summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2019-04-17 10:31:39 -0400
committerGitHub <noreply@github.com>2019-04-17 10:31:39 -0400
commit80d6737382c43dff10358198b5a4cccf3b802cfc (patch)
treeca6c7a56a2f8cc19582ae64f86428ee40aec145e
parent490be41b20ec4bb4a81837e73eb6ea9bfcea7a8a (diff)
parent0c224439ad98b0379818a7c09e3249cbfd0ecb42 (diff)
downloadsdl_android-80d6737382c43dff10358198b5a4cccf3b802cfc.tar.gz
Merge pull request #1015 from smartdevicelink/release/4.8.0-rc1
Release 4.8.0
-rw-r--r--.gitignore6
-rw-r--r--.travis.yml6
-rw-r--r--CHANGELOG.md39
-rw-r--r--JavaSuiteFolderStructure.pngbin0 -> 18360 bytes
-rw-r--r--LICENSE2
-rw-r--r--README.md85
-rw-r--r--VERSION1
-rw-r--r--android/README.md35
-rw-r--r--android/build.gradle (renamed from build.gradle)0
-rw-r--r--android/gradle.properties (renamed from gradle.properties)0
-rw-r--r--android/gradle/wrapper/gradle-wrapper.jar (renamed from gradle/wrapper/gradle-wrapper.jar)bin53636 -> 53636 bytes
-rw-r--r--android/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xandroid/gradlew (renamed from gradlew)0
-rw-r--r--android/gradlew.bat (renamed from gradlew.bat)0
-rwxr-xr-xandroid/hello_sdl_android/build.gradle (renamed from hello_sdl_android/build.gradle)0
-rwxr-xr-xandroid/hello_sdl_android/proguard-rules.pro (renamed from hello_sdl_android/proguard-rules.pro)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/AndroidManifest.xml (renamed from hello_sdl_android/src/main/AndroidManifest.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java (renamed from hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java (renamed from hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlRouterService.java (renamed from hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlRouterService.java)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java262
-rwxr-xr-xandroid/hello_sdl_android/src/main/res.zip (renamed from hello_sdl_android/src/main/res.zip)bin71117 -> 71117 bytes
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/drawable/sdl.png (renamed from hello_sdl_android/src/main/res/drawable/sdl.png)bin3274 -> 3274 bytes
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/layout/activity_main.xml (renamed from hello_sdl_android/src/main/res/layout/activity_main.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/menu/main.xml (renamed from hello_sdl_android/src/main/res/menu/main.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/mipmap-hdpi/ic_launcher.png (renamed from hello_sdl_android/src/main/res/mipmap-hdpi/ic_launcher.png)bin6614 -> 6614 bytes
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/mipmap-mdpi/ic_launcher.png (renamed from hello_sdl_android/src/main/res/mipmap-mdpi/ic_launcher.png)bin3515 -> 3515 bytes
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/mipmap-xhdpi/ic_launcher.png (renamed from hello_sdl_android/src/main/res/mipmap-xhdpi/ic_launcher.png)bin9073 -> 9073 bytes
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/mipmap-xxhdpi/ic_launcher.png (renamed from hello_sdl_android/src/main/res/mipmap-xxhdpi/ic_launcher.png)bin17100 -> 17100 bytes
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/mipmap-xxxhdpi/ic_launcher.png (renamed from hello_sdl_android/src/main/res/mipmap-xxxhdpi/ic_launcher.png)bin25896 -> 25896 bytes
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/values-v11/styles.xml (renamed from hello_sdl_android/src/main/res/values-v11/styles.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/values-v14/styles.xml (renamed from hello_sdl_android/src/main/res/values-v14/styles.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/values-w820dp/dimens.xml (renamed from hello_sdl_android/src/main/res/values-w820dp/dimens.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/values/dimens.xml (renamed from hello_sdl_android/src/main/res/values/dimens.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/values/strings.xml (renamed from hello_sdl_android/src/main/res/values/strings.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/values/styles.xml (renamed from hello_sdl_android/src/main/res/values/styles.xml)0
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/xml/accessory_filter.xml (renamed from hello_sdl_android/src/main/res/xml/accessory_filter.xml)0
-rw-r--r--android/sdl_android/ROUTER_SERVICE_MESSAGING_PROTOCOL.md (renamed from sdl_android/ROUTER_SERVICE_MESSAGING_PROTOCOL.md)0
-rw-r--r--android/sdl_android/bintray.gradle73
-rw-r--r--android/sdl_android/bintray.properties6
-rw-r--r--android/sdl_android/build.gradle66
-rw-r--r--android/sdl_android/proguard-rules.pro (renamed from sdl_android/proguard-rules.pro)0
-rw-r--r--android/sdl_android/src/androidTest/AndroidManifest.xml (renamed from sdl_android/src/androidTest/AndroidManifest.xml)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/AddCommand.json (renamed from sdl_android/src/androidTest/assets/json/AddCommand.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/AddSubMenu.json (renamed from sdl_android/src/androidTest/assets/json/AddSubMenu.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/Alert.json (renamed from sdl_android/src/androidTest/assets/json/Alert.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/AlertManeuver.json (renamed from sdl_android/src/androidTest/assets/json/AlertManeuver.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/ButtonPress.json (renamed from sdl_android/src/androidTest/assets/json/ButtonPress.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/ChangeRegistration.json (renamed from sdl_android/src/androidTest/assets/json/ChangeRegistration.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/CreateInteractionChoiceSet.json (renamed from sdl_android/src/androidTest/assets/json/CreateInteractionChoiceSet.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/DeleteCommand.json (renamed from sdl_android/src/androidTest/assets/json/DeleteCommand.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/DeleteFile.json (renamed from sdl_android/src/androidTest/assets/json/DeleteFile.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/DeleteInteractionChoiceSet.json (renamed from sdl_android/src/androidTest/assets/json/DeleteInteractionChoiceSet.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/DeleteSubMenu.json (renamed from sdl_android/src/androidTest/assets/json/DeleteSubMenu.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/DiagnosticMessage.json (renamed from sdl_android/src/androidTest/assets/json/DiagnosticMessage.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/DialNumber.json (renamed from sdl_android/src/androidTest/assets/json/DialNumber.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/EndAudioPassThru.json (renamed from sdl_android/src/androidTest/assets/json/EndAudioPassThru.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/GetAppServiceData.json20
-rw-r--r--android/sdl_android/src/androidTest/assets/json/GetDTCs.json (renamed from sdl_android/src/androidTest/assets/json/GetDTCs.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/GetFile.json23
-rw-r--r--android/sdl_android/src/androidTest/assets/json/GetInteriorVehicleData.json (renamed from sdl_android/src/androidTest/assets/json/GetInteriorVehicleData.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/GetSystemCapability.json19
-rw-r--r--android/sdl_android/src/androidTest/assets/json/GetVehicleData.json (renamed from sdl_android/src/androidTest/assets/json/GetVehicleData.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/GetWayPoints.json (renamed from sdl_android/src/androidTest/assets/json/GetWayPoints.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/ListFiles.json (renamed from sdl_android/src/androidTest/assets/json/ListFiles.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/PerformAppServiceInteraction.json19
-rw-r--r--android/sdl_android/src/androidTest/assets/json/PerformAudioPassThru.json (renamed from sdl_android/src/androidTest/assets/json/PerformAudioPassThru.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/PerformInteraction.json (renamed from sdl_android/src/androidTest/assets/json/PerformInteraction.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/PublishAppService.json42
-rw-r--r--android/sdl_android/src/androidTest/assets/json/PutFile.json (renamed from sdl_android/src/androidTest/assets/json/PutFile.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/ReadDID.json (renamed from sdl_android/src/androidTest/assets/json/ReadDID.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json (renamed from sdl_android/src/androidTest/assets/json/RegisterAppInterface.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/ResetGlobalProperties.json (renamed from sdl_android/src/androidTest/assets/json/ResetGlobalProperties.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/ScrollableMessage.json (renamed from sdl_android/src/androidTest/assets/json/ScrollableMessage.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SendHapticData.json (renamed from sdl_android/src/androidTest/assets/json/SendHapticData.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SendLocation.json (renamed from sdl_android/src/androidTest/assets/json/SendLocation.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SetAppIcon.json (renamed from sdl_android/src/androidTest/assets/json/SetAppIcon.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SetDisplayLayout.json (renamed from sdl_android/src/androidTest/assets/json/SetDisplayLayout.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SetGlobalProperties.json (renamed from sdl_android/src/androidTest/assets/json/SetGlobalProperties.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SetInteriorVehicleData.json (renamed from sdl_android/src/androidTest/assets/json/SetInteriorVehicleData.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SetMediaClockTimer.json (renamed from sdl_android/src/androidTest/assets/json/SetMediaClockTimer.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/Show.json (renamed from sdl_android/src/androidTest/assets/json/Show.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/ShowConstantTBT.json (renamed from sdl_android/src/androidTest/assets/json/ShowConstantTBT.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/Slider.json (renamed from sdl_android/src/androidTest/assets/json/Slider.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/Speak.json (renamed from sdl_android/src/androidTest/assets/json/Speak.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/StreamRPC.json (renamed from sdl_android/src/androidTest/assets/json/StreamRPC.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SubscribeButton.json (renamed from sdl_android/src/androidTest/assets/json/SubscribeButton.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json (renamed from sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SubscribeWayPoints.json (renamed from sdl_android/src/androidTest/assets/json/SubscribeWayPoints.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SystemRequest.json (renamed from sdl_android/src/androidTest/assets/json/SystemRequest.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/UnregisterAppInterface.json (renamed from sdl_android/src/androidTest/assets/json/UnregisterAppInterface.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/UnsubscribeButton.json (renamed from sdl_android/src/androidTest/assets/json/UnsubscribeButton.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json (renamed from sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/UnsubscribeWayPoints.json (renamed from sdl_android/src/androidTest/assets/json/UnsubscribeWayPoints.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/json/UpdateTurnList.json (renamed from sdl_android/src/androidTest/assets/json/UpdateTurnList.json)0
-rw-r--r--android/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml7720
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/AndroidTestCase2.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/AndroidTestCase2.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/SdlConnection/SdlConnectionTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/SdlConnection/SdlConnectionTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java393
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java681
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java507
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java182
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java135
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java242
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java546
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java286
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java73
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java373
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/WiProProtocolTests.java381
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java194
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Config.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/Config.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/JsonUtils.java251
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Logger.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/Logger.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/NullValues.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/NullValues.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SampleRpc.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/SampleRpc.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java44
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlUnitTestContants.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlUnitTestContants.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java1225
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java3585
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java392
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/encoder/EncoderUtilsTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/encoder/EncoderUtilsTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/json/rpc/JsonFileReader.java57
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java105
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataControlFrameTypeTests.java162
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataTests.java116
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameTypeTests.java117
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/MessageTypeTests.java61
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/SessionTypeTests.java125
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java69
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java142
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java1102
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java39
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java702
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java467
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java100
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java102
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceCapabilityTest.java137
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceDataTests.java118
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceManifestTests.java148
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceRecordTests.java107
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServicesCapabilitiesTests.java143
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java78
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java137
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java93
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java82
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java113
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CloudAppPropertiesTests.java104
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java82
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java70
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java69
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java89
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java116
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java172
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java76
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java87
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java151
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java84
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java109
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java105
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java70
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java76
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java96
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceDataTests.java121
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceManifestTests.java30
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java64
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationInstructionTests.java134
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceDataTests.java143
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceManifestTests.java64
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java84
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java64
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java90
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java76
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java104
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java124
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java66
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java80
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java81
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java108
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java69
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java89
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java56
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java69
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java68
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java85
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java112
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherDataTests.java189
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java142
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceManifestTests.java84
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AmbientLightStatusTests.java97
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java111
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java111
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppServiceTypeTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingIndicatorTests.java80
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingStateTests.java76
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioTypeTests.java68
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/BitsPerSampleTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonEventModeTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonNameTests.java242
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonPressModeTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CarModeStatusTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CharacterSetTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CompassDirectionTests.java95
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ComponentVolumeStatusTests.java87
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DefrostZoneTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DefrostZoneTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DeviceLevelStatusTests.java87
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DimensionTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DirectionTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java107
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DriverDistractionStateTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ECallConfirmationStatusTests.java91
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ElectronicParkBrakeStatusTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ElectronicParkBrakeStatusTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/EmergencyEventTypeTests.java91
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FileTypeTests.java95
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelCutoffStatusTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelTypeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelTypeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/GlobalPropertyTests.java91
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiLevelTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiZoneCapabilitiesTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HybridAppPreferenceTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStableStatusTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStatusTests.java87
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java115
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageTypeTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/InteractionModeTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/JingleTests.java83
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardEventTests.java83
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardLayoutTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeypressModeTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LanguageTests.java220
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LayoutModeTests.java84
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LockScreenStatusTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageCushionTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageCushionTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaClockFormatTests.java91
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaTypeTests.java77
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/NavigationActionTests.java92
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/NavigationJunctionTests.java95
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeQualificationStatusTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeStatusTests.java99
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrerecordedSpeechTests.java83
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrndlTests.java128
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioBandTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioBandTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioStateTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioStateTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java153
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ResultTests.java203
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SamplingRateTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java176
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ServiceUpdateReasonTests.java84
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SoftButtonTypeTests.java76
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SpeechCapabilitiesTests.java84
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemActionTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemCapabilityTypeTests.java123
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemContextTests.java83
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TPMSTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TPMSTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TbtStateTests.java103
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextAlignmentTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java178
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TouchTypeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TouchTypeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TriggerSourceTests.java76
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TurnSignalTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TurnSignalTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/UpdateModeTests.java83
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataEventStatusTests.java83
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataNotificationStatusTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataResultCodeTests.java99
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataStatusTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java187
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VentilationModeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VentilationModeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingCodecTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingCodecTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingProtocolTests.java81
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingStateTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingStateTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VrCapabilitiesTests.java69
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WarningLightStatusTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WiperStatusTests.java123
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java68
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppServiceDataTests.java73
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java46
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java73
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java70
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java91
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java69
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java73
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java73
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java85
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java26
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java78
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemCapabilityUpdatedTests.java73
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java133
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java68
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java81
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java499
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java137
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java122
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java123
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java158
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java104
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java115
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java98
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java97
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java97
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java97
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java119
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java107
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetCloudAppPropertiesTests.java46
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java105
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java132
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java101
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java235
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java128
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java157
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java187
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java107
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java149
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java109
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java218
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java108
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java125
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java145
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java98
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetCloudAppPropertiesTests.java46
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java121
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java168
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java189
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java175
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java187
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java129
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java105
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java98
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java230
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java123
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java100
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java237
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java125
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java97
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java47
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java97
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java110
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java46
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetCloudAppPropertiesResponseTests.java42
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java108
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java118
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java577
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java110
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java99
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java110
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java103
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java97
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java109
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java268
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetCloudAppPropertiesResponseTests.java42
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java150
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java94
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java353
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java74
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java355
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java73
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java174
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java86
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java70
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockStreamListener.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockStreamListener.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java509
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java55
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java54
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java124
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java63
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java63
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java79
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java43
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java50
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java98
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java80
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/WiFiSocketFactoryTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/WiFiSocketFactoryTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java96
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java28
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DeviceUtil.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DeviceUtil.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java77
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java46
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java33
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AppServiceFactory.java75
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java431
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java699
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java (renamed from sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java)0
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java125
-rw-r--r--android/sdl_android/src/androidTest/res/raw/test_audio_square_250hz_80amp_1s.mp3 (renamed from sdl_android/src/androidTest/res/raw/test_audio_square_250hz_80amp_1s.mp3)bin18803 -> 18803 bytes
-rw-r--r--android/sdl_android/src/main/AndroidManifest.xml (renamed from sdl_android/src/main/AndroidManifest.xml)0
-rw-r--r--android/sdl_android/src/main/aidl/com/smartdevicelink/protocol/SdlPacket.aidl (renamed from sdl_android/src/main/aidl/com/smartdevicelink/protocol/SdlPacket.aidl)0
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java661
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java829
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java309
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java (renamed from sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java)0
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java272
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java403
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/haptic/HapticInterfaceManager.java (renamed from sdl_android/src/main/java/com/smartdevicelink/haptic/HapticInterfaceManager.java)0
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java639
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java1054
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java53
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java122
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java168
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderListener.java58
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java479
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java278
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java312
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java168
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java138
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java222
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java146
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java321
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java161
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java57
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java50
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java56
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java65
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java641
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/AbstractProtocol.java193
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java70
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java695
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java259
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java90
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java52
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java161
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java1030
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java63
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java2068
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java8204
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java223
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java65
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java39
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java63
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java278
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java337
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java (renamed from sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java)0
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java500
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java155
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java585
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java71
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java (renamed from sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java)0
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java870
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java (renamed from sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java)0
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransport.java (renamed from sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransport.java)0
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java265
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java350
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java725
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java493
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java3643
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java191
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java153
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java559
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportConfig.java115
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java823
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java456
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java235
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java906
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java135
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java239
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteAraryMessageAssembler.java113
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java157
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/WiFiSocketFactory.java127
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java191
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java48
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java177
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java173
-rw-r--r--android/sdl_android/src/main/res/drawable-hdpi/ic_sdl.png (renamed from sdl_android/src/main/res/drawable-hdpi/ic_sdl.png)bin3665 -> 3665 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-hdpi/sdl_lockscreen_icon.png (renamed from sdl_android/src/main/res/drawable-hdpi/sdl_lockscreen_icon.png)bin2570 -> 2570 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-hdpi/sdl_tray_icon.png (renamed from sdl_android/src/main/res/drawable-hdpi/sdl_tray_icon.png)bin938 -> 938 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-mdpi/ic_sdl.png (renamed from sdl_android/src/main/res/drawable-mdpi/ic_sdl.png)bin2290 -> 2290 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png (renamed from sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png)bin1791 -> 1791 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-mdpi/sdl_tray_icon.png (renamed from sdl_android/src/main/res/drawable-mdpi/sdl_tray_icon.png)bin688 -> 688 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-mdpi/transparent.png (renamed from sdl_android/src/main/res/drawable-mdpi/transparent.png)bin980 -> 980 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xhdpi/ic_sdl.png (renamed from sdl_android/src/main/res/drawable-xhdpi/ic_sdl.png)bin4759 -> 4759 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png (renamed from sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png)bin3487 -> 3487 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xhdpi/sdl_tray_icon.png (renamed from sdl_android/src/main/res/drawable-xhdpi/sdl_tray_icon.png)bin1211 -> 1211 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xxhdpi/ic_sdl.png (renamed from sdl_android/src/main/res/drawable-xxhdpi/ic_sdl.png)bin7517 -> 7517 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png (renamed from sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png)bin5172 -> 5172 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xxhdpi/sdl_tray_icon.png (renamed from sdl_android/src/main/res/drawable-xxhdpi/sdl_tray_icon.png)bin2024 -> 2024 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xxxhdpi/ic_sdl.png (renamed from sdl_android/src/main/res/drawable-xxxhdpi/ic_sdl.png)bin13699 -> 13699 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png (renamed from sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png)bin6666 -> 6666 bytes
-rw-r--r--android/sdl_android/src/main/res/drawable-xxxhdpi/sdl_tray_icon.png (renamed from sdl_android/src/main/res/drawable-xxxhdpi/sdl_tray_icon.png)bin2594 -> 2594 bytes
-rw-r--r--android/sdl_android/src/main/res/layout/activity_sdllock_screen.xml (renamed from sdl_android/src/main/res/layout/activity_sdllock_screen.xml)0
-rw-r--r--android/sdl_android/src/main/res/values/sdl.xml8
-rw-r--r--android/sdl_android/src/main/res/values/strings.xml (renamed from sdl_android/src/main/res/values/strings.xml)0
-rw-r--r--android/sdl_android/src/main/res/xml/accessory_filter.xml (renamed from sdl_android/src/main/res/xml/accessory_filter.xml)0
-rw-r--r--android/sdl_android/src/test/java/com/smartdevicelink/ExampleUnitTest.java17
-rw-r--r--android/sdl_android/src/test/java/com/smartdevicelink/haptic/HapticInterfaceManagerTest.java173
-rw-r--r--android/settings.gradle (renamed from settings.gradle)0
-rw-r--r--base/README.md6
-rw-r--r--base/src/main/java/android/os/AsyncTask.java26
-rw-r--r--base/src/main/java/android/os/Parcel.java58
-rw-r--r--base/src/main/java/android/os/Parcelable.java30
-rw-r--r--base/src/main/java/android/util/Log.java70
-rw-r--r--base/src/main/java/com/livio/BSON/BsonEncoder.java118
-rw-r--r--base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java40
-rw-r--r--base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java94
-rw-r--r--base/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java482
-rw-r--r--base/src/main/java/com/smartdevicelink/exception/SdlException.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/exception/SdlExceptionCause.java56
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java213
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java35
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java114
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/CompletionListener.java41
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java103
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java43
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java378
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/file/MultipleFileCompletionListener.java45
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java36
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java267
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java177
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java386
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java51
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java73
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java101
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java99
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java392
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java607
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java923
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java303
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java126
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java43
-rw-r--r--base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java158
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java149
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java75
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java58
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java39
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java182
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/SdlPacket.java469
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java145
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java51
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java1450
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java140
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java73
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java87
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java201
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java51
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java50
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java169
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java57
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java81
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java211
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java358
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java332
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java70
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java50
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java56
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java39
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java52
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java52
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java46
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/constants/Names.java537
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java (renamed from sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java36
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java417
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java40
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java266
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java42
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java (renamed from sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java37
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java262
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java69
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java226
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java200
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java377
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java127
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java84
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java130
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java138
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java259
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java139
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java134
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java181
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java146
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java156
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java293
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java193
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java181
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java139
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java297
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java260
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java406
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java214
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java136
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java136
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java75
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java182
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java70
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java117
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java108
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java246
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java137
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java124
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java117
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java138
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java129
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java171
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java353
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java156
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java81
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java86
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java262
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java128
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java165
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThru.java82
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java128
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java99
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java524
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java101
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java113
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java81
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java66
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java149
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java91
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java158
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java143
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java121
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java119
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java110
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java95
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java543
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java375
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java69
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java99
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java135
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java138
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java122
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java (renamed from sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java119
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java150
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java147
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java128
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java120
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java170
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java148
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java109
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java89
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java158
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ListFiles.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java125
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java112
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java110
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java111
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java295
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceManifest.java46
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java182
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java147
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java189
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java93
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java66
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java200
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java220
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java249
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java112
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java93
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java193
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java188
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java142
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java111
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java221
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java106
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java89
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java131
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java146
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnLockScreenStatus.java105
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java121
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java100
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnSdlChoiceChosen.java189
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnStreamRPC.java66
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java392
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java111
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java128
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java585
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java66
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java139
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java132
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java85
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java357
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java398
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java117
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java128
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java58
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java108
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java91
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java85
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java406
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java123
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java173
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java343
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java293
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java211
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java189
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java74
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java (renamed from sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java738
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java458
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java189
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java146
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java118
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java200
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java192
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java370
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java378
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java126
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java87
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java (renamed from sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java234
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java129
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppPropertiesResponse.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java191
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java120
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java310
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java93
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java94
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java336
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java580
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java304
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java145
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java154
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java266
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java94
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java176
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java181
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java199
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java159
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java85
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/StreamRPCResponse.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java152
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java867
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java517
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPoints.java46
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java61
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java118
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java148
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java66
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java126
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java100
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java143
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java192
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java192
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java120
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java200
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java125
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java117
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterface.java70
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java130
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java853
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java519
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPoints.java46
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java61
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java128
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java114
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java173
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java95
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java85
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java129
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java152
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java389
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java164
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java134
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AmbientLightStatus.java63
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java98
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java129
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppServiceType.java59
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingIndicator.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingState.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioType.java60
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/BitsPerSample.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java256
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonPressMode.java66
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CharacterSet.java55
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CompassDirection.java84
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ComponentVolumeStatus.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DefrostZone.java48
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeliveryMode.java47
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeviceLevelStatus.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Dimension.java81
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Direction.java49
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java47
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java126
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java46
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DriverDistractionState.java60
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ECallConfirmationStatus.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ElectronicParkBrakeStatus.java69
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/EmergencyEventType.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FileType.java75
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelCutoffStatus.java63
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelType.java62
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/GlobalProperty.java85
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java101
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HmiZoneCapabilities.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HybridAppPreference.java47
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStableStatus.java61
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStatus.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java120
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageType.java60
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/InteractionMode.java89
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Jingle.java62
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardEvent.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardLayout.java50
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java59
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Language.java281
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LayoutMode.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java165
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java50
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LockScreenStatus.java62
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java52
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java50
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java55
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java157
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaType.java54
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MetadataType.java127
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java50
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/NavigationAction.java62
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/NavigationJunction.java89
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PRNDL.java101
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeQualificationStatus.java73
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java171
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrerecordedSpeech.java57
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java89
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioBand.java47
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioState.java51
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RequestType.java123
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Result.java230
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SamplingRate.java89
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlConnectionState.java37
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java118
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java37
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java56
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ServiceUpdateReason.java80
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SoftButtonType.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SpeechCapabilities.java83
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java941
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java49
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemAction.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java497
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemContext.java98
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TBTState.java101
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TPMS.java82
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TemperatureUnit.java45
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextAlignment.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java197
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TouchType.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TriggerSource.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TurnSignal.java66
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/UpdateMode.java73
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataEventStatus.java63
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataNotificationStatus.java69
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java96
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataStatus.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java179
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VentilationMode.java48
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingCodec.java81
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingProtocol.java75
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingState.java54
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VrCapabilities.java73
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WayPointType.java46
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WiperStatus.java129
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java91
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java86
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCNotificationListener.java39
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCRequestListener.java50
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java84
-rw-r--r--base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java122
-rw-r--r--base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java36
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java113
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java38
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java275
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingCodec.java (renamed from sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingCodec.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java (renamed from sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java (renamed from sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java503
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java216
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/DiagLevel.java92
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/ISTListener.java36
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/Mime.java131
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java117
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/SdlTrace.java452
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/enums/DetailLevel.java47
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/enums/InterfaceActivityDirection.java46
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/enums/Mod.java49
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/CustomTransport.java171
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java53
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/ITransportListener.java48
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/SdlPsm.java292
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/SiphonServer.java416
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/TransportCallback.java44
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/TransportConstants.java294
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/TransportInterface.java47
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/TransportManager.java215
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java155
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/WebSocketServer.java199
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/enums/TransportType.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java111
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java163
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java (renamed from sdl_android/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java)0
-rw-r--r--base/src/main/java/com/smartdevicelink/util/BitConverter.java147
-rw-r--r--base/src/main/java/com/smartdevicelink/util/ByteEnumer.java91
-rw-r--r--base/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java56
-rw-r--r--base/src/main/java/com/smartdevicelink/util/DebugTool.java386
-rw-r--r--base/src/main/java/com/smartdevicelink/util/FileUtls.java91
-rw-r--r--base/src/main/java/com/smartdevicelink/util/HttpRequestTask.java211
-rw-r--r--base/src/main/java/com/smartdevicelink/util/IConsole.java41
-rw-r--r--base/src/main/java/com/smartdevicelink/util/NativeLogTool.java143
-rw-r--r--base/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java94
-rw-r--r--base/src/main/java/com/smartdevicelink/util/Version.java106
-rw-r--r--base/src/main/java/org/json/JSON.java116
-rw-r--r--base/src/main/java/org/json/JSONArray.java626
-rw-r--r--base/src/main/java/org/json/JSONException.java58
-rw-r--r--base/src/main/java/org/json/JSONObject.java829
-rw-r--r--base/src/main/java/org/json/JSONStringer.java432
-rw-r--r--base/src/main/java/org/json/JSONTokener.java611
-rw-r--r--baseAndroid/README.md6
l---------baseAndroid/src/main/java/com/smartdevicelink/Dispatcher1
l---------baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/exception1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSubManager.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/CompletionListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/audio1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/file1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/permission1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/screen1
l---------baseAndroid/src/main/java/com/smartdevicelink/managers/video1
l---------baseAndroid/src/main/java/com/smartdevicelink/marshal1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacket.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/protocol/enums1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/IProxyListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCMessage.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCNotification.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCRequest.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCResponse.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCStruct.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/callbacks1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/constants1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/proxy/rpc1
l---------baseAndroid/src/main/java/com/smartdevicelink/security1
l---------baseAndroid/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/streaming/IStreamListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/streaming/audio1
l---------baseAndroid/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/trace/DiagLevel.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/trace/ISTListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/trace/Mime.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/trace/enums1
l---------baseAndroid/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/transport/ITransportListener.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/transport/SdlPsm.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/transport/SiphonServer.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/transport/TransportConstants.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/transport/enums1
l---------baseAndroid/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/BitConverter.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/ByteEnumer.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/DebugTool.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/FileUtls.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/HttpRequestTask.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/IConsole.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/NativeLogTool.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java1
l---------baseAndroid/src/main/java/com/smartdevicelink/util/Version.java1
-rw-r--r--gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xhello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java259
-rwxr-xr-xhello_sdl_java/assets/images/sdl.pngbin0 -> 3274 bytes
-rwxr-xr-xhello_sdl_java/assets/images/sdl_s_green.pngbin0 -> 25896 bytes
-rw-r--r--hello_sdl_java/build.gradle35
-rw-r--r--hello_sdl_java/gradle/wrapper/gradle-wrapper.jarbin0 -> 56172 bytes
-rw-r--r--hello_sdl_java/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xhello_sdl_java/gradlew172
-rw-r--r--hello_sdl_java/gradlew.bat84
-rw-r--r--hello_sdl_java/settings.gradle4
-rw-r--r--hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java96
-rw-r--r--hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java239
l---------hello_sdl_java_ee/assets1
-rw-r--r--hello_sdl_java_ee/build.gradle26
-rw-r--r--hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.jarbin0 -> 56172 bytes
-rw-r--r--hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xhello_sdl_java_ee/gradlew172
-rw-r--r--hello_sdl_java_ee/gradlew.bat84
-rw-r--r--hello_sdl_java_ee/settings.gradle3
-rw-r--r--hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java51
-rw-r--r--hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java207
-rw-r--r--javaEE/README.md25
-rw-r--r--javaEE/bintray.gradle97
-rw-r--r--javaEE/bintray.properties6
-rw-r--r--javaEE/build.gradle79
-rw-r--r--javaEE/gradle/wrapper/gradle-wrapper.jarbin0 -> 55190 bytes
-rw-r--r--javaEE/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xjavaEE/gradlew172
-rw-r--r--javaEE/gradlew.bat84
-rw-r--r--javaEE/settings.gradle1
-rw-r--r--javaSE/README.md25
-rw-r--r--javaSE/bintray.gradle97
-rw-r--r--javaSE/bintray.properties6
-rw-r--r--javaSE/build.gradle79
-rw-r--r--javaSE/gradle/wrapper/gradle-wrapper.jarbin0 -> 55190 bytes
-rw-r--r--javaSE/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xjavaSE/gradlew172
-rw-r--r--javaSE/gradlew.bat84
-rw-r--r--javaSE/settings.gradle2
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/BuildConfig.java36
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java707
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java52
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java102
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java125
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java188
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java1329
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java55
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java48
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java54
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java62
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java36
-rw-r--r--sdl_android/bintray.gradle71
-rw-r--r--sdl_android/bintray.properties8
-rw-r--r--sdl_android/build.gradle60
-rw-r--r--sdl_android/src/androidTest/assets/json/GetSystemCapability.json18
-rw-r--r--sdl_android/src/androidTest/assets/xml/MOBILE_API.xml7015
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java386
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java681
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java485
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java122
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java239
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java545
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java282
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java372
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/protocol/WiProProtocolTests.java385
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java194
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/JsonUtils.java214
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java50
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java1053
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java2919
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java393
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/json/rpc/JsonFileReader.java58
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java105
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataControlFrameTypeTests.java162
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataTests.java116
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameTypeTests.java117
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/MessageTypeTests.java61
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/SessionTypeTests.java125
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java69
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java142
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java1103
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java41
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java654
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java246
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java100
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java102
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java78
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java137
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java93
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java82
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java113
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java82
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java70
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java69
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java89
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java116
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java172
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java76
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java87
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java151
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java84
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java109
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java105
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java70
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java76
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java96
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java64
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java71
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java84
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java64
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java90
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java76
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java104
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java108
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java66
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java81
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java81
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java108
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java69
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java89
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java56
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java69
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java70
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java85
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AmbientLightStatusTests.java97
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java111
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java111
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingIndicatorTests.java80
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingStateTests.java76
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioTypeTests.java68
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/BitsPerSampleTests.java71
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonEventModeTests.java71
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonNameTests.java242
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonPressModeTests.java71
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CarModeStatusTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CharacterSetTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CompassDirectionTests.java95
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ComponentVolumeStatusTests.java87
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DeviceLevelStatusTests.java87
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DimensionTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java107
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DriverDistractionStateTests.java71
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ECallConfirmationStatusTests.java91
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/EmergencyEventTypeTests.java91
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FileTypeTests.java95
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelCutoffStatusTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/GlobalPropertyTests.java91
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiLevelTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiZoneCapabilitiesTests.java71
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStableStatusTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStatusTests.java87
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java115
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageTypeTests.java71
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/InteractionModeTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/JingleTests.java83
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardEventTests.java83
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardLayoutTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeypressModeTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LanguageTests.java220
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LayoutModeTests.java84
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LockScreenStatusTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaClockFormatTests.java91
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeQualificationStatusTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeStatusTests.java99
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrerecordedSpeechTests.java83
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrndlTests.java128
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java148
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ResultTests.java203
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SamplingRateTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java174
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SoftButtonTypeTests.java76
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SpeechCapabilitiesTests.java84
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemActionTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemCapabilityTypeTests.java119
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemContextTests.java83
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TbtStateTests.java103
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextAlignmentTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java178
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TriggerSourceTests.java76
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/UpdateModeTests.java83
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataEventStatusTests.java83
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataNotificationStatusTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataResultCodeTests.java99
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataStatusTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java183
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingProtocolTests.java82
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VrCapabilitiesTests.java69
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WarningLightStatusTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WiperStatusTests.java123
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java68
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java46
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java73
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java70
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java91
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java69
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java73
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java73
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java85
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java26
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java78
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java133
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java68
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java81
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java499
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java137
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java122
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java123
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java158
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java104
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java115
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java98
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java97
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java97
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java97
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java119
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java105
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java95
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java235
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java157
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java187
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java149
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java109
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java218
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java108
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java125
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java145
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java98
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java121
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java168
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java124
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java175
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java187
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java129
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java105
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java98
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java230
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java123
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java100
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java231
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java125
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java97
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java47
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java97
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java110
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java46
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java108
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java577
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java110
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java110
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java97
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java109
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java269
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java75
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java150
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java94
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java353
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java355
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java73
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java175
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java92
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java71
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java511
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java57
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java54
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java124
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java63
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java63
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java43
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java50
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java97
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java70
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java96
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java28
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java77
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java46
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java32
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java432
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java335
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java129
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java9
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java63
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java41
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java619
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java790
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java298
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java241
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java400
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/exception/SdlException.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/exception/SdlExceptionCause.java25
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/BaseSubManager.java83
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/CompletionListener.java10
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java560
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java927
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java21
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java72
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java90
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java137
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderListener.java27
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java447
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java246
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java280
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java434
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/file/MultipleFileCompletionListener.java14
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java83
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java114
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java289
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java130
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java20
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java42
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java70
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java350
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java68
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java361
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java568
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java272
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java97
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java895
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java621
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java127
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/AbstractProtocol.java162
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java118
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java44
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java56
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java8
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java151
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java437
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java97
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java1437
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java660
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java106
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java42
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java56
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java37
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java162
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java20
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java37
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java228
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java59
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java21
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/IProxyListener.java19
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java130
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/RPCMessage.java129
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/RPCNotification.java29
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequest.java50
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java999
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/RPCResponse.java183
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java32
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java322
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java2036
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java7696
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java192
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java34
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java225
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java39
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java7
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java19
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java25
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java33
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java8
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java21
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java21
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java15
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/constants/Names.java506
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java48
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java359
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java9
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java229
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java11
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java6
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java231
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java38
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java195
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java36
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java173
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java346
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java96
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java53
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java150
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java115
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java130
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java266
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java166
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java150
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java107
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java41
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java266
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java229
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java374
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java183
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java107
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java44
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java151
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java39
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java86
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java77
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java215
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java106
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java37
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java93
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java86
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java107
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java34
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java98
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java37
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java145
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java322
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java126
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java50
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java55
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java36
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java237
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java101
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java138
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThru.java51
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java37
-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/FuelRange.java66
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java493
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java70
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java118
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java60
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java89
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java88
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java59
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java64
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java495
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java316
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java34
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java38
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java68
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java104
-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/HeadLampStatus.java88
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java119
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Image.java116
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java103
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java93
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java144
-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/ListFiles.java45
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java94
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java81
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java79
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java80
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java151
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java116
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java158
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java62
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java218
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java81
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java62
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java154
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java157
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java111
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java80
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java190
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java75
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java58
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java100
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java115
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnLockScreenStatus.java74
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java90
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java69
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnSdlChoiceChosen.java158
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnStreamRPC.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java361
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java80
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java97
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java531
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java108
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java326
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java367
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java86
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java99
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java27
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java77
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java367
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java92
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java141
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java311
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java261
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java180
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java158
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java43
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java707
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java429
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java158
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java115
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java87
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java172
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java148
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java339
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java347
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java95
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java86
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java203
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java36
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java98
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java160
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java89
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java279
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java62
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java63
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java196
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Show.java549
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java273
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java36
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java114
-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/Slider.java235
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java63
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java146
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java150
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java168
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java48
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java115
-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/StreamRPCResponse.java33
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java121
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java811
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java469
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPoints.java15
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java30
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java78
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java117
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java95
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java69
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java111
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java163
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java165
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java89
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java169
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java94
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java87
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterface.java39
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java99
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java805
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java474
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPoints.java15
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java30
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java97
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java40
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java83
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java142
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java64
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java54
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java99
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AmbientLightStatus.java34
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java67
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java98
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingIndicator.java48
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingState.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioType.java32
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/BitsPerSample.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java36
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java224
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonPressMode.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java39
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CharacterSet.java24
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CompassDirection.java53
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ComponentVolumeStatus.java45
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DefrostZone.java17
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeliveryMode.java16
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeviceLevelStatus.java45
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Dimension.java50
-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/DisplayType.java95
-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/DriverDistractionState.java32
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ECallConfirmationStatus.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ElectronicParkBrakeStatus.java38
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/EmergencyEventType.java41
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FileType.java44
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelCutoffStatus.java32
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelType.java31
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/GlobalProperty.java54
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java70
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/HmiZoneCapabilities.java34
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStableStatus.java30
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStatus.java45
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java89
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageType.java29
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/InteractionMode.java58
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Jingle.java31
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardEvent.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardLayout.java19
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java28
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Language.java250
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LayoutMode.java36
-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/LockScreenStatus.java31
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java21
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java19
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java24
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java126
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MetadataType.java96
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java19
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PRNDL.java70
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeQualificationStatus.java42
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java48
-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/PrerecordedSpeech.java26
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java58
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioBand.java16
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioState.java20
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RequestType.java88
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Result.java199
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SamplingRate.java58
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlConnectionState.java6
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java85
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java6
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java25
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SoftButtonType.java46
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SpeechCapabilities.java52
-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/enums/SupportedSeat.java18
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemAction.java37
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java429
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemContext.java67
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TBTState.java70
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TPMS.java51
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TemperatureUnit.java14
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextAlignment.java33
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java166
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TouchType.java41
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TriggerSource.java47
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TurnSignal.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/UpdateMode.java42
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataEventStatus.java32
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataNotificationStatus.java41
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java65
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataStatus.java36
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java143
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VentilationMode.java17
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingCodec.java50
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingProtocol.java44
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingState.java23
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VrCapabilities.java42
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java34
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WayPointType.java15
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WiperStatus.java98
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java62
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java48
-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/OnRPCNotificationListener.java8
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java53
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java5
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java117
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java82
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/IStreamListener.java7
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java249
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java307
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java506
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java218
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/DiagLevel.java61
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/ISTListener.java5
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/Mime.java100
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java86
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java469
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java124
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/enums/DetailLevel.java16
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/enums/InterfaceActivityDirection.java15
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/trace/enums/Mod.java18
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java554
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java40
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/ITransportListener.java17
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java870
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java265
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java327
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java694
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java490
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/SdlPsm.java261
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java3529
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java164
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java122
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/SiphonServer.java384
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java528
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportConfig.java84
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java819
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/TransportConstants.java263
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java381
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java219
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java873
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java104
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java220
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/enums/TransportType.java29
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteAraryMessageAssembler.java82
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java127
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/utl/WiFiSocketFactory.java96
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java163
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/BitConverter.java116
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/ByteEnumer.java60
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java25
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/DebugTool.java355
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java180
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java22
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/IConsole.java10
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/NativeLogTool.java114
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java179
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java63
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java142
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/Version.java75
-rw-r--r--sdl_android/src/main/res/values/sdl.xml8
-rw-r--r--sdl_android/src/test/java/com/smartdevicelink/ExampleUnitTest.java17
-rw-r--r--sdl_android/src/test/java/com/smartdevicelink/haptic/HapticInterfaceManagerTest.java169
-rw-r--r--third_party.md64
1911 files changed, 157493 insertions, 120047 deletions
diff --git a/.gitignore b/.gitignore
index 48e3fec3f..a87913e43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,12 @@
##############################
# Project Specific
##############################
+javaSE/out/
+javaSE/build/
+javaSE/local.properties
+javaEE/out/
+javaEE/build/
+javaEE/local.properties
##############################
diff --git a/.travis.yml b/.travis.yml
index 22c941f6c..6c25dd665 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -45,7 +45,11 @@ before_script:
script:
- android list target
- - ./gradlew :sdl_android:connectedCheck
+ - ./android/gradlew -p ./android :sdl_android:connectedCheck
+ - ./android/gradlew -p ./android :hello_sdl_android:test
+ - ./javaSE/gradlew -p ./javaSE test
+ - ./hello_sdl_java/gradlew -p ./hello_sdl_java test
+ - ./javaEE/gradlew -p ./javaEE test
before_install:
- echo yes | sdkmanager "build-tools;27.0.3"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c1b7a2b5b..4b8ae8b51 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,34 @@
-# 4.7.2 Release Notes
+# 4.8.0 Release Notes
+
+### Feature
+- Renamed repo to `sdl_java_suite`
+- Complete restructure of project to include all Java based projects (Android, JavaSE, and JavaEE). This included creating base source sets for all projects.
+- [[SDL 0203] Added JavaSE and JavaEE libraries to support embedded, remote, and cloud applications.](https://github.com/smartdevicelink/sdl_android/pull/983)
+- [[SDL 0158] Added new `SetCloudAppProperties`, `GetCloudAppProperties`, new vehicle data item -`cloudAppVehicleID`, and retrieval of auth token sent during `StartServiceACK` for RPC service. ](https://github.com/smartdevicelink/sdl_android/issues/981)
+- [[SDL 0167] Add the new App Services feature. This includes app service types Media, Weather, and Navigation](https://github.com/smartdevicelink/sdl_android/issues/810)
+- [Add support for `TemplateImages` in `ScreenManager`](https://github.com/smartdevicelink/sdl_android/issues/916)
+- [Added ability to access the `RegisterAppInterface` Response message from `SdlManager`](https://github.com/smartdevicelink/sdl_android/issues/928)
+- [[SDL 0208]- Allow developers to block old SDL Head Units from Mobile](https://github.com/smartdevicelink/sdl_android/issues/955)
+- [SDL 0197- Update `SetMediaClockTimer` Initializers](https://github.com/smartdevicelink/sdl_android/issues/856)
+- [[SDL 0196] Add Support for `StaticIcons` to `SDLArtwork`](https://github.com/smartdevicelink/sdl_android/issues/848)
+
+
+### Bug fix
+- [Duplicate send for ButtonPress on v5+](https://github.com/smartdevicelink/sdl_android/issues/1007)
+- [Fixed issue where `SdlManagerListener.onDestroy()` was not being called after transport disconnect when bound to older router services.](https://github.com/smartdevicelink/sdl_android/issues/932)
+ - [Vastly improve AOA USB connection stability especially during disconnect/reconnect.](https://github.com/smartdevicelink/sdl_android/issues/924)
+- [Fix legacy BT disconnect issue that left library listening for BT connection](https://github.com/smartdevicelink/sdl_android/pull/935)
+- [Fixed the `ScreenManager` not being able to clear images](https://github.com/smartdevicelink/sdl_android/pull/954)
+- [Fixed issue with `ScreenManager` where it would not call completion listener if TextAndGraphicManager was not dirty](https://github.com/smartdevicelink/sdl_android/issues/930)
+- [Make `SystemCapabilityManager` query only for queryable capabilities](https://github.com/smartdevicelink/sdl_android/pull/966)
+ - Fix potential NPEs in `SdlRouterService`: [1](https://github.com/smartdevicelink/sdl_android/issues/951), [2](https://github.com/smartdevicelink/sdl_android/pull/956), [3](https://github.com/smartdevicelink/sdl_android/pull/957), [4](https://github.com/smartdevicelink/sdl_android/issues/945)
+- [Fixed `VirtualDisplayEncoder` from sending unexpected buffer at startup](https://github.com/smartdevicelink/sdl_android/issues/921)
+- [Fixed issue where `SdlRouterService` wasn't sending EndSession frame with valid hash ID for protocol version >= 5](https://github.com/smartdevicelink/sdl_android/issues/943)
+- [Fixed an issue with the `ScreenManager` submanagers starting at incorrect time](https://github.com/smartdevicelink/sdl_android/pull/938)
+
+### Misc
+- [Remove unnecessary imports](https://github.com/smartdevicelink/sdl_android/issues/923)
+- [Updated incorrect JavaDocs for `UpdateTurnList`](https://github.com/smartdevicelink/sdl_android/issues/1017)
+- [Show warning if default `SdlRouterService` class is used in `SdlReceiver`. ](https://github.com/smartdevicelink/sdl_android/issues/975)
-## Hot Fix
-- Fix legacy router service [issue #925](https://github.com/smartdevicelink/sdl_android/issues/925)
- - Addressed issue in `TransportBroker` that caused previous router service's connection messages to be dropped.
- - Add logic to check router service version and perform appropriate logic.
- - Added check if packet doesn't include a transport record
- - Fixed a parcel issue in the `SdlPacket` class
diff --git a/JavaSuiteFolderStructure.png b/JavaSuiteFolderStructure.png
new file mode 100644
index 000000000..abe2729ea
--- /dev/null
+++ b/JavaSuiteFolderStructure.png
Binary files differ
diff --git a/LICENSE b/LICENSE
index ddda209c2..fdbb4aa63 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2017 - 2018, SmartDeviceLink Consortium, Inc.
+Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/README.md b/README.md
index b5dad034e..33c624aab 100644
--- a/README.md
+++ b/README.md
@@ -9,16 +9,19 @@ SmartDeviceLink (SDL) is a standard set of protocols and messages that connect a
* The [Core](https://github.com/smartdevicelink/sdl_core) component is the software which Vehicle Manufacturers (OEMs) implement in their vehicle head units. Integrating this component into their head unit and HMI based on a set of guidelines and templates enables access to various smartphone applications.
* The optional [SDL Server](https://github.com/smartdevicelink/sdl_server) can be used by Vehicle OEMs to update application policies and gather usage information for connected applications.
* The [iOS](https://github.com/smartdevicelink/sdl_ios) and [Android](https://github.com/smartdevicelink/sdl_android) libraries are implemented by app developers into their applications to enable command and control via the connected head unit.
-
+ * The JavaSE (Embedded) and JavaEE (Cloud) libraries, written in Java, are implemented by app developers into their applications to enable command and control of a connected head unit.
+
Pull Requests Welcome!
To understand if a contribution should be entered as an Android Pull Request (or issue), or an SDL Evolution Proposal, please reference [this document](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals_versus_issues.md).
<a href="http://www.youtube.com/watch?feature=player_embedded&v=AzdQdSCS24M" target="_blank"><img src="http://i.imgur.com/nm8UujD.png?1" alt="SmartDeviceLink" border="10" /></a>
-## Mobile Proxy
+## Client Proxy
+
+The client libraries component of SDL is meant to run on the end user’s smart-device from within SDL enabled apps, as an embedded app, or connected to from the cloud. The libraries allows the apps to connect to SDL enabled head-units and hardware through bluetooth, USB, TCP for Android and cloud and embedded apps can connect through web sockets, Java Beans, and other custom transports. Once the library establishes a connection between the smart device and head-unit through the preferred method of transport, the two components are able to communicate using the SDL defined protocol. The app integrating this library project is then able to expose its functionality to the head-unit through text, media, and other interactive elements.
-The mobile library component of SDL is meant to run on the end user’s smart-device from within SDL enabled apps. The library allows the apps to connect to SDL enabled head-units and hardware through bluetooth, USB, and TCP. Once the library establishes a connection between the smart device and head-unit through the preferred method of transport, the two components are able to communicate using the SDL defined protocol. The app integrating this library project is then able to expose its functionality to the head-unit through text, media, and other interactive elements.
+# SmartDeviceLink Java Suite
## SmartDeviceLink Android
@@ -32,7 +35,7 @@ You can also find some branches that have yet to be merged into this GitHub proj
To compile with the latest release of SDL Android, include the following in your app's `build.gradle` file,
-```
+```sh
repositories {
jcenter()
}
@@ -51,9 +54,79 @@ If you prefer not to use any of the aforementioned dependency managers, you can
Developers using Proguard to shrink and obfuscate their code should be sure to include the following lines in their proguard-rules.pro file:
-```
+```sh
-keep class com.smartdevicelink.** { *; }
-keep class com.livio.** { *; }
# Video streaming apps must add the following line
-keep class ** extends com.smartdevicelink.streaming.video.SdlRemoteDisplay { *; }
-``` \ No newline at end of file
+```
+
+## SmartDeviceLink Java
+
+### JavaSE
+
+The JavaSE project is meant to allow SDL compatibility for embedded applications.
+
+#### Dependency Managers
+
+To compile with the latest release of SDL JavaSE, include the following in your app's `build.gradle` file,
+
+```sh
+repositories {
+ jcenter()
+}
+dependencies {
+ implementation 'com.smartdevicelink:sdl_java_se:4.+'
+}
+```
+
+### JavaEE
+
+The JavaEE project is meant to allow SDL compatibility for web applications.
+
+#### Dependency Managers
+
+To compile with the latest release of SDL JavaEE, include the following in your app's `build.gradle` file,
+
+```sh
+repositories {
+ jcenter()
+}
+dependencies {
+ implementation 'com.smartdevicelink:sdl_java_ee:4.+'
+}
+```
+
+#### Manually building a JAR
+
+If you prefer making a JAR, simply call:
+
+```sh
+gradle build
+```
+from within the project (JavaSE or JavaEE) and a JAR should be generated in the `build/libs` folder
+
+## Java Suite Repo Structure
+
+![Java Suite Folder Structure](JavaSuiteFolderStructure.png)
+
+#### base Folder
+The base folder contains the source set that is shared between all of the compilable projects. This folder does not contain a a compilable project.
+
+#### baseAndroid Folder
+The baseAndroid folder contains symbolic links to files and folders from the base folder. This has been included since the Java Suite refactor is a minor version release and the base folder contains breaking changes for the Android project. This folder does not contain a a compilable project.
+
+#### android Folder
+The android folder contains the SDL Android library as well as the sample project for Android. Both of those are compilable projects.
+
+#### javaSE
+The javaSE folder contains the SDL JavaSE Library. The base folder source set is added as a dependency. This project can be used for embedded or remote SDL applications. It uses a web socket transport by default but can be made to work with other transports via the `CustomTransport`.
+
+###### JavaSE Sample App
+The JavaSE sample app is in the hello_sdl_java folder. It demonstrates an efficient way to structure a Java app using the JavaSE library.
+
+#### javaEE
+The javaEE folder contains the SDL JavaEE library. The JavaSE folder is used as a source set and added as a dependency. This library is based off the JavaSE library and will contain specifics for the JavaEe platform.
+
+###### JavaEE Sample App
+The JavaEE sample app is in the hello_sdl_java_ee folder. Most of the code is commented out since the library and sample app do not include the dependencies of JavaEE due to licensing issues. However, the commented out code demonstrates how to build a Java based app into the JavaEE bean architecture. \ No newline at end of file
diff --git a/VERSION b/VERSION
new file mode 100644
index 000000000..6ca6df113
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+4.8.0 \ No newline at end of file
diff --git a/android/README.md b/android/README.md
new file mode 100644
index 000000000..e6a89c85e
--- /dev/null
+++ b/android/README.md
@@ -0,0 +1,35 @@
+## SmartDeviceLink Android
+
+We're still working on creating documentation for each of these individual repositories, but in the meantime, you can find more information about SmartDeviceLink [here](https://smartdevicelink.com)
+
+### Installation
+
+#### Dependency Managers
+
+To compile with the latest release of SDL Android, include the following in your app's `build.gradle` file,
+
+```
+repositories {
+ jcenter()
+}
+dependencies {
+ implementation 'com.smartdevicelink:sdl_android:4.+'
+}
+```
+
+For Maven or Ivy snippets please look at [Bintray](https://bintray.com/smartdevicelink/sdl_android/sdl_android)
+
+#### Manually
+
+If you prefer not to use any of the aforementioned dependency managers, you can integrate SDL Android into your project manually.
+
+### Proguard Rules
+
+Developers using Proguard to shrink and obfuscate their code should be sure to include the following lines in their proguard-rules.pro file:
+
+```
+-keep class com.smartdevicelink.** { *; }
+-keep class com.livio.** { *; }
+# Video streaming apps must add the following line
+-keep class ** extends com.smartdevicelink.streaming.video.SdlRemoteDisplay { *; }
+``` \ No newline at end of file
diff --git a/build.gradle b/android/build.gradle
index 800d3be0e..800d3be0e 100644
--- a/build.gradle
+++ b/android/build.gradle
diff --git a/gradle.properties b/android/gradle.properties
index aac7c9b46..aac7c9b46 100644
--- a/gradle.properties
+++ b/android/gradle.properties
diff --git a/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar
index 13372aef5..13372aef5 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/android/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..edbfc86a9
--- /dev/null
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sun Apr 8 12:14:33 EDT 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file
diff --git a/gradlew b/android/gradlew
index 9d82f7891..9d82f7891 100755
--- a/gradlew
+++ b/android/gradlew
diff --git a/gradlew.bat b/android/gradlew.bat
index 8a0b282aa..8a0b282aa 100644
--- a/gradlew.bat
+++ b/android/gradlew.bat
diff --git a/hello_sdl_android/build.gradle b/android/hello_sdl_android/build.gradle
index ac8b92278..ac8b92278 100755
--- a/hello_sdl_android/build.gradle
+++ b/android/hello_sdl_android/build.gradle
diff --git a/hello_sdl_android/proguard-rules.pro b/android/hello_sdl_android/proguard-rules.pro
index 7b318e2d1..7b318e2d1 100755
--- a/hello_sdl_android/proguard-rules.pro
+++ b/android/hello_sdl_android/proguard-rules.pro
diff --git a/hello_sdl_android/src/main/AndroidManifest.xml b/android/hello_sdl_android/src/main/AndroidManifest.xml
index 72a191542..72a191542 100755
--- a/hello_sdl_android/src/main/AndroidManifest.xml
+++ b/android/hello_sdl_android/src/main/AndroidManifest.xml
diff --git a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java
index 6fc9203db..6fc9203db 100755
--- a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java
+++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java
diff --git a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java
index 09cf35a82..09cf35a82 100755
--- a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java
+++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java
diff --git a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlRouterService.java b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlRouterService.java
index b4bec8cde..b4bec8cde 100755
--- a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlRouterService.java
+++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlRouterService.java
diff --git a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java
new file mode 100755
index 000000000..b180c851b
--- /dev/null
+++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java
@@ -0,0 +1,262 @@
+package com.sdl.hellosdlandroid;
+
+import android.annotation.SuppressLint;
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.Service;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Build;
+import android.os.IBinder;
+import android.util.Log;
+
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.SdlManager;
+import com.smartdevicelink.managers.SdlManagerListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.TTSChunkFactory;
+import com.smartdevicelink.proxy.rpc.AddCommand;
+import com.smartdevicelink.proxy.rpc.MenuParams;
+import com.smartdevicelink.proxy.rpc.OnCommand;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.Speak;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.TCPTransportConfig;
+import com.smartdevicelink.util.DebugTool;
+
+import java.util.Collections;
+import java.util.Vector;
+
+public class SdlService extends Service {
+
+ private static final String TAG = "SDL Service";
+
+ private static final String APP_NAME = "Hello Sdl";
+ private static final String APP_ID = "8678309";
+
+ private static final String ICON_FILENAME = "hello_sdl_icon.png";
+ private static final String SDL_IMAGE_FILENAME = "sdl_full_image.png";
+
+ private static final String WELCOME_SHOW = "Welcome to HelloSDL";
+ private static final String WELCOME_SPEAK = "Welcome to Hello S D L";
+
+ private static final String TEST_COMMAND_NAME = "Test Command";
+ private static final int TEST_COMMAND_ID = 1;
+
+ private static final int FOREGROUND_SERVICE_ID = 111;
+
+ // TCP/IP transport config
+ // The default port is 12345
+ // The IP is of the machine that is running SDL Core
+ private static final int TCP_PORT = 12345;
+ private static final String DEV_MACHINE_IP_ADDRESS = "192.168.1.78";
+
+ // variable to create and call functions of the SyncProxy
+ private SdlManager sdlManager = null;
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ return null;
+ }
+
+ @Override
+ public void onCreate() {
+ Log.d(TAG, "onCreate");
+ super.onCreate();
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ enterForeground();
+ }
+ }
+
+ // Helper method to let the service enter foreground mode
+ @SuppressLint("NewApi")
+ public void enterForeground() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ NotificationChannel channel = new NotificationChannel(APP_ID, "SdlService", NotificationManager.IMPORTANCE_DEFAULT);
+ NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ if (notificationManager != null) {
+ notificationManager.createNotificationChannel(channel);
+ Notification serviceNotification = new Notification.Builder(this, channel.getId())
+ .setContentTitle("Connected through SDL")
+ .setSmallIcon(R.drawable.ic_sdl)
+ .build();
+ startForeground(FOREGROUND_SERVICE_ID, serviceNotification);
+ }
+ }
+ }
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ startProxy();
+ return START_STICKY;
+ }
+
+ @Override
+ public void onDestroy() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ stopForeground(true);
+ }
+
+ if (sdlManager != null) {
+ sdlManager.dispose();
+ }
+
+ super.onDestroy();
+ }
+
+ private void startProxy() {
+ // This logic is to select the correct transport and security levels defined in the selected build flavor
+ // Build flavors are selected by the "build variants" tab typically located in the bottom left of Android Studio
+ // Typically in your app, you will only set one of these.
+ if (sdlManager == null) {
+ Log.i(TAG, "Starting SDL Proxy");
+ // Enable DebugTool for debug build type
+ if (BuildConfig.DEBUG){
+ DebugTool.enableDebugTool();
+ }
+ BaseTransportConfig transport = null;
+ if (BuildConfig.TRANSPORT.equals("MULTI")) {
+ int securityLevel;
+ if (BuildConfig.SECURITY.equals("HIGH")) {
+ securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH;
+ } else if (BuildConfig.SECURITY.equals("MED")) {
+ securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED;
+ } else if (BuildConfig.SECURITY.equals("LOW")) {
+ securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_LOW;
+ } else {
+ securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF;
+ }
+ transport = new MultiplexTransportConfig(this, APP_ID, securityLevel);
+ } else if (BuildConfig.TRANSPORT.equals("TCP")) {
+ transport = new TCPTransportConfig(TCP_PORT, DEV_MACHINE_IP_ADDRESS, true);
+ } else if (BuildConfig.TRANSPORT.equals("MULTI_HB")) {
+ MultiplexTransportConfig mtc = new MultiplexTransportConfig(this, APP_ID, MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF);
+ mtc.setRequiresHighBandwidth(true);
+ transport = mtc;
+ }
+
+ // The app type to be used
+ Vector<AppHMIType> appType = new Vector<>();
+ appType.add(AppHMIType.MEDIA);
+
+ // The manager listener helps you know when certain events that pertain to the SDL Manager happen
+ // Here we will listen for ON_HMI_STATUS and ON_COMMAND notifications
+ SdlManagerListener listener = new SdlManagerListener() {
+ @Override
+ public void onStart() {
+ // HMI Status Listener
+ sdlManager.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnHMIStatus status = (OnHMIStatus) notification;
+ if (status.getHmiLevel() == HMILevel.HMI_FULL && ((OnHMIStatus) notification).getFirstRun()) {
+ sendCommands();
+ performWelcomeSpeak();
+ performWelcomeShow();
+ }
+ }
+ });
+
+ // Menu Selected Listener
+ sdlManager.addOnRPCNotificationListener(FunctionID.ON_COMMAND, new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnCommand command = (OnCommand) notification;
+ Integer id = command.getCmdID();
+ if(id != null){
+ switch(id){
+ case TEST_COMMAND_ID:
+ showTest();
+ break;
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onDestroy() {
+ SdlService.this.stopSelf();
+ }
+
+ @Override
+ public void onError(String info, Exception e) {
+ }
+ };
+
+ // Create App Icon, this is set in the SdlManager builder
+ SdlArtwork appIcon = new SdlArtwork(ICON_FILENAME, FileType.GRAPHIC_PNG, R.mipmap.ic_launcher, true);
+
+ // The manager builder sets options for your session
+ SdlManager.Builder builder = new SdlManager.Builder(this, APP_ID, APP_NAME, listener);
+ builder.setAppTypes(appType);
+ builder.setTransportType(transport);
+ builder.setAppIcon(appIcon);
+ sdlManager = builder.build();
+ sdlManager.start();
+ }
+ }
+
+ /**
+ * Add commands for the app on SDL.
+ */
+ private void sendCommands(){
+ AddCommand command = new AddCommand();
+ MenuParams params = new MenuParams();
+ params.setMenuName(TEST_COMMAND_NAME);
+ command.setCmdID(TEST_COMMAND_ID);
+ command.setMenuParams(params);
+ command.setVrCommands(Collections.singletonList(TEST_COMMAND_NAME));
+ sdlManager.sendRPC(command);
+ }
+
+ /**
+ * Will speak a sample welcome message
+ */
+ private void performWelcomeSpeak(){
+ sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(WELCOME_SPEAK)));
+ }
+
+ /**
+ * Use the Screen Manager to set the initial screen text and set the image.
+ * Because we are setting multiple items, we will call beginTransaction() first,
+ * and finish with commit() when we are done.
+ */
+ private void performWelcomeShow() {
+ sdlManager.getScreenManager().beginTransaction();
+ sdlManager.getScreenManager().setTextField1(APP_NAME);
+ sdlManager.getScreenManager().setTextField2(WELCOME_SHOW);
+ sdlManager.getScreenManager().setPrimaryGraphic(new SdlArtwork(SDL_IMAGE_FILENAME, FileType.GRAPHIC_PNG, R.drawable.sdl, true));
+ sdlManager.getScreenManager().commit(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ if (success){
+ Log.i(TAG, "welcome show successful");
+ }
+ }
+ });
+ }
+
+ /**
+ * Will show a sample test message on screen as well as speak a sample test message
+ */
+ private void showTest(){
+ sdlManager.getScreenManager().beginTransaction();
+ sdlManager.getScreenManager().setTextField1("Command has been selected");
+ sdlManager.getScreenManager().setTextField2("");
+ sdlManager.getScreenManager().commit(null);
+
+ sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(TEST_COMMAND_NAME)));
+ }
+
+
+}
diff --git a/hello_sdl_android/src/main/res.zip b/android/hello_sdl_android/src/main/res.zip
index 16370f43a..16370f43a 100755
--- a/hello_sdl_android/src/main/res.zip
+++ b/android/hello_sdl_android/src/main/res.zip
Binary files differ
diff --git a/hello_sdl_android/src/main/res/drawable/sdl.png b/android/hello_sdl_android/src/main/res/drawable/sdl.png
index 5cfc0f84a..5cfc0f84a 100755
--- a/hello_sdl_android/src/main/res/drawable/sdl.png
+++ b/android/hello_sdl_android/src/main/res/drawable/sdl.png
Binary files differ
diff --git a/hello_sdl_android/src/main/res/layout/activity_main.xml b/android/hello_sdl_android/src/main/res/layout/activity_main.xml
index 8da613491..8da613491 100755
--- a/hello_sdl_android/src/main/res/layout/activity_main.xml
+++ b/android/hello_sdl_android/src/main/res/layout/activity_main.xml
diff --git a/hello_sdl_android/src/main/res/menu/main.xml b/android/hello_sdl_android/src/main/res/menu/main.xml
index d74718db3..d74718db3 100755
--- a/hello_sdl_android/src/main/res/menu/main.xml
+++ b/android/hello_sdl_android/src/main/res/menu/main.xml
diff --git a/hello_sdl_android/src/main/res/mipmap-hdpi/ic_launcher.png b/android/hello_sdl_android/src/main/res/mipmap-hdpi/ic_launcher.png
index d10bd53b0..d10bd53b0 100755
--- a/hello_sdl_android/src/main/res/mipmap-hdpi/ic_launcher.png
+++ b/android/hello_sdl_android/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/hello_sdl_android/src/main/res/mipmap-mdpi/ic_launcher.png b/android/hello_sdl_android/src/main/res/mipmap-mdpi/ic_launcher.png
index 239564b34..239564b34 100755
--- a/hello_sdl_android/src/main/res/mipmap-mdpi/ic_launcher.png
+++ b/android/hello_sdl_android/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/hello_sdl_android/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/hello_sdl_android/src/main/res/mipmap-xhdpi/ic_launcher.png
index 485ca6880..485ca6880 100755
--- a/hello_sdl_android/src/main/res/mipmap-xhdpi/ic_launcher.png
+++ b/android/hello_sdl_android/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/hello_sdl_android/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/hello_sdl_android/src/main/res/mipmap-xxhdpi/ic_launcher.png
index 60574c2af..60574c2af 100755
--- a/hello_sdl_android/src/main/res/mipmap-xxhdpi/ic_launcher.png
+++ b/android/hello_sdl_android/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/hello_sdl_android/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/hello_sdl_android/src/main/res/mipmap-xxxhdpi/ic_launcher.png
index c43021775..c43021775 100755
--- a/hello_sdl_android/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+++ b/android/hello_sdl_android/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/hello_sdl_android/src/main/res/values-v11/styles.xml b/android/hello_sdl_android/src/main/res/values-v11/styles.xml
index a4a95bc46..a4a95bc46 100755
--- a/hello_sdl_android/src/main/res/values-v11/styles.xml
+++ b/android/hello_sdl_android/src/main/res/values-v11/styles.xml
diff --git a/hello_sdl_android/src/main/res/values-v14/styles.xml b/android/hello_sdl_android/src/main/res/values-v14/styles.xml
index 664f4f162..664f4f162 100755
--- a/hello_sdl_android/src/main/res/values-v14/styles.xml
+++ b/android/hello_sdl_android/src/main/res/values-v14/styles.xml
diff --git a/hello_sdl_android/src/main/res/values-w820dp/dimens.xml b/android/hello_sdl_android/src/main/res/values-w820dp/dimens.xml
index f3e70203b..f3e70203b 100755
--- a/hello_sdl_android/src/main/res/values-w820dp/dimens.xml
+++ b/android/hello_sdl_android/src/main/res/values-w820dp/dimens.xml
diff --git a/hello_sdl_android/src/main/res/values/dimens.xml b/android/hello_sdl_android/src/main/res/values/dimens.xml
index 55c1e5908..55c1e5908 100755
--- a/hello_sdl_android/src/main/res/values/dimens.xml
+++ b/android/hello_sdl_android/src/main/res/values/dimens.xml
diff --git a/hello_sdl_android/src/main/res/values/strings.xml b/android/hello_sdl_android/src/main/res/values/strings.xml
index 6f96374c6..6f96374c6 100755
--- a/hello_sdl_android/src/main/res/values/strings.xml
+++ b/android/hello_sdl_android/src/main/res/values/strings.xml
diff --git a/hello_sdl_android/src/main/res/values/styles.xml b/android/hello_sdl_android/src/main/res/values/styles.xml
index 845fb572b..845fb572b 100755
--- a/hello_sdl_android/src/main/res/values/styles.xml
+++ b/android/hello_sdl_android/src/main/res/values/styles.xml
diff --git a/hello_sdl_android/src/main/res/xml/accessory_filter.xml b/android/hello_sdl_android/src/main/res/xml/accessory_filter.xml
index 4b0ab7c83..4b0ab7c83 100755
--- a/hello_sdl_android/src/main/res/xml/accessory_filter.xml
+++ b/android/hello_sdl_android/src/main/res/xml/accessory_filter.xml
diff --git a/sdl_android/ROUTER_SERVICE_MESSAGING_PROTOCOL.md b/android/sdl_android/ROUTER_SERVICE_MESSAGING_PROTOCOL.md
index e641b8be2..e641b8be2 100644
--- a/sdl_android/ROUTER_SERVICE_MESSAGING_PROTOCOL.md
+++ b/android/sdl_android/ROUTER_SERVICE_MESSAGING_PROTOCOL.md
diff --git a/android/sdl_android/bintray.gradle b/android/sdl_android/bintray.gradle
new file mode 100644
index 000000000..734b77755
--- /dev/null
+++ b/android/sdl_android/bintray.gradle
@@ -0,0 +1,73 @@
+apply plugin: "com.jfrog.bintray"
+apply plugin: 'com.github.dcendents.android-maven'
+apply plugin: 'maven-publish'
+
+def siteUrl = 'https://github.com/smartdevicelink/sdl_java_suite' // Homepage URL of the library
+def gitUrl = 'https://github.com/smartdevicelink/sdl_java_suite.git' // Git repository URL
+group = "com.smartdevicelink" // Maven Group ID for the artifact
+def libDescription = 'SmartDeviceLink mobile library for Android'
+def libVersion = new File(projectDir.path, ('/../../VERSION')).text.trim()
+
+
+install {
+ repositories.mavenInstaller {
+ pom {
+ project {
+ packaging 'aar'
+
+ // Add your description here
+ name 'com.smartdevicelink:sdl_android'
+ description = libDescription
+ url siteUrl
+
+ // Set your license
+ licenses {
+ license {
+ name 'BSD 3-Clause'
+ url 'https://opensource.org/licenses/BSD-3-Clause'
+ }
+ }
+ scm {
+ connection gitUrl
+ developerConnection gitUrl
+ url siteUrl
+ }
+ }
+ }
+ }
+}
+
+task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+}
+
+artifacts {
+ archives sourcesJar
+}
+
+bintray {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ // Authorization
+ user = props.getProperty("bintray.user")
+ key = props.getProperty("bintray.key")
+ version = libVersion
+ configurations = ['archives']
+ pkg {
+ repo = props.getProperty("bintray.repo")
+ name = props.getProperty("bintray.artifact")
+ websiteUrl = siteUrl
+ vcsUrl = gitUrl
+ userOrg = props.getProperty("bintray.userorg")
+ licenses = ["BSD 3-Clause"]
+ publish = props.getProperty("bintray.publish") // Will upload to jCenter
+ version {
+ name = libVersion // Change to release version
+ desc = libDescription
+ released = new Date() // Will be the current date & time
+ vcsTag = libVersion // Should match git tag
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/bintray.properties b/android/sdl_android/bintray.properties
new file mode 100644
index 000000000..05fe732b1
--- /dev/null
+++ b/android/sdl_android/bintray.properties
@@ -0,0 +1,6 @@
+bintray.user=username
+bintray.key=apikey
+bintray.repo=sdl_android
+bintray.artifact=sdl_android
+bintray.userorg=smartdevicelink
+bintray.publish=true \ No newline at end of file
diff --git a/android/sdl_android/build.gradle b/android/sdl_android/build.gradle
new file mode 100644
index 000000000..cce904a1c
--- /dev/null
+++ b/android/sdl_android/build.gradle
@@ -0,0 +1,66 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 28
+ defaultConfig {
+ minSdkVersion 8
+ targetSdkVersion 26
+ versionCode 11
+ versionName new File(projectDir.path, ('/../../VERSION')).text.trim()
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"'
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ multiDexEnabled true
+ }
+ debug {
+ testCoverageEnabled = true
+ multiDexEnabled true
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_7
+ targetCompatibility JavaVersion.VERSION_1_7
+ }
+ lintOptions {
+ abortOnError false
+ }
+
+ testOptions {
+ unitTests.returnDefaultValues = true
+ }
+
+ sourceSets {
+ main.java.srcDirs += '../../baseAndroid/src/main/java'
+ }
+}
+
+dependencies {
+ api fileTree(dir: 'libs', include: ['*.jar'])
+ api 'com.smartdevicelink:bson_java_port:1.1.1'
+ androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ testImplementation 'junit:junit:4.12'
+ testImplementation 'org.mockito:mockito-core:2.9.0'
+ androidTestImplementation 'org.mockito:mockito-android:2.9.0'
+ api 'com.android.support:support-annotations:28.0.0'
+ api "android.arch.lifecycle:extensions:1.1.1"
+ annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
+}
+
+buildscript {
+ repositories {
+ jcenter()
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
+ }
+}
+
+apply from: 'bintray.gradle'
diff --git a/sdl_android/proguard-rules.pro b/android/sdl_android/proguard-rules.pro
index 3a5b9d9f9..3a5b9d9f9 100644
--- a/sdl_android/proguard-rules.pro
+++ b/android/sdl_android/proguard-rules.pro
diff --git a/sdl_android/src/androidTest/AndroidManifest.xml b/android/sdl_android/src/androidTest/AndroidManifest.xml
index 5231061fd..5231061fd 100644
--- a/sdl_android/src/androidTest/AndroidManifest.xml
+++ b/android/sdl_android/src/androidTest/AndroidManifest.xml
diff --git a/sdl_android/src/androidTest/assets/json/AddCommand.json b/android/sdl_android/src/androidTest/assets/json/AddCommand.json
index c6567e966..c6567e966 100644
--- a/sdl_android/src/androidTest/assets/json/AddCommand.json
+++ b/android/sdl_android/src/androidTest/assets/json/AddCommand.json
diff --git a/sdl_android/src/androidTest/assets/json/AddSubMenu.json b/android/sdl_android/src/androidTest/assets/json/AddSubMenu.json
index 37cc46adb..37cc46adb 100644
--- a/sdl_android/src/androidTest/assets/json/AddSubMenu.json
+++ b/android/sdl_android/src/androidTest/assets/json/AddSubMenu.json
diff --git a/sdl_android/src/androidTest/assets/json/Alert.json b/android/sdl_android/src/androidTest/assets/json/Alert.json
index ab497110b..ab497110b 100644
--- a/sdl_android/src/androidTest/assets/json/Alert.json
+++ b/android/sdl_android/src/androidTest/assets/json/Alert.json
diff --git a/sdl_android/src/androidTest/assets/json/AlertManeuver.json b/android/sdl_android/src/androidTest/assets/json/AlertManeuver.json
index 4099f80b0..4099f80b0 100644
--- a/sdl_android/src/androidTest/assets/json/AlertManeuver.json
+++ b/android/sdl_android/src/androidTest/assets/json/AlertManeuver.json
diff --git a/sdl_android/src/androidTest/assets/json/ButtonPress.json b/android/sdl_android/src/androidTest/assets/json/ButtonPress.json
index e74e857be..e74e857be 100644
--- a/sdl_android/src/androidTest/assets/json/ButtonPress.json
+++ b/android/sdl_android/src/androidTest/assets/json/ButtonPress.json
diff --git a/sdl_android/src/androidTest/assets/json/ChangeRegistration.json b/android/sdl_android/src/androidTest/assets/json/ChangeRegistration.json
index ceb93ccd3..ceb93ccd3 100644
--- a/sdl_android/src/androidTest/assets/json/ChangeRegistration.json
+++ b/android/sdl_android/src/androidTest/assets/json/ChangeRegistration.json
diff --git a/sdl_android/src/androidTest/assets/json/CreateInteractionChoiceSet.json b/android/sdl_android/src/androidTest/assets/json/CreateInteractionChoiceSet.json
index 6f01500db..6f01500db 100644
--- a/sdl_android/src/androidTest/assets/json/CreateInteractionChoiceSet.json
+++ b/android/sdl_android/src/androidTest/assets/json/CreateInteractionChoiceSet.json
diff --git a/sdl_android/src/androidTest/assets/json/DeleteCommand.json b/android/sdl_android/src/androidTest/assets/json/DeleteCommand.json
index cba061a03..cba061a03 100644
--- a/sdl_android/src/androidTest/assets/json/DeleteCommand.json
+++ b/android/sdl_android/src/androidTest/assets/json/DeleteCommand.json
diff --git a/sdl_android/src/androidTest/assets/json/DeleteFile.json b/android/sdl_android/src/androidTest/assets/json/DeleteFile.json
index ed3ff0cdc..ed3ff0cdc 100644
--- a/sdl_android/src/androidTest/assets/json/DeleteFile.json
+++ b/android/sdl_android/src/androidTest/assets/json/DeleteFile.json
diff --git a/sdl_android/src/androidTest/assets/json/DeleteInteractionChoiceSet.json b/android/sdl_android/src/androidTest/assets/json/DeleteInteractionChoiceSet.json
index 60f9a6c61..60f9a6c61 100644
--- a/sdl_android/src/androidTest/assets/json/DeleteInteractionChoiceSet.json
+++ b/android/sdl_android/src/androidTest/assets/json/DeleteInteractionChoiceSet.json
diff --git a/sdl_android/src/androidTest/assets/json/DeleteSubMenu.json b/android/sdl_android/src/androidTest/assets/json/DeleteSubMenu.json
index c31eb189d..c31eb189d 100644
--- a/sdl_android/src/androidTest/assets/json/DeleteSubMenu.json
+++ b/android/sdl_android/src/androidTest/assets/json/DeleteSubMenu.json
diff --git a/sdl_android/src/androidTest/assets/json/DiagnosticMessage.json b/android/sdl_android/src/androidTest/assets/json/DiagnosticMessage.json
index ff5e4a92d..ff5e4a92d 100644
--- a/sdl_android/src/androidTest/assets/json/DiagnosticMessage.json
+++ b/android/sdl_android/src/androidTest/assets/json/DiagnosticMessage.json
diff --git a/sdl_android/src/androidTest/assets/json/DialNumber.json b/android/sdl_android/src/androidTest/assets/json/DialNumber.json
index cb79aad84..cb79aad84 100644
--- a/sdl_android/src/androidTest/assets/json/DialNumber.json
+++ b/android/sdl_android/src/androidTest/assets/json/DialNumber.json
diff --git a/sdl_android/src/androidTest/assets/json/EndAudioPassThru.json b/android/sdl_android/src/androidTest/assets/json/EndAudioPassThru.json
index ed6554bc3..ed6554bc3 100644
--- a/sdl_android/src/androidTest/assets/json/EndAudioPassThru.json
+++ b/android/sdl_android/src/androidTest/assets/json/EndAudioPassThru.json
diff --git a/android/sdl_android/src/androidTest/assets/json/GetAppServiceData.json b/android/sdl_android/src/androidTest/assets/json/GetAppServiceData.json
new file mode 100644
index 000000000..6e4e9a2e2
--- /dev/null
+++ b/android/sdl_android/src/androidTest/assets/json/GetAppServiceData.json
@@ -0,0 +1,20 @@
+{
+ "request":{
+ "name":"GetAppServiceData",
+ "correlationID":53,
+ "parameters":{
+ "subscribe":true,
+ "serviceType":"MEDIA"
+ }
+ },
+ "response":{
+ "name":"GetAppServiceDataResponse",
+ "correlationID":53,
+ "parameters":{
+ "serviceData": {
+ "serviceId": "test",
+ "serviceType": "MEDIA"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/assets/json/GetDTCs.json b/android/sdl_android/src/androidTest/assets/json/GetDTCs.json
index 7a0f0e51d..7a0f0e51d 100644
--- a/sdl_android/src/androidTest/assets/json/GetDTCs.json
+++ b/android/sdl_android/src/androidTest/assets/json/GetDTCs.json
diff --git a/android/sdl_android/src/androidTest/assets/json/GetFile.json b/android/sdl_android/src/androidTest/assets/json/GetFile.json
new file mode 100644
index 000000000..422bb4ee6
--- /dev/null
+++ b/android/sdl_android/src/androidTest/assets/json/GetFile.json
@@ -0,0 +1,23 @@
+{
+ "request":{
+ "name":"GetFile",
+ "correlationID":1,
+ "parameters":{
+ "fileName":"test",
+ "appServiceId": "test",
+ "fileType":"GRAPHIC_JPEG",
+ "offset": 100,
+ "length": 100
+ }
+ },
+ "response":{
+ "name":"GetFileResponse",
+ "correlationID":1,
+ "parameters":{
+ "fileType":"GRAPHIC_JPEG",
+ "offset": 100,
+ "length": 100,
+ "crc": 1234
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/assets/json/GetInteriorVehicleData.json b/android/sdl_android/src/androidTest/assets/json/GetInteriorVehicleData.json
index 7000d2918..7000d2918 100644
--- a/sdl_android/src/androidTest/assets/json/GetInteriorVehicleData.json
+++ b/android/sdl_android/src/androidTest/assets/json/GetInteriorVehicleData.json
diff --git a/android/sdl_android/src/androidTest/assets/json/GetSystemCapability.json b/android/sdl_android/src/androidTest/assets/json/GetSystemCapability.json
new file mode 100644
index 000000000..5869df406
--- /dev/null
+++ b/android/sdl_android/src/androidTest/assets/json/GetSystemCapability.json
@@ -0,0 +1,19 @@
+{
+ "request":{
+ "name":"GetSystemCapability",
+ "correlationID":203,
+ "parameters":{
+ "systemCapabilityType":"NAVIGATION",
+ "subscribe": true
+ }
+ },
+ "response":{
+ "name":"GetSystemCapabilityResponse",
+ "correlationID":204,
+ "parameters":{
+ "systemCapability":{
+ "systemCapabilityType":"NAVIGATION"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/assets/json/GetVehicleData.json b/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json
index 81b25ef87..81b25ef87 100644
--- a/sdl_android/src/androidTest/assets/json/GetVehicleData.json
+++ b/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json
diff --git a/sdl_android/src/androidTest/assets/json/GetWayPoints.json b/android/sdl_android/src/androidTest/assets/json/GetWayPoints.json
index 8d06a9dd6..8d06a9dd6 100644
--- a/sdl_android/src/androidTest/assets/json/GetWayPoints.json
+++ b/android/sdl_android/src/androidTest/assets/json/GetWayPoints.json
diff --git a/sdl_android/src/androidTest/assets/json/ListFiles.json b/android/sdl_android/src/androidTest/assets/json/ListFiles.json
index d34d64ff0..d34d64ff0 100644
--- a/sdl_android/src/androidTest/assets/json/ListFiles.json
+++ b/android/sdl_android/src/androidTest/assets/json/ListFiles.json
diff --git a/android/sdl_android/src/androidTest/assets/json/PerformAppServiceInteraction.json b/android/sdl_android/src/androidTest/assets/json/PerformAppServiceInteraction.json
new file mode 100644
index 000000000..e16bc880f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/assets/json/PerformAppServiceInteraction.json
@@ -0,0 +1,19 @@
+{
+ "request":{
+ "name":"PerformAppServiceInteraction",
+ "correlationID":55,
+ "parameters":{
+ "serviceUri": "test",
+ "appServiceId": "test",
+ "originApp": "test",
+ "requestServiceActive": true
+ }
+ },
+ "response":{
+ "name":"PerformAppServiceInteractionResponse",
+ "correlationID":55,
+ "parameters":{
+ "serviceSpecificResult": "test"
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/assets/json/PerformAudioPassThru.json b/android/sdl_android/src/androidTest/assets/json/PerformAudioPassThru.json
index 60e88b694..60e88b694 100644
--- a/sdl_android/src/androidTest/assets/json/PerformAudioPassThru.json
+++ b/android/sdl_android/src/androidTest/assets/json/PerformAudioPassThru.json
diff --git a/sdl_android/src/androidTest/assets/json/PerformInteraction.json b/android/sdl_android/src/androidTest/assets/json/PerformInteraction.json
index b8965ee61..b8965ee61 100644
--- a/sdl_android/src/androidTest/assets/json/PerformInteraction.json
+++ b/android/sdl_android/src/androidTest/assets/json/PerformInteraction.json
diff --git a/android/sdl_android/src/androidTest/assets/json/PublishAppService.json b/android/sdl_android/src/androidTest/assets/json/PublishAppService.json
new file mode 100644
index 000000000..1a6edf9db
--- /dev/null
+++ b/android/sdl_android/src/androidTest/assets/json/PublishAppService.json
@@ -0,0 +1,42 @@
+{
+ "request":{
+ "name":"PublishAppService",
+ "correlationID":52,
+ "parameters":{
+ "appServiceManifest":{
+ "allowAppConsumers":true,
+ "serviceIcon": "test",
+ "rpcSpecVersion":{
+ "majorVersion":5,
+ "minorVersion":1,
+ "patchVersion":0},
+ "serviceName":"Mobile_MEDIA",
+ "serviceType":"MEDIA",
+ "handledRPCs":[39,41]
+ }
+ }
+ },
+ "response":{
+ "name":"PublishAppServiceResponse",
+ "correlationID":52,
+ "parameters":{
+ "appServiceRecord": {
+ "serviceID": "test",
+ "serviceManifest": {
+ "allowAppConsumers": true,
+ "rpcSpecVersion": {
+ "majorVersion": 5,
+ "minorVersion": 1,
+ "patchVersion": 0
+ },
+ "serviceName": "Mobile_MEDIA",
+ "serviceType": "MEDIA",
+ "serviceIcon": "test",
+ "handledRPCs": [39,41]
+ },
+ "servicePublished": true,
+ "serviceActive":true
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/assets/json/PutFile.json b/android/sdl_android/src/androidTest/assets/json/PutFile.json
index e989a62aa..e989a62aa 100644
--- a/sdl_android/src/androidTest/assets/json/PutFile.json
+++ b/android/sdl_android/src/androidTest/assets/json/PutFile.json
diff --git a/sdl_android/src/androidTest/assets/json/ReadDID.json b/android/sdl_android/src/androidTest/assets/json/ReadDID.json
index 5cb3403fb..5cb3403fb 100644
--- a/sdl_android/src/androidTest/assets/json/ReadDID.json
+++ b/android/sdl_android/src/androidTest/assets/json/ReadDID.json
diff --git a/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json b/android/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json
index 1d13635a9..1d13635a9 100644
--- a/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json
+++ b/android/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json
diff --git a/sdl_android/src/androidTest/assets/json/ResetGlobalProperties.json b/android/sdl_android/src/androidTest/assets/json/ResetGlobalProperties.json
index 02ff2ba26..02ff2ba26 100644
--- a/sdl_android/src/androidTest/assets/json/ResetGlobalProperties.json
+++ b/android/sdl_android/src/androidTest/assets/json/ResetGlobalProperties.json
diff --git a/sdl_android/src/androidTest/assets/json/ScrollableMessage.json b/android/sdl_android/src/androidTest/assets/json/ScrollableMessage.json
index f86dc188c..f86dc188c 100644
--- a/sdl_android/src/androidTest/assets/json/ScrollableMessage.json
+++ b/android/sdl_android/src/androidTest/assets/json/ScrollableMessage.json
diff --git a/sdl_android/src/androidTest/assets/json/SendHapticData.json b/android/sdl_android/src/androidTest/assets/json/SendHapticData.json
index 42b863aae..42b863aae 100644
--- a/sdl_android/src/androidTest/assets/json/SendHapticData.json
+++ b/android/sdl_android/src/androidTest/assets/json/SendHapticData.json
diff --git a/sdl_android/src/androidTest/assets/json/SendLocation.json b/android/sdl_android/src/androidTest/assets/json/SendLocation.json
index 9b0ae8901..9b0ae8901 100644
--- a/sdl_android/src/androidTest/assets/json/SendLocation.json
+++ b/android/sdl_android/src/androidTest/assets/json/SendLocation.json
diff --git a/sdl_android/src/androidTest/assets/json/SetAppIcon.json b/android/sdl_android/src/androidTest/assets/json/SetAppIcon.json
index 67f3b0b41..67f3b0b41 100644
--- a/sdl_android/src/androidTest/assets/json/SetAppIcon.json
+++ b/android/sdl_android/src/androidTest/assets/json/SetAppIcon.json
diff --git a/sdl_android/src/androidTest/assets/json/SetDisplayLayout.json b/android/sdl_android/src/androidTest/assets/json/SetDisplayLayout.json
index ec9e62f54..ec9e62f54 100644
--- a/sdl_android/src/androidTest/assets/json/SetDisplayLayout.json
+++ b/android/sdl_android/src/androidTest/assets/json/SetDisplayLayout.json
diff --git a/sdl_android/src/androidTest/assets/json/SetGlobalProperties.json b/android/sdl_android/src/androidTest/assets/json/SetGlobalProperties.json
index 60cdfbffb..60cdfbffb 100644
--- a/sdl_android/src/androidTest/assets/json/SetGlobalProperties.json
+++ b/android/sdl_android/src/androidTest/assets/json/SetGlobalProperties.json
diff --git a/sdl_android/src/androidTest/assets/json/SetInteriorVehicleData.json b/android/sdl_android/src/androidTest/assets/json/SetInteriorVehicleData.json
index 9bcdc01dc..9bcdc01dc 100644
--- a/sdl_android/src/androidTest/assets/json/SetInteriorVehicleData.json
+++ b/android/sdl_android/src/androidTest/assets/json/SetInteriorVehicleData.json
diff --git a/sdl_android/src/androidTest/assets/json/SetMediaClockTimer.json b/android/sdl_android/src/androidTest/assets/json/SetMediaClockTimer.json
index e4950d05d..e4950d05d 100644
--- a/sdl_android/src/androidTest/assets/json/SetMediaClockTimer.json
+++ b/android/sdl_android/src/androidTest/assets/json/SetMediaClockTimer.json
diff --git a/sdl_android/src/androidTest/assets/json/Show.json b/android/sdl_android/src/androidTest/assets/json/Show.json
index 97ef1f20f..97ef1f20f 100644
--- a/sdl_android/src/androidTest/assets/json/Show.json
+++ b/android/sdl_android/src/androidTest/assets/json/Show.json
diff --git a/sdl_android/src/androidTest/assets/json/ShowConstantTBT.json b/android/sdl_android/src/androidTest/assets/json/ShowConstantTBT.json
index 0a0c30b0c..0a0c30b0c 100644
--- a/sdl_android/src/androidTest/assets/json/ShowConstantTBT.json
+++ b/android/sdl_android/src/androidTest/assets/json/ShowConstantTBT.json
diff --git a/sdl_android/src/androidTest/assets/json/Slider.json b/android/sdl_android/src/androidTest/assets/json/Slider.json
index 38f033df4..38f033df4 100644
--- a/sdl_android/src/androidTest/assets/json/Slider.json
+++ b/android/sdl_android/src/androidTest/assets/json/Slider.json
diff --git a/sdl_android/src/androidTest/assets/json/Speak.json b/android/sdl_android/src/androidTest/assets/json/Speak.json
index 413535ac6..413535ac6 100644
--- a/sdl_android/src/androidTest/assets/json/Speak.json
+++ b/android/sdl_android/src/androidTest/assets/json/Speak.json
diff --git a/sdl_android/src/androidTest/assets/json/StreamRPC.json b/android/sdl_android/src/androidTest/assets/json/StreamRPC.json
index ff20ffc93..ff20ffc93 100644
--- a/sdl_android/src/androidTest/assets/json/StreamRPC.json
+++ b/android/sdl_android/src/androidTest/assets/json/StreamRPC.json
diff --git a/sdl_android/src/androidTest/assets/json/SubscribeButton.json b/android/sdl_android/src/androidTest/assets/json/SubscribeButton.json
index bfb660c7e..bfb660c7e 100644
--- a/sdl_android/src/androidTest/assets/json/SubscribeButton.json
+++ b/android/sdl_android/src/androidTest/assets/json/SubscribeButton.json
diff --git a/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json b/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json
index 92cf00a1b..92cf00a1b 100644
--- a/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json
+++ b/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json
diff --git a/sdl_android/src/androidTest/assets/json/SubscribeWayPoints.json b/android/sdl_android/src/androidTest/assets/json/SubscribeWayPoints.json
index bd1eee5c6..bd1eee5c6 100644
--- a/sdl_android/src/androidTest/assets/json/SubscribeWayPoints.json
+++ b/android/sdl_android/src/androidTest/assets/json/SubscribeWayPoints.json
diff --git a/sdl_android/src/androidTest/assets/json/SystemRequest.json b/android/sdl_android/src/androidTest/assets/json/SystemRequest.json
index 44c6d5205..44c6d5205 100644
--- a/sdl_android/src/androidTest/assets/json/SystemRequest.json
+++ b/android/sdl_android/src/androidTest/assets/json/SystemRequest.json
diff --git a/sdl_android/src/androidTest/assets/json/UnregisterAppInterface.json b/android/sdl_android/src/androidTest/assets/json/UnregisterAppInterface.json
index f9cc9f0de..f9cc9f0de 100644
--- a/sdl_android/src/androidTest/assets/json/UnregisterAppInterface.json
+++ b/android/sdl_android/src/androidTest/assets/json/UnregisterAppInterface.json
diff --git a/sdl_android/src/androidTest/assets/json/UnsubscribeButton.json b/android/sdl_android/src/androidTest/assets/json/UnsubscribeButton.json
index cb2164d94..cb2164d94 100644
--- a/sdl_android/src/androidTest/assets/json/UnsubscribeButton.json
+++ b/android/sdl_android/src/androidTest/assets/json/UnsubscribeButton.json
diff --git a/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json b/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json
index d01b99aa8..d01b99aa8 100644
--- a/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json
+++ b/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json
diff --git a/sdl_android/src/androidTest/assets/json/UnsubscribeWayPoints.json b/android/sdl_android/src/androidTest/assets/json/UnsubscribeWayPoints.json
index 60e2a98e4..60e2a98e4 100644
--- a/sdl_android/src/androidTest/assets/json/UnsubscribeWayPoints.json
+++ b/android/sdl_android/src/androidTest/assets/json/UnsubscribeWayPoints.json
diff --git a/sdl_android/src/androidTest/assets/json/UpdateTurnList.json b/android/sdl_android/src/androidTest/assets/json/UpdateTurnList.json
index 9cd449acd..9cd449acd 100644
--- a/sdl_android/src/androidTest/assets/json/UpdateTurnList.json
+++ b/android/sdl_android/src/androidTest/assets/json/UpdateTurnList.json
diff --git a/android/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml b/android/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml
new file mode 100644
index 000000000..6582c9361
--- /dev/null
+++ b/android/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml
@@ -0,0 +1,7720 @@
+<?xml version="1.0" standalone="no"?>
+<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
+
+<interface name="SmartDeviceLink RAPI" version="5.1.0" minVersion="1.0" date="2019-03-19">
+ <enum name="Result" internal_scope="base" since="1.0">
+ <element name="SUCCESS">
+ <description>The request succeeded</description>
+ </element>
+ <element name="UNSUPPORTED_REQUEST">
+ <description>The request is not supported by the headunit</description>
+ </element>
+ <element name="UNSUPPORTED_RESOURCE">
+ <description>
+ A button that was requested for subscription is not supported under the current system.
+ </description>
+ </element>
+ <element name="DISALLOWED">
+ <description>RPC is not authorized in local policy table.</description>
+ </element>
+ <element name="REJECTED">
+ <description>
+ The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
+ Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
+ </description>
+ </element>
+ <element name="ABORTED">
+ <description>
+ A command was aborted, for example due to user interaction (e.g. user pressed button).
+ Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
+ </description>
+ </element>
+ <element name="IGNORED">
+ <description>
+ A command was ignored, because the intended result is already in effect.
+ For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
+ NOTE: potentially replaces SUBSCRIBED_ALREADY
+ </description>
+ </element>
+ <element name="RETRY">
+ <description>The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.</description>
+ </element>
+ <element name="IN_USE">
+ <description>
+ The data may not be changed, because it is currently in use.
+ For example when trying to delete a command set that is currently involved in an interaction.
+ </description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" since="2.0">
+ <description>The requested vehicle data is not available on this vehicle or is not published.</description>
+ </element>
+ <element name="TIMED_OUT">
+ <description>Overlay reached the maximum timeout and closed.</description>
+ </element>
+ <element name="INVALID_DATA">
+ <description>
+ The data sent is invalid. For example:
+ Invalid Json syntax
+ Parameters out of bounds (number or enum range)
+ Mandatory parameters not provided
+ Parameter provided with wrong type
+ Invalid characters
+ Empty string
+ </description>
+ </element>
+ <element name="CHAR_LIMIT_EXCEEDED"></element>
+ <element name="INVALID_ID">
+ <description>
+ One of the provided IDs is not valid. For example
+ This applies to CorrelationID, SubscriptionID, CommandID, MenuID, etc.
+ </description>
+ </element>
+ <element name="DUPLICATE_NAME">
+ <description>There was a conflict with an registered name (application or menu item) or vr command</description>
+ </element>
+ <element name="APPLICATION_NOT_REGISTERED">
+ <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
+ </element>
+ <element name="WRONG_LANGUAGE">
+ <description>
+ The requested language is currently not supported.
+ Might be because of a mismatch of the currently active language on the headunit and the requested language
+ </description>
+ </element>
+ <element name="OUT_OF_MEMORY">
+ <description>The system could not process the request because the necessary memory couldn't be allocated</description>
+ </element>
+ <element name="TOO_MANY_PENDING_REQUESTS">
+ <description>There are too many requests pending (means, that the response has not been delivered, yet).There may be a maximum of 1000 pending requests at a time.</description>
+ </element>
+ <element name="TOO_MANY_APPLICATIONS">
+ <description>There are already too many registered applications</description>
+ </element>
+ <element name="APPLICATION_REGISTERED_ALREADY">
+ <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
+ </element>
+ <element name="WARNINGS">
+ <description>The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.</description>
+ </element>
+ <element name="GENERIC_ERROR">
+ <description>Provided data is valid but something went wrong in the lower layers.</description>
+ </element>
+ <element name="USER_DISALLOWED" since="2.0">
+ <description>RPC is included in a functional group explicitly blocked by the user.</description>
+ </element>
+ <element name="TRUNCATED_DATA">
+ <description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
+ </element>
+ <element name="UNSUPPORTED_VERSION" since="2.0">
+ <description>Sync doesn't support the protocol that is requested by the mobile application</description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_ALLOWED" since="2.0">
+ <description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
+ </element>
+ <element name="FILE_NOT_FOUND" since="3.0">
+ <description>A specified file could not be found on the headunit.</description>
+ </element>
+ <element name="CANCEL_ROUTE">
+ <description>User selected to Cancel Route.</description>
+ </element>
+ <element name="SAVED" since="2.0">
+ <description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
+ </element>
+ <element name="INVALID_CERT" since="3.0">
+ <description>The certificate provided during authentication is invalid.</description>
+ </element>
+ <element name="EXPIRED_CERT" since="3.0">
+ <description>The certificate provided during authentication is expired.</description>
+ </element>
+ <element name="RESUME_FAILED" since="3.0">
+ <description>The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.</description>
+ </element>
+ <element name="DATA_NOT_AVAILABLE" since="4.5">
+ <description>The requested information is currently not available. This is different than UNSUPPORTED_RESOURCE because it implies the data is at some point available. </description>
+ </element>
+ <element name="READ_ONLY" since="4.5">
+ <description>The value being set is read only</description>
+ </element>
+ <element name="CORRUPTED_DATA" since="5.0">
+ <description>The data sent failed to pass CRC check in receiver end</description>
+ </element>
+ </enum>
+
+ <enum name="ButtonPressMode" since="1.0">
+ <element name="LONG">
+ <description>
+ A button was released, after it was pressed for a long time
+ Actual timing is defined by the headunit and may vary
+ </description>
+ </element>
+ <element name="SHORT">
+ <description>
+ A button was released, after it was pressed for a short time
+ Actual timing is defined by the headunit and may vary
+ </description>
+ </element>
+ </enum>
+
+ <enum name="ButtonEventMode" since="1.0">
+ <element name="BUTTONUP">
+ <description>A button has been released up</description>
+ </element>
+ <element name="BUTTONDOWN">
+ <description>A button has been pressed down</description>
+ </element>
+ </enum>
+
+ <enum name="Language" since="1.0">
+ <element name="EN-US" internal_name="EN_US">
+ <description>English - US</description>
+ </element>
+ <element name="ES-MX" internal_name="ES_MX">
+ <description>Spanish - Mexico</description>
+ </element>
+ <element name="FR-CA" internal_name="FR_CA">
+ <description>French - Canada</description>
+ </element>
+ <element name="DE-DE" internal_name="DE_DE" since="2.0">
+ <description>German - Germany</description>
+ </element>
+ <element name="ES-ES" internal_name="ES_ES" since="2.0">
+ <description>Spanish - Spain</description>
+ </element>
+ <element name="EN-GB" internal_name="EN_GB" since="2.0">
+ <description>English - GB</description>
+ </element>
+ <element name="RU-RU" internal_name="RU_RU" since="2.0">
+ <description>Russian - Russia</description>
+ </element>
+ <element name="TR-TR" internal_name="TR_TR" since="2.0">
+ <description>Turkish - Turkey</description>
+ </element>
+ <element name="PL-PL" internal_name="PL_PL" since="2.0">
+ <description>Polish - Poland</description>
+ </element>
+ <element name="FR-FR" internal_name="FR_FR" since="2.0">
+ <description>French - France</description>
+ </element>
+ <element name="IT-IT" internal_name="IT_IT" since="2.0">
+ <description>Italian - Italy</description>
+ </element>
+ <element name="SV-SE" internal_name="SV_SE" since="2.0">
+ <description>Swedish - Sweden</description>
+ </element>
+ <element name="PT-PT" internal_name="PT_PT" since="2.0">
+ <description>Portuguese - Portugal</description>
+ </element>
+ <element name="NL-NL" internal_name="NL_NL" since="2.0">
+ <description>Dutch (Standard) - Netherlands</description>
+ </element>
+ <element name="EN-AU" internal_name="EN_AU" since="2.0">
+ <description>English - Australia</description>
+ </element>
+ <element name="ZH-CN" internal_name="ZH_CN" since="2.0">
+ <description>Mandarin - China</description>
+ </element>
+ <element name="ZH-TW" internal_name="ZH_TW" since="2.0">
+ <description>Mandarin - Taiwan</description>
+ </element>
+ <element name="JA-JP" internal_name="JA_JP" since="2.0">
+ <description>Japanese - Japan</description>
+ </element>
+ <element name="AR-SA" internal_name="AR_SA" since="2.0">
+ <description>Arabic - Saudi Arabia</description>
+ </element>
+ <element name="KO-KR" internal_name="KO_KR" since="2.0">
+ <description>Korean - South Korea</description>
+ </element>
+ <element name="PT-BR" internal_name="PT_BR" since="2.0">
+ <description>Portuguese - Brazil</description>
+ </element>
+ <element name="CS-CZ" internal_name="CS_CZ" since="2.0">
+ <description>Czech - Czech Republic</description>
+ </element>
+ <element name="DA-DK" internal_name="DA_DK" since="2.0">
+ <description>Danish - Denmark</description>
+ </element>
+ <element name="NO-NO" internal_name="NO_NO" since="2.0">
+ <description>Norwegian - Norway</description>
+ </element>
+ <element name="NL-BE" internal_name="NL_BE" since="2.0">
+ <description>Dutch (Flemish) - Belgium</description>
+ </element>
+ <element name="EL-GR" internal_name="EL_GR" since="2.0">
+ <description>Greek - Greece</description>
+ </element>
+ <element name="HU-HU" internal_name="HU_HU" since="2.0">
+ <description>Hungarian - Hungary</description>
+ </element>
+ <element name="FI-FI" internal_name="FI_FI" since="2.0">
+ <description>Finnish - Finland</description>
+ </element>
+ <element name="SK-SK" internal_name="SK_SK" since="2.0">
+ <description>Slovak - Slovakia</description>
+ </element>
+ <element name="EN-IN" internal_name="EN_IN" since="4.5">
+ <description>English - India</description>
+ </element>
+ <element name="TH-TH" internal_name="TH_TH" since="4.5">
+ <description>Thai - Thailand</description>
+ </element>
+ <element name="EN-SA" internal_name="EN_SA" since="4.5">
+ <description>English - Middle East</description>
+ </element>
+ <element name="HE-IL" internal_name="HE_IL" since="4.5">
+ <description>Hebrew - Israel</description>
+ </element>
+ <element name="RO-RO" internal_name="RO_RO" since="4.5">
+ <description>Romanian - Romania</description>
+ </element>
+ <element name="UK-UA" internal_name="UK_UA" since="4.5">
+ <description>Ukrainian - Ukraine</description>
+ </element>
+ <element name="ID-ID" internal_name="ID_ID" since="4.5">
+ <description>Indonesian - Indonesia</description>
+ </element>
+ <element name="VI-VN" internal_name="VI_VN" since="4.5">
+ <description>Vietnamese - Vietnam</description>
+ </element>
+ <element name="MS-MY" internal_name="MS_MY" since="4.5">
+ <description>Malay - Malaysia</description>
+ </element>
+ <element name="HI-IN" internal_name="HI_IN" since="4.5">
+ <description>Hindi - India</description>
+ </element>
+ </enum>
+
+ <enum name="UpdateMode" since="1.0">
+ <description>Describes how the media clock timer should behave on the platform</description>
+ <element name="COUNTUP" >
+ <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
+ </element>
+ <element name="COUNTDOWN" >
+ <description>Starts the media clock timer counting downwards, as in time remaining.</description>
+ </element>
+ <element name="PAUSE" >
+ <description>Pauses the media clock timer</description>
+ </element>
+ <element name="RESUME" >
+ <description>Resume the media clock timer</description>
+ </element>
+ <element name="CLEAR" >
+ <description>Clears the media clock timer (previously done through Show->mediaClock)</description>
+ </element>
+ </enum>
+
+ <enum name="TimerMode" since="1.0">
+ <element name="UP" >
+ <description>Causes the media clock timer to update from 0:00 to a specified time</description>
+ </element>
+ <element name="DOWN" >
+ <description>Causes the media clock timer to update from a specified time to 0:00</description>
+ </element>
+ <element name="NONE" >
+ <description>Indicates to not use the media clock timer</description>
+ </element>
+ </enum>
+
+ <enum name="InteractionMode" since="1.0">
+ <description>For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction.</description>
+ <element name="MANUAL_ONLY" >
+ <description>This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display. No Voice Interaction.</description>
+ </element>
+ <element name="VR_ONLY" >
+ <description>This mode causes the interaction to only occur using the headunits VR system. Selections are made by saying the command.</description>
+ </element>
+ <element name="BOTH" >
+ <description>This mode causes both a VR and display selection option for an interaction. The user will first be asked via Voice Interaction (if available). If this is unsuccessful, the system will switch to manual input.</description>
+ </element>
+ </enum>
+
+ <enum name="LayoutMode" since="3.0">
+ <description>For touchscreen interactions, the mode of how the choices are presented.</description>
+ <element name="ICON_ONLY" >
+ <description>This mode causes the interaction to display the previous set of choices as icons.</description>
+ </element>
+ <element name="ICON_WITH_SEARCH" >
+ <description>This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.</description>
+ </element>
+ <element name="LIST_ONLY" >
+ <description>This mode causes the interaction to display the previous set of choices as a list.</description>
+ </element>
+ <element name="LIST_WITH_SEARCH" >
+ <description>This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.</description>
+ </element>
+ <element name="KEYBOARD" >
+ <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
+ </element>
+ </enum>
+
+ <enum name="HMILevel" since="1.0">
+ <description>Enumeration that describes current levels of HMI.</description>
+ <element name="FULL" internal_name="HMI_FULL" />
+ <element name="LIMITED" internal_name="HMI_LIMITED" />
+ <element name="BACKGROUND" internal_name="HMI_BACKGROUND" />
+ <element name="NONE" internal_name="HMI_NONE" />
+ </enum>
+
+ <enum name="AudioStreamingState" since="1.0">
+ <description>Enumeration that describes possible states of audio streaming.</description>
+ <element name="AUDIBLE" />
+ <element name="ATTENUATED" />
+ <element name="NOT_AUDIBLE" />
+ </enum>
+
+ <enum name="SystemAction" since="1.0">
+ <description>Enumeration that describes system actions that can be triggered.</description>
+ <element name="DEFAULT_ACTION">
+ <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
+ </element>
+ <element name="STEAL_FOCUS">
+ <description>App is brought into HMI_FULL.</description>
+ </element>
+ <element name="KEEP_CONTEXT">
+ <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
+ </element>
+ </enum>
+
+ <enum name="SystemContext" since="1.0">
+ <description>Enumeration that describes possible contexts an app's HMI might be in. Communicated to whichever app is in HMI FULL, except Alert.</description>
+ <element name="MAIN" internal_name="SYSCTXT_MAIN">
+ <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
+ </element>
+ <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
+ <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
+ </element>
+ <element name="MENU" internal_name="SYSCTXT_MENU">
+ <description>The system is currently displaying an in-App menu onscreen.</description>
+ </element>
+ <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
+ <description>The app's display HMI is currently being obscured by either a system or other app's overlay.</description>
+ </element>
+ <element name="ALERT" internal_name="SYSCTXT_ALERT">
+ <description>Broadcast only to whichever app has an alert currently being displayed.</description>
+ </element>
+ </enum>
+
+ <enum name="VideoStreamingState" since="5.0">
+ <description>Enumeration that describes possible states of video streaming. </description>
+ <element name="STREAMABLE" />
+ <element name="NOT_STREAMABLE" />
+ </enum>
+
+ <enum name="SoftButtonType" since="2.0">
+ <description>Contains information about the SoftButton capabilities.</description>
+ <element name="TEXT" internal_name="SBT_TEXT"/>
+ <element name="IMAGE" internal_name="SBT_IMAGE"/>
+ <element name="BOTH" internal_name="SBT_BOTH"/>
+ </enum>
+
+ <enum name="AppInterfaceUnregisteredReason" since="1.0">
+ <description>Error code, which comes from the module side.</description>
+ <!-- Deprecate
+ <element name="USER_EXIT" />
+ -->
+ <element name="IGNITION_OFF" />
+ <element name="BLUETOOTH_OFF" />
+ <element name="USB_DISCONNECTED" />
+ <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL" />
+ <element name="TOO_MANY_REQUESTS" />
+ <element name="DRIVER_DISTRACTION_VIOLATION" />
+ <element name="LANGUAGE_CHANGE" />
+ <element name="MASTER_RESET" />
+ <element name="FACTORY_DEFAULTS" />
+ <element name="APP_UNAUTHORIZED" since="2.0" />
+ <element name="PROTOCOL_VIOLATION" since="4.0" />
+ <element name="UNSUPPORTED_HMI_RESOURCE" since="4.1" />
+ </enum>
+
+ <enum name="TriggerSource" since="1.0">
+ <description>Indicates the source from where the command was triggered.</description>
+ <element name="MENU" internal_name="TS_MENU" />
+ <element name="VR" internal_name="TS_VR" />
+ <element name="KEYBOARD" internal_name="TS_KEYBOARD" since="3.0" />
+ </enum>
+
+ <enum name="HmiZoneCapabilities" since="1.0">
+ <description>Contains information about the HMI zone capabilities.</description>
+ <description>For future use.</description>
+ <element name="FRONT" />
+ <element name="BACK" />
+ </enum>
+
+ <enum name="SpeechCapabilities" since="1.0">
+ <description>Contains information about the TTS capabilities.</description>
+ <element name="TEXT" internal_name="SC_TEXT"/>
+ <element name="SAPI_PHONEMES" />
+ <element name="LHPLUS_PHONEMES" />
+ <element name="PRE_RECORDED" />
+ <element name="SILENCE" />
+ <element name="FILE" since="5.0" />
+ </enum>
+
+ <enum name="VrCapabilities" since="1.0">
+ <description>Contains information about the VR capabilities.</description>
+ <element name="TEXT" internal_name="VR_TEXT"/>
+ </enum>
+
+ <enum name="PrerecordedSpeech" since="1.0">
+ <description>Contains a list of prerecorded speech items present on the platform.</description>
+ <element name="HELP_JINGLE" />
+ <element name="INITIAL_JINGLE" />
+ <element name="LISTEN_JINGLE" />
+ <element name="POSITIVE_JINGLE" />
+ <element name="NEGATIVE_JINGLE" />
+ </enum>
+
+ <enum name="SamplingRate" since="2.0">
+ <description>Describes different sampling options for PerformAudioPassThru.</description>
+ <element name="8KHZ" internal_name="SamplingRate_8KHZ">
+ <description>Sampling rate of 8000 Hz.</description>
+ </element>
+ <element name="16KHZ" internal_name="SamplingRate_16KHZ">
+ <description>Sampling rate of 16000 Hz.</description>
+ </element>
+ <element name="22KHZ" internal_name="SamplingRate_22KHZ">
+ <description>Sampling rate of 22050 Hz.</description>
+ </element>
+ <element name="44KHZ" internal_name="SamplingRate_44KHZ">
+ <description>Sampling rate of 44100 Hz.</description>
+ </element>
+ </enum>
+
+ <enum name="BitsPerSample" since="2.0">
+ <description>Describes different quality options for PerformAudioPassThru.</description>
+ <element name="8_BIT" internal_name="BitsPerSample_8_BIT">
+ <description>Audio sample is 8 bits wide, unsigned.</description>
+ </element>
+ <element name="16_BIT" internal_name="BitsPerSample_16_BIT">
+ <description>Audio sample is 16 bits wide, signed, and in little endian.</description>
+ </element>
+ </enum>
+
+ <enum name="AudioType" since="2.0">
+ <description>Describes different audio type options for PerformAudioPassThru.</description>
+ <element name="PCM">
+ <description>Linear PCM.</description>
+ </element>
+ </enum>
+
+ <struct name="AudioPassThruCapabilities" since="2.0">
+ <description>
+ Describes different audio type configurations for PerformAudioPassThru.
+ e.g. {8kHz,8-bit,PCM}
+ The audio is recorded in monaural.
+ </description>
+ <param name="samplingRate" type="SamplingRate" mandatory="true"/>
+ <param name="bitsPerSample" type="BitsPerSample" mandatory="true"/>
+ <param name="audioType" type="AudioType" mandatory="true"/>
+ </struct>
+
+ <enum name="VehicleDataType" since="2.0">
+ <description>Defines the data types that can be published and subscribed to.</description>
+ <element name="VEHICLEDATA_GPS">
+ <description>Notifies GPSData may be subscribed</description>
+ </element>
+ <element name="VEHICLEDATA_SPEED" />
+ <element name="VEHICLEDATA_RPM" />
+ <element name="VEHICLEDATA_FUELLEVEL" />
+ <element name="VEHICLEDATA_FUELLEVEL_STATE" />
+ <element name="VEHICLEDATA_FUELCONSUMPTION" />
+ <element name="VEHICLEDATA_EXTERNTEMP" />
+ <element name="VEHICLEDATA_VIN" />
+ <element name="VEHICLEDATA_PRNDL" />
+ <element name="VEHICLEDATA_TIREPRESSURE" />
+ <element name="VEHICLEDATA_ODOMETER" />
+ <element name="VEHICLEDATA_BELTSTATUS" />
+ <element name="VEHICLEDATA_BODYINFO" />
+ <element name="VEHICLEDATA_DEVICESTATUS" />
+ <element name="VEHICLEDATA_ECALLINFO" />
+ <element name="VEHICLEDATA_AIRBAGSTATUS" />
+ <element name="VEHICLEDATA_EMERGENCYEVENT" />
+ <element name="VEHICLEDATA_CLUSTERMODESTATUS" />
+ <element name="VEHICLEDATA_MYKEY" />
+ <element name="VEHICLEDATA_BRAKING" />
+ <element name="VEHICLEDATA_WIPERSTATUS" />
+ <element name="VEHICLEDATA_HEADLAMPSTATUS" />
+ <element name="VEHICLEDATA_BATTVOLTAGE" />
+ <element name="VEHICLEDATA_ENGINETORQUE" />
+ <element name="VEHICLEDATA_ACCPEDAL" />
+ <element name="VEHICLEDATA_STEERINGWHEEL" />
+ <element name="VEHICLEDATA_TURNSIGNAL" since="5.0" />
+ <element name="VEHICLEDATA_FUELRANGE" since="5.0" />
+ <element name="VEHICLEDATA_ENGINEOILLIFE" since="5.0" />
+ <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" since="5.0" />
+ <element name="VEHICLEDATA_CLOUDAPPVEHICLEID" since="5.1"/>
+ </enum>
+
+ <enum name="HybridAppPreference" since="5.1">
+ <description>Enumeration for the user's preference of which app type to use when both are available</description>
+ <element name="MOBILE" />
+ <element name="CLOUD" />
+ <element name="BOTH" />
+ </enum>
+
+ <struct name="CloudAppProperties" since="5.1">
+ <param name="nicknames" type="String" minlength="0" maxlength="100" array="true" minsize="0" maxsize="100" mandatory="false">
+ <description>An array of app names a cloud app is allowed to register with. If included in a SetCloudAppProperties request, this value will overwrite the existing "nicknames" field in the app policies section of the policy table.</description>
+ </param>
+ <param name="appID" type="String" maxlength="100" mandatory="true"/>
+ <param name="enabled" type="Boolean" mandatory="false">
+ <description>If true, cloud app will be included in HMI RPC UpdateAppList</description>
+ </param>
+ <param name="authToken" type="String" maxlength="65535" mandatory="false">
+ <description>Used to authenticate websocket connection on app activation</description>
+ </param>
+ <param name="cloudTransportType" type="String" maxlength="100" mandatory="false">
+ <description>Specifies the connection type Core should use</description>
+ </param>
+ <param name="hybridAppPreference" type="HybridAppPreference" mandatory="false">
+ <description>Specifies the user preference to use the cloud app version or mobile app version when both are available</description>
+ </param>
+ <param name="endpoint" type="String" maxlength="65535" mandatory="false">
+ <description>Specifies the endpoint which Core will attempt to connect to when this app is selected</description>
+ </param>
+ </struct>
+
+ <enum name="ButtonName" since="1.0">
+ <description>Defines the hard (physical) and soft (touchscreen) buttons available from the module</description>
+ <element name="OK" />
+ <element name="PLAY_PAUSE" since="5.0">
+ <description>
+ The button name for the physical Play/Pause
+ toggle that can be used by media apps.
+ </description>
+ <warning>
+ Please use the physical OK button in order to
+ use a Play/Pause toggle for versions &lt; 4.5.0.
+ </warning>
+ </element>
+ <element name="SEEKLEFT" />
+ <element name="SEEKRIGHT" />
+ <element name="TUNEUP" />
+ <element name="TUNEDOWN" />
+ <element name="PRESET_0" />
+ <element name="PRESET_1" />
+ <element name="PRESET_2" />
+ <element name="PRESET_3" />
+ <element name="PRESET_4" />
+ <element name="PRESET_5" />
+ <element name="PRESET_6" />
+ <element name="PRESET_7" />
+ <element name="PRESET_8" />
+ <element name="PRESET_9" />
+ <element name="CUSTOM_BUTTON" />
+ <element name="SEARCH" />
+ <!-- Climate Buttons -->
+ <element name="AC_MAX" since="4.5" />
+ <element name="AC" since="4.5" />
+ <element name="RECIRCULATE" since="4.5" />
+ <element name="FAN_UP" since="4.5" />
+ <element name="FAN_DOWN" since="4.5" />
+ <element name="TEMP_UP" since="4.5" />
+ <element name="TEMP_DOWN" since="4.5" />
+ <element name="DEFROST_MAX" since="4.5" />
+ <element name="DEFROST" since="4.5" />
+ <element name="DEFROST_REAR" since="4.5" />
+ <element name="UPPER_VENT" since="4.5" />
+ <element name="LOWER_VENT" since="4.5" />
+ <!-- Radio Buttons -->
+ <element name="VOLUME_UP" since="4.5" />
+ <element name="VOLUME_DOWN" since="4.5" />
+ <element name="EJECT" since="4.5" />
+ <element name="SOURCE" since="4.5" />
+ <element name="SHUFFLE" since="4.5" />
+ <element name="REPEAT" since="4.5" />
+ </enum>
+
+ <enum name="MediaClockFormat" since="1.0">
+ <element name="CLOCK1">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
+ used for Type II and CID headunits
+ </description>
+ </element>
+ <element name="CLOCK2">
+ <description>
+ minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
+ used for Type V headunit
+ </description>
+ </element>
+ <element name="CLOCK3" since="2.0">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
+ used for GEN1.1 MFD3/4/5 headunits
+ </description>
+ </element>
+ <element name="CLOCKTEXT1">
+ <description>
+ 5 characters possible
+ Format: 1|sp c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters, see TypeII column in XLS. See [@TODO: create file ref]]
+ :|sp : colon or space
+ used for Type II headunit
+ </description>
+ </element>
+ <element name="CLOCKTEXT2">
+ <description>
+ 5 chars possible
+ Format: 1|sp c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters, see CID column in XLS. See [@TODO: create file ref]]
+ :|sp : colon or space
+ used for CID headunit
+ NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set
+ </description>
+ </element>
+ <element name="CLOCKTEXT3">
+ <description>
+ 6 chars possible
+ Format: 1|sp c c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters, see Type 5 column in XLS]. See [@TODO: create file ref]
+ :|sp : colon or space
+ used for Type V headunit
+ </description>
+ </element>
+ <element name="CLOCKTEXT4" since="2.0">
+ <description>
+ 6 chars possible
+ Format: c :|sp c c : c c
+ :|sp : colon or space
+ c : character out of following character set: sp|0-9|[letters].
+ used for GEN1.1 MFD3/4/5 headunits
+ </description>
+ </element>
+ </enum>
+
+ <enum name="DisplayType" deprecated="true" since="5.0">
+ <description>See DAES for further infos regarding the displays</description>
+ <element name="CID"/>
+ <element name="TYPE2" />
+ <element name="TYPE5" />
+ <element name="NGN" />
+ <element name="GEN2_8_DMA" since="3.0" />
+ <element name="GEN2_6_DMA" since="3.0" />
+ <element name="MFD3" since="2.0" />
+ <element name="MFD4" since="2.0" />
+ <element name="MFD5" since="2.0" />
+ <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" since="3.0" />
+ <element name="SDL_GENERIC" since="4.0" />
+ <history>
+ <enum name="DisplayType" since="1.0" until="5.0"/>
+ </history>
+ </enum>
+
+ <enum name="TextFieldName" since="1.0">
+ <element name="mainField1">
+ <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+
+ <element name="mainField2">
+ <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+
+ <element name="mainField3">
+ <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
+ </element>
+
+ <element name="mainField4">
+ <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+
+ <element name="statusBar">
+ <description>The status bar on NGN; applies to "Show"</description>
+ </element>
+
+ <element name="mediaClock">
+ <description>Text value for MediaClock field; applies to "Show"</description>
+ </element>
+
+ <element name="mediaTrack">
+ <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
+ </element>
+
+ <element name="alertText1">
+ <description>The first line of the alert text field; applies to "Alert"</description>
+ </element>
+
+ <element name="alertText2" since="2.0">
+ <description>The second line of the alert text field; applies to "Alert"</description>
+ </element>
+
+ <element name="alertText3" since="2.0">
+ <description>The third line of the alert text field; applies to "Alert"</description>
+ </element>
+
+ <element name="scrollableMessageBody" since="2.0">
+ <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
+ </element>
+
+ <element name="initialInteractionText" since="2.0">
+ <description> First line suggestion for a user response (in the case of VR enabled interaction)</description>
+ </element>
+
+ <element name="navigationText1" since="2.0">
+ <description> First line of navigation text</description>
+ </element>
+
+ <element name="navigationText2" since="2.0">
+ <description> Second line of navigation text</description>
+ </element>
+
+ <element name="ETA" since="2.0">
+ <description> Estimated Time of Arrival time for navigation</description>
+ </element>
+
+ <element name="totalDistance" since="2.0">
+ <description> Total distance to destination for navigation</description>
+ </element>
+
+ <element name="audioPassThruDisplayText1" since="2.0">
+ <description> First line of text for audio pass thru</description>
+ </element>
+
+ <element name="audioPassThruDisplayText2" since="2.0">
+ <description> Second line of text for audio pass thru</description>
+ </element>
+
+ <element name="sliderHeader" since="2.0">
+ <description> Header text for slider</description>
+ </element>
+
+ <element name="sliderFooter" since="2.0">
+ <description> Footer text for slider</description>
+ </element>
+
+ <element name="menuName">
+ <description> Primary text for Choice</description>
+ </element>
+
+ <element name="secondaryText">
+ <description> Secondary text for Choice</description>
+ </element>
+
+ <element name="tertiaryText">
+ <description> Tertiary text for Choice</description>
+ </element>
+
+ <element name="menuTitle">
+ <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </element>
+
+ <element name="locationName" since="4.0">
+ <description> Optional name / title of intended location for SendLocation.</description>
+ </element>
+
+ <element name="locationDescription" since="4.0">
+ <description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
+ </element>
+
+ <element name="addressLines" since="4.0">
+ <description> Optional location address (if applicable) for SendLocation.</description>
+ </element>
+
+ <element name="phoneNumber" since="4.0">
+ <description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
+ </element>
+
+ </enum>
+
+ <enum name="ImageFieldName" since="3.0">
+ <element name="softButtonImage">
+ <description>The image field for SoftButton</description>
+ </element>
+
+ <element name="choiceImage">
+ <description>The first image field for Choice</description>
+ </element>
+
+ <element name="choiceSecondaryImage">
+ <description>The secondary image field for Choice</description>
+ </element>
+
+ <element name="vrHelpItem">
+ <description>The image field for vrHelpItem</description>
+ </element>
+
+ <element name="turnIcon">
+ <description>The image field for Turn</description>
+ </element>
+
+ <element name="menuIcon">
+ <description>The image field for the menu icon in SetGlobalProperties</description>
+ </element>
+
+ <element name="cmdIcon">
+ <description>The image field for AddCommand</description>
+ </element>
+
+ <element name="appIcon">
+ <description>The image field for the app icon (set by setAppIcon)</description>
+ </element>
+
+ <element name="graphic">
+ <description>The primary image field for Show</description>
+ </element>
+
+ <element name="secondaryGraphic" since="5.0">
+ <description>The secondary image field for Show</description>
+ </element>
+
+ <element name="showConstantTBTIcon">
+ <description>The primary image field for ShowConstantTBT</description>
+ </element>
+
+ <element name="showConstantTBTNextTurnIcon">
+ <description>The secondary image field for ShowConstantTBT</description>
+ </element>
+
+ <element name="locationImage" since="4.0">
+ <description>The optional image of a destination / location</description>
+ </element>
+
+ </enum>
+
+ <enum name="CharacterSet" since="1.0">
+ <description>The list of potential character sets</description>
+ <element name="TYPE2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="TYPE5SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID1SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ </enum>
+
+ <enum name="TextAlignment" since="1.0">
+ <description>The list of possible alignments, left, right, or centered</description>
+ <element name="LEFT_ALIGNED" />
+ <element name="RIGHT_ALIGNED" />
+ <element name="CENTERED" />
+ </enum>
+
+ <enum name="TBTState" since="2.0">
+ <description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
+ <element name="ROUTE_UPDATE_REQUEST" />
+ <element name="ROUTE_ACCEPTED" />
+ <element name="ROUTE_REFUSED" />
+ <element name="ROUTE_CANCELLED" />
+ <element name="ETA_REQUEST" />
+ <element name="NEXT_TURN_REQUEST" />
+ <element name="ROUTE_STATUS_REQUEST" />
+ <element name="ROUTE_SUMMARY_REQUEST" />
+ <element name="TRIP_STATUS_REQUEST" />
+ <element name="ROUTE_UPDATE_REQUEST_TIMEOUT" />
+ </enum>
+
+ <enum name="DriverDistractionState" since="2.0">
+ <description>Enumeration that describes possible states of driver distraction.</description>
+ <element name="DD_ON" />
+ <element name="DD_OFF" />
+ </enum>
+
+ <enum name="ImageType" since="2.0">
+ <description>Contains information about the type of image.</description>
+ <element name="STATIC" />
+ <element name="DYNAMIC" />
+ </enum>
+
+ <enum name="DeliveryMode" since="4.1">
+ <description>The mode in which the SendLocation request is sent</description>
+ <element name="PROMPT" />
+ <element name="DESTINATION" />
+ <element name="QUEUE" />
+ </enum>
+
+ <enum name="VideoStreamingProtocol" since="4.5">
+ <description>Enum for each type of video streaming protocol type.</description>
+ <element name="RAW">
+ <description>Raw stream bytes that contains no timestamp data and is the lowest supported video streaming</description>
+ </element>
+ <element name="RTP">
+ <description>RTP facilitates the transfer of real-time data. Information provided by this protocol include timestamps (for synchronization), sequence numbers (for packet loss and reordering detection) and the payload format which indicates the encoded format of the data.</description>
+ </element>
+ <element name="RTSP">
+ <description>The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for media stream delivery. However, some vendors implement proprietary transport protocols. </description>
+ </element>
+ <element name="RTMP">
+ <description> Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by Macromedia for streaming audio, video and data over the Internet, between a Flash player and a server. Macromedia is now owned by Adobe, which has released an incomplete version of the specification of the protocol for public use.</description>
+ </element>
+ <element name="WEBM">
+ <description>The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.</description>
+ </element>
+ </enum>
+
+ <enum name="VideoStreamingCodec" since="4.5">
+ <description>Enum for each type of video streaming codec.</description>
+ <element name="H264">
+ <description>A block-oriented motion-compensation-based video compression standard. As of 2014 it is one of the most commonly used formats for the recording, compression, and distribution of video content.</description>
+ </element>
+ <element name="H265">
+ <description>High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard, one of several potential successors to the widely used AVC (H.264 or MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio at the same level of video quality, or substantially improved video quality at the same bit rate. It supports resolutions up to 8192x4320, including 8K UHD.</description>
+ </element>
+ <element name="Theora">
+ <description>Theora is derived from the formerly proprietary VP3 codec, released into the public domain by On2 Technologies. It is broadly comparable in design and bitrate efficiency to MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of the features present in some of these other codecs. It is comparable in open standards philosophy to the BBC's Dirac codec.</description>
+ </element>
+ <element name="VP8">
+ <description>VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for Open Media (AOMedia) are based on VP8.</description>
+ </element>
+ <element name="VP9">
+ <description>Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) and also enables lossless compression.</description>
+ </element>
+ </enum>
+
+ <enum name="AudioStreamingIndicator" since="5.0">
+ <element name="PLAY_PAUSE">
+ <description>
+ Default playback indicator.
+ By default the playback indicator should be PLAY_PAUSE when:
+ - the media app is newly registered on the head unit (after RegisterAppInterface)
+ - the media app was closed by the user (App enters HMI_NONE)
+ - the app sends SetMediaClockTimer with audioStreamingIndicator not set to any value
+ </description>
+ </element>
+ <element name="PLAY">
+ <description>Indicates that a button press of the Play/Pause button starts the audio playback.</description>
+ </element>
+ <element name="PAUSE">
+ <description>Indicates that a button press of the Play/Pause button pauses the current audio playback.</description>
+ </element>
+ <element name="STOP">
+ <description>Indicates that a button press of the Play/Pause button stops the current audio playback.</description>
+ </element>
+ </enum>
+
+ <struct name="Image" since="2.0">
+ <param name="value" minlength="0" maxlength="65535" type="String" mandatory="true">
+ <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
+ </param>
+ <param name="imageType" type="ImageType" mandatory="true">
+ <description>Describes, whether it is a static or dynamic image.</description>
+ </param>
+ <param name="isTemplate" type="Boolean" mandatory="false" since="5.0">
+ <description>If true, the image is a template image and can be recolored by the HMI</description>
+ </param>
+ </struct>
+
+ <struct name="SoftButton" since="2.0">
+ <param name="type" type="SoftButtonType" mandatory="true">
+ <description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
+ </param>
+ <param name="text" minlength="0" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to display (if defined as TEXT or BOTH)</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
+ </param>
+ <param name="isHighlighted" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ True, if highlighted
+ False, if not highlighted
+ </description>
+ </param>
+ <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Value which is returned via OnButtonPress / OnButtonEvent</description>
+ </param>
+ <param name="systemAction" type="SystemAction" defvalue="DEFAULT_ACTION" mandatory="false">
+ <description>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</description>
+ </param>
+ </struct>
+
+ <struct name="Choice" since="1.0">
+ <description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true"/>
+ <param name="menuName" type="String" maxlength="500" mandatory="true"/>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false" since="5.0">
+ <history>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true" since="1.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="image" type="Image" mandatory="false" since="2.0" />
+ <param name="secondaryText" maxlength="500" type="String" mandatory="false" since="3.0">
+ <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
+ </param>
+ <param name="tertiaryText" maxlength="500" type="String" mandatory="false" since="3.0">
+ <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
+ </param>
+ <param name="secondaryImage" type="Image" mandatory="false" since="3.0">
+ <description>Optional secondary image struct for choice</description>
+ </param>
+ </struct>
+
+ <struct name="VrHelpItem" since="2.0">
+ <param name="text" maxlength="500" type="String" mandatory="true">
+ <description>Text to display for VR Help item</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Image struct for VR Help item</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
+ <description>Position to display item in VR Help list</description>
+ </param>
+ </struct>
+
+ <struct name="SyncMsgVersion" since="1.0">
+ <description>Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application</description>
+
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10" mandatory="true">
+ <description>The major version indicates versions that is not-compatible to previous versions.</description>
+ </param>
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
+ <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
+ </param>
+ <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false" since="4.3">
+ <description>The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version </description>
+ </param>
+ </struct>
+
+ <enum name="GlobalProperty" since="1.0">
+ <description>The different global properties.</description>
+ <element name="HELPPROMPT" since="1.0">
+ <description>The property helpPrompt of setGlobalProperties</description>
+ </element>
+ <element name="TIMEOUTPROMPT" since="1.0">
+ <description>The property timeoutPrompt of setGlobalProperties</description>
+ </element>
+ <element name="VRHELPTITLE" since="2.0">
+ <description>The property vrHelpTitle of setGlobalProperties</description>
+ </element>
+ <element name="VRHELPITEMS" since="2.0">
+ <description>The property array of vrHelp of setGlobalProperties</description>
+ </element>
+ <element name="MENUNAME" since="3.0">
+ <description>The property in-app menu name of setGlobalProperties</description>
+ </element>
+ <element name="MENUICON" since="3.0">
+ <description>The property in-app menu icon of setGlobalProperties</description>
+ </element>
+ <element name="KEYBOARDPROPERTIES" since="3.0">
+ <description>The on-screen keyboard configuration of setGlobalProperties</description>
+ </element>
+ </enum>
+
+ <enum name="CompassDirection" since="2.0">
+ <description>The list of potential compass directions</description>
+ <element name="NORTH">
+ </element>
+ <element name="NORTHWEST">
+ </element>
+ <element name="WEST">
+ </element>
+ <element name="SOUTHWEST">
+ </element>
+ <element name="SOUTH">
+ </element>
+ <element name="SOUTHEAST">
+ </element>
+ <element name="EAST">
+ </element>
+ <element name="NORTHEAST">
+ </element>
+ </enum>
+
+ <enum name="Dimension" since="2.0">
+ <description>The supported dimensions of the GPS</description>
+ <element name="NO_FIX" internal_name="Dimension_NO_FIX">
+ <description>No GPS at all</description>
+ </element>
+ <element name="2D" internal_name="Dimension_2D">
+ <description>Longitude and latitude</description>
+ </element>
+ <element name="3D" internal_name="Dimension_3D">
+ <description>Longitude and latitude and altitude</description>
+ </element>
+ </enum>
+
+ <enum name="PRNDL" since="2.0">
+ <description>The selected gear.</description>
+ <element name="PARK">
+ <description>Parking</description>
+ </element>
+ <element name="REVERSE">
+ <description>Reverse gear</description>
+ </element>
+ <element name="NEUTRAL">
+ <description>No gear</description>
+ </element>
+ <element name="DRIVE">
+ </element>
+ <element name="SPORT">
+ <description>Drive Sport mode</description>
+ </element>
+ <element name="LOWGEAR">
+ <description>1st gear hold</description>
+ </element>
+ <element name="FIRST">
+ </element>
+ <element name="SECOND">
+ </element>
+ <element name="THIRD">
+ </element>
+ <element name="FOURTH">
+ </element>
+ <element name="FIFTH">
+ </element>
+ <element name="SIXTH">
+ </element>
+ <element name="SEVENTH">
+ </element>
+ <element name="EIGHTH">
+ </element>
+ <element name="UNKNOWN">
+ </element>
+ <element name="FAULT">
+ </element>
+ </enum>
+
+ <enum name="ComponentVolumeStatus" since="2.0">
+ <description>The volume status of a vehicle component.</description>
+ <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
+ </element>
+ <element name="NORMAL" internal_name="CVS_NORMAL">
+ </element>
+ <element name="LOW" internal_name="CVS_LOW">
+ </element>
+ <element name="FAULT" internal_name="CVS_FAULT">
+ </element>
+ <element name="ALERT" internal_name="CVS_ALERT">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
+ </element>
+ </enum>
+
+ <enum name="TPMS" since="5.0">
+ <element name="UNKNOWN">
+ <description>If set the status of the tire is not known.</description>
+ </element>
+ <element name="SYSTEM_FAULT">
+ <description>TPMS does not function.</description>
+ </element>
+ <element name="SENSOR_FAULT">
+ <description>The sensor of the tire does not function.</description>
+ </element>
+ <element name="LOW">
+ <description>TPMS is reporting a low tire pressure for the tire.</description>
+ </element>
+ <element name="SYSTEM_ACTIVE">
+ <description>TPMS is active and the tire pressure is monitored.</description>
+ </element>
+ <element name="TRAIN">
+ <description>TPMS is reporting that the tire must be trained.</description>
+ </element>
+ <element name="TRAINING_COMPLETE">
+ <description>TPMS reports the training for the tire is completed.</description>
+ </element>
+ <element name="NOT_TRAINED">
+ <description>TPMS reports the tire is not trained.</description>
+ </element>
+ </enum>
+
+ <enum name="FuelType" since="5.0">
+ <element name="GASOLINE" />
+ <element name="DIESEL" />
+ <element name="CNG">
+ <description>
+ For vehicles using compressed natural gas.
+ </description>
+ </element>
+ <element name="LPG">
+ <description>
+ For vehicles using liquefied petroleum gas.
+ </description>
+ </element>
+ <element name="HYDROGEN">
+ <description>For FCEV (fuel cell electric vehicle).</description>
+ </element>
+ <element name="BATTERY">
+ <description>For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery.</description>
+ </element>
+ </enum>
+
+ <struct name="FuelRange" since="5.0">
+ <param name="type" type="FuelType" mandatory="false"/>
+ <param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
+ <description>
+ The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ </description>
+ </param>
+ </struct>
+
+ <enum name="ElectronicParkBrakeStatus" since="5.0">
+ <element name="CLOSED">
+ <description>
+ Park brake actuators have been fully applied.
+ </description>
+ </element>
+ <element name="TRANSITION">
+ <description>
+ Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
+ </description>
+ </element>
+ <element name="OPEN">
+ <description>
+ Park brake actuators are released.
+ </description>
+ </element>
+ <element name="DRIVE_ACTIVE">
+ <description>
+ When driver pulls the Electronic Park Brake switch while driving "at speed".
+ </description>
+ </element>
+ <element name="FAULT">
+ <description>
+ When system has a fault or is under maintenance.
+ </description>
+ </element>
+ </enum>
+
+ <struct name="SingleTireStatus" since="2.0">
+ <param name="status" type="ComponentVolumeStatus" mandatory="true">
+ <description>See ComponentVolumeStatus.</description>
+ </param>
+ <param name="tpms" type="TPMS" mandatory="false" since="5.0">
+ <description>
+ The status of TPMS according to the particular tire.
+ </description>
+ </param>
+ <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000" since="5.0">
+ <description>The pressure value of the particular tire in kilo pascal.</description>
+ </param>
+ </struct>
+
+ <enum name="WarningLightStatus" since="2.0">
+ <description>Reflects the status of a cluster instrument warning light.</description>
+ <element name="OFF" internal_name="WLS_OFF">
+ </element>
+ <element name="ON" internal_name="WLS_ON">
+ </element>
+ <element name="FLASH" internal_name="WLS_FLASH">
+ </element>
+ <element name="NOT_USED" internal_name="WLS_NOT_USED">
+ </element>
+ </enum>
+
+ <enum name="VehicleDataNotificationStatus" since="2.0">
+ <description>Reflects the status of a vehicle data notification.</description>
+ <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
+ </element>
+ <element name="NORMAL" internal_name="VDNS_NORMAL">
+ </element>
+ <element name="ACTIVE" internal_name="VDNS_ACTIVE">
+ </element>
+ <element name="NOT_USED" internal_name="VDNS_NOT_USED">
+ </element>
+ </enum>
+
+ <enum name="IgnitionStableStatus" since="2.0">
+ <description>Reflects the ignition switch stability.</description>
+ <element name="IGNITION_SWITCH_NOT_STABLE">
+ </element>
+ <element name="IGNITION_SWITCH_STABLE">
+ </element>
+ <element name="MISSING_FROM_TRANSMITTER">
+ </element>
+ </enum>
+
+ <enum name="IgnitionStatus" since="2.0">
+ <description>Reflects the status of ignition.</description>
+ <element name="UNKNOWN" internal_name="IS_UNKNOWN">
+ </element>
+ <element name="OFF" internal_name="IS_OFF">
+ </element>
+ <element name="ACCESSORY" internal_name="IS_ACCESSORY">
+ </element>
+ <element name="RUN" internal_name="IS_RUN">
+ </element>
+ <element name="START" internal_name="IS_START">
+ </element>
+ <element name="INVALID" internal_name="IS_INVALID">
+ </element>
+ </enum>
+
+ <enum name="VehicleDataEventStatus" since="2.0">
+ <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
+ <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
+ </element>
+ <element name="NO" internal_name="VDES_NO">
+ </element>
+ <element name="YES" internal_name="VDES_YES">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
+ </element>
+ <element name="FAULT" internal_name="VDES_FAULT">
+ </element>
+ </enum>
+
+ <enum name="DeviceLevelStatus" since="2.0">
+ <description>Reflects the reported battery status of the connected device, if reported.</description>
+ <element name="ZERO_LEVEL_BARS">
+ </element>
+ <element name="ONE_LEVEL_BARS">
+ </element>
+ <element name="TWO_LEVEL_BARS">
+ </element>
+ <element name="THREE_LEVEL_BARS">
+ </element>
+ <element name="FOUR_LEVEL_BARS">
+ </element>
+ <element name="NOT_PROVIDED">
+ </element>
+ </enum>
+
+ <enum name="PrimaryAudioSource" since="2.0">
+ <description>Reflects the current primary audio source (if selected).</description>
+ <element name="NO_SOURCE_SELECTED">
+ </element>
+ <element name="CD" since="5.0">
+ </element>
+ <element name="USB">
+ </element>
+ <element name="USB2">
+ </element>
+ <element name="BLUETOOTH_STEREO_BTST">
+ </element>
+ <element name="LINE_IN">
+ </element>
+ <element name="IPOD">
+ </element>
+ <element name="MOBILE_APP">
+ </element>
+ <element name="AM" since="5.0">
+ </element>
+ <element name="FM" since="5.0">
+ </element>
+ <element name="XM" since="5.0">
+ </element>
+ <element name="DAB" since="5.0">
+ </element>
+ </enum>
+
+ <enum name="WiperStatus" since="2.0">
+ <description>Reflects the status of the wipers.</description>
+ <element name="OFF" />
+ <element name="AUTO_OFF" />
+ <element name="OFF_MOVING" />
+ <element name="MAN_INT_OFF" />
+ <element name="MAN_INT_ON" />
+ <element name="MAN_LOW" />
+ <element name="MAN_HIGH" />
+ <element name="MAN_FLICK" />
+ <element name="WASH" />
+ <element name="AUTO_LOW" />
+ <element name="AUTO_HIGH" />
+ <element name="COURTESYWIPE" />
+ <element name="AUTO_ADJUST" />
+ <element name="STALLED" />
+ <element name="NO_DATA_EXISTS" />
+ </enum>
+
+ <enum name="VehicleDataStatus" since="2.0">
+ <description>Reflects the status of a binary vehicle data item.</description>
+ <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
+ </element>
+ <element name="OFF" internal_name="VDS_OFF">
+ </element>
+ <element name="ON" internal_name="VDS_ON">
+ </element>
+ </enum>
+
+ <enum name="MaintenanceModeStatus" since="2.0">
+ <description>Reflects the status of a vehicle maintenance mode.</description>
+ <element name="NORMAL" internal_name="MMS_NORMAL">
+ </element>
+ <element name="NEAR" internal_name="MMS_NEAR">
+ </element>
+ <element name="ACTIVE" internal_name="MMS_ACTIVE">
+ </element>
+ <element name="FEATURE_NOT_PRESENT" internal_name="MMS_FEATURE_NOT_PRESENT">
+ </element>
+ </enum>
+
+ <enum name="VehicleDataActiveStatus" since="2.0">
+ <description>Reflects the status of given vehicle component.</description>
+ <element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
+ </element>
+ <element name="INACTIVE_CONFIRMED" internal_name="VDAS_INACTIVE_CONFIRMED">
+ </element>
+ <element name="ACTIVE_NOT_CONFIRMED" internal_name="VDAS_ACTIVE_NOT_CONFIRMED">
+ </element>
+ <element name="ACTIVE_CONFIRMED" internal_name="VDAS_ACTIVE_CONFIRMED">
+ </element>
+ <element name="FAULT" internal_name="VDAS_FAULT">
+ </element>
+ </enum>
+
+ <enum name="AmbientLightStatus" since="2.0">
+ <description>Reflects the status of the ambient light sensor.</description>
+ <element name="NIGHT" />
+ <element name="TWILIGHT_1" />
+ <element name="TWILIGHT_2" />
+ <element name="TWILIGHT_3" />
+ <element name="TWILIGHT_4" />
+ <element name="DAY" />
+ <element name="UNKNOWN" internal_name="ALS_UNKNOWN" />
+ <element name="INVALID" />
+ </enum>
+
+ <enum name="ModuleType" since="4.5">
+ <element name="CLIMATE"/>
+ <element name="RADIO"/>
+ <element name="SEAT" since="5.0"/>
+ <element name="AUDIO" since="5.0"/>
+ <element name="LIGHT" since="5.0"/>
+ <element name="HMI_SETTINGS" since="5.0"/>
+ </enum>
+
+ <enum name="DefrostZone" since="4.5">
+ <element name="FRONT"/>
+ <element name="REAR"/>
+ <element name="ALL"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="VentilationMode" since="4.5">
+ <element name="UPPER"/>
+ <element name="LOWER"/>
+ <element name="BOTH"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="RadioBand" since="4.5">
+ <element name="AM"/>
+ <element name="FM"/>
+ <element name="XM"/>
+ </enum>
+
+ <enum name="RadioState" since="4.5">
+ <element name="ACQUIRING"/>
+ <element name="ACQUIRED"/>
+ <element name="MULTICAST"/>
+ <element name="NOT_FOUND"/>
+ </enum>
+
+ <enum name="TemperatureUnit" since="4.5">
+ <element name="FAHRENHEIT"/>
+ <element name="CELSIUS"/>
+ </enum>
+
+ <struct name="BeltStatus" since="2.0">
+ <param name="driverBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverBuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerChildDetected" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRearInflatableBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRearInflatableBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="BodyInformation" since="2.0">
+ <param name="parkBrakeActive" type="Boolean" mandatory="true">
+ <description>References signal "PrkBrkActv_B_Actl".</description>
+ </param>
+ <param name="ignitionStableStatus" type="IgnitionStableStatus" mandatory="true">
+ <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
+ </param>
+ <param name="ignitionStatus" type="IgnitionStatus" mandatory="true">
+ <description>References signal "Ignition_status". See IgnitionStatus.</description>
+ </param>
+ <param name="driverDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatDrv_B_Actl".</description>
+ </param>
+ <param name="passengerDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatPsngr_B_Actl".</description>
+ </param>
+ <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRl_B_Actl".</description>
+ </param>
+ <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRr_B_Actl".</description>
+ </param>
+ </struct>
+
+ <struct name="DeviceStatus" since="2.0">
+ <param name="voiceRecOn" type="Boolean" mandatory="true">
+ <description>References signal "CPM_VoiceRec_STAT".</description>
+ </param>
+ <param name="btIconOn" type="Boolean" mandatory="true">
+ <description>References signal "BT_ICON".</description>
+ </param>
+ <param name="callActive" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Call_Active_STAT".</description>
+ </param>
+ <param name="phoneRoaming" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Phone_Roaming_STAT".</description>
+ </param>
+ <param name="textMsgAvailable" type="Boolean" mandatory="true">
+ <description>References signal "CPM_TextMsg_AVAL".</description>
+ </param>
+ <param name="battLevelStatus" type="DeviceLevelStatus" mandatory="true">
+ <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="stereoAudioOutputMuted" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Stereo_Audio_Output".</description>
+ </param>
+ <param name="monoAudioOutputMuted" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Mono_Audio_Output".</description>
+ </param>
+ <param name="signalLevelStatus" type="DeviceLevelStatus" mandatory="true">
+ <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="primaryAudioSource" type="PrimaryAudioSource" mandatory="true">
+ <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
+ </param>
+ <param name="eCallEventActive" type="Boolean" mandatory="true">
+ <description>References signal "eCall_Event".</description>
+ </param>
+ </struct>
+
+ <struct name="HeadLampStatus" since="2.0">
+ <param name="lowBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
+ </param>
+ <param name="highBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat".</description>
+ </param>
+ <param name="ambientLightSensorStatus" type="AmbientLightStatus" mandatory="false">
+ <description>Status of the ambient light sensor.</description>
+ </param>
+ </struct>
+
+ <struct name="AppInfo" since="4.2">
+ <description>Contains detailed information about the registered application.</description>
+
+ <param name="appDisplayName" type="String" maxlength="100" mandatory="true">
+ <description>The name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request).</description>
+ </param>
+
+ <param name="appBundleID" type="String" maxlength="256" mandatory="true">
+ <description>The AppBundleID of an iOS application or package name of the Android application. This supports App Launch strategies for each platform.</description>
+ </param>
+
+ <param name="appVersion" type="String" maxlength="256" mandatory="true">
+ <description>Represents the build version number of this particular mobile app.</description>
+ </param>
+
+ <param name="appIcon" type="String" maxlength="500" mandatory="false">
+ <description>A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration).</description>
+ </param>
+ </struct>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- Ford Specific Data Items -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <enum name="FileType" since="2.0">
+ <description>Enumeration listing possible file types.</description>
+ <element name="GRAPHIC_BMP" />
+ <element name="GRAPHIC_JPEG" />
+ <element name="GRAPHIC_PNG" />
+ <element name="AUDIO_WAVE" />
+ <element name="AUDIO_MP3" />
+ <element name="AUDIO_AAC" />
+ <element name="BINARY" />
+ <element name="JSON" />
+ </enum>
+
+ <enum name="FuelCutoffStatus" since="2.0">
+ <description>Reflects the status of the RCM fuel cutoff.</description>
+ <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
+ </element>
+ <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
+ </element>
+ <element name="FAULT" internal_name="FCS_FAULT">
+ </element>
+ </enum>
+
+ <enum name="EmergencyEventType" since="2.0">
+ <description>Reflects the emergency event status of the vehicle.</description>
+ <element name="NO_EVENT" internal_name="EET_NO_EVENT">
+ </element>
+ <element name="FRONTAL" internal_name="EET_FRONTAL">
+ </element>
+ <element name="SIDE" internal_name="EET_SIDE">
+ </element>
+ <element name="REAR" internal_name="EET_REAR">
+ </element>
+ <element name="ROLLOVER" internal_name="EET_ROLLOVER">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
+ </element>
+ <element name="FAULT" internal_name="EET_FAULT">
+ </element>
+ </enum>
+
+ <enum name="ECallConfirmationStatus" since="2.0">
+ <description>Reflects the status of the eCall Notification.</description>
+ <element name="NORMAL" internal_name="ECCS_NORMAL">
+ </element>
+ <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
+ </element>
+ <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
+ </element>
+ <element name="CALL_COMPLETED">
+ </element>
+ <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
+ </element>
+ <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
+ </element>
+ <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
+ </element>
+ </enum>
+
+ <enum name="PowerModeQualificationStatus" since="2.0">
+ <description>Reflects the status of the current power mode qualification.</description>
+ <element name="POWER_MODE_UNDEFINED">
+ </element>
+ <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
+ </element>
+ <element name="NOT_DEFINED">
+ </element>
+ <element name="POWER_MODE_OK">
+ </element>
+ </enum>
+
+ <enum name="PowerModeStatus" since="2.0">
+ <description>Reflects the status of the current power mode.</description>
+ <element name="KEY_OUT">
+ </element>
+ <element name="KEY_RECENTLY_OUT">
+ </element>
+ <element name="KEY_APPROVED_0">
+ </element>
+ <element name="POST_ACCESORY_0">
+ </element>
+ <element name="ACCESORY_1">
+ </element>
+ <element name="POST_IGNITION_1">
+ </element>
+ <element name="IGNITION_ON_2">
+ </element>
+ <element name="RUNNING_2">
+ </element>
+ <element name="CRANK_3">
+ </element>
+ </enum>
+
+ <enum name="CarModeStatus" since="2.0">
+ <description>Reflects the status of the current car mode.</description>
+ <element name="NORMAL" internal_name="CMS_NORMAL">
+ </element>
+ <element name="FACTORY" internal_name="CMS_FACTORY">
+ </element>
+ <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
+ </element>
+ <element name="CRASH" internal_name="CMS_CRASH">
+ </element>
+ </enum>
+
+ <struct name="ECallInfo" since="2.0">
+ <param name="eCallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
+ <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
+ <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="eCallConfirmationStatus" type="ECallConfirmationStatus" mandatory="true">
+ <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="AirbagStatus" since="2.0">
+ <param name="driverAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="EmergencyEvent" since="2.0">
+ <param name="emergencyEventType" type="EmergencyEventType" mandatory="true">
+ <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
+ </param>
+ <param name="fuelCutoffStatus" type="FuelCutoffStatus" mandatory="true">
+ <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
+ </param>
+ <param name="rolloverEvent" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+
+ <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255" mandatory="true">
+ <description>References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values:
+ 0x00 No event
+ 0xFE Not supported
+ 0xFF Fault
+ </description>
+ </param>
+ <param name="multipleEvents" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="ClusterModeStatus" since="2.0">
+ <param name="powerModeActive" type="Boolean" mandatory="true">
+ <description>References signal "PowerMode_UB".</description>
+ </param>
+ <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus" mandatory="true">
+ <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
+ </param>
+ <param name="carModeStatus" type="CarModeStatus" mandatory="true">
+ <description>References signal "CarMode". See CarMode.</description>
+ </param>
+ <param name="powerModeStatus" type="PowerModeStatus" mandatory="true">
+ <description>References signal "PowerMode". See PowerMode.</description>
+ </param>
+ </struct>
+
+ <struct name="MyKey" since="2.0">
+ <param name="e911Override" type="VehicleDataStatus" mandatory="true">
+ <description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
+ </param>
+ </struct>
+
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- / Ford Specific Data Items -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <enum name="VehicleDataResultCode" since="2.0">
+ <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
+ <element name="SUCCESS" internal_name="VDRC_SUCCESS">
+ <description>Individual vehicle data item / DTC / DID request or subscription successful</description>
+ </element>
+ <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA">
+ <description>DTC / DID request successful, however, not all active DTCs or full contents of DID location available</description>
+ </element>
+ <element name="DISALLOWED" internal_name="VDRC_DISALLOWED">
+ <description>This vehicle data item is not allowed for this app by Ford.</description>
+ </element>
+ <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED">
+ <description>The user has not granted access to this type of vehicle data item at this time.</description>
+ </element>
+ <element name="INVALID_ID" internal_name="VDRC_INVALID_ID">
+ <description>The ECU ID referenced is not a valid ID on the bus / system.</description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE">
+ <description>The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system.</description>
+ </element>
+ <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED">
+ <description>The vehicle data item is already subscribed.</description>
+ </element>
+ <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED">
+ <description>The vehicle data item cannot be unsubscribed because it is not currently subscribed.</description>
+ </element>
+ <element name="IGNORED" internal_name="VDRC_IGNORED">
+ <description>The request for this item is ignored because it is already in progress.</description>
+ </element>
+ </enum>
+
+ <struct name="TireStatus" since="2.0">
+ <description>The status and pressure of the tires.</description>
+
+ <param name="pressureTelltale" type="WarningLightStatus" mandatory="true">
+ <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
+ </param>
+ <param name="leftFront" type="SingleTireStatus" mandatory="true">
+ <description>The status of the left front tire.</description>
+ </param>
+ <param name="rightFront" type="SingleTireStatus" mandatory="true">
+ <description>The status of the right front tire.</description>
+ </param>
+ <param name="leftRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the left rear tire.</description>
+ </param>
+ <param name="rightRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the right rear tire.</description>
+ </param>
+ <param name="innerLeftRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the inner left rear.</description>
+ </param>
+ <param name="innerRightRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the inner right rear.</description>
+ </param>
+ </struct>
+
+ <enum name="TurnSignal" since="5.0">
+ <description>Enumeration that describes the status of the turn light indicator.</description>
+ <element name="OFF">
+ <description>Turn signal is OFF</description>
+ </element>
+ <element name="LEFT">
+ <description>Left turn signal is on</description>
+ </element>
+ <element name="RIGHT">
+ <description>Right turn signal is on</description>
+ </element>
+ <element name="BOTH">
+ <description>Both signals (left and right) are on.</description>
+ </element>
+ </enum>
+
+ <struct name="GPSData" since="2.0">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false" since="5.0">
+ <description>The current UTC year.</description>
+ <history>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="5.0">
+ <description>The current UTC month.</description>
+ <history>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="5.0">
+ <description>The current UTC day.</description>
+ <history>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="5.0">
+ <description>The current UTC hour.</description>
+ <history>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
+ <description>The current UTC minute.</description>
+ <history>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
+ <description>The current UTC second.</description>
+ <history>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="compassDirection" type="CompassDirection" mandatory="false" since="5.0">
+ <description>See CompassDirection.</description>
+ <history>
+ <param name="compassDirection" type="CompassDirection" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
+ <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
+ <history>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
+ <description>HDOP. If value is unknown, value shall be set to 0.</description>
+ <history>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
+ <description>VDOP. If value is unknown, value shall be set to 0.</description>
+ <history>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="actual" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ True, if actual.
+ False, if inferred.
+ </description>
+ <history>
+ <param name="actual" type="Boolean" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false" since="5.0">
+ <description>Number of satellites in view</description>
+ <history>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="dimension" type="Dimension" mandatory="false" since="5.0">
+ <description>See Dimension</description>
+ <history>
+ <param name="dimension" type="Dimension" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false" since="5.0">
+ <description>Altitude in meters</description>
+ <history>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false" since="5.0">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ <history>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false" since="5.0">
+ <description>The speed in KPH</description>
+ <history>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true" since="2.0" until="5.0"/>
+ </history>
+ </param>
+ </struct>
+
+ <struct name="VehicleDataResult" since="2.0">
+ <description>Individual published data request result</description>
+ <param name="dataType" type="VehicleDataType" mandatory="true">
+ <description>Defined published data element type.</description>
+ </param>
+ <param name="resultCode" type="VehicleDataResultCode" mandatory="true">
+ <description>Published data result code.</description>
+ </param>
+ </struct>
+
+ <struct name="DIDResult" since="2.0">
+ <description>Individual requested DID result and data</description>
+ <param name="resultCode" type="VehicleDataResultCode" mandatory="true">
+ <description>Individual DID result code.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Location of raw data from vehicle data DID</description>
+ </param>
+ <param name="data" type="String" maxlength="5000" mandatory="false">
+ <description>Raw DID-based data returned for requested element.</description>
+ </param>
+ </struct>
+
+ <struct name="StartTime" since="1.0">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <description>
+ The hour of the media clock.
+ Some radios only support a max of 19 hours. If out of range, it will be rejected.
+ </description>
+ </param>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ </struct>
+
+ <struct name="TextField" since="1.0">
+ <param name="name" type="TextFieldName" mandatory="true">
+ <description>The name that identifies the field. See TextFieldName.</description>
+ </param>
+ <param name="characterSet" type="CharacterSet" mandatory="true">
+ <description>The character set that is supported in this field. See CharacterSet.</description>
+ </param>
+ <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
+ <description>The number of characters in one row of this field.</description>
+ </param>
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
+ <description>The number of rows of this field.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageResolution" since="3.0">
+ <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution width.</description>
+ </param>
+ <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution height.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageField" since="3.0">
+ <param name="name" type="ImageFieldName" mandatory="true">
+ <description>The name that identifies the field. See ImageFieldName.</description>
+ </param>
+ <param name="imageTypeSupported" type="FileType" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>The image types that are supported in this field. See FileType.</description>
+ </param>
+ <param name="imageResolution" type="ImageResolution" mandatory="false">
+ <description>The image resolution of this field.</description>
+ </param>
+ </struct>
+
+ <struct name="TouchCoord" since="3.0">
+ <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
+ <description>The x coordinate of the touch.</description>
+ </param>
+ <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
+ <description>The y coordinate of the touch.</description>
+ </param>
+ </struct>
+
+ <enum name="TouchType" since="3.0">
+ <element name="BEGIN"/>
+ <element name="MOVE"/>
+ <element name="END"/>
+ <element name="CANCEL" since="4.5"/>
+ </enum>
+
+ <struct name="TouchEvent" since="3.0">
+ <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
+ <description>
+ A touch's unique identifier. The application can track the current touch events by id.
+ If a touch event has type begin, the id should be added to the set of touches.
+ If a touch event has type end, the id should be removed from the set of touches.
+ </description>
+ </param>
+ <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="1000">
+ <description>
+ The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
+ The timestamp is used to determined the rate of change of position of a touch.
+ The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
+ If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
+ </description>
+ </param>
+ <param name="c" type="TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
+ </param>
+ </struct>
+
+ <struct name="TouchEventCapabilities" since="3.0">
+ <param name="pressAvailable" type="Boolean" mandatory="true">
+ </param>
+ <param name="multiTouchAvailable" type="Boolean" mandatory="true">
+ </param>
+ <param name="doublePressAvailable" type="Boolean" mandatory="true">
+ </param>
+ </struct>
+
+ <struct name="ScreenParams" since="3.0">
+ <param name="resolution" type="ImageResolution" mandatory="true">
+ <description>The resolution of the prescribed screen area.</description>
+ </param>
+ <param name="touchEventAvailable" type="TouchEventCapabilities" mandatory="false">
+ <description>Types of screen touch events available in screen area.</description>
+ </param>
+ </struct>
+
+ <enum name="PermissionStatus" since="2.0">
+ <description>Enumeration that describes possible permission states of a policy table entry.</description>
+ <element name="ALLOWED" internal_name="PS_ALLOWED"/>
+ <element name="DISALLOWED" internal_name="PS_DISALLOWED"/>
+ <element name="USER_DISALLOWED" internal_name="PS_USER_DISALLOWED"/>
+ <element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
+ </enum>
+
+ <struct name="HMIPermissions" since="2.0">
+ <param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all HMI levels that are permitted for this given RPC.</description>
+ </param>
+ <param name="userDisallowed" type="HMILevel" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all HMI levels that are prohibited for this given RPC.</description>
+ </param>
+ </struct>
+
+ <struct name="ParameterPermissions" since="2.0">
+ <param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true" mandatory="true">
+ <description>A set of all parameters that are permitted for this given RPC.</description>
+ </param>
+ <param name="userDisallowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true" mandatory="true">
+ <description>A set of all parameters that are prohibited for this given RPC.</description>
+ </param>
+ </struct>
+
+ <struct name="PermissionItem" since="2.0">
+ <param name="rpcName" type="String" maxlength="100" mandatory="true">
+ <description>Name of the individual RPC in the policy table.</description>
+ </param>
+ <param name="hmiPermissions" type="HMIPermissions" mandatory="true"/>
+ <param name="parameterPermissions" type="ParameterPermissions" mandatory="true"/>
+ </struct>
+
+ <struct name="DisplayCapabilities" since="1.0">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayType" type="DisplayType" mandatory="true" deprecated="true" since="5.0">
+ <description>The type of the display. See DisplayType</description>
+ <history>
+ <param name="displayType" type="DisplayType" mandatory="true" since="1.0" until="5.0"/>
+ </history>
+ </param>
+ <param name="displayName" type="String" mandatory="false" since="5.0">
+ <description>The name of the display the app is connected to.</description>
+ </param>
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>A set of all fields that support text data. See TextField</description>
+ </param>
+ <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support images. See ImageField</description>
+ </param>
+ <param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
+ </param>
+ <param name="graphicSupported" type="Boolean" mandatory="true" since="2.0">
+ <description>The display's persistent screen supports referencing a static or dynamic image.</description>
+ </param>
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false" since="3.0">
+ <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
+ </param>
+ <param name="screenParams" type="ScreenParams" mandatory="false" since="3.0">
+ <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
+ </param>
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false" since="3.0">
+ <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
+ </param>
+
+ <!-- TODO: Add pixel density? -->
+ </struct>
+
+ <struct name="ButtonCapabilities" since="1.0">
+ <description>Contains information about a button's capabilities.</description>
+ <param name="name" type="ButtonName" mandatory="true">
+ <description>The name of the button. See ButtonName.</description>
+ </param>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports a short press.
+ Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ </description>
+ </param>
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports a LONG press.
+ Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ </description>
+ </param>
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports "button down" and "button up".
+ Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ Whenever the button is released, onButtonEvent( UP) will be invoked.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="SoftButtonCapabilities" since="2.0">
+ <description>Contains information about a SoftButton's capabilities.</description>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports a short press.
+ Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ </description>
+ </param>
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports a LONG press.
+ Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ </description>
+ </param>
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
+ <description>
+ The button supports "button down" and "button up".
+ Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ Whenever the button is released, onButtonEvent( UP) will be invoked.
+ </description>
+ </param>
+ <param name="imageSupported" type="Boolean" mandatory="true">
+ <description>The button supports referencing a static or dynamic image.</description>
+ </param>
+ </struct>
+
+ <struct name="PresetBankCapabilities" since="2.0">
+ <description>Contains information about on-screen preset capabilities.</description>
+ <param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
+ <description>Onscreen custom presets are available.</description>
+ </param>
+ </struct>
+
+ <struct name="HMICapabilities" since="3.0">
+ <param name="navigation" type="Boolean" mandatory="false">
+ <description>Availability of build in Nav. True: Available, False: Not Available</description>
+ </param>
+ <param name="phoneCall" type="Boolean" mandatory="false">
+ <description>Availability of build in phone. True: Available, False: Not Available </description>
+ </param>
+ <param name="videoStreaming" type="Boolean" mandatory="false" since="4.5">
+ <description>Availability of video streaming. </description>
+ </param>
+ <param name="remoteControl" type="Boolean" mandatory="false" since="4.5">
+ <description>Availability of remote control feature. True: Available, False: Not Available</description>
+ </param>
+ </struct>
+
+ <struct name="MenuParams" since="1.0">
+ <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" defvalue="0" mandatory="false">
+ <description>
+ unique ID of the sub menu, the command will be added to.
+ If not provided, it will be provided to the top level of the in application menu.
+ </description>
+ </param>
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>
+ Position within the items that are are at top level of the in application menu.
+ 0 will insert at the front.
+ 1 will insert at the second position.
+ if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
+ If this param was omitted the entry will be added at the end.
+ </description>
+ </param>
+ <param name="menuName" type="String" maxlength="500" mandatory="true">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+ </struct>
+
+ <struct name="TTSChunk" since="1.0">
+ <description>A TTS chunk, that consists of text/phonemes to speak or the name of a file to play, and a TTS type (like text or SAPI)</description>
+ <param name="text" minlength="0" maxlength="500" type="String" mandatory="true">
+ <description>
+ The text or phonemes to speak, or the name of the audio file to play.
+ May not be empty.
+ </description>
+ </param>
+
+ <param name="type" type="SpeechCapabilities" mandatory="true">
+ <description>Describes whether the TTS chunk is plain text, a specific phoneme set, or an audio file. See SpeechCapabilities</description>
+ </param>
+ </struct>
+
+ <struct name="Turn" since="2.0">
+ <param name="navigationText" type="String" maxlength="500" mandatory="false">
+ <description>Individual turn text. Must provide at least text or icon for a given turn.</description>
+ </param>
+ <param name="turnIcon" type="Image" mandatory="false">
+ <description>Individual turn icon. Must provide at least text or icon for a given turn.</description>
+ </param>
+ </struct>
+
+ <struct name="VehicleType" since="2.0">
+ <param name="make" type="String" maxlength="500" mandatory="false">
+ <description>Make of the vehicle, e.g. Ford</description>
+ </param>
+ <param name="model" type="String" maxlength="500" mandatory="false">
+ <description>Model of the vehicle, e.g. Fiesta</description>
+ </param>
+ <param name="modelYear" type="String" maxlength="500" mandatory="false">
+ <description>Model Year of the vehicle, e.g. 2013</description>
+ </param>
+ <param name="trim" type="String" maxlength="500" mandatory="false">
+ <description>Trim of the vehicle, e.g. SE</description>
+ </param>
+ </struct>
+
+ <enum name="KeyboardLayout" since="3.0">
+ <description>Enumeration listing possible keyboard layouts.</description>
+ <element name="QWERTY" />
+ <element name="QWERTZ" />
+ <element name="AZERTY" />
+ </enum>
+
+ <enum name="KeyboardEvent" since="3.0">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="KEYPRESS" />
+ <element name="ENTRY_SUBMITTED" />
+ <element name="ENTRY_VOICE" />
+ <element name="ENTRY_CANCELLED" />
+ <element name="ENTRY_ABORTED" />
+ </enum>
+
+ <enum name="KeypressMode" since="3.0">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="SINGLE_KEYPRESS">
+ <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
+ </element>
+ <element name="QUEUE_KEYPRESSES">
+ <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
+ </element>
+ <element name="RESEND_CURRENT_ENTRY">
+ <description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
+ </element>
+ </enum>
+
+ <struct name="KeyboardProperties" since="3.0">
+ <description>Configuration of on-screen keyboard (if available).</description>
+ <param name="language" type="Language" mandatory="false">
+ <description>The keyboard language.</description>
+ </param>
+ <param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
+ <description>Desired keyboard layout.</description>
+ </param>
+ <param name="keypressMode" type="KeypressMode" mandatory="false" >
+ <description>
+ Desired keypress mode.
+ If omitted, this value will be set to RESEND_CURRENT_ENTRY.
+ </description>
+ </param>
+ <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Array of keyboard characters to enable.</description>
+ <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
+ <description>If omitted, the entire keyboard will be enabled.</description>
+ </param>
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
+ <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
+ </param>
+ </struct>
+
+ <struct name="DeviceInfo" since="3.0">
+ <description>Various information about connecting device.</description>
+ <param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device model</description>
+ </param>
+ <param name="firmwareRev" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device firmware revision</description>
+ </param>
+ <param name="os" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device OS</description>
+ </param>
+ <param name="osVersion" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device OS version</description>
+ </param>
+ <param name="carrier" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device mobile carrier (if applicable)</description>
+ </param>
+ <param name="maxNumberRFCOMMPorts" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Omitted if connected not via BT.</description>
+ </param>
+ </struct>
+
+ <enum name="RequestType" since="3.0">
+ <description>Enumeration listing possible asynchronous requests.</description>
+ <element name="HTTP" />
+ <element name="FILE_RESUME" />
+ <element name="AUTH_REQUEST" />
+ <element name="AUTH_CHALLENGE" />
+ <element name="AUTH_ACK" />
+ <element name="PROPRIETARY" />
+ <element name="QUERY_APPS" />
+ <element name="LAUNCH_APP" />
+ <element name="LOCK_SCREEN_ICON_URL" />
+ <element name="TRAFFIC_MESSAGE_CHANNEL" />
+ <element name="DRIVER_PROFILE" />
+ <element name="VOICE_SEARCH" />
+ <element name="NAVIGATION" />
+ <element name="PHONE" />
+ <element name="CLIMATE" />
+ <element name="SETTINGS" />
+ <element name="VEHICLE_DIAGNOSTICS" />
+ <element name="EMERGENCY" />
+ <element name="MEDIA" />
+ <element name="FOTA" />
+ <element name="OEM_SPECIFIC" since="5.0" />
+ <element name="ICON_URL" since="5.1" />
+ </enum>
+
+ <enum name="AppHMIType" since="2.0">
+ <description>Enumeration listing possible app types.</description>
+ <element name="DEFAULT" />
+ <element name="COMMUNICATION" />
+ <element name="MEDIA" />
+ <element name="MESSAGING" />
+ <element name="NAVIGATION" />
+ <element name="INFORMATION" />
+ <element name="SOCIAL" />
+ <element name="BACKGROUND_PROCESS" />
+ <element name="TESTING" />
+ <element name="SYSTEM" />
+ <element name="PROJECTION" since="4.5" />
+ <element name="REMOTE_CONTROL" since="4.5" />
+ </enum>
+
+ <enum name="PredefinedLayout" platform="documentation" since="3.0">
+ <description>Predefined screen layout.</description>
+ <element name="DEFAULT" rootscreen="true">
+ <description>
+ Default media / non-media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="MEDIA" rootscreen="true">
+ <description>
+ Default Media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NON-MEDIA" internal_name="NON_MEDIA" rootscreen="true">
+ <description>
+ Default Non-media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="ONSCREEN_PRESETS" rootscreen="true">
+ <description>
+ Custom root media screen containing app-defined onscreen presets.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_FULLSCREEN_MAP" rootscreen="true" >
+ <description>
+ Custom root template screen containing full screen map with navigation controls.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_LIST" rootscreen="true" >
+ <description>
+ Custom root template screen containing video represented list.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_KEYBOARD" rootscreen="true" >
+ <description>
+ Custom root template screen containing video represented keyboard.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXT" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with lines of text.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXT_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing lines of text with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TILES_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only tiled SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXTBUTTONS_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only text SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TILES" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with tiled SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TILES_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing tiled SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with text and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing text and SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with text only SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXTBUTTONS_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing text only SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="LARGE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing a large graphic and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="DOUBLE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing two graphics and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="LARGE_GRAPHIC_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only a large graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ </enum>
+
+ <enum name="FunctionID" internal_scope="base" since="1.0">
+ <description>Enumeration linking function names with function IDs in AppLink protocol. Assumes enumeration starts at value 0.</description>
+ <element name="RESERVED" value="0" since="1.0" />
+ <!--
+ Base Request / Response RPCs
+ Range = 0x 0000 0001 - 0x 0000 7FFF
+ -->
+ <element name="RegisterAppInterfaceID" value="1" hexvalue="1" since="1.0" />
+ <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" since="1.0" />
+ <element name="SetGlobalPropertiesID" value="3" hexvalue="3" since="1.0" />
+ <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" since="1.0" />
+ <element name="AddCommandID" value="5" hexvalue="5" since="1.0" />
+ <element name="DeleteCommandID" value="6" hexvalue="6" since="1.0" />
+ <element name="AddSubMenuID" value="7" hexvalue="7" since="1.0" />
+ <element name="DeleteSubMenuID" value="8" hexvalue="8" since="1.0" />
+ <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" since="1.0" />
+ <element name="PerformInteractionID" value="10" hexvalue="A" since="1.0" />
+ <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" since="1.0" />
+ <element name="AlertID" value="12" hexvalue="C" since="1.0" />
+ <element name="ShowID" value="13" hexvalue="D" since="1.0" />
+ <element name="SpeakID" value="14" hexvalue="E" since="1.0" />
+ <element name="SetMediaClockTimerID" value="15" hexvalue="F" since="1.0" />
+ <element name="PerformAudioPassThruID" value="16" hexvalue="10" since="2.0" />
+ <element name="EndAudioPassThruID" value="17" hexvalue="11" since="2.0" />
+ <element name="SubscribeButtonID" value="18" hexvalue="12" since="1.0" />
+ <element name="UnsubscribeButtonID" value="19" hexvalue="13" since="1.0" />
+ <element name="SubscribeVehicleDataID" value="20" hexvalue="14" since="2.0" />
+ <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" since="2.0" />
+ <element name="GetVehicleDataID" value="22" hexvalue="16" since="2.0" />
+ <element name="ReadDIDID" value="23" hexvalue="17" since="2.0" />
+ <element name="GetDTCsID" value="24" hexvalue="18" since="2.0" />
+ <element name="ScrollableMessageID" value="25" hexvalue="19" since="2.0" />
+ <element name="SliderID" value="26" hexvalue="1A" since="2.0" />
+ <element name="ShowConstantTBTID" value="27" hexvalue="1B" since="2.0" />
+ <element name="AlertManeuverID" value="28" hexvalue="1C" since="2.0" />
+ <element name="UpdateTurnListID" value="29" hexvalue="1D" since="2.0" />
+ <element name="ChangeRegistrationID" value="30" hexvalue="1E" since="2.0" />
+ <element name="GenericResponseID" value="31" hexvalue="1F" since="1.0" />
+ <element name="PutFileID" value="32" hexvalue="20" since="3.0" />
+ <element name="DeleteFileID" value="33" hexvalue="21" since="3.0" />
+ <element name="ListFilesID" value="34" hexvalue="22" since="3.0" />
+ <element name="SetAppIconID" value="35" hexvalue="23" since="3.0" />
+ <element name="SetDisplayLayoutID" value="36" hexvalue="24" since="3.0" />
+ <element name="DiagnosticMessageID" value="37" hexvalue="25" since="3.0" />
+ <element name="SystemRequestID" value="38" hexvalue="26" since="3.0" />
+ <element name="SendLocationID" value="39" hexvalue="27" since="3.0" />
+ <element name="DialNumberID" value="40" hexvalue="28" since="3.0" />
+ <element name="ButtonPressID" value="41" hexvalue="29" since="4.5" />
+ <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" since="4.5" />
+ <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" since="4.5" />
+ <element name="GetWayPointsID" value="45" hexvalue="2D" since="4.1" />
+ <element name="SubscribeWayPointsID" value="46" hexvalue="2E" since="4.1" />
+ <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" since="4.1" />
+ <element name="GetSystemCapabilityID" value="48" hexvalue="30" since="4.5" />
+ <element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" />
+ <element name="SetCloudAppPropertiesID" value="50" hexvalue="32" since="5.1" />
+ <element name="GetCloudAppPropertiesID" value="51" hexvalue="33" since="5.1" />
+ <element name="PublishAppServiceID" value="52" hexvalue="34" since="5.1" />
+ <element name="GetAppServiceDataID" value="53" hexvalue="35" since="5.1" />
+ <element name="GetFileID" value="54" hexvalue="36" since="5.1" />
+ <element name="PerformAppServiceInteractionID" value="55" hexvalue="37" since="5.1" />
+
+ <!--
+ Base Notifications
+ Range = 0x 0000 8000 - 0x 0000 FFFF
+ -->
+
+ <element name="OnHMIStatusID" value="32768" hexvalue="8000" since="1.0" />
+ <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" since="1.0" />
+ <element name="OnButtonEventID" value="32770" hexvalue="8002" since="1.0" />
+ <element name="OnButtonPressID" value="32771" hexvalue="8003" since="1.0" />
+ <element name="OnVehicleDataID" value="32772" hexvalue="8004" since="2.0" />
+ <element name="OnCommandID" value="32773" hexvalue="8005" since="1.0" />
+ <element name="OnTBTClientStateID" value="32774" hexvalue="8006" since="1.0" />
+ <element name="OnDriverDistractionID" value="32775" hexvalue="8007" since="1.0" />
+ <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" since="2.0" />
+ <element name="OnAudioPassThruID" value="32777" hexvalue="8009" since="2.0" />
+ <element name="OnLanguageChangeID" value="32778" hexvalue="800A" since="2.0" />
+ <element name="OnKeyboardInputID" value="32779" hexvalue="800B" since="3.0" />
+ <element name="OnTouchEventID" value="32780" hexvalue="800C" since="3.0" />
+ <element name="OnSystemRequestID" value="32781" hexvalue="800D" since="3.0" />
+ <element name="OnHashChangeID" value="32782" hexvalue="800E" since="3.0" />
+ <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" since="4.5" />
+ <element name="OnWayPointChangeID" value="32784" hexvalue="8010" since="4.1" />
+ <element name="OnRCStatusID" value="32785" hexvalue="8011" since="5.0" />
+ <element name="OnAppServiceDataID" value="32786" hexvalue="8012" since="5.1" />
+ <element name="OnSystemCapabilityUpdatedID" value="32787" hexvalue="8013" since="5.1" />
+
+ <!--
+ Ford Specific Request / Response RPCs
+ Range = 0x 0001 0000 - 0x 0001 7FFF
+ -->
+
+ <element name="EncodedSyncPDataID" value="65536" hexvalue="10000" since="1.0" />
+ <element name="SyncPDataID" value="65537" hexvalue="10001" since="1.0" />
+
+ <!--
+ Ford Specific Notifications
+ Range = 0x 0001 8000 - 0x 0001 FFFF
+ -->
+
+ <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" since="1.0" />
+ <element name="OnSyncPDataID" value="98305" hexvalue="18001" since="1.0" />
+ </enum>
+
+ <enum name="messageType" since="1.0">
+ <description>
+ Enumeration linking message types with function types in WiPro protocol.
+ Assumes enumeration starts at value 0.
+ </description>
+ <element name="request" value="0" />
+ <element name="response" value="1" />
+ <element name="notification" value="2" />
+ </enum>
+
+ <struct name="DateTime" since="4.1">
+ <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false" since="4.2.2">
+ <description>Milliseconds </description>
+ </param>
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false" since="4.2.2">
+ <description>Seconds part of time</description>
+ <history>
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="4.2.2">
+ <description>Minutes part of time</description>
+ <history>
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="4.2.2">
+ <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
+ <history>
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="4.2.2">
+ <description>Day of the month</description>
+ <history>
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="4.2.2">
+ <description>Month of the year</description>
+ <history>
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="year" type="Integer" maxvalue="4095" mandatory="false" since="4.2.2">
+ <description>The year in YYYY format</description>
+ <history>
+ <param name="year" type="Integer" maxvalue="4095" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false" since="4.2.2">
+ <description>Time zone offset in Hours wrt UTC.</description>
+ <history>
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false" since="4.2.2">
+ <description>Time zone offset in Min wrt UTC.</description>
+ <history>
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
+ </history>
+ </param>
+ </struct>
+
+ <enum name="WayPointType" since="4.1">
+ <description>Describes what kind of waypoint is requested/provided.</description>
+ <element name="ALL" />
+ <element name="DESTINATION" />
+ </enum>
+
+ <struct name="Coordinate" since="4.1">
+ <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
+ <description>Latitude of the location.</description>
+ </param>
+ <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
+ <description>Longitude of the location.</description>
+ </param>
+ </struct>
+
+ <struct name="OASISAddress" since="4.1">
+ <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Name of the country (localized)</description>
+ </param>
+ <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
+ <description>Name of country (ISO 3166-2)</description>
+ </param>
+ <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
+ <description>(PLZ, ZIP, PIN, CAP etc.)</description>
+ </param>
+ <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of country (e.g. state)</description>
+ </param>
+ <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of e.g. state (e.g. county)</description>
+ </param>
+ <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for e.g. city/village</description>
+ </param>
+ <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for e.g. district</description>
+ </param>
+ <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for street, road etc.</description>
+ </param>
+ <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of thoroughfare e.g. house number</description>
+ </param>
+ </struct>
+
+ <struct name="LocationDetails" since="4.1">
+ <param name="coordinate" type="Coordinate" mandatory="false">
+ <description>Latitude/Longitude of the location.</description>
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description>Name of location.</description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>Location address for display purposes only</description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description>Description intended location / establishment (if applicable)</description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description>Phone number of location / establishment.</description>
+ </param>
+ <param name="locationImage" type="Image" mandatory="false">
+ <description>Image / icon of intended location.</description>
+ </param>
+ <param name="searchAddress" type="OASISAddress" mandatory="false">
+ <description>Address to be used by navigation engines for search</description>
+ </param>
+ </struct>
+
+ <enum name="SystemCapabilityType" since="4.5">
+ <description>Enumerations of all available system capability types</description>
+ <element name="NAVIGATION"/>
+ <element name="PHONE_CALL"/>
+ <element name="VIDEO_STREAMING"/>
+ <element name="REMOTE_CONTROL"/>
+ <element name="APP_SERVICES" since="5.1"/>
+ </enum>
+
+ <struct name="NavigationCapability" since="4.5">
+ <description>Extended capabilities for an onboard navigation system</description>
+ <param name="sendLocationEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to add locations to the onboard nav</description>
+ </param>
+ <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to return way points from onboard nav</description>
+ </param>
+ </struct>
+
+ <struct name="PhoneCapability" since="4.5">
+ <description>Extended capabilities of the module's phone feature</description>
+ <param name="dialNumberEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to perform dial number</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingFormat" since="4.5">
+ <description>Video streaming formats and their specifications.</description>
+ <param name="protocol" type="VideoStreamingProtocol" mandatory="true">
+ <description>Protocol type, see VideoStreamingProtocol</description>
+ </param>
+ <param name="codec" type="VideoStreamingCodec" mandatory="true">
+ <description>Codec type, see VideoStreamingCodec</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingCapability" since="4.5">
+ <description>Contains information about this system's video streaming capabilities.</description>
+ <param name="preferredResolution" type="ImageResolution" mandatory="false">
+ <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
+ </param>
+ <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
+ <description>The maximum bitrate of video stream that is supported, in kbps.</description>
+ </param>
+ <param name="supportedFormats" type="VideoStreamingFormat" array="true" mandatory="false">
+ <description>Detailed information on each format supported by this system, in its preferred order (i.e. the first element in the array is most preferable to the system). Each object will contain a VideoStreamingFormat that describes what can be expected.</description>
+ </param>
+ <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
+ <description>True if the system can utilize the haptic spatial data from the source being streamed. If not included, it can be assumed the module doesn't support haptic spatial data'. </description>
+ </param>
+ </struct>
+
+ <struct name="RGBColor" since="5.0">
+ <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
+ </struct>
+
+ <struct name="TemplateColorScheme" since="5.0">
+ <description>
+ A color scheme for all display layout templates.
+ </description>
+ <param name="primaryColor" type="RGBColor" mandatory="false">
+ <description>The primary "accent" color</description>
+ </param>
+ <param name="secondaryColor" type="RGBColor" mandatory="false">
+ <description>The secondary "accent" color</description>
+ </param>
+ <param name="backgroundColor" type="RGBColor" mandatory="false">
+ <description>The color of the background</description>
+ </param>
+ </struct>
+
+ <!---Remote control -->
+
+ <enum name="MassageZone" since="5.0">
+ <description>List possible zones of a multi-contour massage seat.</description>
+ <element name="LUMBAR">
+ <description>The back of a multi-contour massage seat. or SEAT_BACK</description>
+ </element>
+ <element name="SEAT_CUSHION">
+ <description>The bottom a multi-contour massage seat. or SEAT_BOTTOM </description>
+ </element>
+ </enum>
+
+ <enum name="MassageMode" since="5.0">
+ <description>List possible modes of a massage zone.</description>
+ <element name="OFF"/>
+ <element name="LOW"/>
+ <element name="HIGH"/>
+ </enum>
+
+ <struct name="MassageModeData" since="5.0">
+ <description>Specify the mode of a massage zone.</description>
+ <param name="massageZone" type="MassageZone" mandatory="true"></param>
+ <param name="massageMode" type="MassageMode" mandatory="true"></param>
+ </struct>
+
+ <enum name="MassageCushion" since="5.0">
+ <description>List possible cushions of a multi-contour massage seat.</description>
+ <element name="TOP_LUMBAR"/>
+ <element name="MIDDLE_LUMBAR"/>
+ <element name="BOTTOM_LUMBAR"/>
+ <element name="BACK_BOLSTERS"/>
+ <element name="SEAT_BOLSTERS"/>
+ </enum>
+
+ <struct name="MassageCushionFirmness" since="5.0">
+ <description>The intensity or firmness of a cushion.</description>
+ <param name="cushion" type="MassageCushion" mandatory="true"></param>
+ <param name="firmness" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
+ </struct>
+
+ <enum name="SeatMemoryActionType" since="5.0">
+ <element name="SAVE">
+ <description>Save current seat postions and settings to seat memory.</description>
+ </element>
+ <element name="RESTORE">
+ <description>Restore / apply the seat memory settings to the current seat. </description>
+ </element>
+ <element name="NONE">
+ <description>No action to be performed.</description>
+ </element>
+ </enum>
+
+ <struct name="SeatMemoryAction" since="5.0">
+ <param name="id" type="Integer" minvalue="1" maxvalue="10" mandatory="true"/>
+ <param name="label" type="String" maxlength="100" mandatory="false"/>
+ <param name="action" type="SeatMemoryActionType" mandatory="true"/>
+ </struct>
+
+ <enum name="SupportedSeat" since="5.0">
+ <description>List possible seats that is a remote controllable seat.</description>
+ <element name="DRIVER"/>
+ <element name="FRONT_PASSENGER"/>
+ </enum>
+
+ <struct name="SeatControlData" since="5.0">
+ <description>Seat control data corresponds to "SEAT" ModuleType. </description>
+ <param name="id" type="SupportedSeat" mandatory="true"></param>
+
+ <param name="heatingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="coolingEnabled" type="Boolean" mandatory="false"></param>
+ <param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="coolingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="horizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="verticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="frontVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="backTiltAngle" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="headSupportHorizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+ <param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
+
+ <param name="massageEnabled" type="Boolean" mandatory="false"></param>
+ <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
+ <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
+
+ <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
+ </struct>
+
+ <struct name="SeatControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="heatingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="heatingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="coolingLevelAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="horizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="verticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="frontVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="backTiltAngleAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportHorizontalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="headSupportVerticalPositionAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageEnabledAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageModeAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="massageCushionFirmnessAvailable" type="Boolean" mandatory="false">
+ </param>
+ <param name="memoryAvailable" type="Boolean" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="Temperature" since="4.5">
+ <param name="unit" type="TemperatureUnit" mandatory="true">
+ <description>Temperature Unit</description>
+ </param>
+ <param name="value" type="Float" mandatory="true">
+ <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
+ </param>
+ </struct>
+
+ <struct name="RdsData" since="4.5">
+ <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
+ <description>Program Service Name</description>
+ </param>
+ <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
+ <description>Radio Text</description>
+ </param>
+ <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
+ <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
+ </param>
+ <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
+ <description>Program Identification - the call sign for the radio station</description>
+ </param>
+ <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>The program type - The region should be used to differentiate between EU and North America program types</description>
+ </param>
+ <param name="TP" type="Boolean" mandatory="false">
+ <description>Traffic Program Identification - Identifies a station that offers traffic</description>
+ </param>
+ <param name="TA" type="Boolean" mandatory="false">
+ <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
+ </param>
+ <param name="REG" type="String" mandatory="false">
+ <description>Region</description>
+ </param>
+ </struct>
+
+ <struct name="StationIDNumber" since="5.0">
+ <param name="countryCode" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Binary Representation of ITU Country Code. USA Code is 001.</description>
+ </param>
+ <param name="fccFacilityId" type="Integer" minvalue="0" maxvalue="999999" mandatory="false">
+ <description>Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory</description>
+ </param>
+ </struct>
+
+ <struct name="SisData" since="5.0">
+ <param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
+ <description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
+ </param>
+ <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
+ <description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
+ </param>
+ <param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>Identifies the station call sign or other identifying information in the long format.</description>
+ </param>
+ <param name="stationLocation" type="GPSData" mandatory="false">
+ <description>Provides the 3-dimensional geographic station location.</description>
+ </param>
+ <param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
+ <description>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.</description>
+ </param>
+ </struct>
+
+ <struct name="RadioControlData" since="4.5">
+ <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
+ <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
+ </param>
+ <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
+ <description>The fractional part of the frequency for 101.7 is 7</description>
+ </param>
+ <param name="band" type="RadioBand" mandatory="false">
+ </param>
+ <param name="rdsData" type="RdsData" mandatory="false">
+ </param>
+ <param name="hdRadioEnable" type="Boolean" mandatory="false" since="5.0">
+ <description> True if the hd radio is on, false if the radio is off</description>
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
+ <description>number of HD sub-channels if available</description>
+ <history>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ </history>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
+ <description>Current HD sub-channel if available</description>
+ <history>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
+ </history>
+ </param>
+ <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
+ </param>
+ <param name="radioEnable" type="Boolean" mandatory="false">
+ <description> True if the radio is on, false if the radio is off. If set to false, no other data will be included.</description>
+ </param>
+ <param name="state" type="RadioState" mandatory="false">
+ </param>
+ <param name="sisData" type="SisData" mandatory="false" since="5.0">
+ <description>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</description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlData" since="4.5">
+ <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="currentTemperature" type="Temperature" mandatory="false">
+ </param>
+ <param name="desiredTemperature" type="Temperature" mandatory="false">
+ </param>
+ <param name="acEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="circulateAirEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="autoModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="defrostZone" type="DefrostZone" mandatory="false">
+ </param>
+ <param name="dualModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="acMaxEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="ventilationMode" type="VentilationMode" mandatory="false">
+ </param>
+ <param name="heatedSteeringWheelEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled/turn off, value true means enabled/turn on.</description>
+ </param>
+ <param name="heatedWindshieldEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedRearWindowEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ <param name="heatedMirrorsEnable" type="Boolean" mandatory="false" since="5.0">
+ <description>value false means disabled, value true means enabled.</description>
+ </param>
+ </struct>
+
+ <struct name="RadioControlCapabilities" since="4.5">
+ <description>Contains information about a radio control module's capabilities.</description>
+ <!-- need an ID in the future -->
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the climate control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="radioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioBandAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of radio band.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioFrequencyAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of radio frequency.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdChannelAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of HD radio channel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="rdsDataAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting Radio Data System (RDS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the number of available HD channels.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="stateAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the Radio state.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalStrengthAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the signal strength.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the signal Change Threshold.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="sisDataAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the getting HD radio Station Information Service (SIS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdRadioEnableAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control of enable/disable HD radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="siriusxmRadioAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of sirius XM radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlCapabilities" since="4.5">
+ <description>Contains information about a climate control module's capabilities.</description>
+ <!-- need an ID in the future -->
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>The short friendly name of the climate control module.
+ It should not be used to identify a module by mobile application.</description>
+ </param>
+ <param name="currentTemperatureAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the reading of current temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of fan speed.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of desired temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of turn on/off AC.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable circulate Air mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable auto mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable dual mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of defrost zones.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZone" type="DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all defrost zones that are controllable.
+ </description>
+ </param>
+ <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of air ventilation mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="ventilationMode" type="VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all ventilation modes that are controllable.
+ </description>
+ </param>
+ <param name="heatedSteeringWheelAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Steering Wheel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedWindshieldAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Windshield.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedRearWindowAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Rear Window.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="heatedMirrorsAvailable" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Availability of the control (enable/disable) of heated Mirrors.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="EqualizerSettings" since="5.0">
+ <description>Defines the each Equalizer channel settings.</description>
+ <param name="channelId" type="Integer" minvalue="1" maxvalue="100" mandatory="true"></param>
+ <param name="channelName" type="String" mandatory="false" maxlength="50">
+ <description>read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz")</description>
+ </param>
+ <param name="channelSetting" type="Integer" minvalue="0" maxvalue="100" mandatory="true">
+ <description>Reflects the setting, from 0%-100%.</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlData" since="5.0">
+ <param name="source" type="PrimaryAudioSource" mandatory="false">
+ <description>
+ 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.
+ </description>
+ </param>
+ <param name="keepContext" type="Boolean" mandatory="false">
+ <description>
+ 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 not included.
+ If it is false, the system not only changes the audio source but also brings the default application or
+ system UI associated with the audio source to foreground.
+ If it is true, the system only changes the audio source, but keeps the current application in foreground.
+ </description>
+ </param>
+ <param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
+ <description>Reflects the volume of audio, from 0%-100%.</description>
+ </param>
+ <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
+ <description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
+ </param>
+ </struct>
+
+ <struct name="AudioControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="sourceAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio source. </description>
+ </param>
+ <param name="keepContextAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the keepContext parameter. </description>
+ </param>
+ <param name="volumeAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of audio volume.</description>
+ </param>
+ <param name="equalizerAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of Equalizer Settings.</description>
+ </param>
+ <param name="equalizerMaxChannelId" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid</description>
+ </param>
+ </struct>
+
+ <enum name="LightName" since="5.0">
+ <!-- Common Single Light 0~500 -->
+ <element name="FRONT_LEFT_HIGH_BEAM" value="0"/>
+ <element name="FRONT_RIGHT_HIGH_BEAM" value="1"/>
+ <element name="FRONT_LEFT_LOW_BEAM" value="2"/>
+ <element name="FRONT_RIGHT_LOW_BEAM" value="3"/>
+ <element name="FRONT_LEFT_PARKING_LIGHT" value="4"/>
+ <element name="FRONT_RIGHT_PARKING_LIGHT" value="5"/>
+ <element name="FRONT_LEFT_FOG_LIGHT" value="6"/>
+ <element name="FRONT_RIGHT_FOG_LIGHT" value="7"/>
+ <element name="FRONT_LEFT_DAYTIME_RUNNING_LIGHT" value="8"/>
+ <element name="FRONT_RIGHT_DAYTIME_RUNNING_LIGHT" value="9"/>
+ <element name="FRONT_LEFT_TURN_LIGHT" value="10"/>
+ <element name="FRONT_RIGHT_TURN_LIGHT" value="11"/>
+ <element name="REAR_LEFT_FOG_LIGHT" value="12"/>
+ <element name="REAR_RIGHT_FOG_LIGHT" value="13"/>
+ <element name="REAR_LEFT_TAIL_LIGHT" value="14"/>
+ <element name="REAR_RIGHT_TAIL_LIGHT" value="15"/>
+ <element name="REAR_LEFT_BRAKE_LIGHT" value="16"/>
+ <element name="REAR_RIGHT_BRAKE_LIGHT" value="17"/>
+ <element name="REAR_LEFT_TURN_LIGHT" value="18"/>
+ <element name="REAR_RIGHT_TURN_LIGHT" value="19"/>
+ <element name="REAR_REGISTRATION_PLATE_LIGHT" value="20"/>
+
+ <!-- Exterior Lights by common function groups 501~800 -->
+ <element name="HIGH_BEAMS" value="501">
+ <description>Include all high beam lights: front_left and front_right.</description>
+ </element>
+ <element name="LOW_BEAMS" value="502">
+ <description>Include all low beam lights: front_left and front_right.</description>
+ </element>
+ <element name="FOG_LIGHTS" value="503">
+ <description>Include all fog lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="RUNNING_LIGHTS" value="504">
+ <description>Include all daytime running lights: front_left and front_right.</description>
+ </element>
+ <element name="PARKING_LIGHTS" value="505">
+ <description>Include all parking lights: front_left and front_right.</description>
+ </element>
+ <element name="BRAKE_LIGHTS" value="506">
+ <description>Include all brake lights: rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_REVERSING_LIGHTS" value="507"/>
+ <element name="SIDE_MARKER_LIGHTS" value="508"/>
+ <element name="LEFT_TURN_LIGHTS" value="509">
+ <description>Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.</description>
+ </element>
+ <element name="RIGHT_TURN_LIGHTS" value="510">
+ <description>Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.</description>
+ </element>
+ <element name="HAZARD_LIGHTS" value="511">
+ <description>Include all hazard lights: front_left, front_right, rear_left and rear_right.</description>
+ </element>
+ <element name="REAR_CARGO_LIGHTS" value="512">
+ <description>Cargo lamps illuminate the cargo area.</description>
+ </element>
+ <element name="REAR_TRUCK_BED_LIGHTS" value="513">
+ <description>Truck bed lamps light up the bed of the truck.</description>
+ </element>
+ <element name="REAR_TRAILER_LIGHTS" value="514">
+ <description>Trailer lights are lamps mounted on a trailer hitch.</description>
+ </element>
+ <element name="LEFT_SPOT_LIGHTS" value="515">
+ <description>It is the spotlights mounted on the left side of a vehicle.</description>
+ </element>
+ <element name="RIGHT_SPOT_LIGHTS" value="516">
+ <description>It is the spotlights mounted on the right side of a vehicle.</description>
+ </element>
+ <element name="LEFT_PUDDLE_LIGHTS" value="517">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+ <element name="RIGHT_PUDDLE_LIGHTS" value="518">
+ <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
+ </element>
+
+ <!-- Interior Lights by common function groups 801~900 -->
+ <element name="AMBIENT_LIGHTS" value="801"/>
+ <element name="OVERHEAD_LIGHTS" value="802"/>
+ <element name="READING_LIGHTS" value="803"/>
+ <element name="TRUNK_LIGHTS" value="804"/>
+
+ <!-- Lights by location 901~1000-->
+ <element name="EXTERIOR_FRONT_LIGHTS" value="901">
+ <description>Include exterior lights located in front of the vehicle. For example, fog lights and low beams.</description>
+ </element>
+ <element name="EXTERIOR_REAR_LIGHTS" value="902">
+ <description>Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights and trailer assist lights.</description>
+ </element>
+ <element name="EXTERIOR_LEFT_LIGHTS" value="903">
+ <description>Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_RIGHT_LIGHTS" value="904">
+ <description>Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.</description>
+ </element>
+ <element name="EXTERIOR_ALL_LIGHTS" value="905">
+ <description> Include all exterior lights around the vehicle.</description>
+ </element>
+ </enum>
+
+ <enum name="LightStatus" since="5.0">
+ <element name="ON"/>
+ <element name="OFF"/>
+ <element name="RAMP_UP"/>
+ <element name="RAMP_DOWN"/>
+ <element name="UNKNOWN"/>
+ <element name="INVALID"/>
+ </enum>
+
+ <struct name="LightCapabilities" since="5.0">
+ <param name="name" type="LightName" mandatory="true" />
+ <param name="statusAvailable" type="Boolean" mandatory="false">
+ <description>
+ 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.
+ </description>
+ </param>
+ <param name="densityAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's density can be set remotely (similar to a dimmer).
+ </description>
+ </param>
+ <param name="rgbColorSpaceAvailable" type="Boolean" mandatory="false">
+ <description>
+ Indicates if the light's color can be set remotely by using the sRGB color space.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="LightControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the light control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description> An array of available LightCapabilities that are controllable. </description>
+ </param>
+ </struct>
+
+ <struct name="LightState" since="5.0">
+ <param name="id" type="LightName" mandatory="true">
+ <description>The name of a light or a group of lights. </description>
+ </param>
+ <param name="status" type="LightStatus" mandatory="true"/>
+ <param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
+ <param name="color" type="RGBColor" mandatory="false" />
+ </struct>
+
+ <struct name="LightControlData" since="5.0">
+ <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
+ <description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
+ </param>
+ </struct>
+
+ <enum name="DisplayMode" since="5.0">
+ <element name="DAY"/>
+ <element name="NIGHT"/>
+ <element name="AUTO"/>
+ </enum>
+
+ <enum name="DistanceUnit" since="5.0">
+ <element name="MILES"/>
+ <element name="KILOMETERS"/>
+ </enum>
+
+ <struct name="HMISettingsControlData" since="5.0">
+ <description>Corresponds to "HMI_SETTINGS" ModuleType</description>
+ <param name="displayMode" type="DisplayMode" mandatory="false"></param>
+ <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
+ <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
+ </struct>
+
+ <struct name="HMISettingsControlCapabilities" since="5.0">
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the hmi setting module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="distanceUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of distance unit. </description>
+ </param>
+ <param name="temperatureUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of temperature unit. </description>
+ </param>
+ <param name="displayModeUnitAvailable" type="Boolean" mandatory="false">
+ <description>Availability of the control of HMI display mode. </description>
+ </param>
+ </struct>
+
+ <struct name="ModuleData" since="4.5">
+ <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ </param>
+ <param name="radioControlData" type="RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="ClimateControlData" mandatory="false">
+ </param>
+ <param name="seatControlData" type="SeatControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="audioControlData" type="AudioControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="lightControlData" type="LightControlData" mandatory="false" since="5.0">
+ </param>
+ <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false" since="5.0">
+ </param>
+ </struct>
+
+ <struct name="RemoteControlCapabilities" since="4.5">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description>
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC radio controls.For this baseline version, maxsize=1. i.e. only one radio control module is supported.</description>
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC button controls with the included button names.</description>
+ </param>
+ <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
+ <description>If included, the platform supports audio controls.</description>
+ </param>
+ <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false" since="5.0">
+ <description>If included, the platform supports hmi setting controls.</description>
+ </param>
+ <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false" since="5.0">
+ <description>If included, the platform supports light controls.</description>
+ </param>
+ <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
+ <description>If included, the platform supports seat controls.</description>
+ </param>
+ </struct>
+
+ <!-- End of RC -->
+
+ <enum name="MetadataType" since="4.5">
+ <element name="mediaTitle">
+ <description>The data in this field contains the title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaArtist">
+ <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
+ </element>
+ <element name="mediaAlbum">
+ <description>The data in this field contains the album title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaYear">
+ <description>The data in this field contains the creation year of the currently playing audio track.</description>
+ </element>
+ <element name="mediaGenre">
+ <description>The data in this field contains the genre of the currently playing audio track.</description>
+ </element>
+ <element name="mediaStation">
+ <description>The data in this field contains the name of the current source for the media.</description>
+ </element>
+ <element name="rating">
+ <description>The data in this field is a rating.</description>
+ </element>
+ <element name="currentTemperature">
+ <description>The data in this field is the current temperature.</description>
+ </element>
+ <element name="maximumTemperature">
+ <description>The data in this field is the maximum temperature for the day.</description>
+ </element>
+ <element name="minimumTemperature">
+ <description>The data in this field is the minimum temperature for the day.</description>
+ </element>
+ <element name="weatherTerm">
+ <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
+ </element>
+ <element name="humidity">
+ <description>The data in this field describes the current humidity value.</description>
+ </element>
+ </enum>
+
+ <struct name="MetadataTags" since="4.5">
+ <param name="mainField1" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField1" text field.</description>
+ </param>
+ <param name="mainField2" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField2" text field.</description>
+ </param>
+ <param name="mainField3" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField3" text field.</description>
+ </param>
+ <param name="mainField4" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField4" text field.</description>
+ </param>
+ </struct>
+
+ <struct name="Rectangle" since="4.5">
+ <param name="x" type="Float" mandatory="true">
+ <description>The upper left X-coordinate of the rectangle</description>
+ </param>
+ <param name="y" type="Float" mandatory="true">
+ <description>The upper left Y-coordinate of the rectangle</description>
+ </param>
+ <param name="width" type="Float" mandatory="true">
+ <description>The width of the rectangle</description>
+ </param>
+ <param name="height" type="Float" mandatory="true">
+ <description>The height of the rectangle</description>
+ </param>
+ </struct>
+
+ <struct name="HapticRect" since="4.5">
+ <description>Defines haptic data for each user control object for video streaming application</description>
+ <param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>A user control spatial identifier</description>
+ </param>
+ <param name="rect" type="Rectangle" mandatory="true">
+ <description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
+ </param>
+ </struct>
+
+ <!-- App Services -->
+
+ <enum name="AppServiceType" platform="documentation" since="5.1">
+ <element name="MEDIA"/>
+ <element name="WEATHER"/>
+ <element name="NAVIGATION"/>
+ </enum>
+
+ <struct name="MediaServiceManifest" since="5.1">
+ </struct>
+
+ <enum name="MediaType" since="5.1">
+ <element name="MUSIC"/>
+ <element name="PODCAST"/>
+ <element name="AUDIOBOOK"/>
+ <element name="OTHER"/>
+ </enum>
+
+ <struct name="MediaServiceData" since="5.1">
+ <description>This data is related to what a media service should provide</description>
+
+ <param name="mediaType" type="MediaType" mandatory="false">
+ <description>The type of the currently playing or paused track.</description>
+ </param>
+
+ <param name="mediaTitle" type="String" mandatory="false">
+ <description>
+ Music: The name of the current track
+ Podcast: The name of the current episode
+ Audiobook: The name of the current chapter
+ </description>
+ </param>
+
+ <param name="mediaArtist" type="String" mandatory="false">
+ <description>
+ Music: The name of the current album artist
+ Podcast: The provider of the podcast (hosts, network, company)
+ Audiobook: The book author's name
+ </description>
+ </param>
+
+ <param name="mediaAlbum" type="String" mandatory="false">
+ <description>
+ Music: The name of the current album
+ Podcast: The name of the current podcast show
+ Audiobook: The name of the current book
+ </description>
+ </param>
+
+ <param name="playlistName" type="String" mandatory="false">
+ <description>
+ Music: The name of the playlist or radio station, if the user is playing from a playlist, otherwise, Null
+ Podcast: The name of the playlist, if the user is playing from a playlist, otherwise, Null
+ Audiobook: Likely not applicable, possibly a collection or "playlist" of books
+ </description>
+ </param>
+
+ <param name="isExplicit" type="Boolean" mandatory="false">
+ <description> Whether or not the content currently playing (e.g. the track, episode, or book) contains explicit content</description>
+ </param>
+
+ <param name="trackPlaybackProgress" type="Integer" mandatory="false">
+ <description>
+ Music: The current progress of the track in seconds
+ Podcast: The current progress of the episode in seconds
+ Audiobook: The current progress of the current segment (e.g. the chapter) in seconds
+ </description>
+ </param>
+
+ <param name="trackPlaybackDuration" type="Integer" mandatory="false">
+ <description>
+ Music: The total duration of the track in seconds
+ Podcast: The total duration of the episode in seconds
+ Audiobook: The total duration of the current segment (e.g. the chapter) in seconds
+ </description>
+ </param>
+
+ <param name="queuePlaybackProgress" type="Integer" mandatory="false">
+ <description>
+ Music: The current progress of the playback queue in seconds
+ Podcast: The current progress of the playback queue in seconds
+ Audiobook: The current progress of the playback queue (e.g. the book) in seconds
+ </description>
+ </param>
+
+ <param name="queuePlaybackDuration" type="Integer" mandatory="false">
+ <description>
+ Music: The total duration of the playback queue in seconds
+ Podcast: The total duration of the playback queue in seconds
+ Audiobook: The total duration of the playback queue (e.g. the book) in seconds
+ </description>
+ </param>
+
+ <param name="queueCurrentTrackNumber" type="Integer" mandatory="false">
+ <description>
+ Music: The current number (1 based) of the track in the playback queue
+ Podcast: The current number (1 based) of the episode in the playback queue
+ Audiobook: The current number (1 based) of the episode in the playback queue (e.g. the chapter number in the book)
+ </description>
+ </param>
+
+ <param name="queueTotalTrackCount" type="Integer" mandatory="false">
+ <description>
+ Music: The total number of tracks in the playback queue
+ Podcast: The total number of episodes in the playback queue
+ Audiobook: The total number of sections in the playback queue (e.g. the number of chapters in the book)
+ </description>
+ </param>
+ </struct>
+
+ <struct name="WeatherServiceManifest" since="5.1">
+ <param name="currentForecastSupported" type="Boolean" mandatory="false"/>
+ <param name="maxMultidayForecastAmount" type="Integer" mandatory="false"/>
+ <param name="maxHourlyForecastAmount" type="Integer" mandatory="false"/>
+ <param name="maxMinutelyForecastAmount" type="Integer" mandatory="false"/>
+ <param name="weatherForLocationSupported" type="Boolean" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherAlert" since="5.1">
+ <param name="title" type="String" mandatory="false"/>
+ <param name="summary" type="String" mandatory="false"/>
+ <param name="expires" type="DateTime" mandatory="false"/>
+ <param name="regions" type="String" array="true" minsize="1" maxsize="99" mandatory="false"/>
+ <param name="severity" type="String" mandatory="false"/>
+ <param name="timeIssued" type="DateTime" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherData" since="5.1">
+ <param name="currentTemperature" type="Temperature" mandatory="false"/>
+ <param name="temperatureHigh" type="Temperature" mandatory="false"/>
+ <param name="temperatureLow" type="Temperature" mandatory="false"/>
+ <param name="apparentTemperature" type="Temperature" mandatory="false"/>
+ <param name="apparentTemperatureHigh" type="Temperature" mandatory="false"/>
+ <param name="apparentTemperatureLow" type="Temperature" mandatory="false"/>
+
+ <param name="weatherSummary" type="String" mandatory="false"/>
+ <param name="time" type="DateTime" mandatory="false"/>
+ <param name="humidity" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage humidity </description>
+ </param>
+ <param name="cloudCover" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage cloud cover </description>
+ </param>
+ <param name="moonPhase" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage of the moon seen, e.g. 0 = no moon, 0.25 = quarter moon </description>
+ </param>
+
+ <param name="windBearing" type="Integer" mandatory="false">
+ <description> In degrees, true north at 0 degrees </description>
+ </param>
+ <param name="windGust" type="Float" mandatory="false">
+ <description> km/hr </description>
+ </param>
+ <param name="windSpeed" type="Float" mandatory="false">
+ <description> km/hr </description>
+ </param>
+
+ <param name="nearestStormBearing" type="Integer" mandatory="false">
+ <description> In degrees, true north at 0 degrees </description>
+ </param>
+ <param name="nearestStormDistance" type="Integer" mandatory="false">
+ <description> In km </description>
+ </param>
+ <param name="precipAccumulation" type="Float" mandatory="false">
+ <description> cm </description>
+ </param>
+ <param name="precipIntensity" type="Float" mandatory="false">
+ <description> cm of water per hour </description>
+ </param>
+ <param name="precipProbability" type="Float" minvalue="0" maxvalue="1" mandatory="false">
+ <description> 0 to 1, percentage chance </description>
+ </param>
+ <param name="precipType" type="String" mandatory="false">
+ <description> e.g. "rain", "snow", "sleet", "hail" </description>
+ </param>
+ <param name="visibility" type="Float" mandatory="false">
+ <description> In km </description>
+ </param>
+
+ <param name="weatherIcon" type="Image" mandatory="false"/>
+ </struct>
+
+ <struct name="WeatherServiceData" since="5.1">
+ <description> This data is related to what a weather service would provide</description>
+ <param name="location" type="LocationDetails" mandatory="true"/>
+ <param name="currentForecast" type="WeatherData" mandatory="false"/>
+ <param name="minuteForecast" type="WeatherData" array="true" minsize="15" maxsize="60" mandatory="false"/>
+ <param name="hourlyForecast" type="WeatherData" array="true" minsize="1" maxsize="96" mandatory="false"/>
+ <param name="multidayForecast" type="WeatherData" array="true" minsize="1" maxsize="30" mandatory="false"/>
+ <param name="alerts" type="WeatherAlert" array="true" minsize="1" maxsize="10" mandatory="false">
+ <description> This array should be ordered with the first object being the current day</description>
+ </param>
+ </struct>
+
+ <struct name="NavigationServiceManifest" since="5.1">
+ <param name="acceptsWayPoints" type="Boolean" mandatory="false">
+ <description> Informs the subscriber if this service can actually accept way points. </description>
+ </param>
+ </struct>
+
+ <enum name="NavigationAction" since="5.1">
+ <element name="TURN">
+ <description> Using this action plus a supplied direction can give the type of turn. </description>
+ </element>
+ <element name="EXIT"/>
+ <element name="STAY"/>
+ <element name="MERGE"/>
+ <element name="FERRY"/>
+ <element name="CAR_SHUTTLE_TRAIN"/>
+ <element name="WAYPOINT"/>
+ </enum>
+
+ <enum name="NavigationJunction" since="5.1">
+ <element name="REGULAR">
+ <description> A junction that represents a standard intersection with a single road crossing another. </description>
+ </element>
+ <element name="BIFURCATION">
+ <description> A junction where the road splits off into two paths; a fork in the road. </description>
+ </element>
+ <element name="MULTI_CARRIAGEWAY">
+ <description> A junction that has multiple intersections and paths. </description>
+ </element>
+ <element name="ROUNDABOUT">
+ <description> A junction where traffic moves in a single direction around a central, non-traversable point to reach one of the connecting roads. </description>
+ </element>
+ <element name="TRAVERSABLE_ROUNDABOUT">
+ <description> Similar to a roundabout, however the center of the roundabout is fully traversable. Also known as a mini-roundabout. </description>
+ </element>
+ <element name="JUGHANDLE">
+ <description> A junction where lefts diverge to the right, then curve to the left, converting a left turn to a crossing maneuver. </description>
+ </element>
+ <element name="ALL_WAY_YIELD">
+ <description> Multiple way intersection that allows traffic to flow based on priority; most commonly right of way and first in, first out. </description>
+ </element>
+ <element name="TURN_AROUND">
+ <description> A junction designated for traffic turn arounds. </description>
+ </element>
+ </enum>
+
+ <enum name="Direction" since="5.1">
+ <element name="LEFT"/>
+ <element name="RIGHT"/>
+ </enum>
+
+ <struct name="NavigationInstruction" since="5.1">
+ <param name="locationDetails" type="LocationDetails" mandatory="true"/>
+
+ <param name="action" type="NavigationAction" mandatory="true"/>
+
+ <param name="eta" type="DateTime" mandatory="false"/>
+
+ <param name="bearing" type="Integer" minvalue="0" maxvalue="359" mandatory="false">
+ <description> The angle at which this instruction takes place. For example, 0 would mean straight, less than 45 is bearing right, greater than 135 is sharp right, between 45 and 135 is a regular right, and 180 is a U-Turn, etc. </description>
+ </param>
+
+ <param name="junctionType" type="NavigationJunction" mandatory="false"/>
+
+ <param name="drivingSide" type="Direction" mandatory="false">
+ <description> Used to infer which side of the road this instruction takes place. For a U-Turn (action=TURN, bearing=180) this will determine which direction the turn should take place. </description>
+ </param>
+
+ <param name="details" type="String" mandatory="false">
+ <description> This is a string representation of this instruction, used to display instructions to the users. This is not intended to be read aloud to the users, see the param prompt in NavigationServiceData for that. </description>
+ </param>
+
+ <param name="image" type="Image" mandatory="false">
+ <description> An image representation of this instruction. </description>
+ </param>
+ </struct>
+
+ <struct name="NavigationServiceData" since="5.1">
+ <description> This data is related to what a navigation service would provide.</description>
+
+ <param name="timeStamp" type="DateTime" mandatory="true">
+ <description> This is the timestamp of when the data was generated. This is to ensure any time or distance given in the data can accurately be adjusted if necessary. </description>
+ </param>
+
+ <param name="origin" type="LocationDetails" mandatory="false"/>
+ <param name="destination" type="LocationDetails" mandatory="false"/>
+ <param name="destinationETA" type="DateTime" mandatory="false"/>
+
+ <param name="instructions" type="NavigationInstruction" array="true" mandatory="false">
+ <description> This array should be ordered with all remaining instructions. The start of this array should always contain the next instruction.</description>
+ </param>
+
+ <param name="nextInstructionETA" type="DateTime" mandatory="false"/>
+ <param name="nextInstructionDistance" type="Float" mandatory="false">
+ <description>The distance to this instruction from current location. This should only be updated ever .1 unit of distance. For more accuracy the consumer can use the GPS location of itself and the next instruction. </description>
+ </param>
+ <param name="nextInstructionDistanceScale" type="Float" mandatory="false">
+ <description>Distance till next maneuver (starting from) from previous maneuver.</description>
+ </param>
+
+ <param name="prompt" type="String" mandatory="false">
+ <description>This is a prompt message that should be conveyed to the user through either display or voice (TTS). This param will change often as it should represent the following: approaching instruction, post instruction, alerts that affect the current navigation session, etc.</description>
+ </param>
+ </struct>
+
+ <struct name="AppServiceManifest" since="5.1">
+ <description> This manifest contains all the information necessary for the service to be published, activated, and consumers able to interact with it </description>
+
+ <param name="serviceName" type="String" mandatory="false">
+ <description> Unique name of this service </description>
+ </param>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description> The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core. </description>
+ </param>
+
+ <param name="serviceIcon" type="Image" mandatory="false">
+ <description> The icon to be associated with this service. Most likely the same as the appIcon.</description>
+ </param>
+
+ <param name="allowAppConsumers" type="Boolean" mandatory="false" defvalue="false">
+ <description> If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false. </description>
+ </param>
+
+ <param name="rpcSpecVersion" type="SyncMsgVersion" mandatory="false">
+ <description> This is the max RPC Spec version the app service understands. This is important during the RPC passthrough functionality. If not included, it is assumed the max version of the module is acceptable. </description>
+ </param>
+
+ <param name="handledRPCs" type="Integer" array="true" mandatory="false">
+ <description> This field contains the Function IDs for the RPCs that this service intends to handle correctly. This means the service will provide meaningful responses. </description>
+ </param>
+
+ <param name="mediaServiceManifest" type="MediaServiceManifest" mandatory="false"/>
+ <param name="weatherServiceManifest" type="WeatherServiceManifest" mandatory="false"/>
+ <param name="navigationServiceManifest" type="NavigationServiceManifest" mandatory="false"/>
+ </struct>
+
+ <struct name="AppServiceRecord" since="5.1">
+ <description> This is the record of an app service publisher that the module has. It should contain the most up to date information including the service's active state</description>
+
+ <param name="serviceID" type="String" mandatory="true">
+ <description> A unique ID tied to this specific service record. The ID is supplied by the module that services publish themselves. </description>
+ </param>
+
+ <param name="serviceManifest" type="AppServiceManifest" mandatory="true">
+ <description> Manifest for the service that this record is for.</description>
+ </param>
+
+ <param name="servicePublished" type="Boolean" mandatory="true">
+ <description> If true, the service is published and available. If false, the service has likely just been unpublished, and should be considered unavailable.</description>
+ </param>
+
+ <param name="serviceActive" type="Boolean" mandatory="true">
+ <description> If true, the service is the active primary service of the supplied service type. It will receive all potential RPCs that are passed through to that service type. If false, it is not the primary service of the supplied type. See servicePublished for its availability. </description>
+ </param>
+ </struct>
+
+ <struct name="AppServiceData" since="5.1">
+ <description> Contains all the current data of the app service. The serviceType will link to which of the service data objects are included in this object (e.g. if the service type is MEDIA, the mediaServiceData param should be included).</description>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description>The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core.</description>
+ </param>
+ <param name="serviceID" type="String" mandatory="true"/>
+
+ <param name="mediaServiceData" type="MediaServiceData" mandatory="false"/>
+ <param name="weatherServiceData" type="WeatherServiceData" mandatory="false"/>
+ <param name="navigationServiceData" type="NavigationServiceData" mandatory="false"/>
+ </struct>
+
+ <enum name="ServiceUpdateReason" since="5.1">
+ <element name="PUBLISHED">
+ <description> The service has just been published with the module and once activated to the primary service of its type, it will be ready for possible consumption.</description>
+ </element>
+ <element name="REMOVED">
+ <description> The service has just been unpublished with the module and is no longer accessible</description>
+ </element>
+ <element name="ACTIVATED">
+ <description> The service is activated as the primary service of this type. All requests dealing with this service type will be handled by this service.</description>
+ </element>
+ <element name="DEACTIVATED">
+ <description> The service has been deactivated as the primary service of its type</description>
+ </element>
+ <element name="MANIFEST_UPDATE">
+ <description> The service has updated its manifest. This could imply updated capabilities</description>
+ </element>
+ </enum>
+
+ <struct name="AppServiceCapability" since="5.1">
+ <param name="updateReason" type="ServiceUpdateReason" mandatory="false">
+ <description> Only included in OnSystemCapabilityUpdated. Update reason for service record.</description>
+ </param>
+ <param name="updatedAppServiceRecord" type="AppServiceRecord" mandatory="true">
+ <description>Service record for a specific app service provider</description>
+ </param>
+ </struct>
+
+ <struct name="AppServicesCapabilities" since="5.1">
+ <description>Capabilities of app services including what service types are supported and the current state of services.</description>
+ <param name="appServices" type="AppServiceCapability" array="true" mandatory="false">
+ <description>An array of currently available services. If this is an update to the capability the affected services will include an update reason in that item</description>
+ </param>
+ </struct>
+
+ <!-- End App Services -->
+
+ <struct name="SystemCapability" since="4.5">
+ <description>The systemCapabilityType identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
+ <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
+ <description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other param included.</description>
+ </param>
+ <param name="navigationCapability" type="NavigationCapability" mandatory="false">
+ <description>Describes extended capabilities for onboard navigation system </description>
+ </param>
+ <param name="phoneCapability" type="PhoneCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="remoteControlCapability" type="RemoteControlCapabilities" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="appServicesCapabilities" type="AppServicesCapabilities" mandatory="false" since="5.1">
+ <description>An array of currently available services. If this is an update to the capability the affected services will include an update reason in that item</description>
+ </param>
+ </struct>
+
+ <!-- Requests/Responses -->
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request" since="1.0">
+ <description>
+ Establishes an interface with a mobile application.
+ Before registerAppInterface no other commands will be accepted/executed.
+ </description>
+
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true" since="1.0">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="appName" type="String" maxlength="100" mandatory="true" since="1.0">
+ <description>
+ The mobile application name, e.g. "Ford Drive Green".
+ Needs to be unique over all applications.
+ May not be empty.
+ May not start with a new line character.
+ May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands)
+ Needs to be unique over all applications. Applications with the same name will be rejected.
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>
+ TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
+ Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
+ Needs to be unique over all applications.
+ May not be empty.
+ May not start with a new line character.
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="1.0">
+ <description>
+ Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.
+ If not provided, the appName is used instead (and will be truncated if too long)
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>
+ Defines an additional voice recognition command.
+ May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands)
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="isMediaApplication" type="Boolean" mandatory="true" since="1.0">
+ <description>
+ Indicates if the application is a media or a non-media application.
+ Only media applications will be able to stream audio to the module that is audible outside of the BT media source.
+ </description>
+ </param>
+ <param name="languageDesired" type="Language" mandatory="true" since="1.0">
+ <description>
+ See Language
+ Current app's expected VR+TTS language
+ If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+ <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true" since="2.0">
+ <description>
+ See Language
+ Current app's expected display language
+ If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+
+ <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>
+ See AppHMIType
+ List of all applicable app HMI types stating which HMI classifications to be given to the app.
+ </description>
+ </param>
+
+ <param name="hashID" type="String" maxlength="100" mandatory="false" since="3.0">
+ <description>
+ ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).
+ This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece.
+ If omitted, then the previous state of an app's commands, etc. will not be restored.
+ When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.).
+ </description>
+ </param>
+ <param name="deviceInfo" type="DeviceInfo" mandatory="false" since="3.0">
+ <description>
+ See DeviceInfo.
+ </description>
+ </param>
+ <param name="appID" type="String" maxlength="100" mandatory="true" since="2.0">
+ <description>ID used to validate app with policy table entries</description>
+ </param>
+ <param name="fullAppID" type="String" maxlength="100" mandatory="false" since="5.0">
+ <description>ID used to validate app with policy table entries</description>
+ </param>
+ <param name="appInfo" type="AppInfo" mandatory="false" since="2.0">
+ <description>
+ See AppInfo.
+ </description>
+ </param>
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+ </function>
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response" since="1.0">
+ <description>The response to registerAppInterface</description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TOO_MANY_APPLICATIONS"/>
+ <element name="APPLICATION_REGISTERED_ALREADY"/>
+ <element name="UNSUPPORTED_VERSION"/>
+ <element name="WRONG_LANGUAGE"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ <element name="RESUME_FAILED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="language" type="Language" mandatory="false">
+ <description>The currently active VR+TTS language on the module. See "Language" for options.</description>
+ </param>
+
+ <param name="hmiDisplayLanguage" type="Language" mandatory="false" since="2.0">
+ <description>The currently active display language on the module. See "Language" for options.</description>
+ </param>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </param>
+
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+ </param>
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" since="2.0">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+ </param>
+ <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>See HmiZoneCapabilities</description>
+ </param>
+ <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>See SpeechCapabilities</description>
+ </param>
+
+ <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
+ <description>See PrerecordedSpeech</description>
+ </param>
+
+ <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>See VrCapabilities</description>
+ </param>
+
+ <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>See AudioPassThruCapability</description>
+ </param>
+
+ <param name="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" mandatory="false" since="4.1">
+ <description>See AudioPassThruCapability</description>
+ </param>
+
+ <param name="vehicleType" type="VehicleType" mandatory="false" since="2.0">
+ <description>Specifies the vehicle's type. See VehicleType.</description>
+ </param>
+
+ <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false" since="3.0">
+ <description>
+ Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests.
+ If a mode outside this list is requested, it will be rejected.
+ </description>
+ </param>
+
+ <param name="hmiCapabilities" type="HMICapabilities" mandatory="false" since="3.0">
+ <description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
+ </param>
+
+ <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
+ <description>The SmartDeviceLink version.</description>
+ </param>
+
+ <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
+ <description>The software version of the system that implements the SmartDeviceLink core.</description>
+ </param>
+
+ <param name="iconResumed" type="Boolean" mandatory="false" since="5.0">
+ <description>
+ Existence of apps icon at system. If true, apps icon
+ was resumed at system. If false, apps icon is not resumed at system
+ </description>
+ </param>
+ </function>
+
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request" since="1.0">
+ <description>
+ Closes an interface from a mobile application.
+ After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.
+ Will fail, if no registerAppInterface was completed successfully before.
+ </description>
+ </function>
+
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request" since="1.0">
+ <description>Allows setting global properties.</description>
+
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>
+ The help prompt.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
+ <description>
+ Help text for a wait timeout.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false" since="2.0">
+ <description>
+ VR Help Title text.
+ If omitted on supported displays, the default module help title shall be used.
+ If omitted and one or more vrHelp items are provided, the request will be rejected.
+ </description>
+ </param>
+
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>
+ VR Help Items.
+ If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
+ If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected.
+ If omitted and a vrHelpTitle is provided, the request will be rejected.
+ </description>
+ </param>
+ <param name="menuTitle" maxlength="500" type="String" mandatory="false" since="3.0">
+ <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </param>
+
+ <param name="menuIcon" type="Image" mandatory="false" since="3.0">
+ <description>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ </param>
+
+ <param name="keyboardProperties" type="KeyboardProperties" mandatory="false" since="3.0">
+ <description>On-screen keyboard configuration (if available).</description>
+ </param>
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request" since="1.0">
+ <description>Allows resetting global properties.</description>
+
+ <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
+ </param>
+ </function>
+
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="AddCommand" functionID="AddCommandID" messagetype="request" since="1.0">
+ <description>
+ Adds a command to the in application menu.
+ Either menuParams or vrCommands must be provided.
+ </description>
+
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>unique ID of the command to add.</description>
+ </param>
+
+ <param name="menuParams" type="MenuParams" mandatory="false">
+ <description>Optional sub value containing menu parameters</description>
+ </param>
+
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false">
+ <description>
+ An array of strings to be used as VR synonyms for this command.
+ If this array is provided, it may not be empty.
+ </description>
+ </param>
+
+ <param name="cmdIcon" type="Image" mandatory="false" since="2.0">
+ <description>
+ Image struct determining whether static or dynamic icon.
+ If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="AddCommand" functionID="AddCommandID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request" since="1.0">
+ <description>Deletes all commands from the in-application menu with the specified command id.</description>
+
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of the command(s) to delete.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request" since="1.0">
+ <description>Adds a sub menu to the in-application menu.</description>
+
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
+ <description>unique ID of the sub menu to add.</description>
+ </param>
+
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" defvalue="1000" mandatory="false">
+ <description>
+ Position within the items that are are at top level of the in application menu.
+ 0 will insert at the front.
+ 1 will insert at the second position.
+ If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
+ Position of any submenu will always be located before the return and exit options
+ If this param was omitted the entry will be added at the end.
+ </description>
+ </param>
+
+ <param name="menuName" maxlength="500" type="String" mandatory="true">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+
+ <param name="menuIcon" type="Image" mandatory="false" since="5.0">
+ <description>The image field for AddSubMenu</description>
+ </param>
+ </function>
+
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request" since="1.0">
+ <description>Deletes a submenu from the in-application menu.</description>
+
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
+ <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request" since="1.0">
+ <description>creates interaction choice set to be used later by performInteraction</description>
+
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Unique ID used for this interaction choice set.</description>
+ </param>
+
+ <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" mandatory="true"/>
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request" since="1.0">
+ <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
+
+ <param name="initialText" type="String" maxlength="500" mandatory="true">
+ <description>
+ Text to be displayed first.
+ </description>
+ </param>
+
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ This is the initial prompt spoken to the user at the start of an interaction.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="interactionMode" type="InteractionMode" mandatory="true">
+ <description>See InteractionMode.</description>
+ </param>
+
+ <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true" mandatory="true">
+ <description>List of interaction choice set IDs to use with an interaction.</description>
+ </param>
+
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Help text. This is the spoken string when a user speaks "help" when the interaction is occurring.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Timeout text. This text is spoken when a VR interaction times out.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="false">
+ <description>
+ Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.
+ Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform.
+ </description>
+ </param>
+
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
+ <description>
+ Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
+ If omitted on supported displays, the default generated list of suggested choices shall be displayed.
+ </description>
+ </param>
+
+ <param name="interactionLayout" type="LayoutMode" mandatory="false" since="3.0">
+ <description>See LayoutMode.</description>
+ </param>
+
+ </function>
+
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TIMED_OUT"/>
+ <element name="ABORTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ ID of the choice that was selected in response to PerformInteraction.
+ Only is valid if general result is "success:true".
+ </description>
+ </param>
+
+ <param name="manualTextEntry" type="String" maxlength="500" mandatory="false" since="3.0">
+ <description>
+ Manually entered text selection, e.g. through keyboard
+ Can be returned in lieu of choiceID, depending on trigger source
+ </description>
+ </param>
+
+ <param name="triggerSource" type="TriggerSource" mandatory="false">
+ <description>
+ See TriggerSource
+ Only is valid if resultCode is SUCCESS.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request" since="1.0">
+ <description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
+ <description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
+
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of the interaction choice set to delete.</description>
+ </param>
+ </function>
+
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="Alert" functionID="AlertID" messagetype="request" since="1.0">
+ <description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
+
+ <param name="alertText1" type="String" maxlength="500" mandatory="false">
+ <description>The first line of the alert text field</description>
+ </param>
+
+ <param name="alertText2" type="String" maxlength="500" mandatory="false">
+ <description>The second line of the alert text field</description>
+ </param>
+
+ <param name="alertText3" type="String" maxlength="500" mandatory="false" since="2.0">
+ <description>The optional third line of the alert text field</description>
+ </param>
+
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="duration" type="Integer" minvalue="3000" maxvalue="10000" defvalue="5000" mandatory="false">
+ <description>
+ Timeout in milliseconds.
+ Typical timeouts are 3-5 seconds.
+ If omitted, timeout is set to 5s.
+ </description>
+ </param>
+
+ <param name="playTone" type="Boolean" mandatory="false">
+ <description>
+ Defines if tone should be played. Tone is played before TTS.
+ If omitted, no tone is played.
+ </description>
+ </param>
+
+ <param name="progressIndicator" type="Boolean" mandatory="false" since="3.0">
+ <description>
+ If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.
+ </description>
+ </param>
+
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false" since="2.0">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, the displayed alert shall not have any SoftButtons.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Alert" functionID="AlertID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="2.0">
+ <description>
+ Amount of time (in seconds) that an app must wait before resending an alert.
+ If provided, another system event or overlay currently has a higher priority than this alert.
+ An app must not send an alert without waiting at least the amount of time dictated.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Show" functionID="ShowID" messagetype="request" since="1.0">
+ <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
+
+ <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>
+ The text that should be displayed in a single or upper display line.
+ If this text is not set, the text of mainField1 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>
+ The text that should be displayed on the second display line.
+ If this text is not set, the text of mainField2 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ <description>
+ The text that should be displayed on the second "page" first display line.
+ If this text is not set, the text of mainField3 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ <description>
+ The text that should be displayed on the second "page" second display line.
+ If this text is not set, the text of mainField4 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="alignment" type="TextAlignment" mandatory="false" since="1.0">
+ <description>
+ Specifies how mainField1 and mainField2 texts should be aligned on display.
+ If omitted, texts will be centered.
+ </description>
+ </param>
+
+ <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
+ </param>
+
+ <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>
+ Text value for MediaClock field. Has to be properly formatted by Mobile App according to the module's capabilities.
+ If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
+ </description>
+ </param>
+
+ <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
+ <description>
+ The text that should be displayed in the track field.
+ If this text is not set, the text of mediaTrack stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="graphic" type="Image" mandatory="false" since="3.0">
+ <description>
+ Image struct determining whether static or dynamic image to display in app.
+ If omitted on supported displays, the displayed graphic shall not change.
+ </description>
+ </param>
+
+ <param name="secondaryGraphic" type="Image" mandatory="false" since="3.0">
+ <description>
+ Image struct determining whether static or dynamic secondary image to display in app.
+ If omitted on supported displays, the displayed secondary graphic shall not change.
+ </description>
+ </param>
+
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false" since="2.0">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, the currently displayed SoftButton values will not change.
+ </description>
+ </param>
+
+ <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false" since="3.0">
+ <description>
+ App labeled on-screen presets (i.e. on-screen media presets or dynamic search suggestions).
+ If omitted on supported displays, the presets will be shown as not defined.
+ </description>
+ </param>
+
+ <param name="metadataTags" type="MetadataTags" mandatory="false" since="4.5">
+ <description>App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4.
+ If omitted on supported displays, the currently set metadata tags will not change.
+ If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.</description>
+ </param>
+ </function>
+
+ <function name="Show" functionID="ShowID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ <element name="ABORTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="Speak" functionID="SpeakID" messagetype="request" since="1.0">
+ <description>Speaks a text.</description>
+
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Speak" functionID="SpeakID" messagetype="response" since="1.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request" since="1.0">
+ <description>Sets the initial media clock value and automatic update method.</description>
+
+ <param name="startTime" type="StartTime" mandatory="false">
+ <description>
+ See StartTime.
+ startTime must be provided for "COUNTUP" and "COUNTDOWN".
+ startTime will be ignored for "RESUME", and "CLEAR"
+ startTime can be sent for "PAUSE", in which case it will update the paused startTime
+ </description>
+ </param>
+
+ <param name="endTime" type="StartTime" mandatory="false" since="3.0">
+ <description>
+ See StartTime.
+ endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
+ If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
+ endTime will be ignored for "RESUME", and "CLEAR"
+ endTime can be sent for "PAUSE", in which case it will update the paused endTime
+ </description>
+ </param>
+
+ <param name="updateMode" type="UpdateMode" mandatory="true">
+ <description>
+ Enumeration to control the media clock.
+ In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.
+ </description>
+ </param>
+
+ <param name="audioStreamingIndicator" type="AudioStreamingIndicator" mandatory="false" since="5.0">
+ <description>
+ Enumeration for the indicator icon on a play/pause button. see AudioStreamingIndicator.
+ </description>
+ </param>
+ </function>
+
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request" since="2.0">
+ <description>Starts audio pass thru session </description>
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ The module will speak this prompt before opening the audio pass thru session.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ If omitted, then no initial prompt is spoken.
+ </description>
+ </param>
+ <param name="audioPassThruDisplayText1" type="String" mandatory="false" maxlength="500">
+ <description>First line of text displayed during audio capture.</description>
+ </param>
+ <param name="audioPassThruDisplayText2" type="String" mandatory="false" maxlength="500">
+ <description>Second line of text displayed during audio capture.</description>
+ </param>
+ <param name="samplingRate" type="SamplingRate" mandatory="true">
+ <description> This value shall be allowed at 8 kHz or 16 or 22 or 44 kHz.</description>
+ </param>
+ <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
+ <description>The maximum duration of audio recording in milliseconds. </description>
+ </param>
+ <param name="bitsPerSample" type="BitsPerSample" mandatory="true">
+ <description>Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.</description>
+ </param>
+ <param name="audioType" type="AudioType" mandatory="true">
+ <description>Specifies the type of audio data being requested.</description>
+ </param>
+ <param name="muteAudio" type="Boolean" mandatory="false">
+ <description>
+ Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
+ If omitted, the value is set to true.
+ </description>
+ </param>
+ </function>
+
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="RETRY"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request" since="2.0">
+ <description>When this request is invoked, the audio capture stops.</description>
+ </function>
+
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request" since="1.0">
+ <description>
+ Subscribes to built-in HMI buttons.
+ The application will be notified by the OnButtonEvent and OnButtonPress.
+ To unsubscribe the notifications, use unsubscribeButton.
+ </description>
+
+ <param name="buttonName" type="ButtonName" mandatory="true">
+ <description>Name of the button to subscribe.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_RESOURCE" />
+ <element name="IGNORED" />
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request" since="1.0">
+ <description>Unsubscribes from built-in HMI buttons.</description>
+
+ <param name="buttonName" type="ButtonName" mandatory="true">
+ <description>Name of the button to unsubscribe.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_RESOURCE" />
+ <element name="IGNORED" />
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request" since="2.0">
+ <description>
+ Subscribes for specific published data items.
+ The data will be only sent if it has changed.
+ The application will be notified by the onVehicleData notification whenever new data is available.
+ To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
+ </description>
+
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="WARNINGS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED" />
+ <element name="IGNORED" />
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="prndl" type="VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+ <param name="cloudAppVehicleID" type="VehicleDataResult" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request" since="2.0">
+ <description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</description>
+
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="WARNINGS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED" />
+ <element name="IGNORED" />
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="prndl" type="VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+ <param name="cloudAppVehicleID" type="VehicleDataResult" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="VehicleDataResult" mandatory="false" >
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="request" since="2.0">
+ <description>Non periodic vehicle data read request.</description>
+
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="vin" type="Boolean" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including ignition status and internal temp</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+ <param name="cloudAppVehicleID" type="Boolean" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="response" since="2.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="VEHICLE_DATA_NOT_ALLOWED"/>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE"/>
+ <element name="USER_DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+ <param name="cloudAppVehicleID" type="String" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="request" since="2.0">
+ <description>Non periodic vehicle data read request</description>
+
+ <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of ECU.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
+ <description>Get raw data from vehicle data DID location(s)</description>
+ </param>
+ </function>
+
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="response" since="2.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="didResult" type="DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>Array of requested DID results (with data if available).</description>
+ </param>
+
+ </function>
+
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="request" since="2.0">
+ <description>Vehicle module diagnostic trouble code request.</description>
+
+ <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of ECU.</description>
+ </param>
+
+ <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
+ <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
+ </param>
+
+ </function>
+
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="response" since="2.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
+ </param>
+
+ <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
+ <description>
+ Array of all reported DTCs on module (ecuHeader contains information if list is truncated).
+ Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf).
+ </description>
+ </param>
+
+ </function>
+
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request" since="3.0">
+ <description>Non periodic vehicle diagnostic request</description>
+
+ <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of target ECU.</description>
+ </param>
+
+ <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Length of message (in bytes).</description>
+ </param>
+
+ <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message.
+ </description>
+ </param>
+ </function>
+
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response" since="3.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message result.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request" since="2.0">
+ <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
+ <param name="scrollableMessageBody" type="String" maxlength="500" mandatory="true">
+ <description>Body of text that can include newlines and tabs.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="30000" mandatory="false">
+ <description>App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout).</description>
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.
+ </description>
+ </param>
+ </function>
+
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="CHAR_LIMIT_EXCEEDED"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="Slider" functionID="SliderID" messagetype="request" since="2.0">
+ <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
+ <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
+ <description>Number of selectable items on a horizontal axis</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
+ <description>Initial position of slider control (cannot exceed numTicks)</description>
+ </param>
+ <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
+ <description>Text header to display</description>
+ </param>
+ <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
+ <description>
+ Text footer to display (meant to display min/max threshold descriptors).
+ For a static text footer, only one footer string shall be provided in the array.
+ For a dynamic text footer, the number of footer text string in the array must match the numTicks value.
+ For a dynamic text footer, text array string should correlate with potential slider position index.
+ If omitted on supported displays, no footer text shall be displayed.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="10000" mandatory="false">
+ <description>
+ App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout).
+ If omitted, the value is set to 10000.
+ </description>
+ </param>
+ </function>
+
+ <function name="Slider" functionID="SliderID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="SAVED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="TIMED_OUT"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
+ <description>
+ Current slider value returned when saved or canceled (aborted)
+ This value is only returned for resultCodes "SAVED" or "ABORTED"
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request" since="2.0">
+ <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ </param>
+ <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ </param>
+ <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ </param>
+ <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false" since="3.0">
+ </param>
+ <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
+ </param>
+ <param name="turnIcon" type="Image" mandatory="false" since="2.0">
+ </param>
+ <param name="nextTurnIcon" type="Image" mandatory="false" since="3.0">
+ </param>
+ <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
+ <description>
+ Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).
+ Used to calculate progress bar.
+ </description>
+ </param>
+ <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
+ <description>
+ Distance till next maneuver (starting from) from previous maneuver.
+ Used to calculate progress bar.
+ </description>
+ </param>
+ <param name="maneuverComplete" type="Boolean" mandatory="false" since="2.0">
+ <description>
+ If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay.
+ If omitted the value will be assumed as FALSE.
+ </description>
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false" since="2.0">
+ <description>
+ Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
+ If omitted on supported displays, the currently displayed SoftButton values will not change.
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request" since="2.0">
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <description>If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed.</description>
+ </param>
+ </function>
+
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request" since="2.0">
+ <param name="turnList" type="Turn" minsize="1" maxsize="100" array="true" mandatory="false">
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
+ <description>If omitted on supported displays, app-defined SoftButton will be left blank.</description>
+ </param>
+ </function>
+
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request" since="2.0">
+ <param name="language" type="Language" mandatory="true">
+ <description>Requested voice engine (VR+TTS) language registration</description>
+ </param>
+ <param name="hmiDisplayLanguage" type="Language" mandatory="true">
+ <description>Request display language registration</description>
+ </param>
+ <param name="appName" type="String" maxlength="100" mandatory="false" since="3.0">
+ <description>Request new app name registration</description>
+ </param>
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
+ <description>Request new ttsName registration</description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="3.0">
+ <description>Request new app short name registration</description>
+ </param>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
+ <description>Request new VR synonyms registration</description>
+ </param>
+
+ </function>
+
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response" since="2.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description>
+ true, if successful
+ false, if failed
+ </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="GenericResponse" functionID="GenericResponseID" messagetype="response" since="1.0">
+ <description>
+ Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.
+ Currently, only resultCode INVALID_DATA is used.
+ </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="INVALID_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PutFile" functionID="PutFileID" messagetype="request" since="3.0">
+ <description>
+ Used to push a binary data onto the module from a mobile device, such as icons and album art
+ Not supported on first generation of SDL enabled modules.
+ Binary data is in binary part of hybrid msg.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ <param name="fileType" type="FileType" mandatory="true">
+ <description>Selected file type.</description>
+ </param>
+
+ <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to persist between sessions / ignition cycles.
+ If set to TRUE, then the system will aim to persist this file through session / cycles.
+ While files with this designation will have priority over others, they are subject to deletion by the system at any time.
+ In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+
+ <param name="systemFile" type="Boolean" defvalue="false" mandatory="false" >
+ <description>
+ Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+
+ <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional length in bytes for resuming partial data chunks
+ If offset is set to 0, then length is the total length of the file to be downloaded
+ </description>
+ </param>
+ <param name="crc" type="Integer" minvalue="0" maxvalue="4294967295" mandatory="false" since="5.0">
+ <description> Additional CRC32 checksum to protect data integrity up to 512 Mbits </description>
+ </param>
+ </function>
+
+ <function name="PutFile" functionID="PutFileID" messagetype="response" since="3.0">
+ <description>Response is sent, when the file data was copied (success case). Or when an error occurred.</description>
+ <description>Not supported on first generation SDL enabled vehicles. </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="CORRUPTED_DATA"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
+ <description>
+ Provides the total local space available in SDL Core for the registered app.
+ If the transfer has systemFile enabled, then the value will be set to 0 automatically.
+ </description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="GetFile" functionID="GetFileID" messagetype="request" since="5.1">
+ <description>This request is sent to the module to retrieve a file</description>
+ <param name="fileName" type="String" maxlength="255" mandatory="true">
+ <description>File name that should be retrieved</description>
+ </param>
+ <param name="appServiceId" type="String" mandatory="false">
+ <description>ID of the service that should have uploaded the requested file.</description>
+ </param>
+ <param name="fileType" type="FileType" mandatory="false">
+ <description>Selected file type.</description>
+ </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional length in bytes for resuming partial data chunks
+ If offset is set to 0, then length is the total length of the file to be retrieved
+ </description>
+ </param>
+ </function>
+
+ <function name="GetFile" functionID="GetFileID" messagetype="response" since="5.1">
+ <description>This response includes the data that is requested from the specific service</description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="FILE_NOT_FOUND"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <!-- Specific response data -->
+ <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+
+ <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks if offset is set to 0, then length is the total length of the file to be downloaded</description>
+ </param>
+
+ <param name="fileType" type="FileType" mandatory="false">
+ <description>File type that is being sent in response.</description>
+ </param>
+
+ <param name="crc" type="Integer" minvalue="0" maxvalue="4294967295" mandatory="false">
+ <description>Additional CRC32 checksum to protect data integrity up to 512 Mbits</description>
+ </param>
+ </function>
+
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="request" since="3.0">
+ <description>
+ Used to delete a file resident on the module in the app's local cache.
+ Not supported on first generation SDL enabled vehicles.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="500" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="response" since="3.0">
+ <description>
+ Response is sent, when the file data was deleted (success case). Or when an error occurred.
+ Not supported on First generation SDL enabled vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
+ <description>Provides the total local space available on the module for the registered app.</description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ListFiles" functionID="ListFilesID" messagetype="request" since="3.0">
+ <description>
+ Requests the current list of resident filenames for the registered app.
+ Not supported on first generation SDL enabled vehicles.
+ </description>
+ </function>
+
+ <function name="ListFiles" functionID="ListFilesID" messagetype="response" since="3.0">
+ <description>
+ Returns the current list of resident filenames for the registered app along with the current space available
+ Not supported on First generation SDL enabled vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="filenames" type="String" maxlength="500" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>
+ An array of all filenames resident on the module for the given registered app.
+ If omitted, then no files currently reside on the system.
+ </description>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
+ <description>Provides the total local space available on the module for the registered app.</description>
+ <history>
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
+ </history>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request" since="3.0">
+ <description>
+ Used to set existing local file on the module as the app's icon
+ Not supported on first generation SDL enabled vehicles.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="500" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ </function>
+
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response" since="3.0">
+ <description>
+ Response is sent, when the file data was copied (success case). Or when an error occurred.
+ Not supported on First generation SDL enabled vehicles.
+ </description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request" since="3.0">
+ <description>
+ Used to set an alternate display layout.
+ If not sent, default screen for given platform will be shown
+ </description>
+
+ <param name="displayLayout" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created screen layout.
+ Currently only predefined screen layouts are defined.
+ </description>
+ </param>
+
+ <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+
+ <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
+ </function>
+
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response" since="3.0">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </param>
+
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
+ </param>
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" since="3.0">
+ <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests)</description>
+ <param name="requestType" type="RequestType" mandatory="true">
+ <description>
+ The type of system request.
+ Note that Proprietary requests should forward the binary data to the known proprietary module on the system.
+ </description>
+ </param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
+ <param name="fileName" type="String" maxlength="255" mandatory="false">
+ <description>
+ Filename of HTTP data to store in predefined system staging area.
+ Mandatory if requestType is HTTP.
+ PROPRIETARY requestType should ignore this parameter.
+ </description>
+ </param>
+ </function>
+
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" since="3.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_CERT"/>
+ <element name="EXPIRED_CERT"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ <element name="TIMED_OUT"/>
+ <element name="IGNORED"/>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="request" since="3.0">
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description>
+ Name / title of intended location
+ </description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description>
+ Description intended location / establishment (if applicable)
+ </description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>
+ Location address (if applicable)
+ </description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description>
+ Phone number of intended location / establishment (if applicable)
+ </description>
+ </param>
+ <param name="locationImage" type="Image" mandatory="false">
+ <description>
+ Image / icon of intended location (if applicable and supported)
+ </description>
+ </param>
+
+ <param name="timeStamp" type="DateTime" mandatory="false" since="4.1">
+ <description>
+ timestamp in ISO 8601 format
+ </description>
+ </param>
+
+ <param name="address" type="OASISAddress" mandatory="false" since="4.1">
+ <description>Address to be used for setting destination</description>
+ </param>
+ <param name="deliveryMode" type="DeliveryMode" mandatory="false" since="4.1">
+ <description>Defines the mode of prompt for user</description>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="response" since="3.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DialNumber" functionID="DialNumberID" messagetype="request" since="3.0">
+ <description>Dials a phone number and switches to phone application.</description>
+
+ <param name="number" type="String" maxlength="40" mandatory="true">
+ <description>
+ Phone number is a string, which can be up to 40 chars.
+ All characters shall be stripped from string except digits 0-9 and * # , ; +
+ </description>
+ </param>
+ </function>
+
+ <function name="DialNumber" functionID="DialNumberID" messagetype="response" since="3.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="request" since="4.5">
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ <description>The module where the button should be pressed</description>
+ </param>
+ <param name="buttonName" type="ButtonName" mandatory="true">
+ <description>The name of supported RC climate or radio button.</description>
+ </param>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ </function>
+
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="response" since="4.5">
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request" since="4.5">
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ <description>
+ The type of a RC module to retrieve module data from the vehicle.
+ In the future, this should be the Identification of a module.
+ </description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false" since="4.5.1">
+ <description>
+ If subscribe is true, the head unit will register OnInteriorVehicleData notifications for the requested moduleType.
+ If subscribe is false, the head unit will unregister OnInteriorVehicleData notifications for the requested moduleType.
+ If subscribe is not included, the subscription status of the app for the requested moduleType will remain unchanged.
+ </description>
+ <history>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false" since="4.5" until="4.5.1"/>
+ </history>
+ </param>
+ </function>
+
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response" since="4.5">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ <param name="isSubscribed" type="Boolean" mandatory="false" >
+ <description>
+ It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
+ if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType.
+ if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.
+ </description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request" since="4.5">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ <description>The module data to set for the requested RC module.</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response" since="4.5">
+ <description>Used to set the values of one remote control module </description>
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="READ_ONLY"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request" since="4.1">
+ <description>To subscribe in getting changes for Waypoints/destinations</description>
+ </function>
+
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response" since="4.1">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request" since="4.1">
+ <description>Request for getting waypoint/destination data.</description>
+ <param name="wayPointType" type="WayPointType" mandatory="true">
+ <description>To request for either the destination only or for all waypoints including destination</description>
+ </param>
+ </function>
+
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response" since="4.1">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="TIMED_OUT"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IGNORED"/>
+ <element name="IN_USE"/>
+ <element name="DISALLOWED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request" since="4.1">
+ <description>Request to unsubscribe from WayPoints and Destination</description>
+ </function>
+
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response" since="4.1">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="request" since="4.5">
+ <description>Request for expanded information about a supported system/HMI capability</description>
+ <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
+ <description>The type of system capability to get more information on</description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false" since="5.1">
+ <description>Flag to subscribe to updates of the supplied service capability type. If true, the requester will be subscribed. If false, the requester will not be subscribed and be removed as a subscriber if it was previously subscribed.</description>
+ </param>
+ </function>
+
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response" since="4.5">
+ <param name="systemCapability" type="SystemCapability" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE">
+ <description>The capability does not exist on the module</description>
+ </element>
+ <element name="DATA_NOT_AVAILABLE">
+ <description>The capability should exist on the module but there was an error retrieving the data.</description>
+ </element>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="request" since="4.5">
+ <description>Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
+ <param name="hapticRectData" type="HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
+ <description>Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared</description>
+ </param>
+ </function>
+
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="response" since="4.5">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false if failed </description>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+ </function>
+
+ <function name="SetCloudAppProperties" functionID="SetCloudAppPropertiesID" messagetype="request" since="5.1">
+ <description>
+ RPC used to enable/disable a cloud application and set its cloud-related policy properties
+ </description>
+ <param name="properties" type="CloudAppProperties" mandatory="true">
+ <description> The new cloud application properties </description>
+ </param>
+ </function>
+
+ <function name="SetCloudAppProperties" functionID="SetCloudAppPropertiesID" messagetype="response" since="5.1">
+ <description>The response to SetCloudAppProperties</description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ </param>
+ </function>
+
+ <function name="GetCloudAppProperties" functionID="GetCloudAppPropertiesID" messagetype="request" since="5.1">
+ <description>
+ RPC used to get the current properties of a cloud application
+ </description>
+ <param name="appID" type="String" maxlength="100" mandatory="true"></param>
+ </function>
+
+ <function name="GetCloudAppProperties" functionID="GetCloudAppPropertiesID" messagetype="response" since="5.1">
+ <description>The response to GetCloudAppProperties</description>
+ <param name="properties" type="CloudAppProperties" mandatory="false">
+ <description> The requested cloud application properties </description>
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ </param>
+ </function>
+
+ <function name="PublishAppService" functionID="PublishAppServiceID" messagetype="request" since="5.1">
+ <description>Registers a service offered by this app on the module</description>
+
+ <param name="appServiceManifest" type="AppServiceManifest" mandatory="true">
+ <description> The manifest of the service that wishes to be published.</description>
+ </param>
+ </function>
+
+ <function name="PublishAppService" functionID="PublishAppServiceID" messagetype="response" since="5.1">
+ <description>Response to the request to register a service offered by this app on the module</description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="appServiceRecord" type="AppServiceRecord" mandatory="false">
+ <description> If the request was successful, this object will be the current status of the service record for the published service. This will include the Core supplied service ID.</description>
+ </param>
+ </function>
+
+ <function name="GetAppServiceData" functionID="GetAppServiceDataID" messagetype="request" since="5.1">
+ <description> This request asks the module for current data related to the specific service. It also includes an option to subscribe to that service for future updates</description>
+
+ <param name="serviceType" type="String" mandatory="true">
+ <description>The type of service that is to be offered by this app. See AppServiceType for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core.</description>
+ </param>
+
+ <param name="subscribe" type="Boolean" mandatory="false">
+ <description> If true, the consumer is requesting to subscribe to all future updates from the service publisher. If false, the consumer doesn't wish to subscribe and should be unsubscribed if it was previously subscribed.</description>
+ </param>
+ </function>
+
+ <function name="GetAppServiceData" functionID="GetAppServiceDataID" messagetype="response" since="5.1">
+ <description> This response includes the data that was requested from the specific service</description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <!-- Specific response data -->
+ <param name="serviceData" type="AppServiceData" mandatory="false"/>
+ </function>
+
+ <function name="PerformAppServiceInteraction" functionID="PerformAppServiceInteractionID" messagetype="request" since="5.1">
+ <param name="serviceUri" type="String" mandatory="true">
+ <description>Fully qualified URI based on a predetermined scheme provided by the app service. SDL makes no guarantee that this URI is correct.</description>
+ </param>
+
+ <param name="serviceID" type="String" mandatory="true">
+ <description>The service ID that the app consumer wishes to send this URI.</description>
+ </param>
+
+ <param name="originApp" type="String" mandatory="true">
+ <description>This string is the appID of the app requesting the app service provider take the specific action.</description>
+ </param>
+
+ <param name="requestServiceActive" type="Boolean" mandatory="false">
+ <description>This flag signals the requesting consumer would like this service to become the active primary service of the destination's type.</description>
+ </param>
+ </function>
+
+ <function name="PerformAppServiceInteraction" functionID="PerformAppServiceInteractionID" messagetype="response" since="5.1">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result. All results will be available for this response.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="serviceSpecificResult" type="String" mandatory="false">
+ <description>The service can provide specific result strings to the consumer through this param.</description>
+ </param>
+ </function>
+
+ <!-- Notifications -->
+
+ <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0">
+ <param name="hmiLevel" type="HMILevel" mandatory="true">
+ <description>See HMILevel</description>
+ </param>
+
+ <param name="audioStreamingState" type="AudioStreamingState" mandatory="true">
+ <description>See AudioStreamingState</description>
+ </param>
+
+ <param name="systemContext" type="SystemContext" mandatory="true">
+ <description>See SystemContext</description>
+ </param>
+
+ <param name="videoStreamingState" type="VideoStreamingState" mandatory="false" defvalue="STREAMABLE" since="5.0">
+ <description>
+ See VideoStreamingState.
+ If it is NOT_STREAMABLE, the app must stop streaming video to SDL Core(stop service).
+ </description>
+ </param>
+ </function>
+
+ <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification" since="1.0">
+ <param name="reason" type="AppInterfaceUnregisteredReason" mandatory="true">
+ <description>See AppInterfaceUnregisteredReason</description>
+ </param>
+ </function>
+
+ <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification" since="1.0">
+ <description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName" mandatory="true"/>
+ <param name="buttonEventMode" type="ButtonEventMode" mandatory="true">
+ <description>Indicates whether this is an UP or DOWN event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
+ <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
+ </param>
+ </function>
+
+ <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification" since="1.0">
+ <description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName" mandatory="true"/>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
+ <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
+ </param>
+ </function>
+
+ <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification" since="2.0">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
+ <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
+ <description>See TurnSignal</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number.</description>
+ </param>
+ <param name="prndl" type="PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
+ <description>The estimated percentage of remaining oil life of the engine.</description>
+ </param>
+ <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
+ <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
+ </param>
+ <param name="cloudAppVehicleID" type="String" mandatory="false" since="5.1">
+ <description>Parameter used by cloud apps to identify a head unit</description>
+ </param>
+
+ <!-- Ford Specific Vehicle Data -->
+ <param name="eCallInfo" type="ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Vehicle Data -->
+
+ </function>
+
+ <function name="OnCommand" functionID="OnCommandID" messagetype="notification" since="1.0">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Command ID, which is related to a specific menu entry</description>
+ </param>
+
+ <param name="triggerSource" type="TriggerSource" mandatory="true">
+ <description>See TriggerSource</description>
+ </param>
+ </function>
+
+ <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" since="1.0">
+ <description>Provides applications with notifications specific to the current TBT client status on the module</description>
+ <param name="state" type="TBTState" mandatory="true">
+ <description>Current State of TBT client</description>
+ </param>
+ </function>
+
+ <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" since="1.0">
+ <description>Provides driver distraction state to mobile applications</description>
+ <param name="state" type="DriverDistractionState" mandatory="true">
+ <description>Current State of Driver Distraction</description>
+ </param>
+ </function>
+
+ <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" since="2.0">
+ <description>Provides update to app of which policy-table-enabled functions are available</description>
+ <param name="permissionItem" type="PermissionItem" minsize="0" maxsize="500" array="true" mandatory="true">
+ <description>Change in permissions for a given set of RPCs</description>
+ </param>
+ </function>
+
+ <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification" since="2.0">
+ <description>Binary data is in binary part of hybrid msg</description>
+ </function>
+
+ <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification" since="2.0">
+ <param name="language" type="Language" mandatory="true">
+ <description>Current SDL voice engine (VR+TTS) language</description>
+ </param>
+ <param name="hmiDisplayLanguage" type="Language" mandatory="true">
+ <description>Current display language</description>
+ </param>
+ </function>
+
+ <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" since="3.0">
+
+ <description>On-screen keyboard event.</description>
+ <description>Can be full string or individual keypresses depending on keyboard mode.</description>
+
+ <param name="event" type="KeyboardEvent" mandatory="true">
+ <description>On-screen keyboard input data.</description>
+ </param>
+
+ <param name="data" type="String" maxlength="500" mandatory="false">
+ <description>On-screen keyboard input data.</description>
+ <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
+ <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
+ <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
+ </param>
+
+ </function>
+
+ <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" since="3.0">
+ <description>Notifies about touch events on the screen's prescribed area</description>
+ <param name="type" type="TouchType" mandatory="true">
+ <description>The type of touch event.</description>
+ </param>
+ <param name="event" type="TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
+ <description>List of all individual touches involved in this event.</description>
+ </param>
+ </function>
+
+ <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification" since="3.0">
+ <description>
+ An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
+ Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
+ </description>
+ <param name="requestType" type="RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
+ <description>
+ This parameter is filled for supporting OEM proprietary data exchanges.
+ </description>
+ </param>
+ <param name="url" type="String" maxlength="1000" mandatory="false">
+ <description>
+ Optional URL for HTTP requests.
+ If blank, the binary data shall be forwarded to the app.
+ If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional timeout for HTTP requests
+ Required if a URL is provided
+ </description>
+ </param>
+ <param name="fileType" type="FileType" mandatory="false">
+ <description>Optional file type (meant for HTTP file requests).</description>
+ </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+ </function>
+
+ <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification" since="3.0">
+ <description>
+ Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
+ Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
+ </description>
+ <param name="hashID" type="String" maxlength="100" mandatory="true">
+ <description>Calculated hash ID to be referenced during RegisterAppInterface.</description>
+ </param>
+ </function>
+
+ <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification" since="4.1">
+ <description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
+ <param name="wayPoints" type="LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification" since="4.5">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ </function>
+
+ <function name="OnRCStatus" functionID="OnRCStatusID" messagetype="notification" since="5.0">
+ <description>Issued by SDL to notify the application about remote control status change on SDL</description>
+ <param name="allowed" type="Boolean" mandatory="false">
+ <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
+ </param>
+ <param name="allocatedModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are allocated to the application.</description>
+ </param>
+ <param name="freeModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>Contains a list (zero or more) of module types that are free to access for the application.</description>
+ </param>
+ </function>
+
+ <function name="OnAppServiceData" functionID="OnAppServiceDataID" messagetype="notification" since="5.1">
+ <description>This notification includes the data that is updated from the specific service</description>
+
+ <param name="serviceData" type="AppServiceData" mandatory="true"/>
+ </function>
+
+ <function name="OnSystemCapabilityUpdated" functionID="OnSystemCapabilityUpdatedID" messagetype="notification" since="5.1">
+ <description>A notification to inform the connected device that a specific system capability has changed.</description>
+ <param name="systemCapability" type="SystemCapability" mandatory="true">
+ <description>The system capability that has been updated</description>
+ </param>
+ </function>
+
+ <!-- ~~~~~~~~~~~~~~~~~~ -->
+ <!-- Ford Specific APIs -->
+ <!-- ~~~~~~~~~~~~~~~~~~ -->
+
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" since="1.0">
+ <description>
+ Allows encoded data in the form of SyncP packets to be sent to the SYNC module.
+ Legacy / v1 Protocol implementation; use SyncPData instead.
+ *** DEPRECATED ***
+ </description>
+
+ <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>Contains base64 encoded string of SyncP packets.</description>
+ <todo>What is the maxlength?</todo>
+ </param>
+ </function>
+
+ <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" since="1.0">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <!-- Deprecating - covered by SystemRequest
+ <function name="SyncPData" functionID="SyncPDataID" messagetype="request" >
+ <description>
+ Allows binary data in the form of SyncP packets to be sent to the SYNC module.
+ Binary data is in binary part of hybrid msg.
+ </description>
+ </function>
+
+ <function name="SyncPData" functionID="SyncPDataID" messagetype="response" >
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ -->
+
+ <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" since="1.0">
+ <description>
+ Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device.
+ Legacy / v1 Protocol implementation; responds to EncodedSyncPData.
+ *** DEPRECATED ***
+ </description>
+ <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" mandatory="true" array="true">
+ <description>Contains base64 encoded string of SyncP packets.</description>
+ </param>
+ <param name="URL" type="String" maxlength="1000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded to the provided URL.
+ </description>
+ </param>
+ <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
+ </description>
+ </param>
+ </function>
+
+
+ <!-- Deprecating - covered by OnSystemRequest
+ <function name="OnSyncPData" functionID="OnSyncPDataID" messagetype="notification" >
+ <description>
+ Callback including binary data of any SyncP packets that SYNC needs to send back to the mobile device.
+ Responds to SyncPData.
+ Binary data is in binary part of hybrid msg.
+ </description>
+
+ <param name="URL" type="String" maxlength="1000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded to the provided URL.
+ </description>
+ </param>
+ <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ If blank, the SyncP data shall be forwarded to the app.
+ If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
+ </description>
+ </param>
+
+ </function>
+ -->
+</interface>
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/AndroidTestCase2.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/AndroidTestCase2.java
index 1aafa19b6..1aafa19b6 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/AndroidTestCase2.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/AndroidTestCase2.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/SdlConnection/SdlConnectionTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/SdlConnection/SdlConnectionTest.java
index 776da6ccc..776da6ccc 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/SdlConnection/SdlConnectionTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/SdlConnection/SdlConnectionTest.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java
new file mode 100644
index 000000000..17e3d9cd9
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java
@@ -0,0 +1,393 @@
+package com.smartdevicelink.managers;
+
+import android.content.Context;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.managers.lockscreen.LockScreenConfig;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.SdlProxyBase;
+import com.smartdevicelink.proxy.rpc.GetAppServiceDataResponse;
+import com.smartdevicelink.proxy.rpc.GetVehicleData;
+import com.smartdevicelink.proxy.rpc.OnAppServiceData;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.TCPTransportConfig;
+
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Vector;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library manager class :
+ * {@link com.smartdevicelink.managers.SdlManager}
+ */
+public class SdlManagerTests extends AndroidTestCase2 {
+
+ public static BaseTransportConfig transport = null;
+ private Context mTestContext;
+ private Vector<AppHMIType> appType;
+ private TemplateColorScheme templateColorScheme;
+ private int listenerCalledCounter;
+ private SdlManager sdlManager;
+ private SdlProxyBase sdlProxyBase;
+
+ // transport related
+ @SuppressWarnings("FieldCanBeLocal")
+ private int TCP_PORT = 12345;
+ @SuppressWarnings("FieldCanBeLocal")
+ private String DEV_MACHINE_IP_ADDRESS = "0.0.0.0";
+
+ @Override
+ public void setUp() throws Exception{
+ super.setUp();
+
+ // set transport
+ transport = new TCPTransportConfig(TCP_PORT, DEV_MACHINE_IP_ADDRESS, true);
+
+ // add AppTypes
+ appType = new Vector<>();
+ appType.add(AppHMIType.DEFAULT);
+
+ // Color Scheme
+ templateColorScheme = new TemplateColorScheme();
+ templateColorScheme.setBackgroundColor(Test.GENERAL_RGBCOLOR);
+ templateColorScheme.setPrimaryColor(Test.GENERAL_RGBCOLOR);
+ templateColorScheme.setSecondaryColor(Test.GENERAL_RGBCOLOR);
+
+ sdlManager = createSampleManager("heyApp", "123456", Test.GENERAL_LOCKSCREENCONFIG);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ // SETUP / HELPERS
+
+ private Context getTestContext() {
+ return mTestContext;
+ }
+
+ private SdlManager createSampleManager(String appName, String appId, LockScreenConfig lockScreenConfig){
+ 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(getTestContext(),appId,appName,listener);
+ builder.setShortAppName(appName);
+ builder.setAppTypes(appType);
+ builder.setTransportType(transport);
+ 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(lockScreenConfig);
+ builder.setMinimumProtocolVersion(Test.GENERAL_VERSION);
+ builder.setMinimumRPCVersion(Test.GENERAL_VERSION);
+ manager = builder.build();
+
+ // mock SdlProxyBase and set it manually
+ sdlProxyBase = mock(SdlProxyBase.class);
+ manager.setProxy(sdlProxyBase);
+
+ return manager;
+ }
+
+ // TESTS
+
+ public void testNotNull(){
+ assertNotNull(createSampleManager("app","123456", Test.GENERAL_LOCKSCREENCONFIG));
+ }
+
+ public void testMissingAppName() {
+ try {
+ createSampleManager(null,"123456", Test.GENERAL_LOCKSCREENCONFIG);
+ } catch (IllegalArgumentException ex) {
+ assertSame(ex.getMessage(), "You must specify an app name by calling setAppName");
+ }
+ }
+
+ public void testMissingAppId() {
+ try {
+ createSampleManager("app",null, Test.GENERAL_LOCKSCREENCONFIG);
+ } catch (IllegalArgumentException ex) {
+ assertSame(ex.getMessage(), "You must specify an app ID by calling setAppId");
+ }
+ }
+
+ public void testManagerSetters() {
+ assertEquals("123456", sdlManager.getAppId());
+ assertEquals("heyApp", sdlManager.getAppName());
+ assertEquals("heyApp", sdlManager.getShortAppName());
+ assertEquals(appType, sdlManager.getAppTypes());
+ assertEquals(Language.EN_US, sdlManager.getHmiLanguage());
+ assertEquals(transport, sdlManager.getTransport());
+ assertEquals(templateColorScheme, sdlManager.getDayColorScheme());
+ 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());
+ assertEquals(Test.GENERAL_VERSION, sdlManager.getMinimumProtocolVersion());
+ assertEquals(Test.GENERAL_VERSION, sdlManager.getMinimumRPCVersion());
+ }
+
+ public void testStartingManager(){
+ listenerCalledCounter = 0;
+
+ 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
+ sdlManager.initialize();
+
+ // Set all sub managers' states to ready
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
+
+ // Make sure the listener is called exactly once
+ assertEquals("Listener was not called or called more/less frequently than expected", listenerCalledCounter, 1);
+ }
+
+ public void testManagerStates() {
+ SdlManager sdlManager = createSampleManager("test", "00000", new LockScreenConfig());
+ sdlManager.initialize();
+
+
+ // Case 1-A:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.READY, sdlManager.getState());
+
+
+ // Case 1-B:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.READY, sdlManager.getState());
+
+
+ // Case 2-A:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.ERROR, sdlManager.getState());
+
+
+ // Case 1-B:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.ERROR, sdlManager.getState());
+
+
+ // Case 3-A:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.SETTING_UP);
+ sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.LIMITED);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.SETTING_UP, sdlManager.getState());
+
+
+ // Case 3-B:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.SETTING_UP);
+ sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.SETTING_UP, sdlManager.getState());
+
+
+ // Case 4-A:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
+
+
+ // Case 4-B:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
+
+
+ // Case 5-A:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.LIMITED);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
+
+
+ // Case 5-B:
+ sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
+ sdlManager.getFileManager().transitionToState(BaseSubManager.LIMITED);
+ sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
+ sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
+ sdlManager.checkState();
+ assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
+ }
+
+ public void testSendRPC(){
+ listenerCalledCounter = 0;
+
+ // When sdlProxyBase.sendRPCRequest() is called, create a fake success response
+ Answer<Void> answer = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ RPCRequest request = (RPCRequest) args[0];
+ RPCResponse response = new RPCResponse(FunctionID.GET_VEHICLE_DATA.toString());
+ response.setSuccess(true);
+ request.getOnRPCResponseListener().onResponse(0, response);
+ return null;
+ }
+ };
+ try {
+ doAnswer(answer).when(sdlProxyBase).sendRPC(any(RPCMessage.class));
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+
+
+ // Test send RPC request
+ final GetVehicleData request = new GetVehicleData();
+ request.setGps(true);
+ request.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ assertTrue(response.getSuccess());
+ listenerCalledCounter++;
+ }
+ });
+
+ sdlManager.sendRPC(request);
+
+ // Make sure the listener is called exactly once
+ assertEquals("Listener was not called or called more/less frequently than expected", listenerCalledCounter, 1);
+ }
+
+ public void testSendRPCs(){
+ testSendMultipleRPCs(false);
+ }
+
+ public void testSendSequentialRPCs(){
+ testSendMultipleRPCs(true);
+ }
+
+ private void testSendMultipleRPCs(boolean sequentialSend){
+ listenerCalledCounter = 0;
+
+ // When sdlProxyBase.sendRPCRequests() is called, call listener.onFinished() to fake the response
+ final Answer<Void> answer = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
+ listener.onFinished();
+ return null;
+ }
+ };
+ try {
+ if (sequentialSend){
+ doAnswer(answer).when(sdlProxyBase).sendSequentialRequests(any(List.class), any(OnMultipleRequestListener.class));
+
+ } else {
+ doAnswer(answer).when(sdlProxyBase).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ }
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+
+
+ // Test send RPC requests
+ List<RPCMessage> rpcsList = Arrays.asList(new GetVehicleData(), new Show(), new OnAppServiceData(), new GetAppServiceDataResponse());
+ OnMultipleRequestListener onMultipleRequestListener = new OnMultipleRequestListener() {
+ @Override
+ public void onUpdate(int remainingRequests) { }
+
+ @Override
+ public void onFinished() {
+ listenerCalledCounter++;
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {}
+
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {}
+ };
+ if (sequentialSend) {
+ sdlManager.sendSequentialRPCs(rpcsList, onMultipleRequestListener);
+ } else {
+ sdlManager.sendRPCs(rpcsList, onMultipleRequestListener);
+ }
+
+
+ // Make sure the listener is called exactly once
+ assertEquals("Listener was not called or called more/less frequently than expected", listenerCalledCounter, 1);
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java
new file mode 100644
index 000000000..cb4d28454
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java
@@ -0,0 +1,681 @@
+package com.smartdevicelink.managers.audio;
+
+import android.content.Context;
+import android.media.AudioFormat;
+import android.media.MediaFormat;
+import android.media.MediaPlayer;
+import android.os.Build;
+import android.support.test.InstrumentationRegistry;
+import android.util.Log;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+
+import junit.framework.TestCase;
+
+import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.RandomAccessFile;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.verify;
+
+public class AudioStreamManagerTest extends TestCase {
+ public static final String TAG = AudioStreamManagerTest.class.getSimpleName();
+ private Context mContext;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ mContext = InstrumentationRegistry.getContext();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ mContext = null;
+ }
+
+ public void testCreatingAudioStreamManager() {
+ ISdl internalInterface = mock(ISdl.class);
+ AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ doReturn(true).when(internalInterface).isConnected();
+ doReturn(audioCapabilities).when(internalInterface).getCapability(SystemCapabilityType.PCM_STREAMING);
+
+ new AudioStreamManager(internalInterface, mContext);
+ }
+
+ public void testStartAudioStreamManager() {
+ final SdlSession mockSession = mock(SdlSession.class);
+
+ Answer<Void> audioServiceAnswer = new Answer<Void>() {
+ ISdlServiceListener serviceListener = null;
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Method method = invocation.getMethod();
+ Object[] args = invocation.getArguments();
+
+ switch (method.getName()) {
+ case "addServiceListener":
+ // parameters (SessionType serviceType, ISdlServiceListener sdlServiceListener);
+ SessionType sessionType = (SessionType) args[0];
+ assertEquals(sessionType, SessionType.PCM);
+ serviceListener = (ISdlServiceListener) args[1];
+ break;
+ case "startAudioService":
+ // parameters (boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params);
+ Boolean encrypted = (Boolean) args[0];
+ serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
+ break;
+ case "stopAudioService":
+ // parameters ()
+ serviceListener.onServiceEnded(mockSession, SessionType.PCM);
+ break;
+ }
+
+ return null;
+ }
+ };
+
+ ISdl internalInterface = mock(ISdl.class);
+ AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ doReturn(true).when(internalInterface).isConnected();
+ doReturn(audioCapabilities).when(internalInterface).getCapability(SystemCapabilityType.PCM_STREAMING);
+ doAnswer(audioServiceAnswer).when(internalInterface).addServiceListener(any(SessionType.class), any(ISdlServiceListener.class));
+ doAnswer(audioServiceAnswer).when(internalInterface).startAudioService(any(Boolean.class));
+ doAnswer(audioServiceAnswer).when(internalInterface).stopAudioService();
+
+ CompletionListener completionListener = new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertEquals(true, success);
+ }
+ };
+
+ CompletionListener mockListener = spy(completionListener);
+ AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext);
+
+ manager.startAudioStream(false, mockListener);
+ manager.stopAudioStream(mockListener);
+ verify(mockListener, timeout(10000).times(2)).onComplete(any(Boolean.class));
+ }
+
+ public void testWithSquareSampleAudio16BitAnd8KhzApi16() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio16BitAnd16KhzApi16() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio16BitAnd22KhzApi16() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio16BitAnd44KhzApi16() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio8BitAnd8KhzApi16() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._8_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio8BitAnd16KhzApi16() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._8_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio8BitAnd22KhzApi16() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._8_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio8BitAnd44KhzApi16() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._8_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio16BitAnd8KhzApi21() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio16BitAnd16KhzApi21() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio16BitAnd22KhzApi21() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio16BitAnd44KhzApi21() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio8BitAnd8KhzApi21() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._8_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio8BitAnd16KhzApi21() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._8_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio8BitAnd22KhzApi21() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._8_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
+ }
+
+ public void testWithSquareSampleAudio8BitAnd44KhzApi21() throws Exception {
+ setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
+ AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._8_BIT, AudioType.PCM);
+ runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
+ }
+
+ private int testFullAudioManagerDecodeFlowCorrectCounter = 0;
+ private int testFullAudioManagerDecodeFlowWrongCounter = 0;
+ private void runFullAudioManagerDecodeFlowWithSquareSampleAudio(final int sampleRate, final @SampleType int sampleType, final AudioPassThruCapabilities audioCapabilities) {
+ testFullAudioManagerDecodeFlowCorrectCounter = 0;
+ testFullAudioManagerDecodeFlowWrongCounter = 0;
+
+ IAudioStreamListener audioStreamListener = new IAudioStreamListener() {
+ @Override
+ public void sendAudio(byte[] data, int offset, int length, long presentationTimeUs) throws ArrayIndexOutOfBoundsException {
+ ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
+ this.sendAudio(buffer, presentationTimeUs);
+ }
+
+ @Override
+ public void sendAudio(ByteBuffer data, long presentationTimeUs) {
+ SampleBuffer samples = SampleBuffer.wrap(data, sampleType, presentationTimeUs);
+ double timeUs = presentationTimeUs;
+ double sampleDurationUs = 1000000.0 / sampleRate;
+
+ for (int i = 0; i < samples.limit(); ++i) {
+ double sample = samples.get(i);
+ double edge = timeUs % 4000.0;
+
+ if (edge > 2000.0) {
+ // swap sample as it's negative expected
+ sample = sample * -1.0;
+ }
+
+ edge = edge % 2000.0;
+
+ // at the edge of a wave the sample can be lower than 0.7
+ if ((sample > 0.7 && sample < 0.95) || (edge < sampleDurationUs || (2000.0 - sampleDurationUs) < edge)) {
+ testFullAudioManagerDecodeFlowCorrectCounter++;
+ } else {
+ testFullAudioManagerDecodeFlowWrongCounter++;
+ }
+
+ timeUs += sampleDurationUs;
+ }
+ }
+ };
+
+ final SdlSession mockSession = mock(SdlSession.class);
+ doReturn(audioStreamListener).when(mockSession).startAudioStream();
+
+ Answer<Void> audioServiceAnswer = new Answer<Void>() {
+ ISdlServiceListener serviceListener = null;
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Method method = invocation.getMethod();
+ Object[] args = invocation.getArguments();
+
+ switch (method.getName()) {
+ case "addServiceListener":
+ // (SessionType serviceType, ISdlServiceListener sdlServiceListener);
+ SessionType sessionType = (SessionType) args[0];
+ assertEquals(sessionType, SessionType.PCM);
+
+ serviceListener = (ISdlServiceListener) args[1];
+ break;
+ case "startAudioService":
+ //(boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params);
+ Boolean encrypted = (Boolean) args[0];
+ serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
+ break;
+ case "stopAudioService":
+ // parameters ()
+ serviceListener.onServiceEnded(mockSession, SessionType.PCM);
+ break;
+ }
+
+ return null;
+ }
+ };
+
+ ISdl internalInterface = mock(ISdl.class);
+ doReturn(true).when(internalInterface).isConnected();
+ doReturn(audioCapabilities).when(internalInterface).getCapability(any(SystemCapabilityType.class));
+ doAnswer(audioServiceAnswer).when(internalInterface).addServiceListener(any(SessionType.class), any(ISdlServiceListener.class));
+ doAnswer(audioServiceAnswer).when(internalInterface).startAudioService(any(Boolean.class));
+ doAnswer(audioServiceAnswer).when(internalInterface).stopAudioService();
+
+ CompletionListener fileCompletionListener = new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertEquals(true, success);
+
+ // not more than 2.5 percent samples must be wrong
+ double relation = 100.0 * (double)testFullAudioManagerDecodeFlowWrongCounter / (double)testFullAudioManagerDecodeFlowCorrectCounter;
+ Log.v(TAG, "Validating number of correct samples (" + Math.round(relation) + "%)");
+ if (relation > 2.5) {
+ fail("Validating raw audio failed. " + Math.round(relation) + " % wrong samples detected. Correct: " + testFullAudioManagerDecodeFlowCorrectCounter + ", Wrong: " + testFullAudioManagerDecodeFlowWrongCounter);
+ }
+ }
+ };
+
+ final CompletionListener mockFileListener = spy(fileCompletionListener);
+
+ final AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext);
+ manager.startAudioStream(false, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertEquals(true, success);
+
+ manager.pushResource(com.smartdevicelink.test.R.raw.test_audio_square_250hz_80amp_1s, mockFileListener);
+ }
+ });
+
+ verify(mockFileListener, timeout(10000)).onComplete(any(Boolean.class));
+ }
+
+ public void testSampleAtTargetTimeReturnNull() {
+ BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
+ Method sampleAtTargetMethod = getSampleAtTargetMethod();
+ SampleBuffer sample = SampleBuffer.allocate(1, SampleType.SIGNED_16_BIT, ByteOrder.LITTLE_ENDIAN, 1);
+ Double result;
+ try {
+ result = (Double) sampleAtTargetMethod.invoke(mockDecoder, 1.0, sample, 1, 3, 2);
+ assertNull(result);
+ result = (Double) sampleAtTargetMethod.invoke(mockDecoder, 1.0, sample, 5, 3, 1);
+ assertNull(result);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testSampleAtTargetTimeReturnLastOutputSample() {
+ BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
+ Method sampleAtTargetMethod = getSampleAtTargetMethod();
+ SampleBuffer sample = SampleBuffer.allocate(1, SampleType.SIGNED_16_BIT, ByteOrder.LITTLE_ENDIAN, 1);
+ Double result;
+ Double lastOutputSample = 15.0;
+ try {
+ result = (Double) sampleAtTargetMethod.invoke(mockDecoder, lastOutputSample, sample, 6, 1, 5);
+ assertTrue(result.doubleValue() == lastOutputSample);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testSampleAtTargetTimeReturnOutputSampleGet() {
+ BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
+ Method sampleAtTargetMethod = getSampleAtTargetMethod();
+ SampleBuffer sample = SampleBuffer.allocate(10, SampleType.SIGNED_16_BIT, ByteOrder.LITTLE_ENDIAN, 1);
+ Double result;
+ try {
+ result = (Double) sampleAtTargetMethod.invoke(mockDecoder, 1.0, sample, 1, 1, 2);
+ assertTrue(result == sample.get(1));
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testSampleAtTargetTime() {
+ BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
+ Method sampleAtTargetMethod = getSampleAtTargetMethod();
+ SampleBuffer sample = SampleBuffer.allocate(10, SampleType.SIGNED_16_BIT, ByteOrder.LITTLE_ENDIAN, 1);
+ Double result;
+ try {
+ result = (Double) sampleAtTargetMethod.invoke(mockDecoder, 1.0, sample, 1, 3, 2);
+ assertNotNull(result);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testOutputFormatChanged() {
+ BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
+
+ try {
+ Field outputChannelCountField = BaseAudioDecoder.class.getDeclaredField("outputChannelCount");
+ Field outputSampleRateField = BaseAudioDecoder.class.getDeclaredField("outputSampleRate");
+ Field outputSampleTypeField = BaseAudioDecoder.class.getDeclaredField("outputSampleType");
+
+ outputChannelCountField.setAccessible(true);
+ outputSampleRateField.setAccessible(true);
+ outputSampleTypeField.setAccessible(true);
+
+ // channel count, sample rate, sample type
+ int key_channel_count = 0, key_sample_rate = 1, key_sample_type = 2, key_sample_type_result = 3;
+ int[][] tests = new int[][] {
+ { 47, 42000, AudioFormat.ENCODING_PCM_8BIT, SampleType.UNSIGNED_8_BIT },
+ { 2, 16000, AudioFormat.ENCODING_PCM_16BIT, SampleType.SIGNED_16_BIT },
+ { 1, 22050, AudioFormat.ENCODING_PCM_FLOAT, SampleType.FLOAT },
+ { 3, 48000, AudioFormat.ENCODING_INVALID, SampleType.SIGNED_16_BIT },
+ };
+
+ for (int[] test : tests) {
+ int channel_count = test[key_channel_count];
+ int sample_rate = test[key_sample_rate];
+ int sample_type = test[key_sample_type];
+ int sample_type_result = test[key_sample_type_result];
+
+ MediaFormat format = new MediaFormat();
+
+ format.setInteger(MediaFormat.KEY_CHANNEL_COUNT, channel_count);
+ format.setInteger(MediaFormat.KEY_SAMPLE_RATE, sample_rate);
+ format.setInteger(MediaFormat.KEY_PCM_ENCODING, sample_type);
+
+ // in case the phone version is old the method does not take sample type into account but
+ // always expected 16 bit. See https://developer.android.com/reference/android/media/MediaFormat.html#KEY_PCM_ENCODING
+ if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N) {
+ sample_type_result = SampleType.SIGNED_16_BIT;
+ }
+
+ mockDecoder.onOutputFormatChanged(format);
+
+ int output_channel_count = outputChannelCountField.getInt(mockDecoder);
+ int output_sample_rate = outputSampleRateField.getInt(mockDecoder);
+ int output_sample_type = outputSampleTypeField.getInt(mockDecoder);
+
+ // changing from assertEquals to if and fail so travis gives better results
+
+ if (channel_count != output_channel_count) {
+ fail("AssertEqualsFailed: channel_count == output_channel_count (" + channel_count + " == " + output_channel_count + ")");
+ }
+
+ if (sample_rate != output_sample_rate) {
+ fail("AssertEqualsFailed: sample_rate == output_sample_rate (" + sample_rate + " == " + output_sample_rate + ")");
+ }
+
+ if (sample_type_result != output_sample_type) {
+ fail("Assert: sample_type_result == output_sample_type (" + sample_type_result + " == " + output_sample_type + ")");
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testPlayAudioFileForManualTest() throws IOException {
+ AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
+ final int sampleType = SampleType.SIGNED_16_BIT;
+ final int sampleRate = 16000;
+
+ final File outputFile = new File(mContext.getCacheDir(), "test_audio_file.wav");
+ assertNotNull((outputFile));
+ final FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
+ assertNotNull(fileOutputStream);
+ writeWaveHeader(fileOutputStream, sampleRate, sampleType << 3);
+
+ IAudioStreamListener audioStreamListener = new IAudioStreamListener() {
+ long audioLength = 0;
+
+ @Override
+ public void sendAudio(byte[] data, int offset, int length, long presentationTimeUs) throws ArrayIndexOutOfBoundsException {
+ ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
+ this.sendAudio(buffer, presentationTimeUs);
+ }
+
+ @Override
+ public void sendAudio(ByteBuffer data, long presentationTimeUs) {
+ try {
+ long length = data.limit();
+ byte[] d = data.array();
+ fileOutputStream.write(d, 0, (int) length);
+
+ audioLength += length;
+ RandomAccessFile raf = new RandomAccessFile(outputFile, "rw");
+ updateWaveHeaderLength(raf, audioLength);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ final SdlSession mockSession = mock(SdlSession.class);
+ doReturn(audioStreamListener).when(mockSession).startAudioStream();
+
+ Answer<Void> audioServiceAnswer = new Answer<Void>() {
+ ISdlServiceListener serviceListener = null;
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Method method = invocation.getMethod();
+ Object[] args = invocation.getArguments();
+
+ switch (method.getName()) {
+ case "addServiceListener":
+ // (SessionType serviceType, ISdlServiceListener sdlServiceListener);
+ SessionType sessionType = (SessionType) args[0];
+ assertEquals(sessionType, SessionType.PCM);
+
+ serviceListener = (ISdlServiceListener) args[1];
+ break;
+ case "startAudioService":
+ //(boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params);
+ Boolean encrypted = (Boolean) args[0];
+ serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
+ break;
+ case "stopAudioService":
+ // parameters ()
+ serviceListener.onServiceEnded(mockSession, SessionType.PCM);
+ break;
+ }
+
+ return null;
+ }
+ };
+
+ ISdl internalInterface = mock(ISdl.class);
+ doReturn(true).when(internalInterface).isConnected();
+ doReturn(audioCapabilities).when(internalInterface).getCapability(any(SystemCapabilityType.class));
+ doAnswer(audioServiceAnswer).when(internalInterface).addServiceListener(any(SessionType.class), any(ISdlServiceListener.class));
+ doAnswer(audioServiceAnswer).when(internalInterface).startAudioService(any(Boolean.class));
+ doAnswer(audioServiceAnswer).when(internalInterface).stopAudioService();
+
+ final MediaPlayer.OnCompletionListener mockPlayerCompletionListener = mock(MediaPlayer.OnCompletionListener.class);
+ final MediaPlayer player = new MediaPlayer();
+ player.setOnCompletionListener(mockPlayerCompletionListener);
+
+ CompletionListener fileCompletionListener = new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ try {
+ fileOutputStream.flush();
+ fileOutputStream.close();
+
+ player.setDataSource(outputFile.getPath());
+ player.prepare();
+ player.start();
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ final CompletionListener mockFileListener = spy(fileCompletionListener);
+
+ final AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext);
+ manager.startAudioStream(false, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertEquals(true, success);
+
+ manager.pushResource(com.smartdevicelink.test.R.raw.test_audio_square_250hz_80amp_1s, mockFileListener);
+ }
+ });
+
+ verify(mockFileListener, timeout(10000)).onComplete(any(Boolean.class));
+ verify(mockPlayerCompletionListener, timeout(10000)).onCompletion(any(MediaPlayer.class));
+ }
+
+ private Method getSampleAtTargetMethod() {
+ Method method = null;
+ try {
+ method = BaseAudioDecoder.class.getDeclaredMethod("sampleAtTargetTime",
+ double.class, SampleBuffer.class, double.class, double.class, double.class);
+ method.setAccessible(true);
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ fail();
+ }
+ return method;
+ }
+
+ private void setFinalStatic(Field field, Object newValue) throws Exception {
+ field.setAccessible(true);
+ field.set(null, newValue);
+ }
+
+ private void writeWaveHeader(OutputStream stream, long samplerate, long bitspersample) throws IOException {
+ byte[] header = new byte[44];
+ // the data header is 36 bytes large
+ long datalength = 36;
+ long audiolength = 0;
+ long format = 1; // 1 = PCM
+ long channels = 1;
+ long blockalign = (channels * bitspersample) >> 3;
+ long byterate = (samplerate * channels * bitspersample) >> 3;
+
+ // RIFF header.
+ header[0] = 'R';
+ header[1] = 'I';
+ header[2] = 'F';
+ header[3] = 'F';
+ // Total data length (UInt32).
+ header[4] = (byte)((datalength) & 0xff);
+ header[5] = (byte)((datalength >> 8) & 0xff);
+ header[6] = (byte)((datalength >> 16) & 0xff);
+ header[7] = (byte)((datalength >> 24) & 0xff);
+ // WAVE header.
+ header[8] = 'W';
+ header[9] = 'A';
+ header[10] = 'V';
+ header[11] = 'E';
+ // Format (fmt) header.
+ header[12] = 'f';
+ header[13] = 'm';
+ header[14] = 't';
+ header[15] = ' ';
+ // Format header size (UInt32).
+ header[16] = 16;
+ header[17] = 0;
+ header[18] = 0;
+ header[19] = 0;
+ // Format type (UInt16). Set 1 for PCM.
+ header[20] = (byte)((format) & 0xff);
+ header[21] = (byte)((format >> 8) & 0xff);
+ // Channels
+ header[22] = (byte)((channels) & 0xff);
+ header[23] = (byte)((channels >> 8) & 0xff);
+ // Sample rate (UInt32).
+ header[24] = (byte)((samplerate) & 0xff);
+ header[25] = (byte)((samplerate >> 8) & 0xff);
+ header[26] = (byte)((samplerate >> 16) & 0xff);
+ header[27] = (byte)((samplerate >> 24) & 0xff);
+ // Byte rate (UInt32).
+ header[28] = (byte)((byterate) & 0xff);
+ header[29] = (byte)((byterate >> 8) & 0xff);
+ header[30] = (byte)((byterate >> 16) & 0xff);
+ header[31] = (byte)((byterate >> 24) & 0xff);
+ // Block alignment (UInt16).
+ header[32] = (byte)((blockalign) & 0xff);
+ header[33] = (byte)((blockalign >> 8) & 0xff);
+ // Bits per sample (UInt16).
+ header[34] = (byte)((bitspersample) & 0xff);
+ header[35] = (byte)((bitspersample >> 8) & 0xff);
+ // Data header
+ header[36] = 'd';
+ header[37] = 'a';
+ header[38] = 't';
+ header[39] = 'a';
+ // Total audio length (UInt32).
+ header[40] = (byte)((audiolength) & 0xff);
+ header[41] = (byte)((audiolength >> 8) & 0xff);
+ header[42] = (byte)((audiolength >> 16) & 0xff);
+ header[43] = (byte)((audiolength >> 24) & 0xff);
+
+ stream.write(header, 0, header.length);
+ }
+
+ /** Updates the data length and audio length of an existing RIFF/WAVE header in the file pointed by the RandomAccessFile object. */
+ private void updateWaveHeaderLength(RandomAccessFile stream, long audiolength) throws IOException {
+ // the data header is 36 bytes large
+ long datalength = 36 + audiolength;
+
+ // Seek from the beginning to data length
+ stream.seek(4);
+ // Overwrite total data length
+ stream.write((int)((datalength) & 0xff));
+ stream.write((int)((datalength >> 8) & 0xff));
+ stream.write((int)((datalength >> 16) & 0xff));
+ stream.write((int)((datalength >> 24) & 0xff));
+ // Seek from the end of data length to audio length
+ stream.seek(40);
+ // overwrite total audio length
+ stream.write((int)((audiolength) & 0xff));
+ stream.write((int)((audiolength >> 8) & 0xff));
+ stream.write((int)((audiolength >> 16) & 0xff));
+ stream.write((int)((audiolength >> 24) & 0xff));
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java
new file mode 100644
index 000000000..b4e27f205
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java
@@ -0,0 +1,507 @@
+package com.smartdevicelink.managers.file;
+
+import android.content.Context;
+import android.net.Uri;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.file.filetypes.SdlFile;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.ListFiles;
+import com.smartdevicelink.proxy.rpc.ListFilesResponse;
+import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.proxy.rpc.PutFileResponse;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.Assert;
+
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library manager class :
+ * {@link FileManager}
+ */
+public class FileManagerTests extends AndroidTestCase2 {
+ public static final String TAG = "FileManagerTests";
+ private FileManager fileManager;
+ private Context mTestContext;
+ private SdlFile validFile;
+
+ // SETUP / HELPERS
+
+ @Override
+ public void setUp() throws Exception{
+ super.setUp();
+ mTestContext = this.getContext();
+ validFile = new SdlFile();
+ validFile.setName(Test.GENERAL_STRING);
+ validFile.setFileData(Test.GENERAL_BYTE_ARRAY);
+ validFile.setPersistent(false);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private Answer<Void> onListFilesSuccess = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ RPCRequest message = (RPCRequest) args[0];
+ if(message instanceof ListFiles){
+ int correlationId = message.getCorrelationID();
+ ListFilesResponse listFilesResponse = new ListFilesResponse();
+ listFilesResponse.setFilenames(Test.GENERAL_STRING_LIST);
+ listFilesResponse.setSpaceAvailable(Test.GENERAL_INT);
+ listFilesResponse.setSuccess(true);
+ message.getOnRPCResponseListener().onResponse(correlationId, listFilesResponse);
+ }
+ return null;
+ }
+ };
+
+ private Answer<Void> onListFilesFailure = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ RPCRequest message = (RPCRequest) args[0];
+ if(message instanceof ListFiles){
+ int correlationId = message.getCorrelationID();
+ ListFilesResponse listFilesResponse = new ListFilesResponse();
+ listFilesResponse.setSuccess(false);
+ message.getOnRPCResponseListener().onResponse(correlationId, listFilesResponse);
+ }
+ return null;
+ }
+ };
+
+ private Answer<Void> onPutFileSuccess = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ RPCRequest message = (RPCRequest) args[0];
+ if(message instanceof PutFile){
+ int correlationId = message.getCorrelationID();
+ PutFileResponse putFileResponse = new PutFileResponse();
+ putFileResponse.setSuccess(true);
+ message.getOnRPCResponseListener().onResponse(correlationId, putFileResponse);
+ }
+ return null;
+ }
+ };
+
+ private Answer<Void> onPutFileFailure = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ RPCRequest message = (RPCRequest) args[0];
+ if(message instanceof PutFile){
+ int correlationId = message.getCorrelationID();
+ PutFileResponse putFileResponse = new PutFileResponse();
+ putFileResponse.setSuccess(false);
+ message.getOnRPCResponseListener().onResponse(correlationId, putFileResponse);
+ }
+ return null;
+ }
+ };
+
+ private Answer<Void> onSendRequestsSuccess = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ List<RPCRequest> rpcs = (List<RPCRequest>) args[0];
+ OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
+ if(rpcs.get(0) instanceof PutFile){
+ for(RPCRequest message : rpcs){
+ int correlationId = message.getCorrelationID();
+ listener.addCorrelationId(correlationId);
+ PutFileResponse putFileResponse = new PutFileResponse();
+ putFileResponse.setSuccess(true);
+ listener.onResponse(correlationId, putFileResponse);
+ }
+ }
+ return null;
+ }
+ };
+
+ // TESTS
+
+ public void testInitializationSuccess(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ Assert.assertEquals(fileManager.getState(), BaseSubManager.READY);
+ assertEquals(fileManager.getRemoteFileNames(), Test.GENERAL_STRING_LIST);
+ }
+ });
+ }
+
+ public void testInitializationFailure(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesFailure).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertFalse(success);
+ assertEquals(fileManager.getState(), BaseSubManager.ERROR);
+ }
+ });
+ }
+
+ public void testFileUploadSuccess(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+ doAnswer(onPutFileSuccess).when(internalInterface).sendRPCRequest(any(PutFile.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ fileManager.uploadFile(validFile, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ assertTrue(fileManager.getRemoteFileNames().contains(validFile.getName()));
+ assertTrue(fileManager.hasUploadedFile(validFile));
+ }
+ });
+ }
+ });
+ }
+
+ public void testFileUploadFailure(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+ doAnswer(onPutFileFailure).when(internalInterface).sendRPCRequest(any(PutFile.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ fileManager.uploadFile(validFile, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertFalse(success);
+ assertFalse(fileManager.getRemoteFileNames().contains(validFile.getName()));
+ assertFalse(fileManager.hasUploadedFile(validFile));
+ }
+ });
+ }
+ });
+ }
+
+ public void testFileUploadForStaticIcon(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ SdlArtwork artwork = new SdlArtwork(StaticIconName.ALBUM);
+ fileManager.uploadFile(artwork, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ }
+ });
+ }
+ });
+ }
+
+ public void testInvalidSdlFileInput(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ SdlFile sdlFile = new SdlFile();
+ // Don't set name
+ sdlFile.setFileData(Test.GENERAL_BYTE_ARRAY);
+ checkForUploadFailure(fileManager, sdlFile);
+
+ sdlFile = new SdlFile();
+ sdlFile.setName(Test.GENERAL_STRING);
+ // Don't set data
+ checkForUploadFailure(fileManager, sdlFile);
+
+ sdlFile = new SdlFile();
+ sdlFile.setName(Test.GENERAL_STRING);
+ // Give an invalid resource ID
+ sdlFile.setResourceId(Test.GENERAL_INT);
+ checkForUploadFailure(fileManager, sdlFile);
+
+ sdlFile = new SdlFile();
+ sdlFile.setName(Test.GENERAL_STRING);
+ // Set invalid Uri
+ Uri testUri = Uri.parse("http://www.google.com");
+ sdlFile.setUri(testUri);
+ checkForUploadFailure(fileManager, sdlFile);
+ }
+ });
+ }
+
+ private void checkForUploadFailure(FileManager fileManager, SdlFile sdlFile){
+ boolean error = false;
+
+ try {
+ fileManager.uploadFile(sdlFile, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {}
+ });
+ }catch (IllegalArgumentException e){
+ error = true;
+ }
+
+ assertTrue(error);
+ }
+
+ public void testInvalidSdlArtworkInput(){
+ SdlArtwork sdlArtwork = new SdlArtwork();
+ // Set invalid type
+ for(FileType fileType : FileType.values()){
+ boolean shouldError = true, didError = false;
+ if(fileType.equals(FileType.GRAPHIC_BMP) || fileType.equals(FileType.GRAPHIC_PNG)
+ || fileType.equals(FileType.GRAPHIC_JPEG)){
+ shouldError = false;
+ }
+ try{
+ sdlArtwork.setType(fileType);
+ }catch(IllegalArgumentException e){
+ didError = true;
+ }
+ assertEquals(shouldError, didError);
+ }
+ }
+
+ public void testMultipleFileUploadThenDeleteSuccess(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+ doAnswer(onSendRequestsSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ int fileNum = 1;
+ final List<SdlFile> filesToUpload = new ArrayList<>();
+ SdlFile sdlFile = new SdlFile();
+ sdlFile.setName("file" + fileNum++);
+ Uri uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
+ sdlFile.setUri(uri);
+ filesToUpload.add(sdlFile);
+
+ sdlFile = new SdlFile();
+ sdlFile.setName("file" + fileNum++);
+ sdlFile.setResourceId(com.smartdevicelink.test.R.drawable.ic_sdl);
+ filesToUpload.add(sdlFile);
+
+ fileManager.uploadFiles(filesToUpload,
+ new MultipleFileCompletionListener() {
+ @Override
+ public void onComplete(Map<String, String> errors) {
+ assertNull(errors);
+ List <String> uploadedFileNames = fileManager.getRemoteFileNames();
+ for(SdlFile file : filesToUpload){
+ assertTrue(uploadedFileNames.contains(file.getName()));
+ }
+ fileManager.deleteRemoteFilesWithNames(uploadedFileNames, new MultipleFileCompletionListener() {
+ @Override
+ public void onComplete(Map<String, String> errors) {
+ assertNull(errors);
+ List <String> uploadedFileNames = fileManager.getRemoteFileNames();
+ for(SdlFile file : filesToUpload){
+ assertFalse(uploadedFileNames.contains(file.getName()));
+ }
+ }
+ });
+ }
+ });
+ }
+ });
+ }
+
+ public void testMultipleFileUploadPartialFailure(){
+ final String failureReason = "No space available";
+
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+
+ Answer<Void> onSendRequestsFailure = new Answer<Void>() {
+ private int responseNum = 0;
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ List<RPCRequest> rpcs = (List<RPCRequest>) args[0];
+ OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
+ if(rpcs.get(0) instanceof PutFile){
+ for(RPCRequest message : rpcs){
+ int correlationId = message.getCorrelationID();
+ listener.addCorrelationId(correlationId);
+ PutFileResponse putFileResponse = new PutFileResponse();
+ if(responseNum++ % 2 == 0){
+ listener.onError(correlationId, Result.OUT_OF_MEMORY, failureReason);
+ }else{
+ putFileResponse.setSuccess(true);
+ listener.onResponse(correlationId, putFileResponse);
+ }
+ }
+ }
+ return null;
+ }
+ };
+ doAnswer(onSendRequestsFailure).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ final String baseFileName = "file";
+ int fileNum = 0;
+ final List<SdlFile> filesToUpload = new ArrayList<>();
+ SdlFile sdlFile = new SdlFile();
+ sdlFile.setName(baseFileName + fileNum++);
+ Uri uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
+ sdlFile.setUri(uri);
+ filesToUpload.add(sdlFile);
+
+ sdlFile = new SdlFile();
+ sdlFile.setName(baseFileName + fileNum++);
+ sdlFile.setResourceId(com.smartdevicelink.test.R.drawable.ic_sdl);
+ filesToUpload.add(sdlFile);
+
+ sdlFile = new SdlFile();
+ sdlFile.setName(baseFileName + fileNum++);
+ sdlFile.setFileData(Test.GENERAL_BYTE_ARRAY);
+ sdlFile.setPersistent(true);
+ sdlFile.setType(FileType.BINARY);
+ filesToUpload.add(sdlFile);
+
+ fileManager.uploadFiles(filesToUpload,
+ new MultipleFileCompletionListener() {
+ @Override
+ public void onComplete(Map<String, String> errors) {
+ assertNotNull(errors);
+ for(int i = 0; i < filesToUpload.size(); i++){
+ if(i % 2 == 0){
+ assertTrue(errors.containsKey(filesToUpload.get(i).getName()));
+ assertEquals(FileManager.buildErrorString(Result.OUT_OF_MEMORY,
+ failureReason), errors.get(filesToUpload.get(i).getName()));
+ }else{
+ assertFalse(errors.containsKey(filesToUpload.get(i).getName()));
+ }
+ }
+ List <String> uploadedFileNames = fileManager.getRemoteFileNames();
+ for(int i = 0; i < filesToUpload.size(); i++){
+ if(i % 2 == 0){
+ assertFalse(uploadedFileNames.contains(filesToUpload.get(i).getName()));
+ }else{
+ assertTrue(uploadedFileNames.contains(filesToUpload.get(i).getName()));
+ }
+ }
+ }
+ });
+ }
+ });
+ }
+
+ public void testMultipleArtworkUploadSuccess(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+ doAnswer(onSendRequestsSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ int fileNum = 1;
+ final List<SdlArtwork> artworkToUpload = new ArrayList<>();
+ SdlArtwork sdlArtwork = new SdlArtwork();
+ sdlArtwork.setName("art" + fileNum++);
+ Uri uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
+ sdlArtwork.setUri(uri);
+ sdlArtwork.setType(FileType.GRAPHIC_PNG);
+ artworkToUpload.add(sdlArtwork);
+
+ sdlArtwork = new SdlArtwork();
+ sdlArtwork.setName("art" + fileNum++);
+ uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/sdl_tray_icon");
+ sdlArtwork.setUri(uri);
+ sdlArtwork.setType(FileType.GRAPHIC_PNG);
+ artworkToUpload.add(sdlArtwork);
+
+ fileManager.uploadFiles(artworkToUpload,
+ new MultipleFileCompletionListener() {
+ @Override
+ public void onComplete(Map<String, String> errors) {
+ assertNull(errors);
+ List < String > uploadedFileNames = fileManager.getRemoteFileNames();
+ for(SdlArtwork artwork : artworkToUpload){
+ assertTrue(uploadedFileNames.contains(artwork.getName()));
+ }
+ }
+ });
+ }
+ });
+ }
+
+ public void testPersistentFileUploaded(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
+
+ final SdlFile file = new SdlFile();
+ file.setName(Test.GENERAL_STRING_LIST.get(0));
+ file.setPersistent(true);
+
+ final FileManager fileManager = new FileManager(internalInterface, mTestContext);
+ fileManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(fileManager.hasUploadedFile(file));
+ }
+ });
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java
new file mode 100644
index 000000000..22e2cba2f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java
@@ -0,0 +1,182 @@
+package com.smartdevicelink.managers.lifecycle;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.util.Version;
+
+import java.lang.reflect.InvocationTargetException;
+
+public class RpcConverterTest extends AndroidTestCase2 {
+
+ private static final String RPC_PACKAGE = "com.smartdevicelink.proxy.rpc.";
+ private static final String RESPONSE_KEY = "Response";
+ private static final Version MAX_RPC_VERSION = new Version(5,1,0);
+
+ /**
+ * The RPC converter relies on the function id json name to match the class name exactly.
+ * Therefore we will test to ensure that they match up first.
+ */
+ public void testFunctionIdsAgainstFileNames(){
+ FunctionID[] functionIDs = FunctionID.values();
+ for(FunctionID functionID : functionIDs) {
+ switch (functionID){
+ case SYNC_P_DATA:
+ case ON_SYNC_P_DATA:
+ case ENCODED_SYNC_P_DATA:
+ case ON_ENCODED_SYNC_P_DATA:
+ case GENERIC_RESPONSE:
+ case STREAM_RPC:
+ case ON_LOCK_SCREEN_STATUS:
+ case ON_SDL_CHOICE_CHOSEN:
+ case ON_STREAM_RPC:
+ continue;
+ default:
+
+ }
+ assertNotNull(getClassForFunctionId(functionID, false));
+ if (FunctionID.REGISTER_APP_INTERFACE.getId() <= functionID.getId()
+ && functionID.getId() < FunctionID.ON_HMI_STATUS.getId()) {
+ //Test response of the request
+ assertNotNull(getClassForFunctionId(functionID, true));
+ }
+ }
+ }
+
+
+ private Class getClassForFunctionId(FunctionID functionID, boolean isResponse) {
+ try {
+ StringBuilder rpcClassName = new StringBuilder();
+ rpcClassName.append(RPC_PACKAGE);
+
+ switch (functionID) {
+ case SYNC_P_DATA:
+ case ON_SYNC_P_DATA:
+ case ENCODED_SYNC_P_DATA:
+ case ON_ENCODED_SYNC_P_DATA:
+ case GENERIC_RESPONSE:
+ case STREAM_RPC:
+ case ON_LOCK_SCREEN_STATUS:
+ case ON_SDL_CHOICE_CHOSEN:
+ case ON_STREAM_RPC:
+ return null;
+ case SHOW_CONSTANT_TBT:
+ rpcClassName.append("ShowConstantTbt");
+ break;
+ default:
+ rpcClassName.append(functionID);
+ break;
+ }
+
+
+ if (isResponse) {
+ //Test response of the request
+ rpcClassName.append(RESPONSE_KEY);
+ }
+ return Class.forName(rpcClassName.toString());
+
+ } catch (Exception e) {
+
+ }
+ return null;
+ }
+
+ public void testRpcCreation(){
+
+ FunctionID[] functionIDs = FunctionID.values();
+
+ for(FunctionID functionID : functionIDs){
+ switch (functionID){
+ case SYNC_P_DATA:
+ case ON_SYNC_P_DATA:
+ case ENCODED_SYNC_P_DATA:
+ case ON_ENCODED_SYNC_P_DATA:
+ case GENERIC_RESPONSE:
+ case STREAM_RPC:
+ case ON_LOCK_SCREEN_STATUS:
+ case ON_SDL_CHOICE_CHOSEN:
+ case ON_STREAM_RPC:
+ continue;
+ default:
+
+ }
+ assertRpc(getClassForFunctionId(functionID, false));
+
+ if (FunctionID.REGISTER_APP_INTERFACE.getId() <= functionID.getId()
+ && functionID.getId() < FunctionID.ON_HMI_STATUS.getId()) {
+ //Test response of the request
+ assertRpc(getClassForFunctionId(functionID, true));
+ }
+
+ }
+ }
+
+ private void assertRpc(Class rpcClass){
+ RPCMessage message = generateRpcMessage(rpcClass);
+ assertNotNull(message);
+ ProtocolMessage protocolMessage = generateProtocolMessageForRpc(message);
+ assertNotNull(protocolMessage);
+ RPCMessage newMessage = RpcConverter.extractRpc(protocolMessage,MAX_RPC_VERSION);
+ assertNotNull(newMessage);
+
+ assertEquals(message.getMessageType(), newMessage.getMessageType());
+ assertEquals(message.getFunctionID(), newMessage.getFunctionID());
+ }
+
+ private RPCMessage generateRpcMessage(Class rpcClass){
+ try {
+ java.lang.reflect.Constructor rpcConstructor = rpcClass.getConstructor();
+ return (RPCMessage)rpcConstructor.newInstance();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ private ProtocolMessage generateProtocolMessageForRpc(RPCMessage message){
+ try {
+
+ message.format(MAX_RPC_VERSION,true);
+ byte[] msgBytes = JsonRPCMarshaller.marshall(message, (byte)5);
+
+ ProtocolMessage pm = new ProtocolMessage();
+ pm.setData(msgBytes);
+ pm.setSessionID((byte)0);
+
+ pm.setMessageType(MessageType.RPC);
+ pm.setSessionType(SessionType.RPC);
+ pm.setFunctionID(FunctionID.getFunctionId(message.getFunctionName()));
+ pm.setPayloadProtected(message.isPayloadProtected());
+
+ if (message.getMessageType().equals(RPCMessage.KEY_REQUEST)) {
+ pm.setRPCType((byte)0x00);
+ }else if (message.getMessageType().equals(RPCMessage.KEY_RESPONSE)){
+ pm.setRPCType((byte)0x01);
+ }else if (message.getMessageType().equals(RPCMessage.KEY_NOTIFICATION)){
+ pm.setRPCType((byte)0x02);
+ }else{
+ return null;
+ }
+
+ if (message.getBulkData() != null){
+ pm.setBulkData(message.getBulkData());
+ }
+
+ return pm;
+
+ } catch (OutOfMemoryError e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java
index c2d4066ce..c2d4066ce 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java
index 69e0aa898..69e0aa898 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java
index 6a66a3092..6a66a3092 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java
new file mode 100644
index 000000000..872e09b81
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java
@@ -0,0 +1,135 @@
+package com.smartdevicelink.managers.screen;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.MetadataType;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.mockito.Mockito.mock;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library manager class :
+ * {@link ScreenManager}
+ */
+public class ScreenManagerTests extends AndroidTestCase2 {
+ private ScreenManager screenManager;
+ private SdlArtwork testArtwork;
+
+ @Override
+ public void setUp() throws Exception{
+ super.setUp();
+
+ ISdl internalInterface = mock(ISdl.class);
+ FileManager fileManager = mock(FileManager.class);
+ screenManager = new ScreenManager(internalInterface, fileManager);
+ screenManager.start(null);
+
+
+ testArtwork = new SdlArtwork("testFile", FileType.GRAPHIC_PNG, 1, false);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testInstantiation(){
+ assertNull(screenManager.getTextField1());
+ assertNull(screenManager.getTextField2());
+ assertNull(screenManager.getTextField3());
+ assertNull(screenManager.getTextField4());
+ assertNull(screenManager.getMediaTrackTextField());
+ assertNull(screenManager.getPrimaryGraphic());
+ assertNull(screenManager.getSecondaryGraphic());
+ assertEquals(screenManager.getTextAlignment(), TextAlignment.CENTERED);
+ assertNull(screenManager.getTextField1Type());
+ assertNull(screenManager.getTextField2Type());
+ assertNull(screenManager.getTextField3Type());
+ assertNull(screenManager.getTextField4Type());
+ assertTrue(screenManager.getSoftButtonObjects().isEmpty());
+ assertNull(screenManager.getSoftButtonObjectByName("test"));
+ assertNull(screenManager.getSoftButtonObjectById(1));
+ assertEquals(screenManager.getState(), BaseSubManager.READY);
+ }
+
+ public void testSetTextField() {
+ screenManager.setTextField1("It is");
+ screenManager.setTextField2("Wednesday");
+ screenManager.setTextField3("My");
+ screenManager.setTextField4("Dudes");
+ assertEquals(screenManager.getTextField1(), "It is");
+ assertEquals(screenManager.getTextField2(), "Wednesday");
+ assertEquals(screenManager.getTextField3(), "My");
+ assertEquals(screenManager.getTextField4(), "Dudes");
+ }
+
+ public void testMediaTrackTextFields() {
+ String songTitle = "Wild For The Night";
+ screenManager.setMediaTrackTextField(songTitle);
+ assertEquals(screenManager.getMediaTrackTextField(), songTitle);
+ }
+
+ public void testSetPrimaryGraphic() {
+ screenManager.setPrimaryGraphic(testArtwork);
+ assertEquals(screenManager.getPrimaryGraphic(), testArtwork);
+ }
+
+ public void testSetPrimaryGraphicWithBlankImage() {
+ screenManager.setPrimaryGraphic(null);
+ assertNotNull(screenManager.getPrimaryGraphic());
+ assertEquals(screenManager.getPrimaryGraphic().getName(), "blankArtwork");
+ }
+
+ public void testSetSecondaryGraphic() {
+ screenManager.setSecondaryGraphic(testArtwork);
+ assertEquals(screenManager.getSecondaryGraphic(), testArtwork);
+ }
+
+ public void testSetSecondaryGraphicWithBlankImage() {
+ screenManager.setSecondaryGraphic(null);
+ assertNotNull(screenManager.getSecondaryGraphic());
+ assertEquals(screenManager.getSecondaryGraphic().getName(), "blankArtwork");
+ }
+
+ public void testAlignment() {
+ screenManager.setTextAlignment(TextAlignment.LEFT_ALIGNED);
+ assertEquals(screenManager.getTextAlignment(), TextAlignment.LEFT_ALIGNED);
+ }
+
+ public void testSetTextFieldTypes() {
+ screenManager.setTextField1Type(MetadataType.MEDIA_TITLE);
+ screenManager.setTextField2Type(MetadataType.MEDIA_ALBUM);
+ screenManager.setTextField3Type(MetadataType.MEDIA_ARTIST);
+ screenManager.setTextField4Type(MetadataType.MEDIA_GENRE);
+ assertEquals(screenManager.getTextField1Type(), MetadataType.MEDIA_TITLE);
+ assertEquals(screenManager.getTextField2Type(), MetadataType.MEDIA_ALBUM);
+ assertEquals(screenManager.getTextField3Type(), MetadataType.MEDIA_ARTIST);
+ assertEquals(screenManager.getTextField4Type(), MetadataType.MEDIA_GENRE);
+ }
+
+ public void testSetSoftButtonObjects(){
+ // Create softButtonObject1
+ SoftButtonState softButtonState1 = new SoftButtonState("object1-state1", "it is", testArtwork);
+ SoftButtonState softButtonState2 = new SoftButtonState("object1-state2", "Wed", testArtwork);
+ SoftButtonObject softButtonObject1 = new SoftButtonObject("object1", Arrays.asList(softButtonState1, softButtonState2), softButtonState1.getName(),null);
+
+ // Create softButtonObject2
+ SoftButtonState softButtonState3 = new SoftButtonState("object2-state1", "my", testArtwork);
+ SoftButtonState softButtonState4 = new SoftButtonState("object2-state2", "dudes!", null);
+ SoftButtonObject softButtonObject2 = new SoftButtonObject("object2", Arrays.asList(softButtonState3, softButtonState4), softButtonState3.getName(), null);
+
+ List<SoftButtonObject> softButtonObjects = Arrays.asList(softButtonObject1, softButtonObject2);
+ screenManager.setSoftButtonObjects(Arrays.asList(softButtonObject1, softButtonObject2));
+ assertEquals(screenManager.getSoftButtonObjects(), softButtonObjects);
+ assertEquals(screenManager.getSoftButtonObjectByName("object2"), softButtonObject2);
+ assertEquals(screenManager.getSoftButtonObjectById(100), softButtonObject2);
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java
new file mode 100644
index 000000000..144057c36
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java
@@ -0,0 +1,242 @@
+package com.smartdevicelink.managers.screen;
+
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
+import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.test.Validator;
+
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library manager class :
+ * {@link SoftButtonManager}
+ */
+public class SoftButtonManagerTests extends AndroidTestCase2 {
+
+ private SoftButtonManager softButtonManager;
+ private boolean fileManagerUploadArtworksGotCalled;
+ private boolean internalInterfaceSendRPCRequestGotCalled;
+ private boolean softButtonMangerUpdateCompleted;
+ private SoftButtonObject softButtonObject1, softButtonObject2;
+ private SoftButtonState softButtonState1, softButtonState2, softButtonState3, softButtonState4;
+
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ // When internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, OnRPCNotificationListener) is called
+ // inside SoftButtonManager, respond with a fake HMILevel.HMI_FULL response to let the SoftButtonManager continue working.
+ ISdl internalInterface = mock(ISdl.class);
+ Answer<Void> onHMIStatusAnswer = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ OnRPCNotificationListener onHMIStatusListener = (OnRPCNotificationListener) args[1];
+ OnHMIStatus onHMIStatusFakeNotification = new OnHMIStatus();
+ onHMIStatusFakeNotification.setHmiLevel(HMILevel.HMI_FULL);
+ onHMIStatusListener.onNotified(onHMIStatusFakeNotification);
+ return null;
+ }
+ };
+ doAnswer(onHMIStatusAnswer).when(internalInterface).addOnRPCNotificationListener(eq(FunctionID.ON_HMI_STATUS), any(OnRPCNotificationListener.class));
+
+
+ // When fileManager.uploadArtworks() is called inside the SoftButtonManager, respond with
+ // a fake onComplete() callback to let the SoftButtonManager continue working.
+ FileManager fileManager = mock(FileManager.class);
+ Answer<Void> onFileManagerUploadAnswer = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ fileManagerUploadArtworksGotCalled = true;
+ Object[] args = invocation.getArguments();
+ MultipleFileCompletionListener multipleFileCompletionListener = (MultipleFileCompletionListener) args[1];
+ multipleFileCompletionListener.onComplete(null);
+ return null;
+ }
+ };
+ doAnswer(onFileManagerUploadAnswer).when(fileManager).uploadArtworks(any(List.class), any(MultipleFileCompletionListener.class));
+
+
+ // Create softButtonManager
+ softButtonManager = new SoftButtonManager(internalInterface, fileManager);
+
+
+ // When internalInterface.sendRPCRequest() is called inside SoftButtonManager:
+ // 1) respond with a fake onResponse() callback to let the SoftButtonManager continue working
+ // 2) assert that the Show RPC values (ie: MainField1 & SoftButtons) that are created by the SoftButtonManager, match the ones that are provided by the developer
+ Answer<Void> onSendShowRPCAnswer = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ internalInterfaceSendRPCRequestGotCalled = true;
+ Object[] args = invocation.getArguments();
+ Show show = (Show) args[0];
+
+ show.getOnRPCResponseListener().onResponse(0, null);
+
+ assertEquals(show.getMainField1(), softButtonManager.getCurrentMainField1());
+ assertEquals(show.getSoftButtons().size(), softButtonManager.createSoftButtonsForCurrentState().size());
+
+ return null;
+ }
+ };
+ doAnswer(onSendShowRPCAnswer).when(internalInterface).sendRPCRequest(any(Show.class));
+
+
+ // Create soft button objects
+ softButtonState1 = new SoftButtonState("object1-state1", "o1s1", new SdlArtwork("image1", FileType.GRAPHIC_PNG, 1, true));
+ softButtonState2 = new SoftButtonState("object1-state2", "o1s2", new SdlArtwork(StaticIconName.ALBUM));
+ softButtonObject1 = new SoftButtonObject("object1", Arrays.asList(softButtonState1, softButtonState2), softButtonState1.getName(), null);
+ softButtonState3 = new SoftButtonState("object2-state1", "o2s1", null);
+ softButtonState4 = new SoftButtonState("object2-state2", "o2s2", new SdlArtwork("image3", FileType.GRAPHIC_PNG, 3, true));
+ softButtonObject2 = new SoftButtonObject("object2", Arrays.asList(softButtonState3, softButtonState4), softButtonState3.getName(), null);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testSoftButtonManagerUpdate() {
+ // Reset the boolean variables
+ fileManagerUploadArtworksGotCalled = false;
+ internalInterfaceSendRPCRequestGotCalled = false;
+ softButtonMangerUpdateCompleted = false;
+
+
+ // Test batch update
+ softButtonManager.setBatchUpdates(true);
+ List<SoftButtonObject> softButtonObjects = Arrays.asList(softButtonObject1, softButtonObject2);
+ softButtonManager.setSoftButtonObjects(Arrays.asList(softButtonObject1, softButtonObject2));
+ softButtonManager.setBatchUpdates(false);
+ softButtonManager.update(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ softButtonMangerUpdateCompleted = true;
+ }
+ });
+
+
+ // Test single update, setCurrentMainField1, and transitionToNextState
+ softButtonManager.setCurrentMainField1("It is Wednesday my dudes!");
+ softButtonObject1.transitionToNextState();
+
+
+ // Check that everything got called as expected
+ assertTrue("FileManager.uploadArtworks() did not get called", fileManagerUploadArtworksGotCalled);
+ assertTrue("InternalInterface.sendRPCRequest() did not get called", internalInterfaceSendRPCRequestGotCalled);
+ assertTrue("SoftButtonManger update onComplete() did not get called", softButtonMangerUpdateCompleted);
+
+
+ // Test getSoftButtonObjects
+ assertEquals("Returned softButtonObjects value doesn't match the expected value", softButtonObjects, softButtonManager.getSoftButtonObjects());
+ }
+
+ public void testSoftButtonManagerGetSoftButtonObject() {
+ softButtonManager.setSoftButtonObjects(Arrays.asList(softButtonObject1, softButtonObject2));
+
+
+ // Test get by valid name
+ assertEquals("Returned SoftButtonObject doesn't match the expected value", softButtonObject2, softButtonManager.getSoftButtonObjectByName("object2"));
+
+
+ // Test get by invalid name
+ assertNull("Returned SoftButtonObject doesn't match the expected value", softButtonManager.getSoftButtonObjectByName("object300"));
+
+
+ // Test get by valid id
+ assertEquals("Returned SoftButtonObject doesn't match the expected value", softButtonObject2, softButtonManager.getSoftButtonObjectById(100));
+
+
+ // Test get by invalid id
+ assertNull("Returned SoftButtonObject doesn't match the expected value", softButtonManager.getSoftButtonObjectById(500));
+ }
+
+ public void testSoftButtonState(){
+ // Test SoftButtonState.getName()
+ String nameExpectedValue = "object1-state1";
+ assertEquals("Returned state name doesn't match the expected value", nameExpectedValue, softButtonState1.getName());
+
+
+ // Test SoftButtonState.getArtwork()
+ SdlArtwork artworkExpectedValue = new SdlArtwork("image1", FileType.GRAPHIC_PNG, 1, true);
+ assertTrue("Returned SdlArtwork doesn't match the expected value", Validator.validateSdlFile(artworkExpectedValue, softButtonState1.getArtwork()));
+ SdlArtwork artworkExpectedValue2 = new SdlArtwork(StaticIconName.ALBUM);
+ assertTrue("Returned SdlArtwork doesn't match the expected value", Validator.validateSdlFile(artworkExpectedValue2, softButtonState2.getArtwork()));
+
+
+ // Test SoftButtonState.getSoftButton()
+ SoftButton softButtonExpectedValue = new SoftButton(SoftButtonType.SBT_BOTH, 0);
+ softButtonExpectedValue.setText("o1s1");
+ softButtonExpectedValue.setImage(new Image(artworkExpectedValue.getName(), ImageType.DYNAMIC));
+ assertTrue("Returned SoftButton doesn't match the expected value", Validator.validateSoftButton(softButtonExpectedValue, softButtonState1.getSoftButton()));
+ }
+
+ public void testSoftButtonObject(){
+ // Test SoftButtonObject.getName()
+ assertEquals("Returned object name doesn't match the expected value", "object1", softButtonObject1.getName());
+
+
+ // Test SoftButtonObject.getCurrentState()
+ assertEquals("Returned current state doesn't match the expected value", softButtonState1, softButtonObject1.getCurrentState());
+
+
+ // Test SoftButtonObject.getCurrentStateName()
+ assertEquals("Returned current state name doesn't match the expected value", softButtonState1.getName(), softButtonObject1.getCurrentStateName());
+
+
+ // Test SoftButtonObject.getButtonId()
+ assertEquals("Returned button Id doesn't match the expected value", 0, softButtonObject1.getButtonId());
+
+
+ // Test SoftButtonObject.getCurrentStateSoftButton()
+ SoftButton softButtonExpectedValue = new SoftButton(SoftButtonType.SBT_TEXT, 0);
+ softButtonExpectedValue.setText("o2s1");
+ assertTrue("Returned current state SoftButton doesn't match the expected value", Validator.validateSoftButton(softButtonExpectedValue, softButtonObject2.getCurrentStateSoftButton()));
+
+
+ // Test SoftButtonObject.getStates()
+ assertEquals("Returned object states doesn't match the expected value", Arrays.asList(softButtonState1, softButtonState2), softButtonObject1.getStates());
+
+
+ // Test SoftButtonObject.transitionToNextState()
+ assertEquals(softButtonState1, softButtonObject1.getCurrentState());
+ softButtonObject1.transitionToNextState();
+ assertEquals(softButtonState2, softButtonObject1.getCurrentState());
+
+
+ // Test SoftButtonObject.transitionToStateByName() - transitioning to a none existing state
+ boolean success = softButtonObject1.transitionToStateByName("none existing name");
+ assertFalse(success);
+
+
+ // Test SoftButtonObject.transitionToStateByName() - transitioning to an existing state
+ success = softButtonObject1.transitionToStateByName("object1-state1");
+ assertTrue(success);
+ assertEquals(softButtonState1, softButtonObject1.getCurrentState());
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java
new file mode 100644
index 000000000..d063f52e3
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java
@@ -0,0 +1,546 @@
+package com.smartdevicelink.managers.screen;
+
+import android.content.Context;
+import android.net.Uri;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.MetadataTags;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.TextField;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.MetadataType;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+
+import org.json.JSONException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.mockito.Mockito.mock;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library manager class :
+ * {@link com.smartdevicelink.managers.screen.TextAndGraphicManager}
+ */
+public class TextAndGraphicManagerTests extends AndroidTestCase2 {
+
+ // SETUP / HELPERS
+ private TextAndGraphicManager textAndGraphicManager;
+ private SdlArtwork testArtwork;
+
+ @Override
+ public void setUp() throws Exception{
+ super.setUp();
+ Context mTestContext = this.getContext();
+ // mock things
+ ISdl internalInterface = mock(ISdl.class);
+ FileManager fileManager = mock(FileManager.class);
+ SoftButtonManager softButtonManager = mock(SoftButtonManager.class);
+
+ testArtwork = new SdlArtwork();
+ testArtwork.setName("testFile");
+ Uri uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
+ testArtwork.setUri(uri);
+ testArtwork.setType(FileType.GRAPHIC_PNG);
+
+ textAndGraphicManager = new TextAndGraphicManager(internalInterface, fileManager, softButtonManager);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private DisplayCapabilities getDisplayCapability(int numberOfMainFields){
+
+ TextField mainField1 = new TextField();
+ mainField1.setName(TextFieldName.mainField1);
+ TextField mainField2 = new TextField();
+ mainField2.setName(TextFieldName.mainField2);
+ TextField mainField3 = new TextField();
+ mainField3.setName(TextFieldName.mainField3);
+ TextField mainField4 = new TextField();
+ mainField4.setName(TextFieldName.mainField4);
+
+ List<TextField> textFieldList = new ArrayList<>();
+
+ textFieldList.add(mainField1);
+ textFieldList.add(mainField2);
+ textFieldList.add(mainField3);
+ textFieldList.add(mainField4);
+
+ List<TextField> returnList = new ArrayList<>();
+
+ if (numberOfMainFields > 0){
+ for (int i = 0; i < numberOfMainFields; i++) {
+ returnList.add(textFieldList.get(i));
+ }
+ }
+
+ DisplayCapabilities displayCapabilities = new DisplayCapabilities();
+ displayCapabilities.setTextFields(returnList);
+
+ return displayCapabilities;
+ }
+
+ public void testInstantiation(){
+
+ assertNull(textAndGraphicManager.getTextField1());
+ assertNull(textAndGraphicManager.getTextField2());
+ assertNull(textAndGraphicManager.getTextField3());
+ assertNull(textAndGraphicManager.getTextField4());
+ assertNull(textAndGraphicManager.getMediaTrackTextField());
+ assertNull(textAndGraphicManager.getPrimaryGraphic());
+ assertNull(textAndGraphicManager.getSecondaryGraphic());
+ assertEquals(textAndGraphicManager.getTextAlignment(), TextAlignment.CENTERED);
+ assertNull(textAndGraphicManager.getTextField1Type());
+ assertNull(textAndGraphicManager.getTextField2Type());
+ assertNull(textAndGraphicManager.getTextField3Type());
+ assertNull(textAndGraphicManager.getTextField4Type());
+
+ assertNotNull(textAndGraphicManager.currentScreenData);
+ assertNull(textAndGraphicManager.inProgressUpdate);
+ assertNull(textAndGraphicManager.queuedImageUpdate);
+ assertFalse(textAndGraphicManager.hasQueuedUpdate);
+ assertNull(textAndGraphicManager.displayCapabilities);
+ assertEquals(textAndGraphicManager.currentHMILevel, HMILevel.HMI_NONE);
+ assertFalse(textAndGraphicManager.isDirty);
+ assertEquals(textAndGraphicManager.getState(), BaseSubManager.SETTING_UP);
+ assertNotNull(textAndGraphicManager.getBlankArtwork());
+ }
+
+ public void testGetMainLines(){
+
+ // We want to test that the looping works. By default, it will return 4 if display cap is null
+
+ // Null test
+ assertEquals(textAndGraphicManager.getNumberOfLines(), 4);
+
+ // The tests.java class has an example of this, but we must build it to do what
+ // we need it to do. Build display cap w/ 3 main fields and test that it returns 3
+ textAndGraphicManager.displayCapabilities = getDisplayCapability(3);
+ assertEquals(textAndGraphicManager.getNumberOfLines(), 3);
+ }
+
+ public void testAssemble1Line(){
+
+ Show inputShow = new Show();
+
+ // Force it to return display with support for only 1 line of text
+ textAndGraphicManager.displayCapabilities = getDisplayCapability(1);
+
+ textAndGraphicManager.setTextField1("It is");
+ textAndGraphicManager.setTextField1Type(MetadataType.HUMIDITY);
+
+ Show assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+
+ // test tags (just 1)
+ MetadataTags tags = assembledShow.getMetadataTags();
+ List<MetadataType> tagsList = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ assertEquals(tags.getMainField1(), tagsList);
+
+ textAndGraphicManager.setTextField2("Wednesday");
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is - Wednesday");
+
+ textAndGraphicManager.setTextField3("My");
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is - Wednesday - My");
+
+ textAndGraphicManager.setTextField4("Dudes");
+ textAndGraphicManager.setTextField4Type(MetadataType.CURRENT_TEMPERATURE);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is - Wednesday - My - Dudes");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList.add(MetadataType.CURRENT_TEMPERATURE);
+ assertEquals(tags.getMainField1(), tagsList);
+
+ // For some obscurity, lets try setting just fields 2 and 4 for a 1 line display
+ textAndGraphicManager.setTextField1(null);
+ textAndGraphicManager.setTextField3(null);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "Wednesday - Dudes");
+ }
+
+ public void testAssemble2Lines() {
+
+ Show inputShow = new Show();
+
+ // Force it to return display with support for only 2 lines of text
+ textAndGraphicManager.displayCapabilities = getDisplayCapability(2);
+
+ textAndGraphicManager.setTextField1("It is");
+ textAndGraphicManager.setTextField1Type(MetadataType.HUMIDITY);
+
+ Show assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+
+ // test tags
+ MetadataTags tags = assembledShow.getMetadataTags();
+ List<MetadataType> tagsList = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ assertEquals(tags.getMainField1(), tagsList);
+
+ textAndGraphicManager.setTextField2("Wednesday");
+ textAndGraphicManager.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ List<MetadataType> tagsList2 = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+
+ textAndGraphicManager.setTextField3("My");
+ textAndGraphicManager.setTextField3Type(MetadataType.MEDIA_ALBUM);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is - Wednesday");
+ assertEquals(assembledShow.getMainField2(), "My");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList2 = new ArrayList<>();
+ tagsList.add(MetadataType.CURRENT_TEMPERATURE);
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.MEDIA_ALBUM);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+
+ textAndGraphicManager.setTextField4("Dudes");
+ textAndGraphicManager.setTextField4Type(MetadataType.MEDIA_STATION);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is - Wednesday");
+ assertEquals(assembledShow.getMainField2(), "My - Dudes");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList2 = new ArrayList<>();
+ tagsList.add(MetadataType.CURRENT_TEMPERATURE);
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.MEDIA_STATION);
+ tagsList2.add(MetadataType.MEDIA_ALBUM);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+
+ // For some obscurity, lets try setting just fields 2 and 4 for a 2 line display
+ textAndGraphicManager.setTextField1(null);
+ textAndGraphicManager.setTextField3(null);
+ textAndGraphicManager.setTextField1Type(null);
+ textAndGraphicManager.setTextField3Type(null);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "Wednesday");
+ assertEquals(assembledShow.getMainField2(), "Dudes");
+
+ // And 3 fields without setting 1
+ textAndGraphicManager.setTextField3("My");
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "Wednesday");
+ assertEquals(assembledShow.getMainField2(), "My - Dudes");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList2 = new ArrayList<>();
+ tagsList.add(MetadataType.CURRENT_TEMPERATURE);
+ tagsList2.add(MetadataType.MEDIA_STATION);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+ }
+
+ public void testAssemble3Lines() {
+
+ Show inputShow = new Show();
+
+ // Force it to return display with support for only 3 lines of text
+ textAndGraphicManager.displayCapabilities = getDisplayCapability(3);
+
+ textAndGraphicManager.setTextField1("It is");
+ textAndGraphicManager.setTextField1Type(MetadataType.HUMIDITY);
+
+ Show assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "");
+ assertEquals(assembledShow.getMainField3(), "");
+
+ // test tags
+ MetadataTags tags = assembledShow.getMetadataTags();
+ List<MetadataType> tagsList = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ assertEquals(tags.getMainField1(), tagsList);
+
+ textAndGraphicManager.setTextField2("Wednesday");
+ textAndGraphicManager.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+ assertEquals(assembledShow.getMainField3(), "");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ List<MetadataType> tagsList2 = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+
+ textAndGraphicManager.setTextField3("My");
+ textAndGraphicManager.setTextField3Type(MetadataType.MEDIA_ALBUM);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+ assertEquals(assembledShow.getMainField3(), "My");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList2 = new ArrayList<>();
+ List<MetadataType> tagsList3 = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
+ tagsList3.add(MetadataType.MEDIA_ALBUM);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+ assertEquals(tags.getMainField3(), tagsList3);
+
+ textAndGraphicManager.setTextField4("Dudes");
+ textAndGraphicManager.setTextField4Type(MetadataType.MEDIA_STATION);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+ assertEquals(assembledShow.getMainField3(), "My - Dudes");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList2 = new ArrayList<>();
+ tagsList3 = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
+ tagsList3.add(MetadataType.MEDIA_ALBUM);
+ tagsList3.add(MetadataType.MEDIA_STATION);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+ assertEquals(tags.getMainField3(), tagsList3);
+
+ // Someone might not want to set the fields in order? We should handle that
+ textAndGraphicManager.setTextField1(null);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ try {
+ System.out.println(assembledShow.serializeJSON().toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+ assertEquals(assembledShow.getMainField3(), "My - Dudes");
+ }
+
+ public void testAssemble4Lines() {
+
+ Show inputShow = new Show();
+
+ // Force it to return display with support for only 4 lines of text
+ textAndGraphicManager.displayCapabilities = getDisplayCapability(4);
+
+ textAndGraphicManager.setTextField1("It is");
+ textAndGraphicManager.setTextField1Type(MetadataType.HUMIDITY);
+
+ Show assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "");
+ assertEquals(assembledShow.getMainField3(), "");
+ assertEquals(assembledShow.getMainField4(), "");
+
+ // test tags
+ MetadataTags tags = assembledShow.getMetadataTags();
+ List<MetadataType> tagsList = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ assertEquals(tags.getMainField1(), tagsList);
+
+ textAndGraphicManager.setTextField2("Wednesday");
+ textAndGraphicManager.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+ assertEquals(assembledShow.getMainField3(), "");
+ assertEquals(assembledShow.getMainField4(), "");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ List<MetadataType> tagsList2 = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+
+ textAndGraphicManager.setTextField3("My");
+ textAndGraphicManager.setTextField3Type(MetadataType.MEDIA_ALBUM);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+ assertEquals(assembledShow.getMainField3(), "My");
+ assertEquals(assembledShow.getMainField4(), "");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList2 = new ArrayList<>();
+ List<MetadataType> tagsList3 = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
+ tagsList3.add(MetadataType.MEDIA_ALBUM);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+ assertEquals(tags.getMainField3(), tagsList3);
+
+ textAndGraphicManager.setTextField4("Dudes");
+ textAndGraphicManager.setTextField4Type(MetadataType.MEDIA_STATION);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+ assertEquals(assembledShow.getMainField3(), "My");
+ assertEquals(assembledShow.getMainField4(), "Dudes");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList2 = new ArrayList<>();
+ tagsList3 = new ArrayList<>();
+ List<MetadataType> tagsList4 = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
+ tagsList3.add(MetadataType.MEDIA_ALBUM);
+ tagsList4.add(MetadataType.MEDIA_STATION);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField2(), tagsList2);
+ assertEquals(tags.getMainField3(), tagsList3);
+ assertEquals(tags.getMainField4(), tagsList4);
+
+ // try just setting line 1 and 4
+ textAndGraphicManager.setTextField2(null);
+ textAndGraphicManager.setTextField3(null);
+ textAndGraphicManager.setTextField2Type(null);
+ textAndGraphicManager.setTextField3Type(null);
+
+ assembledShow = textAndGraphicManager.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "");
+ assertEquals(assembledShow.getMainField3(), "");
+ assertEquals(assembledShow.getMainField4(), "Dudes");
+
+ // test tags
+ tags = assembledShow.getMetadataTags();
+ tagsList = new ArrayList<>();
+ tagsList4 = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ tagsList4.add(MetadataType.MEDIA_STATION);
+ assertEquals(tags.getMainField1(), tagsList);
+ assertEquals(tags.getMainField4(), tagsList4);
+ }
+
+ public void testMediaTrackTextField() {
+
+ String songTitle = "Wild For The Night";
+ textAndGraphicManager.setMediaTrackTextField(songTitle);
+ assertEquals(textAndGraphicManager.getMediaTrackTextField(), songTitle);
+ }
+
+ public void testAlignment() {
+
+ textAndGraphicManager.setTextAlignment(TextAlignment.LEFT_ALIGNED);
+ assertEquals(textAndGraphicManager.getTextAlignment(), TextAlignment.LEFT_ALIGNED);
+ }
+
+ public void testExtractTextFromShow(){
+
+ Show mainShow = new Show();
+ mainShow.setMainField1("test");
+ mainShow.setMainField3("Sauce");
+ mainShow.setMainField4("");
+
+ Show newShow = textAndGraphicManager.extractTextFromShow(mainShow);
+
+ assertEquals(newShow.getMainField1(), "test");
+ assertEquals(newShow.getMainField3(), "Sauce");
+ assertEquals(newShow.getMainField4(), "");
+ assertNull(newShow.getMainField2());
+ }
+
+ // TEST IMAGES
+
+ public void testSetPrimaryGraphic() {
+ textAndGraphicManager.setPrimaryGraphic(testArtwork);
+ assertEquals(textAndGraphicManager.getPrimaryGraphic(), testArtwork);
+ }
+
+ public void testSetSecondaryGraphic() {
+ textAndGraphicManager.setSecondaryGraphic(testArtwork);
+ assertEquals(textAndGraphicManager.getSecondaryGraphic(), testArtwork);
+ }
+
+ // TEST DISPOSE
+
+ public void testDispose() {
+ textAndGraphicManager.dispose();
+
+ assertNull(textAndGraphicManager.getTextField1());
+ assertNull(textAndGraphicManager.getTextField2());
+ assertNull(textAndGraphicManager.getTextField3());
+ assertNull(textAndGraphicManager.getTextField4());
+ assertNull(textAndGraphicManager.getMediaTrackTextField());
+ assertNull(textAndGraphicManager.getPrimaryGraphic());
+ assertNull(textAndGraphicManager.getSecondaryGraphic());
+ assertNull(textAndGraphicManager.getTextAlignment());
+ assertNull(textAndGraphicManager.getTextField1Type());
+ assertNull(textAndGraphicManager.getTextField2Type());
+ assertNull(textAndGraphicManager.getTextField3Type());
+ assertNull(textAndGraphicManager.getTextField4Type());
+ assertNotNull(textAndGraphicManager.getBlankArtwork());
+ assertNull(textAndGraphicManager.currentScreenData);
+ assertNull(textAndGraphicManager.inProgressUpdate);
+ assertNull(textAndGraphicManager.queuedImageUpdate);
+ assertFalse(textAndGraphicManager.hasQueuedUpdate);
+ assertNull(textAndGraphicManager.displayCapabilities);
+ assertFalse(textAndGraphicManager.isDirty);
+ assertEquals(textAndGraphicManager.getState(), BaseSubManager.SHUTDOWN);
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java
new file mode 100644
index 000000000..5e291c736
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java
@@ -0,0 +1,286 @@
+package com.smartdevicelink.managers.video;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.view.Display;
+import android.view.MotionEvent;
+import android.view.View;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.managers.CompletionListener;
+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.Collections;
+import java.util.HashSet;
+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.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * This is a unit test class for the SmartDeviceLink video streaming manager class :
+ * {@link VideoStreamManager}
+ */
+public class VideoStreamManagerTests extends AndroidTestCase2 {
+ public static final String TAG = "VideoStreamManagerTests";
+ 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);
+ when(internalInterface.getProtocolVersion()).thenReturn(new Version(5,1,0));
+
+ 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));
+
+ VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
+ videoStreamManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ }
+ });
+ }
+
+ public void testHMILevelNotFull(){
+ final ISdl internalInterface = mock(ISdl.class);
+
+ when(internalInterface.getProtocolVersion()).thenReturn((new Version(5,0,0)));
+ when(internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
+
+ final VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
+ videoStreamManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ VideoStreamingParameters params = new VideoStreamingParameters();
+ boolean encrypted = false;
+ videoStreamManager.startStreaming(params, encrypted);
+ verify(internalInterface, times(0)).startVideoService(params, encrypted);
+ }
+ });
+ }
+
+ public void testRemoteDisplayStream(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ final Set<Object> listenerSet = new HashSet<>();
+
+ when(internalInterface.getProtocolVersion()).thenReturn(new Version(5,0,0));
+ 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 VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
+ videoStreamManager.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);
+
+ videoStreamManager.startRemoteDisplayStream(mTestContext, TestPresentation.class, null, false);
+
+ //assertTrue(touchEventOccured);
+
+ videoStreamManager.dispose();
+ assertTrue(listenerSet.isEmpty());
+ }
+ });
+
+ }
+
+ public void testConvertTouchEvent(){
+ ISdl internalInterface = mock(ISdl.class);
+ when(internalInterface.getProtocolVersion()).thenReturn(new Version(5,1,0));
+
+ final VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
+ videoStreamManager.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 = videoStreamManager.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 = videoStreamManager.convertTouchEvent(testOnTouchEvent);
+ assertEquals(motionEvent.getAction(), MotionEvent.ACTION_POINTER_DOWN);
+
+ // Release one of the pointers (101)
+ testOnTouchEvent.setType(TouchType.END);
+ motionEvent = videoStreamManager.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 = videoStreamManager.convertTouchEvent(testOnTouchEvent);
+ assertEquals(motionEvent.getAction(), MotionEvent.ACTION_UP);
+ }
+ });
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java
new file mode 100644
index 000000000..e9e179659
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java
@@ -0,0 +1,73 @@
+package com.smartdevicelink.protocol;
+
+import com.livio.BSON.BsonEncoder;
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.protocol.enums.ControlFrameTags;
+
+import java.util.HashMap;
+
+public class SdlPacketTests extends AndroidTestCase2 {
+ //TODO: Add tests to cover other parts of SdlPacket class
+
+ // Test variables
+ private final int TEST_HASH_ID = 65537;
+ private final String TEST_PROTOCOL_VERSION = "5.0.0";
+ private final Long TEST_MTU = (long) 131072;
+
+ // Test payload from core representing hashId and mtu size
+ private byte[] corePayload = hexStringToByteArray("39000000" +
+ "10" +
+ "68617368496400" +
+ "01000100" +
+ "126d747500" +
+ "000002" + "0000000000" + "02" +
+ "70726f746f636f6c56657273" +
+ "696f6e0006000000352e302e300000");
+
+ public void testNull(){
+ byte[] testPayload = hexStringToByteArray(
+ "16000000" +
+ "02" +
+ "68656c6c6f" +"00" + // hello
+ "06000000" + "776f726c64" + "00" + //world
+ "00");
+ String tag = "hello";
+
+ SdlPacket sdlPacket = new SdlPacket();
+ assertNull(sdlPacket.getTag(tag));
+ sdlPacket.setPayload(testPayload);
+ assertEquals(sdlPacket.getTag("hello"),"world");
+ }
+
+ public void testBsonDecoding(){
+ SdlPacket sdlPacket = new SdlPacket();
+ sdlPacket.setPayload(corePayload);
+ assertEquals(sdlPacket.getTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID), TEST_HASH_ID);
+ assertEquals(sdlPacket.getTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION), TEST_PROTOCOL_VERSION);
+ assertEquals(sdlPacket.getTag(ControlFrameTags.RPC.StartServiceACK.MTU), TEST_MTU);
+ }
+
+ public void testBsonEncoding(){
+ HashMap<String, Object> testMap = new HashMap<>();
+ testMap.put(ControlFrameTags.RPC.StartServiceACK.HASH_ID, TEST_HASH_ID);
+ testMap.put(ControlFrameTags.RPC.StartServiceACK.MTU, TEST_MTU);
+ testMap.put(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION, TEST_PROTOCOL_VERSION);
+
+ byte[] observed = BsonEncoder.encodeToBytes(testMap);
+ assertEquals(observed.length, corePayload.length);
+ for(int i = 0; i < observed.length; i++){
+ assertEquals(observed[i], corePayload[i]);
+ }
+ }
+
+ // Helper method for converting String to Byte Array
+ private static byte[] hexStringToByteArray(String s) {
+ int len = s.length();
+ byte[] data = new byte[len / 2];
+ for (int i = 0; i < len; i += 2) {
+ data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ + Character.digit(s.charAt(i+1), 16));
+ }
+ return data;
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java
new file mode 100644
index 000000000..4c53e9b58
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java
@@ -0,0 +1,373 @@
+package com.smartdevicelink.protocol;
+
+import android.util.Log;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.SdlConnection.SdlConnection;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.test.SampleRpc;
+import com.smartdevicelink.test.SdlUnitTestContants;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.RouterServiceValidator;
+
+import junit.framework.Assert;
+
+import java.io.ByteArrayOutputStream;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import static org.mockito.Mockito.mock;
+
+public class SdlProtocolTests extends AndroidTestCase2 {
+
+ int max_int = 2147483647;
+ byte[] payload;
+ MultiplexTransportConfig config;
+ SdlProtocol protocol;
+
+ ISdlProtocol defaultListener = mock(ISdlProtocol.class);
+
+ public static class DidReceiveListener implements ISdlProtocol{
+ boolean didReceive = false;
+
+ public void reset(){
+ didReceive = false;
+ }
+ public boolean didReceive(){
+ return didReceive;
+ }
+ @Override
+ public void onProtocolMessageBytesToSend(SdlPacket packet) {}
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+ didReceive = true;
+ Log.d("DidReceiveListener", "RPC Type: " + msg.getRPCType());
+ Log.d("DidReceiveListener", "Function Id: " + msg.getFunctionID());
+ Log.d("DidReceiveListener", "JSON Size: " + msg.getJsonSize());
+ }
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,byte sessionID, byte version, String correlationID, int hashID,boolean isEncrypted){}
+ @Override
+ public void onProtocolSessionNACKed(SessionType sessionType,byte sessionID, byte version, String correlationID, List<String> rejectedParams) {}
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType,byte sessionID, String correlationID) {}
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,byte sessionID, String correlationID) {}
+ @Override
+ public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {}
+ @Override
+ public void onProtocolHeartbeatACK(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onProtocolServiceDataACK(SessionType sessionType,int dataSize, byte sessionID) {}
+ @Override
+ public void onResetOutgoingHeartbeat(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onResetIncomingHeartbeat(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onProtocolError(String info, Exception e) {}
+ @Override
+ public byte getSessionId() {return 0;}
+ @Override
+ public void shutdown(String info) {}
+ @Override
+ public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) {}
+ @Override
+ public SdlSecurityBase getSdlSecurity() {return null;}
+ @Override
+ public VideoStreamingParameters getDesiredVideoParams() {return null; }
+ @Override
+ public void setAcceptedVideoParams(VideoStreamingParameters acceptedVideoParams) {}
+ @Override
+ public void stopStream(SessionType serviceType) {}
+ @Override
+ public void onAuthTokenReceived(String token){}
+ };
+
+ DidReceiveListener onProtocolMessageReceivedListener = new DidReceiveListener();
+
+
+ public void setUp(){
+ config = new MultiplexTransportConfig(this.mContext, SdlUnitTestContants.TEST_APP_ID);
+ protocol = new SdlProtocol(defaultListener,config);
+ }
+
+
+ public void testBase(){
+ SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
+
+ }
+
+ public void testVersion(){
+ SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
+
+ sdlProtocol.setVersion((byte)0x01);
+ assertEquals((byte)0x01,sdlProtocol.getProtocolVersion().getMajor());
+
+ sdlProtocol = new SdlProtocol(defaultListener,config);
+ sdlProtocol.setVersion((byte)0x02);
+ assertEquals((byte)0x02,sdlProtocol.getProtocolVersion().getMajor());
+
+ sdlProtocol = new SdlProtocol(defaultListener,config);
+ sdlProtocol.setVersion((byte)0x03);
+ assertEquals((byte)0x03,sdlProtocol.getProtocolVersion().getMajor());
+
+ sdlProtocol = new SdlProtocol(defaultListener,config);
+ sdlProtocol.setVersion((byte)0x04);
+ assertEquals((byte)0x04,sdlProtocol.getProtocolVersion().getMajor());
+
+ sdlProtocol = new SdlProtocol(defaultListener,config);
+ sdlProtocol.setVersion((byte)0x05);
+ assertEquals((byte)0x05,sdlProtocol.getProtocolVersion().getMajor());
+
+ //If we get newer than 5, it should fall back to 5
+ sdlProtocol = new SdlProtocol(defaultListener,config);
+ sdlProtocol.setVersion((byte)0x06);
+ assertEquals((byte)0x05,sdlProtocol.getProtocolVersion().getMajor());
+
+ //Is this right?
+ sdlProtocol = new SdlProtocol(defaultListener,config);
+ sdlProtocol.setVersion((byte)0x00);
+ assertEquals((byte)0x01,sdlProtocol.getProtocolVersion().getMajor());
+ }
+
+ public void testMtu(){
+ SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
+
+ sdlProtocol.setVersion((byte)0x01);
+
+ try{
+ assertEquals(sdlProtocol.getMtu(), 1500-8);
+
+ //Version 2
+ sdlProtocol.setVersion((byte)0x02);
+ assertEquals(sdlProtocol.getMtu(), 1500-12);
+
+ //Version 3
+ sdlProtocol.setVersion((byte)0x03);
+ assertEquals(sdlProtocol.getMtu(), 131072);
+
+ //Version 4
+ sdlProtocol.setVersion((byte)0x04);
+ assertEquals(sdlProtocol.getMtu(), 131072);
+
+ //Version 5
+ sdlProtocol.setVersion((byte)0x05);
+ assertEquals(sdlProtocol.getMtu(), 131072);
+
+ //Version 5+
+ sdlProtocol.setVersion((byte)0x06);
+ assertEquals(sdlProtocol.getMtu(), 131072);
+
+ }catch(Exception e){
+ Assert.fail("Exceptin during reflection");
+ }
+
+ }
+
+ public void testHandleFrame(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+ SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
+ SdlProtocolBase.MessageFrameAssembler assembler = sdlProtocol.new MessageFrameAssembler();
+ try{
+ assembler.handleFrame(sampleRpc.toSdlPacket());
+ }catch(Exception e){
+ Assert.fail("Exceptin during handleFrame - " + e.toString());
+ }
+ }
+ public void testHandleFrameCorrupt(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+ BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
+ header.setJsonSize(Integer.MAX_VALUE);
+ sampleRpc.setBinaryFrameHeader(header);
+ SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
+ SdlProtocolBase.MessageFrameAssembler assembler = sdlProtocol.new MessageFrameAssembler();
+ try{
+ assembler.handleFrame(sampleRpc.toSdlPacket());
+ }catch(Exception e){
+ Assert.fail("Exceptin during handleFrame - " + e.toString());
+ }
+ }
+
+ public void testHandleSingleFrameMessageFrame(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+ SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
+ SdlProtocolBase.MessageFrameAssembler assembler = sdlProtocol.new MessageFrameAssembler();
+
+
+ try{
+ Method method = assembler.getClass().getDeclaredMethod ("handleSingleFrameMessageFrame", SdlPacket.class);
+ method.setAccessible(true);
+ method.invoke (assembler, sampleRpc.toSdlPacket());
+ }catch(Exception e){
+ Assert.fail("Exceptin during handleSingleFrameMessageFrame - " + e.toString());
+ }
+ }
+
+ public void testHandleSingleFrameMessageFrameCorruptBfh(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+
+ //Create a corrupted header
+ BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
+ header.setJsonSize(5);
+ header.setJsonData(new byte[5]);
+ header.setJsonSize(Integer.MAX_VALUE);
+ sampleRpc.setBinaryFrameHeader(header);
+
+ SdlPacket packet = sampleRpc.toSdlPacket();
+
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.parseBinaryHeader(packet.payload);
+ assertNull(binFrameHeader);
+
+ SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
+
+
+ sdlProtocol.handlePacketReceived(packet);
+ assertFalse(onProtocolMessageReceivedListener.didReceive());
+
+ onProtocolMessageReceivedListener.reset();
+ SdlProtocol.MessageFrameAssembler assembler =sdlProtocol.getFrameAssemblerForFrame(packet);// sdlProtocol.new MessageFrameAssembler();
+ assertNotNull(assembler);
+ assembler.handleFrame(packet);
+ assertFalse(onProtocolMessageReceivedListener.didReceive());
+
+ try{
+ Method method = assembler.getClass().getDeclaredMethod("handleSingleFrameMessageFrame", SdlPacket.class);
+ method.setAccessible(true);
+ method.invoke (assembler, sampleRpc.toSdlPacket());
+ }catch(Exception e){
+ Assert.fail("Exceptin during handleSingleFrameMessageFrame - " + e.toString());
+ }
+ }
+
+
+
+
+
+ public void testNormalCase(){
+ setUp();
+ payload = new byte[]{0x00,0x02,0x05,0x01,0x01,0x01,0x05,0x00};
+ byte sessionID = 1, version = 1;
+ int messageID = 1;
+ boolean encrypted = false;
+ SdlPacket sdlPacket = SdlPacketFactory.createMultiSendDataFirst(SessionType.RPC, sessionID, messageID, version, payload, encrypted);
+ SdlProtocolBase.MessageFrameAssembler assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
+
+ assertNotNull(assembler);
+
+ OutOfMemoryError oom_error = null;
+ NullPointerException np_exception = null;
+ try{
+ assembler.handleMultiFrameMessageFrame(sdlPacket);
+ }catch(OutOfMemoryError e){
+ oom_error = e;
+ }catch(NullPointerException z){
+ np_exception = z;
+ }catch(Exception e){
+ e.printStackTrace();
+ assertNotNull(null);
+ }
+
+ assertNull(np_exception);
+ assertNull(oom_error);
+
+ payload = new byte[23534];
+ sdlPacket = SdlPacketFactory.createMultiSendDataRest(SessionType.RPC, sessionID, payload.length, (byte) 3, messageID, version, payload, 0, 1500, encrypted);
+ assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
+ try{
+ assembler.handleMultiFrameMessageFrame(sdlPacket);
+ }catch(OutOfMemoryError e){
+ oom_error = e;
+ }catch(NullPointerException z){
+ np_exception = z;
+ }catch(Exception e){
+ assertNotNull(null);
+ }
+
+ assertNull(np_exception);
+ assertNull(oom_error);
+ }
+
+ public void testOverallocatingAccumulator(){
+ setUp();
+ ByteArrayOutputStream builder = new ByteArrayOutputStream();
+ for(int i = 0; i < 8; i++){
+ builder.write(0x0F);
+ }
+ payload = builder.toByteArray();
+ byte sessionID = 1, version = 1;
+ int messageID = 1;
+ boolean encrypted = false;
+ SdlPacket sdlPacket = SdlPacketFactory.createMultiSendDataFirst(SessionType.RPC, sessionID, messageID, version, payload, encrypted);
+ SdlProtocolBase.MessageFrameAssembler assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
+
+ OutOfMemoryError oom_error = null;
+ NullPointerException np_exception = null;
+ try{
+ assembler.handleMultiFrameMessageFrame(sdlPacket);
+ }catch(OutOfMemoryError e){
+ oom_error = e;
+ }catch(NullPointerException z){
+ np_exception = z;
+ }catch(Exception e){
+ assertNotNull(null);
+ }
+
+ assertNull(np_exception);
+ assertNull(oom_error);
+
+ payload = new byte[23534];
+ sdlPacket = SdlPacketFactory.createMultiSendDataRest(SessionType.RPC, sessionID, payload.length, (byte) 3, messageID, version, payload, 0, 1500, encrypted);
+ assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
+
+ try{
+ assembler.handleMultiFrameMessageFrame(sdlPacket);
+ }catch(OutOfMemoryError e){
+ oom_error = e;
+ }catch(NullPointerException z){
+ np_exception = z;
+ }catch(Exception e){
+ assertNotNull(null);
+ }
+
+ assertNull(np_exception);
+ assertNull(oom_error);
+
+ }
+
+ protected class SdlConnectionTestClass extends SdlConnection {
+ protected boolean connected = false;
+ public SdlConnectionTestClass(BaseTransportConfig transportConfig) {
+ super(transportConfig);
+ }
+
+ protected SdlConnectionTestClass(BaseTransportConfig transportConfig,RouterServiceValidator rsvp){
+ super(transportConfig,rsvp);
+ }
+
+ @Override
+ public void onTransportConnected() {
+ super.onTransportConnected();
+ connected = true;
+ }
+
+ @Override
+ public void onTransportDisconnected(String info) {
+ connected = false;
+ //Grab a currently running router service
+ RouterServiceValidator rsvp2 = new RouterServiceValidator(mContext);
+ rsvp2.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE);
+ assertTrue(rsvp2.validate());
+ assertNotNull(rsvp2.getService());
+ super.onTransportDisconnected(info);
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+ connected = false;
+ super.onTransportError(info, e);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/WiProProtocolTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/WiProProtocolTests.java
new file mode 100644
index 000000000..a5556479f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/WiProProtocolTests.java
@@ -0,0 +1,381 @@
+package com.smartdevicelink.protocol;
+
+import android.util.Log;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.SdlConnection.SdlConnection;
+import com.smartdevicelink.protocol.WiProProtocol.MessageFrameAssembler;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.test.SampleRpc;
+import com.smartdevicelink.test.SdlUnitTestContants;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.RouterServiceValidator;
+
+import junit.framework.Assert;
+
+import java.io.ByteArrayOutputStream;
+import java.lang.reflect.Method;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.protocol.BinaryFrameHeader}
+ */
+public class WiProProtocolTests extends AndroidTestCase2 {
+
+ int max_int = 2147483647;
+ byte[] payload;
+ MultiplexTransportConfig config;
+ SdlConnectionTestClass connection;
+ WiProProtocol protocol;
+
+ IProtocolListener defaultListener = new IProtocolListener(){
+ @Override
+ public void onProtocolMessageBytesToSend(SdlPacket packet) {}
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {}
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,byte sessionID, byte version, String correlationID, int hashID,boolean isEncrypted){}
+ @Override
+ public void onProtocolSessionNACKed(SessionType sessionType,byte sessionID, byte version, String correlationID, List<String> rejectedParams) {}
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType,byte sessionID, String correlationID) {}
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,byte sessionID, String correlationID) {}
+ @Override
+ public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {}
+ @Override
+ public void onProtocolHeartbeatACK(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onProtocolServiceDataACK(SessionType sessionType,int dataSize, byte sessionID) {}
+ @Override
+ public void onResetOutgoingHeartbeat(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onResetIncomingHeartbeat(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onProtocolError(String info, Exception e) {}
+
+ };
+ public static class DidReceiveListener implements IProtocolListener{
+ boolean didReceive = false;
+
+ public void reset(){
+ didReceive = false;
+ }
+ public boolean didReceive(){
+ return didReceive;
+ }
+ @Override
+ public void onProtocolMessageBytesToSend(SdlPacket packet) {}
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+ didReceive = true;
+ Log.d("DidReceiveListener", "RPC Type: " + msg.getRPCType());
+ Log.d("DidReceiveListener", "Function Id: " + msg.getFunctionID());
+ Log.d("DidReceiveListener", "JSON Size: " + msg.getJsonSize());
+ }
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,byte sessionID, byte version, String correlationID, int hashID,boolean isEncrypted){}
+ @Override
+ public void onProtocolSessionNACKed(SessionType sessionType,byte sessionID, byte version, String correlationID, List<String> rejectedParams) {}
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType,byte sessionID, String correlationID) {}
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,byte sessionID, String correlationID) {}
+ @Override
+ public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {}
+ @Override
+ public void onProtocolHeartbeatACK(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onProtocolServiceDataACK(SessionType sessionType,int dataSize, byte sessionID) {}
+ @Override
+ public void onResetOutgoingHeartbeat(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onResetIncomingHeartbeat(SessionType sessionType,byte sessionID) {}
+ @Override
+ public void onProtocolError(String info, Exception e) {}
+ };
+ DidReceiveListener onProtocolMessageReceivedListener = new DidReceiveListener();
+
+ public void testBase(){
+ WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
+
+ }
+
+ public void testVersion(){
+ WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
+
+ wiProProtocol.setVersion((byte)0x01);
+ assertEquals((byte)0x01,wiProProtocol.getVersion());
+
+ wiProProtocol = new WiProProtocol(defaultListener);
+ wiProProtocol.setVersion((byte)0x02);
+ assertEquals((byte)0x02,wiProProtocol.getVersion());
+
+ wiProProtocol = new WiProProtocol(defaultListener);
+ wiProProtocol.setVersion((byte)0x03);
+ assertEquals((byte)0x03,wiProProtocol.getVersion());
+
+ wiProProtocol = new WiProProtocol(defaultListener);
+ wiProProtocol.setVersion((byte)0x04);
+ assertEquals((byte)0x04,wiProProtocol.getVersion());
+
+ wiProProtocol = new WiProProtocol(defaultListener);
+ wiProProtocol.setVersion((byte)0x05);
+ assertEquals((byte)0x05,wiProProtocol.getVersion());
+
+ //If we get newer than 5, it should fall back to 5
+ wiProProtocol = new WiProProtocol(defaultListener);
+ wiProProtocol.setVersion((byte)0x06);
+ assertEquals((byte)0x05,wiProProtocol.getVersion());
+
+ //Is this right?
+ wiProProtocol = new WiProProtocol(defaultListener);
+ wiProProtocol.setVersion((byte)0x00);
+ assertEquals((byte)0x01,wiProProtocol.getVersion());
+ }
+
+ public void testMtu(){
+ WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
+
+ wiProProtocol.setVersion((byte)0x01);
+
+ try{
+ assertEquals(wiProProtocol.getMtu(), 1500-8);
+
+ //Version 2
+ wiProProtocol.setVersion((byte)0x02);
+ assertEquals(wiProProtocol.getMtu(), 1500-12);
+
+ //Version 3
+ wiProProtocol.setVersion((byte)0x03);
+ assertEquals(wiProProtocol.getMtu(), 131072);
+
+ //Version 4
+ wiProProtocol.setVersion((byte)0x04);
+ assertEquals(wiProProtocol.getMtu(), 131072);
+
+ //Version 5
+ wiProProtocol.setVersion((byte)0x05);
+ assertEquals(wiProProtocol.getMtu(), 131072);
+
+ //Version 5+
+ wiProProtocol.setVersion((byte)0x06);
+ assertEquals(wiProProtocol.getMtu(), 131072);
+
+ }catch(Exception e){
+ Assert.fail("Exceptin during reflection");
+ }
+
+ }
+
+ public void testHandleFrame(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+ WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
+ MessageFrameAssembler assembler = wiProProtocol.new MessageFrameAssembler();
+ try{
+ assembler.handleFrame(sampleRpc.toSdlPacket());
+ }catch(Exception e){
+ Assert.fail("Exceptin during handleFrame - " + e.toString());
+ }
+ }
+ public void testHandleFrameCorrupt(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+ BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
+ header.setJsonSize(Integer.MAX_VALUE);
+ sampleRpc.setBinaryFrameHeader(header);
+ WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
+ MessageFrameAssembler assembler = wiProProtocol.new MessageFrameAssembler();
+ try{
+ assembler.handleFrame(sampleRpc.toSdlPacket());
+ }catch(Exception e){
+ Assert.fail("Exceptin during handleFrame - " + e.toString());
+ }
+ }
+
+ public void testHandleSingleFrameMessageFrame(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+ WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
+ MessageFrameAssembler assembler = wiProProtocol.new MessageFrameAssembler();
+
+
+ try{
+ Method method = assembler.getClass().getDeclaredMethod ("handleSingleFrameMessageFrame", SdlPacket.class);
+ method.setAccessible(true);
+ method.invoke (assembler, sampleRpc.toSdlPacket());
+ }catch(Exception e){
+ Assert.fail("Exceptin during handleSingleFrameMessageFrame - " + e.toString());
+ }
+ }
+
+ public void testHandleSingleFrameMessageFrameCorruptBfh(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+
+ //Create a corrupted header
+ BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
+ header.setJsonSize(5);
+ header.setJsonData(new byte[5]);
+ header.setJsonSize(Integer.MAX_VALUE);
+ sampleRpc.setBinaryFrameHeader(header);
+
+ SdlPacket packet = sampleRpc.toSdlPacket();
+
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.parseBinaryHeader(packet.payload);
+ assertNull(binFrameHeader);
+
+ WiProProtocol wiProProtocol = new WiProProtocol(onProtocolMessageReceivedListener);
+
+
+ wiProProtocol.handlePacketReceived(packet);
+ assertFalse(onProtocolMessageReceivedListener.didReceive());
+
+ onProtocolMessageReceivedListener.reset();
+ MessageFrameAssembler assembler =wiProProtocol.getFrameAssemblerForFrame(packet);// wiProProtocol.new MessageFrameAssembler();
+ assertNotNull(assembler);
+ assembler.handleFrame(packet);
+ assertFalse(onProtocolMessageReceivedListener.didReceive());
+
+ try{
+ Method method = assembler.getClass().getDeclaredMethod("handleSingleFrameMessageFrame", SdlPacket.class);
+ method.setAccessible(true);
+ method.invoke (assembler, sampleRpc.toSdlPacket());
+ }catch(Exception e){
+ Assert.fail("Exceptin during handleSingleFrameMessageFrame - " + e.toString());
+ }
+ }
+
+
+
+ public void setUp(){
+ config = new MultiplexTransportConfig(this.mContext,SdlUnitTestContants.TEST_APP_ID);
+ connection = new SdlConnectionTestClass(config, null);
+ protocol = new WiProProtocol(connection);
+ }
+
+ public void testNormalCase(){
+ setUp();
+ payload = new byte[]{0x00,0x02,0x05,0x01,0x01,0x01,0x05,0x00};
+ byte sessionID = 1, version = 1;
+ int messageID = 1;
+ boolean encrypted = false;
+ SdlPacket sdlPacket = SdlPacketFactory.createMultiSendDataFirst(SessionType.RPC, sessionID, messageID, version, payload, encrypted);
+ MessageFrameAssembler assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
+
+ assertNotNull(assembler);
+
+ OutOfMemoryError oom_error = null;
+ NullPointerException np_exception = null;
+ try{
+ assembler.handleMultiFrameMessageFrame(sdlPacket);
+ }catch(OutOfMemoryError e){
+ oom_error = e;
+ }catch(NullPointerException z){
+ np_exception = z;
+ }catch(Exception e){
+ e.printStackTrace();
+ assertNotNull(null);
+ }
+
+ assertNull(np_exception);
+ assertNull(oom_error);
+
+ payload = new byte[23534];
+ sdlPacket = SdlPacketFactory.createMultiSendDataRest(SessionType.RPC, sessionID, payload.length, (byte) 3, messageID, version, payload, 0, 1500, encrypted);
+ assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
+ try{
+ assembler.handleMultiFrameMessageFrame(sdlPacket);
+ }catch(OutOfMemoryError e){
+ oom_error = e;
+ }catch(NullPointerException z){
+ np_exception = z;
+ }catch(Exception e){
+ assertNotNull(null);
+ }
+
+ assertNull(np_exception);
+ assertNull(oom_error);
+ }
+
+ public void testOverallocatingAccumulator(){
+ setUp();
+ ByteArrayOutputStream builder = new ByteArrayOutputStream();
+ for(int i = 0; i < 8; i++){
+ builder.write(0x0F);
+ }
+ payload = builder.toByteArray();
+ byte sessionID = 1, version = 1;
+ int messageID = 1;
+ boolean encrypted = false;
+ SdlPacket sdlPacket = SdlPacketFactory.createMultiSendDataFirst(SessionType.RPC, sessionID, messageID, version, payload, encrypted);
+ MessageFrameAssembler assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
+
+ OutOfMemoryError oom_error = null;
+ NullPointerException np_exception = null;
+ try{
+ assembler.handleMultiFrameMessageFrame(sdlPacket);
+ }catch(OutOfMemoryError e){
+ oom_error = e;
+ }catch(NullPointerException z){
+ np_exception = z;
+ }catch(Exception e){
+ assertNotNull(null);
+ }
+
+ assertNull(np_exception);
+ assertNull(oom_error);
+
+ payload = new byte[23534];
+ sdlPacket = SdlPacketFactory.createMultiSendDataRest(SessionType.RPC, sessionID, payload.length, (byte) 3, messageID, version, payload, 0, 1500, encrypted);
+ assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
+
+ try{
+ assembler.handleMultiFrameMessageFrame(sdlPacket);
+ }catch(OutOfMemoryError e){
+ oom_error = e;
+ }catch(NullPointerException z){
+ np_exception = z;
+ }catch(Exception e){
+ assertNotNull(null);
+ }
+
+ assertNull(np_exception);
+ assertNull(oom_error);
+
+ }
+
+ protected class SdlConnectionTestClass extends SdlConnection{
+ protected boolean connected = false;
+ public SdlConnectionTestClass(BaseTransportConfig transportConfig) {
+ super(transportConfig);
+ }
+
+ protected SdlConnectionTestClass(BaseTransportConfig transportConfig,RouterServiceValidator rsvp){
+ super(transportConfig,rsvp);
+ }
+
+ @Override
+ public void onTransportConnected() {
+ super.onTransportConnected();
+ connected = true;
+ }
+
+ @Override
+ public void onTransportDisconnected(String info) {
+ connected = false;
+ //Grab a currently running router service
+ RouterServiceValidator rsvp2 = new RouterServiceValidator(mContext);
+ rsvp2.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE);
+ assertTrue(rsvp2.validate());
+ assertNotNull(rsvp2.getService());
+ SdlConnectionTestClass.cachedMultiConfig.setService(rsvp2.getService());
+ super.onTransportDisconnected(info);
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+ connected = false;
+ super.onTransportError(info, e);
+ }
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java
new file mode 100644
index 000000000..023a6f8e9
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java
@@ -0,0 +1,194 @@
+package com.smartdevicelink.test;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.RPCResponse;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+
+public abstract class BaseRpcTests extends AndroidTestCase2 {
+
+ public static final int SDL_VERSION_UNDER_TEST = Config.SDL_VERSION_UNDER_TEST;
+
+ private static final int CORR_ID = 402;
+
+ protected RPCMessage msg;
+
+ /**
+ * Sets up the specific RPC message under testing.
+ */
+ protected abstract RPCMessage createMessage();
+
+ /**
+ * Retrieves the RPC message type under testing.
+ */
+ protected abstract String getMessageType();
+
+ /**
+ * Retrieves the RPC command type under testing.
+ */
+ protected abstract String getCommandType();
+
+ /**
+ * Retrieves the JSON translated RPC message under testing.
+ */
+ protected abstract JSONObject getExpectedParameters(int sdlVersion);
+
+ @Override
+ public void setUp(){
+ this.msg = createMessage();
+ if (msg instanceof RPCRequest) {
+ ((RPCRequest) msg).setCorrelationID(CORR_ID);
+ }
+ else if (msg instanceof RPCResponse) {
+ ((RPCResponse) msg).setCorrelationID(CORR_ID);
+ }
+
+ }
+
+ public void testCreation(){
+ assertNotNull("Object creation failed.", msg);
+ }
+
+ public void testCorrelationId(){
+ int correlationId;
+ if (msg instanceof RPCRequest) {
+ correlationId = ((RPCRequest) msg).getCorrelationID();
+ assertEquals("Correlation ID doesn't match expected ID.", CORR_ID, correlationId);
+ }
+ else if (msg instanceof RPCResponse) {
+ correlationId = ((RPCResponse) msg).getCorrelationID();
+ assertEquals("Correlation ID doesn't match expected ID.", CORR_ID, correlationId);
+ }
+
+ }
+
+ public void testMessageType(){
+ String messageType = msg.getMessageType();
+
+ assertNotNull("Message type was null.", messageType);
+ assertEquals("Message type was not REQUEST.", getMessageType(), messageType);
+ }
+
+ public void testCommandType(){
+ String command = msg.getFunctionName();
+
+ assertNotNull("Command was null.", command);
+ assertEquals("Command type was not ADD_COMMAND", getCommandType(), command);
+ }
+
+
+ public void testFunctionName(){
+ String funcName = msg.getFunctionName();
+
+ assertNotNull("Function name was null.", funcName);
+ assertEquals("Function name did not match expected name.", getCommandType(), funcName);
+ }
+
+ public void testJson(){
+ try{
+ JSONObject reference = buildJsonStore();
+ JSONObject underTest = msg.serializeJSON();
+
+ assertEquals("Size of JSON under test didn't match expected size.", reference.length(), underTest.length());
+
+ // loop through all values and verifies they match the RPCMessage parameters
+ Iterator<?> iterator = reference.keys();
+ while(iterator.hasNext()){
+ String key = (String) iterator.next();
+ Object referenceValue = JsonUtils.readObjectFromJsonObject(reference, key);
+ testJsonParameters((JSONObject) referenceValue, (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ }catch(JSONException e){
+ // do nothing
+ }
+ }
+
+ private JSONObject buildJsonStore() throws JSONException{
+ JSONObject result = new JSONObject(), command = new JSONObject();
+
+ if (!getMessageType().equals(RPCMessage.KEY_NOTIFICATION)) {
+ command.put(RPCMessage.KEY_CORRELATION_ID, CORR_ID);
+ }
+ command.put(RPCMessage.KEY_FUNCTION_NAME, msg.getFunctionName());
+ command.put(RPCMessage.KEY_PARAMETERS, getExpectedParameters(SDL_VERSION_UNDER_TEST));
+
+ result.put(getMessageType(), command);
+
+ return result;
+ }
+
+ private void testJsonParameters(JSONObject reference, JSONObject underTest) throws JSONException{
+ assertEquals("Size of JSON under test didn't match expected size.", reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while(iterator.hasNext()){
+ String key = (String) iterator.next();
+ Object referenceValue = JsonUtils.readObjectFromJsonObject(reference, key);
+ if(referenceValue instanceof JSONObject){
+ testJsonParameters((JSONObject) referenceValue, (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ else if(referenceValue instanceof JSONArray){
+ JSONArray array1 = (JSONArray) referenceValue, array2 = (JSONArray) JsonUtils.readObjectFromJsonObject(underTest, key);
+ testJsonArray(array1, array2, key);
+ }
+ else{
+ assertTrue("JSON object didn't match reference object for key \"" + key + "\".", referenceValue.equals(JsonUtils.readObjectFromJsonObject(underTest, key)));
+ }
+ }
+ }
+
+ private void testJsonArray(JSONArray reference, JSONArray underTest, String key) throws JSONException{
+ assertEquals("Size of JSON array didn't match expected size.", reference.length(), underTest.length());
+ int len = reference.length();
+ for(int i=0; i<len; i++){
+ Object array1Obj = reference.get(i), array2Obj = underTest.get(i);
+ if(array1Obj instanceof JSONObject){
+ testJsonParameters((JSONObject) array1Obj, (JSONObject) array2Obj);
+ }
+ else if(array1Obj instanceof JSONArray){
+ testJsonArray((JSONArray) array1Obj, (JSONArray) array2Obj, key);
+ }
+ else{
+ assertTrue("JSONArray object didn't match reference object for key \"" + key + "\".", array1Obj.equals(array2Obj));
+ }
+ }
+ }
+
+ // this method must be manually called from the subclass
+ protected void testNullBase(RPCMessage msg){
+ assertNotNull("RPCMessage was null.", msg);
+
+ Integer correlationId;
+ if (msg instanceof RPCRequest) {
+ correlationId = ((RPCRequest) msg).getCorrelationID();
+ assertNotNull("Correlation ID of the RPC message was null.", correlationId);
+ //assertEquals("Correlation ID didn't match expected correlation ID.", CORR_ID, (int) correlationId);
+ }
+ else if (msg instanceof RPCResponse) {
+ correlationId = ((RPCResponse) msg).getCorrelationID();
+ assertNull("Correlation ID of the RPC message was not null.", correlationId);
+ //assertEquals("Correlation ID didn't match expected correlation ID.", CORR_ID, (int) correlationId);
+ }
+
+ assertNotNull("Message type of the RPC message was null.", msg.getMessageType());
+
+ assertEquals("Message type didn't match expected message type.", getMessageType(), msg.getMessageType());
+
+ assertNotNull("Command type of the RPC message was null.", msg.getMessageType());
+ assertEquals("Command type didn't match expected command type.", getCommandType(), msg.getFunctionName());
+
+
+ try{
+ assertTrue("Parameters weren't initialized, but the JSON contained 2 or more objects.", (msg.serializeJSON().length() == 1));
+ } catch(JSONException e) {
+ //do nothing
+ }
+
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Config.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Config.java
index 7f424bda9..7f424bda9 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Config.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Config.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/JsonUtils.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/JsonUtils.java
new file mode 100644
index 000000000..375de9362
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/JsonUtils.java
@@ -0,0 +1,251 @@
+package com.smartdevicelink.test;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.AppServiceCapability;
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public final class JsonUtils {
+
+ private JsonUtils(){}
+
+ public static JSONObject createJsonObject(byte[] data){
+ JSONObject result = null;
+ try {
+ String jsonStr = new String(data);
+ result = new JSONObject(jsonStr);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ return result;
+ }
+
+ public static JSONArray createJsonArrayOfJsonObjects(List<? extends RPCStruct> parameterList, int sdlVersion) throws JSONException{
+ JSONArray result = new JSONArray();
+
+ for(RPCStruct parameter : parameterList){
+ //result.put(parameter.getJsonParameters(sdlVersion));
+ result.put(parameter.serializeJSON());
+ }
+
+ return result;
+ }
+
+ public static JSONArray createJsonArrayOfJsonNames(List<? extends Enum<?>> parameterList, int sdlVersion) throws JSONException{
+ JSONArray result = new JSONArray();
+
+ for(Enum<?> name : parameterList){
+ result.put(name);
+ }
+
+ return result;
+ }
+
+ public static <T> JSONArray createJsonArray(List<T> list) throws JSONException{
+ JSONArray result = new JSONArray();
+
+ for(T str : list){
+ result.put(str);
+ }
+
+ return result;
+ }
+
+ // this method is basically to get around the annoying JSONException that is thrown when a key doesn't exist
+ // in the JSON object. this method returns null instead of throwing an exception.
+ public static Object readObjectFromJsonObject(JSONObject json, String key){
+ try {
+ return json.get(key);
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ public static Boolean readBooleanFromJsonObject(JSONObject json, String key){
+ try {
+ return json.getBoolean(key);
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ public static Double readDoubleFromJsonObject(JSONObject json, String key){
+ try {
+ return json.getDouble(key);
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ public static Integer readIntegerFromJsonObject(JSONObject json, String key){
+ try {
+ return json.getInt(key);
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ public static JSONArray readJsonArrayFromJsonObject(JSONObject json, String key){
+ try {
+ return json.getJSONArray(key);
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ public static List<String> readStringListFromJsonObject(JSONObject json, String key){
+ JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
+
+ if(jsonArray != null){
+ int len = jsonArray.length();
+ List<String> result = new ArrayList<String>(len);
+ for(int i=0; i<len; i++){
+ try {
+ String str = jsonArray.getString(i);
+ result.add(str);
+ } catch (JSONException e) {}
+ }
+ return result;
+ }
+
+ return null;
+ }
+
+ public static List<AppServiceType> readAppServiceTypeListFromJsonObject(JSONObject json, String key){
+ JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
+
+ if(jsonArray != null){
+ int len = jsonArray.length();
+ List<AppServiceType> result = new ArrayList<>(len);
+ for(int i=0; i<len; i++){
+ try {
+ AppServiceType serviceType = (AppServiceType) jsonArray.get(i);
+ result.add(serviceType);
+ } catch (JSONException e) {}
+ }
+ return result;
+ }
+
+ return null;
+ }
+
+ public static List<AppServiceCapability> readAppServiceCapabilityListFromJsonObject(JSONObject json, String key){
+ JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
+ if(jsonArray != null){
+ int len = jsonArray.length();
+ List<AppServiceCapability> result = new ArrayList<>(len);
+ for(int i=0; i<len; i++){
+ try {
+ AppServiceCapability serviceCapability = (AppServiceCapability) jsonArray.getJSONArray(0).get(i);
+ result.add(serviceCapability);
+ } catch (JSONException e) {}
+ }
+ return result;
+ }
+
+ return null;
+ }
+
+ public static List<Integer> readIntegerListFromJsonObject(JSONObject json, String key){
+ JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
+
+ if(jsonArray != null){
+ int len = jsonArray.length();
+ List<Integer> result = new ArrayList<Integer>(len);
+ for(int i=0; i<len; i++){
+ try {
+ Integer str = jsonArray.getInt(i);
+ result.add(str);
+ } catch (JSONException e) {}
+ }
+ return result;
+ }
+
+ return null;
+ }
+
+ public static List<Double> readDoubleListFromJsonObject(JSONObject json, String key){
+ JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
+
+ if(jsonArray != null){
+ int len = jsonArray.length();
+ List<Double> result = new ArrayList<Double>(len);
+ for(int i=0; i<len; i++){
+ try {
+ Double str = jsonArray.getDouble(i);
+ result.add(str);
+ } catch (JSONException e) {}
+ }
+ return result;
+ }
+
+ return null;
+ }
+
+ public static List<Long> readLongListFromJsonObject(JSONObject json, String key){
+ JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
+
+ if(jsonArray != null){
+ int len = jsonArray.length();
+ List<Long> result = new ArrayList<Long>(len);
+ for(int i=0; i<len; i++){
+ try {
+ Long str = jsonArray.getLong(i);
+ result.add(str);
+ } catch (JSONException e) {}
+ }
+ return result;
+ }
+
+ return null;
+ }
+
+ public static List<JSONObject> readJsonObjectListFromJsonObject(JSONObject json, String key){
+ JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
+
+ if(jsonArray != null){
+ int len = jsonArray.length();
+ List<JSONObject> result = new ArrayList<JSONObject>(len);
+ for(int i=0; i<len; i++){
+ try{
+ JSONObject jsonObject = jsonArray.getJSONObject(i);
+ result.add(jsonObject);
+ } catch(JSONException e) {}
+ }
+ return result;
+ }
+
+ return null;
+ }
+
+ public static JSONObject readJsonObjectFromJsonObject(JSONObject json, String key){
+ try {
+ return json.getJSONObject(key);
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ public static Long readLongFromJsonObject(JSONObject json, String key){
+ try {
+ return json.getLong(key);
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ public static String readStringFromJsonObject(JSONObject json, String key){
+ try {
+ return json.getString(key);
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Logger.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Logger.java
index ab922fd7a..ab922fd7a 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Logger.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Logger.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/NullValues.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/NullValues.java
index ce5972887..ce5972887 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/NullValues.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/NullValues.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/SampleRpc.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SampleRpc.java
index 67c15706c..67c15706c 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/SampleRpc.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SampleRpc.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java
new file mode 100644
index 000000000..982be84e8
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java
@@ -0,0 +1,44 @@
+package com.smartdevicelink.test.SdlConnection;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.transport.TCPTransportConfig;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.SdlConnection.SdlSession}
+ */
+public class SdlSessionTests extends TestCase {
+
+ public void testServiceListeners(){
+ SdlSession session = SdlSession.createSession((byte)5,null, new TCPTransportConfig(8080,"",false));
+ ISdlServiceListener test = new ISdlServiceListener() {
+ @Override
+ public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
+
+ }
+
+ @Override
+ public void onServiceEnded(SdlSession session, SessionType type) {
+
+ }
+
+ @Override
+ public void onServiceError(SdlSession session, SessionType type, String reason) {
+
+ }
+ };
+
+ session.addServiceListener(SessionType.RPC, test);
+
+ assertTrue(session.removeServiceListener(SessionType.RPC, test));
+
+ assertFalse(session.removeServiceListener(SessionType.RPC, test));
+
+ }
+
+
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlUnitTestContants.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlUnitTestContants.java
index 3b38b94f3..3b38b94f3 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlUnitTestContants.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlUnitTestContants.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java
new file mode 100644
index 000000000..62176744f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java
@@ -0,0 +1,1225 @@
+package com.smartdevicelink.test;
+
+import android.graphics.Color;
+import android.util.Log;
+
+import com.smartdevicelink.R;
+import com.smartdevicelink.SdlConnection.SdlSession2;
+import com.smartdevicelink.managers.lockscreen.LockScreenConfig;
+import com.smartdevicelink.protocol.SdlProtocol;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.SdlProxyBase;
+import com.smartdevicelink.proxy.TTSChunkFactory;
+import com.smartdevicelink.proxy.rpc.AppServiceCapability;
+import com.smartdevicelink.proxy.rpc.AppServiceData;
+import com.smartdevicelink.proxy.rpc.AppServiceManifest;
+import com.smartdevicelink.proxy.rpc.AppServiceRecord;
+import com.smartdevicelink.proxy.rpc.AppServicesCapabilities;
+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;
+import com.smartdevicelink.proxy.rpc.ClimateControlCapabilities;
+import com.smartdevicelink.proxy.rpc.ClimateControlData;
+import com.smartdevicelink.proxy.rpc.CloudAppProperties;
+import com.smartdevicelink.proxy.rpc.Coordinate;
+import com.smartdevicelink.proxy.rpc.DIDResult;
+import com.smartdevicelink.proxy.rpc.DateTime;
+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;
+import com.smartdevicelink.proxy.rpc.MediaServiceData;
+import com.smartdevicelink.proxy.rpc.MediaServiceManifest;
+import com.smartdevicelink.proxy.rpc.MenuParams;
+import com.smartdevicelink.proxy.rpc.MetadataTags;
+import com.smartdevicelink.proxy.rpc.ModuleData;
+import com.smartdevicelink.proxy.rpc.NavigationCapability;
+import com.smartdevicelink.proxy.rpc.NavigationInstruction;
+import com.smartdevicelink.proxy.rpc.NavigationServiceData;
+import com.smartdevicelink.proxy.rpc.NavigationServiceManifest;
+import com.smartdevicelink.proxy.rpc.OasisAddress;
+import com.smartdevicelink.proxy.rpc.ParameterPermissions;
+import com.smartdevicelink.proxy.rpc.PermissionItem;
+import com.smartdevicelink.proxy.rpc.PhoneCapability;
+import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
+import com.smartdevicelink.proxy.rpc.RGBColor;
+import com.smartdevicelink.proxy.rpc.RadioControlCapabilities;
+import com.smartdevicelink.proxy.rpc.RadioControlData;
+import com.smartdevicelink.proxy.rpc.RdsData;
+import com.smartdevicelink.proxy.rpc.Rectangle;
+import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities;
+import com.smartdevicelink.proxy.rpc.ScreenParams;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+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;
+import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
+import com.smartdevicelink.proxy.rpc.TextField;
+import com.smartdevicelink.proxy.rpc.TouchCoord;
+import com.smartdevicelink.proxy.rpc.TouchEvent;
+import com.smartdevicelink.proxy.rpc.TouchEventCapabilities;
+import com.smartdevicelink.proxy.rpc.Turn;
+import com.smartdevicelink.proxy.rpc.VehicleDataResult;
+import com.smartdevicelink.proxy.rpc.VehicleType;
+import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.VrHelpItem;
+import com.smartdevicelink.proxy.rpc.WeatherAlert;
+import com.smartdevicelink.proxy.rpc.WeatherData;
+import com.smartdevicelink.proxy.rpc.WeatherServiceData;
+import com.smartdevicelink.proxy.rpc.WeatherServiceManifest;
+import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator;
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
+import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
+import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
+import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
+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.Direction;
+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;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
+import com.smartdevicelink.proxy.rpc.enums.FuelType;
+import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.HybridAppPreference;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
+import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
+import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
+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;
+import com.smartdevicelink.proxy.rpc.enums.MassageZone;
+import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
+import com.smartdevicelink.proxy.rpc.enums.MediaType;
+import com.smartdevicelink.proxy.rpc.enums.MetadataType;
+import com.smartdevicelink.proxy.rpc.enums.ModuleType;
+import com.smartdevicelink.proxy.rpc.enums.NavigationAction;
+import com.smartdevicelink.proxy.rpc.enums.NavigationJunction;
+import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
+import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
+import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
+import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
+import com.smartdevicelink.proxy.rpc.enums.RadioBand;
+import com.smartdevicelink.proxy.rpc.enums.RadioState;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType;
+import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason;
+import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.SupportedSeat;
+import com.smartdevicelink.proxy.rpc.enums.SystemAction;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.enums.SystemContext;
+import com.smartdevicelink.proxy.rpc.enums.TBTState;
+import com.smartdevicelink.proxy.rpc.enums.TPMS;
+import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+import com.smartdevicelink.proxy.rpc.enums.TouchType;
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
+import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
+import com.smartdevicelink.proxy.rpc.enums.VentilationMode;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingState;
+import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
+import com.smartdevicelink.proxy.rpc.enums.WayPointType;
+import com.smartdevicelink.util.Version;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Vector;
+
+public class Test {
+
+ //Versions
+ public static final Version MAX_RPC_VERSION_SUPPORTED = SdlProxyBase.MAX_SUPPORTED_RPC_VERSION;
+ /**
+ * @see SdlProtocol
+ */
+ public static final Version MAX_PROTOCOL_VERSION_SUPPORTED = new Version(5, 2, 0);
+
+
+ // Test Failure Messages
+ public static final String NULL = "Value should be null.";
+ public static final String MATCH = "Values should match.";
+ public static final String ARRAY = "Array values should match.";
+ public static final String TRUE = "Value should be true.";
+ public static final String FALSE = "Value should be false.";
+ public static final String NOT_NULL = "Value should not be null.";
+ public static final String JSON_FAIL = "Json testing failed.";
+
+ // RPC Request/Response/Notification/Datatype Test Values
+ public static final int GENERAL_INT = 100;
+ public static final Integer GENERAL_INTEGER = 100;
+ public static final Long GENERAL_LONG = 100L;
+ public static final Turn GENERAL_TURN = new Turn();
+ public static final Float GENERAL_FLOAT = 100f;
+ public static final Image GENERAL_IMAGE = new Image();
+ public static final Choice GENERAL_CHOICE = new Choice();
+ public static final String GENERAL_STRING = "test";
+ public static final Double GENERAL_DOUBLE = 10.01;
+ public static final boolean GENERAL_BOOLEAN = true;
+ public static final byte[] GENERAL_BYTE_ARRAY = new byte[0];
+ public static final TPMS GENERAL_TPMS = TPMS.UNKNOWN;
+ public static final TBTState GENERAL_TBTSTATE = TBTState.NEXT_TURN_REQUEST;
+ public static final FileType GENERAL_FILETYPE = FileType.BINARY;
+ public static final Language GENERAL_LANGUAGE = Language.EN_US;
+ public static final HMILevel GENERAL_HMILEVEL = HMILevel.HMI_FULL;
+ public static final DIDResult GENERAL_DIDRESULT = new DIDResult();
+ public static final TextField GENERAL_TEXTFIELD = new TextField();
+ public static final OasisAddress GENERAL_OASISADDRESS = new OasisAddress();
+ public static final Coordinate GENERAL_COORDINATE = new Coordinate();
+ public static final LocationDetails GENERAL_LOCATIONDETAILS = new LocationDetails();
+ public static final Dimension GENERAL_DIMENSION = Dimension._2D;
+ public static final ImageType GENERAL_IMAGETYPE = ImageType.DYNAMIC;
+ public static final AudioType GENERAL_AUDIOTYPE = AudioType.PCM;
+ public static final StartTime GENERAL_STARTTIME = new StartTime();
+ public static final TouchType GENERAL_TOUCHTYPE = TouchType.BEGIN;
+ public static final TouchEvent GENERAL_TOUCHEVENT = new TouchEvent();
+ public static final VrHelpItem GENERAL_VRHELPITEM = new VrHelpItem();
+ public static final ImageField GENERAL_IMAGEFIELD = new ImageField();
+ public static final DeviceInfo GENERAL_DEVICEINFO = new DeviceInfo();
+ public static final LayoutMode GENERAL_LAYOUTMODE = LayoutMode.LIST_ONLY;
+ public static final MenuParams GENERAL_MENUPARAMS = new MenuParams();
+ public static final SoftButton GENERAL_SOFTBUTTON = new SoftButton();
+ public static final ButtonName GENERAL_BUTTONNAME = ButtonName.OK;
+ public static final UpdateMode GENERAL_UPDATEMODE = UpdateMode.RESUME;
+ public static final TouchCoord GENERAL_TOUCHCOORD = new TouchCoord();
+ public static final MassageModeData GENERAL_MASSAGEMODEDATA = new MassageModeData();
+ public static final MassageCushionFirmness GENERAL_MASSAGECUSHIONFIRMNESS = new MassageCushionFirmness();
+ public static final DisplayType GENERAL_DISPLAYTYPE = DisplayType.CID;
+ public static final VehicleType GENERAL_VEHICLETYPE = new VehicleType();
+ public static final RequestType GENERAL_REQUESTTYPE = RequestType.AUTH_REQUEST;
+ public static final SystemAction GENERAL_SYSTEMACTION = SystemAction.DEFAULT_ACTION;
+ public static final CharacterSet GENERAL_CHARACTERSET = CharacterSet.CID1SET;
+ public static final SamplingRate GENERAL_SAMPLINGRATE = SamplingRate._8KHZ;
+ public static final ScreenParams GENERAL_SCREENPARAMS = new ScreenParams();
+ public static final KeypressMode GENERAL_KEYPRESSMODE = KeypressMode.QUEUE_KEYPRESSES;
+ public static final SystemContext GENERAL_SYSTEMCONTEXT = SystemContext.SYSCTXT_MAIN;
+ public static final KeyboardEvent GENERAL_KEYBOARDEVENT = KeyboardEvent.ENTRY_SUBMITTED;
+ public static final CarModeStatus GENERAL_CARMODESTATUS = CarModeStatus.NORMAL;
+ public static final TextFieldName GENERAL_TEXTFIELDNAME = TextFieldName.ETA;
+ public static final TriggerSource GENERAL_TRIGGERSOURCE = TriggerSource.TS_VR;
+ public static final BitsPerSample GENERAL_BITSPERSAMPLE = BitsPerSample._8_BIT;
+ public static final TextAlignment GENERAL_TEXTALIGNMENT = TextAlignment.CENTERED;
+ public static final SdlMsgVersion GENERAL_SDLMSGVERSION = new SdlMsgVersion();
+ public static final PermissionItem GENERAL_PERMISSIONITEM = new PermissionItem();
+ public static final SoftButtonType GENERAL_SOFTBUTTONTYPE = SoftButtonType.SBT_BOTH;
+ public static final MassageZone GENERAL_MASSAGEZONE = MassageZone.LUMBAR;
+ public static final MassageMode GENERAL_MASSAGEMODE = MassageMode.HIGH;
+ public static final MassageCushion GENERAL_MASSAGECUSHION = MassageCushion.BACK_BOLSTERS;
+ public static final SeatMemoryActionType GENERAL_SEATMEMORYACTIONTYPE = SeatMemoryActionType.SAVE;
+ public static final SupportedSeat GENERAL_SUPPORTEDSEAT = SupportedSeat.DRIVER;
+ public static final KeyboardLayout GENERAL_KEYBOARDLAYOUT = KeyboardLayout.QWERTY;
+ public static final ImageFieldName GENERAL_IMAGEFIELDNAME = ImageFieldName.graphic;
+ public static final HMIPermissions GENERAL_HMIPERMISSIONS = new HMIPermissions();
+ public static final IgnitionStatus GENERAL_IGNITIONSTATUS = IgnitionStatus.RUN;
+ public static final ButtonEventMode GENERAL_BUTTONEVENTMODE = ButtonEventMode.BUTTONUP;
+ public static final ButtonPressMode GENERAL_BUTTONPRESSMODE = ButtonPressMode.SHORT;
+ public static final PowerModeStatus GENERAL_POWERMODESTATUS = PowerModeStatus.RUNNING_2;
+ public static final VehicleDataType GENERAL_VEHICLEDATATYPE = VehicleDataType.VEHICLEDATA_BRAKING;
+ public static final InteractionMode GENERAL_INTERACTIONMODE = InteractionMode.BOTH;
+ public static final ImageResolution GENERAL_IMAGERESOLUTION = new ImageResolution();
+ public static final FuelCutoffStatus GENERAL_FUELCUTOFFSTATUS = FuelCutoffStatus.NORMAL_OPERATION;
+ public static final CompassDirection GENERAL_COMPASSDIRECTION = CompassDirection.EAST;
+ public static final LockScreenStatus GENERAL_LOCKSCREENSTATUS = LockScreenStatus.REQUIRED;
+ public static final VehicleDataStatus GENERAL_VEHICLEDATASTATUS = VehicleDataStatus.ON;
+ public static final DeviceLevelStatus GENERAL_DEVICELEVELSTATUS = DeviceLevelStatus.FOUR_LEVEL_BARS;
+ public static final ButtonCapabilities GENERAL_BUTTONCAPABILITIES = new ButtonCapabilities();
+ public static final EmergencyEventType GENERAL_EMERGENCYEVENTTYPE = EmergencyEventType.FAULT;
+ public static final AmbientLightStatus GENERAL_AMBIENTLIGHTSTATUS = AmbientLightStatus.NIGHT;
+ public static final SpeechCapabilities GENERAL_SPEECHCAPABILITIES = SpeechCapabilities.TEXT;
+ public static final WarningLightStatus GENERAL_WARNINGLIGHTSTATUS = WarningLightStatus.OFF;
+ public static final KeyboardProperties GENERAL_KEYBOARDPROPERTIES = new KeyboardProperties();
+ public static final PrimaryAudioSource GENERAL_PRIMARYAUDIOSOURCE = PrimaryAudioSource.BLUETOOTH_STEREO_BTST;
+ public static final AudioStreamingState GENERAL_AUDIOSTREAMINGSTATE = AudioStreamingState.AUDIBLE;
+ public static final VideoStreamingState GENERAL_VIDEOSTREAMINGSTATE = VideoStreamingState.STREAMABLE;
+ public static final DisplayCapabilities GENERAL_DISPLAYCAPABILITIES = new DisplayCapabilities();
+ public static final ParameterPermissions GENERAL_PARAMETERPERMISSIONS = new ParameterPermissions();
+ public static final IgnitionStableStatus GENERAL_IGNITIONSTABLESTATUS = IgnitionStableStatus.IGNITION_SWITCH_STABLE;
+ public static final VehicleDataResultCode GENERAL_VEHICLEDATARESULTCODE = VehicleDataResultCode.IGNORED;
+ public static final ComponentVolumeStatus GENERAL_COMPONENTVOLUMESTATUS = ComponentVolumeStatus.LOW;
+ public static final PresetBankCapabilities GENERAL_PRESETBANKCAPABILITIES = new PresetBankCapabilities();
+ public static final VehicleDataEventStatus GENERAL_VEHCILEDATAEVENTSTATUS = VehicleDataEventStatus.YES;
+ public static final VehicleDataEventStatus GENERAL_VEHICLEDATAEVENTSTATUS = VehicleDataEventStatus.YES;
+ public static final TouchEventCapabilities GENERAL_TOUCHEVENTCAPABILITIES = new TouchEventCapabilities();
+ public static final SeatMemoryAction GENERAL_SEATMEMORYACTION = new SeatMemoryAction();
+ public static final SoftButtonCapabilities GENERAL_SOFTBUTTONCAPABILITIES = new SoftButtonCapabilities();
+ public static final ECallConfirmationStatus GENERAL_ECALLCONFIRMATIONSTATUS = ECallConfirmationStatus.CALL_IN_PROGRESS;
+ public static final AudioPassThruCapabilities GENERAL_AUDIOPASSTHRUCAPABILITIES = new AudioPassThruCapabilities();
+ public static final PowerModeQualificationStatus GENERAL_POWERMODEQUALIFICATIONSTATUS = PowerModeQualificationStatus.POWER_MODE_OK;
+ public static final VehicleDataNotificationStatus GENERAL_VEHICLEDATANOTIFICATIONSTATUS = VehicleDataNotificationStatus.NORMAL;
+ public static final AppInterfaceUnregisteredReason GENERAL_APPINTERFACEUNREGISTEREDREASON = AppInterfaceUnregisteredReason.BLUETOOTH_OFF;
+ public static final SystemCapabilityType GENERAL_SYSTEMCAPABILITYTYPE = SystemCapabilityType.NAVIGATION;
+ public static final NavigationCapability GENERAL_NAVIGATIONCAPABILITY = new NavigationCapability();
+ public static final PhoneCapability GENERAL_PHONECAPABILITY = new PhoneCapability();
+ public static final RemoteControlCapabilities GENERAL_REMOTECONTROLCAPABILITIES = new RemoteControlCapabilities();
+ public static final SystemCapability GENERAL_SYSTEMCAPABILITY = new SystemCapability();
+ public static final VideoStreamingProtocol GENERAL_VIDEOSTREAMINGPROTOCOL = VideoStreamingProtocol.RAW;
+ public static final VideoStreamingCodec GENERAL_VIDEOSTREAMINGCODEC = VideoStreamingCodec.H264;
+ public static final VideoStreamingCapability GENERAL_VIDEOSTREAMINGCAPABILITY = new VideoStreamingCapability();
+ public static final VideoStreamingFormat GENERAL_VIDEOSTREAMINGFORMAT = new VideoStreamingFormat();
+ public static final RGBColor GENERAL_RGBCOLOR = new RGBColor();
+ public static final TemplateColorScheme GENERAL_DAYCOLORSCHEME = new TemplateColorScheme();
+ public static final TemplateColorScheme GENERAL_NIGHTCOLORSCHEME = new TemplateColorScheme();
+ public static final Result GENERAL_RESULT = Result.SUCCESS;
+ public static final WayPointType GENERAL_WAYPOINTTYPE = WayPointType.DESTINATION;
+ public static final SingleTireStatus GENERAL_SINGLETIRESTATUS = new SingleTireStatus();
+ 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 HybridAppPreference GENERAL_HYBRID_APP_PREFERENCE = HybridAppPreference.CLOUD;
+ public static final CloudAppProperties GENERAL_CLOUDAPPPROPERTIES = new CloudAppProperties();
+ public static final AppServiceType GENERAL_APP_SERVICE_TYPE = AppServiceType.MEDIA;
+ public static final List<Integer> GENERAL_FUNCTION_ID_LIST = Arrays.asList(FunctionID.GET_VEHICLE_DATA.getId(), FunctionID.SEND_HAPTIC_DATA.getId());
+ public static final AppServiceManifest GENERAL_APPSERVICEMANIFEST = new AppServiceManifest(AppServiceType.MEDIA.name());
+ public static final MediaServiceManifest GENERAL_MEDIA_SERVICE_MANIFEST = new MediaServiceManifest();
+ public static final WeatherServiceManifest GENERAL_WEATHER_SERVICE_MANIFEST = new WeatherServiceManifest();
+ public static final NavigationServiceManifest GENERAL_NAVIGATION_SERVICE_MANIFEST = new NavigationServiceManifest();
+ public static final AppServiceRecord GENERAL_APPSERVICERECORD = new AppServiceRecord();
+ public static final AppServiceCapability GENERAL_APP_SERVICE_CAPABILITY = new AppServiceCapability();
+ public static final AppServicesCapabilities GENERAL_APP_SERVICE_CAPABILITIES = new AppServicesCapabilities();
+ public static final ServiceUpdateReason GENERAL_SERVICE_UPDATE_REASON = ServiceUpdateReason.MANIFEST_UPDATE;
+ public static final DateTime GENERAL_DATETIME = new DateTime();
+ public static final WeatherData GENERAL_WEATHERDATA = new WeatherData();
+ public static final WeatherAlert GENERAL_WEATHERALERT = new WeatherAlert();
+ public static final MediaType GENERAL_MEDIATYPE = MediaType.MUSIC;
+ public static final MediaServiceData GENERAL_MEDIASERVICEDATA = new MediaServiceData();
+ public static final WeatherServiceData GENERAL_WEATHERSERVICEDATA = new WeatherServiceData();
+ public static final NavigationServiceData GENERAL_NAVIGATIONSERVICEDATA = new NavigationServiceData();
+ public static final AppServiceData GENERAL_APPSERVICEDATA = new AppServiceData();
+ public static final NavigationAction GENERAL_NAVIGATIONACTION = NavigationAction.STAY;
+ public static final NavigationJunction GENERAL_NAVIGATION_JUNCTION = NavigationJunction.BIFURCATION;
+ public static final Direction GENERAL_DIRECTION = Direction.RIGHT;
+ public static final NavigationInstruction GENERAL_NAVIGATION_INSTRUCTION = new NavigationInstruction();
+ public static final Version GENERAL_VERSION = new Version("4.0.0");
+ 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();
+
+ public static final MetadataTags GENERAL_METADATASTRUCT = new MetadataTags();
+ 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>();
+ public static final List<Choice> GENERAL_CHOICE_LIST = new ArrayList<Choice>();
+ public static final List<String> GENERAL_STRING_LIST = Arrays.asList(new String[] { "a", "b"});
+ public static final List<Integer> GENERAL_INTEGER_LIST = Arrays.asList(new Integer[]{ -1, -2});
+ public static final List<TTSChunk> GENERAL_TTSCHUNK_LIST = new ArrayList<TTSChunk>(2);
+ public static final List<HMILevel> GENERAL_HMILEVEL_LIST = Arrays.asList(new HMILevel[]{HMILevel.HMI_FULL, HMILevel.HMI_BACKGROUND});
+ public static final List<FileType> GENERAL_FILETYPE_LIST = new ArrayList<FileType>(1);
+ public static final List<TextField> GENERAL_TEXTFIELD_LIST = new ArrayList<TextField>(1);
+ public static final List<DIDResult> GENERAL_DIDRESULT_LIST = new ArrayList<DIDResult>(1);
+ public static final List<TouchCoord> GENERAL_TOUCHCOORD_LIST = new ArrayList<TouchCoord>(1);
+ public static final List<MassageModeData> GENERAL_MASSAGEMODEDATA_LIST = new ArrayList<MassageModeData>(1);
+ public static final List<MassageCushionFirmness> GENERAL_MASSAGECUSHIONFIRMNESS_LIST = new ArrayList<MassageCushionFirmness>(1);
+ public static final List<AppHMIType> GENERAL_APPHMITYPE_LIST = new ArrayList<AppHMIType>(2);
+ public static final List<VrHelpItem> GENERAL_VRHELPITEM_LIST = new ArrayList<VrHelpItem>(2);
+ public static final List<SoftButton> GENERAL_SOFTBUTTON_LIST = new ArrayList<SoftButton>(1);
+ public static final List<ImageField> GENERAL_IMAGEFIELD_LIST = new ArrayList<ImageField>(1);
+ public static final List<TouchEvent> GENERAL_TOUCHEVENT_LIST = new ArrayList<TouchEvent>(1);
+ public static final List<PermissionItem> GENERAL_PERMISSIONITEM_LIST = new ArrayList<PermissionItem>(1);
+ public static final List<GlobalProperty> GENERAL_GLOBALPROPERTY_LIST = new ArrayList<GlobalProperty>(2);
+ public static final List<VrCapabilities> GENERAL_VRCAPABILITIES_LIST = new ArrayList<VrCapabilities>(1);
+ public static final List<MediaClockFormat> GENERAL_MEDIACLOCKFORMAT_LIST = new ArrayList<MediaClockFormat>(2);
+ public static final List<VehicleDataResult> GENERAL_VEHICLEDATARESULT_LIST = new ArrayList<VehicleDataResult>(VehicleDataType.values().length);
+ public static final List<PrerecordedSpeech> GENERAL_PRERECORDEDSPEECH_LIST = new ArrayList<PrerecordedSpeech>(2);
+ public static final List<SpeechCapabilities> GENERAL_SPEECHCAPABILITIES_LIST = new ArrayList<SpeechCapabilities>(2);
+ public static final List<ButtonCapabilities> GENERAL_BUTTONCAPABILITIES_LIST = new ArrayList<ButtonCapabilities>(2);
+ public static final List<HmiZoneCapabilities> GENERAL_HMIZONECAPABILITIES_LIST = new ArrayList<HmiZoneCapabilities>(2);
+ public static final List<SoftButtonCapabilities> GENERAL_SOFTBUTTONCAPABILITIES_LIST = new ArrayList<SoftButtonCapabilities>(1);
+ public static final List<AudioPassThruCapabilities> GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST = new ArrayList<AudioPassThruCapabilities>(1);
+ public static final List<VideoStreamingFormat> GENERAL_VIDEOSTREAMINGFORMAT_LIST = new ArrayList<VideoStreamingFormat>(2);
+ public static final List<DefrostZone> GENERAL_DEFROSTZONE_LIST = Arrays.asList(new DefrostZone[]{DefrostZone.FRONT, DefrostZone.REAR});
+ public static final List<VentilationMode> GENERAL_VENTILATIONMODE_LIST = Arrays.asList(new VentilationMode[]{VentilationMode.LOWER, VentilationMode.UPPER});
+ public static final List<ClimateControlCapabilities> GENERAL_CLIMATECONTROLCAPABILITIES_LIST = new ArrayList<ClimateControlCapabilities>(1);
+ public static final List<RadioControlCapabilities> GENERAL_RADIOCONTROLCAPABILITIES_LIST = new ArrayList<RadioControlCapabilities>(1);
+ 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 List<ModuleData> GENERAL_MODULEDATA_LIST = Collections.singletonList(GENERAL_MODULEDATA);
+ public static final List<AppServiceType> GENERAL_APPSERVICETYPE_LIST = Arrays.asList(AppServiceType.MEDIA, AppServiceType.NAVIGATION);
+ public static final List<AppServiceCapability> GENERAL_APPSERVICECAPABILITY_LIST = Arrays.asList(GENERAL_APP_SERVICE_CAPABILITY);
+ public static final List<WeatherData> GENERAL_WEATHERDATA_LIST = Arrays.asList(GENERAL_WEATHERDATA);
+ public static final List<WeatherAlert> GENERAL_WEATHERALERT_LIST = Arrays.asList(GENERAL_WEATHERALERT);
+ public static final List<NavigationInstruction> GENERAL_NAVIGATION_INSTRUCTION_LIST = Arrays.asList(GENERAL_NAVIGATION_INSTRUCTION);
+
+
+ public static final JSONArray JSON_TURNS = new JSONArray();
+ public static final JSONArray JSON_CHOICES = new JSONArray();
+ public static final JSONArray JSON_HMILEVELS = new JSONArray();
+ public static final JSONArray JSON_TTSCHUNKS = new JSONArray();
+ public static final JSONArray JSON_DIDRESULTS = new JSONArray();
+ public static final JSONArray JSON_TEXTFIELDS = new JSONArray();
+ public static final JSONArray JSON_TOUCHCOORDS = new JSONArray();
+ public static final JSONArray JSON_VRHELPITEMS = new JSONArray();
+ public static final JSONArray JSON_SOFTBUTTONS = new JSONArray();
+ public static final JSONArray JSON_IMAGEFIELDS = new JSONArray();
+ public static final JSONArray JSON_TOUCHEVENTS = new JSONArray();
+ public static final JSONArray JSON_PERMISSIONITEMS = new JSONArray();
+ public static final JSONArray JSON_BUTTONCAPABILITIES = new JSONArray();
+ public static final JSONArray JSON_SOFTBUTTONCAPABILITIES = new JSONArray();
+ public static final JSONArray JSON_AUDIOPASSTHRUCAPABILITIES = new JSONArray();
+ public static final JSONArray JSON_RADIOCONTROLCAPABILITIES = new JSONArray();
+ public static final JSONArray JSON_CLIMATECONTROLCAPABILITIES = new JSONArray();
+ public static final JSONArray JSON_TEXTFIELDTYPES = new JSONArray();
+ public static final JSONObject JSON_TURN = new JSONObject();
+ public static final JSONObject JSON_IMAGE = new JSONObject();
+ public static final JSONObject JSON_CHOICE = new JSONObject();
+ public static final JSONObject JSON_DIDRESULT = new JSONObject();
+ public static final JSONObject JSON_STARTTIME = new JSONObject();
+ public static final JSONObject JSON_TEXTFIELD = new JSONObject();
+ public static final JSONObject JSON_TOUCHCOORD = new JSONObject();
+ public static final JSONObject JSON_TOUCHEVENT = new JSONObject();
+ public static final JSONObject JSON_IMAGEFIELD = new JSONObject();
+ public static final JSONObject JSON_SOFTBUTTON = new JSONObject();
+ public static final JSONObject JSON_MENUPARAMS = new JSONObject();
+ public static final JSONObject JSON_DEVICEINFO = new JSONObject();
+ public static final JSONObject JSON_VRHELPITEM = new JSONObject();
+ public static final JSONObject JSON_SCREENPARAMS = new JSONObject();
+ public static final JSONObject JSON_SDLMSGVERSION = new JSONObject();
+ public static final JSONObject JSON_PERMISSIONITEM = new JSONObject();
+ public static final JSONObject JSON_HMIPERMISSIONS = new JSONObject();
+ public static final JSONObject JSON_IMAGERESOLUTION = new JSONObject();
+ public static final JSONObject JSON_KEYBOARDPROPERTIES = new JSONObject();
+ public static final JSONObject JSON_DISPLAYCAPABILITIES = new JSONObject();
+ public static final JSONObject JSON_PARAMETERPERMISSIONS = new JSONObject();
+ public static final JSONObject JSON_PRESETBANKCAPABILITIES = new JSONObject();
+ public static final JSONObject JSON_TOUCHEVENTCAPABILITIES = new JSONObject();
+ public static final JSONObject JSON_PCMSTREAMCAPABILITIES = new JSONObject();
+ public static final JSONObject JSON_RGBCOLOR = new JSONObject();
+ public static final JSONObject JSON_DAYCOLORSCHEME = new JSONObject();
+ public static final JSONObject JSON_NIGHTCOLORSCHEME = new JSONObject();
+
+ static {
+ GENERAL_TOUCHEVENTCAPABILITIES.setDoublePressAvailable(GENERAL_BOOLEAN);
+ GENERAL_TOUCHEVENTCAPABILITIES.setMultiTouchAvailable(GENERAL_BOOLEAN);
+ GENERAL_TOUCHEVENTCAPABILITIES.setPressAvailable(GENERAL_BOOLEAN);
+
+ GENERAL_SEATMEMORYACTION.setAction(GENERAL_SEATMEMORYACTIONTYPE);
+ GENERAL_SEATMEMORYACTION.setLabel(GENERAL_STRING);
+ GENERAL_SEATMEMORYACTION.setId(GENERAL_INT);
+
+ GENERAL_IMAGERESOLUTION.setResolutionHeight(GENERAL_INT);
+ GENERAL_IMAGERESOLUTION.setResolutionWidth(GENERAL_INT);
+
+ GENERAL_TEMPERATURE.setUnit(GENERAL_TEMPERATUREUNIT);
+ GENERAL_TEMPERATURE.setValue(GENERAL_FLOAT);
+
+ GENERAL_CLIMATECONTROLDATA.setFanSpeed(GENERAL_INT);
+ GENERAL_CLIMATECONTROLDATA.setCurrentTemperature(GENERAL_TEMPERATURE);
+ GENERAL_CLIMATECONTROLDATA.setDesiredTemperature(GENERAL_TEMPERATURE);
+ GENERAL_CLIMATECONTROLDATA.setAcEnable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLDATA.setCirculateAirEnable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLDATA.setAutoModeEnable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLDATA.setDualModeEnable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLDATA.setAcMaxEnable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLDATA.setDefrostZone(GENERAL_DEFROSTZONE);
+ GENERAL_CLIMATECONTROLDATA.setVentilationMode(GENERAL_VENTILATIONMODE);
+
+ GENERAL_SEATCONTROLDATA.setMemory(GENERAL_SEATMEMORYACTION);
+ GENERAL_SEATCONTROLDATA.setMassageCushionFirmness(GENERAL_MASSAGECUSHIONFIRMNESS_LIST);
+ GENERAL_SEATCONTROLDATA.setMassageMode(GENERAL_MASSAGEMODEDATA_LIST);
+ GENERAL_SEATCONTROLDATA.setMassageEnabled(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLDATA.setHeadSupportHorizontalPosition(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setHeadSupportVerticalPosition(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setBackTiltAngle(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setBackVerticalPosition(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setFrontVerticalPosition(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setVerticalPosition(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setHorizontalPosition(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setCoolingLevel(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setHeatingLevel(GENERAL_INT);
+ GENERAL_SEATCONTROLDATA.setHeatingEnabled(GENERAL_BOOLEAN);
+ 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);
+ GENERAL_RDSDATA.setProgramIdentification(GENERAL_STRING);
+ GENERAL_RDSDATA.setRegion(GENERAL_STRING);
+ GENERAL_RDSDATA.setTrafficProgram(GENERAL_BOOLEAN);
+ GENERAL_RDSDATA.setTrafficAnnouncement(GENERAL_BOOLEAN);
+ GENERAL_RDSDATA.setProgramType(GENERAL_INT);
+
+ GENERAL_RADIOCONTROLDATA.setFrequencyInteger(GENERAL_INT);
+ GENERAL_RADIOCONTROLDATA.setFrequencyFraction(GENERAL_INT);
+ GENERAL_RADIOCONTROLDATA.setBand(GENERAL_RADIOBAND);
+ GENERAL_RADIOCONTROLDATA.setRdsData(GENERAL_RDSDATA);
+ GENERAL_RADIOCONTROLDATA.setAvailableHDs(GENERAL_INT);
+ GENERAL_RADIOCONTROLDATA.setHdChannel(GENERAL_INT);
+ GENERAL_RADIOCONTROLDATA.setSignalStrength(GENERAL_INT);
+ GENERAL_RADIOCONTROLDATA.setSignalChangeThreshold(GENERAL_INT);
+ GENERAL_RADIOCONTROLDATA.setRadioEnable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLDATA.setState(GENERAL_RADIOSTATE);
+
+ GENERAL_MODULEDATA.setModuleType(GENERAL_MODULETYPE);
+ GENERAL_MODULEDATA.setClimateControlData(GENERAL_CLIMATECONTROLDATA);
+
+ GENERAL_CHOICE.setMenuName(GENERAL_STRING);
+ GENERAL_CHOICE.setSecondaryText(GENERAL_STRING);
+ GENERAL_CHOICE.setTertiaryText(GENERAL_STRING);
+ GENERAL_CHOICE.setChoiceID(GENERAL_INT);
+ GENERAL_CHOICE.setImage(GENERAL_IMAGE);
+ GENERAL_CHOICE.setSecondaryImage(GENERAL_IMAGE);
+ GENERAL_CHOICE.setVrCommands(GENERAL_STRING_LIST);
+
+ GENERAL_MASSAGEMODEDATA.setMassageMode(GENERAL_MASSAGEMODE);
+ GENERAL_MASSAGEMODEDATA.setMassageZone(GENERAL_MASSAGEZONE);
+ GENERAL_MASSAGEMODEDATA_LIST.add(GENERAL_MASSAGEMODEDATA);
+
+ GENERAL_MASSAGECUSHIONFIRMNESS.setCushion(GENERAL_MASSAGECUSHION);
+ GENERAL_MASSAGECUSHIONFIRMNESS.setFirmness(GENERAL_INT);
+ GENERAL_MASSAGECUSHIONFIRMNESS_LIST.add(GENERAL_MASSAGECUSHIONFIRMNESS);
+
+ GENERAL_TOUCHCOORD.setX(GENERAL_INT);
+ GENERAL_TOUCHCOORD.setY(GENERAL_INT);
+ GENERAL_TOUCHCOORD_LIST.add(GENERAL_TOUCHCOORD);
+
+ GENERAL_TOUCHEVENT.setId(GENERAL_INT);
+ GENERAL_TOUCHEVENT.setTs(GENERAL_LONG_LIST);
+ GENERAL_TOUCHEVENT.setC(GENERAL_TOUCHCOORD_LIST);
+ GENERAL_TOUCHEVENT_LIST.add(GENERAL_TOUCHEVENT);
+
+ GENERAL_TEXTFIELD.setName(GENERAL_TEXTFIELDNAME);
+ GENERAL_TEXTFIELD.setRows(GENERAL_INT);
+ GENERAL_TEXTFIELD.setWidth(GENERAL_INT);
+ GENERAL_TEXTFIELD.setCharacterSet(GENERAL_CHARACTERSET);
+ GENERAL_TEXTFIELD_LIST.add(GENERAL_TEXTFIELD);
+
+ GENERAL_COORDINATE.setLongitudeDegrees(GENERAL_FLOAT);
+ GENERAL_COORDINATE.setLatitudeDegrees(GENERAL_FLOAT);
+
+ GENERAL_OASISADDRESS.setCountryName(GENERAL_STRING);
+ GENERAL_OASISADDRESS.setThoroughfare(GENERAL_STRING);
+ GENERAL_OASISADDRESS.setSubThoroughfare(GENERAL_STRING);
+ GENERAL_OASISADDRESS.setCountryCode(GENERAL_STRING);
+ GENERAL_OASISADDRESS.setPostalCode(GENERAL_STRING);
+ GENERAL_OASISADDRESS.setLocality(GENERAL_STRING);
+ GENERAL_OASISADDRESS.setSubLocality(GENERAL_STRING);
+ GENERAL_OASISADDRESS.setAdministrativeArea(GENERAL_STRING);
+ GENERAL_OASISADDRESS.setSubAdministrativeArea(GENERAL_STRING);
+
+ GENERAL_LOCATIONDETAILS.setAddressLines(GENERAL_STRING_LIST);
+ GENERAL_LOCATIONDETAILS.setCoordinate(GENERAL_COORDINATE);
+ GENERAL_LOCATIONDETAILS.setLocationDescription(GENERAL_STRING);
+ GENERAL_LOCATIONDETAILS.setLocationImage(GENERAL_IMAGE);
+ GENERAL_LOCATIONDETAILS.setLocationName(GENERAL_STRING);
+ GENERAL_LOCATIONDETAILS.setSearchAddress(GENERAL_OASISADDRESS);
+ GENERAL_LOCATIONDETAILS.setPhoneNumber(GENERAL_STRING);
+
+ GENERAL_FILETYPE_LIST.add(GENERAL_FILETYPE);
+
+ GENERAL_IMAGEFIELD.setImageResolution(GENERAL_IMAGERESOLUTION);
+ GENERAL_IMAGEFIELD.setName(GENERAL_IMAGEFIELDNAME);
+ GENERAL_IMAGEFIELD.setImageTypeSupported(GENERAL_FILETYPE_LIST);
+ GENERAL_IMAGEFIELD_LIST.add(GENERAL_IMAGEFIELD);
+
+ GENERAL_SCREENPARAMS.setImageResolution(GENERAL_IMAGERESOLUTION);
+ GENERAL_SCREENPARAMS.setTouchEventAvailable(GENERAL_TOUCHEVENTCAPABILITIES);
+
+ GENERAL_MEDIACLOCKFORMAT_LIST.add(MediaClockFormat.CLOCK1);
+ GENERAL_MEDIACLOCKFORMAT_LIST.add(MediaClockFormat.CLOCK2);
+
+ GENERAL_IMAGE.setValue(GENERAL_STRING);
+ GENERAL_IMAGE.setImageType(GENERAL_IMAGETYPE);
+ GENERAL_IMAGE.setIsTemplate(GENERAL_BOOLEAN);
+
+ GENERAL_SOFTBUTTON.setIsHighlighted(GENERAL_BOOLEAN);
+ GENERAL_SOFTBUTTON.setSoftButtonID(GENERAL_INT);
+ GENERAL_SOFTBUTTON.setSystemAction(SystemAction.STEAL_FOCUS);
+ GENERAL_SOFTBUTTON.setText(GENERAL_STRING);
+ GENERAL_SOFTBUTTON.setType(SoftButtonType.SBT_TEXT);
+ GENERAL_SOFTBUTTON.setImage(GENERAL_IMAGE);
+ GENERAL_SOFTBUTTON_LIST.add(GENERAL_SOFTBUTTON);
+
+ GENERAL_TURN.setNavigationText(GENERAL_STRING);
+ GENERAL_TURN.setTurnIcon(GENERAL_IMAGE);
+ GENERAL_TURN_LIST.add(GENERAL_TURN);
+
+ GENERAL_MENUPARAMS.setMenuName(GENERAL_STRING);
+ GENERAL_MENUPARAMS.setParentID(GENERAL_INT);
+ GENERAL_MENUPARAMS.setPosition(GENERAL_INT);
+
+ GENERAL_VRHELPITEM.setText(GENERAL_STRING);
+ GENERAL_VRHELPITEM.setImage(GENERAL_IMAGE);
+ GENERAL_VRHELPITEM.setPosition(100);
+ GENERAL_VRHELPITEM_LIST.add(GENERAL_VRHELPITEM);
+
+ GENERAL_TTSCHUNK_LIST.add(TTSChunkFactory.createChunk(SpeechCapabilities.TEXT, "Welcome to the jungle"));
+ GENERAL_TTSCHUNK_LIST.add(TTSChunkFactory.createChunk(SpeechCapabilities.TEXT, "Say a command"));
+
+ GENERAL_KEYBOARDPROPERTIES.setAutoCompleteText(GENERAL_STRING);
+ GENERAL_KEYBOARDPROPERTIES.setKeypressMode(KeypressMode.SINGLE_KEYPRESS);
+ GENERAL_KEYBOARDPROPERTIES.setKeyboardLayout(KeyboardLayout.QWERTY);
+ GENERAL_KEYBOARDPROPERTIES.setLanguage(Language.EN_US);
+ GENERAL_KEYBOARDPROPERTIES.setLimitedCharacterList(Test.GENERAL_STRING_LIST);
+
+ GENERAL_STARTTIME.setHours(GENERAL_INT);
+ GENERAL_STARTTIME.setMinutes(GENERAL_INT);
+ GENERAL_STARTTIME.setSeconds(GENERAL_INT);
+
+ GENERAL_CHOICE_LIST.add(GENERAL_CHOICE);
+
+ GENERAL_DEVICEINFO.setCarrier(GENERAL_STRING);
+ GENERAL_DEVICEINFO.setFirmwareRev(GENERAL_STRING);
+ GENERAL_DEVICEINFO.setHardware(GENERAL_STRING);
+ GENERAL_DEVICEINFO.setMaxNumberRFCOMMPorts(GENERAL_INT);
+ GENERAL_DEVICEINFO.setOs(GENERAL_STRING);
+ GENERAL_DEVICEINFO.setOsVersion(GENERAL_STRING);
+
+ GENERAL_SDLMSGVERSION.setMajorVersion(GENERAL_INT);
+ GENERAL_SDLMSGVERSION.setMinorVersion(GENERAL_INT);
+
+ GENERAL_APPHMITYPE_LIST.add(AppHMIType.BACKGROUND_PROCESS);
+ GENERAL_APPHMITYPE_LIST.add(AppHMIType.COMMUNICATION);
+
+ GENERAL_GLOBALPROPERTY_LIST.add(GlobalProperty.HELPPROMPT);
+ GENERAL_GLOBALPROPERTY_LIST.add(GlobalProperty.MENUICON);
+
+ for (VehicleDataType data : VehicleDataType.values()) {
+ VehicleDataResult result = new VehicleDataResult();
+ result.setResultCode(VehicleDataResultCode.SUCCESS);
+ result.setDataType(data);
+ GENERAL_VEHICLEDATARESULT_LIST.add(result);
+ }
+
+ GENERAL_DIDRESULT.setData(GENERAL_STRING);
+ GENERAL_DIDRESULT.setDidLocation(GENERAL_INT);
+ GENERAL_DIDRESULT.setResultCode(VehicleDataResultCode.SUCCESS);
+ GENERAL_DIDRESULT_LIST.add(GENERAL_DIDRESULT);
+
+ GENERAL_DISPLAYCAPABILITIES.setDisplayType(GENERAL_DISPLAYTYPE);
+ GENERAL_DISPLAYCAPABILITIES.setDisplayName(GENERAL_STRING);
+ GENERAL_DISPLAYCAPABILITIES.setGraphicSupported(GENERAL_BOOLEAN);
+ GENERAL_DISPLAYCAPABILITIES.setImageFields(GENERAL_IMAGEFIELD_LIST);
+ GENERAL_DISPLAYCAPABILITIES.setMediaClockFormats(GENERAL_MEDIACLOCKFORMAT_LIST);
+ GENERAL_DISPLAYCAPABILITIES.setNumCustomPresetsAvailable(GENERAL_INT);
+ GENERAL_DISPLAYCAPABILITIES.setScreenParams(GENERAL_SCREENPARAMS);
+ GENERAL_DISPLAYCAPABILITIES.setTemplatesAvailable(GENERAL_STRING_LIST);
+ GENERAL_DISPLAYCAPABILITIES.setTextFields(GENERAL_TEXTFIELD_LIST);
+
+ GENERAL_PRESETBANKCAPABILITIES.setOnScreenPresetsAvailable(GENERAL_BOOLEAN);
+
+ GENERAL_BUTTONCAPABILITIES.setLongPressAvailable(false);
+ GENERAL_BUTTONCAPABILITIES.setShortPressAvailable(true);
+ GENERAL_BUTTONCAPABILITIES.setUpDownAvailable(true);
+ GENERAL_BUTTONCAPABILITIES.setName(ButtonName.SEEKRIGHT);
+ GENERAL_BUTTONCAPABILITIES_LIST.add(GENERAL_BUTTONCAPABILITIES);
+
+ GENERAL_SOFTBUTTONCAPABILITIES.setLongPressAvailable(GENERAL_BOOLEAN);
+ GENERAL_SOFTBUTTONCAPABILITIES.setShortPressAvailable(GENERAL_BOOLEAN);
+ GENERAL_SOFTBUTTONCAPABILITIES.setUpDownAvailable(GENERAL_BOOLEAN);
+ GENERAL_SOFTBUTTONCAPABILITIES.setImageSupported(GENERAL_BOOLEAN);
+ GENERAL_SOFTBUTTONCAPABILITIES_LIST.add(GENERAL_SOFTBUTTONCAPABILITIES);
+
+ GENERAL_VEHICLETYPE.setMake(GENERAL_STRING);
+ GENERAL_VEHICLETYPE.setModel(GENERAL_STRING);
+ GENERAL_VEHICLETYPE.setModelYear(GENERAL_STRING);
+ GENERAL_VEHICLETYPE.setTrim(GENERAL_STRING);
+
+ GENERAL_AUDIOPASSTHRUCAPABILITIES.setAudioType(GENERAL_AUDIOTYPE);
+ GENERAL_AUDIOPASSTHRUCAPABILITIES.setBitsPerSample(GENERAL_BITSPERSAMPLE);
+ GENERAL_AUDIOPASSTHRUCAPABILITIES.setSamplingRate(GENERAL_SAMPLINGRATE);
+ GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST.add(GENERAL_AUDIOPASSTHRUCAPABILITIES);
+
+ GENERAL_PRERECORDEDSPEECH_LIST.add(PrerecordedSpeech.HELP_JINGLE);
+ GENERAL_PRERECORDEDSPEECH_LIST.add(PrerecordedSpeech.INITIAL_JINGLE);
+
+ GENERAL_HMIZONECAPABILITIES_LIST.add(HmiZoneCapabilities.BACK);
+ GENERAL_HMIZONECAPABILITIES_LIST.add(HmiZoneCapabilities.FRONT);
+
+ GENERAL_SPEECHCAPABILITIES_LIST.add(SpeechCapabilities.SILENCE);
+ GENERAL_SPEECHCAPABILITIES_LIST.add(SpeechCapabilities.TEXT);
+
+ GENERAL_VRCAPABILITIES_LIST.add(VrCapabilities.TEXT);
+
+ GENERAL_HMIPERMISSIONS.setAllowed(GENERAL_HMILEVEL_LIST);
+ GENERAL_HMIPERMISSIONS.setUserDisallowed(GENERAL_HMILEVEL_LIST);
+
+ GENERAL_PARAMETERPERMISSIONS.setAllowed(GENERAL_STRING_LIST);
+ GENERAL_PARAMETERPERMISSIONS.setUserDisallowed(GENERAL_STRING_LIST);
+
+ GENERAL_PERMISSIONITEM.setRpcName(GENERAL_STRING);
+ GENERAL_PERMISSIONITEM.setHMIPermissions(GENERAL_HMIPERMISSIONS);
+ GENERAL_PERMISSIONITEM.setParameterPermissions(GENERAL_PARAMETERPERMISSIONS);
+ GENERAL_PERMISSIONITEM_LIST.add(GENERAL_PERMISSIONITEM);
+
+ GENERAL_SYSTEMCAPABILITY.setSystemCapabilityType(GENERAL_SYSTEMCAPABILITYTYPE);
+
+ GENERAL_NAVIGATIONCAPABILITY.setSendLocationEnabled(GENERAL_BOOLEAN);
+ GENERAL_NAVIGATIONCAPABILITY.setWayPointsEnabled(GENERAL_BOOLEAN);
+
+ GENERAL_PHONECAPABILITY.setDialNumberEnabled(GENERAL_BOOLEAN);
+
+ GENERAL_VIDEOSTREAMINGFORMAT.setProtocol(GENERAL_VIDEOSTREAMINGPROTOCOL);
+ GENERAL_VIDEOSTREAMINGFORMAT.setCodec(GENERAL_VIDEOSTREAMINGCODEC);
+
+ GENERAL_VIDEOSTREAMINGFORMAT_LIST.add(GENERAL_VIDEOSTREAMINGFORMAT);
+ GENERAL_VIDEOSTREAMINGFORMAT_LIST.add(GENERAL_VIDEOSTREAMINGFORMAT);
+
+ 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);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setDesiredTemperatureAvailable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setAcEnableAvailable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setAcMaxEnableAvailable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setCirculateAirEnableAvailable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setAutoModeEnableAvailable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setDualModeEnableAvailable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setDefrostZoneAvailable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setDefrostZone(GENERAL_DEFROSTZONE_LIST);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setVentilationModeAvailable(GENERAL_BOOLEAN);
+ GENERAL_CLIMATECONTROLCAPABILITIES.setVentilationMode(GENERAL_VENTILATIONMODE_LIST);
+ GENERAL_CLIMATECONTROLCAPABILITIES_LIST.add(GENERAL_CLIMATECONTROLCAPABILITIES);
+
+ GENERAL_RADIOCONTROLCAPABILITIES.setModuleName(GENERAL_STRING);
+ GENERAL_RADIOCONTROLCAPABILITIES.setRadioEnableAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES.setRadioBandAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES.setRadioFrequencyAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES.setHdChannelAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES.setRdsDataAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES.setAvailableHDsAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES.setStateAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES.setSignalStrengthAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES.setSignalChangeThresholdAvailable(GENERAL_BOOLEAN);
+ GENERAL_RADIOCONTROLCAPABILITIES_LIST.add(GENERAL_RADIOCONTROLCAPABILITIES);
+
+ GENERAL_SEATCONTROLCAPABILITIES.setMemoryAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setMassageCushionFirmnessAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setMassageModeAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setMassageEnabledAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setHeadSupportVerticalPositionAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setHeadSupportHorizontalPositionAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setBackTiltAngleAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setBackVerticalPositionAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setFrontVerticalPositionAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setVerticalPositionAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setHorizontalPositionAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setCoolingLevelAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setHeatingLevelAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setCoolingEnabledAvailable(GENERAL_BOOLEAN);
+ GENERAL_SEATCONTROLCAPABILITIES.setHeatingEnabledAvailable(GENERAL_BOOLEAN);
+ 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.setKeepContextAvailable(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);
+
+ GENERAL_HMICAPABILITIES.setNavigationAvilable(GENERAL_BOOLEAN);
+ GENERAL_HMICAPABILITIES.setVideoStreamingAvailable(GENERAL_BOOLEAN);
+ GENERAL_HMICAPABILITIES.setPhoneCallAvilable(GENERAL_BOOLEAN);
+
+ List<MetadataType> exampleList = new ArrayList<>();
+ exampleList.add(0, MetadataType.CURRENT_TEMPERATURE);
+ exampleList.add(1, MetadataType.MEDIA_ALBUM);
+ exampleList.add(2, MetadataType.MEDIA_ARTIST);
+
+ GENERAL_METADATASTRUCT.setMainField1(exampleList);
+ GENERAL_METADATASTRUCT.setMainField2(exampleList);
+ GENERAL_METADATASTRUCT.setMainField3(exampleList);
+ GENERAL_METADATASTRUCT.setMainField4(exampleList);
+
+ GENERAL_RECTANGLE.setX(GENERAL_FLOAT);
+ GENERAL_RECTANGLE.setY(GENERAL_FLOAT);
+ GENERAL_RECTANGLE.setWidth(GENERAL_FLOAT);
+ GENERAL_RECTANGLE.setHeight(GENERAL_FLOAT);
+
+ GENERAL_HAPTIC_RECT.setId(GENERAL_INTEGER);
+ GENERAL_HAPTIC_RECT.setRect(GENERAL_RECTANGLE);
+
+ GENERAL_RGBCOLOR.setRed(GENERAL_INTEGER);
+ GENERAL_RGBCOLOR.setGreen(GENERAL_INTEGER);
+ GENERAL_RGBCOLOR.setBlue(GENERAL_INTEGER);
+
+ GENERAL_NIGHTCOLORSCHEME.setPrimaryColor(GENERAL_RGBCOLOR);
+ GENERAL_NIGHTCOLORSCHEME.setSecondaryColor(GENERAL_RGBCOLOR);
+ GENERAL_NIGHTCOLORSCHEME.setBackgroundColor(GENERAL_RGBCOLOR);
+
+ GENERAL_DAYCOLORSCHEME.setPrimaryColor(GENERAL_RGBCOLOR);
+ 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);
+ GENERAL_CLOUDAPPPROPERTIES.setNicknames(GENERAL_STRING_LIST);
+ GENERAL_CLOUDAPPPROPERTIES.setAppID(GENERAL_STRING);
+ GENERAL_CLOUDAPPPROPERTIES.setEnabled(GENERAL_BOOLEAN);
+ GENERAL_CLOUDAPPPROPERTIES.setAuthToken(GENERAL_STRING);
+ GENERAL_CLOUDAPPPROPERTIES.setCloudTransportType(GENERAL_STRING);
+ GENERAL_CLOUDAPPPROPERTIES.setHybridAppPreference(GENERAL_HYBRID_APP_PREFERENCE);
+ GENERAL_CLOUDAPPPROPERTIES.setEndpoint(GENERAL_STRING);
+ GENERAL_WEATHER_SERVICE_MANIFEST.setWeatherForLocationSupported(GENERAL_BOOLEAN);
+ GENERAL_WEATHER_SERVICE_MANIFEST.setCurrentForecastSupported(GENERAL_BOOLEAN);
+ GENERAL_WEATHER_SERVICE_MANIFEST.setMaxMultidayForecastAmount(GENERAL_INTEGER);
+ GENERAL_WEATHER_SERVICE_MANIFEST.setMaxMinutelyForecastAmount(GENERAL_INTEGER);
+ GENERAL_WEATHER_SERVICE_MANIFEST.setMaxHourlyForecastAmount(GENERAL_INTEGER);
+
+ GENERAL_APPSERVICEMANIFEST.setWeatherServiceManifest(GENERAL_WEATHER_SERVICE_MANIFEST);
+ GENERAL_APPSERVICEMANIFEST.setServiceName(GENERAL_STRING);
+ GENERAL_APPSERVICEMANIFEST.setServiceIcon(GENERAL_IMAGE);
+ GENERAL_APPSERVICEMANIFEST.setRpcSpecVersion(GENERAL_SDLMSGVERSION);
+ GENERAL_APPSERVICEMANIFEST.setMediaServiceManifest(GENERAL_MEDIA_SERVICE_MANIFEST);
+ GENERAL_APPSERVICEMANIFEST.setHandledRpcs(GENERAL_FUNCTION_ID_LIST);
+ GENERAL_APPSERVICEMANIFEST.setAllowAppConsumers(GENERAL_BOOLEAN);
+ GENERAL_APPSERVICEMANIFEST.setServiceType(GENERAL_STRING);
+
+ GENERAL_NAVIGATION_SERVICE_MANIFEST.setAcceptsWayPoints(GENERAL_BOOLEAN);
+
+ GENERAL_APPSERVICERECORD.setServiceID(GENERAL_STRING);
+ GENERAL_APPSERVICERECORD.setServiceManifest(GENERAL_APPSERVICEMANIFEST);
+ GENERAL_APPSERVICERECORD.setServiceActive(GENERAL_BOOLEAN);
+ GENERAL_APPSERVICERECORD.setServicePublished(GENERAL_BOOLEAN);
+
+ GENERAL_APP_SERVICE_CAPABILITY.setUpdatedAppServiceRecord(GENERAL_APPSERVICERECORD);
+ GENERAL_APP_SERVICE_CAPABILITY.setUpdateReason(GENERAL_SERVICE_UPDATE_REASON);
+
+ GENERAL_APP_SERVICE_CAPABILITIES.setAppServices(GENERAL_APPSERVICECAPABILITY_LIST);
+
+ GENERAL_DATETIME.setDay(Test.GENERAL_INT);
+ GENERAL_DATETIME.setHour(Test.GENERAL_INT);
+ GENERAL_DATETIME.setMilliSecond(Test.GENERAL_INT);
+ GENERAL_DATETIME.setMinute(Test.GENERAL_INT);
+ GENERAL_DATETIME.setMonth(Test.GENERAL_INT);
+ GENERAL_DATETIME.setSecond(Test.GENERAL_INT);
+ GENERAL_DATETIME.setTzHour(Test.GENERAL_INT);
+ GENERAL_DATETIME.setTzMinute(Test.GENERAL_INT);
+ GENERAL_DATETIME.setYear(Test.GENERAL_INT);
+
+ GENERAL_WEATHERDATA.setCurrentTemperature(GENERAL_TEMPERATURE);
+ GENERAL_WEATHERDATA.setTemperatureHigh(GENERAL_TEMPERATURE);
+ GENERAL_WEATHERDATA.setTemperatureLow(GENERAL_TEMPERATURE);
+ GENERAL_WEATHERDATA.setApparentTemperature(GENERAL_TEMPERATURE);
+ GENERAL_WEATHERDATA.setWeatherSummary(GENERAL_STRING);
+ GENERAL_WEATHERDATA.setTime(GENERAL_DATETIME);
+ GENERAL_WEATHERDATA.setHumidity(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setCloudCover(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setMoonPhase(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setWindBearing(GENERAL_INTEGER);
+ GENERAL_WEATHERDATA.setWindGust(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setWindSpeed(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setNearestStormBearing(GENERAL_INTEGER);
+ GENERAL_WEATHERDATA.setNearestStormDistance(GENERAL_INTEGER);
+ GENERAL_WEATHERDATA.setPrecipAccumulation(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setPrecipIntensity(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setPrecipProbability(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setPrecipType(GENERAL_STRING);
+ GENERAL_WEATHERDATA.setVisibility(GENERAL_FLOAT);
+ GENERAL_WEATHERDATA.setWeatherIcon(GENERAL_IMAGE);
+
+ GENERAL_WEATHERALERT.setTitle(GENERAL_STRING);
+ GENERAL_WEATHERALERT.setSummary(GENERAL_STRING);
+ GENERAL_WEATHERALERT.setExpires(GENERAL_DATETIME);
+ GENERAL_WEATHERALERT.setRegions(GENERAL_STRING_LIST);
+ GENERAL_WEATHERALERT.setSeverity(GENERAL_STRING);
+ GENERAL_WEATHERALERT.setTimeIssued(GENERAL_DATETIME);
+
+ GENERAL_WEATHERSERVICEDATA.setLocation(GENERAL_LOCATIONDETAILS);
+ GENERAL_WEATHERSERVICEDATA.setCurrentForecast(GENERAL_WEATHERDATA);
+ GENERAL_WEATHERSERVICEDATA.setMinuteForecast(GENERAL_WEATHERDATA_LIST);
+ GENERAL_WEATHERSERVICEDATA.setHourlyForecast(GENERAL_WEATHERDATA_LIST);
+ GENERAL_WEATHERSERVICEDATA.setMultidayForecast(GENERAL_WEATHERDATA_LIST);
+ GENERAL_WEATHERSERVICEDATA.setAlerts(GENERAL_WEATHERALERT_LIST);
+
+ GENERAL_MEDIASERVICEDATA.setMediaType(GENERAL_MEDIATYPE);
+ GENERAL_MEDIASERVICEDATA.setMediaTitle(GENERAL_STRING);
+ GENERAL_MEDIASERVICEDATA.setMediaArtist(GENERAL_STRING);
+ GENERAL_MEDIASERVICEDATA.setMediaAlbum(GENERAL_STRING);
+ GENERAL_MEDIASERVICEDATA.setPlaylistName(GENERAL_STRING);
+ GENERAL_MEDIASERVICEDATA.setIsExplicit(GENERAL_BOOLEAN);
+ GENERAL_MEDIASERVICEDATA.setTrackPlaybackProgress(GENERAL_INTEGER);
+ GENERAL_MEDIASERVICEDATA.setTrackPlaybackDuration(GENERAL_INTEGER);
+ GENERAL_MEDIASERVICEDATA.setQueuePlaybackProgress(GENERAL_INTEGER);
+ GENERAL_MEDIASERVICEDATA.setQueuePlaybackDuration(GENERAL_INTEGER);
+ GENERAL_MEDIASERVICEDATA.setQueueCurrentTrackNumber(GENERAL_INTEGER);
+ GENERAL_MEDIASERVICEDATA.setQueueTotalTrackCount(GENERAL_INTEGER);
+
+ GENERAL_APPSERVICEDATA.setServiceType(GENERAL_STRING);
+ GENERAL_APPSERVICEDATA.setServiceID(GENERAL_STRING);
+ GENERAL_APPSERVICEDATA.setWeatherServiceData(GENERAL_WEATHERSERVICEDATA);
+ GENERAL_APPSERVICEDATA.setMediaServiceData(GENERAL_MEDIASERVICEDATA);
+
+ GENERAL_NAVIGATION_INSTRUCTION.setLocationDetails(GENERAL_LOCATIONDETAILS);
+ GENERAL_NAVIGATION_INSTRUCTION.setAction(GENERAL_NAVIGATIONACTION);
+ GENERAL_NAVIGATION_INSTRUCTION.setEta(GENERAL_DATETIME);
+ GENERAL_NAVIGATION_INSTRUCTION.setBearing(GENERAL_INTEGER);
+ GENERAL_NAVIGATION_INSTRUCTION.setJunctionType(GENERAL_NAVIGATION_JUNCTION);
+ GENERAL_NAVIGATION_INSTRUCTION.setDrivingSide(GENERAL_DIRECTION);
+ GENERAL_NAVIGATION_INSTRUCTION.setDetails(GENERAL_STRING);
+ GENERAL_NAVIGATION_INSTRUCTION.setImage(GENERAL_IMAGE);
+
+
+ try {
+ JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, GENERAL_HMILEVEL_LIST);
+ JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_USER_DISALLOWED, GENERAL_HMILEVEL_LIST);
+
+ JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, GENERAL_AUDIOTYPE);
+ JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, GENERAL_BITSPERSAMPLE);
+ JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, GENERAL_SAMPLINGRATE);
+
+ JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE, GENERAL_BOOLEAN);
+ JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, GENERAL_BOOLEAN);
+ JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, GENERAL_BOOLEAN);
+
+ JSON_IMAGERESOLUTION.put(ImageResolution.KEY_RESOLUTION_HEIGHT, GENERAL_INT);
+ JSON_IMAGERESOLUTION.put(ImageResolution.KEY_RESOLUTION_WIDTH, GENERAL_INT);
+
+ JSON_CHOICE.put(Choice.KEY_MENU_NAME, GENERAL_STRING);
+ JSON_CHOICE.put(Choice.KEY_SECONDARY_TEXT, GENERAL_STRING);
+ JSON_CHOICE.put(Choice.KEY_TERTIARY_TEXT, GENERAL_STRING);
+ JSON_CHOICE.put(Choice.KEY_CHOICE_ID, GENERAL_INT);
+ JSON_CHOICE.put(Choice.KEY_IMAGE, JSON_IMAGE);
+ JSON_CHOICE.put(Choice.KEY_SECONDARY_IMAGE, JSON_IMAGE);
+ JSON_CHOICE.put(Choice.KEY_VR_COMMANDS, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
+
+ JSON_HMILEVELS.put(HMILevel.HMI_FULL);
+ JSON_HMILEVELS.put(HMILevel.HMI_BACKGROUND);
+
+ JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, JSON_HMILEVELS);
+ JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_USER_DISALLOWED, JSON_HMILEVELS);
+
+ JSON_PARAMETERPERMISSIONS.put(ParameterPermissions.KEY_ALLOWED, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
+ JSON_PARAMETERPERMISSIONS.put(ParameterPermissions.KEY_USER_DISALLOWED, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
+
+ JSON_PERMISSIONITEM.put(PermissionItem.KEY_HMI_PERMISSIONS, JSON_HMIPERMISSIONS);
+ JSON_PERMISSIONITEM.put(PermissionItem.KEY_PARAMETER_PERMISSIONS, JSON_PARAMETERPERMISSIONS);
+ JSON_PERMISSIONITEM.put(PermissionItem.KEY_RPC_NAME, GENERAL_STRING);
+ JSON_PERMISSIONITEMS.put(JSON_PERMISSIONITEM);
+
+ JSON_IMAGE.put(Image.KEY_IMAGE_TYPE, GENERAL_IMAGETYPE);
+ JSON_IMAGE.put(Image.KEY_VALUE, GENERAL_STRING);
+ JSON_IMAGE.put(Image.KEY_IS_TEMPLATE, GENERAL_BOOLEAN);
+
+ JSON_SOFTBUTTON.put(SoftButton.KEY_IS_HIGHLIGHTED , GENERAL_BOOLEAN);
+ JSON_SOFTBUTTON.put(SoftButton.KEY_SOFT_BUTTON_ID, GENERAL_INT);
+ JSON_SOFTBUTTON.put(SoftButton.KEY_SYSTEM_ACTION, SystemAction.STEAL_FOCUS);
+ JSON_SOFTBUTTON.put(SoftButton.KEY_TEXT, GENERAL_STRING);
+ JSON_SOFTBUTTON.put(SoftButton.KEY_TYPE, SoftButtonType.SBT_TEXT);
+ JSON_SOFTBUTTON.put(SoftButton.KEY_IMAGE, GENERAL_IMAGE.serializeJSON());
+ JSON_SOFTBUTTONS.put(JSON_SOFTBUTTON);
+
+ JSON_TURN.put(Turn.KEY_NAVIGATION_TEXT, GENERAL_STRING);
+ JSON_TURN.put(Turn.KEY_TURN_IMAGE, GENERAL_IMAGE.serializeJSON());
+ JSON_TURNS.put(JSON_TURN);
+
+ JSON_MENUPARAMS.put(MenuParams.KEY_MENU_NAME, GENERAL_STRING);
+ JSON_MENUPARAMS.put(MenuParams.KEY_PARENT_ID, GENERAL_INT);
+ JSON_MENUPARAMS.put(MenuParams.KEY_POSITION, GENERAL_INT);
+
+ JSON_VRHELPITEM.put(VrHelpItem.KEY_TEXT, GENERAL_STRING);
+ JSON_VRHELPITEM.put(VrHelpItem.KEY_IMAGE, JSON_IMAGE);
+ JSON_VRHELPITEM.put(VrHelpItem.KEY_POSITION, GENERAL_INT);
+ JSON_VRHELPITEMS.put(JSON_VRHELPITEM);
+
+ JSONObject jsonTtsChunk = new JSONObject();
+ jsonTtsChunk.put(TTSChunk.KEY_TEXT, "Welcome to the jungle");
+ jsonTtsChunk.put(TTSChunk.KEY_TYPE, SpeechCapabilities.TEXT);
+ JSON_TTSCHUNKS.put(jsonTtsChunk);
+ jsonTtsChunk = new JSONObject();
+ jsonTtsChunk.put(TTSChunk.KEY_TEXT, "Say a command");
+ jsonTtsChunk.put(TTSChunk.KEY_TYPE, SpeechCapabilities.TEXT);
+ JSON_TTSCHUNKS.put(jsonTtsChunk);
+
+ JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_AUTO_COMPLETE_TEXT, GENERAL_STRING);
+ JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_KEYPRESS_MODE, KeypressMode.SINGLE_KEYPRESS);
+ JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_KEYBOARD_LAYOUT, KeyboardLayout.QWERTY);
+ JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_LANGUAGE, Language.EN_US);
+ JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
+
+ JSON_STARTTIME.put(StartTime.KEY_HOURS, GENERAL_STARTTIME.getHours());
+ JSON_STARTTIME.put(StartTime.KEY_MINUTES, GENERAL_STARTTIME.getMinutes());
+ JSON_STARTTIME.put(StartTime.KEY_SECONDS, GENERAL_STARTTIME.getSeconds());
+
+ JSON_CHOICES.put(JSON_CHOICE);
+
+ JSON_DEVICEINFO.put(DeviceInfo.KEY_CARRIER, GENERAL_STRING);
+ JSON_DEVICEINFO.put(DeviceInfo.KEY_FIRMWARE_REV, GENERAL_STRING);
+ JSON_DEVICEINFO.put(DeviceInfo.KEY_HARDWARE, GENERAL_STRING);
+ JSON_DEVICEINFO.put(DeviceInfo.KEY_MAX_NUMBER_RFCOMM_PORTS, GENERAL_INT);
+ JSON_DEVICEINFO.put(DeviceInfo.KEY_OS, GENERAL_STRING);
+ JSON_DEVICEINFO.put(DeviceInfo.KEY_OS_VERSION, GENERAL_STRING);
+
+ JSON_RGBCOLOR.put(RGBColor.KEY_RED, GENERAL_INT);
+ JSON_RGBCOLOR.put(RGBColor.KEY_GREEN, GENERAL_INT);
+ JSON_RGBCOLOR.put(RGBColor.KEY_BLUE, GENERAL_INT);
+
+ JSON_DAYCOLORSCHEME.put(TemplateColorScheme.KEY_PRIMARY_COLOR, JSON_RGBCOLOR);
+ JSON_DAYCOLORSCHEME.put(TemplateColorScheme.KEY_SECONDARY_COLOR, JSON_RGBCOLOR);
+ JSON_DAYCOLORSCHEME.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, JSON_RGBCOLOR);
+
+ JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_PRIMARY_COLOR, JSON_RGBCOLOR);
+ JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_SECONDARY_COLOR, JSON_RGBCOLOR);
+ JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, JSON_RGBCOLOR);
+
+ JSON_SDLMSGVERSION.put(SdlMsgVersion.KEY_MAJOR_VERSION, GENERAL_INT);
+ JSON_SDLMSGVERSION.put(SdlMsgVersion.KEY_MINOR_VERSION, GENERAL_INT);
+
+ JSON_DIDRESULT.put(DIDResult.KEY_DATA, GENERAL_STRING);
+ JSON_DIDRESULT.put(DIDResult.KEY_DID_LOCATION, GENERAL_INT);
+ JSON_DIDRESULT.put(DIDResult.KEY_RESULT_CODE, VehicleDataResultCode.SUCCESS);
+ JSON_DIDRESULTS.put(JSON_DIDRESULT);
+
+ JSON_PRESETBANKCAPABILITIES.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE, GENERAL_BOOLEAN);
+
+ JSONObject jsonButton = new JSONObject();
+ jsonButton.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, false);
+ jsonButton.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, GENERAL_BOOLEAN);
+ jsonButton.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE, GENERAL_BOOLEAN);
+ jsonButton.put(ButtonCapabilities.KEY_NAME, ButtonName.SEEKRIGHT);
+ JSON_BUTTONCAPABILITIES.put(jsonButton);
+
+ JSONObject jsonRadioControlCapabilities = new JSONObject();
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_MODULE_NAME, GENERAL_STRING);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_RADIO_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_RADIO_BAND_AVAILABLE, GENERAL_BOOLEAN);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_RADIO_FREQUENCY_AVAILABLE, GENERAL_BOOLEAN);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_HD_CHANNEL_AVAILABLE, GENERAL_BOOLEAN);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_RDS_DATA_AVAILABLE, GENERAL_BOOLEAN);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_AVAILABLE_HDS_AVAILABLE, GENERAL_BOOLEAN);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_STATE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_SIGNAL_STRENGTH_AVAILABLE, GENERAL_BOOLEAN);
+ jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, GENERAL_BOOLEAN);
+ JSON_RADIOCONTROLCAPABILITIES.put(jsonRadioControlCapabilities);
+
+ JSONObject jsonClimateControlCapabilities = new JSONObject();
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_MODULE_NAME, GENERAL_STRING);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_FAN_SPEED_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_DESIRED_TEMPERATURE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_AC_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_AC_MAX_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_CIRCULATE_AIR_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_AUTO_MODE_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_DUAL_MODE_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_DEFROST_ZONE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_DEFROST_ZONE, GENERAL_DEFROSTZONE_LIST);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_VENTILATION_MODE_AVAILABLE, GENERAL_BOOLEAN);
+ jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_VENTILATION_MODE, GENERAL_VENTILATIONMODE_LIST);
+ JSON_CLIMATECONTROLCAPABILITIES.put(jsonClimateControlCapabilities);
+
+ jsonButton = new JSONObject();
+ jsonButton.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, GENERAL_BOOLEAN);
+ jsonButton.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, GENERAL_BOOLEAN);
+ jsonButton.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE, GENERAL_BOOLEAN);
+ jsonButton.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED, GENERAL_BOOLEAN);
+ JSON_SOFTBUTTONCAPABILITIES.put(jsonButton);
+
+ jsonButton = new JSONObject();
+ jsonButton.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, GENERAL_AUDIOTYPE);
+ jsonButton.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, GENERAL_BITSPERSAMPLE);
+ jsonButton.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, GENERAL_SAMPLINGRATE);
+ JSON_AUDIOPASSTHRUCAPABILITIES.put(jsonButton);
+
+ JSON_TEXTFIELD.put(TextField.KEY_CHARACTER_SET, CharacterSet.CID1SET);
+ JSON_TEXTFIELD.put(TextField.KEY_NAME, TextFieldName.ETA);
+ JSON_TEXTFIELD.put(TextField.KEY_ROWS, GENERAL_INT);
+ JSON_TEXTFIELD.put(TextField.KEY_WIDTH, GENERAL_INT);
+ JSON_TEXTFIELDS.put(JSON_TEXTFIELD);
+
+ JSON_IMAGEFIELD.put(ImageField.KEY_IMAGE_RESOLUTION, JSON_IMAGERESOLUTION);
+ JSON_IMAGEFIELD.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED, JsonUtils.createJsonArray(Test.GENERAL_FILETYPE_LIST));
+ JSON_IMAGEFIELD.put(ImageField.KEY_NAME, ImageFieldName.graphic);
+ JSON_IMAGEFIELDS.put(JSON_IMAGEFIELD);
+
+ JSONObject jsonTEC = new JSONObject();
+ jsonTEC.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE, GENERAL_BOOLEAN);
+ jsonTEC.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, GENERAL_BOOLEAN);
+ jsonTEC.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, GENERAL_BOOLEAN);
+
+ JSON_SCREENPARAMS.put(ScreenParams.KEY_RESOLUTION, JSON_IMAGERESOLUTION);
+ JSON_SCREENPARAMS.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE, jsonTEC);
+
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_DISPLAY_TYPE, GENERAL_DISPLAYTYPE);
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_DISPLAY_NAME, GENERAL_STRING);
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED, GENERAL_BOOLEAN);
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_IMAGE_FIELDS, JSON_IMAGEFIELDS);
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS, JsonUtils.createJsonArray(GENERAL_MEDIACLOCKFORMAT_LIST));
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_NUM_CUSTOM_PRESETS_AVAILABLE, GENERAL_INT);
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_SCREEN_PARAMS, JSON_SCREENPARAMS);
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
+ JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_TEXT_FIELDS, JSON_TEXTFIELDS);
+
+ JSON_TOUCHCOORD.put(TouchCoord.KEY_X, GENERAL_INT);
+ JSON_TOUCHCOORD.put(TouchCoord.KEY_Y, GENERAL_INT);
+ JSON_TOUCHCOORDS.put(JSON_TOUCHCOORD);
+
+ JSON_TOUCHEVENT.put(TouchEvent.KEY_C, JSON_TOUCHCOORDS);
+ JSON_TOUCHEVENT.put(TouchEvent.KEY_ID, GENERAL_INT);
+ JSON_TOUCHEVENT.put(TouchEvent.KEY_TS, JsonUtils.createJsonArray(GENERAL_LONG_LIST));
+ JSON_TOUCHEVENTS.put(JSON_TOUCHEVENT);
+
+ JSON_TEXTFIELDTYPES.put(MetadataType.CURRENT_TEMPERATURE);
+ JSON_TEXTFIELDTYPES.put(MetadataType.MEDIA_ALBUM);
+ JSON_TEXTFIELDTYPES.put(MetadataType.MEDIA_ARTIST);
+
+ } catch (JSONException e) {
+ Log.e("Test", "Static Json Construction Failed.", e);
+ }
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java
new file mode 100644
index 000000000..5172e4053
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java
@@ -0,0 +1,3585 @@
+package com.smartdevicelink.test;
+
+import com.smartdevicelink.managers.file.filetypes.SdlFile;
+import com.smartdevicelink.protocol.enums.FrameData;
+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.AppServiceCapability;
+import com.smartdevicelink.proxy.rpc.AppServiceManifest;
+import com.smartdevicelink.proxy.rpc.AppServiceRecord;
+import com.smartdevicelink.proxy.rpc.AppServicesCapabilities;
+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;
+import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.Choice;
+import com.smartdevicelink.proxy.rpc.ClimateControlCapabilities;
+import com.smartdevicelink.proxy.rpc.ClimateControlData;
+import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
+import com.smartdevicelink.proxy.rpc.Coordinate;
+import com.smartdevicelink.proxy.rpc.DIDResult;
+import com.smartdevicelink.proxy.rpc.DateTime;
+import com.smartdevicelink.proxy.rpc.DeviceInfo;
+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.LocationDetails;
+import com.smartdevicelink.proxy.rpc.MassageCushionFirmness;
+import com.smartdevicelink.proxy.rpc.MassageModeData;
+import com.smartdevicelink.proxy.rpc.MediaServiceData;
+import com.smartdevicelink.proxy.rpc.MediaServiceManifest;
+import com.smartdevicelink.proxy.rpc.MenuParams;
+import com.smartdevicelink.proxy.rpc.ModuleData;
+import com.smartdevicelink.proxy.rpc.MyKey;
+import com.smartdevicelink.proxy.rpc.NavigationCapability;
+import com.smartdevicelink.proxy.rpc.NavigationInstruction;
+import com.smartdevicelink.proxy.rpc.NavigationServiceData;
+import com.smartdevicelink.proxy.rpc.NavigationServiceManifest;
+import com.smartdevicelink.proxy.rpc.OasisAddress;
+import com.smartdevicelink.proxy.rpc.ParameterPermissions;
+import com.smartdevicelink.proxy.rpc.PermissionItem;
+import com.smartdevicelink.proxy.rpc.PhoneCapability;
+import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
+import com.smartdevicelink.proxy.rpc.RGBColor;
+import com.smartdevicelink.proxy.rpc.RadioControlCapabilities;
+import com.smartdevicelink.proxy.rpc.RadioControlData;
+import com.smartdevicelink.proxy.rpc.RdsData;
+import com.smartdevicelink.proxy.rpc.Rectangle;
+import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities;
+import com.smartdevicelink.proxy.rpc.ScreenParams;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+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;
+import com.smartdevicelink.proxy.rpc.TextField;
+import com.smartdevicelink.proxy.rpc.TireStatus;
+import com.smartdevicelink.proxy.rpc.TouchCoord;
+import com.smartdevicelink.proxy.rpc.TouchEvent;
+import com.smartdevicelink.proxy.rpc.TouchEventCapabilities;
+import com.smartdevicelink.proxy.rpc.Turn;
+import com.smartdevicelink.proxy.rpc.VehicleDataResult;
+import com.smartdevicelink.proxy.rpc.VehicleType;
+import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.VrHelpItem;
+import com.smartdevicelink.proxy.rpc.WeatherAlert;
+import com.smartdevicelink.proxy.rpc.WeatherData;
+import com.smartdevicelink.proxy.rpc.WeatherServiceData;
+import com.smartdevicelink.proxy.rpc.WeatherServiceManifest;
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+import com.smartdevicelink.proxy.rpc.enums.DefrostZone;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.VentilationMode;
+
+import java.util.Iterator;
+import java.util.List;
+
+public class Validator{
+
+ // TODO: This class could be (mostly) eliminated if all RPC classes implement their own .equals() and .hashCode() methods.
+ // Some special methods do exist for pseudo-enums (FrameType, SessionType, FrameData, FrameDataControlFrame)
+
+ private Validator(){}
+
+ public static boolean validateMenuParams(MenuParams menuParams1, MenuParams menuParams2){
+ if(menuParams1 == null){
+ return ( menuParams2 == null );
+ }
+ if(menuParams2 == null){
+ return ( menuParams1 == null );
+ }
+
+ return ( menuParams1.getMenuName().equals(menuParams2.getMenuName())
+ && menuParams1.getParentID() == menuParams2.getParentID() && menuParams1.getPosition() == menuParams2
+ .getPosition() );
+ }
+
+ public static boolean validateVehicleDataResult(VehicleDataResult result1, VehicleDataResult result2){
+ if(result1 == null){
+ return ( result2 == null );
+ }
+ if(result2 == null){
+ return ( result1 == null );
+ }
+
+ return ( result1.getDataType().equals(result2.getDataType())
+ && result1.getResultCode().equals(result2.getResultCode()) );
+ }
+
+ public static boolean validateBulkData(byte[] array1, byte[] array2){
+ if(array1 == null){
+ return ( array2 == null );
+ }
+ if(array2 == null){
+ return ( array1 == null );
+ }
+
+ if(array1.length != array2.length){
+ return false;
+ }
+
+ for(int i = 0; i < array1.length; i++){
+ if(array1[i] != array2[i]){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateFrameTypeArray (FrameType[] array1, FrameType[] array2) {
+
+ if (array1 == null) {
+ return (array2 == null);
+ }
+
+ if (array2 == null) {
+ return (array1 == null);
+ }
+
+ if (array1.length != array2.length) {
+ return false;
+ }
+
+ for (int i = 0; i < array1.length; i++) {
+ if (array1[i] != array2[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateSessionTypeArray (SessionType[] array1, SessionType[] array2) {
+
+ if (array1 == null) {
+ return (array2 == null);
+ }
+
+ if (array2 == null) {
+ return (array1 == null);
+ }
+
+ if (array1.length != array2.length) {
+ return false;
+ }
+
+ for (int i = 0; i < array1.length; i++) {
+ if (array1[i] != array2[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateFrameDataControlFrameTypeArray (FrameDataControlFrameType[] array1, FrameDataControlFrameType[] array2) {
+
+ if (array1 == null) {
+ return (array2 == null);
+ }
+
+ if (array2 == null) {
+ return (array1 == null);
+ }
+
+ if (array1.length != array2.length) {
+ return false;
+ }
+
+ for (int i = 0; i < array1.length; i++) {
+ if (array1[i] != array2[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateFrameDataArray (FrameData[] array1, FrameData[] array2) {
+ if (array1 == null) {
+ return (array2 == null);
+ }
+
+ if (array2 == null) {
+ return (array1 == null);
+ }
+
+ if (array1.length != array2.length) {
+ return false;
+ }
+
+ for (int i = 0; i < array1.length; i++) {
+ if (array1[i] != array2[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateImage(Image image1, Image image2){
+ if(image1 == null){
+ return ( image2 == null );
+ }
+ if(image2 == null){
+ return ( image1 == null );
+ }
+
+ if(!( image1.getValue().equals(image2.getValue()) )){
+ log("validateImage",
+ "image1 name \"" + image1.getValue() + "\" didn't match image2 name \"" + image2.getValue() + "\".");
+ return false;
+ }
+
+ if(image1.getImageType() != image2.getImageType()){
+ log("validateImage",
+ "image1 type \"" + image1.getImageType() + "\" didn't match image2 type \"" + image2.getImageType()
+ + "\".");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateSdlFile(SdlFile sdlFile1, SdlFile sdlFile2){
+ if(sdlFile1 == null){
+ return ( sdlFile2 == null );
+ }
+ if(sdlFile2 == null){
+ return ( sdlFile1 == null );
+ }
+
+ if(!( sdlFile1.getName().equals(sdlFile2.getName()) )){
+ log("validateSdlFile",
+ "sdlFile1 name \"" + sdlFile1.getName() + "\" didn't match sdlFile2 name \"" + sdlFile2.getName() + "\".");
+ return false;
+ }
+
+ if(sdlFile1.getResourceId() != sdlFile2.getResourceId() ){
+ log("validateSdlFile",
+ "sdlFile1 resourceId \"" + sdlFile1.getName() + "\" didn't match sdlFile2 resourceId \"" + sdlFile2.getName() + "\".");
+ return false;
+ }
+
+ if((sdlFile1.getType()!= null && sdlFile2.getType() != null) && !( sdlFile1.getType().equals(sdlFile2.getType()) )){
+ log("validateSdlFile",
+ "sdlFile1 type \"" + sdlFile1.getType() + "\" didn't match sdlFile2 type \"" + sdlFile2.getType() + "\".");
+ return false;
+ }
+
+ if( (sdlFile1.getUri() != sdlFile2.getUri()) && !( sdlFile1.getUri().equals(sdlFile2.getUri()) )){
+ log("validateSdlFile",
+ "sdlFile1 uri \"" + sdlFile1.getUri() + "\" didn't match sdlFile2 uri \"" + sdlFile2.getUri() + "\".");
+ return false;
+ }
+
+
+ return true;
+ }
+
+ public static boolean validateStringList(List<String> vrCommands1, List<String> vrCommands2){
+ if(vrCommands1 == null){
+ return ( vrCommands2 == null );
+ }
+ if(vrCommands2 == null){
+ return ( vrCommands1 == null );
+ }
+
+ for(int i = 0; i < vrCommands1.size(); i++){
+ if(!vrCommands1.get(i).equals(vrCommands2.get(i))){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateIntegerList(List<Integer> intList1, List<Integer> intList2){
+ if(intList1 == null){
+ return ( intList2 == null );
+ }
+ if(intList2 == null){
+ return ( intList1 == null );
+ }
+
+ for(int i = 0; i < intList1.size(); i++){
+ if(!intList1.get(i).equals(intList2.get(i))){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateLongList(List<Long> intList1, List<Long> intList2){
+ if(intList1 == null){
+ return ( intList2 == null );
+ }
+ if(intList2 == null){
+ return ( intList1 == null );
+ }
+
+ for(int i = 0; i < intList1.size(); i++){
+ if(!intList1.get(i).equals(intList2.get(i))){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateSoftButton(SoftButton button1, SoftButton button2){
+ return validateImage(button1.getImage(), button2.getImage())
+ && validateText(button1.getText(), button2.getText())
+ && button1.getIsHighlighted() == button2.getIsHighlighted()
+ && button1.getSoftButtonID() == button2.getSoftButtonID()
+ && button1.getSystemAction() == button2.getSystemAction()
+ && button1.getType() == button2.getType();
+ }
+
+ public static boolean validateSoftButtons(List<SoftButton> list1, List<SoftButton> list2){
+ if(list1 == null){
+ return ( list2 == null );
+ }
+ if(list2 == null){
+ return ( list1 == null );
+ }
+
+ Iterator<SoftButton> iterator1 = list1.iterator();
+ Iterator<SoftButton> iterator2 = list2.iterator();
+
+ while(iterator1.hasNext() && iterator2.hasNext()){
+ SoftButton button1 = iterator1.next();
+ SoftButton button2 = iterator2.next();
+
+ if(!validateSoftButton(button1, button2)){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateCoordinate(Coordinate c1, Coordinate c2){
+ if(c1 == null){
+ return ( c2 == null );
+ }
+ if(c2 == null){
+ return ( c1 == null );
+ }
+
+ if(c1.getLatitudeDegrees() != c2.getLatitudeDegrees()){
+ return false;
+ }
+
+ if(c1.getLongitudeDegrees() != c2.getLongitudeDegrees()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateRectangle(Rectangle c1, Rectangle c2){
+ if(c1 == null){
+ return ( c2 == null );
+ }
+ if(c2 == null){
+ return ( c1 == null );
+ }
+
+ if(c1.getX() != c2.getX()){
+ return false;
+ }
+
+ if(c1.getY() != c2.getY()){
+ return false;
+ }
+
+ if(c1.getWidth() != c2.getWidth()){
+ return false;
+ }
+
+ if(c1.getHeight() != c2.getHeight()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateOasisAddress(OasisAddress a1, OasisAddress a2){
+ if(a1 == null){
+ return ( a2 == null );
+ }
+ if(a2 == null){
+ return ( a1 == null );
+ }
+
+ if(!a1.getAdministrativeArea().equals(a2.getAdministrativeArea())){
+ return false;
+ }
+
+ if(!a1.getCountryCode().equals(a2.getCountryCode())){
+ return false;
+ }
+
+ if(!a1.getCountryName().equals(a2.getCountryName())){
+ return false;
+ }
+
+ if(!a1.getLocality().equals(a2.getLocality())){
+ return false;
+ }
+
+ if(!a1.getSubLocality().equals(a2.getSubLocality())){
+ return false;
+ }
+
+ if(!a1.getSubAdministrativeArea().equals(a2.getSubAdministrativeArea())){
+ return false;
+ }
+
+ if(!a1.getPostalCode().equals(a2.getPostalCode())){
+ return false;
+ }
+
+ if(!a1.getThoroughfare().equals(a2.getThoroughfare())){
+ return false;
+ }
+
+ if(!a1.getSubThoroughfare().equals(a2.getSubThoroughfare())){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateTtsChunks(List<TTSChunk> list1, List<TTSChunk> list2){
+ if(list1 == null){
+ return ( list2 == null );
+ }
+ if(list2 == null){
+ return ( list1 == null );
+ }
+
+ Iterator<TTSChunk> iterator1 = list1.iterator();
+ Iterator<TTSChunk> iterator2 = list2.iterator();
+
+ while(iterator1.hasNext() && iterator2.hasNext()){
+ TTSChunk chunk1 = iterator1.next();
+ TTSChunk chunk2 = iterator2.next();
+
+ if(!validateText(chunk1.getText(), chunk2.getText()) || chunk1.getType() != chunk2.getType()){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateAppServiceTypeList(List<AppServiceType> list1, List<AppServiceType> list2){
+ if(list1 == null){
+ return ( list2 == null );
+ }
+ if(list2 == null){
+ return ( list1 == null );
+ }
+
+ Iterator<AppServiceType> iterator1 = list1.iterator();
+ Iterator<AppServiceType> iterator2 = list2.iterator();
+
+ while(iterator1.hasNext() && iterator2.hasNext()){
+ AppServiceType chunk1 = iterator1.next();
+ AppServiceType chunk2 = iterator2.next();
+
+ if(chunk1 != chunk2){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateAppServiceCapabilities(AppServicesCapabilities params1, AppServicesCapabilities params2) {
+ if (params1 == null) {
+ return (params2 == null);
+ }
+ if (params2 == null) {
+ return (params1 == null);
+ }
+
+ if (!validateAppServiceCapabilityList(params1.getAppServices(), params2.getAppServices())){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateAppServiceCapabilityList(List<AppServiceCapability> list1, List<AppServiceCapability> list2){
+ if(list1 == null){
+ return ( list2 == null );
+ }
+ if(list2 == null){
+ return ( list1 == null );
+ }
+
+ Iterator<AppServiceCapability> iterator1 = list1.iterator();
+ Iterator<AppServiceCapability> iterator2 = list2.iterator();
+
+ while(iterator1.hasNext() && iterator2.hasNext()){
+ AppServiceCapability chunk1 = iterator1.next();
+ AppServiceCapability chunk2 = iterator2.next();
+
+ if(!validateAppServiceRecord(chunk1.getUpdatedAppServiceRecord(), chunk2.getUpdatedAppServiceRecord())){
+ return false;
+ }
+
+ if (!chunk1.getUpdateReason().equals(chunk2.getUpdateReason())){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateMediaServiceManifest(MediaServiceManifest params1, MediaServiceManifest params2){
+ if(params1 == null){
+ return ( params2 == null );
+ }
+ if(params2 == null){
+ return ( params1 == null );
+ }
+
+ return true;
+ }
+
+ public static boolean validateNavigationServiceManifest(NavigationServiceManifest params1, NavigationServiceManifest params2){
+ if(params1 == null){
+ return ( params2 == null );
+ }
+ if(params2 == null){
+ return ( params1 == null );
+ }
+
+ if (!params1.getAcceptsWayPoints().equals(params2.getAcceptsWayPoints())){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateAppServiceRecord(AppServiceRecord params1, AppServiceRecord params2) {
+ if (params1 == null) {
+ return (params2 == null);
+ }
+ if (params2 == null) {
+ return (params1 == null);
+ }
+
+ if (!params1.getServiceActive().equals(params2.getServiceActive())){
+ return false;
+ }
+
+ if (!params1.getServicePublished().equals(params2.getServicePublished())){
+ return false;
+ }
+
+ if (!params1.getServiceID().equals(params2.getServiceID())){
+ return false;
+ }
+
+ if (!validateAppServiceManifest(params1.getServiceManifest(), params2.getServiceManifest())){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateAppServiceManifest(AppServiceManifest params1, AppServiceManifest params2){
+ if(params1 == null){
+ return ( params2 == null );
+ }
+ if(params2 == null){
+ return ( params1 == null );
+ }
+
+ if (!params1.getAllowAppConsumers().equals(params2.getAllowAppConsumers())){
+ return false;
+ }
+
+ if (!validateImage(params1.getServiceIcon(), params2.getServiceIcon())){
+ return false;
+ }
+
+ if (!params1.getServiceName().equals(params2.getServiceName())){
+ return false;
+ }
+
+ if (!params1.getServiceType().equals(params2.getServiceType())){
+ return false;
+ }
+
+ if (!validateSdlMsgVersion(params1.getRpcSpecVersion(),params2.getRpcSpecVersion())){
+ return false;
+ }
+
+ if (!validateMediaServiceManifest(params1.getMediaServiceManifest(), params2.getMediaServiceManifest())) {
+ return false;
+ }
+
+ if (!validateWeatherServiceManifest(params1.getWeatherServiceManifest(), params2.getWeatherServiceManifest())){
+ return false;
+ }
+
+ if (!validateIntegerList(params1.getHandledRpcs(), params2.getHandledRpcs())){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateWeatherServiceManifest(WeatherServiceManifest params1, WeatherServiceManifest params2){
+ if(params1 == null){
+ return ( params2 == null );
+ }
+ if(params2 == null){
+ return ( params1 == null );
+ }
+
+ if (!params1.getMaxHourlyForecastAmount().equals(params2.getMaxHourlyForecastAmount())){
+ return false;
+ }
+
+ if (!params1.getMaxMinutelyForecastAmount().equals(params2.getMaxMinutelyForecastAmount())){
+ return false;
+ }
+
+ if (!params1.getMaxMultidayForecastAmount().equals(params2.getMaxMultidayForecastAmount())){
+ return false;
+ }
+
+ if (params1.getCurrentForecastSupported()!=params2.getCurrentForecastSupported()){
+ return false;
+ }
+
+ if (params1.getWeatherForLocationSupported()!=params2.getWeatherForLocationSupported()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateLocationDetails(LocationDetails params1, LocationDetails params2) {
+ if (params1 == null) {
+ return (params2 == null);
+ }
+ if (params2 == null) {
+ return (params1 == null);
+ }
+
+ if (!params1.getAddressLines().equals(params2.getAddressLines())) {
+ return false;
+ }
+
+ if (!validateCoordinate(params1.getCoordinate(), params2.getCoordinate())) {
+ return false;
+ }
+
+ if (!params1.getLocationDescription().equals(params2.getLocationDescription())) {
+ return false;
+ }
+
+ if (!params1.getPhoneNumber().equals(params2.getPhoneNumber())) {
+ return false;
+ }
+
+ if (!validateImage(params1.getLocationImage(), params2.getLocationImage())) {
+ return false;
+ }
+
+ if (!params1.getLocationName().equals(params2.getLocationName())) {
+ return false;
+ }
+
+ if (!validateOasisAddress(params1.getSearchAddress(), params2.getSearchAddress())) {
+ return false;
+ }
+ return true;
+ }
+
+ public static boolean validateChoice(Choice choice1, Choice choice2){
+ if(choice1 == null){
+ return ( choice2 == null );
+ }
+ if(choice2 == null){
+ return ( choice1 == null );
+ }
+
+ if(!( validateImage(choice1.getImage(), choice2.getImage()) )){
+ log("validateChoice", "choice1 image \"" + choice1.getImage() + "\" didn't match choice2 image \""
+ + choice2.getImage() + "\"");
+ return false;
+ }
+ if(!( validateImage(choice1.getSecondaryImage(), choice2.getSecondaryImage()) )){
+ log("validateChoice", "choice1 secondary image \"" + choice1.getSecondaryImage()
+ + "\" didn't match choice2 image \"" + choice2.getSecondaryImage() + "\"");
+ return false;
+ }
+ if(choice1.getChoiceID() != choice2.getChoiceID()){
+ log("validateChoice",
+ "choice1 ID \"" + choice1.getChoiceID() + "\" didn't match choice2 ID \"" + choice2.getChoiceID()
+ + "\"");
+ return false;
+ }
+ if(!( validateText(choice1.getMenuName(), choice2.getMenuName()) )){
+ log("validateChoice", "choice1 menu name \"" + choice1.getMenuName()
+ + "\" didn't match choice2 menu name \"" + choice2.getMenuName() + "\"");
+ return false;
+ }
+ if(!( validateText(choice1.getSecondaryText(), choice2.getSecondaryText()) )){
+ log("validateChoice", "choice1 secondary text \"" + choice1.getSecondaryText()
+ + "\" didn't match choice2 secondary text \"" + choice2.getSecondaryText() + "\"");
+ return false;
+ }
+ if(!( validateText(choice1.getTertiaryText(), choice2.getTertiaryText()) )){
+ log("validateChoice", "choice1 tertiary text \"" + choice1.getTertiaryText()
+ + "\" didn't match choice2 tertiary text \"" + choice2.getTertiaryText() + "\"");
+ return false;
+ }
+ if(!( validateStringList(choice1.getVrCommands(), choice2.getVrCommands()) )){
+ log("validateChoice", "choice1 VR commands \"" + choice1.getVrCommands()
+ + "\" didn't match choice2 VR commands \"" + choice2.getVrCommands() + "\"");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateText(String text1, String text2){
+ if(text1 == null){
+ return ( text2 == null );
+ }
+ if(text2 == null){
+ return ( text1 == null );
+ }
+
+ return text1.equals(text2);
+ }
+
+ public static boolean validateScreenParams(ScreenParams params1, ScreenParams params2){
+ if(params1 == null){
+ return ( params2 == null );
+ }
+ if(params2 == null){
+ return ( params1 == null );
+ }
+
+ if(!( validateImageResolution(params1.getImageResolution(), params2.getImageResolution()) )){
+ log("validateScreenParams", "Image resolutions didn't match!");
+ return false;
+ }
+
+ if(!( validateTouchEventCapabilities(params1.getTouchEventAvailable(), params2.getTouchEventAvailable()) )){
+ log("validateScreenParams", "Touch event capabilities didn't match!");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateImageResolution(ImageResolution image1, ImageResolution image2){
+ if(image1 == null){
+ return ( image2 == null );
+ }
+ if(image2 == null){
+ return ( image1 == null );
+ }
+
+ if((int) image1.getResolutionHeight() != (int) image2.getResolutionHeight()){
+ log("validateImageResolution",
+ "Height " + image1.getResolutionHeight() + " didn't match height " + image2.getResolutionHeight()
+ + ".");
+ return false;
+ }
+
+ if((int) image1.getResolutionWidth() != (int) image2.getResolutionWidth()){
+ log("validateImageResolution",
+ "Width " + image1.getResolutionWidth() + " didn't match width " + image2.getResolutionWidth() + ".");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateTemperature(Temperature temperature1, Temperature temperature2){
+ if(temperature1 == null){
+ return ( temperature2 == null );
+ }
+ if(temperature2 == null){
+ return ( temperature1 == null );
+ }
+
+ if((float) temperature1.getValue() != (float) temperature2.getValue()){
+ log("validateTemperature",
+ "Value " + temperature1.getValue() + " didn't match value " + temperature2.getValue()
+ + ".");
+ return false;
+ }
+
+ if(temperature1.getUnit() != temperature2.getUnit()){
+ log("validateTemperature",
+ "Unit " + temperature1.getUnit() + " didn't match unit " + temperature2.getUnit() + ".");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateRdsData(RdsData rdsData1, RdsData rdsData2){
+ if(rdsData1 == null){
+ return ( rdsData2 == null );
+ }
+ if(rdsData2 == null){
+ return ( rdsData1 == null );
+ }
+
+ if(rdsData1.getProgramService() != rdsData2.getProgramService()){
+ log("validateRdsData",
+ "Ps " + rdsData1.getProgramService() + " didn't match Ps " + rdsData2.getProgramService()
+ + ".");
+ return false;
+ }
+
+ if(rdsData1.getRadioText() != rdsData2.getRadioText()){
+ log("validateRdsData",
+ "Rt " + rdsData1.getRadioText() + " didn't match Rt " + rdsData2.getRadioText()
+ + ".");
+ return false;
+ }
+
+ if(rdsData1.getClockText() != rdsData2.getClockText()){
+ log("validateRdsData",
+ "Ct " + rdsData1.getClockText() + " didn't match Ct " + rdsData2.getClockText()
+ + ".");
+ return false;
+ }
+
+ if(rdsData1.getProgramIdentification() != rdsData2.getProgramIdentification()){
+ log("validateRdsData",
+ "Pi " + rdsData1.getProgramIdentification() + " didn't match Pi " + rdsData2.getProgramIdentification()
+ + ".");
+ return false;
+ }
+
+ if(rdsData1.getRegion() != rdsData2.getRegion()){
+ log("validateRdsData",
+ "Reg " + rdsData1.getRegion() + " didn't match Reg " + rdsData2.getRegion()
+ + ".");
+ return false;
+ }
+
+ if(rdsData1.getTrafficProgram() != rdsData2.getTrafficProgram()){
+ log("validateRdsData",
+ "Tp " + rdsData1.getTrafficProgram() + " didn't match Tp " + rdsData2.getTrafficProgram()
+ + ".");
+ return false;
+ }
+
+ if(rdsData1.getTrafficAnnouncement() != rdsData2.getTrafficAnnouncement()){
+ log("validateRdsData",
+ "Ta " + rdsData1.getTrafficAnnouncement() + " didn't match Ta " + rdsData2.getTrafficAnnouncement()
+ + ".");
+ return false;
+ }
+
+ if(rdsData1.getProgramType() != rdsData2.getProgramType()){
+ log("validateRdsData",
+ "Pty " + rdsData1.getProgramType() + " didn't match Pty " + rdsData2.getProgramType()
+ + ".");
+ return false;
+ }
+
+ 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 );
+ }
+ if(climateControlData2 == null){
+ return ( climateControlData1 == null );
+ }
+
+ if(climateControlData1.getFanSpeed() != climateControlData2.getFanSpeed()){
+ log("validateClimateControlData",
+ "FanSpeed " + climateControlData1.getFanSpeed() + " didn't match fanSpeed " + climateControlData2.getFanSpeed()
+ + ".");
+ return false;
+ }
+
+ if(!( validateTemperature(climateControlData1.getCurrentTemperature(), climateControlData2.getCurrentTemperature()) )){
+ return false;
+ }
+
+ if(!( validateTemperature(climateControlData1.getDesiredTemperature(), climateControlData2.getDesiredTemperature()) )){
+ return false;
+ }
+
+ if(climateControlData1.getAcEnable() != climateControlData2.getAcEnable()){
+ log("validateClimateControlData",
+ "AcEnable " + climateControlData1.getAcEnable() + " didn't match AcEnable " + climateControlData2.getAcEnable()
+ + ".");
+ return false;
+ }
+
+ if(climateControlData1.getCirculateAirEnable() != climateControlData2.getCirculateAirEnable()){
+ log("validateClimateControlData",
+ "CirculateAirEnable " + climateControlData1.getCirculateAirEnable() + " didn't match CirculateAirEnable " + climateControlData2.getCirculateAirEnable()
+ + ".");
+ return false;
+ }
+
+ if(climateControlData1.getAutoModeEnable() != climateControlData2.getAutoModeEnable()){
+ log("validateClimateControlData",
+ "AutoModeEnable " + climateControlData1.getAutoModeEnable() + " didn't match AutoModeEnable " + climateControlData2.getAutoModeEnable()
+ + ".");
+ return false;
+ }
+
+ if(climateControlData1.getDefrostZone() != climateControlData2.getDefrostZone()){
+ log("validateClimateControlData",
+ "DefrostZone " + climateControlData1.getDefrostZone() + " didn't match DefrostZone " + climateControlData2.getDefrostZone()
+ + ".");
+ return false;
+ }
+
+ if(climateControlData1.getDualModeEnable() != climateControlData2.getDualModeEnable()){
+ log("validateClimateControlData",
+ "DualModeEnable " + climateControlData1.getDualModeEnable() + " didn't match DualModeEnable " + climateControlData2.getDualModeEnable()
+ + ".");
+ return false;
+ }
+
+ if(climateControlData1.getAcMaxEnable() != climateControlData2.getAcMaxEnable()){
+ log("validateClimateControlData",
+ "AcMaxEnable " + climateControlData1.getAcMaxEnable() + " didn't match AcMaxEnable " + climateControlData2.getAcMaxEnable()
+ + ".");
+ return false;
+ }
+
+ if(climateControlData1.getVentilationMode() != climateControlData2.getVentilationMode()){
+ log("validateClimateControlData",
+ "VentilationMode " + climateControlData1.getVentilationMode() + " didn't match VentilationMode " + climateControlData2.getVentilationMode()
+ + ".");
+ return false;
+ }
+
+
+ return true;
+ }
+
+ public static boolean validateSeatControlData(SeatControlData seatControlData1, SeatControlData seatControlData2) {
+ if (seatControlData1 == null) {
+ return (seatControlData2 == null);
+ }
+ if (seatControlData2 == null) {
+ return (seatControlData1 == null);
+ }
+
+ if (seatControlData1.getCoolingEnabled() != seatControlData2.getCoolingEnabled()) {
+ return false;
+ }
+ if (seatControlData1.getHeatingEnabled() != seatControlData2.getHeatingEnabled()) {
+ return false;
+ }
+ if (seatControlData1.getMassageEnabled() != seatControlData2.getMassageEnabled()) {
+ return false;
+ }
+ if (seatControlData1.getBackTiltAngle() != seatControlData2.getBackTiltAngle()) {
+ return false;
+ }
+ if (seatControlData1.getBackVerticalPosition() != seatControlData2.getBackVerticalPosition()) {
+ return false;
+ }
+ if (seatControlData1.getCoolingLevel() != seatControlData2.getCoolingLevel()) {
+ return false;
+ }
+ if (seatControlData1.getFrontVerticalPosition() != seatControlData2.getFrontVerticalPosition()) {
+ return false;
+ }
+ if (seatControlData1.getHeadSupportHorizontalPosition() != seatControlData2.getHeadSupportHorizontalPosition()) {
+ return false;
+ }
+ if (seatControlData1.getHeadSupportVerticalPosition() != seatControlData2.getHeadSupportVerticalPosition()) {
+ return false;
+ }
+ if (seatControlData1.getHeatingLevel() != seatControlData2.getHeatingLevel()) {
+ return false;
+ }
+ if (seatControlData1.getHorizontalPosition() != seatControlData2.getHorizontalPosition()) {
+ return false;
+ }
+ if (seatControlData1.getId() != seatControlData2.getId()) {
+ return false;
+ }
+
+ if (!(validateSeatMemoryAction(seatControlData1.getMemory(), seatControlData2.getMemory()))) {
+ return false;
+ }
+
+ if (!(validateSeatMemoryAction(seatControlData1.getMemory(), seatControlData2.getMemory()))) {
+ return false;
+ }
+
+ 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 );
+ }
+ if(moduleData2 == null){
+ return ( moduleData1 == null );
+ }
+
+ if(moduleData1.getModuleType() != moduleData2.getModuleType()){
+ log("validateModuleData",
+ "ModuleType " + moduleData1.getModuleType() + " didn't match ModuleType " + moduleData2.getModuleType()
+ + ".");
+ return false;
+ }
+
+ if(!( validateRadioControlData(moduleData1.getRadioControlData(), moduleData2.getRadioControlData()) )){
+ return false;
+ }
+
+ if(!( validateClimateControlData(moduleData1.getClimateControlData(), moduleData2.getClimateControlData()) )){
+ return false;
+ }
+
+ 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 );
+ }
+ if(remoteControlCapabilities2 == null){
+ return ( remoteControlCapabilities1 == null );
+ }
+
+ if(!( validateButtonCapabilities(remoteControlCapabilities1.getButtonCapabilities(), remoteControlCapabilities2.getButtonCapabilities()) )){
+ return false;
+ }
+
+ if(!( validateRadioControlCapabilities(remoteControlCapabilities1.getRadioControlCapabilities(), remoteControlCapabilities2.getRadioControlCapabilities()) )){
+ return false;
+ }
+
+ if(!( validateClimateControlCapabilities(remoteControlCapabilities1.getClimateControlCapabilities(), remoteControlCapabilities2.getClimateControlCapabilities()) )){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateRadioControlData(RadioControlData radioControlData1, RadioControlData radioControlData2){
+ if(radioControlData1 == null){
+ return ( radioControlData2 == null );
+ }
+ if(radioControlData2 == null){
+ return ( radioControlData1 == null );
+ }
+
+ if(radioControlData1.getFrequencyInteger() != radioControlData2.getFrequencyInteger()){
+ log("validateRadioControlData",
+ "FrequencyInteger " + radioControlData1.getFrequencyInteger() + " didn't match FrequencyInteger " + radioControlData2.getFrequencyInteger()
+ + ".");
+ return false;
+ }
+
+ if(radioControlData1.getFrequencyFraction() != radioControlData2.getFrequencyFraction()){
+ log("validateRadioControlData",
+ "FrequencyFraction " + radioControlData1.getFrequencyFraction() + " didn't match FrequencyFraction " + radioControlData2.getFrequencyFraction()
+ + ".");
+ return false;
+ }
+
+ if(radioControlData1.getBand() != radioControlData2.getBand()){
+ log("validateRadioControlData",
+ "Band " + radioControlData1.getBand() + " didn't match Band " + radioControlData2.getBand()
+ + ".");
+ return false;
+ }
+
+ if(!( validateRdsData(radioControlData1.getRdsData(), radioControlData2.getRdsData()) )){
+ return false;
+ }
+
+ if(radioControlData1.getAvailableHDs() != radioControlData2.getAvailableHDs()){
+ log("validateRadioControlData",
+ "AvailableHDs " + radioControlData1.getAvailableHDs() + " didn't match AvailableHDs " + radioControlData2.getAvailableHDs()
+ + ".");
+ return false;
+ }
+
+ if(radioControlData1.getHdChannel() != radioControlData2.getHdChannel()){
+ log("validateRadioControlData",
+ "HdChannel " + radioControlData1.getHdChannel() + " didn't match HdChannel " + radioControlData2.getHdChannel()
+ + ".");
+ return false;
+ }
+
+ if(radioControlData1.getSignalStrength() != radioControlData2.getSignalStrength()){
+ log("validateRadioControlData",
+ "SignalStrength " + radioControlData1.getSignalStrength() + " didn't match SignalStrength " + radioControlData2.getSignalStrength()
+ + ".");
+ return false;
+ }
+
+ if(radioControlData1.getSignalChangeThreshold() != radioControlData2.getSignalChangeThreshold()){
+ log("validateRadioControlData",
+ "SignalChangeThreshold " + radioControlData1.getSignalChangeThreshold() + " didn't match SignalChangeThreshold " + radioControlData2.getSignalChangeThreshold()
+ + ".");
+ return false;
+ }
+
+ if(radioControlData1.getRadioEnable() != radioControlData2.getRadioEnable()){
+ log("validateRadioControlData",
+ "RadioEnable " + radioControlData1.getRadioEnable() + " didn't match RadioEnable " + radioControlData2.getRadioEnable()
+ + ".");
+ return false;
+ }
+
+ if(radioControlData1.getState() != radioControlData2.getState()){
+ log("validateRadioControlData",
+ "State " + radioControlData1.getState() + " didn't match State " + radioControlData2.getState()
+ + ".");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateNavigationCapability(NavigationCapability navigationCapability1, NavigationCapability navigationCapability2){
+ if(navigationCapability1 == null){
+ return ( navigationCapability2 == null );
+ }
+ if(navigationCapability2 == null){
+ return ( navigationCapability1 == null );
+ }
+
+ if(navigationCapability1.getSendLocationEnabled() != navigationCapability2.getSendLocationEnabled()){
+ log("validateNavigationCapability",
+ "SendLocationEnabled " + navigationCapability1.getSendLocationEnabled() + " didn't match SendLocationEnabled " + navigationCapability2.getSendLocationEnabled()
+ + ".");
+ return false;
+ }
+
+ if(navigationCapability1.getWayPointsEnabled() != navigationCapability2.getWayPointsEnabled()){
+ log("validateNavigationCapability",
+ "WayPointsEnabled " + navigationCapability1.getWayPointsEnabled() + " didn't match WayPointsEnabled " + navigationCapability2.getWayPointsEnabled() + ".");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validatePhoneCapability(PhoneCapability phoneCapability1, PhoneCapability phoneCapability2){
+ if(phoneCapability1 == null){
+ return ( phoneCapability2 == null );
+ }
+ if(phoneCapability2 == null){
+ return ( phoneCapability1 == null );
+ }
+
+ if(phoneCapability1.getDialNumberEnabled() != phoneCapability2.getDialNumberEnabled()){
+ log("validatePhoneCapability",
+ "DialNumberEnabled " + phoneCapability1.getDialNumberEnabled() + " didn't match DialNumberEnabled " + phoneCapability1.getDialNumberEnabled()
+ + ".");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateTouchEventCapabilities(TouchEventCapabilities item1, TouchEventCapabilities item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getPressAvailable() != item2.getPressAvailable()){
+ log("validateTouchEventCapabilities", "Press available \"" + item1.getPressAvailable()
+ + "\" didn't match press available \"" + item1.getPressAvailable() + "\".");
+ return false;
+ }
+
+ if(item1.getDoublePressAvailable() != item2.getDoublePressAvailable()){
+ log("validateTouchEventCapabilities", "Double press available \"" + item1.getDoublePressAvailable()
+ + "\" didn't match double press available \"" + item1.getDoublePressAvailable() + "\".");
+ return false;
+ }
+
+ if(item1.getMultiTouchAvailable() != item2.getMultiTouchAvailable()){
+ log("validateTouchEventCapabilities", "Multi-touch available \"" + item1.getMultiTouchAvailable()
+ + "\" didn't match multi-touch available \"" + item1.getMultiTouchAvailable() + "\".");
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateSeatMemoryAction(SeatMemoryAction item1, SeatMemoryAction item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.getAction() == null) {
+ return (item2.getAction() == null);
+ }
+
+ if (item1.getAction() != item2.getAction()) {
+ return false;
+ }
+
+ if (item1.getId() != item2.getId()) {
+ return false;
+ }
+
+ if (item1.getLabel() != item2.getLabel()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateTextFields(TextField item1, TextField item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+
+ if(item1.getCharacterSet() != item2.getCharacterSet()){
+ return false;
+ }
+ if(item1.getName() != item2.getName()){
+ return false;
+ }
+ if(item1.getRows() != item2.getRows()){
+ return false;
+ }
+ if(item1.getWidth() != item2.getWidth()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateImageFields(ImageField item1, ImageField item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+ if(! (validateFileTypes(item1.getImageTypeSupported(), item2.getImageTypeSupported()) )){
+ return false;
+ }
+ if(item1.getName() != item2.getName()){
+ return false;
+ }
+ if(!( validateImageResolution(item1.getImageResolution(), item2.getImageResolution()) )){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateFileTypes (List<FileType> item1, List<FileType> 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 (item1.get(i) != item2.get(i)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateWeatherDataList(List<WeatherData> item1Array, List<WeatherData> item2Array) {
+ if(item1Array.size() != item2Array.size()){
+ return false;
+ }
+
+ for(int i = 0; i < item1Array.size(); i++){
+ if(!validateWeatherData(item1Array.get(i), item2Array.get(i))){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static boolean validateWeatherData(WeatherData item1, WeatherData item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (!validateTemperature(item1.getCurrentTemperature(), item2.getCurrentTemperature())) {
+ return false;
+ }
+
+ if (!validateTemperature(item1.getTemperatureHigh(), item2.getTemperatureHigh())) {
+ return false;
+ }
+
+ if (!validateTemperature(item1.getTemperatureLow(), item2.getTemperatureLow())) {
+ return false;
+ }
+
+ if (!validateTemperature(item1.getApparentTemperature(), item2.getApparentTemperature())) {
+ return false;
+ }
+
+ if (!validateTemperature(item1.getApparentTemperatureHigh(), item2.getApparentTemperatureHigh())) {
+ return false;
+ }
+
+ if (!validateTemperature(item1.getApparentTemperatureLow(), item2.getApparentTemperatureLow())) {
+ return false;
+ }
+
+ if (!item1.getWeatherSummary().equals(item2.getWeatherSummary())) {
+ return false;
+ }
+
+ if (!validateDateTime(item1.getTime(), item2.getTime())) {
+ return false;
+ }
+
+ if (!item1.getHumidity().equals(item2.getHumidity())) {
+ return false;
+ }
+
+ if (!item1.getCloudCover().equals(item2.getCloudCover())) {
+ return false;
+ }
+
+ if (!item1.getMoonPhase().equals(item2.getMoonPhase())) {
+ return false;
+ }
+
+ if (!item1.getWindBearing().equals(item2.getWindBearing())) {
+ return false;
+ }
+
+ if (!item1.getWindGust().equals(item2.getWindGust())) {
+ return false;
+ }
+
+ if (!item1.getWindSpeed().equals(item2.getWindSpeed())) {
+ return false;
+ }
+
+ if (!item1.getNearestStormBearing().equals(item2.getNearestStormBearing())) {
+ return false;
+ }
+
+ if (!item1.getNearestStormDistance().equals(item2.getNearestStormDistance())) {
+ return false;
+ }
+
+ if (!item1.getPrecipAccumulation().equals(item2.getPrecipAccumulation())) {
+ return false;
+ }
+
+ if (!item1.getPrecipIntensity().equals(item2.getPrecipIntensity())) {
+ return false;
+ }
+
+ if (!item1.getPrecipProbability().equals(item2.getPrecipProbability())) {
+ return false;
+ }
+
+ if (!item1.getPrecipType().equals(item2.getPrecipType())) {
+ return false;
+ }
+
+ if (!item1.getVisibility().equals(item2.getVisibility())) {
+ return false;
+ }
+
+ if (!validateImage(item1.getWeatherIcon(), item2.getWeatherIcon())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateWeatherAlertList(List<WeatherAlert> item1Array, List<WeatherAlert> item2Array) {
+ if(item1Array.size() != item2Array.size()){
+ return false;
+ }
+
+ for(int i = 0; i < item1Array.size(); i++){
+ if(!validateWeatherAlert(item1Array.get(i), item2Array.get(i))){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static boolean validateNavigationInstructionList(List<NavigationInstruction> item1Array, List<NavigationInstruction> item2Array) {
+ if (item1Array == null && item2Array == null){
+ return true;
+ }
+
+ if (item1Array == null || item2Array == null){
+ return false;
+ }
+
+ if(item1Array.size() != item2Array.size()){
+ return false;
+ }
+
+ for(int i = 0; i < item1Array.size(); i++){
+ if(!validateNavigationInstruction(item1Array.get(i), item2Array.get(i))){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static boolean validateNavigationInstruction(NavigationInstruction item1, NavigationInstruction item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (!validateLocationDetails(item1.getLocationDetails(),item2.getLocationDetails())) {
+ return false;
+ }
+
+ if (!item1.getAction().equals(item2.getAction())) {
+ return false;
+ }
+
+ if (!validateDateTime(item1.getEta(),item2.getEta())) {
+ return false;
+ }
+
+ if (!item1.getBearing().equals(item2.getBearing())) {
+ return false;
+ }
+
+ if (!item1.getJunctionType().equals(item2.getJunctionType())) {
+ return false;
+ }
+
+ if (!item1.getDrivingSide().equals(item2.getDrivingSide())) {
+ return false;
+ }
+
+ if (!item1.getDetails().equals(item2.getDetails())) {
+ return false;
+ }
+
+ if (!validateImage(item1.getImage(),item2.getImage())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateMediaServiceData(MediaServiceData item1, MediaServiceData item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (!item1.getMediaType().equals(item2.getMediaType())) {
+ return false;
+ }
+
+ if (!item1.getMediaTitle().equals(item2.getMediaTitle())) {
+ return false;
+ }
+
+ if (!item1.getMediaArtist().equals(item2.getMediaArtist())) {
+ return false;
+ }
+
+ if (!item1.getMediaAlbum().equals(item2.getMediaAlbum())) {
+ return false;
+ }
+
+ if (!item1.getPlaylistName().equals(item2.getPlaylistName())) {
+ return false;
+ }
+
+ if (!item1.getIsExplicit().equals(item2.getIsExplicit())) {
+ return false;
+ }
+
+ if (!item1.getTrackPlaybackProgress().equals(item2.getTrackPlaybackProgress())) {
+ return false;
+ }
+
+ if (!item1.getTrackPlaybackDuration().equals(item2.getTrackPlaybackDuration())) {
+ return false;
+ }
+
+ if (!item1.getQueuePlaybackProgress().equals(item2.getQueuePlaybackProgress())) {
+ return false;
+ }
+
+ if (!item1.getQueueCurrentTrackNumber().equals(item2.getQueueCurrentTrackNumber())) {
+ return false;
+ }
+
+ if (!item1.getQueuePlaybackDuration().equals(item2.getQueuePlaybackDuration())) {
+ return false;
+ }
+
+ if (!item1.getQueueTotalTrackCount().equals(item2.getQueueTotalTrackCount())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateWeatherServiceData(WeatherServiceData item1, WeatherServiceData item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (!validateLocationDetails(item1.getLocation(), item2.getLocation())) {
+ return false;
+ }
+
+ if (!validateWeatherData(item1.getCurrentForecast(), item2.getCurrentForecast())) {
+ return false;
+ }
+
+ if (!validateWeatherDataList(item1.getHourlyForecast(), item2.getHourlyForecast())) {
+ return false;
+ }
+
+ if (!validateWeatherDataList(item1.getMinuteForecast(), item2.getMinuteForecast())) {
+ return false;
+ }
+
+ if (!validateWeatherDataList(item1.getMultidayForecast(), item2.getMultidayForecast())) {
+ return false;
+ }
+
+ if (!validateWeatherAlertList(item1.getAlerts(), item2.getAlerts())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateNavigationServiceData(NavigationServiceData item1, NavigationServiceData item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (!validateDateTime(item1.getTimeStamp(), item2.getTimeStamp())) {
+ return false;
+ }
+
+ if (!validateLocationDetails(item1.getOrigin(), item2.getOrigin())) {
+ return false;
+ }
+
+ if (!validateLocationDetails(item1.getDestination(), item2.getDestination())) {
+ return false;
+ }
+
+ if (!validateDateTime(item1.getDestinationETA(), item2.getDestinationETA())) {
+ return false;
+ }
+
+ if (!validateNavigationInstructionList(item1.getInstructions(), item2.getInstructions())) {
+ return false;
+ }
+
+ if (!validateDateTime(item1.getNextInstructionETA(), item2.getNextInstructionETA())) {
+ return false;
+ }
+
+ if (item1.getNextInstructionDistance() != null && item2.getNextInstructionDistance() != null && !item1.getNextInstructionDistance().equals(item2.getNextInstructionDistance())) {
+ return false;
+ }
+
+ if (item1.getNextInstructionDistanceScale() != null && item2.getNextInstructionDistanceScale() != null && !item1.getNextInstructionDistanceScale().equals(item2.getNextInstructionDistanceScale())) {
+ return false;
+ }
+
+ if (item1.getPrompt() != null && item1.getPrompt() != null && !item1.getPrompt().equals(item2.getPrompt())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateWeatherAlert(WeatherAlert item1, WeatherAlert item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (!validateDateTime(item1.getExpires(), item2.getExpires())) {
+ return false;
+ }
+
+ if (!validateDateTime(item1.getTimeIssued(), item2.getTimeIssued())) {
+ return false;
+ }
+
+ if (!item1.getTitle().equals(item2.getTitle())) {
+ return false;
+ }
+
+ if (!item1.getSummary().equals(item2.getSummary())) {
+ return false;
+ }
+
+ if (!item1.getSeverity().equals(item2.getSeverity())) {
+ return false;
+ }
+
+ if (!validateStringList(item1.getRegions(), item2.getRegions())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateDateTime(DateTime item1, DateTime item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if(item1.getDay() != item2.getDay()){
+ return false;
+ }
+
+ if(item1.getHour() != item2.getHour()){
+ return false;
+ }
+
+ if(item1.getMilliSecond() != item2.getMilliSecond()){
+ return false;
+ }
+
+ if(item1.getMinute() != item2.getMinute()){
+ return false;
+ }
+
+ if(item1.getMonth() != item2.getMonth()){
+ return false;
+ }
+
+ if(item1.getSecond() != item2.getSecond()){
+ return false;
+ }
+
+ if(item1.getTzHour() != item2.getTzHour()){
+ return false;
+ }
+
+ if(item1.getTzMinute() != item2.getTzMinute()){
+ return false;
+ }
+
+ if(item1.getYear() != item2.getYear()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateGpsData(GPSData item1, GPSData item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getActual() != item2.getActual()){
+ return false;
+ }
+ if(item1.getAltitude() != item2.getAltitude()){
+ return false;
+ }
+ if(item1.getCompassDirection() != item2.getCompassDirection()){
+ return false;
+ }
+ if(item1.getDimension() != item2.getDimension()){
+ return false;
+ }
+ if(item1.getHdop() != item2.getHdop()){
+ return false;
+ }
+ if(item1.getHeading() != item2.getHeading()){
+ return false;
+ }
+ if(item1.getLatitudeDegrees() != item2.getLatitudeDegrees()){
+ return false;
+ }
+ if(item1.getLongitudeDegrees() != item2.getLongitudeDegrees()){
+ return false;
+ }
+ if(item1.getPdop() != item2.getPdop()){
+ return false;
+ }
+ if(item1.getSatellites() != item2.getSatellites()){
+ return false;
+ }
+ if(item1.getSpeed() != item2.getSpeed()){
+ return false;
+ }
+ if(item1.getUtcDay() != item2.getUtcDay()){
+ return false;
+ }
+ if(item1.getUtcHours() != item2.getUtcHours()){
+ return false;
+ }
+ if(item1.getUtcMinutes() != item1.getUtcMinutes()){
+ return false;
+ }
+ if(item1.getUtcMonth() != item2.getUtcMonth()){
+ return false;
+ }
+ if(item1.getUtcSeconds() != item2.getUtcSeconds()){
+ return false;
+ }
+ if(item1.getUtcYear() != item2.getUtcYear()){
+ return false;
+ }
+ if(item1.getVdop() != item2.getVdop()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateTireStatus(TireStatus item1, TireStatus item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getPressureTellTale() != item2.getPressureTellTale()){
+ return false;
+ }
+
+ SingleTireStatus item1Status = item1.getLeftFront();
+ SingleTireStatus item2Status = item2.getLeftFront();
+ boolean isEqual = validateSingleTireStatus(item1Status, item2Status);
+ if(!isEqual) return false;
+ item1Status = item1.getRightFront();
+ item2Status = item2.getRightFront();
+ isEqual = validateSingleTireStatus(item1Status, item2Status);
+ if(!isEqual) return false;
+ item1Status = item1.getLeftRear();
+ item2Status = item2.getLeftRear();
+ isEqual = validateSingleTireStatus(item1Status, item2Status);
+ if(!isEqual) return false;
+ item1Status = item1.getRightRear();
+ item2Status = item2.getRightRear();
+ isEqual = validateSingleTireStatus(item1Status, item2Status);
+ if(!isEqual) return false;
+ item1Status = item1.getInnerLeftRear();
+ item2Status = item2.getInnerLeftRear();
+ isEqual = validateSingleTireStatus(item1Status, item2Status);
+ if(!isEqual) return false;
+ item1Status = item1.getInnerRightRear();
+ item2Status = item2.getInnerRightRear();
+ isEqual = validateSingleTireStatus(item1Status, item2Status);
+ if(!isEqual) return false;
+
+ return true;
+ }
+
+ public static boolean validateSingleTireStatus(SingleTireStatus item1, SingleTireStatus item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getStatus() != item2.getStatus()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateBeltStatus(BeltStatus item1, BeltStatus item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getLeftRearInflatableBelted() != item2.getLeftRearInflatableBelted()){
+ return false;
+ }
+ if(item1.getRightRearInflatableBelted() != item2.getRightRearInflatableBelted()){
+ return false;
+ }
+ if(item1.getPassengerChildDetected() != item2.getPassengerChildDetected()){
+ return false;
+ }
+ if(item1.getDriverBuckleBelted() != item2.getDriverBuckleBelted()){
+ return false;
+ }
+ if(item1.getPassengerBuckleBelted() != item2.getPassengerBuckleBelted()){
+ return false;
+ }
+ if(item1.getRightRow2BuckleBelted() != item2.getRightRow2BuckleBelted()){
+ return false;
+ }
+ if(item1.getMiddleRow1BuckleBelted() != item2.getMiddleRow1BuckleBelted()){
+ return false;
+ }
+ if(item1.getLeftRow2BuckleBelted() != item2.getLeftRow2BuckleBelted()){
+ return false;
+ }
+ if(item1.getMiddleRow2BuckleBelted() != item2.getMiddleRow2BuckleBelted()){
+ return false;
+ }
+ if(item1.getMiddleRow3BuckleBelted() != item2.getMiddleRow3BuckleBelted()){
+ return false;
+ }
+ if(item1.getLeftRow3BuckleBelted() != item2.getLeftRow3BuckleBelted()){
+ return false;
+ }
+ if(item1.getRightRow3BuckleBelted() != item2.getRightRow3BuckleBelted()){
+ return false;
+ }
+ if(item1.getPassengerBeltDeployed() != item2.getPassengerBeltDeployed()){
+ return false;
+ }
+ if(item1.getMiddleRow1BeltDeployed() != item2.getMiddleRow1BeltDeployed()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateBodyInformation(BodyInformation item1, BodyInformation item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getIgnitionStatus() != item2.getIgnitionStatus()){
+ return false;
+ }
+ if(item1.getIgnitionStableStatus() != item2.getIgnitionStableStatus()){
+ return false;
+ }
+ if(item1.getParkBrakeActive() != item2.getParkBrakeActive()){
+ return false;
+ }
+ if(item1.getDriverDoorAjar() != item2.getDriverDoorAjar()){
+ return false;
+ }
+ if(item1.getPassengerDoorAjar() != item2.getPassengerDoorAjar()){
+ return false;
+ }
+ if(item1.getRearLeftDoorAjar() != item2.getRearLeftDoorAjar()){
+ return false;
+ }
+ if(item1.getRearRightDoorAjar() != item2.getRearRightDoorAjar()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateDeviceStatus(DeviceStatus item1, DeviceStatus item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getBtIconOn() != item2.getBtIconOn()){
+ return false;
+ }
+ if(item1.getCallActive() != item2.getCallActive()){
+ return false;
+ }
+ if(item1.getECallEventActive() != item2.getECallEventActive()){
+ return false;
+ }
+ if(item1.getMonoAudioOutputMuted() != item2.getMonoAudioOutputMuted()){
+ return false;
+ }
+ if(item1.getPhoneRoaming() != item2.getPhoneRoaming()){
+ return false;
+ }
+ if(item1.getStereoAudioOutputMuted() != item2.getStereoAudioOutputMuted()){
+ return false;
+ }
+ if(item1.getTextMsgAvailable() != item2.getTextMsgAvailable()){
+ return false;
+ }
+ if(item1.getVoiceRecOn() != item2.getVoiceRecOn()){
+ return false;
+ }
+ if(item1.getBattLevelStatus() != item2.getBattLevelStatus()){
+ return false;
+ }
+ if(item1.getPrimaryAudioSource() != item2.getPrimaryAudioSource()){
+ return false;
+ }
+ if(item1.getSignalLevelStatus() != item2.getSignalLevelStatus()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateHeadLampStatus(HeadLampStatus item1, HeadLampStatus item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getHighBeamsOn() != item2.getHighBeamsOn()){
+ return false;
+ }
+ if(item1.getLowBeamsOn() != item2.getLowBeamsOn()){
+ return false;
+ }
+ if(item1.getAmbientLightStatus() != item2.getAmbientLightStatus()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateECallInfo(ECallInfo item1, ECallInfo item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getAuxECallNotificationStatus() != item2.getAuxECallNotificationStatus()){
+ return false;
+ }
+ if(item1.getECallConfirmationStatus() != item2.getECallConfirmationStatus()){
+ return false;
+ }
+ if(item1.getECallNotificationStatus() != item2.getECallNotificationStatus()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateAirbagStatus(AirbagStatus item1, AirbagStatus item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+ if(item1.getDriverAirbagDeployed() != item2.getDriverAirbagDeployed()){
+ return false;
+ }
+ if(item1.getDriverSideAirbagDeployed() != item2.getDriverSideAirbagDeployed()){
+ return false;
+ }
+ if(item1.getDriverCurtainAirbagDeployed() != item2.getDriverCurtainAirbagDeployed()){
+ return false;
+ }
+ if(item1.getPassengerAirbagDeployed() != item2.getPassengerAirbagDeployed()){
+ return false;
+ }
+ if(item1.getPassengerCurtainAirbagDeployed() != item2.getPassengerCurtainAirbagDeployed()){
+ return false;
+ }
+ if(item1.getDriverKneeAirbagDeployed() != item2.getDriverKneeAirbagDeployed()){
+ return false;
+ }
+ if(item1.getPassengerSideAirbagDeployed() != item2.getPassengerSideAirbagDeployed()){
+ return false;
+ }
+ if(item1.getPassengerKneeAirbagDeployed() != item2.getPassengerKneeAirbagDeployed()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateEmergencyEvent(EmergencyEvent item1, EmergencyEvent item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getEmergencyEventType() != item2.getEmergencyEventType()){
+ return false;
+ }
+ if(item1.getFuelCutoffStatus() != item2.getFuelCutoffStatus()){
+ return false;
+ }
+ if(item1.getMaximumChangeVelocity() != item2.getMaximumChangeVelocity()){
+ return false;
+ }
+ if(item1.getMultipleEvents() != item2.getMultipleEvents()){
+ return false;
+ }
+ if(item1.getRolloverEvent() != item2.getRolloverEvent()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateClusterModeStatus(ClusterModeStatus item1, ClusterModeStatus item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getPowerModeActive() != item2.getPowerModeActive()){
+ return false;
+ }
+ if(item1.getPowerModeQualificationStatus() != item2.getPowerModeQualificationStatus()){
+ return false;
+ }
+ if(item1.getPowerModeStatus() != item2.getPowerModeStatus()){
+ return false;
+ }
+ if(item1.getCarModeStatus() != item2.getCarModeStatus()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateMyKey(MyKey item1, MyKey item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getE911Override() != item2.getE911Override()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateFuelRange (List<FuelRange> item1, List<FuelRange> 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 (item1.get(i).getType() != item2.get(i).getType()) {
+ return false;
+ }
+ if (item1.get(i).getRange() != item2.get(i).getRange()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validatePermissionItem(PermissionItem item1, PermissionItem item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+ /*
+ if(item1 == item2){
+ log("validatePermissionItem", "Items are the same object. No defensive copy took place.");
+ return false;
+ }
+ */
+ if(!item1.getRpcName().equals(item2.getRpcName())){
+ return false;
+ }
+
+ if(!validateHmiPermissions(item1.getHMIPermissions(), item2.getHMIPermissions())){
+ return false;
+ }
+
+ if(!validateParameterPermissions(item1.getParameterPermissions(), item2.getParameterPermissions())){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateHmiPermissions(HMIPermissions item1, HMIPermissions item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+ /*
+ if(item1 == item2){
+ log("validateHmiPermissions", "Items are the same object. No defensive copy took place.");
+ return false;
+ }
+ */
+ if(!validateHmiLevelLists(item1.getAllowed(), item2.getAllowed())){
+ return false;
+ }
+
+ List<HMILevel> item1Array = item1.getUserDisallowed();
+ List<HMILevel> item2Array = item2.getUserDisallowed();
+
+ if(item1Array.size() != item2Array.size()){
+ return false;
+ }
+
+ for(int i = 0; i < item1Array.size(); i++){
+ if(item1Array.get(i) != item2Array.get(i)){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateHmiLevelLists(List<HMILevel> item1Array, List<HMILevel> item2Array) {
+ if(item1Array.size() != item2Array.size()){
+ return false;
+ }
+
+ for(int i = 0; i < item1Array.size(); i++){
+ if(item1Array.get(i) != item2Array.get(i)){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static boolean validateParameterPermissions(ParameterPermissions item1, ParameterPermissions item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+ /*
+ if(item1 == item2){
+ log("validateParameterPermissions", "Items are the same object. No defensive copy took place.");
+ return false;
+ }
+ */
+ if(!validateStringList(item1.getAllowed(), item2.getAllowed())){
+ return false;
+ }
+
+ if(!validateStringList(item1.getUserDisallowed(), item2.getUserDisallowed())){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateTouchEvent(TouchEvent item1, TouchEvent item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1 == item2){
+ return true;
+ }
+
+ List<TouchCoord> tc1 = item1.getC();
+ List<TouchCoord> tc2 = item2.getC();
+ List<Long> ts1 = item1.getTs();
+ List<Long> ts2 = item2.getTs();
+
+ for(int i=0; i<tc1.size(); i++){
+ if( ! validateTouchCoord(tc1.get(i), tc2.get(i)) ){
+ return false;
+ }
+ if(ts1.get(i) != ts2.get(i)){
+ return false;
+ }
+ }
+
+ if(item1.getId() != item2.getId()){
+ return false;
+ }
+
+
+ return true;
+ }
+
+ public static boolean validateTouchCoord(TouchCoord item1, TouchCoord item2){
+ if(item1 == null){
+ return ( item2 == null );
+ }
+ if(item2 == null){
+ return ( item1 == null );
+ }
+
+ if(item1.getX() != item2.getX()){
+ return false;
+ }
+ if(item1.getY() != item2.getY()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateMassageModeData(MassageModeData item1, MassageModeData item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.getMassageMode() != item2.getMassageMode()) {
+ return false;
+ }
+
+ if (item1.getMassageZone() != item2.getMassageZone()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateMassageModeDataList(List<MassageModeData> item1, List<MassageModeData> 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 (!validateMassageModeData(item1.get(i), item2.get(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateMassageCushionFirmness(MassageCushionFirmness item1, MassageCushionFirmness item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.getCushion() != item2.getCushion()) {
+ return false;
+ }
+
+ if (item1.getFirmness() != item2.getFirmness()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateMassageCushionFirmnessList(List<MassageCushionFirmness> item1, List<MassageCushionFirmness> 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 (!validateMassageCushionFirmness(item1.get(i), item2.get(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static void log(String tag, String msg){
+ Logger.log(tag, msg);
+ }
+
+ public static boolean validateSdlMsgVersion (SdlMsgVersion item1, SdlMsgVersion item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.getMajorVersion() != item2.getMajorVersion() ||
+ item1.getMinorVersion() != item2.getMinorVersion()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateDeviceInfo (DeviceInfo item1, DeviceInfo item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.getOs() != item2.getOs() ||
+ item1.getCarrier() != item2.getCarrier() ||
+ item1.getHardware() != item2.getHardware() ||
+ item1.getOsVersion() != item2.getOsVersion() ||
+ item1.getFirmwareRev() != item2.getFirmwareRev() ||
+ item1.getMaxNumberRFCOMMPorts() != item2.getMaxNumberRFCOMMPorts()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateTemplateColorScheme (TemplateColorScheme item1, TemplateColorScheme item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.getPrimaryColor().getRed() != item2.getPrimaryColor().getRed()
+ || item1.getPrimaryColor().getGreen() != item2.getPrimaryColor().getGreen()
+ || item1.getPrimaryColor().getBlue() != item2.getPrimaryColor().getBlue()
+ || item1.getSecondaryColor().getRed() != item2.getSecondaryColor().getRed()
+ || item1.getSecondaryColor().getGreen() != item2.getSecondaryColor().getGreen()
+ || item1.getSecondaryColor().getBlue() != item2.getSecondaryColor().getBlue()
+ || item1.getBackgroundColor().getRed() != item2.getBackgroundColor().getRed()
+ || item1.getBackgroundColor().getGreen() != item2.getBackgroundColor().getGreen()
+ || item1.getBackgroundColor().getBlue() != item2.getBackgroundColor().getBlue()
+
+ ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateRGBColor(RGBColor item1, RGBColor item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.getRed() != item2.getRed()
+ || item1.getGreen() != item2.getGreen()
+ || item1.getBlue() != item2.getBlue() ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateSupportedFormats (VideoStreamingFormat vsf1, VideoStreamingFormat vsf2) {
+ if(vsf1.getProtocol() != vsf2.getProtocol()){
+ return false;
+ }
+
+ if(vsf1.getCodec() != vsf2.getCodec()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateDisplayCapabilities (DisplayCapabilities item1, DisplayCapabilities item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.getDisplayType() == null) {
+ return ( item2.getDisplayType() == null );
+ }
+
+ if (item1.getDisplayType() != item2.getDisplayType()) {
+ return false;
+ }
+
+ if (!item1.getDisplayName().equals(item2.getDisplayName())) {
+ return false;
+ }
+
+ if (item1.getGraphicSupported() != item2.getGraphicSupported()) {
+ return false;
+ }
+ // Failing past here:
+ // log("GS", item1.getGraphicSupported() + " : " + item2.getGraphicSupported());
+
+ if (!validateStringList(item1.getTemplatesAvailable(),item2.getTemplatesAvailable())) {
+ log("TA", item1.getTemplatesAvailable() + " | " + item2.getTemplatesAvailable());
+ return false;
+ }
+
+ if (item1.getNumCustomPresetsAvailable() != item2.getNumCustomPresetsAvailable()) {
+ return false;
+ }
+
+ if (item1.getMediaClockFormats() == null) {
+ return ( item2.getMediaClockFormats() == null );
+ }
+
+ if (item1.getMediaClockFormats().size() != item2.getMediaClockFormats().size()) {
+ return false;
+ }
+
+ for (int i = 0; i < item1.getMediaClockFormats().size(); i++) {
+ if (item1.getMediaClockFormats().get(i) == null && item2.getMediaClockFormats().get(i) != null) {
+ return false;
+ }
+
+ if (item1.getMediaClockFormats().get(i) != item2.getMediaClockFormats().get(i)) {
+ return false;
+ }
+ }
+
+ if (item1.getTextFields() == null) {
+ return ( item2.getTextFields() == null );
+ }
+
+ if (item1.getTextFields().size() != item2.getTextFields().size()) {
+ return false;
+ }
+
+ for (int i = 0; i < item1.getTextFields().size(); i++) {
+ if (item1.getTextFields().get(i) == null && item2.getTextFields().get(i) != null) {
+ return false;
+ }
+
+ if (!validateTextFields(item1.getTextFields().get(i), item2.getTextFields().get(i))) {
+ return false;
+ }
+ }
+
+ if (item1.getImageFields() == null) {
+ return ( item2.getImageFields() == null );
+ }
+
+ if (item1.getImageFields().size() != item2.getImageFields().size()) {
+ return false;
+ }
+
+ for (int i = 0; i < item1.getImageFields().size(); i++) {
+ if (item1.getImageFields().get(i) == null && item2.getImageFields().get(i) != null) {
+ return false;
+ }
+
+ if (!validateImageFields(item1.getImageFields().get(i), item2.getImageFields().get(i))) {
+ return false;
+ }
+ }
+
+ if (!validateScreenParams(item1.getScreenParams(), item2.getScreenParams())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateButtonCapabilities (List<ButtonCapabilities> item1, List<ButtonCapabilities> 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 (item1.get(i).getName() != item2.get(i).getName()) {
+ return false;
+ }
+ if (item1.get(i).getUpDownAvailable() != item2.get(i).getUpDownAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getLongPressAvailable() != item2.get(i).getLongPressAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getShortPressAvailable() != item2.get(i).getShortPressAvailable()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateSoftButtonCapabilities (List<SoftButtonCapabilities> item1, List<SoftButtonCapabilities> 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 (item1.get(i).getImageSupported() != item2.get(i).getImageSupported()) {
+ return false;
+ }
+ if (item1.get(i).getUpDownAvailable() != item2.get(i).getUpDownAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getLongPressAvailable() != item2.get(i).getLongPressAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getShortPressAvailable() != item2.get(i).getShortPressAvailable()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateRadioControlCapabilities (List<RadioControlCapabilities> item1, List<RadioControlCapabilities> 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 (item1.get(i).getModuleName() != item2.get(i).getModuleName()) {
+ return false;
+ }
+ if (item1.get(i).getRadioEnableAvailable() != item2.get(i).getRadioEnableAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getRadioBandAvailable() != item2.get(i).getRadioBandAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getRadioFrequencyAvailable() != item2.get(i).getRadioFrequencyAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getHdChannelAvailable() != item2.get(i).getHdChannelAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getRdsDataAvailable() != item2.get(i).getRdsDataAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getAvailableHDsAvailable() != item2.get(i).getAvailableHDsAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getStateAvailable() != item2.get(i).getStateAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getSignalStrengthAvailable() != item2.get(i).getSignalStrengthAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getSignalChangeThresholdAvailable() != item2.get(i).getSignalChangeThresholdAvailable()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateClimateControlCapabilities (List<ClimateControlCapabilities> item1, List<ClimateControlCapabilities> 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 (item1.get(i).getModuleName() != item2.get(i).getModuleName()) {
+ return false;
+ }
+ if (item1.get(i).getFanSpeedAvailable() != item2.get(i).getFanSpeedAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getDesiredTemperatureAvailable() != item2.get(i).getDesiredTemperatureAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getAcEnableAvailable() != item2.get(i).getAcEnableAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getAcMaxEnableAvailable() != item2.get(i).getAcMaxEnableAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getCirculateAirEnableAvailable() != item2.get(i).getCirculateAirEnableAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getAutoModeEnableAvailable() != item2.get(i).getAutoModeEnableAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getDualModeEnableAvailable() != item2.get(i).getDualModeEnableAvailable()) {
+ return false;
+ }
+ if (item1.get(i).getDefrostZoneAvailable() != item2.get(i).getDefrostZoneAvailable()) {
+ return false;
+ }
+
+ if(! (validateDefrostZones(item1.get(i).getDefrostZone(), item2.get(i).getDefrostZone()) )){
+ return false;
+ }
+
+ if (item1.get(i).getVentilationModeAvailable() != item2.get(i).getVentilationModeAvailable()) {
+ return false;
+ }
+
+ if(! (validateVentilationModes(item1.get(i).getVentilationMode(), item2.get(i).getVentilationMode()) )){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateSeatControlCapabilities(SeatControlCapabilities item1, SeatControlCapabilities item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.getModuleName() != item2.getModuleName()) {
+ return false;
+ }
+ if (item1.getHeatingEnabledAvailable() != item2.getHeatingEnabledAvailable()) {
+ return false;
+ }
+ if (item1.getCoolingEnabledAvailable() != item2.getCoolingEnabledAvailable()) {
+ return false;
+ }
+ if (item1.getHeatingLevelAvailable() != item2.getHeatingLevelAvailable()) {
+ return false;
+ }
+ if (item1.getCoolingLevelAvailable() != item2.getCoolingLevelAvailable()) {
+ return false;
+ }
+ if (item1.getHorizontalPositionAvailable() != item2.getHorizontalPositionAvailable()) {
+ return false;
+ }
+ if (item1.getVerticalPositionAvailable() != item2.getVerticalPositionAvailable()) {
+ return false;
+ }
+ if (item1.getFrontVerticalPositionAvailable() != item2.getFrontVerticalPositionAvailable()) {
+ return false;
+ }
+ if (item1.getBackVerticalPositionAvailable() != item2.getBackVerticalPositionAvailable()) {
+ return false;
+ }
+ if (item1.getBackTiltAngleAvailable() != item2.getBackTiltAngleAvailable()) {
+ return false;
+ }
+ if (item1.getHeadSupportVerticalPositionAvailable() != item2.getHeadSupportVerticalPositionAvailable()) {
+ return false;
+ }
+ if (item1.getHeadSupportHorizontalPositionAvailable() != item2.getHeadSupportHorizontalPositionAvailable()) {
+ return false;
+ }
+ if (item1.getMassageEnabledAvailable() != item2.getMassageEnabledAvailable()) {
+ return false;
+ }
+ if (item1.getMassageModeAvailable() != item2.getMassageModeAvailable()) {
+ return false;
+ }
+ if (item1.getMassageCushionFirmnessAvailable() != item2.getMassageCushionFirmnessAvailable()) {
+ return false;
+ }
+ if (item1.getMemoryAvailable() != item2.getMemoryAvailable()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateSeatControlCapabilitiesList(List<SeatControlCapabilities> item1, List<SeatControlCapabilities> 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 (!validateSeatControlCapabilities(item1.get(i), item2.get(i))) {
+ return false;
+ }
+ }
+
+ 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.getKeepContextAvailable() != item2.getKeepContextAvailable()) {
+ 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 );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.size() != item2.size()) {
+ return false;
+ }
+
+ for (int i = 0; i < item1.size(); i++) {
+ if (item1.get(i) != item2.get(i)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateVentilationModes (List<VentilationMode> item1, List<VentilationMode> 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 (item1.get(i) != item2.get(i)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateTurnList (List<Turn> item1, List<Turn> 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 (!item1.get(i).getNavigationText().equals(item2.get(i).getNavigationText())) {
+ return false;
+ }
+ if (!validateImage(item1.get(i).getTurnIcon(), item2.get(i).getTurnIcon())) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateAudioPassThruCapabilities (List<AudioPassThruCapabilities> item1, List<AudioPassThruCapabilities> 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 (item1.get(i).getAudioType() != item2.get(i).getAudioType()) {
+ return false;
+ }
+ if (item1.get(i).getBitsPerSample() != item2.get(i).getBitsPerSample()) {
+ return false;
+ }
+ if (item1.get(i).getSamplingRate() != item2.get(i).getSamplingRate()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validatePcmStreamCapabilities (AudioPassThruCapabilities item1, AudioPassThruCapabilities item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.getAudioType() != item2.getAudioType()) {
+ return false;
+ }
+
+ if (item1.getBitsPerSample() != item2.getBitsPerSample()) {
+ return false;
+ }
+
+ if (item1.getSamplingRate() != item2.getSamplingRate()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validatePresetBankCapabilities (PresetBankCapabilities item1, PresetBankCapabilities item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.onScreenPresetsAvailable() != item2.onScreenPresetsAvailable()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateVehicleType (VehicleType item1, VehicleType item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.getMake() != item2.getMake() ||
+ item1.getModel() != item2.getModel() ||
+ item1.getTrim() != item2.getTrim() ||
+ item1.getModelYear() != item2.getModelYear()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateKeyboardProperties (KeyboardProperties item1, KeyboardProperties item2) {
+ if (item1 == null) {
+ log("1", item2.toString());
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ log("2", item1.toString());
+ return ( item1 == null );
+ }
+
+ if (!item1.getAutoCompleteText().equals(item2.getAutoCompleteText())) {
+ log("ACT", item1.getAutoCompleteText().toString() + " | " + item2.getAutoCompleteText().toString());
+ return false;
+ }
+ if (item1.getKeyboardLayout() != item2.getKeyboardLayout()) {
+ log("KL", item1.getKeyboardLayout().toString() + " | " + item2.getKeyboardLayout().toString());
+ return false;
+ }
+ if (item1.getKeypressMode() != item2.getKeypressMode()) {
+ log("KM", item1.getKeypressMode() + " | " + item2.getKeypressMode());
+ return false;
+ }
+ if (item1.getLanguage() != item2.getLanguage()) {
+ log("L", item1.getLanguage().toString() + " | " + item2.getLanguage().toString());
+ return false;
+ }
+ if (!validateStringList(item1.getLimitedCharacterList(), item2.getLimitedCharacterList())) {
+ log("List",item1.getLimitedCharacterList().toString() + " | " + item2.getLimitedCharacterList().toString());
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateStartTime (StartTime item1, StartTime item2) {
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if (item1.getHours() != item2.getHours()) {
+ return false;
+ }
+ if (item1.getMinutes() != item2.getMinutes()) {
+ return false;
+ }
+ if (item1.getSeconds() != item2.getSeconds()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateVrHelpItems (List<VrHelpItem> item1, List<VrHelpItem> 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 (!item1.get(i).getText().equals(item2.get(i).getText())) {
+ return false;
+ }
+ if (!validateImage(item1.get(i).getImage(), item2.get(i).getImage())) {
+ return false;
+ }
+ if ((int) item1.get(i).getPosition() != (int) item2.get(i).getPosition()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateDIDResults (List<DIDResult> item1, List<DIDResult> 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 (!item1.get(i).getData().equals(item2.get(i).getData())) {
+ return false;
+ }
+ if (item1.get(i).getResultCode() != item2.get(i).getResultCode()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateHeaders(Headers item1, Headers item2){
+ if (item1 == null) {
+ return ( item2 == null );
+ }
+ if (item2 == null) {
+ return ( item1 == null );
+ }
+
+ if( ! item1.getDoInput().equals(item2.getDoInput()) ){
+ return false;
+ }
+
+ if( ! item1.getDoOutput().equals(item2.getDoOutput()) ){
+ return false;
+ }
+
+ if( ! item1.getInstanceFollowRedirects().equals(item2.getInstanceFollowRedirects()) ){
+ return false;
+ }
+
+ if( ! item1.getUseCaches().equals(item2.getUseCaches()) ){
+ return false;
+ }
+
+ if( ! item1.getCharset().equals(item2.getCharset()) ){
+ return false;
+ }
+
+ if( ! item1.getConnectTimeout().equals(item2.getConnectTimeout()) ){
+ return false;
+ }
+
+ if( ! item1.getContentLength().equals(item2.getContentLength()) ){
+ return false;
+ }
+
+ if( ! item1.getContentType().equals(item2.getContentType()) ){
+ return false;
+ }
+
+ if( ! item1.getReadTimeout().equals(item2.getReadTimeout()) ){
+ return false;
+ }
+
+ if( ! item1.getRequestMethod().equals(item2.getRequestMethod()) ){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateHMICapabilities(HMICapabilities hmiA, HMICapabilities hmiB){
+ if(hmiA.isPhoneCallAvailable() != hmiB.isPhoneCallAvailable()){
+ return false;
+ }
+
+ if(hmiA.isVideoStreamingAvailable() != hmiB.isVideoStreamingAvailable()){
+ return false;
+ }
+
+ if(hmiA.isNavigationAvailable() != hmiB.isNavigationAvailable()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateHMIZoneCapabilities(List<HmiZoneCapabilities> hmizA, List<HmiZoneCapabilities> hmizB){
+ for(int i = 0; i < hmizA.size(); i++){
+ if(!hmizA.get(i).equals(hmizB.get(i))){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static boolean validateSpeechCapabilities(List<SpeechCapabilities> spA, List<SpeechCapabilities> spB){
+ for(int i = 0; i < spA.size(); i++){
+ if(!spA.get(i).equals(spB.get(i))){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static boolean validateVideoStreamingFormat(VideoStreamingFormat a, VideoStreamingFormat b){
+ if(!a.getCodec().equals(b.getCodec())){
+ return false;
+ }
+
+ if(!a.getProtocol().equals(b.getProtocol())){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateVideoStreamingCapability(VideoStreamingCapability a, VideoStreamingCapability b){
+ if(!validateImageResolution(a.getPreferredResolution(), b.getPreferredResolution())){
+ return false;
+ }
+
+ if(!a.getMaxBitrate().equals(b.getMaxBitrate())){
+ return false;
+ }
+
+ for(int i = 0; i < a.getSupportedFormats().size(); i++){
+ if(!validateVideoStreamingFormat(a.getSupportedFormats().get(i), b.getSupportedFormats().get(i))){
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java
new file mode 100644
index 000000000..c9373adfc
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java
@@ -0,0 +1,392 @@
+package com.smartdevicelink.test;
+
+import com.smartdevicelink.proxy.rpc.AirbagStatus;
+import com.smartdevicelink.proxy.rpc.BeltStatus;
+import com.smartdevicelink.proxy.rpc.BodyInformation;
+import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
+import com.smartdevicelink.proxy.rpc.DeviceStatus;
+import com.smartdevicelink.proxy.rpc.ECallInfo;
+import com.smartdevicelink.proxy.rpc.EmergencyEvent;
+import com.smartdevicelink.proxy.rpc.FuelRange;
+import com.smartdevicelink.proxy.rpc.GPSData;
+import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.HeadLampStatus;
+import com.smartdevicelink.proxy.rpc.MyKey;
+import com.smartdevicelink.proxy.rpc.OnVehicleData;
+import com.smartdevicelink.proxy.rpc.SingleTireStatus;
+import com.smartdevicelink.proxy.rpc.TireStatus;
+import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
+import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
+import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
+import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
+import com.smartdevicelink.proxy.rpc.enums.Dimension;
+import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
+import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
+import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
+import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
+import com.smartdevicelink.proxy.rpc.enums.FuelType;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
+import com.smartdevicelink.proxy.rpc.enums.PRNDL;
+import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
+import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
+import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
+import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
+import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
+import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class VehicleDataHelper{
+ //top level variables for OnVehicleData
+ public static final double SPEED = 35.6;
+ public static final int RPM = 2500;
+ public static final double EXTERNAL_TEMPERATURE = 140.1;
+ public static final double FUEL_LEVEL = 3.7;
+ public static final String VIN = "FIUE4WHR3984579THIRU";
+ public static final PRNDL PRNDL_FINAL = PRNDL.SECOND;
+ public static final TireStatus TIRE_PRESSURE = new TireStatus();
+ public static final double ENGINE_TORQUE = 518.3;
+ public static final float ENGINE_OIL_LIFE = 19.3f;
+ public static final int ODOMETER = 140000;
+ public static final GPSData GPS = new GPSData();
+ public static final ComponentVolumeStatus FUEL_LEVEL_STATE = ComponentVolumeStatus.ALERT;
+ public static final double INSTANT_FUEL_CONSUMPTION = 2.76;
+ public static final BeltStatus BELT_STATUS = new BeltStatus();
+ public static final BodyInformation BODY_INFORMATION = new BodyInformation();
+ public static final DeviceStatus DEVICE_STATUS = new DeviceStatus();
+ public static final VehicleDataEventStatus DRIVER_BRAKING = VehicleDataEventStatus.NO;
+ public static final WiperStatus WIPER_STATUS = WiperStatus.COURTESYWIPE;
+ public static final HeadLampStatus HEAD_LAMP_STATUS = new HeadLampStatus();
+ public static final double ACC_PEDAL_POSITION = 28.29;
+ public static final double STEERING_WHEEL_ANGLE = 70.5;
+ public static final ECallInfo E_CALL_INFO = new ECallInfo();
+ public static final AirbagStatus AIRBAG_STATUS = new AirbagStatus();
+ public static final EmergencyEvent EMERGENCY_EVENT = new EmergencyEvent();
+ public static final ClusterModeStatus CLUSTER_MODE_STATUS = new ClusterModeStatus();
+ public static final MyKey MY_KEY = new MyKey();
+ public static final FuelRange FUEL_RANGE = new FuelRange();
+ public static final List<FuelRange> FUEL_RANGE_LIST = new ArrayList<FuelRange>(1);
+ public static final TurnSignal TURN_SIGNAL = TurnSignal.OFF;
+ public static final ElectronicParkBrakeStatus ELECTRONIC_PARK_BRAKE_STATUS = ElectronicParkBrakeStatus.CLOSED;
+
+ //other variables inside some of the above objects
+ // tire status
+ public static final WarningLightStatus TIRE_PRESSURE_TELL_TALE = WarningLightStatus.ON;
+ public static final ComponentVolumeStatus TIRE_PRESSURE_LEFT_FRONT = ComponentVolumeStatus.NORMAL;
+ public static final ComponentVolumeStatus TIRE_PRESSURE_RIGHT_FRONT = ComponentVolumeStatus.FAULT;
+ public static final ComponentVolumeStatus TIRE_PRESSURE_LEFT_REAR = ComponentVolumeStatus.LOW;
+ public static final ComponentVolumeStatus TIRE_PRESSURE_RIGHT_REAR = ComponentVolumeStatus.NORMAL;
+ public static final ComponentVolumeStatus TIRE_PRESSURE_INNER_LEFT_REAR = ComponentVolumeStatus.LOW;
+ public static final ComponentVolumeStatus TIRE_PRESSURE_INNER_RIGHT_REAR = ComponentVolumeStatus.ALERT;
+
+ // GPS data
+ public static final Double GPS_LONGITUDE = 104.2;
+ public static final Double GPS_LATITUDE = 56.3;
+ public static final Integer GPS_YEAR = 2015;
+ public static final Integer GPS_MONTH = 7;
+ public static final Integer GPS_DAY = 14;
+ public static final Integer GPS_HOURS = 11;
+ public static final Integer GPS_MINUTES = 38;
+ public static final Integer GPS_SECONDS = 12;
+ public static final CompassDirection GPS_DIRECTION = CompassDirection.NORTHWEST;
+ public static final Double GPS_PDOP = 4.1;
+ public static final Double GPS_HDOP = 2.4;
+ public static final Double GPS_VDOP = 5.5;
+ public static final Boolean GPS_ACTUAL = true;
+ public static final Integer GPS_SATELLITES = 3;
+ public static final Dimension GPS_DIMENSION = Dimension._2D;
+ public static final Double GPS_ALTITUDE = 768.5;
+ public static final Double GPS_HEADING = 315.0;
+ public static final Double GPS_SPEED = 30.5;
+
+ // belt status
+ public static final VehicleDataEventStatus BELT_STATUS_DRIVER_DEPLOYED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus BELT_STATUS_PASSENGER_DEPLOYED = VehicleDataEventStatus.YES;
+ public static final VehicleDataEventStatus BELT_STATUS_PASSENGER_BELTED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus BELT_STATUS_DRIVER_BELTED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus BELT_STATUS_LEFT_ROW_2_BELTED = VehicleDataEventStatus.NO_EVENT;
+ public static final VehicleDataEventStatus BELT_STATUS_PASSENGER_CHILD = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus BELT_STATUS_RIGHT_ROW_2_BELTED = VehicleDataEventStatus.NO_EVENT;
+ public static final VehicleDataEventStatus BELT_STATUS_MIDDLE_ROW_2_BELTED = VehicleDataEventStatus.YES;
+ public static final VehicleDataEventStatus BELT_STATUS_MIDDLE_ROW_3_BELTED = VehicleDataEventStatus.NO_EVENT;
+ public static final VehicleDataEventStatus BELT_STATUS_LEFT_ROW_3_BELTED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus BELT_STATUS_RIGHT_ROW_3_BELTED = VehicleDataEventStatus.NO_EVENT;
+ public static final VehicleDataEventStatus BELT_STATUS_LEFT_REAR_INFLATABLE_BELTED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus BELT_STATUS_RIGHT_REAR_INFLATABLE_BELTED = VehicleDataEventStatus.NO_EVENT;
+ public static final VehicleDataEventStatus BELT_STATUS_MIDDLE_ROW_1_DEPLOYED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus BELT_STATUS_MIDDLE_ROW_1_BELTED = VehicleDataEventStatus.YES;
+
+ // body information
+ public static final Boolean BODY_INFORMATION_PARK_BRAKE = false;
+ public static final IgnitionStableStatus BODY_INFORMATION_IGNITION_STATUS = IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE;
+ public static final IgnitionStatus BODY_INFORMATION_IGNITION_STABLE_STATUS = IgnitionStatus.ACCESSORY;
+ public static final Boolean BODY_INFORMATION_DRIVER_AJAR = true;
+ public static final Boolean BODY_INFORMATION_PASSENGER_AJAR = true;
+ public static final Boolean BODY_INFORMATION_REAR_LEFT_AJAR = false;
+ public static final Boolean BODY_INFORMATION_REAR_RIGHT_AJAR = true;
+
+ // device status
+ public static final Boolean DEVICE_STATUS_VOICE_REC = true;
+ public static final Boolean DEVICE_STATUS_BT_ICON = true;
+ public static final Boolean DEVICE_STATUS_CALL_ACTIVE = true;
+ public static final Boolean DEVICE_STATUS_PHONE_ROAMING = false;
+ public static final Boolean DEVICE_STATUS_TEXT_MSG_AVAILABLE = false;
+ public static final DeviceLevelStatus DEVICE_STATUS_BATT_LEVEL_STATUS = DeviceLevelStatus.TWO_LEVEL_BARS;
+ public static final Boolean DEVICE_STATUS_STEREO_MUTED = false;
+ public static final Boolean DEVICE_STATUS_MONO_MUTED = true;
+ public static final DeviceLevelStatus DEVICE_STATUS_SIGNAL_LEVEL_STATUS = DeviceLevelStatus.ONE_LEVEL_BARS;
+ public static final PrimaryAudioSource DEVICE_STATUS_PRIMARY_AUDIO = PrimaryAudioSource.BLUETOOTH_STEREO_BTST;
+ public static final Boolean DEVICE_STATUS_E_CALL_ACTIVE = false;
+
+ // head lamp status
+ public static final AmbientLightStatus HEAD_LAMP_STATUS_AMBIENT_STATUS = AmbientLightStatus.TWILIGHT_3;
+ public static final Boolean HEAD_LAMP_HIGH_BEAMS = true;
+ public static final Boolean HEAD_LAMP_LOW_BEAMS = false;
+
+ // e call info
+ public static final VehicleDataNotificationStatus E_CALL_INFO_E_CALL_NOTIFICATION_STATUS = VehicleDataNotificationStatus.NOT_SUPPORTED;
+ public static final VehicleDataNotificationStatus E_CALL_INFO_AUX_E_CALL_NOTIFICATION_STATUS = VehicleDataNotificationStatus.NOT_USED;
+ public static final ECallConfirmationStatus E_CALL_INFO_CONFIRMATION_STATUS = ECallConfirmationStatus.ECALL_CONFIGURED_OFF;
+
+ // airbag status
+ public static final VehicleDataEventStatus AIRBAG_STATUS_DRIVER_DEPLOYED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus AIRBAG_STATUS_DRIVER_SIDE_DEPLOYED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus AIRBAG_STATUS_DRIVER_CURTAIN_DEPLOYED = VehicleDataEventStatus.YES;
+ public static final VehicleDataEventStatus AIRBAG_STATUS_PASSENGER_DEPLOYED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus AIRBAG_STATUS_PASSENGER_CURTAIN_DEPLOYED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus AIRBAG_STATUS_DRIVER_KNEE_DEPLOYED = VehicleDataEventStatus.NO;
+ public static final VehicleDataEventStatus AIRBAG_STATUS_PASSENGER_SIDE_DEPLOYED = VehicleDataEventStatus.YES;
+ public static final VehicleDataEventStatus AIRBAG_STATUS_PASSENGER_KNEE_DEPLOYED = VehicleDataEventStatus.NO;
+
+ // emergency event
+ public static final EmergencyEventType EMERGENCY_EVENT_TYPE = EmergencyEventType.FRONTAL;
+ public static final FuelCutoffStatus EMERGENCY_EVENT_FUEL_CUTOFF_STATUS = FuelCutoffStatus.TERMINATE_FUEL;
+ public static final VehicleDataEventStatus EMERGENCY_EVENT_ROLLOVER_EVENT = VehicleDataEventStatus.YES;
+ public static final Integer EMERGENCY_EVENT_MAX_CHANGE_VELOCITY = 5;
+ public static final VehicleDataEventStatus EMERGENCY_EVENT_MULTIPLE_EVENTS = VehicleDataEventStatus.NO;
+
+ // cluster mode status
+ public static final Boolean CLUSTER_MODE_STATUS_POWER_MODE_ACTIVE = true;
+ public static final PowerModeQualificationStatus CLUSTER_MODE_STATUS_POWER_MODE_QUALIFICATION_STATUS =
+ PowerModeQualificationStatus.POWER_MODE_EVALUATION_IN_PROGRESS;
+ public static final CarModeStatus CLUSTER_MODE_STATUS_CAR_MODE_STATUS = CarModeStatus.TRANSPORT;
+ public static final PowerModeStatus CLUSTER_MODE_STATUS_POWER_MODE_STATUS = PowerModeStatus.POST_ACCESORY_0;
+
+ // my key
+ public static final VehicleDataStatus MY_KEY_E_911_OVERRIDE = VehicleDataStatus.NO_DATA_EXISTS;
+
+ // fuel range
+ public static final FuelType FUEL_RANGE_TYPE = FuelType.GASOLINE;
+ public static final Float FUEL_RANGE_RANGE = Test.GENERAL_FLOAT;
+
+ public static final JSONArray JSON_FUEL_RANGE = new JSONArray();
+
+ //the OnVehicleData which stores all the information above
+ public static final OnVehicleData VEHICLE_DATA = new OnVehicleData();
+ //GetVehicleDataResponse data which stores the same things
+ public static final GetVehicleDataResponse VEHICLE_DATA_RESPONSE = new GetVehicleDataResponse();
+
+ static {
+ //TIRE_PRESSURE set up
+ TIRE_PRESSURE.setPressureTellTale(TIRE_PRESSURE_TELL_TALE);
+ SingleTireStatus tireLeftFront = new SingleTireStatus();
+ tireLeftFront.setStatus(TIRE_PRESSURE_LEFT_FRONT);
+ TIRE_PRESSURE.setLeftFront(tireLeftFront);
+ SingleTireStatus tireRightFront = new SingleTireStatus();
+ tireRightFront.setStatus(TIRE_PRESSURE_RIGHT_FRONT);
+ TIRE_PRESSURE.setRightFront(tireRightFront);
+ SingleTireStatus tireLeftRear = new SingleTireStatus();
+ tireLeftRear.setStatus(TIRE_PRESSURE_LEFT_REAR);
+ TIRE_PRESSURE.setLeftRear(tireLeftRear);
+ SingleTireStatus tireRightRear = new SingleTireStatus();
+ tireRightRear.setStatus(TIRE_PRESSURE_RIGHT_REAR);
+ TIRE_PRESSURE.setRightRear(tireRightRear);
+ SingleTireStatus tireInnerLeftRear = new SingleTireStatus();
+ tireInnerLeftRear.setStatus(TIRE_PRESSURE_INNER_LEFT_REAR);
+ TIRE_PRESSURE.setInnerLeftRear(tireInnerLeftRear);
+ SingleTireStatus tireInnerRightRear = new SingleTireStatus();
+ tireInnerRightRear.setStatus(TIRE_PRESSURE_INNER_RIGHT_REAR);
+ TIRE_PRESSURE.setInnerRightRear(tireInnerRightRear);
+
+ //GPS set up
+ GPS.setLongitudeDegrees(GPS_LONGITUDE);
+ GPS.setLatitudeDegrees(GPS_LATITUDE);
+ GPS.setUtcYear(GPS_YEAR);
+ GPS.setUtcMonth(GPS_MONTH);
+ GPS.setUtcDay(GPS_DAY);
+ GPS.setUtcHours(GPS_HOURS);
+ GPS.setUtcMinutes(GPS_MINUTES);
+ GPS.setUtcSeconds(GPS_SECONDS);
+ GPS.setCompassDirection(GPS_DIRECTION);
+ GPS.setPdop(GPS_PDOP);
+ GPS.setHdop(GPS_HDOP);
+ GPS.setVdop(GPS_VDOP);
+ GPS.setActual(GPS_ACTUAL);
+ GPS.setSatellites(GPS_SATELLITES);
+ GPS.setDimension(GPS_DIMENSION);
+ GPS.setAltitude(GPS_ALTITUDE);
+ GPS.setHeading(GPS_HEADING);
+ GPS.setSpeed(GPS_SPEED);
+
+ //BELT_STATUS set up
+ BELT_STATUS.setDriverBeltDeployed(BELT_STATUS_DRIVER_DEPLOYED);
+ BELT_STATUS.setPassengerBeltDeployed(BELT_STATUS_PASSENGER_DEPLOYED);
+ BELT_STATUS.setPassengerBuckleBelted(BELT_STATUS_PASSENGER_BELTED);
+ BELT_STATUS.setDriverBuckleBelted(BELT_STATUS_DRIVER_BELTED);
+ BELT_STATUS.setLeftRow2BuckleBelted(BELT_STATUS_LEFT_ROW_2_BELTED);
+ BELT_STATUS.setPassengerChildDetected(BELT_STATUS_PASSENGER_CHILD);
+ BELT_STATUS.setRightRow2BuckleBelted(BELT_STATUS_RIGHT_ROW_2_BELTED);
+ BELT_STATUS.setMiddleRow2BuckleBelted(BELT_STATUS_MIDDLE_ROW_2_BELTED);
+ BELT_STATUS.setMiddleRow3BuckleBelted(BELT_STATUS_MIDDLE_ROW_3_BELTED);
+ BELT_STATUS.setLeftRow3BuckleBelted(BELT_STATUS_LEFT_ROW_3_BELTED);
+ BELT_STATUS.setRightRow3BuckleBelted(BELT_STATUS_RIGHT_ROW_3_BELTED);
+ BELT_STATUS.setLeftRearInflatableBelted(BELT_STATUS_LEFT_REAR_INFLATABLE_BELTED);
+ BELT_STATUS.setRightRearInflatableBelted(BELT_STATUS_RIGHT_REAR_INFLATABLE_BELTED);
+ BELT_STATUS.setMiddleRow1BeltDeployed(BELT_STATUS_MIDDLE_ROW_1_DEPLOYED);
+ BELT_STATUS.setMiddleRow1BuckleBelted(BELT_STATUS_MIDDLE_ROW_1_BELTED);
+
+ //BODY_INFORMATION set up
+ BODY_INFORMATION.setParkBrakeActive(BODY_INFORMATION_PARK_BRAKE);
+ BODY_INFORMATION.setIgnitionStableStatus(BODY_INFORMATION_IGNITION_STATUS);
+ BODY_INFORMATION.setIgnitionStatus(BODY_INFORMATION_IGNITION_STABLE_STATUS);
+ BODY_INFORMATION.setDriverDoorAjar(BODY_INFORMATION_DRIVER_AJAR);
+ BODY_INFORMATION.setPassengerDoorAjar(BODY_INFORMATION_PASSENGER_AJAR);
+ BODY_INFORMATION.setRearLeftDoorAjar(BODY_INFORMATION_REAR_LEFT_AJAR);
+ BODY_INFORMATION.setRearRightDoorAjar(BODY_INFORMATION_REAR_RIGHT_AJAR);
+
+ //DEVICE_STATUS set up
+ DEVICE_STATUS.setVoiceRecOn(DEVICE_STATUS_VOICE_REC);
+ DEVICE_STATUS.setBtIconOn(DEVICE_STATUS_BT_ICON);
+ DEVICE_STATUS.setCallActive(DEVICE_STATUS_CALL_ACTIVE);
+ DEVICE_STATUS.setPhoneRoaming(DEVICE_STATUS_PHONE_ROAMING);
+ DEVICE_STATUS.setTextMsgAvailable(DEVICE_STATUS_TEXT_MSG_AVAILABLE);
+ DEVICE_STATUS.setBattLevelStatus(DEVICE_STATUS_BATT_LEVEL_STATUS);
+ DEVICE_STATUS.setStereoAudioOutputMuted(DEVICE_STATUS_STEREO_MUTED);
+ DEVICE_STATUS.setMonoAudioOutputMuted(DEVICE_STATUS_MONO_MUTED);
+ DEVICE_STATUS.setSignalLevelStatus(DEVICE_STATUS_SIGNAL_LEVEL_STATUS);
+ DEVICE_STATUS.setPrimaryAudioSource(DEVICE_STATUS_PRIMARY_AUDIO);
+ DEVICE_STATUS.setECallEventActive(DEVICE_STATUS_E_CALL_ACTIVE);
+
+ //HEAD_LAMP_STATUS set up
+ HEAD_LAMP_STATUS.setAmbientLightStatus(HEAD_LAMP_STATUS_AMBIENT_STATUS);
+ HEAD_LAMP_STATUS.setHighBeamsOn(HEAD_LAMP_HIGH_BEAMS);
+ HEAD_LAMP_STATUS.setLowBeamsOn(HEAD_LAMP_LOW_BEAMS);
+
+ //E_CALL_INFO set up
+ E_CALL_INFO.setECallNotificationStatus(E_CALL_INFO_E_CALL_NOTIFICATION_STATUS);
+ E_CALL_INFO.setAuxECallNotificationStatus(E_CALL_INFO_AUX_E_CALL_NOTIFICATION_STATUS);
+ E_CALL_INFO.setECallConfirmationStatus(E_CALL_INFO_CONFIRMATION_STATUS);
+
+ //AIRBAG_STATUS set up
+ AIRBAG_STATUS.setDriverAirbagDeployed(AIRBAG_STATUS_DRIVER_DEPLOYED);
+ AIRBAG_STATUS.setDriverSideAirbagDeployed(AIRBAG_STATUS_DRIVER_SIDE_DEPLOYED);
+ AIRBAG_STATUS.setDriverCurtainAirbagDeployed(AIRBAG_STATUS_DRIVER_CURTAIN_DEPLOYED);
+ AIRBAG_STATUS.setPassengerAirbagDeployed(AIRBAG_STATUS_PASSENGER_DEPLOYED);
+ AIRBAG_STATUS.setPassengerCurtainAirbagDeployed(AIRBAG_STATUS_PASSENGER_CURTAIN_DEPLOYED);
+ AIRBAG_STATUS.setDriverKneeAirbagDeployed(AIRBAG_STATUS_DRIVER_KNEE_DEPLOYED);
+ AIRBAG_STATUS.setPassengerSideAirbagDeployed(AIRBAG_STATUS_PASSENGER_SIDE_DEPLOYED);
+ AIRBAG_STATUS.setPassengerKneeAirbagDeployed(AIRBAG_STATUS_PASSENGER_KNEE_DEPLOYED);
+
+ //EMERGENCY_EVENT set up
+ EMERGENCY_EVENT.setEmergencyEventType(EMERGENCY_EVENT_TYPE);
+ EMERGENCY_EVENT.setFuelCutoffStatus(EMERGENCY_EVENT_FUEL_CUTOFF_STATUS);
+ EMERGENCY_EVENT.setRolloverEvent(EMERGENCY_EVENT_ROLLOVER_EVENT);
+ EMERGENCY_EVENT.setMaximumChangeVelocity(EMERGENCY_EVENT_MAX_CHANGE_VELOCITY);
+ EMERGENCY_EVENT.setMultipleEvents(EMERGENCY_EVENT_MULTIPLE_EVENTS);
+
+ //CLUSTER_MODE_STATUS set up
+ CLUSTER_MODE_STATUS.setPowerModeActive(CLUSTER_MODE_STATUS_POWER_MODE_ACTIVE);
+ CLUSTER_MODE_STATUS.setPowerModeQualificationStatus(CLUSTER_MODE_STATUS_POWER_MODE_QUALIFICATION_STATUS);
+ CLUSTER_MODE_STATUS.setCarModeStatus(CLUSTER_MODE_STATUS_CAR_MODE_STATUS);
+ CLUSTER_MODE_STATUS.setPowerModeStatus(CLUSTER_MODE_STATUS_POWER_MODE_STATUS);
+
+ //MY_KEY set up
+ MY_KEY.setE911Override(MY_KEY_E_911_OVERRIDE);
+
+ // FUEL_RANGE and FUEL_RANGE_LIST set up
+ FUEL_RANGE.setType(FUEL_RANGE_TYPE);
+ FUEL_RANGE.setRange(FUEL_RANGE_RANGE);
+ FUEL_RANGE_LIST.add(FUEL_RANGE);
+
+ // FUEL_RANGE json array set up
+ try {
+ JSON_FUEL_RANGE.put(FUEL_RANGE.serializeJSON());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+
+ //set up the OnVehicleData object
+ VEHICLE_DATA.setSpeed(SPEED);
+ VEHICLE_DATA.setRpm(RPM);
+ VEHICLE_DATA.setExternalTemperature(EXTERNAL_TEMPERATURE);
+ VEHICLE_DATA.setFuelLevel(FUEL_LEVEL);
+ VEHICLE_DATA.setVin(VIN);
+ VEHICLE_DATA.setPrndl(PRNDL_FINAL);
+ VEHICLE_DATA.setTirePressure(TIRE_PRESSURE);
+ VEHICLE_DATA.setEngineTorque(ENGINE_TORQUE);
+ VEHICLE_DATA.setEngineOilLife(ENGINE_OIL_LIFE);
+ VEHICLE_DATA.setOdometer(ODOMETER);
+ VEHICLE_DATA.setGps(GPS);
+ VEHICLE_DATA.setFuelLevelState(FUEL_LEVEL_STATE);
+ VEHICLE_DATA.setInstantFuelConsumption(INSTANT_FUEL_CONSUMPTION);
+ VEHICLE_DATA.setBeltStatus(BELT_STATUS);
+ VEHICLE_DATA.setBodyInformation(BODY_INFORMATION);
+ VEHICLE_DATA.setDeviceStatus(DEVICE_STATUS);
+ VEHICLE_DATA.setDriverBraking(DRIVER_BRAKING);
+ VEHICLE_DATA.setWiperStatus(WIPER_STATUS);
+ VEHICLE_DATA.setHeadLampStatus(HEAD_LAMP_STATUS);
+ VEHICLE_DATA.setAccPedalPosition(ACC_PEDAL_POSITION);
+ VEHICLE_DATA.setSteeringWheelAngle(STEERING_WHEEL_ANGLE);
+ VEHICLE_DATA.setECallInfo(E_CALL_INFO);
+ VEHICLE_DATA.setAirbagStatus(AIRBAG_STATUS);
+ VEHICLE_DATA.setEmergencyEvent(EMERGENCY_EVENT);
+ VEHICLE_DATA.setClusterModeStatus(CLUSTER_MODE_STATUS);
+ VEHICLE_DATA.setMyKey(MY_KEY);
+ VEHICLE_DATA.setFuelRange(FUEL_RANGE_LIST);
+ VEHICLE_DATA.setTurnSignal(TURN_SIGNAL);
+ VEHICLE_DATA.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS);
+
+ //set up the GetVehicleDataResponse object
+ VEHICLE_DATA_RESPONSE.setSpeed(SPEED);
+ VEHICLE_DATA_RESPONSE.setRpm(RPM);
+ VEHICLE_DATA_RESPONSE.setExternalTemperature(EXTERNAL_TEMPERATURE);
+ VEHICLE_DATA_RESPONSE.setFuelLevel(FUEL_LEVEL);
+ VEHICLE_DATA_RESPONSE.setVin(VIN);
+ VEHICLE_DATA_RESPONSE.setPrndl(PRNDL_FINAL);
+ VEHICLE_DATA_RESPONSE.setTirePressure(TIRE_PRESSURE);
+ VEHICLE_DATA_RESPONSE.setEngineTorque(ENGINE_TORQUE);
+ VEHICLE_DATA_RESPONSE.setEngineOilLife(ENGINE_OIL_LIFE);
+ VEHICLE_DATA_RESPONSE.setOdometer(ODOMETER);
+ VEHICLE_DATA_RESPONSE.setGps(GPS);
+ VEHICLE_DATA_RESPONSE.setFuelLevelState(FUEL_LEVEL_STATE);
+ VEHICLE_DATA_RESPONSE.setInstantFuelConsumption(INSTANT_FUEL_CONSUMPTION);
+ VEHICLE_DATA_RESPONSE.setBeltStatus(BELT_STATUS);
+ VEHICLE_DATA_RESPONSE.setBodyInformation(BODY_INFORMATION);
+ VEHICLE_DATA_RESPONSE.setDeviceStatus(DEVICE_STATUS);
+ VEHICLE_DATA_RESPONSE.setDriverBraking(DRIVER_BRAKING);
+ VEHICLE_DATA_RESPONSE.setWiperStatus(WIPER_STATUS);
+ VEHICLE_DATA_RESPONSE.setHeadLampStatus(HEAD_LAMP_STATUS);
+ VEHICLE_DATA_RESPONSE.setAccPedalPosition(ACC_PEDAL_POSITION);
+ VEHICLE_DATA_RESPONSE.setSteeringWheelAngle(STEERING_WHEEL_ANGLE);
+ VEHICLE_DATA_RESPONSE.setECallInfo(E_CALL_INFO);
+ VEHICLE_DATA_RESPONSE.setAirbagStatus(AIRBAG_STATUS);
+ VEHICLE_DATA_RESPONSE.setEmergencyEvent(EMERGENCY_EVENT);
+ VEHICLE_DATA_RESPONSE.setClusterModeStatus(CLUSTER_MODE_STATUS);
+ VEHICLE_DATA_RESPONSE.setMyKey(MY_KEY);
+ VEHICLE_DATA_RESPONSE.setFuelRange(FUEL_RANGE_LIST);
+ VEHICLE_DATA_RESPONSE.setTurnSignal(TURN_SIGNAL);
+ VEHICLE_DATA_RESPONSE.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS);
+ }
+
+ private VehicleDataHelper(){}
+
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/encoder/EncoderUtilsTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/encoder/EncoderUtilsTest.java
index 083a5dd3f..083a5dd3f 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/encoder/EncoderUtilsTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/encoder/EncoderUtilsTest.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/json/rpc/JsonFileReader.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/json/rpc/JsonFileReader.java
new file mode 100644
index 000000000..7284114ab
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/json/rpc/JsonFileReader.java
@@ -0,0 +1,57 @@
+package com.smartdevicelink.test.json.rpc;
+
+import android.content.Context;
+
+import com.smartdevicelink.test.JsonUtils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+
+public class JsonFileReader {
+ private static final String PATH = "json/";
+ private static final String EXT = ".json";
+
+ public static JSONObject readId (Context context, String id, String type) {
+ if(context == null){
+ return null;
+ }
+ String fileName = PATH + id + EXT;
+
+ JSONObject commandJsonWithType = null;
+
+ try {
+ JSONObject commandJson = null;
+ //get the file which holds the desired object
+ InputStream fileStream = context.getAssets().open(fileName);
+ BufferedInputStream bufferStream = new BufferedInputStream(fileStream);
+ byte[] buffer = new byte[(int)fileStream.available()];
+ bufferStream.read(buffer);
+ fileStream.close();
+ commandJson = JsonUtils.createJsonObject(buffer);
+
+ //now use the type parameter to get the specific message type
+ //it also makes sure to return it with the message type in the top level because that's needed to eventually make this into a class object
+ commandJson = JsonUtils.readJsonObjectFromJsonObject(commandJson, type);
+ commandJsonWithType = new JSONObject();
+ commandJsonWithType = commandJsonWithType.put(type, commandJson);
+ }
+ catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ catch (IOException e) {
+ e.printStackTrace();
+ }
+ catch (JSONException e) {
+ e.printStackTrace();
+ }
+
+ return commandJsonWithType;
+
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java
new file mode 100644
index 000000000..04c44e810
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java
@@ -0,0 +1,105 @@
+package com.smartdevicelink.test.protocol;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.protocol.BinaryFrameHeader;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.test.SampleRpc;
+
+import junit.framework.Assert;
+
+public class BinaryFrameHeaderTests extends AndroidTestCase2 {
+
+ public static final byte RPC_TYPE_REQUEST = 0x00;
+ public static final byte RPC_TYPE_RESPONSE = 0x01;
+ public static final byte RPC_TYPE_NOTIFICAITON = 0x02;
+
+
+ public static BinaryFrameHeader createDummyBfh(){
+ BinaryFrameHeader bfh = new BinaryFrameHeader();
+ bfh.setCorrID(123);
+ bfh.setFunctionID(FunctionID.ON_HMI_STATUS.getId());
+ bfh.setRPCType(RPC_TYPE_NOTIFICAITON);
+ bfh.setBulkData(null);
+ //There is no check for null bfh.setJsonData(null);
+ bfh.setJsonSize(0);
+ return bfh;
+ }
+
+ public BinaryFrameHeader safeParse(byte[] array){
+ try{
+ return BinaryFrameHeader.parseBinaryHeader(array);
+ }catch(Exception e){
+ return null;
+ }
+ }
+
+ public void testAssemblyAndParse(){
+ BinaryFrameHeader bfh = createDummyBfh();
+
+ byte[] bfhBytes = bfh.assembleHeaderBytes();
+ assertNotNull(bfhBytes);
+
+ BinaryFrameHeader parsedBfh = BinaryFrameHeader.parseBinaryHeader(bfhBytes);
+ assertNotNull(parsedBfh);
+
+ assertTrue(bfh.getCorrID() == parsedBfh.getCorrID());
+
+ assertTrue(bfh.getFunctionID() == parsedBfh.getFunctionID());
+
+ assertTrue(bfh.getRPCType() == parsedBfh.getRPCType());
+
+ assertTrue(bfh.getBulkData() == parsedBfh.getBulkData());
+
+ assertTrue(bfh.getJsonData() == parsedBfh.getJsonData());
+
+ assertTrue(bfh.getJsonSize() == parsedBfh.getJsonSize());
+
+ }
+
+ public void testCorruptHeader(){
+ BinaryFrameHeader bfh = createDummyBfh();
+ bfh.setJsonSize(5);
+ bfh.setJsonData(new byte[5]);
+ bfh.setJsonSize(Integer.MAX_VALUE);
+
+ assertFalse(bfh.getJsonData().length == bfh.getJsonSize());
+
+ byte[] bfhBytes = bfh.assembleHeaderBytes();
+
+ assertNull(safeParse(bfhBytes));
+
+ //Change bytes in the array manually
+ int size = bfhBytes.length;
+ for(int i =0; i<size;i++){
+ bfhBytes[i] = (byte) 0x99;
+ }
+
+ assertNull(safeParse(bfhBytes));
+ BinaryFrameHeader head = BinaryFrameHeader.parseBinaryHeader(bfhBytes);
+ assertNull(head);
+ }
+
+ public void testJsonSetException(){
+ try{
+ BinaryFrameHeader bfh = createDummyBfh();
+ bfh.setJsonData(null);
+ Assert.fail("Setting JSON data to null should have thrown an exception.");
+ }catch(Exception e){
+ //Pass
+ }
+ }
+
+ public void testAlteredDataInSampleRpc(){
+ SampleRpc sampleRpc = new SampleRpc(4);
+ //Create a corrupted header
+ BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
+ header.setJsonSize(Integer.MAX_VALUE);
+ assertEquals(Integer.MAX_VALUE, header.getJsonSize());
+ sampleRpc.setBinaryFrameHeader(header);
+
+ assertEquals(Integer.MAX_VALUE,sampleRpc.getBinaryFrameHeader(false).getJsonSize());
+
+
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataControlFrameTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataControlFrameTypeTests.java
new file mode 100644
index 000000000..d51bb6430
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataControlFrameTypeTests.java
@@ -0,0 +1,162 @@
+package com.smartdevicelink.test.protocol.enums;
+
+import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import java.util.Vector;
+
+
+public class FrameDataControlFrameTypeTests extends TestCase {
+
+ private Vector<FrameDataControlFrameType> list = FrameDataControlFrameType.getList();
+
+ // Verifies the values are not null upon valid assignment.
+ // These are not actual enums for packeting reasons so testing is different.
+ public void testValidEnums () {
+
+ final byte START_SESSION_BYTE = (byte) 0x01;
+ final String START_SESSION_STRING = "StartSession";
+
+ final byte START_SESSION_ACK_BYTE = (byte) 0x02;
+ final String START_SESSION_ACK_STRING = "StartSessionACK";
+
+ final byte START_SESSION_NACK_BYTE = (byte) 0x03;
+ final String START_SESSION_NACK_STRING = "StartSessionNACK";
+
+ final byte END_SESSION_BYTE = (byte) 0x04;
+ final String END_SESSION_STRING = "EndSession";
+
+ final byte END_SESSION_ACK_BYTE = (byte) 0x05;
+ final String END_SESSION_ACK_STRING = "EndSessionACK";
+
+ final byte END_SESSION_NACK_BYTE = (byte) 0x06;
+ final String END_SESSION_NACK_STRING = "EndSessionNACK";
+
+ final byte HEARTBEAT_BYTE = (byte) 0x00;
+ final String HEARTBEAT_STRING = "Heartbeat";
+
+ final byte HEARTBEAT_ACK_BYTE = (byte) 0xFF;
+ final String HEARTBEAT_ACK_STRING = "HeartbeatACK";
+
+ try {
+
+ assertNotNull("FrameDataControlFrameType list returned null", list);
+
+ // Check the byte values
+ FrameDataControlFrameType enumSS = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_BYTE);
+ FrameDataControlFrameType enumSSACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_ACK_BYTE);
+ FrameDataControlFrameType enumSSNACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_NACK_BYTE);
+ FrameDataControlFrameType enumES = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_BYTE);
+ FrameDataControlFrameType enumESACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_ACK_BYTE);
+ FrameDataControlFrameType enumESNACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_NACK_BYTE);
+ FrameDataControlFrameType enumH = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, HEARTBEAT_BYTE);
+ FrameDataControlFrameType enumHACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, HEARTBEAT_ACK_BYTE);
+
+ assertNotNull("Start session byte match returned null", enumSS);
+ assertNotNull("Start session ack byte match returned null", enumSSACK);
+ assertNotNull("Start session nack byte match returned null", enumSSNACK);
+ assertNotNull("End session byte match returned null", enumES);
+ assertNotNull("End session ack byte match returned null", enumESACK);
+ assertNotNull("End session nack byte match returned null", enumESNACK);
+ assertNotNull("Heartbeat byte match returned null", enumH);
+ assertNotNull("Heartbeat ack byte match returned null", enumHACK);
+
+ // Check the string values
+ enumSS = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_STRING);
+ enumSSACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_ACK_STRING);
+ enumSSNACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_NACK_STRING);
+ enumES = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_STRING);
+ enumESACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_ACK_STRING);
+ enumESNACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_NACK_STRING);
+ enumH = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, HEARTBEAT_STRING);
+ enumHACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, HEARTBEAT_ACK_STRING);
+
+ assertNotNull("Start session string match returned null", enumSS);
+ assertNotNull("Start session ack string match returned null", enumSSACK);
+ assertNotNull("Start session nack string match returned null", enumSSNACK);
+ assertNotNull("End session string match returned null", enumES);
+ assertNotNull("End session ack string match returned null", enumESACK);
+ assertNotNull("End session nack string match returned null", enumESNACK);
+ assertNotNull("Heartbeat string match returned null", enumH);
+ assertNotNull("Heartbeat ack string match returned null", enumHACK);
+
+ } catch (NullPointerException exception) {
+ fail("Null enum list throws NullPointerException.");
+ }
+ }
+
+ // Verifies that an invalid assignment is null.
+ public void testInvalidEnum () {
+
+ final byte INVALID_BYTE = (byte) 0xAB;
+ final String INVALID_STRING = "Invalid";
+
+ try {
+
+ // Check the byte value
+ FrameDataControlFrameType enumInvalid = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, INVALID_BYTE);
+ assertNull("Invalid byte match didn't return null", enumInvalid);
+
+ // Check the string value
+ enumInvalid = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, INVALID_STRING);
+ assertNull("Invalid string match didn't return null", enumInvalid);
+
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ // Verifies that a null assignment is invalid.
+ public void testNullEnum () {
+ try {
+
+ // Check null string lookup
+ FrameDataControlFrameType enumNull = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, null);
+ assertNull("Null lookup returns a value", enumNull);
+
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ // Verifies the possible enum values of FrameType.
+ public void testListEnum () {
+ // Test Vector
+ Vector<FrameDataControlFrameType> enumTestList = new Vector<FrameDataControlFrameType>();
+ enumTestList.add(FrameDataControlFrameType.Heartbeat);
+ enumTestList.add(FrameDataControlFrameType.StartSession);
+ enumTestList.add(FrameDataControlFrameType.StartSessionACK);
+ enumTestList.add(FrameDataControlFrameType.StartSessionNACK);
+ enumTestList.add(FrameDataControlFrameType.EndSession);
+ enumTestList.add(FrameDataControlFrameType.EndSessionACK);
+ enumTestList.add(FrameDataControlFrameType.EndSessionNACK);
+ enumTestList.add(FrameDataControlFrameType.ServiceDataACK);
+ enumTestList.add(FrameDataControlFrameType.HeartbeatACK);
+ enumTestList.add(FrameDataControlFrameType.RegisterSecondaryTransport);
+ enumTestList.add(FrameDataControlFrameType.RegisterSecondaryTransportACK);
+ enumTestList.add(FrameDataControlFrameType.RegisterSecondaryTransportNACK);
+ enumTestList.add(FrameDataControlFrameType.TransportEventUpdate);
+
+ assertTrue("List does not match enum test list.",
+ list.containsAll(enumTestList) &&
+ enumTestList.containsAll(list));
+
+ // Test Array
+ FrameDataControlFrameType[] enumValueArray = FrameDataControlFrameType.values();
+ FrameDataControlFrameType[] enumTestArray = {
+ FrameDataControlFrameType.Heartbeat, FrameDataControlFrameType.StartSession,
+ FrameDataControlFrameType.StartSessionACK, FrameDataControlFrameType.StartSessionNACK,
+ FrameDataControlFrameType.EndSession, FrameDataControlFrameType.EndSessionACK,
+ FrameDataControlFrameType.EndSessionNACK, FrameDataControlFrameType.RegisterSecondaryTransport,
+ FrameDataControlFrameType.RegisterSecondaryTransportACK, FrameDataControlFrameType.RegisterSecondaryTransportNACK,
+ FrameDataControlFrameType.TransportEventUpdate, FrameDataControlFrameType.ServiceDataACK,
+ FrameDataControlFrameType.HeartbeatACK,
+ };
+
+ assertTrue("Array does not match enum values array.",
+ Validator.validateFrameDataControlFrameTypeArray(enumValueArray, enumTestArray));
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataTests.java
new file mode 100644
index 000000000..e2ad1ea3a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataTests.java
@@ -0,0 +1,116 @@
+package com.smartdevicelink.test.protocol.enums;
+
+import com.smartdevicelink.protocol.enums.FrameData;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import java.util.Vector;
+
+public class FrameDataTests extends TestCase {
+
+ private Vector<FrameData> list = FrameData.getList();
+
+ // Verifies the values are not null upon valid assignment.
+ // These are not actual enums for packeting reasons so testing is different.
+ public void testValidEnums () {
+
+ final byte START_SESSION_BYTE = (byte) 0x01;
+ final String START_SESSION_STRING = "StartSession";
+
+ final byte START_SESSION_ACK_BYTE = (byte) 0x02;
+ final String START_SESSION_ACK_STRING = "StartSessionACK";
+
+ final byte START_SESSION_NACK_BYTE = (byte) 0x03;
+ final String START_SESSION_NACK_STRING = "StartSessionNACK";
+
+ final byte END_SESSION_BYTE = (byte) 0x04;
+ final String END_SESSION_STRING = "EndSession";
+
+ try {
+
+ assertNotNull("FrameData list returned null", list);
+
+ // Check the byte values
+ FrameData enumSS = (FrameData) FrameData.get(list, START_SESSION_BYTE);
+ FrameData enumSSACK = (FrameData) FrameData.get(list, START_SESSION_ACK_BYTE);
+ FrameData enumSSNACK = (FrameData) FrameData.get(list, START_SESSION_NACK_BYTE);
+ FrameData enumES = (FrameData) FrameData.get(list, END_SESSION_BYTE);
+
+ assertNotNull("Start session byte match returned null", enumSS);
+ assertNotNull("Single byte match returned null", enumSSACK);
+ assertNotNull("First byte match returned null", enumSSNACK);
+ assertNotNull("Consecutive byte match returned null", enumES);
+
+ // Check the string values
+ enumSS = (FrameData) FrameData.get(list, START_SESSION_STRING);
+ enumSSACK = (FrameData) FrameData.get(list, START_SESSION_ACK_STRING);
+ enumSSNACK = (FrameData) FrameData.get(list, START_SESSION_NACK_STRING);
+ enumES = (FrameData) FrameData.get(list, END_SESSION_STRING);
+
+ assertNotNull("Start session string match returned null", enumSS);
+ assertNotNull("Single string match returned null", enumSSACK);
+ assertNotNull("First string match returned null", enumSSNACK);
+ assertNotNull("Consecutive string match returned null", enumES);
+
+ } catch (NullPointerException exception) {
+ fail("Null enum list throws NullPointerException.");
+ }
+ }
+
+ // Verifies that an invalid assignment is null.
+ public void testInvalidEnum () {
+
+ final byte INVALID_BYTE = (byte) 0xAB;
+ final String INVALID_STRING = "Invalid";
+
+ try {
+
+ // Check the byte value
+ FrameData enumInvalid = (FrameData) FrameData.get(list, INVALID_BYTE);
+ assertNull("Invalid byte match didn't return null", enumInvalid);
+
+ // Check the string value
+ enumInvalid = (FrameData) FrameData.get(list, INVALID_STRING);
+ assertNull("Invalid string match didn't return null", enumInvalid);
+
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ // Verifies that a null assignment is invalid.
+ public void testNullEnum () {
+ try {
+
+ // Check null string lookup
+ FrameData enumNull = (FrameData) FrameData.get(list, null);
+ assertNull("Null lookup returns a value", enumNull);
+
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ // Verifies the possible enum values of FrameType.
+ public void testListEnum () {
+ // Test Vector
+ Vector<FrameData> enumTestList = new Vector<FrameData>();
+ enumTestList.add(FrameData.StartSession);
+ enumTestList.add(FrameData.StartSessionACK);
+ enumTestList.add(FrameData.StartSessionNACK);
+ enumTestList.add(FrameData.EndSession);
+
+ assertTrue("List does not match enum test list.",
+ list.containsAll(enumTestList) &&
+ enumTestList.containsAll(list));
+
+ // Test Array
+ FrameData[] enumValueArray = FrameData.values();
+ FrameData[] enumTestArray = { FrameData.StartSession, FrameData.StartSessionACK,
+ FrameData.StartSessionNACK, FrameData.EndSession };
+
+ assertTrue("Array does not match enum values array.",
+ Validator.validateFrameDataArray(enumValueArray, enumTestArray));
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameTypeTests.java
new file mode 100644
index 000000000..182287a39
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameTypeTests.java
@@ -0,0 +1,117 @@
+package com.smartdevicelink.test.protocol.enums;
+
+import com.smartdevicelink.protocol.enums.FrameType;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import java.util.Vector;
+
+public class FrameTypeTests extends TestCase {
+
+ private Vector<FrameType> list = FrameType.getList();
+
+ // Verifies the values are not null upon valid assignment.
+ // These are not actual enums for packeting reasons so testing is different.
+ public void testValidEnums () {
+
+ final byte CONTROL_BYTE = (byte) 0x00;
+ final String CONTROL_STRING = "Control";
+
+ final byte SINGLE_BYTE = (byte) 0x01;
+ final String SINGLE_STRING = "Single";
+
+ final byte FIRST_BYTE = (byte) 0x02;
+ final String FIRST_STRING = "First";
+
+ final byte CONSECUTIVE_BYTE = (byte) 0x03;
+ final String CONSECUTIVE_STRING = "Consecutive";
+
+ try {
+
+ assertNotNull("FrameType list returned null", list);
+
+ // Check the byte values
+ FrameType enumControl = (FrameType) FrameType.get(list, CONTROL_BYTE);
+ FrameType enumSingle = (FrameType) FrameType.get(list, SINGLE_BYTE);
+ FrameType enumFirst = (FrameType) FrameType.get(list, FIRST_BYTE);
+ FrameType enumConsecutive = (FrameType) FrameType.get(list, CONSECUTIVE_BYTE);
+
+ assertNotNull("Control byte match returned null", enumControl);
+ assertNotNull("Single byte match returned null", enumSingle);
+ assertNotNull("First byte match returned null", enumFirst);
+ assertNotNull("Consecutive byte match returned null", enumConsecutive);
+
+ // Check the string values
+ enumControl = (FrameType) FrameType.get(list, CONTROL_STRING);
+ enumSingle = (FrameType) FrameType.get(list, SINGLE_STRING);
+ enumFirst = (FrameType) FrameType.get(list, FIRST_STRING);
+ enumConsecutive = (FrameType) FrameType.get(list, CONSECUTIVE_STRING);
+
+ assertNotNull("Control string match returned null", enumControl);
+ assertNotNull("Single string match returned null", enumSingle);
+ assertNotNull("First string match returned null", enumFirst);
+ assertNotNull("Consecutive string match returned null", enumConsecutive);
+
+ } catch (NullPointerException exception) {
+ fail("Null enum list throws NullPointerException.");
+ }
+ }
+
+ // Verifies that an invalid assignment is null.
+ public void testInvalidEnum () {
+
+ final byte INVALID_BYTE = (byte) 0xAB;
+ final String INVALID_STRING = "Invalid";
+
+ try {
+
+ // Check the byte value
+ FrameType enumInvalid = (FrameType) FrameType.get(list, INVALID_BYTE);
+ assertNull("Invalid byte match didn't return null", enumInvalid);
+
+ // Check the string value
+ enumInvalid = (FrameType) FrameType.get(list, INVALID_STRING);
+ assertNull("Invalid string match didn't return null", enumInvalid);
+
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ // Verifies that a null assignment is invalid.
+ public void testNullEnum () {
+ try {
+
+ // Check null string lookup
+ FrameType enumNull = (FrameType) FrameType.get(list, null);
+ assertNull("Null lookup returns a value", enumNull);
+
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ // Verifies the possible enum values of FrameType.
+ public void testListEnum () {
+
+ // Test Vector
+ Vector<FrameType> enumTestList = new Vector<FrameType>();
+ enumTestList.add(FrameType.Control);
+ enumTestList.add(FrameType.Single);
+ enumTestList.add(FrameType.First);
+ enumTestList.add(FrameType.Consecutive);
+
+ assertTrue("List does not match enum test list.",
+ list.containsAll(enumTestList) &&
+ enumTestList.containsAll(list));
+
+ // Test Array
+ FrameType[] enumValueArray = FrameType.values();
+ FrameType[] enumTestArray = { FrameType.Control, FrameType.Single,
+ FrameType.First, FrameType.Consecutive };
+
+ assertTrue("Array does not match enum values array.",
+ Validator.validateFrameTypeArray(enumValueArray, enumTestArray));
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/MessageTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/MessageTypeTests.java
new file mode 100644
index 000000000..1a09a5b05
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/MessageTypeTests.java
@@ -0,0 +1,61 @@
+package com.smartdevicelink.test.protocol.enums;
+
+import com.smartdevicelink.protocol.enums.MessageType;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class MessageTypeTests extends TestCase {
+
+ public void testValidEnums () {
+ String example = "UNDEFINED";
+ MessageType enumUndefined = MessageType.valueForString(example);
+ example = "BULK";
+ MessageType enumBulk = MessageType.valueForString(example);
+ example = "RPC";
+ MessageType enumRpc = MessageType.valueForString(example);
+
+ assertNotNull("UNDEFINED returned null", enumUndefined);
+ assertNotNull("BULK returned null", enumBulk);
+ assertNotNull("RPC returned null", enumRpc);
+ }
+
+ public void testInvalidEnum () {
+ String example = "RpC";
+
+ try {
+ MessageType temp = MessageType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException");
+ }
+ }
+
+ public void testNullEnum () {
+ String example = null;
+
+ try {
+ MessageType temp = MessageType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ public void testListEnum() {
+ List<MessageType> enumValueList = Arrays.asList(MessageType.values());
+
+ List<MessageType> enumTestList = new ArrayList<MessageType>();
+ enumTestList.add(MessageType.UNDEFINED);
+ enumTestList.add(MessageType.BULK);
+ enumTestList.add(MessageType.RPC);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/SessionTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/SessionTypeTests.java
new file mode 100644
index 000000000..e96b6a5b5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/SessionTypeTests.java
@@ -0,0 +1,125 @@
+package com.smartdevicelink.test.protocol.enums;
+
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import java.util.Vector;
+
+public class SessionTypeTests extends TestCase {
+
+ private Vector<SessionType> list = SessionType.getList();
+
+ // Verifies the values are not null upon valid assignment.
+ // These are not actual enums for packeting reasons so testing is different.
+ public void testValidEnums () {
+
+ final byte HEARTBEAT_BYTE = (byte) 0x00;
+ final String HEARTBEAT_STRING = "CONTROL";
+
+ final byte RPC_BYTE = (byte) 0x07;
+ final String RPC_STRING = "RPC";
+
+ final byte PCM_BYTE = (byte) 0x0A;
+ final String PCM_STRING = "PCM";
+
+ final byte NAV_BYTE = (byte) 0x0B;
+ final String NAV_STRING = "NAV";
+
+ final byte BULK_DATA_BYTE = (byte) 0x0F;
+ final String BULK_DATA_STRING = "BULK_DATA";
+
+ try {
+
+ assertNotNull("SessionType list returned null", list);
+
+ // Check the byte values
+ SessionType enumHeartbeat = (SessionType) SessionType.get(list, HEARTBEAT_BYTE);
+ SessionType enumRPC = (SessionType) SessionType.get(list, RPC_BYTE);
+ SessionType enumPCM = (SessionType) SessionType.get(list, PCM_BYTE);
+ SessionType enumNAV = (SessionType) SessionType.get(list, NAV_BYTE);
+ SessionType enumBulkData = (SessionType) SessionType.get(list, BULK_DATA_BYTE);
+
+ assertNotNull("Start session byte match returned null", enumHeartbeat);
+ assertNotNull("Single byte match returned null", enumRPC);
+ assertNotNull("First byte match returned null", enumPCM);
+ assertNotNull("Consecutive byte match returned null", enumNAV);
+ assertNotNull("Consecutive byte match returned null", enumBulkData);
+
+ // Check the string values
+ enumHeartbeat = (SessionType) SessionType.get(list, HEARTBEAT_STRING);
+ enumRPC = (SessionType) SessionType.get(list, RPC_STRING);
+ enumPCM = (SessionType) SessionType.get(list, PCM_STRING);
+ enumNAV = (SessionType) SessionType.get(list, NAV_STRING);
+ enumBulkData = (SessionType) SessionType.get(list, BULK_DATA_STRING);
+
+ assertNotNull("Start session string match returned null", enumHeartbeat);
+ assertNotNull("Single string match returned null", enumRPC);
+ assertNotNull("First string match returned null", enumPCM);
+ assertNotNull("Consecutive string match returned null", enumNAV);
+ assertNotNull("Consecutive string match returned null", enumBulkData);
+
+ } catch (NullPointerException exception) {
+ fail("Null enum list throws NullPointerException.");
+ }
+ }
+
+ // Verifies that an invalid assignment is null.
+ public void testInvalidEnum () {
+
+ final byte INVALID_BYTE = (byte) 0xAB;
+ final String INVALID_STRING = "Invalid";
+
+ try {
+
+ // Check the byte value
+ SessionType enumInvalid = (SessionType) SessionType.get(list, INVALID_BYTE);
+ assertNull("Invalid byte match didn't return null", enumInvalid);
+
+ // Check the string value
+ enumInvalid = (SessionType) SessionType.get(list, INVALID_STRING);
+ assertNull("Invalid string match didn't return null", enumInvalid);
+
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ // Verifies that a null assignment is invalid.
+ public void testNullEnum () {
+ try {
+
+ // Check null string lookup
+ SessionType enumNull = (SessionType) SessionType.get(list, null);
+ assertNull("Null lookup returns a value", enumNull);
+
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ // Verifies the possible enum values of SessionType.
+ public void testListEnum () {
+ // Test Vector
+ Vector<SessionType> enumTestList = new Vector<SessionType>();
+ enumTestList.add(SessionType.RPC);
+ enumTestList.add(SessionType.PCM);
+ enumTestList.add(SessionType.NAV);
+ enumTestList.add(SessionType.BULK_DATA);
+ enumTestList.add(SessionType.CONTROL);
+
+ assertTrue("List does not match enum test list.",
+ list.containsAll(enumTestList) &&
+ enumTestList.containsAll(list));
+
+ // Test Array
+ SessionType[] enumValueArray = SessionType.values();
+ SessionType[] enumTestArray = { SessionType.RPC, SessionType.PCM,
+ SessionType.NAV, SessionType.BULK_DATA,
+ SessionType.CONTROL };
+
+ assertTrue("Array does not match enum values array.",
+ Validator.validateSessionTypeArray(enumValueArray, enumTestArray));
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java
new file mode 100644
index 000000000..7957ee227
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java
@@ -0,0 +1,69 @@
+package com.smartdevicelink.test.protocol.heartbeat;
+
+import com.smartdevicelink.protocol.heartbeat.HeartbeatMonitor;
+import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitorListener;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.protocol.heartbeat.HeartbeatMonitor}
+ */
+public class HeartbeatMonitorTests extends TestCase {
+
+ // TODO : Proper thread testing.
+
+ private HeartbeatMonitor monitor = new HeartbeatMonitor();
+ private Runnable testRunnable;
+ private Timer timer;
+
+ public void testValues () {
+ assertNotNull(Test.NOT_NULL, monitor);
+
+ testRunnable = monitor.getHeartbeatRunnable();
+ assertNotNull(Test.NOT_NULL, testRunnable);
+
+ int testInterval = 100;
+ monitor.setInterval(testInterval);
+ assertEquals("Interval did not match expected value", monitor.getInterval(), testInterval);
+ }
+
+ public void testThread () {
+ try {
+ Thread testThread = new Thread(testRunnable);
+ assertNotNull(Test.NOT_NULL, testThread);
+ setTimeout(5000, testThread); // Cannot leave thread hanging
+
+ testThread.start();
+ testThread.join();
+ } catch (Exception e) {
+ fail("Thread exception was thrown");
+ }
+ }
+
+ private void setTimeout(int duration, final Thread thread) {
+ timer = new Timer();
+ timer.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ thread.interrupt();
+ }
+ }, duration);
+ }
+
+ public void testNull () {
+ // Testing a null value for listener instead of implementing and overriding
+ // IHeartbeatMonitorListener methods to test the getter/setter methods of HeartbeatMonitor.
+ monitor.setListener(null);
+ IHeartbeatMonitorListener testListener = monitor.getListener();
+ assertNull("Listener returned a value", testListener);
+
+ // Interface testing issue >>
+ // monitor.heartbeatACKReceived(); // Sets the ack boolean flag
+ // assertTrue("ACK value was not true", monitor.getACKReceived());
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java
index f5baf5e06..f5baf5e06 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java
new file mode 100644
index 000000000..55d22dcfd
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java
@@ -0,0 +1,142 @@
+package com.smartdevicelink.test.proxy;
+
+import com.smartdevicelink.proxy.LockScreenManager;
+import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.LockScreenManager}
+ */
+public class LockScreenManagerTest extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.proxy.LockScreenManager#setDriverDistStatus(boolean)}
+ */
+ public void testDriverDistStatus(){
+ LockScreenManager lockMan = new LockScreenManager();
+ lockMan.setDriverDistStatus(true);
+ assertEquals(Test.MATCH, true, (boolean) lockMan.getLockObj().getDriverDistractionStatus());
+
+ lockMan.setDriverDistStatus(false);
+ assertEquals(Test.MATCH, false, (boolean) lockMan.getLockObj().getDriverDistractionStatus());
+ }
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.proxy.LockScreenManager#setHMILevel(HMILevel)}
+ */
+ public void testHmiLevelStatus(){
+ LockScreenManager lockMan = new LockScreenManager();
+ lockMan.setHMILevel(HMILevel.HMI_BACKGROUND);
+ assertEquals(Test.MATCH, HMILevel.HMI_BACKGROUND, lockMan.getLockObj().getHMILevel());
+
+ lockMan.setHMILevel(HMILevel.HMI_FULL);
+ assertEquals(Test.MATCH, HMILevel.HMI_FULL, lockMan.getLockObj().getHMILevel());
+
+ lockMan.setHMILevel(HMILevel.HMI_LIMITED);
+ assertEquals(Test.MATCH, HMILevel.HMI_LIMITED, lockMan.getLockObj().getHMILevel());
+
+ lockMan.setHMILevel(HMILevel.HMI_NONE);
+ assertEquals(Test.MATCH, HMILevel.HMI_NONE, lockMan.getLockObj().getHMILevel());
+
+ lockMan.setHMILevel(null);
+ assertNull(Test.NULL, lockMan.getLockObj().getHMILevel());
+ }
+
+ /**
+ * Test the lock screen status when no setter methods are called.
+ */
+ public void testLockScreenStatusNull(){
+ LockScreenManager lockMan = new LockScreenManager();
+ OnLockScreenStatus result = lockMan.getLockObj();
+ assertNotNull(Test.NOT_NULL, result);
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+ }
+
+ /**
+ * Test the invalid settings of lock screen status.
+ */
+ public void testLockScreenStatusDriverDistNull(){
+ LockScreenManager lockMan = new LockScreenManager();
+
+ OnLockScreenStatus result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_NONE);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_BACKGROUND);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_FULL);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_LIMITED);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen());
+ }
+
+ /**
+ * Test the enabled settings of lock screen status.
+ */
+ public void testLockScreenStatusDriverDistEnabled(){
+ LockScreenManager lockMan = new LockScreenManager();
+ lockMan.setDriverDistStatus(true);
+
+ // HMI level is null
+ OnLockScreenStatus result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_NONE);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_BACKGROUND);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_FULL);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_LIMITED);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen());
+ }
+
+ /**
+ * Test the disabled settings of lock screen status.
+ */
+ public void testLockScreenStatusDriverDistDisabled(){
+ LockScreenManager lockMan = new LockScreenManager();
+ lockMan.setDriverDistStatus(false);
+
+ OnLockScreenStatus result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_NONE);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_BACKGROUND);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_FULL);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OPTIONAL, result.getShowLockScreen());
+
+ lockMan.setHMILevel(HMILevel.HMI_LIMITED);
+ result = lockMan.getLockObj();
+ assertEquals(Test.MATCH, LockScreenStatus.OPTIONAL, result.getShowLockScreen());
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java
index 51727bb66..51727bb66 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java
new file mode 100644
index 000000000..4762bc2b9
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java
@@ -0,0 +1,1102 @@
+package com.smartdevicelink.test.proxy;
+
+import com.smartdevicelink.proxy.RPCRequestFactory;
+import com.smartdevicelink.proxy.TTSChunkFactory;
+import com.smartdevicelink.proxy.rpc.AddCommand;
+import com.smartdevicelink.proxy.rpc.AddSubMenu;
+import com.smartdevicelink.proxy.rpc.Alert;
+import com.smartdevicelink.proxy.rpc.ChangeRegistration;
+import com.smartdevicelink.proxy.rpc.Choice;
+import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
+import com.smartdevicelink.proxy.rpc.DeleteCommand;
+import com.smartdevicelink.proxy.rpc.DeleteFile;
+import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
+import com.smartdevicelink.proxy.rpc.DeleteSubMenu;
+import com.smartdevicelink.proxy.rpc.DeviceInfo;
+import com.smartdevicelink.proxy.rpc.EndAudioPassThru;
+import com.smartdevicelink.proxy.rpc.GetVehicleData;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.ListFiles;
+import com.smartdevicelink.proxy.rpc.PerformAudioPassThru;
+import com.smartdevicelink.proxy.rpc.PerformInteraction;
+import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
+import com.smartdevicelink.proxy.rpc.ScrollableMessage;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.SetAppIcon;
+import com.smartdevicelink.proxy.rpc.SetDisplayLayout;
+import com.smartdevicelink.proxy.rpc.SetGlobalProperties;
+import com.smartdevicelink.proxy.rpc.SetMediaClockTimer;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.Slider;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.Speak;
+import com.smartdevicelink.proxy.rpc.SubscribeButton;
+import com.smartdevicelink.proxy.rpc.SubscribeVehicleData;
+import com.smartdevicelink.proxy.rpc.SystemRequest;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
+import com.smartdevicelink.proxy.rpc.UnsubscribeButton;
+import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData;
+import com.smartdevicelink.proxy.rpc.VrHelpItem;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
+import com.smartdevicelink.test.NullValues;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import java.util.Vector;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.RPCRequestFactory}
+ */
+public class RPCRequestFactoryTests extends TestCase {
+
+ public void testBuildSystemRequest () {
+
+ String testData;
+ Integer testInt;
+ SystemRequest testBSR;
+ Vector<String> testVData;
+
+ // Test -- buildSystemRequest(String data, Integer correlationID)
+ testData = "test";
+ testInt = 0;
+ testBSR = RPCRequestFactory.buildSystemRequest(testData, testInt);
+ assertNotNull(Test.NOT_NULL, testBSR.getBulkData());
+ assertEquals(Test.MATCH, testInt, testBSR.getCorrelationID());
+
+ testBSR = RPCRequestFactory.buildSystemRequest(testData, null);
+ assertNotNull(Test.NULL, testBSR.getCorrelationID());
+
+ testBSR = RPCRequestFactory.buildSystemRequest(null, testInt);
+ assertNull(Test.NULL, testBSR);
+
+ // Test -- buildSystemRequestLegacy(Vector<String> data, Integer correlationID)
+ testVData = new Vector<String>();
+ testVData.add("Test A");
+ testVData.add("Test B");
+ testVData.add("Test C");
+ testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, testInt);
+ assertEquals(Test.MATCH, testVData, new Vector<String>(testBSR.getLegacyData()));
+ assertEquals(Test.MATCH, testInt, testBSR.getCorrelationID());
+
+ testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, null);
+ assertNotNull(Test.NOT_NULL, testBSR.getCorrelationID());
+
+ testBSR = RPCRequestFactory.buildSystemRequestLegacy(null, testInt);
+ assertNull(Test.NULL, testBSR);
+
+ // Issue #166 -- Null values within the Vector<String> parameter.
+ // TODO: Once resolved, add the following test.
+ //testVData = new Vector<String>();
+ //testVData.add("Test A");
+ //testVData.add("Test B");
+ //testVData.add(null);
+ //testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, testInt);
+ //assertNull(Test.NULL, testBSR);
+ }
+
+ public void testBuildAddCommand () {
+
+ Image testImage;
+ String testMenuText, testIconValue;
+ Integer testCommandID, testParentID, testPosition, testCorrelationID;
+ ImageType testIconType;
+ AddCommand testBAC;
+ Vector<String> testVrCommands;
+
+ // Test -- buildAddCommand(Integer commandID, String menuText, Integer parentID, Integer position,Vector<String> vrCommands, Image cmdIcon, Integer correlationID)
+ testImage = new Image();
+ testMenuText = "menu";
+ testPosition = 1;
+ testParentID = 2;
+ testCommandID = 3;
+ testCorrelationID = 4;
+ testVrCommands = new Vector<String>();
+ testImage.setImageType(ImageType.STATIC);
+ testImage.setValue("image");
+ testVrCommands.add("Test A");
+ testVrCommands.add("Test B");
+ testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testImage, testCorrelationID);
+ assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
+ assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
+ assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID());
+ assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition());
+ assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
+ assertTrue(Test.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon()));
+ assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
+
+ testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testBAC.getCmdID());
+ assertNull(Test.NULL, testBAC.getMenuParams());
+ assertNull(Test.NULL, testBAC.getVrCommands());
+ assertNull(Test.NULL, testBAC.getCmdIcon());
+ assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
+
+ // Test -- buildAddCommand(Integer commandID, String menuText, Integer parentID, Integer position, Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
+ testIconValue = "icon";
+ testIconType = ImageType.STATIC;
+ testImage = new Image();
+ testImage.setValue(testIconValue);
+ testImage.setImageType(testIconType);
+ testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testIconValue, testIconType, testCorrelationID);
+ assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
+ assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
+ assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID());
+ assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition());
+ assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
+ assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
+ assertTrue(Test.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon()));
+
+ testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testBAC.getCmdID());
+ assertNull(Test.NULL, testBAC.getMenuParams());
+ assertNull(Test.NULL, testBAC.getVrCommands());
+ assertNull(Test.NULL, testBAC.getCmdIcon());
+ assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
+
+ // Test -- buildAddCommand(Integer commandID, String menuText, Integer parentID, Integer position, Vector<String> vrCommands, Integer correlationID)
+ testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testCorrelationID);
+ assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
+ assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
+ assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID());
+ assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition());
+ assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
+ assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
+
+ testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null);
+ assertNull(Test.NULL, testBAC.getCmdID());
+ assertNull(Test.NULL, testBAC.getMenuParams());
+ assertNull(Test.NULL, testBAC.getVrCommands());
+ assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
+
+ // Test -- buildAddCommand(Integer commandID, String menuText, Vector<String> vrCommands, Integer correlationID)
+ testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testVrCommands, testCorrelationID);
+ assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
+ assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
+ assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
+ assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
+
+ testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null);
+ assertNull(Test.NULL, testBAC.getCmdID());
+ assertNull(Test.NULL, testBAC.getMenuParams());
+ assertNull(Test.NULL, testBAC.getVrCommands());
+ assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
+
+ // Test -- buildAddCommand(Integer commandID, Vector<String> vrCommands, Integer correlationID)
+ testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testVrCommands, testCorrelationID);
+ assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
+ assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
+ assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
+
+ testBAC = RPCRequestFactory.buildAddCommand(null, null, null);
+ assertNull(Test.NULL, testBAC.getCmdID());
+ assertNull(Test.NULL, testBAC.getVrCommands());
+ assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
+ }
+
+ public void testBuildAddSubMenu () {
+
+ Integer testMenuID, testCorrelationID, testPosition;
+ String testMenuName;
+ AddSubMenu testBASM;
+
+ // Test -- buildAddSubMenu(Integer menuID, String menuName, Integer correlationID)
+ // ^ Calls another build method.
+ // Test -- buildAddSubMenu(Integer menuID, String menuName, Integer position, Integer correlationID)
+ testMenuID = 0;
+ testMenuName = "name";
+ testPosition = 1;
+ testCorrelationID = 2;
+ testBASM = RPCRequestFactory.buildAddSubMenu(testMenuID, testMenuName, testPosition, testCorrelationID);
+ assertEquals(Test.MATCH, testMenuID, testBASM.getMenuID());
+ assertEquals(Test.MATCH, testMenuName, testBASM.getMenuName());
+ assertEquals(Test.MATCH, testPosition, testBASM.getPosition());
+ assertEquals(Test.MATCH, testCorrelationID, testBASM.getCorrelationID());
+
+ testBASM = RPCRequestFactory.buildAddSubMenu(null, null, null, null);
+ assertNull(Test.NULL, testBASM.getMenuID());
+ assertNull(Test.NULL, testBASM.getMenuName());
+ assertNull(Test.NULL, testBASM.getPosition());
+ assertNotNull(Test.NOT_NULL, testBASM.getCorrelationID());
+ }
+
+ public void testBuildAlert () {
+
+ Alert testAlert;
+ String testTTSText, testAlertText1, testAlertText2, testAlertText3;
+ Integer testCorrelationID, testDuration;
+ Boolean testPlayTone;
+ Vector<SoftButton> testSoftButtons;
+ Vector<TTSChunk> testTtsChunks;
+
+ // Test -- buildAlert(String ttsText, Boolean playTone, Vector<SoftButton> softButtons, Integer correlationID)
+ testTTSText = "simple test";
+ testCorrelationID = 0;
+ testPlayTone = true;
+ testSoftButtons = new Vector<SoftButton>();
+ SoftButton test1 = new SoftButton();
+ test1.setText("test 1");
+ SoftButton test2 = new SoftButton();
+ test2.setText("test 2");
+ testSoftButtons.add(test1);
+ testSoftButtons.add(test2);
+ testAlert = RPCRequestFactory.buildAlert(testTTSText, testPlayTone, testSoftButtons, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(TTSChunkFactory.createSimpleTTSChunks(testTTSText), testAlert.getTtsChunks()));
+ // ^ Calls another build method.
+
+ // Test -- buildAlert(String alertText1, String alertText2, String alertText3, Integer duration, Vector<SoftButton> softButtons, Integer correlationID)
+ testAlertText1 = "test 1";
+ testAlertText2 = "test 2";
+ testAlertText3 = "test 3";
+ testDuration = 1;
+ // ^ Calls another build method.
+
+ // Test -- buildAlert(String ttsText, String alertText1, String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID)
+ testAlert = RPCRequestFactory.buildAlert(testTTSText, testAlertText1, testAlertText2, testAlertText3, testPlayTone, testDuration, testSoftButtons, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(TTSChunkFactory.createSimpleTTSChunks(testTTSText), testAlert.getTtsChunks()));
+ // ^ Calls another build method.
+
+ // Test -- buildAlert(Vector<TTSChunk> chunks, Boolean playTone, Vector<SoftButton> softButtons, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildAlert(Vector<TTSChunk> ttsChunks, String alertText1, String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID)
+ testTtsChunks = TTSChunkFactory.createSimpleTTSChunks(testTTSText);
+ testAlert = RPCRequestFactory.buildAlert(testTtsChunks, testAlertText1, testAlertText2, testAlertText3, testPlayTone, testDuration, testSoftButtons, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks()));
+ assertEquals(Test.MATCH, testAlertText1, testAlert.getAlertText1());
+ assertEquals(Test.MATCH, testAlertText2, testAlert.getAlertText2());
+ assertEquals(Test.MATCH, testAlertText3, testAlert.getAlertText3());
+ assertEquals(Test.MATCH, testPlayTone, testAlert.getPlayTone());
+ assertEquals(Test.MATCH, testDuration, testAlert.getDuration());
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testAlert.getSoftButtons()));
+ assertEquals(Test.MATCH, testCorrelationID, testAlert.getCorrelationID());
+
+ testAlert = RPCRequestFactory.buildAlert((Vector<TTSChunk>) null, null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testAlert.getTtsChunks());
+ assertNull(Test.NULL, testAlert.getAlertText1());
+ assertNull(Test.NULL, testAlert.getAlertText2());
+ assertNull(Test.NULL, testAlert.getAlertText3());
+ assertNull(Test.NULL, testAlert.getPlayTone());
+ assertNull(Test.NULL, testAlert.getDuration());
+ assertNull(Test.NULL, testAlert.getSoftButtons());
+ assertNotNull(Test.NOT_NULL, testAlert.getCorrelationID());
+
+ // Test -- buildAlert(String ttsText, Boolean playTone, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildAlert(String alertText1, String alertText2, Integer duration, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildAlert(String ttsText, String alertText1, String alertText2, Boolean playTone, Integer duration, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildAlert(Vector<TTSChunk> chunks, Boolean playTone, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildAlert(Vector<TTSChunk> ttsChunks, String alertText1, String alertText2, Boolean playTone, Integer duration, Integer correlationID)
+ testAlert = RPCRequestFactory.buildAlert(testTtsChunks, testAlertText1, testAlertText2, testPlayTone, testDuration, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks()));
+ assertEquals(Test.MATCH, testAlertText1, testAlert.getAlertText1());
+ assertEquals(Test.MATCH, testAlertText2, testAlert.getAlertText2());
+ assertEquals(Test.MATCH, testPlayTone, testAlert.getPlayTone());
+ assertEquals(Test.MATCH, testDuration, testAlert.getDuration());
+ assertEquals(Test.MATCH, testCorrelationID, testAlert.getCorrelationID());
+
+ testAlert = RPCRequestFactory.buildAlert((Vector<TTSChunk>) null, null, null, null, null, null);
+ assertNull(Test.NULL, testAlert.getTtsChunks());
+ assertNull(Test.NULL, testAlert.getAlertText1());
+ assertNull(Test.NULL, testAlert.getAlertText2());
+ assertNull(Test.NULL, testAlert.getPlayTone());
+ assertNull(Test.NULL, testAlert.getDuration());
+ assertNotNull(Test.NOT_NULL, testAlert.getCorrelationID());
+ }
+
+ public void testBuildCreateInteractionChoiceSet () {
+
+ Integer testICSID, testCorrelationID;
+ Vector<Choice> testChoiceSet;
+ CreateInteractionChoiceSet testBCICS;
+
+ // Test --buildCreateInteractionChoiceSet(Vector<Choice> choiceSet, Integer interactionChoiceSetID, Integer correlationID)
+ testICSID = 0;
+ testCorrelationID = 1;
+ testChoiceSet = new Vector<Choice>();
+ Choice testChoice = new Choice();
+ testChoiceSet.add(testChoice);
+ testBCICS = RPCRequestFactory.buildCreateInteractionChoiceSet(testChoiceSet, testICSID, testCorrelationID);
+ assertEquals(Test.MATCH, testChoiceSet, testBCICS.getChoiceSet());
+ assertEquals(Test.MATCH, testICSID, testBCICS.getInteractionChoiceSetID());
+ assertEquals(Test.MATCH, testCorrelationID, testBCICS.getCorrelationID());
+
+ testBCICS = RPCRequestFactory.buildCreateInteractionChoiceSet(null, null, null);
+ assertNull(Test.NULL, testBCICS.getChoiceSet());
+ assertNull(Test.NULL, testBCICS.getInteractionChoiceSetID());
+ assertNotNull(Test.NOT_NULL, testBCICS.getCorrelationID());
+ }
+
+ public void testBuildDeleteCommand () {
+
+ Integer testCID, testCorrelationID;
+ DeleteCommand testDC;
+
+ // Test -- buildDeleteCommand(Integer commandID, Integer correlationID)
+ testCID = 0;
+ testCorrelationID = 1;
+ testDC = RPCRequestFactory.buildDeleteCommand(testCID, testCorrelationID);
+ assertEquals(Test.MATCH, testCID, testDC.getCmdID());
+ assertEquals(Test.MATCH, testCorrelationID, testDC.getCorrelationID());
+
+ testDC = RPCRequestFactory.buildDeleteCommand(null, null);
+ assertNull(Test.NULL, testDC.getCmdID());
+ assertNotNull(Test.NOT_NULL, testDC.getCorrelationID());
+
+ }
+
+ public void testBuildDeleteFile () {
+
+ Integer testCorrelationID;
+ String testFileName;
+ DeleteFile testDF;
+
+ // Test --buildDeleteFile(String sdlFileName, Integer correlationID)
+ testCorrelationID = 0;
+ testFileName = "test";
+ testDF = RPCRequestFactory.buildDeleteFile(testFileName, testCorrelationID);
+ assertEquals(Test.MATCH, testCorrelationID, testDF.getCorrelationID());
+ assertEquals(Test.MATCH, testFileName, testDF.getSdlFileName());
+
+ testDF = RPCRequestFactory.buildDeleteFile(null, null);
+ assertNotNull(Test.NOT_NULL, testDF.getCorrelationID());
+ assertNull(Test.NULL, testDF.getSdlFileName());
+
+ }
+
+ public void testBuildDeleteInteractionChoiceSet () {
+
+ Integer testICSID, testCorrelationID;
+ DeleteInteractionChoiceSet testDICS;
+
+ // Test -- buildDeleteInteractionChoiceSet(Integer interactionChoiceSetID, Integer correlationID)
+ testICSID = 0;
+ testCorrelationID = 1;
+ testDICS = RPCRequestFactory.buildDeleteInteractionChoiceSet(testICSID, testCorrelationID);
+ assertEquals(Test.MATCH, testICSID, testDICS.getInteractionChoiceSetID());
+ assertEquals(Test.MATCH, testCorrelationID, testDICS.getCorrelationID());
+
+ testDICS = RPCRequestFactory.buildDeleteInteractionChoiceSet(null, null);
+ assertNull(Test.NULL, testDICS.getInteractionChoiceSetID());
+ assertNotNull(Test.NOT_NULL, testDICS.getCorrelationID());
+ }
+
+ public void testBuildDeleteSubMenu () {
+
+ Integer testMenuID, testCorrelationID;
+ DeleteSubMenu testDSM;
+
+ // Test -- buildDeleteSubMenu(Integer menuID, Integer correlationID)
+ testMenuID = 0;
+ testCorrelationID = 1;
+ testDSM = RPCRequestFactory.buildDeleteSubMenu(testMenuID, testCorrelationID);
+ assertEquals(Test.MATCH, testMenuID, testDSM.getMenuID());
+ assertEquals(Test.MATCH, testCorrelationID, testDSM.getCorrelationID());
+
+ testDSM = RPCRequestFactory.buildDeleteSubMenu(null, null);
+ assertNull(Test.NULL, testDSM.getMenuID());
+ assertNotNull(Test.NOT_NULL, testDSM.getCorrelationID());
+ }
+
+ public void testBuildListFiles () {
+
+ Integer testCorrelationID = 0;
+ ListFiles testLF;
+
+ // Test -- buildListFiles(Integer correlationID)
+ testLF = RPCRequestFactory.buildListFiles(testCorrelationID);
+ assertEquals(Test.MATCH, testCorrelationID, testLF.getCorrelationID());
+
+ testLF = RPCRequestFactory.buildListFiles(null);
+ assertNotNull(Test.NOT_NULL, testLF.getCorrelationID());
+ }
+
+ @SuppressWarnings("deprecation")
+ public void testBuildPerformInteraction () {
+
+ String testDisplayText = "test";
+ Integer testTimeout = 1, testCorrelationID = 0;
+ InteractionMode testIM = InteractionMode.BOTH;
+ Vector<TTSChunk> testInitChunks, testHelpChunks, testTimeoutChunks;
+ Vector<Integer> testCSIDs;
+ Vector<VrHelpItem> testVrHelpItems;
+ PerformInteraction testPI;
+
+ // Test -- buildPerformInteraction(Vector<TTSChunk> initChunks, String displayText, Vector<Integer> interactionChoiceSetIDList, Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp, Integer correlationID)
+ testInitChunks = TTSChunkFactory.createSimpleTTSChunks("init chunks");
+ testHelpChunks = TTSChunkFactory.createSimpleTTSChunks("help items");
+ testTimeoutChunks = TTSChunkFactory.createSimpleTTSChunks("timeout");
+ testVrHelpItems = new Vector<VrHelpItem>();
+ VrHelpItem testItem = new VrHelpItem();
+ testItem.setPosition(0);
+ testItem.setText("text");
+ Image image = new Image();
+ image.setValue("value");
+ image.setImageType(ImageType.DYNAMIC);
+ testItem.setImage(image);
+ testVrHelpItems.add(testItem);
+ testCSIDs = new Vector<Integer>();
+ testCSIDs.add(0);
+ testCSIDs.add(1);
+ testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testTimeoutChunks, testIM, testTimeout, testVrHelpItems, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
+ assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText());
+ assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt()));
+ assertEquals(Test.MATCH, testIM, testPI.getInteractionMode());
+ assertEquals(Test.MATCH, testTimeout, testPI.getTimeout());
+ assertTrue(Test.TRUE, Validator.validateVrHelpItems(testVrHelpItems, testPI.getVrHelp()));
+ assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID());
+
+ testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testPI.getInitialPrompt());
+ assertNull(Test.NULL, testPI.getInitialText());
+ assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList());
+ assertNull(Test.NULL, testPI.getHelpPrompt());
+ assertNull(Test.NULL, testPI.getTimeoutPrompt());
+ assertNull(Test.NULL, testPI.getInteractionMode());
+ assertNull(Test.NULL, testPI.getTimeout());
+ assertNull(Test.NULL, testPI.getVrHelp());
+ assertNotNull(Test.NOT_NULL, testPI.getCorrelationID());
+
+ // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildPerformInteraction(String initPrompt, String displayText, Integer interactionChoiceSetID, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildPerformInteraction(String initPrompt, String displayText, Integer interactionChoiceSetID, Vector<VrHelpItem> vrHelp, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildPerformInteraction(Vector<TTSChunk> initChunks, String displayText, Vector<Integer> interactionChoiceSetIDList, Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, InteractionMode interactionMode, Integer timeout, Integer correlationID)
+ testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testTimeoutChunks, testIM, testTimeout, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
+ assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText());
+ assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt()));
+ assertEquals(Test.MATCH, testIM, testPI.getInteractionMode());
+ assertEquals(Test.MATCH, testTimeout, testPI.getTimeout());
+ assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID());
+
+ testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testPI.getInitialPrompt());
+ assertNull(Test.NULL, testPI.getInitialText());
+ assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList());
+ assertNull(Test.NULL, testPI.getHelpPrompt());
+ assertNull(Test.NULL, testPI.getTimeoutPrompt());
+ assertNull(Test.NULL, testPI.getInteractionMode());
+ assertNull(Test.NULL, testPI.getTimeout());
+ assertNotNull(Test.NOT_NULL, testPI.getCorrelationID());
+
+ // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildPerformInteraction(String initPrompt, String displayText, Integer interactionChoiceSetID, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildPerformInteraction(String initPrompt, String displayText, Integer interactionChoiceSetID, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildPerformInteraction(Vector<TTSChunk> initChunks, String displayText, Vector<Integer> interactionChoiceSetIDList, Vector<TTSChunk> helpChunks, InteractionMode interactionMode, Integer timeout, Integer correlationID)
+ testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testIM, testTimeout, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
+ assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText());
+ assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
+ assertEquals(Test.MATCH, testIM, testPI.getInteractionMode());
+ assertEquals(Test.MATCH, testTimeout, testPI.getTimeout());
+ assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID());
+
+ testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testPI.getInitialPrompt());
+ assertNull(Test.NULL, testPI.getInitialText());
+ assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList());
+ assertNull(Test.NULL, testPI.getHelpPrompt());
+ assertNull(Test.NULL, testPI.getInteractionMode());
+ assertNull(Test.NULL, testPI.getTimeout());
+ assertNotNull(Test.NOT_NULL, testPI.getCorrelationID());
+
+ // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, InteractionMode interactionMode, Integer timeout, Integer correlationID)
+ // ^ Calls another build method.
+ }
+
+ public void testBuildPutFiles () {
+
+ String testFileName = "test";
+ Boolean testPFile = true, testSystemFile = true;
+ Integer testCorrelationID = 0;
+ Long testOffset = 1L, testLength = 2L;
+ FileType testFileType = FileType.BINARY;
+ byte[] testFileData = {(byte) 0x00, (byte) 0x01, (byte) 0x02 };
+ PutFile testPF;
+
+ // Test -- buildPutFile(String sdlFileName, FileType fileType, Boolean persistentFile, byte[] fileData, Integer correlationID)
+ testPF = RPCRequestFactory.buildPutFile(testFileName, testFileType, testPFile, testFileData, testCorrelationID);
+ assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName());
+ assertEquals(Test.MATCH, testFileType, testPF.getFileType());
+ assertEquals(Test.MATCH, testPFile, testPF.getPersistentFile());
+ assertTrue(Test.TRUE, Validator.validateBulkData(testFileData, testPF.getFileData()));
+ assertEquals(Test.MATCH, testCorrelationID, testPF.getCorrelationID());
+
+ testPF = RPCRequestFactory.buildPutFile(null, null, null, null, null);
+ assertNull(Test.NULL, testPF.getSdlFileName());
+ assertNull(Test.NULL, testPF.getFileType());
+ assertNull(Test.NULL, testPF.getPersistentFile());
+ assertNull(Test.NULL, testPF.getFileData());
+ assertNotNull(Test.NOT_NULL, testPF.getCorrelationID());
+
+ // Test -- buildPutFile(String sdlFileName, Integer iOffset, Integer iLength)
+ testPF = RPCRequestFactory.buildPutFile(testFileName, testOffset, testLength);
+ assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName());
+ assertEquals(Test.MATCH, testOffset, testPF.getOffset());
+ assertEquals(Test.MATCH, testLength, testPF.getLength());
+
+ testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER);
+ assertNull(Test.NULL, testPF.getSdlFileName());
+ assertNull(Test.NULL, testPF.getOffset());
+ assertNull(Test.NULL, testPF.getLength());
+
+ // Test -- buildPutFile(String syncFileName, Integer iOffset, Integer iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile)
+ testPF = RPCRequestFactory.buildPutFile(testFileName, testOffset, testLength, testFileType, testPFile, testSystemFile);
+ assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName());
+ assertEquals(Test.MATCH, testOffset, testPF.getOffset());
+ assertEquals(Test.MATCH, testLength, testPF.getLength());
+ assertTrue(Test.TRUE, testPF.getPersistentFile());
+ assertEquals(Test.MATCH, testSystemFile, testPF.getSystemFile());
+
+ testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER, null, NullValues.BOOLEAN, NullValues.BOOLEAN);
+ assertNull(Test.NULL, testPF.getSdlFileName());
+ assertNull(Test.NULL, testPF.getOffset());
+ assertNull(Test.NULL, testPF.getLength());
+ assertNull(Test.NULL, testPF.getFileType());
+ assertNull(Test.NULL, testPF.getPersistentFile());
+ assertNull(Test.NULL, testPF.getSystemFile());
+ }
+
+ public void testBuildRegisterAppInterface () {
+
+ SdlMsgVersion testSMV = new SdlMsgVersion();
+ testSMV.setMajorVersion(1);
+ testSMV.setMinorVersion(0);
+ String testAppName = "test", testNGN = "ngn", testAppID = "id";
+ Vector<TTSChunk> testTTSName = TTSChunkFactory.createSimpleTTSChunks("name");
+ Vector<String> testSynonyms = new Vector<String>();
+ testSynonyms.add("examine");
+ Boolean testIMA = false;
+ Integer testCorrelationID = 0;
+ Language testLang = Language.EN_US, testHMILang = Language.EN_GB;
+ Vector<AppHMIType> testHMIType = new Vector<AppHMIType>();
+ testHMIType.add(AppHMIType.DEFAULT);
+ DeviceInfo testDI = RPCRequestFactory.BuildDeviceInfo(null);
+ RegisterAppInterface testRAI;
+
+ // Test -- buildRegisterAppInterface(String appName, String appID)
+ // ^ Calls another build method.
+
+ // Test -- buildRegisterAppInterface(String appName, Boolean isMediaApp, String appID)
+ // ^ Calls another build method.
+
+ // Test -- buildRegisterAppInterface(SdlMsgVersion sdlMsgVersion, String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID, Integer correlationID)
+ testRAI = RPCRequestFactory.buildRegisterAppInterface(testSMV, testAppName, testTTSName, testNGN, testSynonyms, testIMA, testLang, testHMILang, testHMIType, testAppID, testCorrelationID,testDI);
+ assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(testSMV, testRAI.getSdlMsgVersion()));
+ assertEquals(Test.MATCH, testAppName, testRAI.getAppName());
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSName, testRAI.getTtsName()));
+ assertEquals(Test.MATCH, testNGN, testRAI.getNgnMediaScreenAppName());
+ assertTrue(Test.TRUE, Validator.validateStringList(testSynonyms, testRAI.getVrSynonyms()));
+ assertEquals(Test.MATCH, testIMA, testRAI.getIsMediaApplication());
+ assertEquals(Test.MATCH, testLang, testRAI.getLanguageDesired());
+ assertEquals(Test.MATCH, testHMILang, testRAI.getHmiDisplayLanguageDesired());
+ assertEquals(Test.MATCH, AppHMIType.DEFAULT, testRAI.getAppHMIType().get(0));
+ assertEquals(Test.MATCH, testAppID, testRAI.getAppID());
+ assertEquals(Test.MATCH, testCorrelationID, testRAI.getCorrelationID());
+ assertEquals(Test.MATCH, testDI, testRAI.getDeviceInfo());
+
+
+ testRAI = RPCRequestFactory.buildRegisterAppInterface(null, null, null, null, null, null, null, null, null, null, null,null);
+ assertEquals(Test.MATCH, (Integer) 1, testRAI.getCorrelationID());
+ assertEquals(Test.MATCH, testSMV.getMajorVersion(), testRAI.getSdlMsgVersion().getMajorVersion());
+ assertEquals(Test.MATCH, testSMV.getMinorVersion(), testRAI.getSdlMsgVersion().getMinorVersion());
+ assertNull(Test.NULL, testRAI.getAppName());
+ assertNull(Test.NULL, testRAI.getTtsName());
+ assertNull(Test.NULL, testRAI.getNgnMediaScreenAppName());
+ assertNull(Test.NULL, testRAI.getVrSynonyms());
+ assertNull(Test.NULL, testRAI.getIsMediaApplication());
+ assertNotNull(Test.NOT_NULL, testRAI.getLanguageDesired());
+ assertNotNull(Test.NOT_NULL, testRAI.getHmiDisplayLanguageDesired());
+ assertNull(Test.NULL, testRAI.getAppHMIType());
+ assertNull(Test.NULL, testRAI.getAppID());
+ assertNull(Test.NULL, testRAI.getDeviceInfo());
+ }
+
+ public void testBuildSetAppIcon () {
+
+ String testFileName = "test";
+ Integer testCorrelationID = 0;
+ SetAppIcon testSAI;
+
+ // Test -- buildSetAppIcon(String sdlFileName, Integer correlationID)
+ testSAI = RPCRequestFactory.buildSetAppIcon(testFileName, testCorrelationID);
+ assertEquals(Test.MATCH, testFileName, testSAI.getSdlFileName());
+ assertEquals(Test.MATCH, testCorrelationID, testSAI.getCorrelationID());
+
+ testSAI = RPCRequestFactory.buildSetAppIcon(null, null);
+ assertNull(Test.NULL, testSAI.getSdlFileName());
+ assertNotNull(Test.NOT_NULL, testSAI.getCorrelationID());
+
+ }
+
+ public void testBuildSetGlobalProperties () {
+
+ Vector<TTSChunk> testHelpChunks = TTSChunkFactory.createSimpleTTSChunks("test"),
+ testTimeoutChunks = TTSChunkFactory.createSimpleTTSChunks("timeout");
+ Vector<VrHelpItem> testVrHelp = new Vector<VrHelpItem>();
+ VrHelpItem testItem = new VrHelpItem();
+ testItem.setPosition(0);
+ testItem.setText("text");
+ Image image = new Image();
+ image.setValue("value");
+ image.setImageType(ImageType.DYNAMIC);
+ testItem.setImage(image);
+ testVrHelp.add(testItem);
+ Integer testCorrelationID = 0;
+ String testHelpTitle = "help";
+ SetGlobalProperties testSBP;
+
+ // Test -- buildSetGlobalProperties(String helpPrompt, String timeoutPrompt, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildSetGlobalProperties(Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, Integer correlationID)
+ testSBP = RPCRequestFactory.buildSetGlobalProperties(testHelpChunks, testTimeoutChunks, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt()));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt()));
+ assertEquals(Test.MATCH, testCorrelationID, testSBP.getCorrelationID());
+
+ testSBP = RPCRequestFactory.buildSetGlobalProperties((Vector<TTSChunk>) null, null, null);
+ assertNull(Test.NULL, testSBP.getHelpPrompt());
+ assertNull(Test.NULL, testSBP.getTimeoutPrompt());
+ assertNotNull(Test.NOT_NULL, testSBP.getCorrelationID());
+
+ // Test -- buildSetGlobalProperties(String helpPrompt, String timeoutPrompt, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildSetGlobalProperties(Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID)
+ testSBP = RPCRequestFactory.buildSetGlobalProperties(testHelpChunks, testTimeoutChunks, testHelpTitle, testVrHelp, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt()));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt()));
+ assertEquals(Test.MATCH, testHelpTitle, testSBP.getVrHelpTitle());
+ assertTrue(Test.TRUE, Validator.validateVrHelpItems(testVrHelp, testSBP.getVrHelp()));
+ assertEquals(Test.MATCH, testCorrelationID, testSBP.getCorrelationID());
+
+ testSBP = RPCRequestFactory.buildSetGlobalProperties((Vector<TTSChunk>) null, null, null, null, null);
+ assertNull(Test.NULL, testSBP.getHelpPrompt());
+ assertNull(Test.NULL, testSBP.getTimeoutPrompt());
+ assertNull(Test.NULL, testSBP.getVrHelpTitle());
+ assertNull(Test.NULL, testSBP.getVrHelp());
+ assertNotNull(Test.NOT_NULL, testSBP.getCorrelationID());
+ }
+
+ public void testBuildSetMediaClockTimer () {
+
+ Integer hours = 0, minutes = 0, seconds = 0, testCorrelationID = 0;
+ UpdateMode testMode = UpdateMode.COUNTUP;
+ SetMediaClockTimer testSMCT;
+
+ // Test -- buildSetMediaClockTimer(Integer hours, Integer minutes, Integer seconds, UpdateMode updateMode, Integer correlationID)
+ testSMCT = RPCRequestFactory.buildSetMediaClockTimer(hours, minutes, seconds, testMode, testCorrelationID);
+ assertEquals(Test.MATCH, hours, testSMCT.getStartTime().getHours());
+ assertEquals(Test.MATCH, minutes, testSMCT.getStartTime().getMinutes());
+ assertEquals(Test.MATCH, seconds, testSMCT.getStartTime().getSeconds());
+ assertEquals(Test.MATCH, testMode, testSMCT.getUpdateMode());
+ assertEquals(Test.MATCH, testCorrelationID, testSMCT.getCorrelationID());
+
+ testSMCT = RPCRequestFactory.buildSetMediaClockTimer(null, null, null, null, null);
+ assertNull(Test.NULL, testSMCT.getStartTime());
+ assertNull(Test.NULL, testSMCT.getUpdateMode());
+ assertNotNull(Test.NOT_NULL, testSMCT.getCorrelationID());
+
+ // Test -- buildSetMediaClockTimer(UpdateMode updateMode, Integer correlationID)
+ // ^ Calls another build method.
+ }
+
+ @SuppressWarnings("deprecation")
+ public void testBuildShow () {
+
+ Image testGraphic = new Image();
+ testGraphic.setImageType(ImageType.STATIC);
+ testGraphic.setValue("test");
+ String testText1 = "test1", testText2 = "test2", testText3 = "test3", testText4 = "test4", testStatusBar = "status", testMediaClock = "media", testMediaTrack = "track";
+ Vector<SoftButton> testSoftButtons = new Vector<SoftButton>();
+ testSoftButtons.add(new SoftButton());
+ Vector<String> testCustomPresets = new Vector<String>();
+ testCustomPresets.add("Test");
+ TextAlignment testAlignment = TextAlignment.CENTERED;
+ Integer testCorrelationID = 0;
+ Show testShow;
+
+ // Test -- buildShow(String mainText1, String mainText2, String mainText3, String mainText4, String statusBar, String mediaClock, String mediaTrack, Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets, TextAlignment alignment, Integer correlationID)
+ testShow = RPCRequestFactory.buildShow(testText1, testText2, testText3, testText4, testStatusBar, testMediaClock, testMediaTrack, testGraphic, testSoftButtons, testCustomPresets, testAlignment, testCorrelationID);
+ assertEquals(Test.MATCH, testText1, testShow.getMainField1());
+ assertEquals(Test.MATCH, testText2, testShow.getMainField2());
+ assertEquals(Test.MATCH, testText3, testShow.getMainField3());
+ assertEquals(Test.MATCH, testText4, testShow.getMainField4());
+ assertEquals(Test.MATCH, testStatusBar, testShow.getStatusBar());
+ assertEquals(Test.MATCH, testMediaClock, testShow.getMediaClock());
+ assertEquals(Test.MATCH, testMediaTrack, testShow.getMediaTrack());
+ assertTrue(Test.TRUE, Validator.validateImage(testGraphic, testShow.getGraphic()));
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testShow.getSoftButtons()));
+ assertTrue(Test.TRUE, Validator.validateStringList(testCustomPresets, testShow.getCustomPresets()));
+ assertEquals(Test.MATCH, testAlignment, testShow.getAlignment());
+ assertEquals(Test.MATCH, testCorrelationID, testShow.getCorrelationID());
+
+ testShow = RPCRequestFactory.buildShow(null, null, null, null, null, null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testShow.getMainField1());
+ assertNull(Test.NULL, testShow.getMainField2());
+ assertNull(Test.NULL, testShow.getMainField3());
+ assertNull(Test.NULL, testShow.getMainField4());
+ assertNull(Test.NULL, testShow.getStatusBar());
+ assertNull(Test.NULL, testShow.getMediaClock());
+ assertNull(Test.NULL, testShow.getMediaTrack());
+ assertNull(Test.NULL, testShow.getGraphic());
+ assertNull(Test.NULL, testShow.getSoftButtons());
+ assertNull(Test.NULL, testShow.getCustomPresets());
+ assertNull(Test.NULL, testShow.getAlignment());
+ assertNotNull(Test.NOT_NULL, testShow.getCorrelationID());
+ // Test -- buildShow(String mainText1, String mainText2, String mainText3, String mainText4, TextAlignment alignment, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- buildShow(String mainText1, String mainText2, String statusBar, String mediaClock, String mediaTrack, TextAlignment alignment, Integer correlationID)
+ testShow = RPCRequestFactory.buildShow(testText1, testText2, testStatusBar, testMediaClock, testMediaTrack, testAlignment, testCorrelationID);
+ assertEquals(Test.MATCH, testText1, testShow.getMainField1());
+ assertEquals(Test.MATCH, testText2, testShow.getMainField2());
+ assertEquals(Test.MATCH, testStatusBar, testShow.getStatusBar());
+ assertEquals(Test.MATCH, testMediaClock, testShow.getMediaClock());
+ assertEquals(Test.MATCH, testMediaTrack, testShow.getMediaTrack());
+ assertEquals(Test.MATCH, testAlignment, testShow.getAlignment());
+ assertEquals(Test.MATCH, testCorrelationID, testShow.getCorrelationID());
+
+ testShow = RPCRequestFactory.buildShow(null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testShow.getMainField1());
+ assertNull(Test.NULL, testShow.getMainField2());
+ assertNull(Test.NULL, testShow.getStatusBar());
+ assertNull(Test.NULL, testShow.getMediaClock());
+ assertNull(Test.NULL, testShow.getMediaTrack());
+ assertNull(Test.NULL, testShow.getAlignment());
+ assertNotNull(Test.NOT_NULL, testShow.getCorrelationID());
+
+ // Test -- buildShow(String mainText1, String mainText2, TextAlignment alignment, Integer correlationID)
+ // ^ Calls another build method.
+ }
+
+ public void testBuildSpeak () {
+
+ String testTTSText = "test";
+ Integer testCorrelationID = 0;
+ Vector<TTSChunk> testTTSChunks = TTSChunkFactory.createSimpleTTSChunks(testTTSText);
+ Speak testSpeak;
+
+ // Test -- buildSpeak(String ttsText, Integer correlationID)
+ testSpeak = RPCRequestFactory.buildSpeak(testTTSText, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks()));
+ assertEquals(Test.MATCH, testCorrelationID, testSpeak.getCorrelationID());
+
+ testSpeak = RPCRequestFactory.buildSpeak((String) null, null);
+ assertNull(Test.NULL, testSpeak.getTtsChunks());
+ assertNotNull(Test.NOT_NULL, testSpeak.getCorrelationID());
+
+ // Test -- buildSpeak(Vector<TTSChunk> ttsChunks, Integer correlationID)
+ testSpeak = RPCRequestFactory.buildSpeak(testTTSChunks, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks()));
+ assertEquals(Test.MATCH, testCorrelationID, testSpeak.getCorrelationID());
+
+ testSpeak = RPCRequestFactory.buildSpeak((Vector<TTSChunk>) null, null);
+ assertNull(Test.NULL, testSpeak.getTtsChunks());
+ assertNotNull(Test.NOT_NULL, testSpeak.getCorrelationID());
+ }
+
+ public void testBuildSubscribeButton () {
+
+ ButtonName testButtonName = ButtonName.CUSTOM_BUTTON;
+ Integer testCorrelationID = 0;
+ SubscribeButton testSB;
+
+ // Test -- buildSubscribeButton(ButtonName buttonName, Integer correlationID)
+ testSB = RPCRequestFactory.buildSubscribeButton(testButtonName, testCorrelationID);
+ assertEquals(Test.MATCH, testButtonName, testSB.getButtonName());
+ assertEquals(Test.MATCH, testCorrelationID, testSB.getCorrelationID());
+
+ testSB = RPCRequestFactory.buildSubscribeButton(null, null);
+ assertNull(Test.NULL, testSB.getButtonName());
+ assertNotNull(Test.NOT_NULL, testSB.getCorrelationID());
+
+ }
+
+ public void testBuildUnregisterAppInterface () {
+
+ Integer testCorrelationID = 0;
+ UnregisterAppInterface testUAI;
+
+ // Test -- buildUnregisterAppInterface(Integer correlationID)
+ testUAI = RPCRequestFactory.buildUnregisterAppInterface(testCorrelationID);
+ assertEquals(Test.MATCH, testCorrelationID, testUAI.getCorrelationID());
+
+ testUAI = RPCRequestFactory.buildUnregisterAppInterface(null);
+ assertNotNull(Test.NOT_NULL, testUAI.getCorrelationID());
+ }
+
+ public void testBuildUnsubscribeButton () {
+
+ ButtonName testButtonName = ButtonName.CUSTOM_BUTTON;
+ Integer testCorrelationID = 0;
+ UnsubscribeButton testUB;
+
+ // Test -- buildUnsubscribeButton(ButtonName buttonName, Integer correlationID)
+ testUB = RPCRequestFactory.buildUnsubscribeButton(testButtonName, testCorrelationID);
+ assertEquals(Test.MATCH, testButtonName, testUB.getButtonName());
+ assertEquals(Test.MATCH, testCorrelationID, testUB.getCorrelationID());
+
+ testUB = RPCRequestFactory.buildUnsubscribeButton(null, null);
+ assertNull(Test.NULL, testUB.getButtonName());
+ assertNotNull(Test.NOT_NULL, testUB.getCorrelationID());
+
+ }
+
+ public void testBuildSubscribeVehicleData () {
+
+ boolean testGPS = true, testSpeed = true, testRPM = true, testFuelLevel = true, testFuelLevelState = true, testInstantFuelConsumption = true, testExternalTemperature = true, testPRNDL = true, testTirePressure = true, testOdometer = true, testBeltStatus = true, testBodyInformation = true, testDeviceStatus = true, testDriverBraking = true;
+ Integer testCorrelationID = 0;
+ SubscribeVehicleData testSVD;
+
+ // Test -- BuildSubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID)
+ testSVD = RPCRequestFactory.BuildSubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID);
+ assertTrue(Test.TRUE, testSVD.getGps());
+ assertTrue(Test.TRUE, testSVD.getSpeed());
+ assertTrue(Test.TRUE, testSVD.getRpm());
+ assertTrue(Test.TRUE, testSVD.getFuelLevel());
+ assertTrue(Test.TRUE, testSVD.getFuelLevelState());
+ assertTrue(Test.TRUE, testSVD.getInstantFuelConsumption());
+ assertTrue(Test.TRUE, testSVD.getExternalTemperature());
+ assertTrue(Test.TRUE, testSVD.getPrndl());
+ assertTrue(Test.TRUE, testSVD.getTirePressure());
+ assertTrue(Test.TRUE, testSVD.getOdometer());
+ assertTrue(Test.TRUE, testSVD.getBeltStatus());
+ assertTrue(Test.TRUE, testSVD.getBodyInformation());
+ assertTrue(Test.TRUE, testSVD.getDeviceStatus());
+ assertTrue(Test.TRUE, testSVD.getDriverBraking());
+ assertEquals(Test.MATCH, testCorrelationID, testSVD.getCorrelationID());
+
+ testSVD = RPCRequestFactory.BuildSubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
+ assertNotNull(Test.NULL, testSVD.getCorrelationID());
+ }
+
+ public void testBuildUnsubscribeVehicleData () {
+
+ boolean testGPS = true, testSpeed = true, testRPM = true, testFuelLevel = true, testFuelLevelState = true, testInstantFuelConsumption = true, testExternalTemperature = true, testPRNDL = true, testTirePressure = true, testOdometer = true, testBeltStatus = true, testBodyInformation = true, testDeviceStatus = true, testDriverBraking = true;
+ Integer testCorrelationID = 0;
+ UnsubscribeVehicleData testUVD;
+
+ // Test -- BuildUnsubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID)
+ testUVD = RPCRequestFactory.BuildUnsubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID);
+ assertTrue(Test.TRUE, testUVD.getGps());
+ assertTrue(Test.TRUE, testUVD.getSpeed());
+ assertTrue(Test.TRUE, testUVD.getRpm());
+ assertTrue(Test.TRUE, testUVD.getFuelLevel());
+ assertTrue(Test.TRUE, testUVD.getFuelLevelState());
+ assertTrue(Test.TRUE, testUVD.getInstantFuelConsumption());
+ assertTrue(Test.TRUE, testUVD.getExternalTemperature());
+ assertTrue(Test.TRUE, testUVD.getPrndl());
+ assertTrue(Test.TRUE, testUVD.getTirePressure());
+ assertTrue(Test.TRUE, testUVD.getOdometer());
+ assertTrue(Test.TRUE, testUVD.getBeltStatus());
+ assertTrue(Test.TRUE, testUVD.getBodyInformation());
+ assertTrue(Test.TRUE, testUVD.getDeviceStatus());
+ assertTrue(Test.TRUE, testUVD.getDriverBraking());
+ assertEquals(Test.MATCH, testCorrelationID, testUVD.getCorrelationID());
+
+ testUVD = RPCRequestFactory.BuildUnsubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
+ assertNotNull(Test.NULL, testUVD.getCorrelationID());
+ }
+
+ public void testBuildGetVehicleData () {
+
+ boolean testGPS = true, testSpeed = true, testRPM = true, testFuelLevel = true, testFuelLevelState = true, testInstantFuelConsumption = true, testExternalTemperature = true, testVIN = true, testPRNDL = true, testTirePressure = true, testOdometer = true, testBeltStatus = true, testBodyInformation = true, testDeviceStatus = true, testDriverBraking = true;
+ Integer testCorrelationID = 0;
+ GetVehicleData testGVD;
+
+ // Test -- BuildGetVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID)
+ testGVD = RPCRequestFactory.BuildGetVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testVIN, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID);
+ assertTrue(Test.TRUE, testGVD.getGps());
+ assertTrue(Test.TRUE, testGVD.getSpeed());
+ assertTrue(Test.TRUE, testGVD.getRpm());
+ assertTrue(Test.TRUE, testGVD.getFuelLevel());
+ assertTrue(Test.TRUE, testGVD.getFuelLevelState());
+ assertTrue(Test.TRUE, testGVD.getInstantFuelConsumption());
+ assertTrue(Test.TRUE, testGVD.getExternalTemperature());
+ assertTrue(Test.TRUE, testGVD.getPrndl());
+ assertTrue(Test.TRUE, testGVD.getTirePressure());
+ assertTrue(Test.TRUE, testGVD.getOdometer());
+ assertTrue(Test.TRUE, testGVD.getBeltStatus());
+ assertTrue(Test.TRUE, testGVD.getBodyInformation());
+ assertTrue(Test.TRUE, testGVD.getDeviceStatus());
+ assertTrue(Test.TRUE, testGVD.getDriverBraking());
+ assertTrue(Test.TRUE, testGVD.getVin());
+ assertEquals(Test.MATCH, testCorrelationID, testGVD.getCorrelationID());
+
+ testGVD = RPCRequestFactory.BuildGetVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testVIN, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
+ assertNotNull(Test.NULL, testGVD.getCorrelationID());
+ }
+
+ public void testBuildScrollableMessage () {
+
+ String testSMB = "test";
+ Integer testTimeout = 1, testCorrelationID = 0;
+ Vector<SoftButton> testSoftButtons = new Vector<SoftButton>();
+ testSoftButtons.add(new SoftButton());
+ ScrollableMessage testSM;
+
+ // Test -- BuildScrollableMessage(String scrollableMessageBody, Integer timeout, Vector<SoftButton> softButtons, Integer correlationID)
+ testSM = RPCRequestFactory.BuildScrollableMessage(testSMB, testTimeout, testSoftButtons, testCorrelationID);
+ assertEquals(Test.MATCH, testSMB, testSM.getScrollableMessageBody());
+ assertEquals(Test.MATCH, testTimeout, testSM.getTimeout());
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testSM.getSoftButtons()));
+ assertEquals(Test.MATCH, testCorrelationID, testSM.getCorrelationID());
+
+ testSM = RPCRequestFactory.BuildScrollableMessage(null, null, null, null);
+ assertNull(Test.NULL, testSM.getScrollableMessageBody());
+ assertNull(Test.NULL, testSM.getTimeout());
+ assertNull(Test.NULL, testSM.getSoftButtons());
+ assertNotNull(Test.NOT_NULL, testSM.getCorrelationID());
+ }
+
+ public void testBuildSlider () {
+
+ Integer testTicks = 1, testPosition = 2, testTimeout = 3, testCorrelationID = 0;
+ String testHeader = "header";
+ Vector<String> testFooter = new Vector<String>();
+ testFooter.add("footer");
+ Slider testSlider;
+
+ // Test -- BuildSlider(Integer numTicks, Integer position, String sliderHeader, Vector<String> sliderFooter, Integer timeout, Integer correlationID)
+ testSlider = RPCRequestFactory.BuildSlider(testTicks, testPosition, testHeader, testFooter, testTimeout, testCorrelationID);
+ assertEquals(Test.MATCH, testTicks, testSlider.getNumTicks());
+ assertEquals(Test.MATCH, testPosition, testSlider.getPosition());
+ assertEquals(Test.MATCH, testHeader, testSlider.getSliderHeader());
+ assertTrue(Test.TRUE, Validator.validateStringList(testFooter, testSlider.getSliderFooter()));
+ assertEquals(Test.MATCH, testCorrelationID, testSlider.getCorrelationID());
+
+ testSlider = RPCRequestFactory.BuildSlider(null, null, null, null, null, null);
+ assertNull(Test.NULL, testSlider.getNumTicks());
+ assertNull(Test.NULL, testSlider.getPosition());
+ assertNull(Test.NULL, testSlider.getSliderHeader());
+ assertNull(Test.NULL, testSlider.getSliderFooter());
+ assertNull(Test.NULL, testSlider.getTimeout());
+ assertNotNull(Test.NOT_NULL, testSlider.getCorrelationID());
+ }
+
+ public void testBuildChangeRegistration () {
+
+ Language testLang = Language.EN_US, testHMILang = Language.EN_AU;
+ Integer testCorrelationID = 0;
+ ChangeRegistration testCR;
+
+ // Test -- BuildChangeRegistration(Language language, Language hmiDisplayLanguage, Integer correlationID)
+ testCR = RPCRequestFactory.BuildChangeRegistration(testLang, testHMILang, testCorrelationID);
+ assertEquals(Test.MATCH, testLang, testCR.getLanguage());
+ assertEquals(Test.MATCH, testHMILang, testCR.getHmiDisplayLanguage());
+ assertEquals(Test.MATCH, testCorrelationID, testCR.getCorrelationID());
+
+ testCR = RPCRequestFactory.BuildChangeRegistration(null, null, null);
+ assertNull(Test.NULL, testCR.getLanguage());
+ assertNull(Test.NULL, testCR.getHmiDisplayLanguage());
+ assertNotNull(Test.NOT_NULL, testCR.getCorrelationID());
+ }
+
+ public void testBuildSetDisplayLayout () {
+
+ String testDL = "layout";
+ Integer testCorrelationID = 0;
+ SetDisplayLayout testSDL;
+
+ // Test -- BuildSetDisplayLayout(String displayLayout, Integer correlationID)
+ testSDL = RPCRequestFactory.BuildSetDisplayLayout(testDL, testCorrelationID);
+ assertEquals(Test.MATCH, testDL, testSDL.getDisplayLayout());
+ assertEquals(Test.MATCH, testCorrelationID, testSDL.getCorrelationID());
+
+ testSDL = RPCRequestFactory.BuildSetDisplayLayout(null, null);
+ assertNull(Test.NULL, testSDL.getDisplayLayout());
+ assertNotNull(Test.NOT_NULL, testSDL.getCorrelationID());
+ }
+
+ public void testBuildPerformAudioPassThru () {
+
+ Vector<TTSChunk> testInitialPrompt = TTSChunkFactory.createSimpleTTSChunks("test");
+ String testAPTDT1 = "audio", testAPTDT2 = "pass";
+ SamplingRate testSR = SamplingRate._16KHZ;
+ Integer testMaxDuration = 1, testCorrelationID = 0;
+ BitsPerSample testBits = BitsPerSample._16_BIT;
+ AudioType testAT = AudioType.PCM;
+ Boolean testMute = false;
+ PerformAudioPassThru testPAPT;
+
+ // Test -- BuildPerformAudioPassThru(String ttsText, String audioPassThruDisplayText1, String audioPassThruDisplayText2, SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample, AudioType audioType, Boolean muteAudio, Integer correlationID)
+ // ^ Calls another build method.
+
+ // Test -- BuildPerformAudioPassThru(Vector<TTSChunk> initialPrompt, String audioPassThruDisplayText1, String audioPassThruDisplayText2, SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample, AudioType audioType, Boolean muteAudio, Integer correlationID)
+ testPAPT = RPCRequestFactory.BuildPerformAudioPassThru(testInitialPrompt, testAPTDT1, testAPTDT2, testSR, testMaxDuration, testBits, testAT, testMute, testCorrelationID);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitialPrompt, testPAPT.getInitialPrompt()));
+ assertEquals(Test.MATCH, testAPTDT1, testPAPT.getAudioPassThruDisplayText1());
+ assertEquals(Test.MATCH, testAPTDT2, testPAPT.getAudioPassThruDisplayText2());
+ assertEquals(Test.MATCH, testSR, testPAPT.getSamplingRate());
+ assertEquals(Test.MATCH, testMaxDuration, testPAPT.getMaxDuration());
+ assertEquals(Test.MATCH, testBits, testPAPT.getBitsPerSample());
+ assertEquals(Test.MATCH, testAT, testPAPT.getAudioType());
+ assertEquals(Test.MATCH, testMute, testPAPT.getMuteAudio());
+ assertEquals(Test.MATCH, testCorrelationID, testPAPT.getCorrelationID());
+
+ testPAPT = RPCRequestFactory.BuildPerformAudioPassThru((Vector<TTSChunk>) null, null, null, null, null, null, null, null, null);
+ assertNull(Test.NULL, testPAPT.getInitialPrompt());
+ assertNull(Test.NULL, testPAPT.getAudioPassThruDisplayText1());
+ assertNull(Test.NULL, testPAPT.getAudioPassThruDisplayText2());
+ assertNull(Test.NULL, testPAPT.getSamplingRate());
+ assertNull(Test.NULL, testPAPT.getMaxDuration());
+ assertNull(Test.NULL, testPAPT.getBitsPerSample());
+ assertNull(Test.NULL, testPAPT.getAudioType());
+ assertNull(Test.NULL, testPAPT.getMuteAudio());
+ assertNotNull(Test.NOT_NULL, testPAPT.getCorrelationID());
+ }
+
+ public void testBuildEndAudioPassThru () {
+
+ Integer testCorrelationID = 0;
+ EndAudioPassThru testEAPT;
+
+ // Test -- BuildEndAudioPassThru(Integer correlationID)
+ testEAPT = RPCRequestFactory.BuildEndAudioPassThru(testCorrelationID);
+ assertEquals(Test.MATCH, testCorrelationID, testEAPT.getCorrelationID());
+
+ testEAPT = RPCRequestFactory.BuildEndAudioPassThru(null);
+ assertNotNull(Test.NOT_NULL, testEAPT.getCorrelationID());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java
new file mode 100644
index 000000000..8496a16d5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java
@@ -0,0 +1,39 @@
+package com.smartdevicelink.test.proxy;
+
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.GetSystemCapability;
+import com.smartdevicelink.test.Config;
+
+
+public class RPCRequestTest extends AndroidTestCase2 {
+
+ public static final int SDL_VERSION_UNDER_TEST = Config.SDL_VERSION_UNDER_TEST;
+
+ private static final int CORR_ID = 402;
+
+ protected RPCRequest msg;
+
+ @Override
+ public void setUp(){
+ this.msg = new GetSystemCapability();
+
+ }
+
+ public void testCreation(){
+ assertNotNull("Object creation failed.", msg);
+ }
+
+ public void testGetCorrelationId(){
+ assertNotNull(this.msg.getCorrelationID());
+ }
+ public void testSettingCorrelationId(){
+ assertNotNull(this.msg.getCorrelationID());
+ msg.setCorrelationID(CORR_ID);
+ assertEquals("Correlation ID doesn't match expected ID.", CORR_ID, (int)msg.getCorrelationID());
+
+ }
+
+
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java
index 370d30979..370d30979 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java
new file mode 100644
index 000000000..6f0258fae
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java
@@ -0,0 +1,702 @@
+package com.smartdevicelink.test.proxy;
+
+import android.content.Context;
+import android.telephony.TelephonyManager;
+import android.util.Log;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.SdlProxyALM;
+import com.smartdevicelink.proxy.SdlProxyBase;
+import com.smartdevicelink.proxy.SdlProxyBuilder;
+import com.smartdevicelink.proxy.SdlProxyConfigurationResources;
+import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
+import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
+import com.smartdevicelink.proxy.interfaces.IProxyListenerALM;
+import com.smartdevicelink.proxy.rpc.AddCommandResponse;
+import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
+import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
+import com.smartdevicelink.proxy.rpc.AlertResponse;
+import com.smartdevicelink.proxy.rpc.ButtonPressResponse;
+import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
+import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
+import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
+import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
+import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
+import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
+import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
+import com.smartdevicelink.proxy.rpc.DialNumberResponse;
+import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
+import com.smartdevicelink.proxy.rpc.GenericResponse;
+import com.smartdevicelink.proxy.rpc.GetAppServiceDataResponse;
+import com.smartdevicelink.proxy.rpc.GetCloudAppPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
+import com.smartdevicelink.proxy.rpc.GetFileResponse;
+import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
+import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.GetWayPointsResponse;
+import com.smartdevicelink.proxy.rpc.ListFilesResponse;
+import com.smartdevicelink.proxy.rpc.OnAppServiceData;
+import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
+import com.smartdevicelink.proxy.rpc.OnButtonEvent;
+import com.smartdevicelink.proxy.rpc.OnButtonPress;
+import com.smartdevicelink.proxy.rpc.OnCommand;
+import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.OnHashChange;
+import com.smartdevicelink.proxy.rpc.OnInteriorVehicleData;
+import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
+import com.smartdevicelink.proxy.rpc.OnLanguageChange;
+import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
+import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
+import com.smartdevicelink.proxy.rpc.OnRCStatus;
+import com.smartdevicelink.proxy.rpc.OnStreamRPC;
+import com.smartdevicelink.proxy.rpc.OnSystemCapabilityUpdated;
+import com.smartdevicelink.proxy.rpc.OnSystemRequest;
+import com.smartdevicelink.proxy.rpc.OnTBTClientState;
+import com.smartdevicelink.proxy.rpc.OnTouchEvent;
+import com.smartdevicelink.proxy.rpc.OnVehicleData;
+import com.smartdevicelink.proxy.rpc.OnWayPointChange;
+import com.smartdevicelink.proxy.rpc.PerformAppServiceInteractionResponse;
+import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
+import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
+import com.smartdevicelink.proxy.rpc.PublishAppServiceResponse;
+import com.smartdevicelink.proxy.rpc.PutFileResponse;
+import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
+import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
+import com.smartdevicelink.proxy.rpc.SendHapticDataResponse;
+import com.smartdevicelink.proxy.rpc.SendLocationResponse;
+import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
+import com.smartdevicelink.proxy.rpc.SetCloudAppPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
+import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.SetInteriorVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
+import com.smartdevicelink.proxy.rpc.ShowResponse;
+import com.smartdevicelink.proxy.rpc.SliderResponse;
+import com.smartdevicelink.proxy.rpc.SpeakResponse;
+import com.smartdevicelink.proxy.rpc.StreamRPCResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse;
+import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
+import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
+import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.UnsubscribeWayPointsResponse;
+import com.smartdevicelink.proxy.rpc.UpdateTurnListResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
+import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.streaming.video.SdlRemoteDisplay;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.test.streaming.video.SdlRemoteDisplayTest;
+
+import junit.framework.Assert;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class SdlProxyBaseTests extends AndroidTestCase2 {
+ public static final String TAG = "SdlProxyBaseTests";
+
+ @Override
+ protected void setUp() throws Exception{
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ //Nothing here for now
+ }
+
+ /**
+ * Test SdlProxyBase for handling null SdlProxyConfigurationResources
+ */
+ public void testNullSdlProxyConfigurationResources() {
+ SdlProxyALM proxy = null;
+ SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(new ProxyListenerTest(), "appId", "appName", true, getContext());
+ SdlProxyConfigurationResources config = new SdlProxyConfigurationResources("path", (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE));
+ //Construct with a non-null SdlProxyConfigurationResources
+ builder.setSdlProxyConfigurationResources(config);
+ try {
+ proxy = builder.build();
+ } catch (Exception e) {
+ Log.v(TAG, "Exception in testNullSdlProxyConfigurationResources, testing non null SdlProxyConfigurationResources");
+ if (!(e instanceof SdlException) || !((SdlException) e).getSdlExceptionCause().equals(SdlExceptionCause.BLUETOOTH_ADAPTER_NULL)) {
+ e.printStackTrace();
+ Assert.fail("Exception in testNullSdlProxyConfigurationResources - \n" + e.toString());
+ }
+ }
+
+ if (proxy != null) {
+ try {
+ proxy.dispose();
+ proxy = null;
+ }catch(SdlException e){
+ e.printStackTrace();
+ }
+ }
+
+ //Construct with a null SdlProxyConfigurationResources
+ builder.setSdlProxyConfigurationResources(null);
+ try {
+ proxy = builder.build();
+ } catch (Exception e) {
+ Log.v(TAG, "Exception in testNullSdlProxyConfigurationResources, testing null SdlProxyConfigurationResources");
+ if (!(e instanceof SdlException) || !((SdlException) e).getSdlExceptionCause().equals(SdlExceptionCause.BLUETOOTH_ADAPTER_NULL)) {
+ e.printStackTrace();
+ Assert.fail("Exception in testNullSdlProxyConfigurationResources, testing null SdlProxyConfigurationResources");
+ }
+ }
+ if (proxy != null) {
+ try {
+ proxy.dispose();
+ proxy = null;
+ }catch(SdlException e){
+ e.printStackTrace();
+ }
+ }
+
+ //Construct with a non-null SdlProxyConfigurationResources and a null TelephonyManager
+ config.setTelephonyManager(null);
+ builder.setSdlProxyConfigurationResources(config);
+ try {
+ proxy = builder.build();
+ } catch (Exception e) {
+ Log.v(TAG, "Exception in testNullSdlProxyConfigurationResources, testing null TelephonyManager");
+ if (!(e instanceof SdlException) || !((SdlException) e).getSdlExceptionCause().equals(SdlExceptionCause.BLUETOOTH_ADAPTER_NULL)) {
+ Assert.fail("Exception in testNullSdlProxyConfigurationResources, testing null TelephonyManager");
+ }
+ }
+ if (proxy != null) {
+ try {
+ proxy.dispose();
+ proxy = null;
+ }catch(SdlException e){
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void testRemoteDisplayStreaming(){
+ SdlProxyALM proxy = null;
+ SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(new ProxyListenerTest(), "appId", "appName", true, getContext());
+ try{
+ proxy = builder.build();
+ // public void startRemoteDisplayStream(Context context, final Class<? extends SdlRemoteDisplay> remoteDisplay, final VideoStreamingParameters parameters, final boolean encrypted){
+ Method m = SdlProxyALM.class.getDeclaredMethod("startRemoteDisplayStream", Context.class, SdlRemoteDisplay.class, VideoStreamingParameters.class, boolean.class);
+ assertNotNull(m);
+ m.setAccessible(true);
+ m.invoke(proxy,getContext(), SdlRemoteDisplayTest.MockRemoteDisplay.class, (VideoStreamingParameters)null, false);
+ assert true;
+
+ }catch (Exception e){
+ assert false;
+ }
+ }
+
+ public void testMultipleRPCSendSynchronous() {
+
+ List<RPCRequest> rpcs = new ArrayList<>();
+
+ // rpc 1
+ Show show = new Show();
+ show.setMainField1("hey y'all");
+ show.setMainField2("");
+ show.setMainField3("");
+ show.setMainField4("");
+ rpcs.add(show);
+
+ // rpc 2
+ Show show2 = new Show();
+ show2.setMainField1("");
+ show2.setMainField2("It is Wednesday My Dudes");
+ show2.setMainField3("");
+ show2.setMainField4("");
+ rpcs.add(show2);
+
+ OnMultipleRequestListener mrl = new OnMultipleRequestListener() {
+ @Override
+ public void onUpdate(int remainingRequests) {
+
+ }
+
+ @Override
+ public void onFinished() {
+
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ assert false;
+ }
+
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+
+ }
+ };
+ try{
+ // public void sendRequests(List<RPCRequest> rpcs, final OnMultipleRequestListener listener) throws SdlException {
+ Method m = SdlProxyBase.class.getDeclaredMethod("sendRequests", SdlProxyBase.class);
+ assertNotNull(m);
+ m.setAccessible(true);
+ m.invoke(rpcs,mrl);
+ assert true;
+
+ }catch (Exception e){
+ assert false;
+ }
+ }
+
+ public void testMultipleRPCSendAsynchronous() {
+
+ List<RPCRequest> rpcs = new ArrayList<>();
+
+ // rpc 1
+ Show show = new Show();
+ show.setMainField1("hey y'all");
+ show.setMainField2("");
+ show.setMainField3("");
+ show.setMainField4("");
+ rpcs.add(show);
+
+ // rpc 2
+ Show show2 = new Show();
+ show2.setMainField1("");
+ show2.setMainField2("It is Wednesday My Dudes");
+ show2.setMainField3("");
+ show2.setMainField4("");
+ rpcs.add(show2);
+
+ OnMultipleRequestListener mrl = new OnMultipleRequestListener() {
+ @Override
+ public void onUpdate(int remainingRequests) {
+
+ }
+
+ @Override
+ public void onFinished() {
+
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ assert false;
+ }
+
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+
+ }
+ };
+ try{
+ // public void sendSequentialRequests(List<RPCRequest> rpcs, final OnMultipleRequestListener listener) throws SdlException {
+ Method m = SdlProxyBase.class.getDeclaredMethod("sendSequentialRequests", SdlProxyBase.class);
+ assertNotNull(m);
+ m.setAccessible(true);
+ m.invoke(rpcs,mrl);
+ assert true;
+
+ }catch (Exception e){
+ assert false;
+ }
+ }
+
+ public class ProxyListenerTest implements IProxyListenerALM {
+
+ @Override
+ public void onProxyClosed(String s, Exception e, SdlDisconnectedReason reason) {
+
+ }
+
+ @Override
+ public void onOnHMIStatus(OnHMIStatus status) {
+
+ }
+
+ @Override
+ public void onListFilesResponse(ListFilesResponse response) {
+ }
+
+ @Override
+ public void onPutFileResponse(PutFileResponse response) {
+ }
+
+ @Override
+ public void onOnLockScreenNotification(OnLockScreenStatus notification) {
+ }
+
+ @Override
+ public void onOnCommand(OnCommand notification){
+ }
+
+ /**
+ * Callback method that runs when the add command response is received from SDL.
+ */
+ @Override
+ public void onAddCommandResponse(AddCommandResponse response) {
+ }
+
+ @Override
+ public void onOnPermissionsChange(OnPermissionsChange notification) {
+
+ }
+
+ @Override
+ public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response) {
+ }
+
+ @Override
+ public void onOnVehicleData(OnVehicleData notification) {
+ }
+
+ /**
+ * Rest of the SDL callbacks from the head unit
+ */
+
+ @Override
+ public void onAddSubMenuResponse(AddSubMenuResponse response) {
+ }
+
+ @Override
+ public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse response) {
+ }
+
+ @Override
+ public void onAlertResponse(AlertResponse response) {
+ }
+
+ @Override
+ public void onDeleteCommandResponse(DeleteCommandResponse response) {
+ }
+
+ @Override
+ public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse response) {
+ }
+
+ @Override
+ public void onDeleteSubMenuResponse(DeleteSubMenuResponse response) {
+ }
+
+ @Override
+ public void onPerformInteractionResponse(PerformInteractionResponse response) {
+ }
+
+ @Override
+ public void onResetGlobalPropertiesResponse(
+ ResetGlobalPropertiesResponse response) {
+ }
+
+ @Override
+ public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse response) {
+ }
+
+ @Override
+ public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response) {
+ }
+
+ @Override
+ public void onShowResponse(ShowResponse response) {
+ }
+
+ @Override
+ public void onSpeakResponse(SpeakResponse response) {
+ Log.i(TAG, "SpeakCommand response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+ }
+
+ @Override
+ public void onOnButtonEvent(OnButtonEvent notification) {
+ }
+
+ @Override
+ public void onOnButtonPress(OnButtonPress notification) {
+ }
+
+ @Override
+ public void onSubscribeButtonResponse(SubscribeButtonResponse response) {
+ }
+
+ @Override
+ public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response) {
+ }
+
+
+ @Override
+ public void onOnTBTClientState(OnTBTClientState notification) {
+ }
+
+ @Override
+ public void onUnsubscribeVehicleDataResponse(
+ UnsubscribeVehicleDataResponse response) {
+
+ }
+
+ @Override
+ public void onGetVehicleDataResponse(GetVehicleDataResponse response) {
+
+ }
+
+ @Override
+ public void onReadDIDResponse(ReadDIDResponse response) {
+
+ }
+
+ @Override
+ public void onGetDTCsResponse(GetDTCsResponse response) {
+
+ }
+
+
+ @Override
+ public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response) {
+
+ }
+
+ @Override
+ public void onEndAudioPassThruResponse(EndAudioPassThruResponse response) {
+
+ }
+
+ @Override
+ public void onOnAudioPassThru(OnAudioPassThru notification) {
+
+ }
+
+ @Override
+ public void onDeleteFileResponse(DeleteFileResponse response) {
+
+ }
+
+ @Override
+ public void onSetAppIconResponse(SetAppIconResponse response) {
+
+ }
+
+ @Override
+ public void onScrollableMessageResponse(ScrollableMessageResponse response) {
+
+ }
+
+ @Override
+ public void onChangeRegistrationResponse(ChangeRegistrationResponse response) {
+
+ }
+
+ @Override
+ public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response) {
+
+ }
+
+ @Override
+ public void onOnLanguageChange(OnLanguageChange notification) {
+
+ }
+
+ @Override
+ public void onSliderResponse(SliderResponse response) {
+
+ }
+
+
+ @Override
+ public void onOnHashChange(OnHashChange notification) {
+
+ }
+
+ @Override
+ public void onOnSystemRequest(OnSystemRequest notification) {
+ }
+
+ @Override
+ public void onSystemRequestResponse(SystemRequestResponse response) {
+
+ }
+
+ @Override
+ public void onOnKeyboardInput(OnKeyboardInput notification) {
+
+ }
+
+ @Override
+ public void onOnTouchEvent(OnTouchEvent notification) {
+
+ }
+
+ @Override
+ public void onDiagnosticMessageResponse(DiagnosticMessageResponse response) {
+
+ }
+
+ @Override
+ public void onOnStreamRPC(OnStreamRPC notification) {
+
+ }
+
+ @Override
+ public void onStreamRPCResponse(StreamRPCResponse response) {
+
+ }
+
+ @Override
+ public void onDialNumberResponse(DialNumberResponse response) {
+
+ }
+
+ @Override
+ public void onSendLocationResponse(SendLocationResponse response) {
+ Log.i(TAG, "SendLocation response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+
+ }
+
+ @Override
+ public void onServiceEnded(OnServiceEnded serviceEnded) {
+
+ }
+
+ @Override
+ public void onServiceNACKed(OnServiceNACKed serviceNACKed) {
+
+ }
+
+ @Override
+ public void onShowConstantTbtResponse(ShowConstantTbtResponse response) {
+ Log.i(TAG, "ShowConstantTbt response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+
+ }
+
+ @Override
+ public void onAlertManeuverResponse(AlertManeuverResponse response) {
+ Log.i(TAG, "AlertManeuver response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+
+ }
+
+ @Override
+ public void onUpdateTurnListResponse(UpdateTurnListResponse response) {
+ Log.i(TAG, "UpdateTurnList response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+
+ }
+
+ @Override
+ public void onServiceDataACK(int dataSize) {
+ }
+
+ @Override
+ public void onGetWayPointsResponse(GetWayPointsResponse response) {
+ Log.i(TAG, "GetWayPoints response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+ }
+
+ @Override
+ public void onSubscribeWayPointsResponse(SubscribeWayPointsResponse response) {
+ Log.i(TAG, "SubscribeWayPoints response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+ }
+
+ @Override
+ public void onUnsubscribeWayPointsResponse(UnsubscribeWayPointsResponse response) {
+ Log.i(TAG, "UnsubscribeWayPoints response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+ }
+
+ @Override
+ public void onOnWayPointChange(OnWayPointChange notification) {
+ Log.i(TAG, "OnWayPointChange notification from SDL: " + notification);
+ }
+
+ @Override
+ public void onGetSystemCapabilityResponse(GetSystemCapabilityResponse response) {
+ Log.i(TAG, "GetSystemCapability response from SDL: " + response);
+ }
+
+ @Override
+ public void onGetInteriorVehicleDataResponse(GetInteriorVehicleDataResponse response) {
+ Log.i(TAG, "GetInteriorVehicleData response from SDL: " + response);
+ }
+
+ @Override
+ public void onButtonPressResponse(ButtonPressResponse response) {
+ Log.i(TAG, "ButtonPress response from SDL: " + response);
+ }
+
+ @Override
+ public void onSetInteriorVehicleDataResponse(SetInteriorVehicleDataResponse response) {
+ Log.i(TAG, "SetInteriorVehicleData response from SDL: " + response);
+ }
+
+ @Override
+ public void onOnInteriorVehicleData(OnInteriorVehicleData notification) {
+
+ }
+
+ @Override
+ public void onOnDriverDistraction(OnDriverDistraction notification) {
+ // Some RPCs (depending on region) cannot be sent when driver distraction is active.
+ }
+
+ @Override
+ public void onError(String info, Exception e) {
+ }
+
+ @Override
+ public void onGenericResponse(GenericResponse response) {
+ Log.i(TAG, "Generic response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
+ }
+
+ @Override
+ public void onSendHapticDataResponse(SendHapticDataResponse response) {
+ Log.i(TAG, "SendHapticDataResponse response from SDL: " + response);
+ }
+
+ @Override
+ public void onOnRCStatus(OnRCStatus notification) {
+ }
+
+ @Override
+ public void onSetCloudAppProperties(SetCloudAppPropertiesResponse response) {
+
+ }
+
+ @Override
+ public void onGetCloudAppProperties(GetCloudAppPropertiesResponse response) {
+
+ }
+
+ @Override
+ public void onPublishAppServiceResponse(PublishAppServiceResponse response) {
+
+ }
+
+ @Override
+ public void onGetAppServiceDataResponse(GetAppServiceDataResponse response) {
+
+ }
+
+ @Override
+ public void onGetFileResponse(GetFileResponse response) {
+
+ }
+
+ @Override
+ public void onPerformAppServiceInteractionResponse(PerformAppServiceInteractionResponse response) {
+
+ }
+
+ @Override
+ public void onOnAppServiceData(OnAppServiceData notification) {
+
+ }
+
+ @Override
+ public void onOnSystemCapabilityUpdated(OnSystemCapabilityUpdated notification) {
+
+ }
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java
new file mode 100644
index 000000000..baa53272b
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java
@@ -0,0 +1,467 @@
+package com.smartdevicelink.test.proxy;
+
+import android.util.SparseArray;
+
+import com.smartdevicelink.AndroidTestCase2;
+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.SystemCapabilityManager;
+import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
+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.AppServiceCapability;
+import com.smartdevicelink.proxy.rpc.AppServicesCapabilities;
+import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
+import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
+import com.smartdevicelink.proxy.rpc.HMICapabilities;
+import com.smartdevicelink.proxy.rpc.OnSystemCapabilityUpdated;
+import com.smartdevicelink.proxy.rpc.PhoneCapability;
+import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.SystemCapability;
+import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason;
+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.proxy.rpc.listeners.OnRPCRequestListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+import com.smartdevicelink.streaming.audio.AudioStreamingCodec;
+import com.smartdevicelink.streaming.audio.AudioStreamingParams;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.utl.AppServiceFactory;
+import com.smartdevicelink.util.CorrelationIdGenerator;
+import com.smartdevicelink.util.Version;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+public class SystemCapabilityManagerTests extends AndroidTestCase2 {
+ public static final String TAG = "SystemCapabilityManagerTests";
+ public static SystemCapabilityManager systemCapabilityManager;
+
+ @Override
+ protected void setUp() throws Exception{
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public SystemCapabilityManager createSampleManager(){
+ return createSampleManager(new InternalSDLInterface());
+ }
+
+ public SystemCapabilityManager createSampleManager(InternalSDLInterface iSdl){
+ SystemCapabilityManager systemCapabilityManager = new SystemCapabilityManager(iSdl);
+
+ RegisterAppInterfaceResponse raiResponse = new RegisterAppInterfaceResponse();
+
+ raiResponse.setHmiCapabilities(Test.GENERAL_HMICAPABILITIES);
+ raiResponse.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES);
+ raiResponse.setAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST);
+ raiResponse.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST);
+ raiResponse.setHmiZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST);
+ raiResponse.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES);
+ raiResponse.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST);
+ raiResponse.setSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST);
+ raiResponse.setSuccess(true);
+
+ systemCapabilityManager.parseRAIResponse(raiResponse);
+ return systemCapabilityManager;
+ }
+
+ public void testParseRAI() {
+ systemCapabilityManager = createSampleManager();
+
+ assertTrue(Test.TRUE,
+ Validator.validateHMICapabilities(Test.GENERAL_HMICAPABILITIES, (HMICapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.HMI)));
+ assertTrue(Test.TRUE,
+ Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, (DisplayCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY)));
+ assertTrue(Test.TRUE,
+ Validator.validateAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, (List<AudioPassThruCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.AUDIO_PASSTHROUGH)));
+ assertTrue(Test.TRUE,
+ Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, (List<ButtonCapabilities> )systemCapabilityManager.getCapability(SystemCapabilityType.BUTTON)));
+ assertTrue(Test.TRUE,
+ Validator.validateHMIZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST, (List<HmiZoneCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.HMI_ZONE)));
+ assertTrue(Test.TRUE,
+ Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, (PresetBankCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.PRESET_BANK)));
+ assertTrue(Test.TRUE,
+ Validator.validateSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST, (List<SoftButtonCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON)));
+ assertTrue(Test.TRUE,
+ Validator.validateSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST, (List<SpeechCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SPEECH)));
+ }
+
+ public void testGetVSCapability(){
+ VideoStreamingCapability vsCapability = new VideoStreamingCapability();
+ vsCapability.setMaxBitrate(Test.GENERAL_INT);
+ vsCapability.setPreferredResolution(Test.GENERAL_IMAGERESOLUTION);
+ vsCapability.setSupportedFormats(Test.GENERAL_VIDEOSTREAMINGFORMAT_LIST);
+
+ SystemCapability cap = new SystemCapability();
+ cap.setSystemCapabilityType(SystemCapabilityType.VIDEO_STREAMING);
+ cap.setCapabilityForType(SystemCapabilityType.VIDEO_STREAMING, vsCapability);
+
+ final SystemCapability referenceCapability = cap;
+
+ systemCapabilityManager = new SystemCapabilityManager(new InternalSDLInterface() {
+ @Override
+ public void sendRPCRequest(RPCRequest message) {
+ GetSystemCapabilityResponse response = new GetSystemCapabilityResponse();
+ response.setSystemCapability(referenceCapability);
+ response.setSuccess(true);
+ message.getOnRPCResponseListener().onResponse(CorrelationIdGenerator.generateId(), response);
+ }
+ });
+
+ systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING, new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ assertTrue(Test.TRUE,
+ Validator.validateVideoStreamingCapability(
+ (VideoStreamingCapability) referenceCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING),
+ (VideoStreamingCapability) capability));
+ }
+
+ @Override
+ public void onError(String info) {
+ assertTrue(false);
+ }
+ });
+ }
+
+ public void testListConversion(){
+ SystemCapabilityManager systemCapabilityManager = createSampleManager();
+ Object capability = systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON);
+ assertNotNull(capability);
+ List<SoftButtonCapabilities> list = SystemCapabilityManager.convertToList(capability, SoftButtonCapabilities.class);
+ assertNotNull(list);
+
+ }
+
+ public void testFalsePositive(){
+ SystemCapabilityManager systemCapabilityManager = createSampleManager();
+ systemCapabilityManager.setCapability(SystemCapabilityType.AUDIO_PASSTHROUGH, null);
+ assertFalse(systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.AUDIO_PASSTHROUGH));
+ }
+
+ public void testOnSystemCapabilityUpdateWithNoExistingCap(){
+ InternalSDLInterface iSDL = new InternalSDLInterface();
+ SystemCapabilityManager systemCapabilityManager = createSampleManager(iSDL);
+ OnRPCListener scmRpcListener = iSDL.rpcListeners.get(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.getId()).get(0);
+ assertNotNull(scmRpcListener);
+
+ assertNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES));
+
+ /* PERFORM A NOTIFICATION SEND THROUGH THE SCM */
+ AppServiceCapability addServiceID = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, "test", "3453", true, null);
+ AppServicesCapabilities serviceIdASC = new AppServicesCapabilities();
+ serviceIdASC.setAppServices(Collections.singletonList(addServiceID));
+
+ SystemCapability systemCapability = new SystemCapability();
+ systemCapability.setSystemCapabilityType(SystemCapabilityType.APP_SERVICES);
+ systemCapability.setCapabilityForType(SystemCapabilityType.APP_SERVICES, serviceIdASC);
+
+ OnSystemCapabilityUpdated onSystemCapabilityUpdated = new OnSystemCapabilityUpdated();
+ onSystemCapabilityUpdated.setSystemCapability(systemCapability);
+
+ scmRpcListener.onReceived(onSystemCapabilityUpdated);
+
+ assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES));
+
+ }
+
+ public void testOnSystemCapabilityUpdated(){
+
+ InternalSDLInterface iSDL = new InternalSDLInterface();
+ String baseName = "NavTest", baseID = "37F98053AE";
+ AppServiceCapability capability1 = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, baseName, null, true, null);
+
+ AppServicesCapabilities appServicesCapabilities = new AppServicesCapabilities();
+ appServicesCapabilities.setAppServices(Collections.singletonList(capability1));
+
+ SystemCapabilityManager systemCapabilityManager = createSampleManager(iSDL);
+ assertNotNull(iSDL.rpcListeners.get(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.getId()));
+ OnRPCListener scmRpcListener = iSDL.rpcListeners.get(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.getId()).get(0);
+ assertNotNull(scmRpcListener);
+
+ /* CONFIRM THE CAP DOESN'T EXIST IN SCM */
+ AppServicesCapabilities cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ assertNull(cachedCap);
+
+ /* ADD THE CAP IN SCM */
+ systemCapabilityManager.setCapability(SystemCapabilityType.APP_SERVICES, appServicesCapabilities);
+ /* CONFIRM THE CAP DOES EXIST IN SCM */
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ assertNotNull(cachedCap);
+ /* CONFIRM THE CAP IN SCM EQUALS ORIGINAL*/
+ assertEquals(cachedCap, appServicesCapabilities);
+ assertNull(cachedCap.getAppServices().get(0).getUpdatedAppServiceRecord().getServiceID());
+
+ /* PERFORM A NOTIFICATION SEND THROUGH THE SCM */
+ AppServiceCapability addServiceID = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, baseName, baseID, true, null);
+ AppServicesCapabilities serviceIdASC = new AppServicesCapabilities();
+ serviceIdASC.setAppServices(Collections.singletonList(addServiceID));
+
+ SystemCapability systemCapability = new SystemCapability();
+ systemCapability.setSystemCapabilityType(SystemCapabilityType.APP_SERVICES);
+ systemCapability.setCapabilityForType(SystemCapabilityType.APP_SERVICES, serviceIdASC);
+
+ OnSystemCapabilityUpdated onSystemCapabilityUpdated = new OnSystemCapabilityUpdated();
+ onSystemCapabilityUpdated.setSystemCapability(systemCapability);
+
+ scmRpcListener.onReceived(onSystemCapabilityUpdated);
+
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ assertNotNull(cachedCap);
+
+ assertTrue(cachedCap.getAppServices().get(0).getUpdatedAppServiceRecord().getServiceID().equals(baseID));
+
+ appServicesCapabilities.updateAppServices(Collections.singletonList(addServiceID));
+ assertTrue(serviceIdASC.getAppServices().get(0).getUpdatedAppServiceRecord().getServiceID().equalsIgnoreCase(appServicesCapabilities.getAppServices().get(0).getUpdatedAppServiceRecord().getServiceID()));
+
+ assertEquals(cachedCap, appServicesCapabilities);
+
+
+ /* PERFORM A NOTIFICATION SEND THROUGH AN UPDATED SERVICE NAME */
+ AppServiceCapability newServiceName = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, "TestNav", baseID, true, null);
+ AppServicesCapabilities newServiceNameASC = new AppServicesCapabilities();
+ newServiceNameASC.setAppServices(Collections.singletonList(newServiceName));
+
+ systemCapability = new SystemCapability();
+ systemCapability.setSystemCapabilityType(SystemCapabilityType.APP_SERVICES);
+ systemCapability.setCapabilityForType(SystemCapabilityType.APP_SERVICES, newServiceNameASC);
+
+ onSystemCapabilityUpdated = new OnSystemCapabilityUpdated();
+ onSystemCapabilityUpdated.setSystemCapability(systemCapability);
+
+ scmRpcListener.onReceived(onSystemCapabilityUpdated);
+
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ assertNotNull(cachedCap);
+ assertEquals(cachedCap.getAppServices().size(), 1);
+
+
+ /* PERFORM A NOTIFICATION SEND THROUGH THE SCM WITH DIFFERENT SERVICE */
+ AppServiceCapability newService = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, "NewNav", "eeeeeeeee", false, null);
+ AppServicesCapabilities newServiceASC = new AppServicesCapabilities();
+ newServiceASC.setAppServices(Collections.singletonList(newService));
+
+ systemCapability = new SystemCapability();
+ systemCapability.setSystemCapabilityType(SystemCapabilityType.APP_SERVICES);
+ systemCapability.setCapabilityForType(SystemCapabilityType.APP_SERVICES, newServiceASC);
+
+ onSystemCapabilityUpdated = new OnSystemCapabilityUpdated();
+ onSystemCapabilityUpdated.setSystemCapability(systemCapability);
+
+ scmRpcListener.onReceived(onSystemCapabilityUpdated);
+
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ assertNotNull(cachedCap);
+ assertEquals(cachedCap.getAppServices().size(), 2);
+
+ /* PERFORM A NOTIFICATION SEND THROUGH THE SCM WITH A REMOVED SERVICE */
+ AppServiceCapability removedService = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, "NewNav", "eeeeeeeee", false, null);
+ removedService.setUpdateReason(ServiceUpdateReason.REMOVED);
+ AppServicesCapabilities removedServiceASC = new AppServicesCapabilities();
+ removedServiceASC.setAppServices(Collections.singletonList(removedService));
+
+ systemCapability = new SystemCapability();
+ systemCapability.setSystemCapabilityType(SystemCapabilityType.APP_SERVICES);
+ systemCapability.setCapabilityForType(SystemCapabilityType.APP_SERVICES, removedServiceASC);
+
+ onSystemCapabilityUpdated = new OnSystemCapabilityUpdated();
+ onSystemCapabilityUpdated.setSystemCapability(systemCapability);
+
+ scmRpcListener.onReceived(onSystemCapabilityUpdated);
+
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ assertNotNull(cachedCap);
+ assertEquals(cachedCap.getAppServices().size(), 1);
+
+ }
+
+
+ public void testOnSystemCapabilityUpdatedOverwrite(){
+ InternalSDLInterface iSDL = new InternalSDLInterface();
+ SystemCapabilityManager systemCapabilityManager = createSampleManager(iSDL);
+ OnRPCListener scmRpcListener = iSDL.rpcListeners.get(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.getId()).get(0);
+ assertNotNull(scmRpcListener);
+ systemCapabilityManager.setCapability(SystemCapabilityType.PHONE_CALL, Test.GENERAL_PHONECAPABILITY);
+
+ PhoneCapability phoneCapability = (PhoneCapability)systemCapabilityManager.getCapability(SystemCapabilityType.PHONE_CALL);
+ assertNotNull(phoneCapability);
+ assertEquals(phoneCapability, Test.GENERAL_PHONECAPABILITY);
+
+ phoneCapability.setDialNumberEnabled(!Test.GENERAL_PHONECAPABILITY.getDialNumberEnabled()); //Flip it
+ SystemCapability systemCapability = new SystemCapability();
+ systemCapability.setSystemCapabilityType(SystemCapabilityType.PHONE_CALL);
+ systemCapability.setCapabilityForType(SystemCapabilityType.PHONE_CALL, phoneCapability);
+ OnSystemCapabilityUpdated onSystemCapabilityUpdated = new OnSystemCapabilityUpdated();
+ onSystemCapabilityUpdated.setSystemCapability(systemCapability);
+
+ scmRpcListener.onReceived(onSystemCapabilityUpdated);
+
+ PhoneCapability phoneCapabilityUpdated = (PhoneCapability)systemCapabilityManager.getCapability(SystemCapabilityType.PHONE_CALL);
+ assertNotNull(phoneCapabilityUpdated);
+ assertFalse(phoneCapabilityUpdated.getDialNumberEnabled());
+ assertEquals(phoneCapability, phoneCapabilityUpdated);
+ }
+
+ private class InternalSDLInterface implements ISdl{
+ private final Object RPC_LISTENER_LOCK = new Object();
+ SparseArray<CopyOnWriteArrayList<OnRPCListener>> rpcListeners = new SparseArray<>();
+
+ @Override
+ public void start(){}
+
+ @Override
+ public void stop() {}
+
+ @Override
+ public boolean isConnected() {return false; }
+
+ @Override
+ public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {}
+
+ @Override
+ public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {}
+
+ @Override
+ public void startVideoService(VideoStreamingParameters parameters, boolean encrypted) { }
+
+ @Override
+ public void stopVideoService() {}
+
+ @Override
+ public void stopAudioService() {}
+
+ @Override
+ public void sendRPCRequest(RPCRequest message) {}
+
+ @Override
+ public void sendRPC(RPCMessage message) {}
+
+ @Override
+ public void sendRequests(List<? extends RPCRequest> rpcs, OnMultipleRequestListener listener) {
+
+ }
+
+ @Override
+ public void sendSequentialRPCs(List<? extends RPCMessage> rpcs, OnMultipleRequestListener listener) {
+
+ }
+
+ @Override
+ public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
+
+ }
+
+ @Override
+ public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {return false;}
+
+ @Override
+ public void addOnRPCRequestListener(FunctionID functionID, OnRPCRequestListener listener) {
+
+ }
+
+ @Override
+ public boolean removeOnRPCRequestListener(FunctionID functionID, OnRPCRequestListener listener) {
+ return false;
+ }
+ @Override
+ public void addOnRPCListener(FunctionID messageId, OnRPCListener listener){
+ synchronized(RPC_LISTENER_LOCK){
+ if(messageId != null && listener != null){
+ if(rpcListeners.indexOfKey(messageId.getId()) < 0 ){
+ rpcListeners.put(messageId.getId(),new CopyOnWriteArrayList<OnRPCListener>());
+ }
+ rpcListeners.get(messageId.getId()).add(listener);
+ }
+ }
+ }
+ @Override
+ public boolean removeOnRPCListener(FunctionID messageId, OnRPCListener listener){
+ synchronized(RPC_LISTENER_LOCK){
+ if(rpcListeners!= null
+ && messageId != null
+ && listener != null
+ && rpcListeners.indexOfKey(messageId.getId()) >= 0){
+ return rpcListeners.get(messageId.getId()).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public Object getCapability(SystemCapabilityType systemCapabilityType){return null;}
+
+ @Override
+ public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) { }
+
+ @Override
+ public SdlMsgVersion getSdlMsgVersion(){
+ return null;
+ }
+
+ @Override
+ public Version getProtocolVersion() {
+ return new Version(1,0,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 boolean isTransportForServiceAvailable(SessionType serviceType) {
+ return false;
+ }
+
+ @Override
+ public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
+ AudioStreamingParams params) {}
+
+ @Override
+ public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters){
+ return null;
+ }
+
+ @Override
+ public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
+ AudioStreamingParams params) {
+ return null;
+ }
+
+ @Override
+ public void startAudioService(boolean encrypted){}
+
+ }
+
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java
new file mode 100644
index 000000000..9349a22d9
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java
@@ -0,0 +1,100 @@
+package com.smartdevicelink.test.proxy;
+
+import com.smartdevicelink.proxy.TTSChunkFactory;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+import java.util.Vector;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.TTSChunkFactory}
+ */
+public class TTSChunkFactoryTests extends TestCase {
+
+ private TTSChunk testChunk;
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.proxy.TTSChunkFactory#createChunk(SpeechCapabilities, String)}
+ */
+ public void testCreateChunk () {
+ // Valid Tests
+ SpeechCapabilities testType = SpeechCapabilities.TEXT;
+ testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
+ assertNotNull(Test.NOT_NULL, testChunk);
+ assertEquals(Test.MATCH, testType, testChunk.getType());
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
+
+ testType = SpeechCapabilities.SILENCE;
+ testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
+ assertNotNull(Test.NOT_NULL, testChunk);
+ assertEquals(Test.MATCH, testType, testChunk.getType());
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
+
+ testType = SpeechCapabilities.SAPI_PHONEMES;
+ testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
+ assertNotNull(Test.NOT_NULL, testChunk);
+ assertEquals(Test.MATCH, testType, testChunk.getType());
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
+
+ testType = SpeechCapabilities.PRE_RECORDED;
+ testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
+ assertNotNull(Test.NOT_NULL, testChunk);
+ assertEquals(Test.MATCH, testType, testChunk.getType());
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
+
+ testType = SpeechCapabilities.LHPLUS_PHONEMES;
+ testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
+ assertNotNull(Test.NOT_NULL, testChunk);
+ assertEquals(Test.MATCH, testType, testChunk.getType());
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
+
+ // Invalid/Null Tests
+ testChunk = TTSChunkFactory.createChunk(null, null);
+ assertNotNull(Test.NOT_NULL, testChunk);
+ assertNull(Test.NULL, testChunk.getType());
+ assertNull(Test.NULL, testChunk.getText());
+ }
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.proxy.TTSChunkFactory#createSimpleTTSChunks(String)}
+ */
+ public void testCreateSimpleTTSChunks () {
+ // Test Values
+ Vector<TTSChunk> testChunks;
+ testChunks = TTSChunkFactory.createSimpleTTSChunks(Test.GENERAL_STRING);
+
+ // Valid Tests
+ assertNotNull(Test.NOT_NULL, testChunks);
+ assertEquals(Test.MATCH, SpeechCapabilities.TEXT, testChunks.get(0).getType());
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunks.get(0).getText());
+
+ // Invalid/Null Tests
+ testChunks = TTSChunkFactory.createSimpleTTSChunks(null);
+ assertNull(Test.NULL, testChunks);
+ }
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.proxy.TTSChunkFactory#createPrerecordedTTSChunks(String)}
+ */
+ public void testCreatePrerecordedTTSChunks () {
+ // Test Values
+ Vector<TTSChunk> testChunks;
+ testChunks = TTSChunkFactory.createPrerecordedTTSChunks(Test.GENERAL_STRING);
+
+ // Valid Tests
+ assertNotNull(Test.NOT_NULL, testChunks);
+ assertEquals(Test.MATCH, SpeechCapabilities.PRE_RECORDED, testChunks.get(0).getType());
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunks.get(0).getText());
+
+ // Invalid/Null Tests
+ testChunks = TTSChunkFactory.createPrerecordedTTSChunks(null);
+ assertNull(Test.NULL, testChunks);
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java
index 7b497310e..7b497310e 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java
new file mode 100644
index 000000000..dae248b74
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java
@@ -0,0 +1,102 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.AirbagStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+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.AirbagStatus}
+ */
+public class AirbagStatusTests extends TestCase{
+
+ private AirbagStatus msg;
+
+ @Override
+ public void setUp(){
+ msg = new AirbagStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ msg.setDriverAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setDriverCurtainAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setDriverKneeAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setDriverSideAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setPassengerAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setPassengerCurtainAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setPassengerKneeAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setPassengerSideAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ VehicleDataEventStatus airbagStatus = msg.getDriverAirbagDeployed();
+ VehicleDataEventStatus curtainStatus = msg.getDriverCurtainAirbagDeployed();
+ VehicleDataEventStatus kneeStatus = msg.getDriverKneeAirbagDeployed();
+ VehicleDataEventStatus sideStatus = msg.getDriverSideAirbagDeployed();
+ VehicleDataEventStatus passengerStatus = msg.getPassengerAirbagDeployed();
+ VehicleDataEventStatus passengerCurtainStatus = msg.getPassengerCurtainAirbagDeployed();
+ VehicleDataEventStatus passengerKneeStatus = msg.getPassengerKneeAirbagDeployed();
+ VehicleDataEventStatus passengerSideStatus = msg.getPassengerSideAirbagDeployed();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, airbagStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, curtainStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, kneeStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, sideStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerCurtainStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerKneeStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerSideStatus);
+
+ // Invalid/Null Tests
+ AirbagStatus msg = new AirbagStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getDriverAirbagDeployed());
+ assertNull(Test.NULL, msg.getDriverSideAirbagDeployed());
+ assertNull(Test.NULL, msg.getDriverCurtainAirbagDeployed());
+ assertNull(Test.NULL, msg.getPassengerAirbagDeployed());
+ assertNull(Test.NULL, msg.getPassengerCurtainAirbagDeployed());
+ assertNull(Test.NULL, msg.getDriverKneeAirbagDeployed());
+ assertNull(Test.NULL, msg.getPassengerSideAirbagDeployed());
+ assertNull(Test.NULL, msg.getPassengerKneeAirbagDeployed());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(AirbagStatus.KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(AirbagStatus.KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(AirbagStatus.KEY_PASSENGER_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(AirbagStatus.KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(AirbagStatus.KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(AirbagStatus.KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceCapabilityTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceCapabilityTest.java
new file mode 100644
index 000000000..ca03861cd
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceCapabilityTest.java
@@ -0,0 +1,137 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.rpc.AppServiceCapability;
+import com.smartdevicelink.proxy.rpc.AppServiceManifest;
+import com.smartdevicelink.proxy.rpc.AppServiceRecord;
+import com.smartdevicelink.proxy.rpc.MediaServiceManifest;
+import com.smartdevicelink.proxy.rpc.NavigationServiceManifest;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.utl.AppServiceFactory;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.AppServiceCapability}
+ */
+public class AppServiceCapabilityTest extends TestCase {
+
+ private AppServiceCapability msg;
+
+ @Override
+ public void setUp(){
+
+ msg = new AppServiceCapability();
+ msg.setUpdatedAppServiceRecord(Test.GENERAL_APPSERVICERECORD);
+ msg.setUpdateReason(Test.GENERAL_SERVICE_UPDATE_REASON);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ AppServiceRecord serviceRecord = msg.getUpdatedAppServiceRecord();
+ ServiceUpdateReason updateReason = msg.getUpdateReason();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, serviceRecord, Test.GENERAL_APPSERVICERECORD);
+ assertEquals(Test.MATCH, updateReason, Test.GENERAL_SERVICE_UPDATE_REASON);
+
+ // Invalid/Null Tests
+ AppServiceCapability msg = new AppServiceCapability();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getUpdatedAppServiceRecord());
+ assertNull(Test.NULL, msg.getUpdateReason());
+ }
+
+ public void testRequiredParamsConstructor(){
+ msg = new AppServiceCapability(Test.GENERAL_APPSERVICERECORD);
+ AppServiceRecord serviceRecord = msg.getUpdatedAppServiceRecord();
+ assertEquals(Test.MATCH, serviceRecord, Test.GENERAL_APPSERVICERECORD);
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(AppServiceCapability.KEY_UPDATE_REASON, Test.GENERAL_SERVICE_UPDATE_REASON);
+ reference.put(AppServiceCapability.KEY_UPDATED_APP_SERVICE_RECORD, Test.GENERAL_APPSERVICERECORD);
+
+ 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(AppServiceCapability.KEY_UPDATED_APP_SERVICE_RECORD)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateAppServiceRecord(Test.GENERAL_APPSERVICERECORD, new AppServiceRecord(hashTest)));
+ } else{
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ }
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+ }
+
+ public void testMatchesAppService(){
+
+ String baseName = "NavTest", baseID = "37F98053AE";
+
+ AppServiceCapability capability1 = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, baseName, baseID, true, null);
+ AppServiceCapability capability2 = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, baseName, baseID, true, null);
+
+ assertTrue(capability1.matchesAppService(capability2));
+
+ //Remove the service id from record 2
+ capability2.getUpdatedAppServiceRecord().setServiceID(null);
+ assertNull(capability2.getUpdatedAppServiceRecord().getServiceID());
+ assertTrue(capability1.matchesAppService(capability2));
+
+ /* UPDATE WITH NEW SERVICE MANIFEST CHANGES */
+
+ AppServiceManifest appServiceManifest2 = capability2.getUpdatedAppServiceRecord().getServiceManifest();
+
+ List<FunctionID> handledRPCs2 = new ArrayList<>();
+ handledRPCs2.add(FunctionID.SEND_LOCATION);
+ handledRPCs2.add(FunctionID.GET_WAY_POINTS);
+ appServiceManifest2.setHandledRpcsUsingFunctionIDs(handledRPCs2);
+ capability2.getUpdatedAppServiceRecord().setServiceManifest(appServiceManifest2);
+
+ assertTrue(capability1.matchesAppService(capability2));
+
+
+ /* UPDATE WITH NEW SERVICE MANIFEST APP NAME */
+ capability2.getUpdatedAppServiceRecord().getServiceManifest().setServiceName("Nav-Test");
+ assertFalse(capability1.matchesAppService(capability2));
+
+
+ /* UPDATE WITH NEW SERVICE ID */
+ //Reset name
+ capability2.getUpdatedAppServiceRecord().getServiceManifest().setServiceName(baseName);
+
+ capability2.getUpdatedAppServiceRecord().setServiceID("EEEEEEEEEE");
+ assertFalse(capability1.matchesAppService(capability2));
+ }
+
+
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceDataTests.java
new file mode 100644
index 000000000..54aff3ef5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceDataTests.java
@@ -0,0 +1,118 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.AppServiceData;
+import com.smartdevicelink.proxy.rpc.MediaServiceData;
+import com.smartdevicelink.proxy.rpc.NavigationServiceData;
+import com.smartdevicelink.proxy.rpc.WeatherServiceData;
+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.proxy.rpc.AppServiceData}
+ */
+public class AppServiceDataTests extends TestCase {
+
+ private AppServiceData msg;
+
+ @Override
+ public void setUp() {
+
+ msg = new AppServiceData();
+ msg.setServiceType(Test.GENERAL_STRING);
+ msg.setServiceID(Test.GENERAL_STRING);
+ msg.setMediaServiceData(Test.GENERAL_MEDIASERVICEDATA);
+ msg.setWeatherServiceData(Test.GENERAL_WEATHERSERVICEDATA);
+ msg.setNavigationServiceData(Test.GENERAL_NAVIGATIONSERVICEDATA);
+
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String appServiceType = msg.getServiceType();
+ String serviceId = msg.getServiceID();
+ MediaServiceData mediaServiceData = msg.getMediaServiceData();
+ WeatherServiceData weatherServiceData = msg.getWeatherServiceData();
+ NavigationServiceData navigationServiceData = msg.getNavigationServiceData();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_STRING, appServiceType);
+ assertEquals(Test.GENERAL_STRING, serviceId);
+ assertEquals(Test.GENERAL_MEDIASERVICEDATA, mediaServiceData);
+ assertEquals(Test.GENERAL_WEATHERSERVICEDATA, weatherServiceData);
+ assertEquals(Test.GENERAL_NAVIGATIONSERVICEDATA, navigationServiceData);
+
+ // Invalid/Null Tests
+ AppServiceData msg = new AppServiceData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getServiceType());
+ assertNull(Test.NULL, msg.getServiceID());
+ assertNull(Test.NULL, msg.getMediaServiceData());
+ assertNull(Test.NULL, msg.getWeatherServiceData());
+ assertNull(Test.NULL, msg.getNavigationServiceData());
+
+ }
+
+ public void testRequiredParamsConstructor(){
+
+ msg = new AppServiceData(Test.GENERAL_STRING, Test.GENERAL_STRING);
+ String appServiceType = msg.getServiceType();
+ String serviceId = msg.getServiceID();
+ assertEquals(Test.GENERAL_STRING, appServiceType);
+ assertEquals(Test.GENERAL_STRING, serviceId);
+
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(AppServiceData.KEY_SERVICE_TYPE, Test.GENERAL_STRING);
+ reference.put(AppServiceData.KEY_SERVICE_ID, Test.GENERAL_STRING);
+ reference.put(AppServiceData.KEY_MEDIA_SERVICE_DATA, Test.GENERAL_MEDIASERVICEDATA);
+ reference.put(AppServiceData.KEY_WEATHER_SERVICE_DATA, Test.GENERAL_WEATHERSERVICEDATA);
+ reference.put(AppServiceData.KEY_NAVIGATION_SERVICE_DATA, Test.GENERAL_NAVIGATIONSERVICEDATA);
+
+ 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(AppServiceData.KEY_MEDIA_SERVICE_DATA)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateMediaServiceData(Test.GENERAL_MEDIASERVICEDATA, new MediaServiceData(hashTest)));
+ } else if (key.equals(AppServiceData.KEY_WEATHER_SERVICE_DATA)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateWeatherServiceData(Test.GENERAL_WEATHERSERVICEDATA, new WeatherServiceData(hashTest)));
+ } else if (key.equals(AppServiceData.KEY_NAVIGATION_SERVICE_DATA)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateNavigationServiceData(Test.GENERAL_NAVIGATIONSERVICEDATA, new NavigationServiceData(hashTest)));
+ } else {
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ }
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceManifestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceManifestTests.java
new file mode 100644
index 000000000..99bd5b716
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceManifestTests.java
@@ -0,0 +1,148 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.AppServiceManifest;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.MediaServiceManifest;
+import com.smartdevicelink.proxy.rpc.NavigationServiceManifest;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.WeatherServiceManifest;
+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;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.AppServiceManifest}
+ */
+public class AppServiceManifestTests extends TestCase {
+
+ private AppServiceManifest msg;
+
+ @Override
+ public void setUp(){
+
+ msg = new AppServiceManifest();
+ msg.setServiceType(Test.GENERAL_STRING);
+ msg.setAllowAppConsumers(Test.GENERAL_BOOLEAN);
+ msg.setHandledRpcs(Test.GENERAL_FUNCTION_ID_LIST);
+ msg.setMediaServiceManifest(Test.GENERAL_MEDIA_SERVICE_MANIFEST);
+ msg.setRpcSpecVersion(Test.GENERAL_SDLMSGVERSION);
+ msg.setServiceIcon(Test.GENERAL_IMAGE);
+ msg.setServiceName(Test.GENERAL_STRING);
+ msg.setWeatherServiceManifest(Test.GENERAL_WEATHER_SERVICE_MANIFEST);
+ msg.setNavigationServiceManifest(Test.GENERAL_NAVIGATION_SERVICE_MANIFEST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Image serviceIcon = msg.getServiceIcon();
+ String serviceName = msg.getServiceName();
+ String appServiceType = msg.getServiceType();
+ boolean allowAppConsumers = msg.getAllowAppConsumers();
+ SdlMsgVersion version = msg.getRpcSpecVersion();
+ List<Integer> handledRPCs = msg.getHandledRpcs();
+ WeatherServiceManifest weatherServiceManifestTest = msg.getWeatherServiceManifest();
+ MediaServiceManifest mediaServiceManifestTest = msg.getMediaServiceManifest();
+ NavigationServiceManifest navigationServiceManifest = msg.getNavigationServiceManifest();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_BOOLEAN, allowAppConsumers);
+ assertEquals(Test.GENERAL_IMAGE, serviceIcon);
+ assertEquals(Test.GENERAL_STRING, serviceName);
+ assertEquals(Test.GENERAL_STRING, appServiceType);
+ assertEquals(Test.GENERAL_SDLMSGVERSION, version);
+ assertEquals(Test.MATCH, Test.GENERAL_FUNCTION_ID_LIST, handledRPCs);
+ assertEquals(Test.GENERAL_WEATHER_SERVICE_MANIFEST, weatherServiceManifestTest);
+ assertEquals(Test.GENERAL_MEDIA_SERVICE_MANIFEST, mediaServiceManifestTest);
+ assertEquals(Test.GENERAL_NAVIGATION_SERVICE_MANIFEST, navigationServiceManifest);
+
+ // Invalid/Null Tests
+ AppServiceManifest msg = new AppServiceManifest();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getServiceIcon());
+ assertNull(Test.NULL, msg.getServiceName());
+ assertNull(Test.NULL, msg.getServiceType());
+ assertNull(Test.NULL, msg.getAllowAppConsumers());
+ assertNull(Test.NULL, msg.getRpcSpecVersion());
+ assertNull(Test.NULL, msg.getHandledRpcs());
+ assertNull(Test.NULL, msg.getWeatherServiceManifest());
+ assertNull(Test.NULL, msg.getMediaServiceManifest());
+ assertNull(Test.NULL, msg.getNavigationServiceManifest());
+ }
+
+ public void testRequiredParamsConstructor(){
+ msg = new AppServiceManifest(Test.GENERAL_STRING);
+ String appServiceType = msg.getServiceType();
+ assertEquals(Test.GENERAL_STRING, appServiceType);
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(AppServiceManifest.KEY_SERVICE_NAME, Test.GENERAL_STRING);
+ reference.put(AppServiceManifest.KEY_SERVICE_ICON, Test.GENERAL_IMAGE);
+ reference.put(AppServiceManifest.KEY_SERVICE_TYPE, Test.GENERAL_STRING);
+ reference.put(AppServiceManifest.KEY_ALLOW_APP_CONSUMERS, Test.GENERAL_BOOLEAN);
+ reference.put(AppServiceManifest.KEY_RPC_SPEC_VERSION, Test.GENERAL_SDLMSGVERSION.serializeJSON());
+ reference.put(AppServiceManifest.KEY_HANDLED_RPCS, Test.GENERAL_FUNCTION_ID_LIST);
+ reference.put(AppServiceManifest.KEY_WEATHER_SERVICE_MANIFEST, Test.GENERAL_WEATHER_SERVICE_MANIFEST);
+ reference.put(AppServiceManifest.KEY_MEDIA_SERVICE_MANIFEST, Test.GENERAL_MEDIA_SERVICE_MANIFEST);
+ reference.put(AppServiceManifest.KEY_NAVIGATION_SERVICE_MANIFEST, Test.GENERAL_NAVIGATION_SERVICE_MANIFEST);
+
+ 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(AppServiceManifest.KEY_RPC_SPEC_VERSION)){
+ 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.validateSdlMsgVersion( new SdlMsgVersion(hashReference), new SdlMsgVersion(hashTest)));
+ }else if(key.equals(AppServiceManifest.KEY_HANDLED_RPCS)){
+ List<Integer> list1 = Test.GENERAL_FUNCTION_ID_LIST;
+ List<Integer> list2 = JsonUtils.readIntegerListFromJsonObject(underTest, key);
+ assertTrue(Test.TRUE, Validator.validateIntegerList(list1,list2));
+ }else if(key.equals(AppServiceManifest.KEY_WEATHER_SERVICE_MANIFEST)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateWeatherServiceManifest( Test.GENERAL_WEATHER_SERVICE_MANIFEST, new WeatherServiceManifest(hashTest)));
+ }else if(key.equals(AppServiceManifest.KEY_MEDIA_SERVICE_MANIFEST)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateMediaServiceManifest( Test.GENERAL_MEDIA_SERVICE_MANIFEST, new MediaServiceManifest(hashTest)));
+ } else if(key.equals(AppServiceManifest.KEY_NAVIGATION_SERVICE_MANIFEST)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateNavigationServiceManifest( Test.GENERAL_NAVIGATION_SERVICE_MANIFEST, new NavigationServiceManifest(hashTest)));
+ }else if(key.equals(AppServiceManifest.KEY_SERVICE_ICON)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Image refIcon1 = new Image(JsonRPCMarshaller.deserializeJSONObject(testEquals));
+ assertTrue(Test.TRUE, Validator.validateImage(refIcon1, msg.getServiceIcon()));
+ }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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceRecordTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceRecordTests.java
new file mode 100644
index 000000000..0e00a1d70
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceRecordTests.java
@@ -0,0 +1,107 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.AppServiceManifest;
+import com.smartdevicelink.proxy.rpc.AppServiceRecord;
+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.proxy.rpc.AppServiceRecord}
+ */
+public class AppServiceRecordTests extends TestCase {
+
+ private AppServiceRecord msg;
+
+ @Override
+ public void setUp(){
+
+ msg = new AppServiceRecord();
+ msg.setServicePublished(Test.GENERAL_BOOLEAN);
+ msg.setServiceActive(Test.GENERAL_BOOLEAN);
+ msg.setServiceManifest(Test.GENERAL_APPSERVICEMANIFEST);
+ msg.setServiceID(Test.GENERAL_STRING);
+
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+
+ boolean isServicePublished = msg.getServicePublished();
+ boolean isServiceActive = msg.getServiceActive();
+ AppServiceManifest serviceManifest = msg.getServiceManifest();
+ String serviceID = msg.getServiceID();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_BOOLEAN, isServicePublished);
+ assertEquals(Test.GENERAL_BOOLEAN, isServiceActive);
+ assertEquals(Test.GENERAL_APPSERVICEMANIFEST, serviceManifest);
+ assertEquals(Test.GENERAL_STRING, serviceID);
+
+ // Invalid/Null Tests
+ AppServiceRecord msg = new AppServiceRecord();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getServicePublished());
+ assertNull(Test.NULL, msg.getServiceActive());
+ assertNull(Test.NULL, msg.getServiceManifest());
+ assertNull(Test.NULL, msg.getServiceID());
+ }
+
+ public void testRequiredParamsConstructor(){
+ msg = new AppServiceRecord(Test.GENERAL_STRING, Test.GENERAL_APPSERVICEMANIFEST, Test.GENERAL_BOOLEAN, Test.GENERAL_BOOLEAN);
+
+ boolean isServicePublished = msg.getServicePublished();
+ boolean isServiceActive = msg.getServiceActive();
+ AppServiceManifest serviceManifest = msg.getServiceManifest();
+ String serviceID = msg.getServiceID();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_BOOLEAN, isServicePublished);
+ assertEquals(Test.GENERAL_BOOLEAN, isServiceActive);
+ assertEquals(Test.GENERAL_APPSERVICEMANIFEST, serviceManifest);
+ assertEquals(Test.GENERAL_STRING, serviceID);
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(AppServiceRecord.KEY_SERVICE_ACTIVE, Test.GENERAL_BOOLEAN);
+ reference.put(AppServiceRecord.KEY_SERVICE_PUBLISHED, Test.GENERAL_BOOLEAN);
+ reference.put(AppServiceRecord.KEY_SERVICE_ID, Test.GENERAL_STRING);
+ reference.put(AppServiceRecord.KEY_SERVICE_MANIFEST, Test.GENERAL_APPSERVICEMANIFEST);
+
+ 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(AppServiceRecord.KEY_SERVICE_MANIFEST)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateAppServiceManifest( Test.GENERAL_APPSERVICEMANIFEST, new AppServiceManifest(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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServicesCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServicesCapabilitiesTests.java
new file mode 100644
index 000000000..a069e2b69
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServicesCapabilitiesTests.java
@@ -0,0 +1,143 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.AppServiceCapability;
+import com.smartdevicelink.proxy.rpc.AppServicesCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.utl.AppServiceFactory;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.AppServicesCapabilities}
+ */
+public class AppServicesCapabilitiesTests extends TestCase {
+
+ private AppServicesCapabilities msg;
+
+ @Override
+ public void setUp(){
+
+ msg = new AppServicesCapabilities();
+ msg.setAppServices(Test.GENERAL_APPSERVICECAPABILITY_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<AppServiceCapability> serviceCapabilityList = msg.getAppServices();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, serviceCapabilityList, Test.GENERAL_APPSERVICECAPABILITY_LIST);
+
+ // Invalid/Null Tests
+ AppServicesCapabilities msg = new AppServicesCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getAppServices());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(AppServicesCapabilities.KEY_APP_SERVICES, Test.GENERAL_APPSERVICETYPE_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(AppServicesCapabilities.KEY_APP_SERVICES)) {
+ List<AppServiceCapability> list1 = Test.GENERAL_APPSERVICECAPABILITY_LIST;
+ List<AppServiceCapability> list2 = JsonUtils.readAppServiceCapabilityListFromJsonObject(underTest, key);
+ assertTrue(Test.TRUE, Validator.validateAppServiceCapabilityList(list1,list2));
+ }else{
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ }
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+ }
+
+ public void testUpdate(){
+ String baseName = "NavTest", baseID = "37F98053AE";
+ AppServiceCapability capability1 = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, baseName, null, true, null);
+ AppServicesCapabilities capabilities1 = new AppServicesCapabilities();
+ capabilities1.setAppServices(Collections.singletonList(capability1));
+
+ assertNotNull(capabilities1.getAppServices());
+ assertEquals(capabilities1.getAppServices().size(), 1);
+ /* TEST TO ENSURE A THE RECORD HAS THE CORRECT "NULL" VALUE FOR SERVICE ID */
+ assertNull(capabilities1.getAppServices().get(0).getUpdatedAppServiceRecord().getServiceID());
+
+ /* TEST TO ENSURE THAT THE LIST DOES NOT GET UPDATED FOR NULL OR EMPTY LISTS */
+ assertFalse(capabilities1.updateAppServices(null));
+ assertFalse(capabilities1.updateAppServices(new ArrayList<AppServiceCapability>()));
+
+
+ AppServiceCapability capability2 = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, baseName, baseID, true, null);
+
+ /* TEST TO ENSURE A THE LIST BEING STORED WAS MODIFIED */
+ assertTrue(capabilities1.updateAppServices(Collections.singletonList(capability2)));
+
+ /* TEST TO ENSURE A NEW RECORD WAS NOT ADDED */
+ assertEquals(capabilities1.getAppServices().size(), 1);
+
+ assertTrue(capabilities1.getAppServices().get(0).getUpdatedAppServiceRecord().getServiceID().equals(baseID));
+
+ AppServiceCapability capability3 = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, "NewNav", null, true, null);
+
+ /* TEST TO ENSURE A THE LIST BEING STORED WAS MODIFIED */
+ assertTrue(capabilities1.updateAppServices(Collections.singletonList(capability3)));
+
+ /* TEST TO ENSURE A NEW RECORD WAS ADDED */
+ assertEquals(capabilities1.getAppServices().size(), 2);
+
+ AppServiceCapability capability4 = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, "NewNav", "eeeeeeeee", true, null);
+
+ /* TEST TO ENSURE A THE LIST BEING STORED WAS MODIFIED */
+ assertTrue(capabilities1.updateAppServices(Collections.singletonList(capability4)));
+
+ /* TEST TO ENSURE A NEW RECORD WAS NOT ADDED */
+ assertEquals(capabilities1.getAppServices().size(), 2);
+
+ AppServiceCapability capability5 = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, "NewNav", "fffffff", true, null);
+
+ /* TEST TO ENSURE A THE LIST BEING STORED WAS MODIFIED */
+ assertTrue(capabilities1.updateAppServices(Collections.singletonList(capability5)));
+
+ /* TEST TO ENSURE A NEW RECORD WAS NOT ADDED */
+ assertEquals(capabilities1.getAppServices().size(), 3);
+
+
+ capability5.setUpdateReason(ServiceUpdateReason.REMOVED);
+
+ /* TEST TO ENSURE A THE LIST BEING STORED WAS MODIFIED */
+ assertTrue(capabilities1.updateAppServices(Collections.singletonList(capability5)));
+
+ /* TEST TO ENSURE THE RECORD WAS REMOVED */
+ assertEquals(capabilities1.getAppServices().size(), 2);
+
+ /* TEST TO ENSURE THE RECORD REMOVED WAS THE CORRECT ONE */
+ assertFalse(capabilities1.getAppServices().contains(capability5));
+
+
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java
index 524a6bde2..524a6bde2 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java
index 4dba080ac..4dba080ac 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java
new file mode 100644
index 000000000..55af9d881
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java
@@ -0,0 +1,78 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+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.AudioPassThruCapabilities}
+ */
+public class AudioPassThruCapabilitiesTest extends TestCase{
+
+ private AudioPassThruCapabilities msg;
+
+ @Override
+ public void setUp(){
+ msg = new AudioPassThruCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ msg.setAudioType(Test.GENERAL_AUDIOTYPE);
+ msg.setBitsPerSample(Test.GENERAL_BITSPERSAMPLE);
+ msg.setSamplingRate(Test.GENERAL_SAMPLINGRATE);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ SamplingRate samplingRate = msg.getSamplingRate();
+ BitsPerSample bitsPerSample = msg.getBitsPerSample();
+ AudioType audioType = msg.getAudioType();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_SAMPLINGRATE, samplingRate);
+ assertEquals(Test.MATCH, Test.GENERAL_BITSPERSAMPLE, bitsPerSample);
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIOTYPE, audioType);
+
+ // Invalid/Null Tests
+ AudioPassThruCapabilities msg = new AudioPassThruCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getAudioType());
+ assertNull(Test.NULL, msg.getBitsPerSample());
+ assertNull(Test.NULL, msg.getSamplingRate());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, Test.GENERAL_AUDIOTYPE);
+ reference.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, Test.GENERAL_BITSPERSAMPLE);
+ reference.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, Test.GENERAL_SAMPLINGRATE);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java
new file mode 100644
index 000000000..c13e1abd4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java
@@ -0,0 +1,137 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.BeltStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+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.BeltStatus}
+ */
+public class BeltStatusTests extends TestCase{
+
+ private BeltStatus msg;
+
+ @Override
+ protected void setUp() throws Exception{
+ msg = new BeltStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ msg.setLeftRearInflatableBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setPassengerChildDetected(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setRightRearInflatableBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setDriverBuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setPassengerBuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setRightRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setDriverBeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setPassengerBeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setMiddleRow1BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setMiddleRow1BeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setLeftRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setMiddleRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setMiddleRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setLeftRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setRightRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Valid Tests
+ VehicleDataEventStatus leftRearInflatable = msg.getLeftRearInflatableBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, leftRearInflatable);
+
+ VehicleDataEventStatus rightRearInflatable = msg.getRightRearInflatableBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, rightRearInflatable);
+
+ VehicleDataEventStatus passengerChild = msg.getPassengerChildDetected();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerChild);
+
+ VehicleDataEventStatus driverBuckled = msg.getDriverBuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+ driverBuckled = msg.getPassengerBuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+ driverBuckled = msg.getRightRow2BuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+ driverBuckled = msg.getMiddleRow1BuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+ driverBuckled = msg.getLeftRow2BuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+ driverBuckled = msg.getMiddleRow2BuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+ driverBuckled = msg.getMiddleRow3BuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+ driverBuckled = msg.getLeftRow3BuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+ driverBuckled = msg.getRightRow3BuckleBelted();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
+
+ VehicleDataEventStatus driverBeltDeployed = msg.getDriverBeltDeployed();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed);
+ driverBeltDeployed = msg.getPassengerBeltDeployed();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed);
+ driverBeltDeployed = msg.getMiddleRow1BeltDeployed();
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed);
+
+ // Invalid/Null Tests
+ BeltStatus msg = new BeltStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getLeftRearInflatableBelted());
+ assertNull(Test.NULL, msg.getRightRearInflatableBelted());
+ assertNull(Test.NULL, msg.getPassengerChildDetected());
+ assertNull(Test.NULL, msg.getDriverBuckleBelted());
+ assertNull(Test.NULL, msg.getPassengerBuckleBelted());
+ assertNull(Test.NULL, msg.getRightRow2BuckleBelted());
+ assertNull(Test.NULL, msg.getMiddleRow1BuckleBelted());
+ assertNull(Test.NULL, msg.getLeftRow2BuckleBelted());
+ assertNull(Test.NULL, msg.getMiddleRow2BuckleBelted());
+ assertNull(Test.NULL, msg.getMiddleRow3BuckleBelted());
+ assertNull(Test.NULL, msg.getLeftRow3BuckleBelted());
+ assertNull(Test.NULL, msg.getRightRow3BuckleBelted());
+ assertNull(Test.NULL, msg.getPassengerBeltDeployed());
+ assertNull(Test.NULL, msg.getMiddleRow1BeltDeployed());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(BeltStatus.KEY_PASSENGER_CHILD_DETECTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_REAR_INFLATABLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_RIGHT_REAR_INFLATABLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_DRIVER_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_DRIVER_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_PASSENGER_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_PASSENGER_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_LEFT_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_RIGHT_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_MIDDLE_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_MIDDLE_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_LEFT_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_RIGHT_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_MIDDLE_ROW_1_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(BeltStatus.KEY_MIDDLE_ROW_1_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java
new file mode 100644
index 000000000..ce3d8b9a0
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java
@@ -0,0 +1,93 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.BodyInformation;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
+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.BodyInformation}
+ */
+public class BodyInformationTests extends TestCase{
+
+ private BodyInformation msg;
+
+ @Override
+ public void setUp(){
+ msg = new BodyInformation();
+ msg.setParkBrakeActive(Test.GENERAL_BOOLEAN);
+ msg.setIgnitionStatus(Test.GENERAL_IGNITIONSTATUS);
+ msg.setIgnitionStableStatus(Test.GENERAL_IGNITIONSTABLESTATUS);
+
+ msg.setDriverDoorAjar(Test.GENERAL_BOOLEAN);
+ msg.setPassengerDoorAjar(Test.GENERAL_BOOLEAN);
+ msg.setRearLeftDoorAjar(Test.GENERAL_BOOLEAN);
+ msg.setRearRightDoorAjar(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean parkBrake = msg.getParkBrakeActive();
+ IgnitionStatus ignitionStatus = msg.getIgnitionStatus();
+ IgnitionStableStatus ignitionStable = msg.getIgnitionStableStatus();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, parkBrake);
+ assertEquals(Test.MATCH, Test.GENERAL_IGNITIONSTATUS, ignitionStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_IGNITIONSTABLESTATUS, ignitionStable);
+
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getDriverDoorAjar());
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getPassengerDoorAjar());
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getRearLeftDoorAjar());
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getRearRightDoorAjar());
+
+ // Invalid/Null Tests
+ BodyInformation msg = new BodyInformation();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getParkBrakeActive());
+ assertNull(Test.NULL, msg.getIgnitionStatus());
+ assertNull(Test.NULL, msg.getIgnitionStatus());
+ assertNull(Test.NULL, msg.getDriverDoorAjar());
+ assertNull(Test.NULL, msg.getPassengerDoorAjar());
+ assertNull(Test.NULL, msg.getRearLeftDoorAjar());
+ assertNull(Test.NULL, msg.getRearRightDoorAjar());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, Test.GENERAL_BOOLEAN);
+ reference.put(BodyInformation.KEY_IGNITION_STATUS, Test.GENERAL_IGNITIONSTATUS);
+ reference.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, Test.GENERAL_IGNITIONSTABLESTATUS);
+ reference.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, Test.GENERAL_BOOLEAN);
+ reference.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, Test.GENERAL_BOOLEAN);
+ reference.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, Test.GENERAL_BOOLEAN);
+ reference.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java
new file mode 100644
index 000000000..4365ceafa
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java
@@ -0,0 +1,82 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+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.ButtonCapabilities}
+ */
+public class ButtonCapabilitiesTests extends TestCase{
+
+ private ButtonCapabilities msg;
+
+ @Override
+ public void setUp(){
+ msg = new ButtonCapabilities();
+
+ msg.setLongPressAvailable(Test.GENERAL_BOOLEAN);
+ msg.setName(Test.GENERAL_BUTTONNAME);
+ msg.setShortPressAvailable(Test.GENERAL_BOOLEAN);
+ msg.setUpDownAvailable(Test.GENERAL_BOOLEAN);
+ }
+
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean shortPress = msg.getShortPressAvailable();
+ boolean longPress = msg.getLongPressAvailable();
+ boolean upDown = msg.getUpDownAvailable();
+ ButtonName buttonName = msg.getName();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, shortPress);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, longPress);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, upDown);
+ assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, buttonName);
+
+ // Invalid/Null Tests
+ ButtonCapabilities msg = new ButtonCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getShortPressAvailable());
+ assertNull(Test.NULL, msg.getLongPressAvailable());
+ assertNull(Test.NULL, msg.getUpDownAvailable());
+ assertNull(Test.NULL, msg.getName());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ButtonCapabilities.KEY_NAME, Test.GENERAL_BUTTONNAME);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java
new file mode 100644
index 000000000..5374ae2bf
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java
@@ -0,0 +1,113 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.Choice;
+import com.smartdevicelink.proxy.rpc.Image;
+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;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.Choice}
+ */
+public class ChoiceTests extends TestCase{
+
+ private Choice msg;
+
+ @Override
+ public void setUp(){
+ msg = new Choice();
+
+ msg.setChoiceID(Test.GENERAL_INT);
+ msg.setMenuName(Test.GENERAL_STRING);
+ msg.setImage(Test.GENERAL_IMAGE);
+ msg.setSecondaryImage(Test.GENERAL_IMAGE);
+ msg.setSecondaryText(Test.GENERAL_STRING);
+ msg.setTertiaryText(Test.GENERAL_STRING);
+ msg.setVrCommands(Test.GENERAL_STRING_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String text3 = msg.getTertiaryText();
+ String text2 = msg.getSecondaryText();
+ String menuName = msg.getMenuName();
+ int choiceId = msg.getChoiceID();
+ List<String> vrCommands = msg.getVrCommands();
+ Image image2 = msg.getSecondaryImage();
+ Image image = msg.getImage();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, text3);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, text2);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, menuName);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, choiceId);
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, vrCommands));
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image2));
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image));
+
+ // Invalid/Null Tests
+ Choice msg = new Choice();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getChoiceID());
+ assertNull(Test.NULL, msg.getImage());
+ assertNull(Test.NULL, msg.getSecondaryImage());
+ assertNull(Test.NULL, msg.getMenuName());
+ assertNull(Test.NULL, msg.getSecondaryText());
+ assertNull(Test.NULL, msg.getTertiaryText());
+ assertNull(Test.NULL, msg.getVrCommands());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(Choice.KEY_CHOICE_ID, Test.GENERAL_INT);
+ reference.put(Choice.KEY_MENU_NAME, Test.GENERAL_STRING);
+ reference.put(Choice.KEY_SECONDARY_TEXT, Test.GENERAL_STRING);
+ reference.put(Choice.KEY_TERTIARY_TEXT, Test.GENERAL_STRING);
+ reference.put(Choice.KEY_IMAGE, Test.JSON_IMAGE);
+ reference.put(Choice.KEY_SECONDARY_IMAGE, Test.JSON_IMAGE);
+ reference.put(Choice.KEY_VR_COMMANDS, JsonUtils.createJsonArray(Test.GENERAL_STRING_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(Choice.KEY_VR_COMMANDS)){
+ assertTrue(Test.TRUE,
+ Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key),
+ JsonUtils.readStringListFromJsonObject(underTest, key)));
+ } else if(key.equals(Choice.KEY_IMAGE) || key.equals(Choice.KEY_SECONDARY_IMAGE)){
+ JSONObject objectEquals = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject testEquals = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+
+ assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(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/ClimateControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java
index c391eb4eb..c391eb4eb 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java
index 99d5c3285..99d5c3285 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CloudAppPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CloudAppPropertiesTests.java
new file mode 100644
index 000000000..75be1e9cc
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CloudAppPropertiesTests.java
@@ -0,0 +1,104 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.CloudAppProperties;
+import com.smartdevicelink.proxy.rpc.enums.HybridAppPreference;
+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.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.CloudAppProperties}
+ */
+public class CloudAppPropertiesTests extends TestCase{
+
+ private CloudAppProperties msg;
+
+ @Override
+ public void setUp(){
+ msg = new CloudAppProperties();
+
+ msg.setNicknames(Test.GENERAL_STRING_LIST);
+ msg.setAppID(Test.GENERAL_STRING);
+ msg.setEnabled(Test.GENERAL_BOOLEAN);
+ msg.setAuthToken(Test.GENERAL_STRING);
+ msg.setCloudTransportType(Test.GENERAL_STRING);
+ msg.setHybridAppPreference(Test.GENERAL_HYBRID_APP_PREFERENCE);
+ msg.setEndpoint(Test.GENERAL_STRING);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<String> nicknames = msg.getNicknames();
+ String appID = msg.getAppID();
+ boolean enabled = msg.isEnabled();
+ String authToken = msg.getAuthToken();
+ String cloudTransportType = msg.getCloudTransportType();
+ HybridAppPreference hybridAppPreference = msg.getHybridAppPreference();
+ String endpoint = msg.getEndpoint();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST, nicknames);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, appID);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, enabled);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, authToken);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, cloudTransportType);
+ assertEquals(Test.MATCH, Test.GENERAL_HYBRID_APP_PREFERENCE, hybridAppPreference);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, endpoint);
+
+ // Invalid/Null Tests
+ CloudAppProperties msg = new CloudAppProperties();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getNicknames());
+ assertNull(Test.NULL, msg.getAppID());
+ assertNull(Test.NULL, msg.isEnabled());
+ assertNull(Test.NULL, msg.getAuthToken());
+ assertNull(Test.NULL, msg.getCloudTransportType());
+ assertNull(Test.NULL, msg.getHybridAppPreference());
+ assertNull(Test.NULL, msg.getEndpoint());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(CloudAppProperties.KEY_NICKNAMES, Test.GENERAL_STRING_LIST);
+ reference.put(CloudAppProperties.KEY_APP_ID, Test.GENERAL_STRING);
+ reference.put(CloudAppProperties.KEY_ENABLED, Test.GENERAL_BOOLEAN);
+ reference.put(CloudAppProperties.KEY_AUTH_TOKEN, Test.GENERAL_STRING);
+ reference.put(CloudAppProperties.KEY_CLOUD_TRANSPORT_TYPE, Test.GENERAL_STRING);
+ reference.put(CloudAppProperties.KEY_HYBRID_APP_PREFERENCE, Test.GENERAL_HYBRID_APP_PREFERENCE);
+ reference.put(CloudAppProperties.KEY_ENDPOINT, 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(CloudAppProperties.KEY_NICKNAMES)){
+ Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key),
+ JsonUtils.readStringListFromJsonObject(underTest, key));
+ }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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java
new file mode 100644
index 000000000..366339818
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java
@@ -0,0 +1,82 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
+import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
+import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
+import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
+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.ClusterModeStatus}
+ */
+public class ClusterModeStatusTests extends TestCase{
+
+ private ClusterModeStatus msg;
+
+ @Override
+ public void setUp(){
+ msg = new ClusterModeStatus();
+
+ msg.setPowerModeActive(Test.GENERAL_BOOLEAN);
+ msg.setCarModeStatus(Test.GENERAL_CARMODESTATUS);
+ msg.setPowerModeQualificationStatus(Test.GENERAL_POWERMODEQUALIFICATIONSTATUS);
+ msg.setPowerModeStatus(Test.GENERAL_POWERMODESTATUS);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean powerMode = msg.getPowerModeActive();
+ PowerModeQualificationStatus qualification = msg.getPowerModeQualificationStatus();
+ PowerModeStatus status = msg.getPowerModeStatus();
+ CarModeStatus carStatus = msg.getCarModeStatus();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, powerMode);
+ assertEquals(Test.MATCH, Test.GENERAL_POWERMODEQUALIFICATIONSTATUS, qualification);
+ assertEquals(Test.MATCH, Test.GENERAL_POWERMODESTATUS, status);
+ assertEquals(Test.MATCH, Test.GENERAL_CARMODESTATUS, carStatus);
+
+ // Invalid/Null Tests
+ ClusterModeStatus msg = new ClusterModeStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getPowerModeActive());
+ assertNull(Test.NULL, msg.getPowerModeStatus());
+ assertNull(Test.NULL, msg.getPowerModeQualificationStatus());
+ assertNull(Test.NULL, msg.getCarModeStatus());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(ClusterModeStatus.KEY_POWER_MODE_ACTIVE, Test.GENERAL_BOOLEAN);
+ reference.put(ClusterModeStatus.KEY_POWER_MODE_STATUS, Test.GENERAL_POWERMODESTATUS);
+ reference.put(ClusterModeStatus.KEY_POWER_MODE_QUALIFICATION_STATUS, Test.GENERAL_POWERMODEQUALIFICATIONSTATUS);
+ reference.put(ClusterModeStatus.KEY_CAR_MODE_STATUS, Test.GENERAL_CARMODESTATUS);
+
+ 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/CoordinateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java
index 5f8a8327f..5f8a8327f 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java
new file mode 100644
index 000000000..245abf45b
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java
@@ -0,0 +1,70 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.DIDResult;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
+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.DIDResult}
+ */
+public class DIDResultTests extends TestCase {
+
+ private DIDResult msg;
+
+ @Override
+ public void setUp(){
+ msg = new DIDResult();
+
+ msg.setData(Test.GENERAL_STRING);
+ msg.setResultCode(Test.GENERAL_VEHICLEDATARESULTCODE);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String data = msg.getData();
+ VehicleDataResultCode resultCode = msg.getResultCode();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, data);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATARESULTCODE, resultCode);
+
+ // Invalid/Null Tests
+ DIDResult msg = new DIDResult();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getData());
+ assertNull(Test.NULL, msg.getResultCode());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(DIDResult.KEY_DATA, Test.GENERAL_STRING);
+ reference.put(DIDResult.KEY_RESULT_CODE, Test.GENERAL_VEHICLEDATARESULTCODE);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java
new file mode 100644
index 000000000..7104e8c6d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java
@@ -0,0 +1,69 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.DTC;
+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.DTC}
+ */
+public class DTCTests extends TestCase{
+
+ private DTC msg;
+
+ @Override
+ public void setUp(){
+ msg = new DTC();
+
+ msg.setIdentifier(Test.GENERAL_STRING);
+ msg.setStatusByte(Test.GENERAL_STRING);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String identifier = msg.getIdentifier();
+ String statusByte = msg.getStatusByte();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, identifier);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, statusByte);
+
+ // Invalid/Null Tests
+ DTC msg = new DTC();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getIdentifier());
+ assertNull(Test.NULL, msg.getStatusByte());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(DTC.KEY_IDENTIFIER, Test.GENERAL_STRING);
+ reference.put(DTC.KEY_STATUS_BYTE, 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();
+ 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/DateTimeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java
index 2cf38b68f..2cf38b68f 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java
new file mode 100644
index 000000000..dfe75fd30
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java
@@ -0,0 +1,89 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.DeviceInfo;
+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.DeviceInfo}
+ */
+public class DeviceInfoTests extends TestCase{
+
+ private DeviceInfo msg;
+
+ @Override
+ public void setUp(){
+ msg = new DeviceInfo();
+
+ msg.setCarrier(Test.GENERAL_STRING);
+ msg.setFirmwareRev(Test.GENERAL_STRING);
+ msg.setHardware(Test.GENERAL_STRING);
+ msg.setMaxNumberRFCOMMPorts(Test.GENERAL_INT);
+ msg.setOs(Test.GENERAL_STRING);
+ msg.setOsVersion(Test.GENERAL_STRING);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String carrier = msg.getCarrier();
+ String hardware = msg.getHardware();
+ String firmwareRev = msg.getFirmwareRev();
+ String os = msg.getOs();
+ String osVer = msg.getOsVersion();
+ int maxNum = msg.getMaxNumberRFCOMMPorts();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, maxNum);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, osVer);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, os);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, firmwareRev);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, hardware);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, carrier);
+
+ // Invalid/Null Tests
+ DeviceInfo msg = new DeviceInfo();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getCarrier());
+ assertNull(Test.NULL, msg.getHardware());
+ assertNull(Test.NULL, msg.getFirmwareRev());
+ assertNull(Test.NULL, msg.getOs());
+ assertNull(Test.NULL, msg.getOsVersion());
+ assertNull(Test.NULL, msg.getMaxNumberRFCOMMPorts());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(DeviceInfo.KEY_CARRIER, Test.GENERAL_STRING);
+ reference.put(DeviceInfo.KEY_HARDWARE, Test.GENERAL_STRING);
+ reference.put(DeviceInfo.KEY_FIRMWARE_REV, Test.GENERAL_STRING);
+ reference.put(DeviceInfo.KEY_OS, Test.GENERAL_STRING);
+ reference.put(DeviceInfo.KEY_OS_VERSION, Test.GENERAL_STRING);
+ reference.put(DeviceInfo.KEY_MAX_NUMBER_RFCOMM_PORTS, 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java
new file mode 100644
index 000000000..e696e48c2
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java
@@ -0,0 +1,116 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.DeviceStatus;
+import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
+import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
+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.DeviceStatus}
+ */
+public class DeviceStatusTests extends TestCase {
+
+ private DeviceStatus msg;
+
+ @Override
+ public void setUp(){
+ msg = new DeviceStatus();
+
+ msg.setBattLevelStatus(Test.GENERAL_DEVICELEVELSTATUS);
+ msg.setBtIconOn(Test.GENERAL_BOOLEAN);
+ msg.setCallActive(Test.GENERAL_BOOLEAN);
+ msg.setECallEventActive(Test.GENERAL_BOOLEAN);
+ msg.setMonoAudioOutputMuted(Test.GENERAL_BOOLEAN);
+ msg.setPhoneRoaming(Test.GENERAL_BOOLEAN);
+ msg.setPrimaryAudioSource(Test.GENERAL_PRIMARYAUDIOSOURCE);
+ msg.setSignalLevelStatus(Test.GENERAL_DEVICELEVELSTATUS);
+ msg.setStereoAudioOutputMuted(Test.GENERAL_BOOLEAN);
+ msg.setTextMsgAvailable(Test.GENERAL_BOOLEAN);
+ msg.setVoiceRecOn(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ DeviceLevelStatus battLevel = msg.getBattLevelStatus();
+ boolean btIcon = msg.getBtIconOn();
+ boolean callActive = msg.getCallActive();
+ boolean ecall = msg.getECallEventActive();
+ boolean monoAudio = msg.getMonoAudioOutputMuted();
+ boolean phoneRoaming = msg.getPhoneRoaming();
+ PrimaryAudioSource primaryAudio = msg.getPrimaryAudioSource();
+ DeviceLevelStatus signalLevel = msg.getSignalLevelStatus();
+ boolean stereoAudio = msg.getStereoAudioOutputMuted();
+ boolean textAvailable = msg.getTextMsgAvailable();
+ boolean voiceRec = msg.getVoiceRecOn();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_DEVICELEVELSTATUS, battLevel);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, btIcon);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, callActive);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, ecall);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, monoAudio);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, phoneRoaming);
+ assertEquals(Test.MATCH, Test.GENERAL_PRIMARYAUDIOSOURCE, primaryAudio);
+ assertEquals(Test.MATCH, Test.GENERAL_DEVICELEVELSTATUS, signalLevel);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, stereoAudio);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, textAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, voiceRec);
+
+ // Invalid/Null Tests
+ DeviceStatus msg = new DeviceStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getBattLevelStatus());
+ assertNull(Test.NULL, msg.getBtIconOn());
+ assertNull(Test.NULL, msg.getCallActive());
+ assertNull(Test.NULL, msg.getECallEventActive());
+ assertNull(Test.NULL, msg.getMonoAudioOutputMuted());
+ assertNull(Test.NULL, msg.getPhoneRoaming());
+ assertNull(Test.NULL, msg.getPrimaryAudioSource());
+ assertNull(Test.NULL, msg.getSignalLevelStatus());
+ assertNull(Test.NULL, msg.getStereoAudioOutputMuted());
+ assertNull(Test.NULL, msg.getTextMsgAvailable());
+ assertNull(Test.NULL, msg.getVoiceRecOn());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, Test.GENERAL_DEVICELEVELSTATUS);
+ reference.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, Test.GENERAL_DEVICELEVELSTATUS);
+ reference.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, Test.GENERAL_PRIMARYAUDIOSOURCE);
+ reference.put(DeviceStatus.KEY_BT_ICON_ON, Test.GENERAL_BOOLEAN);
+ reference.put(DeviceStatus.KEY_CALL_ACTIVE, Test.GENERAL_BOOLEAN);
+ reference.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, Test.GENERAL_BOOLEAN);
+ reference.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, Test.GENERAL_BOOLEAN);
+ reference.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, Test.GENERAL_BOOLEAN);
+ reference.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(DeviceStatus.KEY_PHONE_ROAMING, Test.GENERAL_BOOLEAN);
+ reference.put(DeviceStatus.KEY_VOICE_REC_ON, 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java
new file mode 100644
index 000000000..f7fcb45e3
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java
@@ -0,0 +1,172 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.ImageField;
+import com.smartdevicelink.proxy.rpc.ScreenParams;
+import com.smartdevicelink.proxy.rpc.TextField;
+import com.smartdevicelink.proxy.rpc.enums.DisplayType;
+import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
+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.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DisplayCapabilities}
+ */
+public class DisplayCapabilitiesTests extends TestCase{
+
+ private DisplayCapabilities msg;
+
+ @Override
+ public void setUp(){
+ msg = new DisplayCapabilities();
+
+ msg.setGraphicSupported(Test.GENERAL_BOOLEAN);
+ msg.setNumCustomPresetsAvailable(Test.GENERAL_INT);
+ msg.setDisplayType(Test.GENERAL_DISPLAYTYPE);
+ msg.setDisplayName(Test.GENERAL_STRING);
+ msg.setImageFields(Test.GENERAL_IMAGEFIELD_LIST);
+ msg.setTextFields(Test.GENERAL_TEXTFIELD_LIST);
+ msg.setMediaClockFormats(Test.GENERAL_MEDIACLOCKFORMAT_LIST);
+ msg.setScreenParams(Test.GENERAL_SCREENPARAMS);
+ msg.setTemplatesAvailable(Test.GENERAL_STRING_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean graphicSupported = msg.getGraphicSupported();
+ int numPresets = msg.getNumCustomPresetsAvailable();
+ DisplayType displayType = msg.getDisplayType();
+ String displayName = msg.getDisplayName();
+ ScreenParams screenParams = msg.getScreenParams();
+ List<String> templatesAvailable = msg.getTemplatesAvailable();
+ List<MediaClockFormat> mediaClock = msg.getMediaClockFormats();
+ List<TextField> textFields = msg.getTextFields();
+ List<ImageField> imageFields = msg.getImageFields();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, graphicSupported);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, numPresets);
+ assertEquals(Test.MATCH, Test.GENERAL_DISPLAYTYPE, displayType);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, displayName);
+ assertTrue(Test.TRUE, Validator.validateScreenParams(Test.GENERAL_SCREENPARAMS, screenParams));
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), templatesAvailable.size());
+ assertEquals(Test.MATCH, Test.GENERAL_MEDIACLOCKFORMAT_LIST.size(), mediaClock.size());
+ assertEquals(Test.MATCH, Test.GENERAL_TEXTFIELD_LIST.size(), textFields.size());
+ assertEquals(Test.MATCH, Test.GENERAL_IMAGEFIELD_LIST.size(), imageFields.size());
+
+ for(int i = 0; i < Test.GENERAL_STRING_LIST.size(); i++){
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.get(i), templatesAvailable.get(i));
+ }
+
+ for(int i = 0; i < Test.GENERAL_MEDIACLOCKFORMAT_LIST.size(); i++){
+ assertEquals(Test.MATCH, Test.GENERAL_MEDIACLOCKFORMAT_LIST.get(i), mediaClock.get(i));
+ }
+
+ for(int i = 0; i < Test.GENERAL_TEXTFIELD_LIST.size(); i++){
+ assertTrue(Test.TRUE, Validator.validateTextFields(Test.GENERAL_TEXTFIELD_LIST.get(i), textFields.get(i)));
+ }
+
+ for(int i = 0; i < Test.GENERAL_IMAGEFIELD_LIST.size(); i++){
+ assertTrue(Test.TRUE, Validator.validateImageFields(Test.GENERAL_IMAGEFIELD_LIST.get(i), imageFields.get(i)));
+ }
+
+ // Invalid/Null Tests
+ DisplayCapabilities msg = new DisplayCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getDisplayType());
+ assertNull(Test.NULL, msg.getDisplayName());
+ assertNull(Test.NULL, msg.getGraphicSupported());
+ assertNull(Test.NULL, msg.getImageFields());
+ assertNull(Test.NULL, msg.getMediaClockFormats());
+ assertNull(Test.NULL, msg.getNumCustomPresetsAvailable());
+ assertNull(Test.NULL, msg.getScreenParams());
+ assertNull(Test.NULL, msg.getTemplatesAvailable());
+ assertNull(Test.NULL, msg.getTextFields());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(DisplayCapabilities.KEY_NUM_CUSTOM_PRESETS_AVAILABLE, Test.GENERAL_INT);
+ reference.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED, Test.GENERAL_BOOLEAN);
+ reference.put(DisplayCapabilities.KEY_DISPLAY_TYPE, Test.GENERAL_DISPLAYTYPE);
+ reference.put(DisplayCapabilities.KEY_DISPLAY_NAME, Test.GENERAL_STRING);
+ reference.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ reference.put(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS, JsonUtils.createJsonArray(Test.GENERAL_MEDIACLOCKFORMAT_LIST));
+ reference.put(DisplayCapabilities.KEY_TEXT_FIELDS, Test.JSON_TEXTFIELDS);
+ reference.put(DisplayCapabilities.KEY_IMAGE_FIELDS, Test.JSON_IMAGEFIELDS);
+ reference.put(DisplayCapabilities.KEY_SCREEN_PARAMS, Test.JSON_SCREENPARAMS);
+
+ 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(DisplayCapabilities.KEY_IMAGE_FIELDS)){
+ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
+ JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
+
+ for(int i = 0; i < referenceArray.length(); i++){
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i));
+ Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i));
+ assertTrue(Test.TRUE, Validator.validateImageFields(new ImageField(hashReference), new ImageField(hashTest)));
+ }
+ } else if(key.equals(DisplayCapabilities.KEY_TEXT_FIELDS)){
+ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
+ JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
+
+ for(int i = 0; i < referenceArray.length(); i++){
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i));
+ Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i));
+ assertTrue(Test.TRUE, Validator.validateTextFields(new TextField(hashReference), new TextField(hashTest)));
+ }
+ } else if(key.equals(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE)){
+ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
+ JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
+ assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
+ } else if(key.equals(DisplayCapabilities.KEY_SCREEN_PARAMS)){
+ JSONObject referenceArray = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject underTestArray = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray);
+ Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray);
+
+ assertTrue(Test.TRUE, Validator.validateScreenParams(new ScreenParams(hashReference), new ScreenParams(hashTest)));
+ } else if(key.equals(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS)){
+ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
+ JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
+
+ for(int i = 0; i < referenceArray.length(); i++){
+ assertTrue(Test.TRUE, Validator.validateText(referenceArray.getString(i), underTestArray.getString(i)));// not a string?
+ }
+ } 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java
new file mode 100644
index 000000000..229b2300d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java
@@ -0,0 +1,76 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.ECallInfo;
+import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
+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.ECallInfo}
+ */
+public class ECallInfoTests extends TestCase{
+
+ private ECallInfo msg;
+
+ @Override
+ public void setUp(){
+ msg = new ECallInfo();
+
+ msg.setAuxECallNotificationStatus(Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS);
+ msg.setECallConfirmationStatus(Test.GENERAL_ECALLCONFIRMATIONSTATUS);
+ msg.setECallNotificationStatus(Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ VehicleDataNotificationStatus auxEcall = msg.getAuxECallNotificationStatus();
+ VehicleDataNotificationStatus ecallNotify = msg.getECallNotificationStatus();
+ ECallConfirmationStatus ecallConfirm = msg.getECallConfirmationStatus();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS, auxEcall);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS, ecallNotify);
+ assertEquals(Test.MATCH, Test.GENERAL_ECALLCONFIRMATIONSTATUS, ecallConfirm);
+
+ // Invalid/Null Tests
+ ECallInfo msg = new ECallInfo();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getECallConfirmationStatus());
+ assertNull(Test.NULL, msg.getECallNotificationStatus());
+ assertNull(Test.NULL, msg.getAuxECallNotificationStatus());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(ECallInfo.KEY_AUX_E_CALL_NOTIFICATION_STATUS, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS);
+ reference.put(ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS);
+ reference.put(ECallInfo.KEY_E_CALL_CONFIRMATION_STATUS, Test.GENERAL_ECALLCONFIRMATIONSTATUS);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java
new file mode 100644
index 000000000..1380c211d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java
@@ -0,0 +1,87 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.EmergencyEvent;
+import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
+import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+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.EmergencyEvent}
+ */
+public class EmergencyEventTests extends TestCase{
+
+ private EmergencyEvent msg;
+
+ @Override
+ public void setUp(){
+ msg = new EmergencyEvent();
+
+ msg.setEmergencyEventType(Test.GENERAL_EMERGENCYEVENTTYPE);
+ msg.setFuelCutoffStatus(Test.GENERAL_FUELCUTOFFSTATUS);
+ msg.setMaximumChangeVelocity(Test.GENERAL_INT);
+ msg.setMultipleEvents(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ msg.setRolloverEvent(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ EmergencyEventType type = msg.getEmergencyEventType();
+ FuelCutoffStatus cutoffStatus = msg.getFuelCutoffStatus();
+ VehicleDataEventStatus multipleEvents = msg.getMultipleEvents();
+ int changeVelocity = msg.getMaximumChangeVelocity();
+ VehicleDataEventStatus rollover = msg.getRolloverEvent();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_EMERGENCYEVENTTYPE, type);
+ assertEquals(Test.MATCH, Test.GENERAL_FUELCUTOFFSTATUS, cutoffStatus);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, changeVelocity);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, multipleEvents);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, rollover);
+
+ // Invalid/Null Tests
+ EmergencyEvent msg = new EmergencyEvent();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getEmergencyEventType());
+ assertNull(Test.NULL, msg.getFuelCutoffStatus());
+ assertNull(Test.NULL, msg.getMaximumChangeVelocity());
+ assertNull(Test.NULL, msg.getMultipleEvents());
+ assertNull(Test.NULL, msg.getRolloverEvent());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(EmergencyEvent.KEY_FUEL_CUTOFF_STATUS, Test.GENERAL_FUELCUTOFFSTATUS);
+ reference.put(EmergencyEvent.KEY_MULTIPLE_EVENTS, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(EmergencyEvent.KEY_ROLLOVER_EVENT, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
+ reference.put(EmergencyEvent.KEY_EMERGENCY_EVENT_TYPE, Test.GENERAL_EMERGENCYEVENTTYPE);
+ reference.put(EmergencyEvent.KEY_MAXIMUM_CHANGE_VELOCITY, 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/EqualizerSettingsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java
index a803b1ded..a803b1ded 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java
index 2dffd2f5b..2dffd2f5b 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java
new file mode 100644
index 000000000..1c9e4986b
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java
@@ -0,0 +1,151 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.GPSData;
+import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
+import com.smartdevicelink.proxy.rpc.enums.Dimension;
+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.GPSData}
+ */
+public class GPSDataTests extends TestCase{
+
+ private GPSData msg;
+
+ @Override
+ public void setUp(){
+ msg = new GPSData();
+
+ msg.setActual(Test.GENERAL_BOOLEAN);
+ msg.setAltitude(Test.GENERAL_DOUBLE);
+ msg.setCompassDirection(Test.GENERAL_COMPASSDIRECTION);
+ msg.setDimension(Test.GENERAL_DIMENSION);
+ msg.setHdop(Test.GENERAL_DOUBLE);
+ msg.setHeading(Test.GENERAL_DOUBLE);
+ msg.setLatitudeDegrees(Test.GENERAL_DOUBLE);
+ msg.setLongitudeDegrees(Test.GENERAL_DOUBLE);
+ msg.setPdop(Test.GENERAL_DOUBLE);
+ msg.setSatellites(Test.GENERAL_INT);
+ msg.setSpeed(Test.GENERAL_DOUBLE);
+ msg.setUtcDay(Test.GENERAL_INT);
+ msg.setUtcHours(Test.GENERAL_INT);
+ msg.setUtcMinutes(Test.GENERAL_INT);
+ msg.setUtcMonth(Test.GENERAL_INT);
+ msg.setUtcSeconds(Test.GENERAL_INT);
+ msg.setUtcYear(Test.GENERAL_INT);
+ msg.setVdop(Test.GENERAL_DOUBLE);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean actual = msg.getActual();
+ double latitude = msg.getLatitudeDegrees();
+ double longitude = msg.getLongitudeDegrees();
+ double altitude = msg.getAltitude();
+ double heading = msg.getHeading();
+ double speed = msg.getSpeed();
+ double pdop = msg.getPdop();
+ double hdop = msg.getHdop();
+ double vdop = msg.getVdop();
+ int utcYear = msg.getUtcYear();
+ int utcMin = msg.getUtcMinutes();
+ int utcMonths = msg.getUtcMonth();
+ int utcDay = msg.getUtcDay();
+ int utcHours = msg.getUtcHours();
+ int utcSec = msg.getUtcSeconds();
+ int satellites = msg.getSatellites();
+ Dimension dimension = msg.getDimension();
+ CompassDirection direction = msg.getCompassDirection();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, actual);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, latitude);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, longitude);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, altitude);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, heading);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, speed);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, pdop);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, hdop);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, vdop);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, utcYear);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, utcMin);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, utcMonths);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, utcDay);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, utcHours);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, utcSec);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, satellites);
+ assertEquals(Test.MATCH, Test.GENERAL_DIMENSION, dimension);
+ assertEquals(Test.MATCH, Test.GENERAL_COMPASSDIRECTION, direction);
+
+ // Invalid/Null Tests
+ GPSData msg = new GPSData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getActual());
+ assertNull(Test.NULL, msg.getAltitude());
+ assertNull(Test.NULL, msg.getCompassDirection());
+ assertNull(Test.NULL, msg.getDimension());
+ assertNull(Test.NULL, msg.getHdop());
+ assertNull(Test.NULL, msg.getHeading());
+ assertNull(Test.NULL, msg.getLatitudeDegrees());
+ assertNull(Test.NULL, msg.getLongitudeDegrees());
+ assertNull(Test.NULL, msg.getPdop());
+ assertNull(Test.NULL, msg.getSatellites());
+ assertNull(Test.NULL, msg.getSpeed());
+ assertNull(Test.NULL, msg.getUtcDay());
+ assertNull(Test.NULL, msg.getUtcHours());
+ assertNull(Test.NULL, msg.getUtcMinutes());
+ assertNull(Test.NULL, msg.getUtcMonth());
+ assertNull(Test.NULL, msg.getUtcSeconds());
+ assertNull(Test.NULL, msg.getUtcYear());
+ assertNull(Test.NULL, msg.getVdop());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(GPSData.KEY_ACTUAL, Test.GENERAL_BOOLEAN);
+ reference.put(GPSData.KEY_LATITUDE_DEGREES, Test.GENERAL_DOUBLE);
+ reference.put(GPSData.KEY_LONGITUDE_DEGREES, Test.GENERAL_DOUBLE);
+ reference.put(GPSData.KEY_ALTITUDE, Test.GENERAL_DOUBLE);
+ reference.put(GPSData.KEY_HEADING, Test.GENERAL_DOUBLE);
+ reference.put(GPSData.KEY_SPEED, Test.GENERAL_DOUBLE);
+ reference.put(GPSData.KEY_PDOP, Test.GENERAL_DOUBLE);
+ reference.put(GPSData.KEY_HDOP, Test.GENERAL_DOUBLE);
+ reference.put(GPSData.KEY_VDOP, Test.GENERAL_DOUBLE);
+ reference.put(GPSData.KEY_UTC_YEAR, Test.GENERAL_INT);
+ reference.put(GPSData.KEY_UTC_MONTH, Test.GENERAL_INT);
+ reference.put(GPSData.KEY_UTC_HOURS, Test.GENERAL_INT);
+ reference.put(GPSData.KEY_UTC_DAY, Test.GENERAL_INT);
+ reference.put(GPSData.KEY_UTC_MINUTES, Test.GENERAL_INT);
+ reference.put(GPSData.KEY_UTC_SECONDS, Test.GENERAL_INT);
+ reference.put(GPSData.KEY_SATELLITES, Test.GENERAL_INT);
+ reference.put(GPSData.KEY_DIMENSION, Test.GENERAL_DIMENSION);
+ reference.put(GPSData.KEY_COMPASS_DIRECTION, Test.GENERAL_COMPASSDIRECTION);
+
+ 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/HMICapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java
index cc4813caa..cc4813caa 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java
new file mode 100644
index 000000000..7c66ba6c7
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java
@@ -0,0 +1,84 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.HMIPermissions;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+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;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.HMIPermissions}
+ */
+public class HMIPermissionsTests extends TestCase{
+
+ private HMIPermissions msg;
+
+ @Override
+ public void setUp(){
+ msg = new HMIPermissions();
+
+ msg.setAllowed(Test.GENERAL_HMILEVEL_LIST);
+ msg.setUserDisallowed(Test.GENERAL_HMILEVEL_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<HMILevel> allowed = msg.getAllowed();
+ List<HMILevel> disallowed = msg.getUserDisallowed();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.size(), allowed.size());
+ assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.size(), disallowed.size());
+
+ for(int i = 0; i < Test.GENERAL_HMILEVEL_LIST.size(); i++){
+ assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.get(i), allowed.get(i));
+ }
+ for(int i = 0; i < Test.GENERAL_HMILEVEL_LIST.size(); i++){
+ assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.get(i), disallowed.get(i));
+ }
+
+ // Invalid/Null Tests
+ HMIPermissions msg = new HMIPermissions();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getAllowed());
+ assertNull(Test.NULL, msg.getUserDisallowed());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(HMIPermissions.KEY_ALLOWED, Test.JSON_HMILEVELS);
+ reference.put(HMIPermissions.KEY_USER_DISALLOWED, Test.JSON_HMILEVELS);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while(iterator.hasNext()){
+ String key = (String) iterator.next();
+ List<String> referenceList = JsonUtils.readStringListFromJsonObject(reference, key);
+ List<String> underTestList = JsonUtils.readStringListFromJsonObject(underTest, key);
+
+ assertEquals(Test.MATCH, referenceList.size(), underTestList.size());
+ for(int i = 0; i < referenceList.size(); i++){
+ assertEquals(Test.MATCH, referenceList.get(i), underTestList.get(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/HMISettingsControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java
index 620868b40..620868b40 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java
index 85205f617..85205f617 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java
index c72204640..c72204640 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java
new file mode 100644
index 000000000..ecce440c5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.HeadLampStatus;
+import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
+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.HeadLampStatus}
+ */
+public class HeadLampStatusTests extends TestCase{
+
+ private HeadLampStatus msg;
+
+ @Override
+ public void setUp(){
+ msg = new HeadLampStatus();
+
+ msg.setAmbientLightStatus(Test.GENERAL_AMBIENTLIGHTSTATUS);
+ msg.setLowBeamsOn(Test.GENERAL_BOOLEAN);
+ msg.setHighBeamsOn(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean lowBeams = msg.getLowBeamsOn();
+ boolean highBeams = msg.getHighBeamsOn();
+ AmbientLightStatus ambientLights = msg.getAmbientLightStatus();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_AMBIENTLIGHTSTATUS, ambientLights);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, highBeams);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, lowBeams);
+
+ // Invalid/Null Tests
+ HeadLampStatus msg = new HeadLampStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getLowBeamsOn());
+ assertNull(Test.NULL, msg.getHighBeamsOn());
+ assertNull(Test.NULL, msg.getAmbientLightStatus());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(HeadLampStatus.KEY_HIGH_BEAMS_ON, Test.GENERAL_BOOLEAN);
+ reference.put(HeadLampStatus.KEY_LOW_BEAMS_ON, Test.GENERAL_BOOLEAN);
+ reference.put(HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS, Test.GENERAL_AMBIENTLIGHTSTATUS);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java
new file mode 100644
index 000000000..e271ccd3c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java
@@ -0,0 +1,109 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.Headers;
+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.Headers}
+ */
+public class HeadersTests extends TestCase{
+
+ private Headers msg;
+
+ @Override
+ public void setUp(){
+ msg = new Headers();
+
+ msg.setCharset(Test.GENERAL_STRING);
+ msg.setConnectTimeout(Test.GENERAL_INT);
+ msg.setContentLength(Test.GENERAL_INT);
+ msg.setContentType(Test.GENERAL_STRING);
+ msg.setDoInput(Test.GENERAL_BOOLEAN);
+ msg.setDoOutput(Test.GENERAL_BOOLEAN);
+ msg.setInstanceFollowRedirects(Test.GENERAL_BOOLEAN);
+ msg.setReadTimeout(Test.GENERAL_INT);
+ msg.setRequestMethod(Test.GENERAL_STRING);
+ msg.setUseCaches(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String charset = msg.getCharset();
+ String contentType = msg.getContentType();
+ String requestMode = msg.getRequestMethod();
+ int connectTimeout = msg.getConnectTimeout();
+ int readTimeout = msg.getReadTimeout();
+ int contentLength = msg.getContentLength();
+ boolean doOutput = msg.getDoOutput();
+ boolean doInput = msg.getDoInput();
+ boolean useCache = msg.getUseCaches();
+ boolean instanceFollow = msg.getInstanceFollowRedirects();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, charset);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, contentType);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, requestMode);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, connectTimeout);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, readTimeout);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, contentLength);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, doOutput);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, doInput);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, useCache);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, instanceFollow);
+
+ // Invalid/Null Tests
+ Headers msg = new Headers();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getCharset());
+ assertNull(Test.NULL, msg.getConnectTimeout());
+ assertNull(Test.NULL, msg.getContentLength());
+ assertNull(Test.NULL, msg.getContentType());
+ assertNull(Test.NULL, msg.getDoInput());
+ assertNull(Test.NULL, msg.getDoOutput());
+ assertNull(Test.NULL, msg.getInstanceFollowRedirects());
+ assertNull(Test.NULL, msg.getReadTimeout());
+ assertNull(Test.NULL, msg.getRequestMethod());
+ assertNull(Test.NULL, msg.getUseCaches());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(Headers.KEY_CHARSET, Test.GENERAL_STRING);
+ reference.put(Headers.KEY_CONTENT_TYPE, Test.GENERAL_STRING);
+ reference.put(Headers.KEY_REQUEST_METHOD, Test.GENERAL_STRING);
+ reference.put(Headers.KEY_CONNECT_TIMEOUT, Test.GENERAL_INT);
+ reference.put(Headers.KEY_READ_TIMEOUT, Test.GENERAL_INT);
+ reference.put(Headers.KEY_CONTENT_LENGTH, Test.GENERAL_INT);
+ reference.put(Headers.KEY_DO_OUTPUT, Test.GENERAL_BOOLEAN);
+ reference.put(Headers.KEY_DO_INPUT, Test.GENERAL_BOOLEAN);
+ reference.put(Headers.KEY_USE_CACHES, Test.GENERAL_BOOLEAN);
+ reference.put(Headers.KEY_INSTANCE_FOLLOW_REDIRECTS, 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java
new file mode 100644
index 000000000..98f4639a8
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java
@@ -0,0 +1,105 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.ImageField;
+import com.smartdevicelink.proxy.rpc.ImageResolution;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
+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.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ImageField}
+ */
+public class ImageFieldTests extends TestCase{
+
+ private ImageField msg;
+
+ @Override
+ public void setUp(){
+ msg = new ImageField();
+
+ msg.setImageResolution(Test.GENERAL_IMAGERESOLUTION);
+ msg.setImageTypeSupported(Test.GENERAL_FILETYPE_LIST);
+ msg.setName(Test.GENERAL_IMAGEFIELDNAME);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ ImageResolution imageRes = msg.getImageResolution();
+ List<FileType> imageTypes = msg.getImageTypeSupported();
+ ImageFieldName name = msg.getName();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateImageResolution(Test.GENERAL_IMAGERESOLUTION, imageRes));
+ assertEquals(Test.MATCH, Test.GENERAL_IMAGEFIELDNAME, name);
+ assertTrue(Test.TRUE, Validator.validateFileTypes(Test.GENERAL_FILETYPE_LIST, imageTypes));
+
+ // Invalid/Null Tests
+ ImageField msg = new ImageField();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getImageResolution());
+ assertNull(Test.NULL, msg.getImageTypeSupported());
+ assertNull(Test.NULL, msg.getName());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(ImageField.KEY_IMAGE_RESOLUTION, Test.JSON_IMAGERESOLUTION);
+ reference.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED, JsonUtils.createJsonArray(Test.GENERAL_FILETYPE_LIST));
+ reference.put(ImageField.KEY_NAME, Test.GENERAL_IMAGEFIELDNAME);
+
+ 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(ImageField.KEY_IMAGE_RESOLUTION)){
+ JSONObject objectEquals = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject testEquals = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateImageResolution( new ImageResolution(hashReference), new ImageResolution(hashTest)));
+ } else if(key.equals(ImageField.KEY_IMAGE_TYPE_SUPPORTED)) {
+ JSONArray imageTypeArrayReference = JsonUtils.readJsonArrayFromJsonObject(reference, key);
+ JSONArray imageTypeArrayTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ List<FileType> imageTypeListReference = new ArrayList<FileType>();
+ List<FileType> imageTypeListTest = new ArrayList<FileType>();
+
+ assertEquals(Test.MATCH, imageTypeArrayReference.length(), imageTypeArrayTest.length());
+
+ for (int index = 0 ; index < imageTypeArrayReference.length(); index++) {
+ imageTypeListReference.add( (FileType)imageTypeArrayReference.get(index) );
+ imageTypeListTest.add( (FileType)imageTypeArrayTest.get(index) );
+ }
+ assertTrue(Test.TRUE, imageTypeListReference.containsAll(imageTypeListTest) && imageTypeListTest.containsAll(imageTypeListReference));
+ } 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java
new file mode 100644
index 000000000..2609acd37
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java
@@ -0,0 +1,70 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.ImageResolution;
+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.ImageResolution}
+ */
+public class ImageResolutionTests extends TestCase{
+
+ private ImageResolution msg;
+
+ @Override
+ public void setUp(){
+ msg = new ImageResolution();
+
+ msg.setResolutionHeight(Test.GENERAL_INT);
+ msg.setResolutionWidth(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int height = msg.getResolutionHeight();
+ int width = msg.getResolutionWidth();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, height);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, width);
+
+ // Invalid/Null Tests
+ ImageResolution msg = new ImageResolution();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getResolutionHeight());
+ assertNull(Test.NULL, msg.getResolutionWidth());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(ImageResolution.KEY_RESOLUTION_HEIGHT, Test.GENERAL_INT);
+ reference.put(ImageResolution.KEY_RESOLUTION_WIDTH, 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java
new file mode 100644
index 000000000..ccc9b2bdb
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java
@@ -0,0 +1,76 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+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.Image}
+ */
+public class ImageTests extends TestCase{
+
+ private Image msg;
+
+ @Override
+ public void setUp(){
+ msg = new Image();
+
+ msg.setImageType(Test.GENERAL_IMAGETYPE);
+ msg.setValue(Test.GENERAL_STRING);
+ msg.setIsTemplate(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ ImageType imageType = msg.getImageType();
+ String value = msg.getValue();
+ Boolean isTemplate = msg.getIsTemplate();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_IMAGETYPE, imageType);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, value);
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, isTemplate);
+
+ // Invalid/Null Tests
+ Image msg = new Image();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getImageType());
+ assertNull(Test.NULL, msg.getValue());
+ assertNull(Test.NULL, msg.getBulkData());
+ assertNull(Test.NULL, msg.getIsTemplate());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(Image.KEY_IMAGE_TYPE, Test.GENERAL_IMAGETYPE);
+ reference.put(Image.KEY_VALUE, Test.GENERAL_STRING);
+ reference.put(Image.KEY_IS_TEMPLATE, 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java
new file mode 100644
index 000000000..da6b52899
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java
@@ -0,0 +1,96 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.KeyboardProperties;
+import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
+import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+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.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.KeyboardProperties}
+ */
+public class KeyboardPropertiesTests extends TestCase{
+
+ private KeyboardProperties msg;
+
+ @Override
+ public void setUp(){
+ msg = new KeyboardProperties();
+
+ msg.setAutoCompleteText(Test.GENERAL_STRING);
+ msg.setKeyboardLayout(Test.GENERAL_KEYBOARDLAYOUT);
+ msg.setKeypressMode(Test.GENERAL_KEYPRESSMODE);
+ msg.setLanguage(Test.GENERAL_LANGUAGE);
+ msg.setLimitedCharacterList(Test.GENERAL_STRING_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String autoComplete = msg.getAutoCompleteText();
+ KeyboardLayout keyboardLayout = msg.getKeyboardLayout();
+ KeypressMode keypressMode = msg.getKeypressMode();
+ Language language = msg.getLanguage();
+ List<String> limitedChars = msg.getLimitedCharacterList();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, autoComplete);
+ assertEquals(Test.MATCH, Test.GENERAL_KEYBOARDLAYOUT, keyboardLayout);
+ assertEquals(Test.MATCH, Test.GENERAL_KEYPRESSMODE, keypressMode);
+ assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, language);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), limitedChars.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, limitedChars));
+
+ // Invalid/Null Tests
+ KeyboardProperties msg = new KeyboardProperties();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ // Keypress mode is created in the object constructor
+ assertNotNull(Test.NOT_NULL, msg.getKeypressMode());
+
+ assertNull(Test.NULL, msg.getAutoCompleteText());
+ assertNull(Test.NULL, msg.getLanguage());
+ assertNull(Test.NULL, msg.getKeyboardLayout());
+ assertNull(Test.NULL, msg.getLimitedCharacterList());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(KeyboardProperties.KEY_AUTO_COMPLETE_TEXT, Test.GENERAL_STRING);
+ reference.put(KeyboardProperties.KEY_KEYBOARD_LAYOUT, Test.GENERAL_KEYBOARDLAYOUT);
+ reference.put(KeyboardProperties.KEY_KEYPRESS_MODE, Test.GENERAL_KEYPRESSMODE);
+ reference.put(KeyboardProperties.KEY_LANGUAGE, Test.GENERAL_LANGUAGE);
+ reference.put(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST, JsonUtils.createJsonArray(Test.GENERAL_STRING_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(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST)){
+ assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
+ } 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/LightCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java
index 6122f4305..6122f4305 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java
index 4ebd7f467..4ebd7f467 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java
index c891e0769..c891e0769 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java
index 196769e00..196769e00 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java
index 18da17eac..18da17eac 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java
index da8a7cbfe..da8a7cbfe 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java
index 958de9fa2..958de9fa2 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceDataTests.java
new file mode 100644
index 000000000..2b4c352c5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceDataTests.java
@@ -0,0 +1,121 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.MediaServiceData;
+import com.smartdevicelink.proxy.rpc.enums.MediaType;
+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.proxy.rpc.MediaServiceData}
+ */
+public class MediaServiceDataTests extends TestCase {
+
+ private MediaServiceData msg;
+
+ @Override
+ public void setUp(){
+
+ msg = new MediaServiceData();
+ msg.setMediaType(Test.GENERAL_MEDIATYPE);
+ msg.setMediaTitle(Test.GENERAL_STRING);
+ msg.setMediaArtist(Test.GENERAL_STRING);
+ msg.setMediaAlbum(Test.GENERAL_STRING);
+ msg.setPlaylistName(Test.GENERAL_STRING);
+ msg.setIsExplicit(Test.GENERAL_BOOLEAN);
+ msg.setTrackPlaybackProgress(Test.GENERAL_INTEGER);
+ msg.setTrackPlaybackDuration(Test.GENERAL_INTEGER);
+ msg.setQueuePlaybackProgress(Test.GENERAL_INTEGER);
+ msg.setQueuePlaybackDuration(Test.GENERAL_INTEGER);
+ msg.setQueueCurrentTrackNumber(Test.GENERAL_INTEGER);
+ msg.setQueueTotalTrackCount(Test.GENERAL_INTEGER);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ MediaType mediaType = msg.getMediaType();
+ String mediaTitle = msg.getMediaTitle();
+ String mediaArtist = msg.getMediaArtist();
+ String mediaAlbum = msg.getMediaAlbum();
+ String playlistName = msg.getPlaylistName();
+ boolean isExplicit = msg.getIsExplicit();
+ Integer trackPlaybackProgress = msg.getTrackPlaybackProgress();
+ Integer trackPlaybackDuration = msg.getTrackPlaybackDuration();
+ Integer queuePlaybackProgress = msg.getQueuePlaybackProgress();
+ Integer queuePlaybackDuration = msg.getQueuePlaybackDuration();
+ Integer queueCurrentTrackNumber = msg.getQueueCurrentTrackNumber();
+ Integer queueTotalTrackCount = msg.getQueueTotalTrackCount();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_MEDIATYPE, mediaType);
+ assertEquals(Test.GENERAL_STRING, mediaTitle);
+ assertEquals(Test.GENERAL_STRING, mediaArtist);
+ assertEquals(Test.GENERAL_STRING, mediaAlbum);
+ assertEquals(Test.GENERAL_STRING, playlistName);
+ assertEquals(Test.GENERAL_BOOLEAN, isExplicit);
+ assertEquals(Test.GENERAL_INTEGER, trackPlaybackProgress);
+ assertEquals(Test.GENERAL_INTEGER, trackPlaybackDuration);
+ assertEquals(Test.GENERAL_INTEGER, queuePlaybackProgress);
+ assertEquals(Test.GENERAL_INTEGER, queuePlaybackDuration);
+ assertEquals(Test.GENERAL_INTEGER, queueCurrentTrackNumber);
+ assertEquals(Test.GENERAL_INTEGER, queueTotalTrackCount);
+
+ // Invalid/Null Tests
+ MediaServiceData msg = new MediaServiceData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getMediaType());
+ assertNull(Test.NULL, msg.getMediaTitle());
+ assertNull(Test.NULL, msg.getMediaArtist());
+ assertNull(Test.NULL, msg.getMediaAlbum());
+ assertNull(Test.NULL, msg.getPlaylistName());
+ assertNull(Test.NULL, msg.getIsExplicit());
+ assertNull(Test.NULL, msg.getTrackPlaybackProgress());
+ assertNull(Test.NULL, msg.getTrackPlaybackDuration());
+ assertNull(Test.NULL, msg.getQueuePlaybackProgress());
+ assertNull(Test.NULL, msg.getQueuePlaybackDuration());
+ assertNull(Test.NULL, msg.getQueueCurrentTrackNumber());
+ assertNull(Test.NULL, msg.getQueueTotalTrackCount());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(MediaServiceData.KEY_MEDIA_TYPE, Test.GENERAL_MEDIATYPE);
+ reference.put(MediaServiceData.KEY_MEDIA_TITLE, Test.GENERAL_STRING);
+ reference.put(MediaServiceData.KEY_MEDIA_ARTIST, Test.GENERAL_STRING);
+ reference.put(MediaServiceData.KEY_MEDIA_ALBUM, Test.GENERAL_STRING);
+ reference.put(MediaServiceData.KEY_PLAYLIST_NAME, Test.GENERAL_STRING);
+ reference.put(MediaServiceData.KEY_IS_EXPLICIT, Test.GENERAL_BOOLEAN);
+ reference.put(MediaServiceData.KEY_TRACK_PLAYBACK_PROGRESS, Test.GENERAL_INTEGER);
+ reference.put(MediaServiceData.KEY_TRACK_PLAYBACK_DURATION, Test.GENERAL_INTEGER);
+ reference.put(MediaServiceData.KEY_QUEUE_PLAYBACK_PROGRESS, Test.GENERAL_INTEGER);
+ reference.put(MediaServiceData.KEY_QUEUE_PLAYBACK_DURATION, Test.GENERAL_INTEGER);
+ reference.put(MediaServiceData.KEY_QUEUE_CURRENT_TRACK_NUMBER, Test.GENERAL_INTEGER);
+ reference.put(MediaServiceData.KEY_QUEUE_TOTAL_TRACK_COUNT, Test.GENERAL_INTEGER);
+
+ 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);
+ }
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceManifestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceManifestTests.java
new file mode 100644
index 000000000..85332bc0c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceManifestTests.java
@@ -0,0 +1,30 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.MediaServiceManifest;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.MediaServiceManifest}
+ */
+public class MediaServiceManifestTests extends TestCase {
+
+ @Override
+ public void setUp(){
+ // nothing to setup yet, this class doesn't contain anything
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+
+ // Invalid/Null Tests
+ MediaServiceManifest msg = new MediaServiceManifest();
+ assertNotNull(Test.NOT_NULL, msg);
+ }
+
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java
new file mode 100644
index 000000000..b839d9247
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.MenuParams;
+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.MenuParams}
+ */
+public class MenuParamsTests extends TestCase{
+
+ private MenuParams msg;
+
+ @Override
+ public void setUp(){
+ msg = new MenuParams();
+
+ msg.setMenuName(Test.GENERAL_STRING);
+ msg.setParentID(Test.GENERAL_INT);
+ msg.setPosition(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String menuName = msg.getMenuName();
+ int parentId = msg.getParentID();
+ int position = msg.getPosition();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, menuName);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, parentId);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, position);
+
+ // Invalid/Null Tests
+ MenuParams msg = new MenuParams();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getMenuName());
+ assertNull(Test.NULL, msg.getParentID());
+ assertNull(Test.NULL, msg.getPosition());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(MenuParams.KEY_MENU_NAME, Test.GENERAL_STRING);
+ reference.put(MenuParams.KEY_PARENT_ID, Test.GENERAL_INT);
+ reference.put(MenuParams.KEY_POSITION, 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/MetadataTagsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java
index 5f27cc132..5f27cc132 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java
index b553587ad..b553587ad 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java
new file mode 100644
index 000000000..a496964ad
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java
@@ -0,0 +1,64 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.MyKey;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
+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.MyKey}
+ */
+public class MyKeyTests extends TestCase{
+
+ private MyKey msg;
+
+ @Override
+ public void setUp(){
+ msg = new MyKey();
+ msg.setE911Override(Test.GENERAL_VEHICLEDATASTATUS);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ VehicleDataStatus override = msg.getE911Override();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATASTATUS, override);
+
+ // Invalid/Null Tests
+ MyKey msg = new MyKey();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getE911Override());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(MyKey.KEY_E_911_OVERRIDE, Test.GENERAL_VEHICLEDATASTATUS);
+
+ 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/NavigationCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java
index efbf7e30d..efbf7e30d 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationInstructionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationInstructionTests.java
new file mode 100644
index 000000000..c27d33ee2
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationInstructionTests.java
@@ -0,0 +1,134 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.DateTime;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.LocationDetails;
+import com.smartdevicelink.proxy.rpc.NavigationInstruction;
+import com.smartdevicelink.proxy.rpc.enums.Direction;
+import com.smartdevicelink.proxy.rpc.enums.NavigationAction;
+import com.smartdevicelink.proxy.rpc.enums.NavigationJunction;
+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.proxy.rpc.NavigationInstruction}
+ */
+public class NavigationInstructionTests extends TestCase {
+
+ private NavigationInstruction msg;
+
+ @Override
+ public void setUp(){
+ msg = new NavigationInstruction();
+
+ msg.setLocationDetails(Test.GENERAL_LOCATIONDETAILS);
+ msg.setAction(Test.GENERAL_NAVIGATIONACTION);
+ msg.setEta(Test.GENERAL_DATETIME);
+ msg.setBearing(Test.GENERAL_INTEGER);
+ msg.setJunctionType(Test.GENERAL_NAVIGATION_JUNCTION);
+ msg.setDrivingSide(Test.GENERAL_DIRECTION);
+ msg.setDetails(Test.GENERAL_STRING);
+ msg.setImage(Test.GENERAL_IMAGE);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ LocationDetails locationDetails = msg.getLocationDetails();
+ NavigationAction action = msg.getAction();
+ DateTime eta = msg.getEta();
+ Integer bearing = msg.getBearing();
+ NavigationJunction junctionType = msg.getJunctionType();
+ Direction drivingSide = msg.getDrivingSide();
+ String details = msg.getDetails();
+ Image image = msg.getImage();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_LOCATIONDETAILS, locationDetails);
+ assertEquals(Test.GENERAL_NAVIGATIONACTION, action);
+ assertEquals(Test.GENERAL_DATETIME, eta);
+ assertEquals(Test.GENERAL_INTEGER, bearing);
+ assertEquals(Test.GENERAL_NAVIGATION_JUNCTION, junctionType);
+ assertEquals(Test.GENERAL_DIRECTION, drivingSide);
+ assertEquals(Test.GENERAL_STRING, details);
+ assertEquals(Test.GENERAL_IMAGE, image);
+
+ // Invalid/Null Tests
+ NavigationInstruction msg = new NavigationInstruction();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getLocationDetails());
+ assertNull(Test.NULL, msg.getAction());
+ assertNull(Test.NULL, msg.getEta());
+ assertNull(Test.NULL, msg.getBearing());
+ assertNull(Test.NULL, msg.getJunctionType());
+ assertNull(Test.NULL, msg.getDrivingSide());
+ assertNull(Test.NULL, msg.getDetails());
+ assertNull(Test.NULL, msg.getImage());
+ }
+
+ public void testRequiredConstructor(){
+ NavigationInstruction msg = new NavigationInstruction(Test.GENERAL_LOCATIONDETAILS, Test.GENERAL_NAVIGATIONACTION);
+ assertNotNull(Test.NOT_NULL, msg);
+
+ LocationDetails locationDetails = msg.getLocationDetails();
+ NavigationAction action = msg.getAction();
+
+ assertEquals(Test.GENERAL_LOCATIONDETAILS, locationDetails);
+ assertEquals(Test.GENERAL_NAVIGATIONACTION, action);
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(NavigationInstruction.KEY_LOCATION_DETAILS, Test.GENERAL_LOCATIONDETAILS);
+ reference.put(NavigationInstruction.KEY_ACTION, Test.GENERAL_NAVIGATIONACTION);
+ reference.put(NavigationInstruction.KEY_ETA, Test.GENERAL_DATETIME);
+ reference.put(NavigationInstruction.KEY_BEARING, Test.GENERAL_INTEGER);
+ reference.put(NavigationInstruction.KEY_JUNCTION_TYPE, Test.GENERAL_NAVIGATION_JUNCTION);
+ reference.put(NavigationInstruction.KEY_DRIVING_SIDE, Test.GENERAL_DIRECTION);
+ reference.put(NavigationInstruction.KEY_DETAILS, Test.GENERAL_STRING);
+ reference.put(NavigationInstruction.KEY_IMAGE, Test.GENERAL_IMAGE);
+
+ 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(NavigationInstruction.KEY_IMAGE)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Image refIcon1 = new Image(JsonRPCMarshaller.deserializeJSONObject(testEquals));
+ assertTrue(Test.TRUE, Validator.validateImage(refIcon1, msg.getImage()));
+ }else if(key.equals(NavigationInstruction.KEY_LOCATION_DETAILS)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateLocationDetails( Test.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest)));
+ }else if (key.equals(NavigationInstruction.KEY_ETA)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceDataTests.java
new file mode 100644
index 000000000..9b59062d4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceDataTests.java
@@ -0,0 +1,143 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.DateTime;
+import com.smartdevicelink.proxy.rpc.LocationDetails;
+import com.smartdevicelink.proxy.rpc.NavigationInstruction;
+import com.smartdevicelink.proxy.rpc.NavigationServiceData;
+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.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.NavigationServiceData}
+ */
+public class NavigationServiceDataTests extends TestCase {
+
+ private NavigationServiceData msg;
+
+ @Override
+ public void setUp(){
+ msg = new NavigationServiceData();
+
+ msg.setTimeStamp(Test.GENERAL_DATETIME);
+ msg.setOrigin(Test.GENERAL_LOCATIONDETAILS);
+ msg.setDestination(Test.GENERAL_LOCATIONDETAILS);
+ msg.setDestinationETA(Test.GENERAL_DATETIME);
+ msg.setInstructions(Test.GENERAL_NAVIGATION_INSTRUCTION_LIST);
+ msg.setNextInstructionETA(Test.GENERAL_DATETIME);
+ msg.setNextInstructionDistance(Test.GENERAL_FLOAT);
+ msg.setNextInstructionDistanceScale(Test.GENERAL_FLOAT);
+ msg.setPrompt(Test.GENERAL_STRING);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ DateTime timestamp = msg.getTimeStamp();
+ LocationDetails origin = msg.getOrigin();
+ LocationDetails destination = msg.getDestination();
+ DateTime destinationETA = msg.getDestinationETA();
+ List<NavigationInstruction> instructions = msg.getInstructions();
+ DateTime nextInstructionETA = msg.getNextInstructionETA();
+ Float nextInstructionDistance = msg.getNextInstructionDistance();
+ Float nextInstructionDistanceScale = msg.getNextInstructionDistanceScale();
+ String prompt = msg.getPrompt();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_DATETIME, timestamp);
+ assertEquals(Test.GENERAL_LOCATIONDETAILS, origin);
+ assertEquals(Test.GENERAL_LOCATIONDETAILS, destination);
+ assertEquals(Test.GENERAL_DATETIME, destinationETA);
+ assertEquals(Test.GENERAL_NAVIGATION_INSTRUCTION_LIST, instructions);
+ assertEquals(Test.GENERAL_DATETIME, nextInstructionETA);
+ assertEquals(Test.GENERAL_FLOAT, nextInstructionDistance);
+ assertEquals(Test.GENERAL_FLOAT, nextInstructionDistanceScale);
+ assertEquals(Test.GENERAL_STRING, prompt);
+
+ // Invalid/Null Tests
+ NavigationServiceData msg = new NavigationServiceData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getTimeStamp());
+ assertNull(Test.NULL, msg.getOrigin());
+ assertNull(Test.NULL, msg.getDestination());
+ assertNull(Test.NULL, msg.getDestinationETA());
+ assertNull(Test.NULL, msg.getInstructions());
+ assertNull(Test.NULL, msg.getNextInstructionETA());
+ assertNull(Test.NULL, msg.getNextInstructionDistance());
+ assertNull(Test.NULL, msg.getNextInstructionDistanceScale());
+ assertNull(Test.NULL, msg.getPrompt());
+ }
+
+ public void testRequiredConstructor(){
+ NavigationServiceData msg = new NavigationServiceData(Test.GENERAL_DATETIME);
+ assertNotNull(Test.NOT_NULL, msg);
+
+ DateTime locationDetails = msg.getTimeStamp();
+
+ assertEquals(Test.GENERAL_DATETIME, locationDetails);
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(NavigationServiceData.KEY_TIMESTAMP, Test.GENERAL_DATETIME);
+ reference.put(NavigationServiceData.KEY_ORIGIN, Test.GENERAL_LOCATIONDETAILS);
+ reference.put(NavigationServiceData.KEY_DESTINATION, Test.GENERAL_LOCATIONDETAILS);
+ reference.put(NavigationServiceData.KEY_DESTINATION_ETA, Test.GENERAL_DATETIME);
+ reference.put(NavigationServiceData.KEY_INSTRUCTIONS, Test.GENERAL_NAVIGATION_INSTRUCTION_LIST);
+ reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_ETA, Test.GENERAL_DATETIME);
+ reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_DISTANCE, Test.GENERAL_FLOAT);
+ reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_DISTANCE_SCALE, Test.GENERAL_FLOAT);
+ reference.put(NavigationServiceData.KEY_PROMPT, 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(NavigationServiceData.KEY_TIMESTAMP)||key.equals(NavigationServiceData.KEY_DESTINATION_ETA)||key.equals(NavigationServiceData.KEY_NEXT_INSTRUCTION_ETA)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(hashTest)));
+ }else if(key.equals(NavigationServiceData.KEY_DESTINATION)||key.equals(NavigationServiceData.KEY_ORIGIN)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateLocationDetails( Test.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest)));
+ }else if (key.equals(NavigationServiceData.KEY_INSTRUCTIONS)){
+ JSONArray NavigationInstructionUnderTestListArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ List<NavigationInstruction> NavigationInstructionUnderTestList = new ArrayList<>();
+ for (int index = 0; index < NavigationInstructionUnderTestListArrayObjTest.length(); index++) {
+ NavigationInstruction NavigationInstructionData = new NavigationInstruction(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)NavigationInstructionUnderTestListArrayObjTest.get(index) ));
+ NavigationInstructionUnderTestList.add(NavigationInstructionData);
+ }
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateNavigationInstructionList(Test.GENERAL_NAVIGATION_INSTRUCTION_LIST, NavigationInstructionUnderTestList));
+ }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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceManifestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceManifestTests.java
new file mode 100644
index 000000000..de4144677
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceManifestTests.java
@@ -0,0 +1,64 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.NavigationServiceManifest;
+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.proxy.rpc.NavigationServiceManifest}
+ */
+public class NavigationServiceManifestTests extends TestCase {
+
+ private NavigationServiceManifest msg;
+
+ @Override
+ public void setUp(){
+ msg = new NavigationServiceManifest();
+
+ msg.setAcceptsWayPoints(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean acceptsWayPoints = msg.getAcceptsWayPoints();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_BOOLEAN, acceptsWayPoints);
+
+ // Invalid/Null Tests
+ NavigationServiceManifest msg = new NavigationServiceManifest();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getAcceptsWayPoints());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(NavigationServiceManifest.KEY_ACCEPTS_WAY_POINTS, 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/OasisAddressTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java
index cf39a3c18..cf39a3c18 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java
new file mode 100644
index 000000000..a76b1e754
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.ParameterPermissions;
+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.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ParameterPermissions}
+ */
+public class ParameterPermissionsTests extends TestCase{
+
+ private ParameterPermissions msg;
+
+ @Override
+ public void setUp(){
+ msg = new ParameterPermissions();
+
+ msg.setAllowed(Test.GENERAL_STRING_LIST);
+ msg.setUserDisallowed(Test.GENERAL_STRING_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<String> allowed = msg.getAllowed();
+ List<String> disallowed = msg.getUserDisallowed();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, allowed));
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, disallowed));
+
+ // Invalid/Null Tests
+ ParameterPermissions msg = new ParameterPermissions();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getAllowed());
+ assertNull(Test.NULL, msg.getUserDisallowed());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(ParameterPermissions.KEY_ALLOWED, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ reference.put(ParameterPermissions.KEY_USER_DISALLOWED, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while(iterator.hasNext()){
+ String key = (String) iterator.next();
+ assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
+ }
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java
new file mode 100644
index 000000000..5fc144fea
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java
@@ -0,0 +1,84 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.HMIPermissions;
+import com.smartdevicelink.proxy.rpc.ParameterPermissions;
+import com.smartdevicelink.proxy.rpc.PermissionItem;
+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.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.PermissionItem}
+ */
+public class PermissionItemTest extends TestCase {
+
+ private PermissionItem msg;
+
+ @Override
+ public void setUp() {
+ msg = new PermissionItem();
+
+ msg.setRpcName(Test.GENERAL_STRING);
+ msg.setHMIPermissions(Test.GENERAL_HMIPERMISSIONS);
+ msg.setParameterPermissions(Test.GENERAL_PARAMETERPERMISSIONS);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String rpcName = msg.getRpcName();
+ HMIPermissions hmiPermissions = msg.getHMIPermissions();
+ ParameterPermissions parameterPermissions = msg.getParameterPermissions();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, rpcName);
+ assertTrue(Test.TRUE, Validator.validateHmiPermissions(Test.GENERAL_HMIPERMISSIONS, hmiPermissions));
+ assertTrue(Test.TRUE, Validator.validateParameterPermissions(Test.GENERAL_PARAMETERPERMISSIONS, parameterPermissions));
+
+ // Invalid/Null Tests
+ PermissionItem msg = new PermissionItem();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getRpcName());
+ assertNull(Test.NULL, msg.getHMIPermissions());
+ assertNull(Test.NULL, msg.getParameterPermissions());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(PermissionItem.KEY_RPC_NAME, Test.GENERAL_STRING);
+ reference.put(PermissionItem.KEY_HMI_PERMISSIONS, Test.JSON_HMIPERMISSIONS);
+ reference.put(PermissionItem.KEY_PARAMETER_PERMISSIONS, Test.JSON_PARAMETERPERMISSIONS);
+
+ 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(PermissionItem.KEY_HMI_PERMISSIONS)) {
+ assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
+ } else if (key.equals(PermissionItem.KEY_PARAMETER_PERMISSIONS)) {
+ assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
+ } 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/PhoneCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java
index 2614db0fd..2614db0fd 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java
new file mode 100644
index 000000000..256ef1383
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java
@@ -0,0 +1,64 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
+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.PresetBankCapabilities}
+ */
+public class PresetBankCapabilitiesTest extends TestCase {
+
+ private PresetBankCapabilities msg;
+
+ @Override
+ public void setUp() {
+ msg = new PresetBankCapabilities();
+
+ msg.setOnScreenPresetsAvailable(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean presets = msg.onScreenPresetsAvailable();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, presets);
+
+ // Invalid/Null Tests
+ PresetBankCapabilities msg = new PresetBankCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.onScreenPresetsAvailable());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_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/RGBColorTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java
index a9c0033a0..a9c0033a0 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java
index 915e779a7..915e779a7 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java
index a560827c4..a560827c4 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java
index 7414304b0..7414304b0 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java
index 569a4db83..569a4db83 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java
index e6a2d2b9a..e6a2d2b9a 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java
new file mode 100644
index 000000000..80a5e3258
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java
@@ -0,0 +1,90 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.ImageResolution;
+import com.smartdevicelink.proxy.rpc.ScreenParams;
+import com.smartdevicelink.proxy.rpc.TouchEventCapabilities;
+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.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ScreenParams}
+ */
+public class ScreenParamsTest extends TestCase {
+
+ private ScreenParams msg;
+
+ @Override
+ public void setUp() {
+ msg = new ScreenParams();
+
+ msg.setImageResolution(Test.GENERAL_IMAGERESOLUTION);
+ msg.setTouchEventAvailable(Test.GENERAL_TOUCHEVENTCAPABILITIES);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ ImageResolution imageRes = msg.getImageResolution();
+ TouchEventCapabilities touchEvent = msg.getTouchEventAvailable();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateImageResolution(Test.GENERAL_IMAGERESOLUTION, imageRes));
+ assertTrue(Test.TRUE, Validator.validateTouchEventCapabilities(Test.GENERAL_TOUCHEVENTCAPABILITIES, touchEvent));
+
+ // Invalid/Null Tests
+ ScreenParams msg = new ScreenParams();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getImageResolution());
+ assertNull(Test.NULL, msg.getTouchEventAvailable());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(ScreenParams.KEY_RESOLUTION, Test.JSON_IMAGERESOLUTION);
+ reference.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE, Test.JSON_TOUCHEVENTCAPABILITIES);
+
+ 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(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE)) {
+ JSONObject touchEventObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject touchEventObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateTouchEventCapabilities(
+ new TouchEventCapabilities(JsonRPCMarshaller.deserializeJSONObject(touchEventObjReference)),
+ new TouchEventCapabilities(JsonRPCMarshaller.deserializeJSONObject(touchEventObjTest))));
+ } else if (key.equals(ScreenParams.KEY_RESOLUTION)) {
+ JSONObject resolutionObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject resolutionObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateImageResolution(
+ new ImageResolution(JsonRPCMarshaller.deserializeJSONObject(resolutionObjReference)),
+ new ImageResolution(JsonRPCMarshaller.deserializeJSONObject(resolutionObjTest))));
+ } 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java
new file mode 100644
index 000000000..a047cf01c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+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.SdlMsgVersion}
+ */
+public class SdlMsgVersionTest extends TestCase {
+
+ private SdlMsgVersion msg;
+
+ @Override
+ public void setUp() {
+ msg = new SdlMsgVersion();
+
+ msg.setMajorVersion(Test.GENERAL_INT);
+ msg.setMinorVersion(Test.GENERAL_INT);
+ msg.setPatchVersion(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer major = msg.getMajorVersion();
+ Integer minor = msg.getMinorVersion();
+ Integer patch = msg.getPatchVersion();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, major);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, minor);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, patch);
+
+ // Invalid/Null Tests
+ SdlMsgVersion msg = new SdlMsgVersion();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getMajorVersion());
+ assertNull(Test.NULL, msg.getMinorVersion());
+ assertNull(Test.NULL, msg.getPatchVersion());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(SdlMsgVersion.KEY_MAJOR_VERSION, Test.GENERAL_INT);
+ reference.put(SdlMsgVersion.KEY_MINOR_VERSION, Test.GENERAL_INT);
+ reference.put(SdlMsgVersion.KEY_PATCH_VERSION, 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/SeatControlCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java
index d988fa991..d988fa991 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java
index 535e7cf3e..535e7cf3e 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java
index a8c17cee3..a8c17cee3 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java
new file mode 100644
index 000000000..15e83ad11
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java
@@ -0,0 +1,76 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.SingleTireStatus;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
+import com.smartdevicelink.proxy.rpc.enums.TPMS;
+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.proxy.rpc.SingleTireStatus}
+ */
+public class SingleTireStatusTest extends TestCase {
+
+ private SingleTireStatus msg;
+
+ @Override
+ public void setUp() {
+ msg = new SingleTireStatus();
+
+ msg.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
+ msg.setTPMS(Test.GENERAL_TPMS);
+ msg.setPressure(Test.GENERAL_FLOAT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ ComponentVolumeStatus status = msg.getStatus();
+ TPMS tpms = msg.getTPMS();
+ Float pressure = msg.getPressure();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, status);
+ assertEquals(Test.MATCH, Test.GENERAL_TPMS, tpms);
+ assertEquals(Test.MATCH, Test.GENERAL_FLOAT, pressure);
+
+ // Invalid/Null Tests
+ SingleTireStatus msg = new SingleTireStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getStatus());
+ assertNull(Test.NULL, msg.getTPMS());
+ assertNull(Test.NULL, msg.getPressure());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
+ reference.put(SingleTireStatus.KEY_TPMS, Test.GENERAL_TPMS);
+ reference.put(SingleTireStatus.KEY_PRESSURE, Test.GENERAL_FLOAT);
+
+ 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/SisDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java
index 51e38f8d1..51e38f8d1 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java
new file mode 100644
index 000000000..f5d0a9217
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
+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.SoftButtonCapabilities}
+ */
+public class SoftButtonCapabilitiesTest extends TestCase {
+
+ private SoftButtonCapabilities msg;
+
+ @Override
+ public void setUp() {
+ msg = new SoftButtonCapabilities();
+
+ msg.setImageSupported(Test.GENERAL_BOOLEAN);
+ msg.setShortPressAvailable(Test.GENERAL_BOOLEAN);
+ msg.setLongPressAvailable(Test.GENERAL_BOOLEAN);
+ msg.setUpDownAvailable(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Boolean imageSupp = msg.getImageSupported();
+ Boolean updown = msg.getUpDownAvailable();
+ Boolean longPress = msg.getLongPressAvailable();
+ Boolean shortPress = msg.getShortPressAvailable();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, imageSupp);
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, updown);
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, longPress);
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, shortPress);
+
+ // Invalid/Null Tests
+ SoftButtonCapabilities msg = new SoftButtonCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getImageSupported());
+ assertNull(Test.NULL, msg.getLongPressAvailable());
+ assertNull(Test.NULL, msg.getShortPressAvailable());
+ assertNull(Test.NULL, msg.getUpDownAvailable());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED, Test.GENERAL_BOOLEAN);
+ reference.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(SoftButtonCapabilities.KEY_SHORT_PRESS_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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java
new file mode 100644
index 000000000..5d12e1286
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java
@@ -0,0 +1,104 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
+import com.smartdevicelink.proxy.rpc.enums.SystemAction;
+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.SoftButton}
+ */
+public class SoftButtonTest extends TestCase {
+
+ private SoftButton msg;
+
+ @Override
+ public void setUp() {
+ msg = new SoftButton();
+
+ msg.setType(Test.GENERAL_SOFTBUTTONTYPE);
+ msg.setText(Test.GENERAL_STRING);
+ msg.setSystemAction(Test.GENERAL_SYSTEMACTION);
+ msg.setImage(Test.GENERAL_IMAGE);
+ msg.setIsHighlighted(Test.GENERAL_BOOLEAN);
+ msg.setSoftButtonID(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ SoftButtonType type = msg.getType();
+ String text = msg.getText();
+ SystemAction sysAction = msg.getSystemAction();
+ Image image = msg.getImage();
+ Boolean isHighlighted = msg.getIsHighlighted();
+ Integer id = msg.getSoftButtonID();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONTYPE, type);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, text);
+ assertEquals(Test.MATCH, Test.GENERAL_SYSTEMACTION, sysAction);
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image));
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, isHighlighted);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, id);
+
+ // Invalid/Null Tests
+ SoftButton msg = new SoftButton();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getSoftButtonID());
+ assertNull(Test.NULL, msg.getImage());
+ assertNull(Test.NULL, msg.getIsHighlighted());
+ assertNull(Test.NULL, msg.getSystemAction());
+ assertNull(Test.NULL, msg.getText());
+ assertNull(Test.NULL, msg.getType());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(SoftButton.KEY_SOFT_BUTTON_ID, Test.GENERAL_INT);
+ reference.put(SoftButton.KEY_TYPE, Test.GENERAL_SOFTBUTTONTYPE);
+ reference.put(SoftButton.KEY_TEXT, Test.GENERAL_STRING);
+ reference.put(SoftButton.KEY_IMAGE, Test.JSON_IMAGE);
+ reference.put(SoftButton.KEY_SYSTEM_ACTION, Test.GENERAL_SYSTEMACTION);
+ reference.put(SoftButton.KEY_IS_HIGHLIGHTED, 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();
+
+ if(key.equals(SoftButton.KEY_IMAGE)){
+ JSONObject referenceArray = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject underTestArray = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray);
+ Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray);
+ assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java
new file mode 100644
index 000000000..5d698398f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.StartTime;
+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.proxy.rpc.StartTime}
+ */
+public class StartTimeTest extends TestCase {
+
+ private StartTime msg;
+
+ @Override
+ public void setUp() {
+ msg = new StartTime();
+
+ msg.setHours(Test.GENERAL_INT);
+ msg.setMinutes(Test.GENERAL_INT);
+ msg.setSeconds(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer hours = msg.getHours();
+ Integer minutes = msg.getMinutes();
+ Integer seconds = msg.getSeconds();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, hours);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, minutes);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, seconds);
+
+ // TimeInterval constructor test
+ StartTime startTime = new StartTime(7000);
+ assertEquals(Test.MATCH, (Integer) 1, startTime.getHours());
+ assertEquals(Test.MATCH, (Integer) 56, startTime.getMinutes());
+ assertEquals(Test.MATCH, (Integer) 40, startTime.getSeconds());
+
+ // Invalid/Null Tests
+ StartTime msg = new StartTime();
+ assertNotNull(Test.NOT_NULL, msg);
+ assertNull(Test.NULL, msg.getHours());
+ assertNull(Test.NULL, msg.getMinutes());
+ assertNull(Test.NULL, msg.getSeconds());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(StartTime.KEY_HOURS, Test.GENERAL_INT);
+ reference.put(StartTime.KEY_MINUTES, Test.GENERAL_INT);
+ reference.put(StartTime.KEY_SECONDS, 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/StationIDNumberTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java
index e7e61f8fd..e7e61f8fd 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java
new file mode 100644
index 000000000..bc50907db
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java
@@ -0,0 +1,124 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import android.util.Log;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.AppServicesCapabilities;
+import com.smartdevicelink.proxy.rpc.NavigationCapability;
+import com.smartdevicelink.proxy.rpc.PhoneCapability;
+import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities;
+import com.smartdevicelink.proxy.rpc.SystemCapability;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+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.proxy.rpc.SystemCapability}
+ */
+public class SystemCapabilityTests extends TestCase {
+
+ private SystemCapability msg;
+
+ @Override
+ public void setUp() {
+ msg = new SystemCapability();
+
+ msg.setSystemCapabilityType(Test.GENERAL_SYSTEMCAPABILITYTYPE);
+ msg.setCapabilityForType(SystemCapabilityType.NAVIGATION, Test.GENERAL_NAVIGATIONCAPABILITY);
+ msg.setCapabilityForType(SystemCapabilityType.PHONE_CALL, Test.GENERAL_PHONECAPABILITY);
+ msg.setCapabilityForType(SystemCapabilityType.REMOTE_CONTROL, Test.GENERAL_REMOTECONTROLCAPABILITIES);
+ msg.setCapabilityForType(SystemCapabilityType.APP_SERVICES, Test.GENERAL_APP_SERVICE_CAPABILITIES);
+
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ SystemCapabilityType testType = msg.getSystemCapabilityType();
+ NavigationCapability testNavigationCapability = (NavigationCapability) msg.getCapabilityForType(SystemCapabilityType.NAVIGATION);
+ PhoneCapability testPhoneCapability = (PhoneCapability) msg.getCapabilityForType(SystemCapabilityType.PHONE_CALL);
+ RemoteControlCapabilities testRemoteControlCapabilities = (RemoteControlCapabilities) msg.getCapabilityForType(SystemCapabilityType.REMOTE_CONTROL);
+ AppServicesCapabilities testAppServicesCapabilities = (AppServicesCapabilities) msg.getCapabilityForType(SystemCapabilityType.APP_SERVICES);
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITYTYPE, testType);
+ assertTrue(Test.TRUE, Validator.validateNavigationCapability(Test.GENERAL_NAVIGATIONCAPABILITY, testNavigationCapability));
+ assertTrue(Test.TRUE, Validator.validatePhoneCapability(Test.GENERAL_PHONECAPABILITY, testPhoneCapability));
+ assertTrue(Test.TRUE, Validator.validateRemoteControlCapabilities(Test.GENERAL_REMOTECONTROLCAPABILITIES, testRemoteControlCapabilities));
+ assertTrue(Test.TRUE, Validator.validateAppServiceCapabilities(Test.GENERAL_APP_SERVICE_CAPABILITIES, testAppServicesCapabilities));
+
+ // Invalid/Null Tests
+ SystemCapability msg = new SystemCapability();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getSystemCapabilityType());
+ assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.NAVIGATION));
+ assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.PHONE_CALL));
+ assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.REMOTE_CONTROL));
+ assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.APP_SERVICES));
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(SystemCapability.KEY_SYSTEM_CAPABILITY_TYPE, Test.GENERAL_SYSTEMCAPABILITYTYPE);
+ reference.put(SystemCapability.KEY_NAVIGATION_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_NAVIGATIONCAPABILITY.getStore()));
+ reference.put(SystemCapability.KEY_PHONE_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_PHONECAPABILITY.getStore()));
+ reference.put(SystemCapability.KEY_REMOTE_CONTROL_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_REMOTECONTROLCAPABILITIES.getStore()));
+ reference.put(SystemCapability.KEY_APP_SERVICES_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_APP_SERVICE_CAPABILITIES.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(SystemCapability.KEY_NAVIGATION_CAPABILITY)){
+ 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.validateNavigationCapability( new NavigationCapability(hashReference), new NavigationCapability(hashTest)));
+ } else if(key.equals(SystemCapability.KEY_PHONE_CAPABILITY)){
+ 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.validatePhoneCapability( new PhoneCapability(hashReference), new PhoneCapability(hashTest)));
+ } else if(key.equals(SystemCapability.KEY_REMOTE_CONTROL_CAPABILITY)){
+ 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.validateRemoteControlCapabilities( new RemoteControlCapabilities(hashReference), new RemoteControlCapabilities(hashTest)));
+ }else if(key.equals(SystemCapability.KEY_APP_SERVICES_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);
+ Log.i("TEST REF", hashReference.toString());
+ Log.i("TEST TEST", hashTest.toString());
+ assertTrue(Test.TRUE, Validator.validateAppServiceCapabilities( new AppServicesCapabilities(hashReference), new AppServicesCapabilities(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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java
new file mode 100644
index 000000000..4a34d297a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java
@@ -0,0 +1,66 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+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;
+
+public class TTSChunkTest extends TestCase {
+
+ private TTSChunk msg;
+
+ @Override
+ public void setUp() {
+ msg = new TTSChunk();
+
+ msg.setText(Test.GENERAL_STRING);
+ msg.setType(Test.GENERAL_SPEECHCAPABILITIES);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String text = msg.getText();
+ SpeechCapabilities speechType = msg.getType();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, text);
+ assertEquals(Test.MATCH, Test.GENERAL_SPEECHCAPABILITIES, speechType);
+
+ // Invalid/Null Tests
+ TTSChunk msg = new TTSChunk();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getText());
+ assertNull(Test.NULL, msg.getType());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(TTSChunk.KEY_TEXT, Test.GENERAL_STRING);
+ reference.put(TTSChunk.KEY_TYPE, Test.GENERAL_SPEECHCAPABILITIES);
+
+ 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/TemperatureTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java
index 090f5a235..090f5a235 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java
new file mode 100644
index 000000000..85666a8b6
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java
@@ -0,0 +1,80 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.RGBColor;
+import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
+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.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.TemplateColorScheme}
+ */
+public class TemplateColorSchemeTest extends TestCase {
+
+ private TemplateColorScheme msg;
+
+ @Override
+ public void setUp() {
+ msg = new TemplateColorScheme();
+ msg.setPrimaryColor(Test.GENERAL_RGBCOLOR);
+ msg.setSecondaryColor(Test.GENERAL_RGBCOLOR);
+ msg.setBackgroundColor(Test.GENERAL_RGBCOLOR);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ RGBColor primaryColor = msg.getPrimaryColor();
+ RGBColor secondaryColor = msg.getSecondaryColor();
+ RGBColor backgroundColor = msg.getBackgroundColor();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, primaryColor));
+ assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, secondaryColor));
+ assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, backgroundColor));
+
+ // Invalid/Null Tests
+ TemplateColorScheme msg = new TemplateColorScheme();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getPrimaryColor());
+ assertNull(Test.NULL, msg.getSecondaryColor());
+ assertNull(Test.NULL, msg.getBackgroundColor());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(TemplateColorScheme.KEY_PRIMARY_COLOR, Test.JSON_RGBCOLOR);
+ reference.put(TemplateColorScheme.KEY_SECONDARY_COLOR, Test.JSON_RGBCOLOR);
+ reference.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, Test.JSON_RGBCOLOR);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+ JSONObject referenceColorObj = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ RGBColor referenceColor = new RGBColor(JsonRPCMarshaller.deserializeJSONObject(referenceColorObj));
+ JSONObject underTestColorObj = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+ RGBColor underTestColor = new RGBColor(JsonRPCMarshaller.deserializeJSONObject(underTestColorObj));
+ assertTrue(Test.TRUE, Validator.validateRGBColor(referenceColor, underTestColor));
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java
new file mode 100644
index 000000000..8a06abd5d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java
@@ -0,0 +1,81 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.TextField;
+import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
+import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+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.TextField}
+ */
+public class TextFieldTest extends TestCase {
+
+ private TextField msg;
+
+ @Override
+ public void setUp() {
+ msg = new TextField();
+
+ msg.setName(Test.GENERAL_TEXTFIELDNAME);
+ msg.setCharacterSet(Test.GENERAL_CHARACTERSET);
+ msg.setWidth(Test.GENERAL_INT);
+ msg.setRows(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ TextFieldName name = msg.getName();
+ CharacterSet charSet = msg.getCharacterSet();
+ Integer width = msg.getWidth();
+ Integer rows = msg.getRows();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_TEXTFIELDNAME, name);
+ assertEquals(Test.MATCH, Test.GENERAL_CHARACTERSET, charSet);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, width);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, rows);
+
+ // Invalid/Null Tests
+ TextField msg = new TextField();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getName());
+ assertNull(Test.NULL, msg.getWidth());
+ assertNull(Test.NULL, msg.getRows());
+ assertNull(Test.NULL, msg.getCharacterSet());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(TextField.KEY_CHARACTER_SET, Test.GENERAL_CHARACTERSET);
+ reference.put(TextField.KEY_WIDTH, Test.GENERAL_INT);
+ reference.put(TextField.KEY_ROWS, Test.GENERAL_INT);
+ reference.put(TextField.KEY_NAME, Test.GENERAL_TEXTFIELDNAME);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java
new file mode 100644
index 000000000..b2751bdda
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java
@@ -0,0 +1,108 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.SingleTireStatus;
+import com.smartdevicelink.proxy.rpc.TireStatus;
+import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.TireStatus}
+ */
+public class TireStatusTest extends TestCase {
+
+ private TireStatus msg;
+
+ @Override
+ public void setUp() {
+ msg = new TireStatus();
+ msg.setPressureTellTale(Test.GENERAL_WARNINGLIGHTSTATUS);
+ SingleTireStatus tireLeftFront = new SingleTireStatus();
+ tireLeftFront.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
+ msg.setLeftFront(tireLeftFront);
+ SingleTireStatus tireRightFront = new SingleTireStatus();
+ tireRightFront.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
+ msg.setRightFront(tireRightFront);
+ SingleTireStatus tireLeftRear = new SingleTireStatus();
+ tireLeftRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
+ msg.setLeftRear(tireLeftRear);
+ SingleTireStatus tireRightRear = new SingleTireStatus();
+ tireRightRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
+ msg.setRightRear(tireRightRear);
+ SingleTireStatus tireInnerLeftRear = new SingleTireStatus();
+ tireInnerLeftRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
+ msg.setInnerLeftRear(tireInnerLeftRear);
+ SingleTireStatus tireInnerRightRear = new SingleTireStatus();
+ tireInnerRightRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
+ msg.setInnerRightRear(tireInnerRightRear);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ WarningLightStatus pressure = msg.getPressureTellTale();
+ SingleTireStatus leftFront = msg.getLeftFront();
+ SingleTireStatus rightFront = msg.getRightFront();
+ SingleTireStatus leftRear = msg.getLeftRear();
+ SingleTireStatus rightRear = msg.getRightRear();
+ SingleTireStatus innerLeftRear = msg.getInnerLeftRear();
+ SingleTireStatus innerRightRear = msg.getInnerRightRear();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_WARNINGLIGHTSTATUS, pressure);
+ assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, leftFront.getStatus());
+ assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, rightFront.getStatus());
+ assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, leftRear.getStatus());
+ assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, rightRear.getStatus());
+ assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, innerLeftRear.getStatus());
+ assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, innerRightRear.getStatus());
+
+ // Invalid/Null Tests
+ TireStatus msg = new TireStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(TireStatus.KEY_PRESSURE_TELL_TALE, Test.GENERAL_WARNINGLIGHTSTATUS);
+ JSONObject tireLeftFront = new JSONObject();
+ tireLeftFront.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
+ reference.put(TireStatus.KEY_LEFT_FRONT, tireLeftFront);
+ JSONObject tireRightFront = new JSONObject();
+ tireRightFront.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
+ reference.put(TireStatus.KEY_RIGHT_FRONT, tireRightFront);
+ JSONObject tireLeftRear = new JSONObject();
+ tireLeftRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
+ reference.put(TireStatus.KEY_LEFT_REAR, tireLeftRear);
+ JSONObject tireRightRear = new JSONObject();
+ tireRightRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
+ reference.put(TireStatus.KEY_RIGHT_REAR, tireRightRear);
+ JSONObject tireInnerLeftRear = new JSONObject();
+ tireInnerLeftRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
+ reference.put(TireStatus.KEY_INNER_LEFT_REAR, tireInnerLeftRear);
+ JSONObject tireInnerRightRear = new JSONObject();
+ tireInnerRightRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
+ reference.put(TireStatus.KEY_INNER_RIGHT_REAR, tireInnerRightRear);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ assertTrue(Test.TRUE, Validator.validateTireStatus(
+ new TireStatus(JsonRPCMarshaller.deserializeJSONObject(reference)),
+ new TireStatus(JsonRPCMarshaller.deserializeJSONObject(underTest))));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java
new file mode 100644
index 000000000..7ce2f176f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java
@@ -0,0 +1,69 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.TouchCoord;
+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.TouchCoord}
+ */
+public class TouchCoordTest extends TestCase {
+
+ private TouchCoord msg;
+
+ @Override
+ public void setUp() {
+ msg = new TouchCoord();
+
+ msg.setX(Test.GENERAL_INT);
+ msg.setY(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer x = msg.getX();
+ Integer y = msg.getY();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, x);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, y);
+
+ // Invalid/Null Tests
+ TouchCoord msg = new TouchCoord();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getX());
+ assertNull(Test.NULL, msg.getY());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(TouchCoord.KEY_X, Test.GENERAL_INT);
+ reference.put(TouchCoord.KEY_Y, 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java
new file mode 100644
index 000000000..27e90e337
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.TouchEventCapabilities;
+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.TouchEventCapabilties}
+ */
+public class TouchEventCapabilitiesTest extends TestCase {
+
+ private TouchEventCapabilities msg;
+
+ @Override
+ public void setUp() {
+ msg = new TouchEventCapabilities();
+
+ msg.setPressAvailable(Test.GENERAL_BOOLEAN);
+ msg.setDoublePressAvailable(Test.GENERAL_BOOLEAN);
+ msg.setMultiTouchAvailable(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Boolean press = msg.getPressAvailable();
+ Boolean multiTouch = msg.getMultiTouchAvailable();
+ Boolean doublePress = msg.getDoublePressAvailable();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, press);
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, multiTouch);
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, doublePress);
+
+ // Invalid/Null Tests
+ TouchEventCapabilities msg = new TouchEventCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getPressAvailable());
+ assertNull(Test.NULL, msg.getMultiTouchAvailable());
+ assertNull(Test.NULL, msg.getDoublePressAvailable());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java
new file mode 100644
index 000000000..24a10d68e
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java
@@ -0,0 +1,89 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.TouchCoord;
+import com.smartdevicelink.proxy.rpc.TouchEvent;
+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.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.TouchEvent}
+ */
+public class TouchEventTest extends TestCase {
+
+ private TouchEvent msg;
+
+ @Override
+ public void setUp() {
+ msg = new TouchEvent();
+ msg.setId(Test.GENERAL_INT);
+ msg.setTs(Test.GENERAL_LONG_LIST);
+ msg.setC(Test.GENERAL_TOUCHCOORD_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer id = msg.getId();
+ List<Long> timestamp = msg.getTs();
+ List<TouchCoord> coordTest = msg.getC();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, id);
+ assertTrue(Test.TRUE, Validator.validateLongList(Test.GENERAL_LONG_LIST, timestamp));
+ assertEquals(Test.MATCH, Test.GENERAL_TOUCHCOORD_LIST.size(), coordTest.size());
+
+ for (int index = 0; index < Test.GENERAL_TOUCHCOORD_LIST.size(); index++) {
+ assertTrue(Test.TRUE, Validator.validateTouchCoord(Test.GENERAL_TOUCHCOORD_LIST.get(index), coordTest.get(index)));
+ }
+
+ // Invalid/Null Tests
+ TouchEvent msg = new TouchEvent();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getId());
+ assertNull(Test.NULL, msg.getTs());
+ assertNull(Test.NULL, msg.getC());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(TouchEvent.KEY_ID, Test.GENERAL_INT);
+ reference.put(TouchEvent.KEY_TS, JsonUtils.createJsonArray(Test.GENERAL_LONG_LIST));
+ reference.put(TouchEvent.KEY_C, Test.JSON_TOUCHCOORDS);
+
+ 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(TouchEvent.KEY_C)) {
+ assertTrue(Test.TRUE, JsonUtils.readIntegerFromJsonObject(reference, key) == JsonUtils.readIntegerFromJsonObject(underTest, key));
+ } else if (key.equals(TouchEvent.KEY_TS)) {
+ List<Long> tsListReference = JsonUtils.readLongListFromJsonObject(reference, key);
+ List<Long> tsListTest = JsonUtils.readLongListFromJsonObject(underTest, key);
+ assertTrue(Test.TRUE, tsListReference.containsAll(tsListTest) && tsListTest.containsAll(tsListReference));
+ } 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java
new file mode 100644
index 000000000..dba742b71
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java
@@ -0,0 +1,56 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.Turn;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+public class TurnTests extends TestCase {
+
+ private Turn msg;
+
+ @Override
+ public void setUp(){
+ msg = new Turn();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ msg.setTurnIcon(Test.GENERAL_IMAGE);
+ msg.setNavigationText(Test.GENERAL_STRING);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Image icon = msg.getTurnIcon();
+ String text = msg.getNavigationText();
+
+ // Valid Tests
+ assertTrue(Test.MATCH, Validator.validateImage(Test.GENERAL_IMAGE, icon));
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, text);
+
+ // Invalid/Null Tests
+ Turn msg = new Turn();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getNavigationText());
+ assertNull(Test.NULL, msg.getTurnIcon());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(Turn.KEY_NAVIGATION_TEXT, Test.GENERAL_STRING);
+ reference.put(Turn.KEY_TURN_IMAGE, Test.JSON_IMAGE);
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java
new file mode 100644
index 000000000..5b982fe97
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java
@@ -0,0 +1,69 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.VehicleDataResult;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
+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;
+
+public class VehicleDataResultTest extends TestCase {
+
+ private VehicleDataResult msg;
+
+ @Override
+ public void setUp() {
+ msg = new VehicleDataResult();
+
+ msg.setDataType(Test.GENERAL_VEHICLEDATATYPE);
+ msg.setResultCode(Test.GENERAL_VEHICLEDATARESULTCODE);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ VehicleDataResultCode result = msg.getResultCode();
+ VehicleDataType type = msg.getDataType();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATARESULTCODE, result);
+ assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATATYPE, type);
+
+ // Invalid/Null Tests
+ VehicleDataResult msg = new VehicleDataResult();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getDataType());
+ assertNull(Test.NULL, msg.getResultCode());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(VehicleDataResult.KEY_RESULT_CODE, Test.GENERAL_VEHICLEDATARESULTCODE);
+ reference.put(VehicleDataResult.KEY_DATA_TYPE, Test.GENERAL_VEHICLEDATATYPE);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java
new file mode 100644
index 000000000..24d85152a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.VehicleType;
+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;
+
+public class VehicleTypeTest extends TestCase {
+
+ private VehicleType msg;
+
+ @Override
+ public void setUp() {
+ msg = new VehicleType();
+
+ msg.setModel(Test.GENERAL_STRING);
+ msg.setMake(Test.GENERAL_STRING);
+ msg.setTrim(Test.GENERAL_STRING);
+ msg.setModelYear(Test.GENERAL_STRING);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String year = msg.getModelYear();
+ String trim = msg.getTrim();
+ String make = msg.getMake();
+ String model = msg.getModel();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, year);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, model);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, make);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, trim);
+
+ // Invalid/Null Tests
+ VehicleType msg = new VehicleType();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getModel());
+ assertNull(Test.NULL, msg.getMake());
+ assertNull(Test.NULL, msg.getModelYear());
+ assertNull(Test.NULL, msg.getTrim());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(VehicleType.KEY_MODEL, Test.GENERAL_STRING);
+ reference.put(VehicleType.KEY_MAKE, Test.GENERAL_STRING);
+ reference.put(VehicleType.KEY_MODEL_YEAR, Test.GENERAL_STRING);
+ reference.put(VehicleType.KEY_TRIM, 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();
+ 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/VideoStreamingCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java
index 54cfc1a22..54cfc1a22 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java
new file mode 100644
index 000000000..431b3bfc6
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java
@@ -0,0 +1,68 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+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;
+
+public class VideoStreamingFormatTests extends TestCase {
+
+ private VideoStreamingFormat msg;
+
+ @Override
+ public void setUp() {
+ msg = new VideoStreamingFormat();
+ msg.setProtocol(Test.GENERAL_VIDEOSTREAMINGPROTOCOL);
+ msg.setCodec(Test.GENERAL_VIDEOSTREAMINGCODEC);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ VideoStreamingProtocol protocol = msg.getProtocol();
+ VideoStreamingCodec codec = msg.getCodec();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (VideoStreamingProtocol) Test.GENERAL_VIDEOSTREAMINGPROTOCOL, protocol);
+ assertEquals(Test.MATCH, (VideoStreamingCodec) Test.GENERAL_VIDEOSTREAMINGCODEC, codec);
+
+ // Invalid/Null Tests
+ VideoStreamingFormat msg = new VideoStreamingFormat();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getProtocol());
+ assertNull(Test.NULL, msg.getCodec());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(VideoStreamingFormat.KEY_PROTOCOL, Test.GENERAL_VIDEOSTREAMINGPROTOCOL);
+ reference.put(VideoStreamingFormat.KEY_CODEC, Test.GENERAL_VIDEOSTREAMINGCODEC);
+
+ 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);
+ }
+ }
+}
+
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java
new file mode 100644
index 000000000..405e2bf84
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java
@@ -0,0 +1,85 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.VrHelpItem;
+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;
+
+public class VrHelpItemTest extends TestCase {
+
+ private VrHelpItem msg;
+
+ @Override
+ public void setUp() {
+ msg = new VrHelpItem();
+
+ msg.setText(Test.GENERAL_STRING);
+ msg.setImage(Test.GENERAL_IMAGE);
+ msg.setPosition(Test.GENERAL_INT);
+
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String text = msg.getText();
+ Image image = msg.getImage();
+ Integer position = msg.getPosition();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, text);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, position);
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image));
+
+ // Invalid/Null Tests
+ VrHelpItem msg = new VrHelpItem();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getImage());
+ assertNull(Test.NULL, msg.getText());
+ assertNull(Test.NULL, msg.getPosition());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(VrHelpItem.KEY_IMAGE, Test.JSON_IMAGE);
+ reference.put(VrHelpItem.KEY_TEXT, Test.GENERAL_STRING);
+ reference.put(VrHelpItem.KEY_POSITION, 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();
+
+ if(key.equals(VrHelpItem.KEY_IMAGE)){
+ JSONObject objectEquals = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject testEquals = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+
+ assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java
new file mode 100644
index 000000000..4a8ade572
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java
@@ -0,0 +1,112 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.DateTime;
+import com.smartdevicelink.proxy.rpc.WeatherAlert;
+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.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.WeatherAlert}
+ */
+public class WeatherAlertTests extends TestCase {
+
+ private WeatherAlert msg;
+
+ @Override
+ public void setUp(){
+
+ msg = new WeatherAlert();
+ msg.setExpires(Test.GENERAL_DATETIME);
+ msg.setTimeIssued(Test.GENERAL_DATETIME);
+ msg.setRegions(Test.GENERAL_STRING_LIST);
+ msg.setSeverity(Test.GENERAL_STRING);
+ msg.setSummary(Test.GENERAL_STRING);
+ msg.setTitle(Test.GENERAL_STRING);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ DateTime expires = msg.getExpires();
+ DateTime issued = msg.getTimeIssued();
+ List<String> regions = msg.getRegions();
+ String severity = msg.getSeverity();
+ String summary = msg.getSummary();
+ String title = msg.getTitle();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expires, Test.GENERAL_DATETIME);
+ assertEquals(Test.MATCH, issued, Test.GENERAL_DATETIME);
+ assertEquals(Test.MATCH, regions, Test.GENERAL_STRING_LIST);
+ assertEquals(Test.MATCH, severity, Test.GENERAL_STRING);
+ assertEquals(Test.MATCH, summary, Test.GENERAL_STRING);
+ assertEquals(Test.MATCH, title, Test.GENERAL_STRING);
+
+ // Invalid/Null Tests
+ WeatherAlert msg = new WeatherAlert();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getExpires());
+ assertNull(Test.NULL, msg.getTimeIssued());
+ assertNull(Test.NULL, msg.getRegions());
+ assertNull(Test.NULL, msg.getSeverity());
+ assertNull(Test.NULL, msg.getSummary());
+ assertNull(Test.NULL, msg.getTitle());
+ }
+
+ public void testRequiredParamsConstructor(){
+ msg = new WeatherAlert(Test.GENERAL_STRING_LIST);
+ List<String> regions = msg.getRegions();
+ assertEquals(Test.MATCH, regions, Test.GENERAL_STRING_LIST);
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(WeatherAlert.KEY_EXPIRES, Test.GENERAL_DATETIME);
+ reference.put(WeatherAlert.KEY_TIME_ISSUED, Test.GENERAL_DATETIME);
+ reference.put(WeatherAlert.KEY_REGIONS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ reference.put(WeatherAlert.KEY_SEVERITY, Test.GENERAL_STRING);
+ reference.put(WeatherAlert.KEY_SUMMARY, Test.GENERAL_STRING);
+ reference.put(WeatherAlert.KEY_TITLE, 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(WeatherAlert.KEY_EXPIRES)||key.equals(WeatherAlert.KEY_TIME_ISSUED)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(hashTest)));
+ } else if (key.equals(WeatherAlert.KEY_REGIONS)){
+ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
+ JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
+ assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
+ } 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherDataTests.java
new file mode 100644
index 000000000..04522acfb
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherDataTests.java
@@ -0,0 +1,189 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.DateTime;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.Temperature;
+import com.smartdevicelink.proxy.rpc.WeatherData;
+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.proxy.rpc.WeatherData}
+ */
+public class WeatherDataTests extends TestCase {
+
+ private WeatherData msg;
+
+ @Override
+ public void setUp(){
+
+ msg = new WeatherData();
+ msg.setCurrentTemperature(Test.GENERAL_TEMPERATURE);
+ msg.setTemperatureHigh(Test.GENERAL_TEMPERATURE);
+ msg.setTemperatureLow(Test.GENERAL_TEMPERATURE);
+ msg.setApparentTemperature(Test.GENERAL_TEMPERATURE);
+ msg.setApparentTemperatureHigh(Test.GENERAL_TEMPERATURE);
+ msg.setApparentTemperatureLow(Test.GENERAL_TEMPERATURE);
+ msg.setWeatherSummary(Test.GENERAL_STRING);
+ msg.setTime(Test.GENERAL_DATETIME);
+ msg.setHumidity(Test.GENERAL_FLOAT);
+ msg.setCloudCover(Test.GENERAL_FLOAT);
+ msg.setMoonPhase(Test.GENERAL_FLOAT);
+ msg.setWindBearing(Test.GENERAL_INTEGER);
+ msg.setWindGust(Test.GENERAL_FLOAT);
+ msg.setWindSpeed(Test.GENERAL_FLOAT);
+ msg.setNearestStormBearing(Test.GENERAL_INTEGER);
+ msg.setNearestStormDistance(Test.GENERAL_INTEGER);
+ msg.setPrecipAccumulation(Test.GENERAL_FLOAT);
+ msg.setPrecipIntensity(Test.GENERAL_FLOAT);
+ msg.setPrecipProbability(Test.GENERAL_FLOAT);
+ msg.setPrecipType(Test.GENERAL_STRING);
+ msg.setVisibility(Test.GENERAL_FLOAT);
+ msg.setWeatherIcon(Test.GENERAL_IMAGE);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Temperature currentTemperature = msg.getCurrentTemperature();
+ Temperature temperatureHigh = msg.getTemperatureHigh();
+ Temperature temperatureLow = msg.getTemperatureLow();
+ Temperature apparentTemperature = msg.getApparentTemperature();
+ Temperature apparentTemperatureHigh = msg.getApparentTemperatureHigh();
+ String weatherSummary = msg.getWeatherSummary();
+ DateTime time = msg.getTime();
+ Float humidity = msg.getHumidity();
+ Float cloudCover = msg.getCloudCover();
+ Float moonPhase = msg.getMoonPhase();
+ Integer windBearing = msg.getWindBearing();
+ Float windGust = msg.getWindGust();
+ Float windSpeed = msg.getWindSpeed();
+ Integer nearestStormBearing = msg.getNearestStormBearing();
+ Integer nearestStormDistance = msg.getNearestStormDistance();
+ Float precipAccumulation = msg.getPrecipAccumulation();
+ Float precipIntensity = msg.getPrecipIntensity();
+ Float precipProbability = msg.getPrecipProbability();
+ String precipType = msg.getPrecipType();
+ Float visibility = msg.getVisibility();
+ Image weatherIcon = msg.getWeatherIcon();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, currentTemperature, Test.GENERAL_TEMPERATURE);
+ assertEquals(Test.MATCH, temperatureHigh, Test.GENERAL_TEMPERATURE);
+ assertEquals(Test.MATCH, temperatureLow, Test.GENERAL_TEMPERATURE);
+ assertEquals(Test.MATCH, apparentTemperature, Test.GENERAL_TEMPERATURE);
+ assertEquals(Test.MATCH, apparentTemperatureHigh, Test.GENERAL_TEMPERATURE);
+ assertEquals(Test.MATCH, weatherSummary, Test.GENERAL_STRING);
+ assertEquals(Test.MATCH, time, Test.GENERAL_DATETIME);
+ assertEquals(Test.MATCH, humidity, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, cloudCover, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, moonPhase, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, windBearing, Test.GENERAL_INTEGER);
+ assertEquals(Test.MATCH, windGust, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, windSpeed, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, nearestStormBearing, Test.GENERAL_INTEGER);
+ assertEquals(Test.MATCH, nearestStormDistance, Test.GENERAL_INTEGER);
+ assertEquals(Test.MATCH, precipAccumulation, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, precipIntensity, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, precipProbability, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, precipType, Test.GENERAL_STRING);
+ assertEquals(Test.MATCH, visibility, Test.GENERAL_FLOAT);
+ assertEquals(Test.MATCH, weatherIcon, Test.GENERAL_IMAGE);
+
+ // Invalid/Null Tests
+ WeatherData msg = new WeatherData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getCurrentTemperature());
+ assertNull(Test.NULL, msg.getTemperatureHigh());
+ assertNull(Test.NULL, msg.getTemperatureLow());
+ assertNull(Test.NULL, msg.getApparentTemperature());
+ assertNull(Test.NULL, msg.getApparentTemperatureHigh());
+ assertNull(Test.NULL, msg.getApparentTemperatureLow());
+ assertNull(Test.NULL, msg.getWeatherSummary());
+ assertNull(Test.NULL, msg.getTime());
+ assertNull(Test.NULL, msg.getHumidity());
+ assertNull(Test.NULL, msg.getCloudCover());
+ assertNull(Test.NULL, msg.getMoonPhase());
+ assertNull(Test.NULL, msg.getWindBearing());
+ assertNull(Test.NULL, msg.getWindGust());
+ assertNull(Test.NULL, msg.getWindSpeed());
+ assertNull(Test.NULL, msg.getNearestStormBearing());
+ assertNull(Test.NULL, msg.getNearestStormDistance());
+ assertNull(Test.NULL, msg.getPrecipAccumulation());
+ assertNull(Test.NULL, msg.getPrecipIntensity());
+ assertNull(Test.NULL, msg.getPrecipProbability());
+ assertNull(Test.NULL, msg.getPrecipType());
+ assertNull(Test.NULL, msg.getVisibility());
+ assertNull(Test.NULL, msg.getWeatherIcon());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(WeatherData.KEY_CURRENT_TEMPERATURE, Test.GENERAL_TEMPERATURE);
+ reference.put(WeatherData.KEY_TEMPERATURE_HIGH, Test.GENERAL_TEMPERATURE);
+ reference.put(WeatherData.KEY_TEMPERATURE_LOW, Test.GENERAL_TEMPERATURE);
+ reference.put(WeatherData.KEY_APPARENT_TEMPERATURE, Test.GENERAL_TEMPERATURE);
+ reference.put(WeatherData.KEY_APPARENT_TEMPERATURE_HIGH, Test.GENERAL_TEMPERATURE);
+ reference.put(WeatherData.KEY_APPARENT_TEMPERATURE_LOW, Test.GENERAL_TEMPERATURE);
+ reference.put(WeatherData.KEY_WEATHER_SUMMARY, Test.GENERAL_STRING);
+ reference.put(WeatherData.KEY_TIME, Test.GENERAL_DATETIME);
+ reference.put(WeatherData.KEY_HUMIDITY, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_CLOUD_COVER, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_MOON_PHASE, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_WIND_BEARING, Test.GENERAL_INTEGER);
+ reference.put(WeatherData.KEY_WIND_GUST, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_WIND_SPEED, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_NEAREST_STORM_BEARING, Test.GENERAL_INTEGER);
+ reference.put(WeatherData.KEY_NEAREST_STORM_DISTANCE, Test.GENERAL_INTEGER);
+ reference.put(WeatherData.KEY_PRECIP_ACCUMULATION, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_PRECIP_INTENSITY, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_PRECIP_PROBABILITY, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_PRECIP_TYPE, Test.GENERAL_STRING);
+ reference.put(WeatherData.KEY_VISIBILITY, Test.GENERAL_FLOAT);
+ reference.put(WeatherData.KEY_WEATHER_ICON, 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(WeatherData.KEY_CURRENT_TEMPERATURE) || key.equals(WeatherData.KEY_TEMPERATURE_HIGH)||
+ key.equals(WeatherData.KEY_TEMPERATURE_LOW) || key.equals(WeatherData.KEY_APPARENT_TEMPERATURE)||
+ key.equals(WeatherData.KEY_APPARENT_TEMPERATURE_HIGH) || key.equals(WeatherData.KEY_APPARENT_TEMPERATURE_LOW)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateTemperature(Test.GENERAL_TEMPERATURE, new Temperature(hashTest)));
+ } else if (key.equals(WeatherData.KEY_TIME)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(hashTest)));
+ } else if (key.equals(WeatherData.KEY_WEATHER_ICON)){
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, new Image(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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java
new file mode 100644
index 000000000..09c976538
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java
@@ -0,0 +1,142 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.LocationDetails;
+import com.smartdevicelink.proxy.rpc.WeatherAlert;
+import com.smartdevicelink.proxy.rpc.WeatherData;
+import com.smartdevicelink.proxy.rpc.WeatherServiceData;
+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.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.WeatherServiceData}
+ */
+public class WeatherServiceDataTests extends TestCase {
+
+ private WeatherServiceData msg;
+
+ @Override
+ public void setUp(){
+
+ msg = new WeatherServiceData();
+ msg.setLocation(Test.GENERAL_LOCATIONDETAILS);
+ msg.setCurrentForecast(Test.GENERAL_WEATHERDATA);
+ msg.setMinuteForecast(Test.GENERAL_WEATHERDATA_LIST);
+ msg.setHourlyForecast(Test.GENERAL_WEATHERDATA_LIST);
+ msg.setMultidayForecast(Test.GENERAL_WEATHERDATA_LIST);
+ msg.setAlerts(Test.GENERAL_WEATHERALERT_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ LocationDetails location = msg.getLocation();
+ WeatherData currentForecast = msg.getCurrentForecast();
+ List<WeatherData> minuteForecast = msg.getMinuteForecast();
+ List<WeatherData> hourlyForecast = msg.getHourlyForecast();
+ List<WeatherData> multidayForecast = msg.getMultidayForecast();
+ List<WeatherAlert> alerts = msg.getAlerts();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_LOCATIONDETAILS, location);
+ assertEquals(Test.GENERAL_WEATHERDATA, currentForecast);
+ assertEquals(Test.GENERAL_WEATHERDATA_LIST, minuteForecast);
+ assertEquals(Test.GENERAL_WEATHERDATA_LIST, hourlyForecast);
+ assertEquals(Test.GENERAL_WEATHERDATA_LIST, multidayForecast);
+ assertEquals(Test.GENERAL_WEATHERALERT_LIST, alerts);
+
+ // Invalid/Null Tests
+ WeatherServiceData msg = new WeatherServiceData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getLocation());
+ assertNull(Test.NULL, msg.getCurrentForecast());
+ assertNull(Test.NULL, msg.getMinuteForecast());
+ assertNull(Test.NULL, msg.getHourlyForecast());
+ assertNull(Test.NULL, msg.getMultidayForecast());
+ assertNull(Test.NULL, msg.getAlerts());
+ }
+
+ public void testRequiredParamsConstructor(){
+ msg = new WeatherServiceData(Test.GENERAL_LOCATIONDETAILS);
+ LocationDetails location = msg.getLocation();
+ assertEquals(Test.GENERAL_LOCATIONDETAILS, location);
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(WeatherServiceData.KEY_LOCATION, Test.GENERAL_LOCATIONDETAILS);
+ reference.put(WeatherServiceData.KEY_CURRENT_FORECAST, Test.GENERAL_WEATHERDATA);
+ reference.put(WeatherServiceData.KEY_MINUTE_FORECAST, Test.GENERAL_WEATHERDATA_LIST);
+ reference.put(WeatherServiceData.KEY_HOURLY_FORECAST, Test.GENERAL_WEATHERDATA_LIST);
+ reference.put(WeatherServiceData.KEY_MULTIDAY_FORECAST, Test.GENERAL_WEATHERDATA_LIST);
+ reference.put(WeatherServiceData.KEY_ALERTS, Test.GENERAL_WEATHERALERT_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(WeatherServiceData.KEY_LOCATION)){
+
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateLocationDetails( Test.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest)));
+
+ } else if(key.equals(WeatherServiceData.KEY_CURRENT_FORECAST)){
+
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateWeatherData( Test.GENERAL_WEATHERDATA, new WeatherData(hashTest)));
+
+ } else if(key.equals(WeatherServiceData.KEY_MINUTE_FORECAST) || key.equals(WeatherServiceData.KEY_HOURLY_FORECAST)
+ || key.equals(WeatherServiceData.KEY_MULTIDAY_FORECAST)){
+
+ JSONArray weatherDataArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ List<WeatherData> weatherDataUnderTestList = new ArrayList<>();
+ for (int index = 0; index < weatherDataArrayObjTest.length(); index++) {
+ WeatherData weatherData1 = new WeatherData(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)weatherDataArrayObjTest.get(index) ));
+ weatherDataUnderTestList.add(weatherData1);
+ }
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateWeatherDataList(Test.GENERAL_WEATHERDATA_LIST, weatherDataUnderTestList));
+
+ } else if(key.equals(WeatherServiceData.KEY_ALERTS)){
+
+ JSONArray weatherAlertArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ List<WeatherAlert> weatherAlertUnderTestList = new ArrayList<>();
+ for (int index = 0; index < weatherAlertArrayObjTest.length(); index++) {
+ WeatherAlert weatherAlert1 = new WeatherAlert(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)weatherAlertArrayObjTest.get(index) ));
+ weatherAlertUnderTestList.add(weatherAlert1);
+ }
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateWeatherAlertList(Test.GENERAL_WEATHERALERT_LIST, weatherAlertUnderTestList));
+ }
+ }
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceManifestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceManifestTests.java
new file mode 100644
index 000000000..cbd65fae7
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceManifestTests.java
@@ -0,0 +1,84 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.WeatherServiceManifest;
+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.proxy.rpc.WeatherServiceManifest}
+ */
+public class WeatherServiceManifestTests extends TestCase {
+
+ private WeatherServiceManifest msg;
+
+ @Override
+ public void setUp(){
+ msg = new WeatherServiceManifest();
+
+ msg.setCurrentForecastSupported(Test.GENERAL_BOOLEAN);
+ msg.setMaxHourlyForecastAmount(Test.GENERAL_INT);
+ msg.setMaxMinutelyForecastAmount(Test.GENERAL_INT);
+ msg.setMaxMultidayForecastAmount(Test.GENERAL_INT);
+ msg.setWeatherForLocationSupported(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean currentForecastSupported = msg.getCurrentForecastSupported();
+ boolean weatherForLocationSupported = msg.getWeatherForLocationSupported();
+ Integer getMaxHourlyForecastAmt = msg.getMaxHourlyForecastAmount();
+ Integer getMaxMinutelyForecastAmt = msg.getMaxMinutelyForecastAmount();
+ Integer getMaxMultidayForecastAmt = msg.getMaxMultidayForecastAmount();
+
+ // Valid Tests
+ assertEquals(Test.GENERAL_BOOLEAN, currentForecastSupported);
+ assertEquals(Test.GENERAL_BOOLEAN, weatherForLocationSupported);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER, getMaxHourlyForecastAmt);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER, getMaxMinutelyForecastAmt);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER, getMaxMultidayForecastAmt);
+
+ // Invalid/Null Tests
+ WeatherServiceManifest msg = new WeatherServiceManifest();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getCurrentForecastSupported());
+ assertNull(Test.NULL, msg.getWeatherForLocationSupported());
+ assertNull(Test.NULL, msg.getMaxHourlyForecastAmount());
+ assertNull(Test.NULL, msg.getMaxMinutelyForecastAmount());
+ assertNull(Test.NULL, msg.getMaxMultidayForecastAmount());
+ }
+
+ public void testJson(){
+ JSONObject reference = new JSONObject();
+
+ try{
+ reference.put(WeatherServiceManifest.KEY_CURRENT_FORECAST_SUPPORTED, Test.GENERAL_BOOLEAN);
+ reference.put(WeatherServiceManifest.KEY_WEATHER_FOR_LOCATION_SUPPORTED, Test.GENERAL_BOOLEAN);
+ reference.put(WeatherServiceManifest.KEY_MAX_HOURLY_FORECAST_AMOUNT, Test.GENERAL_INTEGER);
+ reference.put(WeatherServiceManifest.KEY_MAX_MINUTELY_FORECAST_AMOUNT, Test.GENERAL_INTEGER);
+ reference.put(WeatherServiceManifest.KEY_MAX_MULTIDAY_FORECAST_AMOUNT, Test.GENERAL_INTEGER);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AmbientLightStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AmbientLightStatusTests.java
new file mode 100644
index 000000000..5aa9a5c10
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AmbientLightStatusTests.java
@@ -0,0 +1,97 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
+
+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.AmbientLightStatus}
+ */
+public class AmbientLightStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+
+ String example = "DAY";
+ AmbientLightStatus enumDay = AmbientLightStatus.valueForString(example);
+ example = "NIGHT";
+ AmbientLightStatus enumNight = AmbientLightStatus.valueForString(example);
+ example = "UNKNOWN";
+ AmbientLightStatus enumUnknown = AmbientLightStatus.valueForString(example);
+ example = "INVALID";
+ AmbientLightStatus enumInvalid = AmbientLightStatus.valueForString(example);
+ example = "TWILIGHT_1";
+ AmbientLightStatus enumTwilight1 = AmbientLightStatus.valueForString(example);
+ example = "TWILIGHT_2";
+ AmbientLightStatus enumTwilight2 = AmbientLightStatus.valueForString(example);
+ example = "TWILIGHT_3";
+ AmbientLightStatus enumTwilight3 = AmbientLightStatus.valueForString(example);
+ example = "TWILIGHT_4";
+ AmbientLightStatus enumTwilight4 = AmbientLightStatus.valueForString(example);
+
+ assertNotNull("DAY returned null", enumDay);
+ assertNotNull("NIGHT returned null", enumNight);
+ assertNotNull("UNKNOWN returned null", enumUnknown);
+ assertNotNull("INVALID returned null", enumInvalid);
+ assertNotNull("TWILIGHT_1 returned null", enumTwilight1);
+ assertNotNull("TWILIGHT_2 returned null", enumTwilight2);
+ assertNotNull("TWILIGHT_3 returned null", enumTwilight3);
+ assertNotNull("TWILIGHT_4 returned null", enumTwilight4);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "niGHt";
+ try {
+ AmbientLightStatus temp = AmbientLightStatus.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 {
+ AmbientLightStatus temp = AmbientLightStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of AmbientLightStatus.
+ */
+ public void testListEnum() {
+ List<AmbientLightStatus> enumValueList = Arrays.asList(AmbientLightStatus.values());
+ List<AmbientLightStatus> enumTestList = new ArrayList<AmbientLightStatus>();
+
+ enumTestList.add(AmbientLightStatus.DAY);
+ enumTestList.add(AmbientLightStatus.NIGHT);
+ enumTestList.add(AmbientLightStatus.UNKNOWN);
+ enumTestList.add(AmbientLightStatus.INVALID);
+ enumTestList.add(AmbientLightStatus.TWILIGHT_1);
+ enumTestList.add(AmbientLightStatus.TWILIGHT_2);
+ enumTestList.add(AmbientLightStatus.TWILIGHT_3);
+ enumTestList.add(AmbientLightStatus.TWILIGHT_4);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java
new file mode 100644
index 000000000..85c74e8e4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java
@@ -0,0 +1,111 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+
+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.AppHMIType}
+ */
+public class AppHmiTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "DEFAULT";
+ AppHMIType enumDefault = AppHMIType.valueForString(example);
+ example = "COMMUNICATION";
+ AppHMIType enumCommunication = AppHMIType.valueForString(example);
+ example = "MEDIA";
+ AppHMIType enumMedia = AppHMIType.valueForString(example);
+ example = "MESSAGING";
+ AppHMIType enumMessaging = AppHMIType.valueForString(example);
+ example = "NAVIGATION";
+ AppHMIType enumNavigation = AppHMIType.valueForString(example);
+ example = "INFORMATION";
+ AppHMIType enumInformation = AppHMIType.valueForString(example);
+ example = "SOCIAL";
+ AppHMIType enumSocial = AppHMIType.valueForString(example);
+ example = "BACKGROUND_PROCESS";
+ AppHMIType enumBackgroundProcess = AppHMIType.valueForString(example);
+ example = "PROJECTION";
+ AppHMIType enumProjection = AppHMIType.valueForString(example);
+ example = "TESTING";
+ AppHMIType enumTesting = AppHMIType.valueForString(example);
+ example = "SYSTEM";
+ AppHMIType enumSystem = AppHMIType.valueForString(example);
+ example = "REMOTE_CONTROL";
+ AppHMIType enumRemoteControl = AppHMIType.valueForString(example);
+
+ assertNotNull("DEFAULT returned null", enumDefault);
+ assertNotNull("COMMUNICATION returned null", enumCommunication);
+ assertNotNull("MEDIA returned null", enumMedia);
+ assertNotNull("MESSAGING returned null", enumMessaging);
+ assertNotNull("NAVIGATION returned null", enumNavigation);
+ assertNotNull("INFORMATION returned null", enumInformation);
+ assertNotNull("SOCIAL returned null", enumSocial);
+ assertNotNull("BACKGROUND_PROCESS returned null", enumBackgroundProcess);
+ assertNotNull("PROJECTION returned null", enumProjection);
+ assertNotNull("TESTING returned null", enumTesting);
+ assertNotNull("SYSTEM returned null", enumSystem);
+ assertNotNull("REMOTE_CONTROL returned null", enumRemoteControl);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "deFaUlt";
+ try {
+ AppHMIType temp = AppHMIType.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 {
+ AppHMIType temp = AppHMIType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of AmbientLightStatus.
+ */
+ public void testListEnum() {
+ List<AppHMIType> enumValueList = Arrays.asList(AppHMIType.values());
+
+ List<AppHMIType> enumTestList = new ArrayList<AppHMIType>();
+ enumTestList.add(AppHMIType.DEFAULT);
+ enumTestList.add(AppHMIType.COMMUNICATION);
+ enumTestList.add(AppHMIType.MEDIA);
+ enumTestList.add(AppHMIType.MESSAGING);
+ enumTestList.add(AppHMIType.NAVIGATION);
+ enumTestList.add(AppHMIType.INFORMATION);
+ enumTestList.add(AppHMIType.SOCIAL);
+ enumTestList.add(AppHMIType.BACKGROUND_PROCESS);
+ enumTestList.add(AppHMIType.PROJECTION);
+ enumTestList.add(AppHMIType.TESTING);
+ enumTestList.add(AppHMIType.SYSTEM);
+ enumTestList.add(AppHMIType.REMOTE_CONTROL);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java
new file mode 100644
index 000000000..cdc7375df
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java
@@ -0,0 +1,111 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
+
+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.AppInterfaceUregisteredReason}
+ */
+public class AppInterfaceUnregisteredReasonTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "USER_EXIT";
+ AppInterfaceUnregisteredReason enumUserExit = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "IGNITION_OFF";
+ AppInterfaceUnregisteredReason enumIgnitionOff = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "BLUETOOTH_OFF";
+ AppInterfaceUnregisteredReason enumBluetoothOff = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "USB_DISCONNECTED";
+ AppInterfaceUnregisteredReason enumUsbDisconnected = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "REQUEST_WHILE_IN_NONE_HMI_LEVEL";
+ AppInterfaceUnregisteredReason enumRequestWhileInNoneHmiLevel = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "TOO_MANY_REQUESTS";
+ AppInterfaceUnregisteredReason enumTooManyRequests = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "DRIVER_DISTRACTION_VIOLATION";
+ AppInterfaceUnregisteredReason enumDriverDistractionViolation = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "LANGUAGE_CHANGE";
+ AppInterfaceUnregisteredReason enumLanguageChange = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "MASTER_RESET";
+ AppInterfaceUnregisteredReason enumMasterReset = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "FACTORY_DEFAULTS";
+ AppInterfaceUnregisteredReason enumFactoryDefaults = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "APP_UNAUTHORIZED";
+ AppInterfaceUnregisteredReason enumAppAuthorized = AppInterfaceUnregisteredReason.valueForString(example);
+ example = "PROTOCOL_VIOLATION";
+ AppInterfaceUnregisteredReason enumProtocolViolation = AppInterfaceUnregisteredReason.valueForString(example);
+
+ assertNotNull("USER_EXIT returned null", enumUserExit);
+ assertNotNull("IGNITION_OFF returned null", enumIgnitionOff);
+ assertNotNull("BLUETOOTH_OFF returned null", enumBluetoothOff);
+ assertNotNull("USB_DISCONNECTED returned null", enumUsbDisconnected);
+ assertNotNull("REQUEST_WHILE_IN_NONE_HMI_LEVEL returned null", enumRequestWhileInNoneHmiLevel);
+ assertNotNull("TOO_MANY_REQUESTS returned null", enumTooManyRequests);
+ assertNotNull("DRIVER_DISTRACTION_VIOLATION returned null", enumDriverDistractionViolation);
+ assertNotNull("LANGUAGE_CHANGE returned null", enumLanguageChange);
+ assertNotNull("MASTER_RESET returned null", enumMasterReset);
+ assertNotNull("FACTORY_DEFAULTS returned null", enumFactoryDefaults);
+ assertNotNull("APP_UNAUTHORIZED returned null", enumAppAuthorized);
+ assertNotNull("PROTOCOL_VIOLATION returned null", enumProtocolViolation);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "uSer_ExiT";
+ try {
+ AppInterfaceUnregisteredReason temp = AppInterfaceUnregisteredReason.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 {
+ AppInterfaceUnregisteredReason temp = AppInterfaceUnregisteredReason.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of AppInterfaceUnregisteredReason.
+ */
+ public void testListEnum() {
+ List<AppInterfaceUnregisteredReason> enumValueList = Arrays.asList(AppInterfaceUnregisteredReason.values());
+
+ List<AppInterfaceUnregisteredReason> enumTestList = new ArrayList<AppInterfaceUnregisteredReason>();
+ enumTestList.add(AppInterfaceUnregisteredReason.USER_EXIT);
+ enumTestList.add(AppInterfaceUnregisteredReason.IGNITION_OFF);
+ enumTestList.add(AppInterfaceUnregisteredReason.BLUETOOTH_OFF);
+ enumTestList.add(AppInterfaceUnregisteredReason.USB_DISCONNECTED);
+ enumTestList.add(AppInterfaceUnregisteredReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL);
+ enumTestList.add(AppInterfaceUnregisteredReason.TOO_MANY_REQUESTS);
+ enumTestList.add(AppInterfaceUnregisteredReason.DRIVER_DISTRACTION_VIOLATION);
+ enumTestList.add(AppInterfaceUnregisteredReason.LANGUAGE_CHANGE);
+ enumTestList.add(AppInterfaceUnregisteredReason.MASTER_RESET);
+ enumTestList.add(AppInterfaceUnregisteredReason.FACTORY_DEFAULTS);
+ enumTestList.add(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED);
+ enumTestList.add(AppInterfaceUnregisteredReason.PROTOCOL_VIOLATION);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppServiceTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppServiceTypeTests.java
new file mode 100644
index 000000000..ce4867e41
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppServiceTypeTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+
+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.AppServiceType}
+ */
+public class AppServiceTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "MEDIA";
+ AppServiceType enumMedia = AppServiceType.valueForString(example);
+ example = "WEATHER";
+ AppServiceType enumWeather = AppServiceType.valueForString(example);
+ example = "NAVIGATION";
+ AppServiceType enumNavigation = AppServiceType.valueForString(example);
+
+ assertNotNull("MEDIA returned null", enumMedia);
+ assertNotNull("WEATHER returned null", enumWeather);
+ assertNotNull("NAVIGATION returned null", enumNavigation);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "MedIas";
+ try {
+ AppServiceType temp = AppServiceType.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 {
+ AppServiceType temp = AppServiceType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of AppServiceType.
+ */
+ public void testListEnum() {
+ List<AppServiceType> enumValueList = Arrays.asList(AppServiceType.values());
+
+ List<AppServiceType> enumTestList = new ArrayList<>();
+ enumTestList.add(AppServiceType.MEDIA);
+ enumTestList.add(AppServiceType.NAVIGATION);
+ enumTestList.add(AppServiceType.WEATHER);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingIndicatorTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingIndicatorTests.java
new file mode 100644
index 000000000..0d7f17c76
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingIndicatorTests.java
@@ -0,0 +1,80 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator;
+
+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.AudioStreamingIndicator}
+ */
+public class AudioStreamingIndicatorTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "PLAY_PAUSE";
+ AudioStreamingIndicator enumPlayPause = AudioStreamingIndicator.valueForString(example);
+ example = "PLAY";
+ AudioStreamingIndicator enumPlay = AudioStreamingIndicator.valueForString(example);
+ example = "PAUSE";
+ AudioStreamingIndicator enumPause = AudioStreamingIndicator.valueForString(example);
+ example = "STOP";
+ AudioStreamingIndicator enumStop = AudioStreamingIndicator.valueForString(example);
+
+
+ assertNotNull("PLAY_PAUSE returned null", enumPlayPause);
+ assertNotNull("PLAY returned null", enumPlay);
+ assertNotNull("PAUSE returned null", enumPause);
+ assertNotNull("STOP returned null", enumStop);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "pLayPauZe";
+ try {
+ AudioStreamingIndicator temp = AudioStreamingIndicator.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 {
+ AudioStreamingIndicator temp = AudioStreamingIndicator.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of AudioStreamingIndicator.
+ */
+ public void testListEnum() {
+ List<AudioStreamingIndicator> enumValueList = Arrays.asList(AudioStreamingIndicator.values());
+
+ List<AudioStreamingIndicator> enumTestList = new ArrayList<>();
+ enumTestList.add(AudioStreamingIndicator.PLAY_PAUSE);
+ enumTestList.add(AudioStreamingIndicator.PLAY);
+ enumTestList.add(AudioStreamingIndicator.PAUSE);
+ enumTestList.add(AudioStreamingIndicator.STOP);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingStateTests.java
new file mode 100644
index 000000000..cf9cd87d4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingStateTests.java
@@ -0,0 +1,76 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
+
+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.AudioStreamingState}
+ */
+public class AudioStreamingStateTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "AUDIBLE";
+ AudioStreamingState enumAudible = AudioStreamingState.valueForString(example);
+ example = "ATTENUATED";
+ AudioStreamingState enumAttentuated = AudioStreamingState.valueForString(example);
+ example = "NOT_AUDIBLE";
+ AudioStreamingState enumNotAudible = AudioStreamingState.valueForString(example);
+
+
+ assertNotNull("AUDIBLE returned null", enumAudible);
+ assertNotNull("ATTENUATED returned null", enumAttentuated);
+ assertNotNull("NOT_AUDIBLE returned null", enumNotAudible);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "aUDibLE";
+ try {
+ AudioStreamingState temp = AudioStreamingState.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 {
+ AudioStreamingState temp = AudioStreamingState.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of AudioStreamingState.
+ */
+ public void testListEnum() {
+ List<AudioStreamingState> enumValueList = Arrays.asList(AudioStreamingState.values());
+
+ List<AudioStreamingState> enumTestList = new ArrayList<AudioStreamingState>();
+ enumTestList.add(AudioStreamingState.AUDIBLE);
+ enumTestList.add(AudioStreamingState.ATTENUATED);
+ enumTestList.add(AudioStreamingState.NOT_AUDIBLE);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioTypeTests.java
new file mode 100644
index 000000000..ef3a59bb4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioTypeTests.java
@@ -0,0 +1,68 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+
+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.AudioType}
+ */
+public class AudioTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "PCM";
+ AudioType enumPcm = AudioType.valueForString(example);
+
+ assertNotNull("PCM returned null", enumPcm);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "pCM";
+ try {
+ AudioType temp = AudioType.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 {
+ AudioType temp = AudioType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+
+ /**
+ * Verifies the possible enum values of AudioType.
+ */
+ public void testListEnum() {
+ List<AudioType> enumValueList = Arrays.asList(AudioType.values());
+
+ List<AudioType> enumTestList = new ArrayList<AudioType>();
+ enumTestList.add(AudioType.PCM);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/BitsPerSampleTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/BitsPerSampleTests.java
new file mode 100644
index 000000000..239295cea
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/BitsPerSampleTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+
+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.BitsPerSample}
+ */
+public class BitsPerSampleTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "8_BIT";
+ BitsPerSample enum8Bit = BitsPerSample.valueForString(example);
+ example = "16_BIT";
+ BitsPerSample enum16Bit = BitsPerSample.valueForString(example);
+
+ assertNotNull("8_BIT returned null", enum8Bit);
+ assertNotNull("16_BIT returned null", enum16Bit);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "8_biT";
+ try {
+ BitsPerSample temp = BitsPerSample.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 {
+ BitsPerSample temp = BitsPerSample.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of BitsPerSample.
+ */
+ public void testListEnum() {
+ List<BitsPerSample> enumValueList = Arrays.asList(BitsPerSample.values());
+
+ List<BitsPerSample> enumTestList = new ArrayList<BitsPerSample>();
+ enumTestList.add(BitsPerSample._8_BIT);
+ enumTestList.add(BitsPerSample._16_BIT);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonEventModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonEventModeTests.java
new file mode 100644
index 000000000..41e94e943
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonEventModeTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode;
+
+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.ButtonEventMode}
+ */
+public class ButtonEventModeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "BUTTONUP";
+ ButtonEventMode enumButtonUp = ButtonEventMode.valueForString(example);
+ example = "BUTTONDOWN";
+ ButtonEventMode enumButtonDown = ButtonEventMode.valueForString(example);
+
+ assertNotNull("BUTTONUP returned null", enumButtonUp);
+ assertNotNull("BUTTONDOWN returned null", enumButtonDown);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "buTTonUp";
+ try {
+ ButtonEventMode temp = ButtonEventMode.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 {
+ ButtonEventMode temp = ButtonEventMode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of ButtonEventMode.
+ */
+ public void testListEnum() {
+ List<ButtonEventMode> enumValueList = Arrays.asList(ButtonEventMode.values());
+
+ List<ButtonEventMode> enumTestList = new ArrayList<ButtonEventMode>();
+ enumTestList.add(ButtonEventMode.BUTTONUP);
+ enumTestList.add(ButtonEventMode.BUTTONDOWN);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonNameTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonNameTests.java
new file mode 100644
index 000000000..5562749ad
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonNameTests.java
@@ -0,0 +1,242 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+
+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.ButtonName}
+ */
+public class ButtonNameTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "OK";
+ ButtonName enumOk = ButtonName.valueForString(example);
+ example = "SEEKLEFT";
+ ButtonName enumSeekLeft = ButtonName.valueForString(example);
+ example = "SEEKRIGHT";
+ ButtonName enumSeekRight = ButtonName.valueForString(example);
+ example = "TUNEUP";
+ ButtonName enumTuneUp = ButtonName.valueForString(example);
+ example = "TUNEDOWN";
+ ButtonName enumTuneDown = ButtonName.valueForString(example);
+ example = "PRESET_0";
+ ButtonName enumPreset0 = ButtonName.valueForString(example);
+ example = "PRESET_1";
+ ButtonName enumPreset1 = ButtonName.valueForString(example);
+ example = "PRESET_2";
+ ButtonName enumPreset2 = ButtonName.valueForString(example);
+ example = "PRESET_3";
+ ButtonName enumPreset3 = ButtonName.valueForString(example);
+ example = "PRESET_4";
+ ButtonName enumPreset4 = ButtonName.valueForString(example);
+ example = "PRESET_5";
+ ButtonName enumPreset5 = ButtonName.valueForString(example);
+ example = "PRESET_6";
+ ButtonName enumPreset6 = ButtonName.valueForString(example);
+ example = "PRESET_7";
+ ButtonName enumPreset7 = ButtonName.valueForString(example);
+ example = "PRESET_8";
+ ButtonName enumPreset8 = ButtonName.valueForString(example);
+ example = "PRESET_9";
+ ButtonName enumPreset9 = ButtonName.valueForString(example);
+ example = "CUSTOM_BUTTON";
+ ButtonName enumCustomButton = ButtonName.valueForString(example);
+ example = "SEARCH";
+ ButtonName enumSearch = ButtonName.valueForString(example);
+ example = "AC_MAX";
+ ButtonName enumAcMax = ButtonName.valueForString(example);
+ example = "AC";
+ ButtonName enumAc = ButtonName.valueForString(example);
+ example = "RECIRCULATE";
+ ButtonName enumRecirculate = ButtonName.valueForString(example);
+ example = "FAN_UP";
+ ButtonName enumFanUp = ButtonName.valueForString(example);
+ example = "FAN_DOWN";
+ ButtonName enumFanDown = ButtonName.valueForString(example);
+ example = "TEMP_UP";
+ ButtonName enumTempUp = ButtonName.valueForString(example);
+ example = "TEMP_DOWN";
+ ButtonName enumTempDown = ButtonName.valueForString(example);
+ example = "DEFROST_MAX";
+ ButtonName enumDefrostMax = ButtonName.valueForString(example);
+ example = "DEFROST";
+ ButtonName enumDefrost = ButtonName.valueForString(example);
+ example = "DEFROST_REAR";
+ ButtonName enumDefrostRear = ButtonName.valueForString(example);
+ example = "UPPER_VENT";
+ ButtonName enumUpperVent = ButtonName.valueForString(example);
+ example = "LOWER_VENT";
+ ButtonName enumLowerVent = ButtonName.valueForString(example);
+ example = "VOLUME_UP";
+ ButtonName enumVolumeUp = ButtonName.valueForString(example);
+ example = "VOLUME_DOWN";
+ ButtonName enumVolumeDown = ButtonName.valueForString(example);
+ example = "EJECT";
+ ButtonName enumEject = ButtonName.valueForString(example);
+ example = "SOURCE";
+ ButtonName enumSource = ButtonName.valueForString(example);
+ example = "SHUFFLE";
+ ButtonName enumShuffle = ButtonName.valueForString(example);
+ example = "REPEAT";
+ ButtonName enumRepeat = ButtonName.valueForString(example);
+
+
+
+ assertNotNull("OK returned null", enumOk);
+ assertNotNull("SEEKLEFT returned null", enumSeekLeft);
+ assertNotNull("SEEKRIGHT returned null", enumSeekRight);
+ assertNotNull("TUNEUP returned null", enumTuneUp);
+ assertNotNull("TUNEDOWN returned null", enumTuneDown);
+ assertNotNull("PRESET_0 returned null", enumPreset0);
+ assertNotNull("PRESET_1 returned null", enumPreset1);
+ assertNotNull("PRESET_2 returned null", enumPreset2);
+ assertNotNull("PRESET_3 returned null", enumPreset3);
+ assertNotNull("PRESET_4 returned null", enumPreset4);
+ assertNotNull("PRESET_5 returned null", enumPreset5);
+ assertNotNull("PRESET_6 returned null", enumPreset6);
+ assertNotNull("PRESET_7 returned null", enumPreset7);
+ assertNotNull("PRESET_8 returned null", enumPreset8);
+ assertNotNull("PRESET_9 returned null", enumPreset9);
+ assertNotNull("CUSTOM_BUTTON returned null", enumCustomButton);
+ assertNotNull("SEARCH returned null", enumSearch);
+ assertNotNull("AC_MAX returned null", enumAcMax);
+ assertNotNull("AC returned null", enumAc);
+ assertNotNull("RECIRCULATE returned null", enumRecirculate);
+ assertNotNull("FAN_UP returned null", enumFanUp);
+ assertNotNull("FAN_DOWN returned null", enumFanDown);
+ assertNotNull("TEMP_UP returned null", enumTempUp);
+ assertNotNull("TEMP_DOWN returned null", enumTempDown);
+ assertNotNull("DEFROST_MAX returned null", enumDefrostMax);
+ assertNotNull("DEFROST returned null", enumDefrost);
+ assertNotNull("DEFROST_REAR returned null", enumDefrostRear);
+ assertNotNull("UPPER_VENT returned null", enumUpperVent);
+ assertNotNull("LOWER_VENT returned null", enumLowerVent);
+ assertNotNull("VOLUME_UP returned null", enumVolumeUp);
+ assertNotNull("VOLUME_DOWN returned null", enumVolumeDown);
+ assertNotNull("EJECT returned null", enumEject);
+ assertNotNull("SOURCE returned null", enumSource);
+ assertNotNull("SHUFFLE returned null", enumShuffle);
+ assertNotNull("REPEAT returned null", enumRepeat);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "oK";
+ try {
+ ButtonName temp = ButtonName.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 {
+ ButtonName temp = ButtonName.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of ButtonName.
+ */
+ public void testListEnum() {
+ List<ButtonName> enumValueList = Arrays.asList(ButtonName.values());
+
+ List<ButtonName> enumTestList = new ArrayList<ButtonName>();
+
+ enumTestList.add(ButtonName.OK);
+ enumTestList.add(ButtonName.SEEKLEFT);
+ enumTestList.add(ButtonName.SEEKRIGHT);
+ enumTestList.add(ButtonName.TUNEUP);
+ enumTestList.add(ButtonName.TUNEDOWN);
+ enumTestList.add(ButtonName.PRESET_0);
+ enumTestList.add(ButtonName.PRESET_1);
+ enumTestList.add(ButtonName.PRESET_2);
+ enumTestList.add(ButtonName.PRESET_3);
+ enumTestList.add(ButtonName.PRESET_4);
+ enumTestList.add(ButtonName.PRESET_5);
+ enumTestList.add(ButtonName.PRESET_6);
+ enumTestList.add(ButtonName.PRESET_7);
+ enumTestList.add(ButtonName.PRESET_8);
+ enumTestList.add(ButtonName.PRESET_9);
+ enumTestList.add(ButtonName.CUSTOM_BUTTON);
+ enumTestList.add(ButtonName.SEARCH);
+ enumTestList.add(ButtonName.AC_MAX);
+ enumTestList.add(ButtonName.AC);
+ enumTestList.add(ButtonName.RECIRCULATE);
+ enumTestList.add(ButtonName.FAN_UP);
+ enumTestList.add(ButtonName.FAN_DOWN);
+ enumTestList.add(ButtonName.TEMP_UP);
+ enumTestList.add(ButtonName.TEMP_DOWN);
+ enumTestList.add(ButtonName.DEFROST_MAX);
+ enumTestList.add(ButtonName.DEFROST);
+ enumTestList.add(ButtonName.DEFROST_REAR);
+ enumTestList.add(ButtonName.UPPER_VENT);
+ enumTestList.add(ButtonName.LOWER_VENT);
+ enumTestList.add(ButtonName.VOLUME_UP);
+ enumTestList.add(ButtonName.VOLUME_DOWN);
+ enumTestList.add(ButtonName.EJECT);
+ enumTestList.add(ButtonName.SOURCE);
+ enumTestList.add(ButtonName.SHUFFLE);
+ enumTestList.add(ButtonName.REPEAT);
+ enumTestList.add(ButtonName.PLAY_PAUSE);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+
+
+ /**
+ * Tests the preset numeric order.
+ */
+ public void testPresetIndeces () {
+ ButtonName[] inputPresetArray = new ButtonName[] {
+ ButtonName.PRESET_0, ButtonName.PRESET_1, ButtonName.PRESET_2, ButtonName.PRESET_3, ButtonName.PRESET_4,
+ ButtonName.PRESET_5, ButtonName.PRESET_6, ButtonName.PRESET_7, ButtonName.PRESET_8, ButtonName.PRESET_9,
+ ButtonName.OK};
+
+ Integer[] expectedValuesArray = new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, null};
+
+ for (int index = 0; index < inputPresetArray.length; index++) {
+ ButtonName input = inputPresetArray[index];
+ Integer expect = expectedValuesArray[index];
+
+ Integer result = ButtonName.indexForPresetButton(input);
+ assertSame("Enum input " + result + " does not match expected value " + expect, result, expect);
+ }
+ }
+
+ /**
+ * Verifies that a null preset lookup is invalid.
+ */
+ public void testPresetNull () {
+ try {
+ assertNull("Passing null as a parameter does not return null", ButtonName.indexForPresetButton(null));
+ }
+ catch (NullPointerException exc){
+ fail("Passing null as a parameter throws a NullPointerException");
+ }
+
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonPressModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonPressModeTests.java
new file mode 100644
index 000000000..bdf8edbc3
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonPressModeTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
+
+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.ButtonPressMode}
+ */
+public class ButtonPressModeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "LONG";
+ ButtonPressMode enumLong = ButtonPressMode.valueForString(example);
+ example = "SHORT";
+ ButtonPressMode enumShort = ButtonPressMode.valueForString(example);
+
+ assertNotNull("LONG returned null", enumLong);
+ assertNotNull("SHORT returned null", enumShort);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "lONg";
+ try {
+ ButtonPressMode temp = ButtonPressMode.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 {
+ ButtonPressMode temp = ButtonPressMode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of ButtonPressMode.
+ */
+ public void testListEnum() {
+ List<ButtonPressMode> enumValueList = Arrays.asList(ButtonPressMode.values());
+
+ List<ButtonPressMode> enumTestList = new ArrayList<ButtonPressMode>();
+ enumTestList.add(ButtonPressMode.LONG);
+ enumTestList.add(ButtonPressMode.SHORT);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CarModeStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CarModeStatusTests.java
new file mode 100644
index 000000000..42c254ddd
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CarModeStatusTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
+
+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.CarModeStatus}
+ */
+public class CarModeStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NORMAL";
+ CarModeStatus enumNormal = CarModeStatus.valueForString(example);
+ example = "FACTORY";
+ CarModeStatus enumFactory = CarModeStatus.valueForString(example);
+ example = "TRANSPORT";
+ CarModeStatus enumTransport = CarModeStatus.valueForString(example);
+ example = "CRASH";
+ CarModeStatus enumCrash = CarModeStatus.valueForString(example);
+
+ assertNotNull("NORMAL returned null", enumNormal);
+ assertNotNull("FACTORY returned null", enumFactory);
+ assertNotNull("TRANSPORT returned null", enumTransport);
+ assertNotNull("CRASH returned null", enumCrash);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "noRmaL";
+ try {
+ CarModeStatus temp = CarModeStatus.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 {
+ CarModeStatus temp = CarModeStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of CarModeStatus.
+ */
+ public void testListEnum() {
+ List<CarModeStatus> enumValueList = Arrays.asList(CarModeStatus.values());
+
+ List<CarModeStatus> enumTestList = new ArrayList<CarModeStatus>();
+ enumTestList.add(CarModeStatus.NORMAL);
+ enumTestList.add(CarModeStatus.FACTORY);
+ enumTestList.add(CarModeStatus.TRANSPORT);
+ enumTestList.add(CarModeStatus.CRASH);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CharacterSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CharacterSetTests.java
new file mode 100644
index 000000000..fa5e36f3f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CharacterSetTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
+
+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.CharacterSet}
+ */
+public class CharacterSetTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "TYPE2SET";
+ CharacterSet enumType2Set = CharacterSet.valueForString(example);
+ example = "TYPE5SET";
+ CharacterSet enumType5Set = CharacterSet.valueForString(example);
+ example = "CID1SET";
+ CharacterSet enumCid1Set = CharacterSet.valueForString(example);
+ example = "CID2SET";
+ CharacterSet enumCid2Set = CharacterSet.valueForString(example);
+
+ assertNotNull("TYPE2SET returned null", enumType2Set);
+ assertNotNull("TYPE5SET returned null", enumType5Set);
+ assertNotNull("CID1SET returned null", enumCid1Set);
+ assertNotNull("CID2SET returned null", enumCid2Set);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "tyPe2SeT";
+ try {
+ CharacterSet temp = CharacterSet.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 {
+ CharacterSet temp = CharacterSet.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of CharacterSet.
+ */
+ public void testListEnum() {
+ List<CharacterSet> enumValueList = Arrays.asList(CharacterSet.values());
+
+ List<CharacterSet> enumTestList = new ArrayList<CharacterSet>();
+ enumTestList.add(CharacterSet.TYPE2SET);
+ enumTestList.add(CharacterSet.TYPE5SET);
+ enumTestList.add(CharacterSet.CID1SET);
+ enumTestList.add(CharacterSet.CID2SET);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CompassDirectionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CompassDirectionTests.java
new file mode 100644
index 000000000..fad24ba8c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CompassDirectionTests.java
@@ -0,0 +1,95 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
+
+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.CompassDirection}
+ */
+public class CompassDirectionTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NORTH";
+ CompassDirection enumNorth = CompassDirection.valueForString(example);
+ example = "NORTHWEST";
+ CompassDirection enumNorthWest = CompassDirection.valueForString(example);
+ example = "WEST";
+ CompassDirection enumWest = CompassDirection.valueForString(example);
+ example = "SOUTHWEST";
+ CompassDirection enumSouthWest = CompassDirection.valueForString(example);
+ example = "SOUTH";
+ CompassDirection enumSouth = CompassDirection.valueForString(example);
+ example = "SOUTHEAST";
+ CompassDirection enumSouthEast = CompassDirection.valueForString(example);
+ example = "EAST";
+ CompassDirection enumEast = CompassDirection.valueForString(example);
+ example = "NORTHEAST";
+ CompassDirection enumNorthEast = CompassDirection.valueForString(example);
+
+ assertNotNull("NORTH returned null", enumNorth);
+ assertNotNull("NORTHWEST returned null", enumNorthWest);
+ assertNotNull("WEST returned null", enumWest);
+ assertNotNull("SOUTHWEST returned null", enumSouthWest);
+ assertNotNull("SOUTH returned null", enumSouth);
+ assertNotNull("SOUTHEAST returned null", enumSouthEast);
+ assertNotNull("EAST returned null", enumEast);
+ assertNotNull("NORTHEAST returned null", enumNorthEast);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "noRTh";
+ try {
+ CompassDirection temp = CompassDirection.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 {
+ CompassDirection temp = CompassDirection.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of CompassDirection.
+ */
+ public void testListEnum() {
+ List<CompassDirection> enumValueList = Arrays.asList(CompassDirection.values());
+
+ List<CompassDirection> enumTestList = new ArrayList<CompassDirection>();
+ enumTestList.add(CompassDirection.NORTH);
+ enumTestList.add(CompassDirection.NORTHWEST);
+ enumTestList.add(CompassDirection.WEST);
+ enumTestList.add(CompassDirection.SOUTHWEST);
+ enumTestList.add(CompassDirection.SOUTH);
+ enumTestList.add(CompassDirection.SOUTHEAST);
+ enumTestList.add(CompassDirection.EAST);
+ enumTestList.add(CompassDirection.NORTHEAST);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ComponentVolumeStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ComponentVolumeStatusTests.java
new file mode 100644
index 000000000..40709ed67
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ComponentVolumeStatusTests.java
@@ -0,0 +1,87 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
+
+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.ComponentVolumeStatus}
+ */
+public class ComponentVolumeStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "UNKNOWN";
+ ComponentVolumeStatus enumUnknown = ComponentVolumeStatus.valueForString(example);
+ example = "NORMAL";
+ ComponentVolumeStatus enumNormal = ComponentVolumeStatus.valueForString(example);
+ example = "LOW";
+ ComponentVolumeStatus enumLow = ComponentVolumeStatus.valueForString(example);
+ example = "FAULT";
+ ComponentVolumeStatus enumFault = ComponentVolumeStatus.valueForString(example);
+ example = "ALERT";
+ ComponentVolumeStatus enumAlert = ComponentVolumeStatus.valueForString(example);
+ example = "NOT_SUPPORTED";
+ ComponentVolumeStatus enumNotSupported = ComponentVolumeStatus.valueForString(example);
+
+ assertNotNull("UNKNOWN returned null", enumUnknown);
+ assertNotNull("NORMAL returned null", enumNormal);
+ assertNotNull("LOW returned null", enumLow);
+ assertNotNull("FAULT returned null", enumFault);
+ assertNotNull("ALERT returned null", enumAlert);
+ assertNotNull("NOT_SUPPORTED returned null", enumNotSupported);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "unKNowN";
+ try {
+ ComponentVolumeStatus temp = ComponentVolumeStatus.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 {
+ ComponentVolumeStatus temp = ComponentVolumeStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of ComponentVolumeStatus.
+ */
+ public void testListEnum() {
+ List<ComponentVolumeStatus> enumValueList = Arrays.asList(ComponentVolumeStatus.values());
+
+ List<ComponentVolumeStatus> enumTestList = new ArrayList<ComponentVolumeStatus>();
+ enumTestList.add(ComponentVolumeStatus.UNKNOWN);
+ enumTestList.add(ComponentVolumeStatus.NORMAL);
+ enumTestList.add(ComponentVolumeStatus.LOW);
+ enumTestList.add(ComponentVolumeStatus.FAULT);
+ enumTestList.add(ComponentVolumeStatus.ALERT);
+ enumTestList.add(ComponentVolumeStatus.NOT_SUPPORTED);
+
+ 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/DefrostZoneTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DefrostZoneTests.java
index f1f375623..f1f375623 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DefrostZoneTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DefrostZoneTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DeviceLevelStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DeviceLevelStatusTests.java
new file mode 100644
index 000000000..8e578eef4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DeviceLevelStatusTests.java
@@ -0,0 +1,87 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
+
+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.DeviceLevelStatus}
+ */
+public class DeviceLevelStatusTests extends TestCase{
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "ZERO_LEVEL_BARS";
+ DeviceLevelStatus enumZeroLevel = DeviceLevelStatus.valueForString(example);
+ example = "ONE_LEVEL_BARS";
+ DeviceLevelStatus enumOneLevel = DeviceLevelStatus.valueForString(example);
+ example = "TWO_LEVEL_BARS";
+ DeviceLevelStatus enumTwoLevel = DeviceLevelStatus.valueForString(example);
+ example = "THREE_LEVEL_BARS";
+ DeviceLevelStatus enumThreeLevel = DeviceLevelStatus.valueForString(example);
+ example = "FOUR_LEVEL_BARS";
+ DeviceLevelStatus enumFourLevel = DeviceLevelStatus.valueForString(example);
+ example = "NOT_PROVIDED";
+ DeviceLevelStatus enumNotProvided = DeviceLevelStatus.valueForString(example);
+
+ assertNotNull("ZERO_LEVEL_BARS returned null", enumZeroLevel);
+ assertNotNull("ONE_LEVEL_BARS returned null", enumOneLevel);
+ assertNotNull("TWO_LEVEL_BARS returned null", enumTwoLevel);
+ assertNotNull("THREE_LEVEL_BARS returned null", enumThreeLevel);
+ assertNotNull("FOUR_LEVEL_BARS returned null", enumFourLevel);
+ assertNotNull("NOT_PROVIDED returned null", enumNotProvided);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "onE_LeVeL_barS";
+ try {
+ DeviceLevelStatus temp = DeviceLevelStatus.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 {
+ DeviceLevelStatus temp = DeviceLevelStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of DeviceLevelStatus.
+ */
+ public void testListEnum() {
+ List<DeviceLevelStatus> enumValueList = Arrays.asList(DeviceLevelStatus.values());
+
+ List<DeviceLevelStatus> enumTestList = new ArrayList<DeviceLevelStatus>();
+ enumTestList.add(DeviceLevelStatus.ZERO_LEVEL_BARS);
+ enumTestList.add(DeviceLevelStatus.ONE_LEVEL_BARS);
+ enumTestList.add(DeviceLevelStatus.TWO_LEVEL_BARS);
+ enumTestList.add(DeviceLevelStatus.THREE_LEVEL_BARS);
+ enumTestList.add(DeviceLevelStatus.FOUR_LEVEL_BARS);
+ enumTestList.add(DeviceLevelStatus.NOT_PROVIDED);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DimensionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DimensionTests.java
new file mode 100644
index 000000000..26d9a539e
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DimensionTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.Dimension;
+
+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.Dimension}
+ */
+public class DimensionTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NO_FIX";
+ Dimension enumNoFix = Dimension.valueForString(example);
+ example = "2D";
+ Dimension enum2D = Dimension.valueForString(example);
+ example = "3D";
+ Dimension enum3D = Dimension.valueForString(example);
+
+ assertNotNull("NO_FIX returned null", enumNoFix);
+ assertNotNull("2D returned null", enum2D);
+ assertNotNull("3D returned null", enum3D);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "no_FiX";
+ try {
+ Dimension temp = Dimension.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 {
+ Dimension temp = Dimension.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of Dimension.
+ */
+ public void testListEnum() {
+ List<Dimension> enumValueList = Arrays.asList(Dimension.values());
+
+ List<Dimension> enumTestList = new ArrayList<Dimension>();
+ enumTestList.add(Dimension.NO_FIX);
+ enumTestList.add(Dimension._2D);
+ enumTestList.add(Dimension._3D);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DirectionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DirectionTests.java
new file mode 100644
index 000000000..76492878d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DirectionTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.Direction;
+
+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.Direction}
+ */
+public class DirectionTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "LEFT";
+ Direction enumLeft = Direction.valueForString(example);
+ example = "RIGHT";
+ Direction enumRight = Direction.valueForString(example);
+
+ assertNotNull("LEFT returned null", enumLeft);
+ assertNotNull("RIGHT returned null", enumRight);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "fRONT";
+ try {
+ Direction temp = Direction.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 {
+ Direction temp = Direction.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of Direction.
+ */
+ public void testListEnum() {
+ List<Direction> enumValueList = Arrays.asList(Direction.values());
+
+ List<Direction> enumTestList = new ArrayList<>();
+ enumTestList.add(Direction.LEFT);
+ enumTestList.add(Direction.RIGHT);
+
+ 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/enums/DisplayModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java
index 94387ef9a..94387ef9a 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java
new file mode 100644
index 000000000..71b738782
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java
@@ -0,0 +1,107 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.DisplayType;
+
+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.DisplayType}
+ */
+public class DisplayTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "CID";
+ DisplayType enumCid = DisplayType.valueForString(example);
+ example = "TYPE2";
+ DisplayType enumType2 = DisplayType.valueForString(example);
+ example = "TYPE5";
+ DisplayType enumType5 = DisplayType.valueForString(example);
+ example = "NGN";
+ DisplayType enumNgn = DisplayType.valueForString(example);
+ example = "GEN2_8_DMA";
+ DisplayType enumGen2_8Dma = DisplayType.valueForString(example);
+ example = "GEN2_6_DMA";
+ DisplayType enumGen2_6Dma = DisplayType.valueForString(example);
+ example = "MFD3";
+ DisplayType enumMfd3 = DisplayType.valueForString(example);
+ example = "MFD4";
+ DisplayType enumMfd4 = DisplayType.valueForString(example);
+ example = "MFD5";
+ DisplayType enumMfd5 = DisplayType.valueForString(example);
+ example = "GEN3_8-INCH";
+ DisplayType enumGen3_8Inch = DisplayType.valueForString(example);
+ example = "SDL_GENERIC";
+ DisplayType enumGeneric = DisplayType.valueForString(example);
+
+ assertNotNull("CID returned null", enumCid);
+ assertNotNull("TYPE2 returned null", enumType2);
+ assertNotNull("TYPE5 returned null", enumType5);
+ assertNotNull("NGN returned null", enumNgn);
+ assertNotNull("GEN2_8_DMA returned null", enumGen2_8Dma);
+ assertNotNull("GEN2_6_DMA returned null", enumGen2_6Dma);
+ assertNotNull("MFD3 returned null", enumMfd3);
+ assertNotNull("MFD4 returned null", enumMfd4);
+ assertNotNull("MFD5 returned null", enumMfd5);
+ assertNotNull("GEN3_8-INCH returned null", enumGen3_8Inch);
+ assertNotNull("SDL_GENERIC returned null", enumGeneric);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "cId";
+ try {
+ DisplayType temp = DisplayType.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 {
+ DisplayType temp = DisplayType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of DisplayType.
+ */
+ public void testListEnum() {
+ List<DisplayType> enumValueList = Arrays.asList(DisplayType.values());
+
+ List<DisplayType> enumTestList = new ArrayList<DisplayType>();
+ enumTestList.add(DisplayType.CID);
+ enumTestList.add(DisplayType.TYPE2);
+ enumTestList.add(DisplayType.TYPE5);
+ enumTestList.add(DisplayType.NGN);
+ enumTestList.add(DisplayType.GEN2_8_DMA);
+ enumTestList.add(DisplayType.GEN2_6_DMA);
+ enumTestList.add(DisplayType.MFD3);
+ enumTestList.add(DisplayType.MFD4);
+ enumTestList.add(DisplayType.MFD5);
+ enumTestList.add(DisplayType.GEN3_8_INCH);
+ enumTestList.add(DisplayType.SDL_GENERIC);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java
index c421d6029..c421d6029 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DriverDistractionStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DriverDistractionStateTests.java
new file mode 100644
index 000000000..50aa21739
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DriverDistractionStateTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
+
+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.DriverDistractionState}
+ */
+public class DriverDistractionStateTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "DD_ON";
+ DriverDistractionState enumDdOn = DriverDistractionState.valueForString(example);
+ example = "DD_OFF";
+ DriverDistractionState enumDdOff = DriverDistractionState.valueForString(example);
+
+ assertNotNull("DD_ON returned null", enumDdOn);
+ assertNotNull("DD_OFF returned null", enumDdOff);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "dD_oN";
+ try {
+ DriverDistractionState temp = DriverDistractionState.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 {
+ DriverDistractionState temp = DriverDistractionState.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of DriverDistractionState.
+ */
+ public void testListEnum() {
+ List<DriverDistractionState> enumValueList = Arrays.asList(DriverDistractionState.values());
+
+ List<DriverDistractionState> enumTestList = new ArrayList<DriverDistractionState>();
+ enumTestList.add(DriverDistractionState.DD_ON);
+ enumTestList.add(DriverDistractionState.DD_OFF);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ECallConfirmationStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ECallConfirmationStatusTests.java
new file mode 100644
index 000000000..7b4c8102e
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ECallConfirmationStatusTests.java
@@ -0,0 +1,91 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
+
+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.ECallConfirmationStatus}
+ */
+public class ECallConfirmationStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NORMAL";
+ ECallConfirmationStatus enumNormal = ECallConfirmationStatus.valueForString(example);
+ example = "CALL_IN_PROGRESS";
+ ECallConfirmationStatus enumCallInProgress = ECallConfirmationStatus.valueForString(example);
+ example = "CALL_CANCELLED";
+ ECallConfirmationStatus enumCancelled = ECallConfirmationStatus.valueForString(example);
+ example = "CALL_COMPLETED";
+ ECallConfirmationStatus enumCompleted = ECallConfirmationStatus.valueForString(example);
+ example = "CALL_UNSUCCESSFUL";
+ ECallConfirmationStatus enumUnsuccessful = ECallConfirmationStatus.valueForString(example);
+ example = "ECALL_CONFIGURED_OFF";
+ ECallConfirmationStatus enumConfiguredOff = ECallConfirmationStatus.valueForString(example);
+ example = "CALL_COMPLETE_DTMF_TIMEOUT";
+ ECallConfirmationStatus enumCompleteDtmfTimeout = ECallConfirmationStatus.valueForString(example);
+
+ assertNotNull("NORMAL returned null", enumNormal);
+ assertNotNull("CALL_IN_PROGRESS returned null", enumCallInProgress);
+ assertNotNull("CALL_CANCELLED returned null", enumCancelled);
+ assertNotNull("CALL_COMPLETED returned null", enumCompleted);
+ assertNotNull("CALL_UNSUCCESSFUL returned null", enumUnsuccessful);
+ assertNotNull("ECALL_CONFIGURED_OFF returned null", enumConfiguredOff);
+ assertNotNull("CALL_COMPLETE_DTMF_TIMEOUT returned null", enumCompleteDtmfTimeout);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "noRMal";
+ try {
+ ECallConfirmationStatus temp = ECallConfirmationStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (IllegalArgumentException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies that a null assignment is invalid.
+ */
+ public void testNullEnum () {
+ String example = null;
+ try {
+ ECallConfirmationStatus temp = ECallConfirmationStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of ECallConfirmationStatus.
+ */
+ public void testListEnum() {
+ List<ECallConfirmationStatus> enumValueList = Arrays.asList(ECallConfirmationStatus.values());
+
+ List<ECallConfirmationStatus> enumTestList = new ArrayList<ECallConfirmationStatus>();
+ enumTestList.add(ECallConfirmationStatus.NORMAL);
+ enumTestList.add(ECallConfirmationStatus.CALL_IN_PROGRESS);
+ enumTestList.add(ECallConfirmationStatus.CALL_CANCELLED);
+ enumTestList.add(ECallConfirmationStatus.CALL_COMPLETED);
+ enumTestList.add(ECallConfirmationStatus.CALL_UNSUCCESSFUL);
+ enumTestList.add(ECallConfirmationStatus.ECALL_CONFIGURED_OFF);
+ enumTestList.add(ECallConfirmationStatus.CALL_COMPLETE_DTMF_TIMEOUT);
+
+ 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/ElectronicParkBrakeStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ElectronicParkBrakeStatusTests.java
index bbeb1bce3..bbeb1bce3 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ElectronicParkBrakeStatusTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ElectronicParkBrakeStatusTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/EmergencyEventTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/EmergencyEventTypeTests.java
new file mode 100644
index 000000000..705739a24
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/EmergencyEventTypeTests.java
@@ -0,0 +1,91 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
+
+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.EmergencyEventType}
+ */
+public class EmergencyEventTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NO_EVENT";
+ EmergencyEventType enumEventType = EmergencyEventType.valueForString(example);
+ example = "FRONTAL";
+ EmergencyEventType enumFrontal = EmergencyEventType.valueForString(example);
+ example = "SIDE";
+ EmergencyEventType enumSide = EmergencyEventType.valueForString(example);
+ example = "REAR";
+ EmergencyEventType enumRear = EmergencyEventType.valueForString(example);
+ example = "ROLLOVER";
+ EmergencyEventType enumRollover = EmergencyEventType.valueForString(example);
+ example = "NOT_SUPPORTED";
+ EmergencyEventType enumNotSupported = EmergencyEventType.valueForString(example);
+ example = "FAULT";
+ EmergencyEventType enumFault = EmergencyEventType.valueForString(example);
+
+ assertNotNull("NO_EVENT returned null", enumEventType);
+ assertNotNull("FRONTAL returned null", enumFrontal);
+ assertNotNull("SIDE returned null", enumSide);
+ assertNotNull("REAR returned null", enumRear);
+ assertNotNull("ROLLOVER returned null", enumRollover);
+ assertNotNull("NOT_SUPPORTED returned null", enumNotSupported);
+ assertNotNull("FAULT returned null", enumFault);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "nO_EvenT";
+ try {
+ EmergencyEventType temp = EmergencyEventType.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 {
+ EmergencyEventType temp = EmergencyEventType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of EmergencyEvent.
+ */
+ public void testListEnum() {
+ List<EmergencyEventType> enumValueList = Arrays.asList(EmergencyEventType.values());
+
+ List<EmergencyEventType> enumTestList = new ArrayList<EmergencyEventType>();
+ enumTestList.add(EmergencyEventType.NO_EVENT);
+ enumTestList.add(EmergencyEventType.FRONTAL);
+ enumTestList.add(EmergencyEventType.SIDE);
+ enumTestList.add(EmergencyEventType.REAR);
+ enumTestList.add(EmergencyEventType.ROLLOVER);
+ enumTestList.add(EmergencyEventType.NOT_SUPPORTED);
+ enumTestList.add(EmergencyEventType.FAULT);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FileTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FileTypeTests.java
new file mode 100644
index 000000000..67cbcdf67
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FileTypeTests.java
@@ -0,0 +1,95 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+
+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.FileType}
+ */
+public class FileTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "GRAPHIC_BMP";
+ FileType enumGraphicBmp = FileType.valueForString(example);
+ example = "GRAPHIC_JPEG";
+ FileType enumGraphicJpeg = FileType.valueForString(example);
+ example = "GRAPHIC_PNG";
+ FileType enumGraphicPng = FileType.valueForString(example);
+ example = "AUDIO_WAVE";
+ FileType enumAudioWave = FileType.valueForString(example);
+ example = "AUDIO_AAC";
+ FileType enumAudioAac = FileType.valueForString(example);
+ example = "AUDIO_MP3";
+ FileType enumAudioMp3 = FileType.valueForString(example);
+ example = "BINARY";
+ FileType enumBinary = FileType.valueForString(example);
+ example = "JSON";
+ FileType enumJson = FileType.valueForString(example);
+
+ assertNotNull("GRAPHIC_BMP returned null", enumGraphicBmp);
+ assertNotNull("GRAPHIC_JPEG returned null", enumGraphicJpeg);
+ assertNotNull("GRAPHIC_PNG returned null", enumGraphicPng);
+ assertNotNull("AUDIO_WAVE returned null", enumAudioWave);
+ assertNotNull("AUDIO_AAC returned null", enumAudioAac);
+ assertNotNull("AUDIO_MP3 returned null", enumAudioMp3);
+ assertNotNull("BINARY returned null", enumBinary);
+ assertNotNull("JSON returned null", enumJson);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "uSer_ExiT";
+ try {
+ FileType temp = FileType.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 {
+ FileType temp = FileType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of FileType.
+ */
+ public void testListEnum() {
+ List<FileType> enumValueList = Arrays.asList(FileType.values());
+
+ List<FileType> enumTestList = new ArrayList<FileType>();
+ enumTestList.add(FileType.GRAPHIC_BMP);
+ enumTestList.add(FileType.GRAPHIC_JPEG);
+ enumTestList.add(FileType.GRAPHIC_PNG);
+ enumTestList.add(FileType.AUDIO_WAVE);
+ enumTestList.add(FileType.AUDIO_AAC);
+ enumTestList.add(FileType.AUDIO_MP3);
+ enumTestList.add(FileType.BINARY);
+ enumTestList.add(FileType.JSON);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelCutoffStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelCutoffStatusTests.java
new file mode 100644
index 000000000..8fa7be908
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelCutoffStatusTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
+
+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.FuelCutoffStatus}
+ */
+public class FuelCutoffStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "TERMINATE_FUEL";
+ FuelCutoffStatus enumTerminateFuel = FuelCutoffStatus.valueForString(example);
+ example = "NORMAL_OPERATION";
+ FuelCutoffStatus enumNormalOperation = FuelCutoffStatus.valueForString(example);
+ example = "FAULT";
+ FuelCutoffStatus enumFault = FuelCutoffStatus.valueForString(example);
+
+ assertNotNull("TERMINATE_FUEL returned null", enumTerminateFuel);
+ assertNotNull("NORMAL_OPERATION returned null", enumNormalOperation);
+ assertNotNull("FAULT returned null", enumFault);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "tErmINAte_FueL";
+ try {
+ FuelCutoffStatus temp = FuelCutoffStatus.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 {
+ FuelCutoffStatus temp = FuelCutoffStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of FuelCutoffStatus.
+ */
+ public void testListEnum() {
+ List<FuelCutoffStatus> enumValueList = Arrays.asList(FuelCutoffStatus.values());
+
+ List<FuelCutoffStatus> enumTestList = new ArrayList<FuelCutoffStatus>();
+ enumTestList.add(FuelCutoffStatus.TERMINATE_FUEL);
+ enumTestList.add(FuelCutoffStatus.NORMAL_OPERATION);
+ enumTestList.add(FuelCutoffStatus.FAULT);
+
+ 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/FuelTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelTypeTests.java
index 525cc0316..525cc0316 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelTypeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelTypeTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/GlobalPropertyTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/GlobalPropertyTests.java
new file mode 100644
index 000000000..422ab808c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/GlobalPropertyTests.java
@@ -0,0 +1,91 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
+
+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.GlobalProperty}
+ */
+public class GlobalPropertyTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "HELPPROMPT";
+ GlobalProperty enumHelpPrompt = GlobalProperty.valueForString(example);
+ example = "TIMEOUTPROMPT";
+ GlobalProperty enumTimeoutPrompt = GlobalProperty.valueForString(example);
+ example = "VRHELPTITLE";
+ GlobalProperty enumVrHelpTitle = GlobalProperty.valueForString(example);
+ example = "VRHELPITEMS";
+ GlobalProperty enumVrHelpItems = GlobalProperty.valueForString(example);
+ example = "MENUNAME";
+ GlobalProperty enumMenuName = GlobalProperty.valueForString(example);
+ example = "MENUICON";
+ GlobalProperty enumMenuIcon = GlobalProperty.valueForString(example);
+ example = "KEYBOARDPROPERTIES";
+ GlobalProperty enumKeyboardProperties = GlobalProperty.valueForString(example);
+
+ assertNotNull("HELPPROMPT returned null", enumHelpPrompt);
+ assertNotNull("TIMEOUTPROMPT returned null", enumTimeoutPrompt);
+ assertNotNull("VRHELPTITLE returned null", enumVrHelpTitle);
+ assertNotNull("VRHELPITEMS returned null", enumVrHelpItems);
+ assertNotNull("MENUNAME returned null", enumMenuName);
+ assertNotNull("MENUICON returned null", enumMenuIcon);
+ assertNotNull("KEYBOARDPROPERTIES returned null", enumKeyboardProperties);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "heLp_ProMPt";
+ try {
+ GlobalProperty temp = GlobalProperty.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 {
+ GlobalProperty temp = GlobalProperty.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of GlobalProperty.
+ */
+ public void testListEnum() {
+ List<GlobalProperty> enumValueList = Arrays.asList(GlobalProperty.values());
+
+ List<GlobalProperty> enumTestList = new ArrayList<GlobalProperty>();
+ enumTestList.add(GlobalProperty.HELPPROMPT);
+ enumTestList.add(GlobalProperty.TIMEOUTPROMPT);
+ enumTestList.add(GlobalProperty.VRHELPTITLE);
+ enumTestList.add(GlobalProperty.VRHELPITEMS);
+ enumTestList.add(GlobalProperty.MENUNAME);
+ enumTestList.add(GlobalProperty.MENUICON);
+ enumTestList.add(GlobalProperty.KEYBOARDPROPERTIES);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiLevelTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiLevelTests.java
new file mode 100644
index 000000000..a0079e1c4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiLevelTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+
+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.HmiLevel}
+ */
+public class HmiLevelTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "FULL";
+ HMILevel enumFull = HMILevel.valueForString(example);
+ example = "LIMITED";
+ HMILevel enumLimited = HMILevel.valueForString(example);
+ example = "BACKGROUND";
+ HMILevel enumBackground = HMILevel.valueForString(example);
+ example = "NONE";
+ HMILevel enumNone = HMILevel.valueForString(example);
+
+ assertNotNull("FULL returned null", enumFull);
+ assertNotNull("LIMITED returned null", enumLimited);
+ assertNotNull("BACKGROUND returned null", enumBackground);
+ assertNotNull("NONE returned null", enumNone);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "fUlL";
+ try {
+ HMILevel temp = HMILevel.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 {
+ HMILevel temp = HMILevel.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of HMILevel.
+ */
+ public void testListEnum() {
+ List<HMILevel> enumValueList = Arrays.asList(HMILevel.values());
+
+ List<HMILevel> enumTestList = new ArrayList<HMILevel>();
+ enumTestList.add(HMILevel.HMI_FULL);
+ enumTestList.add(HMILevel.HMI_LIMITED);
+ enumTestList.add(HMILevel.HMI_BACKGROUND);
+ enumTestList.add(HMILevel.HMI_NONE);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiZoneCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiZoneCapabilitiesTests.java
new file mode 100644
index 000000000..d1b3ff690
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiZoneCapabilitiesTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
+
+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.HmiZoneCapabilities}
+ */
+public class HmiZoneCapabilitiesTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "FRONT";
+ HmiZoneCapabilities enumFront = HmiZoneCapabilities.valueForString(example);
+ example = "BACK";
+ HmiZoneCapabilities enumBack = HmiZoneCapabilities.valueForString(example);
+
+ assertNotNull("FRONT returned null", enumFront);
+ assertNotNull("BACK returned null", enumBack);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "fROnT";
+ try {
+ HmiZoneCapabilities temp = HmiZoneCapabilities.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 {
+ HmiZoneCapabilities temp = HmiZoneCapabilities.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of HmiZoneCapabilities.
+ */
+ public void testListEnum() {
+ List<HmiZoneCapabilities> enumValueList = Arrays.asList(HmiZoneCapabilities.values());
+
+ List<HmiZoneCapabilities> enumTestList = new ArrayList<HmiZoneCapabilities>();
+ enumTestList.add(HmiZoneCapabilities.FRONT);
+ enumTestList.add(HmiZoneCapabilities.BACK);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HybridAppPreferenceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HybridAppPreferenceTests.java
new file mode 100644
index 000000000..5c601fe20
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HybridAppPreferenceTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.HybridAppPreference;
+
+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.HybridAppPreference}
+ */
+public class HybridAppPreferenceTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "MOBILE";
+ HybridAppPreference enumMobile = HybridAppPreference.valueForString(example);
+ example = "CLOUD";
+ HybridAppPreference enumCloud = HybridAppPreference.valueForString(example);
+ example = "BOTH";
+ HybridAppPreference enumBoth = HybridAppPreference.valueForString(example);
+
+ assertNotNull("MOBILE returned null", enumMobile);
+ assertNotNull("CLOUD returned null", enumCloud);
+ assertNotNull("BOTH returned null", enumBoth);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "deFaUlt";
+ try {
+ HybridAppPreference temp = HybridAppPreference.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 {
+ HybridAppPreference temp = HybridAppPreference.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of HybridAppPreference.
+ */
+ public void testListEnum() {
+ List<HybridAppPreference> enumValueList = Arrays.asList(HybridAppPreference.values());
+
+ List<HybridAppPreference> enumTestList = new ArrayList<>();
+ enumTestList.add(HybridAppPreference.MOBILE);
+ enumTestList.add(HybridAppPreference.CLOUD);
+ enumTestList.add(HybridAppPreference.BOTH);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStableStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStableStatusTests.java
new file mode 100644
index 000000000..713b75e10
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStableStatusTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
+
+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.IgnitionStableStatus}
+ */
+public class IgnitionStableStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "IGNITION_SWITCH_NOT_STABLE";
+ IgnitionStableStatus enumIgnitionSwitchNotStable = IgnitionStableStatus.valueForString(example);
+ example = "IGNITION_SWITCH_STABLE";
+ IgnitionStableStatus enumIgnitionSwitchStable = IgnitionStableStatus.valueForString(example);
+ example = "MISSING_FROM_TRANSMITTER";
+ IgnitionStableStatus enumMissingFromTransmitter = IgnitionStableStatus.valueForString(example);
+
+ assertNotNull("IGNITION_SWITCH_NOT_STABLE returned null", enumIgnitionSwitchNotStable);
+ assertNotNull("IGNITION_SWITCH_STABLE returned null", enumIgnitionSwitchStable);
+ assertNotNull("MISSING_FROM_TRANSMITTER returned null", enumMissingFromTransmitter);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "iGnitIoN_SwiTch_NoT_StablE";
+ try {
+ IgnitionStableStatus temp = IgnitionStableStatus.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 {
+ IgnitionStableStatus temp = IgnitionStableStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of IgnitionStableStatus.
+ */
+ public void testListEnum() {
+ List<IgnitionStableStatus> enumValueList = Arrays.asList(IgnitionStableStatus.values());
+
+ List<IgnitionStableStatus> enumTestList = new ArrayList<IgnitionStableStatus>();
+ enumTestList.add(IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE);
+ enumTestList.add(IgnitionStableStatus.IGNITION_SWITCH_STABLE);
+ enumTestList.add(IgnitionStableStatus.MISSING_FROM_TRANSMITTER);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStatusTests.java
new file mode 100644
index 000000000..c10b4198b
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStatusTests.java
@@ -0,0 +1,87 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
+
+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.IgnitionStatus}
+ */
+public class IgnitionStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "UNKNOWN";
+ IgnitionStatus enumUnknown = IgnitionStatus.valueForString(example);
+ example = "OFF";
+ IgnitionStatus enumOff = IgnitionStatus.valueForString(example);
+ example = "ACCESSORY";
+ IgnitionStatus enumAccessory = IgnitionStatus.valueForString(example);
+ example = "RUN";
+ IgnitionStatus enumRun = IgnitionStatus.valueForString(example);
+ example = "START";
+ IgnitionStatus enumStart = IgnitionStatus.valueForString(example);
+ example = "INVALID";
+ IgnitionStatus enumInvalid = IgnitionStatus.valueForString(example);
+
+ assertNotNull("UNKNOWN returned null", enumUnknown);
+ assertNotNull("OFF returned null", enumOff);
+ assertNotNull("ACCESSORY returned null", enumAccessory);
+ assertNotNull("RUN returned null", enumRun);
+ assertNotNull("START returned null", enumStart);
+ assertNotNull("INVALID returned null", enumInvalid);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "uNKnowN";
+ try {
+ IgnitionStatus temp = IgnitionStatus.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 {
+ IgnitionStatus temp = IgnitionStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of IgnitionStatus.
+ */
+ public void testListEnum() {
+ List<IgnitionStatus> enumValueList = Arrays.asList(IgnitionStatus.values());
+
+ List<IgnitionStatus> enumTestList = new ArrayList<IgnitionStatus>();
+ enumTestList.add(IgnitionStatus.UNKNOWN);
+ enumTestList.add(IgnitionStatus.OFF);
+ enumTestList.add(IgnitionStatus.ACCESSORY);
+ enumTestList.add(IgnitionStatus.RUN);
+ enumTestList.add(IgnitionStatus.START);
+ enumTestList.add(IgnitionStatus.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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java
new file mode 100644
index 000000000..5c59df856
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java
@@ -0,0 +1,115 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
+
+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.ImageFieldName}
+ */
+public class ImageFieldNameTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "softButtonImage";
+ ImageFieldName enumSoftButtonImage = ImageFieldName.valueForString(example);
+ example = "choiceImage";
+ ImageFieldName enumChoiceImage = ImageFieldName.valueForString(example);
+ example = "choiceSecondaryImage";
+ ImageFieldName enumSecondaryImage = ImageFieldName.valueForString(example);
+ example = "vrHelpItem";
+ ImageFieldName enumVrHelpItem = ImageFieldName.valueForString(example);
+ example = "turnIcon";
+ ImageFieldName enumTurnIcon = ImageFieldName.valueForString(example);
+ example = "menuIcon";
+ ImageFieldName enumMenuIcon = ImageFieldName.valueForString(example);
+ example = "cmdIcon";
+ ImageFieldName enumCmdIcon = ImageFieldName.valueForString(example);
+ example = "appIcon";
+ ImageFieldName enumAppIcon = ImageFieldName.valueForString(example);
+ example = "graphic";
+ ImageFieldName enumGraphicIcon = ImageFieldName.valueForString(example);
+ example = "showConstantTBTIcon";
+ ImageFieldName enumShowConstantTbtIcon = ImageFieldName.valueForString(example);
+ example = "showConstantTBTNextTurnIcon";
+ ImageFieldName enumShowConstantTbtNextTurnIcon = ImageFieldName.valueForString(example);
+ example = "locationImage";
+ ImageFieldName enumLocationImage = ImageFieldName.valueForString(example);
+ example = "secondaryGraphic";
+ ImageFieldName enumSecondaryGraphic = ImageFieldName.valueForString(example);
+
+ assertNotNull("softButtonImage returned null", enumSoftButtonImage);
+ assertNotNull("choiceImage returned null", enumChoiceImage);
+ assertNotNull("choiceSecondaryImage returned null", enumSecondaryImage);
+ assertNotNull("vrHelpItem returned null", enumVrHelpItem);
+ assertNotNull("turnIcon returned null", enumTurnIcon);
+ assertNotNull("menuIcon returned null", enumMenuIcon);
+ assertNotNull("cmdIcon returned null", enumCmdIcon);
+ assertNotNull("appIcon returned null", enumAppIcon);
+ assertNotNull("graphic returned null", enumGraphicIcon);
+ assertNotNull("showConstantTBTIcon returned null", enumShowConstantTbtIcon);
+ assertNotNull("showConstantTBTNextTurnIcon returned null", enumShowConstantTbtNextTurnIcon);
+ assertNotNull("location image returned null", enumLocationImage);
+ assertNotNull("secondary graphic returned null", enumSecondaryGraphic);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "sofTbUtTOnImagE";
+ try {
+ ImageFieldName temp = ImageFieldName.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 {
+ ImageFieldName temp = ImageFieldName.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of ImageFieldName.
+ */
+ public void testListEnum() {
+ List<ImageFieldName> enumValueList = Arrays.asList(ImageFieldName.values());
+
+ List<ImageFieldName> enumTestList = new ArrayList<ImageFieldName>();
+ enumTestList.add(ImageFieldName.softButtonImage);
+ enumTestList.add(ImageFieldName.choiceImage);
+ enumTestList.add(ImageFieldName.choiceSecondaryImage);
+ enumTestList.add(ImageFieldName.vrHelpItem);
+ enumTestList.add(ImageFieldName.turnIcon);
+ enumTestList.add(ImageFieldName.menuIcon);
+ enumTestList.add(ImageFieldName.cmdIcon);
+ enumTestList.add(ImageFieldName.appIcon);
+ enumTestList.add(ImageFieldName.graphic);
+ enumTestList.add(ImageFieldName.showConstantTBTIcon);
+ enumTestList.add(ImageFieldName.showConstantTBTNextTurnIcon);
+ enumTestList.add(ImageFieldName.locationImage);
+ enumTestList.add(ImageFieldName.secondaryGraphic);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageTypeTests.java
new file mode 100644
index 000000000..637195c58
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageTypeTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+
+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.ImageType}
+ */
+public class ImageTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "STATIC";
+ ImageType enumStatic = ImageType.valueForString(example);
+ example = "DYNAMIC";
+ ImageType enumDynamic = ImageType.valueForString(example);
+
+ assertNotNull("STATIC returned null", enumStatic);
+ assertNotNull("DYNAMIC returned null", enumDynamic);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "sTatIc";
+ try {
+ ImageType temp = ImageType.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 {
+ ImageType temp = ImageType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of ImageType.
+ */
+ public void testListEnum() {
+ List<ImageType> enumValueList = Arrays.asList(ImageType.values());
+
+ List<ImageType> enumTestList = new ArrayList<ImageType>();
+ enumTestList.add(ImageType.STATIC);
+ enumTestList.add(ImageType.DYNAMIC);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/InteractionModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/InteractionModeTests.java
new file mode 100644
index 000000000..47c30086c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/InteractionModeTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
+
+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.InteractionMode}
+ */
+public class InteractionModeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "MANUAL_ONLY";
+ InteractionMode enumManualOnly = InteractionMode.valueForString(example);
+ example = "VR_ONLY";
+ InteractionMode enumVrOnly = InteractionMode.valueForString(example);
+ example = "BOTH";
+ InteractionMode enumBoth = InteractionMode.valueForString(example);
+
+ assertNotNull("MANUAL_ONLY returned null", enumManualOnly);
+ assertNotNull("VR_ONLY returned null", enumVrOnly);
+ assertNotNull("BOTH returned null", enumBoth);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "maNuAL_OnlY";
+ try {
+ InteractionMode temp = InteractionMode.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 {
+ InteractionMode temp = InteractionMode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of InteractionMode.
+ */
+ public void testListEnum() {
+ List<InteractionMode> enumValueList = Arrays.asList(InteractionMode.values());
+
+ List<InteractionMode> enumTestList = new ArrayList<InteractionMode>();
+ enumTestList.add(InteractionMode.MANUAL_ONLY);
+ enumTestList.add(InteractionMode.VR_ONLY);
+ enumTestList.add(InteractionMode.BOTH);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/JingleTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/JingleTests.java
new file mode 100644
index 000000000..3d4348927
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/JingleTests.java
@@ -0,0 +1,83 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.Jingle;
+
+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.Jingle}
+ */
+public class JingleTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+
+ String example = "POSITIVE_JINGLE";
+ Jingle enumPositiveJingle = Jingle.valueForString(example);
+ example = "NEGATIVE_JINGLE";
+ Jingle enumNegativeJingle = Jingle.valueForString(example);
+ example = "INITIAL_JINGLE";
+ Jingle enumInitialJingle = Jingle.valueForString(example);
+ example = "LISTEN_JINGLE";
+ Jingle enumListenJingle = Jingle.valueForString(example);
+ example = "HELP_JINGLE";
+ Jingle enumHelpJingle = Jingle.valueForString(example);
+
+ assertNotNull("POSITIVE_JINGLE returned null", enumPositiveJingle);
+ assertNotNull("NEGATIVE_JINGLE returned null", enumNegativeJingle);
+ assertNotNull("INITIAL_JINGLE returned null", enumInitialJingle);
+ assertNotNull("LISTEN_JINGLE returned null", enumListenJingle);
+ assertNotNull("HELP_JINGLE returned null", enumHelpJingle);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "posITive_JiGLE";
+ try {
+ Jingle temp = Jingle.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 {
+ Jingle temp = Jingle.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (IllegalArgumentException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of Jingle.
+ */
+ public void testListEnums () {
+ List<Jingle> enumValueList = Arrays.asList(Jingle.values());
+ List<Jingle> enumTestList = new ArrayList<Jingle>();
+
+ enumTestList.add(Jingle.HELP);
+ enumTestList.add(Jingle.INITIAL);
+ enumTestList.add(Jingle.LISTEN);
+ enumTestList.add(Jingle.NEGATIVE);
+ enumTestList.add(Jingle.POSITIVE);
+
+ assertTrue("Enum value list does not match neum class list.",
+ enumValueList.containsAll(enumTestList) &&
+ enumTestList.containsAll(enumValueList));
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardEventTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardEventTests.java
new file mode 100644
index 000000000..af33c4d17
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardEventTests.java
@@ -0,0 +1,83 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
+
+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.KeyboardEvent}
+ */
+public class KeyboardEventTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "KEYPRESS";
+ KeyboardEvent enumKeypress = KeyboardEvent.valueForString(example);
+ example = "ENTRY_SUBMITTED";
+ KeyboardEvent enumEntrySubmitted = KeyboardEvent.valueForString(example);
+ example = "ENTRY_CANCELLED";
+ KeyboardEvent enumEntryCancelled = KeyboardEvent.valueForString(example);
+ example = "ENTRY_ABORTED";
+ KeyboardEvent enumEntryAborted = KeyboardEvent.valueForString(example);
+ example = "ENTRY_VOICE";
+ KeyboardEvent enumEntryVoice = KeyboardEvent.valueForString(example);
+
+ assertNotNull("KEYPRESS returned null", enumKeypress);
+ assertNotNull("ENTRY_SUBMITTED returned null", enumEntrySubmitted);
+ assertNotNull("ENTRY_CANCELLED returned null", enumEntryCancelled);
+ assertNotNull("ENTRY_ABORTED returned null", enumEntryAborted);
+ assertNotNull("ENTRY_VOICE returned null", enumEntryVoice);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "keyPreSS";
+ try {
+ KeyboardEvent temp = KeyboardEvent.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 {
+ KeyboardEvent temp = KeyboardEvent.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of KeyboardEvent.
+ */
+ public void testListEnum() {
+ List<KeyboardEvent> enumValueList = Arrays.asList(KeyboardEvent.values());
+
+ List<KeyboardEvent> enumTestList = new ArrayList<KeyboardEvent>();
+ enumTestList.add(KeyboardEvent.KEYPRESS);
+ enumTestList.add(KeyboardEvent.ENTRY_SUBMITTED);
+ enumTestList.add(KeyboardEvent.ENTRY_CANCELLED);
+ enumTestList.add(KeyboardEvent.ENTRY_ABORTED);
+ enumTestList.add(KeyboardEvent.ENTRY_VOICE);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardLayoutTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardLayoutTests.java
new file mode 100644
index 000000000..ccb146d09
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardLayoutTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
+
+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.KeyboardLayout}
+ */
+public class KeyboardLayoutTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "QWERTY";
+ KeyboardLayout enumQwerty = KeyboardLayout.valueForString(example);
+ example = "QWERTZ";
+ KeyboardLayout enumQwertz = KeyboardLayout.valueForString(example);
+ example = "AZERTY";
+ KeyboardLayout enumAzerty = KeyboardLayout.valueForString(example);
+
+ assertNotNull("QWERTY returned null", enumQwerty);
+ assertNotNull("QWERTZ returned null", enumQwertz);
+ assertNotNull("AZERTY returned null", enumAzerty);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "qWerTY";
+ try {
+ KeyboardLayout temp = KeyboardLayout.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 {
+ KeyboardLayout temp = KeyboardLayout.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of KeyboardLayout.
+ */
+ public void testListEnum() {
+ List<KeyboardLayout> enumValueList = Arrays.asList(KeyboardLayout.values());
+
+ List<KeyboardLayout> enumTestList = new ArrayList<KeyboardLayout>();
+ enumTestList.add(KeyboardLayout.QWERTY);
+ enumTestList.add(KeyboardLayout.QWERTZ);
+ enumTestList.add(KeyboardLayout.AZERTY);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeypressModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeypressModeTests.java
new file mode 100644
index 000000000..4b169c6ca
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeypressModeTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
+
+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.KeypressMode}
+ */
+public class KeypressModeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "SINGLE_KEYPRESS";
+ KeypressMode enumSingleKeypress = KeypressMode.valueForString(example);
+ example = "QUEUE_KEYPRESSES";
+ KeypressMode enumQueueKeypresses = KeypressMode.valueForString(example);
+ example = "RESEND_CURRENT_ENTRY";
+ KeypressMode enumResendCurrentEntry = KeypressMode.valueForString(example);
+
+ assertNotNull("SINGLE_KEYPRESS returned null", enumSingleKeypress);
+ assertNotNull("QUEUE_KEYPRESSES returned null", enumQueueKeypresses);
+ assertNotNull("RESEND_CURRENT_ENTRY returned null", enumResendCurrentEntry);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "sIngLe_KeyPrESs";
+ try {
+ KeypressMode temp = KeypressMode.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 {
+ KeypressMode temp = KeypressMode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of KeypressMode.
+ */
+ public void testListEnum() {
+ List<KeypressMode> enumValueList = Arrays.asList(KeypressMode.values());
+
+ List<KeypressMode> enumTestList = new ArrayList<KeypressMode>();
+ enumTestList.add(KeypressMode.SINGLE_KEYPRESS);
+ enumTestList.add(KeypressMode.QUEUE_KEYPRESSES);
+ enumTestList.add(KeypressMode.RESEND_CURRENT_ENTRY);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LanguageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LanguageTests.java
new file mode 100644
index 000000000..61de1cfd5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LanguageTests.java
@@ -0,0 +1,220 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.Language;
+
+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.Language}
+ */
+public class LanguageTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "EN-US";
+ Language enumEnUs = Language.valueForString(example);
+ example = "EN-SA";
+ Language enumEnSa = Language.valueForString(example);
+ example = "HE-IL";
+ Language enumHeIl = Language.valueForString(example);
+ example = "RO-RO";
+ Language enumRoRo = Language.valueForString(example);
+ example = "UK-UA";
+ Language enumUkUa = Language.valueForString(example);
+ example = "ID-ID";
+ Language enumIdId = Language.valueForString(example);
+ example = "VI-VN";
+ Language enumViVn = Language.valueForString(example);
+ example = "MS-MY";
+ Language enumMsMy = Language.valueForString(example);
+ example = "HI-IN";
+ Language enumHiIn = Language.valueForString(example);
+ example = "NL-BE";
+ Language enumNlBe = Language.valueForString(example);
+ example = "EL-GR";
+ Language enumElGr = Language.valueForString(example);
+ example = "HU-HU";
+ Language enumHuHu = Language.valueForString(example);
+ example = "FI-FI";
+ Language enumFiFi = Language.valueForString(example);
+ example = "SK-SK";
+ Language enumSkSk = Language.valueForString(example);
+ example = "ES-MX";
+ Language enumEsMx = Language.valueForString(example);
+ example = "FR-CA";
+ Language enumFrCa = Language.valueForString(example);
+ example = "DE-DE";
+ Language enumDeDe = Language.valueForString(example);
+ example = "ES-ES";
+ Language enumEsEs = Language.valueForString(example);
+ example = "EN-GB";
+ Language enumEnGb = Language.valueForString(example);
+ example = "RU-RU";
+ Language enumRuRu = Language.valueForString(example);
+ example = "TR-TR";
+ Language enumTrTr = Language.valueForString(example);
+ example = "PL-PL";
+ Language enumPlPl = Language.valueForString(example);
+ example = "FR-FR";
+ Language enumFrFr = Language.valueForString(example);
+ example = "IT-IT";
+ Language enumItIt = Language.valueForString(example);
+ example = "SV-SE";
+ Language enumSvSe = Language.valueForString(example);
+ example = "PT-PT";
+ Language enumPtPt = Language.valueForString(example);
+ example = "NL-NL";
+ Language enumNlNl = Language.valueForString(example);
+ example = "EN-AU";
+ Language enumEnAu = Language.valueForString(example);
+ example = "ZH-CN";
+ Language enumZhCn = Language.valueForString(example);
+ example = "ZH-TW";
+ Language enumZhTw = Language.valueForString(example);
+ example = "JA-JP";
+ Language enumJaJp = Language.valueForString(example);
+ example = "AR-SA";
+ Language enumArSa = Language.valueForString(example);
+ example = "KO-KR";
+ Language enumKoKr = Language.valueForString(example);
+ example = "PT-BR";
+ Language enumPtBr = Language.valueForString(example);
+ example = "CS-CZ";
+ Language enumCsCz = Language.valueForString(example);
+ example = "DA-DK";
+ Language enumDaDk = Language.valueForString(example);
+ example = "NO-NO";
+ Language enumNoNo = Language.valueForString(example);
+ example = "EN-IN";
+ Language enumEnIn = Language.valueForString(example);
+ example = "TH-TH";
+ Language enumThTh = Language.valueForString(example);
+
+ assertNotNull("EN-US returned null", enumEnUs);
+ assertNotNull("EN-SA returned null", enumEnSa);
+ assertNotNull("HE-IL returned null", enumHeIl);
+ assertNotNull("RO-RO returned null", enumRoRo);
+ assertNotNull("UK-UA returned null", enumUkUa);
+ assertNotNull("ID-ID returned null", enumIdId);
+ assertNotNull("VI-VN returned null", enumViVn);
+ assertNotNull("MS-MY returned null", enumMsMy);
+ assertNotNull("HI-IN returned null", enumHiIn);
+ assertNotNull("NL-BE returned null", enumNlBe);
+ assertNotNull("EL-GR returned null", enumElGr);
+ assertNotNull("HU-HU returned null", enumHuHu);
+ assertNotNull("FI-FI returned null", enumFiFi);
+ assertNotNull("SK-SK returned null", enumSkSk);
+ assertNotNull("ES-MX returned null", enumEsMx);
+ assertNotNull("FR-CA returned null", enumFrCa);
+ assertNotNull("DE-DE returned null", enumDeDe);
+ assertNotNull("ES-ES returned null", enumEsEs);
+ assertNotNull("EN-GB returned null", enumEnGb);
+ assertNotNull("RU-RU returned null", enumRuRu);
+ assertNotNull("TR-TR returned null", enumTrTr);
+ assertNotNull("PL-PL returned null", enumPlPl);
+ assertNotNull("FR-FR returned null", enumFrFr);
+ assertNotNull("IT-IT returned null", enumItIt);
+ assertNotNull("SV-SE returned null", enumSvSe);
+ assertNotNull("PT-PT returned null", enumPtPt);
+ assertNotNull("NL-NL returned null", enumNlNl);
+ assertNotNull("EN-AU returned null", enumEnAu);
+ assertNotNull("ZH-CN returned null", enumZhCn);
+ assertNotNull("ZH-TW returned null", enumZhTw);
+ assertNotNull("JA-JP returned null", enumJaJp);
+ assertNotNull("AR-SA returned null", enumArSa);
+ assertNotNull("KO-KR returned null", enumKoKr);
+ assertNotNull("PT-BR returned null", enumPtBr);
+ assertNotNull("CS-CZ returned null", enumCsCz);
+ assertNotNull("DA-DK returned null", enumDaDk);
+ assertNotNull("NO-NO returned null", enumNoNo);
+ assertNotNull("EN-IN returned null", enumEnIn);
+ assertNotNull("TH-TH returned null", enumThTh);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "eN-Us";
+ try {
+ Language temp = Language.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 {
+ Language temp = Language.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of Language.
+ */
+ public void testListEnum() {
+ List<Language> enumValueList = Arrays.asList(Language.values());
+
+ List<Language> enumTestList = new ArrayList<Language>();
+
+ enumTestList.add(Language.EN_US);
+ enumTestList.add(Language.EN_SA);
+ enumTestList.add(Language.HE_IL);
+ enumTestList.add(Language.RO_RO);
+ enumTestList.add(Language.UK_UA);
+ enumTestList.add(Language.ID_ID);
+ enumTestList.add(Language.VI_VN);
+ enumTestList.add(Language.MS_MY);
+ enumTestList.add(Language.HI_IN);
+ enumTestList.add(Language.NL_BE);
+ enumTestList.add(Language.EL_GR);
+ enumTestList.add(Language.HU_HU);
+ enumTestList.add(Language.FI_FI);
+ enumTestList.add(Language.SK_SK);
+ enumTestList.add(Language.ES_MX);
+ enumTestList.add(Language.FR_CA);
+ enumTestList.add(Language.DE_DE);
+ enumTestList.add(Language.ES_ES);
+ enumTestList.add(Language.EN_GB);
+ enumTestList.add(Language.RU_RU);
+ enumTestList.add(Language.TR_TR);
+ enumTestList.add(Language.PL_PL);
+ enumTestList.add(Language.FR_FR);
+ enumTestList.add(Language.IT_IT);
+ enumTestList.add(Language.SV_SE);
+ enumTestList.add(Language.PT_PT);
+ enumTestList.add(Language.NL_NL);
+ enumTestList.add(Language.EN_AU);
+ enumTestList.add(Language.ZH_CN);
+ enumTestList.add(Language.ZH_TW);
+ enumTestList.add(Language.JA_JP);
+ enumTestList.add(Language.AR_SA);
+ enumTestList.add(Language.KO_KR);
+ enumTestList.add(Language.PT_BR);
+ enumTestList.add(Language.CS_CZ);
+ enumTestList.add(Language.DA_DK);
+ enumTestList.add(Language.NO_NO);
+ enumTestList.add(Language.EN_IN);
+ enumTestList.add(Language.TH_TH);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LayoutModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LayoutModeTests.java
new file mode 100644
index 000000000..60b67dab7
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LayoutModeTests.java
@@ -0,0 +1,84 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.LayoutMode;
+
+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.LayoutMode}
+ */
+public class LayoutModeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "ICON_ONLY";
+ LayoutMode enumIconOnly = LayoutMode.valueForString(example);
+ example = "ICON_WITH_SEARCH";
+ LayoutMode enumIconWithSearch = LayoutMode.valueForString(example);
+ example = "LIST_ONLY";
+ LayoutMode enumListOnly = LayoutMode.valueForString(example);
+ example = "LIST_WITH_SEARCH";
+ LayoutMode enumListWithSearch = LayoutMode.valueForString(example);
+ example = "KEYBOARD";
+ LayoutMode enumKeyboard = LayoutMode.valueForString(example);
+
+ assertNotNull("ICON_ONLY returned null", enumIconOnly);
+ assertNotNull("ICON_WITH_SEARCH returned null", enumIconWithSearch);
+ assertNotNull("LIST_ONLY returned null", enumListOnly);
+ assertNotNull("LIST_WITH_SEARCH returned null", enumListWithSearch);
+ assertNotNull("KEYBOARD returned null", enumKeyboard);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "icOn_OnlY";
+ try {
+ LayoutMode temp = LayoutMode.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 {
+ LayoutMode temp = LayoutMode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+
+ /**
+ * Verifies the possible enum values of LayoutMode.
+ */
+ public void testListEnum() {
+ List<LayoutMode> enumValueList = Arrays.asList(LayoutMode.values());
+
+ List<LayoutMode> enumTestList = new ArrayList<LayoutMode>();
+ enumTestList.add(LayoutMode.ICON_ONLY);
+ enumTestList.add(LayoutMode.ICON_WITH_SEARCH);
+ enumTestList.add(LayoutMode.LIST_ONLY);
+ enumTestList.add(LayoutMode.LIST_WITH_SEARCH);
+ enumTestList.add(LayoutMode.KEYBOARD);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java
index 10df1e762..10df1e762 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java
index a97cd6eba..a97cd6eba 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LockScreenStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LockScreenStatusTests.java
new file mode 100644
index 000000000..0735e9aac
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LockScreenStatusTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
+
+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.LockScreenStatus}
+ */
+public class LockScreenStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "REQUIRED";
+ LockScreenStatus enumRequired = LockScreenStatus.valueForString(example);
+ example = "OPTIONAL";
+ LockScreenStatus enumOptional = LockScreenStatus.valueForString(example);
+ example = "OFF";
+ LockScreenStatus enumOff = LockScreenStatus.valueForString(example);
+
+ assertNotNull("REQUIRED returned null", enumRequired);
+ assertNotNull("OPTIONAL returned null", enumOptional);
+ assertNotNull("OFF returned null", enumOff);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "ReqUireD";
+ try {
+ LockScreenStatus temp = LockScreenStatus.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 {
+ LockScreenStatus temp = LockScreenStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of LockScreenStatus.
+ */
+ public void testListEnum() {
+ List<LockScreenStatus> enumValueList = Arrays.asList(LockScreenStatus.values());
+
+ List<LockScreenStatus> enumTestList = new ArrayList<LockScreenStatus>();
+ enumTestList.add(LockScreenStatus.REQUIRED);
+ enumTestList.add(LockScreenStatus.OPTIONAL);
+ enumTestList.add(LockScreenStatus.OFF);
+
+ 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/MassageCushionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageCushionTests.java
index e1f58ffef..e1f58ffef 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageCushionTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageCushionTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java
index 55e82ac21..55e82ac21 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java
index bbd543d4e..bbd543d4e 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaClockFormatTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaClockFormatTests.java
new file mode 100644
index 000000000..8e5008ddf
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaClockFormatTests.java
@@ -0,0 +1,91 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
+
+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.MediaClockFormat}
+ */
+public class MediaClockFormatTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "CLOCK1";
+ MediaClockFormat enumClock1 = MediaClockFormat.valueForString(example);
+ example = "CLOCK2";
+ MediaClockFormat enumClock2 = MediaClockFormat.valueForString(example);
+ example = "CLOCK3";
+ MediaClockFormat enumClock3 = MediaClockFormat.valueForString(example);
+ example = "CLOCKTEXT1";
+ MediaClockFormat enumClockText1 = MediaClockFormat.valueForString(example);
+ example = "CLOCKTEXT2";
+ MediaClockFormat enumClockText2 = MediaClockFormat.valueForString(example);
+ example = "CLOCKTEXT3";
+ MediaClockFormat enumClockText3 = MediaClockFormat.valueForString(example);
+ example = "CLOCKTEXT4";
+ MediaClockFormat enumClockText4 = MediaClockFormat.valueForString(example);
+
+ assertNotNull("CLOCK1 returned null", enumClock1);
+ assertNotNull("CLOCK2 returned null", enumClock2);
+ assertNotNull("CLOCK3 returned null", enumClock3);
+ assertNotNull("CLOCKTEXT1 returned null", enumClockText1);
+ assertNotNull("CLOCKTEXT2 returned null", enumClockText2);
+ assertNotNull("CLOCKTEXT3 returned null", enumClockText3);
+ assertNotNull("CLOCKTEXT4 returned null", enumClockText4);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "cloCK1";
+ try {
+ MediaClockFormat temp = MediaClockFormat.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 {
+ MediaClockFormat temp = MediaClockFormat.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of MediaClockFormat.
+ */
+ public void testListEnum() {
+ List<MediaClockFormat> enumValueList = Arrays.asList(MediaClockFormat.values());
+
+ List<MediaClockFormat> enumTestList = new ArrayList<MediaClockFormat>();
+ enumTestList.add(MediaClockFormat.CLOCK1);
+ enumTestList.add(MediaClockFormat.CLOCK2);
+ enumTestList.add(MediaClockFormat.CLOCK3);
+ enumTestList.add(MediaClockFormat.CLOCKTEXT1);
+ enumTestList.add(MediaClockFormat.CLOCKTEXT2);
+ enumTestList.add(MediaClockFormat.CLOCKTEXT3);
+ enumTestList.add(MediaClockFormat.CLOCKTEXT4);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaTypeTests.java
new file mode 100644
index 000000000..835045418
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaTypeTests.java
@@ -0,0 +1,77 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.MediaType;
+
+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.MediaType}
+ */
+public class MediaTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums() {
+ String example = "MUSIC";
+ MediaType enumMusic = MediaType.valueForString(example);
+ example = "PODCAST";
+ MediaType enumPodcast = MediaType.valueForString(example);
+ example = "AUDIOBOOK";
+ MediaType enumAudioBook = MediaType.valueForString(example);
+ example = "OTHER";
+ MediaType enumOther = MediaType.valueForString(example);
+
+ assertNotNull("MUSIC returned null", enumMusic);
+ assertNotNull("PODCAST returned null", enumPodcast);
+ assertNotNull("AUDIOBOOK returned null", enumAudioBook);
+ assertNotNull("OTHER returned null", enumOther);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum() {
+ String example = "PudCAsT";
+ try {
+ MediaType temp = MediaType.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 {
+ MediaType temp = MediaType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of MediaType.
+ */
+ public void testListEnum() {
+ List<MediaType> enumValueList = Arrays.asList(MediaType.values());
+
+ List<MediaType> enumTestList = new ArrayList<MediaType>();
+ enumTestList.add(MediaType.MUSIC);
+ enumTestList.add(MediaType.PODCAST);
+ enumTestList.add(MediaType.AUDIOBOOK);
+ enumTestList.add(MediaType.OTHER);
+
+ 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/MetadataTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java
index c381dfff3..c381dfff3 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java
index 65432873e..65432873e 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/NavigationActionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/NavigationActionTests.java
new file mode 100644
index 000000000..5051ef337
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/NavigationActionTests.java
@@ -0,0 +1,92 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.NavigationAction;
+
+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.NavigationAction}
+ */
+public class NavigationActionTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "TURN";
+ NavigationAction enumTurn = NavigationAction.valueForString(example);
+ example = "EXIT";
+ NavigationAction enumExit = NavigationAction.valueForString(example);
+ example = "STAY";
+ NavigationAction enumStay = NavigationAction.valueForString(example);
+ example = "MERGE";
+ NavigationAction enumMerge = NavigationAction.valueForString(example);
+ example = "FERRY";
+ NavigationAction enumFerry = NavigationAction.valueForString(example);
+ example = "CAR_SHUTTLE_TRAIN";
+ NavigationAction enumCarShuttleTrain = NavigationAction.valueForString(example);
+ example = "WAYPOINT";
+ NavigationAction enumWaypoint = NavigationAction.valueForString(example);
+
+ assertNotNull("TURN returned null", enumTurn);
+ assertNotNull("EXIT returned null", enumExit);
+ assertNotNull("STAY returned null", enumStay);
+ assertNotNull("MERGE returned null", enumMerge);
+ assertNotNull("FERRY returned null", enumFerry);
+ assertNotNull("CAR_SHUTTLE_TRAIN returned null", enumCarShuttleTrain);
+ assertNotNull("WAYPOINT returned null", enumWaypoint);
+
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "fRONT";
+ try {
+ NavigationAction temp = NavigationAction.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 {
+ NavigationAction temp = NavigationAction.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of NavigationAction.
+ */
+ public void testListEnum() {
+ List<NavigationAction> enumValueList = Arrays.asList(NavigationAction.values());
+
+ List<NavigationAction> enumTestList = new ArrayList<>();
+ enumTestList.add(NavigationAction.TURN);
+ enumTestList.add(NavigationAction.EXIT);
+ enumTestList.add(NavigationAction.STAY);
+ enumTestList.add(NavigationAction.MERGE);
+ enumTestList.add(NavigationAction.FERRY);
+ enumTestList.add(NavigationAction.CAR_SHUTTLE_TRAIN);
+ enumTestList.add(NavigationAction.WAYPOINT);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/NavigationJunctionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/NavigationJunctionTests.java
new file mode 100644
index 000000000..691480f78
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/NavigationJunctionTests.java
@@ -0,0 +1,95 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.NavigationJunction;
+
+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.NavigationJunction}
+ */
+public class NavigationJunctionTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "REGULAR";
+ NavigationJunction enumRegular = NavigationJunction.valueForString(example);
+ example = "BIFURCATION";
+ NavigationJunction enumBifurcation = NavigationJunction.valueForString(example);
+ example = "MULTI_CARRIAGEWAY";
+ NavigationJunction enumMultiCarriageway = NavigationJunction.valueForString(example);
+ example = "ROUNDABOUT";
+ NavigationJunction enumRoundabout = NavigationJunction.valueForString(example);
+ example = "TRAVERSABLE_ROUNDABOUT";
+ NavigationJunction enumTraversableRoundabout = NavigationJunction.valueForString(example);
+ example = "JUGHANDLE";
+ NavigationJunction enumJughandle = NavigationJunction.valueForString(example);
+ example = "ALL_WAY_YIELD";
+ NavigationJunction enumAllWayYield = NavigationJunction.valueForString(example);
+ example = "TURN_AROUND";
+ NavigationJunction enumTurnAround = NavigationJunction.valueForString(example);
+
+ assertNotNull("REGULAR returned null", enumRegular);
+ assertNotNull("BIFURCATION returned null", enumBifurcation);
+ assertNotNull("MULTI_CARRIAGEWAY returned null", enumMultiCarriageway);
+ assertNotNull("ROUNDABOUT returned null", enumRoundabout);
+ assertNotNull("TRAVERSABLE_ROUNDABOUT returned null", enumTraversableRoundabout);
+ assertNotNull("JUGHANDLE returned null", enumJughandle);
+ assertNotNull("ALL_WAY_YIELD returned null", enumAllWayYield);
+ assertNotNull("TURN_AROUND returned null", enumTurnAround);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "fRONT";
+ try {
+ NavigationJunction temp = NavigationJunction.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 {
+ NavigationJunction temp = NavigationJunction.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of NavigationJunction.
+ */
+ public void testListEnum() {
+ List<NavigationJunction> enumValueList = Arrays.asList(NavigationJunction.values());
+
+ List<NavigationJunction> enumTestList = new ArrayList<>();
+ enumTestList.add(NavigationJunction.REGULAR);
+ enumTestList.add(NavigationJunction.BIFURCATION);
+ enumTestList.add(NavigationJunction.MULTI_CARRIAGEWAY);
+ enumTestList.add(NavigationJunction.ROUNDABOUT);
+ enumTestList.add(NavigationJunction.TRAVERSABLE_ROUNDABOUT);
+ enumTestList.add(NavigationJunction.JUGHANDLE);
+ enumTestList.add(NavigationJunction.ALL_WAY_YIELD);
+ enumTestList.add(NavigationJunction.TURN_AROUND);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeQualificationStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeQualificationStatusTests.java
new file mode 100644
index 000000000..b0c5c7acb
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeQualificationStatusTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
+
+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.PowerModeQualificationStatus}
+ */
+public class PowerModeQualificationStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "POWER_MODE_UNDEFINED";
+ PowerModeQualificationStatus enumPowerModeUndefined = PowerModeQualificationStatus.valueForString(example);
+ example = "POWER_MODE_EVALUATION_IN_PROGRESS";
+ PowerModeQualificationStatus enumPowerModeEvaluationInProgress = PowerModeQualificationStatus.valueForString(example);
+ example = "NOT_DEFINED";
+ PowerModeQualificationStatus enumNotDefined = PowerModeQualificationStatus.valueForString(example);
+ example = "POWER_MODE_OK";
+ PowerModeQualificationStatus enumPowerModeOk = PowerModeQualificationStatus.valueForString(example);
+
+ assertNotNull("POWER_MODE_UNDEFINED returned null", enumPowerModeUndefined);
+ assertNotNull("POWER_MODE_EVALUATION_IN_PROGRESS returned null", enumPowerModeEvaluationInProgress);
+ assertNotNull("NOT_DEFINED returned null", enumNotDefined);
+ assertNotNull("POWER_MODE_OK returned null", enumPowerModeOk);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "poweR_moDE_UndEfiNEd";
+ try {
+ PowerModeQualificationStatus temp = PowerModeQualificationStatus.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 {
+ PowerModeQualificationStatus temp = PowerModeQualificationStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of PowerModeQualificationStatus.
+ */
+ public void testListEnum() {
+ List<PowerModeQualificationStatus> enumValueList = Arrays.asList(PowerModeQualificationStatus.values());
+
+ List<PowerModeQualificationStatus> enumTestList = new ArrayList<PowerModeQualificationStatus>();
+ enumTestList.add(PowerModeQualificationStatus.POWER_MODE_UNDEFINED);
+ enumTestList.add(PowerModeQualificationStatus.POWER_MODE_EVALUATION_IN_PROGRESS);
+ enumTestList.add(PowerModeQualificationStatus.NOT_DEFINED);
+ enumTestList.add(PowerModeQualificationStatus.POWER_MODE_OK);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeStatusTests.java
new file mode 100644
index 000000000..6f70ca58c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeStatusTests.java
@@ -0,0 +1,99 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
+
+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.PowerModeStatus}
+ */
+public class PowerModeStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "KEY_OUT";
+ PowerModeStatus enumKeyOut = PowerModeStatus.valueForString(example);
+ example = "KEY_RECENTLY_OUT";
+ PowerModeStatus enumKeyRecentlyOut = PowerModeStatus.valueForString(example);
+ example = "KEY_APPROVED_0";
+ PowerModeStatus enumKeyApproved0 = PowerModeStatus.valueForString(example);
+ example = "POST_ACCESORY_0";
+ PowerModeStatus enumPostAccessory0 = PowerModeStatus.valueForString(example);
+ example = "ACCESORY_1";
+ PowerModeStatus enumAccessory1 = PowerModeStatus.valueForString(example);
+ example = "POST_IGNITION_1";
+ PowerModeStatus enumPostIgnition1 = PowerModeStatus.valueForString(example);
+ example = "IGNITION_ON_2";
+ PowerModeStatus enumIgnitionOn2 = PowerModeStatus.valueForString(example);
+ example = "RUNNING_2";
+ PowerModeStatus enumRunning2 = PowerModeStatus.valueForString(example);
+ example = "CRANK_3";
+ PowerModeStatus enumCrank3 = PowerModeStatus.valueForString(example);
+
+ assertNotNull("KEY_OUT returned null", enumKeyOut);
+ assertNotNull("KEY_RECENTLY_OUT returned null", enumKeyRecentlyOut);
+ assertNotNull("KEY_APPROVED_0 returned null", enumKeyApproved0);
+ assertNotNull("POST_ACCESORY_0 returned null", enumPostAccessory0);
+ assertNotNull("ACCESORY_1 returned null", enumAccessory1);
+ assertNotNull("POST_IGNITION_1 returned null", enumPostIgnition1);
+ assertNotNull("IGNITION_ON_2 returned null", enumIgnitionOn2);
+ assertNotNull("RUNNING_2 returned null", enumRunning2);
+ assertNotNull("CRANK_3 returned null", enumCrank3);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "key_Out";
+ try {
+ PowerModeStatus temp = PowerModeStatus.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 {
+ PowerModeStatus temp = PowerModeStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of PowerModeStatus.
+ */
+ public void testListEnum() {
+ List<PowerModeStatus> enumValueList = Arrays.asList(PowerModeStatus.values());
+
+ List<PowerModeStatus> enumTestList = new ArrayList<PowerModeStatus>();
+ enumTestList.add(PowerModeStatus.KEY_OUT);
+ enumTestList.add(PowerModeStatus.KEY_RECENTLY_OUT);
+ enumTestList.add(PowerModeStatus.KEY_APPROVED_0);
+ enumTestList.add(PowerModeStatus.POST_ACCESORY_0);
+ enumTestList.add(PowerModeStatus.ACCESORY_1);
+ enumTestList.add(PowerModeStatus.POST_IGNITION_1);
+ enumTestList.add(PowerModeStatus.IGNITION_ON_2);
+ enumTestList.add(PowerModeStatus.RUNNING_2);
+ enumTestList.add(PowerModeStatus.CRANK_3);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java
index 26b32d08b..26b32d08b 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrerecordedSpeechTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrerecordedSpeechTests.java
new file mode 100644
index 000000000..0d34ea99d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrerecordedSpeechTests.java
@@ -0,0 +1,83 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
+
+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.PrerecordedSpeech}
+ */
+public class PrerecordedSpeechTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "HELP_JINGLE";
+ PrerecordedSpeech enumHelpJingle = PrerecordedSpeech.valueForString(example);
+ example = "INITIAL_JINGLE";
+ PrerecordedSpeech enumInitialJingle = PrerecordedSpeech.valueForString(example);
+ example = "LISTEN_JINGLE";
+ PrerecordedSpeech enumListenJingle = PrerecordedSpeech.valueForString(example);
+ example = "POSITIVE_JINGLE";
+ PrerecordedSpeech enumPositiveJingle = PrerecordedSpeech.valueForString(example);
+ example = "NEGATIVE_JINGLE";
+ PrerecordedSpeech enumNegativeJingle = PrerecordedSpeech.valueForString(example);
+
+ assertNotNull("HELP_JINGLE returned null", enumHelpJingle);
+ assertNotNull("INITIAL_JINGLE returned null", enumInitialJingle);
+ assertNotNull("LISTEN_JINGLE returned null", enumListenJingle);
+ assertNotNull("POSITIVE_JINGLE returned null", enumPositiveJingle);
+ assertNotNull("NEGATIVE_JINGLE returned null", enumNegativeJingle);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "heLP_JingLE";
+ try {
+ PrerecordedSpeech temp = PrerecordedSpeech.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 {
+ PrerecordedSpeech temp = PrerecordedSpeech.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of PrerecordedSpeech.
+ */
+ public void testListEnum() {
+ List<PrerecordedSpeech> enumValueList = Arrays.asList(PrerecordedSpeech.values());
+
+ List<PrerecordedSpeech> enumTestList = new ArrayList<PrerecordedSpeech>();
+ enumTestList.add(PrerecordedSpeech.HELP_JINGLE);
+ enumTestList.add(PrerecordedSpeech.INITIAL_JINGLE);
+ enumTestList.add(PrerecordedSpeech.LISTEN_JINGLE);
+ enumTestList.add(PrerecordedSpeech.POSITIVE_JINGLE);
+ enumTestList.add(PrerecordedSpeech.NEGATIVE_JINGLE);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java
index b3432985d..b3432985d 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrndlTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrndlTests.java
new file mode 100644
index 000000000..394d0cd37
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrndlTests.java
@@ -0,0 +1,128 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.PRNDL;
+
+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.Prndl}
+ */
+public class PrndlTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "PARK";
+ PRNDL enumPark = PRNDL.valueForString(example);
+ example = "REVERSE";
+ PRNDL enumReverse = PRNDL.valueForString(example);
+ example = "NEUTRAL";
+ PRNDL enumNeutral = PRNDL.valueForString(example);
+ example = "DRIVE";
+ PRNDL enumDrive = PRNDL.valueForString(example);
+ example = "SPORT";
+ PRNDL enumSport = PRNDL.valueForString(example);
+ example = "LOWGEAR";
+ PRNDL enumLowGear = PRNDL.valueForString(example);
+ example = "FIRST";
+ PRNDL enumFirst = PRNDL.valueForString(example);
+ example = "SECOND";
+ PRNDL enumSecond = PRNDL.valueForString(example);
+ example = "THIRD";
+ PRNDL enumThird = PRNDL.valueForString(example);
+ example = "FOURTH";
+ PRNDL enumFourth = PRNDL.valueForString(example);
+ example = "FIFTH";
+ PRNDL enumFifth = PRNDL.valueForString(example);
+ example = "SIXTH";
+ PRNDL enumSixth = PRNDL.valueForString(example);
+ example = "SEVENTH";
+ PRNDL enumSeventh = PRNDL.valueForString(example);
+ example = "EIGHTH";
+ PRNDL enumEighth = PRNDL.valueForString(example);
+ example = "UNKNOWN";
+ PRNDL enumUnknown = PRNDL.valueForString(example);
+ example = "FAULT";
+ PRNDL enumFault = PRNDL.valueForString(example);
+
+ assertNotNull("PARK returned null", enumPark);
+ assertNotNull("REVERSE returned null", enumReverse);
+ assertNotNull("NEUTRAL returned null", enumNeutral);
+ assertNotNull("DRIVE returned null", enumDrive);
+ assertNotNull("SPORT returned null", enumSport);
+ assertNotNull("LOWGEAR returned null", enumLowGear);
+ assertNotNull("FIRST returned null", enumFirst);
+ assertNotNull("SECOND returned null", enumSecond);
+ assertNotNull("THIRD returned null", enumThird);
+ assertNotNull("FOURTH returned null", enumFourth);
+ assertNotNull("FIFTH returned null", enumFifth);
+ assertNotNull("SIXTH returned null", enumSixth);
+ assertNotNull("SEVENTH returned null", enumSeventh);
+ assertNotNull("EIGHTH returned null", enumEighth);
+ assertNotNull("UNKNOWN returned null", enumUnknown);
+ assertNotNull("FAULT returned null", enumFault);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "pARk";
+ try {
+ PRNDL temp = PRNDL.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 {
+ PRNDL temp = PRNDL.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of PRNDL.
+ */
+ public void testListEnum() {
+ List<PRNDL> enumValueList = Arrays.asList(PRNDL.values());
+
+ List<PRNDL> enumTestList = new ArrayList<PRNDL>();
+ enumTestList.add(PRNDL.PARK);
+ enumTestList.add(PRNDL.REVERSE);
+ enumTestList.add(PRNDL.NEUTRAL);
+ enumTestList.add(PRNDL.DRIVE);
+ enumTestList.add(PRNDL.SPORT);
+ enumTestList.add(PRNDL.LOWGEAR);
+ enumTestList.add(PRNDL.FIRST);
+ enumTestList.add(PRNDL.SECOND);
+ enumTestList.add(PRNDL.THIRD);
+ enumTestList.add(PRNDL.FOURTH);
+ enumTestList.add(PRNDL.FIFTH);
+ enumTestList.add(PRNDL.SIXTH);
+ enumTestList.add(PRNDL.SEVENTH);
+ enumTestList.add(PRNDL.EIGHTH);
+ enumTestList.add(PRNDL.UNKNOWN);
+ enumTestList.add(PRNDL.FAULT);
+
+ 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/RadioBandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioBandTests.java
index cc5d5b700..cc5d5b700 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioBandTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioBandTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioStateTests.java
index d16f00599..d16f00599 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioStateTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RadioStateTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java
new file mode 100644
index 000000000..d721e9b58
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java
@@ -0,0 +1,153 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+import com.smartdevicelink.test.Test;
+
+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.RequestType}
+ */
+public class RequestTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "HTTP";
+ RequestType enumHttp = RequestType.valueForString(example);
+ example = "FILE_RESUME";
+ RequestType enumFileResume = RequestType.valueForString(example);
+ example = "AUTH_REQUEST";
+ RequestType enumAuthRequest = RequestType.valueForString(example);
+ example = "AUTH_CHALLENGE";
+ RequestType enumAuthChallenge = RequestType.valueForString(example);
+ example = "AUTH_ACK";
+ RequestType enumAuthAck = RequestType.valueForString(example);
+ example = "PROPRIETARY";
+ RequestType enumProprietary = RequestType.valueForString(example);
+
+ example = "QUERY_APPS";
+ RequestType enumQueryApps = RequestType.valueForString(example);
+ example = "LAUNCH_APP";
+ RequestType enumLaunchApp = RequestType.valueForString(example);
+ example = "LOCK_SCREEN_ICON_URL";
+ RequestType enumLockScreen = RequestType.valueForString(example);
+ example = "TRAFFIC_MESSAGE_CHANNEL";
+ RequestType enumTrafficMessage = RequestType.valueForString(example);
+ example = "DRIVER_PROFILE";
+ RequestType enumDriverProfile = RequestType.valueForString(example);
+ example = "VOICE_SEARCH";
+ RequestType enumVoiceSearch = RequestType.valueForString(example);
+ example = "NAVIGATION";
+ RequestType enumNavigation = RequestType.valueForString(example);
+ example = "PHONE";
+ RequestType enumPhone = RequestType.valueForString(example);
+ example = "CLIMATE";
+ RequestType enumClimate = RequestType.valueForString(example);
+ example = "SETTINGS";
+ RequestType enumSettings = RequestType.valueForString(example);
+ example = "VEHICLE_DIAGNOSTICS";
+ RequestType enumDiagnostics = RequestType.valueForString(example);
+ example = "EMERGENCY";
+ RequestType enumEmergency = RequestType.valueForString(example);
+ example = "MEDIA";
+ RequestType enumMedia = RequestType.valueForString(example);
+ example = "FOTA";
+ RequestType enumFota = RequestType.valueForString(example);
+ example = "ICON_URL";
+ RequestType enumIconURL = RequestType.valueForString(example);
+
+ assertNotNull("HTTP returned null", enumHttp);
+ assertNotNull("FILE_RESUME returned null", enumFileResume);
+ assertNotNull("AUTH_REQUEST returned null", enumAuthRequest);
+ assertNotNull("AUTH_CHALLENGE returned null", enumAuthChallenge);
+ assertNotNull("AUTH_ACK returned null", enumAuthAck);
+ assertNotNull("PROPRIETARY returned null", enumProprietary);
+ assertNotNull("ICON_URL returned null", enumIconURL);
+
+ assertNotNull(Test.NOT_NULL, enumQueryApps);
+ assertNotNull(Test.NOT_NULL, enumLaunchApp);
+ assertNotNull(Test.NOT_NULL, enumLockScreen);
+ assertNotNull(Test.NOT_NULL, enumTrafficMessage);
+ assertNotNull(Test.NOT_NULL, enumDriverProfile);
+ assertNotNull(Test.NOT_NULL, enumVoiceSearch);
+ assertNotNull(Test.NOT_NULL, enumNavigation);
+ assertNotNull(Test.NOT_NULL, enumPhone);
+ assertNotNull(Test.NOT_NULL, enumClimate);
+ assertNotNull(Test.NOT_NULL, enumSettings);
+ assertNotNull(Test.NOT_NULL, enumDiagnostics);
+ assertNotNull(Test.NOT_NULL, enumEmergency);
+ assertNotNull(Test.NOT_NULL, enumMedia);
+ assertNotNull(Test.NOT_NULL, enumFota);
+ assertNotNull(Test.NOT_NULL, enumIconURL);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "hTTp";
+ try {
+ RequestType temp = RequestType.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 {
+ RequestType temp = RequestType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of RequestType.
+ */
+ public void testListEnum() {
+ List<RequestType> enumValueList = Arrays.asList(RequestType.values());
+
+ List<RequestType> enumTestList = new ArrayList<RequestType>();
+ enumTestList.add(RequestType.HTTP);
+ enumTestList.add(RequestType.FILE_RESUME);
+ enumTestList.add(RequestType.AUTH_REQUEST);
+ enumTestList.add(RequestType.AUTH_CHALLENGE);
+ enumTestList.add(RequestType.AUTH_ACK);
+ enumTestList.add(RequestType.PROPRIETARY);
+
+ enumTestList.add(RequestType.QUERY_APPS);
+ enumTestList.add(RequestType.LAUNCH_APP);
+ enumTestList.add(RequestType.LOCK_SCREEN_ICON_URL);
+ enumTestList.add(RequestType.TRAFFIC_MESSAGE_CHANNEL);
+ enumTestList.add(RequestType.DRIVER_PROFILE);
+ enumTestList.add(RequestType.VOICE_SEARCH);
+ enumTestList.add(RequestType.NAVIGATION);
+ enumTestList.add(RequestType.PHONE);
+ enumTestList.add(RequestType.CLIMATE);
+ enumTestList.add(RequestType.SETTINGS);
+ enumTestList.add(RequestType.VEHICLE_DIAGNOSTICS);
+ enumTestList.add(RequestType.EMERGENCY);
+ enumTestList.add(RequestType.MEDIA);
+ enumTestList.add(RequestType.FOTA);
+ enumTestList.add(RequestType.OEM_SPECIFIC);
+ enumTestList.add(RequestType.ICON_URL);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ResultTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ResultTests.java
new file mode 100644
index 000000000..992f4e54e
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ResultTests.java
@@ -0,0 +1,203 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+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.Result}
+ */
+public class ResultTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "SUCCESS";
+ Result enumSuccess = Result.valueForString(example);
+ example = "INVALID_DATA";
+ Result enumInvalidData = Result.valueForString(example);
+ example = "UNSUPPORTED_REQUEST";
+ Result enumUnsupportedRequest = Result.valueForString(example);
+ example = "OUT_OF_MEMORY";
+ Result enumOutOfMemory = Result.valueForString(example);
+ example = "TOO_MANY_PENDING_REQUESTS";
+ Result enumTooManyPendingRequests = Result.valueForString(example);
+ example = "INVALID_ID";
+ Result enumInvalidId = Result.valueForString(example);
+ example = "DUPLICATE_NAME";
+ Result enumDuplicateName = Result.valueForString(example);
+ example = "TOO_MANY_APPLICATIONS";
+ Result enumTooManyApplications = Result.valueForString(example);
+ example = "APPLICATION_REGISTERED_ALREADY";
+ Result enumApplicationRegisteredAlready = Result.valueForString(example);
+ example = "UNSUPPORTED_VERSION";
+ Result enumUnsupportedVersion = Result.valueForString(example);
+ example = "WRONG_LANGUAGE";
+ Result enumWrongLanguage = Result.valueForString(example);
+ example = "APPLICATION_NOT_REGISTERED";
+ Result enumApplicationNotRegistered = Result.valueForString(example);
+ example = "IN_USE";
+ Result enumInUse = Result.valueForString(example);
+ example = "VEHICLE_DATA_NOT_ALLOWED";
+ Result enumVehicleDataNotAllowed = Result.valueForString(example);
+ example = "VEHICLE_DATA_NOT_AVAILABLE";
+ Result enumVehicleDataNotAvailable = Result.valueForString(example);
+ example = "REJECTED";
+ Result enumRejected = Result.valueForString(example);
+ example = "ABORTED";
+ Result enumAborted = Result.valueForString(example);
+ example = "IGNORED";
+ Result enumIgnored = Result.valueForString(example);
+ example = "UNSUPPORTED_RESOURCE";
+ Result enumUnsupportedResource = Result.valueForString(example);
+ example = "FILE_NOT_FOUND";
+ Result enumFileNotFound = Result.valueForString(example);
+ example = "GENERIC_ERROR";
+ Result enumGenericError = Result.valueForString(example);
+ example = "DISALLOWED";
+ Result enumDisallowed = Result.valueForString(example);
+ example = "USER_DISALLOWED";
+ Result enumUserDisallowed = Result.valueForString(example);
+ example = "TIMED_OUT";
+ Result enumTimedOut = Result.valueForString(example);
+ example = "CANCEL_ROUTE";
+ Result enumCancelRoute = Result.valueForString(example);
+ example = "TRUNCATED_DATA";
+ Result enumTruncatedData = Result.valueForString(example);
+ example = "RETRY";
+ Result enumRetry = Result.valueForString(example);
+ example = "WARNINGS";
+ Result enumWarnings = Result.valueForString(example);
+ example = "SAVED";
+ Result enumSaved = Result.valueForString(example);
+ example = "INVALID_CERT";
+ Result enumInvalidCert = Result.valueForString(example);
+ example = "EXPIRED_CERT";
+ Result enumExpiredCert = Result.valueForString(example);
+ example = "RESUME_FAILED";
+ Result enumResumeFailed = Result.valueForString(example);
+ example = "DATA_NOT_AVAILABLE";
+ Result enumDataNotAvailable = Result.valueForString(example);
+ example = "READ_ONLY";
+ Result enumReadOnly = Result.valueForString(example);
+ example = "CORRUPTED_DATA";
+ Result enumCorruptData = Result.valueForString(example);
+
+ assertNotNull("SUCCESS returned null", enumSuccess);
+ assertNotNull("INVALID_DATA returned null", enumInvalidData);
+ assertNotNull("UNSUPPORTED_REQUEST returned null", enumUnsupportedRequest);
+ assertNotNull("OUT_OF_MEMORY returned null", enumOutOfMemory);
+ assertNotNull("TOO_MANY_PENDING_REQUESTS returned null", enumTooManyPendingRequests);
+ assertNotNull("INVALID_ID returned null", enumInvalidId);
+ assertNotNull("DUPLICATE_NAME returned null", enumDuplicateName);
+ assertNotNull("TOO_MANY_APPLICATIONS returned null", enumTooManyApplications);
+ assertNotNull("APPLICATION_REGISTERED_ALREADY returned null", enumApplicationRegisteredAlready);
+ assertNotNull("UNSUPPORTED_VERSION returned null", enumUnsupportedVersion);
+ assertNotNull("WRONG_LANGUAGE returned null", enumWrongLanguage);
+ assertNotNull("APPLICATION_NOT_REGISTERED returned null", enumApplicationNotRegistered);
+ assertNotNull("IN_USE returned null", enumInUse);
+ assertNotNull("VEHICLE_DATA_NOT_ALLOWED returned null", enumVehicleDataNotAllowed);
+ assertNotNull("VEHICLE_DATA_NOT_AVAILABLE returned null", enumVehicleDataNotAvailable);
+ assertNotNull("REJECTED returned null", enumRejected);
+ assertNotNull("ABORTED returned null", enumAborted);
+ assertNotNull("IGNORED returned null", enumIgnored);
+ assertNotNull("UNSUPPORTED_RESOURCE returned null", enumUnsupportedResource);
+ assertNotNull("FILE_NOT_FOUND returned null", enumFileNotFound);
+ assertNotNull("GENERIC_ERROR returned null", enumGenericError);
+ assertNotNull("DISALLOWED returned null", enumDisallowed);
+ assertNotNull("USER_DISALLOWED returned null", enumUserDisallowed);
+ assertNotNull("TIMED_OUT returned null", enumTimedOut);
+ assertNotNull("CANCEL_ROUTE returned null", enumCancelRoute);
+ assertNotNull("TRUNCATED_DATA returned null", enumTruncatedData);
+ assertNotNull("RETRY returned null", enumRetry);
+ assertNotNull("WARNINGS returned null", enumWarnings);
+ assertNotNull("SAVED returned null", enumSaved);
+ assertNotNull("INVALID_CERT returned null", enumInvalidCert);
+ assertNotNull("EXPIRED_CERT returned null", enumExpiredCert);
+ assertNotNull("RESUME_FAILED returned null", enumResumeFailed);
+ assertNotNull("DATA_NOT_AVAILABLE returned null", enumDataNotAvailable);
+ assertNotNull("READ_ONLY returned null", enumReadOnly);
+ assertNotNull("CORRUPTED_DATA", enumCorruptData);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "suCcesS";
+ try {
+ Result temp = Result.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 {
+ Result temp = Result.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of Result.
+ */
+ public void testListEnum() {
+ List<Result> enumValueList = Arrays.asList(Result.values());
+
+ List<Result> enumTestList = new ArrayList<Result>();
+ enumTestList.add(Result.SUCCESS);
+ enumTestList.add(Result.INVALID_DATA);
+ enumTestList.add(Result.UNSUPPORTED_REQUEST);
+ enumTestList.add(Result.OUT_OF_MEMORY);
+ enumTestList.add(Result.TOO_MANY_PENDING_REQUESTS);
+ enumTestList.add(Result.INVALID_ID);
+ enumTestList.add(Result.DUPLICATE_NAME);
+ enumTestList.add(Result.TOO_MANY_APPLICATIONS);
+ enumTestList.add(Result.APPLICATION_REGISTERED_ALREADY);
+ enumTestList.add(Result.UNSUPPORTED_VERSION);
+ enumTestList.add(Result.WRONG_LANGUAGE);
+ enumTestList.add(Result.APPLICATION_NOT_REGISTERED);
+ enumTestList.add(Result.IN_USE);
+ enumTestList.add(Result.VEHICLE_DATA_NOT_ALLOWED);
+ enumTestList.add(Result.VEHICLE_DATA_NOT_AVAILABLE);
+ enumTestList.add(Result.REJECTED);
+ enumTestList.add(Result.ABORTED);
+ enumTestList.add(Result.IGNORED);
+ enumTestList.add(Result.UNSUPPORTED_RESOURCE);
+ enumTestList.add(Result.FILE_NOT_FOUND);
+ enumTestList.add(Result.GENERIC_ERROR);
+ enumTestList.add(Result.DISALLOWED);
+ enumTestList.add(Result.USER_DISALLOWED);
+ enumTestList.add(Result.TIMED_OUT);
+ enumTestList.add(Result.CANCEL_ROUTE);
+ enumTestList.add(Result.TRUNCATED_DATA);
+ enumTestList.add(Result.RETRY);
+ enumTestList.add(Result.WARNINGS);
+ enumTestList.add(Result.SAVED);
+ enumTestList.add(Result.INVALID_CERT);
+ enumTestList.add(Result.EXPIRED_CERT);
+ enumTestList.add(Result.RESUME_FAILED);
+ enumTestList.add(Result.DATA_NOT_AVAILABLE);
+ enumTestList.add(Result.READ_ONLY);
+ enumTestList.add(Result.CORRUPTED_DATA);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SamplingRateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SamplingRateTests.java
new file mode 100644
index 000000000..d40b20269
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SamplingRateTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+
+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.SamplingRate}
+ */
+public class SamplingRateTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "8KHZ";
+ SamplingRate enum8Khz = SamplingRate.valueForString(example);
+ example = "16KHZ";
+ SamplingRate enum16Khz = SamplingRate.valueForString(example);
+ example = "22KHZ";
+ SamplingRate enum22Khz = SamplingRate.valueForString(example);
+ example = "44KHZ";
+ SamplingRate enum44Khz = SamplingRate.valueForString(example);
+
+ assertNotNull("8KHZ returned null", enum8Khz);
+ assertNotNull("16KHZ returned null", enum16Khz);
+ assertNotNull("22KHZ returned null", enum22Khz);
+ assertNotNull("44KHZ returned null", enum44Khz);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "8kHz";
+ try {
+ SamplingRate temp = SamplingRate.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 {
+ SamplingRate temp = SamplingRate.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of SamplingRate.
+ */
+ public void testListEnum() {
+ List<SamplingRate> enumValueList = Arrays.asList(SamplingRate.values());
+
+ List<SamplingRate> enumTestList = new ArrayList<SamplingRate>();
+ enumTestList.add(SamplingRate._8KHZ);
+ enumTestList.add(SamplingRate._16KHZ);
+ enumTestList.add(SamplingRate._22KHZ);
+ enumTestList.add(SamplingRate._44KHZ);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java
new file mode 100644
index 000000000..d264b2563
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java
@@ -0,0 +1,176 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
+import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
+import com.smartdevicelink.test.Test;
+
+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.SdlDisconnectedReason}
+ */
+public class SdlDisconnectedReasonTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "USER_EXIT";
+ SdlDisconnectedReason enumUserExit = SdlDisconnectedReason.valueForString(example);
+ example = "IGNITION_OFF";
+ SdlDisconnectedReason enumIgnitionOff = SdlDisconnectedReason.valueForString(example);
+ example = "BLUETOOTH_OFF";
+ SdlDisconnectedReason enumBluetoothOff = SdlDisconnectedReason.valueForString(example);
+ example = "USB_DISCONNECTED";
+ SdlDisconnectedReason enumUsbDisconnected = SdlDisconnectedReason.valueForString(example);
+ example = "REQUEST_WHILE_IN_NONE_HMI_LEVEL";
+ SdlDisconnectedReason enumRequestWhileInNoneHmiLevel = SdlDisconnectedReason.valueForString(example);
+ example = "TOO_MANY_REQUESTS";
+ SdlDisconnectedReason enumTooManyRequests = SdlDisconnectedReason.valueForString(example);
+ example = "DRIVER_DISTRACTION_VIOLATION";
+ SdlDisconnectedReason enumDriverDistractionViolation = SdlDisconnectedReason.valueForString(example);
+ example = "LANGUAGE_CHANGE";
+ SdlDisconnectedReason enumLanuguageChange = SdlDisconnectedReason.valueForString(example);
+ example = "MASTER_RESET";
+ SdlDisconnectedReason enumMasterReset = SdlDisconnectedReason.valueForString(example);
+ example = "FACTORY_DEFAULTS";
+ SdlDisconnectedReason enumFactoryDefaults = SdlDisconnectedReason.valueForString(example);
+ example = "TRANSPORT_ERROR";
+ SdlDisconnectedReason enumTransportError = SdlDisconnectedReason.valueForString(example);
+ example = "APPLICATION_REQUESTED_DISCONNECT";
+ SdlDisconnectedReason enumApplicationRequestedDisconnect = SdlDisconnectedReason.valueForString(example);
+ example = "DEFAULT";
+ SdlDisconnectedReason enumDefault = SdlDisconnectedReason.valueForString(example);
+ example = "TRANSPORT_DISCONNECT";
+ SdlDisconnectedReason enumTransportDisconnect = SdlDisconnectedReason.valueForString(example);
+ example = "HB_TIMEOUT";
+ SdlDisconnectedReason enumHbTimeout = SdlDisconnectedReason.valueForString(example);
+ example = "BLUETOOTH_DISABLED";
+ SdlDisconnectedReason enumBluetoothDisabled = SdlDisconnectedReason.valueForString(example);
+ example = "BLUETOOTH_ADAPTER_ERROR";
+ SdlDisconnectedReason enumBluetoothAdapterError = SdlDisconnectedReason.valueForString(example);
+ example = "SDL_REGISTRATION_ERROR";
+ SdlDisconnectedReason enumSdlRegistrationError = SdlDisconnectedReason.valueForString(example);
+ example = "APP_INTERFACE_UNREG";
+ SdlDisconnectedReason enumAppInterfaceUnreg = SdlDisconnectedReason.valueForString(example);
+ example = "GENERIC_ERROR";
+ SdlDisconnectedReason enumGenericError = SdlDisconnectedReason.valueForString(example);
+ example = "LEGACY_BLUETOOTH_MODE_ENABLED";
+ SdlDisconnectedReason enumLegacyMode = SdlDisconnectedReason.valueForString(example);
+ example = "RPC_SESSION_ENDED";
+ SdlDisconnectedReason enumRpcSessionEnded = SdlDisconnectedReason.valueForString(example);
+
+ assertNotNull("USER_EXIT returned null", enumUserExit);
+ assertNotNull("IGNITION_OFF returned null", enumIgnitionOff);
+ assertNotNull("BLUETOOTH_OFF returned null", enumBluetoothOff);
+ assertNotNull("USB_DISCONNECTED returned null", enumUsbDisconnected);
+ assertNotNull("REQUEST_WHILE_IN_NONE_HMI_LEVEL returned null", enumRequestWhileInNoneHmiLevel);
+ assertNotNull("TOO_MANY_REQUESTS returned null", enumTooManyRequests);
+ assertNotNull("DRIVER_DISTRACTION_VIOLATION returned null", enumDriverDistractionViolation);
+ assertNotNull("LANGUAGE_CHANGE returned null", enumLanuguageChange);
+ assertNotNull("MASTER_RESET returned null", enumMasterReset);
+ assertNotNull("FACTORY_DEFAULTS returned null", enumFactoryDefaults);
+ assertNotNull("TRANSPORT_ERROR returned null", enumTransportError);
+ assertNotNull("APPLICATION_REQUESTED_DISCONNECT returned null", enumApplicationRequestedDisconnect);
+ assertNotNull("DEFAULT returned null", enumDefault);
+ assertNotNull("TRANSPORT_DISCONNECT returned null", enumTransportDisconnect);
+ assertNotNull("HB_TIMEOUT returned null", enumHbTimeout);
+ assertNotNull("BLUETOOTH_DISABLED returned null", enumBluetoothDisabled);
+ assertNotNull("BLUETOOTH_ADAPTER_ERROR returned null", enumBluetoothAdapterError);
+ assertNotNull("SDL_REGISTRATION_ERROR returned null", enumSdlRegistrationError);
+ assertNotNull("APP_INTERFACE_UNREG returned null", enumAppInterfaceUnreg);
+ assertNotNull("GENERIC_ERROR returned null", enumGenericError);
+ assertNotNull("LEGACY_BLUETOOTH_MODE_ENABLED returned null", enumLegacyMode);
+ assertNotNull("RPC_SESSION_ENDED returned null", enumRpcSessionEnded);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "uSer_ExiT";
+ try {
+ SdlDisconnectedReason temp = SdlDisconnectedReason.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 {
+ SdlDisconnectedReason temp = SdlDisconnectedReason.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of SdlDisconnectedReason.
+ */
+ public void testListEnum() {
+ List<SdlDisconnectedReason> enumValueList = Arrays.asList(SdlDisconnectedReason.values());
+
+ List<SdlDisconnectedReason> enumTestList = new ArrayList<SdlDisconnectedReason>();
+ enumTestList.add(SdlDisconnectedReason.USER_EXIT);
+ enumTestList.add(SdlDisconnectedReason.IGNITION_OFF);
+ enumTestList.add(SdlDisconnectedReason.BLUETOOTH_OFF);
+ enumTestList.add(SdlDisconnectedReason.USB_DISCONNECTED);
+ enumTestList.add(SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL);
+ enumTestList.add(SdlDisconnectedReason.TOO_MANY_REQUESTS);
+ enumTestList.add(SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION);
+ enumTestList.add(SdlDisconnectedReason.LANGUAGE_CHANGE);
+ enumTestList.add(SdlDisconnectedReason.MASTER_RESET);
+ enumTestList.add(SdlDisconnectedReason.FACTORY_DEFAULTS);
+ enumTestList.add(SdlDisconnectedReason.TRANSPORT_ERROR);
+ enumTestList.add(SdlDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);
+ enumTestList.add(SdlDisconnectedReason.DEFAULT);
+ enumTestList.add(SdlDisconnectedReason.TRANSPORT_DISCONNECT);
+ enumTestList.add(SdlDisconnectedReason.HB_TIMEOUT);
+ enumTestList.add(SdlDisconnectedReason.BLUETOOTH_DISABLED);
+ enumTestList.add(SdlDisconnectedReason.BLUETOOTH_ADAPTER_ERROR);
+ enumTestList.add(SdlDisconnectedReason.SDL_REGISTRATION_ERROR);
+ enumTestList.add(SdlDisconnectedReason.APP_INTERFACE_UNREG);
+ enumTestList.add(SdlDisconnectedReason.GENERIC_ERROR);
+ enumTestList.add(SdlDisconnectedReason.LEGACY_BLUETOOTH_MODE_ENABLED);
+ enumTestList.add(SdlDisconnectedReason.RPC_SESSION_ENDED);
+ enumTestList.add(SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST);
+ enumTestList.add(SdlDisconnectedReason.MINIMUM_PROTOCOL_VERSION_HIGHER_THAN_SUPPORTED);
+ enumTestList.add(SdlDisconnectedReason.MINIMUM_RPC_VERSION_HIGHER_THAN_SUPPORTED);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+
+ /**
+ * Verifies the valid returns of the conversion method,
+ * {@link com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason#convertAppInterfaceunregisteredReason(AppInterfaceUnregisteredReason)}
+ */
+ public void testConvertMethod () {
+ assertEquals(Test.MATCH, SdlDisconnectedReason.DEFAULT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.BLUETOOTH_OFF, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.BLUETOOTH_OFF));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.DRIVER_DISTRACTION_VIOLATION));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.FACTORY_DEFAULTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.FACTORY_DEFAULTS));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.IGNITION_OFF, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.IGNITION_OFF));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.LANGUAGE_CHANGE, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.LANGUAGE_CHANGE));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.MASTER_RESET, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.MASTER_RESET));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.TOO_MANY_REQUESTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.TOO_MANY_REQUESTS));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.USB_DISCONNECTED, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USB_DISCONNECTED));
+ assertEquals(Test.MATCH, SdlDisconnectedReason.USER_EXIT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USER_EXIT));
+ assertNull(Test.MATCH, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(null));
+ }
+
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java
index 2642e35d3..2642e35d3 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ServiceUpdateReasonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ServiceUpdateReasonTests.java
new file mode 100644
index 000000000..f2484ff9e
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ServiceUpdateReasonTests.java
@@ -0,0 +1,84 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason;
+
+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.ServiceUpdateReason}
+ */
+public class ServiceUpdateReasonTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "PUBLISHED";
+ ServiceUpdateReason enumPublished = ServiceUpdateReason.valueForString(example);
+ example = "REMOVED";
+ ServiceUpdateReason enumRemoved = ServiceUpdateReason.valueForString(example);
+ example = "ACTIVATED";
+ ServiceUpdateReason enumActivated = ServiceUpdateReason.valueForString(example);
+ example = "DEACTIVATED";
+ ServiceUpdateReason enumDeactivated = ServiceUpdateReason.valueForString(example);
+ example = "MANIFEST_UPDATE";
+ ServiceUpdateReason enumManifestUpdate = ServiceUpdateReason.valueForString(example);
+
+
+ assertNotNull("PUBLISHED returned null", enumPublished);
+ assertNotNull("REMOVED returned null", enumRemoved);
+ assertNotNull("ACTIVATED returned null", enumActivated);
+ assertNotNull("DEACTIVATED returned null", enumDeactivated);
+ assertNotNull("MANIFEST_UPDATE returned null", enumManifestUpdate);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "HalFActIvAted";
+ try {
+ ServiceUpdateReason temp = ServiceUpdateReason.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 {
+ ServiceUpdateReason temp = ServiceUpdateReason.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of ServiceUpdateReason.
+ */
+ public void testListEnum() {
+ List<ServiceUpdateReason> enumValueList = Arrays.asList(ServiceUpdateReason.values());
+
+ List<ServiceUpdateReason> enumTestList = new ArrayList<>();
+ enumTestList.add(ServiceUpdateReason.MANIFEST_UPDATE);
+ enumTestList.add(ServiceUpdateReason.ACTIVATED);
+ enumTestList.add(ServiceUpdateReason.DEACTIVATED);
+ enumTestList.add(ServiceUpdateReason.PUBLISHED);
+ enumTestList.add(ServiceUpdateReason.REMOVED);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SoftButtonTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SoftButtonTypeTests.java
new file mode 100644
index 000000000..5fa102b44
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SoftButtonTypeTests.java
@@ -0,0 +1,76 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
+
+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.SoftButtonType}
+ */
+public class SoftButtonTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "TEXT";
+ SoftButtonType enumText = SoftButtonType.valueForString(example);
+ example = "IMAGE";
+ SoftButtonType enumImage = SoftButtonType.valueForString(example);
+ example = "BOTH";
+ SoftButtonType enumBoth = SoftButtonType.valueForString(example);
+
+ assertNotNull("TEXT returned null", enumText);
+ assertNotNull("IMAGE returned null", enumImage);
+ assertNotNull("BOTH returned null", enumBoth);
+ }
+
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "teXT";
+ try {
+ SoftButtonType temp = SoftButtonType.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 {
+ SoftButtonType temp = SoftButtonType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of SoftButtonType.
+ */
+ public void testListEnum() {
+ List<SoftButtonType> enumValueList = Arrays.asList(SoftButtonType.values());
+
+ List<SoftButtonType> enumTestList = new ArrayList<SoftButtonType>();
+ enumTestList.add(SoftButtonType.SBT_TEXT);
+ enumTestList.add(SoftButtonType.SBT_IMAGE);
+ enumTestList.add(SoftButtonType.SBT_BOTH);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SpeechCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SpeechCapabilitiesTests.java
new file mode 100644
index 000000000..b8bb12360
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SpeechCapabilitiesTests.java
@@ -0,0 +1,84 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+
+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.SpeechCapabilities}
+ */
+public class SpeechCapabilitiesTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "TEXT";
+ SpeechCapabilities enumText = SpeechCapabilities.valueForString(example);
+ example = "SAPI_PHONEMES";
+ SpeechCapabilities enumSapiPhonemes = SpeechCapabilities.valueForString(example);
+ example = "LHPLUS_PHONEMES";
+ SpeechCapabilities enumLhplusPhonemes = SpeechCapabilities.valueForString(example);
+ example = "PRE_RECORDED";
+ SpeechCapabilities enumPreRecorded = SpeechCapabilities.valueForString(example);
+ example = "SILENCE";
+ SpeechCapabilities enumSilence = SpeechCapabilities.valueForString(example);
+
+ assertNotNull("TEXT returned null", enumText);
+ assertNotNull("SAPI_PHONEMES returned null", enumSapiPhonemes);
+ assertNotNull("LHPLUS_PHONEMES returned null", enumLhplusPhonemes);
+ assertNotNull("PRE_RECORDED returned null", enumPreRecorded);
+ assertNotNull("SILENCE returned null", enumSilence);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "teXT";
+ try {
+ SpeechCapabilities temp = SpeechCapabilities.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 {
+ SpeechCapabilities temp = SpeechCapabilities.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of SpeechCapabilities.
+ */
+ public void testListEnum() {
+ List<SpeechCapabilities> enumValueList = Arrays.asList(SpeechCapabilities.values());
+
+ List<SpeechCapabilities> enumTestList = new ArrayList<SpeechCapabilities>();
+ enumTestList.add(SpeechCapabilities.TEXT);
+ enumTestList.add(SpeechCapabilities.SAPI_PHONEMES);
+ enumTestList.add(SpeechCapabilities.LHPLUS_PHONEMES);
+ enumTestList.add(SpeechCapabilities.PRE_RECORDED);
+ enumTestList.add(SpeechCapabilities.SILENCE);
+ enumTestList.add(SpeechCapabilities.FILE);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java
index b85905039..b85905039 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java
index 6a2dbd18f..6a2dbd18f 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemActionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemActionTests.java
new file mode 100644
index 000000000..d0eb9cf5e
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemActionTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.SystemAction;
+
+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.SystemAction}
+ */
+public class SystemActionTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "DEFAULT_ACTION";
+ SystemAction enumDefaultAction = SystemAction.valueForString(example);
+ example = "STEAL_FOCUS";
+ SystemAction enumStealFocus = SystemAction.valueForString(example);
+ example = "KEEP_CONTEXT";
+ SystemAction enumKeepContext = SystemAction.valueForString(example);
+
+ assertNotNull("DEFAULT_ACTION returned null", enumDefaultAction);
+ assertNotNull("STEAL_FOCUS returned null", enumStealFocus);
+ assertNotNull("KEEP_CONTEXT returned null", enumKeepContext);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "deFaulT_ActiON";
+ try {
+ SystemAction temp = SystemAction.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 {
+ SystemAction temp = SystemAction.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of SystemAction.
+ */
+ public void testListEnum() {
+ List<SystemAction> enumValueList = Arrays.asList(SystemAction.values());
+
+ List<SystemAction> enumTestList = new ArrayList<SystemAction>();
+ enumTestList.add(SystemAction.DEFAULT_ACTION);
+ enumTestList.add(SystemAction.STEAL_FOCUS);
+ enumTestList.add(SystemAction.KEEP_CONTEXT);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemCapabilityTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemCapabilityTypeTests.java
new file mode 100644
index 000000000..f0f876d00
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemCapabilityTypeTests.java
@@ -0,0 +1,123 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+
+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.SystemCapabilityType}
+ */
+public class SystemCapabilityTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NAVIGATION";
+ SystemCapabilityType enumNavigation = SystemCapabilityType.valueForString(example);
+ example = "PHONE_CALL";
+ SystemCapabilityType enumPhoneCall = SystemCapabilityType.valueForString(example);
+ example = "VIDEO_STREAMING";
+ SystemCapabilityType enumVideoStreaming = SystemCapabilityType.valueForString(example);
+ example = "REMOTE_CONTROL";
+ SystemCapabilityType enumRemoteControl = SystemCapabilityType.valueForString(example);
+ example = "HMI";
+ SystemCapabilityType enumHmi = SystemCapabilityType.valueForString(example);
+ example = "DISPLAY";
+ SystemCapabilityType enumDisplay = SystemCapabilityType.valueForString(example);
+ example = "AUDIO_PASSTHROUGH";
+ SystemCapabilityType enumAudioPassThrough = SystemCapabilityType.valueForString(example);
+ example = "BUTTON";
+ SystemCapabilityType enumButton = SystemCapabilityType.valueForString(example);
+ example = "HMI_ZONE";
+ SystemCapabilityType enumHmiZone = SystemCapabilityType.valueForString(example);
+ example = "PRESET_BANK";
+ SystemCapabilityType enumPresetBank = SystemCapabilityType.valueForString(example);
+ example = "SOFTBUTTON";
+ SystemCapabilityType enumSoftButton = SystemCapabilityType.valueForString(example);
+ example = "SPEECH";
+ SystemCapabilityType enumSpeech = SystemCapabilityType.valueForString(example);
+ example = "VOICE_RECOGNITION";
+ SystemCapabilityType enumVoiceRecognition = SystemCapabilityType.valueForString(example);
+ example = "PCM_STREAMING";
+ SystemCapabilityType enumPCM = SystemCapabilityType.valueForString(example);
+ example = "APP_SERVICES";
+ SystemCapabilityType enumAppServices = SystemCapabilityType.valueForString(example);
+
+ assertNotNull("NAVIGATION returned null", enumNavigation);
+ assertNotNull("PHONE_CALL returned null", enumPhoneCall);
+ assertNotNull("VIDEO_STREAMING returned null", enumVideoStreaming);
+ assertNotNull("REMOTE_CONTROL returned null", enumRemoteControl);
+ assertNotNull("HMI returned null", enumHmi);
+ assertNotNull("DISPLAY returned null", enumDisplay);
+ assertNotNull("AUDIO_PASSTHROUGH returned null", enumAudioPassThrough);
+ assertNotNull("BUTTON returned null", enumButton);
+ assertNotNull("HMI_ZONE returned null", enumHmiZone);
+ assertNotNull("PRESET_BANK returned null", enumPresetBank);
+ assertNotNull("SOFTBUTTON returned null", enumSoftButton);
+ assertNotNull("SPEECH returned null", enumSpeech);
+ assertNotNull("VOICE_RECOGNITION returned null", enumVoiceRecognition);
+ assertNotNull("PCM_STREAMING", enumPCM);
+ assertNotNull("APP_SERVICES", enumAppServices);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "nAVIGATION";
+ try {
+ SystemCapabilityType temp = SystemCapabilityType.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 {
+ SystemCapabilityType temp = SystemCapabilityType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of SystemCapabilityType.
+ */
+ public void testListEnum() {
+ List<SystemCapabilityType> enumValueList = Arrays.asList(SystemCapabilityType.values());
+
+ List<SystemCapabilityType> enumTestList = new ArrayList<SystemCapabilityType>();
+ enumTestList.add(SystemCapabilityType.NAVIGATION);
+ enumTestList.add(SystemCapabilityType.PHONE_CALL);
+ enumTestList.add(SystemCapabilityType.VIDEO_STREAMING);
+ enumTestList.add(SystemCapabilityType.REMOTE_CONTROL);
+ enumTestList.add(SystemCapabilityType.HMI);
+ enumTestList.add(SystemCapabilityType.DISPLAY);
+ enumTestList.add(SystemCapabilityType.AUDIO_PASSTHROUGH);
+ enumTestList.add(SystemCapabilityType.BUTTON);
+ enumTestList.add(SystemCapabilityType.HMI_ZONE);
+ enumTestList.add(SystemCapabilityType.PRESET_BANK);
+ enumTestList.add(SystemCapabilityType.SOFTBUTTON);
+ enumTestList.add(SystemCapabilityType.SPEECH);
+ enumTestList.add(SystemCapabilityType.VOICE_RECOGNITION);
+ enumTestList.add(SystemCapabilityType.PCM_STREAMING);
+ enumTestList.add(SystemCapabilityType.APP_SERVICES);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemContextTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemContextTests.java
new file mode 100644
index 000000000..1e635e1bd
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemContextTests.java
@@ -0,0 +1,83 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.SystemContext;
+
+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.SystemContext}
+ */
+public class SystemContextTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "MAIN";
+ SystemContext enumMain = SystemContext.valueForString(example);
+ example = "VRSESSION";
+ SystemContext enumVrSession = SystemContext.valueForString(example);
+ example = "MENU";
+ SystemContext enumMenu = SystemContext.valueForString(example);
+ example = "HMI_OBSCURED";
+ SystemContext enumHmiObscured = SystemContext.valueForString(example);
+ example = "ALERT";
+ SystemContext enumAlert = SystemContext.valueForString(example);
+
+ assertNotNull("MAIN returned null", enumMain);
+ assertNotNull("VRSESSION returned null", enumVrSession);
+ assertNotNull("MENU returned null", enumMenu);
+ assertNotNull("HMI_OBSCURED returned null", enumHmiObscured);
+ assertNotNull("ALERT returned null", enumAlert);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "mAIn";
+ try {
+ SystemContext temp = SystemContext.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 {
+ SystemContext temp = SystemContext.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of SystemContext.
+ */
+ public void testListEnum() {
+ List<SystemContext> enumValueList = Arrays.asList(SystemContext.values());
+
+ List<SystemContext> enumTestList = new ArrayList<SystemContext>();
+ enumTestList.add(SystemContext.SYSCTXT_MAIN);
+ enumTestList.add(SystemContext.SYSCTXT_VRSESSION);
+ enumTestList.add(SystemContext.SYSCTXT_MENU);
+ enumTestList.add(SystemContext.SYSCTXT_HMI_OBSCURED);
+ enumTestList.add(SystemContext.SYSCTXT_ALERT);
+
+ 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/TPMSTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TPMSTests.java
index c573a0d7a..c573a0d7a 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TPMSTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TPMSTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TbtStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TbtStateTests.java
new file mode 100644
index 000000000..214be8a34
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TbtStateTests.java
@@ -0,0 +1,103 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.TBTState;
+
+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.TbtState}
+ */
+public class TbtStateTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "ROUTE_UPDATE_REQUEST";
+ TBTState enumRouteUpdateRequest = TBTState.valueForString(example);
+ example = "ROUTE_ACCEPTED";
+ TBTState enumRouteAccepted = TBTState.valueForString(example);
+ example = "ROUTE_REFUSED";
+ TBTState enumRouteRefused = TBTState.valueForString(example);
+ example = "ROUTE_CANCELLED";
+ TBTState enumRouteCancelled = TBTState.valueForString(example);
+ example = "ETA_REQUEST";
+ TBTState enumEtaEquest = TBTState.valueForString(example);
+ example = "NEXT_TURN_REQUEST";
+ TBTState enumNextTurnRequest = TBTState.valueForString(example);
+ example = "ROUTE_STATUS_REQUEST";
+ TBTState enumRouteStatusRequest = TBTState.valueForString(example);
+ example = "ROUTE_SUMMARY_REQUEST";
+ TBTState enumRouteSummaryRequest = TBTState.valueForString(example);
+ example = "TRIP_STATUS_REQUEST";
+ TBTState enumTripStatusRequest = TBTState.valueForString(example);
+ example = "ROUTE_UPDATE_REQUEST_TIMEOUT";
+ TBTState enumRouteUpdateRequestTimeout = TBTState.valueForString(example);
+
+ assertNotNull("ROUTE_UPDATE_REQUEST returned null", enumRouteUpdateRequest);
+ assertNotNull("ROUTE_ACCEPTED returned null", enumRouteAccepted);
+ assertNotNull("ROUTE_REFUSED returned null", enumRouteRefused);
+ assertNotNull("ROUTE_CANCELLED returned null", enumRouteCancelled);
+ assertNotNull("ETA_REQUEST returned null", enumEtaEquest);
+ assertNotNull("NEXT_TURN_REQUEST returned null", enumNextTurnRequest);
+ assertNotNull("ROUTE_STATUS_REQUEST returned null", enumRouteStatusRequest);
+ assertNotNull("ROUTE_SUMMARY_REQUEST returned null", enumRouteSummaryRequest);
+ assertNotNull("TRIP_STATUS_REQUEST returned null", enumTripStatusRequest);
+ assertNotNull("ROUTE_UPDATE_REQUEST_TIMEOUT returned null", enumRouteUpdateRequestTimeout);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "rOUte_UpDAte_reQuesT";
+ try {
+ TBTState temp = TBTState.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 {
+ TBTState temp = TBTState.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of TBTState.
+ */
+ public void testListEnum() {
+ List<TBTState> enumValueList = Arrays.asList(TBTState.values());
+
+ List<TBTState> enumTestList = new ArrayList<TBTState>();
+ enumTestList.add(TBTState.ROUTE_UPDATE_REQUEST);
+ enumTestList.add(TBTState.ROUTE_ACCEPTED);
+ enumTestList.add(TBTState.ROUTE_REFUSED);
+ enumTestList.add(TBTState.ROUTE_CANCELLED);
+ enumTestList.add(TBTState.ETA_REQUEST);
+ enumTestList.add(TBTState.NEXT_TURN_REQUEST);
+ enumTestList.add(TBTState.ROUTE_STATUS_REQUEST);
+ enumTestList.add(TBTState.ROUTE_SUMMARY_REQUEST);
+ enumTestList.add(TBTState.TRIP_STATUS_REQUEST);
+ enumTestList.add(TBTState.ROUTE_UPDATE_REQUEST_TIMEOUT);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextAlignmentTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextAlignmentTests.java
new file mode 100644
index 000000000..394f74dab
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextAlignmentTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+
+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.TextAlignment}
+ */
+public class TextAlignmentTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "LEFT_ALIGNED";
+ TextAlignment enumLeftAligned = TextAlignment.valueForString(example);
+ example = "RIGHT_ALIGNED";
+ TextAlignment enumRightAligned = TextAlignment.valueForString(example);
+ example = "CENTERED";
+ TextAlignment enumCentered = TextAlignment.valueForString(example);
+
+ assertNotNull("LEFT_ALIGNED returned null", enumLeftAligned);
+ assertNotNull("RIGHT_ALIGNED returned null", enumRightAligned);
+ assertNotNull("CENTERED returned null", enumCentered);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "leFT_AliGned";
+ try {
+ TextAlignment temp = TextAlignment.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 {
+ TextAlignment temp = TextAlignment.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of TextAlignment.
+ */
+ public void testListEnum() {
+ List<TextAlignment> enumValueList = Arrays.asList(TextAlignment.values());
+
+ List<TextAlignment> enumTestList = new ArrayList<TextAlignment>();
+ enumTestList.add(TextAlignment.LEFT_ALIGNED);
+ enumTestList.add(TextAlignment.RIGHT_ALIGNED);
+ enumTestList.add(TextAlignment.CENTERED);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java
new file mode 100644
index 000000000..4703b6ee0
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java
@@ -0,0 +1,178 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+import com.smartdevicelink.test.Test;
+
+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.TextFieldName}
+ */
+public class TextFieldNameTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "mainField1";
+ TextFieldName enumMainField1 = TextFieldName.valueForString(example);
+ example = "mainField2";
+ TextFieldName enumMainField2 = TextFieldName.valueForString(example);
+ example = "mainField3";
+ TextFieldName enumMainField3 = TextFieldName.valueForString(example);
+ example = "mainField4";
+ TextFieldName enumMainField4 = TextFieldName.valueForString(example);
+ example = "statusBar";
+ TextFieldName enumStatusBar = TextFieldName.valueForString(example);
+ example = "mediaClock";
+ TextFieldName enumMediaClock = TextFieldName.valueForString(example);
+ example = "mediaTrack";
+ TextFieldName enumMediaTrack = TextFieldName.valueForString(example);
+ example = "alertText1";
+ TextFieldName enumAlertText1 = TextFieldName.valueForString(example);
+ example = "alertText2";
+ TextFieldName enumAlertText2 = TextFieldName.valueForString(example);
+ example = "alertText3";
+ TextFieldName enumAlertText3 = TextFieldName.valueForString(example);
+ example = "scrollableMessageBody";
+ TextFieldName enumScrollableMessageBody = TextFieldName.valueForString(example);
+ example = "initialInteractionText";
+ TextFieldName enumInitialInteractionText = TextFieldName.valueForString(example);
+ example = "navigationText1";
+ TextFieldName enumNavigationText1 = TextFieldName.valueForString(example);
+ example = "navigationText2";
+ TextFieldName enumNavigationText2 = TextFieldName.valueForString(example);
+ example = "ETA";
+ TextFieldName enumEta = TextFieldName.valueForString(example);
+ example = "totalDistance";
+ TextFieldName enumTotalDistance = TextFieldName.valueForString(example);
+ example = "audioPassThruDisplayText1";
+ TextFieldName enumAudioPassThruDisplayText1 = TextFieldName.valueForString(example);
+ example = "audioPassThruDisplayText2";
+ TextFieldName enumAudioPassThruDisplayText2 = TextFieldName.valueForString(example);
+ example = "sliderHeader";
+ TextFieldName enumSliderHeader = TextFieldName.valueForString(example);
+ example = "sliderFooter";
+ TextFieldName enumSliderFooter = TextFieldName.valueForString(example);
+ example = "menuName";
+ TextFieldName enumMenuName = TextFieldName.valueForString(example);
+ example = "secondaryText";
+ TextFieldName enumSecondaryText = TextFieldName.valueForString(example);
+ example = "tertiaryText";
+ TextFieldName enumTertiaryText = TextFieldName.valueForString(example);
+ example = "menuTitle";
+ TextFieldName enumMenuTitle = TextFieldName.valueForString(example);
+ example = "locationName";
+ TextFieldName enumLocName = TextFieldName.valueForString(example);
+ example = "locationDescription";
+ TextFieldName enumLocDesc = TextFieldName.valueForString(example);
+ example = "addressLines";
+ TextFieldName enumAddLines = TextFieldName.valueForString(example);
+ example = "phoneNumber";
+ TextFieldName enumPhone = TextFieldName.valueForString(example);
+
+ assertNotNull("mainField1 returned null", enumMainField1);
+ assertNotNull("mainField2 returned null", enumMainField2);
+ assertNotNull("mainField3 returned null", enumMainField3);
+ assertNotNull("mainField4 returned null", enumMainField4);
+ assertNotNull("statusBar returned null", enumStatusBar);
+ assertNotNull("mediaClock returned null", enumMediaClock);
+ assertNotNull("mediaTrack returned null", enumMediaTrack);
+ assertNotNull("alertText1 returned null", enumAlertText1);
+ assertNotNull("alertText2 returned null", enumAlertText2);
+ assertNotNull("alertText3 returned null", enumAlertText3);
+ assertNotNull("scrollableMessageBody returned null", enumScrollableMessageBody);
+ assertNotNull("initialInteractionText returned null", enumInitialInteractionText);
+ assertNotNull("navigationText1 returned null", enumNavigationText1);
+ assertNotNull("navigationText2 returned null", enumNavigationText2);
+ assertNotNull("ETA returned null", enumEta);
+ assertNotNull("totalDistance returned null", enumTotalDistance);
+ assertNotNull("audioPassThruDisplayText1 returned null", enumAudioPassThruDisplayText1);
+ assertNotNull("audioPassThruDisplayText2 returned null", enumAudioPassThruDisplayText2);
+ assertNotNull("sliderHeader returned null", enumSliderHeader);
+ assertNotNull("sliderFooter returned null", enumSliderFooter);
+ assertNotNull("menuName returned null", enumMenuName);
+ assertNotNull("secondaryText returned null", enumSecondaryText);
+ assertNotNull("tertiaryText returned null", enumTertiaryText);
+ assertNotNull("menuTitle returned null", enumMenuTitle);
+
+ assertNotNull(Test.NOT_NULL, enumLocName);
+ assertNotNull(Test.NOT_NULL, enumLocDesc);
+ assertNotNull(Test.NOT_NULL, enumAddLines);
+ assertNotNull(Test.NOT_NULL, enumPhone);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "mAinField1";
+ try {
+ TextFieldName temp = TextFieldName.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 {
+ TextFieldName temp = TextFieldName.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of TextFieldName.
+ */
+ public void testListEnum() {
+ List<TextFieldName> enumValueList = Arrays.asList(TextFieldName.values());
+
+ List<TextFieldName> enumTestList = new ArrayList<TextFieldName>();
+ enumTestList.add(TextFieldName.mainField1);
+ enumTestList.add(TextFieldName.mainField2);
+ enumTestList.add(TextFieldName.mainField3);
+ enumTestList.add(TextFieldName.mainField4);
+ enumTestList.add(TextFieldName.statusBar);
+ enumTestList.add(TextFieldName.mediaClock);
+ enumTestList.add(TextFieldName.mediaTrack);
+ enumTestList.add(TextFieldName.alertText1);
+ enumTestList.add(TextFieldName.alertText2);
+ enumTestList.add(TextFieldName.alertText3);
+ enumTestList.add(TextFieldName.scrollableMessageBody);
+ enumTestList.add(TextFieldName.initialInteractionText);
+ enumTestList.add(TextFieldName.navigationText1);
+ enumTestList.add(TextFieldName.navigationText2);
+ enumTestList.add(TextFieldName.ETA);
+ enumTestList.add(TextFieldName.totalDistance);
+ enumTestList.add(TextFieldName.audioPassThruDisplayText1);
+ enumTestList.add(TextFieldName.audioPassThruDisplayText2);
+ enumTestList.add(TextFieldName.sliderHeader);
+ enumTestList.add(TextFieldName.sliderFooter);
+ enumTestList.add(TextFieldName.menuName);
+ enumTestList.add(TextFieldName.secondaryText);
+ enumTestList.add(TextFieldName.tertiaryText);
+ enumTestList.add(TextFieldName.menuTitle);
+
+ enumTestList.add(TextFieldName.locationName);
+ enumTestList.add(TextFieldName.locationDescription);
+ enumTestList.add(TextFieldName.addressLines);
+ enumTestList.add(TextFieldName.phoneNumber);
+
+ 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/TouchTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TouchTypeTests.java
index db9c417ef..db9c417ef 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TouchTypeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TouchTypeTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TriggerSourceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TriggerSourceTests.java
new file mode 100644
index 000000000..d045203d8
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TriggerSourceTests.java
@@ -0,0 +1,76 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
+
+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.TriggerSource}
+ */
+public class TriggerSourceTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "MENU";
+ TriggerSource enumMenu = TriggerSource.valueForString(example);
+ example = "VR";
+ TriggerSource enumVr = TriggerSource.valueForString(example);
+ example = "KEYBOARD";
+ TriggerSource enumKeyboard = TriggerSource.valueForString(example);
+
+ assertNotNull("MENU returned null", enumMenu);
+ assertNotNull("VR returned null", enumVr);
+ assertNotNull("KEYBOARD returned null", enumKeyboard);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "meNU";
+ try {
+ TriggerSource temp = TriggerSource.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 {
+ TriggerSource temp = TriggerSource.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+
+ /**
+ * Verifies the possible enum values of TriggerSource.
+ */
+ public void testListEnum() {
+ List<TriggerSource> enumValueList = Arrays.asList(TriggerSource.values());
+
+ List<TriggerSource> enumTestList = new ArrayList<TriggerSource>();
+ enumTestList.add(TriggerSource.TS_MENU);
+ enumTestList.add(TriggerSource.TS_VR);
+ enumTestList.add(TriggerSource.TS_KEYBOARD);
+
+ 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/TurnSignalTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TurnSignalTests.java
index a758d683e..a758d683e 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TurnSignalTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TurnSignalTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/UpdateModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/UpdateModeTests.java
new file mode 100644
index 000000000..3d97bbdc5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/UpdateModeTests.java
@@ -0,0 +1,83 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
+
+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.UpdateMode}
+ */
+public class UpdateModeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "COUNTUP";
+ UpdateMode enumCountUp = UpdateMode.valueForString(example);
+ example = "COUNTDOWN";
+ UpdateMode enumCountDown = UpdateMode.valueForString(example);
+ example = "PAUSE";
+ UpdateMode enumPause = UpdateMode.valueForString(example);
+ example = "RESUME";
+ UpdateMode enumResume = UpdateMode.valueForString(example);
+ example = "CLEAR";
+ UpdateMode enumClear = UpdateMode.valueForString(example);
+
+ assertNotNull("COUNTUP returned null", enumCountUp);
+ assertNotNull("COUNTDOWN returned null", enumCountDown);
+ assertNotNull("PAUSE returned null", enumPause);
+ assertNotNull("RESUME returned null", enumResume);
+ assertNotNull("CLEAR returned null", enumClear);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "coUnTUp";
+ try {
+ UpdateMode temp = UpdateMode.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 {
+ UpdateMode temp = UpdateMode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of UpdateMode.
+ */
+ public void testListEnum() {
+ List<UpdateMode> enumValueList = Arrays.asList(UpdateMode.values());
+
+ List<UpdateMode> enumTestList = new ArrayList<UpdateMode>();
+ enumTestList.add(UpdateMode.COUNTUP);
+ enumTestList.add(UpdateMode.COUNTDOWN);
+ enumTestList.add(UpdateMode.PAUSE);
+ enumTestList.add(UpdateMode.RESUME);
+ enumTestList.add(UpdateMode.CLEAR);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataEventStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataEventStatusTests.java
new file mode 100644
index 000000000..04faf1e80
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataEventStatusTests.java
@@ -0,0 +1,83 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+
+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.VehicleDataEventStatus}
+ */
+public class VehicleDataEventStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NO_EVENT";
+ VehicleDataEventStatus enumNoEvent = VehicleDataEventStatus.valueForString(example);
+ example = "NO";
+ VehicleDataEventStatus enumNo = VehicleDataEventStatus.valueForString(example);
+ example = "YES";
+ VehicleDataEventStatus enumYes = VehicleDataEventStatus.valueForString(example);
+ example = "NOT_SUPPORTED";
+ VehicleDataEventStatus enumNotSupported = VehicleDataEventStatus.valueForString(example);
+ example = "FAULT";
+ VehicleDataEventStatus enumFault = VehicleDataEventStatus.valueForString(example);
+
+ assertNotNull("NO_EVENT returned null", enumNoEvent);
+ assertNotNull("NO returned null", enumNo);
+ assertNotNull("YES returned null", enumYes);
+ assertNotNull("NOT_SUPPORTED returned null", enumNotSupported);
+ assertNotNull("FAULT returned null", enumFault);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "no_EveNT";
+ try {
+ VehicleDataEventStatus temp = VehicleDataEventStatus.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 {
+ VehicleDataEventStatus temp = VehicleDataEventStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of AmbientLightStatus.
+ */
+ public void testListEnum() {
+ List<VehicleDataEventStatus> enumValueList = Arrays.asList(VehicleDataEventStatus.values());
+
+ List<VehicleDataEventStatus> enumTestList = new ArrayList<VehicleDataEventStatus>();
+ enumTestList.add(VehicleDataEventStatus.NO_EVENT);
+ enumTestList.add(VehicleDataEventStatus.NO);
+ enumTestList.add(VehicleDataEventStatus.YES);
+ enumTestList.add(VehicleDataEventStatus.NOT_SUPPORTED);
+ enumTestList.add(VehicleDataEventStatus.FAULT);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataNotificationStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataNotificationStatusTests.java
new file mode 100644
index 000000000..8a4d54727
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataNotificationStatusTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
+
+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.VehicleDataNotificationStatus}
+ */
+public class VehicleDataNotificationStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NOT_SUPPORTED";
+ VehicleDataNotificationStatus enumNotSupported = VehicleDataNotificationStatus.valueForString(example);
+ example = "NORMAL";
+ VehicleDataNotificationStatus enumNormal = VehicleDataNotificationStatus.valueForString(example);
+ example = "ACTIVE";
+ VehicleDataNotificationStatus enumActive = VehicleDataNotificationStatus.valueForString(example);
+ example = "NOT_USED";
+ VehicleDataNotificationStatus enumNotUsed = VehicleDataNotificationStatus.valueForString(example);
+
+ assertNotNull("NOT_SUPPORTED returned null", enumNotSupported);
+ assertNotNull("NORMAL returned null", enumNormal);
+ assertNotNull("ACTIVE returned null", enumActive);
+ assertNotNull("NOT_USED returned null", enumNotUsed);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "nOT_SuppOrTEd";
+ try {
+ VehicleDataNotificationStatus temp = VehicleDataNotificationStatus.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 {
+ VehicleDataNotificationStatus temp = VehicleDataNotificationStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of VehicleDataNotification.
+ */
+ public void testListEnum() {
+ List<VehicleDataNotificationStatus> enumValueList = Arrays.asList(VehicleDataNotificationStatus.values());
+
+ List<VehicleDataNotificationStatus> enumTestList = new ArrayList<VehicleDataNotificationStatus>();
+ enumTestList.add(VehicleDataNotificationStatus.NOT_SUPPORTED);
+ enumTestList.add(VehicleDataNotificationStatus.NORMAL);
+ enumTestList.add(VehicleDataNotificationStatus.ACTIVE);
+ enumTestList.add(VehicleDataNotificationStatus.NOT_USED);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataResultCodeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataResultCodeTests.java
new file mode 100644
index 000000000..061aaf65f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataResultCodeTests.java
@@ -0,0 +1,99 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
+
+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.VehicleDataResultCode}
+ */
+public class VehicleDataResultCodeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "SUCCESS";
+ VehicleDataResultCode enumSuccess = VehicleDataResultCode.valueForString(example);
+ example = "TRUNCATED_DATA";
+ VehicleDataResultCode enumTruncData = VehicleDataResultCode.valueForString(example);
+ example = "DISALLOWED";
+ VehicleDataResultCode enumDisallowed = VehicleDataResultCode.valueForString(example);
+ example = "USER_DISALLOWED";
+ VehicleDataResultCode enumUserDisallowed = VehicleDataResultCode.valueForString(example);
+ example = "INVALID_ID";
+ VehicleDataResultCode enumInvalidId = VehicleDataResultCode.valueForString(example);
+ example = "VEHICLE_DATA_NOT_AVAILABLE";
+ VehicleDataResultCode enumVehicleDataNotAvailable = VehicleDataResultCode.valueForString(example);
+ example = "DATA_ALREADY_SUBSCRIBED";
+ VehicleDataResultCode enumDataAlreadySubscribed = VehicleDataResultCode.valueForString(example);
+ example = "DATA_NOT_SUBSCRIBED";
+ VehicleDataResultCode enumDataNotSubscribed = VehicleDataResultCode.valueForString(example);
+ example = "IGNORED";
+ VehicleDataResultCode enumIgnored = VehicleDataResultCode.valueForString(example);
+
+ assertNotNull("SUCCESS returned null", enumSuccess);
+ assertNotNull("TRUNCATED_DATA returned null", enumTruncData);
+ assertNotNull("DISALLOWED returned null", enumDisallowed);
+ assertNotNull("USER_DISALLOWED returned null", enumUserDisallowed);
+ assertNotNull("INVALID_ID returned null", enumInvalidId);
+ assertNotNull("VEHICLE_DATA_NOT_AVAILABLE returned null", enumVehicleDataNotAvailable);
+ assertNotNull("DATA_ALREADY_SUBSCRIBED returned null", enumDataAlreadySubscribed);
+ assertNotNull("DATA_NOT_SUBSCRIBED returned null", enumDataNotSubscribed);
+ assertNotNull("IGNORED returned null", enumIgnored);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "suCcesS";
+ try {
+ VehicleDataResultCode temp = VehicleDataResultCode.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 {
+ VehicleDataResultCode temp = VehicleDataResultCode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of VehicleDataResultCode.
+ */
+ public void testListEnum() {
+ List<VehicleDataResultCode> enumValueList = Arrays.asList(VehicleDataResultCode.values());
+
+ List<VehicleDataResultCode> enumTestList = new ArrayList<VehicleDataResultCode>();
+ enumTestList.add(VehicleDataResultCode.SUCCESS);
+ enumTestList.add(VehicleDataResultCode.TRUNCATED_DATA);
+ enumTestList.add(VehicleDataResultCode.DISALLOWED);
+ enumTestList.add(VehicleDataResultCode.USER_DISALLOWED);
+ enumTestList.add(VehicleDataResultCode.INVALID_ID);
+ enumTestList.add(VehicleDataResultCode.VEHICLE_DATA_NOT_AVAILABLE);
+ enumTestList.add(VehicleDataResultCode.DATA_ALREADY_SUBSCRIBED);
+ enumTestList.add(VehicleDataResultCode.DATA_NOT_SUBSCRIBED);
+ enumTestList.add(VehicleDataResultCode.IGNORED);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataStatusTests.java
new file mode 100644
index 000000000..080a85cf4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataStatusTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
+
+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.VehicleDataStatus}
+ */
+public class VehicleDataStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "NO_DATA_EXISTS";
+ VehicleDataStatus enumNoDataExists = VehicleDataStatus.valueForString(example);
+ example = "OFF";
+ VehicleDataStatus enumOff = VehicleDataStatus.valueForString(example);
+ example = "ON";
+ VehicleDataStatus enumOn = VehicleDataStatus.valueForString(example);
+
+ assertNotNull("NO_DATA_EXISTS returned null", enumNoDataExists);
+ assertNotNull("OFF returned null", enumOff);
+ assertNotNull("ON returned null", enumOn);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "No_DatA_ExiSTs";
+ try {
+ VehicleDataStatus temp = VehicleDataStatus.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 {
+ VehicleDataStatus temp = VehicleDataStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of VehicleDataStatus.
+ */
+ public void testListEnum() {
+ List<VehicleDataStatus> enumValueList = Arrays.asList(VehicleDataStatus.values());
+
+ List<VehicleDataStatus> enumTestList = new ArrayList<VehicleDataStatus>();
+ enumTestList.add(VehicleDataStatus.NO_DATA_EXISTS);
+ enumTestList.add(VehicleDataStatus.OFF);
+ enumTestList.add(VehicleDataStatus.ON);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java
new file mode 100644
index 000000000..65a7646d3
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java
@@ -0,0 +1,187 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
+
+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.VehicleDataType}
+ */
+public class VehicleDataTypeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "VEHICLEDATA_GPS";
+ VehicleDataType enumVehicleDataGps = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_SPEED";
+ VehicleDataType enumVehicleDataSpeed = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_RPM";
+ VehicleDataType enumVehicleDataRpm = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_FUELLEVEL";
+ VehicleDataType enumVehicleDataFuelLevel = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_FUELLEVEL_STATE";
+ VehicleDataType enumVehicleDataFuelLevelState = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_FUELCONSUMPTION";
+ VehicleDataType enumVehicleDataFuelConsumption = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_EXTERNTEMP";
+ VehicleDataType enumVehicleDataExternTemp = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_VIN";
+ VehicleDataType enumVehicleDataVin = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_PRNDL";
+ VehicleDataType enumVehicleDataPrndl = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_TIREPRESSURE";
+ VehicleDataType enumVehicleDataTirePressure = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_ODOMETER";
+ VehicleDataType enumVehicleDataOdometer = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_BELTSTATUS";
+ VehicleDataType enumVehicleDataBeltStatus = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_BODYINFO";
+ VehicleDataType enumVehicleDataBodyInfo = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_DEVICESTATUS";
+ VehicleDataType enumVehicleDataDeviceStatus = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_BRAKING";
+ VehicleDataType enumVehicleDataBraking = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_WIPERSTATUS";
+ VehicleDataType enumVehicleDataWiperStatus = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_HEADLAMPSTATUS";
+ VehicleDataType enumVehicleDataHeadlampStatus = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_BATTVOLTAGE";
+ VehicleDataType enumVehicleDataBattVoltage = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_ENGINETORQUE";
+ VehicleDataType enumVehicleDataEngineTorque = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_ENGINEOILLIFE";
+ VehicleDataType enumVehicleDataEngineOilLife = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_ACCPEDAL";
+ VehicleDataType enumVehicleDataAccPedal = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_STEERINGWHEEL";
+ VehicleDataType enumVehicleDataSteeringWheel = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_ECALLINFO";
+ VehicleDataType enumVehicleDataECallInfo = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_AIRBAGSTATUS";
+ VehicleDataType enumVehicleDataAirbagStatus = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_EMERGENCYEVENT";
+ VehicleDataType enumVehicleDataEmergencyEvent = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_CLUSTERMODESTATUS";
+ VehicleDataType enumVehicleDataClusterModeStatus = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_MYKEY";
+ VehicleDataType enumVehicleDataMyKey = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_FUELRANGE";
+ VehicleDataType enumVehicleDataFuelRange = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_TURNSIGNAL";
+ VehicleDataType enumVehicleDataTurnSignal = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS";
+ VehicleDataType enumVehicleDataElectronicParkBrakeStatus = VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_CLOUDAPPVEHICLEID";
+ VehicleDataType enumVehicleCloudAppVehicleId = VehicleDataType.valueForString(example);
+
+ assertNotNull("VEHICLEDATA_GPS returned null", enumVehicleDataGps);
+ assertNotNull("VEHICLEDATA_SPEED returned null", enumVehicleDataSpeed);
+ assertNotNull("VEHICLEDATA_RPM returned null", enumVehicleDataRpm);
+ assertNotNull("VEHICLEDATA_FUELLEVEL returned null", enumVehicleDataFuelLevel);
+ assertNotNull("VEHICLEDATA_FUELLEVEL_STATE returned null", enumVehicleDataFuelLevelState);
+ assertNotNull("VEHICLEDATA_FUELCONSUMPTION returned null", enumVehicleDataFuelConsumption);
+ assertNotNull("VEHICLEDATA_EXTERNTEMP returned null", enumVehicleDataExternTemp);
+ assertNotNull("VEHICLEDATA_VIN returned null", enumVehicleDataVin);
+ assertNotNull("VEHICLEDATA_PRNDL returned null", enumVehicleDataPrndl);
+ assertNotNull("VEHICLEDATA_TIREPRESSURE returned null", enumVehicleDataTirePressure);
+ assertNotNull("VEHICLEDATA_ODOMETER returned null", enumVehicleDataOdometer);
+ assertNotNull("VEHICLEDATA_BELTSTATUS returned null", enumVehicleDataBeltStatus);
+ assertNotNull("VEHICLEDATA_BODYINFO returned null", enumVehicleDataBodyInfo);
+ assertNotNull("VEHICLEDATA_DEVICESTATUS returned null", enumVehicleDataDeviceStatus);
+ assertNotNull("VEHICLEDATA_BRAKING returned null", enumVehicleDataBraking);
+ assertNotNull("VEHICLEDATA_WIPERSTATUS returned null", enumVehicleDataWiperStatus);
+ assertNotNull("VEHICLEDATA_HEADLAMPSTATUS returned null", enumVehicleDataHeadlampStatus);
+ assertNotNull("VEHICLEDATA_BATTVOLTAGE returned null", enumVehicleDataBattVoltage);
+ assertNotNull("VEHICLEDATA_ENGINETORQUE returned null", enumVehicleDataEngineTorque);
+ assertNotNull("VEHICLEDATA_ENGINEOILLIFE returned null", enumVehicleDataEngineOilLife);
+ assertNotNull("VEHICLEDATA_ACCPEDAL returned null", enumVehicleDataAccPedal);
+ assertNotNull("VEHICLEDATA_STEERINGWHEEL returned null", enumVehicleDataSteeringWheel);
+ assertNotNull("VEHICLEDATA_ECALLINFO returned null", enumVehicleDataECallInfo);
+ assertNotNull("VEHICLEDATA_AIRBAGSTATUS returned null", enumVehicleDataAirbagStatus);
+ assertNotNull("VEHICLEDATA_EMERGENCYEVENT returned null", enumVehicleDataEmergencyEvent);
+ assertNotNull("VEHICLEDATA_CLUSTERMODESTATUS returned null", enumVehicleDataClusterModeStatus);
+ assertNotNull("VEHICLEDATA_MYKEY returned null", enumVehicleDataMyKey);
+ assertNotNull("VEHICLEDATA_FUELRANGE returned null", enumVehicleDataFuelRange);
+ assertNotNull("VEHICLEDATA_TURNSIGNAL returned null", enumVehicleDataTurnSignal);
+ assertNotNull("VEHICLEDATA_ELECTRONICPARKBRAKESTATUS returned null", enumVehicleDataElectronicParkBrakeStatus);
+ assertNotNull("VEHICLEDATA_CLOUDAPPVEHICLEID returned null", enumVehicleCloudAppVehicleId);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "VeHIcLEDatA_GPs";
+ try {
+ VehicleDataType temp = VehicleDataType.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 {
+ VehicleDataType temp = VehicleDataType.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of VehicleDataType.
+ */
+ public void testListEnum() {
+ List<VehicleDataType> enumValueList = Arrays.asList(VehicleDataType.values());
+
+ List<VehicleDataType> enumTestList = new ArrayList<VehicleDataType>();
+ enumTestList.add(VehicleDataType.VEHICLEDATA_GPS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_SPEED);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_RPM);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_FUELLEVEL);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_EXTERNTEMP);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_VIN);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_PRNDL);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_TIREPRESSURE);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_ODOMETER);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_BELTSTATUS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_BODYINFO);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_DEVICESTATUS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_BRAKING);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_WIPERSTATUS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_BATTVOLTAGE);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_ENGINETORQUE);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_ACCPEDAL);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_STEERINGWHEEL);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_ECALLINFO);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_MYKEY);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_FUELRANGE);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_TURNSIGNAL);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_CLOUDAPPVEHICLEID);
+
+ 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/VentilationModeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VentilationModeTests.java
index 561e66a77..561e66a77 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VentilationModeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VentilationModeTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingCodecTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingCodecTests.java
index b4aa8fd97..b4aa8fd97 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingCodecTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingCodecTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingProtocolTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingProtocolTests.java
new file mode 100644
index 000000000..36dba5b6f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingProtocolTests.java
@@ -0,0 +1,81 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class VideoStreamingProtocolTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "RAW";
+ VideoStreamingProtocol enumRAW = VideoStreamingProtocol.valueForString(example);
+ example = "RTP";
+ VideoStreamingProtocol enumRTP = VideoStreamingProtocol.valueForString(example);
+ example = "RTSP";
+ VideoStreamingProtocol enumRTSP = VideoStreamingProtocol.valueForString(example);
+ example = "RTMP";
+ VideoStreamingProtocol enumRTMP = VideoStreamingProtocol.valueForString(example);
+ example = "WEBM";
+ VideoStreamingProtocol enumWEBM = VideoStreamingProtocol.valueForString(example);
+
+ assertNotNull("RAW returned null", enumRAW);
+ assertNotNull("RTP returned null", enumRTP);
+ assertNotNull("RTSP returned null", enumRTSP);
+ assertNotNull("RTMP returned null", enumRTMP);
+ assertNotNull("WEBM returned null", enumWEBM);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "RAAW";
+ try {
+ VideoStreamingProtocol temp = VideoStreamingProtocol.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 {
+ VideoStreamingProtocol temp = VideoStreamingProtocol.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+
+ /**
+ * Verifies the possible enum values of TouchType.
+ */
+ public void testListEnum() {
+ List<VideoStreamingProtocol> enumValueList = Arrays.asList(VideoStreamingProtocol.values());
+
+ List<VideoStreamingProtocol> enumTestList = new ArrayList<VideoStreamingProtocol>();
+ enumTestList.add(VideoStreamingProtocol.RAW);
+ enumTestList.add(VideoStreamingProtocol.RTP);
+ enumTestList.add(VideoStreamingProtocol.RTSP);
+ enumTestList.add(VideoStreamingProtocol.RTMP);
+ enumTestList.add(VideoStreamingProtocol.WEBM);
+
+ 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/enums/VideoStreamingStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingStateTests.java
index 2074efe47..2074efe47 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingStateTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingStateTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VrCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VrCapabilitiesTests.java
new file mode 100644
index 000000000..e95fdf887
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VrCapabilitiesTests.java
@@ -0,0 +1,69 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
+
+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.VrCapabilities}
+ */
+public class VrCapabilitiesTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "Text";
+ VrCapabilities enumText = VrCapabilities.valueForString(example);
+
+ assertNotNull("Text returned null", enumText);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "tExTx";
+ try {
+ VrCapabilities temp = VrCapabilities.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 {
+ VrCapabilities temp = VrCapabilities.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of VrCapabilities.
+ */
+ @SuppressWarnings("deprecation")
+ public void testListEnum() {
+ List<VrCapabilities> enumValueList = Arrays.asList(VrCapabilities.values());
+
+ List<VrCapabilities> enumTestList = new ArrayList<VrCapabilities>();
+ enumTestList.add(VrCapabilities.TEXT);
+ enumTestList.add(VrCapabilities.Text);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WarningLightStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WarningLightStatusTests.java
new file mode 100644
index 000000000..c83355b18
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WarningLightStatusTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
+
+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.WarningListStatus}
+ */
+public class WarningLightStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "OFF";
+ WarningLightStatus enumOff = WarningLightStatus.valueForString(example);
+ example = "ON";
+ WarningLightStatus enumOn = WarningLightStatus.valueForString(example);
+ example = "FLASH";
+ WarningLightStatus enumFlash = WarningLightStatus.valueForString(example);
+ example = "NOT_USED";
+ WarningLightStatus enumNotUsed = WarningLightStatus.valueForString(example);
+
+ assertNotNull("OFF returned null", enumOff);
+ assertNotNull("ON returned null", enumOn);
+ assertNotNull("FLASH returned null", enumFlash);
+ assertNotNull("NOT_USED returned null", enumNotUsed);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "OfF";
+ try {
+ WarningLightStatus temp = WarningLightStatus.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 {
+ WarningLightStatus temp = WarningLightStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of WarningLightStatus.
+ */
+ public void testListEnum() {
+ List<WarningLightStatus> enumValueList = Arrays.asList(WarningLightStatus.values());
+
+ List<WarningLightStatus> enumTestList = new ArrayList<WarningLightStatus>();
+ enumTestList.add(WarningLightStatus.OFF);
+ enumTestList.add(WarningLightStatus.ON);
+ enumTestList.add(WarningLightStatus.FLASH);
+ enumTestList.add(WarningLightStatus.NOT_USED);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WiperStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WiperStatusTests.java
new file mode 100644
index 000000000..6a17b0e59
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WiperStatusTests.java
@@ -0,0 +1,123 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
+
+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.WiperStatis}
+ */
+public class WiperStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "OFF";
+ WiperStatus enumOff = WiperStatus.valueForString(example);
+ example = "AUTO_OFF";
+ WiperStatus enumAutoOff = WiperStatus.valueForString(example);
+ example = "OFF_MOVING";
+ WiperStatus enumOffMoving = WiperStatus.valueForString(example);
+ example = "MAN_INT_OFF";
+ WiperStatus enumManIntOff = WiperStatus.valueForString(example);
+ example = "MAN_INT_ON";
+ WiperStatus enumManIntOn = WiperStatus.valueForString(example);
+ example = "MAN_LOW";
+ WiperStatus enumManLow = WiperStatus.valueForString(example);
+ example = "MAN_HIGH";
+ WiperStatus enumManHigh = WiperStatus.valueForString(example);
+ example = "MAN_FLICK";
+ WiperStatus enumManFlick = WiperStatus.valueForString(example);
+ example = "WASH";
+ WiperStatus enumWash = WiperStatus.valueForString(example);
+ example = "AUTO_LOW";
+ WiperStatus enumAutoLow = WiperStatus.valueForString(example);
+ example = "AUTO_HIGH";
+ WiperStatus enumAutoHigh = WiperStatus.valueForString(example);
+ example = "COURTESYWIPE";
+ WiperStatus enumCourtesyWipe = WiperStatus.valueForString(example);
+ example = "AUTO_ADJUST";
+ WiperStatus enumAutoAdjust = WiperStatus.valueForString(example);
+ example = "STALLED";
+ WiperStatus enumStalled = WiperStatus.valueForString(example);
+ example = "NO_DATA_EXISTS";
+ WiperStatus enumNoDataExists = WiperStatus.valueForString(example);
+
+ assertNotNull("OFF returned null", enumOff);
+ assertNotNull("AUTO_OFF returned null", enumAutoOff);
+ assertNotNull("OFF_MOVING returned null", enumOffMoving);
+ assertNotNull("MAN_INT_OFF returned null", enumManIntOff);
+ assertNotNull("MAN_INT_ON returned null", enumManIntOn);
+ assertNotNull("MAN_LOW returned null", enumManLow);
+ assertNotNull("MAN_HIGH returned null", enumManHigh);
+ assertNotNull("MAN_FLICK returned null", enumManFlick);
+ assertNotNull("WASH returned null", enumWash);
+ assertNotNull("AUTO_LOW returned null", enumAutoLow);
+ assertNotNull("AUTO_HIGH returned null", enumAutoHigh);
+ assertNotNull("COURTESYWIPE returned null", enumCourtesyWipe);
+ assertNotNull("AUTO_ADJUST returned null", enumAutoAdjust);
+ assertNotNull("STALLED returned null", enumStalled);
+ assertNotNull("NO_DATA_EXISTS returned null", enumNoDataExists);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "OFf";
+ try {
+ WiperStatus temp = WiperStatus.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 {
+ WiperStatus temp = WiperStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of WiperStatus.
+ */
+ public void testListEnum() {
+ List<WiperStatus> enumValueList = Arrays.asList(WiperStatus.values());
+
+ List<WiperStatus> enumTestList = new ArrayList<WiperStatus>();
+ enumTestList.add(WiperStatus.OFF);
+ enumTestList.add(WiperStatus.AUTO_OFF);
+ enumTestList.add(WiperStatus.OFF_MOVING);
+ enumTestList.add(WiperStatus.MAN_INT_OFF);
+ enumTestList.add(WiperStatus.MAN_INT_ON);
+ enumTestList.add(WiperStatus.MAN_LOW);
+ enumTestList.add(WiperStatus.MAN_HIGH);
+ enumTestList.add(WiperStatus.MAN_FLICK);
+ enumTestList.add(WiperStatus.WASH);
+ enumTestList.add(WiperStatus.AUTO_LOW);
+ enumTestList.add(WiperStatus.AUTO_HIGH);
+ enumTestList.add(WiperStatus.COURTESYWIPE);
+ enumTestList.add(WiperStatus.AUTO_ADJUST);
+ enumTestList.add(WiperStatus.STALLED);
+ enumTestList.add(WiperStatus.NO_DATA_EXISTS);
+
+ 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/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java
new file mode 100644
index 000000000..c5f9bebdb
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java
@@ -0,0 +1,68 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered;
+import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnAppInterfaceUnregistered}
+ */
+public class OnAppInterfaceUnregisteredTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered();
+
+ msg.setReason(Test.GENERAL_APPINTERFACEUNREGISTEREDREASON);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnAppInterfaceUnregistered.KEY_REASON, Test.GENERAL_APPINTERFACEUNREGISTEREDREASON);
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ AppInterfaceUnregisteredReason reason = ( (OnAppInterfaceUnregistered) msg ).getReason();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_APPINTERFACEUNREGISTEREDREASON, reason);
+
+ // Invalid/Null tests
+ OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getReason());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppServiceDataTests.java
new file mode 100644
index 000000000..8a04d4b6a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppServiceDataTests.java
@@ -0,0 +1,73 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AppServiceData;
+import com.smartdevicelink.proxy.rpc.OnAppServiceData;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.OnAppServiceData}
+ */
+public class OnAppServiceDataTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnAppServiceData msg = new OnAppServiceData();
+
+ msg.setServiceData(Test.GENERAL_APPSERVICEDATA);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_APP_SERVICE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnAppServiceData.KEY_SERVICE_DATA, Test.GENERAL_APPSERVICEDATA.serializeJSON());
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ AppServiceData cmdId = ( (OnAppServiceData) msg ).getServiceData();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_APPSERVICEDATA, cmdId);
+
+ // Invalid/Null Tests
+ OnAppServiceData msg = new OnAppServiceData();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getServiceData());
+
+ // test constructor with param
+ msg = new OnAppServiceData(Test.GENERAL_APPSERVICEDATA);
+ AppServiceData serviceData = msg.getServiceData();
+ assertEquals(serviceData, Test.GENERAL_APPSERVICEDATA);
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java
new file mode 100644
index 000000000..1c6efbef5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java
@@ -0,0 +1,46 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnAudioPassThru}
+ */
+public class OnAudioPassThruTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new OnAudioPassThru();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_AUDIO_PASS_THRU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ OnAudioPassThru msg = new OnAudioPassThru();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java
new file mode 100644
index 000000000..2bf73753e
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnButtonEvent;
+import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnButtonEvent}
+ */
+public class OnButtonEventTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnButtonEvent msg = new OnButtonEvent();
+
+ msg.setButtonEventMode(Test.GENERAL_BUTTONEVENTMODE);
+ msg.setButtonName(Test.GENERAL_BUTTONNAME);
+ msg.setCustomButtonID(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_BUTTON_EVENT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnButtonEvent.KEY_BUTTON_EVENT_MODE, Test.GENERAL_BUTTONEVENTMODE);
+ result.put(OnButtonEvent.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME);
+ result.put(OnButtonEvent.KEY_CUSTOM_BUTTON_ID, Test.GENERAL_INT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int cmdId = ( (OnButtonEvent) msg ).getCustomButtonID();
+ ButtonEventMode mode = ( (OnButtonEvent) msg ).getButtonEventMode();
+ ButtonName name = ( (OnButtonEvent) msg ).getButtonName();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, cmdId);
+ assertEquals(Test.MATCH, Test.GENERAL_BUTTONEVENTMODE, mode);
+ assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, name);
+
+ // Invalid/Null Tests
+ OnButtonEvent msg = new OnButtonEvent();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getButtonEventMode());
+ assertNull(Test.NULL, msg.getButtonName());
+ assertNull(Test.NULL, msg.getCustomButtonID());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java
new file mode 100644
index 000000000..2bc01f53d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnButtonPress;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnButtonPress}
+ */
+public class OnButtonPressTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnButtonPress msg = new OnButtonPress();
+
+ msg.setButtonName(Test.GENERAL_BUTTONNAME);
+ msg.setButtonPressMode(Test.GENERAL_BUTTONPRESSMODE);
+ msg.setCustomButtonName(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_BUTTON_PRESS.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnButtonPress.KEY_CUSTOM_BUTTON_ID, Test.GENERAL_INT);
+ result.put(OnButtonPress.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME);
+ result.put(OnButtonPress.KEY_BUTTON_PRESS_MODE, Test.GENERAL_BUTTONPRESSMODE);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int customName = ( (OnButtonPress) msg ).getCustomButtonName();
+ ButtonName buttonName = ( (OnButtonPress) msg ).getButtonName();
+ ButtonPressMode buttonPressMode = ( (OnButtonPress) msg ).getButtonPressMode();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, customName);
+ assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, buttonName);
+ assertEquals(Test.MATCH, Test.GENERAL_BUTTONPRESSMODE, buttonPressMode);
+
+ // Invalid/Null Tests
+ OnButtonPress msg = new OnButtonPress();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getCustomButtonName());
+ assertNull(Test.NULL, msg.getButtonName());
+ assertNull(Test.NULL, msg.getButtonPressMode());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java
new file mode 100644
index 000000000..737435ec6
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java
@@ -0,0 +1,73 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnCommand;
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnCommand}
+ */
+public class OnCommandTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnCommand msg = new OnCommand();
+
+ msg.setCmdID(Test.GENERAL_INT);
+ msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_COMMAND.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnCommand.KEY_CMD_ID, Test.GENERAL_INT);
+ result.put(OnCommand.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int cmdId = ( (OnCommand) msg ).getCmdID();
+ TriggerSource triggerSource = ( (OnCommand) msg ).getTriggerSource();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, cmdId);
+ assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, triggerSource);
+
+ // Invalid/Null Tests
+ OnCommand msg = new OnCommand();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getTriggerSource());
+ assertNull(Test.NULL, msg.getCmdID());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java
new file mode 100644
index 000000000..c334c7e82
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java
@@ -0,0 +1,70 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
+import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnDriverDistraction}
+ */
+public class OnDriverDistractionTests extends BaseRpcTests{
+
+ private static final DriverDistractionState STATUS = DriverDistractionState.DD_ON;
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnDriverDistraction msg = new OnDriverDistraction();
+
+ msg.setState(STATUS);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_DRIVER_DISTRACTION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnDriverDistraction.KEY_STATE, STATUS);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ DriverDistractionState cmdId = ( (OnDriverDistraction) msg ).getState();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, STATUS, cmdId);
+
+ // Invalid/Null Tests
+ OnDriverDistraction msg = new OnDriverDistraction();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getState());
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java
index a907c8942..a907c8942 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java
new file mode 100644
index 000000000..46a5d1c75
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java
@@ -0,0 +1,91 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+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;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.OnHMIStatus}
+ */
+public class OnHMIStatusTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnHMIStatus msg = new OnHMIStatus();
+
+ msg.setAudioStreamingState(Test.GENERAL_AUDIOSTREAMINGSTATE);
+ msg.setVideoStreamingState(Test.GENERAL_VIDEOSTREAMINGSTATE);
+ msg.setFirstRun(Test.GENERAL_BOOLEAN);
+ msg.setHmiLevel(Test.GENERAL_HMILEVEL);
+ msg.setSystemContext(Test.GENERAL_SYSTEMCONTEXT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_HMI_STATUS.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnHMIStatus.KEY_AUDIO_STREAMING_STATE, Test.GENERAL_AUDIOSTREAMINGSTATE);
+ result.put(OnHMIStatus.KEY_VIDEO_STREAMING_STATE, Test.GENERAL_VIDEOSTREAMINGSTATE);
+ result.put(OnHMIStatus.KEY_HMI_LEVEL, Test.GENERAL_HMILEVEL);
+ result.put(OnHMIStatus.KEY_SYSTEM_CONTEXT, Test.GENERAL_SYSTEMCONTEXT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ AudioStreamingState audioStreamingState = ( (OnHMIStatus) msg ).getAudioStreamingState();
+ VideoStreamingState videoStreamingState = ( (OnHMIStatus) msg ).getVideoStreamingState();
+ HMILevel hmiLevel = ( (OnHMIStatus) msg ).getHmiLevel();
+ SystemContext context = ( (OnHMIStatus) msg ).getSystemContext();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIOSTREAMINGSTATE, audioStreamingState);
+ assertEquals(Test.MATCH, Test.GENERAL_VIDEOSTREAMINGSTATE, videoStreamingState);
+ assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL, hmiLevel);
+ assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCONTEXT, context);
+
+ // Invalid/Null Tests
+ OnHMIStatus msg = new OnHMIStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+ 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());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java
new file mode 100644
index 000000000..cfc439a89
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java
@@ -0,0 +1,69 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnHashChange;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnHashChange}
+ */
+public class OnHashChangeTests extends BaseRpcTests{
+
+ private static final String HASH_ID = "agh4lg2hb1g9gq3";
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnHashChange msg = new OnHashChange();
+
+ msg.setHashID(HASH_ID);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_HASH_CHANGE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnHashChange.KEY_HASH_ID, HASH_ID);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String hashId = ( (OnHashChange) msg ).getHashID();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, HASH_ID, hashId);
+
+ // Invalid/Null Tests
+ OnHashChange msg = new OnHashChange();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getHashID());
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java
index 4fded53fe..4fded53fe 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java
new file mode 100644
index 000000000..4f541a84a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java
@@ -0,0 +1,73 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
+import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnKeyboardInput}
+ */
+public class OnKeyboardInputTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnKeyboardInput msg = new OnKeyboardInput();
+
+ msg.setData(Test.GENERAL_STRING);
+ msg.setEvent(Test.GENERAL_KEYBOARDEVENT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_KEYBOARD_INPUT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnKeyboardInput.KEY_DATA, Test.GENERAL_STRING);
+ result.put(OnKeyboardInput.KEY_EVENT, Test.GENERAL_KEYBOARDEVENT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ KeyboardEvent event = ( (OnKeyboardInput) msg ).getEvent();
+ String data = ( (OnKeyboardInput) msg ).getData();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_KEYBOARDEVENT, event);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, data);
+
+ // Invalid/Null Tests
+ OnKeyboardInput msg = new OnKeyboardInput();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getData());
+ assertNull(Test.NULL, msg.getEvent());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java
new file mode 100644
index 000000000..884851f4c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java
@@ -0,0 +1,73 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnLanguageChange;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnLanguageChange}
+ */
+public class OnLanguageChangeTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnLanguageChange msg = new OnLanguageChange();
+
+ msg.setLanguage(Test.GENERAL_LANGUAGE);
+ msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_LANGUAGE_CHANGE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnLanguageChange.KEY_LANGUAGE, Test.GENERAL_LANGUAGE);
+ result.put(OnLanguageChange.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Language lang = ( (OnLanguageChange) msg ).getLanguage();
+ Language hmiLang = ( (OnLanguageChange) msg ).getHmiDisplayLanguage();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, lang);
+ assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, hmiLang);
+
+ // Invalid/Null Tests
+ OnLanguageChange msg = new OnLanguageChange();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getLanguage());
+ assertNull(Test.NULL, msg.getHmiDisplayLanguage());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java
new file mode 100644
index 000000000..0326cda53
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java
@@ -0,0 +1,85 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnLockScreenStatus}
+ */
+public class OnLockScreenStatusTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnLockScreenStatus msg = new OnLockScreenStatus();
+
+ msg.setDriverDistractionStatus(Test.GENERAL_BOOLEAN);
+ msg.setHMILevel(Test.GENERAL_HMILEVEL);
+ msg.setShowLockScreen(Test.GENERAL_LOCKSCREENSTATUS);
+ msg.setUserSelected(Test.GENERAL_BOOLEAN);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_LOCK_SCREEN_STATUS.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnLockScreenStatus.KEY_DRIVER_DISTRACTION, Test.GENERAL_BOOLEAN);
+ result.put(OnHMIStatus.KEY_HMI_LEVEL, Test.GENERAL_HMILEVEL);
+ result.put(OnLockScreenStatus.KEY_SHOW_LOCK_SCREEN, Test.GENERAL_LOCKSCREENSTATUS);
+ result.put(OnLockScreenStatus.KEY_USER_SELECTED, Test.GENERAL_BOOLEAN);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Boolean status = ( (OnLockScreenStatus) msg ).getDriverDistractionStatus();
+ HMILevel hmiLevel = ( (OnLockScreenStatus) msg ).getHMILevel();
+ LockScreenStatus lockScreen = ( (OnLockScreenStatus) msg ).getShowLockScreen();
+ boolean userSelected = ( (OnLockScreenStatus) msg ).getUserSelected();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, status);
+ assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL, hmiLevel);
+ assertEquals(Test.MATCH, Test.GENERAL_LOCKSCREENSTATUS, lockScreen);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, userSelected);
+
+ // Invalid/Null Tests
+ OnLockScreenStatus msg = new OnLockScreenStatus();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getDriverDistractionStatus());
+ assertNull(Test.NULL, msg.getHMILevel());
+ assertNull(Test.NULL, msg.getShowLockScreen());
+ assertNull(Test.NULL, msg.getUserSelected());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java
new file mode 100644
index 000000000..e390fc599
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
+import com.smartdevicelink.proxy.rpc.PermissionItem;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnPermissionsChange}
+ */
+public class OnPermissionsChangeTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnPermissionsChange msg = new OnPermissionsChange();
+
+ msg.setPermissionItem(Test.GENERAL_PERMISSIONITEM_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_PERMISSIONS_CHANGE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnPermissionsChange.KEY_PERMISSION_ITEM, Test.JSON_PERMISSIONITEMS);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<PermissionItem> data = ( (OnPermissionsChange) msg ).getPermissionItem();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_PERMISSIONITEM_LIST.size(), data.size());
+ for(int i=0; i<data.size(); i++){
+ assertTrue(Test.TRUE, Validator.validatePermissionItem(Test.GENERAL_PERMISSIONITEM_LIST.get(i), data.get(i)));
+ }
+
+ // Invalid/Null Tests
+ OnPermissionsChange msg = new OnPermissionsChange();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getPermissionItem());
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java
index defede878..defede878 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java
new file mode 100644
index 000000000..312d5abd1
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java
@@ -0,0 +1,26 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
+import com.smartdevicelink.proxy.callbacks.OnProxyOpened;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.callbacks.OnProxyOpened}
+ */
+public class OnProxyOpenedTests extends TestCase {
+
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.proxy.callbacks.OnProxyOpened#OnProxyOpened()}
+ * {@link com.smartdevicelink.proxy.callbacks.OnProxyOpened#getFunctionName()}
+ */
+ public void testMethods () {
+ OnProxyOpened testOnProxyOpened = new OnProxyOpened();
+ assertNotNull(Test.NOT_NULL, testOnProxyOpened);
+ assertEquals(Test.MATCH, InternalProxyMessage.OnProxyOpened, testOnProxyOpened.getFunctionName());
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java
index a6d4d63fd..a6d4d63fd 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java
new file mode 100644
index 000000000..7146ca0cf
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java
@@ -0,0 +1,78 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnSdlChoiceChosen;
+import com.smartdevicelink.proxy.rpc.OnSdlChoiceChosen.SdlChoice;
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.OnSdlChoiceChosen}
+ */
+public class OnSdlChoiceChosenTests extends BaseRpcTests{
+
+ SdlChoice sdlChoice;
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnSdlChoiceChosen msg = new OnSdlChoiceChosen();
+ sdlChoice = msg.new SdlChoice(Test.GENERAL_CHOICE);
+
+ msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE);
+ msg.setSdlChoice(sdlChoice);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_SDL_CHOICE_CHOSEN.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnSdlChoiceChosen.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE);
+ result.put(OnSdlChoiceChosen.KEY_SDL_CHOICE, sdlChoice);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ SdlChoice data = ( (OnSdlChoiceChosen) msg ).getSdlChoice();
+ TriggerSource source = ( (OnSdlChoiceChosen) msg ).getTriggerSource();
+
+ // Valid Tests
+ assertTrue(Test.MATCH, Validator.validateChoice(Test.GENERAL_CHOICE, data.getChoice()));
+ assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, source);
+
+ // Invalid/Null Tests
+ OnSdlChoiceChosen msg = new OnSdlChoiceChosen();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getTriggerSource());
+ assertNull(Test.NULL, msg.getSdlChoice());
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java
index 58db7d8eb..58db7d8eb 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemCapabilityUpdatedTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemCapabilityUpdatedTests.java
new file mode 100644
index 000000000..ca0fa5f02
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemCapabilityUpdatedTests.java
@@ -0,0 +1,73 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnSystemCapabilityUpdated;
+import com.smartdevicelink.proxy.rpc.SystemCapability;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.OnSystemCapabilityUpdated}
+ */
+public class OnSystemCapabilityUpdatedTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnSystemCapabilityUpdated msg = new OnSystemCapabilityUpdated();
+
+ msg.setSystemCapability(Test.GENERAL_SYSTEMCAPABILITY);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnSystemCapabilityUpdated.KEY_SYSTEM_CAPABILITY, Test.GENERAL_SYSTEMCAPABILITY.serializeJSON());
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ SystemCapability cmdId = ( (OnSystemCapabilityUpdated) msg ).getSystemCapability();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITY, cmdId);
+
+ // Invalid/Null Tests
+ OnSystemCapabilityUpdated msg = new OnSystemCapabilityUpdated();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSystemCapability());
+
+ // test constructor with param
+ msg = new OnSystemCapabilityUpdated(Test.GENERAL_SYSTEMCAPABILITY);
+ SystemCapability systemCapability = msg.getSystemCapability();
+ assertEquals(systemCapability, Test.GENERAL_SYSTEMCAPABILITY);
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java
new file mode 100644
index 000000000..d4490dd15
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java
@@ -0,0 +1,133 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Headers;
+import com.smartdevicelink.proxy.rpc.OnSystemRequest;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.OnSystemRequest}
+ */
+public class OnSystemRequestTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnSystemRequest msg = new OnSystemRequest();
+
+ msg.setFileType(Test.GENERAL_FILETYPE);
+ msg.setLength(Test.GENERAL_LONG);
+ msg.setOffset(Test.GENERAL_LONG);
+ msg.setRequestType(Test.GENERAL_REQUESTTYPE);
+ msg.setRequestSubType(Test.GENERAL_STRING);
+ msg.setTimeout(Test.GENERAL_INT);
+ msg.setUrl(Test.GENERAL_STRING);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_SYSTEM_REQUEST.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnSystemRequest.KEY_FILE_TYPE, Test.GENERAL_FILETYPE);
+ result.put(OnSystemRequest.KEY_LENGTH, Test.GENERAL_LONG);
+ result.put(OnSystemRequest.KEY_TIMEOUT, Test.GENERAL_INT);
+ result.put(OnSystemRequest.KEY_OFFSET, Test.GENERAL_LONG);
+ result.put(OnSystemRequest.KEY_URL, Test.GENERAL_STRING);
+ result.put(OnSystemRequest.KEY_REQUEST_TYPE, Test.GENERAL_REQUESTTYPE);
+ result.put(OnSystemRequest.KEY_REQUEST_SUB_TYPE, Test.GENERAL_STRING);
+ } catch(JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ FileType fileType = ( (OnSystemRequest) msg ).getFileType();
+ Long length = ( (OnSystemRequest) msg ).getLength();
+ int timeout = ( (OnSystemRequest) msg ).getTimeout();
+ Long offset = ( (OnSystemRequest) msg ).getOffset();
+ String url = ( (OnSystemRequest) msg ).getUrl();
+ RequestType requestType = ( (OnSystemRequest) msg ).getRequestType();
+ String requestSubType = ( (OnSystemRequest) msg ).getRequestSubType();
+
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, fileType);
+ assertEquals(Test.MATCH, Test.GENERAL_LONG, length);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, timeout);
+ assertEquals(Test.MATCH, Test.GENERAL_LONG, offset);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, url);
+ assertEquals(Test.MATCH, Test.GENERAL_REQUESTTYPE, requestType);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, requestSubType);
+
+ // Test Body
+ OnSystemRequest osr = (OnSystemRequest) msg;
+ String body = osr.getBody();
+ assertNull(Test.NULL, body);
+
+ String testBody = "123ABC";
+ osr.setBody(testBody);
+
+ String readBody = osr.getBody();
+ assertEquals(Test.MATCH, testBody, readBody);
+
+ // Test Headers
+ Headers headers = osr.getHeader();
+ assertNull(Test.NULL, headers);
+
+ Headers testHeaders = new Headers();
+ testHeaders.setCharset("ASCII");
+ testHeaders.setConnectTimeout(1000);
+ testHeaders.setContentLength(1024);
+ testHeaders.setContentType("application/json");
+ testHeaders.setDoInput(false);
+ testHeaders.setDoOutput(true);
+ testHeaders.setInstanceFollowRedirects(true);
+ testHeaders.setReadTimeout(800);
+ testHeaders.setRequestMethod("POST");
+ testHeaders.setUseCaches(false);
+ osr.setHeaders(testHeaders);
+
+ Headers readHeaders = osr.getHeader();
+ assertTrue(Test.TRUE, Validator.validateHeaders(testHeaders, readHeaders));
+
+ // Invalid/Null Tests
+ OnSystemRequest msg = new OnSystemRequest();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getFileType());
+ assertNull(Test.NULL, msg.getLength());
+ assertNull(Test.NULL, msg.getOffset());
+ assertNull(Test.NULL, msg.getTimeout());
+ assertNull(Test.NULL, msg.getUrl());
+ assertNull(Test.NULL, msg.getRequestType());
+ assertNull(Test.NULL, msg.getRequestSubType());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java
new file mode 100644
index 000000000..3b8b8fa3f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java
@@ -0,0 +1,68 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnTBTClientState;
+import com.smartdevicelink.proxy.rpc.enums.TBTState;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnTBTClientState}
+ */
+public class OnTBTClientStateTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnTBTClientState msg = new OnTBTClientState();
+
+ msg.setState(Test.GENERAL_TBTSTATE);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_TBT_CLIENT_STATE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnTBTClientState.KEY_STATE, Test.GENERAL_TBTSTATE);
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ TBTState data = ( (OnTBTClientState) msg ).getState();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_TBTSTATE, data);
+
+ // Invalid/Null Tests
+ OnTBTClientState msg = new OnTBTClientState();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getState());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java
new file mode 100644
index 000000000..a978d12e7
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java
@@ -0,0 +1,81 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.OnTouchEvent;
+import com.smartdevicelink.proxy.rpc.TouchEvent;
+import com.smartdevicelink.proxy.rpc.enums.TouchType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.OnTouchEvent}
+ */
+public class OnTouchEventTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ OnTouchEvent msg = new OnTouchEvent();
+ msg.setType(Test.GENERAL_TOUCHTYPE);
+ msg.setEvent(Test.GENERAL_TOUCHEVENT_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_TOUCH_EVENT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnTouchEvent.KEY_TYPE,Test.GENERAL_TOUCHTYPE);
+ result.put(OnTouchEvent.KEY_EVENT, Test.JSON_TOUCHEVENTS);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ TouchType type = ( (OnTouchEvent) msg ).getType();
+ List<TouchEvent> event = ( (OnTouchEvent) msg ).getEvent();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_TOUCHTYPE, type);
+ assertEquals(Test.MATCH, Test.GENERAL_TOUCHEVENT_LIST.size(), event.size());
+ for(int i=0; i< Test.GENERAL_TOUCHEVENT_LIST.size(); i++){
+ TouchEvent referenceEvent = Test.GENERAL_TOUCHEVENT_LIST.get(i);
+ TouchEvent dataEvent = event.get(i);
+ assertTrue(Test.TRUE, Validator.validateTouchEvent(referenceEvent, dataEvent));
+ }
+
+ // Invalid/Null Tests
+ OnTouchEvent msg = new OnTouchEvent();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getType());
+ assertNull(Test.NULL, msg.getEvent());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java
new file mode 100644
index 000000000..c4dd2378f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java
@@ -0,0 +1,499 @@
+package com.smartdevicelink.test.rpc.notifications;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AirbagStatus;
+import com.smartdevicelink.proxy.rpc.BeltStatus;
+import com.smartdevicelink.proxy.rpc.BodyInformation;
+import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
+import com.smartdevicelink.proxy.rpc.DeviceStatus;
+import com.smartdevicelink.proxy.rpc.ECallInfo;
+import com.smartdevicelink.proxy.rpc.EmergencyEvent;
+import com.smartdevicelink.proxy.rpc.FuelRange;
+import com.smartdevicelink.proxy.rpc.GPSData;
+import com.smartdevicelink.proxy.rpc.HeadLampStatus;
+import com.smartdevicelink.proxy.rpc.MyKey;
+import com.smartdevicelink.proxy.rpc.OnVehicleData;
+import com.smartdevicelink.proxy.rpc.SingleTireStatus;
+import com.smartdevicelink.proxy.rpc.TireStatus;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
+import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
+import com.smartdevicelink.proxy.rpc.enums.PRNDL;
+import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.VehicleDataHelper;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.OnVehicleData}
+ */
+public class OnVehicleDataTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return VehicleDataHelper.VEHICLE_DATA;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_NOTIFICATION;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ON_VEHICLE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(OnVehicleData.KEY_SPEED, VehicleDataHelper.SPEED);
+ result.put(OnVehicleData.KEY_RPM, VehicleDataHelper.RPM);
+ result.put(OnVehicleData.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE);
+ result.put(OnVehicleData.KEY_FUEL_LEVEL, VehicleDataHelper.FUEL_LEVEL);
+ result.put(OnVehicleData.KEY_VIN, VehicleDataHelper.VIN);
+ result.put(OnVehicleData.KEY_PRNDL, VehicleDataHelper.PRNDL_FINAL);
+ result.put(OnVehicleData.KEY_TIRE_PRESSURE, VehicleDataHelper.TIRE_PRESSURE.serializeJSON());
+ result.put(OnVehicleData.KEY_ENGINE_TORQUE, VehicleDataHelper.ENGINE_TORQUE);
+ result.put(OnVehicleData.KEY_ENGINE_OIL_LIFE, VehicleDataHelper.ENGINE_OIL_LIFE);
+ result.put(OnVehicleData.KEY_ODOMETER, VehicleDataHelper.ODOMETER);
+ result.put(OnVehicleData.KEY_GPS, VehicleDataHelper.GPS.serializeJSON());
+ result.put(OnVehicleData.KEY_FUEL_LEVEL_STATE, VehicleDataHelper.FUEL_LEVEL_STATE);
+ result.put(OnVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION);
+ result.put(OnVehicleData.KEY_BELT_STATUS, VehicleDataHelper.BELT_STATUS.serializeJSON());
+ result.put(OnVehicleData.KEY_BODY_INFORMATION, VehicleDataHelper.BODY_INFORMATION.serializeJSON());
+ result.put(OnVehicleData.KEY_DEVICE_STATUS, VehicleDataHelper.DEVICE_STATUS.serializeJSON());
+ result.put(OnVehicleData.KEY_DRIVER_BRAKING, VehicleDataHelper.DRIVER_BRAKING);
+ result.put(OnVehicleData.KEY_WIPER_STATUS, VehicleDataHelper.WIPER_STATUS);
+ result.put(OnVehicleData.KEY_HEAD_LAMP_STATUS, VehicleDataHelper.HEAD_LAMP_STATUS.serializeJSON());
+ result.put(OnVehicleData.KEY_ACC_PEDAL_POSITION, VehicleDataHelper.ACC_PEDAL_POSITION);
+ result.put(OnVehicleData.KEY_STEERING_WHEEL_ANGLE, VehicleDataHelper.STEERING_WHEEL_ANGLE);
+ result.put(OnVehicleData.KEY_E_CALL_INFO, VehicleDataHelper.E_CALL_INFO.serializeJSON());
+ result.put(OnVehicleData.KEY_AIRBAG_STATUS, VehicleDataHelper.AIRBAG_STATUS.serializeJSON());
+ result.put(OnVehicleData.KEY_EMERGENCY_EVENT, VehicleDataHelper.EMERGENCY_EVENT.serializeJSON());
+ result.put(OnVehicleData.KEY_CLUSTER_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS.serializeJSON());
+ result.put(OnVehicleData.KEY_MY_KEY, VehicleDataHelper.MY_KEY.serializeJSON());
+ result.put(OnVehicleData.KEY_FUEL_RANGE, VehicleDataHelper.JSON_FUEL_RANGE);
+ result.put(OnVehicleData.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL);
+ result.put(OnVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
+ } catch(JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Double speed = ( (OnVehicleData) msg).getSpeed();
+ int rpm = ( (OnVehicleData) msg).getRpm();
+ Double external = ( (OnVehicleData) msg).getExternalTemperature();
+ Double fuelLevel = ( (OnVehicleData) msg).getFuelLevel();
+ String vin = ( (OnVehicleData) msg).getVin();
+ PRNDL prndl = ( (OnVehicleData) msg).getPrndl();
+ TireStatus pressure = ( (OnVehicleData) msg).getTirePressure();
+ Double torque = ( (OnVehicleData) msg).getEngineTorque();
+ Float engineOilLife = ( (OnVehicleData) msg).getEngineOilLife();
+ int odometer = ( (OnVehicleData) msg).getOdometer();
+ GPSData gps = ( (OnVehicleData) msg).getGps();
+ ComponentVolumeStatus state = ( (OnVehicleData) msg).getFuelLevelState();
+ Double consumption = ( (OnVehicleData) msg).getInstantFuelConsumption();
+ BeltStatus belt = ( (OnVehicleData) msg).getBeltStatus();
+ BodyInformation body = ( (OnVehicleData) msg).getBodyInformation();
+ DeviceStatus device = ( (OnVehicleData) msg).getDeviceStatus();
+ VehicleDataEventStatus brake = ( (OnVehicleData) msg).getDriverBraking();
+ WiperStatus wiper = ( (OnVehicleData) msg).getWiperStatus();
+ HeadLampStatus lamp = ( (OnVehicleData) msg).getHeadLampStatus();
+ Double pedal = ( (OnVehicleData) msg).getAccPedalPosition();
+ Double wheel = ( (OnVehicleData) msg).getSteeringWheelAngle();
+ ECallInfo ecall = ( (OnVehicleData) msg).getECallInfo();
+ AirbagStatus airbag = ( (OnVehicleData) msg).getAirbagStatus();
+ EmergencyEvent event = ( (OnVehicleData) msg).getEmergencyEvent();
+ ClusterModeStatus cluster = ( (OnVehicleData) msg).getClusterModeStatus();
+ MyKey key = ( (OnVehicleData) msg).getMyKey();
+ List<FuelRange> fuelRangeList = ( (OnVehicleData) msg).getFuelRange();
+ TurnSignal turnSignal = ( (OnVehicleData) msg).getTurnSignal();
+ ElectronicParkBrakeStatus electronicParkBrakeStatus = ( (OnVehicleData) msg).getElectronicParkBrakeStatus();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, VehicleDataHelper.SPEED, speed);
+ assertEquals(Test.MATCH, VehicleDataHelper.RPM, rpm);
+ assertEquals(Test.MATCH, VehicleDataHelper.EXTERNAL_TEMPERATURE, external);
+ assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL, fuelLevel);
+ assertEquals(Test.MATCH, VehicleDataHelper.VIN, vin);
+ assertEquals(Test.MATCH, VehicleDataHelper.PRNDL_FINAL, prndl);
+ assertTrue(Test.MATCH, Validator.validateTireStatus(VehicleDataHelper.TIRE_PRESSURE, pressure));
+ assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_TORQUE, torque);
+ assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_OIL_LIFE, engineOilLife);
+ assertEquals(Test.MATCH, VehicleDataHelper.ODOMETER, odometer);
+ assertTrue(Test.MATCH, Validator.validateGpsData(VehicleDataHelper.GPS, gps));
+ assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL_STATE, state);
+ assertEquals(Test.MATCH, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION, consumption);
+ assertTrue(Test.TRUE, Validator.validateBeltStatus(VehicleDataHelper.BELT_STATUS, belt));
+ assertTrue(Test.TRUE, Validator.validateBodyInformation(VehicleDataHelper.BODY_INFORMATION, body));
+ assertTrue(Test.TRUE, Validator.validateDeviceStatus(VehicleDataHelper.DEVICE_STATUS, device));
+ assertEquals(Test.MATCH, VehicleDataHelper.DRIVER_BRAKING, brake);
+ assertEquals(Test.MATCH, VehicleDataHelper.WIPER_STATUS, wiper);
+ assertTrue(Test.TRUE, Validator.validateHeadLampStatus(VehicleDataHelper.HEAD_LAMP_STATUS, lamp));
+ assertEquals(Test.MATCH, VehicleDataHelper.ACC_PEDAL_POSITION, pedal);
+ assertEquals(Test.MATCH, VehicleDataHelper.STEERING_WHEEL_ANGLE, wheel);
+ assertTrue(Test.TRUE, Validator.validateECallInfo(VehicleDataHelper.E_CALL_INFO, ecall));
+ assertTrue(Test.TRUE, Validator.validateAirbagStatus(VehicleDataHelper.AIRBAG_STATUS, airbag));
+ assertTrue(Test.TRUE, Validator.validateEmergencyEvent(VehicleDataHelper.EMERGENCY_EVENT, event));
+ assertTrue(Test.TRUE, Validator.validateClusterModeStatus(VehicleDataHelper.CLUSTER_MODE_STATUS, cluster));
+ assertTrue(Test.TRUE, Validator.validateMyKey(VehicleDataHelper.MY_KEY, key));
+ assertTrue(Test.TRUE, Validator.validateFuelRange(VehicleDataHelper.FUEL_RANGE_LIST, fuelRangeList));
+ assertEquals(Test.MATCH, VehicleDataHelper.TURN_SIGNAL, turnSignal);
+ assertEquals(Test.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+
+ // Invalid/Null Tests
+ OnVehicleData msg = new OnVehicleData();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSpeed());
+ assertNull(Test.NULL, msg.getRpm());
+ assertNull(Test.NULL, msg.getExternalTemperature());
+ assertNull(Test.NULL, msg.getFuelLevel());
+ assertNull(Test.NULL, msg.getVin());
+ assertNull(Test.NULL, msg.getPrndl());
+ assertNull(Test.NULL, msg.getTirePressure());
+ assertNull(Test.NULL, msg.getEngineTorque());
+ assertNull(Test.NULL, msg.getEngineOilLife());
+ assertNull(Test.NULL, msg.getOdometer());
+ assertNull(Test.NULL, msg.getGps());
+ assertNull(Test.NULL, msg.getFuelLevelState());
+ assertNull(Test.NULL, msg.getInstantFuelConsumption());
+ assertNull(Test.NULL, msg.getBeltStatus());
+ assertNull(Test.NULL, msg.getBodyInformation());
+ assertNull(Test.NULL, msg.getDeviceStatus());
+ assertNull(Test.NULL, msg.getDriverBraking());
+ assertNull(Test.NULL, msg.getWiperStatus());
+ assertNull(Test.NULL, msg.getHeadLampStatus());
+ assertNull(Test.NULL, msg.getAccPedalPosition());
+ assertNull(Test.NULL, msg.getSteeringWheelAngle());
+ assertNull(Test.NULL, msg.getECallInfo());
+ assertNull(Test.NULL, msg.getAirbagStatus());
+ assertNull(Test.NULL, msg.getEmergencyEvent());
+ assertNull(Test.NULL, msg.getClusterModeStatus());
+ assertNull(Test.NULL, msg.getMyKey());
+ assertNull(Test.NULL, msg.getFuelRange());
+ assertNull(Test.NULL, msg.getTurnSignal());
+ assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ //Objects needed on the first level.
+ JSONObject tireStatusObj = new JSONObject();
+ JSONObject GPSDataObj = new JSONObject();
+ JSONObject beltStatusObj = new JSONObject();
+ JSONObject bodyInformationObj = new JSONObject();
+ JSONObject deviceStatusObj = new JSONObject();
+ JSONObject headLampStatusObj = new JSONObject();
+ JSONObject ECallInfoObj = new JSONObject();
+ JSONObject airbagStatusObj = new JSONObject();
+ JSONObject emergencyEventObj = new JSONObject();
+ JSONObject clusterModeStatusObj = new JSONObject();
+ JSONObject myKeyObj = new JSONObject();
+ JSONObject fuelRangeObj = new JSONObject();
+ JSONArray fuelRangeArrayObj = new JSONArray();
+
+ try {
+ //Set up the JSONObject to represent OnVehicleData:
+
+ //TIRE_PRESSURE
+ tireStatusObj.put(TireStatus.KEY_PRESSURE_TELL_TALE, VehicleDataHelper.TIRE_PRESSURE_TELL_TALE);
+ JSONObject tireLeftFront = new JSONObject();
+ tireLeftFront.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_LEFT_FRONT);
+ tireStatusObj.put(TireStatus.KEY_LEFT_FRONT, tireLeftFront);
+ JSONObject tireRightFront = new JSONObject();
+ tireRightFront.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_RIGHT_FRONT);
+ tireStatusObj.put(TireStatus.KEY_RIGHT_FRONT, tireRightFront);
+ JSONObject tireLeftRear = new JSONObject();
+ tireLeftRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_LEFT_REAR);
+ tireStatusObj.put(TireStatus.KEY_LEFT_REAR, tireLeftRear);
+ JSONObject tireRightRear = new JSONObject();
+ tireRightRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_RIGHT_REAR);
+ tireStatusObj.put(TireStatus.KEY_RIGHT_REAR, tireRightRear);
+ JSONObject tireInnerLeftRear = new JSONObject();
+ tireInnerLeftRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_INNER_LEFT_REAR);
+ tireStatusObj.put(TireStatus.KEY_INNER_LEFT_REAR, tireInnerLeftRear);
+ JSONObject tireInnerRightRear = new JSONObject();
+ tireInnerRightRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_INNER_RIGHT_REAR);
+ tireStatusObj.put(TireStatus.KEY_INNER_RIGHT_REAR, tireInnerRightRear);
+
+ //GPS
+ GPSDataObj.put(GPSData.KEY_LONGITUDE_DEGREES, VehicleDataHelper.GPS_LONGITUDE);
+ GPSDataObj.put(GPSData.KEY_LATITUDE_DEGREES, VehicleDataHelper.GPS_LATITUDE);
+ GPSDataObj.put(GPSData.KEY_UTC_YEAR, VehicleDataHelper.GPS_YEAR);
+ GPSDataObj.put(GPSData.KEY_UTC_MONTH, VehicleDataHelper.GPS_MONTH);
+ GPSDataObj.put(GPSData.KEY_UTC_DAY, VehicleDataHelper.GPS_DAY);
+ GPSDataObj.put(GPSData.KEY_UTC_HOURS, VehicleDataHelper.GPS_HOURS);
+ GPSDataObj.put(GPSData.KEY_UTC_MINUTES, VehicleDataHelper.GPS_MINUTES);
+ GPSDataObj.put(GPSData.KEY_UTC_SECONDS, VehicleDataHelper.GPS_SECONDS);
+ GPSDataObj.put(GPSData.KEY_COMPASS_DIRECTION, VehicleDataHelper.GPS_DIRECTION);
+ GPSDataObj.put(GPSData.KEY_PDOP, VehicleDataHelper.GPS_PDOP);
+ GPSDataObj.put(GPSData.KEY_VDOP, VehicleDataHelper.GPS_VDOP);
+ GPSDataObj.put(GPSData.KEY_HDOP, VehicleDataHelper.GPS_HDOP);
+ GPSDataObj.put(GPSData.KEY_ACTUAL, VehicleDataHelper.GPS_ACTUAL);
+ GPSDataObj.put(GPSData.KEY_SATELLITES, VehicleDataHelper.GPS_SATELLITES);
+ GPSDataObj.put(GPSData.KEY_DIMENSION, VehicleDataHelper.GPS_DIMENSION);
+ GPSDataObj.put(GPSData.KEY_ALTITUDE, VehicleDataHelper.GPS_ALTITUDE);
+ GPSDataObj.put(GPSData.KEY_HEADING, VehicleDataHelper.GPS_HEADING);
+ GPSDataObj.put(GPSData.KEY_SPEED, VehicleDataHelper.GPS_SPEED);
+
+ //BELT_STATUS
+ beltStatusObj.put(BeltStatus.KEY_DRIVER_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_DRIVER_DEPLOYED);
+ beltStatusObj.put(BeltStatus.KEY_PASSENGER_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_PASSENGER_DEPLOYED);
+ beltStatusObj.put(BeltStatus.KEY_PASSENGER_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_PASSENGER_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_DRIVER_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_DRIVER_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_LEFT_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_ROW_2_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_PASSENGER_CHILD_DETECTED, VehicleDataHelper.BELT_STATUS_PASSENGER_CHILD);
+ beltStatusObj.put(BeltStatus.KEY_RIGHT_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_ROW_2_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_2_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_3_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_LEFT_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_ROW_3_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_RIGHT_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_ROW_3_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_REAR_INFLATABLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_REAR_INFLATABLE_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_RIGHT_REAR_INFLATABLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_REAR_INFLATABLE_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_1_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_1_DEPLOYED);
+ beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_1_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_1_BELTED);
+
+ //BODY_INFORMATION
+ bodyInformationObj.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, VehicleDataHelper.BODY_INFORMATION_PARK_BRAKE);
+ bodyInformationObj.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STATUS);
+ bodyInformationObj.put(BodyInformation.KEY_IGNITION_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STABLE_STATUS);
+ bodyInformationObj.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_DRIVER_AJAR);
+ bodyInformationObj.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_PASSENGER_AJAR);
+ bodyInformationObj.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_LEFT_AJAR);
+ bodyInformationObj.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_RIGHT_AJAR);
+
+ //DEVICE_STATUS
+ deviceStatusObj.put(DeviceStatus.KEY_VOICE_REC_ON, VehicleDataHelper.DEVICE_STATUS_VOICE_REC);
+ deviceStatusObj.put(DeviceStatus.KEY_BT_ICON_ON, VehicleDataHelper.DEVICE_STATUS_BT_ICON);
+ deviceStatusObj.put(DeviceStatus.KEY_CALL_ACTIVE, VehicleDataHelper.DEVICE_STATUS_CALL_ACTIVE);
+ deviceStatusObj.put(DeviceStatus.KEY_PHONE_ROAMING, VehicleDataHelper.DEVICE_STATUS_PHONE_ROAMING);
+ deviceStatusObj.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, VehicleDataHelper.DEVICE_STATUS_TEXT_MSG_AVAILABLE);
+ deviceStatusObj.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, VehicleDataHelper.DEVICE_STATUS_BATT_LEVEL_STATUS);
+ deviceStatusObj.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, VehicleDataHelper.DEVICE_STATUS_STEREO_MUTED);
+ deviceStatusObj.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, VehicleDataHelper.DEVICE_STATUS_MONO_MUTED);
+ deviceStatusObj.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, VehicleDataHelper.DEVICE_STATUS_SIGNAL_LEVEL_STATUS);
+ deviceStatusObj.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, VehicleDataHelper.DEVICE_STATUS_PRIMARY_AUDIO);
+ deviceStatusObj.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, VehicleDataHelper.DEVICE_STATUS_E_CALL_ACTIVE);
+
+ //HEAD_LAMP_STATUS
+ headLampStatusObj.put(HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS, VehicleDataHelper.HEAD_LAMP_STATUS_AMBIENT_STATUS);
+ headLampStatusObj.put(HeadLampStatus.KEY_HIGH_BEAMS_ON, VehicleDataHelper.HEAD_LAMP_HIGH_BEAMS);
+ headLampStatusObj.put(HeadLampStatus.KEY_LOW_BEAMS_ON, VehicleDataHelper.HEAD_LAMP_LOW_BEAMS);
+
+ //E_CALL_INFO
+ ECallInfoObj.put(ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS, VehicleDataHelper.E_CALL_INFO_E_CALL_NOTIFICATION_STATUS);
+ ECallInfoObj.put(ECallInfo.KEY_AUX_E_CALL_NOTIFICATION_STATUS, VehicleDataHelper.E_CALL_INFO_AUX_E_CALL_NOTIFICATION_STATUS);
+ ECallInfoObj.put(ECallInfo.KEY_E_CALL_CONFIRMATION_STATUS, VehicleDataHelper.E_CALL_INFO_CONFIRMATION_STATUS);
+
+ //AIRBAG_STATUS
+ airbagStatusObj.put(AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_SIDE_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_CURTAIN_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_KNEE_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_SIDE_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_CURTAIN_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_KNEE_DEPLOYED);
+
+ //EMERGENCY_EVENT
+ emergencyEventObj.put(EmergencyEvent.KEY_EMERGENCY_EVENT_TYPE, VehicleDataHelper.EMERGENCY_EVENT_TYPE);
+ emergencyEventObj.put(EmergencyEvent.KEY_FUEL_CUTOFF_STATUS, VehicleDataHelper.EMERGENCY_EVENT_FUEL_CUTOFF_STATUS);
+ emergencyEventObj.put(EmergencyEvent.KEY_ROLLOVER_EVENT, VehicleDataHelper.EMERGENCY_EVENT_ROLLOVER_EVENT);
+ emergencyEventObj.put(EmergencyEvent.KEY_MAXIMUM_CHANGE_VELOCITY, VehicleDataHelper.EMERGENCY_EVENT_MAX_CHANGE_VELOCITY);
+ emergencyEventObj.put(EmergencyEvent.KEY_MULTIPLE_EVENTS, VehicleDataHelper.EMERGENCY_EVENT_MULTIPLE_EVENTS);
+
+ //CLUSTER_MODE_STATUS
+ clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_ACTIVE, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_ACTIVE);
+ clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_QUALIFICATION_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_QUALIFICATION_STATUS);
+ clusterModeStatusObj.put(ClusterModeStatus.KEY_CAR_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_CAR_MODE_STATUS);
+ clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_STATUS);
+
+ //MY_KEY
+ myKeyObj.put(MyKey.KEY_E_911_OVERRIDE, VehicleDataHelper.MY_KEY_E_911_OVERRIDE);
+
+ // FUEL_RANGE
+ fuelRangeObj.put(FuelRange.KEY_TYPE, VehicleDataHelper.FUEL_RANGE_TYPE);
+ fuelRangeObj.put(FuelRange.KEY_RANGE, VehicleDataHelper.FUEL_RANGE_RANGE);
+ fuelRangeArrayObj.put(fuelRangeObj);
+
+ reference.put(OnVehicleData.KEY_SPEED, VehicleDataHelper.SPEED);
+ reference.put(OnVehicleData.KEY_RPM, VehicleDataHelper.RPM);
+ reference.put(OnVehicleData.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE);
+ reference.put(OnVehicleData.KEY_FUEL_LEVEL, VehicleDataHelper.FUEL_LEVEL);
+ reference.put(OnVehicleData.KEY_VIN, VehicleDataHelper.VIN);
+ reference.put(OnVehicleData.KEY_PRNDL, VehicleDataHelper.PRNDL_FINAL);
+ reference.put(OnVehicleData.KEY_TIRE_PRESSURE, tireStatusObj);
+ reference.put(OnVehicleData.KEY_ENGINE_TORQUE, VehicleDataHelper.ENGINE_TORQUE);
+ reference.put(OnVehicleData.KEY_ENGINE_OIL_LIFE, VehicleDataHelper.ENGINE_OIL_LIFE);
+ reference.put(OnVehicleData.KEY_ODOMETER, VehicleDataHelper.ODOMETER);
+ reference.put(OnVehicleData.KEY_GPS, GPSDataObj);
+ reference.put(OnVehicleData.KEY_FUEL_LEVEL_STATE, VehicleDataHelper.FUEL_LEVEL_STATE);
+ reference.put(OnVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION);
+ reference.put(OnVehicleData.KEY_BELT_STATUS, beltStatusObj);
+ reference.put(OnVehicleData.KEY_BODY_INFORMATION, bodyInformationObj);
+ reference.put(OnVehicleData.KEY_DEVICE_STATUS, deviceStatusObj);
+ reference.put(OnVehicleData.KEY_DRIVER_BRAKING, VehicleDataHelper.DRIVER_BRAKING);
+ reference.put(OnVehicleData.KEY_WIPER_STATUS, VehicleDataHelper.WIPER_STATUS);
+ reference.put(OnVehicleData.KEY_HEAD_LAMP_STATUS, headLampStatusObj);
+ reference.put(OnVehicleData.KEY_ACC_PEDAL_POSITION, VehicleDataHelper.ACC_PEDAL_POSITION);
+ reference.put(OnVehicleData.KEY_STEERING_WHEEL_ANGLE, VehicleDataHelper.STEERING_WHEEL_ANGLE);
+ reference.put(OnVehicleData.KEY_E_CALL_INFO, ECallInfoObj);
+ reference.put(OnVehicleData.KEY_AIRBAG_STATUS, airbagStatusObj);
+ reference.put(OnVehicleData.KEY_EMERGENCY_EVENT, emergencyEventObj);
+ reference.put(OnVehicleData.KEY_CLUSTER_MODE_STATUS, clusterModeStatusObj);
+ reference.put(OnVehicleData.KEY_MY_KEY, myKeyObj);
+ reference.put(OnVehicleData.KEY_FUEL_RANGE, fuelRangeArrayObj);
+ reference.put(OnVehicleData.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL);
+ reference.put(OnVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
+
+ JSONObject underTest = msg.serializeJSON();
+ //go inside underTest and only return the JSONObject inside the parameters key inside the notification key
+ underTest = underTest.getJSONObject("notification").getJSONObject("parameters");
+
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ if (key.equals(OnVehicleData.KEY_TIRE_PRESSURE)) {
+ JSONObject tirePressureReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject tirePressureTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateTireStatus(
+ new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureReference)),
+ new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureTest))));
+
+ } else if (key.equals(OnVehicleData.KEY_GPS)) {
+ JSONObject GPSObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject GPSObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateGpsData(
+ new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjReference)),
+ new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjTest))));
+ } else if (key.equals(OnVehicleData.KEY_BELT_STATUS)) {
+ JSONObject beltObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject beltObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateBeltStatus(
+ new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjReference)),
+ new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjTest))));
+ } else if (key.equals(OnVehicleData.KEY_BODY_INFORMATION)) {
+ JSONObject bodyInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject bodyInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateBodyInformation(
+ new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjReference)),
+ new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjTest))));
+ } else if (key.equals(OnVehicleData.KEY_DEVICE_STATUS)) {
+ JSONObject deviceObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject deviceObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateDeviceStatus(
+ new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjReference)),
+ new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjTest))));
+ } else if (key.equals(OnVehicleData.KEY_HEAD_LAMP_STATUS)) {
+ JSONObject headLampObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject headLampObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateHeadLampStatus(
+ new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjReference)),
+ new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjTest))));
+ } else if (key.equals(OnVehicleData.KEY_E_CALL_INFO)) {
+ JSONObject callInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject callInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateECallInfo(
+ new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjReference)),
+ new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjTest))));
+ } else if (key.equals(OnVehicleData.KEY_AIRBAG_STATUS)) {
+ JSONObject airbagObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject airbagObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateAirbagStatus(
+ new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjReference)),
+ new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjTest))));
+ }
+ else if (key.equals(OnVehicleData.KEY_EMERGENCY_EVENT)) {
+ JSONObject emergencyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject emergencyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateEmergencyEvent(
+ new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjReference)),
+ new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjTest))));
+ }
+ else if (key.equals(OnVehicleData.KEY_CLUSTER_MODE_STATUS)) {
+ JSONObject clusterModeObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject clusterModeObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateClusterModeStatus(
+ new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjReference)),
+ new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjTest))));
+ }
+ else if (key.equals(OnVehicleData.KEY_MY_KEY)) {
+ JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue(Test.TRUE, Validator.validateMyKey(
+ new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)),
+ new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest))));
+ }
+ else if (key.equals(OnVehicleData.KEY_ENGINE_OIL_LIFE)) {
+ assertEquals(JsonUtils.readDoubleFromJsonObject(reference, key), JsonUtils.readDoubleFromJsonObject(underTest, key));
+ }
+ else if (key.equals(OnVehicleData.KEY_FUEL_RANGE)) {
+ JSONArray fuelRangeArrayObjReference = JsonUtils.readJsonArrayFromJsonObject(reference, key);
+ List<FuelRange> fuelRangeRefereceList = new ArrayList<FuelRange>();
+ for (int index = 0; index < fuelRangeArrayObjReference.length(); index++) {
+ FuelRange fuelRange = new FuelRange(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)fuelRangeArrayObjReference.get(index) ));
+ fuelRangeRefereceList.add(fuelRange);
+ }
+
+ JSONArray fuelRangeArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ List<FuelRange> fuelRangeUnderTestList = new ArrayList<FuelRange>();
+ for (int index = 0; index < fuelRangeArrayObjTest.length(); index++) {
+ FuelRange fuelRange = new FuelRange(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)fuelRangeArrayObjTest.get(index) ));
+ fuelRangeUnderTestList.add(fuelRange);
+ }
+
+ assertTrue(Test.TRUE, Validator.validateFuelRange(
+ fuelRangeRefereceList,
+ fuelRangeUnderTestList));
+ }
+ else {
+ assertEquals(Test.TRUE, 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/notifications/OnWayPointChangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java
index dcc02dafd..dcc02dafd 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java
new file mode 100644
index 000000000..aa7967c2a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java
@@ -0,0 +1,137 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AddCommand;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.MenuParams;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.AddCommand}
+ */
+public class AddCommandTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ AddCommand msg = new AddCommand();
+
+ msg.setCmdIcon(Test.GENERAL_IMAGE);
+ msg.setMenuParams(Test.GENERAL_MENUPARAMS);
+ msg.setVrCommands(Test.GENERAL_STRING_LIST);
+ msg.setCmdID(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ADD_COMMAND.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(AddCommand.KEY_CMD_ICON, Test.JSON_IMAGE);
+ result.put(AddCommand.KEY_MENU_PARAMS, Test.JSON_MENUPARAMS);
+ result.put(AddCommand.KEY_VR_COMMANDS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ result.put(AddCommand.KEY_CMD_ID, Test.GENERAL_INT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int testCmdId = ( (AddCommand) msg ).getCmdID();
+ Image testImage = ( (AddCommand) msg ).getCmdIcon();
+ MenuParams testMenuParams = ( (AddCommand) msg ).getMenuParams();
+ List<String> testVrCommands = ( (AddCommand) msg ).getVrCommands();
+
+ // Valid Tests
+ assertNotNull(Test.NOT_NULL, testMenuParams);
+ assertNotNull(Test.NOT_NULL, testImage);
+ assertNotNull(Test.NOT_NULL, testVrCommands);
+
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testCmdId);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), testVrCommands.size());
+
+ assertTrue(Test.TRUE, Validator.validateMenuParams(Test.GENERAL_MENUPARAMS, testMenuParams));
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testImage));
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testVrCommands));
+
+ // Invalid/Null Tests
+ AddCommand msg = new AddCommand();
+ assertNotNull(Test.NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getCmdIcon());
+ assertNull(Test.NULL, msg.getCmdID());
+ assertNull(Test.NULL, msg.getMenuParams());
+ assertNull(Test.NULL, msg.getVrCommands());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ AddCommand cmd = new AddCommand(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ List<String> vrCommandsList = JsonUtils.readStringListFromJsonObject(parameters, AddCommand.KEY_VR_COMMANDS);
+ List<String> testCommandsList = cmd.getVrCommands();
+ assertEquals(Test.MATCH, vrCommandsList.size(), testCommandsList.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(vrCommandsList, testCommandsList));
+
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddCommand.KEY_CMD_ID), cmd.getCmdID());
+
+ JSONObject menuParams = JsonUtils.readJsonObjectFromJsonObject(parameters, AddCommand.KEY_MENU_PARAMS);
+ MenuParams referenceMenuParams = new MenuParams(JsonRPCMarshaller.deserializeJSONObject(menuParams));
+ assertTrue(Test.TRUE, Validator.validateMenuParams(referenceMenuParams, cmd.getMenuParams()));
+
+ JSONObject cmdIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddCommand.KEY_CMD_ICON);
+ Image referenceCmdIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(cmdIcon));
+ assertTrue(Test.TRUE, Validator.validateImage(referenceCmdIcon, cmd.getCmdIcon()));
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java
new file mode 100644
index 000000000..4ba991c44
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java
@@ -0,0 +1,122 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AddSubMenu;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.AddSubMenu}
+ */
+public class AddSubmenuTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ AddSubMenu msg = new AddSubMenu();
+
+ msg.setMenuID(Test.GENERAL_INT);
+ msg.setMenuName(Test.GENERAL_STRING);
+ msg.setPosition(Test.GENERAL_INT);
+ msg.setMenuIcon(Test.GENERAL_IMAGE);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ADD_SUB_MENU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(AddSubMenu.KEY_MENU_ID, Test.GENERAL_INT);
+ result.put(AddSubMenu.KEY_MENU_NAME, Test.GENERAL_STRING);
+ result.put(AddSubMenu.KEY_POSITION, Test.GENERAL_INT);
+ result.put(AddSubMenu.KEY_MENU_ICON, Test.JSON_IMAGE);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int testMenuId = ( (AddSubMenu) msg ).getMenuID();
+ int testPosition = ( (AddSubMenu) msg ).getPosition();
+ String testMenuName = ( (AddSubMenu) msg ).getMenuName();
+ Image testMenuIcon = ( (AddSubMenu) msg ).getMenuIcon();
+
+ // Valid Tests
+ assertEquals("Menu ID didn't match input menu ID.", Test.GENERAL_INT, testMenuId);
+ assertEquals("Menu name didn't match input menu name.", Test.GENERAL_STRING, testMenuName);
+ assertEquals("Position didn't match input position.", Test.GENERAL_INT, testPosition);
+ assertTrue("Menu icon didn't match input icon.", Validator.validateImage(Test.GENERAL_IMAGE, testMenuIcon));
+
+
+ // Invalid/Null Tests
+ AddSubMenu msg = new AddSubMenu();
+ assertNotNull("Null object creation failed.", msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getMenuID());
+ assertNull(Test.NULL, msg.getMenuName());
+ assertNull(Test.NULL, msg.getPosition());
+ assertNull(Test.NULL, msg.getMenuIcon());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ AddSubMenu cmd = new AddSubMenu(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_MENU_ID), cmd.getMenuID());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_POSITION), cmd.getPosition());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, AddSubMenu.KEY_MENU_NAME), cmd.getMenuName());
+
+ JSONObject menuIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddSubMenu.KEY_MENU_ICON);
+ Image referenceMenuIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(menuIcon));
+ assertTrue(Test.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon()));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java
new file mode 100644
index 000000000..6cbe23fd1
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java
@@ -0,0 +1,123 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AlertManeuver;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.AlertManeuver}
+ */
+public class AlertManeuverTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ AlertManeuver msg = new AlertManeuver();
+
+ msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.ALERT_MANEUVER.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(AlertManeuver.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS);
+ result.put(AlertManeuver.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<TTSChunk> testTtsChunks = ( (AlertManeuver) msg ).getTtsChunks();
+ List<SoftButton> testSoftButtons = ( (AlertManeuver) msg ).getSoftButtons();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTtsChunks));
+
+ // Invalid/Null Tests
+ AlertManeuver msg = new AlertManeuver();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getTtsChunks());
+ assertNull(Test.NULL, msg.getSoftButtons());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ AlertManeuver cmd = new AlertManeuver(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, AlertManeuver.KEY_TTS_CHUNKS);
+
+ List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < ttsChunkArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)));
+ ttsChunkList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks()));
+
+ JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, AlertManeuver.KEY_SOFT_BUTTONS);
+ List<SoftButton> softButtonList = new ArrayList<SoftButton>();
+ for (int index = 0; index < softButtonArray.length(); index++) {
+ SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject((JSONObject)softButtonArray.get(index)));
+ softButtonList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java
new file mode 100644
index 000000000..12c440b1b
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java
@@ -0,0 +1,158 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Alert;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.Alert}
+ */
+public class AlertTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ Alert msg = new Alert();
+
+ msg.setDuration(Test.GENERAL_INT);
+ msg.setAlertText1(Test.GENERAL_STRING);
+ msg.setAlertText2(Test.GENERAL_STRING);
+ msg.setAlertText3(Test.GENERAL_STRING);
+ msg.setPlayTone(Test.GENERAL_BOOLEAN);
+ msg.setProgressIndicator(Test.GENERAL_BOOLEAN);
+ msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ALERT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(Alert.KEY_DURATION, Test.GENERAL_INT);
+ result.put(Alert.KEY_ALERT_TEXT_1, Test.GENERAL_STRING);
+ result.put(Alert.KEY_ALERT_TEXT_2, Test.GENERAL_STRING);
+ result.put(Alert.KEY_ALERT_TEXT_3, Test.GENERAL_STRING);
+ result.put(Alert.KEY_PLAY_TONE, Test.GENERAL_BOOLEAN);
+ result.put(Alert.KEY_PROGRESS_INDICATOR, Test.GENERAL_BOOLEAN);
+ result.put(Alert.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS);
+ result.put(Alert.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int testDuration = ( (Alert) msg ).getDuration();
+ String testAlertText1 = ( (Alert) msg ).getAlertText1();
+ String testAlertText2 = ( (Alert) msg ).getAlertText2();
+ String testAlertText3 = ( (Alert) msg ).getAlertText3();
+ boolean testPlayTone = ( (Alert) msg ).getPlayTone();
+ boolean testProgressIndicator = ( (Alert) msg ).getProgressIndicator();
+ List<TTSChunk> testTtsChunks = ( (Alert) msg ).getTtsChunks();
+ List<SoftButton> testSoftButtons = ( (Alert) msg ).getSoftButtons();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testDuration);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText1);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText2);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText3);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testPlayTone);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testProgressIndicator);
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTtsChunks));
+
+ // Invalid/Null Tests
+ Alert msg = new Alert();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getAlertText1());
+ assertNull(Test.NULL, msg.getAlertText2());
+ assertNull(Test.NULL, msg.getAlertText3());
+ assertNull(Test.NULL, msg.getDuration());
+ assertNull(Test.NULL, msg.getPlayTone());
+ assertNull(Test.NULL, msg.getProgressIndicator());
+ assertNull(Test.NULL, msg.getTtsChunks());
+ assertNull(Test.NULL, msg.getSoftButtons());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ Alert cmd = new Alert(hash);
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Alert.KEY_PLAY_TONE), cmd.getPlayTone());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Alert.KEY_DURATION), cmd.getDuration());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_1), cmd.getAlertText1());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_2), cmd.getAlertText2());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_3), cmd.getAlertText3());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Alert.KEY_PROGRESS_INDICATOR), cmd.getProgressIndicator());
+
+ JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Alert.KEY_TTS_CHUNKS);
+ List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < ttsChunkArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) );
+ ttsChunkList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks()));
+
+ JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Alert.KEY_SOFT_BUTTONS);
+ List<SoftButton> softButtonList = new ArrayList<SoftButton>();
+ for (int index = 0; index < softButtonArray.length(); index++) {
+ SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
+ softButtonList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
+ } 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/requests/ButtonPressTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java
index f16a3a87c..f16a3a87c 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java
new file mode 100644
index 000000000..9eda2e182
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java
@@ -0,0 +1,104 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ChangeRegistration;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ChangeRegistration}
+ */
+public class ChangeRegistrationTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ ChangeRegistration msg = new ChangeRegistration();
+
+ msg.setLanguage(Test.GENERAL_LANGUAGE);
+ msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.CHANGE_REGISTRATION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(ChangeRegistration.KEY_LANGUAGE, Test.GENERAL_LANGUAGE);
+ result.put(ChangeRegistration.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Language testLanguage = ( (ChangeRegistration) msg ).getLanguage();
+ Language testHmiLanguage = ( (ChangeRegistration) msg ).getHmiDisplayLanguage();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testLanguage);
+ assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testHmiLanguage);
+
+ // Invalid/Null Tests
+ ChangeRegistration msg = new ChangeRegistration();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getLanguage());
+ assertNull(Test.NULL, msg.getHmiDisplayLanguage());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ChangeRegistration cmd = new ChangeRegistration(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ChangeRegistration.KEY_LANGUAGE), cmd.getLanguage().toString());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ChangeRegistration.KEY_HMI_DISPLAY_LANGUAGE), cmd.getHmiDisplayLanguage().toString());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java
new file mode 100644
index 000000000..5969c53fc
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java
@@ -0,0 +1,115 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Choice;
+import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.CreateInteractionChoiceSet}
+ */
+public class CreateInteractionChoiceSetTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet();
+
+ msg.setInteractionChoiceSetID(Test.GENERAL_INT);
+ msg.setChoiceSet(Test.GENERAL_CHOICE_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.CREATE_INTERACTION_CHOICE_SET.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(CreateInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID, Test.GENERAL_INT);
+ result.put(CreateInteractionChoiceSet.KEY_CHOICE_SET, Test.JSON_CHOICES);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int testCmdId = ( (CreateInteractionChoiceSet) msg ).getInteractionChoiceSetID();
+ List<Choice> testChoices = ( (CreateInteractionChoiceSet) msg ).getChoiceSet();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testCmdId);
+ assertEquals(Test.MATCH, Test.GENERAL_CHOICE_LIST.size(), testChoices.size());
+ for(int i = 0; i < testChoices.size(); i++){
+ assertTrue(Test.TRUE, Validator.validateChoice(Test.GENERAL_CHOICE_LIST.get(i), testChoices.get(i)));
+ }
+
+ // Invalid/Null Tests
+ CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getChoiceSet());
+ assertNull(Test.NULL, msg.getInteractionChoiceSetID());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ CreateInteractionChoiceSet cmd = new CreateInteractionChoiceSet(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CreateInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID), cmd.getInteractionChoiceSetID());
+
+ JSONArray choiceSetArray = JsonUtils.readJsonArrayFromJsonObject(parameters, CreateInteractionChoiceSet.KEY_CHOICE_SET);
+ for (int index = 0; index < choiceSetArray.length(); index++) {
+ Choice chunk = new Choice(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)choiceSetArray.get(index)) );
+ assertTrue(Test.TRUE, Validator.validateChoice(chunk, cmd.getChoiceSet().get(index)) );
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java
new file mode 100644
index 000000000..8b3bff42c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java
@@ -0,0 +1,98 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeleteCommand;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DeleteCommand}
+ */
+public class DeleteCommandTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ DeleteCommand msg = new DeleteCommand();
+
+ msg.setCmdID(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DELETE_COMMAND.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(DeleteCommand.KEY_CMD_ID, Test.GENERAL_INT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int cmdId = ( (DeleteCommand) msg ).getCmdID();
+
+ // Valid Tests
+ assertEquals("Command ID didn't match input command ID.", Test.GENERAL_INT, cmdId);
+
+ // Invalid/Null Tests
+ DeleteCommand msg = new DeleteCommand();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.MATCH, msg.getCmdID());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DeleteCommand cmd = new DeleteCommand(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteCommand.KEY_CMD_ID), cmd.getCmdID());
+ }
+ catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java
new file mode 100644
index 000000000..c86a1c134
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java
@@ -0,0 +1,97 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeleteFile;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DeleteFile}
+ */
+public class DeleteFileTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ DeleteFile msg = new DeleteFile();
+
+ msg.setSdlFileName(Test.GENERAL_STRING);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DELETE_FILE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(DeleteFile.KEY_SDL_FILE_NAME, Test.GENERAL_STRING);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String testFilename = ( (DeleteFile) msg ).getSdlFileName();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testFilename);
+
+ // Invalid/Null Tests
+ DeleteFile msg = new DeleteFile();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSdlFileName());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DeleteFile cmd = new DeleteFile(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, DeleteFile.KEY_SDL_FILE_NAME), cmd.getSdlFileName());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java
new file mode 100644
index 000000000..b30aa1567
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java
@@ -0,0 +1,97 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DeleteInteractionChoiceSet}
+ */
+public class DeleteInteractionChoiceSetTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet();
+
+ msg.setInteractionChoiceSetID(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DELETE_INTERACTION_CHOICE_SET.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(DeleteInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID, Test.GENERAL_INT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int testChoiceSetId = ( (DeleteInteractionChoiceSet) msg ).getInteractionChoiceSetID();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testChoiceSetId);
+
+ // Invalid/Null Tests
+ DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getInteractionChoiceSetID());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DeleteInteractionChoiceSet cmd = new DeleteInteractionChoiceSet(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID), cmd.getInteractionChoiceSetID());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java
new file mode 100644
index 000000000..4ed760099
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java
@@ -0,0 +1,97 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeleteSubMenu;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DeleteSubMenu}
+ */
+public class DeleteSubMenuTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ DeleteSubMenu msg = new DeleteSubMenu();
+
+ msg.setMenuID(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DELETE_SUB_MENU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(DeleteSubMenu.KEY_MENU_ID, Test.GENERAL_INT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int testMenuId = ( (DeleteSubMenu) msg ).getMenuID();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testMenuId);
+
+ // Invalid/Null Tests
+ DeleteSubMenu msg = new DeleteSubMenu();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getMenuID());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DeleteSubMenu cmd = new DeleteSubMenu(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteSubMenu.KEY_MENU_ID), cmd.getMenuID());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java
new file mode 100644
index 000000000..7b050347d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java
@@ -0,0 +1,119 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DiagnosticMessage;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DiagnosticMessage}
+ */
+public class DiagnosticMessageTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ DiagnosticMessage msg = new DiagnosticMessage();
+
+ msg.setMessageLength(Test.GENERAL_INT);
+ msg.setTargetID(Test.GENERAL_INT);
+ msg.setMessageData(Test.GENERAL_INTEGER_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DIAGNOSTIC_MESSAGE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(DiagnosticMessage.KEY_TARGET_ID, Test.GENERAL_INT);
+ result.put(DiagnosticMessage.KEY_MESSAGE_LENGTH, Test.GENERAL_INT);
+ result.put(DiagnosticMessage.KEY_MESSAGE_DATA, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int testTargetId = ( (DiagnosticMessage) msg ).getTargetID();
+ int testMessageLength = ( (DiagnosticMessage) msg ).getMessageLength();
+ List<Integer> testMessageData = ( (DiagnosticMessage) msg ).getMessageData();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testTargetId);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testMessageLength);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.size(), testMessageData.size());
+
+ for(int i = 0; i < testMessageData.size(); i++){
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.get(i), testMessageData.get(i));
+ }
+
+ // Invalid/Null Tests
+ DiagnosticMessage msg = new DiagnosticMessage();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getTargetID());
+ assertNull(Test.NULL, msg.getMessageLength());
+ assertNull(Test.NULL, msg.getMessageData());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DiagnosticMessage cmd = new DiagnosticMessage(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DiagnosticMessage.KEY_TARGET_ID), cmd.getTargetID());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DiagnosticMessage.KEY_MESSAGE_LENGTH), cmd.getMessageLength());
+
+ List<Integer> messageDataList = JsonUtils.readIntegerListFromJsonObject(parameters, DiagnosticMessage.KEY_MESSAGE_DATA);
+ List<Integer> testDataList = cmd.getMessageData();
+ assertEquals(Test.MATCH, messageDataList.size(), testDataList.size());
+ assertTrue(Test.TRUE, Validator.validateIntegerList(messageDataList, testDataList));
+ } 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/requests/DialNumberTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java
index 40a8d432f..40a8d432f 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java
new file mode 100644
index 000000000..0ab5ebe66
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.EndAudioPassThru;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.EndAudioPassThru}
+ */
+public class EndAudioPassThruTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new EndAudioPassThru();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.END_AUDIO_PASS_THRU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ EndAudioPassThru msg = new EndAudioPassThru();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ EndAudioPassThru cmd = new EndAudioPassThru(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java
new file mode 100644
index 000000000..abda43557
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java
@@ -0,0 +1,107 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetAppServiceData;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+public class GetAppServiceDataTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ GetAppServiceData msg = new GetAppServiceData();
+ msg.setServiceType(Test.GENERAL_STRING);
+ msg.setSubscribe(Test.GENERAL_BOOLEAN);
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.GET_APP_SERVICE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(GetAppServiceData.KEY_SERVICE_TYPE, Test.GENERAL_STRING);
+ result.put(GetAppServiceData.KEY_SUBSCRIBE, Test.GENERAL_BOOLEAN);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String serviceType = ( (GetAppServiceData) msg ).getServiceType();
+ boolean subscribe = ( (GetAppServiceData) msg ).getSubscribe();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceType);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, subscribe);
+
+ // Invalid/Null Tests
+ GetAppServiceData msg = new GetAppServiceData();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(msg.getServiceType());
+ assertNull(msg.getSubscribe());
+ }
+
+ /**
+ * Tests constructor with required params
+ */
+ public void testRequiredParamsConstructor () {
+
+ GetAppServiceData msg = new GetAppServiceData(Test.GENERAL_STRING);
+ assertNotNull(Test.NOT_NULL, msg);
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, msg.getServiceType());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetAppServiceData cmd = new GetAppServiceData(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetAppServiceData.KEY_SUBSCRIBE), cmd.getSubscribe());
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetAppServiceData.KEY_SERVICE_TYPE).toString(), cmd.getServiceType().toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetCloudAppPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetCloudAppPropertiesTests.java
new file mode 100644
index 000000000..d31c33caa
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetCloudAppPropertiesTests.java
@@ -0,0 +1,46 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetCloudAppProperties;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+public class GetCloudAppPropertiesTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ GetCloudAppProperties msg = new GetCloudAppProperties();
+
+ msg.setAppID(Test.GENERAL_STRING);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_CLOUD_APP_PROPERTIES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(GetCloudAppProperties.KEY_APP_ID, Test.GENERAL_STRING);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java
new file mode 100644
index 000000000..5b298a93b
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java
@@ -0,0 +1,105 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetDTCs;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.GetDTCs}
+ */
+public class GetDTCsTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ GetDTCs msg = new GetDTCs();
+
+ msg.setEcuName(Test.GENERAL_INT);
+ msg.setDtcMask(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_DTCS.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(GetDTCs.KEY_ECU_NAME, Test.GENERAL_INT);
+ result.put(GetDTCs.KEY_DTC_MASK, Test.GENERAL_INT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int testDtcMask = ( (GetDTCs) msg ).getDtcMask();
+ int testEcuName = ( (GetDTCs) msg ).getEcuName();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testDtcMask);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testEcuName);
+
+ // Invalid/Null Tests
+ GetDTCs msg = new GetDTCs();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getEcuName());
+ assertNull(Test.NULL, msg.getDtcMask());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetDTCs cmd = new GetDTCs(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetDTCs.KEY_DTC_MASK), cmd.getDtcMask());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetDTCs.KEY_ECU_NAME), cmd.getEcuName());
+ }
+ catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java
new file mode 100644
index 000000000..48214373d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java
@@ -0,0 +1,132 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetFile;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+
+public class GetFileTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ GetFile msg = new GetFile();
+
+ msg.setFileName(Test.GENERAL_STRING);
+ msg.setAppServiceId(Test.GENERAL_STRING);
+ msg.setFileType(Test.GENERAL_FILETYPE);
+ msg.setOffset(Test.GENERAL_INT);
+ msg.setLength(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.GET_FILE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(GetFile.KEY_FILE_NAME, Test.GENERAL_STRING);
+ result.put(GetFile.KEY_APP_SERVICE_ID, Test.GENERAL_STRING);
+ result.put(GetFile.KEY_FILE_TYPE, Test.GENERAL_FILETYPE);
+ result.put(GetFile.KEY_OFFSET, Test.GENERAL_INTEGER);
+ result.put(GetFile.KEY_LENGTH, Test.GENERAL_INTEGER);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String fileName = ( (GetFile) msg ).getFileName();
+ String appServiceId = ( (GetFile) msg ).getAppServiceId();
+ FileType fileType = ( (GetFile) msg ).getFileType();
+ Integer offset = ( (GetFile) msg ).getOffset();
+ Integer length = ( (GetFile) msg ).getLength();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, fileName);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, appServiceId);
+ assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, fileType);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER, offset);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER, length);
+
+ // Invalid/Null Tests
+ GetFile msg = new GetFile();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getFileName());
+ assertNull(Test.NULL, msg.getAppServiceId());
+ assertNull(Test.NULL, msg.getFileType());
+ assertNull(Test.NULL, msg.getOffset());
+ assertNull(Test.NULL, msg.getLength());
+ }
+
+ /**
+ * Tests constructor with required params
+ */
+ public void testRequiredParamsConstructor () {
+
+ GetFile msg = new GetFile(Test.GENERAL_STRING);
+ assertNotNull(Test.NOT_NULL, msg);
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, msg.getFileName());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetFile cmd = new GetFile(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetFile.KEY_APP_SERVICE_ID), cmd.getAppServiceId());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetFile.KEY_FILE_NAME), cmd.getFileName());
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetFile.KEY_FILE_TYPE).toString(), cmd.getFileType().toString());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFile.KEY_LENGTH), cmd.getLength());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFile.KEY_OFFSET), cmd.getOffset());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java
index 5a08d4266..5a08d4266 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java
new file mode 100644
index 000000000..290a291d1
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java
@@ -0,0 +1,101 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetSystemCapability;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+public class GetSystemCapabilityTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ GetSystemCapability msg = new GetSystemCapability();
+
+ msg.setSystemCapabilityType(Test.GENERAL_SYSTEMCAPABILITYTYPE);
+ msg.setSubscribe(Test.GENERAL_BOOLEAN);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_SYSTEM_CAPABILITY.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(GetSystemCapability.KEY_SYSTEM_CAPABILITY_TYPE, Test.GENERAL_SYSTEMCAPABILITYTYPE);
+ result.put(GetSystemCapability.KEY_SUBSCRIBE, Test.GENERAL_BOOLEAN);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ SystemCapabilityType testType = ( (GetSystemCapability) msg ).getSystemCapabilityType();
+ boolean testSubscribe = ( (GetSystemCapability) msg ).getSubscribe();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITYTYPE, testType);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testSubscribe);
+
+ // Invalid/Null Tests
+ GetSystemCapability msg = new GetSystemCapability();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSystemCapabilityType());
+ assertNull(Test.NULL, msg.getSubscribe());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetSystemCapability cmd = new GetSystemCapability(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetSystemCapability.KEY_SYSTEM_CAPABILITY_TYPE).toString(), cmd.getSystemCapabilityType().toString());
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetSystemCapability.KEY_SUBSCRIBE), cmd.getSubscribe());
+ }catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java
new file mode 100644
index 000000000..e47560a7c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java
@@ -0,0 +1,235 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetVehicleData;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.GetVehicleData}
+ */
+public class GetVehicleDataTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ GetVehicleData msg = new GetVehicleData();
+
+ msg.setSpeed(Test.GENERAL_BOOLEAN);
+ msg.setRpm(Test.GENERAL_BOOLEAN);
+ msg.setExternalTemperature(Test.GENERAL_BOOLEAN);
+ msg.setFuelLevel(Test.GENERAL_BOOLEAN);
+ msg.setPrndl(Test.GENERAL_BOOLEAN);
+ msg.setTirePressure(Test.GENERAL_BOOLEAN);
+ msg.setEngineTorque(Test.GENERAL_BOOLEAN);
+ msg.setEngineOilLife(Test.GENERAL_BOOLEAN);
+ msg.setOdometer(Test.GENERAL_BOOLEAN);
+ msg.setGps(Test.GENERAL_BOOLEAN);
+ msg.setFuelLevelState(Test.GENERAL_BOOLEAN);
+ msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN);
+ msg.setVin(Test.GENERAL_BOOLEAN);
+ msg.setBeltStatus(Test.GENERAL_BOOLEAN);
+ msg.setBodyInformation(Test.GENERAL_BOOLEAN);
+ msg.setDeviceStatus(Test.GENERAL_BOOLEAN);
+ msg.setDriverBraking(Test.GENERAL_BOOLEAN);
+ msg.setWiperStatus(Test.GENERAL_BOOLEAN);
+ msg.setHeadLampStatus(Test.GENERAL_BOOLEAN);
+ msg.setAccPedalPosition(Test.GENERAL_BOOLEAN);
+ msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN);
+ msg.setECallInfo(Test.GENERAL_BOOLEAN);
+ msg.setAirbagStatus(Test.GENERAL_BOOLEAN);
+ msg.setEmergencyEvent(Test.GENERAL_BOOLEAN);
+ msg.setClusterModeStatus(Test.GENERAL_BOOLEAN);
+ msg.setMyKey(Test.GENERAL_BOOLEAN);
+ msg.setFuelRange(Test.GENERAL_BOOLEAN);
+ msg.setTurnSignal(Test.GENERAL_BOOLEAN);
+ msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_VEHICLE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(GetVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_VIN, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Valid Tests
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getSpeed());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getRpm());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getExternalTemperature());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelLevel());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getPrndl());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getTirePressure());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEngineTorque());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEngineOilLife());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getOdometer());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getGps());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelLevelState());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getInstantFuelConsumption());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getVin());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getBeltStatus());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getBodyInformation());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getVin());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getDeviceStatus());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getDriverBraking());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getWiperStatus());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getHeadLampStatus());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getAccPedalPosition());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getSteeringWheelAngle());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getECallInfo());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getAirbagStatus());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEmergencyEvent());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getClusterModeStatus());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getMyKey());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelRange());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getTurnSignal());
+ assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getElectronicParkBrakeStatus());
+
+ // Invalid/Null Tests
+ GetVehicleData msg = new GetVehicleData();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getAccPedalPosition());
+ assertNull(Test.NULL, msg.getAirbagStatus());
+ assertNull(Test.NULL, msg.getBeltStatus());
+ assertNull(Test.NULL, msg.getDriverBraking());
+ assertNull(Test.NULL, msg.getFuelLevel());
+ assertNull(Test.NULL, msg.getTirePressure());
+ assertNull(Test.NULL, msg.getWiperStatus());
+ assertNull(Test.NULL, msg.getGps());
+ assertNull(Test.NULL, msg.getSpeed());
+ assertNull(Test.NULL, msg.getRpm());
+ assertNull(Test.NULL, msg.getFuelLevelState());
+ assertNull(Test.NULL, msg.getInstantFuelConsumption());
+ assertNull(Test.NULL, msg.getExternalTemperature());
+ assertNull(Test.NULL, msg.getVin());
+ assertNull(Test.NULL, msg.getPrndl());
+ assertNull(Test.NULL, msg.getOdometer());
+ assertNull(Test.NULL, msg.getBodyInformation());
+ assertNull(Test.NULL, msg.getDeviceStatus());
+ assertNull(Test.NULL, msg.getHeadLampStatus());
+ assertNull(Test.NULL, msg.getEngineTorque());
+ assertNull(Test.NULL, msg.getEngineOilLife());
+ assertNull(Test.NULL, msg.getSteeringWheelAngle());
+ assertNull(Test.NULL, msg.getECallInfo());
+ assertNull(Test.NULL, msg.getEmergencyEvent());
+ assertNull(Test.NULL, msg.getClusterModeStatus());
+ assertNull(Test.NULL, msg.getMyKey());
+ assertNull(Test.NULL, msg.getFuelRange());
+ assertNull(Test.NULL, msg.getTurnSignal());
+ assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetVehicleData cmd = new GetVehicleData(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals("Command name doesn't match input name", JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals("Correlation ID doesn't match input ID", JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_SPEED), cmd.getSpeed());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_RPM), cmd.getRpm());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_VIN), cmd.getVin());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_PRNDL), cmd.getPrndl());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ODOMETER), cmd.getOdometer());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_GPS), cmd.getGps());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_MY_KEY), cmd.getMyKey());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus());
+ } 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/requests/GetWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java
index bf0531685..bf0531685 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java
new file mode 100644
index 000000000..2fd8db4ea
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ListFiles;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ListFiles}
+ */
+public class ListFilesTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new ListFiles();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.LIST_FILES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ ListFiles msg = new ListFiles();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ListFiles cmd = new ListFiles(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java
new file mode 100644
index 000000000..5e5c4ffbd
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java
@@ -0,0 +1,128 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.PerformAppServiceInteraction;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+
+public class PerformAppServiceInteractionTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ PerformAppServiceInteraction msg = new PerformAppServiceInteraction();
+
+ msg.setServiceUri(Test.GENERAL_STRING);
+ msg.setServiceID(Test.GENERAL_STRING);
+ msg.setOriginApp(Test.GENERAL_STRING);
+ msg.setRequestServiceActive(Test.GENERAL_BOOLEAN);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.PERFORM_APP_SERVICES_INTERACTION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(PerformAppServiceInteraction.KEY_SERVICE_URI, Test.GENERAL_STRING);
+ result.put(PerformAppServiceInteraction.KEY_SERVICE_ID, Test.GENERAL_STRING);
+ result.put(PerformAppServiceInteraction.KEY_ORIGIN_APP, Test.GENERAL_STRING);
+ result.put(PerformAppServiceInteraction.KEY_REQUEST_SERVICE_ACTIVE, Test.GENERAL_BOOLEAN);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String serviceUri = ( (PerformAppServiceInteraction) msg ).getServiceUri();
+ String appServiceId = ( (PerformAppServiceInteraction) msg ).getServiceID();
+ String originApp = ( (PerformAppServiceInteraction) msg ).getOriginApp();
+ boolean requestServiceActive = ( (PerformAppServiceInteraction) msg ).getRequestServiceActive();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceUri);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, appServiceId);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, originApp);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, requestServiceActive);
+
+ // Invalid/Null Tests
+ PerformAppServiceInteraction msg = new PerformAppServiceInteraction();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getServiceUri());
+ assertNull(Test.NULL, msg.getServiceID());
+ assertNull(Test.NULL, msg.getOriginApp());
+ assertNull(Test.NULL, msg.getRequestServiceActive());
+ }
+
+ /**
+ * Tests constructor with required params
+ */
+ public void testRequiredParamsConstructor () {
+ // test with param in constructor
+ PerformAppServiceInteraction msg = new PerformAppServiceInteraction(Test.GENERAL_STRING,Test.GENERAL_STRING,Test.GENERAL_STRING);
+ String serviceUri = msg.getServiceUri();
+ String appServiceId = msg.getServiceID();
+ String originApp = msg.getOriginApp();
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceUri);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, appServiceId);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, originApp);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PerformAppServiceInteraction cmd = new PerformAppServiceInteraction(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_SERVICE_ID), cmd.getServiceID());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_SERVICE_URI), cmd.getServiceUri());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_ORIGIN_APP), cmd.getOriginApp());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PerformAppServiceInteraction.KEY_REQUEST_SERVICE_ACTIVE), cmd.getRequestServiceActive());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java
new file mode 100644
index 000000000..f3ccf0a59
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java
@@ -0,0 +1,157 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.PerformAudioPassThru;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.PerformAudioPassThru}
+ */
+public class PerformAudioPassThruTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ PerformAudioPassThru msg = new PerformAudioPassThru();
+
+ msg.setInitialPrompt(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setAudioPassThruDisplayText1(Test.GENERAL_STRING);
+ msg.setAudioPassThruDisplayText2(Test.GENERAL_STRING);
+ msg.setSamplingRate(Test.GENERAL_SAMPLINGRATE);
+ msg.setAudioType(Test.GENERAL_AUDIOTYPE);
+ msg.setBitsPerSample(Test.GENERAL_BITSPERSAMPLE);
+ msg.setMaxDuration(Test.GENERAL_INT);
+ msg.setMuteAudio(Test.GENERAL_BOOLEAN);
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.PERFORM_AUDIO_PASS_THRU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1, Test.GENERAL_STRING);
+ result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2, Test.GENERAL_STRING);
+ result.put(PerformAudioPassThru.KEY_MUTE_AUDIO, Test.GENERAL_BOOLEAN);
+ result.put(PerformAudioPassThru.KEY_MAX_DURATION, Test.GENERAL_INT);
+ result.put(PerformAudioPassThru.KEY_AUDIO_TYPE, Test.GENERAL_AUDIOTYPE);
+ result.put(PerformAudioPassThru.KEY_SAMPLING_RATE, Test.GENERAL_SAMPLINGRATE);
+ result.put(PerformAudioPassThru.KEY_BITS_PER_SAMPLE, Test.GENERAL_BITSPERSAMPLE);
+ result.put(PerformAudioPassThru.KEY_INITIAL_PROMPT, Test.JSON_TTSCHUNKS);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ boolean testMuteAudio = ( (PerformAudioPassThru) msg ).getMuteAudio();
+ int testMaxDuration = ( (PerformAudioPassThru) msg ).getMaxDuration();
+ String testText2 = ( (PerformAudioPassThru) msg ).getAudioPassThruDisplayText2();
+ String testText1 = ( (PerformAudioPassThru) msg ).getAudioPassThruDisplayText1();
+ SamplingRate testSamplingRate = ( (PerformAudioPassThru) msg ).getSamplingRate();
+ AudioType testAudioType = ( (PerformAudioPassThru) msg ).getAudioType();
+ BitsPerSample testBitsPerSample = ( (PerformAudioPassThru) msg ).getBitsPerSample();
+ List<TTSChunk> testInitialPrompt = ( (PerformAudioPassThru) msg ).getInitialPrompt();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_TTSCHUNK_LIST.size(), testInitialPrompt.size());
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testText1);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testText2);
+ assertEquals(Test.MATCH, Test.GENERAL_SAMPLINGRATE, testSamplingRate);
+ assertEquals(Test.MATCH, Test.GENERAL_BITSPERSAMPLE, testBitsPerSample);
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIOTYPE, testAudioType);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, testMaxDuration);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testMuteAudio);
+ for (int i = 0; i < Test.GENERAL_TTSCHUNK_LIST.size(); i++) {
+ assertEquals(Test.MATCH, Test.GENERAL_TTSCHUNK_LIST.get(i), testInitialPrompt.get(i));
+ }
+
+ // Invalid/Null Tests
+ PerformAudioPassThru msg = new PerformAudioPassThru();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getInitialPrompt());
+ assertNull(Test.NULL, msg.getAudioPassThruDisplayText1());
+ assertNull(Test.NULL, msg.getAudioPassThruDisplayText2());
+ assertNull(Test.NULL, msg.getSamplingRate());
+ assertNull(Test.NULL, msg.getBitsPerSample());
+ assertNull(Test.NULL, msg.getAudioType());
+ assertNull(Test.NULL, msg.getMaxDuration());
+ assertNull(Test.NULL, msg.getMuteAudio());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PerformAudioPassThru cmd = new PerformAudioPassThru(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformAudioPassThru.KEY_MAX_DURATION), (Integer)cmd.getMaxDuration());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1), cmd.getAudioPassThruDisplayText1());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2), cmd.getAudioPassThruDisplayText2());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PerformAudioPassThru.KEY_MUTE_AUDIO), cmd.getMuteAudio());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_SAMPLING_RATE), cmd.getSamplingRate().toString());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_TYPE), cmd.getAudioType().toString());
+
+ JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformAudioPassThru.KEY_INITIAL_PROMPT);
+ List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < ttsChunkArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) );
+ ttsChunkList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getInitialPrompt()));
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_BITS_PER_SAMPLE), cmd.getBitsPerSample().toString());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java
new file mode 100644
index 000000000..e415d8382
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java
@@ -0,0 +1,187 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.PerformInteraction;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.VrHelpItem;
+import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
+import com.smartdevicelink.proxy.rpc.enums.LayoutMode;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.PerformInteraction}
+ */
+public class PerformInteractionTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ PerformInteraction msg = new PerformInteraction();
+
+ msg.setInitialPrompt(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setHelpPrompt(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setTimeoutPrompt(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setVrHelp(Test.GENERAL_VRHELPITEM_LIST);
+ msg.setInteractionChoiceSetIDList(Test.GENERAL_INTEGER_LIST);
+ msg.setInteractionLayout(Test.GENERAL_LAYOUTMODE);
+ msg.setInitialText(Test.GENERAL_STRING);
+ msg.setInteractionMode(Test.GENERAL_INTERACTIONMODE);
+ msg.setTimeout(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.PERFORM_INTERACTION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(PerformInteraction.KEY_INITIAL_PROMPT, Test.JSON_TTSCHUNKS);
+ result.put(PerformInteraction.KEY_HELP_PROMPT, Test.JSON_TTSCHUNKS);
+ result.put(PerformInteraction.KEY_TIMEOUT_PROMPT, Test.JSON_TTSCHUNKS);
+ result.put(PerformInteraction.KEY_VR_HELP, Test.JSON_VRHELPITEMS);
+ result.put(PerformInteraction.KEY_INTERACTION_CHOICE_SET_ID_LIST, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
+ result.put(PerformInteraction.KEY_INTERACTION_LAYOUT, Test.GENERAL_LAYOUTMODE);
+ result.put(PerformInteraction.KEY_INITIAL_TEXT, Test.GENERAL_STRING);
+ result.put(PerformInteraction.KEY_INTERACTION_MODE, Test.GENERAL_INTERACTIONMODE);
+ result.put(PerformInteraction.KEY_TIMEOUT, Test.GENERAL_INT);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<TTSChunk> testInitialPrompt = ( (PerformInteraction) msg).getInitialPrompt();
+ List<TTSChunk> testHelpPrompt = ( (PerformInteraction) msg).getHelpPrompt();
+ List<TTSChunk> testTimeoutPrompt = ( (PerformInteraction) msg).getTimeoutPrompt();
+ List<VrHelpItem> testVrHelpItems = ( (PerformInteraction) msg).getVrHelp();
+ List<Integer> testChoiceSetIds = ( (PerformInteraction) msg).getInteractionChoiceSetIDList();
+ LayoutMode testLayout = ( (PerformInteraction) msg).getInteractionLayout();
+ String testInitialText = ( (PerformInteraction) msg).getInitialText();
+ InteractionMode testMode = ( (PerformInteraction) msg).getInteractionMode();
+ Integer testTimeout = ( (PerformInteraction) msg).getTimeout();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testInitialPrompt));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testHelpPrompt));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTimeoutPrompt));
+ assertTrue(Test.TRUE, Validator.validateVrHelpItems(Test.GENERAL_VRHELPITEM_LIST, testVrHelpItems));
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testChoiceSetIds);
+ assertEquals(Test.MATCH, Test.GENERAL_LAYOUTMODE, testLayout);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testInitialText);
+ assertEquals(Test.MATCH, Test.GENERAL_INTERACTIONMODE, testMode);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout);
+
+ // Invald/Null Tests
+ PerformInteraction msg = new PerformInteraction();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getInitialPrompt());
+ assertNull(Test.NULL, msg.getHelpPrompt());
+ assertNull(Test.NULL, msg.getTimeoutPrompt());
+ assertNull(Test.NULL, msg.getVrHelp());
+ assertNull(Test.NULL, msg.getInteractionChoiceSetIDList());
+ assertNull(Test.NULL, msg.getInteractionLayout());
+ assertNull(Test.NULL, msg.getInitialText());
+ assertNull(Test.NULL, msg.getInteractionMode());
+ assertNull(Test.NULL, msg.getTimeout());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PerformInteraction cmd = new PerformInteraction(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INITIAL_TEXT), cmd.getInitialText());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_MODE), cmd.getInteractionMode().toString());
+
+ List<Integer> interactionIDList = JsonUtils.readIntegerListFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_CHOICE_SET_ID_LIST);
+ List<Integer> testIDList = cmd.getInteractionChoiceSetIDList();
+ assertEquals(Test.MATCH, interactionIDList.size(), testIDList.size());
+ assertTrue(Test.TRUE, Validator.validateIntegerList(interactionIDList, testIDList));
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_LAYOUT), cmd.getInteractionLayout().toString());
+
+ JSONArray initalPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_INITIAL_PROMPT);
+ List<TTSChunk> initalPromptList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < initalPromptArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)initalPromptArray.get(index)) );
+ initalPromptList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(initalPromptList, cmd.getInitialPrompt()));
+
+ JSONArray helpPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_HELP_PROMPT);
+ List<TTSChunk> helpPromptList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < helpPromptArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)helpPromptArray.get(index)) );
+ helpPromptList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(helpPromptList, cmd.getHelpPrompt()));
+
+ JSONArray timeoutPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_TIMEOUT_PROMPT);
+ List<TTSChunk> timeoutPromptList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < timeoutPromptArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)timeoutPromptArray.get(index)) );
+ timeoutPromptList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(timeoutPromptList, cmd.getTimeoutPrompt()));
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteraction.KEY_TIMEOUT), cmd.getTimeout());
+
+ JSONArray vrHelpArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_VR_HELP);
+ List<VrHelpItem> vrHelpList= new ArrayList<VrHelpItem>();
+ for (int index = 0; index < vrHelpArray.length(); index++) {
+ VrHelpItem vrHelpItem = new VrHelpItem(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)vrHelpArray.get(index)) );
+ vrHelpList.add(vrHelpItem);
+ }
+ assertTrue(Test.TRUE, Validator.validateVrHelpItems(vrHelpList, cmd.getVrHelp()) );
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java
new file mode 100644
index 000000000..ffe7a60b4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java
@@ -0,0 +1,107 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AppServiceManifest;
+import com.smartdevicelink.proxy.rpc.PublishAppService;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+public class PublishAppServiceTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ PublishAppService msg = new PublishAppService();
+ msg.setAppServiceManifest(Test.GENERAL_APPSERVICEMANIFEST);
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.PUBLISH_APP_SERVICE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(PublishAppService.KEY_APP_SERVICE_MANIFEST, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_APPSERVICEMANIFEST.getStore()));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ AppServiceManifest copy = ( (PublishAppService) msg ).getAppServiceManifest();
+
+ // Valid Tests
+ assertTrue(Validator.validateAppServiceManifest(Test.GENERAL_APPSERVICEMANIFEST, copy));
+
+ // Invalid/Null Tests
+ PublishAppService msg = new PublishAppService();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.MATCH, msg.getAppServiceManifest());
+ }
+
+ /**
+ * Tests constructor with required params
+ */
+ public void testRequiredParamsConstructor () {
+
+ PublishAppService msg = new PublishAppService(Test.GENERAL_APPSERVICEMANIFEST);
+ assertNotNull(Test.NOT_NULL, msg);
+ // Valid Tests
+ assertTrue(Validator.validateAppServiceManifest(Test.GENERAL_APPSERVICEMANIFEST, msg.getAppServiceManifest()));
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PublishAppService cmd = new PublishAppService(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONObject appServiceManifestObject = JsonUtils.readJsonObjectFromJsonObject(parameters, PublishAppService.KEY_APP_SERVICE_MANIFEST);
+ AppServiceManifest manifestTest = new AppServiceManifest(JsonRPCMarshaller.deserializeJSONObject(appServiceManifestObject));
+ assertTrue(Test.TRUE, Validator.validateAppServiceManifest(manifestTest, cmd.getAppServiceManifest()));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java
new file mode 100644
index 000000000..2d55dde4b
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java
@@ -0,0 +1,149 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.zip.CRC32;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.PutFile}
+ */
+public class PutFileTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ PutFile msg = new PutFile();
+
+ msg.setFileType(Test.GENERAL_FILETYPE);
+ msg.setPersistentFile(Test.GENERAL_BOOLEAN);
+ msg.setSystemFile(Test.GENERAL_BOOLEAN);
+ msg.setOffset(Test.GENERAL_LONG);
+ msg.setLength(Test.GENERAL_LONG);
+ msg.setCRC(Test.GENERAL_BYTE_ARRAY);
+ msg.setCRC(Test.GENERAL_LONG);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.PUT_FILE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(PutFile.KEY_FILE_TYPE, Test.GENERAL_FILETYPE);
+ result.put(PutFile.KEY_PERSISTENT_FILE, Test.GENERAL_BOOLEAN);
+ result.put(PutFile.KEY_SYSTEM_FILE, Test.GENERAL_BOOLEAN);
+ result.put(PutFile.KEY_OFFSET, Test.GENERAL_LONG);
+ result.put(PutFile.KEY_LENGTH, Test.GENERAL_LONG);
+ result.put(PutFile.KEY_CRC, Test.GENERAL_LONG);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ FileType testFileType = ( (PutFile) msg ).getFileType();
+ boolean testPersistentFile = ( (PutFile) msg ).getPersistentFile();
+ boolean testSystemFile = ( (PutFile) msg ).getSystemFile();
+ Long testOffset = ( (PutFile) msg ).getOffset();
+ Long testLength = ( (PutFile) msg ).getLength();
+ Long testCRC = ( (PutFile) msg ).getCRC();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, testFileType);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testPersistentFile);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testSystemFile);
+ assertEquals(Test.MATCH, Test.GENERAL_LONG, testOffset);
+ assertEquals(Test.MATCH, Test.GENERAL_LONG, testLength);
+ assertEquals(Test.MATCH, Test.GENERAL_LONG, testCRC);
+
+ // Invalid/Null Tests
+ PutFile msg = new PutFile();
+ assertNotNull("Null object creation failed.", msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getFileType());
+ assertNull(Test.NULL, msg.getPersistentFile());
+ assertNull(Test.NULL, msg.getSystemFile());
+ assertNull(Test.NULL, msg.getOffset());
+ assertNull(Test.NULL, msg.getLength());
+ assertNull(Test.NULL, msg.getCRC());
+ }
+
+ /**
+ * Tests the expected values of the CRC checksum.
+ */
+ public void testByteArrayCheckSum () {
+ // Test Values
+ PutFile msgCRC = new PutFile();
+ msgCRC.setCRC(Test.GENERAL_BYTE_ARRAY);
+ Long testCRCByteArray = msgCRC.getCRC();
+
+ CRC32 crc = new CRC32();
+ crc.update(Test.GENERAL_BYTE_ARRAY);
+ Long crcValue = crc.getValue();
+
+ assertEquals(Test.MATCH, crcValue, testCRCByteArray);
+ }
+
+
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PutFile cmd = new PutFile(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PutFile.KEY_PERSISTENT_FILE), cmd.getPersistentFile());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PutFile.KEY_SYSTEM_FILE), cmd.getSystemFile());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PutFile.KEY_FILE_TYPE), cmd.getFileType().toString());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PutFile.KEY_SDL_FILE_NAME), cmd.getSdlFileName());
+ assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_OFFSET).longValue(), cmd.getOffset());
+ assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_LENGTH).longValue(), cmd.getLength());
+ assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_CRC).longValue(), cmd.getCRC());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java
new file mode 100644
index 000000000..77889839f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java
@@ -0,0 +1,109 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ReadDID;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ReadDID}
+ */
+public class ReadDidTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ ReadDID msg = new ReadDID();
+
+ msg.setEcuName(Test.GENERAL_INT);
+ msg.setDidLocation(Test.GENERAL_INTEGER_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.READ_DID.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(ReadDID.KEY_ECU_NAME, Test.GENERAL_INT);
+ result.put(ReadDID.KEY_DID_LOCATION, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer testEcuName = ( (ReadDID) msg ).getEcuName();
+ List<Integer> testDidLocation = ( (ReadDID) msg ).getDidLocation();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testEcuName);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testDidLocation);
+
+ // Invalid/Null Tests
+ ReadDID msg = new ReadDID();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getEcuName());
+ assertNull(Test.NULL, msg.getDidLocation());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ReadDID cmd = new ReadDID(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ReadDID.KEY_ECU_NAME), cmd.getEcuName());
+
+ List<Integer> didLocationList = JsonUtils.readIntegerListFromJsonObject(parameters, ReadDID.KEY_DID_LOCATION);
+ List<Integer> testLocationList = cmd.getDidLocation();
+ assertEquals(Test.MATCH, didLocationList.size(), testLocationList.size());
+ assertTrue(Test.TRUE, Validator.validateIntegerList(didLocationList, testLocationList));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
new file mode 100644
index 000000000..9d07afe79
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
@@ -0,0 +1,218 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeviceInfo;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.RegisterAppInterface}
+ */
+public class RegisterAppInterfaceTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ RegisterAppInterface msg = new RegisterAppInterface();
+
+ msg.setSdlMsgVersion(Test.GENERAL_SDLMSGVERSION);
+ msg.setAppName(Test.GENERAL_STRING);
+ msg.setNgnMediaScreenAppName(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);
+ msg.setTtsName(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setVrSynonyms(Test.GENERAL_STRING_LIST);
+ msg.setAppHMIType(Test.GENERAL_APPHMITYPE_LIST);
+ msg.setIsMediaApplication(Test.GENERAL_BOOLEAN);
+ msg.setDeviceInfo(Test.GENERAL_DEVICEINFO);
+ msg.setDayColorScheme(Test.GENERAL_DAYCOLORSCHEME);
+ msg.setNightColorScheme(Test.GENERAL_NIGHTCOLORSCHEME);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.REGISTER_APP_INTERFACE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ 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_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);
+ result.put(RegisterAppInterface.KEY_TTS_NAME, Test.JSON_TTSCHUNKS);
+ result.put(RegisterAppInterface.KEY_VR_SYNONYMS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ result.put(RegisterAppInterface.KEY_APP_HMI_TYPE, JsonUtils.createJsonArrayOfJsonNames(Test.GENERAL_APPHMITYPE_LIST, SDL_VERSION_UNDER_TEST));
+ result.put(RegisterAppInterface.KEY_IS_MEDIA_APPLICATION, Test.GENERAL_BOOLEAN);
+ result.put(RegisterAppInterface.KEY_DEVICE_INFO, Test.JSON_DEVICEINFO);
+ result.put(RegisterAppInterface.KEY_DAY_COLOR_SCHEME, Test.JSON_DAYCOLORSCHEME);
+ result.put(RegisterAppInterface.KEY_NIGHT_COLOR_SCHEME, Test.JSON_NIGHTCOLORSCHEME);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ SdlMsgVersion testVersion = ( (RegisterAppInterface) msg).getSdlMsgVersion();
+ 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();
+ List<TTSChunk> testTts = ( (RegisterAppInterface) msg).getTtsName();
+ List<String> testSynonyms = ( (RegisterAppInterface) msg).getVrSynonyms();
+ List<AppHMIType> testApps = ( (RegisterAppInterface) msg).getAppHMIType();
+ Boolean testMedia = ( (RegisterAppInterface) msg).getIsMediaApplication();
+ DeviceInfo testDeviceInfo = ( (RegisterAppInterface) msg).getDeviceInfo();
+ TemplateColorScheme testDayColorScheme = ( (RegisterAppInterface) msg).getDayColorScheme();
+ TemplateColorScheme testNightColorScheme = ( (RegisterAppInterface) msg).getNightColorScheme();
+
+ // Valid Tests
+ 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_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);
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTts));
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST, testSynonyms);
+ assertEquals(Test.MATCH, Test.GENERAL_APPHMITYPE_LIST, testApps);
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, testMedia);
+ assertTrue(Test.TRUE, Validator.validateDeviceInfo(Test.GENERAL_DEVICEINFO, testDeviceInfo));
+ assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_DAYCOLORSCHEME, testDayColorScheme));
+ assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme));
+
+ // Invalid/Null Tests
+ RegisterAppInterface msg = new RegisterAppInterface();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSdlMsgVersion());
+ 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());
+ assertNull(Test.NULL, msg.getTtsName());
+ assertNull(Test.NULL, msg.getVrSynonyms());
+ assertNull(Test.NULL, msg.getAppHMIType());
+ assertNull(Test.NULL, msg.getIsMediaApplication());
+ assertNull(Test.NULL, msg.getDeviceInfo());
+ assertNull(Test.NULL, msg.getDayColorScheme());
+ assertNull(Test.NULL, msg.getNightColorScheme());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ RegisterAppInterface cmd = new RegisterAppInterface(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ JSONArray ttsNameArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterface.KEY_TTS_NAME);
+ List<TTSChunk> ttsNameList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < ttsNameArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsNameArray.get(index)) );
+ ttsNameList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsNameList, cmd.getTtsName()));
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HMI_DISPLAY_LANGUAGE_DESIRED), cmd.getHmiDisplayLanguageDesired().toString());
+
+ JSONArray appHmiTypeArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterface.KEY_APP_HMI_TYPE);
+ for (int index = 0; index < appHmiTypeArray.length(); index++) {
+ AppHMIType appHmiTypeItem = AppHMIType.valueForString( appHmiTypeArray.get(index).toString() );
+ 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);
+ DeviceInfo deviceInfo = new DeviceInfo(JsonRPCMarshaller.deserializeJSONObject(deviceInfoObj));
+ assertTrue(Test.TRUE, Validator.validateDeviceInfo(deviceInfo, cmd.getDeviceInfo()) );
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_NAME), cmd.getAppName());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_NGN_MEDIA_SCREEN_APP_NAME), cmd.getNgnMediaScreenAppName());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, RegisterAppInterface.KEY_IS_MEDIA_APPLICATION), cmd.getIsMediaApplication());
+
+ List<String> vrSynonymsList = JsonUtils.readStringListFromJsonObject(parameters, RegisterAppInterface.KEY_VR_SYNONYMS);
+ List<String> testSynonymsList = cmd.getVrSynonyms();
+ assertEquals(Test.MATCH, vrSynonymsList.size(), testSynonymsList.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(vrSynonymsList, testSynonymsList));
+
+ JSONObject sdlMsgVersionObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_SDL_MSG_VERSION);
+ SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(JsonRPCMarshaller.deserializeJSONObject(sdlMsgVersionObj));
+ assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) );
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HASH_ID), cmd.getHashID());
+
+ JSONObject dayColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DAY_COLOR_SCHEME);
+ TemplateColorScheme dayColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(dayColorSchemeObj));
+ assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(dayColorScheme, cmd.getDayColorScheme()) );
+
+ JSONObject nightColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DAY_COLOR_SCHEME);
+ TemplateColorScheme nightColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(nightColorSchemeObj));
+ assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(nightColorScheme, cmd.getDayColorScheme()) );
+
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java
new file mode 100644
index 000000000..408c809be
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java
@@ -0,0 +1,108 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ResetGlobalProperties;
+import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ResetGlobalProperties}
+ */
+public class ResetGlobalPropertiesTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ ResetGlobalProperties msg = new ResetGlobalProperties();
+
+ msg.setProperties(Test.GENERAL_GLOBALPROPERTY_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.RESET_GLOBAL_PROPERTIES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(ResetGlobalProperties.KEY_PROPERTIES, JsonUtils.createJsonArray(Test.GENERAL_GLOBALPROPERTY_LIST));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<GlobalProperty> copy = ( (ResetGlobalProperties) msg ).getProperties();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_GLOBALPROPERTY_LIST.size(), copy.size());
+ for(int i = 0; i < Test.GENERAL_GLOBALPROPERTY_LIST.size(); i++){
+ assertEquals(Test.MATCH, Test.GENERAL_GLOBALPROPERTY_LIST.get(i), copy.get(i));
+ }
+
+ // Invalid/Null Tests
+ ResetGlobalProperties msg = new ResetGlobalProperties();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getProperties());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ResetGlobalProperties cmd = new ResetGlobalProperties(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONArray propertiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ResetGlobalProperties.KEY_PROPERTIES);
+ for (int index = 0; index < propertiesArray.length(); index++) {
+ GlobalProperty property = GlobalProperty.valueOf(propertiesArray.get(index).toString());
+ assertEquals(Test.MATCH, property, cmd.getProperties().get(index));
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java
new file mode 100644
index 000000000..2a4e14a6a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java
@@ -0,0 +1,125 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ScrollableMessage;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ScrollableMessage}
+ */
+public class ScrollableMessageTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ ScrollableMessage msg = new ScrollableMessage();
+
+ msg.setTimeout(Test.GENERAL_INT);
+ msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
+ msg.setScrollableMessageBody(Test.GENERAL_STRING);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SCROLLABLE_MESSAGE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY, Test.GENERAL_STRING);
+ result.put(ScrollableMessage.KEY_TIMEOUT, Test.GENERAL_INT);
+ result.put(ScrollableMessage.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String testBody = ( (ScrollableMessage) msg ).getScrollableMessageBody();
+ Integer testTimeout = ( (ScrollableMessage) msg ).getTimeout();
+ List<SoftButton> testSoftButtons = ( (ScrollableMessage) msg ).getSoftButtons();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testBody);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout);
+ assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTON_LIST.size(), testSoftButtons.size());
+ for (int i = 0; i < Test.GENERAL_SOFTBUTTON_LIST.size(); i++) {
+ assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTON_LIST.get(i), testSoftButtons.get(i));
+ }
+
+ // Invalid/Null Tests
+ ScrollableMessage msg = new ScrollableMessage();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getScrollableMessageBody());
+ assertNull(Test.NULL, msg.getTimeout());
+ assertNull(Test.NULL, msg.getSoftButtons());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ScrollableMessage cmd = new ScrollableMessage(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY), cmd.getScrollableMessageBody());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ScrollableMessage.KEY_TIMEOUT), cmd.getTimeout());
+
+ JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ScrollableMessage.KEY_SOFT_BUTTONS);
+ List<SoftButton> softButtonList = new ArrayList<SoftButton>();
+ for (int index = 0; index < softButtonArray.length(); index++) {
+ SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
+ softButtonList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
+ } 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/requests/SendHapticDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java
index 7c3b0ed90..7c3b0ed90 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java
new file mode 100644
index 000000000..9849caee5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java
@@ -0,0 +1,145 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.SendLocation;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SendLocation}
+ */
+public class SendLocationTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ SendLocation msg = new SendLocation();
+
+ msg.setLatitudeDegrees(Test.GENERAL_DOUBLE);
+ msg.setLongitudeDegrees(Test.GENERAL_DOUBLE);
+ msg.setLocationName(Test.GENERAL_STRING);
+ msg.setLocationDescription(Test.GENERAL_STRING);
+ msg.setPhoneNumber(Test.GENERAL_STRING);
+ msg.setAddressLines(Test.GENERAL_STRING_LIST);
+ msg.setLocationImage(Test.GENERAL_IMAGE);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SEND_LOCATION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters (int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SendLocation.KEY_LAT_DEGREES, Test.GENERAL_DOUBLE);
+ result.put(SendLocation.KEY_LON_DEGREES, Test.GENERAL_DOUBLE);
+ result.put(SendLocation.KEY_LOCATION_NAME, Test.GENERAL_STRING);
+ result.put(SendLocation.KEY_LOCATION_DESCRIPTION, Test.GENERAL_STRING);
+ result.put(SendLocation.KEY_PHONE_NUMBER, Test.GENERAL_STRING);
+ result.put(SendLocation.KEY_LOCATION_IMAGE, Test.GENERAL_IMAGE.serializeJSON());
+ result.put(SendLocation.KEY_ADDRESS_LINES, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Double latitude = ((SendLocation) msg).getLatitudeDegrees();
+ Double longitude = ((SendLocation) msg).getLongitudeDegrees();
+ String locationName = ((SendLocation) msg).getLocationName();
+ String locationDesc = ((SendLocation) msg).getLocationDescription();
+ String phoneNumber = ((SendLocation) msg).getPhoneNumber();
+ List<String> addressLines = ((SendLocation) msg).getAddressLines();
+ Image locationImage = ((SendLocation) msg).getLocationImage();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, longitude);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, latitude);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, locationDesc);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, locationName);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, phoneNumber);
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, addressLines));
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, locationImage));
+
+ // Invalid/Null Tests
+ SendLocation msg = new SendLocation();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getLatitudeDegrees());
+ assertNull(Test.NULL, msg.getLongitudeDegrees());
+ assertNull(Test.NULL, msg.getLocationName());
+ assertNull(Test.NULL, msg.getLocationDescription());
+ assertNull(Test.NULL, msg.getPhoneNumber());
+ assertNull(Test.NULL, msg.getAddressLines());
+ assertNull(Test.NULL, msg.getLocationImage());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull("Command object is null", commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SendLocation cmd = new SendLocation(hash);
+ assertNotNull(Test.NOT_NULL, cmd);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, SendLocation.KEY_LAT_DEGREES), cmd.getLatitudeDegrees());
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, SendLocation.KEY_LON_DEGREES), cmd.getLongitudeDegrees());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_LOCATION_NAME), cmd.getLocationName());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_LOCATION_DESCRIPTION), cmd.getLocationDescription());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_PHONE_NUMBER), cmd.getPhoneNumber());
+
+ List<String> addressList = JsonUtils.readStringListFromJsonObject(parameters, SendLocation.KEY_ADDRESS_LINES);
+ List<String> testList = cmd.getAddressLines();
+ assertEquals(Test.MATCH, addressList.size(), testList.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(addressList, testList));
+
+ JSONObject cmdIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, SendLocation.KEY_LOCATION_IMAGE);
+ Image reference = new Image(JsonRPCMarshaller.deserializeJSONObject(cmdIcon));
+ assertTrue(Test.TRUE, Validator.validateImage(reference, cmd.getLocationImage()));
+
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java
new file mode 100644
index 000000000..1be5366f6
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java
@@ -0,0 +1,98 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SetAppIcon;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SetAppIcon}
+ */
+public class SetAppIconTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SetAppIcon msg = new SetAppIcon();
+
+ msg.setSdlFileName(Test.GENERAL_STRING);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SET_APP_ICON.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SetAppIcon.KEY_SDL_FILE_NAME, Test.GENERAL_STRING);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String copy = ( (SetAppIcon) msg ).getSdlFileName();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, copy);
+
+ // Invalid/Null Tests
+ SetAppIcon msg = new SetAppIcon();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSdlFileName());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SetAppIcon cmd = new SetAppIcon(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetAppIcon.KEY_SDL_FILE_NAME), cmd.getSdlFileName());
+
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetCloudAppPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetCloudAppPropertiesTests.java
new file mode 100644
index 000000000..1a5751701
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetCloudAppPropertiesTests.java
@@ -0,0 +1,46 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SetCloudAppProperties;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+public class SetCloudAppPropertiesTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ SetCloudAppProperties msg = new SetCloudAppProperties();
+
+ msg.setProperties(Test.GENERAL_CLOUDAPPPROPERTIES);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SET_CLOUD_APP_PROPERTIES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(SetCloudAppProperties.KEY_PROPERTIES, Test.GENERAL_CLOUDAPPPROPERTIES.serializeJSON());
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java
new file mode 100644
index 000000000..7f08fb332
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java
@@ -0,0 +1,121 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SetDisplayLayout;
+import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SetDisplayLayout}
+ */
+public class SetDisplayLayoutTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SetDisplayLayout msg = new SetDisplayLayout();
+
+ msg.setDisplayLayout(Test.GENERAL_STRING);
+ msg.setDayColorScheme(Test.GENERAL_DAYCOLORSCHEME);
+ msg.setNightColorScheme(Test.GENERAL_NIGHTCOLORSCHEME);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SET_DISPLAY_LAYOUT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SetDisplayLayout.KEY_DISPLAY_LAYOUT, Test.GENERAL_STRING);
+ result.put(SetDisplayLayout.KEY_DAY_COLOR_SCHEME, Test.JSON_DAYCOLORSCHEME);
+ result.put(SetDisplayLayout.KEY_NIGHT_COLOR_SCHEME, Test.JSON_NIGHTCOLORSCHEME);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String testDisplayLayout = ( (SetDisplayLayout) msg ).getDisplayLayout();
+ TemplateColorScheme testDayColorScheme = ( (SetDisplayLayout) msg).getDayColorScheme();
+ TemplateColorScheme testNightColorScheme = ( (SetDisplayLayout) msg).getNightColorScheme();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testDisplayLayout);
+ assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_DAYCOLORSCHEME, testDayColorScheme));
+ assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme));
+
+ // Invalid/Null Tests
+ SetDisplayLayout msg = new SetDisplayLayout();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getDisplayLayout());
+ assertNull(Test.NULL, msg.getDayColorScheme());
+ assertNull(Test.NULL, msg.getNightColorScheme());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SetDisplayLayout cmd = new SetDisplayLayout(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.MATCH, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetDisplayLayout.KEY_DISPLAY_LAYOUT), cmd.getDisplayLayout());
+
+
+ JSONObject dayColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayout.KEY_DAY_COLOR_SCHEME);
+ TemplateColorScheme dayColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(dayColorSchemeObj));
+ assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(dayColorScheme, cmd.getDayColorScheme()) );
+
+ JSONObject nightColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayout.KEY_DAY_COLOR_SCHEME);
+ TemplateColorScheme nightColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(nightColorSchemeObj));
+ assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(nightColorScheme, cmd.getDayColorScheme()) );
+
+
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java
new file mode 100644
index 000000000..969ae9522
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java
@@ -0,0 +1,168 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.KeyboardProperties;
+import com.smartdevicelink.proxy.rpc.SetGlobalProperties;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.VrHelpItem;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SetGlobalProperties}
+ */
+public class SetGlobalPropertiesTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SetGlobalProperties msg = new SetGlobalProperties();
+
+ msg.setVrHelpTitle(Test.GENERAL_STRING);
+ msg.setMenuTitle(Test.GENERAL_STRING);
+ msg.setMenuIcon(Test.GENERAL_IMAGE);
+ msg.setVrHelp(Test.GENERAL_VRHELPITEM_LIST);
+ msg.setHelpPrompt(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setTimeoutPrompt(Test.GENERAL_TTSCHUNK_LIST);
+ msg.setKeyboardProperties(Test.GENERAL_KEYBOARDPROPERTIES);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SET_GLOBAL_PROPERTIES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SetGlobalProperties.KEY_MENU_ICON, Test.JSON_IMAGE);
+ result.put(SetGlobalProperties.KEY_VR_HELP, Test.JSON_VRHELPITEMS);
+ result.put(SetGlobalProperties.KEY_HELP_PROMPT, Test.JSON_TTSCHUNKS);
+ result.put(SetGlobalProperties.KEY_TIMEOUT_PROMPT, Test.JSON_TTSCHUNKS);
+ result.put(SetGlobalProperties.KEY_MENU_TITLE, Test.GENERAL_STRING);
+ result.put(SetGlobalProperties.KEY_VR_HELP_TITLE, Test.GENERAL_STRING);
+ result.put(SetGlobalProperties.KEY_KEYBOARD_PROPERTIES, Test.JSON_KEYBOARDPROPERTIES);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Image testImage = ( (SetGlobalProperties) msg ).getMenuIcon();
+ String testVrHelpTitle = ( (SetGlobalProperties) msg ).getVrHelpTitle();
+ String testMenuTitle = ( (SetGlobalProperties) msg ).getMenuTitle();
+ List<TTSChunk> testHelpPrompt = ( (SetGlobalProperties) msg ).getHelpPrompt();
+ List<TTSChunk> testTimeout = ( (SetGlobalProperties) msg ).getTimeoutPrompt();
+ List<VrHelpItem> testVrHelpItems = ( (SetGlobalProperties) msg ).getVrHelp();
+ KeyboardProperties testKeyboardProperties = ( (SetGlobalProperties) msg ).getKeyboardProperties();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testMenuTitle);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testVrHelpTitle);
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testImage));
+ assertTrue(Test.TRUE, Validator.validateVrHelpItems(Test.GENERAL_VRHELPITEM_LIST, testVrHelpItems));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testHelpPrompt));
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTimeout));
+ assertTrue(Test.TRUE, Validator.validateKeyboardProperties(Test.GENERAL_KEYBOARDPROPERTIES, testKeyboardProperties));
+
+ // Invalid/Null Tests
+ SetGlobalProperties msg = new SetGlobalProperties();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getMenuIcon());
+ assertNull(Test.NULL, msg.getMenuTitle());
+ assertNull(Test.NULL, msg.getVrHelp());
+ assertNull(Test.NULL, msg.getHelpPrompt());
+ assertNull(Test.NULL, msg.getTimeoutPrompt());
+ assertNull(Test.NULL, msg.getKeyboardProperties());
+ assertNull(Test.NULL, msg.getVrHelpTitle());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SetGlobalProperties cmd = new SetGlobalProperties(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetGlobalProperties.KEY_VR_HELP_TITLE), cmd.getVrHelpTitle());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_TITLE), cmd.getMenuTitle());
+
+ JSONObject menuIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_ICON);
+ Image referenceMenuIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(menuIcon));
+ assertTrue(Test.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon()));
+
+ JSONObject keyboardProperties = JsonUtils.readJsonObjectFromJsonObject(parameters, SetGlobalProperties.KEY_KEYBOARD_PROPERTIES);
+ KeyboardProperties referenceKeyboardProperties = new KeyboardProperties(JsonRPCMarshaller.deserializeJSONObject(keyboardProperties));
+ assertTrue(Test.TRUE, Validator.validateKeyboardProperties(referenceKeyboardProperties, cmd.getKeyboardProperties()));
+
+ JSONArray helpPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_HELP_PROMPT);
+ List<TTSChunk> helpPromptList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < helpPromptArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)helpPromptArray.get(index)) );
+ helpPromptList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(helpPromptList, cmd.getHelpPrompt()));
+
+ JSONArray timeoutPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_TIMEOUT_PROMPT);
+ List<TTSChunk> timeoutPromptList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < timeoutPromptArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)timeoutPromptArray.get(index)) );
+ timeoutPromptList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(timeoutPromptList, cmd.getTimeoutPrompt()));
+
+ JSONArray vrHelpArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_VR_HELP);
+ List<VrHelpItem> vrHelpList = new ArrayList<VrHelpItem>();
+ for (int index = 0; index < vrHelpArray.length(); index++) {
+ VrHelpItem chunk = new VrHelpItem(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)vrHelpArray.get(index)) );
+ vrHelpList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateVrHelpItems(vrHelpList, cmd.getVrHelp()));
+ } 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/requests/SetInteriorVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java
index f5ecb0d06..f5ecb0d06 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java
new file mode 100644
index 000000000..b422937a8
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java
@@ -0,0 +1,189 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SetMediaClockTimer;
+import com.smartdevicelink.proxy.rpc.StartTime;
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator;
+import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.SetMediaClockTimer}
+ */
+public class SetMediaClockTimerTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SetMediaClockTimer msg = new SetMediaClockTimer();
+
+ msg.setStartTime(Test.GENERAL_STARTTIME);
+ msg.setEndTime(Test.GENERAL_STARTTIME);
+ msg.setUpdateMode(Test.GENERAL_UPDATEMODE);
+ msg.setAudioStreamingIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SET_MEDIA_CLOCK_TIMER.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SetMediaClockTimer.KEY_START_TIME, Test.JSON_STARTTIME);
+ result.put(SetMediaClockTimer.KEY_END_TIME, Test.JSON_STARTTIME);
+ result.put(SetMediaClockTimer.KEY_UPDATE_MODE, Test.GENERAL_UPDATEMODE);
+ result.put(SetMediaClockTimer.KEY_AUDIO_STREAMING_INDICATOR, Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ StartTime testStartTime = ( (SetMediaClockTimer) msg ).getStartTime();
+ StartTime testEndTime = ( (SetMediaClockTimer) msg ).getEndTime();
+ UpdateMode testUpdateMode = ( (SetMediaClockTimer) msg ).getUpdateMode();
+ AudioStreamingIndicator testAudioStreamingIndicator = ( (SetMediaClockTimer) msg ).getAudioStreamingIndicator();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_UPDATEMODE, testUpdateMode);
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, testAudioStreamingIndicator);
+ assertTrue(Test.TRUE, Validator.validateStartTime(Test.GENERAL_STARTTIME, testStartTime));
+ assertTrue(Test.TRUE, Validator.validateStartTime(Test.GENERAL_STARTTIME, testEndTime));
+
+ // Invalid/Null Tests
+ SetMediaClockTimer msg = new SetMediaClockTimer();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getStartTime());
+ assertNull(Test.NULL, msg.getEndTime());
+ assertNull(Test.NULL, msg.getUpdateMode());
+ assertNull(Test.NULL, msg.getAudioStreamingIndicator());
+ }
+
+ /**
+ * Test static initializers
+ */
+ public void testInitializers(){
+ Integer timeInterval1 = 5000;
+ StartTime startTime1 = new StartTime(timeInterval1);
+ Integer timeInterval2 = 7000;
+ StartTime startTime2 = new StartTime(timeInterval2);
+ SetMediaClockTimer msg;
+
+ msg = SetMediaClockTimer.countUpFromStartTimeInterval(timeInterval1, timeInterval2, Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.COUNTUP);
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime()));
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime()));
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+
+ msg = SetMediaClockTimer.countUpFromStartTime(startTime1, startTime2, Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.COUNTUP);
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime()));
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime()));
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+
+ msg = SetMediaClockTimer.countDownFromStartTimeInterval(timeInterval1, timeInterval2, Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.COUNTDOWN);
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime()));
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime()));
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+
+ msg = SetMediaClockTimer.countDownFromStartTime(startTime1, startTime2, Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.COUNTDOWN);
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime()));
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime()));
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+
+ msg = SetMediaClockTimer.pauseWithPlayPauseIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE);
+ assertNull(Test.NULL, msg.getStartTime());
+ assertNull(Test.NULL, msg.getEndTime());
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+
+ msg = SetMediaClockTimer.updatePauseWithNewStartTimeInterval(timeInterval1, timeInterval2, Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE);
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime()));
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime()));
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+
+ msg = SetMediaClockTimer.updatePauseWithNewStartTime(startTime1, startTime2, Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE);
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime()));
+ assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime()));
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+
+ msg = SetMediaClockTimer.resumeWithPlayPauseIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.RESUME);
+ assertNull(Test.NULL, msg.getStartTime());
+ assertNull(Test.NULL, msg.getEndTime());
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+
+ msg = SetMediaClockTimer.clearWithPlayPauseIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR);
+ assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.CLEAR);
+ assertNull(Test.NULL, msg.getStartTime());
+ assertNull(Test.NULL, msg.getEndTime());
+ assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SetMediaClockTimer cmd = new SetMediaClockTimer(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ JSONObject startTime = JsonUtils.readJsonObjectFromJsonObject(parameters, SetMediaClockTimer.KEY_START_TIME);
+ StartTime referenceStartTime = new StartTime(JsonRPCMarshaller.deserializeJSONObject(startTime));
+ assertTrue(Test.TRUE, Validator.validateStartTime(referenceStartTime, cmd.getStartTime()));
+
+ JSONObject endTime = JsonUtils.readJsonObjectFromJsonObject(parameters, SetMediaClockTimer.KEY_END_TIME);
+ StartTime referenceEndTime = new StartTime(JsonRPCMarshaller.deserializeJSONObject(endTime));
+ assertTrue(Test.TRUE, Validator.validateStartTime(referenceEndTime, cmd.getEndTime()));
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetMediaClockTimer.KEY_UPDATE_MODE), cmd.getUpdateMode().toString());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetMediaClockTimer.KEY_AUDIO_STREAMING_INDICATOR), cmd.getAudioStreamingIndicator().toString());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java
new file mode 100644
index 000000000..0fd7f0d19
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java
@@ -0,0 +1,175 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.ShowConstantTbt;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ShowConstantTbt}
+ */
+public class ShowConstantTbtTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ ShowConstantTbt msg = new ShowConstantTbt();
+
+ msg.setDistanceToManeuver(Test.GENERAL_DOUBLE);
+ msg.setDistanceToManeuverScale(Test.GENERAL_DOUBLE);
+ msg.setEta(Test.GENERAL_STRING);
+ msg.setManeuverComplete(true);
+ msg.setNavigationText1(Test.GENERAL_STRING);
+ msg.setNavigationText2(Test.GENERAL_STRING);
+ msg.setNextTurnIcon(Test.GENERAL_IMAGE);
+ msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
+ msg.setTimeToDestination(Test.GENERAL_STRING);
+ msg.setTotalDistance(Test.GENERAL_STRING);
+ msg.setTurnIcon(Test.GENERAL_IMAGE);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SHOW_CONSTANT_TBT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(ShowConstantTbt.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
+ result.put(ShowConstantTbt.KEY_ETA, Test.GENERAL_STRING);
+ result.put(ShowConstantTbt.KEY_MANEUVER_COMPLETE, true);
+ result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE, Test.GENERAL_DOUBLE);
+ result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE, Test.GENERAL_DOUBLE);
+ result.put(ShowConstantTbt.KEY_TEXT1, Test.GENERAL_STRING);
+ result.put(ShowConstantTbt.KEY_TEXT2, Test.GENERAL_STRING);
+ result.put(ShowConstantTbt.KEY_TIME_TO_DESTINATION, Test.GENERAL_STRING);
+ result.put(ShowConstantTbt.KEY_TOTAL_DISTANCE, Test.GENERAL_STRING);
+ result.put(ShowConstantTbt.KEY_MANEUVER_IMAGE, Test.GENERAL_IMAGE.serializeJSON());
+ result.put(ShowConstantTbt.KEY_NEXT_MANEUVER_IMAGE, Test.GENERAL_IMAGE.serializeJSON());
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Double testScale = ((ShowConstantTbt) msg).getDistanceToManeuverScale();
+ Double testDistance = ((ShowConstantTbt) msg).getDistanceToManeuver();
+ String testEta = ((ShowConstantTbt) msg).getEta();
+ String testTimeToDestination = ((ShowConstantTbt) msg).getTimeToDestination();
+ String testTotalDistance = ((ShowConstantTbt) msg).getTotalDistance();
+ String testNavText2 = ((ShowConstantTbt) msg).getNavigationText2();
+ String testNavText1 = ((ShowConstantTbt) msg).getNavigationText1();
+ Boolean testManeuverComplete = ((ShowConstantTbt) msg).getManeuverComplete();
+ Image testTurnIcon = ((ShowConstantTbt) msg).getTurnIcon();
+ Image testNextTurnIcon = ((ShowConstantTbt) msg).getNextTurnIcon();
+ List<SoftButton> testSoftButtons = ((ShowConstantTbt) msg).getSoftButtons();
+
+ // Valid Test
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testTimeToDestination);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, testScale);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testNavText1);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testNavText2);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testEta);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testTotalDistance);
+ assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, testDistance);
+ assertTrue(Test.TRUE, testManeuverComplete);
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons));
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testTurnIcon));
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testNextTurnIcon));
+
+ // Invalid/Null Tests
+ ShowConstantTbt msg = new ShowConstantTbt();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSoftButtons());
+ assertNull(Test.NULL, msg.getNavigationText1());
+ assertNull(Test.NULL, msg.getNavigationText2());
+ assertNull(Test.NULL, msg.getDistanceToManeuver());
+ assertNull(Test.NULL, msg.getDistanceToManeuverScale());
+ assertNull(Test.NULL, msg.getEta());
+ assertNull(Test.NULL, msg.getManeuverComplete());
+ assertNull(Test.NULL, msg.getNextTurnIcon());
+ assertNull(Test.NULL, msg.getTimeToDestination());
+ assertNull(Test.NULL, msg.getTotalDistance());
+ assertNull(Test.NULL, msg.getTurnIcon());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ShowConstantTbt cmd = new ShowConstantTbt(hash);
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_ETA), cmd.getEta());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_COMPLETE), cmd.getManeuverComplete());
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE), cmd.getDistanceToManeuver());
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE), cmd.getDistanceToManeuverScale());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT1), cmd.getNavigationText1());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT2), cmd.getNavigationText2());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TIME_TO_DESTINATION), cmd.getTimeToDestination());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TOTAL_DISTANCE), cmd.getTotalDistance());
+
+ JSONObject icon1 = JsonUtils.readJsonObjectFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_IMAGE);
+ Image refIcon1 = new Image(JsonRPCMarshaller.deserializeJSONObject(icon1));
+ assertTrue(Test.TRUE, Validator.validateImage(refIcon1, cmd.getTurnIcon()));
+
+ JSONObject icon2 = JsonUtils.readJsonObjectFromJsonObject(parameters, ShowConstantTbt.KEY_NEXT_MANEUVER_IMAGE);
+ Image refIcon2 = new Image(JsonRPCMarshaller.deserializeJSONObject(icon2));
+ assertTrue(Test.TRUE, Validator.validateImage(refIcon2, cmd.getNextTurnIcon()));
+
+ JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ShowConstantTbt.KEY_SOFT_BUTTONS);
+ List<SoftButton> softButtonList = new ArrayList<SoftButton>();
+ for (int index = 0; index < softButtonArray.length(); index++) {
+ SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
+ softButtonList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java
new file mode 100644
index 000000000..91f4c52d7
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java
@@ -0,0 +1,187 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.MetadataTags;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.Show}
+ */
+public class ShowTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ Show msg = new Show();
+
+ msg.setMainField1(Test.GENERAL_STRING);
+ msg.setMainField2(Test.GENERAL_STRING);
+ msg.setMainField3(Test.GENERAL_STRING);
+ msg.setMainField4(Test.GENERAL_STRING);
+ msg.setStatusBar(Test.GENERAL_STRING);
+ msg.setMediaTrack(Test.GENERAL_STRING);
+ msg.setAlignment(Test.GENERAL_TEXTALIGNMENT);
+ msg.setGraphic(Test.GENERAL_IMAGE);
+ msg.setSecondaryGraphic(Test.GENERAL_IMAGE);
+ msg.setCustomPresets(Test.GENERAL_STRING_LIST);
+ msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
+ msg.setMetadataTags(Test.GENERAL_METADATASTRUCT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SHOW.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(Show.KEY_MAIN_FIELD_1, Test.GENERAL_STRING);
+ result.put(Show.KEY_MAIN_FIELD_2, Test.GENERAL_STRING);
+ result.put(Show.KEY_MAIN_FIELD_3, Test.GENERAL_STRING);
+ result.put(Show.KEY_MAIN_FIELD_4, Test.GENERAL_STRING);
+ result.put(Show.KEY_STATUS_BAR, Test.GENERAL_STRING);
+ result.put(Show.KEY_MEDIA_TRACK, Test.GENERAL_STRING);
+ result.put(Show.KEY_GRAPHIC, Test.JSON_IMAGE);
+ result.put(Show.KEY_SECONDARY_GRAPHIC, Test.JSON_IMAGE);
+ result.put(Show.KEY_ALIGNMENT, Test.GENERAL_TEXTALIGNMENT);
+ result.put(Show.KEY_CUSTOM_PRESETS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ result.put(Show.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
+ result.put(Show.KEY_METADATA_TAGS, Test.GENERAL_METADATASTRUCT.serializeJSON());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ public void testSoftButtons () {
+ // TestValues
+ String testTrack = ( (Show) msg ).getMediaTrack();
+ Image testGraphic2 = ( (Show) msg ).getSecondaryGraphic();
+ Image testGraphic1 = ( (Show) msg ).getGraphic();
+ String testStatusBar = ( (Show) msg ).getStatusBar();
+ String testText1 = ( (Show) msg ).getMainField1();
+ String testText2 = ( (Show) msg ).getMainField2();
+ String testText3 = ( (Show) msg ).getMainField3();
+ String testText4 = ( (Show) msg ).getMainField4();
+ TextAlignment testAlignment = ( (Show) msg ).getAlignment();
+ List<SoftButton> testSoftButtons = ( (Show) msg ).getSoftButtons();
+ List<String> testCustomPresets = ( (Show) msg ).getCustomPresets();
+ MetadataTags testMetadata = ( (Show) msg ).getMetadataTags();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testTrack);
+ assertEquals(Test.MATCH, Test.GENERAL_TEXTALIGNMENT, testAlignment);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testStatusBar);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testText1);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testText2);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testText3);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testText4);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), testCustomPresets.size());
+ assertEquals(Test.MATCH, Test.GENERAL_METADATASTRUCT, testMetadata);
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons));
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testGraphic2));
+ assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testGraphic1));
+
+ // Invalid/Null Tests
+ Show msg = new Show();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getMainField1());
+ assertNull(Test.NULL, msg.getMainField2());
+ assertNull(Test.NULL, msg.getMainField3());
+ assertNull(Test.NULL, msg.getMainField4());
+ assertNull(Test.NULL, msg.getStatusBar());
+ assertNull(Test.NULL, msg.getAlignment());
+ assertNull(Test.NULL, msg.getGraphic());
+ assertNull(Test.NULL, msg.getSecondaryGraphic());
+ assertNull(Test.NULL, msg.getCustomPresets());
+ assertNull(Test.NULL, msg.getMediaTrack());
+ assertNull(Test.NULL, msg.getSoftButtons());
+ assertNull(Test.NULL, msg.getMetadataTags());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext,getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ Show cmd = new Show(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONObject graphic = JsonUtils.readJsonObjectFromJsonObject(parameters, Show.KEY_GRAPHIC);
+ Image referenceGraphic = new Image(JsonRPCMarshaller.deserializeJSONObject(graphic));
+ assertTrue(Test.TRUE, Validator.validateImage(referenceGraphic, cmd.getGraphic()));
+
+ List<String> customPresetsList = JsonUtils.readStringListFromJsonObject(parameters, Show.KEY_CUSTOM_PRESETS);
+ List<String> testPresetsList = cmd.getCustomPresets();
+ assertEquals(Test.MATCH, customPresetsList.size(), testPresetsList.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(customPresetsList, testPresetsList));
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_1), cmd.getMainField1());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_2), cmd.getMainField2());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_3), cmd.getMainField3());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_4), cmd.getMainField4());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_STATUS_BAR), cmd.getStatusBar());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_ALIGNMENT), cmd.getAlignment().toString());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MEDIA_TRACK), cmd.getMediaTrack());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_METADATA_TAGS), cmd.getMetadataTags());
+
+ JSONObject secondaryGraphic = JsonUtils.readJsonObjectFromJsonObject(parameters, Show.KEY_SECONDARY_GRAPHIC);
+ Image referenceSecondaryGraphic = new Image(JsonRPCMarshaller.deserializeJSONObject(secondaryGraphic));
+ assertTrue(Test.TRUE, Validator.validateImage(referenceSecondaryGraphic, cmd.getSecondaryGraphic()));
+
+ JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Show.KEY_SOFT_BUTTONS);
+ List<SoftButton> softButtonList = new ArrayList<SoftButton>();
+ for (int index = 0; index < softButtonArray.length(); index++) {
+ SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
+ softButtonList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
+
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java
new file mode 100644
index 000000000..12119b847
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java
@@ -0,0 +1,129 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Slider;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.Slider}
+ */
+public class SliderTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ Slider msg = new Slider();
+
+ msg.setNumTicks(Test.GENERAL_INT);
+ msg.setPosition(Test.GENERAL_INT);
+ msg.setTimeout(Test.GENERAL_INT);
+ msg.setSliderHeader(Test.GENERAL_STRING);
+ msg.setSliderFooter(Test.GENERAL_STRING_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SLIDER.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(Slider.KEY_SLIDER_HEADER, Test.GENERAL_STRING);
+ result.put(Slider.KEY_SLIDER_FOOTER, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ result.put(Slider.KEY_POSITION, Test.GENERAL_INT);
+ result.put(Slider.KEY_TIMEOUT, Test.GENERAL_INT);
+ result.put(Slider.KEY_NUM_TICKS, Test.GENERAL_INT);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer testNumTicks = ( (Slider) msg ).getNumTicks();
+ Integer testTimeout = ( (Slider) msg ).getTimeout();
+ Integer testPosition = ( (Slider) msg ).getPosition();
+ String testSlider = ( (Slider) msg ).getSliderHeader();
+ List<String> testFooter = ( (Slider) msg ).getSliderFooter();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testNumTicks);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout);
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testPosition);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testSlider);
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testFooter));
+
+ // Invalid/Null Tests
+ Slider msg = new Slider();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSliderHeader());
+ assertNull(Test.NULL, msg.getSliderFooter());
+ assertNull(Test.NULL, msg.getPosition());
+ assertNull(Test.NULL, msg.getTimeout());
+ assertNull(Test.NULL, msg.getNumTicks());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ Slider cmd = new Slider(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_NUM_TICKS), cmd.getNumTicks());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Slider.KEY_SLIDER_HEADER), cmd.getSliderHeader());
+
+ List<String> sliderFooterList = JsonUtils.readStringListFromJsonObject(parameters, Slider.KEY_SLIDER_FOOTER);
+ List<String> testFooterList = cmd.getSliderFooter();
+ assertEquals(Test.MATCH, sliderFooterList.size(), testFooterList.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(sliderFooterList, testFooterList));
+
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_POSITION), cmd.getPosition());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_TIMEOUT), cmd.getTimeout());
+ }
+ catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java
new file mode 100644
index 000000000..e926c9b78
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java
@@ -0,0 +1,105 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.Speak;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+public class SpeakTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ Speak msg = new Speak();
+
+ msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SPEAK.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(Speak.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<TTSChunk> copy = ( (Speak) msg ).getTtsChunks();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, copy));
+
+ // Invalid/Null Tests
+ Speak msg = new Speak();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.MATCH, msg.getTtsChunks());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ Speak cmd = new Speak(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Speak.KEY_TTS_CHUNKS);
+ List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>();
+ for (int index = 0; index < ttsChunkArray.length(); index++) {
+ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) );
+ ttsChunkList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks()));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java
new file mode 100644
index 000000000..6860122bb
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java
@@ -0,0 +1,98 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SubscribeButton;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SubscribeButton}
+ */
+public class SubscribeButtonTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SubscribeButton msg = new SubscribeButton();
+
+ msg.setButtonName(Test.GENERAL_BUTTONNAME);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SUBSCRIBE_BUTTON.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SubscribeButton.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ ButtonName testButtonName = ( (SubscribeButton) msg ).getButtonName();
+
+ // Valid Tests
+ assertEquals("Data didn't match input data.", Test.GENERAL_BUTTONNAME, testButtonName);
+
+ // Invalid/Null Tests
+ SubscribeButton msg = new SubscribeButton();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getButtonName());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SubscribeButton cmd = new SubscribeButton(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SubscribeButton.KEY_BUTTON_NAME), cmd.getButtonName().toString());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java
new file mode 100644
index 000000000..a629f18b8
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java
@@ -0,0 +1,230 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SubscribeVehicleData;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.SubscribeVehicleData}
+ */
+public class SubscribeVehicleDataTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SubscribeVehicleData msg = new SubscribeVehicleData();
+
+ msg.setSpeed(Test.GENERAL_BOOLEAN);
+ msg.setRpm(Test.GENERAL_BOOLEAN);
+ msg.setExternalTemperature(Test.GENERAL_BOOLEAN);
+ msg.setFuelLevel(Test.GENERAL_BOOLEAN);
+ msg.setPrndl(Test.GENERAL_BOOLEAN);
+ msg.setTirePressure(Test.GENERAL_BOOLEAN);
+ msg.setEngineTorque(Test.GENERAL_BOOLEAN);
+ msg.setEngineOilLife(Test.GENERAL_BOOLEAN);
+ msg.setOdometer(Test.GENERAL_BOOLEAN);
+ msg.setGps(Test.GENERAL_BOOLEAN);
+ msg.setFuelLevelState(Test.GENERAL_BOOLEAN);
+ msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN);
+ msg.setBeltStatus(Test.GENERAL_BOOLEAN);
+ msg.setBodyInformation(Test.GENERAL_BOOLEAN);
+ msg.setDeviceStatus(Test.GENERAL_BOOLEAN);
+ msg.setDriverBraking(Test.GENERAL_BOOLEAN);
+ msg.setWiperStatus(Test.GENERAL_BOOLEAN);
+ msg.setHeadLampStatus(Test.GENERAL_BOOLEAN);
+ msg.setAccPedalPosition(Test.GENERAL_BOOLEAN);
+ msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN);
+ msg.setECallInfo(Test.GENERAL_BOOLEAN);
+ msg.setAirbagStatus(Test.GENERAL_BOOLEAN);
+ msg.setEmergencyEvent(Test.GENERAL_BOOLEAN);
+ msg.setClusterModeStatus(Test.GENERAL_BOOLEAN);
+ msg.setMyKey(Test.GENERAL_BOOLEAN);
+ msg.setFuelRange(Test.GENERAL_BOOLEAN);
+ msg.setTurnSignal(Test.GENERAL_BOOLEAN);
+ msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SUBSCRIBE_VEHICLE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SubscribeVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+
+ // Valid Tests
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getSpeed());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getRpm());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getExternalTemperature());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelLevel());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getPrndl());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getTirePressure());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEngineTorque());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEngineOilLife());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getOdometer());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getGps());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelLevelState());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getInstantFuelConsumption());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getBeltStatus());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getBodyInformation());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getDeviceStatus());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getDriverBraking());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getWiperStatus());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getHeadLampStatus());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getAccPedalPosition());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getSteeringWheelAngle());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getECallInfo());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getAirbagStatus());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEmergencyEvent());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getClusterModeStatus());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getMyKey());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelRange());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getTurnSignal());
+ assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getElectronicParkBrakeStatus());
+
+ // Invalid/Null Tests
+ SubscribeVehicleData msg = new SubscribeVehicleData();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getAccPedalPosition());
+ assertNull(Test.NULL, msg.getAirbagStatus());
+ assertNull(Test.NULL, msg.getBeltStatus());
+ assertNull(Test.NULL, msg.getDriverBraking());
+ assertNull(Test.NULL, msg.getFuelLevel());
+ assertNull(Test.NULL, msg.getTirePressure());
+ assertNull(Test.NULL, msg.getWiperStatus());
+ assertNull(Test.NULL, msg.getGps());
+ assertNull(Test.NULL, msg.getSpeed());
+ assertNull(Test.NULL, msg.getRpm());
+ assertNull(Test.NULL, msg.getFuelLevelState());
+ assertNull(Test.NULL, msg.getInstantFuelConsumption());
+ assertNull(Test.NULL, msg.getExternalTemperature());
+ assertNull(Test.NULL, msg.getPrndl());
+ assertNull(Test.NULL, msg.getOdometer());
+ assertNull(Test.NULL, msg.getBodyInformation());
+ assertNull(Test.NULL, msg.getDeviceStatus());
+ assertNull(Test.NULL, msg.getHeadLampStatus());
+ assertNull(Test.NULL, msg.getEngineTorque());
+ assertNull(Test.NULL, msg.getEngineOilLife());
+ assertNull(Test.NULL, msg.getSteeringWheelAngle());
+ assertNull(Test.NULL, msg.getECallInfo());
+ assertNull(Test.NULL, msg.getEmergencyEvent());
+ assertNull(Test.NULL, msg.getClusterModeStatus());
+ assertNull(Test.NULL, msg.getMyKey());
+ assertNull(Test.NULL, msg.getFuelRange());
+ assertNull(Test.NULL, msg.getTurnSignal());
+ assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SubscribeVehicleData cmd = new SubscribeVehicleData(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_SPEED), cmd.getSpeed());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_RPM), cmd.getRpm());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_PRNDL), cmd.getPrndl());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ODOMETER), cmd.getOdometer());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_GPS), cmd.getGps());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_MY_KEY), cmd.getMyKey());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus());
+ } 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/requests/SubscribeWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java
index 06b6ee330..06b6ee330 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java
new file mode 100644
index 000000000..e6c7d72ee
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java
@@ -0,0 +1,123 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SystemRequest;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SystemRequest}
+ */
+public class SystemRequestTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SystemRequest msg = new SystemRequest();
+
+ msg.setLegacyData(Test.GENERAL_STRING_LIST);
+ msg.setFileName(Test.GENERAL_STRING);
+ msg.setRequestType(Test.GENERAL_REQUESTTYPE);
+ msg.setRequestSubType(Test.GENERAL_STRING);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SYSTEM_REQUEST.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SystemRequest.KEY_DATA, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ result.put(SystemRequest.KEY_FILE_NAME, Test.GENERAL_STRING);
+ result.put(SystemRequest.KEY_REQUEST_TYPE, Test.GENERAL_REQUESTTYPE);
+ result.put(SystemRequest.KEY_REQUEST_SUB_TYPE, Test.GENERAL_STRING);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ RequestType testRequestType = ( (SystemRequest) msg ).getRequestType();
+ String testRequestSubType = ( (SystemRequest) msg ).getRequestSubType();
+ String testFileName = ( (SystemRequest) msg ).getFileName();
+ List<String> testLegacyData = ( (SystemRequest) msg ).getLegacyData();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_REQUESTTYPE, testRequestType);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testRequestSubType);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testFileName);
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testLegacyData));
+
+ // Invalid/Null Tests
+ SystemRequest msg = new SystemRequest();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getLegacyData());
+ assertNull(Test.NULL, msg.getFileName());
+ assertNull(Test.NULL, msg.getRequestType());
+ assertNull(Test.NULL, msg.getRequestSubType());
+ assertNull(Test.NULL, msg.getBulkData());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SystemRequest cmd = new SystemRequest(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_FILE_NAME), cmd.getFileName());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_REQUEST_TYPE), cmd.getRequestType().toString());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_REQUEST_SUB_TYPE), cmd.getRequestSubType());
+
+ List<String> dataList = JsonUtils.readStringListFromJsonObject(parameters, SystemRequest.KEY_DATA);
+ List<String> testDataList = cmd.getLegacyData();
+ assertEquals(Test.MATCH, dataList.size(), testDataList.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(dataList, testDataList));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java
new file mode 100644
index 000000000..a49cc12fb
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.UnregisterAppInterface}
+ */
+public class UnregisterAppInterfaceTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new UnregisterAppInterface();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.UNREGISTER_APP_INTERFACE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ UnregisterAppInterface msg = new UnregisterAppInterface();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ UnregisterAppInterface cmd = new UnregisterAppInterface(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ }
+ catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java
new file mode 100644
index 000000000..c587b2358
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java
@@ -0,0 +1,100 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.UnsubscribeButton;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.UnsubscribeButton}
+ */
+public class UnsubscribeButtonTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ UnsubscribeButton msg = new UnsubscribeButton();
+
+ msg.setButtonName(Test.GENERAL_BUTTONNAME);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.UNSUBSCRIBE_BUTTON.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(UnsubscribeButton.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME);
+
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ ButtonName testButtonName = ( (UnsubscribeButton) msg ).getButtonName();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, testButtonName);
+
+ // Invalid/Null Tests
+ UnsubscribeButton msg = new UnsubscribeButton();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getButtonName());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ UnsubscribeButton cmd = new UnsubscribeButton(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, UnsubscribeButton.KEY_BUTTON_NAME), cmd.getButtonName().toString());
+ }
+ catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java
new file mode 100644
index 000000000..975a452db
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java
@@ -0,0 +1,237 @@
+package com.smartdevicelink.test.rpc.requests;
+
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData}
+ */
+public class UnsubscribeVehicleDataTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
+
+ msg.setSpeed(Test.GENERAL_BOOLEAN);
+ msg.setRpm(Test.GENERAL_BOOLEAN);
+ msg.setExternalTemperature(Test.GENERAL_BOOLEAN);
+ msg.setFuelLevel(Test.GENERAL_BOOLEAN);
+ msg.setPrndl(Test.GENERAL_BOOLEAN);
+ msg.setTirePressure(Test.GENERAL_BOOLEAN);
+ msg.setEngineTorque(Test.GENERAL_BOOLEAN);
+ msg.setEngineOilLife(Test.GENERAL_BOOLEAN);
+ msg.setOdometer(Test.GENERAL_BOOLEAN);
+ msg.setGps(Test.GENERAL_BOOLEAN);
+ msg.setFuelLevelState(Test.GENERAL_BOOLEAN);
+ msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN);
+ msg.setBeltStatus(Test.GENERAL_BOOLEAN);
+ msg.setBodyInformation(Test.GENERAL_BOOLEAN);
+ msg.setDeviceStatus(Test.GENERAL_BOOLEAN);
+ msg.setDriverBraking(Test.GENERAL_BOOLEAN);
+ msg.setWiperStatus(Test.GENERAL_BOOLEAN);
+ msg.setHeadLampStatus(Test.GENERAL_BOOLEAN);
+ msg.setAccPedalPosition(Test.GENERAL_BOOLEAN);
+ msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN);
+ msg.setECallInfo(Test.GENERAL_BOOLEAN);
+ msg.setAirbagStatus(Test.GENERAL_BOOLEAN);
+ msg.setEmergencyEvent(Test.GENERAL_BOOLEAN);
+ msg.setClusterModeStatus(Test.GENERAL_BOOLEAN);
+ msg.setMyKey(Test.GENERAL_BOOLEAN);
+ msg.setFuelRange(Test.GENERAL_BOOLEAN);
+ msg.setTurnSignal(Test.GENERAL_BOOLEAN);
+ msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN);
+ msg.setCloudAppVehicleID(Test.GENERAL_BOOLEAN);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(UnsubscribeVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID, Test.GENERAL_BOOLEAN);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues(){
+ // Valid Tests
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getSpeed());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getRpm());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getExternalTemperature());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelLevel());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getPrndl());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getTirePressure());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEngineTorque());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEngineOilLife());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getOdometer());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getGps());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelLevelState());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getInstantFuelConsumption());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getBeltStatus());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getBodyInformation());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getDeviceStatus());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getDriverBraking());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getWiperStatus());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getHeadLampStatus());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getAccPedalPosition());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getSteeringWheelAngle());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getECallInfo());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getAirbagStatus());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEmergencyEvent());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getClusterModeStatus());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getMyKey());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelRange());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getTurnSignal());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getElectronicParkBrakeStatus());
+ assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getCloudAppVehicleID());
+
+ // Invalid/Null Tests
+ UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getAccPedalPosition());
+ assertNull(Test.NULL, msg.getAirbagStatus());
+ assertNull(Test.NULL, msg.getBeltStatus());
+ assertNull(Test.NULL, msg.getDriverBraking());
+ assertNull(Test.NULL, msg.getFuelLevel());
+ assertNull(Test.NULL, msg.getTirePressure());
+ assertNull(Test.NULL, msg.getWiperStatus());
+ assertNull(Test.NULL, msg.getGps());
+ assertNull(Test.NULL, msg.getSpeed());
+ assertNull(Test.NULL, msg.getRpm());
+ assertNull(Test.NULL, msg.getFuelLevelState());
+ assertNull(Test.NULL, msg.getInstantFuelConsumption());
+ assertNull(Test.NULL, msg.getExternalTemperature());
+ assertNull(Test.NULL, msg.getPrndl());
+ assertNull(Test.NULL, msg.getOdometer());
+ assertNull(Test.NULL, msg.getBodyInformation());
+ assertNull(Test.NULL, msg.getDeviceStatus());
+ assertNull(Test.NULL, msg.getHeadLampStatus());
+ assertNull(Test.NULL, msg.getEngineTorque());
+ assertNull(Test.NULL, msg.getEngineOilLife());
+ assertNull(Test.NULL, msg.getSteeringWheelAngle());
+ assertNull(Test.NULL, msg.getECallInfo());
+ assertNull(Test.NULL, msg.getEmergencyEvent());
+ assertNull(Test.NULL, msg.getClusterModeStatus());
+ assertNull(Test.NULL, msg.getMyKey());
+ assertNull(Test.NULL, msg.getFuelRange());
+ assertNull(Test.NULL, msg.getTurnSignal());
+ assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
+ assertNull(Test.NULL, msg.getCloudAppVehicleID());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ UnsubscribeVehicleData cmd = new UnsubscribeVehicleData(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_SPEED), cmd.getSpeed());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_RPM), cmd.getRpm());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_PRNDL), cmd.getPrndl());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ODOMETER), cmd.getOdometer());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_GPS), cmd.getGps());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_MY_KEY), cmd.getMyKey());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus());
+ assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID), cmd.getCloudAppVehicleID());
+
+ }
+ 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/requests/UnsubscribeWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java
index ac4afbbea..ac4afbbea 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java
new file mode 100644
index 000000000..a8e88aee8
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java
@@ -0,0 +1,125 @@
+package com.smartdevicelink.test.rpc.requests;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.Turn;
+import com.smartdevicelink.proxy.rpc.UpdateTurnList;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.UpdateTurnList}
+ */
+public class UpdateTurnListTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ UpdateTurnList msg = new UpdateTurnList();
+
+ msg.setTurnList(Test.GENERAL_TURN_LIST);
+ msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_REQUEST;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.UPDATE_TURN_LIST.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(UpdateTurnList.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
+ result.put(UpdateTurnList.KEY_TURN_LIST, Test.JSON_TURNS);
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<SoftButton> testSoftButtonList = ( (UpdateTurnList) msg ).getSoftButtons();
+ List<Turn> testTurnList = ( (UpdateTurnList) msg ).getTurnList();
+
+ // Valid Tests
+ assertNotNull(Test.NOT_NULL, testSoftButtonList);
+ assertNotNull(Test.NOT_NULL, testTurnList);
+
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtonList));
+ assertTrue(Test.TRUE, Validator.validateTurnList(Test.GENERAL_TURN_LIST, testTurnList));
+
+ // Invalid/Null Tests
+ UpdateTurnList msg = new UpdateTurnList();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getTurnList());
+ assertNull(Test.NULL, msg.getSoftButtons());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ UpdateTurnList cmd = new UpdateTurnList(hash);
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_SOFT_BUTTONS);
+ List<SoftButton> softButtonList = new ArrayList<SoftButton>();
+ for (int index = 0; index < softButtonArray.length(); index++) {
+ SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
+ softButtonList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
+
+ JSONArray turnArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_TURN_LIST);
+ List<Turn> turnList = new ArrayList<Turn>();
+ for (int index = 0; index < turnArray.length(); index++) {
+ Turn chunk = new Turn(JsonRPCMarshaller.deserializeJSONObject((JSONObject) turnArray.get(index)));
+ if (chunk != null)
+ turnList.add(chunk);
+ }
+ assertTrue(Test.TRUE, Validator.validateTurnList(turnList, cmd.getTurnList()));
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java
new file mode 100644
index 000000000..3536809ec
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AddCommand;
+import com.smartdevicelink.proxy.rpc.AddCommandResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.AddCommandResponse}
+ */
+public class AddCommandResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new AddCommandResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ADD_COMMAND.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ AddCommandResponse msg = new AddCommandResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ AddCommand cmd = new AddCommand(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java
new file mode 100644
index 000000000..d49f91443
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.AddSubmenuResponse}
+ */
+public class AddSubmenuResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new AddSubMenuResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ADD_SUB_MENU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ AddSubMenuResponse msg = new AddSubMenuResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ AddSubMenuResponse cmd = new AddSubMenuResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java
new file mode 100644
index 000000000..b296cccf0
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.AlertManeuverResponse}
+ */
+public class AlertManeuverResponseTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ return new AlertManeuverResponse();
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.ALERT_MANEUVER.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ AlertManeuverResponse msg = new AlertManeuverResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ AlertManeuverResponse cmd = new AlertManeuverResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java
new file mode 100644
index 000000000..b46a83c62
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java
@@ -0,0 +1,97 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AlertResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.AlertResponse}
+ */
+public class AlertResponseTests extends BaseRpcTests{
+
+ private static final int TRY_AGAIN_TIME = 400;
+
+ @Override
+ protected RPCMessage createMessage(){
+ AlertResponse alert = new AlertResponse();
+ alert.setTryAgainTime(TRY_AGAIN_TIME);
+ return alert;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.ALERT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(AlertResponse.KEY_TRY_AGAIN_TIME, TRY_AGAIN_TIME);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int tryAgainTime = ( (AlertResponse) msg ).getTryAgainTime();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, TRY_AGAIN_TIME, tryAgainTime);
+
+ // Invalid/Null Tests
+ AlertResponse msg = new AlertResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getTryAgainTime());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ AlertResponse cmd = new AlertResponse(hash);
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AlertResponse.KEY_TRY_AGAIN_TIME), cmd.getTryAgainTime());
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java
index 64f5b0c75..64f5b0c75 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java
new file mode 100644
index 000000000..dc0ebd285
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ChangeRegistrationResponse}
+ */
+public class ChangeRegistrationResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new ChangeRegistrationResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.CHANGE_REGISTRATION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ ChangeRegistrationResponse msg = new ChangeRegistrationResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ChangeRegistrationResponse cmd = new ChangeRegistrationResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java
new file mode 100644
index 000000000..5acf53c08
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java
@@ -0,0 +1,47 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.CreateInteractionChoiceSetResponse}
+ */
+public class CreateInteractionChoiceSetResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new CreateInteractionChoiceSetResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.CREATE_INTERACTION_CHOICE_SET.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ CreateInteractionChoiceSetResponse msg = new CreateInteractionChoiceSetResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ testNullBase(msg);
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java
new file mode 100644
index 000000000..cde460a81
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DeleteCommandResponse}
+ */
+public class DeleteCommandResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new DeleteCommandResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DELETE_COMMAND.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ DeleteCommandResponse msg = new DeleteCommandResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DeleteCommandResponse cmd = new DeleteCommandResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java
new file mode 100644
index 000000000..7d0c293c5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java
@@ -0,0 +1,97 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.DeleteFileResponse}
+ */
+public class DeleteFileResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ DeleteFileResponse msg = new DeleteFileResponse();
+
+ msg.setSpaceAvailable(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DELETE_FILE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(DeleteFileResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ int spaceAvailable = ( (DeleteFileResponse) msg ).getSpaceAvailable();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, spaceAvailable);
+
+ // Invalid/Null Tests
+ DeleteFileResponse msg = new DeleteFileResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSpaceAvailable());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DeleteFileResponse cmd = new DeleteFileResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteFileResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java
new file mode 100644
index 000000000..f57b0277f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DeleteInteractionChoiceSetResponse}
+ */
+public class DeleteInteractionChoiceSetResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new DeleteInteractionChoiceSetResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DELETE_INTERACTION_CHOICE_SET.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ DeleteInteractionChoiceSetResponse msg = new DeleteInteractionChoiceSetResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DeleteInteractionChoiceSetResponse cmd = new DeleteInteractionChoiceSetResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java
new file mode 100644
index 000000000..5a405b78c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DeleteSubMenuResponse}
+ */
+public class DeleteSubMenuResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new DeleteSubMenuResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DELETE_SUB_MENU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ DeleteSubMenuResponse msg = new DeleteSubMenuResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DeleteSubMenuResponse cmd = new DeleteSubMenuResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java
new file mode 100644
index 000000000..c55cc5098
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java
@@ -0,0 +1,110 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.DiagnosticMessageResponse}
+ */
+public class DiagnosticMessageResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ DiagnosticMessageResponse msg = new DiagnosticMessageResponse();
+
+ msg.setMessageDataResult(Test.GENERAL_INTEGER_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.DIAGNOSTIC_MESSAGE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(DiagnosticMessageResponse.KEY_MESSAGE_DATA_RESULT,
+ JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<Integer> cmdId = ( (DiagnosticMessageResponse) msg ).getMessageDataResult();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.size(), cmdId.size());
+
+ for(int i = 0; i < Test.GENERAL_INTEGER_LIST.size(); i++){
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.get(i), cmdId.get(i));
+ }
+
+ // Invalid/Null Tests
+ DiagnosticMessageResponse msg = new DiagnosticMessageResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getMessageDataResult());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ DiagnosticMessageResponse cmd = new DiagnosticMessageResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ List<Integer> dataResultList = JsonUtils.readIntegerListFromJsonObject(parameters, DiagnosticMessageResponse.KEY_MESSAGE_DATA_RESULT);
+ List<Integer> testResultList = cmd.getMessageDataResult();
+
+ assertEquals(Test.MATCH, dataResultList.size(), testResultList.size());
+ assertTrue(Test.TRUE, Validator.validateIntegerList(dataResultList, testResultList));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java
index bf625f19a..bf625f19a 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java
new file mode 100644
index 000000000..5bf4c33da
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.EndAudioPassThruResponse}
+ */
+public class EndAudioPassThruResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new EndAudioPassThruResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.END_AUDIO_PASS_THRU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ EndAudioPassThruResponse msg = new EndAudioPassThruResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ EndAudioPassThruResponse cmd = new EndAudioPassThruResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java
new file mode 100644
index 000000000..fafb7c22a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java
@@ -0,0 +1,46 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GenericResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONObject;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.GenericResponse}
+ */
+public class GenericResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new GenericResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GENERIC_RESPONSE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ GenericResponse msg = new GenericResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java
new file mode 100644
index 000000000..ef3e53424
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AppServiceData;
+import com.smartdevicelink.proxy.rpc.GetAppServiceDataResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.GetAppServiceDataResponse}
+ */
+public class GetAppServiceDataResponseTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new GetAppServiceDataResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_APP_SERVICE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ GetAppServiceDataResponse msg = new GetAppServiceDataResponse();
+ msg.setServiceData(Test.GENERAL_APPSERVICEDATA);
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ // test getter
+ AppServiceData serviceData = msg.getServiceData();
+ assertEquals(Test.GENERAL_APPSERVICEDATA, serviceData);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetAppServiceDataResponse cmd = new GetAppServiceDataResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetCloudAppPropertiesResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetCloudAppPropertiesResponseTests.java
new file mode 100644
index 000000000..e082c82f9
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetCloudAppPropertiesResponseTests.java
@@ -0,0 +1,42 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetCloudAppPropertiesResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONObject;
+
+public class GetCloudAppPropertiesResponseTests extends BaseRpcTests {
+ @Override
+ protected RPCMessage createMessage(){
+ return new GetCloudAppPropertiesResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_CLOUD_APP_PROPERTIES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ GetCloudAppPropertiesResponse msg = new GetCloudAppPropertiesResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java
new file mode 100644
index 000000000..5df87b425
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java
@@ -0,0 +1,108 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.GetDTCsResponse}
+ */
+public class GetDTCsResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ GetDTCsResponse msg = new GetDTCsResponse();
+
+ msg.setDtc(Test.GENERAL_STRING_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_DTCS.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(GetDTCsResponse.KEY_DTC, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<String> cmdId = ( (GetDTCsResponse) msg ).getDtc();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), cmdId.size());
+
+ for(int i = 0; i < Test.GENERAL_STRING_LIST.size(); i++){
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.get(i), cmdId.get(i));
+ }
+
+ // Invalid/Null Tests
+ GetDTCsResponse msg = new GetDTCsResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getDtc());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetDTCsResponse cmd = new GetDTCsResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ List<String> dtcList = JsonUtils.readStringListFromJsonObject(parameters, GetDTCsResponse.KEY_DTC);
+ List<String> testDtcList = cmd.getDtc();
+ assertEquals(Test.MATCH, dtcList.size(), testDtcList.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(dtcList, testDtcList));
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java
new file mode 100644
index 000000000..25ba20949
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java
@@ -0,0 +1,118 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.GetFileResponse;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.GetFileResponse}
+ */
+public class GetFileResponseTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+
+ GetFileResponse msg = new GetFileResponse();
+
+ msg.setCRC(Test.GENERAL_INT);
+ msg.setFileType(Test.GENERAL_FILETYPE);
+ msg.setOffset(Test.GENERAL_INT);
+ msg.setLength(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_FILE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(GetFileResponse.KEY_CRC, Test.GENERAL_INTEGER);
+ result.put(GetFileResponse.KEY_FILE_TYPE, Test.GENERAL_FILETYPE);
+ result.put(GetFileResponse.KEY_OFFSET, Test.GENERAL_INTEGER);
+ result.put(GetFileResponse.KEY_LENGTH, Test.GENERAL_INTEGER);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer crc = ( (GetFileResponse) msg ).getCRC();
+ FileType fileType = ( (GetFileResponse) msg ).getFileType();
+ Integer offset = ( (GetFileResponse) msg ).getOffset();
+ Integer length = ( (GetFileResponse) msg ).getLength();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER, crc);
+ assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, fileType);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER, offset);
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER, length);
+
+ // Invalid/Null Tests
+ GetFileResponse msg = new GetFileResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getCRC());
+ assertNull(Test.NULL, msg.getFileType());
+ assertNull(Test.NULL, msg.getOffset());
+ assertNull(Test.NULL, msg.getLength());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetFileResponse cmd = new GetFileResponse (hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_CRC), cmd.getCRC());
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetFileResponse.KEY_FILE_TYPE).toString(), cmd.getFileType().toString());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_LENGTH), cmd.getLength());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_OFFSET), cmd.getOffset());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java
index c76388c69..c76388c69 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java
index b9fd85a8e..b9fd85a8e 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java
new file mode 100644
index 000000000..c15ba7693
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java
@@ -0,0 +1,577 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AirbagStatus;
+import com.smartdevicelink.proxy.rpc.BeltStatus;
+import com.smartdevicelink.proxy.rpc.BodyInformation;
+import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
+import com.smartdevicelink.proxy.rpc.DeviceStatus;
+import com.smartdevicelink.proxy.rpc.ECallInfo;
+import com.smartdevicelink.proxy.rpc.EmergencyEvent;
+import com.smartdevicelink.proxy.rpc.FuelRange;
+import com.smartdevicelink.proxy.rpc.GPSData;
+import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.HeadLampStatus;
+import com.smartdevicelink.proxy.rpc.MyKey;
+import com.smartdevicelink.proxy.rpc.SingleTireStatus;
+import com.smartdevicelink.proxy.rpc.TireStatus;
+import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.VehicleDataHelper;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.GetVehicleDataResponse}
+ */
+public class GetVehicleDataResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ return VehicleDataHelper.VEHICLE_DATA_RESPONSE;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.GET_VEHICLE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(GetVehicleDataResponse.KEY_SPEED, VehicleDataHelper.SPEED);
+ result.put(GetVehicleDataResponse.KEY_RPM, VehicleDataHelper.RPM);
+ result.put(GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE);
+ result.put(GetVehicleDataResponse.KEY_FUEL_LEVEL, VehicleDataHelper.FUEL_LEVEL);
+ result.put(GetVehicleDataResponse.KEY_VIN, VehicleDataHelper.VIN);
+ result.put(GetVehicleDataResponse.KEY_PRNDL, VehicleDataHelper.PRNDL_FINAL);
+ result.put(GetVehicleDataResponse.KEY_TIRE_PRESSURE, VehicleDataHelper.TIRE_PRESSURE.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_ENGINE_TORQUE, VehicleDataHelper.ENGINE_TORQUE);
+ result.put(GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE, VehicleDataHelper.ENGINE_OIL_LIFE);
+ result.put(GetVehicleDataResponse.KEY_ODOMETER, VehicleDataHelper.ODOMETER);
+ result.put(GetVehicleDataResponse.KEY_GPS, VehicleDataHelper.GPS.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_FUEL_LEVEL_STATE, VehicleDataHelper.FUEL_LEVEL_STATE);
+ result.put(GetVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION);
+ result.put(GetVehicleDataResponse.KEY_BELT_STATUS, VehicleDataHelper.BELT_STATUS.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_BODY_INFORMATION, VehicleDataHelper.BODY_INFORMATION.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_DEVICE_STATUS, VehicleDataHelper.DEVICE_STATUS.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_DRIVER_BRAKING, VehicleDataHelper.DRIVER_BRAKING);
+ result.put(GetVehicleDataResponse.KEY_WIPER_STATUS, VehicleDataHelper.WIPER_STATUS);
+ result.put(GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS, VehicleDataHelper.HEAD_LAMP_STATUS.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_ACC_PEDAL_POSITION, VehicleDataHelper.ACC_PEDAL_POSITION);
+ result.put(GetVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, VehicleDataHelper.STEERING_WHEEL_ANGLE);
+ result.put(GetVehicleDataResponse.KEY_E_CALL_INFO, VehicleDataHelper.E_CALL_INFO.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_AIRBAG_STATUS, VehicleDataHelper.AIRBAG_STATUS.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_EMERGENCY_EVENT, VehicleDataHelper.EMERGENCY_EVENT.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_MY_KEY, VehicleDataHelper.MY_KEY.serializeJSON());
+ result.put(GetVehicleDataResponse.KEY_FUEL_RANGE, VehicleDataHelper.JSON_FUEL_RANGE);
+ result.put(GetVehicleDataResponse.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL);
+ result.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
+ } catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ //objects needed on the first level
+ JSONObject tireStatusObj = new JSONObject();
+ JSONObject GPSDataObj = new JSONObject();
+ JSONObject beltStatusObj = new JSONObject();
+ JSONObject bodyInformationObj = new JSONObject();
+ JSONObject deviceStatusObj = new JSONObject();
+ JSONObject headLampStatusObj = new JSONObject();
+ JSONObject ECallInfoObj = new JSONObject();
+ JSONObject airbagStatusObj = new JSONObject();
+ JSONObject emergencyEventObj = new JSONObject();
+ JSONObject clusterModeStatusObj = new JSONObject();
+ JSONObject myKeyObj = new JSONObject();
+ JSONObject fuelRangeObj = new JSONObject();
+ JSONArray fuelRangeArrayObj = new JSONArray();
+
+ try {
+ //set up the JSONObject to represent GetVehicleDataResponse
+ //TIRE_PRESSURE
+ tireStatusObj.put(TireStatus.KEY_PRESSURE_TELL_TALE, VehicleDataHelper.TIRE_PRESSURE_TELL_TALE);
+ JSONObject tireLeftFront = new JSONObject();
+ tireLeftFront.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_LEFT_FRONT);
+ tireStatusObj.put(TireStatus.KEY_LEFT_FRONT, tireLeftFront);
+ JSONObject tireRightFront = new JSONObject();
+ tireRightFront.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_RIGHT_FRONT);
+ tireStatusObj.put(TireStatus.KEY_RIGHT_FRONT, tireRightFront);
+ JSONObject tireLeftRear = new JSONObject();
+ tireLeftRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_LEFT_REAR);
+ tireStatusObj.put(TireStatus.KEY_LEFT_REAR, tireLeftRear);
+ JSONObject tireRightRear = new JSONObject();
+ tireRightRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_RIGHT_REAR);
+ tireStatusObj.put(TireStatus.KEY_RIGHT_REAR, tireRightRear);
+ JSONObject tireInnerLeftRear = new JSONObject();
+ tireInnerLeftRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_INNER_LEFT_REAR);
+ tireStatusObj.put(TireStatus.KEY_INNER_LEFT_REAR, tireInnerLeftRear);
+ JSONObject tireInnerRightRear = new JSONObject();
+ tireInnerRightRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_INNER_RIGHT_REAR);
+ tireStatusObj.put(TireStatus.KEY_INNER_RIGHT_REAR, tireInnerRightRear);
+
+ //GPS
+ GPSDataObj.put(GPSData.KEY_LONGITUDE_DEGREES, VehicleDataHelper.GPS_LONGITUDE);
+ GPSDataObj.put(GPSData.KEY_LATITUDE_DEGREES, VehicleDataHelper.GPS_LATITUDE);
+ GPSDataObj.put(GPSData.KEY_UTC_YEAR, VehicleDataHelper.GPS_YEAR);
+ GPSDataObj.put(GPSData.KEY_UTC_MONTH, VehicleDataHelper.GPS_MONTH);
+ GPSDataObj.put(GPSData.KEY_UTC_DAY, VehicleDataHelper.GPS_DAY);
+ GPSDataObj.put(GPSData.KEY_UTC_HOURS, VehicleDataHelper.GPS_HOURS);
+ GPSDataObj.put(GPSData.KEY_UTC_MINUTES, VehicleDataHelper.GPS_MINUTES);
+ GPSDataObj.put(GPSData.KEY_UTC_SECONDS, VehicleDataHelper.GPS_SECONDS);
+ GPSDataObj.put(GPSData.KEY_COMPASS_DIRECTION, VehicleDataHelper.GPS_DIRECTION);
+ GPSDataObj.put(GPSData.KEY_PDOP, VehicleDataHelper.GPS_PDOP);
+ GPSDataObj.put(GPSData.KEY_VDOP, VehicleDataHelper.GPS_VDOP);
+ GPSDataObj.put(GPSData.KEY_HDOP, VehicleDataHelper.GPS_HDOP);
+ GPSDataObj.put(GPSData.KEY_ACTUAL, VehicleDataHelper.GPS_ACTUAL);
+ GPSDataObj.put(GPSData.KEY_SATELLITES, VehicleDataHelper.GPS_SATELLITES);
+ GPSDataObj.put(GPSData.KEY_DIMENSION, VehicleDataHelper.GPS_DIMENSION);
+ GPSDataObj.put(GPSData.KEY_ALTITUDE, VehicleDataHelper.GPS_ALTITUDE);
+ GPSDataObj.put(GPSData.KEY_HEADING, VehicleDataHelper.GPS_HEADING);
+ GPSDataObj.put(GPSData.KEY_SPEED, VehicleDataHelper.GPS_SPEED);
+
+ //BELT_STATUS
+ beltStatusObj.put(BeltStatus.KEY_DRIVER_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_DRIVER_DEPLOYED);
+ beltStatusObj.put(BeltStatus.KEY_PASSENGER_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_PASSENGER_DEPLOYED);
+ beltStatusObj.put(BeltStatus.KEY_PASSENGER_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_PASSENGER_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_DRIVER_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_DRIVER_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_LEFT_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_ROW_2_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_PASSENGER_CHILD_DETECTED, VehicleDataHelper.BELT_STATUS_PASSENGER_CHILD);
+ beltStatusObj.put(BeltStatus.KEY_RIGHT_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_ROW_2_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_2_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_3_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_LEFT_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_ROW_3_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_RIGHT_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_ROW_3_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_REAR_INFLATABLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_REAR_INFLATABLE_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_RIGHT_REAR_INFLATABLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_REAR_INFLATABLE_BELTED);
+ beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_1_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_1_DEPLOYED);
+ beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_1_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_1_BELTED);
+
+ //BODY_INFORMATION
+ bodyInformationObj.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, VehicleDataHelper.BODY_INFORMATION_PARK_BRAKE);
+ bodyInformationObj.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STATUS);
+ bodyInformationObj.put(BodyInformation.KEY_IGNITION_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STABLE_STATUS);
+ bodyInformationObj.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_DRIVER_AJAR);
+ bodyInformationObj.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_PASSENGER_AJAR);
+ bodyInformationObj.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_LEFT_AJAR);
+ bodyInformationObj.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_RIGHT_AJAR);
+
+ //DEVICE_STATUS
+ deviceStatusObj.put(DeviceStatus.KEY_VOICE_REC_ON, VehicleDataHelper.DEVICE_STATUS_VOICE_REC);
+ deviceStatusObj.put(DeviceStatus.KEY_BT_ICON_ON, VehicleDataHelper.DEVICE_STATUS_BT_ICON);
+ deviceStatusObj.put(DeviceStatus.KEY_CALL_ACTIVE, VehicleDataHelper.DEVICE_STATUS_CALL_ACTIVE);
+ deviceStatusObj.put(DeviceStatus.KEY_PHONE_ROAMING, VehicleDataHelper.DEVICE_STATUS_PHONE_ROAMING);
+ deviceStatusObj.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, VehicleDataHelper.DEVICE_STATUS_TEXT_MSG_AVAILABLE);
+ deviceStatusObj.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, VehicleDataHelper.DEVICE_STATUS_BATT_LEVEL_STATUS);
+ deviceStatusObj.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, VehicleDataHelper.DEVICE_STATUS_STEREO_MUTED);
+ deviceStatusObj.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, VehicleDataHelper.DEVICE_STATUS_MONO_MUTED);
+ deviceStatusObj.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, VehicleDataHelper.DEVICE_STATUS_SIGNAL_LEVEL_STATUS);
+ deviceStatusObj.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, VehicleDataHelper.DEVICE_STATUS_PRIMARY_AUDIO);
+ deviceStatusObj.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, VehicleDataHelper.DEVICE_STATUS_E_CALL_ACTIVE);
+
+ //HEAD_LAMP_STATUS
+ headLampStatusObj.put(HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS, VehicleDataHelper.HEAD_LAMP_STATUS_AMBIENT_STATUS);
+ headLampStatusObj.put(HeadLampStatus.KEY_HIGH_BEAMS_ON, VehicleDataHelper.HEAD_LAMP_HIGH_BEAMS);
+ headLampStatusObj.put(HeadLampStatus.KEY_LOW_BEAMS_ON, VehicleDataHelper.HEAD_LAMP_LOW_BEAMS);
+
+ //E_CALL_INFO
+ ECallInfoObj.put(ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS, VehicleDataHelper.E_CALL_INFO_E_CALL_NOTIFICATION_STATUS);
+ ECallInfoObj.put(ECallInfo.KEY_AUX_E_CALL_NOTIFICATION_STATUS, VehicleDataHelper.E_CALL_INFO_AUX_E_CALL_NOTIFICATION_STATUS);
+ ECallInfoObj.put(ECallInfo.KEY_E_CALL_CONFIRMATION_STATUS, VehicleDataHelper.E_CALL_INFO_CONFIRMATION_STATUS);
+
+ //AIRBAG_STATUS
+ airbagStatusObj.put(AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_SIDE_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_CURTAIN_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_KNEE_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_SIDE_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_CURTAIN_DEPLOYED);
+ airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_KNEE_DEPLOYED);
+
+ //EMERGENCY_EVENT
+ emergencyEventObj.put(EmergencyEvent.KEY_EMERGENCY_EVENT_TYPE, VehicleDataHelper.EMERGENCY_EVENT_TYPE);
+ emergencyEventObj.put(EmergencyEvent.KEY_FUEL_CUTOFF_STATUS, VehicleDataHelper.EMERGENCY_EVENT_FUEL_CUTOFF_STATUS);
+ emergencyEventObj.put(EmergencyEvent.KEY_ROLLOVER_EVENT, VehicleDataHelper.EMERGENCY_EVENT_ROLLOVER_EVENT);
+ emergencyEventObj.put(EmergencyEvent.KEY_MAXIMUM_CHANGE_VELOCITY, VehicleDataHelper.EMERGENCY_EVENT_MAX_CHANGE_VELOCITY);
+ emergencyEventObj.put(EmergencyEvent.KEY_MULTIPLE_EVENTS, VehicleDataHelper.EMERGENCY_EVENT_MULTIPLE_EVENTS);
+
+ //CLUSTER_MODE_STATUS
+ clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_ACTIVE, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_ACTIVE);
+ clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_QUALIFICATION_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_QUALIFICATION_STATUS);
+ clusterModeStatusObj.put(ClusterModeStatus.KEY_CAR_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_CAR_MODE_STATUS);
+ clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_STATUS);
+
+ //MY_KEY
+ myKeyObj.put(MyKey.KEY_E_911_OVERRIDE, VehicleDataHelper.MY_KEY_E_911_OVERRIDE);
+
+ // FUEL_RANGE
+ fuelRangeObj.put(FuelRange.KEY_TYPE, VehicleDataHelper.FUEL_RANGE_TYPE);
+ fuelRangeObj.put(FuelRange.KEY_RANGE, VehicleDataHelper.FUEL_RANGE_RANGE);
+ fuelRangeArrayObj.put(fuelRangeObj);
+
+ reference.put(GetVehicleDataResponse.KEY_SPEED, VehicleDataHelper.SPEED);
+ reference.put(GetVehicleDataResponse.KEY_RPM, VehicleDataHelper.RPM);
+ reference.put(GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE);
+ reference.put(GetVehicleDataResponse.KEY_FUEL_LEVEL, VehicleDataHelper.FUEL_LEVEL);
+ reference.put(GetVehicleDataResponse.KEY_VIN, VehicleDataHelper.VIN);
+ reference.put(GetVehicleDataResponse.KEY_PRNDL, VehicleDataHelper.PRNDL_FINAL);
+ reference.put(GetVehicleDataResponse.KEY_TIRE_PRESSURE, tireStatusObj);
+ reference.put(GetVehicleDataResponse.KEY_ENGINE_TORQUE, VehicleDataHelper.ENGINE_TORQUE);
+ reference.put(GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE, VehicleDataHelper.ENGINE_OIL_LIFE);
+ reference.put(GetVehicleDataResponse.KEY_ODOMETER, VehicleDataHelper.ODOMETER);
+ reference.put(GetVehicleDataResponse.KEY_GPS, GPSDataObj);
+ reference.put(GetVehicleDataResponse.KEY_FUEL_LEVEL_STATE, VehicleDataHelper.FUEL_LEVEL_STATE);
+ reference.put(GetVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION);
+ reference.put(GetVehicleDataResponse.KEY_BELT_STATUS, beltStatusObj);
+ reference.put(GetVehicleDataResponse.KEY_BODY_INFORMATION, bodyInformationObj);
+ reference.put(GetVehicleDataResponse.KEY_DEVICE_STATUS, deviceStatusObj);
+ reference.put(GetVehicleDataResponse.KEY_DRIVER_BRAKING, VehicleDataHelper.DRIVER_BRAKING);
+ reference.put(GetVehicleDataResponse.KEY_WIPER_STATUS, VehicleDataHelper.WIPER_STATUS);
+ reference.put(GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS, headLampStatusObj);
+ reference.put(GetVehicleDataResponse.KEY_ACC_PEDAL_POSITION, VehicleDataHelper.ACC_PEDAL_POSITION);
+ reference.put(GetVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, VehicleDataHelper.STEERING_WHEEL_ANGLE);
+ reference.put(GetVehicleDataResponse.KEY_E_CALL_INFO, ECallInfoObj);
+ reference.put(GetVehicleDataResponse.KEY_AIRBAG_STATUS, airbagStatusObj);
+ reference.put(GetVehicleDataResponse.KEY_EMERGENCY_EVENT, emergencyEventObj);
+ reference.put(GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, clusterModeStatusObj);
+ reference.put(GetVehicleDataResponse.KEY_MY_KEY, myKeyObj);
+ reference.put(GetVehicleDataResponse.KEY_FUEL_RANGE, fuelRangeArrayObj);
+ reference.put(GetVehicleDataResponse.KEY_TURN_SIGNAL, TurnSignal.OFF);
+ reference.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
+
+ JSONObject underTest = msg.serializeJSON();
+
+ //go inside underTest and only return the JSONObject inside the parameters key inside the response key
+ underTest = underTest.getJSONObject("response").getJSONObject("parameters");
+
+ assertEquals("JSON size didn't match expected size.", reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ if (key.equals(GetVehicleDataResponse.KEY_TIRE_PRESSURE)) {
+ JSONObject tirePressureReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject tirePressureTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateTireStatus(
+ new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureReference)),
+ new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureTest))));
+
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_GPS)) {
+ JSONObject GPSObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject GPSObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateGpsData(
+ new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjReference)),
+ new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_BELT_STATUS)) {
+ JSONObject beltObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject beltObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateBeltStatus(
+ new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjReference)),
+ new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_BODY_INFORMATION)) {
+ JSONObject bodyInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject bodyInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateBodyInformation(
+ new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjReference)),
+ new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_DEVICE_STATUS)) {
+ JSONObject deviceObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject deviceObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateDeviceStatus(
+ new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjReference)),
+ new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS)) {
+ JSONObject headLampObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject headLampObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateHeadLampStatus(
+ new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjReference)),
+ new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_E_CALL_INFO)) {
+ JSONObject callInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject callInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateECallInfo(
+ new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjReference)),
+ new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_AIRBAG_STATUS)) {
+ JSONObject airbagObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject airbagObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateAirbagStatus(
+ new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjReference)),
+ new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_EMERGENCY_EVENT)) {
+ JSONObject emergencyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject emergencyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateEmergencyEvent(
+ new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjReference)),
+ new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS)) {
+ JSONObject clusterModeObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject clusterModeObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateClusterModeStatus(
+ new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjReference)),
+ new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_MY_KEY)) {
+ JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateMyKey(
+ new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)),
+ new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest))));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE)) {
+ assertEquals("JSON value didn't match expected value for key \"" + key + "\".",
+ JsonUtils.readDoubleFromJsonObject(reference, key), JsonUtils.readDoubleFromJsonObject(underTest, key));
+ }
+ else if (key.equals(GetVehicleDataResponse.KEY_FUEL_RANGE)) {
+ JSONArray fuelRangeArrayObjReference = JsonUtils.readJsonArrayFromJsonObject(reference, key);
+ List<FuelRange> fuelRangeRefereceList = new ArrayList<FuelRange>();
+ for (int index = 0; index < fuelRangeArrayObjReference.length(); index++) {
+ FuelRange fuelRange = new FuelRange(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)fuelRangeArrayObjReference.get(index) ));
+ fuelRangeRefereceList.add(fuelRange);
+ }
+
+ JSONArray fuelRangeArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ List<FuelRange> fuelRangeUnderTestList = new ArrayList<FuelRange>();
+ for (int index = 0; index < fuelRangeArrayObjTest.length(); index++) {
+ FuelRange fuelRange = new FuelRange(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)fuelRangeArrayObjTest.get(index) ));
+ fuelRangeUnderTestList.add(fuelRange);
+ }
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateFuelRange(
+ fuelRangeRefereceList,
+ fuelRangeUnderTestList));
+ }
+ else {
+ assertEquals("JSON value didn't match expected value for key \"" + key + "\".",
+ JsonUtils.readObjectFromJsonObject(reference, key),
+ JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+
+ }
+
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues(){
+ // Valid Tests
+ assertEquals(Test.MATCH, VehicleDataHelper.SPEED, ( (GetVehicleDataResponse) msg ).getSpeed());
+ assertEquals(Test.MATCH, (Integer) VehicleDataHelper.RPM, ( (GetVehicleDataResponse) msg ).getRpm());
+ assertEquals(Test.MATCH, VehicleDataHelper.EXTERNAL_TEMPERATURE, ( (GetVehicleDataResponse) msg ).getExternalTemperature());
+ assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL, ( (GetVehicleDataResponse) msg ).getFuelLevel());
+ assertEquals(Test.MATCH, VehicleDataHelper.PRNDL_FINAL, ( (GetVehicleDataResponse) msg ).getPrndl());
+ assertEquals(Test.MATCH, VehicleDataHelper.TIRE_PRESSURE, ( (GetVehicleDataResponse) msg ).getTirePressure());
+ assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_TORQUE, ( (GetVehicleDataResponse) msg ).getEngineTorque());
+ assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_OIL_LIFE, ( (GetVehicleDataResponse) msg ).getEngineOilLife());
+ assertEquals(Test.MATCH, (Integer) VehicleDataHelper.ODOMETER, ( (GetVehicleDataResponse) msg ).getOdometer());
+ assertEquals(Test.MATCH, VehicleDataHelper.GPS, ( (GetVehicleDataResponse) msg ).getGps());
+ assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL_STATE, ( (GetVehicleDataResponse) msg ).getFuelLevelState());
+ assertEquals(Test.MATCH, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION, ( (GetVehicleDataResponse) msg ).getInstantFuelConsumption());
+ assertEquals(Test.MATCH, VehicleDataHelper.BELT_STATUS, ( (GetVehicleDataResponse) msg ).getBeltStatus());
+ assertEquals(Test.MATCH, VehicleDataHelper.BODY_INFORMATION, ( (GetVehicleDataResponse) msg ).getBodyInformation());
+ assertEquals(Test.MATCH, VehicleDataHelper.DEVICE_STATUS, ( (GetVehicleDataResponse) msg ).getDeviceStatus());
+ assertEquals(Test.MATCH, VehicleDataHelper.DRIVER_BRAKING, ( (GetVehicleDataResponse) msg ).getDriverBraking());
+ assertEquals(Test.MATCH, VehicleDataHelper.WIPER_STATUS, ( (GetVehicleDataResponse) msg ).getWiperStatus());
+ assertEquals(Test.MATCH, VehicleDataHelper.HEAD_LAMP_STATUS, ( (GetVehicleDataResponse) msg ).getHeadLampStatus());
+ assertEquals(Test.MATCH, VehicleDataHelper.ACC_PEDAL_POSITION, ( (GetVehicleDataResponse) msg ).getAccPedalPosition());
+ assertEquals(Test.MATCH, VehicleDataHelper.STEERING_WHEEL_ANGLE, ( (GetVehicleDataResponse) msg ).getSteeringWheelAngle());
+ assertEquals(Test.MATCH, VehicleDataHelper.E_CALL_INFO, ( (GetVehicleDataResponse) msg ).getECallInfo());
+ assertEquals(Test.MATCH, VehicleDataHelper.AIRBAG_STATUS, ( (GetVehicleDataResponse) msg ).getAirbagStatus());
+ assertEquals(Test.MATCH, VehicleDataHelper.EMERGENCY_EVENT, ( (GetVehicleDataResponse) msg ).getEmergencyEvent());
+ assertEquals(Test.MATCH, VehicleDataHelper.CLUSTER_MODE_STATUS, ( (GetVehicleDataResponse) msg ).getClusterModeStatus());
+ assertEquals(Test.MATCH, VehicleDataHelper.MY_KEY, ( (GetVehicleDataResponse) msg ).getMyKey());
+ assertEquals(Test.MATCH, VehicleDataHelper.TURN_SIGNAL, ( (GetVehicleDataResponse) msg ).getTurnSignal());
+ assertEquals(Test.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, ( (GetVehicleDataResponse) msg ).getElectronicParkBrakeStatus());
+
+ // Invalid/Null Tests
+ GetVehicleDataResponse msg = new GetVehicleDataResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getAccPedalPosition());
+ assertNull(Test.NULL, msg.getAirbagStatus());
+ assertNull(Test.NULL, msg.getBeltStatus());
+ assertNull(Test.NULL, msg.getDriverBraking());
+ assertNull(Test.NULL, msg.getFuelLevel());
+ assertNull(Test.NULL, msg.getTirePressure());
+ assertNull(Test.NULL, msg.getWiperStatus());
+ assertNull(Test.NULL, msg.getGps());
+ assertNull(Test.NULL, msg.getSpeed());
+ assertNull(Test.NULL, msg.getRpm());
+ assertNull(Test.NULL, msg.getFuelLevelState());
+ assertNull(Test.NULL, msg.getInstantFuelConsumption());
+ assertNull(Test.NULL, msg.getExternalTemperature());
+ assertNull(Test.NULL, msg.getPrndl());
+ assertNull(Test.NULL, msg.getOdometer());
+ assertNull(Test.NULL, msg.getBodyInformation());
+ assertNull(Test.NULL, msg.getDeviceStatus());
+ assertNull(Test.NULL, msg.getHeadLampStatus());
+ assertNull(Test.NULL, msg.getEngineTorque());
+ assertNull(Test.NULL, msg.getEngineOilLife());
+ assertNull(Test.NULL, msg.getSteeringWheelAngle());
+ assertNull(Test.NULL, msg.getECallInfo());
+ assertNull(Test.NULL, msg.getEmergencyEvent());
+ assertNull(Test.NULL, msg.getClusterModeStatus());
+ assertNull(Test.NULL, msg.getMyKey());
+ assertNull(Test.NULL, msg.getTurnSignal());
+ assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
+ }
+
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ GetVehicleDataResponse cmd = new GetVehicleDataResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_SPEED), cmd.getSpeed());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetVehicleDataResponse.KEY_RPM), cmd.getRpm());
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature());
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_FUEL_LEVEL), cmd.getFuelLevel());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_VIN), cmd.getVin());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_PRNDL), cmd.getPrndl().toString());
+
+ JSONObject tireStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_TIRE_PRESSURE);
+ TireStatus tireStatus = new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tireStatusObj));
+ assertTrue(Test.TRUE, Validator.validateTireStatus(tireStatus, cmd.getTirePressure()) );
+
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ENGINE_TORQUE), cmd.getEngineTorque());
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife(), 0.0002);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetVehicleDataResponse.KEY_ODOMETER), cmd.getOdometer());
+
+ JSONObject gpsDataObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_GPS);
+ GPSData gpsData = new GPSData(JsonRPCMarshaller.deserializeJSONObject(gpsDataObj));
+ assertTrue(Test.TRUE, Validator.validateGpsData(gpsData, cmd.getGps()) );
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState().toString());
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption());
+
+ JSONObject beltStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_BELT_STATUS);
+ BeltStatus beltStatus = new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltStatusObj));
+ assertTrue(Test.TRUE, Validator.validateBeltStatus(beltStatus, cmd.getBeltStatus()) );
+
+ JSONObject bodyInformationObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_BODY_INFORMATION);
+ BodyInformation bodyInformation = new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInformationObj));
+ assertTrue(Test.TRUE, Validator.validateBodyInformation(bodyInformation, cmd.getBodyInformation()) );
+
+ JSONObject deviceStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_DEVICE_STATUS);
+ DeviceStatus deviceStatus = new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceStatusObj));
+ assertTrue(Test.TRUE, Validator.validateDeviceStatus(deviceStatus, cmd.getDeviceStatus()) );
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_DRIVER_BRAKING), cmd.getDriverBraking().toString());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_WIPER_STATUS), cmd.getWiperStatus().toString());
+
+ JSONObject headLampStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS);
+ HeadLampStatus headLampStatus = new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampStatusObj));
+ assertTrue(Test.TRUE, Validator.validateHeadLampStatus(headLampStatus, cmd.getHeadLampStatus()) );
+
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition());
+ assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle());
+
+ JSONObject eCallInfoObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_E_CALL_INFO);
+ ECallInfo eCallInfo = new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(eCallInfoObj));
+ assertTrue(Test.TRUE, Validator.validateECallInfo(eCallInfo, cmd.getECallInfo()) );
+
+ JSONObject airbagStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_AIRBAG_STATUS);
+ AirbagStatus airbagStatus = new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagStatusObj));
+ assertTrue(Test.TRUE, Validator.validateAirbagStatus(airbagStatus, cmd.getAirbagStatus()) );
+
+ JSONObject emergencyEventObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_EMERGENCY_EVENT);
+ EmergencyEvent emergencyEvent = new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyEventObj));
+ assertTrue(Test.TRUE, Validator.validateEmergencyEvent(emergencyEvent, cmd.getEmergencyEvent()) );
+
+ JSONObject clusterModeStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS);
+ ClusterModeStatus clusterModeStatus = new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatusObj));
+ assertTrue(Test.TRUE, Validator.validateClusterModeStatus(clusterModeStatus, cmd.getClusterModeStatus()) );
+
+ JSONObject myKeyObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_MY_KEY);
+ MyKey myKey = new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObj));
+ assertTrue(Test.TRUE, Validator.validateMyKey(myKey, cmd.getMyKey()) );
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_TURN_SIGNAL), cmd.getTurnSignal().toString());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus().toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java
index 57d8499df..57d8499df 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java
new file mode 100644
index 000000000..466961bcc
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java
@@ -0,0 +1,110 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ListFilesResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.ListFilesResponse}
+ */
+public class ListFilesResponseTests extends BaseRpcTests{
+
+ @Override
+ protected RPCMessage createMessage(){
+ ListFilesResponse msg = new ListFilesResponse();
+
+ msg.setFilenames(Test.GENERAL_STRING_LIST);
+ msg.setSpaceAvailable(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.LIST_FILES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(ListFilesResponse.KEY_FILENAMES, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
+ result.put(ListFilesResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<String> filenames = ( (ListFilesResponse) msg ).getFilenames();
+ int spaceAvailable = ( (ListFilesResponse) msg ).getSpaceAvailable();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), filenames.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, filenames));
+ assertEquals(Test.MATCH, Test.GENERAL_INT, spaceAvailable);
+
+ // Invalid/Null Tests
+ ListFilesResponse msg = new ListFilesResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getFilenames());
+ assertNull(Test.NULL, msg.getSpaceAvailable());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ListFilesResponse cmd = new ListFilesResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ List<String> fileNamesList = JsonUtils.readStringListFromJsonObject(parameters, ListFilesResponse.KEY_FILENAMES);
+ List<String> testNamesList = cmd.getFilenames();
+ assertEquals(Test.MATCH, fileNamesList.size(), testNamesList.size());
+ assertTrue(Test.TRUE, Validator.validateStringList(fileNamesList, testNamesList));
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ListFilesResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java
new file mode 100644
index 000000000..a6ba3c96c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java
@@ -0,0 +1,99 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.PerformAppServiceInteractionResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.PerformAppServiceInteractionResponse}
+ */
+public class PerformAppServiceInteractionResponseTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+
+ PerformAppServiceInteractionResponse msg = new PerformAppServiceInteractionResponse();
+
+ msg.setServiceSpecificResult(Test.GENERAL_STRING);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.PERFORM_APP_SERVICES_INTERACTION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(PerformAppServiceInteractionResponse.KEY_SERVICE_SPECIFIC_RESULT, Test.GENERAL_STRING);
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ String serviceSpecificResult = ( (PerformAppServiceInteractionResponse) msg ).getServiceSpecificResult();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceSpecificResult);
+
+ // Invalid/Null Tests
+ PerformAppServiceInteractionResponse msg = new PerformAppServiceInteractionResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getServiceSpecificResult());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PerformAppServiceInteractionResponse cmd = new PerformAppServiceInteractionResponse (hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteractionResponse.KEY_SERVICE_SPECIFIC_RESULT), cmd.getServiceSpecificResult());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java
new file mode 100644
index 000000000..19e62bd28
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.PerformAudioPassThruResponse}
+ */
+public class PerformAudioPassThruResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new PerformAudioPassThruResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.PERFORM_AUDIO_PASS_THRU.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ PerformAudioPassThruResponse msg = new PerformAudioPassThruResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PerformAudioPassThruResponse cmd = new PerformAudioPassThruResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java
new file mode 100644
index 000000000..8e9145b27
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java
@@ -0,0 +1,110 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.PerformInteractionResponse}
+ */
+public class PerformInteractionResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ PerformInteractionResponse msg = new PerformInteractionResponse();
+
+ msg.setChoiceID(Test.GENERAL_INT);
+ msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE);
+ msg.setManualTextEntry(Test.GENERAL_STRING);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.PERFORM_INTERACTION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(PerformInteractionResponse.KEY_CHOICE_ID, Test.GENERAL_INT);
+ result.put(PerformInteractionResponse.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE);
+ result.put(PerformInteractionResponse.KEY_MANUAL_TEXT_ENTRY, Test.GENERAL_STRING);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer testId = ( (PerformInteractionResponse) msg).getChoiceID();
+ TriggerSource testSource = ( (PerformInteractionResponse) msg).getTriggerSource();
+ String testText = ( (PerformInteractionResponse) msg).getManualTextEntry();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testId);
+ assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, testSource);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, testText);
+
+ // Invalid/Null Tests
+ PerformInteractionResponse msg = new PerformInteractionResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getChoiceID());
+ assertNull(Test.NULL, msg.getTriggerSource());
+ assertNull(Test.NULL, msg.getManualTextEntry());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PerformInteractionResponse cmd = new PerformInteractionResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteractionResponse.KEY_MANUAL_TEXT_ENTRY), cmd.getManualTextEntry());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteractionResponse.KEY_TRIGGER_SOURCE), cmd.getTriggerSource().toString());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteractionResponse.KEY_CHOICE_ID), cmd.getChoiceID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java
new file mode 100644
index 000000000..97ded7f67
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java
@@ -0,0 +1,103 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AppServiceRecord;
+import com.smartdevicelink.proxy.rpc.PublishAppServiceResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.PublishAppServiceResponse}
+ */
+public class PublishAppServiceResponseTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+
+ PublishAppServiceResponse msg = new PublishAppServiceResponse();
+
+ msg.setServiceRecord(Test.GENERAL_APPSERVICERECORD);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.PUBLISH_APP_SERVICE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ JSONObject result = new JSONObject();
+
+ try{
+ result.put(PublishAppServiceResponse.KEY_APP_SERVICE_RECORD, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_APPSERVICERECORD.getStore()));
+ }catch(JSONException e){
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ AppServiceRecord testRecord = ( (PublishAppServiceResponse) msg ).getServiceRecord();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateAppServiceRecord(Test.GENERAL_APPSERVICERECORD, testRecord));
+
+ // Invalid/Null Tests
+ PublishAppServiceResponse msg = new PublishAppServiceResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getServiceRecord());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PublishAppServiceResponse cmd = new PublishAppServiceResponse (hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONObject appServiceRecordObject = JsonUtils.readJsonObjectFromJsonObject(parameters, PublishAppServiceResponse.KEY_APP_SERVICE_RECORD);
+ AppServiceRecord recordTest = new AppServiceRecord(JsonRPCMarshaller.deserializeJSONObject(appServiceRecordObject));
+ assertTrue(Test.TRUE, Validator.validateAppServiceRecord(recordTest, cmd.getServiceRecord()));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java
new file mode 100644
index 000000000..a3fc1a2fd
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java
@@ -0,0 +1,97 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.PutFileResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.PutFileResponse}
+ */
+public class PutFileResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ PutFileResponse msg = new PutFileResponse();
+
+ msg.setSpaceAvailable(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.PUT_FILE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(PutFileResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ Integer testSpace = ( (PutFileResponse) msg ).getSpaceAvailable();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testSpace);
+
+ // Invalid/Null Tests
+ PutFileResponse msg = new PutFileResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSpaceAvailable());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ PutFileResponse cmd = new PutFileResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PutFileResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java
new file mode 100644
index 000000000..2e383b8da
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java
@@ -0,0 +1,109 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.DIDResult;
+import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ReadDIDResponse}
+ */
+public class ReadDIDResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ ReadDIDResponse msg = new ReadDIDResponse();
+
+ msg.setDidResult(Test.GENERAL_DIDRESULT_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.READ_DID.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(ReadDIDResponse.KEY_DID_RESULT, Test.JSON_DIDRESULTS);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<DIDResult> testResults = ( (ReadDIDResponse) msg ).getDidResult();
+
+ // Valid Tests
+ assertTrue("Did results didn't match input data.", Validator.validateDIDResults(Test.GENERAL_DIDRESULT_LIST, testResults));
+
+ // Invalid/Null Tests
+ ReadDIDResponse msg = new ReadDIDResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getDidResult());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ReadDIDResponse cmd = new ReadDIDResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONArray didResultArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ReadDIDResponse.KEY_DID_RESULT);
+ List<DIDResult> didResultList = new ArrayList<DIDResult>();
+ for (int index = 0; index < didResultArray.length(); index++) {
+ DIDResult chunk = new DIDResult(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)didResultArray.get(index)) );
+ didResultList.add(chunk);
+ }
+ assertTrue(Test.MATCH, Validator.validateDIDResults(didResultList, cmd.getDidResult()));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java
new file mode 100644
index 000000000..73528e577
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java
@@ -0,0 +1,268 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
+import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.VehicleType;
+import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse}
+ */
+public class RegisterAppInterfaceResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse();
+
+ msg.setSdlMsgVersion(Test.GENERAL_SDLMSGVERSION);
+ msg.setLanguage(Test.GENERAL_LANGUAGE);
+ msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE);
+ msg.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES);
+ msg.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES);
+ msg.setVehicleType(Test.GENERAL_VEHICLETYPE);
+ msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST);
+ msg.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST);
+ msg.setAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST);
+ msg.setPcmStreamingCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES);
+ msg.setHmiZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST);
+ msg.setSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST);
+ msg.setVrCapabilities(Test.GENERAL_VRCAPABILITIES_LIST);
+ msg.setPrerecordedSpeech(Test.GENERAL_PRERECORDEDSPEECH_LIST);
+ msg.setSupportedDiagModes(Test.GENERAL_INTEGER_LIST);
+ msg.setIconResumed(Test.GENERAL_BOOLEAN);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.REGISTER_APP_INTERFACE.toString();
+ }
+
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(RegisterAppInterfaceResponse.KEY_LANGUAGE, Test.GENERAL_LANGUAGE);
+ result.put(RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE);
+ result.put(RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
+ result.put(RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION, Test.JSON_SDLMSGVERSION);
+ result.put(RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE, Test.GENERAL_VEHICLETYPE.serializeJSON());
+ result.put(RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES, Test.JSON_PRESETBANKCAPABILITIES);
+ result.put(RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES, Test.JSON_DISPLAYCAPABILITIES);
+ result.put(RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES, Test.JSON_BUTTONCAPABILITIES);
+ result.put(RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES, Test.JSON_SOFTBUTTONCAPABILITIES);
+ result.put(RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES, Test.JSON_AUDIOPASSTHRUCAPABILITIES);
+ result.put(RegisterAppInterfaceResponse.KEY_PCM_STREAM_CAPABILITIES, Test.JSON_PCMSTREAMCAPABILITIES);
+ result.put(RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_SPEECHCAPABILITIES_LIST));
+ result.put(RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_VRCAPABILITIES_LIST));
+ result.put(RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_HMIZONECAPABILITIES_LIST));
+ result.put(RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH, JsonUtils.createJsonArray(Test.GENERAL_PRERECORDEDSPEECH_LIST));
+ result.put(RegisterAppInterfaceResponse.KEY_ICON_RESUMED, Test.GENERAL_BOOLEAN);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ List<Integer> testSupportedDiagModes = ( (RegisterAppInterfaceResponse) msg ).getSupportedDiagModes();
+ List<PrerecordedSpeech> testPrerecordedSpeech = ( (RegisterAppInterfaceResponse) msg ).getPrerecordedSpeech();
+ List<VrCapabilities> testVrCapabilities = ( (RegisterAppInterfaceResponse) msg ).getVrCapabilities();
+ List<SpeechCapabilities> testSpeechCapabilities = ( (RegisterAppInterfaceResponse) msg ).getSpeechCapabilities();
+ List<HmiZoneCapabilities> testHmiZoneCapabilities = ( (RegisterAppInterfaceResponse) msg ).getHmiZoneCapabilities();
+ List<SoftButtonCapabilities> testSoftButtonCapabilities = ( (RegisterAppInterfaceResponse) msg ).getSoftButtonCapabilities();
+ List<ButtonCapabilities> testButtonCapabilities = ( (RegisterAppInterfaceResponse) msg ).getButtonCapabilities();
+ VehicleType testVehicleType = ( (RegisterAppInterfaceResponse) msg ).getVehicleType();
+ PresetBankCapabilities testPbc = ( (RegisterAppInterfaceResponse) msg ).getPresetBankCapabilities();
+ DisplayCapabilities testDc = ( (RegisterAppInterfaceResponse) msg ).getDisplayCapabilities();
+ Language testHmiLang = ( (RegisterAppInterfaceResponse) msg ).getHmiDisplayLanguage();
+ Language testLang = ( (RegisterAppInterfaceResponse) msg ).getLanguage();
+ SdlMsgVersion testMsgVersion = ( (RegisterAppInterfaceResponse) msg ).getSdlMsgVersion();
+ List<AudioPassThruCapabilities> testAptc = ( (RegisterAppInterfaceResponse) msg ).getAudioPassThruCapabilities();
+ AudioPassThruCapabilities testPcmStream = ( (RegisterAppInterfaceResponse) msg ).getPcmStreamingCapabilities();
+ Boolean testIconResumed = ( (RegisterAppInterfaceResponse) msg ).getIconResumed();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testSupportedDiagModes);
+ assertEquals(Test.MATCH, Test.GENERAL_PRERECORDEDSPEECH_LIST, testPrerecordedSpeech);
+ assertEquals(Test.MATCH, Test.GENERAL_VRCAPABILITIES_LIST, testVrCapabilities);
+ assertEquals(Test.MATCH, Test.GENERAL_SPEECHCAPABILITIES_LIST, testSpeechCapabilities);
+ assertEquals(Test.MATCH, Test.GENERAL_HMIZONECAPABILITIES_LIST, testHmiZoneCapabilities);
+ assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST, testSoftButtonCapabilities));
+ assertTrue(Test.TRUE, Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, testButtonCapabilities));
+ assertTrue(Test.TRUE, Validator.validateVehicleType(Test.GENERAL_VEHICLETYPE, testVehicleType));
+ assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, testPbc));
+ assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, testDc));
+ assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testHmiLang);
+ assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testLang);
+ assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(Test.GENERAL_SDLMSGVERSION, testMsgVersion));
+ assertTrue(Test.TRUE, Validator.validateAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, testAptc));
+ assertTrue(Test.TRUE, Validator.validatePcmStreamCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES, testPcmStream));
+ assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, testIconResumed);
+
+ // Invalid/Null Tests
+ RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSdlMsgVersion());
+ assertNull(Test.NULL, msg.getLanguage());
+ assertNull(Test.NULL, msg.getHmiDisplayLanguage());
+ assertNull(Test.NULL, msg.getDisplayCapabilities());
+ assertNull(Test.NULL, msg.getPresetBankCapabilities());
+ assertNull(Test.NULL, msg.getVehicleType());
+ assertNull(Test.NULL, msg.getButtonCapabilities());
+ assertNull(Test.NULL, msg.getSoftButtonCapabilities());
+ assertNull(Test.NULL, msg.getAudioPassThruCapabilities());
+ assertNull(Test.NULL, msg.getPcmStreamingCapabilities());
+ assertNull(Test.NULL, msg.getHmiZoneCapabilities());
+ assertNull(Test.NULL, msg.getSpeechCapabilities());
+ assertNull(Test.NULL, msg.getVrCapabilities());
+ assertNull(Test.NULL, msg.getPrerecordedSpeech());
+ assertNull(Test.NULL, msg.getSupportedDiagModes());
+ assertNull(Test.NULL, msg.getIconResumed());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ RegisterAppInterfaceResponse cmd = new RegisterAppInterfaceResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONObject vehicleTypeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE);
+ VehicleType vehicleType = new VehicleType(JsonRPCMarshaller.deserializeJSONObject(vehicleTypeObj));
+ assertTrue(Test.TRUE, Validator.validateVehicleType(vehicleType, cmd.getVehicleType()));
+
+ JSONObject pcmStreamObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PCM_STREAM_CAPABILITIES);
+ AudioPassThruCapabilities pcmStreamCap = new AudioPassThruCapabilities(JsonRPCMarshaller.deserializeJSONObject(pcmStreamObj));
+ assertTrue(Test.TRUE, Validator.validatePcmStreamCapabilities(pcmStreamCap, cmd.getPcmStreamingCapabilities()));
+
+ JSONArray speechCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES);
+ for (int index = 0; index < speechCapabilitiesArray.length(); index++) {
+ SpeechCapabilities speechCapability = SpeechCapabilities.valueForString( speechCapabilitiesArray.get(index).toString() );
+ assertEquals(Test.MATCH, speechCapability, cmd.getSpeechCapabilities().get(index));
+ }
+
+ JSONArray vrCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES);
+ for (int index = 0; index < vrCapabilitiesArray.length(); index++) {
+ VrCapabilities vrCapability = VrCapabilities.valueForString( vrCapabilitiesArray.get(index).toString() );
+ assertEquals(Test.MATCH, vrCapability, cmd.getVrCapabilities().get(index));
+ }
+
+ JSONArray audioPassThruCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES);
+ List<AudioPassThruCapabilities> audioPassThruCapabilitiesList = new ArrayList<AudioPassThruCapabilities>();
+ for (int index = 0; index < audioPassThruCapabilitiesArray.length(); index++) {
+ AudioPassThruCapabilities audioPassThruCapability =
+ new AudioPassThruCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)audioPassThruCapabilitiesArray.get(index) ));
+ audioPassThruCapabilitiesList.add(audioPassThruCapability);
+ }
+ assertTrue(Test.TRUE, Validator.validateAudioPassThruCapabilities(audioPassThruCapabilitiesList, cmd.getAudioPassThruCapabilities() ));
+
+ JSONArray hmiZoneCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES);
+ for (int index = 0; index < hmiZoneCapabilitiesArray.length(); index++) {
+ HmiZoneCapabilities hmiZoneCapability = HmiZoneCapabilities.valueForString( hmiZoneCapabilitiesArray.get(index).toString() );
+ assertEquals(Test.MATCH, hmiZoneCapability, cmd.getHmiZoneCapabilities().get(index));
+ }
+
+ JSONArray prerecordedSpeechArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH);
+ for (int index = 0; index < prerecordedSpeechArray.length(); index++) {
+ PrerecordedSpeech prerecordedSpeech = PrerecordedSpeech.valueForString( prerecordedSpeechArray.get(index).toString() );
+ assertEquals(Test.MATCH, prerecordedSpeech, cmd.getPrerecordedSpeech().get(index));
+ }
+
+ List<Integer> supportedDiagnosticModesList = JsonUtils.readIntegerListFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES);
+ List<Integer> testDiagnosticModesList = cmd.getSupportedDiagModes();
+ assertEquals(Test.MATCH, supportedDiagnosticModesList.size(), testDiagnosticModesList.size());
+ assertTrue(Test.TRUE, Validator.validateIntegerList(supportedDiagnosticModesList, testDiagnosticModesList));
+
+ JSONObject sdlMsgVersionObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION);
+ SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(JsonRPCMarshaller.deserializeJSONObject(sdlMsgVersionObj));
+ assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) );
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_LANGUAGE), cmd.getLanguage().toString());
+
+ JSONArray buttonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES);
+ List<ButtonCapabilities> buttonCapabilitiesList = new ArrayList<ButtonCapabilities>();
+ for (int index = 0; index < buttonCapabilitiesArray.length(); index++) {
+ ButtonCapabilities buttonCapability = new ButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)buttonCapabilitiesArray.get(index) ));
+ buttonCapabilitiesList.add(buttonCapability);
+ }
+ assertTrue(Test.TRUE, Validator.validateButtonCapabilities(buttonCapabilitiesList, cmd.getButtonCapabilities() ));
+
+ JSONObject displayCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES);
+ DisplayCapabilities displayCapabilities = new DisplayCapabilities(JsonRPCMarshaller.deserializeJSONObject(displayCapabilitiesObj));
+ assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(displayCapabilities, cmd.getDisplayCapabilities()) );
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE), cmd.getHmiDisplayLanguage().toString());
+
+ JSONArray softButtonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES);
+ List<SoftButtonCapabilities> softButtonCapabilitiesList = new ArrayList<SoftButtonCapabilities>();
+ for (int index = 0; index < softButtonCapabilitiesArray.length(); index++) {
+ SoftButtonCapabilities softButtonCapability =
+ new SoftButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonCapabilitiesArray.get(index) ));
+ softButtonCapabilitiesList.add(softButtonCapability);
+ }
+ assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(softButtonCapabilitiesList, cmd.getSoftButtonCapabilities() ));
+
+ JSONObject presetBankCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES);
+ PresetBankCapabilities presetBankCapabilities = new PresetBankCapabilities(JsonRPCMarshaller.deserializeJSONObject(presetBankCapabilitiesObj));
+ assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(presetBankCapabilities, cmd.getPresetBankCapabilities()) );
+
+ Boolean iconResumed = JsonUtils.readBooleanFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_ICON_RESUMED);
+ assertEquals(Test.MATCH, iconResumed, cmd.getIconResumed());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java
new file mode 100644
index 000000000..fa3c870fb
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ResetGlobalPropertiesResponse}
+ */
+public class ResetGlobalPropertiesResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new ResetGlobalPropertiesResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.RESET_GLOBAL_PROPERTIES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ ResetGlobalPropertiesResponse msg = new ResetGlobalPropertiesResponse();
+ assertNotNull(Test.NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ResetGlobalPropertiesResponse cmd = new ResetGlobalPropertiesResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java
new file mode 100644
index 000000000..2795b6621
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ScrollableMessageResponse}
+ */
+public class ScrollableMessageResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new ScrollableMessageResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SCROLLABLE_MESSAGE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ ScrollableMessageResponse msg = new ScrollableMessageResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ScrollableMessageResponse cmd = new ScrollableMessageResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java
new file mode 100644
index 000000000..43163608e
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SendLocationResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SendLocaitonResponse}
+ */
+public class SendLocationResponseTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SendLocationResponse msg = new SendLocationResponse();
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SEND_LOCATION.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ SendLocationResponse msg = new SendLocationResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SendLocationResponse cmd = new SendLocationResponse(hash);
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java
new file mode 100644
index 000000000..8efb6f006
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SetAppIconResponse}
+ */
+public class SetAppIconResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new SetAppIconResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SET_APP_ICON.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ SetAppIconResponse msg = new SetAppIconResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SetAppIconResponse cmd = new SetAppIconResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetCloudAppPropertiesResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetCloudAppPropertiesResponseTests.java
new file mode 100644
index 000000000..894c7ee78
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetCloudAppPropertiesResponseTests.java
@@ -0,0 +1,42 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SetCloudAppPropertiesResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.Test;
+
+import org.json.JSONObject;
+
+public class SetCloudAppPropertiesResponseTests extends BaseRpcTests {
+ @Override
+ protected RPCMessage createMessage(){
+ return new SetCloudAppPropertiesResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SET_CLOUD_APP_PROPERTIES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ SetCloudAppPropertiesResponse msg = new SetCloudAppPropertiesResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java
new file mode 100644
index 000000000..ec0bef668
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java
@@ -0,0 +1,150 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
+import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
+import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SetDisplayLayoutResponse}
+ */
+public class SetDisplayLayoutResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse();
+
+ msg.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES);
+ msg.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES);
+ msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST);
+ msg.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SET_DISPLAY_LAYOUT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES, Test.GENERAL_DISPLAYCAPABILITIES.serializeJSON());
+ result.put(SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES, Test.JSON_PRESETBANKCAPABILITIES);
+ result.put(SetDisplayLayoutResponse.KEY_BUTTON_CAPABILITIES, Test.JSON_BUTTONCAPABILITIES);
+ result.put(SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES, Test.JSON_SOFTBUTTONCAPABILITIES);
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ DisplayCapabilities testDisplay = ( (SetDisplayLayoutResponse) msg ).getDisplayCapabilities();
+ PresetBankCapabilities testPbc = ( (SetDisplayLayoutResponse) msg ).getPresetBankCapabilities();
+ List<ButtonCapabilities> testBc = ( (SetDisplayLayoutResponse) msg ).getButtonCapabilities();
+ List<SoftButtonCapabilities> testSbc = ( (SetDisplayLayoutResponse) msg ).getSoftButtonCapabilities();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, testDisplay));
+ assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, testPbc));
+ assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.size(), testBc.size());
+ assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(), testSbc.size());
+ for (int i = 0; i < Test.GENERAL_BUTTONCAPABILITIES_LIST.size(); i++) {
+ assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.get(i), testBc.get(i));
+ }
+ for (int i = 0; i < Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(); i++) {
+ assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.get(i), testSbc.get(i));
+ }
+
+ // Invalid/Null Tests
+ SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getDisplayCapabilities());
+ assertNull(Test.NULL, msg.getPresetBankCapabilities());
+ assertNull(Test.NULL, msg.getButtonCapabilities());
+ assertNull(Test.NULL, msg.getSoftButtonCapabilities());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SetDisplayLayoutResponse cmd = new SetDisplayLayoutResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONArray buttonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_BUTTON_CAPABILITIES);
+ List<ButtonCapabilities> buttonCapabilitiesList = new ArrayList<ButtonCapabilities>();
+ for (int index = 0; index < buttonCapabilitiesArray.length(); index++) {
+ ButtonCapabilities buttonCapability = new ButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)buttonCapabilitiesArray.get(index) ));
+ buttonCapabilitiesList.add(buttonCapability);
+ }
+ assertTrue(Test.TRUE, Validator.validateButtonCapabilities(buttonCapabilitiesList, cmd.getButtonCapabilities() ));
+
+ JSONObject displayCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES);
+ DisplayCapabilities displayCapabilities = new DisplayCapabilities(JsonRPCMarshaller.deserializeJSONObject(displayCapabilitiesObj));
+ assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(displayCapabilities, cmd.getDisplayCapabilities()) );
+
+ JSONArray softButtonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES);
+ List<SoftButtonCapabilities> softButtonCapabilitiesList = new ArrayList<SoftButtonCapabilities>();
+ for (int index = 0; index < softButtonCapabilitiesArray.length(); index++) {
+ SoftButtonCapabilities softButtonCapability =
+ new SoftButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonCapabilitiesArray.get(index) ));
+ softButtonCapabilitiesList.add(softButtonCapability);
+ }
+ assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(softButtonCapabilitiesList, cmd.getSoftButtonCapabilities() ));
+
+ JSONObject presetBankCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES);
+ PresetBankCapabilities presetBankCapabilities = new PresetBankCapabilities(JsonRPCMarshaller.deserializeJSONObject(presetBankCapabilitiesObj));
+ assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(presetBankCapabilities, cmd.getPresetBankCapabilities()) );
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java
new file mode 100644
index 000000000..249294228
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SetGlobalPropertiesResponse}
+ */
+public class SetGlobalPropertiesResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new SetGlobalPropertiesResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SET_GLOBAL_PROPERTIES.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ SetGlobalPropertiesResponse msg = new SetGlobalPropertiesResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SetGlobalPropertiesResponse cmd = new SetGlobalPropertiesResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java
index c25685157..c25685157 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java
new file mode 100644
index 000000000..9bcc7f841
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SetMediaClockTimerResponse}
+ */
+public class SetMediaClockTimerResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new SetMediaClockTimerResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SET_MEDIA_CLOCK_TIMER.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ SetMediaClockTimerResponse msg = new SetMediaClockTimerResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SetMediaClockTimerResponse cmd = new SetMediaClockTimerResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java
new file mode 100644
index 000000000..dd41d1ea2
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.ShowConstantTbtResponse}
+ */
+public class ShowConstantTbtResponseTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ ShowConstantTbtResponse msg = new ShowConstantTbtResponse();
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SHOW_CONSTANT_TBT.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ ShowConstantTbtResponse msg = new ShowConstantTbtResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ShowConstantTbtResponse cmd = new ShowConstantTbtResponse(hash);
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java
new file mode 100644
index 000000000..ba9b2dfb0
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.ShowResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.ShowResponse}
+ */
+public class ShowResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new ShowResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SHOW.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ ShowResponse msg = new ShowResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ ShowResponse cmd = new ShowResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java
new file mode 100644
index 000000000..2985b9207
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java
@@ -0,0 +1,94 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SliderResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SliderResponse}
+ */
+public class SliderResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage() {
+ SliderResponse msg = new SliderResponse();
+
+ msg.setSliderPosition(Test.GENERAL_INT);
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SLIDER.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+ result.put(SliderResponse.KEY_SLIDER_POSITION, Test.GENERAL_INT);
+
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ public void testPosition() {
+ Integer copy = ( (SliderResponse) msg ).getSliderPosition();
+ assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, copy);
+ }
+
+ public void testNull() {
+ SliderResponse msg = new SliderResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getSliderPosition());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SliderResponse cmd = new SliderResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, SliderResponse.KEY_SLIDER_POSITION), cmd.getSliderPosition());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java
new file mode 100644
index 000000000..6606b3df5
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SpeakResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SpeakResponse}
+ */
+public class SpeakResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new SpeakResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SPEAK.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ SpeakResponse msg = new SpeakResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SpeakResponse cmd = new SpeakResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java
index 47801ea90..47801ea90 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java
new file mode 100644
index 000000000..b835354e3
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SubscribeButtonResponse}
+ */
+public class SubscribeButtonResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new SubscribeButtonResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SUBSCRIBE_BUTTON.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ SubscribeButtonResponse msg = new SubscribeButtonResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SubscribeButtonResponse cmd = new SubscribeButtonResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals("Correlation ID doesn't match input ID", JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java
new file mode 100644
index 000000000..f121d783c
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java
@@ -0,0 +1,353 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.VehicleDataResult;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse}
+ */
+public class SubscribeVehicleDataResponseTest extends BaseRpcTests {
+
+ // TODO : Test different result codes.
+
+ @Override
+ protected RPCMessage createMessage() {
+ SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse();
+
+ msg.setSpeed(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()));
+ msg.setRpm(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()));
+ msg.setExternalTemperature(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()));
+ msg.setFuelLevel(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()));
+ msg.setPrndl(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()));
+ msg.setTirePressure(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()));
+ msg.setEngineTorque(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()));
+ msg.setEngineOilLife(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()));
+ msg.setOdometer(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()));
+ msg.setGps(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()));
+ msg.setFuelLevelState(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()));
+ msg.setInstantFuelConsumption(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()));
+ msg.setBeltStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()));
+ msg.setBodyInformation(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()));
+ msg.setDeviceStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()));
+ msg.setDriverBraking(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()));
+ msg.setWiperStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()));
+ msg.setHeadLampStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()));
+ msg.setAccPedalPosition(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()));
+ msg.setSteeringWheelAngle(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()));
+ msg.setECallInfo(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()));
+ msg.setAirbagStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()));
+ msg.setEmergencyEvent(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()));
+ msg.setClusterModeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()));
+ msg.setMyKey(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()));
+ msg.setFuelRange(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()));
+ msg.setTurnSignal(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()));
+ msg.setElectronicParkBrakeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()));
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.SUBSCRIBE_VEHICLE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+
+ // Note: If the key values stored in SubscribeVehicleDataResponse
+ // were to be in a list then this could be easily looped through
+ // instead of individually set.
+
+ result.put(SubscribeVehicleDataResponse.KEY_SPEED, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_RPM, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_PRNDL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ODOMETER, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_GPS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_BELT_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_BODY_INFORMATION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_DEVICE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_WIPER_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_E_CALL_INFO, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ VehicleDataResult testGps = ( (SubscribeVehicleDataResponse) msg ).getGps();
+ VehicleDataResult testOdometer = ( (SubscribeVehicleDataResponse) msg ).getOdometer();
+ VehicleDataResult testTirePressure = ( (SubscribeVehicleDataResponse) msg ).getTirePressure();
+ VehicleDataResult testBeltStatus = ( (SubscribeVehicleDataResponse) msg ).getBeltStatus();
+ VehicleDataResult testBodyInfo = ( (SubscribeVehicleDataResponse) msg ).getBodyInformation();
+ VehicleDataResult testDeviceStatus = ( (SubscribeVehicleDataResponse) msg ).getDeviceStatus();
+ VehicleDataResult testHeadLampStatus = ( (SubscribeVehicleDataResponse) msg ).getHeadLampStatus();
+ VehicleDataResult testECallInfo = ( (SubscribeVehicleDataResponse) msg ).getECallInfo();
+ VehicleDataResult testAirbagStatus = ( (SubscribeVehicleDataResponse) msg ).getAirbagStatus();
+ VehicleDataResult testEmergencyEvent = ( (SubscribeVehicleDataResponse) msg ).getEmergencyEvent();
+ VehicleDataResult testClusterMode = ( (SubscribeVehicleDataResponse) msg ).getClusterModeStatus();
+ VehicleDataResult testMyKey = ( (SubscribeVehicleDataResponse) msg ).getMyKey();
+ VehicleDataResult testSpeed = ( (SubscribeVehicleDataResponse) msg ).getSpeed();
+ VehicleDataResult testRpm = ( (SubscribeVehicleDataResponse) msg ).getRpm();
+ VehicleDataResult testFuelLevel = ( (SubscribeVehicleDataResponse) msg ).getFuelLevel();
+ VehicleDataResult testConsumption = ( (SubscribeVehicleDataResponse) msg ).getInstantFuelConsumption();
+ VehicleDataResult testExternalTemp = ( (SubscribeVehicleDataResponse) msg ).getExternalTemperature();
+ VehicleDataResult testEngineTorque = ( (SubscribeVehicleDataResponse) msg ).getEngineTorque();
+ VehicleDataResult testEngineOilLife = ( (SubscribeVehicleDataResponse) msg ).getEngineOilLife();
+ VehicleDataResult testAccPedal = ( (SubscribeVehicleDataResponse) msg ).getAccPedalPosition();
+ VehicleDataResult testSteeringWheel = ( (SubscribeVehicleDataResponse) msg ).getSteeringWheelAngle();
+ VehicleDataResult testFuelLevelState = ( (SubscribeVehicleDataResponse) msg ).getFuelLevelState();
+ VehicleDataResult testPrndl = ( (SubscribeVehicleDataResponse) msg ).getPrndl();
+ VehicleDataResult testBraking = ( (SubscribeVehicleDataResponse) msg ).getDriverBraking();
+ VehicleDataResult testWiperStatus = ( (SubscribeVehicleDataResponse) msg ).getWiperStatus();
+ VehicleDataResult testFuelRange = ( (SubscribeVehicleDataResponse) msg ).getFuelRange();
+ VehicleDataResult testTurnSignal = ( (SubscribeVehicleDataResponse) msg ).getTurnSignal();
+ VehicleDataResult testEBrakeStatus = ( (SubscribeVehicleDataResponse) msg ).getElectronicParkBrakeStatus();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, testGps.getDataType().equals(VehicleDataType.VEHICLEDATA_GPS));
+ assertTrue(Test.TRUE, testOdometer.getDataType().equals(VehicleDataType.VEHICLEDATA_ODOMETER));
+ assertTrue(Test.TRUE, testTirePressure.getDataType().equals(VehicleDataType.VEHICLEDATA_TIREPRESSURE));
+ assertTrue(Test.TRUE, testBeltStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_BELTSTATUS));
+ assertTrue(Test.TRUE, testBodyInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_BODYINFO));
+ assertTrue(Test.TRUE, testDeviceStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_DEVICESTATUS));
+ assertTrue(Test.TRUE, testHeadLampStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS));
+ assertTrue(Test.TRUE, testECallInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_ECALLINFO));
+ assertTrue(Test.TRUE, testAirbagStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS));
+ assertTrue(Test.TRUE, testEmergencyEvent.getDataType().equals(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT));
+ assertTrue(Test.TRUE, testClusterMode.getDataType().equals(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS));
+ assertTrue(Test.TRUE, testMyKey.getDataType().equals(VehicleDataType.VEHICLEDATA_MYKEY));
+ assertTrue(Test.TRUE, testSpeed.getDataType().equals(VehicleDataType.VEHICLEDATA_SPEED));
+ assertTrue(Test.TRUE, testRpm.getDataType().equals(VehicleDataType.VEHICLEDATA_RPM));
+ assertTrue(Test.TRUE, testFuelLevel.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL));
+ assertTrue(Test.TRUE, testConsumption.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION));
+ assertTrue(Test.TRUE, testExternalTemp.getDataType().equals(VehicleDataType.VEHICLEDATA_EXTERNTEMP));
+ assertTrue(Test.TRUE, testEngineTorque.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINETORQUE));
+ assertTrue(Test.TRUE, testEngineOilLife.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE));
+ assertTrue(Test.TRUE, testAccPedal.getDataType().equals(VehicleDataType.VEHICLEDATA_ACCPEDAL));
+ assertTrue(Test.TRUE, testSteeringWheel.getDataType().equals(VehicleDataType.VEHICLEDATA_STEERINGWHEEL));
+ assertTrue(Test.TRUE, testFuelLevelState.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE));
+ assertTrue(Test.TRUE, testPrndl.getDataType().equals(VehicleDataType.VEHICLEDATA_PRNDL));
+ assertTrue(Test.TRUE, testBraking.getDataType().equals(VehicleDataType.VEHICLEDATA_BRAKING));
+ assertTrue(Test.TRUE, testWiperStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WIPERSTATUS));
+ assertTrue(Test.TRUE, testFuelRange.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELRANGE));
+ assertTrue(Test.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL));
+ assertTrue(Test.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS));
+
+ // Invalid/Null Tests
+ SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse();
+ assertNotNull("Null object creation failed.", msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getAccPedalPosition());
+ assertNull(Test.NULL, msg.getAirbagStatus());
+ assertNull(Test.NULL, msg.getBeltStatus());
+ assertNull(Test.NULL, msg.getDriverBraking());
+ assertNull(Test.NULL, msg.getFuelLevel());
+ assertNull(Test.NULL, msg.getTirePressure());
+ assertNull(Test.NULL, msg.getWiperStatus());
+ assertNull(Test.NULL, msg.getGps());
+ assertNull(Test.NULL, msg.getSpeed());
+ assertNull(Test.NULL, msg.getRpm());
+ assertNull(Test.NULL, msg.getFuelLevelState());
+ assertNull(Test.NULL, msg.getInstantFuelConsumption());
+ assertNull(Test.NULL, msg.getExternalTemperature());
+ assertNull(Test.NULL, msg.getPrndl());
+ assertNull(Test.NULL, msg.getOdometer());
+ assertNull(Test.NULL, msg.getBodyInformation());
+ assertNull(Test.NULL, msg.getDeviceStatus());
+ assertNull(Test.NULL, msg.getHeadLampStatus());
+ assertNull(Test.NULL, msg.getEngineTorque());
+ assertNull(Test.NULL, msg.getEngineOilLife());
+ assertNull(Test.NULL, msg.getSteeringWheelAngle());
+ assertNull(Test.NULL, msg.getECallInfo());
+ assertNull(Test.NULL, msg.getEmergencyEvent());
+ assertNull(Test.NULL, msg.getClusterModeStatus());
+ assertNull(Test.NULL, msg.getMyKey());
+ assertNull(Test.NULL, msg.getFuelRange());
+ assertNull(Test.NULL, msg.getTurnSignal());
+ assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SubscribeVehicleDataResponse cmd = new SubscribeVehicleDataResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONObject speed = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_SPEED);
+ VehicleDataResult referenceSpeed = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(speed));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSpeed, cmd.getSpeed()));
+
+ JSONObject rpm = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_RPM);
+ VehicleDataResult referenceRpm = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(rpm));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceRpm, cmd.getRpm()));
+
+ JSONObject fuelLevel = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_LEVEL);
+ VehicleDataResult referenceFuelLevel = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevel));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevel, cmd.getFuelLevel()));
+
+ JSONObject externalTemperature = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE);
+ VehicleDataResult referenceExternalTemperature = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(externalTemperature));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceExternalTemperature, cmd.getExternalTemperature()));
+
+ JSONObject prndl = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_PRNDL);
+ VehicleDataResult referencePrndl = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(prndl));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referencePrndl, cmd.getPrndl()));
+
+ JSONObject tirePressure = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE);
+ VehicleDataResult referenceTirePressure = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(tirePressure));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTirePressure, cmd.getTirePressure()));
+
+ JSONObject engineTorque = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE);
+ VehicleDataResult referenceEngineTorque = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineTorque));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineTorque, cmd.getEngineTorque()));
+
+ JSONObject engineOilLife = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE);
+ VehicleDataResult referenceEngineOilLife = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineOilLife));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineOilLife, cmd.getEngineOilLife()));
+
+ JSONObject odometer = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ODOMETER);
+ VehicleDataResult referenceOdometer = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(odometer));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceOdometer, cmd.getOdometer()));
+
+ JSONObject gps = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_GPS);
+ VehicleDataResult referenceGps = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(gps));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceGps, cmd.getGps()));
+
+ JSONObject fuelLevelState = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE);
+ VehicleDataResult referenceFuelLevelState = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevelState));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevelState, cmd.getFuelLevelState()));
+
+ JSONObject fuelConsumption = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION);
+ VehicleDataResult referenceFuelConsumption = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelConsumption));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelConsumption, cmd.getInstantFuelConsumption()));
+
+ JSONObject beltStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_BELT_STATUS);
+ VehicleDataResult referenceBeltStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(beltStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBeltStatus, cmd.getBeltStatus()));
+
+ JSONObject bodyInformation = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_BODY_INFORMATION);
+ VehicleDataResult referenceBodyInformation = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(bodyInformation));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBodyInformation, cmd.getBodyInformation()));
+
+ JSONObject deviceStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_DEVICE_STATUS);
+ VehicleDataResult referenceDeviceStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(deviceStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDeviceStatus, cmd.getDeviceStatus()));
+
+ JSONObject driverBraking = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING);
+ VehicleDataResult referenceDriverBraking = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(driverBraking));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDriverBraking, cmd.getDriverBraking()));
+
+ JSONObject wiperStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_WIPER_STATUS);
+ VehicleDataResult referenceWiperStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(wiperStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceWiperStatus, cmd.getWiperStatus()));
+
+ JSONObject headLampStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS);
+ VehicleDataResult referenceHeadLampStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(headLampStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceHeadLampStatus, cmd.getHeadLampStatus()));
+
+ JSONObject accPedalPosition = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION);
+ VehicleDataResult referenceAccPedalPosition = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(accPedalPosition));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAccPedalPosition, cmd.getAccPedalPosition()));
+
+ JSONObject steeringWheelAngle = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE);
+ VehicleDataResult referenceSteeringWheelAngle = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(steeringWheelAngle));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSteeringWheelAngle, cmd.getSteeringWheelAngle()));
+
+ JSONObject eCallInfo = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_E_CALL_INFO);
+ VehicleDataResult referenceECallInfo = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eCallInfo));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceECallInfo, cmd.getECallInfo()));
+
+ JSONObject airbagStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS);
+ VehicleDataResult referenceAirbagStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(airbagStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAirbagStatus, cmd.getAirbagStatus()));
+
+ JSONObject emergencyEvent = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT);
+ VehicleDataResult referenceEmergencyEvent = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(emergencyEvent));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEmergencyEvent, cmd.getEmergencyEvent()));
+
+ JSONObject clusterModeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS);
+ VehicleDataResult referenceClusterModeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceClusterModeStatus, cmd.getClusterModeStatus()));
+
+ JSONObject myKey = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_MY_KEY);
+ VehicleDataResult referenceMyKey = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(myKey));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceMyKey, cmd.getMyKey()));
+
+ JSONObject fuelRange = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_RANGE);
+ VehicleDataResult referenceFuelRange = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelRange));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelRange, cmd.getFuelRange()));
+
+ JSONObject turnSignal = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_TURN_SIGNAL);
+ VehicleDataResult referenceTurnSignal = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(turnSignal));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTurnSignal, cmd.getTurnSignal()));
+
+ JSONObject electronicParkBrakeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ VehicleDataResult referenceEBrakeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(electronicParkBrakeStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEBrakeStatus, cmd.getElectronicParkBrakeStatus()));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java
index a43220dce..a43220dce 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java
new file mode 100644
index 000000000..70a4f6279
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SystemRequestResponse}
+ */
+public class SystemRequestResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new SystemRequestResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.SYSTEM_REQUEST.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ SystemRequestResponse msg = new SystemRequestResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ SystemRequestResponse cmd = new SystemRequestResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java
new file mode 100644
index 000000000..a0d33a15d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.UnregisterAppInterfaceResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.UnregisterAppInterfaceResponse}
+ */
+public class UnregisterAppInterfaceResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new UnregisterAppInterfaceResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.UNREGISTER_APP_INTERFACE.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ UnregisterAppInterfaceResponse msg = new UnregisterAppInterfaceResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ UnregisterAppInterfaceResponse cmd = new UnregisterAppInterfaceResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java
new file mode 100644
index 000000000..015b0e255
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.UnsubscribeButtonResponse}
+ */
+public class UnsubscribeButtonResponseTest extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new UnsubscribeButtonResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.UNSUBSCRIBE_BUTTON.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ UnsubscribeButtonResponse msg = new UnsubscribeButtonResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ UnsubscribeButtonResponse cmd = new UnsubscribeButtonResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java
new file mode 100644
index 000000000..2df9250eb
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java
@@ -0,0 +1,355 @@
+package com.smartdevicelink.test.rpc.responses;
+
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.VehicleDataResult;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse}
+ */
+public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests {
+
+ // TODO : Test different result codes.
+
+ @Override
+ protected RPCMessage createMessage() {
+ UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse();
+
+ msg.setSpeed(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()));
+ msg.setRpm(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()));
+ msg.setExternalTemperature(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()));
+ msg.setFuelLevel(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()));
+ msg.setPrndl(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()));
+ msg.setTirePressure(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()));
+ msg.setEngineTorque(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()));
+ msg.setEngineOilLife(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()));
+ msg.setOdometer(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()));
+ msg.setGps(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()));
+ msg.setFuelLevelState(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()));
+ msg.setInstantFuelConsumption(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()));
+ msg.setBeltStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()));
+ msg.setBodyInformation(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()));
+ msg.setDeviceStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()));
+ msg.setDriverBraking(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()));
+ msg.setWiperStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()));
+ msg.setHeadLampStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()));
+ msg.setAccPedalPosition(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()));
+ msg.setSteeringWheelAngle(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()));
+ msg.setECallInfo(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()));
+ msg.setAirbagStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()));
+ msg.setEmergencyEvent(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()));
+ msg.setClusterModeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()));
+ msg.setMyKey(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()));
+ msg.setFuelRange(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()));
+ msg.setTurnSignal(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()));
+ msg.setElectronicParkBrakeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()));
+
+ return msg;
+ }
+
+ @Override
+ protected String getMessageType() {
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType() {
+ return FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion) {
+ JSONObject result = new JSONObject();
+
+ try {
+
+ // Note: If the key values stored in SubscribeVehicleDataResponse
+ // were to be in a list then this could be easily looped through
+ // instead of individually set.
+
+ result.put(SubscribeVehicleDataResponse.KEY_SPEED, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_RPM, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_PRNDL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ODOMETER, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_GPS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_BELT_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_BODY_INFORMATION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_DEVICE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_WIPER_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_E_CALL_INFO, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON());
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+
+ return result;
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ VehicleDataResult testGps = ( (UnsubscribeVehicleDataResponse) msg ).getGps();
+ VehicleDataResult testOdometer = ( (UnsubscribeVehicleDataResponse) msg ).getOdometer();
+ VehicleDataResult testTirePressure = ( (UnsubscribeVehicleDataResponse) msg ).getTirePressure();
+ VehicleDataResult testBeltStatus = ( (UnsubscribeVehicleDataResponse) msg ).getBeltStatus();
+ VehicleDataResult testBodyInfo = ( (UnsubscribeVehicleDataResponse) msg ).getBodyInformation();
+ VehicleDataResult testDeviceStatus = ( (UnsubscribeVehicleDataResponse) msg ).getDeviceStatus();
+ VehicleDataResult testHeadLampStatus = ( (UnsubscribeVehicleDataResponse) msg ).getHeadLampStatus();
+ VehicleDataResult testECallInfo = ( (UnsubscribeVehicleDataResponse) msg ).getECallInfo();
+ VehicleDataResult testAirbagStatus = ( (UnsubscribeVehicleDataResponse) msg ).getAirbagStatus();
+ VehicleDataResult testEmergencyEvent = ( (UnsubscribeVehicleDataResponse) msg ).getEmergencyEvent();
+ VehicleDataResult testClusterMode = ( (UnsubscribeVehicleDataResponse) msg ).getClusterModeStatus();
+ VehicleDataResult testMyKey = ( (UnsubscribeVehicleDataResponse) msg ).getMyKey();
+ VehicleDataResult testSpeed = ( (UnsubscribeVehicleDataResponse) msg ).getSpeed();
+ VehicleDataResult testRpm = ( (UnsubscribeVehicleDataResponse) msg ).getRpm();
+ VehicleDataResult testFuelLevel = ( (UnsubscribeVehicleDataResponse) msg ).getFuelLevel();
+ VehicleDataResult testConsumption = ( (UnsubscribeVehicleDataResponse) msg ).getInstantFuelConsumption();
+ VehicleDataResult testExternalTemp = ( (UnsubscribeVehicleDataResponse) msg ).getExternalTemperature();
+ VehicleDataResult testEngineTorque = ( (UnsubscribeVehicleDataResponse) msg ).getEngineTorque();
+ VehicleDataResult testEngineOilLife = ( (UnsubscribeVehicleDataResponse) msg ).getEngineOilLife();
+ VehicleDataResult testAccPedal = ( (UnsubscribeVehicleDataResponse) msg ).getAccPedalPosition();
+ VehicleDataResult testSteeringWheel = ( (UnsubscribeVehicleDataResponse) msg ).getSteeringWheelAngle();
+ VehicleDataResult testFuelLevelState = ( (UnsubscribeVehicleDataResponse) msg ).getFuelLevelState();
+ VehicleDataResult testPrndl = ( (UnsubscribeVehicleDataResponse) msg ).getPrndl();
+ VehicleDataResult testBraking = ( (UnsubscribeVehicleDataResponse) msg ).getDriverBraking();
+ VehicleDataResult testWiperStatus = ( (UnsubscribeVehicleDataResponse) msg ).getWiperStatus();
+ VehicleDataResult testFuelRange = ( (UnsubscribeVehicleDataResponse) msg ).getFuelRange();
+ VehicleDataResult testTurnSignal = ( (UnsubscribeVehicleDataResponse) msg ).getTurnSignal();
+ VehicleDataResult testEBrakeStatus = ( (UnsubscribeVehicleDataResponse) msg ).getElectronicParkBrakeStatus();
+
+ // Valid Tests
+ assertTrue(Test.TRUE, testGps.getDataType().equals(VehicleDataType.VEHICLEDATA_GPS));
+ assertTrue(Test.TRUE, testOdometer.getDataType().equals(VehicleDataType.VEHICLEDATA_ODOMETER));
+ assertTrue(Test.TRUE, testTirePressure.getDataType().equals(VehicleDataType.VEHICLEDATA_TIREPRESSURE));
+ assertTrue(Test.TRUE, testBeltStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_BELTSTATUS));
+ assertTrue(Test.TRUE, testBodyInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_BODYINFO));
+ assertTrue(Test.TRUE, testDeviceStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_DEVICESTATUS));
+ assertTrue(Test.TRUE, testHeadLampStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS));
+ assertTrue(Test.TRUE, testECallInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_ECALLINFO));
+ assertTrue(Test.TRUE, testAirbagStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS));
+ assertTrue(Test.TRUE, testEmergencyEvent.getDataType().equals(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT));
+ assertTrue(Test.TRUE, testClusterMode.getDataType().equals(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS));
+ assertTrue(Test.TRUE, testMyKey.getDataType().equals(VehicleDataType.VEHICLEDATA_MYKEY));
+ assertTrue(Test.TRUE, testSpeed.getDataType().equals(VehicleDataType.VEHICLEDATA_SPEED));
+ assertTrue(Test.TRUE, testRpm.getDataType().equals(VehicleDataType.VEHICLEDATA_RPM));
+ assertTrue(Test.TRUE, testFuelLevel.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL));
+ assertTrue(Test.TRUE, testConsumption.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION));
+ assertTrue(Test.TRUE, testExternalTemp.getDataType().equals(VehicleDataType.VEHICLEDATA_EXTERNTEMP));
+ assertTrue(Test.TRUE, testEngineTorque.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINETORQUE));
+ assertTrue(Test.TRUE, testEngineOilLife.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE));
+ assertTrue(Test.TRUE, testAccPedal.getDataType().equals(VehicleDataType.VEHICLEDATA_ACCPEDAL));
+ assertTrue(Test.TRUE, testSteeringWheel.getDataType().equals(VehicleDataType.VEHICLEDATA_STEERINGWHEEL));
+ assertTrue(Test.TRUE, testFuelLevelState.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE));
+ assertTrue(Test.TRUE, testPrndl.getDataType().equals(VehicleDataType.VEHICLEDATA_PRNDL));
+ assertTrue(Test.TRUE, testBraking.getDataType().equals(VehicleDataType.VEHICLEDATA_BRAKING));
+ assertTrue(Test.TRUE, testWiperStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WIPERSTATUS));
+ assertTrue(Test.TRUE, testFuelRange.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELRANGE));
+ assertTrue(Test.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL));
+ assertTrue(Test.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS));
+
+ // Invalid/Null Tests
+ UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse();
+ assertNotNull("Null object creation failed.", msg);
+ testNullBase(msg);
+
+ assertNull(Test.NULL, msg.getAccPedalPosition());
+ assertNull(Test.NULL, msg.getAirbagStatus());
+ assertNull(Test.NULL, msg.getBeltStatus());
+ assertNull(Test.NULL, msg.getDriverBraking());
+ assertNull(Test.NULL, msg.getFuelLevel());
+ assertNull(Test.NULL, msg.getTirePressure());
+ assertNull(Test.NULL, msg.getWiperStatus());
+ assertNull(Test.NULL, msg.getGps());
+ assertNull(Test.NULL, msg.getSpeed());
+ assertNull(Test.NULL, msg.getRpm());
+ assertNull(Test.NULL, msg.getFuelLevelState());
+ assertNull(Test.NULL, msg.getInstantFuelConsumption());
+ assertNull(Test.NULL, msg.getExternalTemperature());
+ assertNull(Test.NULL, msg.getPrndl());
+ assertNull(Test.NULL, msg.getOdometer());
+ assertNull(Test.NULL, msg.getBodyInformation());
+ assertNull(Test.NULL, msg.getDeviceStatus());
+ assertNull(Test.NULL, msg.getHeadLampStatus());
+ assertNull(Test.NULL, msg.getEngineTorque());
+ assertNull(Test.NULL, msg.getEngineOilLife());
+ assertNull(Test.NULL, msg.getSteeringWheelAngle());
+ assertNull(Test.NULL, msg.getECallInfo());
+ assertNull(Test.NULL, msg.getEmergencyEvent());
+ assertNull(Test.NULL, msg.getClusterModeStatus());
+ assertNull(Test.NULL, msg.getMyKey());
+ assertNull(Test.NULL, msg.getFuelRange());
+ assertNull(Test.NULL, msg.getTurnSignal());
+ assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
+ }
+
+ /**
+ * Tests a valid JSON construction of this RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ UnsubscribeVehicleDataResponse cmd = new UnsubscribeVehicleDataResponse(hash);
+
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+
+ JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
+
+ JSONObject speed = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_SPEED);
+ VehicleDataResult referenceSpeed = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(speed));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSpeed, cmd.getSpeed()));
+
+ JSONObject rpm = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_RPM);
+ VehicleDataResult referenceRpm = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(rpm));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceRpm, cmd.getRpm()));
+
+ JSONObject fuelLevel = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_LEVEL);
+ VehicleDataResult referenceFuelLevel = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevel));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevel, cmd.getFuelLevel()));
+
+ JSONObject externalTemperature = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE);
+ VehicleDataResult referenceExternalTemperature = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(externalTemperature));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceExternalTemperature, cmd.getExternalTemperature()));
+
+ JSONObject prndl = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_PRNDL);
+ VehicleDataResult referencePrndl = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(prndl));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referencePrndl, cmd.getPrndl()));
+
+ JSONObject tirePressure = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_TIRE_PRESSURE);
+ VehicleDataResult referenceTirePressure = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(tirePressure));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTirePressure, cmd.getTirePressure()));
+
+ JSONObject engineTorque = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ENGINE_TORQUE);
+ VehicleDataResult referenceEngineTorque = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineTorque));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineTorque, cmd.getEngineTorque()));
+
+ JSONObject engineOilLife = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE);
+ VehicleDataResult referenceEngineOilLife = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineOilLife));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineOilLife, cmd.getEngineOilLife()));
+
+ JSONObject odometer = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ODOMETER);
+ VehicleDataResult referenceOdometer = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(odometer));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceOdometer, cmd.getOdometer()));
+
+ JSONObject gps = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_GPS);
+ VehicleDataResult referenceGps = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(gps));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceGps, cmd.getGps()));
+
+ JSONObject fuelLevelState = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE);
+ VehicleDataResult referenceFuelLevelState = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevelState));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevelState, cmd.getFuelLevelState()));
+
+ JSONObject fuelConsumption = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION);
+ VehicleDataResult referenceFuelConsumption = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelConsumption));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelConsumption, cmd.getInstantFuelConsumption()));
+
+ JSONObject beltStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_BELT_STATUS);
+ VehicleDataResult referenceBeltStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(beltStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBeltStatus, cmd.getBeltStatus()));
+
+ JSONObject bodyInformation = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_BODY_INFORMATION);
+ VehicleDataResult referenceBodyInformation = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(bodyInformation));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBodyInformation, cmd.getBodyInformation()));
+
+ JSONObject deviceStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_DEVICE_STATUS);
+ VehicleDataResult referenceDeviceStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(deviceStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDeviceStatus, cmd.getDeviceStatus()));
+
+ JSONObject driverBraking = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_DRIVER_BRAKING);
+ VehicleDataResult referenceDriverBraking = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(driverBraking));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDriverBraking, cmd.getDriverBraking()));
+
+ JSONObject wiperStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_WIPER_STATUS);
+ VehicleDataResult referenceWiperStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(wiperStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceWiperStatus, cmd.getWiperStatus()));
+
+ JSONObject headLampStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS);
+ VehicleDataResult referenceHeadLampStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(headLampStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceHeadLampStatus, cmd.getHeadLampStatus()));
+
+ JSONObject accPedalPosition = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION);
+ VehicleDataResult referenceAccPedalPosition = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(accPedalPosition));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAccPedalPosition, cmd.getAccPedalPosition()));
+
+ JSONObject steeringWheelAngle = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE);
+ VehicleDataResult referenceSteeringWheelAngle = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(steeringWheelAngle));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSteeringWheelAngle, cmd.getSteeringWheelAngle()));
+
+ JSONObject eCallInfo = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_E_CALL_INFO);
+ VehicleDataResult referenceECallInfo = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eCallInfo));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceECallInfo, cmd.getECallInfo()));
+
+ JSONObject airbagStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_AIRBAG_STATUS);
+ VehicleDataResult referenceAirbagStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(airbagStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAirbagStatus, cmd.getAirbagStatus()));
+
+ JSONObject emergencyEvent = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT);
+ VehicleDataResult referenceEmergencyEvent = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(emergencyEvent));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEmergencyEvent, cmd.getEmergencyEvent()));
+
+ JSONObject clusterModeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS);
+ VehicleDataResult referenceClusterModeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceClusterModeStatus, cmd.getClusterModeStatus()));
+
+ JSONObject myKey = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_MY_KEY);
+ VehicleDataResult referenceMyKey = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(myKey));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceMyKey, cmd.getMyKey()));
+
+ JSONObject fuelRange = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_RANGE);
+ VehicleDataResult referenceFuelRange = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelRange));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelRange, cmd.getFuelRange()));
+
+ JSONObject turnSignal = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_TURN_SIGNAL);
+ VehicleDataResult referenceTurnSignal = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(turnSignal));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTurnSignal, cmd.getTurnSignal()));
+
+ JSONObject eBrakeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ VehicleDataResult referenceEBrakeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eBrakeStatus));
+ assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEBrakeStatus, cmd.getElectronicParkBrakeStatus()));
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java
index b8b69be60..b8b69be60 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java
new file mode 100644
index 000000000..84ecc8b64
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java
@@ -0,0 +1,73 @@
+package com.smartdevicelink.test.rpc.responses;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.rpc.UpdateTurnListResponse;
+import com.smartdevicelink.test.BaseRpcTests;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.json.rpc.JsonFileReader;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.UpdateTurnListResponse}
+ */
+public class UpdateTurnListResponseTests extends BaseRpcTests {
+
+ @Override
+ protected RPCMessage createMessage(){
+ return new UpdateTurnListResponse();
+ }
+
+ @Override
+ protected String getMessageType(){
+ return RPCMessage.KEY_RESPONSE;
+ }
+
+ @Override
+ protected String getCommandType(){
+ return FunctionID.UPDATE_TURN_LIST.toString();
+ }
+
+ @Override
+ protected JSONObject getExpectedParameters(int sdlVersion){
+ return new JSONObject();
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Invalid/Null Tests
+ UpdateTurnListResponse msg = new UpdateTurnListResponse();
+ assertNotNull(Test.NOT_NULL, msg);
+ testNullBase(msg);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testJsonConstructor () {
+ JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
+ assertNotNull(Test.NOT_NULL, commandJson);
+
+ try {
+ Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
+ UpdateTurnListResponse cmd = new UpdateTurnListResponse(hash);
+ JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
+ assertNotNull(Test.NOT_NULL, body);
+
+ // Test everything in the json body.
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
+ assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java
new file mode 100644
index 000000000..e3aca14a4
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java
@@ -0,0 +1,174 @@
+package com.smartdevicelink.test.security;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.BTTransportConfig;
+import com.smartdevicelink.transport.BaseTransportConfig;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SdlSecurityBaseTest extends AndroidTestCase2 {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ }
+
+ private class MockSdlSecurityBase extends SdlSecurityBase {
+
+ @Override
+ public void initialize() {
+
+ }
+
+ @Override
+ public Integer runHandshake(byte[] inputData, byte[] outputData) {
+ return null;
+ }
+
+ @Override
+ public Integer encryptData(byte[] inputData, byte[] outputData) {
+ return null;
+ }
+
+ @Override
+ public Integer decryptData(byte[] inputData, byte[] outputData) {
+ return null;
+ }
+
+ @Override
+ public void shutDown() {
+
+ }
+
+ public SdlSession getSdlSession() {
+ return session;
+ }
+
+ public void setStartServiceList(List<SessionType> list) {
+ startServiceList = list;
+ }
+ }
+
+ class MockInterfaceBroker implements ISdlConnectionListener {
+ public MockInterfaceBroker () { }
+ @Override
+ public void onTransportDisconnected(String info) {
+
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) {
+
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+
+ }
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+
+ }
+ @Override
+ public void onProtocolSessionStartedNACKed(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+
+ }
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID,
+ boolean isEncrypted) {
+
+ }
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
+ String correlationID) {
+
+ }
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,
+ byte sessionID, String correlationID) {
+
+ }
+ @Override
+ public void onProtocolError(String info, Exception e) {
+
+ }
+ @Override
+ public void onHeartbeatTimedOut(byte sessionID) {
+
+ }
+ @Override
+ public void onProtocolServiceDataACK(SessionType sessionType, int dataSize,
+ byte sessionID) {
+
+ }
+ @Override
+ public void onAuthTokenReceived(String token, byte bytes){}
+
+ }
+
+ public void testMakeListSetAndGet(){
+ List<String> makeList = new ArrayList<String>();
+ MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase();
+
+ String MAKE_1 = "SDL1";
+ String MAKE_2 = "SDL2";
+ makeList.add(MAKE_1);
+ makeList.add(MAKE_2);
+
+ mockSdlSecurityBase.setMakeList(makeList);
+
+ assertNotNull(Test.NOT_NULL, makeList);
+ assertEquals(Test.MATCH, makeList, mockSdlSecurityBase.getMakeList());
+ }
+
+ public void testHandleInitResult() {
+ byte testWiproVersion = (byte) 0x0B;
+ boolean testInitResult = true;
+ MockInterfaceBroker interfaceBroker = new MockInterfaceBroker();
+ BaseTransportConfig transportConfig = new BTTransportConfig(true);
+ MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase();
+
+ SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,interfaceBroker, transportConfig);
+
+ assertNotNull(Test.NOT_NULL, mockSdlSecurityBase);
+ assertNotNull(Test.NOT_NULL, testSdlSession);
+
+ testSdlSession.setSdlSecurity(mockSdlSecurityBase);
+
+ mockSdlSecurityBase.handleSdlSession(testSdlSession);
+
+ assertEquals(Test.MATCH, mockSdlSecurityBase.getSdlSession(), testSdlSession);
+ assertEquals(Test.MATCH, mockSdlSecurityBase.getSdlSession().getSessionId(), testSdlSession.getSessionId());
+
+ mockSdlSecurityBase.handleInitResult(testInitResult);
+
+ assertEquals(Test.MATCH, testInitResult, mockSdlSecurityBase.getInitSuccess());
+ }
+
+ public void testStartServiceListSetAndGet() {
+ List<SessionType> startServiceList = new ArrayList<SessionType>();
+ MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase();
+
+ startServiceList.add(SessionType.RPC);
+ startServiceList.add(SessionType.NAV);
+ startServiceList.add(SessionType.PCM);
+ startServiceList.add(SessionType.CONTROL);
+
+ assertNotNull(Test.NOT_NULL, startServiceList);
+
+ mockSdlSecurityBase.setStartServiceList(startServiceList);
+
+ assertEquals(Test.MATCH, startServiceList, mockSdlSecurityBase.getServiceList());
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java
new file mode 100644
index 000000000..aa2c6f073
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java
@@ -0,0 +1,86 @@
+package com.smartdevicelink.test.streaming;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.streaming.IStreamListener;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.BTTransportConfig;
+import com.smartdevicelink.transport.BaseTransportConfig;
+
+import junit.framework.TestCase;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.streaming.AbstractPacketizer}
+ */
+public class AbstractPacketizerTests extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.streaming.AbstractPacketizer#AbstractPacketizer(IStreamListener, InputStream, SessionType, byte)}
+ * {@link com.smartdevicelink.streaming.AbstractPacketizer#AbstractPacketizer(IStreamListener, InputStream, RPCRequest, SessionType, byte, byte)}
+ */
+ public void testConstructors () {
+
+ // Test Values
+ byte testSessionId = (byte) 0x0A;
+ byte testWiproVersion = (byte) 0x0B;
+ RPCRequest testRpcRequest = new RPCRequest("test");
+ SessionType testSessionType = SessionType.RPC;
+ SdlSession testSdlSession = null;
+ InputStream testInputStream = null;
+ MockPacketizer testPacketizer1 = null;
+ MockPacketizer testPacketizer2 = null;
+ MockPacketizer testPacketizer3 = null;
+ IStreamListener testListener = new MockStreamListener();
+ try {
+ testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes()));
+ MockInterfaceBroker _interfaceBroker = new MockInterfaceBroker();
+ BaseTransportConfig _transportConfig = new BTTransportConfig(true);
+ testSdlSession = SdlSession.createSession(testWiproVersion,_interfaceBroker, _transportConfig);
+ testPacketizer1 = new MockPacketizer(testListener, testInputStream, testSessionType, testSessionId, testSdlSession);
+ testPacketizer2 = new MockPacketizer(null, null, null, testSessionId, testSdlSession);
+ testPacketizer3 = new MockPacketizer(testListener, testInputStream, testRpcRequest, testSessionType, testSessionId, testWiproVersion, testSdlSession);
+ try {
+ new MockPacketizer(null, null, null, null, testSessionId, testWiproVersion, null);
+ fail("Exception should be thrown");
+ }catch(Exception e) {
+ assertTrue(e instanceof IllegalArgumentException);
+ }
+
+
+ // Valid Tests
+ assertNotNull(Test.NOT_NULL, testPacketizer1);
+ assertNotNull(Test.NOT_NULL, testPacketizer2);
+ assertNotNull(Test.NOT_NULL, testPacketizer3);
+
+ assertEquals(Test.MATCH, testListener, testPacketizer1.getListener());
+ assertEquals(Test.MATCH, testInputStream, testPacketizer1.getInputStream());
+ assertEquals(Test.MATCH, testSessionType, testPacketizer1.getSessionType());
+ assertEquals(Test.MATCH, testSessionId, testPacketizer1.getSessionId());
+ assertEquals(Test.MATCH, testListener, testPacketizer3.getListener());
+ assertEquals(Test.MATCH, testInputStream, testPacketizer3.getInputStream());
+ assertEquals(Test.MATCH, testSessionType, testPacketizer3.getSessionType());
+ assertEquals(Test.MATCH, testSessionId, testPacketizer3.getSessionId());
+ assertEquals(Test.MATCH, testWiproVersion, testPacketizer3.getWiproVersion());
+ assertEquals(Test.MATCH, testRpcRequest.getFunctionName(), testPacketizer3.getRPCRequest().getFunctionName());
+ assertEquals(Test.MATCH, testSdlSession, testPacketizer3.getSdlSession());
+
+ // Invalid/Null Tests
+ assertNull(Test.NULL, testPacketizer2.getListener());
+ assertNull(Test.NULL, testPacketizer2.getInputStream());
+ assertNull(Test.NULL, testPacketizer2.getSessionType());
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ fail("IOException was thrown.");
+ }
+ }
+}
+
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java
new file mode 100644
index 000000000..f3bcc38ee
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java
@@ -0,0 +1,70 @@
+package com.smartdevicelink.test.streaming;
+
+import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.transport.BaseTransportConfig;
+
+import java.util.List;
+
+/**
+ * This is a mock class for testing the following :
+ * {@link com.smartdevicelink.streaming.AbstractPacketizer}
+ */
+public class MockInterfaceBroker implements ISdlConnectionListener {
+ public MockInterfaceBroker () { }
+ @Override
+ public void onTransportDisconnected(String info) {
+
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) {
+
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+
+ }
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+
+ }
+ @Override
+ public void onProtocolSessionStartedNACKed(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+
+ }
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID,
+ boolean isEncrypted) {
+
+ }
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
+ String correlationID) {
+
+ }
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,
+ byte sessionID, String correlationID) {
+
+ }
+ @Override
+ public void onProtocolError(String info, Exception e) {
+
+ }
+ @Override
+ public void onHeartbeatTimedOut(byte sessionID) {
+
+ }
+ @Override
+ public void onProtocolServiceDataACK(SessionType sessionType, int dataSize,
+ byte sessionID) {
+
+ }
+ @Override
+ public void onAuthTokenReceived(String token, byte bytes){}
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
index 2c6618f62..2c6618f62 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockStreamListener.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockStreamListener.java
index 0081c65ea..0081c65ea 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockStreamListener.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockStreamListener.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java
new file mode 100644
index 000000000..143e8efec
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java
@@ -0,0 +1,509 @@
+package com.smartdevicelink.test.streaming;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.streaming.IStreamListener;
+import com.smartdevicelink.streaming.StreamPacketizer;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.BTTransportConfig;
+import com.smartdevicelink.transport.BaseTransportConfig;
+
+import junit.framework.TestCase;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.streaming.StreamPacketizer}
+ */
+public class StreamPacketizerTests extends TestCase {
+
+ private static final byte WIPRO_VERSION = 0x0B;
+ private static final byte SESSION_ID = 0x0A;
+
+ private final byte[][] SAMPLE_H264_VIDEO_STREAM = {
+ // one byte array represents a frame
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x67, 0x42, (byte)0xC0, 0x0A, (byte)0xA6, 0x11, 0x11, (byte)0xE8,
+ 0x40, 0x00, 0x00, (byte)0xFA, 0x40, 0x00, 0x3A, (byte)0x98,
+ 0x23, (byte)0xC4, (byte)0x89, (byte)0x84, 0x60,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x68, (byte)0xC8, 0x42, 0x0F, 0x13, 0x20,
+ 0x00, 0x00, 0x01,
+ 0x65, (byte)0x88, (byte)0x82, 0x07, 0x67, 0x39, 0x31, 0x40,
+ 0x00, 0x5E, 0x0A, (byte)0xFB, (byte)0xEF, (byte)0xAE, (byte)0xBA, (byte)0xEB,
+ (byte)0xAE, (byte)0xBA, (byte)0xEB, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x1C, 0x0E, (byte)0xCE, 0x71, (byte)0xB0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x2A, 0x03, (byte)0xB3, (byte)0x9C, 0x6C},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x3B, 0x03, (byte)0xB3, (byte)0x9C, 0x6C},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x49, 0x00, (byte)0xEC, (byte)0xE7, 0x1B},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x59, 0x40, (byte)0xEC, (byte)0xE7, 0x1B},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x69, (byte)0x80, (byte)0xEC, (byte)0xE7, 0x1B},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x79, (byte)0xC0, (byte)0xEC, (byte)0xE7, 0x1B},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, (byte)0x88, (byte)0x80, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, (byte)0x98, (byte)0x90, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, (byte)0xA8, (byte)0xA0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, (byte)0xB8, (byte)0xB0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, (byte)0xC8, (byte)0xC0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, (byte)0xD8, (byte)0xD0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, (byte)0xE8, (byte)0xE0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, (byte)0xF8, (byte)0xF0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, 0x00, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, 0x10, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, 0x20, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, 0x30, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, 0x40, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, 0x50, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, 0x60, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, 0x70, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, (byte)0x80, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, (byte)0x90, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, (byte)0xA0, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, (byte)0xB0, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, (byte)0xC0, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9B, (byte)0xD0, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x67, 0x42, (byte)0xC0, 0x0A, (byte)0xA6, 0x11, 0x11, (byte)0xE8,
+ 0x40, 0x00, 0x00, (byte)0xFA, 0x40, 0x00, 0x3A, (byte)0x98,
+ 0x23, (byte)0xC4, (byte)0x89, (byte)0x84, 0x60,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x68, (byte)0xC8, 0x42, 0x0F, 0x13, 0x20,
+ 0x00, 0x00, 0x01,
+ 0x65, (byte)0x88, (byte)0x81, 0x00, (byte)0x8E, 0x73, (byte)0x93, 0x14,
+ 0x00, 0x06, (byte)0xA4, 0x2F, (byte)0xBE, (byte)0xFA, (byte)0xEB, (byte)0xAE,
+ (byte)0xBA, (byte)0xEB, (byte)0xAE, (byte)0xBC},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x1C, 0x0D, (byte)0xCE, 0x71, (byte)0xB0},
+ new byte[]{0x00, 0x00, 0x00, 0x01,
+ 0x41, (byte)0x9A, 0x2A, 0x03, 0x33, (byte)0x9C, 0x6C},
+ };
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.streaming.StreamPacketizer#StreamPacketizer(IStreamListener, InputStream, SessionType, byte)}
+ */
+ public void testConstructor () {
+
+ // Test Values
+ byte testSessionId = (byte) 0x0A;
+ SessionType testSessionType = SessionType.RPC;
+ InputStream testInputStream = null;
+ byte testWiproVersion = (byte) 0x0B;
+ IStreamListener testListener = new MockStreamListener();
+ MockInterfaceBroker _interfaceBroker = new MockInterfaceBroker();
+ BaseTransportConfig _transportConfig = new BTTransportConfig(true);
+ SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,_interfaceBroker, _transportConfig);
+ try {
+ testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes()));
+ StreamPacketizer testStreamPacketizer = new StreamPacketizer(testListener, testInputStream, testSessionType, testSessionId, testSdlSession);
+ assertNotNull(Test.NOT_NULL, testStreamPacketizer);
+
+ // NOTE: Cannot test thread handling methods currently.
+
+ } catch (IOException e) {
+ fail("IOException was thrown.");
+ }
+ }
+
+ /**
+ * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendFrame(byte[], int, int, long)}
+ */
+ public void testSendFrameInterfaceWithArray() {
+ StreamReceiver mockReceiver = new StreamReceiver();
+ SdlSession session = createTestSession();
+ StreamPacketizer packetizer = null;
+ try {
+ packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
+ } catch (IOException e) {
+ fail();
+ }
+ MockVideoApp mockApp = new MockVideoApp(packetizer);
+
+ try {
+ packetizer.start();
+ } catch (IOException e) {
+ fail();
+ }
+
+ mockApp.inputByteStreamWithArray(SAMPLE_H264_VIDEO_STREAM);
+ try {
+ Thread.sleep(1000, 0);
+ } catch (InterruptedException e) {}
+
+ packetizer.stop();
+ assertTrue(mockReceiver.verify(SAMPLE_H264_VIDEO_STREAM));
+ }
+
+ /**
+ * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendFrame(byte[], int, int, long)}
+ * with offset parameter
+ */
+ public void testSendFrameInterfaceWithArrayOffset() {
+ StreamReceiver mockReceiver = new StreamReceiver();
+ SdlSession session = createTestSession();
+ StreamPacketizer packetizer = null;
+ try {
+ packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
+ } catch (IOException e) {
+ fail();
+ }
+ MockVideoApp mockApp = new MockVideoApp(packetizer);
+
+ try {
+ packetizer.start();
+ } catch (IOException e) {
+ fail();
+ }
+
+ mockApp.inputByteStreamWithArrayOffset(SAMPLE_H264_VIDEO_STREAM);
+ try {
+ Thread.sleep(1000, 0);
+ } catch (InterruptedException e) {}
+
+ packetizer.stop();
+ assertTrue(mockReceiver.verify(SAMPLE_H264_VIDEO_STREAM));
+ }
+
+ /**
+ * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendFrame(ByteBuffer, long)}
+ */
+ public void testSendFrameInterfaceWithByteBuffer() {
+ StreamReceiver mockReceiver = new StreamReceiver();
+ SdlSession session = createTestSession();
+ StreamPacketizer packetizer = null;
+ try {
+ packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
+ } catch (IOException e) {
+ fail();
+ }
+ MockVideoApp mockApp = new MockVideoApp(packetizer);
+
+ try {
+ packetizer.start();
+ } catch (IOException e) {
+ fail();
+ }
+
+ mockApp.inputByteStreamWithByteBuffer(SAMPLE_H264_VIDEO_STREAM);
+ try {
+ Thread.sleep(1000, 0);
+ } catch (InterruptedException e) {}
+
+ packetizer.stop();
+ assertTrue(mockReceiver.verify(SAMPLE_H264_VIDEO_STREAM));
+ }
+
+ /**
+ * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendFrame(ByteBuffer, long)}
+ * with direct ByteBuffer
+ */
+ public void testSendFrameInterfaceWithDirectByteBuffer() {
+ StreamReceiver mockReceiver = new StreamReceiver();
+ SdlSession session = createTestSession();
+ StreamPacketizer packetizer = null;
+ try {
+ packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
+ } catch (IOException e) {
+ fail();
+ }
+ MockVideoApp mockApp = new MockVideoApp(packetizer);
+
+ try {
+ packetizer.start();
+ } catch (IOException e) {
+ fail();
+ }
+
+ mockApp.inputByteStreamWithDirectByteBuffer(SAMPLE_H264_VIDEO_STREAM);
+ try {
+ Thread.sleep(1000, 0);
+ } catch (InterruptedException e) {}
+
+ packetizer.stop();
+ assertTrue(mockReceiver.verify(SAMPLE_H264_VIDEO_STREAM));
+ }
+
+ /**
+ * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendAudio(byte[], int, int, long)}
+ */
+ public void testSendAudioInterfaceWithArray() {
+ // assume 100 data of 16kHz / 16bits audio for 10 msecs
+ int dataCount = 100;
+ byte[][] sampleAudio = new byte[dataCount][];
+ for (int i = 0; i < dataCount; i++) {
+ sampleAudio[i] = new byte[4 * 160];
+ Arrays.fill(sampleAudio[i], (byte)0);
+ }
+
+ StreamReceiver mockReceiver = new StreamReceiver();
+ SdlSession session = createTestSession();
+ StreamPacketizer packetizer = null;
+ try {
+ packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
+ } catch (IOException e) {
+ fail();
+ }
+ MockVideoApp mockApp = new MockVideoApp(packetizer);
+
+ try {
+ packetizer.start();
+ } catch (IOException e) {
+ fail();
+ }
+
+ mockApp.inputByteStreamWithArray(sampleAudio);
+ try {
+ Thread.sleep(1000, 0);
+ } catch (InterruptedException e) {}
+
+ packetizer.stop();
+ assertTrue(mockReceiver.verify(sampleAudio));
+ }
+
+ /**
+ * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendAudio(byte[], int, int, long)}
+ */
+ public void testSendAudioInterfaceWithArrayOffset() {
+ // assume 100 data of 16kHz / 16bits audio for 10 msecs
+ int dataCount = 100;
+ byte[][] sampleAudio = new byte[dataCount][];
+ for (int i = 0; i < dataCount; i++) {
+ sampleAudio[i] = new byte[4 * 160];
+ Arrays.fill(sampleAudio[i], (byte)0);
+ }
+
+ StreamReceiver mockReceiver = new StreamReceiver();
+ SdlSession session = createTestSession();
+ StreamPacketizer packetizer = null;
+ try {
+ packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
+ } catch (IOException e) {
+ fail();
+ }
+ MockVideoApp mockApp = new MockVideoApp(packetizer);
+
+ try {
+ packetizer.start();
+ } catch (IOException e) {
+ fail();
+ }
+
+ mockApp.inputByteStreamWithArrayOffset(sampleAudio);
+ try {
+ Thread.sleep(1000, 0);
+ } catch (InterruptedException e) {}
+
+ packetizer.stop();
+ assertTrue(mockReceiver.verify(sampleAudio));
+ }
+
+ /**
+ * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendAudio(ByteBuffer, long)}
+ */
+ public void testSendAudioInterfaceWithByteBuffer() {
+ // assume 100 data of 16kHz / 16bits audio for 10 msecs
+ int dataCount = 100;
+ byte[][] sampleAudio = new byte[dataCount][];
+ for (int i = 0; i < dataCount; i++) {
+ sampleAudio[i] = new byte[4 * 160];
+ Arrays.fill(sampleAudio[i], (byte)0);
+ }
+
+ StreamReceiver mockReceiver = new StreamReceiver();
+ SdlSession session = createTestSession();
+ StreamPacketizer packetizer = null;
+ try {
+ packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
+ } catch (IOException e) {
+ fail();
+ }
+ MockVideoApp mockApp = new MockVideoApp(packetizer);
+
+ try {
+ packetizer.start();
+ } catch (IOException e) {
+ fail();
+ }
+
+ mockApp.inputByteStreamWithByteBuffer(sampleAudio);
+ try {
+ Thread.sleep(1000, 0);
+ } catch (InterruptedException e) {}
+
+ packetizer.stop();
+ assertTrue(mockReceiver.verify(sampleAudio));
+ }
+
+ /**
+ * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendAudio(ByteBuffer, long)}
+ * with direct ByteBuffer
+ */
+ public void testSendAudioInterfaceWithDirectByteBuffer() {
+ // assume 100 data of 16kHz / 16bits audio for 10 msecs
+ int dataCount = 100;
+ byte[][] sampleAudio = new byte[dataCount][];
+ for (int i = 0; i < dataCount; i++) {
+ sampleAudio[i] = new byte[4 * 160];
+ Arrays.fill(sampleAudio[i], (byte)0);
+ }
+
+ StreamReceiver mockReceiver = new StreamReceiver();
+ SdlSession session = createTestSession();
+ StreamPacketizer packetizer = null;
+ try {
+ packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
+ } catch (IOException e) {
+ fail();
+ }
+ MockVideoApp mockApp = new MockVideoApp(packetizer);
+
+ try {
+ packetizer.start();
+ } catch (IOException e) {
+ fail();
+ }
+
+ mockApp.inputByteStreamWithDirectByteBuffer(sampleAudio);
+ try {
+ Thread.sleep(1000, 0);
+ } catch (InterruptedException e) {}
+
+ packetizer.stop();
+ assertTrue(mockReceiver.verify(sampleAudio));
+ }
+
+
+ private SdlSession createTestSession() {
+ return SdlSession.createSession(WIPRO_VERSION, new MockInterfaceBroker(), new BTTransportConfig(true));
+ }
+
+ private class StreamReceiver implements IStreamListener {
+ private ByteArrayOutputStream mReceiveBuffer;
+
+ StreamReceiver() {
+ mReceiveBuffer = new ByteArrayOutputStream();
+ }
+
+ @Override
+ public void sendStreamPacket(ProtocolMessage pm) {
+ try {
+ mReceiveBuffer.write(pm.getData());
+ } catch (IOException e) {
+ fail();
+ }
+ }
+
+ boolean verify(byte[][] expectedStream) {
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ for (byte[] frame : expectedStream) {
+ try {
+ buffer.write(frame);
+ } catch (IOException e) {
+ fail();
+ }
+ }
+ boolean result = Arrays.equals(buffer.toByteArray(), mReceiveBuffer.toByteArray());
+ try {
+ buffer.close();
+ } catch (IOException e) {
+ fail();
+ }
+ return result;
+ }
+ }
+
+ private class MockVideoApp {
+ private IVideoStreamListener mListener;
+
+ MockVideoApp(IVideoStreamListener listener) {
+ mListener = listener;
+ }
+
+ void inputByteStreamWithArray(byte[][] stream) {
+ for (byte[] data : stream) {
+ mListener.sendFrame(data, 0, data.length, -1);
+ }
+ }
+
+ void inputByteStreamWithArrayOffset(byte[][] stream) {
+ int dummyOffset = 0;
+ for (byte[] data : stream) {
+ // to test 'offset' param, create a buffer with a dummy offset
+ byte[] buffer = new byte[dummyOffset + data.length];
+ System.arraycopy(data, 0, buffer, dummyOffset, data.length);
+
+ mListener.sendFrame(buffer, dummyOffset, data.length, -1);
+ dummyOffset++;
+ }
+ }
+
+ void inputByteStreamWithByteBuffer(byte[][] stream) {
+ int dummyOffset = 0;
+ for (byte[] data : stream) {
+ // add a dummy offset inside byteBuffer for testing
+ ByteBuffer byteBuffer = ByteBuffer.allocate(dummyOffset + data.length);
+ byteBuffer.position(dummyOffset);
+
+ byteBuffer.put(data);
+ byteBuffer.flip();
+ byteBuffer.position(dummyOffset);
+
+ mListener.sendFrame(byteBuffer, -1);
+ dummyOffset++;
+ }
+ }
+
+ void inputByteStreamWithDirectByteBuffer(byte[][] stream) {
+ int dummyOffset = 0;
+ for (byte[] data : stream) {
+ // add a dummy offset inside byteBuffer for testing
+ ByteBuffer byteBuffer = ByteBuffer.allocateDirect(dummyOffset + data.length);
+ byteBuffer.position(dummyOffset);
+
+ byteBuffer.put(data);
+ byteBuffer.flip();
+ byteBuffer.position(dummyOffset);
+
+ mListener.sendFrame(byteBuffer, -1);
+ dummyOffset++;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java
new file mode 100644
index 000000000..b35877ac3
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java
@@ -0,0 +1,55 @@
+package com.smartdevicelink.test.streaming;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.SdlProxyBase;
+import com.smartdevicelink.streaming.IStreamListener;
+import com.smartdevicelink.streaming.StreamRPCPacketizer;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.BTTransportConfig;
+import com.smartdevicelink.transport.BaseTransportConfig;
+
+import junit.framework.TestCase;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.streaming.StreamRPCPacketizer}
+ */
+public class StreamRPCPacketizerTests extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.streaming.StreamRPCPacketizer#StreamRPCPacketizer(SdlProxyBase, IStreamListener, InputStream, RPCRequest, SessionType, byte, byte, long, SdlSession)}
+ */
+ public void testConstructor () {
+
+ // Test Values
+ byte testSessionId = (byte) 0x0A;
+ byte testWV = (byte) 0x0B;
+ RPCRequest testRequest = new RPCRequest("test");
+ SessionType testSessionType = SessionType.RPC;
+ InputStream testInputStream = null;
+ IStreamListener testListener = new MockStreamListener();
+
+ byte testWiproVersion = (byte) 0x0B;
+ MockInterfaceBroker _interfaceBroker = new MockInterfaceBroker();
+ BaseTransportConfig _transportConfig = new BTTransportConfig(true);
+ SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,_interfaceBroker, _transportConfig);
+ try {
+ testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes()));
+ StreamRPCPacketizer testStreamRpcPacketizer = new StreamRPCPacketizer(null, testListener, testInputStream, testRequest, testSessionType, testSessionId, testWV, testWV, testSdlSession);
+ assertNotNull(Test.NOT_NULL, testStreamRpcPacketizer);
+
+ // NOTE: Cannot test thread handling methods currently.
+
+ } catch (IOException e) {
+ fail("IOException was thrown.");
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java
index 7090ba8e8..7090ba8e8 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java
index 453239bca..453239bca 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java
index ce24ce4e8..ce24ce4e8 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java
new file mode 100644
index 000000000..34c5c1936
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java
@@ -0,0 +1,54 @@
+package com.smartdevicelink.test.trace;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.trace.Mime;
+
+import junit.framework.TestCase;
+
+import java.io.UnsupportedEncodingException;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.trace.Mime}
+ */
+public class MimeTests extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.trace.Mime#base64Encode(byte[])}
+ * {@link com.smartdevicelink.trace.Mime#base64Encode(String)}
+ * {@link com.smartdevicelink.trace.Mime#base64Encode(byte[], int, int)}
+ */
+ public void testEncoding () {
+
+ try {
+ // Test Values
+ String testString = "test";
+ byte[] testBytes = testString.getBytes("US-ASCII");
+
+ // Comparison Values
+ String expectedEncodedString = "dGVzdA==";
+ String actualNullResult1 = Mime.base64Encode((byte[]) null);
+ String actualNullResult2 = Mime.base64Encode((String) null);
+ String actualNullResult3 = Mime.base64Encode(null, 0, 0);
+ String actualInvalidResult = Mime.base64Encode(testBytes, 35, 2);
+ String actualEncodedString1 = Mime.base64Encode(testString);
+ String actualEncodedString2 = Mime.base64Encode(testBytes);
+ String actualEncodedString3 = Mime.base64Encode(testBytes, 0, testBytes.length);
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString1);
+ assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString2);
+ assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString3);
+
+ // Invalid/Null Tests
+ assertNull(Test.NULL, actualNullResult1);
+ assertNull(Test.NULL, actualNullResult2);
+ assertNull(Test.NULL, actualNullResult3);
+ assertNull(Test.NULL, actualInvalidResult);
+
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java
new file mode 100644
index 000000000..a46e35542
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java
@@ -0,0 +1,124 @@
+package com.smartdevicelink.test.trace;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.trace.DiagLevel;
+import com.smartdevicelink.trace.SdlTrace;
+import com.smartdevicelink.trace.enums.DetailLevel;
+import com.smartdevicelink.trace.enums.Mod;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.trace.SdlTrace}
+ */
+public class SdlTraceTests extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.trace.SdlTrace#setAcceptAPITraceAdjustments(Boolean)}
+ * {@link com.smartdevicelink.trace.SdlTrace#getAcceptAPITraceAdjustments()}
+ */
+ public void testAdjustmentFlags () {
+
+ SdlTrace.setAcceptAPITraceAdjustments(true);
+ assertTrue(Test.TRUE, SdlTrace.getAcceptAPITraceAdjustments());
+
+ SdlTrace.setAcceptAPITraceAdjustments(false);
+ assertFalse(Test.FALSE, SdlTrace.getAcceptAPITraceAdjustments());
+
+ // This should not change the value from the previous setting.
+ SdlTrace.setAcceptAPITraceAdjustments(null);
+ assertFalse(Test.FALSE, SdlTrace.getAcceptAPITraceAdjustments());
+ }
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.trace.SdlTrace#setAppTraceLevel(DetailLevel)}
+ * {@link com.smartdevicelink.trace.SdlTrace#setProxyTraceLevel(DetailLevel)}
+ * {@link com.smartdevicelink.trace.SdlTrace#setRpcTraceLevel(DetailLevel)}
+ * {@link com.smartdevicelink.trace.SdlTrace#setMarshallingTraceLevel(DetailLevel)}
+ * {@link com.smartdevicelink.trace.SdlTrace#setProtocolTraceLevel(DetailLevel)}
+ * {@link com.smartdevicelink.trace.SdlTrace#setTransportTraceLevel(DetailLevel)}
+ */
+ public void testTraceLevelFlags () {
+
+ SdlTrace.setAcceptAPITraceAdjustments(true);
+
+ // App Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ SdlTrace.setAppTraceLevel(DetailLevel.VERBOSE);
+ assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.app));
+ SdlTrace.setAppTraceLevel(DetailLevel.TERSE);
+ assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.app));
+ SdlTrace.setAppTraceLevel(DetailLevel.OFF);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.app));
+
+ // This should not change the value from the previous setting.
+ SdlTrace.setAppTraceLevel(null);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.app));
+
+ // Proxy Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - -
+ SdlTrace.setProxyTraceLevel(DetailLevel.VERBOSE);
+ assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.proxy));
+ SdlTrace.setProxyTraceLevel(DetailLevel.TERSE);
+ assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.proxy));
+ SdlTrace.setProxyTraceLevel(DetailLevel.OFF);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proxy));
+
+ // This should not change the value from the previous setting.
+ SdlTrace.setProxyTraceLevel(null);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proxy));
+
+ // Rpc Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ SdlTrace.setRpcTraceLevel(DetailLevel.VERBOSE);
+ assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.rpc));
+ SdlTrace.setRpcTraceLevel(DetailLevel.TERSE);
+ assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.rpc));
+ SdlTrace.setRpcTraceLevel(DetailLevel.OFF);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.rpc));
+
+ // This should not change the value from the previous setting.
+ SdlTrace.setRpcTraceLevel(null);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.rpc));
+
+ // Marshalling Trace Level - - - - - - - - - - - - - - - - - - - - - - -
+ SdlTrace.setMarshallingTraceLevel(DetailLevel.VERBOSE);
+ assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.mar));
+ SdlTrace.setMarshallingTraceLevel(DetailLevel.TERSE);
+ assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.mar));
+ SdlTrace.setMarshallingTraceLevel(DetailLevel.OFF);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.mar));
+
+ // This should not change the value from the previous setting.
+ SdlTrace.setMarshallingTraceLevel(null);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.mar));
+
+ // Protocol Trace Level - - - - - - - - - - - - - - - - - - - - - - - -
+ SdlTrace.setProtocolTraceLevel(DetailLevel.VERBOSE);
+ assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.proto));
+ SdlTrace.setProtocolTraceLevel(DetailLevel.TERSE);
+ assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.proto));
+ SdlTrace.setProtocolTraceLevel(DetailLevel.OFF);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proto));
+
+ // This should not change the value from the previous setting.
+ SdlTrace.setProtocolTraceLevel(null);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proto));
+
+ // Transport Trace Level - - - - - - - - - - - - - - - - - - - - - - - -
+ SdlTrace.setTransportTraceLevel(DetailLevel.VERBOSE);
+ assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.tran));
+ SdlTrace.setTransportTraceLevel(DetailLevel.TERSE);
+ assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.tran));
+ SdlTrace.setTransportTraceLevel(DetailLevel.OFF);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.tran));
+
+ // This should not change the value from the previous setting.
+ SdlTrace.setTransportTraceLevel(null);
+ assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.tran));
+ }
+
+ // NOTE : No testing can currently be done for the logging methods.
+
+ // NOTE : Cannot test for Bluetooth connected information currently.
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java
new file mode 100644
index 000000000..5f4301b0d
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java
@@ -0,0 +1,63 @@
+package com.smartdevicelink.test.trace.enums;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.trace.enums.DetailLevel;
+
+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.trace.enums.DetailLevel}
+ */
+public class DetailLevelTests extends TestCase {
+
+ /**
+ * This is a unit test for the following enum :
+ * {@link com.smartdevicelink.trace.enums.DetailLevel}
+ */
+ public void testDetailLevelEnum () {
+
+ // Test Values
+ String testOff = "OFF";
+ String testTerse = "TERSE";
+ String testInvalid = "INVALID";
+ String testVerbose = "VERBOSE";
+
+ try {
+ // Comparison Values
+ DetailLevel expectedOffEnum = DetailLevel.OFF;
+ DetailLevel expectedTerseEnum = DetailLevel.TERSE;
+ DetailLevel expectedVerboseEnum = DetailLevel.VERBOSE;
+ List<DetailLevel> expectedEnumList = new ArrayList<DetailLevel>();
+ expectedEnumList.add(DetailLevel.OFF);
+ expectedEnumList.add(DetailLevel.TERSE);
+ expectedEnumList.add(DetailLevel.VERBOSE);
+
+ DetailLevel actualNullEnum = DetailLevel.valueForString(null);
+ DetailLevel actualOffEnum = DetailLevel.valueForString(testOff);
+ DetailLevel actualTerseEnum = DetailLevel.valueForString(testTerse);
+ DetailLevel actualInvalidEnum = DetailLevel.valueForString(testInvalid);
+ DetailLevel actualVerboseEnum = DetailLevel.valueForString(testVerbose);
+ List<DetailLevel> actualEnumList = Arrays.asList(DetailLevel.values());
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedOffEnum, actualOffEnum);
+ assertEquals(Test.MATCH, expectedTerseEnum, actualTerseEnum);
+ assertEquals(Test.MATCH, expectedVerboseEnum, actualVerboseEnum);
+ assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
+
+ // Invalid/Null Tests
+ assertNull(Test.NULL, actualInvalidEnum);
+ assertNull(Test.NULL, actualNullEnum);
+
+ }catch (NullPointerException e) {
+ fail("Could not retrieve value for null string, should return null.");
+ } catch (IllegalArgumentException e) {
+ fail("Could not retrieve value for invalid string, should return null.");
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java
new file mode 100644
index 000000000..9ee0fff13
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java
@@ -0,0 +1,63 @@
+package com.smartdevicelink.test.trace.enums;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+
+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.trace.enums.InterfaceActivityDirection}
+ */
+public class InterfaceActivityDirectionTests extends TestCase {
+
+ /**
+ * This is a unit test for the following enum :
+ * {@link com.smartdevicelink.trace.enums.InterfaceActivityDirection}
+ */
+ public void testInterfaceActivityDirectionEnum () {
+
+ // Test Values
+ String testNone = "None";
+ String testInvalid = "Invalid";
+ String testReceive = "Receive";
+ String testTransmit = "Transmit";
+
+ try {
+ // Comparison Values
+ InterfaceActivityDirection expectedNoneEnum = InterfaceActivityDirection.None;
+ InterfaceActivityDirection expectedReceiveEnum = InterfaceActivityDirection.Receive;
+ InterfaceActivityDirection expectedTransmitEnum = InterfaceActivityDirection.Transmit;
+ List<InterfaceActivityDirection> expectedEnumList = new ArrayList<InterfaceActivityDirection>();
+ expectedEnumList.add(InterfaceActivityDirection.None);
+ expectedEnumList.add(InterfaceActivityDirection.Receive);
+ expectedEnumList.add(InterfaceActivityDirection.Transmit);
+
+ InterfaceActivityDirection actualNullEnum = InterfaceActivityDirection.valueForString(null);
+ InterfaceActivityDirection actualNoneEnum = InterfaceActivityDirection.valueForString(testNone);
+ InterfaceActivityDirection actualInvalidEnum = InterfaceActivityDirection.valueForString(testInvalid);
+ InterfaceActivityDirection actualReceiveEnum = InterfaceActivityDirection.valueForString(testReceive);
+ InterfaceActivityDirection actualTransmitEnum = InterfaceActivityDirection.valueForString(testTransmit);
+ List<InterfaceActivityDirection> actualEnumList = Arrays.asList(InterfaceActivityDirection.values());
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedNoneEnum, actualNoneEnum);
+ assertEquals(Test.MATCH, expectedReceiveEnum, actualReceiveEnum);
+ assertEquals(Test.MATCH, expectedTransmitEnum, actualTransmitEnum);
+ assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
+
+ // Invalid/Null
+ assertNull(Test.NULL, actualInvalidEnum);
+ assertNull(Test.NULL, actualNullEnum);
+
+ } catch (NullPointerException e) {
+ fail("Could not retrieve value for null string, should return null.");
+ } catch (IllegalArgumentException e) {
+ fail("Could not retrieve value for invalid string, should return null.");
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java
new file mode 100644
index 000000000..f1f856ef9
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.trace.enums;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.trace.enums.Mod;
+
+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.trace.enums.Mod}
+ */
+public class ModTests extends TestCase {
+
+ /**
+ * This is a unit test for the following enum :
+ * {@link com.smartdevicelink.trace.enums.Mod}
+ */
+ public void testModEnum () {
+
+ // TestValues
+ String testApp = "app";
+ String testRpc = "rpc";
+ String testMar = "mar";
+ String testTran = "tran";
+ String testProto = "proto";
+ String testProxy = "proxy";
+ String testInvalid = "invalid";
+
+ try {
+ // Comparison Values
+ Mod expectedAppEnum = Mod.app;
+ Mod expectedRpcEnum = Mod.rpc;
+ Mod expectedMarEnum = Mod.mar;
+ Mod expectedTranEnum = Mod.tran;
+ Mod expectedProtoEnum = Mod.proto;
+ Mod expectedProxyEnum = Mod.proxy;
+ List<Mod> expectedEnumList = new ArrayList<Mod>();
+ expectedEnumList.add(Mod.app);
+ expectedEnumList.add(Mod.rpc);
+ expectedEnumList.add(Mod.mar);
+ expectedEnumList.add(Mod.tran);
+ expectedEnumList.add(Mod.proto);
+ expectedEnumList.add(Mod.proxy);
+
+ Mod actualNullEnum = Mod.valueForString(null);
+ Mod actualAppEnum = Mod.valueForString(testApp);
+ Mod actualRpcEnum = Mod.valueForString(testRpc);
+ Mod actualMarEnum = Mod.valueForString(testMar);
+ Mod actualTranEnum = Mod.valueForString(testTran);
+ Mod actualProtoEnum = Mod.valueForString(testProto);
+ Mod actualProxyEnum = Mod.valueForString(testProxy);
+ Mod actualInvalidEnum = Mod.valueForString(testInvalid);
+ List<Mod> actualEnumList = Arrays.asList(Mod.values());
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedAppEnum, actualAppEnum);
+ assertEquals(Test.MATCH, expectedRpcEnum, actualRpcEnum);
+ assertEquals(Test.MATCH, expectedMarEnum, actualMarEnum);
+ assertEquals(Test.MATCH, expectedTranEnum, actualTranEnum);
+ assertEquals(Test.MATCH, expectedProtoEnum, actualProtoEnum);
+ assertEquals(Test.MATCH, expectedProxyEnum, actualProxyEnum);
+ assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
+
+ // Invalid/Null Tests
+ assertNull(Test.NULL, actualInvalidEnum);
+ assertNull(Test.NULL, actualNullEnum);
+
+ } catch (NullPointerException e) {
+ fail("Could not retrieve value for null string, should return null.");
+ } catch (IllegalArgumentException e) {
+ fail("Could not retrieve value for invalid string, should return null.");
+ }
+
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java
new file mode 100644
index 000000000..973cdaa16
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java
@@ -0,0 +1,43 @@
+package com.smartdevicelink.test.transport;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.BTTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.transport.BtTransportConfig}
+ */
+public class BTTransportConfigTests extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.transport.BtTransportConfig#getTransportType()}
+ * {@link com.smartdevicelink.transport.BtTransportConfig#setKeepSocketActive(boolean)}
+ * {@link com.smartdevicelink.transport.BtTransportConfig#getKeepSocketActive}
+ */
+ public void testConfigs () {
+
+ // Test Values
+ boolean testBoolean = true;
+ BTTransportConfig testConfig1 = new BTTransportConfig();
+ BTTransportConfig testConfig2 = new BTTransportConfig(testBoolean);
+
+ // Comparison Values
+ TransportType expectedTransportType = TransportType.BLUETOOTH;
+ boolean actualShareConnection = testConfig2.shareConnection();
+ TransportType actualTransportType = testConfig1.getTransportType();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedTransportType, actualTransportType);
+ assertTrue(Test.TRUE, actualShareConnection);
+
+
+ testConfig1.setKeepSocketActive(true);
+ assertTrue(Test.TRUE, testConfig1.getKeepSocketActive());
+ testConfig1.setKeepSocketActive(false);
+ assertFalse(Test.FALSE, testConfig1.getKeepSocketActive());
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java
new file mode 100644
index 000000000..6336851fe
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java
@@ -0,0 +1,50 @@
+package com.smartdevicelink.test.transport;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.transport.BaseTransportConfig}
+ */
+public class BaseTransportConfigTests extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.transport.BaseTransportConfig#getTransportType()}
+ * {@link com.smartdevicelink.transport.BaseTransportConfig#shareConnection()}
+ * {@link com.smartdevicelink.transport.BaseTransportConfig#getHeartBeatTimeout()}
+ * {@link com.smartdevicelink.transport.BaseTransportConfig#setHeartBeatTimeout(int)}
+ */
+ public void testConfigs () {
+
+ // Test Values
+ int testInt = 10;
+ MockBaseTransportConfig testBaseTransportConfig = new MockBaseTransportConfig();
+
+ // Comparison Values
+ int expectedMaxValue = Integer.MAX_VALUE;
+ boolean actualShareConnection = testBaseTransportConfig.shareConnection();
+ int actualMaxValue = testBaseTransportConfig.getHeartBeatTimeout();
+
+ // Valid Tests
+ assertNotNull(Test.NOT_NULL, testBaseTransportConfig);
+ assertEquals(Test.MATCH, expectedMaxValue, actualMaxValue);
+ assertTrue(Test.TRUE, actualShareConnection);
+
+ testBaseTransportConfig.setHeartBeatTimeout(testInt);
+ assertEquals(Test.MATCH, testInt, testBaseTransportConfig.getHeartBeatTimeout());
+ }
+}
+
+/**
+ * This is a mock class for testing the following :
+ * {@link com.smartdevicelink.transport.BaseTransportConfig}
+ */
+class MockBaseTransportConfig extends BaseTransportConfig {
+ public MockBaseTransportConfig () { }
+ @Override public TransportType getTransportType() { return null; }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java
index cdf83079c..cdf83079c 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java
index cb3de5670..cb3de5670 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexTransportConfigTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java
new file mode 100644
index 000000000..e6398853a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java
@@ -0,0 +1,98 @@
+package com.smartdevicelink.test.transport;
+
+import android.util.Log;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.WiProProtocol;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.SdlPsm;
+
+import junit.framework.TestCase;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.transport.SdlPsm}
+ */
+public class SdlPsmTests extends TestCase {
+ private static final String TAG = "SdlPsmTests";
+ private static final int MAX_DATA_LENGTH = WiProProtocol.V1_V2_MTU_SIZE - WiProProtocol.V1_HEADER_SIZE;
+ SdlPsm sdlPsm;
+ Field frameType, dataLength, version, controlFrameInfo;
+ Method transitionOnInput;
+ byte rawByte = (byte) 0x0;
+
+ protected void setUp() throws Exception{
+ super.setUp();
+ sdlPsm = new SdlPsm();
+ transitionOnInput = SdlPsm.class.getDeclaredMethod("transitionOnInput", byte.class, int.class);
+ transitionOnInput.setAccessible(true);
+
+ frameType = SdlPsm.class.getDeclaredField("frameType");
+ dataLength = SdlPsm.class.getDeclaredField("dataLength");
+ version = SdlPsm.class.getDeclaredField("version");
+ controlFrameInfo = SdlPsm.class.getDeclaredField("controlFrameInfo");
+ frameType.setAccessible(true);
+ dataLength.setAccessible(true);
+ version.setAccessible(true);
+ controlFrameInfo.setAccessible(true);
+ }
+
+ /**
+ * These are unit tests for the following methods :
+ * {@link com.smartdevicelink.transport.SdlPsm#transitionOnInput()}
+ */
+
+ public void testGarbledControlFrame() {
+ try{
+ rawByte = 0x0;
+ version.set(sdlPsm, 1);
+ controlFrameInfo.set(sdlPsm, SdlPacket.FRAME_INFO_START_SERVICE);
+ frameType.set(sdlPsm, SdlPacket.FRAME_TYPE_CONTROL);
+
+ dataLength.set(sdlPsm, MAX_DATA_LENGTH + 1);
+ int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE);
+
+ assertEquals(Test.MATCH, SdlPsm.ERROR_STATE, STATE);
+ }catch (Exception e){
+ Log.e(TAG, e.toString());
+ }
+ }
+
+ public void testMaximumControlFrame(){
+ try{
+ rawByte = 0x0;
+ version.set(sdlPsm, 1);
+ controlFrameInfo.set(sdlPsm, SdlPacket.FRAME_INFO_START_SERVICE);
+ frameType.set(sdlPsm, SdlPacket.FRAME_TYPE_CONTROL);
+
+ dataLength.set(sdlPsm, MAX_DATA_LENGTH);
+ int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE);
+
+ assertEquals(Test.MATCH, SdlPsm.DATA_PUMP_STATE, STATE);
+ }catch (Exception e){
+ Log.e(TAG, e.toString());
+ }
+ }
+
+ public void testOutOfMemoryDS4(){
+ try{
+ rawByte = 0x0;
+ version.set(sdlPsm, 1);
+ frameType.set(sdlPsm, SdlPacket.FRAME_TYPE_SINGLE);
+
+ dataLength.set(sdlPsm, 2147483647);
+ int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE);
+
+ assertEquals(Test.MATCH, SdlPsm.ERROR_STATE, STATE);
+ }catch (Exception e){
+ Log.e(TAG, e.toString());
+ }
+ }
+
+ protected void tearDown() throws Exception{
+ super.tearDown();
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java
index f08deea5a..f08deea5a 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java
new file mode 100644
index 000000000..62f5a322a
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java
@@ -0,0 +1,80 @@
+package com.smartdevicelink.test.transport;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.transport.enums.TransportType;
+
+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.transport.enums.TransportType}
+ */
+public class TransportTypeTests extends TestCase {
+
+ /**
+ * This is a unit test for the following enum :
+ * {@link com.smartdevicelink.transport.enums.TransportType}
+ */
+ public void testTransportTypeEnum () {
+
+ // Test Values
+ String testTcp = "TCP";
+ String testUsb = "USB";
+ String testInvalid = "INVALID";
+ String testBluetooth = "BLUETOOTH";
+ String testMultiplexing = "MULTIPLEX";
+ String testWebSocketServer = "WEB_SOCKET_SERVER";
+ String testCustom = "CUSTOM";
+
+ try {
+ // Comparison Values
+ TransportType expectedTcpEnum = TransportType.TCP;
+ TransportType expectedUsbEnum = TransportType.USB;
+ TransportType expectedBluetoothEnum = TransportType.BLUETOOTH;
+ TransportType expectedMultiplexingEnum = TransportType.MULTIPLEX;
+ TransportType expectedWebSocketServerEnum = TransportType.WEB_SOCKET_SERVER;
+ TransportType expectedCustomEnum = TransportType.CUSTOM;
+
+ List<TransportType> expectedEnumList = new ArrayList<TransportType>();
+ expectedEnumList.add(TransportType.BLUETOOTH);
+ expectedEnumList.add(TransportType.TCP);
+ expectedEnumList.add(TransportType.USB);
+ expectedEnumList.add(TransportType.MULTIPLEX);
+ expectedEnumList.add(TransportType.WEB_SOCKET_SERVER);
+ expectedEnumList.add(TransportType.CUSTOM);
+
+ TransportType actualNullEnum = TransportType.valueForString(null);
+ TransportType actualTcpEnum = TransportType.valueForString(testTcp);
+ TransportType actualUsbEnum = TransportType.valueForString(testUsb);
+ TransportType actualInvalidEnum = TransportType.valueForString(testInvalid);
+ TransportType actualBluetoothEnum = TransportType.valueForString(testBluetooth);
+ TransportType actualMultiplexingEnum = TransportType.valueForString(testMultiplexing);
+ TransportType actualWebSocketServerEnum = TransportType.valueForString(testWebSocketServer);
+ TransportType actualCustomEnum = TransportType.valueForString(testCustom);
+
+ List<TransportType> actualEnumList = Arrays.asList(TransportType.values());
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedTcpEnum, actualTcpEnum);
+ assertEquals(Test.MATCH, expectedUsbEnum, actualUsbEnum);
+ assertEquals(Test.MATCH, expectedBluetoothEnum, actualBluetoothEnum);
+ assertEquals(Test.MATCH, expectedMultiplexingEnum, actualMultiplexingEnum);
+ assertEquals(Test.MATCH, expectedWebSocketServerEnum, actualWebSocketServerEnum);
+ assertEquals(Test.MATCH, expectedCustomEnum, actualCustomEnum);
+ assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
+
+ // Invalid/Null Tests
+ assertNull(Test.NULL, actualInvalidEnum);
+ assertNull(Test.NULL, actualNullEnum);
+
+ } catch (NullPointerException e) {
+ fail("Could not retrieve value for null string, should return null.");
+ } catch (IllegalArgumentException e) {
+ fail("Could not retrieve value for invalid string, should return null.");
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/WiFiSocketFactoryTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/WiFiSocketFactoryTest.java
index ab2b7b52d..ab2b7b52d 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/WiFiSocketFactoryTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/WiFiSocketFactoryTest.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java
index fb6eed3f9..fb6eed3f9 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java
new file mode 100644
index 000000000..b056d4fdf
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java
@@ -0,0 +1,96 @@
+package com.smartdevicelink.test.util;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.util.ByteEnumer;
+
+import junit.framework.TestCase;
+
+import java.util.Vector;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.util.ByteEnumer}
+ */
+public class ByteEnumerTests extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.util.ByteEnumer#value()}
+ * {@link com.smartdevicelink.util.ByteEnumer#getValue()}
+ * {@link com.smartdevicelink.util.ByteEnumer#getName()}
+ * {@link com.smartdevicelink.util.ByteEnumer#equals(ByteEnumer)}
+ * {@link com.smartdevicelink.util.ByteEnumer#eq(ByteEnumer)}
+ */
+ public void testStoredValues () {
+
+ // Test Values
+ byte testByte = (byte) 0x01;
+ String testString = "test";
+ MockByteEnumer testObject = new MockByteEnumer(testByte, null);
+
+ // Comparison Values
+ MockByteEnumer expectedObject = new MockByteEnumer(testByte, testString);
+ MockByteEnumer actualObject = new MockByteEnumer(testByte, testString);
+ byte actualByte1 = expectedObject.getValue();
+ byte actualByte2 = expectedObject.value();
+ String actualString = expectedObject.getName();
+ String actualNullString = testObject.getName();
+
+ // Valid Tests
+ assertNotNull(Test.NOT_NULL, expectedObject);
+ assertEquals(Test.MATCH, testByte, actualByte1);
+ assertEquals(Test.MATCH, testByte, actualByte2);
+ assertEquals(Test.MATCH, testString, actualString);
+ assertTrue(Test.TRUE, actualObject.equals(expectedObject));
+ assertTrue(Test.TRUE, actualObject.eq(expectedObject));
+
+ // Invalid/Null Tests
+ assertNull(Test.NULL, actualNullString);
+ }
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.util.ByteEnumer#get(Vector, byte)}
+ * {@link com.smartdevicelink.util.ByteEnumer#get(Vector, String)}
+ */
+ public void testSearchMethods () {
+
+ // Test Values
+ byte testByte1 = (byte) 0x01;
+ byte testByte2 = (byte) 0x02;
+ String testString1 = "test_1";
+ String testString2 = "test_2";
+ Vector<ByteEnumer> testList = new Vector<ByteEnumer>();
+ Vector<String> testInvalidList = new Vector<String>();
+
+ // Comparison Values
+ MockByteEnumer expectedObject1 = new MockByteEnumer(testByte1, testString1);
+ MockByteEnumer expectedObject2 = new MockByteEnumer(testByte2, testString2);
+
+ testList.add(expectedObject1);
+ testList.add(expectedObject2);
+ testInvalidList.add(testString1);
+ testInvalidList.add(testString2);
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedObject1, ByteEnumer.get(testList, testByte1));
+ assertEquals(Test.MATCH, expectedObject1, ByteEnumer.get(testList, testString1));
+ assertEquals(Test.MATCH, expectedObject2, ByteEnumer.get(testList, testByte2));
+ assertEquals(Test.MATCH, expectedObject2, ByteEnumer.get(testList, testString2));
+
+ // Invalid/Null Tests
+ assertNull(Test.NULL, ByteEnumer.get(testList, null));
+ assertNull(Test.NULL, ByteEnumer.get(testInvalidList, testByte1));
+ assertNull(Test.NULL, ByteEnumer.get(testInvalidList, testString1));
+ }
+}
+
+/**
+ * This is a mock class for testing the following :
+ * {@link com.smartdevicelink.util.ByteEnumer}
+ */
+class MockByteEnumer extends ByteEnumer {
+ protected MockByteEnumer(byte value, String name) {
+ super(value, name);
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java
new file mode 100644
index 000000000..d4fbacee0
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java
@@ -0,0 +1,28 @@
+package com.smartdevicelink.test.util;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.util.DebugTool;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.util.DebugTool}
+ */
+public class DebugToolTests extends TestCase {
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.util.DebugTool#enableDebugTool()}
+ * {@link com.smartdevicelink.util.DebugTool#disableDebugTool()}
+ * {@link com.smartdevicelink.util.DebugTool#isDebugEnabled()}
+ */
+ public void testDebugEnableMethods () {
+ DebugTool.enableDebugTool();
+ assertTrue(Test.TRUE, DebugTool.isDebugEnabled());
+ DebugTool.disableDebugTool();
+ assertFalse(Test.FALSE, DebugTool.isDebugEnabled());
+ }
+
+ // NOTE : No testing can currently be done for the logging methods.
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DeviceUtil.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DeviceUtil.java
index 389403eaf..389403eaf 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DeviceUtil.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DeviceUtil.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java
new file mode 100644
index 000000000..38ab8a67f
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java
@@ -0,0 +1,77 @@
+package com.smartdevicelink.test.util;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.util.NativeLogTool;
+
+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.util.NativeLogTool}
+ */
+public class NativeLogToolTests extends TestCase {
+
+ /**
+ * This is a unit test for the following enum :
+ * {@link com.smartdevicelink.util.NativeLogTool.LogTarget}
+ */
+ public void testLogTargetEnum () {
+
+ // Test Values
+ String testInfo = "Info";
+ String testError = "Error";
+ String testInvalid = "Invalid";
+ String testWarning = "Warning";
+
+ try {
+ // Comparison Values
+ NativeLogTool.LogTarget expectedInfoEnum = NativeLogTool.LogTarget.Info;
+ NativeLogTool.LogTarget expectedErrorEnum = NativeLogTool.LogTarget.Error;
+ NativeLogTool.LogTarget expectedWarningEnum = NativeLogTool.LogTarget.Warning;
+ List<NativeLogTool.LogTarget> expectedEnumList = new ArrayList<NativeLogTool.LogTarget>();
+ expectedEnumList.add(NativeLogTool.LogTarget.Info);
+ expectedEnumList.add(NativeLogTool.LogTarget.Error);
+ expectedEnumList.add(NativeLogTool.LogTarget.Warning);
+
+ NativeLogTool.LogTarget actualNullEnum = NativeLogTool.LogTarget.valueForString(null);
+ NativeLogTool.LogTarget actualInfoEnum = NativeLogTool.LogTarget.valueForString(testInfo);
+ NativeLogTool.LogTarget actualErrorEnum = NativeLogTool.LogTarget.valueForString(testError);
+ NativeLogTool.LogTarget actualInvalidEnum = NativeLogTool.LogTarget.valueForString(testInvalid);
+ NativeLogTool.LogTarget actualWarningEnum = NativeLogTool.LogTarget.valueForString(testWarning);
+ List<NativeLogTool.LogTarget> actualEnumList = Arrays.asList(NativeLogTool.LogTarget.values());
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedInfoEnum, actualInfoEnum);
+ assertEquals(Test.MATCH, expectedErrorEnum, actualErrorEnum);
+ assertEquals(Test.MATCH, expectedWarningEnum, actualWarningEnum);
+ assertTrue("Contents should match.", expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
+
+ // Invalid/Null Tests
+ assertNull(Test.NULL, actualInvalidEnum);
+ assertNull(Test.NULL, actualNullEnum);
+
+ } catch (NullPointerException e) {
+ fail("Could not retrieve value for null string, should return null.");
+ } catch (IllegalArgumentException e) {
+ fail("Could not retrieve value for invalid string, should return null.");
+ }
+ }
+
+ /**
+ * This is a unit test for the following methods :
+ * {@link com.smartdevicelink.util.NativeLogTool#setEnableState(boolean)}
+ * {@link com.smartdevicelink.util.NativeLogTool#getEnableState()}
+ */
+ public void testEnabled () {
+ NativeLogTool.setEnableState(false);
+ assertFalse("Value should be false.", NativeLogTool.isEnabled());
+ NativeLogTool.setEnableState(true);
+ assertTrue("Valueshould be true.", NativeLogTool.isEnabled());
+ }
+
+ // NOTE : No testing can currently be done for the logging methods.
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java
index 027de8b2c..027de8b2c 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java
new file mode 100644
index 000000000..2792608c6
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java
@@ -0,0 +1,46 @@
+package com.smartdevicelink.test.util;
+
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import junit.framework.TestCase;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.util.SdlDataTypeConverter}
+ */
+public class SdlDataTypeConverterTests extends TestCase {
+
+ /**
+ * This is a unit test for the following method :
+ * {@link com.smartdevicelink.util.SdlDataTypeConverter#objectToDouble(Object)}
+ */
+ public void testObjectToDouble () {
+
+ // Test Values
+ Long testLong = Long.valueOf(1);
+ Short testShort = 1;
+ Float testFloat = 1f;
+ Double testDouble = 1.0;
+ Integer testInteger = 1;
+
+ // Comparison Values
+ Double expectedValue = 1.0;
+ Double actualNullValue = SdlDataTypeConverter.objectToDouble(null);
+ Double actualLongValue = SdlDataTypeConverter.objectToDouble(testLong);
+ Double actualShortValue = SdlDataTypeConverter.objectToDouble(testShort);
+ Double actualFloatValue = SdlDataTypeConverter.objectToDouble(testFloat);
+ Double actualDoubleValue = SdlDataTypeConverter.objectToDouble(testDouble);
+ Double actualIntegerValue = SdlDataTypeConverter.objectToDouble(testInteger);
+
+ // Valid Tests
+ assertEquals(Test.MATCH, expectedValue, actualDoubleValue);
+ assertEquals(Test.MATCH, expectedValue, actualIntegerValue);
+ assertEquals(Test.MATCH, expectedValue, actualFloatValue);
+
+ // Null Tests
+ assertNull(Test.NULL, actualNullValue);
+ assertNull(Test.NULL, actualLongValue);
+ assertNull(Test.NULL, actualShortValue);
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java
index 4798de56b..4798de56b 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/VersionTest.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java
new file mode 100644
index 000000000..8b93b41b7
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java
@@ -0,0 +1,33 @@
+package com.smartdevicelink.test.utl;
+
+import android.content.ComponentName;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.util.AndroidTools;
+
+import junit.framework.Assert;
+
+public class AndroidToolsTests extends AndroidTestCase2 {
+
+
+ public void testIsServiceExportedNormal(){
+
+ try{
+ AndroidTools.isServiceExported(mContext, new ComponentName(mContext, "test"));
+ }catch(Exception e){
+ Assert.fail("Exception during normal test: " + e.getMessage());
+ }
+
+ }
+ public void testIsServiceExportedNull(){
+
+ try{
+ AndroidTools.isServiceExported(mContext, null);
+ Assert.fail("Proccessed null data");
+ }catch(Exception e){
+
+ }
+
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AppServiceFactory.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AppServiceFactory.java
new file mode 100644
index 000000000..108d6e457
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AppServiceFactory.java
@@ -0,0 +1,75 @@
+package com.smartdevicelink.test.utl;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.rpc.AppServiceCapability;
+import com.smartdevicelink.proxy.rpc.AppServiceManifest;
+import com.smartdevicelink.proxy.rpc.AppServiceRecord;
+import com.smartdevicelink.proxy.rpc.MediaServiceManifest;
+import com.smartdevicelink.proxy.rpc.NavigationServiceManifest;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.WeatherServiceManifest;
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason;
+import com.smartdevicelink.test.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AppServiceFactory {
+
+
+ public static AppServiceManifest createAppServiceManifest(AppServiceType type, String serviceName){
+ AppServiceManifest manifest = new AppServiceManifest();
+
+ manifest.setServiceName(serviceName);
+ manifest.setRpcSpecVersion(new SdlMsgVersion(Test.MAX_RPC_VERSION_SUPPORTED));
+ manifest.setAllowAppConsumers(true);
+ List<FunctionID> handledRPCs = new ArrayList<>();
+
+ switch (type){
+ case MEDIA:
+ handledRPCs.add(FunctionID.BUTTON_PRESS);
+ manifest.setMediaServiceManifest(new MediaServiceManifest());
+ break;
+ case WEATHER:
+ WeatherServiceManifest weatherServiceManifest = new WeatherServiceManifest();
+ weatherServiceManifest.setCurrentForecastSupported(true);
+ weatherServiceManifest.setMaxHourlyForecastAmount(6);
+ weatherServiceManifest.setMaxMinutelyForecastAmount(30);
+ weatherServiceManifest.setMaxMultidayForecastAmount(5);
+ weatherServiceManifest.setWeatherForLocationSupported(true);
+ manifest.setWeatherServiceManifest(weatherServiceManifest);
+ break;
+ case NAVIGATION:
+ handledRPCs.add(FunctionID.SEND_LOCATION);
+ handledRPCs.add(FunctionID.GET_WAY_POINTS);
+ handledRPCs.add(FunctionID.SUBSCRIBE_VEHICLE_DATA);
+ handledRPCs.add(FunctionID.UNSUBSCRIBE_VEHICLE_DATA);
+
+ NavigationServiceManifest navigationServiceManifest = new NavigationServiceManifest();
+ navigationServiceManifest.setAcceptsWayPoints(true);
+ manifest.setNavigationServiceManifest(navigationServiceManifest);
+ break;
+ }
+
+ manifest.setHandledRpcsUsingFunctionIDs(handledRPCs);
+
+ return manifest;
+ }
+
+ public static AppServiceRecord createAppServiceRecord(AppServiceType type, String serviceName, String serviceID, boolean isActive){
+ AppServiceRecord appServiceRecord = new AppServiceRecord();
+ appServiceRecord.setServiceManifest(createAppServiceManifest(type,serviceName));
+ appServiceRecord.setServiceID(serviceID);
+ appServiceRecord.setServiceActive(isActive);
+ appServiceRecord.setServicePublished(true);
+ return appServiceRecord;
+ }
+
+ public static AppServiceCapability createAppServiceCapability(AppServiceType type, String serviceName, String serviceID, boolean isActive, ServiceUpdateReason updateReason){
+ AppServiceCapability appServiceCapability = new AppServiceCapability();
+ appServiceCapability.setUpdatedAppServiceRecord(createAppServiceRecord(type,serviceName,serviceID,isActive));
+ appServiceCapability.setUpdateReason(updateReason);
+ return appServiceCapability;
+ }
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java
index 10aa25d75..10aa25d75 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java
index 9551a5a6f..9551a5a6f 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java
new file mode 100644
index 000000000..a6bc846fe
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java
@@ -0,0 +1,431 @@
+package com.smartdevicelink.transport;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.util.Log;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.transport.RouterServiceValidator.TrustedAppStore;
+import com.smartdevicelink.util.HttpRequestTask.HttpRequestTaskCallback;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.concurrent.Semaphore;
+
+public class RSVTestCase extends AndroidTestCase2 {
+ private static final String TAG = "RSVTestCase";
+
+ private static final long REFRESH_TRUSTED_APP_LIST_TIME_DAY = 3600000 * 24; // A day in ms
+ private static final long REFRESH_TRUSTED_APP_LIST_TIME_WEEK = REFRESH_TRUSTED_APP_LIST_TIME_DAY * 7; // A week in ms
+ private static final long REFRESH_TRUSTED_APP_LIST_TIME_MONTH = REFRESH_TRUSTED_APP_LIST_TIME_DAY * 30; // A ~month in ms
+ private static final String TEST = "{\"response\": {\"com.livio.sdl\" : { \"versionBlacklist\":[] }, \"com.lexus.tcapp\" : { \"versionBlacklist\":[] }, \"com.toyota.tcapp\" : { \"versionBlacklist\": [] } , \"com.sdl.router\":{\"versionBlacklist\": [] },\"com.ford.fordpass\" : { \"versionBlacklist\":[] } }}";
+ RouterServiceValidator rsvp;
+ /**
+ * Set this boolean if you want to test the actual validation of router service
+ */
+ boolean liveTest = false;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ rsvp = new RouterServiceValidator(this.mContext);
+
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private static final Semaphore TRUSTED_LIST_LOCK = new Semaphore(1);
+
+ private void requestTListLock(){
+ try {
+ TRUSTED_LIST_LOCK.acquire();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void releaseTListLock(){
+ TRUSTED_LIST_LOCK.release();
+ }
+
+ private RouterServiceValidator.TrustedListCallback trustedListCallback = new RouterServiceValidator.TrustedListCallback(){
+ @Override
+ public void onListObtained(boolean successful) {
+ releaseTListLock();
+ }
+ };
+
+/*
+ * These tests are a little strange because they don't test the logic behind the validation of each piece.
+ * However, they allow us to test
+ */
+
+ public void testInstalledFrom(){
+ if(liveTest){
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
+ assertTrue(rsvp.validate());
+ }
+ }
+
+ public void testPackageCheck(){
+ if(liveTest){
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_PACKAGE_CHECK);
+ assertTrue(rsvp.validate());
+ }
+ }
+
+ public void testVersionCheck(){
+ if(liveTest){
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
+ assertTrue(rsvp.validate());
+ }
+ }
+
+ public void testNoFlags(){
+ if(liveTest){
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE);
+ assertTrue(rsvp.validate());
+ }
+ }
+
+ public void testAllFlags(){
+ if(liveTest){
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_PERFORM_ALL_CHECKS);
+ assertTrue(rsvp.validate());
+ }
+ }
+
+ public void testSecuritySetting(){
+
+ RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
+ rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
+
+ try{
+ Field securityLevelField = RouterServiceValidator.class.getDeclaredField("securityLevel");
+ securityLevelField.setAccessible(true);
+ assertEquals(securityLevelField.get(rsvp),MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
+ }catch(NoSuchFieldException e1){
+ fail(e1.getMessage());
+ }catch( IllegalAccessException e2){
+ fail(e2.getMessage());
+ }
+ assertEquals(RouterServiceValidator.getSecurityLevel(mContext), MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
+ }
+
+ public void testHighSecurity(){
+ requestTListLock();
+
+ RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
+ rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
+
+ assertTrue(checkShouldOverrideInstalledFrom(rsvp,false));
+
+ assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK);
+
+ assertTrue(RouterServiceValidator.createTrustedListRequest(mContext, true, null, trustedListCallback));
+
+ }
+
+ public void testMediumSecurity(){
+ requestTListLock();
+
+ RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
+ rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED);
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
+
+ assertTrue(checkShouldOverrideInstalledFrom(rsvp,true));
+
+ assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK);
+
+ assertTrue(RouterServiceValidator.createTrustedListRequest(mContext, true, null, trustedListCallback));
+
+ }
+
+ public void testLowSecurity(){
+ requestTListLock();
+
+ RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
+ rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_LOW);
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
+
+ assertTrue(checkShouldOverrideInstalledFrom(rsvp,true));
+
+ assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_MONTH);
+
+ assertTrue(RouterServiceValidator.createTrustedListRequest(mContext, true, null, trustedListCallback));
+
+ }
+
+ public void testNoSecurity(){
+ requestTListLock();
+
+ RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
+ rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF);
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
+
+ assertTrue(checkShouldOverrideInstalledFrom(rsvp,true));
+
+ assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK);
+
+ assertFalse(RouterServiceValidator.createTrustedListRequest(mContext, true, null, trustedListCallback));
+
+ //This should always return true
+ assertTrue(rsvp.validate());
+
+ }
+
+ public boolean checkShouldOverrideInstalledFrom(RouterServiceValidator rsvp, boolean shouldOverride){
+ try{
+ Method shouldOverrideInstalledFrom = RouterServiceValidator.class.getDeclaredMethod("shouldOverrideInstalledFrom");
+ shouldOverrideInstalledFrom.setAccessible(true);
+ boolean should = (Boolean)shouldOverrideInstalledFrom.invoke(rsvp);
+
+ return shouldOverride == should;
+
+ }catch(NoSuchMethodException e1){
+ fail(e1.getMessage());
+ }catch( IllegalAccessException e2){
+ fail(e2.getMessage());
+ }catch( InvocationTargetException e3){
+ fail(e3.getMessage());
+ }
+ return false;
+ }
+
+ public void testJsonRecovery(){
+ assertNotNull(rsvp.stringToJson(null));
+ assertNotNull(rsvp.stringToJson("asdf235vq32{]]"));
+
+ }
+
+ public void testInvalidateList(){
+ requestTListLock();
+
+ assertFalse(RouterServiceValidator.invalidateList(null));
+ assertTrue(RouterServiceValidator.invalidateList(mContext));
+
+ releaseTListLock();
+ }
+
+ public void testGetTrustedList(){
+ requestTListLock();
+
+ assertNull(RouterServiceValidator.getTrustedList(null));
+ assertNotNull(RouterServiceValidator.getTrustedList(mContext));
+
+ releaseTListLock();
+ }
+
+ public void testSetTrustedList(){
+ requestTListLock();
+
+ assertFalse(RouterServiceValidator.setTrustedList(null,null));
+ assertFalse(RouterServiceValidator.setTrustedList(mContext,null));
+ assertFalse(RouterServiceValidator.setTrustedList(null,"test"));
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,"test"));
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,TEST));
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,TEST+TEST+TEST+TEST+TEST));
+ StringBuilder builder = new StringBuilder();
+ for(int i = 0; i<1000; i++){
+ builder.append(TEST);
+ }
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,builder.toString()));
+
+ releaseTListLock();
+ }
+
+ public void testTrustedListSetAndGet(){
+ requestTListLock();
+
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,TEST));
+ String retVal = RouterServiceValidator.getTrustedList(mContext);
+ assertNotNull(retVal);
+ assertTrue(TEST.equals(retVal));
+
+ StringBuilder builder = new StringBuilder();
+ for(int i = 0; i<1000; i++){
+ builder.append(TEST);
+ }
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,builder.toString()));
+ retVal = RouterServiceValidator.getTrustedList(mContext);
+ assertNotNull(retVal);
+ assertTrue(builder.toString().equals(retVal));
+
+ releaseTListLock();
+ }
+
+ public void testInvalidationSequence(){
+ requestTListLock();
+
+ assertTrue(RouterServiceValidator.invalidateList(mContext));
+ assertTrue(RouterServiceValidator.createTrustedListRequest(mContext, false, null, trustedListCallback));
+ }
+
+ public void testAppStorePackages(){
+ assertTrue(TrustedAppStore.isTrustedStore(TrustedAppStore.PLAY_STORE.packageString));
+ assertTrue(TrustedAppStore.isTrustedStore("com.xiaomi.market"));
+ assertFalse(TrustedAppStore.isTrustedStore("test"));
+ assertFalse(TrustedAppStore.isTrustedStore(null));
+
+ rsvp = new RouterServiceValidator(this.mContext);
+ rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
+ rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
+
+ PackageManager packageManager = mContext.getPackageManager();
+ List<PackageInfo> packages = packageManager.getInstalledPackages(0);
+ String appStore;
+ for(PackageInfo info: packages){
+ appStore = packageManager.getInstallerPackageName(info.packageName);
+ if(TrustedAppStore.isTrustedStore(appStore)){
+ assertTrue(rsvp.wasInstalledByAppStore(info.packageName));
+ }
+ }
+
+ assertFalse(rsvp.wasInstalledByAppStore(null));
+ }
+
+ public void testVersionBlackList(){
+ rsvp = new RouterServiceValidator(this.mContext);
+ JSONArray array = new JSONArray();
+ for(int i=0; i<25; i++){
+ if(i%3 == 0){
+ array.put(i);
+ }
+ }
+ assertTrue(rsvp.verifyVersion(1, null));
+ assertTrue(rsvp.verifyVersion(1, array));
+ assertTrue(rsvp.verifyVersion(100, array));
+ assertFalse(rsvp.verifyVersion(3, array));
+ assertFalse(rsvp.verifyVersion(-3, array));
+
+ }
+
+ static boolean didFinish = false;
+ public void testGetAndCheckList(){
+ requestTListLock();
+
+ final Object REQUEST_LOCK = new Object();
+ didFinish = false;
+ HttpRequestTaskCallback cb = new HttpRequestTaskCallback(){
+
+ @Override
+ public void httpCallComplete(String response) {
+ //Might want to check if this list is ok
+ Log.d(TAG, "APPS! " + response);
+ synchronized(REQUEST_LOCK){
+ didFinish = true;
+ REQUEST_LOCK.notify();
+ }
+ releaseTListLock();
+ }
+ @Override
+ public void httpFailure(int statusCode) {
+ Log.e(TAG, "Error while requesting trusted app list: " + statusCode);
+ synchronized(REQUEST_LOCK){
+ didFinish = true;
+ REQUEST_LOCK.notify();
+ }
+ releaseTListLock();
+ }
+ };
+
+ assertTrue(RouterServiceValidator.createTrustedListRequest(mContext,true, cb));
+ //Now wait for call to finish
+ synchronized(REQUEST_LOCK){
+ try {
+ REQUEST_LOCK.wait();
+ assertTrue(didFinish);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ }
+
+ /**
+ * Test to check that we can save our last request which actually houses all the previous known sdl enabled apps
+ */
+ public void testRequestChange(){
+ requestTListLock();
+
+ RouterServiceValidator.setLastRequest(mContext, null);
+ assertNull(RouterServiceValidator.getLastRequest(mContext));
+
+ JSONObject object = null;
+ try {
+ object = new JSONObject(TEST);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(object);
+ assertFalse(object.equals(RouterServiceValidator.getLastRequest(mContext)));
+
+ assertTrue(RouterServiceValidator.setLastRequest(mContext, object.toString()));
+
+ String oldRequest = RouterServiceValidator.getLastRequest(mContext);
+ assertNotNull(oldRequest);
+ assertTrue(object.toString().equals(oldRequest));
+
+ //Now test a new list
+ String test = "{\"response\": {\"com.livio.sdl\" : { \"versionBlacklist\":[] }, \"com.lexus.tcapp\" : { \"versionBlacklist\":[] }, \"com.test.test\" : { \"versionBlacklist\":[] },\"com.toyota.tcapp\" : { \"versionBlacklist\": [] } , \"com.sdl.router\":{\"versionBlacklist\": [] },\"com.ford.fordpass\" : { \"versionBlacklist\":[] } }}";
+ object = null;
+ try {
+ object = new JSONObject(test);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(object);
+ assertFalse(object.equals(RouterServiceValidator.getLastRequest(mContext)));
+ //Clear it for next test
+ RouterServiceValidator.setLastRequest(mContext, null);
+
+ releaseTListLock();
+ }
+
+ /**
+ * Test app's router validation. Validation should fail when the given context and ComponentName object are from different packages and security setting is not OFF
+ * and app is not on trusted list. Validation should pass when the given context and ComponentName object are from the same package.
+ */
+ public void testAppSelfValidation() {
+
+ class RouterServiceValidatorTest extends RouterServiceValidator{
+ public RouterServiceValidatorTest(Context context){
+ super(context);
+ }
+
+ public RouterServiceValidatorTest(Context context, ComponentName service){
+ super(context, service);
+ }
+
+ // Override this method and simply returning true for the purpose of this test
+ protected boolean isServiceRunning(Context context, ComponentName service){
+ return true;
+ }
+ }
+
+ // Fail, different package name for context and service and app security setting is not OFF and app is not on trusted list
+ RouterServiceValidatorTest rsvpFail = new RouterServiceValidatorTest(this.mContext, new ComponentName("anything", mContext.getClass().getSimpleName()));
+ rsvpFail.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
+ assertFalse(rsvpFail.validate());
+
+ // Success, same package name for context and service
+ RouterServiceValidatorTest rsvpPass = new RouterServiceValidatorTest(this.mContext, new ComponentName(mContext.getPackageName(), mContext.getClass().getSimpleName()));
+ rsvpPass.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
+ assertTrue(rsvpPass.validate());
+ }
+
+
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java
index 89dbae3ab..89dbae3ab 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java
new file mode 100644
index 000000000..e01fdbaf2
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java
@@ -0,0 +1,699 @@
+package com.smartdevicelink.transport;
+
+
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.util.Log;
+import android.util.SparseArray;
+import android.util.SparseIntArray;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.BinaryFrameHeader;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.SdlPacketFactory;
+import com.smartdevicelink.protocol.enums.ControlFrameTags;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import junit.framework.Assert;
+
+import org.mockito.ArgumentCaptor;
+
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Vector;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class SdlRouterServiceTests extends AndroidTestCase2 {
+
+ public static final String TAG = "SdlRouterServiceTests";
+ private final int SAMPLE_RPC_CORRELATION_ID = 630;
+ int version = 1;
+ int sessionId = 1;
+ ProtocolMessage pm = null;
+ BinaryFrameHeader binFrameHeader = null;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ //Nothing here for now
+ }
+
+ /**
+ * Ensure that the router service hardcoded number is the same as the integer value in
+ * the resources.
+ */
+ public void testVersionCorrectness(){
+ int resourceVersion = getContext().getResources().getInteger(com.smartdevicelink.test.R.integer.sdl_router_service_version_value);
+ assertEquals(resourceVersion, SdlRouterService.ROUTER_SERVICE_VERSION_NUMBER);
+ }
+
+ /**
+ * Test null bundle handling in AltTransportHandler when handling messages. Only test the case of
+ * msg.what == TransportConstants.ROUTER_RECEIVED_PACKET
+ */
+ public void testAlTransportHandlerHandleNullBundle() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ class AltTransportHandler extends Handler {
+ ClassLoader loader;
+ final WeakReference<SdlRouterService> provider;
+
+ public AltTransportHandler(SdlRouterService provider) {
+ this.provider = new WeakReference<SdlRouterService>(provider);
+ loader = getClass().getClassLoader();
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ SdlRouterService service = this.provider.get();
+ Bundle receivedBundle = msg.getData();
+ switch (msg.what) {
+ case TransportConstants.ROUTER_RECEIVED_PACKET:
+ if (receivedBundle != null) {
+ receivedBundle.setClassLoader(loader);//We do this because loading a custom parceable object isn't possible without it
+ if (receivedBundle.containsKey(TransportConstants.FORMED_PACKET_EXTRA_NAME)) {
+ SdlPacket packet = receivedBundle.getParcelable(TransportConstants.FORMED_PACKET_EXTRA_NAME);
+ if (packet != null && service != null) {
+ service.onPacketRead(packet);
+ } else {
+ Log.w(TAG, "Received null packet from alt transport service");
+ }
+ } else {
+ Log.w(TAG, "Flase positive packet reception");
+ }
+ } else {
+ Log.e(TAG, "Bundle was null while sending packet to router service from alt transport");
+ }
+ break;
+ default:
+ super.handleMessage(msg);
+ }
+
+ }
+ }
+ AltTransportHandler testHandler = new AltTransportHandler(null);
+ Message msg = Message.obtain(null, TransportConstants.ROUTER_RECEIVED_PACKET);
+ //Send a null bundle
+ msg.setData(null);
+ try {
+ testHandler.handleMessage(msg);
+ } catch (Exception e) {
+ Assert.fail("Exception in testAlTransportHandlerHandleNullBundle, " + e);
+ }
+ }
+
+ /**
+ * Test writeBytesToTransport method for handling null byte array in bundle
+ *
+ * @see SdlRouterService#writeBytesToTransport(Bundle)
+ */
+ public void testWriteBytesToTransport() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ Method method;
+ Field field = null;
+ Object sdlRouterService = null;
+ try {
+ sdlRouterService = Class.forName("com.smartdevicelink.transport.SdlRouterService").newInstance();
+ //Send a null bundle
+ method = SdlRouterService.class.getDeclaredMethod("writeBytesToTransport", Bundle.class);
+ Bundle bundle = null;
+ method.invoke(sdlRouterService, bundle);
+
+ //Send a non-null bundle with a null bytes array
+ //First, set mSerialService to the correct state so we get to test packet being null
+ MultiplexBluetoothTransport transport = new MultiplexBluetoothTransport(null);
+ transport.setStateManually(MultiplexBluetoothTransport.STATE_CONNECTED);
+ field = SdlRouterService.class.getDeclaredField("bluetoothTransport");
+ field.setAccessible(true);
+ field.set(sdlRouterService, transport);
+ bundle = new Bundle();
+ bundle.putByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME, null);
+ method.invoke(sdlRouterService, bundle);
+ } catch (Exception e) {
+ Assert.fail("Exception in testWriteBytesToTransport, " + e);
+ }
+
+ //Return mSerialService to previous state
+ if (field != null && sdlRouterService != null) {
+ try {
+ field.set(sdlRouterService, null);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Test sending UAI to an app whose session id is the same as a removed app
+ * but is indeed a different app
+ *
+ * @see SdlRouterService#sendPacketToRegisteredApp(SdlPacket)
+ */
+ public void testRegisterAppExistingSessionIDDifferentApp() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ Method method;
+ try {
+ // create instance of router service
+ SdlRouterService sdlRouterService = new SdlRouterService();
+
+ // We need a registered app for this to work
+ Message message = Message.obtain();
+ SdlRouterService.RegisteredApp app1 = sdlRouterService.new RegisteredApp("12345",message.replyTo);
+ SdlRouterService.RegisteredApp app2 = sdlRouterService.new RegisteredApp("12344",message.replyTo);
+ HashMap<String,SdlRouterService.RegisteredApp> registeredApps = new HashMap<>();
+ registeredApps.put(app1.getAppId(),app1);
+ registeredApps.put(app2.getAppId(),app2);
+
+ // set registered apps array
+ Field raf = sdlRouterService.getClass().getDeclaredField("registeredApps");
+ raf.setAccessible(true);
+ raf.set(sdlRouterService, registeredApps);
+
+ // need a session map too
+ SparseArray<String> sessionMap = new SparseArray<String>();
+ sessionMap.put(1, "12345");
+ Field sessionMapField = sdlRouterService.getClass().getDeclaredField("bluetoothSessionMap");
+ sessionMapField.setAccessible(true);
+ sessionMapField.set(sdlRouterService, sessionMap);
+
+ // set cleaned session map
+ SparseIntArray testCleanedMap = new SparseIntArray();
+ testCleanedMap.put(1, 12345);
+ Field f = sdlRouterService.getClass().getDeclaredField("cleanedSessionMap");
+ f.setAccessible(true);
+ f.set(sdlRouterService, testCleanedMap);
+
+ // set session hash id map
+ SparseIntArray testHashIdMap = new SparseIntArray();
+ testHashIdMap.put(1, 12344);
+ Field f2 = sdlRouterService.getClass().getDeclaredField("sessionHashIdMap");
+ f2.setAccessible(true);
+ f2.set(sdlRouterService, testHashIdMap);
+
+ // make sure maps are set and NOT the same
+ Assert.assertNotNull(raf.get(sdlRouterService));
+ Assert.assertNotNull(sessionMapField.get(sdlRouterService));
+ Assert.assertNotNull(f.get(sdlRouterService));
+ Assert.assertNotNull(f2.get(sdlRouterService));
+
+ // make da RPC
+ UnregisterAppInterface request = new UnregisterAppInterface();
+ request.setCorrelationID(SAMPLE_RPC_CORRELATION_ID);
+
+ // build protocol message
+ byte[] msgBytes = JsonRPCMarshaller.marshall(request, (byte) version);
+ pm = new ProtocolMessage();
+ pm.setData(msgBytes);
+ pm.setSessionID((byte) sessionId);
+ pm.setMessageType(MessageType.RPC);
+ pm.setSessionType(SessionType.RPC);
+ pm.setFunctionID(FunctionID.getFunctionId(request.getFunctionName()));
+ pm.setCorrID(request.getCorrelationID());
+
+ if (request.getBulkData() != null) {
+ pm.setBulkData(request.getBulkData());
+ }
+
+ // binary frame header
+ byte[] data = new byte[12 + pm.getJsonSize()];
+ binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(pm.getRPCType(), pm.getFunctionID(), pm.getCorrID(), pm.getJsonSize());
+ System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
+ System.arraycopy(pm.getData(), 0, data, 12, pm.getJsonSize());
+
+ // create packet and invoke sendPacketToRegisteredApp
+ SdlPacket packet = new SdlPacket(4, false, SdlPacket.FRAME_TYPE_SINGLE, SdlPacket.SERVICE_TYPE_RPC, 0, sessionId, data.length, 123, data);
+ packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
+ method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
+ Boolean success = (Boolean) method.invoke(sdlRouterService, packet);
+
+ // we do not want the UAI packet to be sent. make sure it is dropped
+ Assert.assertFalse(success);
+
+ } catch (Exception e) {
+ Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
+ }
+ }
+ /**
+ * Test sending UAI to an app whose session id is the same as a removed app
+ * but is indeed the SAME app
+ *
+ * @see SdlRouterService#sendPacketToRegisteredApp(SdlPacket)
+ */
+ public void testRegisterAppExistingSessionIDSameApp() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ Method method;
+ try {
+ // create instance of router service
+ SdlRouterService sdlRouterService = new SdlRouterService();
+
+ // We need a registered app for this to work
+ Message message = Message.obtain();
+ SdlRouterService.RegisteredApp app1 = sdlRouterService.new RegisteredApp("12345",message.replyTo);
+ SdlRouterService.RegisteredApp app2 = sdlRouterService.new RegisteredApp("12344",message.replyTo);
+ HashMap<String,SdlRouterService.RegisteredApp> registeredApps = new HashMap<>();
+ registeredApps.put(app1.getAppId(),app1);
+ registeredApps.put(app2.getAppId(),app2);
+
+ // set registered apps array
+ Field raf = sdlRouterService.getClass().getDeclaredField("registeredApps");
+ raf.setAccessible(true);
+ raf.set(sdlRouterService, registeredApps);
+
+ // need a session map too
+ SparseArray<String> sessionMap = new SparseArray<String>();
+ sessionMap.put(1, "12345");
+ Field sessionMapField = sdlRouterService.getClass().getDeclaredField("bluetoothSessionMap");
+ sessionMapField.setAccessible(true);
+ sessionMapField.set(sdlRouterService, sessionMap);
+
+ // set cleaned session map
+ SparseIntArray testCleanedMap = new SparseIntArray();
+ testCleanedMap.put(1, 12345);
+ Field f = sdlRouterService.getClass().getDeclaredField("cleanedSessionMap");
+ f.setAccessible(true);
+ f.set(sdlRouterService, testCleanedMap);
+
+ // set session hash id map
+ SparseIntArray testHashIdMap = new SparseIntArray();
+ testHashIdMap.put(1, 12345);
+ Field f2 = sdlRouterService.getClass().getDeclaredField("sessionHashIdMap");
+ f2.setAccessible(true);
+ f2.set(sdlRouterService, testHashIdMap);
+
+ // make sure maps are set and NOT the same
+ Assert.assertNotNull(raf.get(sdlRouterService));
+ Assert.assertNotNull(sessionMapField.get(sdlRouterService));
+ Assert.assertNotNull(f.get(sdlRouterService));
+ Assert.assertNotNull(f2.get(sdlRouterService));
+
+ // make da RPC
+ UnregisterAppInterface request = new UnregisterAppInterface();
+ request.setCorrelationID(SAMPLE_RPC_CORRELATION_ID);
+
+ // build protocol message
+ byte[] msgBytes = JsonRPCMarshaller.marshall(request, (byte) version);
+ pm = new ProtocolMessage();
+ pm.setData(msgBytes);
+ pm.setSessionID((byte) sessionId);
+ pm.setMessageType(MessageType.RPC);
+ pm.setSessionType(SessionType.RPC);
+ pm.setFunctionID(FunctionID.getFunctionId(request.getFunctionName()));
+ pm.setCorrID(request.getCorrelationID());
+
+ if (request.getBulkData() != null) {
+ pm.setBulkData(request.getBulkData());
+ }
+
+ // binary frame header
+ byte[] data = new byte[12 + pm.getJsonSize()];
+ binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(pm.getRPCType(), pm.getFunctionID(), pm.getCorrID(), pm.getJsonSize());
+ System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
+ System.arraycopy(pm.getData(), 0, data, 12, pm.getJsonSize());
+
+ // create packet and invoke sendPacketToRegisteredApp
+ SdlPacket packet = new SdlPacket(4, false, SdlPacket.FRAME_TYPE_SINGLE, SdlPacket.SERVICE_TYPE_RPC, 0, sessionId, data.length, 123, data);
+ packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
+ method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
+ Boolean success = (Boolean) method.invoke(sdlRouterService, packet);
+
+ // Since it is the same app, allow the packet to be sent
+ Assert.assertTrue(success);
+
+ } catch (Exception e) {
+ Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
+ }
+ }
+
+ /**
+ * Test router service correctly picks up Hash ID from start service ACK (prior to V5)
+ */
+ public void testStartSessionAckHashId() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ Method method;
+ try {
+ SdlRouterService sdlRouterService = new SdlRouterService();
+
+ initFields(sdlRouterService);
+ addDummyRegisteredApp(sdlRouterService, "12345", sessionId);
+
+ // create packet and invoke sendPacketToRegisteredApp
+ int hashId = 0x123456;
+ byte[] payload = new byte[]{0x00, 0x12, 0x34, 0x56};
+ SdlPacket packet = new SdlPacket(4, false, SdlPacket.FRAME_TYPE_CONTROL, SdlPacket.SERVICE_TYPE_RPC, SdlPacket.FRAME_INFO_START_SERVICE_ACK, sessionId, payload.length, 2, payload);
+ packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
+
+ method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
+ method.setAccessible(true);
+ Boolean success = (Boolean) method.invoke(sdlRouterService, packet);
+ Assert.assertTrue(success);
+
+ // verify hash id map contains the correct ID
+ Field field = sdlRouterService.getClass().getDeclaredField("sessionHashIdMap");
+ field.setAccessible(true);
+ SparseIntArray sessionHashIdMap = (SparseIntArray)field.get(sdlRouterService);
+
+ Assert.assertTrue(sessionHashIdMap.indexOfKey(sessionId) >= 0);
+ int value = sessionHashIdMap.get(sessionId, -1);
+ Assert.assertEquals(hashId, value);
+ } catch (Exception e) {
+ Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
+ }
+ }
+
+ /**
+ * Test router service correctly acquires Hash ID from V5 start service ACK
+ */
+ public void testStartSessionAckV5HashId() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ Method method;
+ try {
+ SdlRouterService sdlRouterService = new SdlRouterService();
+
+ initFields(sdlRouterService);
+ addDummyRegisteredApp(sdlRouterService, "12345", sessionId);
+
+ // create packet and invoke sendPacketToRegisteredApp
+ int hashId = 0x123456;
+ SdlPacket packet = new SdlPacket(5, false, SdlPacket.FRAME_TYPE_CONTROL, SdlPacket.SERVICE_TYPE_RPC, SdlPacket.FRAME_INFO_START_SERVICE_ACK, sessionId, 0, 2, null);
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION, "5.0.0");
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID, hashId);
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.MTU, 1024);
+ packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
+ packet.constructPacket(); // update 'payload' field in the packet instance
+
+ method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
+ method.setAccessible(true);
+ Boolean success = (Boolean) method.invoke(sdlRouterService, packet);
+ Assert.assertTrue(success);
+
+ // verify hash id map contains the correct ID
+ Field field = sdlRouterService.getClass().getDeclaredField("sessionHashIdMap");
+ field.setAccessible(true);
+ SparseIntArray sessionHashIdMap = (SparseIntArray)field.get(sdlRouterService);
+
+ Assert.assertTrue(sessionHashIdMap.indexOfKey(sessionId) >= 0);
+ int value = sessionHashIdMap.get(sessionId, -1);
+ Assert.assertEquals(hashId, value);
+ } catch (Exception e) {
+ Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
+ }
+ }
+
+ /**
+ * Test router service sends a valid end service request from attemptToCleanupModule()
+ */
+ public void testEndSessionV5FromAttemptToCleanupModule() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ Method method;
+ try {
+ SdlRouterService sdlRouterService = new SdlRouterService();
+
+ initFields(sdlRouterService);
+ addDummyRegisteredApp(sdlRouterService, "12345", sessionId);
+
+ MultiplexBluetoothTransport mockTransport = mock(MultiplexBluetoothTransport.class);
+ Field btf = sdlRouterService.getClass().getDeclaredField("bluetoothTransport");
+ btf.setAccessible(true);
+ btf.set(sdlRouterService, mockTransport);
+
+ // create packet and invoke sendPacketToRegisteredApp
+ int hashId = 0x123456;
+ SdlPacket packet = new SdlPacket(5, false, SdlPacket.FRAME_TYPE_CONTROL, SdlPacket.SERVICE_TYPE_RPC, SdlPacket.FRAME_INFO_START_SERVICE_ACK, sessionId, 0, 2, null);
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION, "5.0.0");
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID, hashId);
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.MTU, 1024);
+ packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
+ packet.constructPacket(); // update 'payload' field in the packet instance
+
+ method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
+ method.setAccessible(true);
+ Boolean success = (Boolean) method.invoke(sdlRouterService, packet);
+ Assert.assertTrue(success);
+
+ when(mockTransport.getState()).thenReturn(MultiplexBluetoothTransport.STATE_CONNECTED);
+
+ // now call attemptToCleanUpModule()
+ method = sdlRouterService.getClass().getDeclaredMethod("attemptToCleanUpModule", int.class, int.class, TransportType.class);
+ method.setAccessible(true);
+ method.invoke(sdlRouterService, sessionId, 5, TransportType.BLUETOOTH);
+
+ ArgumentCaptor<byte[]> argument = ArgumentCaptor.forClass(byte[].class);
+ verify(mockTransport, times(2)).write(argument.capture(), eq(0), anyInt());
+
+ List<byte[]> frames = argument.getAllValues();
+
+ // First, we receive UnregisterAppInterface. Verifying the message is out of scope of this test.
+ Assert.assertEquals(2, frames.size());
+
+ // then we should receive a end service frame
+ byte[] expectedBsonPayload = new byte[] {
+ 0x11, 0x00, 0x00, 0x00, /* total bytes */
+ 0x10, 'h', 'a', 's', 'h', 'I', 'd', 0x00, 0x56, 0x34, 0x12, 0x00, /* int32: "hashId": 0x00123456 */
+ 0x00, /* end of document */
+ };
+ byte[] actualFrame = frames.get(1);
+
+ Assert.assertEquals(12 + expectedBsonPayload.length, actualFrame.length);
+ Assert.assertEquals(actualFrame[2], 0x04 /* end service */);
+ Assert.assertEquals(actualFrame[3], (byte)sessionId);
+ byte[] actualPayload = Arrays.copyOfRange(actualFrame, 12, actualFrame.length);
+ Assert.assertTrue(Arrays.equals(expectedBsonPayload, actualPayload));
+ } catch (Exception e) {
+ Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
+ }
+ }
+
+ /**
+ * Test router service sends a valid end service request when it receives a packet from Core
+ * and the app has been unregistered
+ */
+ public void testEndSessionV5WhenPacketForUnregisteredAppReceived() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ Method method;
+ try {
+ SdlRouterService sdlRouterService = new SdlRouterService();
+
+ initFields(sdlRouterService);
+ addDummyRegisteredApp(sdlRouterService, "12345", sessionId);
+ // The end service frame will not be sent out if there is no app in the map. Is this expected?
+ addDummyRegisteredApp(sdlRouterService, "12346", 2);
+
+ MultiplexBluetoothTransport mockTransport = mock(MultiplexBluetoothTransport.class);
+ Field btf = sdlRouterService.getClass().getDeclaredField("bluetoothTransport");
+ btf.setAccessible(true);
+ btf.set(sdlRouterService, mockTransport);
+
+ // create packet and invoke sendPacketToRegisteredApp
+ int hashId = 0x123456;
+ SdlPacket packet = new SdlPacket(5, false, SdlPacket.FRAME_TYPE_CONTROL, SdlPacket.SERVICE_TYPE_RPC, SdlPacket.FRAME_INFO_START_SERVICE_ACK, sessionId, 0, 2, null);
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION, "5.0.0");
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID, hashId);
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.MTU, 1024);
+ packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
+ packet.constructPacket(); // update 'payload' field in the packet instance
+
+ method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
+ method.setAccessible(true);
+ Boolean ret = (Boolean) method.invoke(sdlRouterService, packet);
+ Assert.assertTrue(ret);
+
+ // remove the app from "registeredApps" map
+ Field field = sdlRouterService.getClass().getDeclaredField("registeredApps");
+ field.setAccessible(true);
+ HashMap<String, SdlRouterService.RegisteredApp> registeredApps = (HashMap<String,SdlRouterService.RegisteredApp>)field.get(sdlRouterService);
+ registeredApps.remove("12345");
+
+ when(mockTransport.getState()).thenReturn(MultiplexBluetoothTransport.STATE_CONNECTED);
+
+ // call sendPacketToRegisteredApp once again with a dummy packet
+ byte[] dummyRegisterAppInterface = new byte[]{0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, '{', '}'};
+ SdlPacket dummyPacket = new SdlPacket(5, false, SdlPacket.FRAME_TYPE_SINGLE, SdlPacket.SERVICE_TYPE_RPC, 0x00, sessionId, dummyRegisterAppInterface.length, 3, dummyRegisterAppInterface);
+ dummyPacket.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
+
+ ret = (Boolean) method.invoke(sdlRouterService, dummyPacket);
+ Assert.assertFalse(ret);
+
+ ArgumentCaptor<byte[]> argument = ArgumentCaptor.forClass(byte[].class);
+ verify(mockTransport, times(2)).write(argument.capture(), eq(0), anyInt());
+
+ List<byte[]> frames = argument.getAllValues();
+
+ // First, we receive UnregisterAppInterface. Verifying the message is out of scope of this test.
+ Assert.assertEquals(2, frames.size());
+
+ // then we should receive a end service frame
+ byte[] expectedBsonPayload = new byte[] {
+ 0x11, 0x00, 0x00, 0x00, /* total bytes */
+ 0x10, 'h', 'a', 's', 'h', 'I', 'd', 0x00, 0x56, 0x34, 0x12, 0x00, /* int32: "hashId": 0x00123456 */
+ 0x00, /* end of document */
+ };
+ byte[] actualFrame = frames.get(1);
+
+ Assert.assertEquals(12 + expectedBsonPayload.length, actualFrame.length);
+ Assert.assertEquals(actualFrame[2], 0x04 /* end service */);
+ Assert.assertEquals(actualFrame[3], (byte)sessionId);
+ byte[] actualPayload = Arrays.copyOfRange(actualFrame, 12, actualFrame.length);
+ Assert.assertTrue(Arrays.equals(expectedBsonPayload, actualPayload));
+ } catch (Exception e) {
+ Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
+ }
+ }
+
+ /**
+ * Test router service sends a valid end service request when it fails to deliver a message
+ * to an app
+ */
+ public void testEndSessionV5WhenSendMessageToClientFailed() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ Method method;
+ try {
+ SdlRouterService sdlRouterService = new SdlRouterService();
+ initFields(sdlRouterService);
+ addDummyRegisteredApp(sdlRouterService, "12345", sessionId);
+
+ // create packet and invoke sendPacketToRegisteredApp
+ int hashId = 0x123456;
+ SdlPacket packet = new SdlPacket(5, false, SdlPacket.FRAME_TYPE_CONTROL, SdlPacket.SERVICE_TYPE_RPC, SdlPacket.FRAME_INFO_START_SERVICE_ACK, sessionId, 0, 2, null);
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION, "5.0.0");
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID, hashId);
+ packet.putTag(ControlFrameTags.RPC.StartServiceACK.MTU, 1024);
+ packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
+ packet.constructPacket(); // update 'payload' field in the packet instance
+
+ method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
+ method.setAccessible(true);
+ Boolean ret = (Boolean) method.invoke(sdlRouterService, packet);
+ Assert.assertTrue(ret);
+
+ SdlRouterService.RegisteredApp mockApp = mock(SdlRouterService.RegisteredApp.class);
+ when(mockApp.sendMessage(any(Message.class))).thenReturn(SdlRouterService.RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT);
+ Vector<Long> dummySessionIds = new Vector<>();
+ dummySessionIds.add((long)sessionId);
+ when(mockApp.getSessionIds()).thenReturn(dummySessionIds);
+ List<TransportType> dummyTransportTypes = new ArrayList<>();
+ dummyTransportTypes.add(TransportType.BLUETOOTH);
+ when(mockApp.getTransportsForSession(sessionId)).thenReturn(dummyTransportTypes);
+
+ MultiplexBluetoothTransport mockTransport = mock(MultiplexBluetoothTransport.class);
+ Field btf = sdlRouterService.getClass().getDeclaredField("bluetoothTransport");
+ btf.setAccessible(true);
+ btf.set(sdlRouterService, mockTransport);
+
+ when(mockTransport.getState()).thenReturn(MultiplexBluetoothTransport.STATE_CONNECTED);
+
+ // invoke sendPacketMessageToClient
+ method = sdlRouterService.getClass().getDeclaredMethod("sendPacketMessageToClient", SdlRouterService.RegisteredApp.class, Message.class, byte.class);
+ method.setAccessible(true);
+ Message dummyMessage = Message.obtain();
+ ret = (Boolean) method.invoke(sdlRouterService, mockApp, dummyMessage, (byte)5);
+ Assert.assertFalse(ret);
+
+ ArgumentCaptor<byte[]> argument = ArgumentCaptor.forClass(byte[].class);
+ verify(mockTransport, times(2)).write(argument.capture(), eq(0), anyInt());
+
+ List<byte[]> frames = argument.getAllValues();
+
+ // First, we receive UnregisterAppInterface. Verifying the message is out of scope of this test.
+ Assert.assertEquals(2, frames.size());
+
+ // then we should receive a end service frame
+ byte[] expectedBsonPayload = new byte[] {
+ 0x11, 0x00, 0x00, 0x00, /* total bytes */
+ 0x10, 'h', 'a', 's', 'h', 'I', 'd', 0x00, 0x56, 0x34, 0x12, 0x00, /* int32: "hashId": 0x00123456 */
+ 0x00, /* end of document */
+ };
+ byte[] actualFrame = frames.get(1);
+
+ Assert.assertEquals(12 + expectedBsonPayload.length, actualFrame.length);
+ Assert.assertEquals(actualFrame[2], 0x04 /* end service */);
+ Assert.assertEquals(actualFrame[3], (byte)sessionId);
+ byte[] actualPayload = Arrays.copyOfRange(actualFrame, 12, actualFrame.length);
+ Assert.assertTrue(Arrays.equals(expectedBsonPayload, actualPayload));
+ } catch (Exception e) {
+ Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
+ }
+ }
+
+ private void initFields(SdlRouterService routerService) throws IllegalAccessException, NoSuchFieldException {
+ // set registered apps array
+ HashMap<String,SdlRouterService.RegisteredApp> registeredApps = new HashMap<>();
+ Field raf = routerService.getClass().getDeclaredField("registeredApps");
+ raf.setAccessible(true);
+ raf.set(routerService, registeredApps);
+
+ // need a session map too
+ SparseArray<String> sessionMap = new SparseArray<String>();
+ Field bsmf = routerService.getClass().getDeclaredField("bluetoothSessionMap");
+ bsmf.setAccessible(true);
+ bsmf.set(routerService, sessionMap);
+
+ SparseIntArray emptyCleanedSessionMap = new SparseIntArray();
+ Field csmf = routerService.getClass().getDeclaredField("cleanedSessionMap");
+ csmf.setAccessible(true);
+ csmf.set(routerService, emptyCleanedSessionMap);
+
+ SparseIntArray emptyHashIdMap = new SparseIntArray();
+ Field shmf = routerService.getClass().getDeclaredField("sessionHashIdMap");
+ shmf.setAccessible(true);
+ shmf.set(routerService, emptyHashIdMap);
+ }
+
+ private void addDummyRegisteredApp(SdlRouterService routerService, String appId, int sessionId)
+ throws IllegalAccessException, NoSuchFieldException {
+ Message message = Message.obtain();
+ SdlRouterService.RegisteredApp app = routerService.new RegisteredApp(appId, message.replyTo);
+
+ Field raf = routerService.getClass().getDeclaredField("registeredApps");
+ raf.setAccessible(true);
+ HashMap<String, SdlRouterService.RegisteredApp> registeredApps = (HashMap<String,SdlRouterService.RegisteredApp>)raf.get(routerService);
+ registeredApps.put(app.getAppId(), app);
+
+ Field bsmf = routerService.getClass().getDeclaredField("bluetoothSessionMap");
+ bsmf.setAccessible(true);
+ SparseArray<String> sessionMap = (SparseArray<String>)bsmf.get(routerService);
+ sessionMap.put(sessionId, appId);
+ }
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java
index ac97857ad..ac97857ad 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java
new file mode 100644
index 000000000..b73460c72
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java
@@ -0,0 +1,125 @@
+package com.smartdevicelink.transport;
+
+import android.content.ComponentName;
+import android.os.Looper;
+
+import com.smartdevicelink.AndroidTestCase2;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.SdlPacketFactory;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.test.SdlUnitTestContants;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import java.util.Collections;
+import java.util.List;
+
+public class TransportManagerTests extends AndroidTestCase2 {
+
+ MultiplexTransportConfig config;
+ final TransportRecord defaultBtRecord = new TransportRecord(TransportType.BLUETOOTH, "12:34:56:78:90");
+ final ComponentName routerServiceComponentName = new ComponentName("com.smartdevicelink.test","com.smartdevicelink.test.SdlRouterService");
+ final SdlPacket defaultPacket = SdlPacketFactory.createStartSessionACK(SessionType.RPC,(byte)1,100,(byte)5);
+
+
+ TransportManager.TransportEventListener defaultListener = new TransportManager.TransportEventListener() {
+ @Override
+ public void onPacketReceived(SdlPacket packet) { assertEquals(defaultPacket,packet);}
+ @Override
+ public void onTransportConnected(List<TransportRecord> transports) {}
+ @Override
+ public void onTransportDisconnected(String info, TransportRecord type, List<TransportRecord> connectedTransports) {}
+ @Override
+ public void onError(String info) {}
+ @Override
+ public boolean onLegacyModeEnabled(String info) {return false; }
+ };
+
+
+ @Override
+ protected void setUp() throws Exception {
+ config = new MultiplexTransportConfig(this.mContext, SdlUnitTestContants.TEST_APP_ID);
+ config.setService(routerServiceComponentName);
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+
+
+ }
+
+ public TransportManager createTransportManager(){
+ TransportManager manager = new TransportManager(config,defaultListener);
+
+ //The default listener returns false as legacy is unacceptable
+ assertNull(manager.legacyBluetoothHandler);
+
+ manager.exitLegacyMode("Test");
+ manager.transport = manager.new TransportBrokerImpl(mContext, config.appId, routerServiceComponentName);
+
+ manager.start();
+ assert true;
+ return manager;
+ }
+
+ public void testBase(){
+ TransportManager manager = new TransportManager(config,defaultListener);
+ assertNotNull(manager);
+ }
+
+ public void testConnectionStatus(){
+ TransportManager manager = new TransportManager(config,defaultListener);
+
+ manager.transportStatus.clear();
+ manager.transportStatus.add(defaultBtRecord);
+
+ assertTrue(manager.isConnected(null, null));
+ assertTrue(manager.isConnected(TransportType.BLUETOOTH, null));
+ assertTrue(manager.isConnected(TransportType.BLUETOOTH, defaultBtRecord.getAddress()));
+
+ assertNull(manager.getTransportRecord(null, null));
+ assertNull(manager.getTransportRecord(null, defaultBtRecord.getAddress()));
+ assertNull(manager.getTransportRecord(TransportType.USB, null));
+
+ assertEquals(defaultBtRecord, manager.getTransportRecord(defaultBtRecord.getType(), null));
+ assertEquals(defaultBtRecord, manager.getTransportRecord(defaultBtRecord.getType(), defaultBtRecord.getAddress()));
+
+ assertFalse(manager.isHighBandwidthAvailable());
+
+ manager.transportStatus.add(new TransportRecord(TransportType.USB,"test"));
+ assertTrue(manager.isHighBandwidthAvailable());
+ assertNotNull(manager.getTransportRecord(TransportType.USB, null));
+
+ }
+
+ public void testOnTransportConnections(){
+
+ TransportManager manager = createTransportManager();
+
+ manager.transport.onHardwareConnected(Collections.singletonList(defaultBtRecord));
+
+ assertTrue(manager.isConnected(null, null));
+ assertTrue(manager.isConnected(TransportType.BLUETOOTH, null));
+ assertTrue(manager.isConnected(TransportType.BLUETOOTH, defaultBtRecord.getAddress()));
+
+ assertNull(manager.getTransportRecord(null, null));
+ assertNull(manager.getTransportRecord(null, defaultBtRecord.getAddress()));
+ assertNull(manager.getTransportRecord(TransportType.USB, null));
+
+ assertEquals(defaultBtRecord, manager.getTransportRecord(defaultBtRecord.getType(), null));
+ assertEquals(defaultBtRecord, manager.getTransportRecord(defaultBtRecord.getType(), defaultBtRecord.getAddress()));
+
+ assertFalse(manager.isHighBandwidthAvailable());
+
+ }
+
+ public void testOnPacket(){
+ TransportManager manager = createTransportManager();
+ assertNotNull(manager.transportListener);
+
+ manager.transport.onPacketReceived(defaultPacket);
+
+ }
+
+
+
+}
diff --git a/sdl_android/src/androidTest/res/raw/test_audio_square_250hz_80amp_1s.mp3 b/android/sdl_android/src/androidTest/res/raw/test_audio_square_250hz_80amp_1s.mp3
index 6108d27ec..6108d27ec 100644
--- a/sdl_android/src/androidTest/res/raw/test_audio_square_250hz_80amp_1s.mp3
+++ b/android/sdl_android/src/androidTest/res/raw/test_audio_square_250hz_80amp_1s.mp3
Binary files differ
diff --git a/sdl_android/src/main/AndroidManifest.xml b/android/sdl_android/src/main/AndroidManifest.xml
index 32a1590e5..32a1590e5 100644
--- a/sdl_android/src/main/AndroidManifest.xml
+++ b/android/sdl_android/src/main/AndroidManifest.xml
diff --git a/sdl_android/src/main/aidl/com/smartdevicelink/protocol/SdlPacket.aidl b/android/sdl_android/src/main/aidl/com/smartdevicelink/protocol/SdlPacket.aidl
index cec80021e..cec80021e 100644
--- a/sdl_android/src/main/aidl/com/smartdevicelink/protocol/SdlPacket.aidl
+++ b/android/sdl_android/src/main/aidl/com/smartdevicelink/protocol/SdlPacket.aidl
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java
new file mode 100644
index 000000000..f5265ccf0
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java
@@ -0,0 +1,661 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.SdlConnection;
+
+
+import android.content.ComponentName;
+import android.util.Log;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.protocol.AbstractProtocol;
+import com.smartdevicelink.protocol.IProtocolListener;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.WiProProtocol;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.transport.BTTransport;
+import com.smartdevicelink.transport.BTTransportConfig;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.ITransportListener;
+import com.smartdevicelink.transport.MultiplexTransport;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.RouterServiceValidator;
+import com.smartdevicelink.transport.SdlBroadcastReceiver;
+import com.smartdevicelink.transport.SdlTransport;
+import com.smartdevicelink.transport.TCPTransport;
+import com.smartdevicelink.transport.TCPTransportConfig;
+import com.smartdevicelink.transport.USBTransport;
+import com.smartdevicelink.transport.USBTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+@Deprecated
+public class SdlConnection implements IProtocolListener, ITransportListener {
+
+ private static final String TAG = "SdlConnection";
+
+ SdlTransport _transport = null;
+ AbstractProtocol _protocol = null;
+ ISdlConnectionListener _connectionListener = null;
+
+
+
+ // Thread safety locks
+ static Object TRANSPORT_REFERENCE_LOCK = new Object();
+ Object PROTOCOL_REFERENCE_LOCK = new Object();
+
+ private Object SESSION_LOCK = new Object();
+ private CopyOnWriteArrayList<SdlSession> listenerList = new CopyOnWriteArrayList<SdlSession>();
+ private static TransportType legacyTransportRequest = null;
+ private final static int BUFF_READ_SIZE = 1000000;
+ protected static MultiplexTransportConfig cachedMultiConfig = null;
+
+ /**
+ * Constructor.
+ *
+ * @param transportConfig Transport configuration for this connection.
+ */
+ public SdlConnection(BaseTransportConfig transportConfig) {
+ RouterServiceValidator vlad = null;
+ //Let's check if we can even do multiplexing
+ if(transportConfig.getTransportType() == TransportType.MULTIPLEX){
+ ComponentName tempCompName = SdlBroadcastReceiver.consumeQueuedRouterService();
+ MultiplexTransportConfig multiConfig = (MultiplexTransportConfig)transportConfig;
+ if(tempCompName!=null){
+ vlad =new RouterServiceValidator(multiConfig.getContext(),tempCompName);
+ }else{
+ vlad =new RouterServiceValidator(multiConfig.getContext());
+ }
+ //vlad.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
+ vlad.setSecurityLevel(multiConfig.getSecurityLevel());
+ }
+ constructor(transportConfig,vlad);
+ }
+ //For unit tests
+ protected SdlConnection(BaseTransportConfig transportConfig,RouterServiceValidator rsvp){
+ constructor(transportConfig,rsvp);
+ }
+
+ private void constructor(BaseTransportConfig transportConfig,RouterServiceValidator rsvp){
+ _connectionListener = new InternalMsgDispatcher();
+
+ // Initialize the transport
+ synchronized(TRANSPORT_REFERENCE_LOCK) {
+ // Ensure transport is null
+ if (_transport != null) {
+ if (_transport.getIsConnected()) {
+ _transport.disconnect();
+ }
+ _transport = null;
+ }
+
+ //Let's check if we can even do multiplexing
+ if(!isLegacyModeEnabled() &&
+ rsvp!= null &&
+ transportConfig.getTransportType() == TransportType.MULTIPLEX){
+ //rsvp = new RouterServiceValidator(((MultiplexTransportConfig)transportConfig).getContext());
+ //vlad.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
+ if(rsvp.validate()){
+ Log.w(TAG, "SDL Router service is valid; attempting to connect");
+ ((MultiplexTransportConfig)transportConfig).setService(rsvp.getService());//Let thes the transport broker know which service to connect to
+ }else{
+ Log.w(TAG, "SDL Router service isn't trusted. Enabling legacy bluetooth connection.");
+ if(cachedMultiConfig == null){
+ cachedMultiConfig = (MultiplexTransportConfig) transportConfig;
+ cachedMultiConfig.setService(null);
+ }
+ enableLegacyMode(true,TransportType.BLUETOOTH); //We will use legacy bluetooth connection for this attempt
+ }
+ }
+
+ if(!isLegacyModeEnabled() && //Make sure legacy mode is not enabled
+ (transportConfig.getTransportType() == TransportType.MULTIPLEX)){
+ _transport = new MultiplexTransport((MultiplexTransportConfig)transportConfig,this);
+ }else if(isLegacyModeEnabled() && legacyTransportRequest == TransportType.BLUETOOTH){
+ _transport = new BTTransport(this, true);
+ }else if(transportConfig.getTransportType() == TransportType.BLUETOOTH){
+ _transport = new BTTransport(this,((BTTransportConfig)transportConfig).getKeepSocketActive());
+ }
+ else if (transportConfig.getTransportType() == TransportType.TCP)
+ {
+ _transport = new TCPTransport((TCPTransportConfig) transportConfig, this);
+ } else if (transportConfig.getTransportType() == TransportType.USB) {
+ _transport = new USBTransport((USBTransportConfig) transportConfig, this);
+ }
+ }
+
+ // Initialize the protocol
+ synchronized(PROTOCOL_REFERENCE_LOCK) {
+ // Ensure protocol is null
+ if (_protocol != null) {
+ _protocol = null;
+ }
+
+ _protocol = new WiProProtocol(this);
+ }
+ }
+
+ public AbstractProtocol getWiProProtocol(){
+ return _protocol;
+ }
+
+
+
+
+ private void closeConnection(boolean willRecycle, byte rpcSessionID, int sessionHashId) {
+ synchronized(PROTOCOL_REFERENCE_LOCK) {
+
+ if (_protocol != null) {
+ // If transport is still connected, sent EndProtocolSessionMessage
+ if (_transport != null && _transport.getIsConnected()) {
+ _protocol.EndProtocolSession(SessionType.RPC, rpcSessionID, sessionHashId);
+ }
+ if (willRecycle) {
+ _protocol = null;
+ }
+ } // end-if
+ }
+ synchronized (TRANSPORT_REFERENCE_LOCK) {
+ if (willRecycle) {
+ if (_transport != null) {
+ _transport.disconnect();
+ }
+ _transport = null;
+ }
+ }
+ }
+
+
+ public void startTransport() throws SdlException {
+ _transport.openConnection();
+ }
+
+ public Boolean getIsConnected() {
+
+ // If _transport is null, then it can't be connected
+ if (_transport == null) {
+ return false;
+ }
+
+ return _transport.getIsConnected();
+ }
+
+ public String getBroadcastComment() {
+
+ if (_transport == null) {
+ return "";
+ }
+
+ return _transport.getBroadcastComment();
+ }
+
+ public void sendMessage(ProtocolMessage msg) {
+ if(_protocol != null)
+ _protocol.SendMessage(msg);
+ }
+
+ void startHandShake() {
+ synchronized(PROTOCOL_REFERENCE_LOCK){
+ if(_protocol != null){
+ _protocol.StartProtocolSession(SessionType.RPC);
+ }
+ }
+ }
+
+ @Override
+ public void onTransportPacketReceived(SdlPacket packet) {
+ // Send bytes to protocol to be interpreted
+ synchronized(PROTOCOL_REFERENCE_LOCK) {
+ if (_protocol != null) {
+ _protocol.handlePacketReceived(packet);
+ }
+ }
+ }
+
+ @Override
+ public void onTransportConnected() {
+ synchronized(PROTOCOL_REFERENCE_LOCK){
+ if(_protocol != null){
+ boolean shouldRequestSession = _transport !=null && _transport.getTransportType()== TransportType.MULTIPLEX;
+ for (SdlSession s : listenerList) {
+ if (s.getSessionId() == 0) {
+ if(shouldRequestSession){
+ ((MultiplexTransport)_transport).requestNewSession();
+ }
+ startHandShake();
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onTransportDisconnected(String info) {
+ // Pass directly to connection listener
+ _connectionListener.onTransportDisconnected(info);
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+ // Pass directly to connection listener
+ _connectionListener.onTransportError(info, e);
+ }
+
+ @Override
+ public void onProtocolMessageBytesToSend(SdlPacket packet) {
+ // Protocol has packaged bytes to send, pass to transport for transmission
+ synchronized(TRANSPORT_REFERENCE_LOCK) {
+ if (_transport != null) {
+ _transport.sendBytes(packet);
+ }
+ }
+ }
+
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+ _connectionListener.onProtocolMessageReceived(msg);
+ }
+
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
+ _connectionListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
+ }
+
+ @Override
+ public void onProtocolSessionNACKed(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+ _connectionListener.onProtocolSessionStartedNACKed(sessionType,
+ sessionID, version, correlationID, rejectedParams);
+ }
+
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
+ String correlationID) {
+ _connectionListener.onProtocolSessionEnded(sessionType, sessionID, correlationID);
+ }
+
+ @Override
+ public void onProtocolError(String info, Exception e) {
+ _connectionListener.onProtocolError(info, e);
+ }
+
+
+ /**
+ * Gets type of transport currently used by this connection.
+ *
+ * @return One of TransportType enumeration values.
+ *
+ * @see TransportType
+ */
+ public TransportType getCurrentTransportType() {
+ return _transport.getTransportType();
+ }
+
+ public void startService (SessionType sessionType, byte sessionID, boolean isEncrypted) {
+ synchronized(PROTOCOL_REFERENCE_LOCK){
+ if(_protocol != null){
+ _protocol.StartProtocolService(sessionType, sessionID, isEncrypted);
+ }
+ }
+ }
+
+ public void endService (SessionType sessionType, byte sessionID) {
+ synchronized(PROTOCOL_REFERENCE_LOCK){
+ if(_protocol != null){
+ _protocol.EndProtocolService(sessionType, sessionID);
+ }
+ }
+ }
+ void registerSession(SdlSession registerListener) throws SdlException {
+ boolean didAdd = listenerList.addIfAbsent(registerListener);
+ if (!this.getIsConnected()) {
+ this.startTransport();
+ } else {
+ if(didAdd && _transport !=null && _transport.getTransportType()== TransportType.MULTIPLEX){ //If we're connected we can request the extra session now
+ ((MultiplexTransport)_transport).requestNewSession();
+ }
+ this.startHandShake();
+ }
+ }
+
+ public void sendHeartbeat(SdlSession mySession) {
+ if(_protocol != null && mySession != null)
+ _protocol.SendHeartBeat(mySession.getSessionId());
+ }
+
+ public void unregisterSession(SdlSession registerListener) {
+ boolean didRemove = listenerList.remove(registerListener);
+ if(didRemove && _transport !=null && _transport.getTransportType()== TransportType.MULTIPLEX){ //If we're connected we can request the extra session now
+ ((MultiplexTransport)_transport).removeSession(registerListener.getSessionId());
+ }
+ closeConnection(listenerList.size() == 0, registerListener.getSessionId(), registerListener.getSessionHashId());
+ }
+
+
+ public SdlSession findSessionById(byte id) {
+ for (SdlSession listener : listenerList) {
+ if (listener.getSessionId() == id) {
+ return listener;
+ }
+ }
+ return null;
+ }
+
+ public void onAuthTokenReceived(String authToken, byte sessionID) {
+ if(this._connectionListener != null){
+ this._connectionListener.onAuthTokenReceived(authToken,sessionID);
+ }
+ }
+
+ private class InternalMsgDispatcher implements ISdlConnectionListener {
+
+ @Override
+ public void onTransportDisconnected(String info) {
+ for (SdlSession session : listenerList) {
+ session.onTransportDisconnected(info);
+ }
+ if(cachedMultiConfig!=null ){
+ if(cachedMultiConfig.getService()!=null){
+ synchronized(TRANSPORT_REFERENCE_LOCK) {
+ // Ensure transport is null
+ if (_transport != null) {
+ if (_transport.getIsConnected()) {
+ _transport.disconnect();
+ }
+ _transport = null;
+ }
+ _transport = new MultiplexTransport(cachedMultiConfig, SdlConnection.this);
+ try {
+ startTransport();
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+ }else{ //The service must be null or already consumed. Let's see if we can find the connection that consumed it
+ for (SdlSession session : listenerList) {
+ session.checkForOpenMultiplexConnection(SdlConnection.this);;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) {
+ onTransportDisconnected(info);
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+ //If there's an error with the transport we want to make sure we clear out any reference to it held by the static list in sessions
+ SdlSession.removeConnection(SdlConnection.this);
+ //If we are erroring out to go into legacy mode, lets cache our multiplexing
+ if(isLegacyModeEnabled() && _transport!=null && TransportType.MULTIPLEX.equals(_transport.getTransportType())){
+ MultiplexTransport multi = ((MultiplexTransport)_transport);
+ cachedMultiConfig = multi.getConfig();
+ cachedMultiConfig.setService(null); //Make sure we're clearning this out
+ }else{
+ cachedMultiConfig = null; //It should now be consumed
+ }
+ for (SdlSession session : listenerList) {
+ session.onTransportError(info, e);
+ }
+
+ }
+
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+ SdlSession session = findSessionById(msg.getSessionID());
+ if (session != null) {
+ session.onProtocolMessageReceived(msg);
+ }
+ }
+
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
+ for (SdlSession session : listenerList) {
+ if (session.getSessionId() == 0) {
+ session.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
+ break;
+ }
+ }
+
+ if (sessionType.equals(SessionType.NAV) || sessionType.equals(SessionType.PCM) || isEncrypted){
+ SdlSession session = findSessionById(sessionID);
+ if (session != null) {
+ session.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
+ }
+ }
+ }
+
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType,
+ byte sessionID, String correlationID) {
+ SdlSession session = findSessionById(sessionID);
+ if (session != null) {
+ session.onProtocolSessionEnded(sessionType, sessionID, correlationID);
+ }
+ }
+
+ @Override
+ public void onProtocolError(String info, Exception e) {
+ for (SdlSession session : listenerList) {
+ session.onProtocolError(info, e);
+ }
+ }
+
+ @Override
+ public void onProtocolSessionStartedNACKed(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+ SdlSession session = findSessionById(sessionID);
+ if (session != null) {
+ session.onProtocolSessionStartedNACKed(sessionType,
+ sessionID, version, correlationID, rejectedParams);
+ }
+ }
+
+ @Override
+ public void onHeartbeatTimedOut(byte sessionID) {
+ SdlSession session = findSessionById(sessionID);
+ if (session != null) {
+ session.onHeartbeatTimedOut(sessionID);
+ }
+ }
+
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType, byte sessionID, String correlationID) {
+ SdlSession session = findSessionById(sessionID);
+ if (session != null) {
+ session.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
+ }
+ }
+
+ @Override
+ public void onProtocolServiceDataACK(SessionType serviceType, int dataSize, byte sessionID) {
+ SdlSession session = findSessionById(sessionID);
+ if (session != null) {
+ session.onProtocolServiceDataACK(serviceType, dataSize, sessionID);
+ }
+ }
+
+ @Override
+ public void onAuthTokenReceived(String authToken, byte sessionID) {
+ SdlSession session = findSessionById(sessionID);
+ if (session != null) {
+ session.onAuthTokenReceived(authToken,sessionID);
+ }
+ }
+ }
+
+ public int getRegisterCount() {
+ return listenerList.size();
+ }
+
+ @Override
+ public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {
+ SdlSession mySession = findSessionById(sessionID);
+ if (mySession == null) return;
+
+ if (mySession._outgoingHeartbeatMonitor != null) {
+ mySession._outgoingHeartbeatMonitor.heartbeatReceived();
+ }
+ if (mySession._incomingHeartbeatMonitor != null) {
+ mySession._incomingHeartbeatMonitor.heartbeatReceived();
+ }
+ }
+
+ @Override
+ public void onProtocolHeartbeatACK(SessionType sessionType, byte sessionID) {
+ SdlSession mySession = findSessionById(sessionID);
+ if (mySession == null) return;
+
+ if (mySession._outgoingHeartbeatMonitor != null) {
+ mySession._outgoingHeartbeatMonitor.heartbeatACKReceived();
+ }
+ if (mySession._incomingHeartbeatMonitor != null) {
+ mySession._incomingHeartbeatMonitor.heartbeatACKReceived();
+ }
+ }
+
+ @Override
+ public void onResetOutgoingHeartbeat(SessionType sessionType, byte sessionID){
+
+ SdlSession mySession = findSessionById(sessionID);
+ if (mySession == null) return;
+
+ if (mySession._outgoingHeartbeatMonitor != null) {
+ mySession._outgoingHeartbeatMonitor.notifyTransportActivity();
+ }
+ }
+
+ @Override
+ public void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID){
+
+ SdlSession mySession = findSessionById(sessionID);
+ if (mySession == null) return;
+
+ if (mySession._incomingHeartbeatMonitor != null) {
+ mySession._incomingHeartbeatMonitor.notifyTransportActivity();
+ }
+ }
+
+ public void forceHardwareConnectEvent(TransportType type){
+ if(_transport == null){
+ Log.w(TAG, "Unable to force connect, transport was null!");
+ return;
+ }
+ if(isLegacyModeEnabled()){//We know we should no longer be in legacy mode for future connections, so lets clear out that flag
+ enableLegacyMode(false,null);
+ }
+ if(_transport!=null && (_transport.getTransportType()==TransportType.MULTIPLEX)){ //This is only valid for the multiplex connection
+ MultiplexTransport multi = ((MultiplexTransport)_transport);
+ MultiplexTransportConfig config = multi.getConfig();
+ ComponentName tempCompName = SdlBroadcastReceiver.consumeQueuedRouterService();
+ if(config.getService() != null && config.getService().equals(tempCompName)){ //If this is the same service that just connected that we are already looking at. Attempt to reconnect
+ if(!multi.getIsConnected() && multi.isDisconnecting() ){ //If we aren't able to force a connection it means the
+ _transport = new MultiplexTransport(config,this);
+ try {
+ startTransport();
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+ }else if(tempCompName!=null){
+ //We have a conflicting service request
+ Log.w(TAG, "Conflicting services. Disconnecting from current and connecting to new");
+ //Log.w(TAG, "Old service " + config.getService().toShortString());
+ //Log.w(TAG, "New Serivce " + tempCompName.toString());
+ multi.disconnect();
+ config.setService(tempCompName);
+ _transport = new MultiplexTransport(config,this);
+ try {
+ startTransport();
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+
+ }
+ }else if(_transport.getTransportType()==TransportType.BLUETOOTH
+ && !_transport.getIsConnected()){
+ if(cachedMultiConfig!=null){
+ //We are in legacy mode, but just received a force connect. The router service should never be pointing us here if we are truely in legacy mode
+ ComponentName tempCompName = SdlBroadcastReceiver.consumeQueuedRouterService();
+ RouterServiceValidator vlad = new RouterServiceValidator(cachedMultiConfig.getContext(),tempCompName);
+ if(vlad.validate()){
+ cachedMultiConfig.setService(tempCompName);
+ //We are not connected yet so we should be able to close down
+ _transport.disconnect(); //This will force us into the
+ }else{
+ //Log.d(TAG, "Router service not trusted during force connect. Ignoring.");
+ return;
+ }
+ }else{
+ //Log.i(TAG, "No cached multiplexing config, ignoring");
+ //_transport.disconnect();
+ return;
+ }
+ Log.w(TAG, "Using own transport, but not connected. Attempting to join multiplexing");
+ }else{
+ Log.w(TAG, "Currently in legacy mode connected to own transport service. Nothing will take place on trnasport cycle");
+ }
+ }
+
+ public static void enableLegacyMode(boolean enable, TransportType type){
+ synchronized(TRANSPORT_REFERENCE_LOCK) {
+ if(enable){
+ legacyTransportRequest = type;
+ }else{
+ legacyTransportRequest = null;
+ }
+ }
+ }
+ public static boolean isLegacyModeEnabled(){
+ synchronized(TRANSPORT_REFERENCE_LOCK) {
+ return (legacyTransportRequest!=null);
+ }
+ }
+
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,
+ byte sessionID, String correlationID) {
+ _connectionListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
+
+ }
+
+ @Override
+ public void onProtocolServiceDataACK(SessionType serviceType, int dataSize, byte sessionID) {
+ _connectionListener.onProtocolServiceDataACK(serviceType, dataSize, sessionID);
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
new file mode 100644
index 000000000..58fa8d576
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
@@ -0,0 +1,829 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.SdlConnection;
+
+import android.annotation.SuppressLint;
+import android.os.Build;
+import android.util.Log;
+import android.view.Surface;
+
+import com.smartdevicelink.encoder.SdlEncoder;
+import com.smartdevicelink.encoder.VirtualDisplayEncoder;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitor;
+import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitorListener;
+import com.smartdevicelink.proxy.LockScreenManager;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
+import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+import com.smartdevicelink.security.ISecurityInitializedListener;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.streaming.AbstractPacketizer;
+import com.smartdevicelink.streaming.IStreamListener;
+import com.smartdevicelink.streaming.StreamPacketizer;
+import com.smartdevicelink.streaming.StreamRPCPacketizer;
+import com.smartdevicelink.streaming.video.RTPH264Packetizer;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.MultiplexTransport;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.Version;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+@Deprecated
+public class SdlSession implements ISdlConnectionListener, IHeartbeatMonitorListener, IStreamListener, ISecurityInitializedListener {
+
+ private static final String TAG = "SdlSession";
+
+ protected final static int BUFF_READ_SIZE = 1024;
+
+ private static CopyOnWriteArrayList<SdlConnection> shareConnections = new CopyOnWriteArrayList<SdlConnection>();
+
+ private byte wiproProcolVer;
+
+ protected BaseTransportConfig transportConfig;
+ protected ISdlConnectionListener sessionListener;
+ protected LockScreenManager lockScreenMan = new LockScreenManager();
+ protected SdlSecurityBase sdlSecurity = null;
+ protected VideoStreamingParameters desiredVideoParams = null;
+ protected VideoStreamingParameters acceptedVideoParams = null;
+
+ protected byte sessionId;
+ protected int sessionHashId = 0;
+ protected HashMap<SessionType, CopyOnWriteArrayList<ISdlServiceListener>> serviceListeners;
+ protected CopyOnWriteArrayList<SessionType> encryptedServices = new CopyOnWriteArrayList<SessionType>();
+
+
+ SdlConnection _sdlConnection = null;
+
+ IHeartbeatMonitor _outgoingHeartbeatMonitor = null;
+ IHeartbeatMonitor _incomingHeartbeatMonitor = null;
+
+ StreamRPCPacketizer mRPCPacketizer = null;
+ AbstractPacketizer mVideoPacketizer = null;
+ StreamPacketizer mAudioPacketizer = null;
+ SdlEncoder mSdlEncoder = null;
+ VirtualDisplayEncoder virtualDisplayEncoder = null;
+
+ public static SdlSession createSession(byte wiproVersion, ISdlConnectionListener listener, BaseTransportConfig btConfig) {
+
+ SdlSession session = new SdlSession();
+ session.wiproProcolVer = wiproVersion;
+ session.sessionListener = listener;
+ session.transportConfig = btConfig;
+
+ return session;
+ }
+
+ public BaseTransportConfig getTransportConfig() {
+ return this.transportConfig;
+ }
+
+ public LockScreenManager getLockScreenMan() {
+ return lockScreenMan;
+ }
+
+
+ public IHeartbeatMonitor getOutgoingHeartbeatMonitor() {
+ return _outgoingHeartbeatMonitor;
+ }
+
+ public IHeartbeatMonitor getIncomingHeartbeatMonitor() {
+ return _incomingHeartbeatMonitor;
+ }
+
+ public void setOutgoingHeartbeatMonitor(IHeartbeatMonitor outgoingHeartbeatMonitor) {
+ this._outgoingHeartbeatMonitor = outgoingHeartbeatMonitor;
+ _outgoingHeartbeatMonitor.setListener(this);
+ }
+
+ public void setIncomingHeartbeatMonitor(IHeartbeatMonitor incomingHeartbeatMonitor) {
+ this._incomingHeartbeatMonitor = incomingHeartbeatMonitor;
+ _incomingHeartbeatMonitor.setListener(this);
+ }
+
+ public int getSessionHashId() {
+ return this.sessionHashId;
+ }
+
+ public byte getSessionId() {
+ return this.sessionId;
+ }
+
+ public SdlConnection getSdlConnection() {
+ return this._sdlConnection;
+ }
+
+ public int getMtu(){
+ if(this._sdlConnection!=null){
+ return this._sdlConnection.getWiProProtocol().getMtu();
+ }else{
+ return 0;
+ }
+ }
+
+ public long getMtu(SessionType type) {
+ if (this._sdlConnection != null) {
+ return this._sdlConnection.getWiProProtocol().getMtu(type);
+ } else {
+ return 0;
+ }
+ }
+
+ public void close() {
+ if (sdlSecurity != null)
+ {
+ sdlSecurity.resetParams();
+ sdlSecurity.shutDown();
+ }
+
+ if (_sdlConnection != null) { //sessionId == 0 means session is not started.
+ //_sdlConnection.unregisterSession(this);
+
+ if (_sdlConnection.getRegisterCount() == 0) {
+ shareConnections.remove(_sdlConnection);
+ }
+
+ _sdlConnection = null;
+ }
+ }
+
+ public void resetSession(){
+
+ }
+
+ public void startStream(InputStream is, SessionType sType, byte rpcSessionID) throws IOException {
+ if (sType.equals(SessionType.NAV))
+ {
+ // protocol is fixed to RAW
+ StreamPacketizer packetizer = new StreamPacketizer(this, is, sType, rpcSessionID, this);
+ packetizer.sdlConnection = this.getSdlConnection();
+ mVideoPacketizer = packetizer;
+ mVideoPacketizer.start();
+ }
+ else if (sType.equals(SessionType.PCM))
+ {
+ mAudioPacketizer = new StreamPacketizer(this, is, sType, rpcSessionID, this);
+ mAudioPacketizer.sdlConnection = this.getSdlConnection();
+ mAudioPacketizer.start();
+ }
+ }
+
+ @SuppressLint("NewApi")
+ public OutputStream startStream(SessionType sType, byte rpcSessionID) throws IOException {
+ OutputStream os = new PipedOutputStream();
+ InputStream is = null;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
+ is = new PipedInputStream((PipedOutputStream) os, BUFF_READ_SIZE);
+ } else {
+ is = new PipedInputStream((PipedOutputStream) os);
+ }
+ if (sType.equals(SessionType.NAV))
+ {
+ // protocol is fixed to RAW
+ StreamPacketizer packetizer = new StreamPacketizer(this, is, sType, rpcSessionID, this);
+ packetizer.sdlConnection = this.getSdlConnection();
+ mVideoPacketizer = packetizer;
+ mVideoPacketizer.start();
+ }
+ else if (sType.equals(SessionType.PCM))
+ {
+ mAudioPacketizer = new StreamPacketizer(this, is, sType, rpcSessionID, this);
+ mAudioPacketizer.sdlConnection = this.getSdlConnection();
+ mAudioPacketizer.start();
+ }
+ else
+ {
+ os.close();
+ is.close();
+ return null;
+ }
+ return os;
+ }
+
+ public IVideoStreamListener startVideoStream() {
+ byte rpcSessionID = getSessionId();
+ VideoStreamingProtocol protocol = getAcceptedProtocol();
+ try {
+ switch (protocol) {
+ case RAW: {
+ StreamPacketizer packetizer = new StreamPacketizer(this, null, SessionType.NAV, rpcSessionID, this);
+ packetizer.sdlConnection = this.getSdlConnection();
+ mVideoPacketizer = packetizer;
+ mVideoPacketizer.start();
+ return packetizer;
+ }
+ case RTP: {
+ RTPH264Packetizer packetizer = new RTPH264Packetizer(this, SessionType.NAV, rpcSessionID, this);
+ mVideoPacketizer = packetizer;
+ mVideoPacketizer.start();
+ return packetizer;
+ }
+ default:
+ Log.e(TAG, "Protocol " + protocol + " is not supported.");
+ return null;
+ }
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ public IAudioStreamListener startAudioStream() {
+ byte rpcSessionID = getSessionId();
+ try {
+ StreamPacketizer packetizer = new StreamPacketizer(this, null, SessionType.PCM, rpcSessionID, this);
+ packetizer.sdlConnection = this.getSdlConnection();
+ mAudioPacketizer = packetizer;
+ mAudioPacketizer.start();
+ return packetizer;
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ public void startRPCStream(InputStream is, RPCRequest request, SessionType sType, byte rpcSessionID, byte wiproVersion) {
+ try {
+ mRPCPacketizer = new StreamRPCPacketizer(null, this, is, request, sType, rpcSessionID, wiproVersion, 0, this);
+ mRPCPacketizer.start();
+ } catch (Exception e) {
+ Log.e(TAG, "Unable to start streaming:" + e.toString());
+ }
+ }
+
+ public OutputStream startRPCStream(RPCRequest request, SessionType sType, byte rpcSessionID, byte wiproVersion) {
+ try {
+ OutputStream os = new PipedOutputStream();
+ InputStream is = new PipedInputStream((PipedOutputStream) os);
+ mRPCPacketizer = new StreamRPCPacketizer(null, this, is, request, sType, rpcSessionID, wiproVersion, 0, this);
+ mRPCPacketizer.start();
+ return os;
+ } catch (Exception e) {
+ Log.e(TAG, "Unable to start streaming:" + e.toString());
+ }
+ return null;
+ }
+
+ public void pauseRPCStream()
+ {
+ if (mRPCPacketizer != null)
+ {
+ mRPCPacketizer.pause();
+ }
+ }
+
+ public void resumeRPCStream()
+ {
+ if (mRPCPacketizer != null)
+ {
+ mRPCPacketizer.resume();
+ }
+ }
+
+ public void stopRPCStream()
+ {
+ if (mRPCPacketizer != null)
+ {
+ mRPCPacketizer.stop();
+ }
+ }
+
+ public boolean stopAudioStream()
+ {
+ if (mAudioPacketizer != null)
+ {
+ mAudioPacketizer.stop();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean stopVideoStream()
+ {
+ if (mVideoPacketizer != null)
+ {
+ mVideoPacketizer.stop();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean pauseAudioStream()
+ {
+ if (mAudioPacketizer != null)
+ {
+ mAudioPacketizer.pause();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean pauseVideoStream()
+ {
+ if (mVideoPacketizer != null)
+ {
+ mVideoPacketizer.pause();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean resumeAudioStream()
+ {
+ if (mAudioPacketizer != null)
+ {
+ mAudioPacketizer.resume();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean resumeVideoStream()
+ {
+ if (mVideoPacketizer != null)
+ {
+ mVideoPacketizer.resume();
+ return true;
+ }
+ return false;
+ }
+
+ public Surface createOpenGLInputSurface(int frameRate, int iFrameInterval, int width,
+ int height, int bitrate, SessionType sType, byte rpcSessionID) {
+ IVideoStreamListener encoderListener = startVideoStream();
+ if (encoderListener == null) {
+ return null;
+ }
+
+ mSdlEncoder = new SdlEncoder();
+ mSdlEncoder.setFrameRate(frameRate);
+ mSdlEncoder.setFrameInterval(iFrameInterval);
+ mSdlEncoder.setFrameWidth(width);
+ mSdlEncoder.setFrameHeight(height);
+ mSdlEncoder.setBitrate(bitrate);
+ mSdlEncoder.setOutputListener(encoderListener);
+ return mSdlEncoder.prepareEncoder();
+ }
+
+ public void startEncoder () {
+ if(mSdlEncoder != null) {
+ mSdlEncoder.startEncoder();
+ }
+ }
+
+ public void releaseEncoder() {
+ if(mSdlEncoder != null) {
+ mSdlEncoder.releaseEncoder();
+ }
+ }
+
+ public void drainEncoder(boolean endOfStream) {
+ if(mSdlEncoder != null) {
+ mSdlEncoder.drainEncoder(endOfStream);
+ }
+ }
+
+ @Override
+ public void sendStreamPacket(ProtocolMessage pm) {
+ sendMessage(pm);
+ }
+
+ public void setSdlSecurity(SdlSecurityBase sec) {
+ sdlSecurity = sec;
+ }
+
+ public SdlSecurityBase getSdlSecurity() {
+ return sdlSecurity;
+ }
+
+ public void startService (SessionType serviceType, byte sessionID, boolean isEncrypted) {
+ if (_sdlConnection == null)
+ return;
+
+ if (isEncrypted)
+ {
+ if (sdlSecurity != null)
+ {
+ List<SessionType> serviceList = sdlSecurity.getServiceList();
+ if (!serviceList.contains(serviceType))
+ serviceList.add(serviceType);
+
+ sdlSecurity.initialize();
+ }
+ return;
+ }
+ _sdlConnection.startService(serviceType, sessionID, isEncrypted);
+ }
+
+ public void endService (SessionType serviceType, byte sessionID) {
+ if (_sdlConnection == null)
+ return;
+ _sdlConnection.endService(serviceType, sessionID);
+ }
+
+ protected void processControlService(ProtocolMessage msg) {
+ if (sdlSecurity == null)
+ return;
+ int ilen = msg.getData().length - 12;
+ byte[] data = new byte[ilen];
+ System.arraycopy(msg.getData(), 12, data, 0, ilen);
+
+ byte[] dataToRead = new byte[4096];
+
+ Integer iNumBytes = sdlSecurity.runHandshake(data, dataToRead);
+
+ if (iNumBytes == null || iNumBytes <= 0)
+ return;
+
+ byte[] returnBytes = new byte[iNumBytes];
+ System.arraycopy(dataToRead, 0, returnBytes, 0, iNumBytes);
+ ProtocolMessage protocolMessage = new ProtocolMessage();
+ protocolMessage.setSessionType(SessionType.CONTROL);
+ protocolMessage.setData(returnBytes);
+ protocolMessage.setFunctionID(0x01);
+ protocolMessage.setVersion(wiproProcolVer);
+ protocolMessage.setSessionID(getSessionId());
+
+ //sdlSecurity.hs();
+
+ sendMessage(protocolMessage);
+ }
+
+ public String getBroadcastComment(BaseTransportConfig myTransport) {
+ SdlConnection connection = null;
+ if (myTransport.shareConnection()) {
+ connection = findTheProperConnection(myTransport);
+ } else {
+ connection = this._sdlConnection;
+ }
+
+ if (connection != null)
+ return connection.getBroadcastComment();
+
+ return "";
+ }
+
+
+ public void startSession() throws SdlException {
+ SdlConnection connection = null;
+ if (this.transportConfig.shareConnection()) {
+ connection = findTheProperConnection(this.transportConfig);
+
+ if (connection == null) {
+ connection = new SdlConnection(this.transportConfig);
+ shareConnections.add(connection);
+ }
+ } else {
+ connection = new SdlConnection(this.transportConfig);
+ }
+
+ this._sdlConnection = connection;
+ connection.registerSession(this); //Handshake will start when register.
+ }
+
+ protected void initialiseSession() {
+ if (_outgoingHeartbeatMonitor != null) {
+ _outgoingHeartbeatMonitor.start();
+ }
+ if (_incomingHeartbeatMonitor != null) {
+ _incomingHeartbeatMonitor.start();
+ }
+ }
+
+ public void sendMessage(ProtocolMessage msg) {
+ if (_sdlConnection == null)
+ return;
+ _sdlConnection.sendMessage(msg);
+ }
+
+ public TransportType getCurrentTransportType() {
+ if (_sdlConnection == null)
+ return null;
+ return _sdlConnection.getCurrentTransportType();
+ }
+
+ public boolean getIsConnected() {
+ if (_sdlConnection == null)
+ return false;
+ return _sdlConnection != null && _sdlConnection.getIsConnected();
+ }
+
+ public boolean isServiceProtected(SessionType sType) {
+ return encryptedServices.contains(sType);
+ }
+
+ @Override
+ public void onTransportDisconnected(String info) {
+ this.sessionListener.onTransportDisconnected(info);
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) {
+ this.sessionListener.onTransportDisconnected(info);
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+ this.sessionListener.onTransportError(info, e);
+ }
+
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+ if (msg.getSessionType().equals(SessionType.CONTROL)) {
+ processControlService(msg);
+ return;
+ }
+
+ this.sessionListener.onProtocolMessageReceived(msg);
+ }
+
+ @Override
+ public void onHeartbeatTimedOut(byte sessionID) {
+ this.sessionListener.onHeartbeatTimedOut(sessionID);
+
+ }
+
+
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
+ this.sessionId = sessionID;
+ lockScreenMan.setSessionID(sessionID);
+ if (sessionType.eq(SessionType.RPC)){
+ sessionHashId = hashID;
+ wiproProcolVer = version;
+ }
+ if (isEncrypted)
+ encryptedServices.addIfAbsent(sessionType);
+ this.sessionListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceStarted(this, sessionType, isEncrypted);
+ }
+ }
+ //if (version == 3)
+ initialiseSession();
+
+ }
+
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
+ String correlationID) {
+ this.sessionListener.onProtocolSessionEnded(sessionType, sessionID, correlationID);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceEnded(this, sessionType);
+ }
+ }
+ encryptedServices.remove(sessionType);
+ }
+
+ @Override
+ public void onProtocolError(String info, Exception e) {
+ this.sessionListener.onProtocolError(info, e);
+ }
+
+ @Override
+ public void sendHeartbeat(IHeartbeatMonitor monitor) {
+ Log.d(TAG, "Asked to send heartbeat");
+ if (_sdlConnection != null)
+ _sdlConnection.sendHeartbeat(this);
+ }
+
+ @Override
+ public void heartbeatTimedOut(IHeartbeatMonitor monitor) {
+ if (_sdlConnection != null)
+ _sdlConnection._connectionListener.onHeartbeatTimedOut(this.sessionId);
+ close();
+ }
+
+ private static SdlConnection findTheProperConnection(BaseTransportConfig config) {
+ SdlConnection connection = null;
+
+ int minCount = 0;
+ for (SdlConnection c : shareConnections) {
+ if (c.getCurrentTransportType() == config.getTransportType()) {
+ if (minCount == 0 || minCount >= c.getRegisterCount()) {
+ connection = c;
+ minCount = c.getRegisterCount();
+ }
+ }
+ }
+
+ return connection;
+ }
+
+ @Override
+ public void onProtocolSessionStartedNACKed(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+ this.sessionListener.onProtocolSessionStartedNACKed(sessionType,
+ sessionID, version, correlationID, rejectedParams);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceError(this, sessionType, "Start "+ sessionType.toString() +" Service NACK'ed");
+ }
+ }
+ }
+
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,
+ byte sessionID, String correlationID) {
+ this.sessionListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceError(this, sessionType, "End "+ sessionType.toString() +" Service NACK'ed");
+ }
+ }
+ }
+
+ @Override
+ public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID) {
+ this.sessionListener.onProtocolServiceDataACK(sessionType, dataSize, sessionID);
+ }
+
+ @Override
+ public void onAuthTokenReceived(String authToken, byte sessionId) {
+ this.sessionListener.onAuthTokenReceived(authToken, sessionId);
+ }
+
+ @Override
+ public void onSecurityInitialized() {
+
+ if (_sdlConnection != null && sdlSecurity != null)
+ {
+ List<SessionType> list = sdlSecurity.getServiceList();
+
+ SessionType service;
+ ListIterator<SessionType> iter = list.listIterator();
+
+ while (iter.hasNext()) {
+ service = iter.next();
+
+ if (service != null)
+ _sdlConnection.startService(service, getSessionId(), true);
+
+ iter.remove();
+ }
+ }
+ }
+
+ public void clearConnection(){
+ _sdlConnection = null;
+ }
+
+ public void checkForOpenMultiplexConnection(SdlConnection connection){
+ removeConnection(connection);
+ connection.unregisterSession(this);
+ _sdlConnection = null;
+ for (SdlConnection c : shareConnections) {
+ if (c.getCurrentTransportType() == TransportType.MULTIPLEX) {
+ if(c.getIsConnected() || ((MultiplexTransport)c._transport).isPendingConnected()){
+ _sdlConnection = c;
+ try {
+ _sdlConnection.registerSession(this);//Handshake will start when register.
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ return;
+ }
+
+ }
+ }
+ }
+ public static boolean removeConnection(SdlConnection connection){
+ return shareConnections.remove(connection);
+ }
+
+ public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
+ if(serviceListeners == null){
+ serviceListeners = new HashMap<>();
+ }
+ if(serviceType != null && sdlServiceListener != null){
+ if(!serviceListeners.containsKey(serviceType)){
+ serviceListeners.put(serviceType,new CopyOnWriteArrayList<ISdlServiceListener>());
+ }
+ serviceListeners.get(serviceType).add(sdlServiceListener);
+ }
+ }
+
+ public boolean removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
+ if(serviceListeners!= null && serviceType != null && sdlServiceListener != null && serviceListeners.containsKey(serviceType)){
+ return serviceListeners.get(serviceType).remove(sdlServiceListener);
+ }
+ return false;
+ }
+
+
+ public HashMap<SessionType, CopyOnWriteArrayList<ISdlServiceListener>> getServiceListeners(){
+ return serviceListeners;
+ }
+
+ public void setDesiredVideoParams(VideoStreamingParameters params){
+ this.desiredVideoParams = params;
+ }
+
+ /**
+ * Returns the currently set desired video streaming parameters. If there haven't been any set,
+ * the default options will be returned and set for this instance.
+ * @return
+ */
+ public VideoStreamingParameters getDesiredVideoParams(){
+ if(desiredVideoParams == null){
+ desiredVideoParams = new VideoStreamingParameters();
+ }
+ return desiredVideoParams;
+ }
+
+ public void setAcceptedVideoParams(VideoStreamingParameters params){
+ this.acceptedVideoParams = params;
+ }
+
+ public VideoStreamingParameters getAcceptedVideoParams(){
+ return acceptedVideoParams;
+ }
+
+ private VideoStreamingProtocol getAcceptedProtocol() {
+ // acquire default protocol (RAW)
+ VideoStreamingProtocol protocol = new VideoStreamingParameters().getFormat().getProtocol();
+
+ if (acceptedVideoParams != null) {
+ VideoStreamingFormat format = acceptedVideoParams.getFormat();
+ if (format != null && format.getProtocol() != null) {
+ protocol = format.getProtocol();
+ }
+ }
+
+ return protocol;
+ }
+
+ public Version getProtocolVersion(){
+ //Since this session version never supported a minor protocol version this should be fine
+ return new Version(wiproProcolVer,0,0);
+ }
+
+ /**
+ * Check to see if a transport is available to start/use the supplied service.
+ * @param sessionType the session that should be checked for transport availability
+ * @return true if there is either a supported
+ * transport currently connected or a transport is
+ * available to connect with for the supplied service type.
+ * <br>false if there is no
+ * transport connected to support the service type in question and
+ * no possibility in the foreseeable future.
+ */
+ public boolean isTransportForServiceAvailable(SessionType sessionType){
+ return _sdlConnection!= null
+ && _sdlConnection._transport!= null
+ && _sdlConnection._transport.getIsConnected()
+ && ((sessionType == SessionType.RPC || sessionType == SessionType.CONTROL || sessionType == SessionType.BULK_DATA ) //If this is a service that can run on any transport just return true
+ || (_sdlConnection._transport.getTransportType() == TransportType.USB || _sdlConnection._transport.getTransportType() == TransportType.TCP));
+ }
+
+
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java
new file mode 100644
index 000000000..c0294b1a3
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.SdlConnection;
+
+import android.util.Log;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.protocol.ISdlProtocol;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.SdlProtocol;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitor;
+import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.Version;
+
+import java.util.List;
+import java.util.ListIterator;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+@SuppressWarnings({"WeakerAccess", "deprecation"})
+public class SdlSession2 extends SdlSession implements ISdlProtocol{
+ private static final String TAG = "SdlSession2";
+
+
+ final protected SdlProtocol sdlProtocol;
+
+ @SuppressWarnings("SameReturnValue")
+ @Deprecated
+ public static SdlSession2 createSession(byte protocolVersion, ISdlConnectionListener listener, BaseTransportConfig btConfig) {
+ return null;
+ }
+
+ public SdlSession2(ISdlConnectionListener listener, MultiplexTransportConfig config){
+ this.transportConfig = config;
+ this.sessionListener = listener;
+ this.sdlProtocol = new SdlProtocol(this,config);
+
+ }
+
+ @Deprecated
+ @Override
+ public SdlConnection getSdlConnection() {
+ return null;
+ }
+
+ @Override
+ public int getMtu(){
+ if(this.sdlProtocol!=null){
+ return this.sdlProtocol.getMtu();
+ }else{
+ return 0;
+ }
+ }
+
+ @Override
+ public long getMtu(SessionType type) {
+ if (this.sdlProtocol != null) {
+ return this.sdlProtocol.getMtu(type);
+ } else {
+ return 0;
+ }
+ }
+
+ public void close() {
+ if (sdlSecurity != null)
+ {
+ sdlSecurity.resetParams();
+ sdlSecurity.shutDown();
+ }
+ if(sdlProtocol != null){
+ sdlProtocol.endSession(sessionId, sessionHashId);
+ }
+ }
+
+ @Override
+ public void resetSession (){
+ sdlProtocol.resetSession();
+ }
+
+ @SuppressWarnings("ConstantConditions")
+ @Override
+ public void startService (SessionType serviceType, byte sessionID, boolean isEncrypted) {
+ if (isEncrypted){
+ if (sdlSecurity != null){
+ List<SessionType> serviceList = sdlSecurity.getServiceList();
+ if (!serviceList.contains(serviceType))
+ serviceList.add(serviceType);
+
+ sdlSecurity.initialize();
+ }
+ return;
+ }
+ sdlProtocol.startService(serviceType, sessionID, isEncrypted);
+ }
+
+ @Override
+ public void endService (SessionType serviceType, byte sessionID) {
+ if (sdlProtocol == null) {
+ return;
+ }
+ sdlProtocol.endService(serviceType,sessionID);
+ }
+
+
+ public String getBroadcastComment(BaseTransportConfig myTransport) {
+ return "Multiplexing";
+ }
+
+
+ @SuppressWarnings("RedundantThrows")
+ @Override
+ public void startSession() throws SdlException {
+ sdlProtocol.start();
+ }
+
+
+ @Override
+ public void sendMessage(ProtocolMessage msg) {
+ if (sdlProtocol == null){
+ return;
+ }
+ sdlProtocol.sendMessage(msg);
+ }
+
+ @Override
+ public TransportType getCurrentTransportType() {
+ return TransportType.MULTIPLEX;
+ }
+
+ @Override
+ public boolean getIsConnected() {
+ return sdlProtocol != null && sdlProtocol.isConnected();
+ }
+
+
+ public void shutdown(String info){
+ Log.d(TAG, "Shutdown - " + info);
+ this.sessionListener.onTransportDisconnected(info);
+
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) {
+ this.sessionListener.onTransportDisconnected(info, altTransportAvailable, this.transportConfig);
+ }
+
+ /**
+ * Get the current protocol version used by this session
+ * @return Version that represents the Protocol version being used
+ */
+ @Override
+ public Version getProtocolVersion(){
+ if(sdlProtocol!=null){
+ return sdlProtocol.getProtocolVersion();
+ }
+ return new Version(1,0,0);
+ }
+
+
+ /* ***********************************************************************************************************************************************************************
+ * ***************************************************************** IProtocol Listener ********************************************************************************
+ *************************************************************************************************************************************************************************/
+
+ @Override
+ public void onProtocolMessageBytesToSend(SdlPacket packet) {
+ //Log.d(TAG, "onProtocolMessageBytesToSend - " + packet.getTransportType());
+ sdlProtocol.sendPacket(packet);
+ }
+
+
+ public void onProtocolSessionStartedNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams){
+ onProtocolSessionNACKed(sessionType,sessionID,version,correlationID,rejectedParams);
+ }
+
+ @Override
+ public void onProtocolSessionNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+ this.sessionListener.onProtocolSessionStartedNACKed(sessionType,
+ sessionID, version, correlationID, rejectedParams);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceError(this, sessionType, "Start "+ sessionType.toString() +" Service NAKed");
+ }
+ }
+ }
+
+ /* Not supported methods from IProtocolListener */
+ @Override
+ public void sendHeartbeat(IHeartbeatMonitor monitor) {/* Not supported */ }
+ @Override
+ public void heartbeatTimedOut(IHeartbeatMonitor monitor) {/* Not supported */}
+ @Override
+ public void onHeartbeatTimedOut(byte sessionId){ /* Not supported */}
+ @Override
+ public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) { /* Not supported */}
+ @Override
+ public void onProtocolHeartbeatACK(SessionType sessionType, byte sessionID) {/* Not supported */}
+ @Override
+ public void onResetOutgoingHeartbeat(SessionType sessionType, byte sessionID) {/* Not supported */}
+ @Override
+ public void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID) {/* Not supported */}
+ @Override
+ public void onAuthTokenReceived(String authToken, byte sessionID){/* Do nothing */ }
+
+ /* ***********************************************************************************************************************************************************************
+ * ***************************************************************** Security Listener *********************************************************************************
+ *************************************************************************************************************************************************************************/
+
+
+ @Override
+ public void onSecurityInitialized() {
+
+ if (sdlProtocol != null && sdlSecurity != null)
+ {
+ List<SessionType> list = sdlSecurity.getServiceList();
+
+ SessionType service;
+ ListIterator<SessionType> iter = list.listIterator();
+
+ while (iter.hasNext()) {
+ service = iter.next();
+
+ if (service != null)
+ sdlProtocol.startService(service, getSessionId(), true);
+
+ iter.remove();
+ }
+ }
+ }
+
+ @Override
+ public void stopStream(SessionType serviceType) {
+ if(SessionType.NAV.equals(serviceType)){
+ stopVideoStream();
+ }else if(SessionType.PCM.equals(serviceType)){
+ stopAudioStream();
+ }
+
+ }
+
+ @Override
+ public void onAuthTokenReceived(String authToken) {
+ sessionListener.onAuthTokenReceived(authToken,sessionId);
+ }
+
+ /**
+ * Check to see if a transport is available to start/use the supplied service.
+ * @param sessionType the session that should be checked for transport availability
+ * @return true if there is either a supported
+ * transport currently connected or a transport is
+ * available to connect with for the supplied service type.
+ * <br>false if there is no
+ * transport connected to support the service type in question and
+ * no possibility in the foreseeable future.
+ */
+ @Override
+ public boolean isTransportForServiceAvailable(SessionType sessionType){
+ return sdlProtocol!=null && sdlProtocol.isTransportForServiceAvailable(sessionType);
+ }
+
+
+ @Override
+ @Deprecated
+ public void clearConnection(){/* Not supported */}
+
+ @SuppressWarnings("SameReturnValue")
+ @Deprecated
+ public static boolean removeConnection(SdlConnection connection){/* Not supported */ return false;}
+
+ @Deprecated
+ @Override
+ public void checkForOpenMultiplexConnection(SdlConnection connection){/* Not supported */}
+
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java
index 362564da8..362564da8 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java
new file mode 100644
index 000000000..dafb3207c
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java
@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.encoder;
+
+import android.annotation.TargetApi;
+import android.media.MediaCodec;
+import android.media.MediaCodecInfo;
+import android.media.MediaFormat;
+import android.os.Build;
+import android.util.Log;
+import android.view.Surface;
+
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+
+import java.io.IOException;
+import java.io.PipedOutputStream;
+import java.nio.ByteBuffer;
+
+@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
+public class SdlEncoder {
+
+ private static final String TAG = "SdlEncoder";
+
+ // parameters for the encoder
+ private static final String _MIME_TYPE = "video/avc"; // H.264/AVC video
+ private static final long KEEPALIVE_INTERVAL_MSEC = 100;
+
+ // private static final String MIME_TYPE = "video/mp4v-es"; //MPEG4 video
+ private int frameRate = 30;
+ private int frameInterval = 5;
+ private int frameWidth = 800;
+ private int frameHeight = 480;
+ private int bitrate = 6000000;
+
+ // encoder state
+ private MediaCodec mEncoder;
+ private PipedOutputStream mOutputStream;
+ private IVideoStreamListener mOutputListener;
+ private long mLastEmittedFrameTimestamp;
+
+ // allocate one of these up front so we don't need to do it every time
+ private MediaCodec.BufferInfo mBufferInfo;
+
+ // Codec-specific data (SPS and PPS)
+ private byte[] mH264CodecSpecificData = null;
+
+ public SdlEncoder () {
+ }
+ public void setFrameRate(int iVal){
+ frameRate = iVal;
+ }
+ public void setFrameInterval(int iVal){
+ frameInterval = iVal;
+ }
+ public void setFrameWidth(int iVal){
+ frameWidth = iVal;
+ }
+ public void setFrameHeight(int iVal){
+ frameHeight = iVal;
+ }
+ public void setBitrate(int iVal){
+ bitrate = iVal;
+ }
+ public void setOutputStream(PipedOutputStream mStream){
+ mOutputStream = mStream;
+ }
+ public void setOutputListener(IVideoStreamListener listener) {
+ mOutputListener = listener;
+ }
+ public Surface prepareEncoder () {
+
+ mBufferInfo = new MediaCodec.BufferInfo();
+
+ MediaFormat format = MediaFormat.createVideoFormat(_MIME_TYPE, frameWidth,
+ frameHeight);
+
+ // Set some properties. Failing to specify some of these can cause the
+ // MediaCodec
+ // configure() call to throw an unhelpful exception.
+ format.setInteger(MediaFormat.KEY_COLOR_FORMAT,
+ MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
+ format.setInteger(MediaFormat.KEY_BIT_RATE, bitrate);
+ format.setInteger(MediaFormat.KEY_FRAME_RATE, frameRate);
+ format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, frameInterval);
+
+ // Create a MediaCodec encoder, and configure it with our format. Get a
+ // Surface
+ // we can use for input and wrap it with a class that handles the EGL
+ // work.
+ //
+ // If you want to have two EGL contexts -- one for display, one for
+ // recording --
+ // you will likely want to defer instantiation of CodecInputSurface
+ // until after the
+ // "display" EGL context is created, then modify the eglCreateContext
+ // call to
+ // take eglGetCurrentContext() as the share_context argument.
+ try {
+ mEncoder = MediaCodec.createEncoderByType(_MIME_TYPE);
+ } catch (Exception e) {e.printStackTrace();}
+
+ if(mEncoder != null) {
+ mEncoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
+ return mEncoder.createInputSurface();
+ } else {
+ return null;
+ }
+ }
+
+ public void startEncoder () {
+ if(mEncoder != null) {
+ mEncoder.start();
+ }
+ }
+
+ /**
+ * Releases encoder resources.
+ */
+ public void releaseEncoder() {
+ if (mEncoder != null) {
+ mEncoder.stop();
+ mEncoder.release();
+ mEncoder = null;
+ }
+ if (mOutputStream != null) {
+ try {
+ mOutputStream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ mOutputStream = null;
+ }
+ mH264CodecSpecificData = null;
+ }
+
+ /**
+ * Extracts all pending data from the encoder
+ * <p>
+ * If endOfStream is not set, this returns when there is no more data to
+ * drain. If it is set, we send EOS to the encoder, and then iterate until
+ * we see EOS on the output. Calling this with endOfStream set should be
+ * done once, right before stopping the muxer.
+ */
+ public void drainEncoder(boolean endOfStream) {
+ final int TIMEOUT_USEC = 10000;
+
+ if(mEncoder == null || (mOutputStream == null && mOutputListener == null)) {
+ return;
+ }
+ if (endOfStream) {
+ mEncoder.signalEndOfInputStream();
+ }
+
+ ByteBuffer[] encoderOutputBuffers = mEncoder.getOutputBuffers();
+ while (true) {
+ int encoderStatus = mEncoder.dequeueOutputBuffer(mBufferInfo,
+ TIMEOUT_USEC);
+ if (encoderStatus == MediaCodec.INFO_TRY_AGAIN_LATER) {
+ // no output available yet
+ if (!endOfStream) {
+ trySendVideoKeepalive();
+ break; // out of while
+ }
+ } else if (encoderStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
+ // not expected for an encoder
+ encoderOutputBuffers = mEncoder.getOutputBuffers();
+ } else if (encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+ if (mH264CodecSpecificData == null) {
+ MediaFormat format = mEncoder.getOutputFormat();
+ mH264CodecSpecificData = EncoderUtils.getCodecSpecificData(format);
+ } else {
+ Log.w(TAG, "Output format change notified more than once, ignoring.");
+ }
+ } else if (encoderStatus < 0) {
+ } else {
+ if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {
+ // If we already retrieve codec specific data via OUTPUT_FORMAT_CHANGED event,
+ // we do not need this data.
+ if (mH264CodecSpecificData != null) {
+ mBufferInfo.size = 0;
+ } else {
+ Log.i(TAG, "H264 codec specific data not retrieved yet.");
+ }
+ }
+
+ if (mBufferInfo.size != 0) {
+ ByteBuffer encoderOutputBuffer = encoderOutputBuffers[encoderStatus];
+ byte[] dataToWrite = null;
+ int dataOffset = 0;
+
+ // append SPS and PPS in front of every IDR NAL unit
+ if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0
+ && mH264CodecSpecificData != null) {
+ dataToWrite = new byte[mH264CodecSpecificData.length + mBufferInfo.size];
+ System.arraycopy(mH264CodecSpecificData, 0,
+ dataToWrite, 0, mH264CodecSpecificData.length);
+ dataOffset = mH264CodecSpecificData.length;
+ } else {
+ dataToWrite = new byte[mBufferInfo.size];
+ }
+
+ try {
+ encoderOutputBuffer.position(mBufferInfo.offset);
+ encoderOutputBuffer.limit(mBufferInfo.offset + mBufferInfo.size);
+
+ encoderOutputBuffer.get(dataToWrite, dataOffset, mBufferInfo.size);
+
+ emitFrame(dataToWrite);
+ } catch (Exception e) {}
+ }
+
+ mEncoder.releaseOutputBuffer(encoderStatus, false);
+
+ if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
+ break; // out of while
+ }
+ }
+ }
+ }
+
+ private void trySendVideoKeepalive() {
+ if (mH264CodecSpecificData == null) {
+ return;
+ }
+
+ try {
+ long timeSinceLastEmitted = System.currentTimeMillis() - mLastEmittedFrameTimestamp;
+ if (timeSinceLastEmitted >= KEEPALIVE_INTERVAL_MSEC) {
+ emitFrame(mH264CodecSpecificData);
+ }
+ } catch (IOException e) {}
+ }
+
+ private void emitFrame(final byte[] dataToWrite) throws IOException {
+ if (mOutputStream != null) {
+ mOutputStream.write(dataToWrite, 0, mBufferInfo.size);
+ } else if (mOutputListener != null) {
+ mOutputListener.sendFrame(
+ dataToWrite, 0, dataToWrite.length, mBufferInfo.presentationTimeUs);
+ }
+ mLastEmittedFrameTimestamp = System.currentTimeMillis();
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java
new file mode 100644
index 000000000..6b7f2a686
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java
@@ -0,0 +1,403 @@
+/*
+ * Copyright (c) 2017 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.encoder;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.hardware.display.DisplayManager;
+import android.hardware.display.VirtualDisplay;
+import android.media.MediaCodec;
+import android.media.MediaCodecInfo;
+import android.media.MediaFormat;
+import android.os.Build;
+import android.util.Log;
+import android.view.Display;
+import android.view.Surface;
+
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.proxy.rpc.ImageResolution;
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+
+import java.nio.ByteBuffer;
+
+@TargetApi(19)
+@SuppressWarnings("NullableProblems")
+public class VirtualDisplayEncoder {
+ private static final String TAG = "VirtualDisplayEncoder";
+ private VideoStreamingParameters streamingParams = new VideoStreamingParameters();
+ private DisplayManager mDisplayManager;
+ private volatile MediaCodec mVideoEncoder = null;
+ private volatile MediaCodec.BufferInfo mVideoBufferInfo = null;
+ private volatile Surface inputSurface = null;
+ private volatile VirtualDisplay virtualDisplay = null;
+ private IVideoStreamListener mOutputListener;
+ private Boolean initPassed = false;
+ private final Object STREAMING_LOCK = new Object();
+
+ // Codec-specific data (SPS and PPS)
+ private byte[] mH264CodecSpecificData = null;
+
+ //For older (<21) OS versions
+ private Thread encoderThread;
+
+
+ /**
+ * Initialization method for VirtualDisplayEncoder object. MUST be called before start() or shutdown()
+ * Will overwrite previously set videoWeight and videoHeight
+ * @param context to create the virtual display
+ * @param outputListener the listener that the video frames will be sent through
+ * @param streamingParams parameters to create the virtual display and encoder
+ * @throws Exception if the API level is <19 or supplied parameters were null
+ */
+ public void init(Context context, IVideoStreamListener outputListener, VideoStreamingParameters streamingParams) throws Exception {
+ if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
+ Log.e(TAG, "API level of 19 required for VirtualDisplayEncoder");
+ throw new Exception("API level of 19 required");
+ }
+
+ if (context == null || outputListener == null || streamingParams == null || streamingParams.getResolution() == null || streamingParams.getFormat() == null) {
+ Log.e(TAG, "init parameters cannot be null for VirtualDisplayEncoder");
+ throw new Exception("init parameters cannot be null");
+ }
+
+ this.mDisplayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
+
+ this.streamingParams.update(streamingParams);
+
+ mOutputListener = outputListener;
+
+ initPassed = true;
+ }
+
+ @SuppressWarnings("unused")
+ public VideoStreamingParameters getStreamingParams(){
+ return this.streamingParams;
+ }
+
+ @SuppressWarnings("unused")
+ public void setStreamingParams(int displayDensity, ImageResolution resolution, int frameRate, int bitrate, int interval, VideoStreamingFormat format) {
+ this.streamingParams = new VideoStreamingParameters(displayDensity, frameRate, bitrate, interval, resolution, format);
+ }
+
+ @SuppressWarnings("unused")
+ public void setStreamingParams(VideoStreamingParameters streamingParams) {
+ this.streamingParams = streamingParams;
+ }
+
+ /**
+ * NOTE: Must call init() without error before calling this method.
+ * Prepares the encoder and virtual display.
+ */
+ public void start() throws Exception {
+ if (!initPassed) {
+ Log.e(TAG, "VirtualDisplayEncoder was not properly initialized with the init() method.");
+ return;
+ }
+ if (streamingParams == null || streamingParams.getResolution() == null || streamingParams.getFormat() == null) {
+ return;
+ }
+
+ synchronized (STREAMING_LOCK) {
+
+ try {
+ inputSurface = prepareVideoEncoder();
+
+ // Create a virtual display that will output to our encoder.
+ virtualDisplay = mDisplayManager.createVirtualDisplay(TAG,
+ streamingParams.getResolution().getResolutionWidth(), streamingParams.getResolution().getResolutionHeight(),
+ streamingParams.getDisplayDensity(), inputSurface, DisplayManager.VIRTUAL_DISPLAY_FLAG_PRESENTATION);
+
+ startEncoder();
+
+ } catch (Exception ex) {
+ Log.e(TAG, "Unable to create Virtual Display.");
+ throw new RuntimeException(ex);
+ }
+ }
+ }
+
+ public void shutDown() {
+ if (!initPassed) {
+ Log.e(TAG, "VirtualDisplayEncoder was not properly initialized with the init() method.");
+ return;
+ }
+ try {
+ if (encoderThread != null) {
+ encoderThread.interrupt();
+ encoderThread = null;
+ }
+
+ if (mVideoEncoder != null) {
+ mVideoEncoder.stop();
+ mVideoEncoder.release();
+ mVideoEncoder = null;
+ }
+
+ if (virtualDisplay != null) {
+ virtualDisplay.release();
+ virtualDisplay = null;
+ }
+
+ if (inputSurface != null) {
+ inputSurface.release();
+ inputSurface = null;
+ }
+ } catch (Exception ex) {
+ Log.e(TAG, "shutDown() failed");
+ }
+ }
+
+ private Surface prepareVideoEncoder() {
+
+ if (streamingParams == null || streamingParams.getResolution() == null || streamingParams.getFormat() == null) {
+ return null;
+ }
+
+ if (mVideoBufferInfo == null) {
+ mVideoBufferInfo = new MediaCodec.BufferInfo();
+ }
+
+ String videoMimeType = getMimeForFormat(streamingParams.getFormat());
+
+ MediaFormat format = MediaFormat.createVideoFormat(videoMimeType, streamingParams.getResolution().getResolutionWidth(), streamingParams.getResolution().getResolutionHeight());
+
+ // Set some required properties. The media codec may fail if these aren't defined.
+ format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
+ format.setInteger(MediaFormat.KEY_BIT_RATE, streamingParams.getBitrate());
+ format.setInteger(MediaFormat.KEY_FRAME_RATE, streamingParams.getFrameRate());
+ format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, streamingParams.getInterval()); // seconds between I-frames
+
+
+ // Create a MediaCodec encoder and configure it. Get a Surface we can use for recording into.
+ try {
+ mVideoEncoder = MediaCodec.createEncoderByType(videoMimeType);
+ mVideoEncoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
+ Surface surface = mVideoEncoder.createInputSurface(); //prepared
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ mVideoEncoder.setCallback(new MediaCodec.Callback() {
+ @Override
+ public void onInputBufferAvailable(MediaCodec codec, int index) {
+ // nothing to do here
+ }
+
+ @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+ @Override
+ public void onOutputBufferAvailable(MediaCodec codec, int index, MediaCodec.BufferInfo info) {
+ try {
+ ByteBuffer encodedData = codec.getOutputBuffer(index);
+ if (encodedData != null) {
+ if ((info.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {
+ info.size = 0;
+ }
+ if (info.size != 0) {
+ byte[] dataToWrite;// = new byte[info.size];
+ int dataOffset = 0;
+
+ // append SPS and PPS in front of every IDR NAL unit
+ if ((info.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0 && mH264CodecSpecificData != null) {
+ dataToWrite = new byte[mH264CodecSpecificData.length + info.size];
+ System.arraycopy(mH264CodecSpecificData, 0, dataToWrite, 0, mH264CodecSpecificData.length);
+ dataOffset = mH264CodecSpecificData.length;
+ } else {
+ dataToWrite = new byte[info.size];
+ }
+
+ encodedData.position(info.offset);
+ encodedData.limit(info.offset + info.size);
+
+ encodedData.get(dataToWrite, dataOffset, info.size);
+ if (mOutputListener != null) {
+ mOutputListener.sendFrame(dataToWrite, 0, dataToWrite.length, info.presentationTimeUs);
+ }
+ }
+
+ codec.releaseOutputBuffer(index, false);
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onError(MediaCodec codec, MediaCodec.CodecException e) {
+ e.printStackTrace();
+ }
+
+ @Override
+ public void onOutputFormatChanged(MediaCodec codec, MediaFormat format) {
+ mH264CodecSpecificData = EncoderUtils.getCodecSpecificData(format);
+ }
+ });
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ //Implied from previous if check that this has to be older than Build.VERSION_CODES.LOLLIPOP
+ encoderThread = new Thread(new EncoderCompat());
+
+ } else {
+ Log.e(TAG, "Unable to start encoder. Android OS version " + Build.VERSION.SDK_INT + "is not supported");
+ }
+
+ return surface;
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return null;
+ }
+
+ private void startEncoder() {
+ if (mVideoEncoder != null) {
+ mVideoEncoder.start();
+ }
+ if (encoderThread != null) {
+ encoderThread.start();
+ }
+ }
+
+ public Display getVirtualDisplay() {
+ return virtualDisplay.getDisplay();
+ }
+
+ private String getMimeForFormat(VideoStreamingFormat format) {
+ if (format != null) {
+ VideoStreamingCodec codec = format.getCodec();
+ if (codec != null) {
+ switch (codec) { //MediaFormat constants are only available in Android 21+
+ case VP8:
+ return "video/x-vnd.on2.vp8"; //MediaFormat.MIMETYPE_VIDEO_VP8
+ case VP9:
+ return "video/x-vnd.on2.vp9"; //MediaFormat.MIMETYPE_VIDEO_VP9
+ case H264: //Fall through
+ default:
+ return "video/avc"; // MediaFormat.MIMETYPE_VIDEO_AVC
+ }
+ }
+ }
+ return null;
+ }
+
+ private class EncoderCompat implements Runnable {
+
+ @Override
+ public void run() {
+ try {
+ drainEncoder(false);
+ } catch (Exception e) {
+ Log.w(TAG, "Error attempting to drain encoder");
+ } finally {
+ mVideoEncoder.release();
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ void drainEncoder(boolean endOfStream) {
+ if (mVideoEncoder == null || mOutputListener == null) {
+ return;
+ }
+
+ if (endOfStream) {
+ mVideoEncoder.signalEndOfInputStream();
+ }
+
+ ByteBuffer[] encoderOutputBuffers = mVideoEncoder.getOutputBuffers();
+ Thread currentThread = Thread.currentThread();
+ while (!currentThread.isInterrupted()) {
+ int encoderStatus = mVideoEncoder.dequeueOutputBuffer(mVideoBufferInfo, -1);
+ if(encoderStatus < 0){
+ if (encoderStatus == MediaCodec.INFO_TRY_AGAIN_LATER) {
+ // no output available yet
+ if (!endOfStream) {
+ break; // out of while
+ }
+ } else if (encoderStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
+ // not expected for an encoder
+ encoderOutputBuffers = mVideoEncoder.getOutputBuffers();
+ } else if (encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+ if (mH264CodecSpecificData == null) {
+ MediaFormat format = mVideoEncoder.getOutputFormat();
+ mH264CodecSpecificData = EncoderUtils.getCodecSpecificData(format);
+ } else {
+ Log.w(TAG, "Output format change notified more than once, ignoring.");
+ }
+ }
+ } else {
+ if ((mVideoBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {
+ // If we already retrieve codec specific data via OUTPUT_FORMAT_CHANGED event,
+ // we do not need this data.
+ if (mH264CodecSpecificData != null) {
+ mVideoBufferInfo.size = 0;
+ } else {
+ Log.i(TAG, "H264 codec specific data not retrieved yet.");
+ }
+ }
+
+ if (mVideoBufferInfo.size != 0) {
+ ByteBuffer encoderOutputBuffer = encoderOutputBuffers[encoderStatus];
+ byte[] dataToWrite;
+ int dataOffset = 0;
+
+ // append SPS and PPS in front of every IDR NAL unit
+ if ((mVideoBufferInfo.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0 && mH264CodecSpecificData != null) {
+ dataToWrite = new byte[mH264CodecSpecificData.length + mVideoBufferInfo.size];
+ System.arraycopy(mH264CodecSpecificData, 0, dataToWrite, 0, mH264CodecSpecificData.length);
+ dataOffset = mH264CodecSpecificData.length;
+ } else {
+ dataToWrite = new byte[mVideoBufferInfo.size];
+ }
+
+ try {
+ encoderOutputBuffer.position(mVideoBufferInfo.offset);
+ encoderOutputBuffer.limit(mVideoBufferInfo.offset + mVideoBufferInfo.size);
+
+ encoderOutputBuffer.get(dataToWrite, dataOffset, mVideoBufferInfo.size);
+
+ if (mOutputListener != null) {
+ mOutputListener.sendFrame(dataToWrite, 0, dataToWrite.length, mVideoBufferInfo.presentationTimeUs);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ mVideoEncoder.releaseOutputBuffer(encoderStatus, false);
+
+ if ((mVideoBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
+ break; // out of while
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/haptic/HapticInterfaceManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/haptic/HapticInterfaceManager.java
index 9a6e44897..9a6e44897 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/haptic/HapticInterfaceManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/haptic/HapticInterfaceManager.java
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java
new file mode 100644
index 000000000..e9d58a3fe
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java
@@ -0,0 +1,639 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers;
+
+import android.util.SparseArray;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.IProxyListener;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
+import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
+import com.smartdevicelink.proxy.rpc.AddCommandResponse;
+import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
+import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
+import com.smartdevicelink.proxy.rpc.AlertResponse;
+import com.smartdevicelink.proxy.rpc.ButtonPressResponse;
+import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
+import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
+import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
+import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
+import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
+import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
+import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
+import com.smartdevicelink.proxy.rpc.DialNumberResponse;
+import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
+import com.smartdevicelink.proxy.rpc.GenericResponse;
+import com.smartdevicelink.proxy.rpc.GetAppServiceDataResponse;
+import com.smartdevicelink.proxy.rpc.GetCloudAppPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
+import com.smartdevicelink.proxy.rpc.GetFileResponse;
+import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
+import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.GetWayPointsResponse;
+import com.smartdevicelink.proxy.rpc.ListFilesResponse;
+import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered;
+import com.smartdevicelink.proxy.rpc.OnAppServiceData;
+import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
+import com.smartdevicelink.proxy.rpc.OnButtonEvent;
+import com.smartdevicelink.proxy.rpc.OnButtonPress;
+import com.smartdevicelink.proxy.rpc.OnCommand;
+import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.OnHashChange;
+import com.smartdevicelink.proxy.rpc.OnInteriorVehicleData;
+import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
+import com.smartdevicelink.proxy.rpc.OnLanguageChange;
+import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
+import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
+import com.smartdevicelink.proxy.rpc.OnRCStatus;
+import com.smartdevicelink.proxy.rpc.OnStreamRPC;
+import com.smartdevicelink.proxy.rpc.OnSystemCapabilityUpdated;
+import com.smartdevicelink.proxy.rpc.OnSystemRequest;
+import com.smartdevicelink.proxy.rpc.OnTBTClientState;
+import com.smartdevicelink.proxy.rpc.OnTouchEvent;
+import com.smartdevicelink.proxy.rpc.OnVehicleData;
+import com.smartdevicelink.proxy.rpc.OnWayPointChange;
+import com.smartdevicelink.proxy.rpc.PerformAppServiceInteractionResponse;
+import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
+import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
+import com.smartdevicelink.proxy.rpc.PublishAppServiceResponse;
+import com.smartdevicelink.proxy.rpc.PutFileResponse;
+import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
+import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
+import com.smartdevicelink.proxy.rpc.SendHapticDataResponse;
+import com.smartdevicelink.proxy.rpc.SendLocationResponse;
+import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
+import com.smartdevicelink.proxy.rpc.SetCloudAppPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
+import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.SetInteriorVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
+import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
+import com.smartdevicelink.proxy.rpc.ShowResponse;
+import com.smartdevicelink.proxy.rpc.SliderResponse;
+import com.smartdevicelink.proxy.rpc.SpeakResponse;
+import com.smartdevicelink.proxy.rpc.StreamRPCResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse;
+import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
+import com.smartdevicelink.proxy.rpc.UnregisterAppInterfaceResponse;
+import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
+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();
+ 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) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onUnregisterAppInterfaceResponse(UnregisterAppInterfaceResponse response) {
+ onRPCReceived(response);
+ }
+
+ protected interface LifecycleListener{
+ void onProxyConnected();
+ void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason);
+ void onServiceEnded(OnServiceEnded serviceEnded);
+ void onServiceNACKed(OnServiceNACKed serviceNACKed);
+ void onError(String info, Exception e);
+ }
+
+ public ProxyBridge( LifecycleListener lifecycleListener){
+ this.lifecycleListener = lifecycleListener;
+ rpcListeners = new SparseArray<>();
+ }
+
+ public boolean onRPCReceived(final RPCMessage message){
+ synchronized(RPC_LISTENER_LOCK){
+ final int id = FunctionID.getFunctionId(message.getFunctionName());
+ CopyOnWriteArrayList<OnRPCListener> listeners = rpcListeners.get(id);
+ if(listeners!=null && listeners.size()>0) {
+ for (OnRPCListener listener : listeners) {
+ listener.onReceived(message);
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ protected void addRpcListener(FunctionID id, OnRPCListener listener){
+ synchronized(RPC_LISTENER_LOCK){
+ if (id != null && listener != null) {
+ if (rpcListeners.indexOfKey(id.getId()) < 0) {
+ rpcListeners.put(id.getId(), new CopyOnWriteArrayList<OnRPCListener>());
+ }
+ rpcListeners.get(id.getId()).add(listener);
+ }
+ }
+ }
+
+ public boolean removeOnRPCListener(FunctionID id, OnRPCListener listener){
+ synchronized(RPC_LISTENER_LOCK){
+ if(rpcListeners!= null
+ && id != null
+ && listener != null
+ && rpcListeners.indexOfKey(id.getId()) >= 0){
+ return rpcListeners.get(id.getId()).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason) {
+ lifecycleListener.onProxyClosed(info,e,reason);
+ }
+
+ @Override
+ public void onServiceEnded(OnServiceEnded serviceEnded) {
+ lifecycleListener.onServiceEnded(serviceEnded);
+
+ }
+
+ @Override
+ public void onServiceNACKed(OnServiceNACKed serviceNACKed) {
+ lifecycleListener.onServiceNACKed(serviceNACKed);
+
+ }
+ @Override
+ public void onError(String info, Exception e) {
+ lifecycleListener.onError(info, e);
+ }
+
+ @Override
+ public void onOnStreamRPC(OnStreamRPC notification) {
+ onRPCReceived(notification);
+
+ }
+
+ @Override
+ public void onStreamRPCResponse(StreamRPCResponse response) {
+ onRPCReceived(response);
+ }
+
+ @Override
+ public void onOnHMIStatus(OnHMIStatus notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onGenericResponse(GenericResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnCommand(OnCommand notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onAddCommandResponse(AddCommandResponse response) {
+ onRPCReceived(response);
+ }
+
+ @Override
+ public void onAddSubMenuResponse(AddSubMenuResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onAlertResponse(AlertResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onDeleteCommandResponse(DeleteCommandResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onDeleteSubMenuResponse(DeleteSubMenuResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onPerformInteractionResponse(PerformInteractionResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onResetGlobalPropertiesResponse(ResetGlobalPropertiesResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onShowResponse(ShowResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onSpeakResponse(SpeakResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnButtonEvent(OnButtonEvent notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onOnButtonPress(OnButtonPress notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onSubscribeButtonResponse(SubscribeButtonResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnPermissionsChange(OnPermissionsChange notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onUnsubscribeVehicleDataResponse(UnsubscribeVehicleDataResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onGetVehicleDataResponse(GetVehicleDataResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnVehicleData(OnVehicleData notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onEndAudioPassThruResponse(EndAudioPassThruResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnAudioPassThru(OnAudioPassThru notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onPutFileResponse(PutFileResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onDeleteFileResponse(DeleteFileResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onListFilesResponse(ListFilesResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onSetAppIconResponse(SetAppIconResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onScrollableMessageResponse(ScrollableMessageResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onChangeRegistrationResponse(ChangeRegistrationResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnLanguageChange(OnLanguageChange notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onOnHashChange(OnHashChange notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onSliderResponse(SliderResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnDriverDistraction(OnDriverDistraction notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onOnTBTClientState(OnTBTClientState notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onOnSystemRequest(OnSystemRequest notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onSystemRequestResponse(SystemRequestResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnKeyboardInput(OnKeyboardInput notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onOnTouchEvent(OnTouchEvent notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onDiagnosticMessageResponse(DiagnosticMessageResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onReadDIDResponse(ReadDIDResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onGetDTCsResponse(GetDTCsResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnLockScreenNotification(OnLockScreenStatus notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onDialNumberResponse(DialNumberResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onSendLocationResponse(SendLocationResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onShowConstantTbtResponse(ShowConstantTbtResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onAlertManeuverResponse(AlertManeuverResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onUpdateTurnListResponse(UpdateTurnListResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onServiceDataACK(int dataSize) {
+
+ }
+
+ @Override
+ public void onGetWayPointsResponse(GetWayPointsResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onSubscribeWayPointsResponse(SubscribeWayPointsResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onUnsubscribeWayPointsResponse(UnsubscribeWayPointsResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnWayPointChange(OnWayPointChange notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onGetSystemCapabilityResponse(GetSystemCapabilityResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onGetInteriorVehicleDataResponse(GetInteriorVehicleDataResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onButtonPressResponse(ButtonPressResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onSetInteriorVehicleDataResponse(SetInteriorVehicleDataResponse response) {
+ onRPCReceived(response);
+
+ }
+
+ @Override
+ public void onOnInteriorVehicleData(OnInteriorVehicleData notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onSendHapticDataResponse(SendHapticDataResponse response) {
+ onRPCReceived(response);
+ }
+
+ @Override
+ public void onOnRCStatus(OnRCStatus notification) {
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onSetCloudAppProperties(SetCloudAppPropertiesResponse response) {
+ onRPCReceived(response);
+ }
+
+ @Override
+ public void onGetCloudAppProperties(GetCloudAppPropertiesResponse response) {
+ onRPCReceived(response);
+ }
+@Override
+ public void onPublishAppServiceResponse(PublishAppServiceResponse response){
+ onRPCReceived(response);
+ }
+
+ @Override
+ public void onGetAppServiceDataResponse(GetAppServiceDataResponse response){
+ onRPCReceived(response);
+ }
+
+ @Override
+ public void onGetFileResponse(GetFileResponse response){
+ onRPCReceived(response);
+ }
+
+ @Override
+ public void onPerformAppServiceInteractionResponse(PerformAppServiceInteractionResponse response){
+ onRPCReceived(response);
+ }
+
+ @Override
+ public void onOnAppServiceData(OnAppServiceData notification){
+ onRPCReceived(notification);
+ }
+
+ @Override
+ public void onOnSystemCapabilityUpdated(OnSystemCapabilityUpdated notification){
+ onRPCReceived(notification);
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java
new file mode 100644
index 000000000..bdba58a6a
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java
@@ -0,0 +1,1054 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.util.Log;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.managers.audio.AudioStreamManager;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.lockscreen.LockScreenConfig;
+import com.smartdevicelink.managers.lockscreen.LockScreenManager;
+import com.smartdevicelink.managers.permission.PermissionManager;
+import com.smartdevicelink.managers.screen.ScreenManager;
+import com.smartdevicelink.managers.video.VideoStreamManager;
+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;
+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.RegisterAppInterfaceResponse;
+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;
+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.proxy.rpc.listeners.OnRPCRequestListener;
+import com.smartdevicelink.security.SdlSecurityBase;
+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.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.Version;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+/**
+ * <strong>SDLManager</strong> <br>
+ *
+ * This is the main point of contact between an application and SDL <br>
+ *
+ * It is broken down to these areas: <br>
+ *
+ * 1. SDLManagerBuilder <br>
+ * 2. ISdl Interface along with its overridden methods - This can be passed into attached managers <br>
+ * 3. Sending Requests <br>
+ * 4. Helper methods
+ */
+public class SdlManager extends BaseSdlManager{
+ private static final String TAG = "SdlManager";
+ private SdlProxyBase proxy;
+ private SdlArtwork appIcon;
+ private Context context;
+ private SdlManagerListener managerListener;
+ private List<Class<? extends SdlSecurityBase>> sdlSecList;
+ private LockScreenConfig lockScreenConfig;
+
+ // Managers
+ private PermissionManager permissionManager;
+ private FileManager fileManager;
+ private LockScreenManager lockScreenManager;
+ private ScreenManager screenManager;
+ private VideoStreamManager videoStreamManager;
+ private AudioStreamManager audioStreamManager;
+
+
+ // Initialize proxyBridge with anonymous lifecycleListener
+ private final ProxyBridge proxyBridge= new ProxyBridge(new ProxyBridge.LifecycleListener() {
+ @Override
+ public void onProxyConnected() {
+ DebugTool.logInfo("Proxy is connected. Now initializing.");
+ initialize();
+ }
+
+ @Override
+ public void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason){
+ dispose();
+ }
+
+ @Override
+ public void onServiceEnded(OnServiceEnded serviceEnded){
+
+ }
+
+ @Override
+ public void onServiceNACKed(OnServiceNACKed serviceNACKed){
+
+ }
+
+ @Override
+ public void onError(String info, Exception e){
+
+ }
+ });
+
+ // Sub manager listener
+ private final CompletionListener subManagerListener = new CompletionListener() {
+ @Override
+ public synchronized void onComplete(boolean success) {
+ if(!success){
+ Log.e(TAG, "Sub manager failed to initialize");
+ }
+ checkState();
+ }
+ };
+
+ @Override
+ void checkState() {
+ if (permissionManager != null && fileManager != null && screenManager != null && (!lockScreenConfig.isEnabled() || lockScreenManager != null)) {
+ if (permissionManager.getState() == BaseSubManager.READY && fileManager.getState() == BaseSubManager.READY && screenManager.getState() == BaseSubManager.READY && (!lockScreenConfig.isEnabled() || lockScreenManager.getState() == BaseSubManager.READY)) {
+ DebugTool.logInfo("Starting sdl manager, all sub managers are in ready state");
+ transitionToState(BaseSubManager.READY);
+ handleQueuedNotifications();
+ notifyDevListener(null);
+ onReady();
+ } else if (permissionManager.getState() == BaseSubManager.ERROR && fileManager.getState() == BaseSubManager.ERROR && screenManager.getState() == BaseSubManager.ERROR && (!lockScreenConfig.isEnabled() || lockScreenManager.getState() == BaseSubManager.ERROR)) {
+ String info = "ERROR starting sdl manager, all sub managers are in error state";
+ Log.e(TAG, info);
+ transitionToState(BaseSubManager.ERROR);
+ notifyDevListener(info);
+ } else if (permissionManager.getState() == BaseSubManager.SETTING_UP || fileManager.getState() == BaseSubManager.SETTING_UP || screenManager.getState() == BaseSubManager.SETTING_UP || (lockScreenConfig.isEnabled() && lockScreenManager != null && lockScreenManager.getState() == BaseSubManager.SETTING_UP)) {
+ DebugTool.logInfo("SETTING UP sdl manager, some sub managers are still setting up");
+ transitionToState(BaseSubManager.SETTING_UP);
+ // No need to notify developer here!
+ } else {
+ Log.w(TAG, "LIMITED starting sdl manager, some sub managers are in error or limited state and the others finished setting up");
+ transitionToState(BaseSubManager.LIMITED);
+ handleQueuedNotifications();
+ notifyDevListener(null);
+ onReady();
+ }
+ } else {
+ // We should never be here, but somehow one of the sub-sub managers is null
+ String info = "ERROR one of the sdl sub managers is null";
+ Log.e(TAG, info);
+ transitionToState(BaseSubManager.ERROR);
+ notifyDevListener(info);
+ }
+ }
+
+ private void notifyDevListener(String info) {
+ if (managerListener != null) {
+ if (getState() == BaseSubManager.ERROR){
+ managerListener.onError(info, null);
+ } else {
+ managerListener.onStart();
+ }
+ }
+ }
+
+ private void onReady(){
+ // Set the app icon
+ if (SdlManager.this.appIcon != null && SdlManager.this.appIcon.getName() != null) {
+ if (fileManager != null && fileManager.getState() == BaseSubManager.READY && !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);
+ }
+ }
+ }
+
+ @Override
+ protected void initialize(){
+ // Instantiate sub managers
+ this.permissionManager = new PermissionManager(_internalInterface);
+ this.fileManager = new FileManager(_internalInterface, context);
+ if (lockScreenConfig.isEnabled()) {
+ this.lockScreenManager = new LockScreenManager(lockScreenConfig, context, _internalInterface);
+ }
+ this.screenManager = new ScreenManager(_internalInterface, this.fileManager);
+ if(getAppTypes().contains(AppHMIType.NAVIGATION) || getAppTypes().contains(AppHMIType.PROJECTION)){
+ this.videoStreamManager = new VideoStreamManager(_internalInterface);
+ } else {
+ this.videoStreamManager = null;
+ }
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN
+ && (getAppTypes().contains(AppHMIType.NAVIGATION) || getAppTypes().contains(AppHMIType.PROJECTION)) ) {
+ this.audioStreamManager = new AudioStreamManager(_internalInterface, context);
+ } else {
+ this.audioStreamManager = null;
+ }
+
+ // Start sub managers
+ this.permissionManager.start(subManagerListener);
+ this.fileManager.start(subManagerListener);
+ if (lockScreenConfig.isEnabled()){
+ this.lockScreenManager.start(subManagerListener);
+ }
+ this.screenManager.start(subManagerListener);
+ }
+
+ @SuppressLint("NewApi")
+ @Override
+ public void dispose() {
+ if (this.permissionManager != null) {
+ this.permissionManager.dispose();
+ }
+
+ if (this.fileManager != null) {
+ this.fileManager.dispose();
+ }
+
+ if (this.lockScreenManager != null) {
+ this.lockScreenManager.dispose();
+ }
+
+ if (this.screenManager != null) {
+ this.screenManager.dispose();
+ }
+
+ if(this.videoStreamManager != null) {
+ this.videoStreamManager.dispose();
+ }
+
+ // SuppressLint("NewApi") is used because audioStreamManager is only available on android >= jelly bean
+ if (this.audioStreamManager != null) {
+ this.audioStreamManager.dispose();
+ }
+
+ if(managerListener != null){
+ managerListener.onDestroy();
+ managerListener = null;
+ }
+ }
+
+ // MANAGER GETTERS
+
+ /**
+ * Gets the PermissionManager. <br>
+ * <strong>Note: PermissionManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a PermissionManager object
+ */
+ public PermissionManager getPermissionManager() {
+ if (permissionManager.getState() != BaseSubManager.READY && permissionManager.getState() != BaseSubManager.LIMITED){
+ Log.e(TAG,"PermissionManager should not be accessed because it is not in READY/LIMITED state");
+ }
+ checkSdlManagerState();
+ return permissionManager;
+ }
+
+ /**
+ * Gets the FileManager. <br>
+ * <strong>Note: FileManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a FileManager object
+ */
+ public FileManager getFileManager() {
+ if (fileManager.getState() != BaseSubManager.READY && fileManager.getState() != BaseSubManager.LIMITED){
+ Log.e(TAG, "FileManager should not be accessed because it is not in READY/LIMITED state");
+ }
+ checkSdlManagerState();
+ return fileManager;
+ }
+
+ /**
+ * Gets the VideoStreamManager. <br>
+ * The VideoStreamManager returned will only be not null if the registered app type is
+ * either NAVIGATION or PROJECTION. Once the VideoStreamManager is retrieved, its start()
+ * method will need to be called before use.
+ * <br><br><strong>Note: VideoStreamManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a VideoStreamManager object attached to this SdlManager instance
+ */
+ public @Nullable
+ VideoStreamManager getVideoStreamManager() {
+ checkSdlManagerState();
+ return videoStreamManager;
+ }
+
+ /**
+ * Gets the AudioStreamManager. <br>
+ * The AudioStreamManager returned will only be not null if the registered app type is
+ * either NAVIGATION or PROJECTION. Once the AudioStreamManager is retrieved, its start()
+ * method will need to be called before use.
+ * <br><strong>Note: AudioStreamManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a AudioStreamManager object
+ */
+ public @Nullable AudioStreamManager getAudioStreamManager() {
+ checkSdlManagerState();
+ 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
+ */
+ public ScreenManager getScreenManager() {
+ if (screenManager.getState() != BaseSubManager.READY && screenManager.getState() != BaseSubManager.LIMITED){
+ Log.e(TAG, "ScreenManager should not be accessed because it is not in READY/LIMITED state");
+ }
+ checkSdlManagerState();
+ return screenManager;
+ }
+
+ /**
+ * 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() {
+ if (lockScreenManager.getState() != BaseSubManager.READY && lockScreenManager.getState() != BaseSubManager.LIMITED){
+ Log.e(TAG, "LockScreenManager should not be accessed because it is not in READY/LIMITED state");
+ }
+ checkSdlManagerState();
+ 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();
+ }
+
+ /**
+ * Method to retrieve the RegisterAppInterface Response message that was sent back from the
+ * module. It contains various attributes about the connected module and can be used to adapt
+ * to different module types and their supported features.
+ *
+ * @return RegisterAppInterfaceResponse received from the module or null if the app has not yet
+ * registered with the module.
+ */
+ @Override
+ public RegisterAppInterfaceResponse getRegisterAppInterfaceResponse(){
+ if(proxy != null){
+ return proxy.getRegisterAppInterfaceResponse();
+ }
+ return null;
+ }
+
+ /**
+ * Get the current OnHMIStatus
+ * @return OnHMIStatus object represents the current OnHMIStatus
+ */
+ @Override
+ public OnHMIStatus getCurrentHMIStatus(){
+ if(this.proxy !=null ){
+ return proxy.getCurrentHMIStatus();
+ }
+ return null;
+ }
+
+ /**
+ * Retrieves the auth token, if any, that was attached to the StartServiceACK for the RPC
+ * service from the module. For example, this should be used to login to a user account.
+ * @return the string representation of the auth token
+ */
+ @Override
+ public String getAuthToken(){
+ return this.proxy.getAuthToken();
+ }
+
+ // PROTECTED GETTERS
+
+ protected LockScreenConfig getLockScreenConfig() { return lockScreenConfig; }
+
+ // SENDING REQUESTS
+
+ /**
+ * Send RPC Message
+ * @param message RPCMessage
+ */
+ @Override
+ public void sendRPC(RPCMessage message) {
+ try{
+ proxy.sendRPC(message);
+ }catch (SdlException exception){
+ handleSdlException(exception);
+ }
+ }
+
+ /**
+ * Takes a list of RPCMessages and sends it to SDL in a synchronous fashion. Responses are captured through callback on OnMultipleRequestListener.
+ * For sending requests asynchronously, use sendRequests <br>
+ *
+ * <strong>NOTE: This will override any listeners on individual RPCs</strong><br>
+ *
+ * <strong>ADDITIONAL NOTE: This only takes the type of RPCRequest for now, notifications and responses will be thrown out</strong>
+ *
+ * @param rpcs is the list of RPCMessages being sent
+ * @param listener listener for updates and completions
+ */
+ @Override
+ public void sendSequentialRPCs(final List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener){
+
+ List<RPCRequest> rpcRequestList = new ArrayList<>();
+ for (int i = 0; i < rpcs.size(); i++) {
+ if (rpcs.get(i) instanceof RPCRequest){
+ rpcRequestList.add((RPCRequest)rpcs.get(i));
+ }
+ }
+
+ if (rpcRequestList.size() > 0) {
+ try{
+ proxy.sendSequentialRequests(rpcRequestList, listener);
+ }catch (SdlException exception){
+ handleSdlException(exception);
+ }
+ }
+ }
+
+ /**
+ * Takes a list of RPCMessages and sends it to SDL. Responses are captured through callback on OnMultipleRequestListener.
+ * For sending requests synchronously, use sendSequentialRPCs <br>
+ *
+ * <strong>NOTE: This will override any listeners on individual RPCs</strong> <br>
+ *
+ * <strong>ADDITIONAL NOTE: This only takes the type of RPCRequest for now, notifications and responses will be thrown out</strong>
+ *
+ * @param rpcs is the list of RPCMessages being sent
+ * @param listener listener for updates and completions
+ */
+ @Override
+ public void sendRPCs(List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener) {
+
+ List<RPCRequest> rpcRequestList = new ArrayList<>();
+ for (int i = 0; i < rpcs.size(); i++) {
+ if (rpcs.get(i) instanceof RPCRequest){
+ rpcRequestList.add((RPCRequest)rpcs.get(i));
+ }
+ }
+
+ if (rpcRequestList.size() > 0) {
+ try{
+ proxy.sendRequests(rpcRequestList, listener);
+ }catch (SdlException exception){
+ handleSdlException(exception);
+ }
+ }
+ }
+
+ private void handleSdlException(SdlException exception){
+ if(exception != null){
+ DebugTool.logError("Caught SdlException: " + exception.getSdlExceptionCause());
+ // In the future this should handle logic to dispose the manager if it is an unrecoverable error
+ }else{
+ DebugTool.logError("Caught SdlException" );
+ }
+ }
+
+ /**
+ * Add an OnRPCNotificationListener
+ * @param listener listener that will be called when a notification is received
+ */
+ @Override
+ public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ proxy.addOnRPCNotificationListener(notificationId,listener);
+ }
+
+ /**
+ * Remove an OnRPCNotificationListener
+ * @param listener listener that was previously added
+ */
+ @Override
+ public void removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ proxy.removeOnRPCNotificationListener(notificationId, listener);
+ }
+
+ /**
+ * Add an OnRPCRequestListener
+ * @param listener listener that will be called when a request is received
+ */
+ @Override
+ public void addOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener){
+ proxy.addOnRPCRequestListener(requestId,listener);
+ }
+
+ /**
+ * Remove an OnRPCRequestListener
+ * @param listener listener that was previously added
+ */
+ @Override
+ public void removeOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener){
+ proxy.removeOnRPCRequestListener(requestId, listener);
+ }
+
+ // LIFECYCLE / OTHER
+
+ // STARTUP
+
+ /**
+ * Starts up a SdlManager, and calls provided callback called once all BaseSubManagers are done setting up
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void start(){
+ if (proxy == null) {
+ try {
+ if(transport!= null && transport.getTransportType() == TransportType.MULTIPLEX){
+ //Do the thing
+ MultiplexTransportConfig multiplexTransportConfig = (MultiplexTransportConfig)(transport);
+ final MultiplexTransportConfig.TransportListener devListener = multiplexTransportConfig.getTransportListener();
+ multiplexTransportConfig.setTransportListener(new MultiplexTransportConfig.TransportListener() {
+ @Override
+ public void onTransportEvent(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail) {
+
+ //Pass to submanagers that need it
+ if(videoStreamManager != null){
+ videoStreamManager.handleTransportUpdated(connectedTransports, audioStreamTransportAvail, videoStreamTransportAvail);
+ }
+
+ if(audioStreamManager != null){
+ audioStreamManager.handleTransportUpdated(connectedTransports, audioStreamTransportAvail, videoStreamTransportAvail);
+ }
+ //If the developer supplied a listener to start, it is time to call that
+ if(devListener != null){
+ devListener.onTransportEvent(connectedTransports,audioStreamTransportAvail,videoStreamTransportAvail);
+ }
+ }
+ });
+ }
+
+ proxy = new SdlProxyBase(proxyBridge, context, appName, shortAppName, isMediaApp, hmiLanguage,
+ hmiLanguage, hmiTypes, appId, transport, vrSynonyms, ttsChunks, dayColorScheme,
+ nightColorScheme) {};
+ proxy.setMinimumProtocolVersion(minimumProtocolVersion);
+ proxy.setMinimumRPCVersion(minimumRPCVersion);
+ if (sdlSecList != null && !sdlSecList.isEmpty()) {
+ proxy.setSdlSecurityClassList(sdlSecList);
+ }
+ //Setup the notification queue
+ initNotificationQueue();
+
+ } catch (SdlException e) {
+ if (managerListener != null) {
+ managerListener.onError("Unable to start manager", e);
+ }
+ }
+ }
+ }
+
+ protected void setProxy(SdlProxyBase proxy){
+ this.proxy = proxy;
+ }
+
+ // INTERNAL INTERFACE
+ private ISdl _internalInterface = new ISdl() {
+ @Override
+ public void start() {
+ try{
+ proxy.initializeProxy();
+ }catch (SdlException e){
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void stop() {
+ try{
+ proxy.dispose();
+ }catch (SdlException e){
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public boolean isConnected() {
+ return proxy.getIsConnected();
+ }
+
+ @Override
+ public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
+ proxy.addServiceListener(serviceType,sdlServiceListener);
+ }
+
+ @Override
+ public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
+ proxy.removeServiceListener(serviceType,sdlServiceListener);
+ }
+
+ @Override
+ public void startVideoService(VideoStreamingParameters parameters, boolean encrypted) {
+ if(proxy.getIsConnected()){
+ proxy.startVideoStream(encrypted,parameters);
+ }
+ }
+
+ @Override
+ public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters){
+ return proxy.startVideoStream(isEncrypted, parameters);
+ }
+
+ @Override
+ public void stopVideoService() {
+ if(proxy.getIsConnected()){
+ proxy.endVideoStream();
+ }
+ }
+
+ @Override
+ public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
+ AudioStreamingParams params) {
+ if(proxy.getIsConnected()){
+ proxy.startAudioStream(isEncrypted, codec, params);
+ }
+ }
+
+ @Override
+ public void startAudioService(boolean encrypted) {
+ if(isConnected()){
+ proxy.startService(SessionType.PCM, encrypted);
+ }
+ }
+
+ @Override
+ public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
+ AudioStreamingParams params) {
+ return proxy.startAudioStream(isEncrypted, codec, params);
+ }
+
+ @Override
+ public void stopAudioService() {
+ if(proxy.getIsConnected()){
+ proxy.endAudioStream();
+ }
+ }
+
+ @Override
+ public void sendRPCRequest(RPCRequest message){
+ try {
+ proxy.sendRPC(message);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void sendRPC(RPCMessage message) {
+ try {
+ proxy.sendRPC(message);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void sendRequests(List<? extends RPCRequest> rpcs, OnMultipleRequestListener listener) {
+ try {
+ proxy.sendRequests(rpcs, listener);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void sendSequentialRPCs(List<? extends RPCMessage> rpcs, OnMultipleRequestListener listener) {
+ try {
+ proxy.sendSequentialRequests(rpcs,listener);
+ } catch (SdlException e) {
+ DebugTool.logError("Issue sending sequential RPCs ", e);
+ }
+ }
+
+ @Override
+ public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
+ proxy.addOnRPCNotificationListener(notificationId,listener);
+ }
+
+ @Override
+ public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
+ return proxy.removeOnRPCNotificationListener(notificationId,listener);
+ }
+
+ @Override
+ public void addOnRPCRequestListener(FunctionID functionID, OnRPCRequestListener listener) {
+ proxy.addOnRPCRequestListener(functionID, listener);
+ }
+
+ @Override
+ public boolean removeOnRPCRequestListener(FunctionID functionID, OnRPCRequestListener listener) {
+ return proxy.removeOnRPCRequestListener(functionID, listener);
+ }
+
+ @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);
+ }
+
+ @Override
+ public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) {
+ proxy.getCapability(systemCapabilityType, scListener);
+ }
+
+ @Override
+ public boolean isCapabilitySupported(SystemCapabilityType systemCapabilityType){
+ return proxy.isCapabilitySupported(systemCapabilityType);
+ }
+
+ @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 boolean isTransportForServiceAvailable(SessionType serviceType) {
+ if(SessionType.NAV.equals(serviceType)){
+ return proxy.isVideoStreamTransportAvailable();
+ }else if(SessionType.PCM.equals(serviceType)){
+ return proxy.isAudioStreamTransportAvailable();
+ }
+ return false;
+ }
+
+ @Override
+ public SdlMsgVersion getSdlMsgVersion(){
+ try {
+ return proxy.getSdlMsgVersion();
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public @NonNull Version getProtocolVersion() {
+ if(proxy.getProtocolVersion() != null){
+ return proxy.getProtocolVersion();
+ }else{
+ return new Version(1,0,0);
+ }
+ }
+
+ };
+
+
+ // BUILDER
+ public static class Builder {
+ SdlManager sdlManager;
+
+ /**
+ * 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(@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);
+ }
+
+ /**
+ * Sets the App ID
+ * @param appId
+ */
+ public Builder setAppId(@NonNull final String appId){
+ sdlManager.appId = appId;
+ return this;
+ }
+
+ /**
+ * Sets the Application Name
+ * @param appName
+ */
+ public Builder setAppName(@NonNull final String appName){
+ sdlManager.appName = appName;
+ return this;
+ }
+
+ /**
+ * Sets the Short Application Name
+ * @param shortAppName
+ */
+ public Builder setShortAppName(final String shortAppName) {
+ sdlManager.shortAppName = shortAppName;
+ return this;
+ }
+
+ /**
+ * Sets the minimum protocol version that will be permitted to connect.
+ * If the protocol version of the head unit connected is below this version,
+ * the app will disconnect with an EndService protocol message and will not register.
+ * @param minimumProtocolVersion the minimum Protocol spec version that should be accepted
+ */
+ public Builder setMinimumProtocolVersion(final Version minimumProtocolVersion) {
+ sdlManager.minimumProtocolVersion = minimumProtocolVersion;
+ return this;
+ }
+
+ /**
+ * The minimum RPC version that will be permitted to connect.
+ * If the RPC version of the head unit connected is below this version, an UnregisterAppInterface will be sent.
+ * @param minimumRPCVersion the minimum RPC spec version that should be accepted
+ */
+ public Builder setMinimumRPCVersion(final Version minimumRPCVersion) {
+ sdlManager.minimumRPCVersion = minimumRPCVersion;
+ return this;
+ }
+
+ /**
+ * Sets the Language of the App
+ * @param hmiLanguage the desired language to be used on the display/HMI of the connected module
+ */
+ public Builder setLanguage(final Language hmiLanguage){
+ sdlManager.hmiLanguage = hmiLanguage;
+ return this;
+ }
+
+ /**
+ * Sets the TemplateColorScheme for daytime
+ * @param dayColorScheme color scheme that will be used (if supported) when the display is
+ * in a "Day Mode" or similar. Should comprise of colors that contrast
+ * well during the day under sunlight.
+ */
+ public Builder setDayColorScheme(final TemplateColorScheme dayColorScheme){
+ sdlManager.dayColorScheme = dayColorScheme;
+ return this;
+ }
+
+ /**
+ * Sets the TemplateColorScheme for nighttime
+ * @param nightColorScheme color scheme that will be used (if supported) when the display is
+ * in a "Night Mode" or similar. Should comprise of colors that
+ * contrast well during the night and are not brighter than average.
+ */
+ public Builder setNightColorScheme(final TemplateColorScheme nightColorScheme){
+ sdlManager.nightColorScheme = nightColorScheme;
+ 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 head unit / In-Vehicle-Infotainment system <br>
+ * @param sdlArtwork the icon that will be used to represent this application on the
+ * connected module
+ */
+ public Builder setAppIcon(final SdlArtwork sdlArtwork){
+ sdlManager.appIcon = sdlArtwork;
+ return this;
+ }
+
+ /**
+ * Sets the vector of AppHMIType <br>
+ * <strong>Note: This should be an ordered list from most -> least relevant</strong>
+ * @param hmiTypes HMI types that represent this application. For example, if the app is a
+ * music player, the MEDIA HMIType should be included.
+ */
+ public Builder setAppTypes(final Vector<AppHMIType> hmiTypes){
+
+ sdlManager.hmiTypes = hmiTypes;
+
+ if (hmiTypes != null) {
+ sdlManager.isMediaApp = hmiTypes.contains(AppHMIType.MEDIA);
+ }
+
+ return this;
+ }
+
+ /**
+ * Sets the voice recognition synonyms that can be used to identify this application.
+ * @param vrSynonyms a vector of Strings that can be associated with this app. For example the app's name should
+ * be included as well as any phonetic spellings of the app name that might help the on-board
+ * VR system associated a users spoken word with the supplied synonyms.
+ */
+ public Builder setVrSynonyms(final Vector<String> vrSynonyms) {
+ sdlManager.vrSynonyms = vrSynonyms;
+ return this;
+ }
+
+ /**
+ * Sets the Text-To-Speech Name of the application. These TTSChunks might be used by the module as an audio
+ * representation of the app's name.
+ * @param ttsChunks the TTS chunks that can represent this app's name
+ */
+ public Builder setTtsName(final Vector<TTSChunk> ttsChunks) {
+ sdlManager.ttsChunks = ttsChunks;
+ return this;
+ }
+
+ /**
+ * This Object type may change with the transport refactor
+ * Sets the BaseTransportConfig
+ * @param transport the type of transport that should be used for this SdlManager instance.
+ */
+ public Builder setTransportType(BaseTransportConfig transport){
+ sdlManager.transport = transport;
+ return this;
+ }
+
+ /**
+ * Sets the Context
+ * @param context
+ */
+ public Builder setContext(Context context){
+ sdlManager.context = context;
+ return this;
+ }
+
+ /**
+ * Sets the Security library
+ * @param secList The list of security class(es)
+ */
+ public Builder setSdlSecurity(List<Class<? extends SdlSecurityBase>> secList) {
+ sdlManager.sdlSecList = secList;
+ return this;
+ }
+
+ /**
+ * Set the SdlManager Listener
+ * @param listener the listener
+ */
+ public Builder setManagerListener(@NonNull final SdlManagerListener listener){
+ sdlManager.managerListener = listener;
+ return this;
+ }
+
+ /**
+ * Set RPCNotification listeners. SdlManager will preload these listeners before any RPCs are sent/received.
+ * @param listeners a map of listeners that will be called when a notification is received.
+ * Key represents the FunctionID of the notification and value represents the listener
+ */
+ public Builder setRPCNotificationListeners(Map<FunctionID, OnRPCNotificationListener> listeners){
+ sdlManager.onRPCNotificationListeners = listeners;
+ return this;
+ }
+
+ public SdlManager build() {
+
+ if (sdlManager.appName == null) {
+ throw new IllegalArgumentException("You must specify an app name by calling setAppName");
+ }
+
+ if (sdlManager.appId == null) {
+ 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);
+ sdlManager.hmiTypes = hmiTypesDefault;
+ 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;
+ }
+
+ if (sdlManager.minimumProtocolVersion == null){
+ sdlManager.minimumProtocolVersion = new Version("1.0.0");
+ }
+
+ if (sdlManager.minimumRPCVersion == null){
+ sdlManager.minimumRPCVersion = new Version("1.0.0");
+ }
+
+ sdlManager.transitionToState(BaseSubManager.SETTING_UP);
+
+ return sdlManager;
+ }
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
new file mode 100644
index 000000000..5a59604cc
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers;
+
+public interface SdlManagerListener extends BaseSdlManagerListener{
+
+ /**
+ * 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/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java
new file mode 100644
index 000000000..e88313036
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.audio;
+
+import android.content.Context;
+import android.media.MediaCodec;
+import android.media.MediaFormat;
+import android.net.Uri;
+import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.annotation.RequiresApi;
+import android.util.Log;
+
+import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
+
+import java.nio.ByteBuffer;
+
+/**
+ * The audio decoder to decode a single audio file to PCM.
+ */
+@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
+public class AudioDecoder extends BaseAudioDecoder {
+ private static final String TAG = AudioDecoder.class.getSimpleName();
+
+ /**
+ * Creates a new object of AudioDecoder.
+ * @param audioSource The audio source to decode.
+ * @param context The context object to use to open the audio source.
+ * @param sampleRate The desired sample rate for decoded audio data.
+ * @param sampleType The desired sample type (8bit, 16bit, float).
+ * @param listener A listener who receives the decoded audio.
+ */
+ AudioDecoder(Uri audioSource, Context context, int sampleRate, @SampleType int sampleType, AudioDecoderListener listener) {
+ super(audioSource, context, sampleRate, sampleType, listener);
+ }
+
+ /**
+ * Starts the audio decoding asynchronously.
+ */
+ public void start() {
+ try {
+ initMediaComponents();
+
+ decoder.setCallback(new MediaCodec.Callback() {
+ @Override
+ public void onInputBufferAvailable(@NonNull MediaCodec mediaCodec, int i) {
+ ByteBuffer inputBuffer = mediaCodec.getInputBuffer(i);
+ if (inputBuffer == null) return;
+
+ MediaCodec.BufferInfo info = AudioDecoder.super.onInputBufferAvailable(extractor, inputBuffer);
+ mediaCodec.queueInputBuffer(i, info.offset, info.size, info.presentationTimeUs, info.flags);
+ }
+
+ @Override
+ public void onOutputBufferAvailable(@NonNull MediaCodec mediaCodec, int i, @NonNull MediaCodec.BufferInfo bufferInfo) {
+ ByteBuffer outputBuffer = mediaCodec.getOutputBuffer(i);
+ if (outputBuffer == null) return;
+
+ if (outputBuffer.limit() > 0) {
+ SampleBuffer targetSampleBuffer = AudioDecoder.super.onOutputBufferAvailable(outputBuffer);
+ AudioDecoder.this.listener.onAudioDataAvailable(targetSampleBuffer);
+ } else {
+ Log.w(TAG, "output buffer empty. Chance that silence was detected");
+ }
+
+ mediaCodec.releaseOutputBuffer(i, false);
+
+ if (bufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
+ listener.onDecoderFinish(true);
+ stop();
+ }
+ }
+
+ @Override
+ public void onOutputFormatChanged(@NonNull MediaCodec mediaCodec, @NonNull MediaFormat mediaFormat) {
+ AudioDecoder.super.onOutputFormatChanged(mediaFormat);
+ }
+
+ @Override
+ public void onError(@NonNull MediaCodec mediaCodec, @NonNull MediaCodec.CodecException e) {
+ AudioDecoder.super.onMediaCodecError(e);
+ }
+ });
+
+ decoder.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ listener.onDecoderError(e);
+ listener.onDecoderFinish(false);
+ stop();
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java
new file mode 100644
index 000000000..984475eaf
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.audio;
+
+import android.content.Context;
+import android.media.MediaCodec;
+import android.media.MediaFormat;
+import android.net.Uri;
+import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.annotation.RequiresApi;
+import android.util.Log;
+
+import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
+
+import java.lang.ref.WeakReference;
+import java.nio.ByteBuffer;
+
+/**
+ * The audio decoder to decode a single audio file to PCM.
+ * This decoder supports phones with api < 21 but uses methods deprecated with api 21.
+ */
+@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
+public class AudioDecoderCompat extends BaseAudioDecoder {
+ private static final String TAG = AudioDecoderCompat.class.getSimpleName();
+ private static final int DEQUEUE_TIMEOUT = 3000;
+ private static Runnable sRunnable;
+ private Thread mThread;
+
+ /**
+ * Creates a new object of AudioDecoder.
+ * @param audioSource The audio source to decode.
+ * @param context The context object to use to open the audio source.
+ * @param sampleRate The desired sample rate for decoded audio data.
+ * @param sampleType The desired sample type (8bit, 16bit, float).
+ * @param listener A listener who receives the decoded audio.
+ */
+ AudioDecoderCompat(@NonNull Uri audioSource, @NonNull Context context, int sampleRate, @SampleType int sampleType, AudioDecoderListener listener) {
+ super(audioSource, context, sampleRate, sampleType, listener);
+ }
+
+ /**
+ * Starts the audio decoding asynchronously.
+ */
+ public void start() {
+ try {
+ initMediaComponents();
+ decoder.start();
+ mThread = new Thread(new DecoderRunnable(AudioDecoderCompat.this));
+ mThread.start();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ if(this.listener != null) {
+ this.listener.onDecoderError(e);
+ this.listener.onDecoderFinish(false);
+ }
+ stop();
+ }
+ }
+
+
+ /**
+ * Runnable to decode audio data
+ */
+ private static class DecoderRunnable implements Runnable {
+ WeakReference<AudioDecoderCompat> weakReference;
+
+ /**
+ * Decodes all audio data from source
+ * @param audioDecoderCompat instance of this class
+ */
+ DecoderRunnable(@NonNull AudioDecoderCompat audioDecoderCompat){
+ weakReference = new WeakReference<>(audioDecoderCompat);
+
+ }
+ @Override
+ public void run() {
+ final AudioDecoderCompat reference = weakReference.get();
+ if (reference == null) {
+ Log.w(TAG, "AudioDecoderCompat reference was null");
+ return;
+ }
+ final ByteBuffer[] inputBuffersArray = reference.decoder.getInputBuffers();
+ final ByteBuffer[] outputBuffersArray = reference.decoder.getOutputBuffers();
+ MediaCodec.BufferInfo outputBufferInfo = new MediaCodec.BufferInfo();
+ MediaCodec.BufferInfo inputBufferInfo;
+ ByteBuffer inputBuffer, outputBuffer;
+ SampleBuffer sampleBuffer;
+
+ while (reference!= null && !reference.mThread.isInterrupted()) {
+ int inputBuffersArrayIndex = 0;
+ while (inputBuffersArrayIndex != MediaCodec.INFO_TRY_AGAIN_LATER) {
+ inputBuffersArrayIndex = reference.decoder.dequeueInputBuffer(DEQUEUE_TIMEOUT);
+ if (inputBuffersArrayIndex >= 0) {
+ inputBuffer = inputBuffersArray[inputBuffersArrayIndex];
+ inputBufferInfo = reference.onInputBufferAvailable(reference.extractor, inputBuffer);
+ reference.decoder.queueInputBuffer(inputBuffersArrayIndex, inputBufferInfo.offset, inputBufferInfo.size, inputBufferInfo.presentationTimeUs, inputBufferInfo.flags);
+ }
+ }
+
+ int outputBuffersArrayIndex = 0;
+ while (outputBuffersArrayIndex != MediaCodec.INFO_TRY_AGAIN_LATER) {
+ outputBuffersArrayIndex = reference.decoder.dequeueOutputBuffer(outputBufferInfo, DEQUEUE_TIMEOUT);
+ if (outputBuffersArrayIndex >= 0) {
+ outputBuffer = outputBuffersArray[outputBuffersArrayIndex];
+ if ((outputBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0 && outputBufferInfo.size != 0) {
+ reference.decoder.releaseOutputBuffer(outputBuffersArrayIndex, false);
+ } else if (outputBuffer.limit() > 0) {
+ sampleBuffer = reference.onOutputBufferAvailable(outputBuffer);
+ if(reference.listener!=null){
+ reference.listener.onAudioDataAvailable(sampleBuffer);
+ }
+ reference.decoder.releaseOutputBuffer(outputBuffersArrayIndex, false);
+ }
+ } else if (outputBuffersArrayIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+ MediaFormat newFormat = reference.decoder.getOutputFormat();
+ reference.onOutputFormatChanged(newFormat);
+ }
+ }
+
+ if (outputBufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
+ if (reference.listener != null) {
+ reference.listener.onDecoderFinish(true);
+ }
+ reference.stop();
+ try {
+ reference.mThread.interrupt();
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ reference.mThread = null;
+ break;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderListener.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderListener.java
new file mode 100644
index 000000000..5962ac09e
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderListener.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.audio;
+
+/**
+ * An interface for the audio decoder classes.
+ * The caller using the audio decoder will be
+ * notified when the decoding is finished or if an error occurred.
+ * During decoding the caller receives sample buffers with decoded audio data.
+ */
+public interface AudioDecoderListener {
+ /**
+ * Notifies that decoded audio data is available.
+ * @param sampleBuffer The sample buffer holding the decoded audio data.
+ */
+ void onAudioDataAvailable(SampleBuffer sampleBuffer);
+
+ /**
+ * Notifies that the audio decoding is finished.
+ * @param success Indicates whether audio decoding was successful or if an error occurred.
+ */
+ void onDecoderFinish(boolean success);
+
+ /**
+ * Notifies the caller that an error/exception occurred during audio decoding.
+ * @param e The exception storing information about the error.
+ */
+ void onDecoderError(Exception e);
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java
new file mode 100644
index 000000000..92e379adf
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java
@@ -0,0 +1,479 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.audio;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.res.Resources;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Handler;
+import android.os.Looper;
+import android.support.annotation.IntDef;
+import android.support.annotation.NonNull;
+import android.support.annotation.RequiresApi;
+import android.util.Log;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.StreamingStateMachine;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
+import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.transport.utl.TransportRecord;
+import com.smartdevicelink.util.Version;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.ref.WeakReference;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Queue;
+
+/**
+ * The AudioStreamManager class provides methods to start and stop an audio stream
+ * to the connected device. Audio files can be pushed to the manager in order to
+ * play them on the connected device. The manager uses the Android built-in MediaCodec.
+ */
+@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
+public class AudioStreamManager extends BaseAudioStreamManager {
+ private static final String TAG = AudioStreamManager.class.getSimpleName();
+ private static final int COMPLETION_TIMEOUT = 2000;
+
+ private IAudioStreamListener sdlAudioStream;
+ private int sdlSampleRate;
+ private @SampleType int sdlSampleType;
+ private final Queue<BaseAudioDecoder> queue;
+ private final WeakReference<Context> context;
+ private final StreamingStateMachine streamingStateMachine;
+ private AudioPassThruCapabilities audioStreamingCapabilities;
+ private HMILevel hmiLevel;
+ private boolean isTransportAvailable = false;
+ // This completion listener is used as a callback to the app developer when starting/stopping audio service
+ private CompletionListener serviceCompletionListener;
+ // As the internal interface does not provide timeout we need to use a future task
+ private final Handler serviceCompletionHandler;
+
+ private final Runnable serviceCompletionTimeoutCallback = new Runnable() {
+ @Override
+ public void run() {
+ serviceListener.onServiceError(null, SessionType.PCM, "Service operation timeout reached");
+ }
+ };
+
+
+
+ // INTERNAL INTERFACE
+
+ private final ISdlServiceListener serviceListener = new ISdlServiceListener() {
+ @Override
+ public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
+ if (SessionType.PCM.equals(type)) {
+ serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
+
+ sdlAudioStream = session.startAudioStream();
+ streamingStateMachine.transitionToState(StreamingStateMachine.STARTED);
+
+ if (serviceCompletionListener != null) {
+ CompletionListener completionListener = serviceCompletionListener;
+ serviceCompletionListener = null;
+ completionListener.onComplete(true);
+ }
+ }
+ }
+
+ @Override
+ public void onServiceEnded(SdlSession session, SessionType type) {
+ if (SessionType.PCM.equals(type)) {
+ serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
+
+ session.stopAudioStream();
+ sdlAudioStream = null;
+ streamingStateMachine.transitionToState(StreamingStateMachine.NONE);
+
+ if (serviceCompletionListener != null) {
+ CompletionListener completionListener = serviceCompletionListener;
+ serviceCompletionListener = null;
+ completionListener.onComplete(true);
+ }
+ }
+ }
+
+ @Override
+ public void onServiceError(SdlSession session, SessionType type, String reason) {
+ if (SessionType.PCM.equals(type)) {
+ serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
+
+ streamingStateMachine.transitionToState(StreamingStateMachine.ERROR);
+ Log.e(TAG, "OnServiceError: " + reason);
+ streamingStateMachine.transitionToState(StreamingStateMachine.NONE);
+
+ if (serviceCompletionListener != null) {
+ CompletionListener completionListener = serviceCompletionListener;
+ serviceCompletionListener = null;
+ completionListener.onComplete(false);
+ }
+ }
+ }
+ };
+
+ private final OnRPCNotificationListener hmiListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ if(notification != null){
+ hmiLevel = ((OnHMIStatus)notification).getHmiLevel();
+ if(hmiLevel.equals(HMILevel.HMI_FULL) || hmiLevel.equals(HMILevel.HMI_LIMITED)){
+ checkState();
+ }
+ }
+ }
+ };
+
+ /**
+ * Creates a new object of AudioStreamManager
+ * @param internalInterface The internal interface to the connected device.
+ */
+ public AudioStreamManager(@NonNull ISdl internalInterface, @NonNull Context context) {
+ super(internalInterface);
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN){
+ this.queue = null;
+ this.context = null;
+ this.serviceCompletionHandler = null;
+ this.streamingStateMachine = null;
+ transitionToState(ERROR);
+ return;
+ }
+ this.queue = new LinkedList<>();
+ this.context = new WeakReference<>(context);
+ this.serviceCompletionHandler = new Handler(Looper.getMainLooper());
+
+ internalInterface.addServiceListener(SessionType.PCM, serviceListener);
+
+ // Listen for HMILevel changes
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
+
+ streamingStateMachine = new StreamingStateMachine();
+
+ }
+
+ @Override
+ public void start(CompletionListener listener) {
+ isTransportAvailable = internalInterface.isTransportForServiceAvailable(SessionType.PCM);
+ getAudioStreamingCapabilities();
+ checkState();
+ super.start(listener);
+ }
+
+ private void checkState(){
+ if(audioStreamingCapabilities != null
+ && isTransportAvailable
+ && hmiLevel != null
+ && (hmiLevel.equals(HMILevel.HMI_LIMITED) || hmiLevel.equals(HMILevel.HMI_FULL))){
+ transitionToState(READY);
+ }
+ }
+
+ private void getAudioStreamingCapabilities(){
+ internalInterface.getCapability(SystemCapabilityType.PCM_STREAMING, new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ if(capability != null && capability instanceof AudioPassThruCapabilities){
+ audioStreamingCapabilities = (AudioPassThruCapabilities) capability;
+ checkState();
+ }
+ }
+
+ @Override
+ public void onError(String info) {
+ Log.e(TAG, "Error retrieving audio streaming capability: " + info);
+ streamingStateMachine.transitionToState(StreamingStateMachine.ERROR);
+ transitionToState(ERROR);
+ }
+ });
+ }
+
+ @Override
+ public void dispose() {
+ stopAudioStream(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ internalInterface.removeServiceListener(SessionType.PCM, serviceListener);
+ }
+ });
+
+ super.dispose();
+ }
+
+ /**
+ * Starts the audio service and audio stream to the connected device.
+ * The method is non-blocking.
+ * @param encrypted Specify whether or not the audio stream should be encrypted.
+ */
+ public void startAudioStream(boolean encrypted, final CompletionListener completionListener) {
+ // audio stream cannot be started without a connected internal interface
+ if (!internalInterface.isConnected()) {
+ Log.w(TAG, "startAudioStream called without being connected.");
+ finish(completionListener, false);
+ return;
+ }
+
+ // streaming state must be NONE (starting the service is ready. starting stream is started)
+ if (streamingStateMachine.getState() != StreamingStateMachine.NONE) {
+ Log.w(TAG, "startAudioStream called but streamingStateMachine is not in state NONE (current: " + streamingStateMachine.getState() + ")");
+ finish(completionListener, false);
+ return;
+ }
+
+ AudioPassThruCapabilities capabilities = (AudioPassThruCapabilities) internalInterface.getCapability(SystemCapabilityType.PCM_STREAMING);
+
+ if (capabilities != null) {
+ switch (capabilities.getSamplingRate()) {
+ case _8KHZ:
+ sdlSampleRate = 8000;
+ break;
+ case _16KHZ:
+ sdlSampleRate = 16000;
+ break;
+ case _22KHZ:
+ // common sample rate is 22050, not 22000
+ // see https://en.wikipedia.org/wiki/Sampling_(signal_processing)#Audio_sampling
+ sdlSampleRate = 22050;
+ break;
+ case _44KHZ:
+ // 2x 22050 is 44100
+ // see https://en.wikipedia.org/wiki/Sampling_(signal_processing)#Audio_sampling
+ sdlSampleRate = 44100;
+ break;
+ default:
+ finish(completionListener, false);
+ return;
+ }
+
+ switch (capabilities.getBitsPerSample()) {
+ case _8_BIT:
+ sdlSampleType = SampleType.UNSIGNED_8_BIT;
+ break;
+ case _16_BIT:
+ sdlSampleType = SampleType.SIGNED_16_BIT;
+ break;
+ default:
+ finish(completionListener, false);
+ return;
+
+ }
+ } else {
+ finish(completionListener, false);
+ return;
+ }
+
+ streamingStateMachine.transitionToState(StreamingStateMachine.READY);
+ serviceCompletionListener = completionListener;
+ serviceCompletionHandler.postDelayed(serviceCompletionTimeoutCallback, COMPLETION_TIMEOUT);
+ internalInterface.startAudioService(encrypted);
+ }
+
+ /**
+ * Makes the callback to the listener
+ * @param listener the listener to notify
+ * @param isSuccess flag to notify
+ */
+ private void finish(CompletionListener listener, boolean isSuccess) {
+ if (listener != null) {
+ listener.onComplete(isSuccess);
+ }
+ }
+
+ /**
+ * Stops the audio service and audio stream to the connected device.
+ * The method is non-blocking.
+ */
+ public void stopAudioStream(final CompletionListener completionListener) {
+ if (!internalInterface.isConnected()) {
+ Log.w(TAG, "stopAudioStream called without being connected");
+ finish(completionListener, false);
+ return;
+ }
+
+ // streaming state must be STARTED (starting the service is ready. starting stream is started)
+ if (streamingStateMachine.getState() != StreamingStateMachine.STARTED) {
+ Log.w(TAG, "stopAudioStream called but streamingStateMachine is not STARTED (current: " + streamingStateMachine.getState() + ")");
+ finish(completionListener, false);
+ return;
+ }
+
+ streamingStateMachine.transitionToState(StreamingStateMachine.STOPPED);
+ serviceCompletionListener = completionListener;
+ serviceCompletionHandler.postDelayed(serviceCompletionTimeoutCallback, COMPLETION_TIMEOUT);
+ internalInterface.stopAudioService();
+ }
+
+ /**
+ * Pushes the specified resource file to the playback queue.
+ * The audio file will be played immediately. If another audio file is currently playing
+ * the specified file will stay queued and automatically played when ready.
+ * @param resourceId The specified resource file to be played.
+ * @param completionListener A completion listener that informs when the audio file is played.
+ */
+ public void pushResource(int resourceId, final CompletionListener completionListener) {
+ Context c = context.get();
+ Resources r = c.getResources();
+ Uri uri = new Uri.Builder()
+ .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
+ .authority(r.getResourcePackageName(resourceId))
+ .appendPath(r.getResourceTypeName(resourceId))
+ .appendPath(r.getResourceEntryName(resourceId))
+ .build();
+
+ this.pushAudioSource(uri, completionListener);
+ }
+
+ /**
+ * Pushes the specified audio file to the playback queue.
+ * The audio file will be played immediately. If another audio file is currently playing
+ * the specified file will stay queued and automatically played when ready.
+ * @param audioSource The specified audio file to be played.
+ * @param completionListener A completion listener that informs when the audio file is played.
+ */
+ @SuppressWarnings("WeakerAccess")
+ public void pushAudioSource(Uri audioSource, final CompletionListener completionListener) {
+ // streaming state must be STARTED (starting the service is ready. starting stream is started)
+ if (streamingStateMachine.getState() != StreamingStateMachine.STARTED) {
+ return;
+ }
+
+ BaseAudioDecoder decoder;
+ AudioDecoderListener decoderListener = new AudioDecoderListener() {
+ @Override
+ public void onAudioDataAvailable(SampleBuffer buffer) {
+ if (sdlAudioStream != null) {
+ sdlAudioStream.sendAudio(buffer.getByteBuffer(), buffer.getPresentationTimeUs());
+ }
+ }
+
+ @Override
+ public void onDecoderFinish(boolean success) {
+ finish(completionListener, true);
+
+ synchronized (queue) {
+ // remove throws an exception if the queue is empty. The decoder of this listener
+ // should still be in this queue so we should be fine by just removing it
+ // if the queue is empty than we have a bug somewhere in the code
+ // and we deserve the crash...
+ queue.remove();
+
+ // if the queue contains more items then start the first one (without removing it)
+ if (queue.size() > 0) {
+ queue.element().start();
+ }
+ }
+ }
+
+ @Override
+ public void onDecoderError(Exception e) {
+ Log.e(TAG, "decoder error", e);
+ }
+ };
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ decoder = new AudioDecoder(audioSource, context.get(), sdlSampleRate, sdlSampleType, decoderListener);
+ } else {
+ // this BaseAudioDecoder subclass uses methods deprecated with api 21
+ decoder = new AudioDecoderCompat(audioSource, context.get(), sdlSampleRate, sdlSampleType, decoderListener);
+ }
+
+ synchronized (queue) {
+ queue.add(decoder);
+
+ if (queue.size() == 1) {
+ decoder.start();
+ }
+ }
+ }
+
+
+ @Override
+ protected void onTransportUpdate(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail){
+
+ isTransportAvailable = audioStreamTransportAvail;
+
+ if(internalInterface.getProtocolVersion().isNewerThan(new Version(5,1,0)) >= 0){
+ if(audioStreamTransportAvail){
+ checkState();
+ }
+ }else{
+ //The protocol version doesn't support simultaneous transports.
+ if(!audioStreamTransportAvail){
+ //If video streaming isn't available on primary transport then it is not possible to
+ //use the video streaming manager until a complete register on a transport that
+ //supports video
+ transitionToState(ERROR);
+ }
+ }
+ }
+
+ @IntDef({SampleType.UNSIGNED_8_BIT, SampleType.SIGNED_16_BIT, SampleType.FLOAT})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface SampleType {
+ // ref https://developer.android.com/reference/android/media/AudioFormat "Encoding" section
+ // The audio sample is a 8 bit unsigned integer in the range [0, 255], with a 128 offset for zero.
+ // This is typically stored as a Java byte in a byte array or ByteBuffer. Since the Java byte is
+ // signed, be careful with math operations and conversions as the most significant bit is inverted.
+ //
+ // The unsigned byte range is [0, 255] and should be converted to double [-1.0, 1.0]
+ // The 8 bits of the byte are easily converted to int by using bitwise operator
+ int UNSIGNED_8_BIT = Byte.SIZE >> 3;
+
+ // ref https://developer.android.com/reference/android/media/AudioFormat "Encoding" section
+ // The audio sample is a 16 bit signed integer typically stored as a Java short in a short array,
+ // but when the short is stored in a ByteBuffer, it is native endian (as compared to the default Java big endian).
+ // The short has full range from [-32768, 32767], and is sometimes interpreted as fixed point Q.15 data.
+ //
+ // the conversion is slightly easier from [-32768, 32767] to [-1.0, 1.0]
+ int SIGNED_16_BIT = Short.SIZE >> 3;
+
+ // ref https://developer.android.com/reference/android/media/AudioFormat "Encoding" section
+ // Introduced in API Build.VERSION_CODES.LOLLIPOP, this encoding specifies that the audio sample
+ // is a 32 bit IEEE single precision float. The sample can be manipulated as a Java float in a
+ // float array, though within a ByteBuffer it is stored in native endian byte order. The nominal
+ // range of ENCODING_PCM_FLOAT audio data is [-1.0, 1.0].
+ int FLOAT = Float.SIZE >> 3;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java
new file mode 100644
index 000000000..f0a04dc7b
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.audio;
+
+import android.content.Context;
+import android.media.AudioFormat;
+import android.media.MediaCodec;
+import android.media.MediaExtractor;
+import android.media.MediaFormat;
+import android.net.Uri;
+import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.annotation.RequiresApi;
+import android.util.Log;
+
+import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
+import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
+
+import java.lang.ref.WeakReference;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+@SuppressWarnings("WeakerAccess")
+@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
+public abstract class BaseAudioDecoder {
+ private static final String TAG = AudioDecoder.class.getSimpleName();
+
+ protected final int targetSampleRate;
+ protected @SampleType final int targetSampleType;
+
+ private int outputChannelCount;
+ private int outputSampleRate;
+ private @SampleType int outputSampleType;
+
+ private double lastOutputSample = 0;
+
+ private double lastOutputPresentationTimeUs = 0;
+ private double lastTargetPresentationTimeUs = 0;
+
+ protected MediaExtractor extractor;
+ protected MediaCodec decoder;
+
+ protected final Uri audioSource;
+ protected final WeakReference<Context> contextWeakReference;
+ protected final AudioDecoderListener listener;
+
+ /**
+ *
+ * @param audioSource Uri of the audio source to be converted
+ * @param context the context
+ * @param sampleRate can be either 8000, 16000, 22050 or 44100
+ * @see AudioPassThruCapabilities#getSamplingRate()
+ * @param sampleType can be either UNSIGNED_8_BIT, SIGNED_16_BIT, FLOAT
+ * @see SampleType
+ * @param listener listener for event callbacks
+ */
+ public BaseAudioDecoder(@NonNull Uri audioSource, @NonNull Context context, int sampleRate, @SampleType int sampleType, AudioDecoderListener listener) {
+ this.audioSource = audioSource;
+ this.contextWeakReference = new WeakReference<>(context);
+ this.listener = listener;
+
+ targetSampleRate = sampleRate;
+ targetSampleType = sampleType;
+ }
+
+ protected void initMediaComponents() throws Exception {
+ if(targetSampleRate <= 0){
+ throw new InstantiationException("Target sample rate of " + targetSampleRate + " is unsupported");
+ }
+
+ extractor = new MediaExtractor();
+ Context contextRef = contextWeakReference.get();
+ if(contextRef == null){
+ throw new InstantiationException("Context reference was null");
+ }
+ extractor.setDataSource(contextRef, audioSource, null);
+ MediaFormat format = null;
+ String mime = null;
+
+ // Select the first audio track we find.
+ int numTracks = extractor.getTrackCount();
+ for (int i = 0; i < numTracks; ++i) {
+ MediaFormat f = extractor.getTrackFormat(i);
+ String m = f.getString(MediaFormat.KEY_MIME);
+ if (m.startsWith("audio/")) {
+ format = f;
+ mime = m;
+ extractor.selectTrack(i);
+ break;
+ }
+ }
+
+ if (mime == null) {
+ throw new Exception("The audio file " + audioSource.getPath() + " doesn't contain an audio track.");
+ }
+
+ decoder = MediaCodec.createDecoderByType(mime);
+ decoder.configure(format, null, null, 0);
+ }
+
+ private Double sampleAtTargetTime(double lastOutputSample, SampleBuffer outputSampleBuffer, double outputPresentationTimeUs, double outputDurationPerSampleUs, double targetPresentationTimeUs) {
+ double timeDiff = targetPresentationTimeUs - outputPresentationTimeUs;
+ double index = timeDiff / outputDurationPerSampleUs;
+
+ // the "last known sample" allows an index from -1.0 to 0
+ // the index cannot exceed the last sample. it must be stored to become the "last known sample" in the next iteration
+ if (index < -1.0 || Math.ceil(index) >= outputSampleBuffer.limit()) {
+ return null;
+ }
+
+ if (index == -1.0) {
+ // the index points exactly to the last known sample
+ return lastOutputSample;
+ } else if (index % 1 == 0) {
+ // index has no digits. therefore current index points to a known sample
+ return outputSampleBuffer.get((int) index);
+ } else {
+ // the first sample can be the last known one
+ double first = index < 0.0 ? lastOutputSample : outputSampleBuffer.get((int) index);
+ double second = outputSampleBuffer.get((int) Math.ceil(index));
+ double rel = index % 1;
+
+ // if the relative is between -1 and 0
+ if (rel < 0.0) {
+ rel = 1 + rel;
+ }
+
+ return first + (second - first) * rel;
+ }
+ }
+
+ protected MediaCodec.BufferInfo onInputBufferAvailable(@NonNull MediaExtractor extractor, @NonNull ByteBuffer inputBuffer) {
+ long sampleTime = extractor.getSampleTime();
+ int counter = 0;
+ int maxresult = 0;
+ int result;
+ boolean advanced = false;
+
+ do {
+ result = extractor.readSampleData(inputBuffer, counter);
+ if (result >= 0) {
+ advanced = extractor.advance();
+ maxresult = Math.max(maxresult, result);
+ counter += result;
+ }
+ } while (result >= 0 && advanced && inputBuffer.capacity() - inputBuffer.limit() > maxresult);
+ // the remaining capacity should be more than enough for another sample data block
+
+ // queue the input buffer. At end of file counter will be 0 and flags marks end of stream
+ // offset MUST be 0. The output buffer code cannot handle offsets
+ // result < 0 means the end of the file input is reached
+ int flags = advanced ? 0 : MediaCodec.BUFFER_FLAG_END_OF_STREAM;
+
+ MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
+ bufferInfo.set(0, counter, sampleTime, flags);
+
+ return bufferInfo;
+ }
+
+ protected SampleBuffer onOutputBufferAvailable(@NonNull ByteBuffer outputBuffer) {
+ double outputPresentationTimeUs = lastOutputPresentationTimeUs;
+ double outputDurationPerSampleUs = 1000000.0 / (double)outputSampleRate;
+
+ double targetPresentationTimeUs = lastTargetPresentationTimeUs;
+ double targetDurationPerSampleUs = 1000000.0 / (double)targetSampleRate;
+
+ // wrap the output buffer to make it provide audio samples
+ SampleBuffer outputSampleBuffer = SampleBuffer.wrap(outputBuffer, outputSampleType, outputChannelCount, (long)outputPresentationTimeUs);
+ outputSampleBuffer.position(0);
+
+ // the buffer size is related to the output and target sample rate
+ // add 2 samples to round up and add an extra sample
+ int sampleSize = outputSampleBuffer.limit() * targetSampleRate / outputSampleRate + 2;
+
+ SampleBuffer targetSampleBuffer = SampleBuffer.allocate(sampleSize, targetSampleType, ByteOrder.LITTLE_ENDIAN, (long)targetPresentationTimeUs);
+ Double sample;
+
+ do {
+ sample = sampleAtTargetTime(lastOutputSample, outputSampleBuffer, outputPresentationTimeUs, outputDurationPerSampleUs, targetPresentationTimeUs);
+ if (sample != null) {
+ targetSampleBuffer.put(sample);
+ targetPresentationTimeUs += targetDurationPerSampleUs;
+ }
+ } while (sample != null);
+
+ lastTargetPresentationTimeUs = targetPresentationTimeUs;
+ lastOutputPresentationTimeUs += outputSampleBuffer.limit() * outputDurationPerSampleUs;
+ lastOutputSample = outputSampleBuffer.get(outputSampleBuffer.limit() - 1);
+
+ targetSampleBuffer.limit(targetSampleBuffer.position());
+ targetSampleBuffer.position(0);
+
+ return targetSampleBuffer;
+ }
+
+ protected void onOutputFormatChanged(@NonNull MediaFormat mediaFormat) {
+ if (mediaFormat.containsKey(MediaFormat.KEY_CHANNEL_COUNT)) {
+ outputChannelCount = mediaFormat.getInteger(MediaFormat.KEY_CHANNEL_COUNT);
+ }
+
+ if (mediaFormat.containsKey(MediaFormat.KEY_SAMPLE_RATE)) {
+ outputSampleRate = mediaFormat.getInteger(MediaFormat.KEY_SAMPLE_RATE);
+ }
+
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N && mediaFormat.containsKey(MediaFormat.KEY_PCM_ENCODING)) {
+ int key = mediaFormat.getInteger(MediaFormat.KEY_PCM_ENCODING);
+ switch (key) {
+ case AudioFormat.ENCODING_PCM_8BIT:
+ outputSampleType = SampleType.UNSIGNED_8_BIT;
+ break;
+ case AudioFormat.ENCODING_PCM_FLOAT:
+ outputSampleType = SampleType.FLOAT;
+ break;
+ case AudioFormat.ENCODING_PCM_16BIT:
+ default:
+ // by default we fallback to signed 16 bit samples
+ outputSampleType = SampleType.SIGNED_16_BIT;
+ break;
+ }
+ } else {
+ outputSampleType = SampleType.SIGNED_16_BIT;
+ }
+ }
+
+ protected void onMediaCodecError(@NonNull MediaCodec.CodecException e) {
+ Log.e(TAG, "MediaCodec.onError: " + e.getLocalizedMessage());
+ if (listener != null) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ listener.onDecoderError(e);
+ } else {
+ listener.onDecoderError(new Exception("Error decoding audio file"));
+ }
+ }
+ }
+
+ public abstract void start();
+
+ public void stop() {
+ if (decoder != null) {
+ decoder.stop();
+ decoder.release();
+ decoder = null;
+ }
+
+ if (extractor != null) {
+ extractor = null;
+ }
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java
new file mode 100644
index 000000000..af618c696
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java
@@ -0,0 +1,312 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.audio;
+
+import android.util.Log;
+
+import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * Wraps a buffer of raw audio samples depending on the sample type (8 bit, 16 bit)
+ * Unifies samples into double.
+ */
+public class SampleBuffer {
+ private static final String TAG = SampleBuffer.class.getSimpleName();
+
+ @SuppressWarnings({"unused", "FieldCanBeLocal"})
+ private @SampleType final int sampleType;
+ private final ByteBuffer byteBuffer;
+ private final int channelCount;
+ private final long presentationTimeUs;
+
+ /**
+ * Wraps a raw (mono) byte buffer to a new sample buffer.
+ * @param buffer The raw buffer to be wrapped.
+ * @param sampleType The sample type of the samples in the raw buffer.
+ * @param presentationTimeUs The presentation time of the buffer.
+ * @return A new sample buffer wrapping the specified raw buffer.
+ */
+ public static SampleBuffer wrap(ByteBuffer buffer, @SampleType int sampleType, long presentationTimeUs) {
+ return new SampleBuffer(buffer, sampleType, 1, presentationTimeUs);
+ }
+
+ /**
+ * Wraps a raw byte buffer to a new sample buffer.
+ * @param buffer The raw buffer to be wrapped.
+ * @param sampleType The sample type of the samples in the raw buffer.
+ * @param channelCount The number of channels (1 = mono, 2 = stereo).
+ * @param presentationTimeUs The presentation time of the buffer.
+ * @return A new sample buffer wrapping the specified raw buffer.
+ */
+ public static SampleBuffer wrap(ByteBuffer buffer, @SampleType int sampleType, int channelCount, long presentationTimeUs) {
+ return new SampleBuffer(buffer, sampleType, channelCount, presentationTimeUs);
+ }
+
+ /**
+ * Allocates a new sample buffer.
+ * @param capacity The specified sample capacity of the sample buffer.
+ * @param sampleType The sample type of the samples the buffer should store.
+ * @param byteOrder The byte order for the samples (little or big endian).
+ * @param presentationTimeUs The presentation time for the buffer.
+ * @return A new and empty sample buffer.
+ */
+ public static SampleBuffer allocate(int capacity, @SampleType int sampleType, ByteOrder byteOrder, long presentationTimeUs) {
+ return new SampleBuffer(capacity, sampleType, 1, byteOrder, presentationTimeUs);
+ }
+
+ /**
+ * Allocates a new sample buffer.
+ * @param capacity The specified sample capacity of the sample buffer.
+ * @param sampleType The sample type of the samples the buffer should store.
+ * @param channelCount The number of channels (1 = mono, 2 = stereo).
+ * @param byteOrder The byte order for the samples (little or big endian).
+ * @param presentationTimeUs The presentation time for the buffer.
+ * @return A new and empty sample buffer.
+ */
+ @SuppressWarnings("unused")
+ public static SampleBuffer allocate(int capacity, @SampleType int sampleType, int channelCount, ByteOrder byteOrder, long presentationTimeUs) {
+ return new SampleBuffer(capacity, sampleType, channelCount, byteOrder, presentationTimeUs);
+ }
+
+ private SampleBuffer(int capacity, @SampleType int sampleType, int channelCount, ByteOrder byteOrder, long presentationTimeUs) {
+ this.byteBuffer = ByteBuffer.allocate(sampleType * capacity);
+ this.byteBuffer.order(byteOrder);
+ this.sampleType = sampleType;
+ this.channelCount = channelCount;
+ this.presentationTimeUs = presentationTimeUs;
+ }
+
+ private SampleBuffer(ByteBuffer buffer, @SampleType int sampleType, int channelCount, long presentationTimeUs) {
+ this.byteBuffer = buffer;
+ this.sampleType = sampleType;
+ this.channelCount = channelCount;
+ this.presentationTimeUs = presentationTimeUs;
+ }
+
+ /**
+ * Returns the capacity of the buffer per channel.
+ */
+ @SuppressWarnings("unused")
+ public int capacity() {
+ return byteBuffer.capacity() / sampleType / channelCount;
+ }
+
+ /**
+ * Returns the number of samples in the buffer per channel.
+ */
+ public int limit() {
+ return byteBuffer.limit() / sampleType / channelCount;
+ }
+
+ /**
+ * Sets the number of samples in the buffer to the new limit.
+ * @param newLimit The new limit of the sample buffer.
+ */
+ public void limit(int newLimit) {
+ byteBuffer.limit(newLimit * sampleType * channelCount);
+ }
+
+ /**
+ * Returns the current position in the buffer per channel.
+ * @return The position of the sample buffer.
+ */
+ public int position() {
+ return byteBuffer.position() / sampleType / channelCount;
+ }
+
+ /**
+ *Sets the position of the sample buffer to the new index.
+ * @param newPosition The new position of the sample buffer.
+ */
+ public void position(int newPosition) {
+ byteBuffer.position(newPosition * sampleType * channelCount);
+ }
+
+ /**
+ * Returns the sample of the current position and then increments the position.
+ * The sample returned is a mixed sample getting all samples from each channel.
+ * @return The mixed sample.
+ */
+ public double get() {
+ // convenient method to avoid duplicate code: we use -1 index to call get()
+ return get(-1);
+ }
+
+ /**
+ * Returns the sample from the given index in the buffer.
+ * If the buffer's channel count is > 1 the sample returned
+ * is a mixed sample getting all samples from each channel.
+ * @param index The index of the sample requested.
+ * @return The sample requested.
+ */
+ public double get(int index) {
+ int internalIndex = index * channelCount * sampleType;
+
+ switch (sampleType) {
+ case SampleType.UNSIGNED_8_BIT: {
+ double avg = 0;
+
+ // get a sample mix to mono from the index
+ for (int i = 0; i < channelCount; i++) {
+ byte b = index == -1 ? byteBuffer.get() : byteBuffer.get(internalIndex + i * sampleType);
+ int a = b & 0xff; // convert the 8 bits into int so we can calc > 127
+ avg += a / (double)channelCount;
+ }
+
+ return avg * 2.0 / 255.0 - 1.0; //magic? check out SampleType
+ }
+ case SampleType.SIGNED_16_BIT: {
+ double avg = 0;
+
+ // get a sample mix to mono from the index
+ for (int i = 0; i < channelCount; i++) {
+ short a = index == -1 ? byteBuffer.getShort() : byteBuffer.getShort(internalIndex + i * sampleType);
+ avg += a / (double)channelCount;
+ }
+
+ return (avg + 32768.0) * 2.0 / 65535.0 - 1.0; //magic? check out SampleType
+ }
+ case SampleType.FLOAT: {
+ double avg = 0;
+
+ // get a sample mix to mono from the index
+ for (int i = 0; i < channelCount; i++) {
+ double a = index == -1 ? byteBuffer.getFloat() : byteBuffer.getFloat(internalIndex + i * sampleType);
+ avg += a / (double)channelCount;
+ }
+
+ return avg;
+ }
+ default: {
+ Log.e(TAG, "SampleBuffer.get(int): The sample type is not known: " + sampleType);
+ return 0.0;
+ }
+ }
+ }
+
+ /**
+ * Puts a sample to the current position and increments the position.
+ * @param sample The sample to put into the buffer.
+ */
+ public void put(double sample) {
+ put(-1, sample);
+ }
+
+ /**
+ * Puts a sample to the given index in the buffer.
+ * If the buffer's channel count is > 1 the sample
+ * will be stored in each channel at the given index.
+ * @param index The index to put the sample.
+ * @param sample The sample to store in the buffer.
+ */
+ public void put(int index, double sample) {
+ int internalIndex = index * channelCount * sampleType;
+ switch (sampleType) {
+ case SampleType.UNSIGNED_8_BIT: {
+ int a = (int)Math.round((sample + 1.0) * 255.0 / 2.0); //magic? check out SampleType
+ byte b = (byte)a;
+ if (index == -1) {
+ for (int i = 0; i < channelCount; i++) {
+ byteBuffer.put(b);
+ }
+ } else {
+ for (int i = 0; i < channelCount; i++) {
+ byteBuffer.put(internalIndex + i * sampleType, b);
+ }
+ }
+ break;
+ }
+ case SampleType.SIGNED_16_BIT: {
+ short a = (short)Math.round((sample + 1.0) * 65535 / 2.0 - 32767.0); //magic? check out SampleType
+ if (index == -1) {
+ for (int i = 0; i < channelCount; i++) {
+ byteBuffer.putShort(a);
+ }
+ } else {
+ for (int i = 0; i < channelCount; i++) {
+ byteBuffer.putShort(internalIndex + i * sampleType, a);
+ }
+ }
+ break;
+ }
+ case SampleType.FLOAT: {
+ if (index == -1) {
+ for (int i = 0; i < channelCount; i++) {
+ byteBuffer.putFloat((float) sample);
+ }
+ } else {
+ for (int i = 0; i < channelCount; i++) {
+ byteBuffer.putFloat(internalIndex + i * sampleType, (float) sample);
+ }
+ }
+ break;
+ }
+ default: {
+ Log.e(TAG, "SampleBuffer.set(int): The sample type is not known: " + sampleType);
+ }
+ }
+ }
+
+ /**
+ * Returns the raw byte buffer managed by this sample buffer.
+ * @return The raw byte buffer managed by this sample buffer.
+ */
+ public ByteBuffer getByteBuffer() {
+ return byteBuffer;
+ }
+
+ /**
+ * Returns a copy of the bytes from position 0 to the current limit.
+ * @return A copy of the bytes.
+ */
+ public byte[] getBytes() {
+ int limit = byteBuffer.limit();
+ byte[] bytes = new byte[limit];
+
+ for (int i = 0; i < limit; ++i) {
+ bytes[i] = byteBuffer.get(i);
+ }
+
+ return bytes;
+ }
+
+ /**
+ * The presentation time of this sample buffer.
+ * @return The presentation time of this sample buffer.
+ */
+ public long getPresentationTimeUs() {
+ return presentationTimeUs;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java
new file mode 100644
index 000000000..a07653414
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.file;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.net.Uri;
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.managers.file.filetypes.SdlFile;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.PutFile;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.ref.WeakReference;
+
+/**
+ * <strong>FileManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+ *
+ * The SDLFileManager uploads files and keeps track of all the uploaded files names during a session. <br>
+ *
+ * We need to add the following struct: SDLFile<br>
+ *
+ * It is broken down to these areas: <br>
+ *
+ * 1. Getters <br>
+ * 2. Deletion methods <br>
+ * 3. Uploading Files / Artwork
+ */
+public class FileManager extends BaseFileManager {
+
+ private final WeakReference<Context> context;
+
+ public FileManager(ISdl internalInterface, Context context) {
+
+ // setup
+ super(internalInterface);
+ this.context = new WeakReference<>(context);
+ }
+
+ /**
+ * Creates and returns a PutFile request that would upload a given SdlFile
+ * @param file SdlFile with fileName and one of A) fileData, B) Uri, or C) resourceID set
+ * @return a valid PutFile request if SdlFile contained a fileName and sufficient data
+ */
+ @Override
+ PutFile createPutFile(@NonNull final SdlFile file){
+ PutFile putFile = new PutFile();
+ if(file.getName() == null){
+ throw new IllegalArgumentException("You must specify an file name in the SdlFile");
+ }else{
+ putFile.setSdlFileName(file.getName());
+ }
+
+ if(file.getResourceId() > 0){
+ // Use resource id to upload file
+ byte[] contents = contentsOfResource(file.getResourceId());
+ if(contents != null){
+ putFile.setFileData(contents);
+ }else{
+ throw new IllegalArgumentException("Resource file id was empty");
+ }
+ }else if(file.getUri() != null){
+ // Use URI to upload file
+ byte[] contents = contentsOfUri(file.getUri());
+ if(contents != null){
+ putFile.setFileData(contents);
+ }else{
+ throw new IllegalArgumentException("Uri was empty");
+ }
+ }else if(file.getFileData() != null){
+ // Use file data (raw bytes) to upload file
+ putFile.setFileData(file.getFileData());
+ }else{
+ throw new IllegalArgumentException("The SdlFile to upload does " +
+ "not specify its resourceId, Uri, or file data");
+ }
+
+ if(file.getType() != null){
+ putFile.setFileType(file.getType());
+ }
+ putFile.setPersistentFile(file.isPersistent());
+
+ return putFile;
+ }
+
+ /**
+ * Helper method to take resource files and turn them into byte arrays
+ * @param resource Resource file id
+ * @return Resulting byte array
+ */
+ private byte[] contentsOfResource(int resource) {
+ InputStream is = null;
+ try {
+ is = context.get().getResources().openRawResource(resource);
+ return contentsOfInputStream(is);
+ } catch (Resources.NotFoundException e) {
+ Log.w(TAG, "Can't read from resource", e);
+ return null;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ /**
+ * Helper method to take Uri and turn it into byte array
+ * @param uri Uri for desired file
+ * @return Resulting byte array
+ */
+ private byte[] contentsOfUri(Uri uri){
+ InputStream is = null;
+ try{
+ is = context.get().getContentResolver().openInputStream(uri);
+ return contentsOfInputStream(is);
+ } catch (IOException e){
+ Log.w(TAG, "Can't read from Uri", e);
+ return null;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
new file mode 100644
index 000000000..805fd775a
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.file.filetypes;
+
+import android.net.Uri;
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+
+/**
+ * A class that extends SdlFile, representing artwork (JPEG, PNG, or BMP) to be uploaded to core
+ */
+public class SdlArtwork extends SdlFile {
+ private boolean isTemplate;
+ private Image imageRPC;
+
+ /**
+ * Creates a new instance of SdlArtwork
+ */
+ public SdlArtwork(){}
+
+ /**
+ * Creates a new instance of SdlArtwork
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param id an int value representing the android resource id of the file
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, int id, boolean persistentFile) {
+ super(fileName, fileType, id, persistentFile);
+ }
+
+ /**
+ * Creates a new instance of SdlArtwork
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param uri a URI value representing a file's location. Currently, it only supports local files
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, Uri uri, boolean persistentFile) {
+ super(fileName, fileType, uri, persistentFile);
+ }
+
+ /**
+ * Creates a new instance of SdlArtwork
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param data a byte array representing the data of the file
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile) {
+ super(fileName, fileType, data, persistentFile);
+ }
+
+ /**
+ * Creates a new instance of SdlArtwork
+ * @param staticIconName a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
+ */
+ public SdlArtwork(@NonNull StaticIconName staticIconName) {
+ super(staticIconName);
+ }
+
+ /**
+ * Sets whether this SdlArtwork is a template image whose coloring should be decided by the HMI
+ * @param isTemplate boolean that tells whether this SdlArtwork is a template image
+ */
+ public void setTemplateImage(boolean isTemplate){
+ this.isTemplate = isTemplate;
+ }
+
+ /**
+ * Gets whether this SdlArtwork is a template image whose coloring should be decided by the HMI
+ * @return boolean that tells whether this SdlArtwork is a template image
+ */
+ public boolean isTemplateImage(){
+ return isTemplate;
+ }
+
+ @Override
+ public void setType(@NonNull FileType fileType) {
+ if(fileType.equals(FileType.GRAPHIC_JPEG) || fileType.equals(FileType.GRAPHIC_PNG)
+ || fileType.equals(FileType.GRAPHIC_BMP)){
+ super.setType(fileType);
+ }else{
+ throw new IllegalArgumentException("Only JPEG, PNG, and BMP image types are supported.");
+ }
+ }
+
+ /**
+ * Gets the Image RPC representing this artwork. Generally for use internally, you should instead pass an artwork to a Screen Manager method
+ * @return The Image RPC representing this artwork
+ */
+ public Image getImageRPC() {
+ if (imageRPC == null) {
+ if (isStaticIcon()) {
+ imageRPC = new Image(getName(), ImageType.STATIC);
+ imageRPC.setIsTemplate(true);
+ } else {
+ imageRPC = new Image(getName(), ImageType.DYNAMIC);
+ imageRPC.setIsTemplate(isTemplate);
+ }
+ }
+ return imageRPC;
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
new file mode 100644
index 000000000..3635c9551
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.file.filetypes;
+
+import android.net.Uri;
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+
+/**
+ * A class representing data to be uploaded to core
+ */
+public class SdlFile{
+ private String fileName;
+ private int id = -1;
+ private Uri uri;
+ private byte[] fileData;
+ private FileType fileType;
+ private boolean persistentFile;
+ private boolean isStaticIcon;
+
+ /**
+ * Creates a new instance of SdlFile
+ */
+ public SdlFile(){}
+
+ /**
+ * Creates a new instance of SdlFile
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param id an int value representing the android resource id of the file
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlFile(@NonNull String fileName, @NonNull FileType fileType, int id, boolean persistentFile){
+ this.fileName = fileName;
+ this.fileType = fileType;
+ this.id = id;
+ this.persistentFile = persistentFile;
+ }
+
+ /**
+ * Creates a new instance of SdlFile
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param uri a URI value representing a file's location. Currently, it only supports local files
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlFile(@NonNull String fileName, @NonNull FileType fileType, Uri uri, boolean persistentFile){
+ this.fileName = fileName;
+ this.fileType = fileType;
+ this.uri = uri;
+ this.persistentFile = persistentFile;
+ }
+
+ /**
+ * Creates a new instance of SdlFile
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param data a byte array representing the data of the file
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlFile(@NonNull String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile){
+ this.fileName = fileName;
+ this.fileType = fileType;
+ this.fileData = data;
+ this.persistentFile = persistentFile;
+ }
+
+ /**
+ * Creates a new instance of SdlFile
+ * @param staticIconName a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
+ */
+ public SdlFile(@NonNull StaticIconName staticIconName){
+ this.fileName = staticIconName.toString();
+ this.fileData = staticIconName.toString().getBytes();
+ this.persistentFile = false;
+ this.isStaticIcon = true;
+ }
+
+ /**
+ * Sets the name of the file
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ */
+ public void setName(@NonNull String fileName){
+ this.fileName = fileName;
+ }
+
+ /**
+ * Gets the name of the file
+ * @return a String value representing the name that will be used to store the file in the head unit
+ */
+ public String getName(){
+ return fileName;
+ }
+
+ /**
+ * Sets the resource ID of the file
+ * @param id an int value representing the android resource id of the file
+ */
+ public void setResourceId(int id){
+ this.id = id;
+ }
+
+ /**
+ * Gets the resource id of the file
+ * @return an int value representing the android resource id of the file
+ */
+ public int getResourceId(){
+ return id;
+ }
+
+ /**
+ * Sets the uri of the file
+ * @param uri a URI value representing a file's location. Currently, it only supports local files
+ */
+ public void setUri(Uri uri){
+ this.uri = uri;
+ }
+
+ /**
+ * Gets the uri of the file
+ * @return a URI value representing a file's location. Currently, it only supports local files
+ */
+ public Uri getUri(){
+ return uri;
+ }
+
+ /**
+ * Sets the byte array that represents the content of the file
+ * @param data a byte array representing the data of the file
+ */
+ public void setFileData(byte[] data){
+ this.fileData = data;
+ }
+
+ /**
+ * Gets the byte array that represents the content of the file
+ * @return a byte array representing the data of the file
+ */
+ public byte[] getFileData(){
+ return fileData;
+ }
+
+ /**
+ * Sets the type of the file
+ * @param fileType a FileType enum value representing the type of the file
+ */
+ public void setType(@NonNull FileType fileType){
+ this.fileType = fileType;
+ }
+
+ /**
+ * Gets the type of the file
+ * @return a FileType enum value representing the type of the file
+ */
+ public FileType getType(){
+ return fileType;
+ }
+
+ /**
+ * Sets whether the file should persist between sessions / ignition cycles
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public void setPersistent(boolean persistentFile){
+ this.persistentFile = persistentFile;
+ }
+
+ /**
+ * Gets whether the file should persist between sessions / ignition cycles
+ * @return a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public boolean isPersistent(){
+ return this.persistentFile;
+ }
+
+ /**
+ * Sets the the name of the static file. Static files comes pre-shipped with the head unit
+ * @param staticIcon a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
+ */
+ public void setStaticIcon(boolean staticIcon) {
+ isStaticIcon = staticIcon;
+ }
+
+ /**
+ * Gets the the name of the static file. Static files comes pre-shipped with the head unit
+ * @return a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
+ */
+ public boolean isStaticIcon() {
+ return isStaticIcon;
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java
new file mode 100644
index 000000000..72fdff5c3
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.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/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java
new file mode 100644
index 000000000..43e40be6c
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java
@@ -0,0 +1,321 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.lockscreen;
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.os.Build;
+import android.util.Log;
+
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.CompletionListener;
+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.AndroidTools;
+
+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;
+ private volatile boolean isApplicationForegrounded;
+ private android.arch.lifecycle.LifecycleObserver lifecycleObserver;
+ 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();
+ }
+
+ @Override
+ public void start(CompletionListener listener) {
+ transitionToState(READY);
+ super.start(listener);
+ }
+
+ @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;
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ try {
+ if (android.arch.lifecycle.ProcessLifecycleOwner.get() != null && lifecycleObserver != null) {
+ android.arch.lifecycle.ProcessLifecycleOwner.get().getLifecycle().removeObserver(lifecycleObserver);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ lifecycleObserver = null;
+ }
+
+ isApplicationForegrounded = false;
+
+ super.dispose();
+ }
+
+ ////
+ // 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);
+ }
+
+ // Set up listener for Application Foreground / Background events
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ try {
+ lifecycleObserver = new android.arch.lifecycle.LifecycleObserver() {
+ @android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_START)
+ public void onMoveToForeground() {
+ isApplicationForegrounded = true;
+ launchLockScreenActivity();
+ }
+
+ @android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_STOP)
+ public void onMoveToBackground() {
+ isApplicationForegrounded = false;
+ }
+ };
+
+ if (android.arch.lifecycle.ProcessLifecycleOwner.get() != null) {
+ android.arch.lifecycle.ProcessLifecycleOwner.get().getLifecycle().addObserver(lifecycleObserver);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else{
+ isApplicationForegrounded = true;
+ }
+ }
+
+ ////
+ // 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 && isApplicationForegrounded && 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));
+ }
+ }
+ }
+
+ ////
+ // 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 = AndroidTools.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/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java
new file mode 100644
index 000000000..6ae10ec73
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.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/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
new file mode 100644
index 000000000..7efa183b7
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.permission;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.interfaces.ISdl;
+
+/**
+ PermissionManager gives the developer information about what permissions are permitted in specific HMI level
+ and helps developers setup listeners to be called when specific permissions become allowed.<br>
+
+ This should be used through the {@link com.smartdevicelink.managers.SdlManager} and not be instantiated by itself
+**/
+
+ public class PermissionManager extends BasePermissionManager{
+
+
+ /**
+ * Creates a new instance of the PermissionManager
+ *
+ * @param internalInterface
+ */
+ public PermissionManager(@NonNull ISdl internalInterface) {
+ super(internalInterface);
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
new file mode 100644
index 000000000..7975bb5f2
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+
+/**
+ * <strong>ScreenManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+*/
+public class ScreenManager extends BaseScreenManager {
+
+ public ScreenManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) {
+ super(internalInterface, fileManager);
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
new file mode 100644
index 000000000..146343677
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+
+/**
+ * <strong>SoftButtonManager</strong> <br>
+ * SoftButtonManager gives the developer the ability to control how soft buttons are displayed on the head unit.<br>
+ * Note: This class must be accessed through the SdlManager->ScreenManager. Do not instantiate it by itself.<br>
+ */
+class SoftButtonManager extends BaseSoftButtonManager {
+
+ /**
+ * Creates a new instance of the SoftButtonManager
+ *
+ * @param internalInterface
+ * @param fileManager
+ */
+ SoftButtonManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) {
+ super(internalInterface, fileManager);
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
new file mode 100644
index 000000000..d3d594b76
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.R;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+
+/**
+ * <strong>TextAndGraphicManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+ *
+ */
+class TextAndGraphicManager extends BaseTextAndGraphicManager {
+
+ TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
+ super(internalInterface, fileManager, softButtonManager);
+ }
+
+ @Override
+ SdlArtwork getBlankArtwork(){
+ if (blankArtwork == null){
+ blankArtwork = new SdlArtwork();
+ blankArtwork.setType(FileType.GRAPHIC_PNG);
+ blankArtwork.setName("blankArtwork");
+ blankArtwork.setResourceId(R.drawable.transparent);
+ }
+ return blankArtwork;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java
new file mode 100644
index 000000000..45196c6c5
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java
@@ -0,0 +1,641 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.video;
+
+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 com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.encoder.VirtualDisplayEncoder;
+import com.smartdevicelink.haptic.HapticInterfaceManager;
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.StreamingStateMachine;
+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 com.smartdevicelink.transport.utl.TransportRecord;
+import com.smartdevicelink.util.Version;
+
+import java.lang.ref.WeakReference;
+import java.util.List;
+import java.util.concurrent.FutureTask;
+
+@TargetApi(19)
+public class VideoStreamManager extends BaseVideoStreamManager {
+ private static String TAG = "VideoStreamManager";
+
+ 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;
+ private boolean isTransportAvailable = false;
+
+ // INTERNAL INTERFACES
+
+ private final ISdlServiceListener serviceListener = new ISdlServiceListener() {
+ @Override
+ public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
+ if(SessionType.NAV.equals(type)){
+ if(session != null && session.getAcceptedVideoParams() != null){
+ parameters = session.getAcceptedVideoParams();
+ }
+ VideoStreamManager.this.streamListener = internalInterface.startVideoStream(isEncrypted, parameters);
+ 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();
+ stateMachine.transitionToState(StreamingStateMachine.STARTED);
+
+
+ }
+ }
+
+ @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();
+ if(hmiLevel.equals(HMILevel.HMI_FULL)){
+ checkState();
+ }
+ }
+ }
+ };
+
+ 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 VideoStreamManager(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();
+ }
+
+ @Override
+ public void start(CompletionListener listener) {
+ isTransportAvailable = internalInterface.isTransportForServiceAvailable(SessionType.NAV);
+ getVideoStreamingParams();
+ checkState();
+ super.start(listener);
+ }
+
+ private synchronized void checkState(){
+ if(this.getState() == SETTING_UP
+ && isTransportAvailable
+ && hmiLevel != null
+ && hmiLevel.equals(HMILevel.HMI_FULL)
+ && parameters != null){
+ transitionToState(READY);
+ }
+ }
+
+ private void getVideoStreamingParams(){
+ if(internalInterface.getProtocolVersion().getMajor() >= 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
+ VideoStreamManager.this.parameters = params;
+
+ checkState();
+
+ }
+
+ @Override
+ public void onError(String info) {
+ Log.e(TAG, "Error retrieving video streaming capability: " + info);
+ stateMachine.transitionToState(StreamingStateMachine.ERROR);
+ transitionToState(ERROR);
+ }
+ });
+ }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());
+ }
+
+ this.parameters = params;
+ checkState();
+ }
+ }
+
+ /**
+ * 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;
+ int majorProtocolVersion = internalInterface.getProtocolVersion().getMajor();
+ if(majorProtocolVersion >= 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(majorProtocolVersion >= 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);
+ }
+ }
+
+
+ /**
+ * 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
+ */
+ protected void startStreaming(VideoStreamingParameters parameters, boolean encrypted){
+ this.parameters = parameters;
+ if(hmiLevel != HMILevel.HMI_FULL){
+ Log.e(TAG, "Cannot start video service if HMILevel is not FULL.");
+ return;
+ }
+ //Start the video service
+ this.internalInterface.startVideoService(parameters, encrypted);
+
+
+ }
+
+ /**
+ * 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.
+ */
+ @Override
+ 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);
+ super.dispose();
+ }
+
+ // 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
+ VideoStreamManager.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.getProtocolVersion().getMajor() >= 5){ //At this point we should already have the capability
+ VideoStreamingCapability capability = (VideoStreamingCapability) internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING);
+ if(capability != null){
+ resolution = capability.getPreferredResolution();
+ }
+ }
+
+ if(resolution == null){ //Either the protocol version is too low to access video streaming caps, or they were null
+ 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);
+ }
+
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void onTransportUpdate(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail){
+
+ isTransportAvailable = videoStreamTransportAvail;
+
+ if(internalInterface.getProtocolVersion().isNewerThan(new Version(5,1,0)) >= 0){
+ if(videoStreamTransportAvail){
+ checkState();
+ }
+ }else{
+ //The protocol version doesn't support simultaneous transports.
+ if(!videoStreamTransportAvail){
+ //If video streaming isn't available on primary transport then it is not possible to
+ //use the video streaming manager until a complete register on a transport that
+ //supports video
+ transitionToState(ERROR);
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/AbstractProtocol.java b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/AbstractProtocol.java
new file mode 100644
index 000000000..00becb062
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/AbstractProtocol.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+
+import com.smartdevicelink.protocol.WiProProtocol.MessageFrameAssembler;
+import com.smartdevicelink.protocol.enums.SessionType;
+
+import java.util.List;
+
+/**
+ * @see SdlProtocol
+ */
+@Deprecated
+public abstract class AbstractProtocol {
+ private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
+
+ private IProtocolListener _protocolListener = null;
+ //protected IProtocolListener ProtocolListener() { return _protocolListener; }
+
+ // Lock to ensure all frames are sent uninterupted
+ private Object _frameLock = new Object();
+
+ // Caller must provide a non-null IProtocolListener interface reference.
+ public AbstractProtocol(IProtocolListener protocolListener) {
+ if (protocolListener == null) {
+ throw new IllegalArgumentException("Provided protocol listener interface reference is null");
+ } // end-if
+
+ _protocolListener = protocolListener;
+ } // end-ctor
+
+
+ // This method receives a protocol message (e.g. RPC, BULK, etc.) and processes
+ // it for transmission over the transport. The results of this processing will
+ // be sent to the onProtocolMessageBytesToSend() method on protocol listener
+ // interface. Note that the ProtocolMessage itself contains information
+ // about the type of message (e.g. RPC, BULK, etc.) and the protocol session
+ // over which to send the message, etc.
+ public abstract void SendMessage(ProtocolMessage msg);
+
+ public abstract int getMtu();
+ public abstract long getMtu(SessionType type);
+
+ public abstract void handlePacketReceived(SdlPacket packet);
+
+ // This method starts a protocol session. A corresponding call to the protocol
+ // listener onProtocolSessionStarted() method will be made when the protocol
+ // session has been established.
+ public abstract void StartProtocolSession(SessionType sessionType);
+
+ public abstract void StartProtocolService(SessionType sessionType, byte sessionID, boolean isEncrypted);
+
+ public abstract void EndProtocolService(SessionType serviceType, byte sessionID);
+ // This method ends a protocol session. A corresponding call to the protocol
+ // listener onProtocolSessionEnded() method will be made when the protocol
+ // session has ended.
+ public abstract void EndProtocolSession(SessionType sessionType, byte sessionID, int hashID);
+
+ // TODO REMOVE
+ // This method sets the interval at which heartbeat protocol messages will be
+ // sent to SDL.
+ public abstract void SetHeartbeatSendInterval(int heartbeatSendInterval_ms);
+
+ // This method sets the interval at which heartbeat protocol messages are
+ // expected to be received from SDL.
+ public abstract void SetHeartbeatReceiveInterval(int heartbeatReceiveInterval_ms);
+
+ public abstract void SendHeartBeat(byte sessionID);
+
+ public abstract void SendHeartBeatACK(byte sessionID);
+
+ // This method is called whenever the protocol receives a complete frame
+ protected void handleProtocolFrameReceived(SdlPacket packet, MessageFrameAssembler assembler) {
+ //FIXME SdlTrace.logProtocolEvent(InterfaceActivityDirection.Receive, header, data,
+ // 0, packet.dataSize, SDL_LIB_TRACE_KEY);
+
+ assembler.handleFrame(packet);
+ }
+
+ private synchronized void resetOutgoingHeartbeat(SessionType sessionType, byte sessionID) {
+ if (_protocolListener != null) {
+ _protocolListener.onResetOutgoingHeartbeat(sessionType,sessionID);
+ }
+ }
+
+ private synchronized void resetIncomingHeartbeat(SessionType sessionType, byte sessionID) {
+ if (_protocolListener != null) {
+ _protocolListener.onResetIncomingHeartbeat(sessionType,sessionID);
+ }
+ }
+
+ // This method is called whenever a protocol has an entire frame to send
+ /**
+ * SdlPacket should have included payload at this point.
+ * @param header
+ */
+ protected void handlePacketToSend(SdlPacket header) {
+ //FIXME SdlTrace.logProtocolEvent(InterfaceActivityDirection.Transmit, header, data,
+ // offset, length, SDL_LIB_TRACE_KEY);
+ resetOutgoingHeartbeat(SessionType.valueOf((byte)header.getServiceType()), (byte)header.getSessionId());
+
+ synchronized(_frameLock) {
+
+ //byte[] frameHeader = header.constructPacket();
+ if(header!=null){
+ _protocolListener.onProtocolMessageBytesToSend(header);
+ }//TODO else log out error
+
+ }
+ }
+
+
+ // This method handles received protocol messages.
+ protected void handleProtocolMessageReceived(ProtocolMessage message) {
+ _protocolListener.onProtocolMessageReceived(message);
+ }
+
+ // This method handles the end of a protocol session. A callback is
+ // sent to the protocol listener.
+ protected void handleProtocolSessionEndedNACK(SessionType sessionType,
+ byte sessionID, String correlationID) {
+ _protocolListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
+ }
+
+ // This method handles the end of a protocol session. A callback is
+ // sent to the protocol listener.
+ protected void handleProtocolSessionEnded(SessionType sessionType,
+ byte sessionID, String correlationID) {
+ _protocolListener.onProtocolSessionEnded(sessionType, sessionID, correlationID);
+ }
+
+ // This method handles the startup of a protocol session. A callback is sent
+ // to the protocol listener.
+ protected void handleProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
+ _protocolListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
+ }
+
+ protected void handleProtocolSessionNACKed(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+ _protocolListener.onProtocolSessionNACKed(sessionType, sessionID, version, correlationID, rejectedParams);
+ }
+
+ // This method handles protocol errors. A callback is sent to the protocol
+ // listener.
+ protected void handleProtocolError(String string, Exception ex) {
+ _protocolListener.onProtocolError(string, ex);
+ }
+ protected void handleProtocolHeartbeat(SessionType sessionType, byte sessionID) {
+ SendHeartBeatACK(sessionID);
+ _protocolListener.onProtocolHeartbeat(sessionType, sessionID);
+ }
+ protected void handleProtocolHeartbeatACK(SessionType sessionType, byte sessionID) {
+ _protocolListener.onProtocolHeartbeatACK(sessionType, sessionID);
+ }
+ protected void handleProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID) {
+ _protocolListener.onProtocolServiceDataACK(sessionType, dataSize, sessionID);
+ }
+ protected void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID) {
+ resetIncomingHeartbeat(sessionType, sessionID);
+ }
+
+} // end-class
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
new file mode 100644
index 000000000..c06709b52
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.protocol;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.TransportManager;
+
+
+@SuppressWarnings("WeakerAccess")
+public class SdlProtocol extends SdlProtocolBase {
+ private static final String TAG ="SdlProtocol";
+
+
+ @SuppressWarnings("ConstantConditions")
+ public SdlProtocol(@NonNull ISdlProtocol iSdlProtocol, @NonNull MultiplexTransportConfig config) {
+ super(iSdlProtocol,config);
+ this.requestedPrimaryTransports = config.getPrimaryTransports();
+ this.requestedSecondaryTransports = config.getSecondaryTransports();
+ this.requiresHighBandwidth = config.requiresHighBandwidth();
+ this.setTransportManager(new TransportManager(config,transportEventListener));
+ }
+
+
+ /**
+ * If there was a TransportListener attached to the supplied multiplex config, this method will
+ * call the onTransportEvent method.
+ */
+ @Override
+ void notifyDevTransportListener (){
+ MultiplexTransportConfig transportConfig = (MultiplexTransportConfig)this.transportConfig;
+ if(transportConfig.getTransportListener() != null && transportManager != null) {
+ transportConfig.getTransportListener().onTransportEvent(transportManager.getConnectedTransports(), isTransportForServiceAvailable(SessionType.PCM),isTransportForServiceAvailable(SessionType.NAV));
+ }
+ }
+
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java
new file mode 100644
index 000000000..4a9c68dc5
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java
@@ -0,0 +1,695 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+import com.smartdevicelink.SdlConnection.SdlConnection;
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.protocol.enums.ControlFrameTags;
+import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
+import com.smartdevicelink.protocol.enums.FrameType;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.rpc.ImageResolution;
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.util.BitConverter;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.Version;
+
+import java.io.ByteArrayOutputStream;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * @see SdlProtocol
+ */
+@Deprecated
+public class WiProProtocol extends AbstractProtocol {
+ private final static String FailurePropagating_Msg = "Failure propagating ";
+ //If increasing MAX PROTOCOL VERSION major version, make sure to alter it in SdlPsm
+ public static final Version MAX_PROTOCOL_VERSION = new Version("5.0.0");
+ private Version protocolVersion = new Version("1.0.0");
+ byte _version = 1;
+
+ public static final int V1_V2_MTU_SIZE = 1500;
+ public static final int V3_V4_MTU_SIZE = 131072;
+ public static final int V1_HEADER_SIZE = 8;
+ public static final int V2_HEADER_SIZE = 12;
+ private static int HEADER_SIZE = 8;
+ private static int TLS_MAX_RECORD_SIZE = 16384;
+
+ int hashID = 0;
+ int messageID = 0;
+ SdlConnection sdlconn = null;
+
+ @SuppressWarnings("unused")
+ private int _heartbeatSendInterval_ms = 0;
+ @SuppressWarnings("unused")
+ private int _heartbeatReceiveInterval_ms = 0;
+
+ Hashtable<Integer, MessageFrameAssembler> _assemblerForMessageID = new Hashtable<Integer, MessageFrameAssembler>();
+ Hashtable<Byte, Hashtable<Integer, MessageFrameAssembler>> _assemblerForSessionID = new Hashtable<Byte, Hashtable<Integer, MessageFrameAssembler>>();
+ Hashtable<Byte, Object> _messageLocks = new Hashtable<Byte, Object>();
+ private HashMap<SessionType, Long> mtus = new HashMap<SessionType,Long>();
+
+ // Hide no-arg ctor
+ private WiProProtocol() {
+ super(null);
+ } // end-ctor
+
+
+ public WiProProtocol(IProtocolListener protocolListener) {
+ super(protocolListener);
+
+ if (protocolListener instanceof SdlConnection)
+ {
+ sdlconn = (SdlConnection) protocolListener;
+ }
+ mtus.put(SessionType.RPC, new Long(V1_V2_MTU_SIZE - HEADER_SIZE));
+ } // end-ctor
+
+ /**
+ * Retrieves the max payload size for a packet to be sent to the module
+ * @return the max transfer unit
+ */
+ public int getMtu(){
+ return mtus.get(SessionType.RPC).intValue();
+ }
+
+ public long getMtu(SessionType type){
+ Long mtu = mtus.get(type);
+ if(mtu == null){
+ mtu = mtus.get(SessionType.RPC);
+ }
+ return mtu;
+ }
+
+
+ /**
+ * Use getProtocolVersion() or getMajorVersionByte instead.<br>
+ * Returns the Major version of the currently used protocol version
+ */
+ @Deprecated
+ public byte getVersion() {
+ return getMajorVersionByte();
+ }
+
+ public Version getProtocolVersion(){
+ return this.protocolVersion;
+ }
+ public byte getMajorVersionByte(){
+ if(_version == 1){
+ _version = new Integer(this.protocolVersion.getMajor()).byteValue();
+ }
+ return _version;
+
+ }
+
+ /**
+ * This method will set the major protocol version that we should use. It will also set the default MTU based on version.
+ * @param version
+ */
+ public void setVersion(byte version) {
+ if (version > 5) {
+ this.protocolVersion = new Version("5.0.0"); //protect for future, proxy only supports v5 or lower
+ HEADER_SIZE = 12;
+ mtus.put(SessionType.RPC,new Long(V3_V4_MTU_SIZE) );
+ } else if (version == 5) {
+ this.protocolVersion = new Version("5.0.0");
+ HEADER_SIZE = 12;
+ mtus.put(SessionType.RPC,new Long(V3_V4_MTU_SIZE) );
+ }else if (version == 4) {
+ this.protocolVersion = new Version("4.0.0");
+ HEADER_SIZE = 12;
+ mtus.put(SessionType.RPC,new Long(V3_V4_MTU_SIZE) ); //versions 4 supports 128k MTU
+ } else if (version == 3) {
+ this.protocolVersion = new Version("3.0.0");
+ HEADER_SIZE = 12;
+ mtus.put(SessionType.RPC,new Long(V3_V4_MTU_SIZE) ); //versions 3 supports 128k MTU
+ } else if (version == 2) {
+ this.protocolVersion = new Version("2.0.0");
+ HEADER_SIZE = 12;
+ mtus.put(SessionType.RPC,new Long(V1_V2_MTU_SIZE - HEADER_SIZE) );
+ } else if (version == 1){
+ this.protocolVersion = new Version("1.0.0");
+ HEADER_SIZE = 8;
+ mtus.put(SessionType.RPC,new Long(V1_V2_MTU_SIZE - HEADER_SIZE) );
+ }
+ }
+
+ public void StartProtocolSession(SessionType sessionType) {
+ SdlPacket header = SdlPacketFactory.createStartSession(sessionType, 0x00, getMajorVersionByte(), (byte) 0x00, false);
+ if(sessionType.equals(SessionType.RPC)){ // check for RPC session
+ header.putTag(ControlFrameTags.RPC.StartService.PROTOCOL_VERSION, MAX_PROTOCOL_VERSION.toString());
+ }
+ handlePacketToSend(header);
+ } // end-method
+
+ private void sendStartProtocolSessionACK(SessionType sessionType, byte sessionID) {
+ SdlPacket header = SdlPacketFactory.createStartSessionACK(sessionType, sessionID, 0x00, getMajorVersionByte());
+ handlePacketToSend(header);
+ } // end-method
+
+ public void EndProtocolSession(SessionType sessionType, byte sessionID, int hashId) {
+ SdlPacket header;
+ if (sessionType.equals(SessionType.RPC)) { // check for RPC session
+ header = SdlPacketFactory.createEndSession(sessionType, sessionID, hashID, getMajorVersionByte(), hashID);
+ }else{ //Any other service type we don't include the hash id
+ header = SdlPacketFactory.createEndSession(sessionType, sessionID, hashID, getMajorVersionByte(), new byte[0]);
+ }
+ handlePacketToSend(header);
+
+ } // end-method
+
+ public void SendMessage(ProtocolMessage protocolMsg) {
+ SessionType sessionType = protocolMsg.getSessionType();
+ byte sessionID = protocolMsg.getSessionID();
+
+ byte[] data = null;
+ if (protocolVersion.getMajor() > 1 && sessionType != SessionType.NAV && sessionType != SessionType.PCM) {
+ if (sessionType.eq(SessionType.CONTROL)) {
+ final byte[] secureData = protocolMsg.getData().clone();
+ data = new byte[HEADER_SIZE + secureData.length];
+
+ final BinaryFrameHeader binFrameHeader =
+ SdlPacketFactory.createBinaryFrameHeader(protocolMsg.getRPCType(),protocolMsg.getFunctionID(), protocolMsg.getCorrID(), 0);
+ System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, HEADER_SIZE);
+ System.arraycopy(secureData, 0, data,HEADER_SIZE, secureData.length);
+ }
+ else if (protocolMsg.getBulkData() != null) {
+ data = new byte[12 + protocolMsg.getJsonSize() + protocolMsg.getBulkData().length];
+ sessionType = SessionType.BULK_DATA;
+ } else {
+ data = new byte[12 + protocolMsg.getJsonSize()];
+ }
+ if (!sessionType.eq(SessionType.CONTROL)) {
+ BinaryFrameHeader binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(protocolMsg.getRPCType(), protocolMsg.getFunctionID(), protocolMsg.getCorrID(), protocolMsg.getJsonSize());
+ System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
+ System.arraycopy(protocolMsg.getData(), 0, data, 12, protocolMsg.getJsonSize());
+ if (protocolMsg.getBulkData() != null) {
+ System.arraycopy(protocolMsg.getBulkData(), 0, data, 12 + protocolMsg.getJsonSize(), protocolMsg.getBulkData().length);
+ }
+ }
+ } else {
+ data = protocolMsg.getData();
+ }
+
+ if (sdlconn != null && protocolMsg.getPayloadProtected())
+ {
+ if (data != null && data.length > 0) {
+ SdlSession session = sdlconn.findSessionById(sessionID);
+
+ if (session == null)
+ return;
+
+ byte[] dataToRead = new byte[TLS_MAX_RECORD_SIZE];
+ SdlSecurityBase sdlSec = session.getSdlSecurity();
+ if (sdlSec == null)
+ return;
+
+ Integer iNumBytes = sdlSec.encryptData(data, dataToRead);
+ if ((iNumBytes == null) || (iNumBytes <= 0))
+ return;
+
+ byte[] encryptedData = new byte[iNumBytes];
+ System.arraycopy(dataToRead, 0, encryptedData, 0, iNumBytes);
+ data = encryptedData;
+ }
+ }
+
+ // Get the message lock for this protocol session
+ Object messageLock = _messageLocks.get(sessionID);
+ if (messageLock == null) {
+ handleProtocolError("Error sending protocol message to SDL.",
+ new SdlException("Attempt to send protocol message prior to startSession ACK.", SdlExceptionCause.SDL_UNAVAILABLE));
+ return;
+ }
+
+ synchronized(messageLock) {
+ if (data.length > getMtu(sessionType)) {
+
+ messageID++;
+
+ // Assemble first frame.
+ Long mtu = getMtu(sessionType);
+ int frameCount = new Long(data.length / mtu).intValue();
+ if (data.length % mtu > 0) {
+ frameCount++;
+ }
+ //byte[] firstFrameData = new byte[HEADER_SIZE];
+ byte[] firstFrameData = new byte[8];
+ // First four bytes are data size.
+ System.arraycopy(BitConverter.intToByteArray(data.length), 0, firstFrameData, 0, 4);
+ // Second four bytes are frame count.
+ System.arraycopy(BitConverter.intToByteArray(frameCount), 0, firstFrameData, 4, 4);
+
+ SdlPacket firstHeader = SdlPacketFactory.createMultiSendDataFirst(sessionType, sessionID, messageID, getMajorVersionByte(),firstFrameData,protocolMsg.getPayloadProtected());
+ firstHeader.setPriorityCoefficient(1+protocolMsg.priorityCoefficient);
+ //Send the first frame
+ handlePacketToSend(firstHeader);
+
+ int currentOffset = 0;
+ byte frameSequenceNumber = 0;
+
+ for (int i = 0; i < frameCount; i++) {
+ if (i < (frameCount - 1)) {
+ ++frameSequenceNumber;
+ if (frameSequenceNumber ==
+ SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME) {
+ // we can't use 0x00 as frameSequenceNumber, because
+ // it's reserved for the last frame
+ ++frameSequenceNumber;
+ }
+ } else {
+ frameSequenceNumber = SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME;
+ } // end-if
+
+ int bytesToWrite = data.length - currentOffset;
+ if (bytesToWrite > mtu) {
+ bytesToWrite = mtu.intValue();
+ }
+ SdlPacket consecHeader = SdlPacketFactory.createMultiSendDataRest(sessionType, sessionID, bytesToWrite, frameSequenceNumber , messageID, getMajorVersionByte(),data, currentOffset, bytesToWrite, protocolMsg.getPayloadProtected());
+ consecHeader.setPriorityCoefficient(i+2+protocolMsg.priorityCoefficient);
+ handlePacketToSend(consecHeader);
+ currentOffset += bytesToWrite;
+ }
+ } else {
+ messageID++;
+ SdlPacket header = SdlPacketFactory.createSingleSendData(sessionType, sessionID, data.length, messageID, getMajorVersionByte(),data, protocolMsg.getPayloadProtected());
+ header.setPriorityCoefficient(protocolMsg.priorityCoefficient);
+ handlePacketToSend(header);
+ }
+ }
+ }
+
+ public void handlePacketReceived(SdlPacket packet){
+ //Check for a version difference
+ if (getMajorVersionByte() == 1) {
+ setVersion((byte)packet.version);
+ }
+
+ MessageFrameAssembler assembler = getFrameAssemblerForFrame(packet);
+ assembler.handleFrame(packet);
+
+ onResetIncomingHeartbeat(SessionType.valueOf((byte)packet.getServiceType()), (byte)packet.getSessionId());
+
+ }
+
+
+
+ protected MessageFrameAssembler getFrameAssemblerForFrame(SdlPacket packet) {
+ Integer iSessionId = Integer.valueOf(packet.getSessionId());
+ Byte bySessionId = iSessionId.byteValue();
+
+ Hashtable<Integer, MessageFrameAssembler> hashSessionID = _assemblerForSessionID.get(bySessionId);
+ if (hashSessionID == null) {
+ hashSessionID = new Hashtable<Integer, MessageFrameAssembler>();
+ _assemblerForSessionID.put(bySessionId, hashSessionID);
+ } // end-if
+
+ MessageFrameAssembler ret = (MessageFrameAssembler) _assemblerForMessageID.get(Integer.valueOf(packet.getMessageId()));
+ if (ret == null) {
+ ret = new MessageFrameAssembler();
+ _assemblerForMessageID.put(Integer.valueOf(packet.getMessageId()), ret);
+ } // end-if
+
+ return ret;
+ } // end-method
+
+ protected class MessageFrameAssembler {
+ protected boolean hasFirstFrame = false;
+ protected ByteArrayOutputStream accumulator = null;
+ protected int totalSize = 0;
+ protected int framesRemaining = 0;
+
+ protected void handleFirstDataFrame(SdlPacket packet) {
+ //The message is new, so let's figure out how big it is.
+ hasFirstFrame = true;
+ totalSize = BitConverter.intFromByteArray(packet.payload, 0) - HEADER_SIZE;
+ framesRemaining = BitConverter.intFromByteArray(packet.payload, 4);
+ try {
+ accumulator = new ByteArrayOutputStream(totalSize);
+ }catch(OutOfMemoryError e){
+ DebugTool.logError("OutOfMemory error", e); //Garbled bits were received
+ accumulator = null;
+ }
+ }
+
+ protected void handleRemainingFrame(SdlPacket packet) {
+ accumulator.write(packet.payload, 0, (int)packet.getDataSize());
+ notifyIfFinished(packet);
+ }
+
+ protected void notifyIfFinished(SdlPacket packet) {
+ //if (framesRemaining == 0) {
+ if (packet.getFrameType() == FrameType.Consecutive && packet.getFrameInfo() == 0x0)
+ {
+ ProtocolMessage message = new ProtocolMessage();
+ message.setPayloadProtected(packet.isEncrypted());
+ message.setSessionType(SessionType.valueOf((byte)packet.getServiceType()));
+ message.setSessionID((byte)packet.getSessionId());
+ //If it is WiPro 2.0 it must have binary header
+ if (protocolVersion.getMajor() > 1) {
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
+ parseBinaryHeader(accumulator.toByteArray());
+ if(binFrameHeader == null) {
+ return;
+ }
+ message.setVersion(getMajorVersionByte());
+ message.setRPCType(binFrameHeader.getRPCType());
+ message.setFunctionID(binFrameHeader.getFunctionID());
+ message.setCorrID(binFrameHeader.getCorrID());
+ if (binFrameHeader.getJsonSize() > 0) message.setData(binFrameHeader.getJsonData());
+ if (binFrameHeader.getBulkData() != null) message.setBulkData(binFrameHeader.getBulkData());
+ } else{
+ message.setData(accumulator.toByteArray());
+ }
+
+ _assemblerForMessageID.remove(packet.getMessageId());
+
+ try {
+ handleProtocolMessageReceived(message);
+ } catch (Exception excp) {
+ DebugTool.logError(FailurePropagating_Msg + "onProtocolMessageReceived: " + excp.toString(), excp);
+ } // end-catch
+
+ hasFirstFrame = false;
+ accumulator = null;
+ } // end-if
+ } // end-method
+
+ protected void handleMultiFrameMessageFrame(SdlPacket packet) {
+ if (packet.getFrameType() == FrameType.First){
+ handleFirstDataFrame(packet);
+ }
+ else{
+ if(accumulator != null)
+ handleRemainingFrame(packet);
+ }
+
+ } // end-method
+
+ protected void handleFrame(SdlPacket packet) {
+
+ if (packet.getPayload() != null && packet.getDataSize() > 0 && packet.isEncrypted() )
+ {
+ if (sdlconn != null)
+ {
+ SdlSession session = sdlconn.findSessionById((byte)packet.getSessionId());
+
+ if (session == null)
+ return;
+
+ SdlSecurityBase sdlSec = session.getSdlSecurity();
+ byte[] dataToRead = new byte[4096];
+
+ Integer iNumBytes = sdlSec.decryptData(packet.getPayload(), dataToRead);
+ if ((iNumBytes == null) || (iNumBytes <= 0))
+ return;
+
+ byte[] decryptedData = new byte[iNumBytes];
+ System.arraycopy(dataToRead, 0, decryptedData, 0, iNumBytes);
+ packet.payload = decryptedData;
+ }
+ }
+
+ if (packet.getFrameType().equals(FrameType.Control)) {
+ handleControlFrame(packet);
+ } else {
+ // Must be a form of data frame (single, first, consecutive, etc.)
+ if ( packet.getFrameType() == FrameType.First
+ || packet.getFrameType() == FrameType.Consecutive
+ ) {
+ handleMultiFrameMessageFrame(packet);
+ } else {
+ handleSingleFrameMessageFrame(packet);
+ }
+ } // end-if
+ } // end-method
+
+ private void handleProtocolHeartbeatACK(SdlPacket packet) {
+ WiProProtocol.this.handleProtocolHeartbeatACK(SessionType.valueOf((byte)packet.getServiceType()),(byte)packet.getSessionId());
+ } // end-method
+ private void handleProtocolHeartbeat(SdlPacket packet) {
+ WiProProtocol.this.handleProtocolHeartbeat(SessionType.valueOf((byte)packet.getServiceType()),(byte)packet.getSessionId());
+ } // end-method
+
+ private void handleControlFrame(SdlPacket packet) {
+ Integer frameTemp = Integer.valueOf(packet.getFrameInfo());
+ Byte frameInfo = frameTemp.byteValue();
+
+ SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
+
+ if (frameInfo == FrameDataControlFrameType.Heartbeat.getValue()) {
+ handleProtocolHeartbeat(packet);
+ }
+ if (frameInfo == FrameDataControlFrameType.HeartbeatACK.getValue()) {
+ handleProtocolHeartbeatACK(packet);
+ }
+ else if (frameInfo == FrameDataControlFrameType.StartSession.getValue()) {
+ sendStartProtocolSessionACK(serviceType, (byte)packet.getSessionId());
+ } else if (frameInfo == FrameDataControlFrameType.StartSessionACK.getValue()) {
+ // Use this sessionID to create a message lock
+ Object messageLock = _messageLocks.get(packet.getSessionId());
+ if (messageLock == null) {
+ messageLock = new Object();
+ _messageLocks.put((byte)packet.getSessionId(), messageLock);
+ }
+ if(packet.version >= 5){
+ String mtuTag = null;
+ if(serviceType.equals(SessionType.RPC)){
+ mtuTag = ControlFrameTags.RPC.StartServiceACK.MTU;
+ }else if(serviceType.equals(SessionType.PCM)){
+ mtuTag = ControlFrameTags.Audio.StartServiceACK.MTU;
+ }else if(serviceType.equals(SessionType.NAV)){
+ mtuTag = ControlFrameTags.Video.StartServiceACK.MTU;
+ }
+ Object mtu = packet.getTag(mtuTag);
+ if(mtu!=null){
+ mtus.put(serviceType,(Long) packet.getTag(mtuTag));
+ }
+ if(serviceType.equals(SessionType.RPC)){
+ hashID = (Integer) packet.getTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID);
+ Object version = packet.getTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION);
+ if(version!=null){
+ //At this point we have confirmed the negotiated version between the module and the proxy
+ protocolVersion = new Version((String)version);
+ }
+ }else if(serviceType.equals(SessionType.NAV)){
+ SdlSession session = sdlconn.findSessionById((byte) packet.sessionId);
+ if(session != null) {
+ ImageResolution acceptedResolution = new ImageResolution();
+ VideoStreamingFormat acceptedFormat = new VideoStreamingFormat();
+ acceptedResolution.setResolutionHeight((Integer) packet.getTag(ControlFrameTags.Video.StartServiceACK.HEIGHT));
+ acceptedResolution.setResolutionWidth((Integer) packet.getTag(ControlFrameTags.Video.StartServiceACK.WIDTH));
+ acceptedFormat.setCodec(VideoStreamingCodec.valueForString((String) packet.getTag(ControlFrameTags.Video.StartServiceACK.VIDEO_CODEC)));
+ acceptedFormat.setProtocol(VideoStreamingProtocol.valueForString((String) packet.getTag(ControlFrameTags.Video.StartServiceACK.VIDEO_PROTOCOL)));
+ VideoStreamingParameters agreedVideoParams = session.getDesiredVideoParams();
+ agreedVideoParams.setResolution(acceptedResolution);
+ agreedVideoParams.setFormat(acceptedFormat);
+ session.setAcceptedVideoParams(agreedVideoParams);
+ }
+ }
+ }else{
+ if (protocolVersion.getMajor() > 1){
+ if (packet.payload!= null && packet.dataSize == 4){ //hashid will be 4 bytes in length
+ hashID = BitConverter.intFromByteArray(packet.payload, 0);
+ }
+ }
+ }
+ handleProtocolSessionStarted(serviceType,(byte) packet.getSessionId(), getMajorVersionByte(), "", hashID, packet.isEncrypted());
+
+ if(serviceType.equals(SessionType.RPC)
+ && protocolVersion.isNewerThan(new Version(5,2,0)) >= 0){
+ // This has to be done after the session has been established because
+ // SdlConnection is just setup that way
+ String authToken = (String)packet.getTag(ControlFrameTags.RPC.StartServiceACK.AUTH_TOKEN);
+ if(authToken != null){
+ sdlconn.onAuthTokenReceived(authToken, (byte)packet.getSessionId());
+ }
+ }
+ } else if (frameInfo == FrameDataControlFrameType.StartSessionNACK.getValue()) {
+ List<String> rejectedParams = null;
+ if(packet.version >= 5){
+ String rejectedTag = null;
+ if(serviceType.equals(SessionType.RPC)){
+ rejectedTag = ControlFrameTags.RPC.StartServiceNAK.REJECTED_PARAMS;
+ }else if(serviceType.equals(SessionType.PCM)){
+ rejectedTag = ControlFrameTags.Audio.StartServiceNAK.REJECTED_PARAMS;
+ }else if(serviceType.equals(SessionType.NAV)){
+ rejectedTag = ControlFrameTags.Video.StartServiceNAK.REJECTED_PARAMS;
+ }
+ rejectedParams = (List<String>) packet.getTag(rejectedTag);
+ }
+ if (serviceType.eq(SessionType.NAV) || serviceType.eq(SessionType.PCM)) {
+ handleProtocolSessionNACKed(serviceType, (byte)packet.getSessionId(), getMajorVersionByte(), "", rejectedParams);
+ } else {
+ handleProtocolError("Got StartSessionNACK for protocol sessionID=" + packet.getSessionId(), null);
+ }
+ } else if (frameInfo == FrameDataControlFrameType.EndSession.getValue()) {
+ if (protocolVersion.getMajor() > 1) {
+ handleProtocolSessionEnded(serviceType, (byte)packet.getSessionId(), "");
+ } else {
+ handleProtocolSessionEnded(serviceType, (byte)packet.getSessionId(), "");
+ }
+ } else if (frameInfo == FrameDataControlFrameType.EndSessionACK.getValue()) {
+ handleProtocolSessionEnded(serviceType, (byte)packet.getSessionId(), "");
+ } else if (frameInfo == FrameDataControlFrameType.EndSessionNACK.getValue()) {
+ if(packet.version >= 5){
+ String rejectedTag = null;
+ if(serviceType.equals(SessionType.RPC)){
+ rejectedTag = ControlFrameTags.RPC.EndServiceNAK.REJECTED_PARAMS;
+ }else if(serviceType.equals(SessionType.PCM)){
+ rejectedTag = ControlFrameTags.Audio.EndServiceNAK.REJECTED_PARAMS;
+ }else if(serviceType.equals(SessionType.NAV)){
+ rejectedTag = ControlFrameTags.Video.EndServiceNAK.REJECTED_PARAMS;
+ }
+ List<String> rejectedParams = (List<String>) packet.getTag(rejectedTag);
+ // TODO: Pass these back
+ }
+ handleProtocolSessionEndedNACK(serviceType, (byte)packet.getSessionId(), "");
+ } else if (frameInfo == FrameDataControlFrameType.ServiceDataACK.getValue()) {
+ if (packet.getPayload() != null && packet.getDataSize() == 4) //service data ack will be 4 bytes in length
+ {
+ int serviceDataAckSize = BitConverter.intFromByteArray(packet.getPayload(), 0);
+ handleProtocolServiceDataACK(serviceType, serviceDataAckSize,(byte)packet.getSessionId ());
+ }
+ }
+ _assemblerForMessageID.remove(packet.getMessageId());
+ } // end-method
+
+ private void handleSingleFrameMessageFrame(SdlPacket packet) {
+ ProtocolMessage message = new ProtocolMessage();
+ message.setPayloadProtected(packet.isEncrypted());
+ SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
+ if (serviceType == SessionType.RPC) {
+ message.setMessageType(MessageType.RPC);
+ } else if (serviceType == SessionType.BULK_DATA) {
+ message.setMessageType(MessageType.BULK);
+ } // end-if
+ message.setSessionType(serviceType);
+ message.setSessionID((byte)packet.getSessionId());
+ //If it is WiPro 2.0 it must have binary header
+ boolean isControlService = message.getSessionType().equals(SessionType.CONTROL);
+ if (protocolVersion.getMajor() > 1 && !isControlService) {
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
+ parseBinaryHeader(packet.payload);
+ if(binFrameHeader == null) {
+ return;
+ }
+ message.setVersion(getMajorVersionByte());
+ message.setRPCType(binFrameHeader.getRPCType());
+ message.setFunctionID(binFrameHeader.getFunctionID());
+ message.setCorrID(binFrameHeader.getCorrID());
+ if (binFrameHeader.getJsonSize() > 0){
+ message.setData(binFrameHeader.getJsonData());
+ }
+ if (binFrameHeader.getBulkData() != null){
+ message.setBulkData(binFrameHeader.getBulkData());
+ }
+ } else {
+ message.setData(packet.payload);
+ }
+
+ _assemblerForMessageID.remove(packet.getMessageId());
+
+ try {
+ handleProtocolMessageReceived(message);
+ } catch (Exception ex) {
+ DebugTool.logError(FailurePropagating_Msg + "onProtocolMessageReceived: " + ex.toString(), ex);
+ handleProtocolError(FailurePropagating_Msg + "onProtocolMessageReceived: ", ex);
+ } // end-catch
+ } // end-method
+ } // end-class
+
+ @Override
+ public void StartProtocolService(SessionType sessionType, byte sessionID, boolean isEncrypted) {
+ SdlPacket header = SdlPacketFactory.createStartSession(sessionType, 0x00, getMajorVersionByte(), sessionID, isEncrypted);
+ if(sessionType.equals(SessionType.NAV)){
+ SdlSession videoSession = sdlconn.findSessionById(sessionID);
+ if(videoSession != null){
+ ImageResolution desiredResolution = videoSession.getDesiredVideoParams().getResolution();
+ VideoStreamingFormat desiredFormat = videoSession.getDesiredVideoParams().getFormat();
+ if(desiredResolution != null){
+ header.putTag(ControlFrameTags.Video.StartService.WIDTH, desiredResolution.getResolutionWidth());
+ header.putTag(ControlFrameTags.Video.StartService.HEIGHT, desiredResolution.getResolutionHeight());
+ }
+ if(desiredFormat != null){
+ header.putTag(ControlFrameTags.Video.StartService.VIDEO_CODEC, desiredFormat.getCodec().toString());
+ header.putTag(ControlFrameTags.Video.StartService.VIDEO_PROTOCOL, desiredFormat.getProtocol().toString());
+ }
+ }
+ }
+ handlePacketToSend(header);
+ }
+
+ @Override
+ public void SetHeartbeatSendInterval(int heartbeatSendInterval_ms) {
+ _heartbeatSendInterval_ms = heartbeatSendInterval_ms;
+
+ }
+
+ @Override
+ public void SetHeartbeatReceiveInterval(int heartbeatReceiveInterval_ms) {
+ _heartbeatReceiveInterval_ms = heartbeatReceiveInterval_ms;
+
+ }
+
+ @Override
+ public void SendHeartBeat(byte sessionID) {
+ final SdlPacket heartbeat = SdlPacketFactory.createHeartbeat(SessionType.CONTROL, sessionID, getMajorVersionByte());
+ handlePacketToSend(heartbeat);
+ }
+
+ @Override
+ public void SendHeartBeatACK(byte sessionID) {
+ final SdlPacket heartbeat = SdlPacketFactory.createHeartbeatACK(SessionType.CONTROL, sessionID, getMajorVersionByte());
+ handlePacketToSend(heartbeat);
+ }
+
+ @Override
+ public void EndProtocolService(SessionType serviceType, byte sessionID) {
+ if(serviceType.equals(SessionType.RPC)){ //RPC session will close all other sessions so we want to make sure we use the correct EndProtocolSession method
+ EndProtocolSession(serviceType,sessionID,hashID);
+ }else {
+ SdlPacket header = SdlPacketFactory.createEndSession(serviceType, sessionID, hashID, getMajorVersionByte(), new byte[0]);
+ handlePacketToSend(header);
+ }
+ }
+
+} // end-class \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java
new file mode 100644
index 000000000..ce314595d
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.heartbeat;
+
+
+import android.os.Handler;
+import android.os.Looper;
+
+
+public class HeartbeatMonitor implements IHeartbeatMonitor {
+
+ public static final int HEARTBEAT_INTERVAL = 5000;
+ public static final int HEARTBEAT_INTERVAL_MAX = Integer.MAX_VALUE;
+
+ private final Object heartbeatThreadHandlerLock = new Object();
+ private final Object listenerLock = new Object();
+
+ private int mHeartBeatInterval = HEARTBEAT_INTERVAL;
+ private boolean mHeartBeatAck = true;
+
+ private IHeartbeatMonitorListener mListener;
+ private volatile boolean mIsAckReceived;
+ private volatile boolean isHeartbeatReceived;
+ private Thread mHeartbeatThread;
+ private Looper mHeartbeatThreadLooper;
+ private Handler mHeartbeatThreadHandler;
+
+ public HeartbeatMonitor() {
+ }
+
+ // Methods used to retrieve values for unit testing only.
+ // See com/smartdevicelink/tests/protocol/heartbeat/HeartbeatMonitorTests.
+ public Runnable getHeartbeatRunnable () { return heartbeatTimeoutRunnable; }
+ public boolean isHeartbeatReceived () { return isHeartbeatReceived; }
+
+ private Runnable heartbeatTimeoutRunnable = new Runnable() {
+
+ @Override
+ public void run() {
+ try{
+ synchronized (listenerLock) {
+ if (isHeartbeatReceived) {
+ if (mListener != null) {
+ mListener.sendHeartbeat(HeartbeatMonitor.this);
+ } else {
+
+ }
+ isHeartbeatReceived = false;
+ } else {
+ if (mListener != null) {
+ mListener.heartbeatTimedOut(HeartbeatMonitor.this);
+ }
+ }
+ }
+ }
+ catch(Exception ex)
+ {
+ stop();
+ }
+ }
+ };
+
+ private Runnable heartbeatAckTimeoutRunnable = new Runnable() {
+
+ @Override
+ public void run() {
+
+ try
+ {
+ synchronized (listenerLock) {
+ if (mIsAckReceived) {
+ if (mListener != null) {
+ mListener.sendHeartbeat(HeartbeatMonitor.this);
+ } else {
+ }
+ mIsAckReceived = false;
+ } else {
+ if (mListener != null) {
+ mListener.heartbeatTimedOut(HeartbeatMonitor.this);
+ }
+ stop();
+ }
+ }
+
+ }
+ catch(Exception ex)
+ {
+ stop();
+ }
+
+ rescheduleHeartbeat();
+ }
+
+ private void rescheduleHeartbeat() {
+ synchronized (heartbeatThreadHandlerLock) {
+ if (mHeartbeatThreadHandler != null) {
+ if (!Thread.interrupted()) {
+ if (!mHeartbeatThreadHandler.postDelayed(this, mHeartBeatInterval)) {
+ }
+ } else {
+ }
+ } else {
+ stop();
+ }
+ }
+ }
+ };
+
+ @Override
+ public void start() {
+
+ synchronized (heartbeatThreadHandlerLock) {
+
+ if (mHeartbeatThread != null) {
+ return;
+ }
+
+ mHeartbeatThread = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+
+ while (!Thread.interrupted()) {
+ Looper.prepare();
+ mHeartbeatThreadLooper = Looper.myLooper();
+
+ mHeartbeatThreadHandler = new Handler();
+ mIsAckReceived = true;
+ isHeartbeatReceived = true;
+
+ if (!mHeartbeatThreadHandler.postDelayed(
+ heartbeatAckTimeoutRunnable, mHeartBeatInterval)) {
+ }
+ Looper.loop();
+ }
+ }
+
+ }, "HeartbeatThread");
+ mHeartbeatThread.setPriority(Thread.MAX_PRIORITY);
+ mHeartbeatThread.start();
+ }
+ }
+
+ @Override
+ public void stop() {
+
+
+ synchronized (heartbeatThreadHandlerLock) {
+
+ if (mHeartbeatThread == null) {
+ mHeartbeatThreadHandler = null;
+ mHeartbeatThreadLooper = null;
+ return;
+ }
+
+ mHeartbeatThread.interrupt();
+ mHeartbeatThread = null;
+
+ if (mHeartbeatThreadHandler != null) {
+ mHeartbeatThreadHandler.removeCallbacks(heartbeatAckTimeoutRunnable);
+ mHeartbeatThreadHandler.removeCallbacks(heartbeatTimeoutRunnable);
+ mHeartbeatThreadHandler = null;
+ } else {
+ }
+
+ if (mHeartbeatThreadLooper != null) {
+ mHeartbeatThreadLooper.quit();
+ mHeartbeatThreadLooper = null;
+ } else {
+ }
+ }
+ }
+
+ @Override
+ public int getInterval() {
+ return mHeartBeatInterval;
+ }
+
+ @Override
+ public void setInterval(int value) {
+ mHeartBeatInterval = value;
+ }
+
+ @Override
+ public IHeartbeatMonitorListener getListener() {
+ return mListener;
+ }
+
+ @Override
+ public void setListener(IHeartbeatMonitorListener value) {
+ mListener = value;
+ }
+
+ @Override
+ public void notifyTransportActivity() {
+ if (mHeartbeatThreadHandler == null) {
+ return;
+ }
+ synchronized (heartbeatThreadHandlerLock) {
+ if (mHeartbeatThreadHandler == null) {
+ return;
+ }
+ mHeartbeatThreadHandler.removeCallbacks(heartbeatAckTimeoutRunnable);
+ if (!mHeartbeatThreadHandler.postDelayed(heartbeatAckTimeoutRunnable, mHeartBeatInterval)) {
+ }
+ }
+ }
+
+
+ @Override
+ public synchronized void heartbeatACKReceived() {
+ synchronized (listenerLock) {
+ mIsAckReceived = true;
+ }
+ }
+
+ @Override
+ public void heartbeatReceived() {
+ if (mHeartbeatThreadHandler == null) {
+ return;
+ }
+ synchronized (listenerLock) {
+ if (mHeartBeatAck) {
+ isHeartbeatReceived = true;
+ if (!mHeartbeatThreadHandler.post(heartbeatTimeoutRunnable)) {
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java
new file mode 100644
index 000000000..2c98413d7
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.heartbeat;
+
+
+public interface IHeartbeatMonitor {
+ /**
+ * Starts the monitor. If the monitor is already started, nothing happens.
+ */
+ public void start();
+
+ /**
+ * Stops the monitor. Does nothing if it is already stopped.
+ */
+ public void stop();
+
+ /**
+ * Returns the heartbeat messages interval.
+ *
+ * @return interval in milliseconds
+ */
+ public int getInterval();
+
+ /**
+ * Sets the interval for sending heartbeat messages if nothing is sent over
+ * transport.
+ *
+ * @param interval interval in milliseconds (min/max values depend on
+ * concrete implementations)
+ */
+ public void setInterval(int interval);
+
+ /**
+ * Returns the listener.
+ *
+ * @return the listener
+ */
+ public IHeartbeatMonitorListener getListener();
+
+ /**
+ * Sets the heartbeat's listener.
+ *
+ * @param listener the new listener
+ */
+ public void setListener(IHeartbeatMonitorListener listener);
+
+ /**
+ * Notifies the monitor about sent/received messages.
+ */
+ public void notifyTransportActivity();
+
+ /**
+ * Notifies the monitor about a received heartbeat ACK message.
+ */
+ public void heartbeatACKReceived();
+
+ /**
+ * Notifies the monitor about a received heartbeat message.
+ */
+ public void heartbeatReceived();
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java
new file mode 100644
index 000000000..da814f3ee
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.heartbeat;
+
+/**
+ * Listener (aka delegate) that actually knows how to work with the outside
+ * world.
+ */
+public interface IHeartbeatMonitorListener {
+ /**
+ * The listener should create and send a heartbeat message.
+ *
+ * @param monitor the caller
+ */
+ public void sendHeartbeat(IHeartbeatMonitor monitor);
+
+ /**
+ * Notifies the listener that the heartbeat timed out.
+ *
+ * @param monitor the caller
+ */
+ public void heartbeatTimedOut(IHeartbeatMonitor monitor);
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java
new file mode 100644
index 000000000..76f92487f
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import android.graphics.Bitmap;
+
+import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
+import com.smartdevicelink.util.AndroidTools;
+
+import java.io.IOException;
+
+public class LockScreenManager {
+
+ public interface OnLockScreenIconDownloadedListener{
+ public void onLockScreenIconDownloaded(Bitmap icon);
+ public void onLockScreenIconDownloadError(Exception e);
+ }
+
+ private Bitmap lockScreenIcon;
+ private Boolean bUserSelected = false;
+ private Boolean bDriverDistStatus = null;
+ private HMILevel hmiLevel = null;
+ @SuppressWarnings("unused")
+ private int iSessionID;
+
+ public synchronized void setSessionID(int iVal)
+ {
+ iSessionID = iVal;
+ }
+
+ private synchronized void setUserSelectedStatus(boolean bVal)
+ {
+ bUserSelected = bVal;
+ }
+
+ public synchronized void setDriverDistStatus(boolean bVal)
+ {
+ bDriverDistStatus = bVal;
+ }
+
+ public synchronized void setHMILevel(HMILevel hmiVal)
+ {
+ hmiLevel = hmiVal;
+
+ if (hmiVal != null) {
+ if ((hmiVal.equals(HMILevel.HMI_FULL)) || (hmiVal.equals(HMILevel.HMI_LIMITED)))
+ setUserSelectedStatus(true);
+ else if (hmiVal.equals(HMILevel.HMI_NONE))
+ setUserSelectedStatus(false);
+ }else{
+ setUserSelectedStatus(false);
+ }
+ }
+
+ public synchronized OnLockScreenStatus getLockObj(/*int SessionID*/)
+ {
+ //int iSessionID = SessionID;
+ OnLockScreenStatus myLock = new OnLockScreenStatus();
+ myLock.setDriverDistractionStatus(bDriverDistStatus);
+ myLock.setHMILevel(hmiLevel);
+ myLock.setUserSelected(bUserSelected);
+ myLock.setShowLockScreen(getLockScreenStatus());
+
+ return myLock;
+ }
+
+ private synchronized LockScreenStatus getLockScreenStatus()
+ {
+
+ if ( (hmiLevel == null) || (hmiLevel.equals(HMILevel.HMI_NONE)) )
+ {
+ return LockScreenStatus.OFF;
+ }
+ else if ( hmiLevel.equals(HMILevel.HMI_BACKGROUND) )
+ {
+ if (bDriverDistStatus == null)
+ {
+ //we don't have driver distraction, lockscreen is entirely based on userselection
+ if (bUserSelected)
+ return LockScreenStatus.REQUIRED;
+ else
+ return LockScreenStatus.OFF;
+ }
+ else if (bDriverDistStatus && bUserSelected)
+ {
+ return LockScreenStatus.REQUIRED;
+ }
+ else if (!bDriverDistStatus && bUserSelected)
+ {
+ return LockScreenStatus.OPTIONAL;
+ }
+ else
+ {
+ return LockScreenStatus.OFF;
+ }
+ }
+ else if ( (hmiLevel.equals(HMILevel.HMI_FULL)) || (hmiLevel.equals(HMILevel.HMI_LIMITED)) )
+ {
+ if ( (bDriverDistStatus != null) && (!bDriverDistStatus) )
+ {
+ return LockScreenStatus.OPTIONAL;
+ }
+ else
+ return LockScreenStatus.REQUIRED;
+ }
+ return LockScreenStatus.OFF;
+ }
+
+ public void downloadLockScreenIcon(final String url, final OnLockScreenIconDownloadedListener l){
+ new Thread(new Runnable(){
+ @Override
+ public void run(){
+ try{
+ lockScreenIcon = AndroidTools.downloadImage(url);
+ if(l != null){
+ l.onLockScreenIconDownloaded(lockScreenIcon);
+ }
+ }catch(IOException e){
+ if(l != null){
+ l.onLockScreenIconDownloadError(e);
+ }
+ }
+ }
+ }).start();
+ }
+
+ public Bitmap getLockScreenIcon(){
+ return this.lockScreenIcon;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java
new file mode 100644
index 000000000..e787fb77d
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java
@@ -0,0 +1,1030 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import android.os.Build;
+
+import com.smartdevicelink.proxy.rpc.AddCommand;
+import com.smartdevicelink.proxy.rpc.AddSubMenu;
+import com.smartdevicelink.proxy.rpc.Alert;
+import com.smartdevicelink.proxy.rpc.ChangeRegistration;
+import com.smartdevicelink.proxy.rpc.Choice;
+import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
+import com.smartdevicelink.proxy.rpc.DeleteCommand;
+import com.smartdevicelink.proxy.rpc.DeleteFile;
+import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
+import com.smartdevicelink.proxy.rpc.DeleteSubMenu;
+import com.smartdevicelink.proxy.rpc.DeviceInfo;
+import com.smartdevicelink.proxy.rpc.EndAudioPassThru;
+import com.smartdevicelink.proxy.rpc.GetVehicleData;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.ListFiles;
+import com.smartdevicelink.proxy.rpc.MenuParams;
+import com.smartdevicelink.proxy.rpc.PerformAudioPassThru;
+import com.smartdevicelink.proxy.rpc.PerformInteraction;
+import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
+import com.smartdevicelink.proxy.rpc.ScrollableMessage;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.SetAppIcon;
+import com.smartdevicelink.proxy.rpc.SetDisplayLayout;
+import com.smartdevicelink.proxy.rpc.SetGlobalProperties;
+import com.smartdevicelink.proxy.rpc.SetMediaClockTimer;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.Slider;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.Speak;
+import com.smartdevicelink.proxy.rpc.StartTime;
+import com.smartdevicelink.proxy.rpc.SubscribeButton;
+import com.smartdevicelink.proxy.rpc.SubscribeVehicleData;
+import com.smartdevicelink.proxy.rpc.SystemRequest;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
+import com.smartdevicelink.proxy.rpc.UnsubscribeButton;
+import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData;
+import com.smartdevicelink.proxy.rpc.VrHelpItem;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
+
+import java.util.Vector;
+
+/**
+ * @deprecated Use RPC constructors directly instead
+ */
+@Deprecated
+public class RPCRequestFactory {
+
+ public static final int SDL_MSG_MAJOR_VERSION = 1;
+ public static final int SDL_MSG_MINOR_VERSION = 0;
+
+ public static SystemRequest buildSystemRequest(
+ String data, Integer correlationID) {
+
+ if(data == null) return null;
+
+ SystemRequest msg = new SystemRequest();
+ msg.setRequestType(RequestType.PROPRIETARY);
+ msg.setCorrelationID(correlationID);
+ msg.setBulkData(data.getBytes());
+ return msg;
+ }
+
+ public static SystemRequest buildSystemRequestLegacy(
+ Vector<String> data, Integer correlationID) {
+
+ if(data == null) return null;
+
+ SystemRequest msg = new SystemRequest(true);
+ msg.setCorrelationID(correlationID);
+ msg.setLegacyData(data);
+ return msg;
+ }
+
+ public static AddCommand buildAddCommand(Integer commandID,
+ String menuText, Integer parentID, Integer position,
+ Vector<String> vrCommands, Image cmdIcon, Integer correlationID) {
+ AddCommand msg = new AddCommand();
+ msg.setCorrelationID(correlationID);
+ msg.setCmdID(commandID);
+ msg.setVrCommands(vrCommands);
+
+ if (cmdIcon != null) msg.setCmdIcon(cmdIcon);
+
+ if(menuText != null || parentID != null || position != null) {
+ MenuParams menuParams = new MenuParams();
+ menuParams.setMenuName(menuText);
+ menuParams.setPosition(position);
+ menuParams.setParentID(parentID);
+ msg.setMenuParams(menuParams);
+ }
+
+ return msg;
+ }
+
+ public static AddCommand buildAddCommand(Integer commandID,
+ String menuText, Integer parentID, Integer position,
+ Vector<String> vrCommands, String IconValue, ImageType IconType,
+ Integer correlationID) {
+ AddCommand msg = new AddCommand();
+ msg.setCorrelationID(correlationID);
+ msg.setCmdID(commandID);
+
+ if (vrCommands != null) msg.setVrCommands(vrCommands);
+
+ Image cmdIcon = null;
+
+ if (IconValue != null && IconType != null)
+ {
+ cmdIcon = new Image();
+ cmdIcon.setValue(IconValue);
+ cmdIcon.setImageType(IconType);
+ }
+
+ if (cmdIcon != null) msg.setCmdIcon(cmdIcon);
+
+ if(menuText != null || parentID != null || position != null) {
+ MenuParams menuParams = new MenuParams();
+ menuParams.setMenuName(menuText);
+ menuParams.setPosition(position);
+ menuParams.setParentID(parentID);
+ msg.setMenuParams(menuParams);
+ }
+
+ return msg;
+ }
+
+ public static AddCommand buildAddCommand(Integer commandID,
+ String menuText, Integer parentID, Integer position,
+ Vector<String> vrCommands, Integer correlationID) {
+ AddCommand msg = new AddCommand();
+ msg.setCorrelationID(correlationID);
+ msg.setCmdID(commandID);
+ msg.setVrCommands(vrCommands);
+
+ if(menuText != null || parentID != null || position != null) {
+ MenuParams menuParams = new MenuParams();
+ menuParams.setMenuName(menuText);
+ menuParams.setPosition(position);
+ menuParams.setParentID(parentID);
+ msg.setMenuParams(menuParams);
+ }
+
+ return msg;
+ }
+
+ public static AddCommand buildAddCommand(Integer commandID,
+ String menuText, Vector<String> vrCommands, Integer correlationID) {
+ AddCommand msg = buildAddCommand(commandID, menuText, null, null,
+ vrCommands, correlationID);
+ return msg;
+ }
+
+ public static AddCommand buildAddCommand(Integer commandID,
+ Vector<String> vrCommands, Integer correlationID) {
+ AddCommand msg = new AddCommand();
+ msg.setCorrelationID(correlationID);
+ msg.setCmdID(commandID);
+ msg.setVrCommands(vrCommands);
+
+ return msg;
+ }
+
+ public static AddSubMenu buildAddSubMenu(Integer menuID, String menuName,
+ Integer correlationID) {
+ AddSubMenu msg = buildAddSubMenu(menuID, menuName, null, correlationID);
+ return msg;
+ }
+
+ public static AddSubMenu buildAddSubMenu(Integer menuID, String menuName,
+ Integer position, Integer correlationID) {
+ AddSubMenu msg = new AddSubMenu();
+ msg.setCorrelationID(correlationID);
+ msg.setMenuName(menuName);
+ msg.setMenuID(menuID);
+ msg.setPosition(position);
+
+ return msg;
+ }
+
+ public static Alert buildAlert(String ttsText, Boolean playTone,
+ Vector<SoftButton> softButtons, Integer correlationID) {
+ Vector<TTSChunk> chunks = TTSChunkFactory
+ .createSimpleTTSChunks(ttsText);
+ Alert msg = buildAlert(chunks, null, null, null, playTone, null, softButtons,
+ correlationID);
+ return msg;
+ }
+
+ public static Alert buildAlert(String alertText1, String alertText2,
+ String alertText3, Integer duration, Vector<SoftButton> softButtons,
+ Integer correlationID) {
+ Alert msg = buildAlert((Vector<TTSChunk>) null, alertText1, alertText2,
+ alertText3, null, duration, softButtons, correlationID);
+ return msg;
+ }
+
+ public static Alert buildAlert(String ttsText, String alertText1,
+ String alertText2, String alertText3, Boolean playTone,
+ Integer duration, Vector<SoftButton> softButtons, Integer correlationID) {
+ Vector<TTSChunk> chunks = TTSChunkFactory
+ .createSimpleTTSChunks(ttsText);
+ Alert msg = buildAlert(chunks, alertText1, alertText2, alertText3,
+ playTone, duration, softButtons, correlationID);
+ return msg;
+ }
+
+ public static Alert buildAlert(Vector<TTSChunk> chunks, Boolean playTone,
+ Vector<SoftButton> softButtons, Integer correlationID) {
+ Alert msg = buildAlert(chunks, null, null, null, playTone, null, softButtons, correlationID);
+ return msg;
+ }
+
+ public static Alert buildAlert(Vector<TTSChunk> ttsChunks,
+ String alertText1, String alertText2, String alertText3,
+ Boolean playTone, Integer duration, Vector<SoftButton> softButtons,
+ Integer correlationID) {
+ Alert msg = new Alert();
+ msg.setCorrelationID(correlationID);
+ msg.setAlertText1(alertText1);
+ msg.setAlertText2(alertText2);
+ msg.setAlertText3(alertText3);
+ msg.setDuration(duration);
+ msg.setPlayTone(playTone);
+ msg.setTtsChunks(ttsChunks);
+ msg.setSoftButtons(softButtons);
+
+ return msg;
+ }
+
+ public static Alert buildAlert(String ttsText, Boolean playTone,
+ Integer correlationID) {
+ Vector<TTSChunk> chunks = TTSChunkFactory
+ .createSimpleTTSChunks(ttsText);
+ Alert msg = buildAlert(chunks, null, null, playTone, null,
+ correlationID);
+ return msg;
+ }
+
+ public static Alert buildAlert(String alertText1, String alertText2,
+ Integer duration, Integer correlationID) {
+ Alert msg = buildAlert((Vector<TTSChunk>) null, alertText1, alertText2,
+ null, duration, correlationID);
+ return msg;
+ }
+
+ public static Alert buildAlert(String ttsText, String alertText1,
+ String alertText2, Boolean playTone, Integer duration,
+ Integer correlationID) {
+ Vector<TTSChunk> chunks = TTSChunkFactory
+ .createSimpleTTSChunks(ttsText);
+ Alert msg = buildAlert(chunks, alertText1, alertText2, playTone,
+ duration, correlationID);
+ return msg;
+ }
+
+ public static Alert buildAlert(Vector<TTSChunk> chunks, Boolean playTone,
+ Integer correlationID) {
+ Alert msg = buildAlert(chunks, null, null, playTone, null,
+ correlationID);
+ return msg;
+ }
+
+ public static Alert buildAlert(Vector<TTSChunk> ttsChunks,
+ String alertText1, String alertText2, Boolean playTone,
+ Integer duration, Integer correlationID) {
+ Alert msg = new Alert();
+ msg.setCorrelationID(correlationID);
+ msg.setAlertText1(alertText1);
+ msg.setAlertText2(alertText2);
+ msg.setDuration(duration);
+ msg.setPlayTone(playTone);
+ msg.setTtsChunks(ttsChunks);
+
+ return msg;
+ }
+
+ public static CreateInteractionChoiceSet buildCreateInteractionChoiceSet(
+ Vector<Choice> choiceSet, Integer interactionChoiceSetID,
+ Integer correlationID) {
+ CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet();
+ msg.setChoiceSet(choiceSet);
+ msg.setInteractionChoiceSetID(interactionChoiceSetID);
+ msg.setCorrelationID(correlationID);
+ return msg;
+ }
+
+ public static DeleteCommand buildDeleteCommand(Integer commandID,
+ Integer correlationID) {
+ DeleteCommand msg = new DeleteCommand();
+ msg.setCmdID(commandID);
+ msg.setCorrelationID(correlationID);
+ return msg;
+ }
+
+ public static DeleteFile buildDeleteFile(String sdlFileName,
+ Integer correlationID) {
+ DeleteFile deleteFile = new DeleteFile();
+ deleteFile.setCorrelationID(correlationID);
+ deleteFile.setSdlFileName(sdlFileName);
+ return deleteFile;
+ }
+
+ public static DeleteInteractionChoiceSet buildDeleteInteractionChoiceSet(
+ Integer interactionChoiceSetID, Integer correlationID) {
+ DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet();
+ msg.setInteractionChoiceSetID(interactionChoiceSetID);
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ public static DeleteSubMenu buildDeleteSubMenu(Integer menuID,
+ Integer correlationID) {
+ DeleteSubMenu msg = new DeleteSubMenu();
+ msg.setCorrelationID(correlationID);
+ msg.setMenuID(menuID);
+
+ return msg;
+ }
+
+ public static ListFiles buildListFiles(Integer correlationID) {
+ ListFiles listFiles = new ListFiles();
+ listFiles.setCorrelationID(correlationID);
+ return listFiles;
+ }
+
+ public static PerformInteraction buildPerformInteraction(
+ Vector<TTSChunk> initChunks, String displayText,
+ Vector<Integer> interactionChoiceSetIDList,
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ InteractionMode interactionMode, Integer timeout,
+ Vector<VrHelpItem> vrHelp, Integer correlationID) {
+ PerformInteraction msg = new PerformInteraction();
+ msg.setInitialPrompt(initChunks);
+ msg.setInitialText(displayText);
+ msg.setInteractionChoiceSetIDList(interactionChoiceSetIDList);
+ msg.setInteractionMode(interactionMode);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setTimeoutPrompt(timeoutChunks);
+ msg.setVrHelp(vrHelp);
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ public static PerformInteraction buildPerformInteraction(
+ String initPrompt, String displayText,
+ Vector<Integer> interactionChoiceSetIDList,
+ String helpPrompt, String timeoutPrompt,
+ InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) {
+ Vector<TTSChunk> initChunks = TTSChunkFactory
+ .createSimpleTTSChunks(initPrompt);
+ Vector<TTSChunk> helpChunks = TTSChunkFactory
+ .createSimpleTTSChunks(helpPrompt);
+ Vector<TTSChunk> timeoutChunks = TTSChunkFactory
+ .createSimpleTTSChunks(timeoutPrompt);
+ return buildPerformInteraction(initChunks,
+ displayText, interactionChoiceSetIDList, helpChunks,
+ timeoutChunks, interactionMode, timeout, vrHelp, correlationID);
+ }
+
+ public static PerformInteraction buildPerformInteraction(
+ String initPrompt, String displayText,
+ Integer interactionChoiceSetID,
+ String helpPrompt, String timeoutPrompt,
+ InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) {
+ Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
+ interactionChoiceSetIDs.add(interactionChoiceSetID);
+
+ return buildPerformInteraction(
+ initPrompt, displayText, interactionChoiceSetIDs,
+ helpPrompt, timeoutPrompt, interactionMode,
+ timeout, vrHelp, correlationID);
+ }
+
+ public static PerformInteraction buildPerformInteraction(String initPrompt,
+ String displayText, Integer interactionChoiceSetID, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) {
+
+ return buildPerformInteraction(initPrompt, displayText,
+ interactionChoiceSetID, null, null,
+ InteractionMode.BOTH, null, vrHelp, correlationID);
+ }
+
+ public static PerformInteraction buildPerformInteraction(
+ Vector<TTSChunk> initChunks, String displayText,
+ Vector<Integer> interactionChoiceSetIDList,
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ InteractionMode interactionMode, Integer timeout,
+ Integer correlationID) {
+ PerformInteraction msg = new PerformInteraction();
+ msg.setInitialPrompt(initChunks);
+ msg.setInitialText(displayText);
+ msg.setInteractionChoiceSetIDList(interactionChoiceSetIDList);
+ msg.setInteractionMode(interactionMode);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setTimeoutPrompt(timeoutChunks);
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ public static PerformInteraction buildPerformInteraction(
+ String initPrompt, String displayText,
+ Vector<Integer> interactionChoiceSetIDList,
+ String helpPrompt, String timeoutPrompt,
+ InteractionMode interactionMode, Integer timeout,
+ Integer correlationID) {
+ Vector<TTSChunk> initChunks = TTSChunkFactory
+ .createSimpleTTSChunks(initPrompt);
+ Vector<TTSChunk> helpChunks = TTSChunkFactory
+ .createSimpleTTSChunks(helpPrompt);
+ Vector<TTSChunk> timeoutChunks = TTSChunkFactory
+ .createSimpleTTSChunks(timeoutPrompt);
+ return buildPerformInteraction(initChunks,
+ displayText, interactionChoiceSetIDList, helpChunks,
+ timeoutChunks, interactionMode, timeout, correlationID);
+ }
+
+ public static PerformInteraction buildPerformInteraction(
+ String initPrompt, String displayText,
+ Integer interactionChoiceSetID,
+ String helpPrompt, String timeoutPrompt,
+ InteractionMode interactionMode, Integer timeout,
+ Integer correlationID) {
+ Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
+ interactionChoiceSetIDs.add(interactionChoiceSetID);
+
+ return buildPerformInteraction(
+ initPrompt, displayText, interactionChoiceSetIDs,
+ helpPrompt, timeoutPrompt, interactionMode,
+ timeout, correlationID);
+ }
+
+ public static PerformInteraction buildPerformInteraction(String initPrompt,
+ String displayText, Integer interactionChoiceSetID,
+ Integer correlationID) {
+
+ return buildPerformInteraction(initPrompt, displayText,
+ interactionChoiceSetID, null, null,
+ InteractionMode.BOTH, null, correlationID);
+ }
+
+ @Deprecated
+ public static PerformInteraction buildPerformInteraction(
+ Vector<TTSChunk> initChunks, String displayText,
+ Vector<Integer> interactionChoiceSetIDList,
+ Vector<TTSChunk> helpChunks, InteractionMode interactionMode,
+ Integer timeout, Integer correlationID) {
+ PerformInteraction msg = new PerformInteraction();
+ msg.setInitialPrompt(initChunks);
+ msg.setInitialText(displayText);
+ msg.setInteractionChoiceSetIDList(interactionChoiceSetIDList);
+ msg.setInteractionMode(interactionMode);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setCorrelationID(correlationID);
+ return msg;
+ }
+
+ @Deprecated
+ public static PerformInteraction buildPerformInteraction(String initPrompt,
+ String displayText, Vector<Integer> interactionChoiceSetIDList,
+ String helpPrompt, InteractionMode interactionMode,
+ Integer timeout, Integer correlationID) {
+ Vector<TTSChunk> initChunks = TTSChunkFactory
+ .createSimpleTTSChunks(initPrompt);
+ Vector<TTSChunk> helpChunks = TTSChunkFactory
+ .createSimpleTTSChunks(helpPrompt);
+ PerformInteraction msg = buildPerformInteraction(initChunks,
+ displayText, interactionChoiceSetIDList, helpChunks,
+ interactionMode, timeout, correlationID);
+ return msg;
+ }
+
+ public static PutFile buildPutFile(String sdlFileName, FileType fileType,
+ Boolean persistentFile, byte[] fileData, Integer correlationID) {
+ PutFile putFile = new PutFile();
+ putFile.setCorrelationID(correlationID);
+ putFile.setSdlFileName(sdlFileName);
+ putFile.setFileType(fileType);
+ putFile.setPersistentFile(persistentFile);
+ putFile.setBulkData(fileData);
+ putFile.setCRC(fileData);
+ return putFile;
+ }
+
+ @Deprecated
+ public static PutFile buildPutFile(String sdlFileName, Integer iOffset, Integer iLength) {
+ PutFile putFile = new PutFile();
+ putFile.setCorrelationID(10000);
+ putFile.setSdlFileName(sdlFileName);
+ putFile.setFileType(FileType.BINARY);
+ putFile.setSystemFile(true);
+ putFile.setOffset(iOffset);
+ putFile.setLength(iLength);
+ return putFile;
+ }
+
+ public static PutFile buildPutFile(String sdlFileName, Long iOffset, Long iLength) {
+ PutFile putFile = new PutFile();
+ putFile.setCorrelationID(10000);
+ putFile.setSdlFileName(sdlFileName);
+ putFile.setFileType(FileType.BINARY);
+ putFile.setSystemFile(true);
+ putFile.setOffset(iOffset);
+ putFile.setLength(iLength);
+ return putFile;
+ }
+
+ @Deprecated
+ public static PutFile buildPutFile(String syncFileName, Integer iOffset, Integer iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) {
+ PutFile putFile = new PutFile();
+ putFile.setCorrelationID(10000);
+ putFile.setSdlFileName(syncFileName);
+ putFile.setFileType(fileType);
+ putFile.setPersistentFile(bPersistentFile);
+ putFile.setSystemFile(bSystemFile);
+ putFile.setOffset(iOffset);
+ putFile.setLength(iLength);
+ return putFile;
+ }
+
+ public static PutFile buildPutFile(String syncFileName, Long iOffset, Long iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) {
+ PutFile putFile = new PutFile();
+ putFile.setCorrelationID(10000);
+ putFile.setSdlFileName(syncFileName);
+ putFile.setFileType(fileType);
+ putFile.setPersistentFile(bPersistentFile);
+ putFile.setSystemFile(bSystemFile);
+ putFile.setOffset(iOffset);
+ putFile.setLength(iLength);
+ return putFile;
+ }
+
+ @Deprecated
+ public static PutFile buildPutFile(String sdlFileName, Integer iOffset, Integer iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Integer iCorrelationID) {
+ PutFile putFile = new PutFile();
+ putFile.setCorrelationID(iCorrelationID);
+ putFile.setSdlFileName(sdlFileName);
+ putFile.setFileType(fileType);
+ putFile.setPersistentFile(bPersistentFile);
+ putFile.setSystemFile(bSystemFile);
+ putFile.setOffset(iOffset);
+ putFile.setLength(iLength);
+ return putFile;
+ }
+
+ public static PutFile buildPutFile(String sdlFileName, Long iOffset, Long iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Boolean isPayloadProtected, Integer iCorrelationID) {
+ PutFile putFile = new PutFile();
+ putFile.setCorrelationID(iCorrelationID);
+ putFile.setSdlFileName(sdlFileName);
+ putFile.setFileType(fileType);
+ putFile.setPersistentFile(bPersistentFile);
+ putFile.setSystemFile(bSystemFile);
+ putFile.setOffset(iOffset);
+ putFile.setLength(iLength);
+ putFile.setPayloadProtected(isPayloadProtected);
+ return putFile;
+ }
+
+ public static RegisterAppInterface buildRegisterAppInterface(String appName, String appID) {
+ return buildRegisterAppInterface(appName, false, appID);
+ }
+
+ public static RegisterAppInterface buildRegisterAppInterface(
+ String appName, Boolean isMediaApp, String appID) {
+
+ return buildRegisterAppInterface(null, appName, null, null, null, isMediaApp,
+ null, null, null, appID, null, null);
+ }
+
+ public static RegisterAppInterface buildRegisterAppInterface(
+ SdlMsgVersion sdlMsgVersion, String appName, Vector<TTSChunk> ttsName,
+ String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
+ String appID, Integer correlationID, DeviceInfo deviceInfo) {
+ RegisterAppInterface msg = new RegisterAppInterface();
+
+ if (correlationID == null) {
+ correlationID = 1;
+ }
+ msg.setCorrelationID(correlationID);
+
+ if (sdlMsgVersion == null) {
+ sdlMsgVersion = new SdlMsgVersion();
+ sdlMsgVersion.setMajorVersion(Integer.valueOf(SDL_MSG_MAJOR_VERSION));
+ sdlMsgVersion.setMinorVersion(Integer.valueOf(SDL_MSG_MINOR_VERSION));
+ }
+ msg.setSdlMsgVersion(sdlMsgVersion);
+ msg.setDeviceInfo(deviceInfo);
+ msg.setAppName(appName);
+
+ msg.setTtsName(ttsName);
+
+ if (ngnMediaScreenAppName == null) {
+ ngnMediaScreenAppName = appName;
+ }
+
+ msg.setNgnMediaScreenAppName(ngnMediaScreenAppName);
+
+ if (vrSynonyms == null) {
+ vrSynonyms = new Vector<String>();
+ vrSynonyms.add(appName);
+ }
+ msg.setVrSynonyms(vrSynonyms);
+
+ msg.setIsMediaApplication(isMediaApp);
+
+ if (languageDesired == null) {
+ languageDesired = Language.EN_US;
+ }
+ msg.setLanguageDesired(languageDesired);
+
+ if (hmiDisplayLanguageDesired == null) {
+ hmiDisplayLanguageDesired = Language.EN_US;
+ }
+
+ msg.setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
+
+ msg.setAppHMIType(appType);
+
+ msg.setAppID(appID);
+
+ return msg;
+ }
+
+ public static SetAppIcon buildSetAppIcon(String sdlFileName,
+ Integer correlationID) {
+ SetAppIcon setAppIcon = new SetAppIcon();
+ setAppIcon.setCorrelationID(correlationID);
+ setAppIcon.setSdlFileName(sdlFileName);
+ return setAppIcon;
+ }
+
+ public static SetGlobalProperties buildSetGlobalProperties(
+ String helpPrompt, String timeoutPrompt, Integer correlationID) {
+ return buildSetGlobalProperties(TTSChunkFactory
+ .createSimpleTTSChunks(helpPrompt), TTSChunkFactory
+ .createSimpleTTSChunks(timeoutPrompt), correlationID);
+ }
+
+ public static SetGlobalProperties buildSetGlobalProperties(
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ Integer correlationID) {
+ SetGlobalProperties req = new SetGlobalProperties();
+ req.setCorrelationID(correlationID);
+
+ req.setHelpPrompt(helpChunks);
+ req.setTimeoutPrompt(timeoutChunks);
+
+ return req;
+ }
+
+ public static SetGlobalProperties buildSetGlobalProperties(
+ String helpPrompt, String timeoutPrompt, String vrHelpTitle,
+ Vector<VrHelpItem> vrHelp, Integer correlationID) {
+ return buildSetGlobalProperties(TTSChunkFactory
+ .createSimpleTTSChunks(helpPrompt), TTSChunkFactory
+ .createSimpleTTSChunks(timeoutPrompt), vrHelpTitle, vrHelp, correlationID);
+ }
+
+ public static SetGlobalProperties buildSetGlobalProperties(
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ String vrHelpTitle, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) {
+ SetGlobalProperties req = new SetGlobalProperties();
+ req.setCorrelationID(correlationID);
+
+ req.setHelpPrompt(helpChunks);
+ req.setTimeoutPrompt(timeoutChunks);
+
+ req.setVrHelpTitle(vrHelpTitle);
+ req.setVrHelp(vrHelp);
+
+ return req;
+ }
+
+ public static SetMediaClockTimer buildSetMediaClockTimer(Integer hours,
+ Integer minutes, Integer seconds, UpdateMode updateMode,
+ Integer correlationID) {
+
+ SetMediaClockTimer msg = new SetMediaClockTimer();
+ if (hours != null || minutes != null || seconds != null) {
+ StartTime startTime = new StartTime();
+ msg.setStartTime(startTime);
+ startTime.setHours(hours);
+ startTime.setMinutes(minutes);
+ startTime.setSeconds(seconds);
+ }
+
+ msg.setUpdateMode(updateMode);
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ @Deprecated
+ public static SetMediaClockTimer buildSetMediaClockTimer(
+ UpdateMode updateMode, Integer correlationID) {
+ Integer hours = null;
+ Integer minutes = null;
+ Integer seconds = null;
+
+ SetMediaClockTimer msg = buildSetMediaClockTimer(hours, minutes,
+ seconds, updateMode, correlationID);
+ return msg;
+ }
+
+ @SuppressWarnings("deprecation")
+ public static Show buildShow(String mainText1, String mainText2,
+ String mainText3, String mainText4,
+ String statusBar, String mediaClock, String mediaTrack,
+ Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets,
+ TextAlignment alignment, Integer correlationID) {
+ Show msg = new Show();
+ msg.setCorrelationID(correlationID);
+ msg.setMainField1(mainText1);
+ msg.setMainField2(mainText2);
+ msg.setStatusBar(statusBar);
+ msg.setMediaClock(mediaClock);
+ msg.setMediaTrack(mediaTrack);
+ msg.setAlignment(alignment);
+ msg.setMainField3(mainText3);
+ msg.setMainField4(mainText4);
+ msg.setGraphic(graphic);
+ msg.setSoftButtons(softButtons);
+ msg.setCustomPresets(customPresets);
+
+ return msg;
+ }
+
+ public static Show buildShow(String mainText1, String mainText2, String mainText3, String mainText4,
+ TextAlignment alignment, Integer correlationID) {
+ Show msg = buildShow(mainText1, mainText2, mainText3, mainText4, null, null, null, null, null, null, alignment,
+ correlationID);
+ return msg;
+ }
+
+ @SuppressWarnings("deprecation")
+ public static Show buildShow(String mainText1, String mainText2,
+ String statusBar, String mediaClock, String mediaTrack,
+ TextAlignment alignment, Integer correlationID) {
+ Show msg = new Show();
+ msg.setCorrelationID(correlationID);
+ msg.setMainField1(mainText1);
+ msg.setMainField2(mainText2);
+ msg.setStatusBar(statusBar);
+ msg.setMediaClock(mediaClock);
+ msg.setMediaTrack(mediaTrack);
+ msg.setAlignment(alignment);
+
+ return msg;
+ }
+
+ public static Show buildShow(String mainText1, String mainText2,
+ TextAlignment alignment, Integer correlationID) {
+ Show msg = buildShow(mainText1, mainText2, null, null, null, alignment,
+ correlationID);
+ return msg;
+ }
+
+ public static Speak buildSpeak(String ttsText, Integer correlationID) {
+ Speak msg = buildSpeak(TTSChunkFactory.createSimpleTTSChunks(ttsText),
+ correlationID);
+ return msg;
+ }
+
+ public static Speak buildSpeak(Vector<TTSChunk> ttsChunks,
+ Integer correlationID) {
+
+ Speak msg = new Speak();
+ msg.setCorrelationID(correlationID);
+
+ msg.setTtsChunks(ttsChunks);
+
+ return msg;
+ }
+
+ public static SubscribeButton buildSubscribeButton(ButtonName buttonName,
+ Integer correlationID) {
+
+ SubscribeButton msg = new SubscribeButton();
+ msg.setCorrelationID(correlationID);
+ msg.setButtonName(buttonName);
+
+ return msg;
+ }
+
+ public static UnregisterAppInterface buildUnregisterAppInterface(
+ Integer correlationID) {
+ UnregisterAppInterface msg = new UnregisterAppInterface();
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ public static UnsubscribeButton buildUnsubscribeButton(
+ ButtonName buttonName, Integer correlationID) {
+
+ UnsubscribeButton msg = new UnsubscribeButton();
+ msg.setCorrelationID(correlationID);
+ msg.setButtonName(buttonName);
+
+ return msg;
+ }
+
+ @SuppressWarnings("deprecation")
+ public static SubscribeVehicleData BuildSubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
+ boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID)
+ {
+ SubscribeVehicleData msg = new SubscribeVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ @SuppressWarnings("deprecation")
+ public static UnsubscribeVehicleData BuildUnsubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
+ boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID)
+ {
+ UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ @SuppressWarnings("deprecation")
+ public static GetVehicleData BuildGetVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure,
+ boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID)
+ {
+ GetVehicleData msg = new GetVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setVin(vin);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ public static ScrollableMessage BuildScrollableMessage(String scrollableMessageBody, Integer timeout, Vector<SoftButton> softButtons, Integer correlationID)
+ {
+ ScrollableMessage msg = new ScrollableMessage();
+ msg.setCorrelationID(correlationID);
+ msg.setScrollableMessageBody(scrollableMessageBody);
+ msg.setTimeout(timeout);
+ msg.setSoftButtons(softButtons);
+
+ return msg;
+ }
+
+ public static Slider BuildSlider(Integer numTicks, Integer position, String sliderHeader, Vector<String> sliderFooter, Integer timeout, Integer correlationID)
+ {
+ Slider msg = new Slider();
+ msg.setCorrelationID(correlationID);
+ msg.setNumTicks(numTicks);
+ msg.setPosition(position);
+ msg.setSliderHeader(sliderHeader);
+ msg.setSliderFooter(sliderFooter);
+ msg.setTimeout(timeout);
+
+ return msg;
+ }
+
+ public static ChangeRegistration BuildChangeRegistration(Language language, Language hmiDisplayLanguage, Integer correlationID)
+ {
+ ChangeRegistration msg = new ChangeRegistration();
+ msg.setCorrelationID(correlationID);
+ msg.setLanguage(language);
+ msg.setHmiDisplayLanguage(hmiDisplayLanguage);
+
+ return msg;
+ }
+
+ public static SetDisplayLayout BuildSetDisplayLayout(String displayLayout, Integer correlationID)
+ {
+ SetDisplayLayout msg = new SetDisplayLayout();
+ msg.setCorrelationID(correlationID);
+ msg.setDisplayLayout(displayLayout);
+
+ return msg;
+ }
+
+ public static PerformAudioPassThru BuildPerformAudioPassThru(String ttsText, String audioPassThruDisplayText1, String audioPassThruDisplayText2,
+ SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample,
+ AudioType audioType, Boolean muteAudio, Integer correlationID)
+ {
+ Vector<TTSChunk> chunks = TTSChunkFactory
+ .createSimpleTTSChunks(ttsText);
+
+ PerformAudioPassThru msg = BuildPerformAudioPassThru(chunks, audioPassThruDisplayText1, audioPassThruDisplayText2,
+ samplingRate, maxDuration, bitsPerSample,audioType, muteAudio, correlationID);
+
+ return msg;
+ }
+
+ public static PerformAudioPassThru BuildPerformAudioPassThru(Vector<TTSChunk> initialPrompt, String audioPassThruDisplayText1, String audioPassThruDisplayText2,
+ SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample,
+ AudioType audioType, Boolean muteAudio, Integer correlationID)
+ {
+ PerformAudioPassThru msg = new PerformAudioPassThru();
+ msg.setCorrelationID(correlationID);
+ msg.setInitialPrompt(initialPrompt);
+ msg.setAudioPassThruDisplayText1(audioPassThruDisplayText1);
+ msg.setAudioPassThruDisplayText2(audioPassThruDisplayText2);
+ msg.setSamplingRate(samplingRate);
+ msg.setMaxDuration(maxDuration);
+ msg.setBitsPerSample(bitsPerSample);
+ msg.setAudioType(audioType);
+ msg.setMuteAudio(muteAudio);
+
+ return msg;
+ }
+
+ public static EndAudioPassThru BuildEndAudioPassThru(Integer correlationID)
+ {
+ EndAudioPassThru msg = new EndAudioPassThru();
+ msg.setCorrelationID(correlationID);
+
+ return msg;
+ }
+
+ public static DeviceInfo BuildDeviceInfo(String carrierName)
+ {
+ DeviceInfo msg = new DeviceInfo();
+ msg.setHardware(android.os.Build.MODEL);
+ msg.setOs(DeviceInfo.DEVICE_OS);
+ msg.setOsVersion(Build.VERSION.RELEASE);
+ msg.setCarrier(carrierName);
+ return msg;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java
new file mode 100644
index 000000000..1cf3cec4a
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import com.smartdevicelink.streaming.StreamRPCPacketizer;
+
+public class RPCStreamController {
+ private StreamRPCPacketizer rpcPacketizer;
+ private Integer iCorrelationID;
+
+ public RPCStreamController(StreamRPCPacketizer rpcPacketizer, Integer iCorrelationID)
+ {
+ this.rpcPacketizer = rpcPacketizer;
+ this.iCorrelationID = iCorrelationID;
+ }
+
+ public Integer getCorrelationID()
+ {
+ return iCorrelationID;
+ }
+
+ public void pause()
+ {
+ rpcPacketizer.pause();
+ }
+ public void resume()
+ {
+ rpcPacketizer.resume();
+ }
+ public void stop()
+ {
+ rpcPacketizer.onPutFileStreamError(null, "Stop Putfile Stream Requested");
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java
new file mode 100644
index 000000000..a48376751
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java
@@ -0,0 +1,2068 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import android.app.Service;
+import android.content.Context;
+
+import com.smartdevicelink.BuildConfig;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.proxy.interfaces.IProxyListenerALM;
+import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
+import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.HMICapabilities;
+import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
+import com.smartdevicelink.proxy.rpc.VehicleType;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
+import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
+import com.smartdevicelink.trace.SdlTrace;
+import com.smartdevicelink.transport.BTTransportConfig;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+
+import java.util.List;
+import java.util.Vector;
+
+import static com.smartdevicelink.proxy.SystemCapabilityManager.convertToList;
+
+
+public class SdlProxyALM extends SdlProxyBase<IProxyListenerALM> {
+
+ private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
+ @SuppressWarnings("unused")
+ private static final String SDL_LIB_PRIVATE_TOKEN = "{DAE1A88C-6C16-4768-ACA5-6F1247EA01C2}";
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL
+ *
+ * Takes advantage of the advanced lifecycle management.
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param isMediaApp - Indicates if the app is a media application.
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ /*ngn media app*/null,
+ /*vr synonyms*/null,
+ /*is media app*/isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*language desired*/languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ /*callbackToUIThread*/ false,
+ new BTTransportConfig());
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL
+ *
+ * Takes advantage of the advanced lifecycle management.
+ * @param context - Used to create a multiplexing transport config
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param isMediaApp - Indicates if the app is a media application.
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, Boolean isMediaApp,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ /*ngn media app*/null,
+ /*vr synonyms*/null,
+ /*is media app*/isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*language desired*/languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ /*callbackToUIThread*/ false,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, appName, and isMediaApp.", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp - Indicates if the app is a media application.
+ * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SDL interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
+ Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ String autoActivateID) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ /*callbackToUIThread*/ false,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, appName, ngnMediaScreenAppName, " +
+ "vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp - Indicates if the app is a media application.
+ * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SDL interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
+ Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ String autoActivateID) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ /*callbackToUIThread*/ false,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, appName, ngnMediaScreenAppName, " +
+ "vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp - Indicates if the app is a media application.
+ * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SDL interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms,
+ Boolean isMediaApp, SdlMsgVersion sdlMsgVersion, Language languageDesired,
+ Language hmiDisplayLanguageDesired, String appID, String autoActivateID) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ /*callbackToUIThread*/ false,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp - Indicates if the app is a media application.
+ * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SDL interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms,
+ Boolean isMediaApp, SdlMsgVersion sdlMsgVersion, Language languageDesired,
+ Language hmiDisplayLanguageDesired, String appID, String autoActivateID) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ /*callbackToUIThread*/ false,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp - Indicates if the app is a media application.
+ * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SDL interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
+ Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ String autoActivateID, boolean callbackToUIThread) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "and callbackToUIThread", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp - Indicates if the app is a media application.
+ * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SDL interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
+ Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ String autoActivateID, boolean callbackToUIThread) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "and callbackToUIThread", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp - Indicates if the app is a media application.
+ * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SDL interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID,
+ boolean callbackToUIThread) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "and callbackToUIThread", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener - Reference to the object in the App listening to callbacks from SDL.
+ * @param appName - Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp - Indicates if the app is a media application.
+ * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SDL interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID,
+ boolean callbackToUIThread) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "and callbackToUIThread", SDL_LIB_TRACE_KEY);
+ }
+
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+
+ public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+
+ /********************************************** TRANSPORT SWITCHING SUPPORT *****************************************/
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ /*ngn media app*/null,
+ /*vr synonyms*/null,
+ /*is media app*/isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*language desired*/languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ /*callbackToUIThread*/ false,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, appName, and isMediaApp.", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
+ Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ String autoActivateID, TransportType transportType, BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ /*callbackToUIThread*/ false,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, appName, ngnMediaScreenAppName, " +
+ "vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms,
+ Boolean isMediaApp, SdlMsgVersion sdlMsgVersion, Language languageDesired,
+ Language hmiDisplayLanguageDesired, String appID, String autoActivateID,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ /*callbackToUIThread*/ false,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands to
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
+ Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ String autoActivateID, boolean callbackToUIThread,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ /*sdl proxy configuration resources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "and callbackToUIThread", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID,
+ boolean callbackToUIThread, BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "and callbackToUIThread", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*TTS Name*/null,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appID Identifier of the client application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, boolean callbackToUIThread, boolean preRegister) throws SdlException
+ {
+ super( listener,
+ /*sdlProxyConfigurationResources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ languageDesired,
+ hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ callbackToUIThread,
+ preRegister,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, isMediaApp, languageDesired, hmiDisplayLanguageDesired" + "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appID Identifier of the client application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, Boolean isMediaApp,Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, boolean callbackToUIThread, boolean preRegister) throws SdlException
+ {
+ super( listener,
+ /*sdlProxyConfigurationResources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ languageDesired,
+ hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ callbackToUIThread,
+ preRegister,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, isMediaApp, languageDesired, hmiDisplayLanguageDesired" + "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param appID Identifier of the client application.
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID) throws SdlException {
+ super( listener,
+ /*sdlProxyConfigurationResources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*languageDesired*/null,
+ /*hmiDisplayLanguageDesired*/null,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ false,
+ false,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param appID Identifier of the client application.
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID) throws SdlException {
+ super( listener,
+ /*sdlProxyConfigurationResources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*languageDesired*/null,
+ /*hmiDisplayLanguageDesired*/null,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ false,
+ false,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param appID Identifier of the client application.
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources, String appName, Boolean isMediaApp,String appID) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*languageDesired*/null,
+ /*hmiDisplayLanguageDesired*/null,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ false,
+ false,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "sdlProxyConfigurationResources, appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param appID Identifier of the client application.
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources, String appName, Boolean isMediaApp,String appID) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*languageDesired*/null,
+ /*hmiDisplayLanguageDesired*/null,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ false,
+ false,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "sdlProxyConfigurationResources, appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
+ }
+
+ public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID,BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ /*sdlProxyConfigurationResources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*languageDesired*/null,
+ /*hmiDisplayLanguageDesired*/null,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ false,
+ false,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
+ }
+
+ public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp, String appID,
+ TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme, BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ /*sdlProxyConfigurationResources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*languageDesired*/null,
+ /*hmiDisplayLanguageDesired*/null,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ dayColorScheme,
+ nightColorScheme,
+ false,
+ false,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, isMediaApp, appID, dayColorScheme, nightColorScheme", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param appID Identifier of the client application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID,
+ boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ /*sdlProxyConfigurationResources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*languageDesired*/null,
+ /*hmiDisplayLanguageDesired*/null,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ callbackToUIThread,
+ preRegister,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, isMediaApp, " + "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param appName Name of the application displayed on SDL.
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param appID Identifier of the client application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID,
+ boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ /*sdlProxyConfigurationResources*/null,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ /*ttsName*/null,
+ /*ngnMediaScreenAppName*/null,
+ /*vrSynonyms*/null,
+ isMediaApp,
+ /*sdlMsgVersion*/null,
+ /*languageDesired*/null,
+ /*hmiDisplayLanguageDesired*/null,
+ /*App Type*/null,
+ /*App ID*/appID,
+ /*autoActivateID*/null,
+ callbackToUIThread,
+ preRegister,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
+ "appName, isMediaApp, " + "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ * @param appService Reference to the apps service object.
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ new MultiplexTransportConfig(appService.getBaseContext(),appID));
+
+ this.setAppService(appService);
+ this.sendTransportBroadcast();
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+
+
+ public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister, BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ transportConfig);
+
+ this.setAppService(appService);
+ this.sendTransportBroadcast();
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+
+
+
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+
+
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/null,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * @deprecated
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appType Type of application.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ @Deprecated
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ Vector<AppHMIType> appType, String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/appType,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ new BTTransportConfig());
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param context - Used to create a multiplexing transport config
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appType Type of application.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @throws SdlException
+ */
+ public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
+ Vector<AppHMIType> appType, String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/appType,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ new MultiplexTransportConfig(context,appID));
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appType Type of application.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/appType,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/appType,
+ /*App ID*/appID,
+ autoActivateID,
+ callbackToUIThread,
+ preRegister,
+ transportConfig);
+
+ this.setAppService(appService);
+ this.sendTransportBroadcast();
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ /**
+ * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param listener Reference to the object in the App listening to callbacks from SDL.
+ * @param sdlProxyConfigurationResources Proxy configuration resources.
+ * @param appName Name of the application displayed on SDL.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
+ * vehicles. Limited to five characters.
+ * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
+ * @param isMediaApp Indicates if the app is a media application.
+ * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
+ * or equal to the version of SDL SmartDeviceLink running on the vehicle.
+ * @param languageDesired Indicates the language desired for the SDL interface.
+ * @param hmiDisplayLanguageDesired Desired language in HMI.
+ * @param appType Type of application.
+ * @param appID Identifier of the client application.
+ * @param autoActivateID ID used to re-register previously registered application.
+ * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
+ * @param preRegister Flag that indicates that client should be pre-registred or not
+ * @param sHashID HashID used for app resumption
+ * @param transportConfig Initial configuration for transport.
+ * @throws SdlException
+ */
+ public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister, String sHashID,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/appType,
+ /*App ID*/appID,
+ autoActivateID,
+ null,
+ null,
+ callbackToUIThread,
+ preRegister,
+ /*sHashID*/sHashID,
+ true,
+ transportConfig);
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
+ String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister, String sHashID,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/appType,
+ /*App ID*/appID,
+ autoActivateID,
+ null,
+ null,
+ callbackToUIThread,
+ preRegister,
+ /*sHashID*/sHashID,
+ /*bEnableResume*/true,
+ transportConfig);
+
+ this.setAppService(appService);
+ this.sendTransportBroadcast();
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
+ String appID, String autoActivateID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme, boolean callbackToUIThread, boolean preRegister, String sHashID,
+ BaseTransportConfig transportConfig) throws SdlException {
+ super( listener,
+ sdlProxyConfigurationResources,
+ /*enable advanced lifecycle management*/true,
+ appName,
+ ttsName,
+ ngnMediaScreenAppName,
+ vrSynonyms,
+ isMediaApp,
+ sdlMsgVersion,
+ languageDesired,
+ /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
+ /*App Type*/appType,
+ /*App ID*/appID,
+ autoActivateID,
+ dayColorScheme,
+ nightColorScheme,
+ callbackToUIThread,
+ preRegister,
+ /*sHashID*/sHashID,
+ /*bEnableResume*/true,
+ transportConfig);
+
+ this.setAppService(appService);
+ this.sendTransportBroadcast();
+
+ SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
+ "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, dayColorScheme, nightColorScheme" +
+ "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
+ }
+ /***************************************** END OF TRANSPORT SWITCHING SUPPORT ***************************************/
+
+ // Allow applications using ALM to reset the proxy (dispose and reinstantiate)
+ /**
+ * Disconnects the application from SDL, then recreates the transport such that
+ * the next time a SDL unit discovers applications, this application will be
+ * available.
+ */
+ public void resetProxy() throws SdlException {
+ super.cycleProxy(SdlDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);
+ }
+
+ /********* Getters for values returned by RegisterAppInterfaceResponse **********/
+
+ /**
+ * Gets buttonCapabilities set when application interface is registered.
+ *
+ * @return buttonCapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public List<ButtonCapabilities> getButtonCapabilities() throws SdlException{
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
+ throw new SdlException("SDL is unavailable. Unable to get the buttonCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+
+ return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.BUTTON), ButtonCapabilities.class);
+ }
+
+ /**
+ * Gets getSoftButtonCapabilities set when application interface is registered.
+ *
+ * @return softButtonCapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public List<SoftButtonCapabilities> getSoftButtonCapabilities() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
+ throw new SdlException("SDL is not connected. Unable to get the softButtonCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON),SoftButtonCapabilities.class);
+ }
+
+ /**
+ * Gets getPresetBankCapabilities set when application interface is registered.
+ *
+ * @return presetBankCapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public PresetBankCapabilities getPresetBankCapabilities() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is not connected. Unable to get the presetBankCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return ( PresetBankCapabilities ) _systemCapabilityManager.getCapability(SystemCapabilityType.PRESET_BANK);
+ }
+
+ /**
+ * Gets the current version information of the proxy.
+ *
+ * @return String
+ * @throws SdlException
+ */
+ public String getProxyVersionInfo() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ if (BuildConfig.VERSION_NAME != null)
+ return BuildConfig.VERSION_NAME;
+
+ return null;
+ }
+
+
+
+ /**
+ * Gets displayCapabilities set when application interface is registered.
+ *
+ * @return displayCapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public DisplayCapabilities getDisplayCapabilities() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
+ throw new SdlException("SDL is unavailable. Unable to get the displayCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return ( DisplayCapabilities ) _systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY);
+ }
+
+ /**
+ * Gets hmiZoneCapabilities set when application interface is registered.
+ *
+ * @return hmiZoneCapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public List<HmiZoneCapabilities> getHmiZoneCapabilities() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
+ throw new SdlException("SDL is unavailable. Unable to get the hmiZoneCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.HMI_ZONE), HmiZoneCapabilities.class);
+ }
+
+ /**
+ * Gets speechCapabilities set when application interface is registered.
+ *
+ * @return speechCapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public List<SpeechCapabilities> getSpeechCapabilities() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
+ throw new SdlException("SDL is unavailable. Unable to get the speechCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+
+ return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.SPEECH), SpeechCapabilities.class);
+ }
+ /**
+ * Gets PrerecordedSpeech set when application interface is registered.
+ *
+ * @return PrerecordedSpeech
+ * @throws SdlException
+ */
+ public List<PrerecordedSpeech> getPrerecordedSpeech() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is unavailable. Unable to get the PrerecordedSpeech.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+
+ return _prerecordedSpeech;
+ }
+ /**
+ * Gets sdlLanguage set when application interface is registered.
+ *
+ * @return sdlLanguage
+ * @throws SdlException
+ */
+ public Language getSdlLanguage() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is unavailable. Unable to get the sdlLanguage.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return _sdlLanguage;
+ }
+
+ /**
+ * Gets getHmiDisplayLanguage set when application interface is registered.
+ *
+ * @return hmiDisplayLanguage
+ * @throws SdlException
+ */
+ public Language getHmiDisplayLanguage() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is not connected. Unable to get the hmiDisplayLanguage.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return _hmiDisplayLanguage;
+ }
+
+ /**
+ * Gets sdlMsgVersion set when application interface is registered.
+ *
+ * @return sdlMsgVersion
+ * @throws SdlException
+ */
+ public SdlMsgVersion getSdlMsgVersion() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is unavailable. Unable to get the sdlMsgVersion.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return _sdlMsgVersion;
+ }
+
+ /**
+ * Gets vrCapabilities set when application interface is registered.
+ *
+ * @return vrCapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public List<VrCapabilities> getVrCapabilities() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
+ throw new SdlException("SDL is unavailable. Unable to get the vrCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.VOICE_RECOGNITION), VrCapabilities.class);
+ }
+
+ /**
+ * Gets getVehicleType set when application interface is registered.
+ *
+ * @return vehicleType
+ * @throws SdlException
+ */
+ public VehicleType getVehicleType() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is not connected. Unable to get the vehicleType.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return _vehicleType;
+ }
+
+ /**
+ * Gets AudioPassThruCapabilities set when application interface is registered.
+ *
+ * @return AudioPassThruCapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public List<AudioPassThruCapabilities> getAudioPassThruCapabilities() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
+ throw new SdlException("SDL is not connected. Unable to get the vehicleType.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.AUDIO_PASSTHROUGH), AudioPassThruCapabilities.class);
+ }
+
+ public List<Integer> getSupportedDiagModes() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is not connected. Unable to get SupportedDiagModes.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return _diagModes;
+ }
+
+ /**
+ * Gets HMICapabilities when application interface is registered.
+ *
+ * @return HMICapabilities
+ * @throws SdlException
+ * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
+ */
+ @Deprecated
+ public HMICapabilities getHmiCapabilities() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
+ throw new SdlException("SDL is not connected. Unable to get the HMICapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return ( HMICapabilities ) _systemCapabilityManager.getCapability(SystemCapabilityType.HMI);
+ }
+
+
+ public String getSystemSoftwareVersion() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is not connected. Unable to get the SystemSoftwareVersion.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return _systemSoftwareVersion;
+ }
+
+ public boolean isAppResumeSuccess() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is not connected. Unable to get isResumeSuccess.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return _bResumeSuccess;
+ }
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
new file mode 100644
index 000000000..1cabf9b89
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
@@ -0,0 +1,8204 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import android.annotation.TargetApi;
+import android.app.Service;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.os.Build;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.SystemClock;
+import android.support.annotation.NonNull;
+import android.telephony.TelephonyManager;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.util.SparseArray;
+import android.util.SparseIntArray;
+import android.view.Display;
+import android.view.InputDevice;
+import android.view.MotionEvent;
+import android.view.Surface;
+
+import com.smartdevicelink.BuildConfig;
+import com.smartdevicelink.Dispatcher.IDispatchingStrategy;
+import com.smartdevicelink.Dispatcher.ProxyMessageDispatcher;
+import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
+import com.smartdevicelink.SdlConnection.SdlConnection;
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.SdlConnection.SdlSession2;
+import com.smartdevicelink.encoder.VirtualDisplayEncoder;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.haptic.HapticInterfaceManager;
+import com.smartdevicelink.managers.lifecycle.RpcConverter;
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.protocol.heartbeat.HeartbeatMonitor;
+import com.smartdevicelink.proxy.LockScreenManager.OnLockScreenIconDownloadedListener;
+import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
+import com.smartdevicelink.proxy.callbacks.OnError;
+import com.smartdevicelink.proxy.callbacks.OnProxyClosed;
+import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
+import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
+import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
+import com.smartdevicelink.proxy.interfaces.IProxyListenerBase;
+import com.smartdevicelink.proxy.interfaces.IPutFileResponseListener;
+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.*;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+import com.smartdevicelink.proxy.rpc.enums.SdlConnectionState;
+import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
+import com.smartdevicelink.proxy.rpc.enums.SdlInterfaceAvailability;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+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.OnRPCRequestListener;
+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.video.SdlRemoteDisplay;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.trace.SdlTrace;
+import com.smartdevicelink.trace.TraceDeviceInfo;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+import com.smartdevicelink.transport.SiphonServer;
+import com.smartdevicelink.transport.USBTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.CorrelationIdGenerator;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.FileUtls;
+import com.smartdevicelink.util.Version;
+
+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.ArrayList;
+import java.util.Collections;
+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> {
+ // Used for calls to Android Log class.
+ public static final String TAG = "SdlProxy";
+ private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
+ private static final int PROX_PROT_VER_ONE = 1;
+ private static final int RESPONSE_WAIT_TIME = 2000;
+
+ public static final com.smartdevicelink.util.Version MAX_SUPPORTED_RPC_VERSION = new com.smartdevicelink.util.Version("5.1.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
+ private final int REGISTER_APP_INTERFACE_CORRELATION_ID = 65529,
+ UNREGISTER_APP_INTERFACE_CORRELATION_ID = 65530,
+ POLICIES_CORRELATION_ID = 65535;
+
+ // Sdl Synchronization Objects
+ private static final Object CONNECTION_REFERENCE_LOCK = new Object(),
+ INCOMING_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
+ OUTGOING_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
+ INTERNAL_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
+ ON_UPDATE_LISTENER_LOCK = new Object(),
+ RPC_LISTENER_LOCK = new Object(),
+ ON_NOTIFICATION_LISTENER_LOCK = new Object();
+
+ private final Object APP_INTERFACE_REGISTERED_LOCK = new Object();
+
+ private int iFileCount = 0;
+
+ private boolean navServiceStartResponseReceived = false;
+ private boolean navServiceStartResponse = false;
+ private List<String> navServiceStartRejectedParams = null;
+ private boolean pcmServiceStartResponseReceived = false;
+ private boolean pcmServiceStartResponse = false;
+ @SuppressWarnings("FieldCanBeLocal")
+ private List<String> pcmServiceStartRejectedParams = null;
+ private boolean navServiceEndResponseReceived = false;
+ private boolean navServiceEndResponse = false;
+ private boolean pcmServiceEndResponseReceived = false;
+ private boolean pcmServiceEndResponse = false;
+ private boolean rpcProtectedResponseReceived = false;
+ private boolean rpcProtectedStartResponse = false;
+
+ // Device Info for logging
+ private TraceDeviceInfo _traceDeviceInterrogator = null;
+
+ // Declare Queuing Threads
+ private ProxyMessageDispatcher<ProtocolMessage> _incomingProxyMessageDispatcher;
+ private ProxyMessageDispatcher<ProtocolMessage> _outgoingProxyMessageDispatcher;
+ private ProxyMessageDispatcher<InternalProxyMessage> _internalProxyMessageDispatcher;
+
+ // Flag indicating if callbacks should be called from UIThread
+ private Boolean _callbackToUIThread = false;
+ // UI Handler
+ private Handler _mainUIHandler = null;
+ final int HEARTBEAT_CORRELATION_ID = 65531;
+
+ // SdlProxy Advanced Lifecycle Management
+ protected Boolean _advancedLifecycleManagementEnabled = false;
+ // Parameters passed to the constructor from the app to register an app interface
+ private String _applicationName = null;
+ private final long instanceDateTime = System.currentTimeMillis();
+ private String sConnectionDetails = "N/A";
+ private Vector<TTSChunk> _ttsName = null;
+ private String _ngnMediaScreenAppName = null;
+ private Boolean _isMediaApp = null;
+ private Language _sdlLanguageDesired = null;
+ private Language _hmiDisplayLanguageDesired = null;
+ private Vector<AppHMIType> _appType = null;
+ private String _appID = null;
+ private TemplateColorScheme _dayColorScheme = null;
+ private TemplateColorScheme _nightColorScheme = null;
+ @SuppressWarnings({"FieldCanBeLocal", "unused"}) //Need to understand what this is used for
+ private String _autoActivateIdDesired = null;
+ private String _lastHashID = null;
+ private SdlMsgVersion _sdlMsgVersionRequest = null;
+ private Vector<String> _vrSynonyms = null;
+ private boolean _bAppResumeEnabled = false;
+ private OnSystemRequest lockScreenIconRequest = null;
+ private TelephonyManager telephonyManager = null;
+ private DeviceInfo deviceInfo = null;
+
+ /**
+ * Contains current configuration for the transport that was selected during
+ * construction of this object
+ */
+ private BaseTransportConfig _transportConfig = null;
+ // Proxy State Variables
+ protected Boolean _appInterfaceRegisterd = false;
+ protected Boolean _preRegisterd = false;
+ @SuppressWarnings({"unused", "FieldCanBeLocal"})
+ private Boolean _haveReceivedFirstNonNoneHMILevel = false;
+ protected Boolean _haveReceivedFirstFocusLevel = false;
+ protected Boolean _haveReceivedFirstFocusLevelFull = false;
+ protected Boolean _proxyDisposed = false;
+ protected SdlConnectionState _sdlConnectionState = null;
+ protected SdlInterfaceAvailability _sdlIntefaceAvailablity = null;
+ protected HMILevel _hmiLevel = null;
+ protected OnHMIStatus lastHmiStatus;
+ protected AudioStreamingState _audioStreamingState = null;
+ // Variables set by RegisterAppInterfaceResponse
+ protected SdlMsgVersion _sdlMsgVersion = null;
+ protected String _autoActivateIdReturned = null;
+ protected Language _sdlLanguage = null;
+ protected Language _hmiDisplayLanguage = null;
+ protected List<PrerecordedSpeech> _prerecordedSpeech = null;
+ protected VehicleType _vehicleType = null;
+ protected String _systemSoftwareVersion = null;
+ protected List<Integer> _diagModes = null;
+ protected Boolean firstTimeFull = true;
+ protected String _proxyVersionInfo = null;
+ protected Boolean _bResumeSuccess = false;
+ protected List<Class<? extends SdlSecurityBase>> _secList = null;
+ protected SystemCapabilityManager _systemCapabilityManager;
+ protected Boolean _iconResumed = false;
+ protected RegisterAppInterfaceResponse raiResponse = null;
+
+ private final CopyOnWriteArrayList<IPutFileResponseListener> _putFileListenerList = new CopyOnWriteArrayList<IPutFileResponseListener>();
+
+ protected com.smartdevicelink.util.Version protocolVersion = new com.smartdevicelink.util.Version(1,0,0);
+ protected com.smartdevicelink.util.Version rpcSpecVersion;
+
+ protected SparseArray<OnRPCResponseListener> rpcResponseListeners = null;
+ protected SparseArray<CopyOnWriteArrayList<OnRPCNotificationListener>> rpcNotificationListeners = null;
+ protected SparseArray<CopyOnWriteArrayList<OnRPCRequestListener>> rpcRequestListeners = null;
+ protected SparseArray<CopyOnWriteArrayList<OnRPCListener>> rpcListeners = null;
+
+ protected VideoStreamingManager manager; //Will move to SdlSession once the class becomes public
+
+ protected String authToken;
+
+ private Version minimumProtocolVersion;
+ private Version minimumRPCVersion;
+
+
+ // Interface broker
+ private SdlInterfaceBroker _interfaceBroker = null;
+ //We create an easily passable anonymous class of the interface so that we don't expose the internal interface to developers
+ private ISdl _internalInterface = new ISdl() {
+ @Override
+ public void start() {
+ try{
+ initializeProxy();
+ }catch (SdlException e){
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void stop() {
+ try{
+ dispose();
+ }catch (SdlException e){
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public boolean isConnected() {
+ return getIsConnected();
+ }
+
+ @Override
+ public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
+ SdlProxyBase.this.addServiceListener(serviceType,sdlServiceListener);
+ }
+
+ @Override
+ public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
+ SdlProxyBase.this.removeServiceListener(serviceType,sdlServiceListener);
+ }
+
+ @Override
+ public void startVideoService(VideoStreamingParameters parameters, boolean encrypted) {
+ if(isConnected()){
+ sdlSession.setDesiredVideoParams(parameters);
+ sdlSession.startService(SessionType.NAV,sdlSession.getSessionId(),encrypted);
+ }
+ }
+
+ @Override
+ public void stopVideoService() {
+ if(isConnected()){
+ sdlSession.endService(SessionType.NAV,sdlSession.getSessionId());
+ }
+ }
+
+ @Override public void stopAudioService() {
+ if(isConnected()){
+ sdlSession.endService(SessionType.PCM,sdlSession.getSessionId());
+ }
+ }
+
+ @Override
+ public void sendRPCRequest(RPCRequest message){
+ try {
+ SdlProxyBase.this.sendRPCRequest(message);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void sendRPC(RPCMessage message) {
+ try {
+ SdlProxyBase.this.sendRPC(message);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void sendRequests(List<? extends RPCRequest> rpcs, OnMultipleRequestListener listener) {
+ try {
+ SdlProxyBase.this.sendRequests(rpcs, listener);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void sendSequentialRPCs(List<? extends RPCMessage> rpcs, OnMultipleRequestListener listener) {
+ try{
+ SdlProxyBase.this.sendSequentialRequests(rpcs,listener);
+ }catch (SdlException e ){
+ DebugTool.logError("Issue sending sequential RPCs ", e);
+ }
+ }
+
+ @Override
+ public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
+ SdlProxyBase.this.addOnRPCNotificationListener(notificationId,listener);
+ }
+
+ @Override
+ public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
+ return SdlProxyBase.this.removeOnRPCNotificationListener(notificationId,listener);
+ }
+
+ @Override
+ public void addOnRPCRequestListener(FunctionID functionID, OnRPCRequestListener listener) {
+ SdlProxyBase.this.addOnRPCRequestListener(functionID,listener);
+ }
+
+ @Override
+ public boolean removeOnRPCRequestListener(FunctionID functionID, OnRPCRequestListener listener) {
+ return SdlProxyBase.this.removeOnRPCRequestListener(functionID,listener);
+ }
+
+ @Override
+ public void addOnRPCListener(FunctionID responseId, OnRPCListener listener) {
+ SdlProxyBase.this.addOnRPCListener(responseId, listener);
+ }
+
+ @Override
+ public boolean removeOnRPCListener(FunctionID responseId, OnRPCListener listener) {
+ return SdlProxyBase.this.removeOnRPCListener(responseId, listener);
+ }
+
+ @Override
+ public Object getCapability(SystemCapabilityType systemCapabilityType){
+ return SdlProxyBase.this.getCapability(systemCapabilityType);
+ }
+
+ @Override
+ public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) {
+ SdlProxyBase.this.getCapability(systemCapabilityType, scListener);
+ }
+
+ @Override
+ public SdlMsgVersion getSdlMsgVersion(){
+ try {
+ return SdlProxyBase.this.getSdlMsgVersion();
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public com.smartdevicelink.util.Version getProtocolVersion() {
+ return SdlProxyBase.this.protocolVersion;
+ }
+
+ @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 boolean isTransportForServiceAvailable(SessionType serviceType) {
+ return SdlProxyBase.this.sdlSession != null
+ && SdlProxyBase.this.sdlSession.isTransportForServiceAvailable(serviceType);
+ }
+
+ @Override
+ public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
+ AudioStreamingParams params) {
+ if(getIsConnected()){
+ SdlProxyBase.this.startAudioStream(isEncrypted, codec, params);
+ }
+ }
+
+ @Override
+ public void startAudioService(boolean encrypted) {
+ if(isConnected()){
+ sdlSession.startService(SessionType.PCM,sdlSession.getSessionId(),encrypted);
+ }
+ }
+
+ @Override
+ public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters){
+ return SdlProxyBase.this.startVideoStream(isEncrypted, parameters);
+ }
+
+ @Override
+ public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
+ AudioStreamingParams params) {
+ return SdlProxyBase.this.startAudioStream(isEncrypted, codec, params);
+ }
+ };
+
+ private void notifyPutFileStreamError(Exception e, String info)
+ {
+ for (IPutFileResponseListener _putFileListener : _putFileListenerList) {
+ _putFileListener.onPutFileStreamError(e, info);
+ }
+ }
+
+ private void notifyPutFileStreamResponse(PutFileResponse msg)
+ {
+ for (IPutFileResponseListener _putFileListener : _putFileListenerList) {
+ _putFileListener.onPutFileResponse(msg);
+ }
+ }
+
+ public void addPutFileResponseListener(IPutFileResponseListener _putFileListener)
+ {
+ _putFileListenerList.addIfAbsent(_putFileListener);
+ }
+
+ public void remPutFileResponseListener(IPutFileResponseListener _putFileListener)
+ {
+ _putFileListenerList.remove(_putFileListener);
+ }
+
+ // Private Class to Interface with SdlConnection
+ private class SdlInterfaceBroker implements ISdlConnectionListener {
+
+ @Override
+ public void onTransportDisconnected(String info) {
+ // proxyOnTransportDisconnect is called to alert the proxy that a requested
+ // disconnect has completed
+ notifyPutFileStreamError(null, info);
+
+ //if (!_advancedLifecycleManagementEnabled) {
+ // If original model, notify app the proxy is closed so it will delete and reinstanciate
+ Log.d(TAG, "notifying proxy of closed");
+ notifyProxyClosed(info, new SdlException("Transport disconnected.", SdlExceptionCause.SDL_UNAVAILABLE), SdlDisconnectedReason.TRANSPORT_DISCONNECT);
+ //}// else If ALM, nothing is required to be done here
+
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) {
+ notifyPutFileStreamError(null, info);
+
+ if( altTransportAvailable){
+ SdlProxyBase.this._transportConfig = transportConfig;
+ Log.d(TAG, "notifying RPC session ended, but potential primary transport available");
+ cycleProxy(SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST);
+
+ }else{
+ notifyProxyClosed(info, new SdlException("Transport disconnected.", SdlExceptionCause.SDL_UNAVAILABLE), SdlDisconnectedReason.TRANSPORT_DISCONNECT);
+ }
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+ DebugTool.logError("Transport failure: " + info, e);
+
+ notifyPutFileStreamError(e, info);
+
+ if (_advancedLifecycleManagementEnabled) {
+ // Cycle the proxy
+ if(SdlConnection.isLegacyModeEnabled()){ //FIXME
+ cycleProxy(SdlDisconnectedReason.LEGACY_BLUETOOTH_MODE_ENABLED);
+
+ }else{
+ cycleProxy(SdlDisconnectedReason.TRANSPORT_ERROR);
+ }
+ } else {
+ notifyProxyClosed(info, e, SdlDisconnectedReason.TRANSPORT_ERROR);
+ }
+ }
+
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+
+ // AudioPathThrough is coming WITH BulkData but WITHOUT JSON Data
+ // Policy Snapshot is coming WITH BulkData and WITH JSON Data
+ if ((msg.getData() != null && msg.getData().length > 0) ||
+ (msg.getBulkData() != null && msg.getBulkData().length > 0)) {
+ queueIncomingMessage(msg);
+ }
+ }
+
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStarted");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
+ updateBroadcastIntent(sendIntent, "COMMENT2", " ServiceType: " + sessionType.getName());
+ updateBroadcastIntent(sendIntent, "COMMENT3", " Encrypted: " + isEncrypted);
+ sendBroadcastIntent(sendIntent);
+
+ if(sdlSession!= null){
+ setProtocolVersion(sdlSession.getProtocolVersion());
+ }else{
+ setProtocolVersion(new com.smartdevicelink.util.Version(version,0,0));
+ }
+
+
+ if (minimumProtocolVersion != null && minimumProtocolVersion.isNewerThan(getProtocolVersion()) == 1){
+ Log.w(TAG, String.format("Disconnecting from head unit, the configured minimum protocol version %s is greater than the supported protocol version %s", minimumProtocolVersion, getProtocolVersion()));
+ endService(sessionType);
+ try {
+ cleanProxy(SdlDisconnectedReason.MINIMUM_PROTOCOL_VERSION_HIGHER_THAN_SUPPORTED);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ return;
+ }
+
+
+ if (sessionType.eq(SessionType.RPC)) {
+
+ if (!isEncrypted)
+ {
+ if ( (_transportConfig.getHeartBeatTimeout() != Integer.MAX_VALUE) && (version > 2))
+ {
+ HeartbeatMonitor outgoingHeartbeatMonitor = new HeartbeatMonitor();
+ outgoingHeartbeatMonitor.setInterval(_transportConfig.getHeartBeatTimeout());
+ sdlSession.setOutgoingHeartbeatMonitor(outgoingHeartbeatMonitor);
+
+ HeartbeatMonitor incomingHeartbeatMonitor = new HeartbeatMonitor();
+ incomingHeartbeatMonitor.setInterval(_transportConfig.getHeartBeatTimeout());
+ sdlSession.setIncomingHeartbeatMonitor(incomingHeartbeatMonitor);
+ }
+
+ startRPCProtocolSession();
+ }
+ else
+ {
+ RPCProtectedServiceStarted();
+ }
+ } else if (sessionType.eq(SessionType.NAV)) {
+ NavServiceStarted();
+ } else if (sessionType.eq(SessionType.PCM)) {
+ AudioServiceStarted();
+ } else if (sessionType.eq(SessionType.RPC)){
+ cycleProxy(SdlDisconnectedReason.RPC_SESSION_ENDED);
+ }
+ else if (protocolVersion!= null && protocolVersion.getMajor() > 1) {
+ //If version is 2 or above then don't need to specify a Session Type
+ startRPCProtocolSession();
+ } //else{} Handle other protocol session types here
+
+ }
+
+ @Override
+ public void onProtocolSessionStartedNACKed(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+ OnServiceNACKed message = new OnServiceNACKed(sessionType);
+ queueInternalMessage(message);
+
+ if (sessionType.eq(SessionType.NAV)) {
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStartedNACKed");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
+ updateBroadcastIntent(sendIntent, "COMMENT2", " NACK ServiceType: " + sessionType.getName());
+ sendBroadcastIntent(sendIntent);
+
+ NavServiceStartedNACK(rejectedParams);
+ }
+ else if (sessionType.eq(SessionType.PCM)) {
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStartedNACKed");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
+ updateBroadcastIntent(sendIntent, "COMMENT2", " NACK ServiceType: " + sessionType.getName());
+ sendBroadcastIntent(sendIntent);
+
+ AudioServiceStartedNACK(rejectedParams);
+ }
+ }
+
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType,
+ byte sessionID, String correlationID) {
+ OnServiceEnded message = new OnServiceEnded(sessionType);
+ queueInternalMessage(message);
+
+ if (sessionType.eq(SessionType.NAV)) {
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEnded");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
+ updateBroadcastIntent(sendIntent, "COMMENT2", " End ServiceType: " + sessionType.getName());
+ sendBroadcastIntent(sendIntent);
+
+ NavServiceEnded();
+ }
+ else if (sessionType.eq(SessionType.PCM)) {
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEnded");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
+ updateBroadcastIntent(sendIntent, "COMMENT2", " End ServiceType: " + sessionType.getName());
+ sendBroadcastIntent(sendIntent);
+
+ AudioServiceEnded();
+ }
+ }
+
+ @Override
+ public void onProtocolError(String info, Exception e) {
+ notifyPutFileStreamError(e, info);
+ passErrorToProxyListener(info, e);
+ }
+
+ @Override
+ public void onHeartbeatTimedOut(byte sessionID) {
+ final String msg = "Heartbeat timeout";
+ DebugTool.logInfo(msg);
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onHeartbeatTimedOut");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "Heartbeat timeout for SessionID: " + sessionID);
+ sendBroadcastIntent(sendIntent);
+
+ notifyProxyClosed(msg, new SdlException(msg, SdlExceptionCause.HEARTBEAT_PAST_DUE), SdlDisconnectedReason.HB_TIMEOUT);
+
+ }
+
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,
+ byte sessionID, String correlationID) {
+ if (sessionType.eq(SessionType.NAV)) {
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEndedNACKed");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
+ updateBroadcastIntent(sendIntent, "COMMENT2", " End NACK ServiceType: " + sessionType.getName());
+ sendBroadcastIntent(sendIntent);
+
+ NavServiceEndedNACK();
+ }
+ else if (sessionType.eq(SessionType.PCM)) {
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEndedNACKed");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
+ updateBroadcastIntent(sendIntent, "COMMENT2", " End NACK ServiceType: " + sessionType.getName());
+ sendBroadcastIntent(sendIntent);
+
+ AudioServiceEndedNACK();
+ }
+
+ }
+
+ public void onProtocolServiceDataACK(SessionType sessionType, final int dataSize,
+ byte sessionID) {
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onServiceDataACK(dataSize);
+ }
+ });
+ } else {
+ _proxyListener.onServiceDataACK(dataSize);
+ }
+ }
+
+ @Override
+ public void onAuthTokenReceived(String authToken, byte sessionID) {
+ SdlProxyBase.this.authToken = authToken;
+ }
+ }
+
+ /**
+ * 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.
+ * @param languageDesired Desired language.
+ * @param hmiDisplayLanguageDesired Desired language for HMI.
+ * @param appType Type of application.
+ * @param appID Application identifier.
+ * @param dayColorScheme TemplateColorScheme for the day
+ * @param nightColorScheme TemplateColorScheme for the night
+ * @param transportConfig Configuration of transport to be used by underlying connection.
+ * @param vrSynonyms List of synonyms.
+ * @param ttsName TTS name.
+ * @throws SdlException
+ */
+ 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;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param listener Type of listener for this proxy base.
+ * @param sdlProxyConfigurationResources Configuration resources for this proxy.
+ * @param enableAdvancedLifecycleManagement Flag that ALM should be enabled or not.
+ * @param appName Client application name.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Media Screen Application name.
+ * @param vrSynonyms List of synonyms.
+ * @param isMediaApp Flag that indicates that client application if media application or not.
+ * @param sdlMsgVersion Version of Sdl Message.
+ * @param languageDesired Desired language.
+ * @param hmiDisplayLanguageDesired Desired language for HMI.
+ * @param appType Type of application.
+ * @param appID Application identifier.
+ * @param autoActivateID Auto activation identifier.
+ * @param callbackToUIThread Flag that indicates that this proxy should send callback to UI thread or not.
+ * @param transportConfig Configuration of transport to be used by underlying connection.
+ * @throws SdlException if there is an unrecoverable error class might throw an exception.
+ */
+ protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
+ String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
+ String autoActivateID, boolean callbackToUIThread, BaseTransportConfig transportConfig)
+ throws SdlException {
+
+ performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
+ sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, null, null, callbackToUIThread, null, null, null, transportConfig);
+ }
+
+ @SuppressWarnings("ConstantConditions")
+ private void performBaseCommon(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
+ String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
+ String autoActivateID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme,
+ boolean callbackToUIThread, Boolean preRegister, String sHashID, Boolean bAppResumeEnab,
+ BaseTransportConfig transportConfig) throws SdlException
+ {
+ Log.i(TAG, "SDL_LIB_VERSION: " + BuildConfig.VERSION_NAME);
+ setProtocolVersion(new Version(PROX_PROT_VER_ONE,0,0));
+
+ if (preRegister != null && preRegister)
+ {
+ _appInterfaceRegisterd = preRegister;
+ _preRegisterd = preRegister;
+ }
+
+ if (bAppResumeEnab != null && bAppResumeEnab)
+ {
+ _bAppResumeEnabled = true;
+ _lastHashID = sHashID;
+ }
+ _interfaceBroker = new SdlInterfaceBroker();
+
+ _callbackToUIThread = callbackToUIThread;
+
+ if (_callbackToUIThread) {
+ _mainUIHandler = new Handler(Looper.getMainLooper());
+ }
+
+ // Set variables for Advanced Lifecycle Management
+ _advancedLifecycleManagementEnabled = enableAdvancedLifecycleManagement;
+ _applicationName = appName;
+ _ttsName = ttsName;
+ _ngnMediaScreenAppName = ngnMediaScreenAppName;
+ _isMediaApp = isMediaApp;
+ _sdlMsgVersionRequest = sdlMsgVersion;
+ _vrSynonyms = vrSynonyms;
+ _sdlLanguageDesired = languageDesired;
+ _hmiDisplayLanguageDesired = hmiDisplayLanguageDesired;
+ _appType = appType;
+ _appID = appID;
+ _autoActivateIdDesired = autoActivateID;
+ _dayColorScheme = dayColorScheme;
+ _nightColorScheme = nightColorScheme;
+ _transportConfig = transportConfig;
+
+ // Test conditions to invalidate the proxy
+ if (listener == null) {
+ throw new IllegalArgumentException("IProxyListener listener must be provided to instantiate SdlProxy object.");
+ }
+ if (_advancedLifecycleManagementEnabled) {
+ /* if (_applicationName == null ) {
+ throw new IllegalArgumentException("To use SdlProxyALM, an application name, appName, must be provided");
+ }
+ if (_applicationName.length() < 1 || _applicationName.length() > 100) {
+ throw new IllegalArgumentException("A provided application name, appName, must be between 1 and 100 characters in length.");
+ }*/
+ if (_isMediaApp == null) {
+ throw new IllegalArgumentException("isMediaApp must not be null when using SdlProxyALM.");
+ }
+ }
+
+ _proxyListener = listener;
+
+ // Get information from sdlProxyConfigurationResources
+ if (sdlProxyConfigurationResources != null) {
+ telephonyManager = sdlProxyConfigurationResources.getTelephonyManager();
+ }
+
+ // Use the telephonyManager to get and log phone info
+ if (telephonyManager != null) {
+ // Following is not quite thread-safe (because m_traceLogger could test null twice),
+ // so we need to fix this, but vulnerability (i.e. two instances of listener) is
+ // likely harmless.
+ if (_traceDeviceInterrogator == null) {
+ _traceDeviceInterrogator = new TraceDeviceInfo(telephonyManager);
+ } // end-if
+
+ } // end-if
+
+ // Setup Internal ProxyMessage Dispatcher
+ synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
+ // Ensure internalProxyMessageDispatcher is null
+ if (_internalProxyMessageDispatcher != null) {
+ _internalProxyMessageDispatcher.dispose();
+ _internalProxyMessageDispatcher = null;
+ }
+
+ _internalProxyMessageDispatcher = new ProxyMessageDispatcher<InternalProxyMessage>("INTERNAL_MESSAGE_DISPATCHER", new IDispatchingStrategy<InternalProxyMessage>() {
+
+ @Override
+ public void dispatch(InternalProxyMessage message) {
+ dispatchInternalMessage(message);
+ }
+
+ @Override
+ public void handleDispatchingError(String info, Exception ex) {
+ handleErrorsFromInternalMessageDispatcher(info, ex);
+ }
+
+ @Override
+ public void handleQueueingError(String info, Exception ex) {
+ handleErrorsFromInternalMessageDispatcher(info, ex);
+ }
+ });
+ }
+
+ // Setup Incoming ProxyMessage Dispatcher
+ synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
+ // Ensure incomingProxyMessageDispatcher is null
+ if (_incomingProxyMessageDispatcher != null) {
+ _incomingProxyMessageDispatcher.dispose();
+ _incomingProxyMessageDispatcher = null;
+ }
+
+ _incomingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("INCOMING_MESSAGE_DISPATCHER",new IDispatchingStrategy<ProtocolMessage>() {
+ @Override
+ public void dispatch(ProtocolMessage message) {
+ dispatchIncomingMessage(message);
+ }
+
+ @Override
+ public void handleDispatchingError(String info, Exception ex) {
+ handleErrorsFromIncomingMessageDispatcher(info, ex);
+ }
+
+ @Override
+ public void handleQueueingError(String info, Exception ex) {
+ handleErrorsFromIncomingMessageDispatcher(info, ex);
+ }
+ });
+ }
+
+ // Setup Outgoing ProxyMessage Dispatcher
+ synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {
+ // Ensure outgoingProxyMessageDispatcher is null
+ if (_outgoingProxyMessageDispatcher != null) {
+ _outgoingProxyMessageDispatcher.dispose();
+ _outgoingProxyMessageDispatcher = null;
+ }
+
+ _outgoingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("OUTGOING_MESSAGE_DISPATCHER",new IDispatchingStrategy<ProtocolMessage>() {
+ @Override
+ public void dispatch(ProtocolMessage message) {
+ dispatchOutgoingMessage(message);
+ }
+
+ @Override
+ public void handleDispatchingError(String info, Exception ex) {
+ handleErrorsFromOutgoingMessageDispatcher(info, ex);
+ }
+
+ @Override
+ public void handleQueueingError(String info, Exception ex) {
+ handleErrorsFromOutgoingMessageDispatcher(info, ex);
+ }
+ });
+ }
+
+ rpcResponseListeners = new SparseArray<OnRPCResponseListener>();
+ rpcNotificationListeners = new SparseArray<CopyOnWriteArrayList<OnRPCNotificationListener>>();
+ rpcRequestListeners = new SparseArray<CopyOnWriteArrayList<OnRPCRequestListener>>();
+ rpcListeners = new SparseArray<CopyOnWriteArrayList<OnRPCListener>>();
+
+ // Initialize the proxy
+ try {
+ initializeProxy();
+ } catch (SdlException e) {
+ // Couldn't initialize the proxy
+ // Dispose threads and then rethrow exception
+
+ if (_internalProxyMessageDispatcher != null) {
+ _internalProxyMessageDispatcher.dispose();
+ _internalProxyMessageDispatcher = null;
+ }
+ if (_incomingProxyMessageDispatcher != null) {
+ _incomingProxyMessageDispatcher.dispose();
+ _incomingProxyMessageDispatcher = null;
+ }
+ if (_outgoingProxyMessageDispatcher != null) {
+ _outgoingProxyMessageDispatcher.dispose();
+ _outgoingProxyMessageDispatcher = null;
+ }
+ throw e;
+ }
+
+ // Trace that ctor has fired
+ SdlTrace.logProxyEvent("SdlProxy Created, instanceID=" + this.toString(), SDL_LIB_TRACE_KEY);
+ }
+
+ protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
+ String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
+ String autoActivateID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme,
+ boolean callbackToUIThread, boolean preRegister, String sHashID, Boolean bEnableResume, BaseTransportConfig transportConfig)
+ throws SdlException
+ {
+ performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
+ sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, dayColorScheme, nightColorScheme, callbackToUIThread, preRegister, sHashID, bEnableResume, transportConfig);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param listener Type of listener for this proxy base.
+ * @param sdlProxyConfigurationResources Configuration resources for this proxy.
+ * @param enableAdvancedLifecycleManagement Flag that ALM should be enabled or not.
+ * @param appName Client application name.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Media Screen Application name.
+ * @param vrSynonyms List of synonyms.
+ * @param isMediaApp Flag that indicates that client application if media application or not.
+ * @param sdlMsgVersion Version of Sdl Message.
+ * @param languageDesired Desired language.
+ * @param hmiDisplayLanguageDesired Desired language for HMI.
+ * @param appType Type of application.
+ * @param appID Application identifier.
+ * @param autoActivateID Auto activation identifier.
+ * @param callbackToUIThread Flag that indicates that this proxy should send callback to UI thread or not.
+ * @param preRegister Flag that indicates that this proxy should be pre-registerd or not.
+ * @param transportConfig Configuration of transport to be used by underlying connection.
+ * @throws SdlException if there is an unrecoverable error class might throw an exception.
+ */
+ protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
+ String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
+ String autoActivateID, boolean callbackToUIThread, boolean preRegister, BaseTransportConfig transportConfig)
+ throws SdlException
+ {
+ performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
+ sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, null, null, callbackToUIThread, preRegister, null, null, transportConfig);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param listener Type of listener for this proxy base.
+ * @param sdlProxyConfigurationResources Configuration resources for this proxy.
+ * @param enableAdvancedLifecycleManagement Flag that ALM should be enabled or not.
+ * @param appName Client application name.
+ * @param ttsName TTS name.
+ * @param ngnMediaScreenAppName Media Screen Application name.
+ * @param vrSynonyms List of synonyms.
+ * @param isMediaApp Flag that indicates that client application if media application or not.
+ * @param sdlMsgVersion Version of Sdl Message.
+ * @param languageDesired Desired language.
+ * @param hmiDisplayLanguageDesired Desired language for HMI.
+ * @param appType Type of application.
+ * @param appID Application identifier.
+ * @param autoActivateID Auto activation identifier.
+ * @param dayColorScheme Day color scheme.
+ * @param dayColorScheme Night color scheme.
+ * @param callbackToUIThread Flag that indicates that this proxy should send callback to UI thread or not.
+ * @param preRegister Flag that indicates that this proxy should be pre-registerd or not.
+ * @param transportConfig Configuration of transport to be used by underlying connection.
+ * @throws SdlException if there is an unrecoverable error class might throw an exception.
+ */
+ protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
+ boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
+ String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
+ String autoActivateID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme,
+ boolean callbackToUIThread, boolean preRegister, BaseTransportConfig transportConfig)
+ throws SdlException
+ {
+ performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
+ sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, dayColorScheme, nightColorScheme, callbackToUIThread, preRegister, null, null, transportConfig);
+ }
+
+ private Intent createBroadcastIntent()
+ {
+ Intent sendIntent = new Intent();
+ sendIntent.setAction("com.smartdevicelink.broadcast");
+ sendIntent.putExtra("APP_NAME", this._applicationName);
+ sendIntent.putExtra("APP_ID", this._appID);
+ sendIntent.putExtra("RPC_NAME", "");
+ sendIntent.putExtra("TYPE", "");
+ sendIntent.putExtra("SUCCESS", true);
+ sendIntent.putExtra("CORRID", 0);
+ sendIntent.putExtra("FUNCTION_NAME", "");
+ sendIntent.putExtra("COMMENT1", "");
+ sendIntent.putExtra("COMMENT2", "");
+ sendIntent.putExtra("COMMENT3", "");
+ sendIntent.putExtra("COMMENT4", "");
+ sendIntent.putExtra("COMMENT5", "");
+ sendIntent.putExtra("COMMENT6", "");
+ sendIntent.putExtra("COMMENT7", "");
+ sendIntent.putExtra("COMMENT8", "");
+ sendIntent.putExtra("COMMENT9", "");
+ sendIntent.putExtra("COMMENT10", "");
+ sendIntent.putExtra("DATA", "");
+ sendIntent.putExtra("SHOW_ON_UI", true);
+ return sendIntent;
+ }
+ private void updateBroadcastIntent(Intent sendIntent, String sKey, String sValue)
+ {
+ if (sValue == null) sValue = "";
+ sendIntent.putExtra(sKey, sValue);
+ }
+ private void updateBroadcastIntent(Intent sendIntent, String sKey, boolean bValue)
+ {
+ sendIntent.putExtra(sKey, bValue);
+ }
+ private void updateBroadcastIntent(Intent sendIntent, String sKey, int iValue)
+ {
+ sendIntent.putExtra(sKey, iValue);
+ }
+
+ private Service getService()
+ {
+ try {
+ Service myService = null;
+ if (_proxyListener != null && _proxyListener instanceof Service) {
+ myService = (Service) _proxyListener;
+ } else if (_appService != null) {
+ myService = _appService;
+ } else if (_appContext != null && _appContext instanceof Service) {
+ myService = (Service) _appContext;
+ }
+ return myService;
+ } catch (Exception ex){
+ return null;
+ }
+ }
+
+ private void sendBroadcastIntent(Intent sendIntent)
+ {
+ Service myService = null;
+ if (_proxyListener != null && _proxyListener instanceof Service)
+ {
+ myService = (Service) _proxyListener;
+ }
+ else if (_appService != null)
+ {
+ myService = _appService;
+ }
+ Context myContext;
+ if (myService != null){
+ myContext = myService.getApplicationContext();
+ } else if (_appContext != null){
+ myContext = _appContext;
+ }
+ else
+ {
+ return;
+ }
+ try
+ {
+ if (myContext != null) myContext.sendBroadcast(sendIntent);
+ }
+ catch(Exception ex)
+ {
+ //If the service or context has become unavailable unexpectedly, catch the exception and move on -- no broadcast log will occur.
+ }
+ }
+
+ private HttpURLConnection getURLConnection(Headers myHeader, String sURLString, int Timeout, int iContentLen)
+ {
+ String sContentType = "application/json";
+ int CONNECTION_TIMEOUT = Timeout * 1000;
+ int READ_TIMEOUT = Timeout * 1000;
+ boolean bDoOutput = true;
+ boolean bDoInput = true;
+ boolean bUsesCaches = false;
+ String sRequestMeth = "POST";
+
+ boolean bInstFolRed = false;
+ String sCharSet = "utf-8";
+ int iContentLength = iContentLen;
+
+ URL url;
+ HttpURLConnection urlConnection;
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "getURLConnection");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "Actual Content Length: " + iContentLen);
+
+ if (myHeader != null)
+ {
+ //if the header isn't null, use it and replace the hardcoded params
+ int iTimeout;
+ int iReadTimeout;
+ sContentType = myHeader.getContentType();
+ iTimeout = myHeader.getConnectTimeout();
+ bDoOutput = myHeader.getDoOutput();
+ bDoInput = myHeader.getDoInput();
+ bUsesCaches = myHeader.getUseCaches();
+ sRequestMeth = myHeader.getRequestMethod();
+ iReadTimeout = myHeader.getReadTimeout();
+ bInstFolRed = myHeader.getInstanceFollowRedirects();
+ sCharSet = myHeader.getCharset();
+ iContentLength = myHeader.getContentLength();
+ CONNECTION_TIMEOUT = iTimeout*1000;
+ READ_TIMEOUT = iReadTimeout*1000;
+ updateBroadcastIntent(sendIntent, "COMMENT2", "\nHeader Defined Content Length: " + iContentLength);
+ }
+
+ try
+ {
+ url = new URL(sURLString);
+ urlConnection = (HttpURLConnection) url.openConnection();
+ urlConnection.setConnectTimeout(CONNECTION_TIMEOUT);
+ urlConnection.setDoOutput(bDoOutput);
+ urlConnection.setDoInput(bDoInput);
+ urlConnection.setRequestMethod(sRequestMeth);
+ urlConnection.setReadTimeout(READ_TIMEOUT);
+ urlConnection.setInstanceFollowRedirects(bInstFolRed);
+ urlConnection.setRequestProperty("Content-Type", sContentType);
+ urlConnection.setRequestProperty("charset", sCharSet);
+ urlConnection.setRequestProperty("Content-Length", "" + Integer.toString(iContentLength));
+ urlConnection.setUseCaches(bUsesCaches);
+ return urlConnection;
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ finally
+ {
+ sendBroadcastIntent(sendIntent);
+ }
+ }
+
+
+ private void sendOnSystemRequestToUrl(OnSystemRequest msg)
+ {
+ Intent sendIntent = createBroadcastIntent();
+ Intent sendIntent2 = createBroadcastIntent();
+
+ HttpURLConnection urlConnection = null;
+ boolean bLegacy = false;
+
+ String sURLString;
+ if (!getPoliciesURL().equals("")) {
+ sURLString = sPoliciesURL;
+ } else {
+ sURLString = msg.getUrl();
+ }
+
+ Integer iTimeout = msg.getTimeout();
+
+ if (iTimeout == null)
+ iTimeout = 2000;
+
+ Headers myHeader = msg.getHeader();
+
+ RequestType requestType = msg.getRequestType();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "sendOnSystemRequestToUrl");
+ updateBroadcastIntent(sendIntent, "COMMENT5", "\r\nCloud URL: " + sURLString);
+
+ try
+ {
+ if (myHeader == null) {
+ updateBroadcastIntent(sendIntent, "COMMENT7", "\r\nHTTPRequest Header is null");
+ }
+
+ String sBodyString = msg.getBody();
+
+ JSONObject jsonObjectToSendToServer;
+ String valid_json = "";
+ int length;
+ if (sBodyString == null)
+ {
+ if(requestType == RequestType.HTTP ){
+ length = msg.getBulkData().length;
+ Intent sendIntent3 = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent3, "FUNCTION_NAME", "replace");
+ updateBroadcastIntent(sendIntent3, "COMMENT1", "Valid Json length before replace: " + length);
+ sendBroadcastIntent(sendIntent3);
+
+ }else{
+ List<String> legacyData = msg.getLegacyData();
+ JSONArray jsonArrayOfSdlPPackets = new JSONArray(legacyData);
+ jsonObjectToSendToServer = new JSONObject();
+ jsonObjectToSendToServer.put("data", jsonArrayOfSdlPPackets);
+ bLegacy = true;
+ updateBroadcastIntent(sendIntent, "COMMENT6", "\r\nLegacy SystemRequest: true");
+ valid_json = jsonObjectToSendToServer.toString().replace("\\", "");
+ length = valid_json.getBytes("UTF-8").length;
+ }
+ }
+ else
+ {
+ Intent sendIntent3 = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent3, "FUNCTION_NAME", "replace");
+ updateBroadcastIntent(sendIntent3, "COMMENT1", "Valid Json length before replace: " + sBodyString.getBytes("UTF-8").length);
+ sendBroadcastIntent(sendIntent3);
+ valid_json = sBodyString.replace("\\", "");
+ length = valid_json.getBytes("UTF-8").length;
+ }
+
+ urlConnection = getURLConnection(myHeader, sURLString, iTimeout, length);
+
+ if (urlConnection == null)
+ {
+ Log.i(TAG, "urlConnection is null, check RPC input parameters");
+ updateBroadcastIntent(sendIntent, "COMMENT2", "urlConnection is null, check RPC input parameters");
+ return;
+ }
+
+ DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream());
+ if(requestType == RequestType.HTTP){
+ wr.write(msg.getBulkData());
+ }else{
+ wr.writeBytes(valid_json);
+ }
+
+ wr.flush();
+ wr.close();
+
+
+ long BeforeTime = System.currentTimeMillis();
+ long AfterTime = System.currentTimeMillis();
+ final long roundtriptime = AfterTime - BeforeTime;
+
+ updateBroadcastIntent(sendIntent, "COMMENT4", " Round trip time: " + roundtriptime);
+ updateBroadcastIntent(sendIntent, "COMMENT1", "Received response from cloud, response code=" + urlConnection.getResponseCode() + " ");
+
+ int iResponseCode = urlConnection.getResponseCode();
+
+ if (iResponseCode != HttpURLConnection.HTTP_OK)
+ {
+ Log.i(TAG, "Response code not HTTP_OK, returning from sendOnSystemRequestToUrl.");
+ updateBroadcastIntent(sendIntent, "COMMENT2", "Response code not HTTP_OK, aborting request. ");
+ return;
+ }
+
+ InputStream is = urlConnection.getInputStream();
+ BufferedReader rd = new BufferedReader(new InputStreamReader(is));
+ String line;
+ StringBuilder response = new StringBuilder();
+ while((line = rd.readLine()) != null)
+ {
+ response.append(line);
+ response.append('\r');
+ }
+ rd.close();
+ //We've read the body
+ if(requestType == RequestType.HTTP){
+ // Create the SystemRequest RPC to send to module.
+ PutFile putFile = new PutFile();
+ putFile.setFileType(FileType.JSON);
+ putFile.setCorrelationID(POLICIES_CORRELATION_ID);
+ putFile.setSdlFileName("response_data");
+ putFile.setFileData(response.toString().getBytes("UTF-8"));
+ putFile.setCRC(response.toString().getBytes());
+ updateBroadcastIntent(sendIntent, "DATA", "Data from cloud response: " + response.toString());
+
+ sendRPCMessagePrivate(putFile);
+ Log.i("sendSystemRequestToUrl", "sent to sdl");
+
+ updateBroadcastIntent(sendIntent2, "RPC_NAME", FunctionID.PUT_FILE.toString());
+ updateBroadcastIntent(sendIntent2, "TYPE", RPCMessage.KEY_REQUEST);
+ updateBroadcastIntent(sendIntent2, "CORRID", putFile.getCorrelationID());
+
+ }else{
+ Vector<String> cloudDataReceived = new Vector<String>();
+ final String dataKey = "data";
+ // Convert the response to JSON
+ JSONObject jsonResponse = new JSONObject(response.toString());
+ if(jsonResponse.has(dataKey)){
+ if (jsonResponse.get(dataKey) instanceof JSONArray)
+ {
+ JSONArray jsonArray = jsonResponse.getJSONArray(dataKey);
+ for (int i=0; i<jsonArray.length(); i++)
+ {
+ if (jsonArray.get(i) instanceof String)
+ {
+ cloudDataReceived.add(jsonArray.getString(i));
+ //Log.i("sendSystemRequestToUrl", "jsonArray.getString(i): " + jsonArray.getString(i));
+ }
+ }
+ }
+ else if (jsonResponse.get(dataKey) instanceof String)
+ {
+ cloudDataReceived.add(jsonResponse.getString(dataKey));
+ //Log.i("sendSystemRequestToUrl", "jsonResponse.getString(data): " + jsonResponse.getString("data"));
+ }
+ }
+ else
+ {
+ DebugTool.logError("sendSystemRequestToUrl: Data in JSON Object neither an array nor a string.");
+ //Log.i("sendSystemRequestToUrl", "sendSystemRequestToUrl: Data in JSON Object neither an array nor a string.");
+ return;
+ }
+
+ String sResponse = cloudDataReceived.toString();
+
+ if (sResponse.length() > 512)
+ {
+ sResponse = sResponse.substring(0, 511);
+ }
+
+ updateBroadcastIntent(sendIntent, "DATA", "Data from cloud response: " + sResponse);
+
+ // Send new SystemRequest to SDL
+ SystemRequest mySystemRequest = null;
+
+ if (bLegacy){
+ if(cloudDataReceived != null) {
+ mySystemRequest = new SystemRequest(true);
+ mySystemRequest.setCorrelationID(getPoliciesReservedCorrelationID());
+ mySystemRequest.setLegacyData(cloudDataReceived);
+ }
+ }else{
+ if (response != null) {
+ mySystemRequest = new SystemRequest();
+ mySystemRequest.setRequestType(RequestType.PROPRIETARY);
+ mySystemRequest.setCorrelationID(getPoliciesReservedCorrelationID());
+ mySystemRequest.setBulkData(response.toString().getBytes());
+ }
+ }
+
+ if (getIsConnected())
+ {
+ sendRPCMessagePrivate(mySystemRequest);
+ Log.i("sendSystemRequestToUrl", "sent to sdl");
+
+ updateBroadcastIntent(sendIntent2, "RPC_NAME", FunctionID.SYSTEM_REQUEST.toString());
+ updateBroadcastIntent(sendIntent2, "TYPE", RPCMessage.KEY_REQUEST);
+ updateBroadcastIntent(sendIntent2, "CORRID", mySystemRequest.getCorrelationID());
+ }
+ }
+ }
+ catch (SdlException e)
+ {
+ DebugTool.logError("sendSystemRequestToUrl: Could not get data from JSONObject received.", e);
+ updateBroadcastIntent(sendIntent, "COMMENT3", " SdlException encountered sendOnSystemRequestToUrl: "+ e);
+ //Log.i("pt", "sendSystemRequestToUrl: Could not get data from JSONObject received."+ e);
+ }
+ catch (JSONException e)
+ {
+ DebugTool.logError("sendSystemRequestToUrl: JSONException: ", e);
+ updateBroadcastIntent(sendIntent, "COMMENT3", " JSONException encountered sendOnSystemRequestToUrl: "+ e);
+ //Log.i("pt", "sendSystemRequestToUrl: JSONException: "+ e);
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ DebugTool.logError("sendSystemRequestToUrl: Could not encode string.", e);
+ updateBroadcastIntent(sendIntent, "COMMENT3", " UnsupportedEncodingException encountered sendOnSystemRequestToUrl: "+ e);
+ //Log.i("pt", "sendSystemRequestToUrl: Could not encode string."+ e);
+ }
+ catch (ProtocolException e)
+ {
+ DebugTool.logError("sendSystemRequestToUrl: Could not set request method to post.", e);
+ updateBroadcastIntent(sendIntent, "COMMENT3", " ProtocolException encountered sendOnSystemRequestToUrl: "+ e);
+ //Log.i("pt", "sendSystemRequestToUrl: Could not set request method to post."+ e);
+ }
+ catch (MalformedURLException e)
+ {
+ DebugTool.logError("sendSystemRequestToUrl: URL Exception when sending SystemRequest to an external server.", e);
+ updateBroadcastIntent(sendIntent, "COMMENT3", " MalformedURLException encountered sendOnSystemRequestToUrl: "+ e);
+ //Log.i("pt", "sendSystemRequestToUrl: URL Exception when sending SystemRequest to an external server."+ e);
+ }
+ catch (IOException e)
+ {
+ DebugTool.logError("sendSystemRequestToUrl: IOException: ", e);
+ updateBroadcastIntent(sendIntent, "COMMENT3", " IOException while sending to cloud: IOException: "+ e);
+ //Log.i("pt", "sendSystemRequestToUrl: IOException: "+ e);
+ }
+ catch (Exception e)
+ {
+ DebugTool.logError("sendSystemRequestToUrl: Unexpected Exception: ", e);
+ updateBroadcastIntent(sendIntent, "COMMENT3", " Exception encountered sendOnSystemRequestToUrl: "+ e);
+ //Log.i("pt", "sendSystemRequestToUrl: Unexpected Exception: " + e);
+ }
+ finally
+ {
+ sendBroadcastIntent(sendIntent);
+ sendBroadcastIntent(sendIntent2);
+
+ if (iFileCount < 10)
+ iFileCount++;
+ else
+ iFileCount = 0;
+
+ if(urlConnection != null)
+ {
+ urlConnection.disconnect();
+ }
+ }
+ }
+
+ private int getPoliciesReservedCorrelationID() {
+ return POLICIES_CORRELATION_ID;
+ }
+
+ // Test correlationID
+ private boolean isCorrelationIDProtected(Integer correlationID) {
+ return correlationID != null &&
+ (HEARTBEAT_CORRELATION_ID == correlationID
+ || REGISTER_APP_INTERFACE_CORRELATION_ID == correlationID
+ || UNREGISTER_APP_INTERFACE_CORRELATION_ID == correlationID
+ || POLICIES_CORRELATION_ID == correlationID);
+
+ }
+
+ // Protected isConnected method to allow legacy proxy to poll isConnected state
+ public Boolean getIsConnected() {
+ return sdlSession != null && sdlSession.getIsConnected();
+ }
+
+
+ /**
+ * Returns whether the application is registered in SDL. Note: for testing
+ * purposes, it's possible that the connection is established, but the
+ * application is not registered.
+ *
+ * @return true if the application is registered in SDL
+ */
+ public Boolean getAppInterfaceRegistered() {
+ return _appInterfaceRegisterd;
+ }
+
+ // Function to initialize new proxy connection
+ public void initializeProxy() throws SdlException {
+ // Reset all of the flags and state variables
+ _haveReceivedFirstNonNoneHMILevel = false;
+ _haveReceivedFirstFocusLevel = false;
+ _haveReceivedFirstFocusLevelFull = false;
+ _appInterfaceRegisterd = _preRegisterd;
+
+ _putFileListenerList.clear();
+
+ _sdlIntefaceAvailablity = SdlInterfaceAvailability.SDL_INTERFACE_UNAVAILABLE;
+
+ //Initialize _systemCapabilityManager here.
+ _systemCapabilityManager = new SystemCapabilityManager(_internalInterface);
+ // Setup SdlConnection
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+
+ //Handle legacy USB connections
+ if(_transportConfig != null
+ && TransportType.USB.equals(_transportConfig.getTransportType())){
+ //A USB transport config was provided
+ USBTransportConfig usbTransportConfig = (USBTransportConfig)_transportConfig;
+ if(usbTransportConfig.getUsbAccessory() == null){
+ DebugTool.logInfo("Legacy USB transport config was used, but received null for accessory. Attempting to connect with router service");
+ //The accessory was null which means it came from a router service
+ MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(usbTransportConfig.getUSBContext(),_appID);
+ multiplexTransportConfig.setRequiresHighBandwidth(true);
+ multiplexTransportConfig.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF);
+ multiplexTransportConfig.setPrimaryTransports(Collections.singletonList(TransportType.USB));
+ multiplexTransportConfig.setSecondaryTransports(new ArrayList<TransportType>());
+ _transportConfig = multiplexTransportConfig;
+ }
+ }
+
+ if(_transportConfig.getTransportType().equals(TransportType.MULTIPLEX)){
+ this.sdlSession = new SdlSession2(_interfaceBroker,(MultiplexTransportConfig)_transportConfig);
+ }else{
+ this.sdlSession = SdlSession.createSession((byte)getProtocolVersion().getMajor(),_interfaceBroker, _transportConfig);
+ }
+ }
+
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+ this.sdlSession.startSession();
+ sendTransportBroadcast();
+ }
+ }
+ /**
+ * This method will fake the multiplex connection event
+ */
+ @SuppressWarnings("unused")
+ public void forceOnConnected(){
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+ if (sdlSession != null) {
+ Log.d(TAG, "Forcing on connected.... might actually need this"); //FIXME
+ /*if(sdlSession.getSdlConnection()==null){ //There is an issue when switching from v1 to v2+ where the connection is closed. So we restart the session during this call.
+ try {
+ sdlSession.startSession();
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ }
+ sdlSession.getSdlConnection().forceHardwareConnectEvent(TransportType.BLUETOOTH);
+ */
+ }
+ }
+ }
+
+ public void sendTransportBroadcast()
+ {
+ if (sdlSession == null || _transportConfig == null) return;
+
+ String sTransComment = sdlSession.getBroadcastComment(_transportConfig);
+
+ if (sTransComment == null || sTransComment.equals("")) return;
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "initializeProxy");
+ updateBroadcastIntent(sendIntent, "COMMENT1", sTransComment);
+ sendBroadcastIntent(sendIntent);
+ }
+
+
+ /**
+ * Public method to enable the siphon transport
+ */
+ @SuppressWarnings("unused")
+ public void enableSiphonDebug() {
+
+ short enabledPortNumber = SiphonServer.enableSiphonServer();
+ String sSiphonPortNumber = "Enabled Siphon Port Number: " + enabledPortNumber;
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "enableSiphonDebug");
+ updateBroadcastIntent(sendIntent, "COMMENT1", sSiphonPortNumber);
+ sendBroadcastIntent(sendIntent);
+ }
+
+
+
+ /**
+ * Public method to disable the Siphon Trace Server
+ */
+ @SuppressWarnings("unused")
+ public void disableSiphonDebug() {
+
+ short disabledPortNumber = SiphonServer.disableSiphonServer();
+ if (disabledPortNumber != -1) {
+ String sSiphonPortNumber = "Disabled Siphon Port Number: " + disabledPortNumber;
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "disableSiphonDebug");
+ updateBroadcastIntent(sendIntent, "COMMENT1", sSiphonPortNumber);
+ sendBroadcastIntent(sendIntent);
+ }
+ }
+
+
+
+ /**
+ * Public method to enable the Debug Tool
+ */
+ public static void enableDebugTool() {
+ DebugTool.enableDebugTool();
+ }
+
+ /**
+ * Public method to disable the Debug Tool
+ */
+ public static void disableDebugTool() {
+ DebugTool.disableDebugTool();
+ }
+
+ /**
+ * Public method to determine Debug Tool enabled
+ */
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
+ public static boolean isDebugEnabled() {
+ return DebugTool.isDebugEnabled();
+ }
+
+
+ /**
+ * Check to see if it a transport is available to perform audio streaming.
+ * <br><strong>NOTE:</strong> This is only for the audio streaming service, not regular
+ * streaming of media playback.
+ * @return true if there is either an audio streaming supported
+ * transport currently connected or a transport is
+ * available to connect with. false if there is no
+ * transport connected to support audio streaming and
+ * no possibility in the foreseeable future.
+ */
+ public boolean isAudioStreamTransportAvailable(){
+ return sdlSession!= null && sdlSession.isTransportForServiceAvailable(SessionType.PCM);
+ }
+
+ /**
+ * Check to see if it a transport is available to perform video streaming.
+
+ * @return true if there is either an video streaming supported
+ * transport currently connected or a transport is
+ * available to connect with. false if there is no
+ * transport connected to support video streaming and
+ * no possibility in the foreseeable future.
+ */
+ public boolean isVideoStreamTransportAvailable(){
+ return sdlSession!= null && sdlSession.isTransportForServiceAvailable(SessionType.NAV);
+ }
+
+
+ @SuppressWarnings("unused")
+ @Deprecated
+ public void close() throws SdlException {
+ dispose();
+ }
+
+ @SuppressWarnings("UnusedParameters")
+ private void cleanProxy(SdlDisconnectedReason disconnectedReason) throws SdlException {
+ if (disconnectedReason == SdlDisconnectedReason.MINIMUM_PROTOCOL_VERSION_HIGHER_THAN_SUPPORTED || disconnectedReason == SdlDisconnectedReason.MINIMUM_RPC_VERSION_HIGHER_THAN_SUPPORTED){
+ notifyProxyClosed(disconnectedReason.toString(), null, disconnectedReason);
+ sdlSession.resetSession();
+ }
+ try {
+
+ // ALM Specific Cleanup
+ if (_advancedLifecycleManagementEnabled) {
+ _sdlConnectionState = SdlConnectionState.SDL_DISCONNECTED;
+
+ firstTimeFull = true;
+
+ // Should we wait for the interface to be unregistered?
+ Boolean waitForInterfaceUnregistered = false;
+ // Unregister app interface
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+ if (getIsConnected() && getAppInterfaceRegistered()) {
+ waitForInterfaceUnregistered = true;
+ unregisterAppInterfacePrivate(UNREGISTER_APP_INTERFACE_CORRELATION_ID);
+ }
+ }
+
+ // Wait for the app interface to be unregistered
+ if (waitForInterfaceUnregistered) {
+ synchronized(APP_INTERFACE_REGISTERED_LOCK) {
+ try {
+ APP_INTERFACE_REGISTERED_LOCK.wait(3000);
+ } catch (InterruptedException e) {
+ // Do nothing
+ }
+ }
+ }
+ }
+
+ if(rpcResponseListeners != null){
+ rpcResponseListeners.clear();
+ }
+ if(rpcNotificationListeners != null){
+ rpcNotificationListeners.clear();
+ }
+
+ // Clean up SDL Connection
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+ if (sdlSession != null) sdlSession.close();
+ }
+ } finally {
+ SdlTrace.logProxyEvent("SdlProxy cleaned.", SDL_LIB_TRACE_KEY);
+ }
+ }
+
+ /**
+ * Terminates the App's Interface Registration, closes the transport connection, ends the protocol session, and frees any resources used by the proxy.
+ */
+ public void dispose() throws SdlException
+ {
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ _proxyDisposed = true;
+
+ SdlTrace.logProxyEvent("Application called dispose() method.", SDL_LIB_TRACE_KEY);
+
+ try{
+ // Clean the proxy
+ cleanProxy(SdlDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);
+
+ // Close IncomingProxyMessageDispatcher thread
+ synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
+ if (_incomingProxyMessageDispatcher != null) {
+ _incomingProxyMessageDispatcher.dispose();
+ _incomingProxyMessageDispatcher = null;
+ }
+ }
+
+ // Close OutgoingProxyMessageDispatcher thread
+ synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {
+ if (_outgoingProxyMessageDispatcher != null) {
+ _outgoingProxyMessageDispatcher.dispose();
+ _outgoingProxyMessageDispatcher = null;
+ }
+ }
+
+ // Close InternalProxyMessageDispatcher thread
+ synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
+ if (_internalProxyMessageDispatcher != null) {
+ _internalProxyMessageDispatcher.dispose();
+ _internalProxyMessageDispatcher = null;
+ }
+ }
+
+ _traceDeviceInterrogator = null;
+
+ rpcResponseListeners = null;
+
+ } finally {
+ SdlTrace.logProxyEvent("SdlProxy disposed.", SDL_LIB_TRACE_KEY);
+ }
+ } // end-method
+
+
+ private final static Object CYCLE_LOCK = new Object();
+
+ private boolean _cycling = false;
+
+ // Method to cycle the proxy, only called in ALM
+ protected void cycleProxy(SdlDisconnectedReason disconnectedReason) {
+ if (_cycling) return;
+
+ synchronized(CYCLE_LOCK)
+ {
+ try{
+ _cycling = true;
+ cleanProxy(disconnectedReason);
+ initializeProxy();
+ if(!SdlDisconnectedReason.LEGACY_BLUETOOTH_MODE_ENABLED.equals(disconnectedReason)
+ && !SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST.equals(disconnectedReason)){//We don't want to alert higher if we are just cycling for legacy bluetooth
+ notifyProxyClosed("Sdl Proxy Cycled", new SdlException("Sdl Proxy Cycled", SdlExceptionCause.SDL_PROXY_CYCLED), disconnectedReason);
+ }
+ }
+ catch (SdlException e) {
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "cycleProxy");
+ updateBroadcastIntent(sendIntent, "COMMENT1", "Proxy cycled, exception cause: " + e.getSdlExceptionCause());
+ sendBroadcastIntent(sendIntent);
+
+ switch(e.getSdlExceptionCause()) {
+ case BLUETOOTH_DISABLED:
+ notifyProxyClosed("Bluetooth is disabled. Bluetooth must be enabled to connect to SDL. Reattempt a connection once Bluetooth is enabled.",
+ new SdlException("Bluetooth is disabled. Bluetooth must be enabled to connect to SDL. Reattempt a connection once Bluetooth is enabled.", SdlExceptionCause.BLUETOOTH_DISABLED), SdlDisconnectedReason.BLUETOOTH_DISABLED);
+ break;
+ case BLUETOOTH_ADAPTER_NULL:
+ notifyProxyClosed("Cannot locate a Bluetooth adapater. A SDL connection is impossible on this device until a Bluetooth adapter is added.",
+ new SdlException("Cannot locate a Bluetooth adapater. A SDL connection is impossible on this device until a Bluetooth adapter is added.", SdlExceptionCause.BLUETOOTH_ADAPTER_NULL), SdlDisconnectedReason.BLUETOOTH_ADAPTER_ERROR);
+ break;
+ default :
+ notifyProxyClosed("Cycling the proxy failed.", e, SdlDisconnectedReason.GENERIC_ERROR);
+ break;
+ }
+ } catch (Exception e) {
+ notifyProxyClosed("Cycling the proxy failed.", e, SdlDisconnectedReason.GENERIC_ERROR);
+ }
+ _cycling = false;
+ }
+ }
+
+
+
+ /************* Functions used by the Message Dispatching Queues ****************/
+ private void dispatchIncomingMessage(ProtocolMessage message) {
+ try{
+ // Dispatching logic
+ if (message.getSessionType().equals(SessionType.RPC)
+ ||message.getSessionType().equals(SessionType.BULK_DATA) ) {
+ try {
+ if (protocolVersion!= null && protocolVersion.getMajor() == 1 && message.getVersion() > 1) {
+ if(sdlSession != null
+ && sdlSession.getProtocolVersion()!= null
+ && sdlSession.getProtocolVersion().getMajor() > 1){
+ setProtocolVersion(sdlSession.getProtocolVersion());
+ }else{
+ setProtocolVersion(new Version(message.getVersion(),0,0));
+ }
+ }
+
+ Hashtable<String, Object> hash = new Hashtable<String, Object>();
+ if (protocolVersion!= null && protocolVersion.getMajor() > 1) {
+ Hashtable<String, Object> hashTemp = new Hashtable<String, Object>();
+ hashTemp.put(RPCMessage.KEY_CORRELATION_ID, message.getCorrID());
+ if (message.getJsonSize() > 0) {
+ final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());
+ //hashTemp.put(Names.parameters, mhash.get(Names.parameters));
+ if (mhash != null) {
+ hashTemp.put(RPCMessage.KEY_PARAMETERS, mhash);
+ }
+ }
+
+ String functionName = FunctionID.getFunctionName(message.getFunctionID());
+ if (functionName != null) {
+ hashTemp.put(RPCMessage.KEY_FUNCTION_NAME, functionName);
+ } else {
+ DebugTool.logWarning("Dispatch Incoming Message - function name is null unknown RPC. FunctionId: " + message.getFunctionID());
+ return;
+ }
+ if (message.getRPCType() == 0x00) {
+ hash.put(RPCMessage.KEY_REQUEST, hashTemp);
+ } else if (message.getRPCType() == 0x01) {
+ hash.put(RPCMessage.KEY_RESPONSE, hashTemp);
+ } else if (message.getRPCType() == 0x02) {
+ hash.put(RPCMessage.KEY_NOTIFICATION, hashTemp);
+ }
+ if (message.getBulkData() != null) hash.put(RPCStruct.KEY_BULK_DATA, message.getBulkData());
+ if (message.getPayloadProtected()) hash.put(RPCStruct.KEY_PROTECTED, true);
+ } else {
+ hash = JsonRPCMarshaller.unmarshall(message.getData());
+ }
+ handleRPCMessage(hash);
+ } catch (final Exception excp) {
+ DebugTool.logError("Failure handling protocol message: " + excp.toString(), excp);
+ passErrorToProxyListener("Error handing incoming protocol message.", excp);
+ } // end-catch
+ } //else { Handle other protocol message types here}
+ } catch (final Exception e) {
+ // Pass error to application through listener
+ DebugTool.logError("Error handing proxy event.", e);
+ passErrorToProxyListener("Error handing incoming protocol message.", e);
+ }
+ }
+
+ /**
+ * Get the SDL protocol spec version being used
+ * @return Version of the protocol spec
+ */
+ public @NonNull Version getProtocolVersion(){
+ if(this.protocolVersion == null){
+ this.protocolVersion = new Version(1,0,0);
+ }
+ return this.protocolVersion;
+ }
+
+ private void setProtocolVersion(@NonNull Version version) {
+ this.protocolVersion = version;
+ }
+
+ public String serializeJSON(RPCMessage msg)
+ {
+ try
+ {
+ return msg.serializeJSON((byte)this.getProtocolVersion().getMajor()).toString(2);
+ }
+ catch (final Exception e)
+ {
+ DebugTool.logError("Error handing proxy event.", e);
+ passErrorToProxyListener("Error serializing message.", e);
+ return null;
+ }
+ }
+
+ private void handleErrorsFromIncomingMessageDispatcher(String info, Exception e) {
+ passErrorToProxyListener(info, e);
+ }
+
+ private void dispatchOutgoingMessage(ProtocolMessage message) {
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+ if (sdlSession != null) {
+ sdlSession.sendMessage(message);
+ }
+ }
+ SdlTrace.logProxyEvent("SdlProxy sending Protocol Message: " + message.toString(), SDL_LIB_TRACE_KEY);
+ }
+
+ private void handleErrorsFromOutgoingMessageDispatcher(String info, Exception e) {
+ passErrorToProxyListener(info, e);
+ }
+
+ void dispatchInternalMessage(final InternalProxyMessage message) {
+ try{
+ switch (message.getFunctionName()) {
+ case InternalProxyMessage.OnProxyError: {
+ final OnError msg = (OnError) message;
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onError(msg.getInfo(), msg.getException());
+ }
+ });
+ } else {
+ _proxyListener.onError(msg.getInfo(), msg.getException());
+ }
+ break;
+ }
+ case InternalProxyMessage.OnServiceEnded: {
+ final OnServiceEnded msg = (OnServiceEnded) message;
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onServiceEnded(msg);
+ }
+ });
+ } else {
+ _proxyListener.onServiceEnded(msg);
+ }
+ break;
+ }
+ case InternalProxyMessage.OnServiceNACKed: {
+ final OnServiceNACKed msg = (OnServiceNACKed) message;
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onServiceNACKed(msg);
+ }
+ });
+ } else {
+ _proxyListener.onServiceNACKed(msg);
+ }
+
+ /* *************Start Legacy Specific Call-backs************/
+ break;
+ }
+ case InternalProxyMessage.OnProxyOpened:
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ ((IProxyListener) _proxyListener).onProxyOpened();
+ }
+ });
+ } else {
+ ((IProxyListener) _proxyListener).onProxyOpened();
+ }
+ break;
+ case InternalProxyMessage.OnProxyClosed: {
+ final OnProxyClosed msg = (OnProxyClosed) message;
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onProxyClosed(msg.getInfo(), msg.getException(), msg.getReason());
+ }
+ });
+ } else {
+ _proxyListener.onProxyClosed(msg.getInfo(), msg.getException(), msg.getReason());
+ }
+ /* ***************End Legacy Specific Call-backs************/
+ break;
+ }
+ default:
+ // Diagnostics
+ SdlTrace.logProxyEvent("Unknown RPC Message encountered. Check for an updated version of the SDL Proxy.", SDL_LIB_TRACE_KEY);
+ DebugTool.logError("Unknown RPC Message encountered. Check for an updated version of the SDL Proxy.");
+ break;
+ }
+
+ SdlTrace.logProxyEvent("Proxy fired callback: " + message.getFunctionName(), SDL_LIB_TRACE_KEY);
+ } catch(final Exception e) {
+ // Pass error to application through listener
+ DebugTool.logError("Error handing proxy event.", e);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onError("Error handing proxy event.", e);
+ }
+ });
+ } else {
+ _proxyListener.onError("Error handing proxy event.", e);
+ }
+ }
+ }
+
+ private void handleErrorsFromInternalMessageDispatcher(String info, Exception e) {
+ DebugTool.logError(info, e);
+ // This error cannot be passed to the user, as it indicates an error
+ // in the communication between the proxy and the application.
+
+ DebugTool.logError("InternalMessageDispatcher failed.", e);
+
+ // Note, this is the only place where the _proxyListener should be referenced asdlhronously,
+ // with an error on the internalMessageDispatcher, we have no other reliable way of
+ // communicating with the application.
+ notifyProxyClosed("Proxy callback dispatcher is down. Proxy instance is invalid.", e, SdlDisconnectedReason.GENERIC_ERROR);
+ _proxyListener.onError("Proxy callback dispatcher is down. Proxy instance is invalid.", e);
+ }
+ /************* END Functions used by the Message Dispatching Queues ****************/
+
+ // Private sendRPCMessagePrivate method. All RPCMessages are funneled through this method after error checking.
+ private void sendRPCMessagePrivate(RPCMessage message) throws SdlException {
+ try {
+ SdlTrace.logRPCEvent(InterfaceActivityDirection.Transmit, message, SDL_LIB_TRACE_KEY);
+
+ //FIXME this is temporary until the next major release of the library where OK is removed
+ if (message.getMessageType().equals(RPCMessage.KEY_REQUEST)) {
+ RPCRequest request = (RPCRequest) message;
+ if (FunctionID.SUBSCRIBE_BUTTON.toString().equals(request.getFunctionName())
+ || FunctionID.UNSUBSCRIBE_BUTTON.toString().equals(request.getFunctionName())
+ || FunctionID.BUTTON_PRESS.toString().equals(request.getFunctionName())) {
+
+ ButtonName buttonName = (ButtonName) request.getObject(ButtonName.class, SubscribeButton.KEY_BUTTON_NAME);
+
+
+ if (rpcSpecVersion != null) {
+ if (rpcSpecVersion.getMajor() < 5) {
+
+ if (ButtonName.PLAY_PAUSE.equals(buttonName)) {
+ request.setParameters(SubscribeButton.KEY_BUTTON_NAME, ButtonName.OK);
+ }
+ } else { //Newer than version 5.0.0
+ if (ButtonName.OK.equals(buttonName)) {
+ RPCRequest request2 = new RPCRequest(request);
+ request2.setParameters(SubscribeButton.KEY_BUTTON_NAME, ButtonName.PLAY_PAUSE);
+ request2.setOnRPCResponseListener(request.getOnRPCResponseListener());
+ sendRPCMessagePrivate(request2);
+ return;
+ }
+ }
+ }
+
+ }
+ }
+
+ message.format(rpcSpecVersion,true);
+ byte[] msgBytes = JsonRPCMarshaller.marshall(message, (byte)getProtocolVersion().getMajor());
+
+ ProtocolMessage pm = new ProtocolMessage();
+ pm.setData(msgBytes);
+ pm.setMessageType(MessageType.RPC);
+ pm.setSessionType(SessionType.RPC);
+ pm.setFunctionID(FunctionID.getFunctionId(message.getFunctionName()));
+ pm.setPayloadProtected(message.isPayloadProtected());
+
+ if (sdlSession != null) {
+ pm.setSessionID(sdlSession.getSessionId());
+ }
+
+ if (message.getBulkData() != null) {
+ pm.setBulkData(message.getBulkData());
+ }
+
+
+ if (message.getMessageType().equals(RPCMessage.KEY_REQUEST)) { // Request Specifics
+ pm.setRPCType((byte)0x00);
+ RPCRequest request = (RPCRequest) message;
+ if (request.getCorrelationID() == null) {
+ //Log error here
+ throw new SdlException("CorrelationID cannot be null. RPC: " + request.getFunctionName(), SdlExceptionCause.INVALID_ARGUMENT);
+ } else {
+ pm.setCorrID(request.getCorrelationID());
+ }
+ if (request.getFunctionName().equalsIgnoreCase(FunctionID.PUT_FILE.name())) {
+ pm.setPriorityCoefficient(1);
+ }
+ } else if (message.getMessageType().equals(RPCMessage.KEY_RESPONSE)) { // Response Specifics
+ pm.setRPCType((byte)0x01);
+ RPCResponse response = (RPCResponse) message;
+ if (response.getCorrelationID() == null) {
+ //Log error here
+ throw new SdlException("CorrelationID cannot be null. RPC: " + response.getFunctionName(), SdlExceptionCause.INVALID_ARGUMENT);
+ } else {
+ pm.setCorrID(response.getCorrelationID());
+ }
+ } else if (message.getMessageType().equals(RPCMessage.KEY_NOTIFICATION)) { // Notification Specifics
+ pm.setRPCType((byte)0x02);
+ } else {
+ //Log error here
+ throw new SdlException("RPC message is not a valid type", SdlExceptionCause.INVALID_ARGUMENT);
+ }
+
+ // Queue this outgoing message
+ synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {
+ if (_outgoingProxyMessageDispatcher != null) {
+ _outgoingProxyMessageDispatcher.queueMessage(pm);
+ //Since the message is queued we can add it's listener to our list, if it is a Request
+ if (message.getMessageType().equals(RPCMessage.KEY_REQUEST)) {
+ RPCRequest request = (RPCRequest) message;
+ OnRPCResponseListener listener = request.getOnRPCResponseListener();
+ addOnRPCResponseListener(listener, request.getCorrelationID(), msgBytes.length);
+ }
+ }
+ }
+ } catch (OutOfMemoryError e) {
+ SdlTrace.logProxyEvent("OutOfMemory exception while sending message " + message.getFunctionName(), SDL_LIB_TRACE_KEY);
+ throw new SdlException("OutOfMemory exception while sending message " + message.getFunctionName(), e, SdlExceptionCause.INVALID_ARGUMENT);
+ }
+ }
+
+ /**
+ * Only call this method for a PutFile response. It will cause a class cast exception if not.
+ * @param correlationId correlation id of the packet being updated
+ * @param bytesWritten how many bytes were written
+ * @param totalSize the total size in bytes
+ */
+ @SuppressWarnings("unused")
+ public void onPacketProgress(int correlationId, long bytesWritten, long totalSize){
+ synchronized(ON_UPDATE_LISTENER_LOCK){
+ if(rpcResponseListeners !=null
+ && rpcResponseListeners.indexOfKey(correlationId)>=0){
+ ((OnPutFileUpdateListener)rpcResponseListeners.get(correlationId)).onUpdate(correlationId, bytesWritten, totalSize);
+ }
+ }
+
+ }
+
+ /**
+ * Will provide callback to the listener either onFinish or onError depending on the RPCResponses result code,
+ * <p>Will automatically remove the listener for the list of listeners on completion.
+ * @param msg The RPCResponse message that was received
+ * @return if a listener was called or not
+ */
+ @SuppressWarnings("UnusedReturnValue")
+ private boolean onRPCResponseReceived(RPCResponse msg){
+ synchronized(ON_UPDATE_LISTENER_LOCK){
+ int correlationId = msg.getCorrelationID();
+ if(rpcResponseListeners !=null
+ && rpcResponseListeners.indexOfKey(correlationId)>=0){
+ OnRPCResponseListener listener = rpcResponseListeners.get(correlationId);
+ if(msg.getSuccess()){
+ listener.onResponse(correlationId, msg);
+ }else{
+ listener.onError(correlationId, msg.getResultCode(), msg.getInfo());
+ }
+ rpcResponseListeners.remove(correlationId);
+ return true;
+ }
+ return false;
+ }
+ }
+
+/**
+ * Add a listener that will receive the response to the specific RPCRequest sent with the corresponding correlation id
+ * @param listener that will get called back when a response is received
+ * @param correlationId of the RPCRequest that was sent
+ * @param totalSize only include if this is an OnPutFileUpdateListener. Otherwise it will be ignored.
+ */
+ public void addOnRPCResponseListener(OnRPCResponseListener listener,int correlationId, int totalSize){
+ synchronized(ON_UPDATE_LISTENER_LOCK){
+ if(rpcResponseListeners!=null
+ && listener !=null){
+ if(listener.getListenerType() == OnRPCResponseListener.UPDATE_LISTENER_TYPE_PUT_FILE){
+ ((OnPutFileUpdateListener)listener).setTotalSize(totalSize);
+ }
+ listener.onStart(correlationId);
+ rpcResponseListeners.put(correlationId, listener);
+ }
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public SparseArray<OnRPCResponseListener> getResponseListeners(){
+ synchronized(ON_UPDATE_LISTENER_LOCK){
+ return this.rpcResponseListeners;
+ }
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public boolean onRPCNotificationReceived(RPCNotification notification){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ CopyOnWriteArrayList<OnRPCNotificationListener> listeners = rpcNotificationListeners.get(FunctionID.getFunctionId(notification.getFunctionName()));
+ if(listeners!=null && listeners.size()>0) {
+ for (OnRPCNotificationListener listener : listeners) {
+ listener.onNotified(notification);
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public boolean onRPCReceived(RPCMessage message){
+ synchronized(RPC_LISTENER_LOCK){
+ CopyOnWriteArrayList<OnRPCListener> listeners = rpcListeners.get(FunctionID.getFunctionId(message.getFunctionName()));
+ if(listeners!=null && listeners.size()>0) {
+ for (OnRPCListener listener : listeners) {
+ listener.onReceived(message);
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public boolean onRPCRequestReceived(RPCRequest request){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ CopyOnWriteArrayList<OnRPCRequestListener> listeners = rpcRequestListeners.get(FunctionID.getFunctionId(request.getFunctionName()));
+ if(listeners!=null && listeners.size()>0) {
+ for (OnRPCRequestListener listener : listeners) {
+ listener.onRequest(request);
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * This will ad a listener for the specific type of notification. As of now it will only allow
+ * a single listener per notification function id
+ * @param notificationId The notification type that this listener is designated for
+ * @param listener The listener that will be called when a notification of the provided type is received
+ */
+ @SuppressWarnings("unused")
+ public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ if(notificationId != null && listener != null){
+ if(rpcNotificationListeners.indexOfKey(notificationId.getId()) < 0 ){
+ rpcNotificationListeners.put(notificationId.getId(),new CopyOnWriteArrayList<OnRPCNotificationListener>());
+ }
+ rpcNotificationListeners.get(notificationId.getId()).add(listener);
+ }
+ }
+ }
+
+ /**
+ * This will add a listener for the specific type of message. As of now it will only allow
+ * a single listener per request function id
+ * @param messageId The message type that this listener is designated for
+ * @param listener The listener that will be called when a request of the provided type is received
+ */
+ @SuppressWarnings("unused")
+ public void addOnRPCListener(FunctionID messageId, OnRPCListener listener){
+ synchronized(RPC_LISTENER_LOCK){
+ if(messageId != null && listener != null){
+ if(rpcListeners.indexOfKey(messageId.getId()) < 0 ){
+ rpcListeners.put(messageId.getId(),new CopyOnWriteArrayList<OnRPCListener>());
+ }
+ rpcListeners.get(messageId.getId()).add(listener);
+ }
+ }
+ }
+
+ public boolean removeOnRPCListener(FunctionID messageId, OnRPCListener listener){
+ synchronized(RPC_LISTENER_LOCK){
+ if(rpcListeners!= null
+ && messageId != null
+ && listener != null
+ && rpcListeners.indexOfKey(messageId.getId()) >= 0){
+ return rpcListeners.get(messageId.getId()).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * This will add a listener for the specific type of request. As of now it will only allow
+ * a single listener per request function id
+ * @param requestId The request type that this listener is designated for
+ * @param listener The listener that will be called when a request of the provided type is received
+ */
+ @SuppressWarnings("unused")
+ public void addOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ if(requestId != null && listener != null){
+ if(rpcRequestListeners.indexOfKey(requestId.getId()) < 0 ){
+ rpcRequestListeners.put(requestId.getId(),new CopyOnWriteArrayList<OnRPCRequestListener>());
+ }
+ rpcRequestListeners.get(requestId.getId()).add(listener);
+ }
+ }
+ }
+
+ /**
+ * This method is no longer valid and will not remove the listener for the supplied notificaiton id
+ * @param notificationId n/a
+ * @see #removeOnRPCNotificationListener(FunctionID, OnRPCNotificationListener)
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public void removeOnRPCNotificationListener(FunctionID notificationId){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ //rpcNotificationListeners.delete(notificationId.getId());
+ }
+ }
+
+ public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ if(rpcNotificationListeners!= null
+ && notificationId != null
+ && listener != null
+ && rpcNotificationListeners.indexOfKey(notificationId.getId()) >= 0){
+ return rpcNotificationListeners.get(notificationId.getId()).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ public boolean removeOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ if(rpcRequestListeners!= null
+ && requestId != null
+ && listener != null
+ && rpcRequestListeners.indexOfKey(requestId.getId()) >= 0){
+ return rpcRequestListeners.get(requestId.getId()).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ private void processRaiResponse(RegisterAppInterfaceResponse rai)
+ {
+ if (rai == null) return;
+
+ this.raiResponse = rai;
+
+ VehicleType vt = rai.getVehicleType();
+ if (vt == null) return;
+
+ String make = vt.getMake();
+ if (make == null) return;
+
+ if (_secList == null) return;
+
+ 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
+ {
+ sec = cls.newInstance();
+ }
+ catch (Exception e)
+ {
+ continue;
+ }
+
+ if ( (sec != null) && (sec.getMakeList() != null) )
+ {
+ if (sec.getMakeList().contains(make))
+ {
+ setSdlSecurity(sec);
+ sec.setAppId(_appID);
+ if (sdlSession != null)
+ sec.handleSdlSession(sdlSession);
+ return;
+ }
+ }
+ }
+ }
+
+ private void handleRPCMessage(Hashtable<String, Object> hash) {
+
+ if (hash == null){
+ DebugTool.logError("handleRPCMessage: hash is null, returning.");
+ return;
+ }
+
+ RPCMessage rpcMsg = RpcConverter.convertTableToRpc(hash);
+
+ if (rpcMsg == null){
+ DebugTool.logError("handleRPCMessage: rpcMsg is null, returning.");
+ return;
+ }
+
+ SdlTrace.logRPCEvent(InterfaceActivityDirection.Receive, rpcMsg, SDL_LIB_TRACE_KEY);
+
+ String functionName = rpcMsg.getFunctionName();
+ String messageType = rpcMsg.getMessageType();
+
+ rpcMsg.format(rpcSpecVersion, true);
+
+ onRPCReceived(rpcMsg); // Should only be called for internal use
+
+ // Requests need to be listened for using the SDLManager's addOnRPCRequestListener method.
+ // Requests are not supported by IProxyListenerBase
+ if (messageType.equals(RPCMessage.KEY_REQUEST)) {
+
+ onRPCRequestReceived((RPCRequest) rpcMsg);
+
+ } else if (messageType.equals(RPCMessage.KEY_RESPONSE)) {
+ // Check to ensure response is not from an internal message (reserved correlation ID)
+ if (isCorrelationIDProtected((new RPCResponse(hash)).getCorrelationID())) {
+ // This is a response generated from an internal message, it can be trapped here
+ // The app should not receive a response for a request it did not send
+ if ((new RPCResponse(hash)).getCorrelationID() == REGISTER_APP_INTERFACE_CORRELATION_ID
+ && _advancedLifecycleManagementEnabled
+ && functionName.equals(FunctionID.REGISTER_APP_INTERFACE.toString())) {
+ final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (msg.getSuccess()) {
+ _appInterfaceRegisterd = true;
+ }
+ processRaiResponse(msg);
+
+ //Populate the system capability manager with the RAI response
+ _systemCapabilityManager.parseRAIResponse(msg);
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.REGISTER_APP_INTERFACE.toString());
+ updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
+ updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
+ updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
+ updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
+ updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
+ updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
+ sendBroadcastIntent(sendIntent);
+
+ //_autoActivateIdReturned = msg.getAutoActivateID();
+ /*Place holder for legacy support*/ _autoActivateIdReturned = "8675309";
+ _prerecordedSpeech = msg.getPrerecordedSpeech();
+ _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;
+ }
+
+ if (minimumRPCVersion != null && minimumRPCVersion.isNewerThan(rpcSpecVersion) == 1){
+ Log.w(TAG, String.format("Disconnecting from head unit, the configured minimum RPC version %s is greater than the supported RPC version %s", minimumRPCVersion, rpcSpecVersion));
+ try {
+ unregisterAppInterfacePrivate(UNREGISTER_APP_INTERFACE_CORRELATION_ID);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ try {
+ cleanProxy(SdlDisconnectedReason.MINIMUM_RPC_VERSION_HIGHER_THAN_SUPPORTED);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ return;
+ }
+
+ _vehicleType = msg.getVehicleType();
+ _systemSoftwareVersion = msg.getSystemSoftwareVersion();
+ _proxyVersionInfo = BuildConfig.VERSION_NAME;
+ _iconResumed = msg.getIconResumed();
+
+ if (_iconResumed == null){
+ _iconResumed = false;
+ }
+
+ if (_bAppResumeEnabled)
+ {
+ if ( (_sdlMsgVersion.getMajorVersion() > 2) && (_lastHashID != null) && (msg.getSuccess()) && (msg.getResultCode() != Result.RESUME_FAILED) )
+ _bResumeSuccess = true;
+ else
+ {
+ _bResumeSuccess = false;
+ _lastHashID = null;
+ }
+ }
+ _diagModes = msg.getSupportedDiagModes();
+
+ String sVersionInfo = "SDL Proxy Version: " + _proxyVersionInfo;
+
+ if (!isDebugEnabled())
+ {
+ enableDebugTool();
+ DebugTool.logInfo(sVersionInfo, false);
+ disableDebugTool();
+ }
+ else
+ DebugTool.logInfo(sVersionInfo, false);
+
+ sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "RAI_RESPONSE");
+ updateBroadcastIntent(sendIntent, "COMMENT1", sVersionInfo);
+ sendBroadcastIntent(sendIntent);
+
+ // Send onSdlConnected message in ALM
+ _sdlConnectionState = SdlConnectionState.SDL_CONNECTED;
+
+ // If registerAppInterface failed, exit with OnProxyUnusable
+ if (!msg.getSuccess()) {
+ notifyProxyClosed("Unable to register app interface. Review values passed to the SdlProxy constructor. RegisterAppInterface result code: ",
+ new SdlException("Unable to register app interface. Review values passed to the SdlProxy constructor. RegisterAppInterface result code: " + msg.getResultCode(), SdlExceptionCause.SDL_REGISTRATION_ERROR), SdlDisconnectedReason.SDL_REGISTRATION_ERROR);
+ }
+
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ if (_proxyListener instanceof IProxyListener) {
+ ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
+ }
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ if (_proxyListener instanceof IProxyListener) {
+ ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
+ }
+ onRPCResponseReceived(msg);
+ }
+ } else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID
+ && functionName.equals(FunctionID.ON_ENCODED_SYNC_P_DATA.toString())) {
+
+ Log.i("pt", "POLICIES_CORRELATION_ID SystemRequest Notification (Legacy)");
+
+ final OnSystemRequest msg = new OnSystemRequest(hash);
+
+ // If url is not null, then send to URL
+ if ( (msg.getUrl() != null) )
+ {
+ // URL has data, attempt to post request to external server
+ Thread handleOffboardTransmissionThread = new Thread() {
+ @Override
+ public void run() {
+ sendOnSystemRequestToUrl(msg);
+ }
+ };
+
+ handleOffboardTransmissionThread.start();
+ }
+ }
+ else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID
+ && functionName.equals(FunctionID.ENCODED_SYNC_P_DATA.toString())) {
+
+ Log.i("pt", "POLICIES_CORRELATION_ID SystemRequest Response (Legacy)");
+ final SystemRequestResponse msg = new SystemRequestResponse(hash);
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.SYSTEM_REQUEST.toString());
+ updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
+ updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
+ updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
+ updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
+ updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
+ sendBroadcastIntent(sendIntent);
+ }
+ else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID
+ && functionName.equals(FunctionID.SYSTEM_REQUEST.toString())) {
+ final SystemRequestResponse msg = new SystemRequestResponse(hash);
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.SYSTEM_REQUEST.toString());
+ updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
+ updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
+ updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
+ updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
+ updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
+ updateBroadcastIntent(sendIntent, "DATA", serializeJSON(msg));
+ sendBroadcastIntent(sendIntent);
+ }
+ else if (functionName.equals(FunctionID.UNREGISTER_APP_INTERFACE.toString())) {
+ // UnregisterAppInterface
+ _appInterfaceRegisterd = false;
+ synchronized(APP_INTERFACE_REGISTERED_LOCK) {
+ 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);
+ updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
+ updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
+ updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
+ updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
+ updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
+ sendBroadcastIntent(sendIntent);
+ }
+ return;
+ }
+
+ if (functionName.equals(FunctionID.REGISTER_APP_INTERFACE.toString())) {
+ final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (msg.getSuccess()) {
+ _appInterfaceRegisterd = true;
+ }
+ processRaiResponse(msg);
+ //Populate the system capability manager with the RAI response
+ _systemCapabilityManager.parseRAIResponse(msg);
+
+ //_autoActivateIdReturned = msg.getAutoActivateID();
+ /*Place holder for legacy support*/ _autoActivateIdReturned = "8675309";
+ _prerecordedSpeech = msg.getPrerecordedSpeech();
+ _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 = BuildConfig.VERSION_NAME;
+
+ if (_bAppResumeEnabled)
+ {
+ if ( (_sdlMsgVersion.getMajorVersion() > 2) && (_lastHashID != null) && (msg.getSuccess()) && (msg.getResultCode() != Result.RESUME_FAILED) )
+ _bResumeSuccess = true;
+ else
+ {
+ _bResumeSuccess = false;
+ _lastHashID = null;
+ }
+ }
+
+ _diagModes = msg.getSupportedDiagModes();
+
+ if (!isDebugEnabled())
+ {
+ enableDebugTool();
+ DebugTool.logInfo("SDL Proxy Version: " + _proxyVersionInfo);
+ disableDebugTool();
+ }
+ else
+ DebugTool.logInfo("SDL Proxy Version: " + _proxyVersionInfo);
+
+ // RegisterAppInterface
+ if (_advancedLifecycleManagementEnabled) {
+
+ // Send onSdlConnected message in ALM
+ _sdlConnectionState = SdlConnectionState.SDL_CONNECTED;
+
+ // If registerAppInterface failed, exit with OnProxyUnusable
+ if (!msg.getSuccess()) {
+ notifyProxyClosed("Unable to register app interface. Review values passed to the SdlProxy constructor. RegisterAppInterface result code: ",
+ new SdlException("Unable to register app interface. Review values passed to the SdlProxy constructor. RegisterAppInterface result code: " + msg.getResultCode(), SdlExceptionCause.SDL_REGISTRATION_ERROR), SdlDisconnectedReason.SDL_REGISTRATION_ERROR);
+ }
+ } else {
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ if (_proxyListener instanceof IProxyListener) {
+ ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
+ }
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ if (_proxyListener instanceof IProxyListener) {
+ ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
+ }
+ onRPCResponseReceived(msg);
+ }
+ }
+ } else if (functionName.equals(FunctionID.SPEAK.toString())) {
+ // SpeakResponse
+
+ final SpeakResponse msg = new SpeakResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onSpeakResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSpeakResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ALERT.toString())) {
+ // AlertResponse
+
+ final AlertResponse msg = new AlertResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onAlertResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onAlertResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.SHOW.toString())) {
+ // ShowResponse
+
+ final ShowResponse msg = new ShowResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onShowResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onShowResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ADD_COMMAND.toString())) {
+ // AddCommand
+
+ final AddCommandResponse msg = new AddCommandResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onAddCommandResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onAddCommandResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.DELETE_COMMAND.toString())) {
+ // DeleteCommandResponse
+
+ final DeleteCommandResponse msg = new DeleteCommandResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onDeleteCommandResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onDeleteCommandResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ADD_SUB_MENU.toString())) {
+ // AddSubMenu
+
+ final AddSubMenuResponse msg = new AddSubMenuResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onAddSubMenuResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onAddSubMenuResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.DELETE_SUB_MENU.toString())) {
+ // DeleteSubMenu
+
+ final DeleteSubMenuResponse msg = new DeleteSubMenuResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onDeleteSubMenuResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onDeleteSubMenuResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.SUBSCRIBE_BUTTON.toString())) {
+ // SubscribeButton
+
+ final SubscribeButtonResponse msg = new SubscribeButtonResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onSubscribeButtonResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSubscribeButtonResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.UNSUBSCRIBE_BUTTON.toString())) {
+ // UnsubscribeButton
+
+ final UnsubscribeButtonResponse msg = new UnsubscribeButtonResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onUnsubscribeButtonResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onUnsubscribeButtonResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.SET_MEDIA_CLOCK_TIMER.toString())) {
+ // SetMediaClockTimer
+
+ final SetMediaClockTimerResponse msg = new SetMediaClockTimerResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onSetMediaClockTimerResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSetMediaClockTimerResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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);
+ updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
+ updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
+ updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
+ updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
+ sendBroadcastIntent(sendIntent);
+
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onSystemRequestResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSystemRequestResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.CREATE_INTERACTION_CHOICE_SET.toString())) {
+ // CreateInteractionChoiceSet
+
+ final CreateInteractionChoiceSetResponse msg = new CreateInteractionChoiceSetResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onCreateInteractionChoiceSetResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onCreateInteractionChoiceSetResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.DELETE_INTERACTION_CHOICE_SET.toString())) {
+ // DeleteInteractionChoiceSet
+
+ final DeleteInteractionChoiceSetResponse msg = new DeleteInteractionChoiceSetResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onDeleteInteractionChoiceSetResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onDeleteInteractionChoiceSetResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.PERFORM_INTERACTION.toString())) {
+ // PerformInteraction
+
+ final PerformInteractionResponse msg = new PerformInteractionResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onPerformInteractionResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onPerformInteractionResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.SET_GLOBAL_PROPERTIES.toString())) {
+ // SetGlobalPropertiesResponse
+
+ final SetGlobalPropertiesResponse msg = new SetGlobalPropertiesResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onSetGlobalPropertiesResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSetGlobalPropertiesResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.RESET_GLOBAL_PROPERTIES.toString())) {
+ // ResetGlobalProperties
+
+ final ResetGlobalPropertiesResponse msg = new ResetGlobalPropertiesResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onResetGlobalPropertiesResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onResetGlobalPropertiesResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.UNREGISTER_APP_INTERFACE.toString())) {
+ // UnregisterAppInterface
+
+ _appInterfaceRegisterd = false;
+ synchronized(APP_INTERFACE_REGISTERED_LOCK) {
+ 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);
+ updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
+ updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
+ updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
+ updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
+ updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
+ sendBroadcastIntent(sendIntent);
+
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ if (_proxyListener instanceof IProxyListener) {
+ ((IProxyListener)_proxyListener).onUnregisterAppInterfaceResponse(msg);
+ }
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ if (_proxyListener instanceof IProxyListener) {
+ ((IProxyListener)_proxyListener).onUnregisterAppInterfaceResponse(msg);
+ }
+ onRPCResponseReceived(msg);
+ }
+
+ notifyProxyClosed("UnregisterAppInterfaceResponse", null, SdlDisconnectedReason.APP_INTERFACE_UNREG);
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onGenericResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGenericResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onSliderResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSliderResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onPutFileResponse(msg);
+ onRPCResponseReceived(msg);
+ notifyPutFileStreamResponse(msg);
+ }
+ });
+ } else {
+ _proxyListener.onPutFileResponse(msg);
+ onRPCResponseReceived(msg);
+ notifyPutFileStreamResponse(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onDeleteFileResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onDeleteFileResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onListFilesResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onListFilesResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onSetAppIconResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSetAppIconResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onScrollableMessageResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onScrollableMessageResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onChangeRegistrationResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onChangeRegistrationResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.SET_DISPLAY_LAYOUT.toString())) {
+ // SetDisplayLayout
+ final SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse(hash);
+ msg.format(rpcSpecVersion,true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onSetDisplayLayoutResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSetDisplayLayoutResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onPerformAudioPassThruResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onPerformAudioPassThruResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onEndAudioPassThruResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onEndAudioPassThruResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onSubscribeVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSubscribeVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onUnsubscribeVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onUnsubscribeVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onGetVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGetVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onSubscribeWayPointsResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSubscribeWayPointsResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onUnsubscribeWayPointsResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onUnsubscribeWayPointsResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onGetWayPointsResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGetWayPointsResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onReadDIDResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onReadDIDResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onGetDTCsResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGetDTCsResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onDiagnosticMessageResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onDiagnosticMessageResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ }
+ 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() {
+ @Override
+ public void run() {
+ _proxyListener.onSystemRequestResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSystemRequestResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ }
+ 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() {
+ @Override
+ public void run() {
+ _proxyListener.onSendLocationResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSendLocationResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ }
+ 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() {
+ @Override
+ public void run() {
+ _proxyListener.onDialNumberResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onDialNumberResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ }
+ 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
+ public void run() {
+ _proxyListener.onShowConstantTbtResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onShowConstantTbtResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ }
+ 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
+ public void run() {
+ _proxyListener.onAlertManeuverResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onAlertManeuverResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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
+ public void run() {
+ _proxyListener.onUpdateTurnListResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onUpdateTurnListResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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
+ public void run() {
+ _proxyListener.onSetInteriorVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSetInteriorVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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
+ public void run() {
+ _proxyListener.onGetInteriorVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGetInteriorVehicleDataResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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
+ public void run() {
+ _proxyListener.onGetSystemCapabilityResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGetSystemCapabilityResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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
+ public void run() {
+ _proxyListener.onButtonPressResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onButtonPressResponse(msg);
+ onRPCResponseReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onSendHapticDataResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSendHapticDataResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.SET_CLOUD_APP_PROPERTIES.toString())) {
+ final SetCloudAppPropertiesResponse msg = new SetCloudAppPropertiesResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onSetCloudAppProperties(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onSetCloudAppProperties(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.GET_CLOUD_APP_PROPERTIES.toString())) {
+ final GetCloudAppPropertiesResponse msg = new GetCloudAppPropertiesResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onGetCloudAppProperties(msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGetCloudAppProperties(msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.PUBLISH_APP_SERVICE.toString())) {
+ final PublishAppServiceResponse msg = new PublishAppServiceResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onPublishAppServiceResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onPublishAppServiceResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.GET_APP_SERVICE_DATA.toString())) {
+ final GetAppServiceDataResponse msg = new GetAppServiceDataResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onGetAppServiceDataResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGetAppServiceDataResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.GET_FILE.toString())) {
+ final GetFileResponse msg = new GetFileResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onGetFileResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onGetFileResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.PERFORM_APP_SERVICES_INTERACTION.toString())) {
+ final PerformAppServiceInteractionResponse msg = new PerformAppServiceInteractionResponse(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onPerformAppServiceInteractionResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onPerformAppServiceInteractionResponse( msg);
+ onRPCResponseReceived(msg);
+ }
+ } else {
+ if (_sdlMsgVersion != null) {
+ DebugTool.logError("Unrecognized response Message: " + functionName +
+ " SDL Message Version = " + _sdlMsgVersion);
+ } else {
+ DebugTool.logError("Unrecognized response Message: " + functionName);
+ }
+ } // end-if
+
+ } else if (messageType.equals(RPCMessage.KEY_NOTIFICATION)) {
+ if (functionName.equals(FunctionID.ON_HMI_STATUS.toString())) {
+ // OnHMIStatus
+
+ final OnHMIStatus msg = new OnHMIStatus(hash);
+
+ //setup lockscreeninfo
+ if (sdlSession != null)
+ {
+ sdlSession.getLockScreenMan().setHMILevel(msg.getHmiLevel());
+ }
+
+ msg.setFirstRun(firstTimeFull);
+ if (msg.getHmiLevel() == HMILevel.HMI_FULL) firstTimeFull = false;
+
+ _hmiLevel = msg.getHmiLevel();
+ _audioStreamingState = msg.getAudioStreamingState();
+
+ msg.format(rpcSpecVersion, true);
+ lastHmiStatus = msg;
+
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnHMIStatus(msg);
+ _proxyListener.onOnLockScreenNotification(sdlSession.getLockScreenMan().getLockObj());
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnHMIStatus(msg);
+ _proxyListener.onOnLockScreenNotification(sdlSession.getLockScreenMan().getLockObj());
+ onRPCNotificationReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ON_COMMAND.toString())) {
+ // OnCommand
+
+ final OnCommand msg = new OnCommand(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnCommand(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnCommand(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ON_DRIVER_DISTRACTION.toString())) {
+ // OnDriverDistration
+
+ final OnDriverDistraction msg = new OnDriverDistraction(hash);
+
+ //setup lockscreeninfo
+ if (sdlSession != null)
+ {
+ DriverDistractionState drDist = msg.getState();
+ sdlSession.getLockScreenMan().setDriverDistStatus(drDist == DriverDistractionState.DD_ON);
+ }
+
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnDriverDistraction(msg);
+ _proxyListener.onOnLockScreenNotification(sdlSession.getLockScreenMan().getLockObj());
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnDriverDistraction(msg);
+ _proxyListener.onOnLockScreenNotification(sdlSession.getLockScreenMan().getLockObj());
+ onRPCNotificationReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ON_ENCODED_SYNC_P_DATA.toString())) {
+
+ final OnSystemRequest msg = new OnSystemRequest(hash);
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.ON_SYSTEM_REQUEST.toString());
+ updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_NOTIFICATION);
+
+ // 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);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnSystemRequest(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnSystemRequest(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } else {
+ updateBroadcastIntent(sendIntent, "COMMENT1", "Sending to cloud: " + msg.getUrl());
+ sendBroadcastIntent(sendIntent);
+
+ Log.i("pt", "send to url");
+
+ if ( (msg.getUrl() != null) )
+ {
+ Thread handleOffboardTransmissionThread = new Thread() {
+ @Override
+ public void run() {
+ sendOnSystemRequestToUrl(msg);
+ }
+ };
+
+ handleOffboardTransmissionThread.start();
+ }
+ }
+ } else if (functionName.equals(FunctionID.ON_PERMISSIONS_CHANGE.toString())) {
+ //OnPermissionsChange
+
+ final OnPermissionsChange msg = new OnPermissionsChange(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnPermissionsChange(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnPermissionsChange(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ON_TBT_CLIENT_STATE.toString())) {
+ // OnTBTClientState
+
+ final OnTBTClientState msg = new OnTBTClientState(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnTBTClientState(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnTBTClientState(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ON_BUTTON_PRESS.toString())) {
+ // OnButtonPress
+
+ final OnButtonPress msg = new OnButtonPress(hash);
+ msg.format(rpcSpecVersion, true);
+ final OnButtonPress onButtonPressCompat = (OnButtonPress)handleButtonNotificationFormatting(msg);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnButtonPress(msg);
+ onRPCNotificationReceived(msg);
+ if(onButtonPressCompat != null){
+ onRPCNotificationReceived(onButtonPressCompat);
+ _proxyListener.onOnButtonPress(onButtonPressCompat);
+ }
+ }
+ });
+ } else {
+ _proxyListener.onOnButtonPress(msg);
+ onRPCNotificationReceived(msg);
+ if(onButtonPressCompat != null){
+ onRPCNotificationReceived(onButtonPressCompat);
+ _proxyListener.onOnButtonPress(onButtonPressCompat);
+ }
+ }
+ } else if (functionName.equals(FunctionID.ON_BUTTON_EVENT.toString())) {
+ // OnButtonEvent
+
+ final OnButtonEvent msg = new OnButtonEvent(hash);
+ msg.format(rpcSpecVersion, true);
+ final OnButtonEvent onButtonEventCompat = (OnButtonEvent)handleButtonNotificationFormatting(msg);
+
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnButtonEvent(msg);
+ onRPCNotificationReceived(msg);
+ if(onButtonEventCompat != null){
+ onRPCNotificationReceived(onButtonEventCompat);
+ _proxyListener.onOnButtonEvent(onButtonEventCompat);
+ }
+ }
+ });
+ } else {
+ _proxyListener.onOnButtonEvent(msg);
+ onRPCNotificationReceived(msg);
+ if(onButtonEventCompat != null){
+ onRPCNotificationReceived(onButtonEventCompat);
+ _proxyListener.onOnButtonEvent(onButtonEventCompat);
+ }
+ }
+ } else if (functionName.equals(FunctionID.ON_LANGUAGE_CHANGE.toString())) {
+ // OnLanguageChange
+
+ final OnLanguageChange msg = new OnLanguageChange(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnLanguageChange(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnLanguageChange(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ON_HASH_CHANGE.toString())) {
+ // OnLanguageChange
+
+ final OnHashChange msg = new OnHashChange(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnHashChange(msg);
+ onRPCNotificationReceived(msg);
+ if (_bAppResumeEnabled)
+ {
+ _lastHashID = msg.getHashID();
+ }
+ }
+ });
+ } else {
+ _proxyListener.onOnHashChange(msg);
+ onRPCNotificationReceived(msg);
+ if (_bAppResumeEnabled)
+ {
+ _lastHashID = msg.getHashID();
+ }
+ }
+ } else if (functionName.equals(FunctionID.ON_SYSTEM_REQUEST.toString())) {
+ // OnSystemRequest
+
+ final OnSystemRequest msg = new OnSystemRequest(hash);
+ msg.format(rpcSpecVersion,true);
+ RequestType requestType = msg.getRequestType();
+ if(msg.getUrl() != null) {
+ if (((requestType == RequestType.PROPRIETARY) && (msg.getFileType() == FileType.JSON))
+ || ((requestType == RequestType.HTTP) && (msg.getFileType() == FileType.BINARY))) {
+ Thread handleOffboardTransmissionThread = new Thread() {
+ @Override
+ public void run() {
+ sendOnSystemRequestToUrl(msg);
+ }
+ };
+
+ handleOffboardTransmissionThread.start();
+ } else if (requestType == RequestType.LOCK_SCREEN_ICON_URL) {
+ //Cache this for when the lockscreen is displayed
+ lockScreenIconRequest = msg;
+ } else if (requestType == RequestType.ICON_URL) {
+ //Download the icon file and send SystemRequest RPC
+ Thread handleOffBoardTransmissionThread = new Thread() {
+ @Override
+ public void run() {
+ byte[] file = FileUtls.downloadFile(msg.getUrl());
+ if (file != null) {
+ SystemRequest systemRequest = new SystemRequest();
+ systemRequest.setFileName(msg.getUrl());
+ systemRequest.setBulkData(file);
+ systemRequest.setRequestType(RequestType.ICON_URL);
+ try {
+ sendRPCMessagePrivate(systemRequest);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+ } else {
+ DebugTool.logError("File was null at: " + msg.getUrl());
+ }
+ }
+ };
+ handleOffBoardTransmissionThread.start();
+ }
+ }
+
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnSystemRequest(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnSystemRequest(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onOnAudioPassThru(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnAudioPassThru(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } 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() {
+ @Override
+ public void run() {
+ _proxyListener.onOnVehicleData(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnVehicleData(msg);
+ onRPCNotificationReceived(msg);
+ }
+ }
+ else if (functionName.equals(FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString())) {
+ // OnAppInterfaceUnregistered
+
+ _appInterfaceRegisterd = false;
+ synchronized(APP_INTERFACE_REGISTERED_LOCK) {
+ APP_INTERFACE_REGISTERED_LOCK.notify();
+ }
+
+ final OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered(hash);
+ msg.format(rpcSpecVersion,true);
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString());
+ updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_NOTIFICATION);
+ updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
+ sendBroadcastIntent(sendIntent);
+
+ if (_advancedLifecycleManagementEnabled) {
+ // This requires the proxy to be cycled
+ cycleProxy(SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(msg.getReason()));
+ } else {
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ ((IProxyListener)_proxyListener).onOnAppInterfaceUnregistered(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ ((IProxyListener)_proxyListener).onOnAppInterfaceUnregistered(msg);
+ onRPCNotificationReceived(msg);
+ }
+ notifyProxyClosed("OnAppInterfaceUnregistered", null, SdlDisconnectedReason.APP_INTERFACE_UNREG);
+ }
+ }
+ 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() {
+ @Override
+ public void run() {
+ _proxyListener.onOnKeyboardInput(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnKeyboardInput(msg);
+ onRPCNotificationReceived(msg);
+ }
+ }
+ 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() {
+ @Override
+ public void run() {
+ _proxyListener.onOnTouchEvent(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnTouchEvent(msg);
+ onRPCNotificationReceived(msg);
+ }
+ }
+ 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() {
+ @Override
+ public void run() {
+ _proxyListener.onOnWayPointChange(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnWayPointChange(msg);
+ onRPCNotificationReceived(msg);
+ }
+ }
+ 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() {
+ @Override
+ public void run() {
+ _proxyListener.onOnInteriorVehicleData(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnInteriorVehicleData(msg);
+ onRPCNotificationReceived(msg);
+ }
+ }
+ 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() {
+ @Override
+ public void run() {
+ _proxyListener.onOnRCStatus(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnRCStatus(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ON_APP_SERVICE_DATA.toString())) {
+ final OnAppServiceData msg = new OnAppServiceData(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnAppServiceData(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnAppServiceData(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } else if (functionName.equals(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.toString())) {
+ final OnSystemCapabilityUpdated msg = new OnSystemCapabilityUpdated(hash);
+ msg.format(rpcSpecVersion, true);
+ if (_callbackToUIThread) {
+ // Run in UI thread
+ _mainUIHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ _proxyListener.onOnSystemCapabilityUpdated(msg);
+ onRPCNotificationReceived(msg);
+ }
+ });
+ } else {
+ _proxyListener.onOnSystemCapabilityUpdated(msg);
+ onRPCNotificationReceived(msg);
+ }
+ } else {
+ if (_sdlMsgVersion != null) {
+ DebugTool.logInfo("Unrecognized notification Message: " + functionName +
+ " connected to SDL using message version: " + _sdlMsgVersion.getMajorVersion() + "." + _sdlMsgVersion.getMinorVersion());
+ } else {
+ DebugTool.logInfo("Unrecognized notification Message: " + functionName);
+ }
+ } // end-if
+ } // end-if notification
+
+ SdlTrace.logProxyEvent("Proxy received RPC Message: " + functionName, SDL_LIB_TRACE_KEY);
+ }
+
+ //FIXME
+ /**
+ * Temporary method to bridge the new PLAY_PAUSE and OKAY button functionality with the old
+ * OK button name. This should be removed during the next major release
+ * @param notification
+ */
+ private RPCNotification handleButtonNotificationFormatting(RPCNotification notification){
+ if(FunctionID.ON_BUTTON_EVENT.toString().equals(notification.getFunctionName())
+ || FunctionID.ON_BUTTON_PRESS.toString().equals(notification.getFunctionName())){
+
+ ButtonName buttonName = (ButtonName)notification.getObject(ButtonName.class, OnButtonEvent.KEY_BUTTON_NAME);
+ ButtonName compatBtnName = null;
+
+ if(rpcSpecVersion != null && rpcSpecVersion.getMajor() >= 5){
+ if(ButtonName.PLAY_PAUSE.equals(buttonName)){
+ compatBtnName = ButtonName.OK;
+ }
+ }else{ // rpc spec version is either null or less than 5
+ if(ButtonName.OK.equals(buttonName)){
+ compatBtnName = ButtonName.PLAY_PAUSE;
+ }
+ }
+
+ try {
+ if (compatBtnName != null) { //There is a button name that needs to be swapped out
+ RPCNotification notification2;
+ //The following is done because there is currently no way to make a deep copy
+ //of an RPC. Since this code will be removed, it's ugliness is borderline acceptable.
+ if (notification instanceof OnButtonEvent) {
+ OnButtonEvent onButtonEvent = new OnButtonEvent();
+ onButtonEvent.setButtonEventMode(((OnButtonEvent) notification).getButtonEventMode());
+ onButtonEvent.setCustomButtonID(((OnButtonEvent) notification).getCustomButtonID());
+ notification2 = onButtonEvent;
+ } else if (notification instanceof OnButtonPress) {
+ OnButtonPress onButtonPress = new OnButtonPress();
+ onButtonPress.setButtonPressMode(((OnButtonPress) notification).getButtonPressMode());
+ onButtonPress.setCustomButtonName(((OnButtonPress) notification).getCustomButtonName());
+ notification2 = onButtonPress;
+ } else {
+ return null;
+ }
+
+ notification2.setParameters(OnButtonEvent.KEY_BUTTON_NAME, compatBtnName);
+ return notification2;
+ }
+ }catch (Exception e){
+ //Should never get here
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get SDL Message Version
+ * @return SdlMsgVersion
+ * @throws SdlException
+ */
+ public SdlMsgVersion getSdlMsgVersion() throws SdlException{
+ return _sdlMsgVersion;
+ }
+
+ /**
+ * Takes a list of RPCMessages and sends it to SDL in a synchronous fashion. Responses are captured through callback on OnMultipleRequestListener.
+ * For sending requests asynchronously, use sendRequests <br>
+ *
+ * <strong>NOTE: This will override any listeners on individual RPCs</strong>
+ *
+ * @param rpcs is the list of RPCMessages being sent
+ * @param listener listener for updates and completions
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void sendSequentialRequests(final List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener) throws SdlException {
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ SdlTrace.logProxyEvent("Application called sendSequentialRequests", SDL_LIB_TRACE_KEY);
+
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+ if (!getIsConnected()) {
+ SdlTrace.logProxyEvent("Application attempted to call sendSequentialRequests without a connected transport.", SDL_LIB_TRACE_KEY);
+ throw new SdlException("There is no valid connection to SDL. sendSequentialRequests cannot be called until SDL has been connected.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ }
+
+ if (rpcs == null){
+ //Log error here
+ throw new SdlException("You must send some RPCs", SdlExceptionCause.INVALID_ARGUMENT);
+ }
+
+ int requestCount = rpcs.size();
+
+ // Break out of recursion, we have finished the requests
+ if (requestCount == 0) {
+ if(listener != null){
+ listener.onFinished();
+ }
+ return;
+ }
+
+ RPCMessage rpc = rpcs.remove(0);
+
+ // Request Specifics
+ if (rpc.getMessageType().equals(RPCMessage.KEY_REQUEST)) {
+ RPCRequest request = (RPCRequest) rpc;
+ request.setCorrelationID(CorrelationIdGenerator.generateId());
+
+ request.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ if (response.getSuccess()) {
+ // success
+ if (listener != null) {
+ listener.onUpdate(rpcs.size());
+ }
+ try {
+ // recurse after successful response of RPC
+ sendSequentialRequests(rpcs, listener);
+ } catch (SdlException e) {
+ e.printStackTrace();
+ if (listener != null) {
+ listener.onError(correlationId, Result.GENERIC_ERROR, e.toString());
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ if (listener != null) {
+ listener.onError(correlationId, resultCode, info);
+ }
+ }
+ });
+ sendRPCMessagePrivate(request);
+ } else {
+ // Notifications and Responses
+ sendRPCMessagePrivate(rpc);
+ }
+
+
+ }
+
+ /**
+ * Takes a list of RPCMessages and sends it to SDL. Responses are captured through callback on OnMultipleRequestListener.
+ * For sending requests synchronously, use sendSequentialRequests <br>
+ *
+ * <strong>NOTE: This will override any listeners on individual RPCs</strong>
+ *
+ * @param rpcs is the list of RPCMessages being sent
+ * @param listener listener for updates and completions
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void sendRequests(List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener) throws SdlException {
+
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ SdlTrace.logProxyEvent("Application called sendRequests", SDL_LIB_TRACE_KEY);
+
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+ if (!getIsConnected()) {
+ SdlTrace.logProxyEvent("Application attempted to call sendRequests without a connected transport.", SDL_LIB_TRACE_KEY);
+ throw new SdlException("There is no valid connection to SDL. sendRequests cannot be called until SDL has been connected.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ }
+
+ if (rpcs == null){
+ //Log error here
+ throw new SdlException("You must send some RPCs, the array is null", SdlExceptionCause.INVALID_ARGUMENT);
+ }
+
+ int arraySize = rpcs.size();
+
+ if (arraySize == 0) {
+ throw new SdlException("You must send some RPCs, the array is empty", SdlExceptionCause.INVALID_ARGUMENT);
+ }
+
+ for (int i = 0; i < arraySize; i++) {
+ RPCMessage rpc = rpcs.get(i);
+ // Request Specifics
+ if (rpc.getMessageType().equals(RPCMessage.KEY_REQUEST)) {
+ RPCRequest request = (RPCRequest) rpc;
+ request.setCorrelationID(CorrelationIdGenerator.generateId());
+ if (listener != null) {
+ listener.addCorrelationId(request.getCorrelationID());
+ request.setOnRPCResponseListener(listener.getSingleRpcResponseListener());
+ }
+ sendRPCMessagePrivate(request);
+ }else {
+ // Notifications and Responses
+ sendRPCMessagePrivate(rpc);
+ }
+ }
+ }
+
+ public void sendRPC(RPCMessage message) throws SdlException {
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test if request is null
+ if (message == null) {
+ SdlTrace.logProxyEvent("Application called sendRPCRequest method with a null RPCRequest.", SDL_LIB_TRACE_KEY);
+ throw new IllegalArgumentException("sendRPCRequest cannot be called with a null request.");
+ }
+
+ SdlTrace.logProxyEvent("Application called sendRPCRequest method for RPCRequest: ." + message.getFunctionName(), SDL_LIB_TRACE_KEY);
+
+ // Test if SdlConnection is null
+ synchronized(CONNECTION_REFERENCE_LOCK) {
+ if (!getIsConnected()) {
+ SdlTrace.logProxyEvent("Application attempted to send and RPCRequest without a connected transport.", SDL_LIB_TRACE_KEY);
+ throw new SdlException("There is no valid connection to SDL. sendRPCRequest cannot be called until SDL has been connected.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ }
+
+ // Test for illegal correlation ID
+ if (message.getMessageType().equals(RPCMessage.KEY_REQUEST)) {
+ RPCRequest request = (RPCRequest) message;
+ if (isCorrelationIDProtected(request.getCorrelationID())) {
+
+ SdlTrace.logProxyEvent("Application attempted to use the reserved correlation ID, " + request.getCorrelationID(), SDL_LIB_TRACE_KEY);
+ throw new SdlException("Invalid correlation ID. The correlation ID, " + request.getCorrelationID()
+ + " , is a reserved correlation ID.", SdlExceptionCause.RESERVED_CORRELATION_ID);
+ }
+ }
+ // Throw exception if RPCRequest is sent when SDL is unavailable
+ if (!_appInterfaceRegisterd && !message.getFunctionName().equals(FunctionID.REGISTER_APP_INTERFACE.toString())) {
+
+ SdlTrace.logProxyEvent("Application attempted to send an RPCRequest (non-registerAppInterface), before the interface was registerd.", SDL_LIB_TRACE_KEY);
+ throw new SdlException("SDL is currently unavailable. RPC Requests cannot be sent.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+
+ if (_advancedLifecycleManagementEnabled) {
+ if (message.getFunctionName().equals(FunctionID.REGISTER_APP_INTERFACE.toString())
+ || message.getFunctionName().equals(FunctionID.UNREGISTER_APP_INTERFACE.toString())) {
+
+ SdlTrace.logProxyEvent("Application attempted to send a RegisterAppInterface or UnregisterAppInterface while using ALM.", SDL_LIB_TRACE_KEY);
+ throw new SdlException("The RPCRequest, " + message.getFunctionName() +
+ ", is un-allowed using the Advanced Lifecycle Management Model.", SdlExceptionCause.INCORRECT_LIFECYCLE_MODEL);
+ }
+ }
+
+ sendRPCMessagePrivate(message);
+ }
+
+ /**
+ * Takes an RPCRequest and sends it to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param request is the RPCRequest being sent
+ * @throws SdlException if an unrecoverable error is encountered
+ * @deprecated - use sendRPC instead
+ */
+ @Deprecated
+ public void sendRPCRequest(RPCRequest request) throws SdlException {
+ sendRPC(request);
+ }
+
+ protected void notifyProxyClosed(final String info, final Exception e, final SdlDisconnectedReason reason) {
+ SdlTrace.logProxyEvent("NotifyProxyClose", SDL_LIB_TRACE_KEY);
+ Log.d(TAG, "notifyProxyClosed: " + info);
+ OnProxyClosed message = new OnProxyClosed(info, e, reason);
+ queueInternalMessage(message);
+ }
+
+ private void passErrorToProxyListener(final String info, final Exception e) {
+
+ OnError message = new OnError(info, e);
+ queueInternalMessage(message);
+ }
+
+ private void startRPCProtocolSession() {
+
+ // Set Proxy Lifecyclek Available
+ if (_advancedLifecycleManagementEnabled) {
+
+ try {
+ registerAppInterfacePrivate(
+ _sdlMsgVersionRequest,
+ _applicationName,
+ _ttsName,
+ _ngnMediaScreenAppName,
+ _vrSynonyms,
+ _isMediaApp,
+ _sdlLanguageDesired,
+ _hmiDisplayLanguageDesired,
+ _appType,
+ _appID,
+ _dayColorScheme,
+ _nightColorScheme,
+ REGISTER_APP_INTERFACE_CORRELATION_ID);
+
+ } catch (Exception e) {
+ notifyProxyClosed("Failed to register application interface with SDL. Check parameter values given to SdlProxy constructor.", e, SdlDisconnectedReason.SDL_REGISTRATION_ERROR);
+ }
+ } else {
+ InternalProxyMessage message = new InternalProxyMessage(InternalProxyMessage.OnProxyOpened);
+ queueInternalMessage(message);
+ }
+ }
+
+ // Queue internal callback message
+ private void queueInternalMessage(InternalProxyMessage message) {
+ synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
+ if (_internalProxyMessageDispatcher != null) {
+ _internalProxyMessageDispatcher.queueMessage(message);
+ }
+ }
+ }
+
+ // Queue incoming ProtocolMessage
+ private void queueIncomingMessage(ProtocolMessage message) {
+ synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
+ if (_incomingProxyMessageDispatcher != null) {
+ _incomingProxyMessageDispatcher.queueMessage(message);
+ }
+ }
+ }
+
+ private FileInputStream getFileInputStream(String sLocalFile)
+ {
+ FileInputStream is = null;
+ try
+ {
+ is = new FileInputStream(sLocalFile);
+ }
+ catch (IOException e1)
+ {
+ e1.printStackTrace();
+ }
+ return is;
+ }
+
+ private Long getFileInputStreamSize(FileInputStream is)
+ {
+ Long lSize = null;
+
+ try
+ {
+ lSize = is.getChannel().size();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ return lSize;
+ }
+
+ private void closeFileInputStream(FileInputStream is)
+ {
+ try
+ {
+ is.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private RPCStreamController startRPCStream(String sLocalFile, PutFile request, SessionType sType, byte rpcSessionID, Version protocolVersion)
+ {
+ if (sdlSession == null) return null;
+
+ FileInputStream is = getFileInputStream(sLocalFile);
+ if (is == null) return null;
+
+ Long lSize = getFileInputStreamSize(is);
+ if (lSize == null)
+ {
+ closeFileInputStream(is);
+ return null;
+ }
+
+ try {
+ StreamRPCPacketizer rpcPacketizer = new StreamRPCPacketizer((SdlProxyBase<IProxyListenerBase>) this, sdlSession, is, request, sType, rpcSessionID, protocolVersion, rpcSpecVersion, lSize, sdlSession);
+ rpcPacketizer.start();
+ return new RPCStreamController(rpcPacketizer, request.getCorrelationID());
+ } catch (Exception e) {
+ Log.e("SyncConnection", "Unable to start streaming:" + e.toString());
+ return null;
+ }
+ }
+
+ @SuppressWarnings({"unchecked", "UnusedReturnValue"})
+ private RPCStreamController startRPCStream(InputStream is, PutFile request, SessionType sType, byte rpcSessionID, Version protocolVersion)
+ {
+ if (sdlSession == null) return null;
+ Long lSize = request.getLength();
+
+ if (lSize == null)
+ {
+ return null;
+ }
+
+ try {
+ StreamRPCPacketizer rpcPacketizer = new StreamRPCPacketizer((SdlProxyBase<IProxyListenerBase>) this, sdlSession, is, request, sType, rpcSessionID, protocolVersion, rpcSpecVersion, lSize, sdlSession);
+ rpcPacketizer.start();
+ return new RPCStreamController(rpcPacketizer, request.getCorrelationID());
+ } catch (Exception e) {
+ Log.e("SyncConnection", "Unable to start streaming:" + e.toString());
+ return null;
+ }
+ }
+
+ private RPCStreamController startPutFileStream(String sPath, PutFile msg) {
+ if (sdlSession == null) return null;
+ return startRPCStream(sPath, msg, SessionType.RPC, sdlSession.getSessionId(), protocolVersion);
+ }
+
+ private RPCStreamController startPutFileStream(InputStream is, PutFile msg) {
+ if (sdlSession == null) return null;
+ if (is == null) return null;
+ return startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), protocolVersion);
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ public boolean startRPCStream(InputStream is, RPCRequest msg) {
+ if (sdlSession == null) return false;
+ sdlSession.startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), (byte)getProtocolVersion().getMajor());
+ return true;
+ }
+
+ public OutputStream startRPCStream(RPCRequest msg) {
+ if (sdlSession == null) return null;
+ return sdlSession.startRPCStream(msg, SessionType.RPC, sdlSession.getSessionId(), (byte)getProtocolVersion().getMajor());
+ }
+
+ public void endRPCStream() {
+ if (sdlSession == null) return;
+ sdlSession.stopRPCStream();
+ }
+
+ private class CallableMethod implements Callable<Void> {
+
+ private final long waitTime;
+
+ public CallableMethod(int timeInMillis){
+ this.waitTime=timeInMillis;
+ }
+ @Override
+ public Void call() {
+ try {
+ Thread.sleep(waitTime);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+ }
+
+ public FutureTask<Void> createFutureTask(CallableMethod callMethod){
+ return new FutureTask<Void>(callMethod);
+ }
+
+ public ScheduledExecutorService createScheduler(){
+ return Executors.newSingleThreadScheduledExecutor();
+ }
+
+ @SuppressWarnings("unused")
+ public void startService(SessionType serviceType, boolean isEncrypted){
+ sdlSession.startService(serviceType, sdlSession.getSessionId(), isEncrypted);
+ }
+
+ @SuppressWarnings("unused")
+ public void endService(SessionType serviceType){
+ sdlSession.endService(serviceType, sdlSession.getSessionId());
+ }
+
+
+
+ /**
+ * @deprecated
+ *Opens the video service (serviceType 11) and subsequently streams raw H264 video from an InputStream provided by the app
+ *@return true if service is opened successfully and stream is started, return false otherwise
+ * @see #startRemoteDisplayStream(Context, Class, VideoStreamingParameters, boolean) startRemoteDisplayStream
+ * @see #startVideoStream(boolean, VideoStreamingParameters) startVideoStream
+ * @see #createOpenGLInputSurface(int, int, int, int, int, boolean) createOpenGLInputSurface
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public boolean startH264(InputStream is, boolean isEncrypted) {
+
+ if (sdlSession == null) return false;
+
+ navServiceStartResponseReceived = false;
+ navServiceStartResponse = false;
+ navServiceStartRejectedParams = null;
+
+ // When startH264() API is used, we will not send video format / width / height information
+ // with StartService. (Reasons: InputStream does not provide timestamp information so RTP
+ // cannot be used. startH264() does not provide with/height information.)
+ VideoStreamingParameters emptyParam = new VideoStreamingParameters();
+ emptyParam.setResolution(null);
+ emptyParam.setFormat(null);
+ sdlSession.setDesiredVideoParams(emptyParam);
+
+ sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!navServiceStartResponseReceived && !fTask.isDone());
+ scheduler.shutdown();
+
+ if (navServiceStartResponse) {
+ try {
+ sdlSession.startStream(is, SessionType.NAV, sdlSession.getSessionId());
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @deprecated
+ *Opens the video service (serviceType 11) and subsequently provides an OutputStream to the app to use for a raw H264 video stream
+ *@return OutputStream if service is opened successfully and stream is started, return null otherwise
+ * @see #startRemoteDisplayStream(Context, Class, VideoStreamingParameters, boolean) startRemoteDisplayStream
+ * @see #startVideoStream(boolean, VideoStreamingParameters) startVideoStream
+ * @see #createOpenGLInputSurface(int, int, int, int, int, boolean) createOpenGLInputSurface
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public OutputStream startH264(boolean isEncrypted) {
+
+ if (sdlSession == null) return null;
+
+ navServiceStartResponseReceived = false;
+ navServiceStartResponse = false;
+ navServiceStartRejectedParams = null;
+
+ // When startH264() API is used, we will not send video format / width / height information
+ // with StartService. (Reasons: OutputStream does not provide timestamp information so RTP
+ // cannot be used. startH264() does not provide with/height information.)
+ VideoStreamingParameters emptyParam = new VideoStreamingParameters();
+ emptyParam.setResolution(null);
+ emptyParam.setFormat(null);
+ sdlSession.setDesiredVideoParams(emptyParam);
+
+ sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!navServiceStartResponseReceived && !fTask.isDone());
+ scheduler.shutdown();
+
+ if (navServiceStartResponse) {
+ try {
+ return sdlSession.startStream(SessionType.NAV, sdlSession.getSessionId());
+ } catch (Exception e) {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ *Closes the opened video service (serviceType 11)
+ *@return true if the video service is closed successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public boolean endH264() {
+ return endVideoStream();
+ }
+ /**
+ *Pauses the stream for the opened audio service (serviceType 10)
+ *@return true if the audio service stream is paused successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public boolean pausePCM() {
+ return pauseAudioStream();
+ }
+
+ /**
+ *Pauses the stream for the opened video service (serviceType 11)
+ *@return true if the video service stream is paused successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public boolean pauseH264() {
+ return pauseVideoStream();
+ }
+
+ /**
+ *Resumes the stream for the opened audio service (serviceType 10)
+ *@return true if the audio service stream is resumed successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public boolean resumePCM() {
+ return resumeAudioStream();
+ }
+
+ /**
+ *Resumes the stream for the opened video service (serviceType 11)
+ *@return true if the video service is resumed successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public boolean resumeH264() {
+ return resumeVideoStream();
+ }
+
+
+ /**
+ *Opens the audio service (serviceType 10) and subsequently streams raw PCM audio from an InputStream provided by the app
+ *@return true if service is opened successfully and stream is started, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public boolean startPCM(InputStream is, boolean isEncrypted) {
+ if (sdlSession == null) return false;
+
+ pcmServiceStartResponseReceived = false;
+ pcmServiceStartResponse = false;
+ sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!pcmServiceStartResponseReceived && !fTask.isDone());
+ scheduler.shutdown();
+
+ if (pcmServiceStartResponse) {
+ try {
+ sdlSession.startStream(is, SessionType.PCM, sdlSession.getSessionId());
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ *Opens the audio service (serviceType 10) and subsequently provides an OutputStream to the app
+ *@return OutputStream if service is opened successfully and stream is started, return null otherwise
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public OutputStream startPCM(boolean isEncrypted) {
+ if (sdlSession == null) return null;
+
+ pcmServiceStartResponseReceived = false;
+ pcmServiceStartResponse = false;
+ sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!pcmServiceStartResponseReceived && !fTask.isDone());
+ scheduler.shutdown();
+
+ if (pcmServiceStartResponse) {
+ try {
+ return sdlSession.startStream(SessionType.PCM, sdlSession.getSessionId());
+ } catch (Exception e) {
+ return null;
+ }
+ } else {
+ if (pcmServiceStartRejectedParams != null) {
+ StringBuilder builder = new StringBuilder();
+ for (String paramName : pcmServiceStartRejectedParams) {
+ if (builder.length() > 0) {
+ builder.append(", ");
+ }
+ builder.append(paramName);
+ }
+ DebugTool.logWarning("StartService for nav failed. Rejected params: " + builder.toString());
+
+ } else {
+ DebugTool.logWarning("StartService for nav failed (rejected params not supplied)");
+ }
+ return null;
+ }
+ }
+
+ /**
+ *Closes the opened audio service (serviceType 10)
+ *@return true if the audio service is closed successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public boolean endPCM() {
+ return endAudioStream();
+ }
+
+ /**
+ * 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 parameters
+ * that will be used to negotiate
+ *
+ * <br><br><b>NOTE: IF USING SECONDARY TRANSPORTS, THE VIDEO SERVICE MUST BE STARTED BEFORE CALLING THIS
+ * THIS METHOD. USE A `ISdlServiceListener` TO BE NOTIFIED THAT IT STARTS THEN CALL THIS METHOD TO
+ * START STREAMING. ADD A LISTENER USE {@link #addServiceListener(SessionType, ISdlServiceListener)}.</b>
+ *
+ * @param isEncrypted Specify true if packets on this service have to be encrypted
+ * @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.
+ *
+ * @return IVideoStreamListener interface if service is opened successfully and streaming is
+ * started, null otherwise
+ *
+ * @see ISdlServiceListener
+ */
+ @SuppressWarnings("unused")
+ public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters) {
+ if (sdlSession == null) {
+ DebugTool.logWarning("SdlSession is not created yet.");
+ return null;
+ }
+ if (!sdlSession.getIsConnected()) {
+ DebugTool.logWarning("Connection is not available.");
+ return null;
+ }
+
+ sdlSession.setDesiredVideoParams(parameters);
+
+ VideoStreamingParameters acceptedParams = tryStartVideoStream(isEncrypted, parameters);
+ if (acceptedParams != null) {
+ return sdlSession.startVideoStream();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ *Closes the opened video service (serviceType 11)
+ *@return true if the video service is closed successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ public boolean endVideoStream() {
+ if (sdlSession == null){ return false; }
+
+ navServiceEndResponseReceived = false;
+ navServiceEndResponse = false;
+ sdlSession.stopVideoStream();
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!navServiceEndResponseReceived && !fTask.isDone());
+ scheduler.shutdown();
+
+ return navServiceEndResponse;
+ }
+
+ /**
+ *Pauses the stream for the opened video service (serviceType 11)
+ *@return true if the video service stream is paused successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ public boolean pauseVideoStream() {
+ return sdlSession != null && sdlSession.pauseVideoStream();
+ }
+
+ /**
+ *Resumes the stream for the opened video service (serviceType 11)
+ *@return true if the video service is resumed successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ public boolean resumeVideoStream() {
+ return sdlSession != null && sdlSession.resumeVideoStream();
+ }
+
+ /**
+ * Opens the video service (serviceType 11) and creates a Surface (used for streaming video) with input parameters provided by the app
+ * @param frameRate - specified rate of frames to utilize for creation of Surface
+ * @param iFrameInterval - specified interval to utilize for creation of Surface
+ * @param width - specified width to utilize for creation of Surface
+ * @param height - specified height to utilize for creation of Surface
+ * @param bitrate - specified bitrate to utilize for creation of Surface
+ *@return Surface if service is opened successfully and stream is started, return null otherwise
+ */
+ @SuppressWarnings("unused")
+ public Surface createOpenGLInputSurface(int frameRate, int iFrameInterval, int width,
+ int height, int bitrate, boolean isEncrypted) {
+
+ if (sdlSession == null || !sdlSession.getIsConnected()){
+ return null;
+ }
+
+ VideoStreamingParameters desired = new VideoStreamingParameters();
+ desired.setFrameRate(frameRate);
+ desired.setInterval(iFrameInterval);
+ ImageResolution resolution = new ImageResolution();
+ resolution.setResolutionWidth(width);
+ resolution.setResolutionHeight(height);
+ desired.setResolution(resolution);
+ desired.setBitrate(bitrate);
+
+ VideoStreamingParameters acceptedParams = tryStartVideoStream(isEncrypted, desired);
+ if (acceptedParams != null) {
+ return sdlSession.createOpenGLInputSurface(frameRate, iFrameInterval, width,
+ height, bitrate, SessionType.NAV, sdlSession.getSessionId());
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * 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 remoteDisplay 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.
+ */
+ @TargetApi(19)
+ public void startRemoteDisplayStream(Context context, final Class<? extends SdlRemoteDisplay> remoteDisplay, final VideoStreamingParameters parameters, final boolean encrypted){
+ if(protocolVersion!= null && protocolVersion.getMajor() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
+ Log.e(TAG, "Video streaming not supported on this module");
+ return;
+ }
+ //Create streaming manager
+ if(manager == null){
+ manager = new VideoStreamingManager(context,this._internalInterface);
+ }
+
+ if(parameters == null){
+ if(protocolVersion!= null && protocolVersion.getMajor() >= 5) {
+ _systemCapabilityManager.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
+ sdlSession.setDesiredVideoParams(params);
+ manager.startVideoStreaming(remoteDisplay, params, encrypted);
+ }
+
+ @Override
+ public void onError(String info) {
+ Log.e(TAG, "Error retrieving video streaming capability: " + info);
+
+ }
+ });
+ }else{
+ //We just use default video streaming params
+ VideoStreamingParameters params = new VideoStreamingParameters();
+ DisplayCapabilities dispCap = (DisplayCapabilities)_systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY);
+ if(dispCap !=null){
+ params.setResolution(dispCap.getScreenParams().getImageResolution());
+ }
+ sdlSession.setDesiredVideoParams(params);
+ manager.startVideoStreaming(remoteDisplay,params, encrypted);
+ }
+ }else{
+ sdlSession.setDesiredVideoParams(parameters);
+ manager.startVideoStreaming(remoteDisplay,parameters, encrypted);
+ }
+ }
+
+ /**
+ * Stops the remote display stream if one has been started
+ */
+ public void stopRemoteDisplayStream(){
+ if(manager!=null){
+ manager.dispose();
+ }
+ manager = null;
+ }
+
+ /**
+ * Try to open a video service by using the video streaming parameters supplied.
+ *
+ * Only information from codecs, width and height are used during video format negotiation.
+ *
+ * @param isEncrypted Specify true if packets on this service have to be encrypted
+ * @param parameters VideoStreamingParameters that are desired. Does not guarantee this is what will be accepted.
+ *
+ * @return If the service is opened successfully, an instance of VideoStreamingParams is
+ * returned which contains accepted video format. If the service is opened with legacy
+ * mode (i.e. without any negotiation) then an instance of VideoStreamingParams is
+ * returned. If the service was not opened then null is returned.
+ */
+ @SuppressWarnings("unused")
+ private VideoStreamingParameters tryStartVideoStream(boolean isEncrypted, VideoStreamingParameters parameters) {
+ if (sdlSession == null) {
+ DebugTool.logWarning("SdlSession is not created yet.");
+ return null;
+ }
+ if(protocolVersion!= null && protocolVersion.getMajor() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
+ DebugTool.logWarning("Module doesn't support video streaming.");
+ return null;
+ }
+ if (parameters == null) {
+ DebugTool.logWarning("Video parameters were not supplied.");
+ return null;
+ }
+
+ if(!navServiceStartResponseReceived || !navServiceStartResponse //If we haven't started the service before
+ || (navServiceStartResponse && isEncrypted && !sdlSession.isServiceProtected(SessionType.NAV))) { //Or the service has been started but we'd like to start an encrypted one
+ sdlSession.setDesiredVideoParams(parameters);
+
+ navServiceStartResponseReceived = false;
+ navServiceStartResponse = false;
+ navServiceStartRejectedParams = null;
+
+ sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!navServiceStartResponseReceived && !fTask.isDone()) ;
+ scheduler.shutdown();
+ }
+
+ if (navServiceStartResponse) {
+ if(protocolVersion!= null && protocolVersion.getMajor() < 5){ //Versions 1-4 do not support streaming parameter negotiations
+ sdlSession.setAcceptedVideoParams(parameters);
+ }
+ return sdlSession.getAcceptedVideoParams();
+ }
+
+ if (navServiceStartRejectedParams != null) {
+ StringBuilder builder = new StringBuilder();
+ for (String paramName : navServiceStartRejectedParams) {
+ if (builder.length() > 0) {
+ builder.append(", ");
+ }
+ builder.append(paramName);
+ }
+
+ DebugTool.logWarning("StartService for nav failed. Rejected params: " + builder.toString());
+
+ } else {
+ DebugTool.logWarning("StartService for nav failed (rejected params not supplied)");
+ }
+
+ return null;
+ }
+
+ /**
+ *Starts the MediaCodec encoder utilized in conjunction with the Surface returned via the createOpenGLInputSurface method
+ */
+ @SuppressWarnings("unused")
+ public void startEncoder () {
+ if (sdlSession == null || !sdlSession.getIsConnected()) return;
+
+ sdlSession.startEncoder();
+ }
+
+ /**
+ *Releases the MediaCodec encoder utilized in conjunction with the Surface returned via the createOpenGLInputSurface method
+ */
+ @SuppressWarnings("unused")
+ public void releaseEncoder() {
+ if (sdlSession == null || !sdlSession.getIsConnected()) return;
+
+ sdlSession.releaseEncoder();
+ }
+
+ /**
+ *Releases the MediaCodec encoder utilized in conjunction with the Surface returned via the createOpenGLInputSurface method
+ */
+ @SuppressWarnings("unused")
+ public void drainEncoder(boolean endOfStream) {
+ if (sdlSession == null || !sdlSession.getIsConnected()) return;
+
+ sdlSession.drainEncoder(endOfStream);
+ }
+
+ /**
+ * Opens a audio service (service type 10) and subsequently provides an IAudioStreamListener
+ * to the app to send audio data.
+ *
+ * Currently information passed by "params" are ignored, since Audio Streaming feature lacks
+ * capability negotiation mechanism. App should configure audio stream data to align with
+ * head unit's capability by checking (upcoming) pcmCapabilities. The default format is in
+ * 16kHz and 16 bits.
+ *
+ * @param isEncrypted Specify true if packets on this service have to be encrypted
+ * @param codec Audio codec which will be used for streaming. Currently, only
+ * AudioStreamingCodec.LPCM is accepted.
+ * @param params (Reserved for future use) Additional configuration information for each
+ * codec. If "codec" is AudioStreamingCodec.LPCM, "params" must be an
+ * instance of LPCMParams class.
+ *
+ * @return IAudioStreamListener interface if service is opened successfully and streaming is
+ * started, null otherwise
+ */
+ @SuppressWarnings("unused")
+ public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
+ AudioStreamingParams params) {
+ if (sdlSession == null) {
+ DebugTool.logWarning("SdlSession is not created yet.");
+ return null;
+ }
+ if (!sdlSession.getIsConnected()) {
+ DebugTool.logWarning("Connection is not available.");
+ return null;
+ }
+ if (codec != AudioStreamingCodec.LPCM) {
+ DebugTool.logWarning("Audio codec " + codec + " is not supported.");
+ return null;
+ }
+
+ pcmServiceStartResponseReceived = false;
+ pcmServiceStartResponse = false;
+ sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!pcmServiceStartResponseReceived && !fTask.isDone());
+ scheduler.shutdown();
+
+ if (pcmServiceStartResponse) {
+ DebugTool.logInfo("StartService for audio succeeded");
+ return sdlSession.startAudioStream();
+ } else {
+ if (pcmServiceStartRejectedParams != null) {
+ StringBuilder builder = new StringBuilder();
+ for (String paramName : pcmServiceStartRejectedParams) {
+ if (builder.length() > 0) {
+ builder.append(", ");
+ }
+ builder.append(paramName);
+ }
+ DebugTool.logWarning("StartService for audio failed. Rejected params: " + builder.toString());
+ } else {
+ DebugTool.logWarning("StartService for audio failed (rejected params not supplied)");
+ }
+ return null;
+ }
+ }
+
+ /**
+ *Closes the opened audio service (serviceType 10)
+ *@return true if the audio service is closed successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ public boolean endAudioStream() {
+ if (sdlSession == null || !sdlSession.getIsConnected()) return false;
+
+ pcmServiceEndResponseReceived = false;
+ pcmServiceEndResponse = false;
+ sdlSession.stopAudioStream();
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!pcmServiceEndResponseReceived && !fTask.isDone());
+ scheduler.shutdown();
+
+ return pcmServiceEndResponse;
+ }
+
+ /**
+ *Pauses the stream for the opened audio service (serviceType 10)
+ *@return true if the audio service stream is paused successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ public boolean pauseAudioStream() {
+ return sdlSession != null && sdlSession.pauseAudioStream();
+ }
+
+ /**
+ *Resumes the stream for the opened audio service (serviceType 10)
+ *@return true if the audio service stream is resumed successfully, return false otherwise
+ */
+ @SuppressWarnings("unused")
+ public boolean resumeAudioStream() {
+ return sdlSession != null && sdlSession.resumeAudioStream();
+ }
+
+ private void NavServiceStarted() {
+ navServiceStartResponseReceived = true;
+ navServiceStartResponse = true;
+ }
+
+ private void NavServiceStartedNACK(List<String> rejectedParams) {
+ navServiceStartResponseReceived = true;
+ navServiceStartResponse = false;
+ navServiceStartRejectedParams = rejectedParams;
+ }
+
+ private void AudioServiceStarted() {
+ pcmServiceStartResponseReceived = true;
+ pcmServiceStartResponse = true;
+ }
+
+ private void RPCProtectedServiceStarted() {
+ rpcProtectedResponseReceived = true;
+ rpcProtectedStartResponse = true;
+ }
+ private void AudioServiceStartedNACK(List<String> rejectedParams) {
+ pcmServiceStartResponseReceived = true;
+ pcmServiceStartResponse = false;
+ pcmServiceStartRejectedParams = rejectedParams;
+ }
+
+ private void NavServiceEnded() {
+ navServiceEndResponseReceived = true;
+ navServiceEndResponse = true;
+ }
+
+ private void NavServiceEndedNACK() {
+ navServiceEndResponseReceived = true;
+ navServiceEndResponse = false;
+ }
+
+ private void AudioServiceEnded() {
+ pcmServiceEndResponseReceived = true;
+ pcmServiceEndResponse = true;
+ }
+
+ private void AudioServiceEndedNACK() {
+ pcmServiceEndResponseReceived = true;
+ pcmServiceEndResponse = false;
+ }
+
+ public void setAppService(Service mService)
+ {
+ _appService = mService;
+ }
+
+ @SuppressWarnings("unused")
+ public boolean startProtectedRPCService() {
+ rpcProtectedResponseReceived = false;
+ rpcProtectedStartResponse = false;
+ sdlSession.startService(SessionType.RPC, sdlSession.getSessionId(), true);
+
+ FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
+ ScheduledExecutorService scheduler = createScheduler();
+ scheduler.execute(fTask);
+
+ //noinspection StatementWithEmptyBody
+ while (!rpcProtectedResponseReceived && !fTask.isDone());
+ scheduler.shutdown();
+
+ return rpcProtectedStartResponse;
+ }
+
+ @SuppressWarnings("unused")
+ public void getLockScreenIcon(final OnLockScreenIconDownloadedListener l){
+ if(lockScreenIconRequest == null){
+ l.onLockScreenIconDownloadError(new SdlException("This version of SDL core may not support lock screen icons.",
+ SdlExceptionCause.LOCK_SCREEN_ICON_NOT_SUPPORTED));
+ return;
+ }
+
+ LockScreenManager lockMan = sdlSession.getLockScreenMan();
+ Bitmap bitmap = lockMan.getLockScreenIcon();
+
+ // read bitmap if it was already downloaded so we don't have to download it every time
+ if(bitmap != null){
+ l.onLockScreenIconDownloaded(bitmap);
+ }
+ else{
+ String url = lockScreenIconRequest.getUrl();
+ sdlSession.getLockScreenMan().downloadLockScreenIcon(url, l);
+ }
+ }
+
+ /* ******************* Public Helper Methods *************************/
+
+ /*Begin V1 Enhanced helper*/
+
+ /**
+ *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param parentID -Menu parent ID for optional sub value containing menu parameters.
+ *@param position -Menu position for optional sub value containing menu parameters.
+ *@param vrCommands -VR synonyms for this AddCommand.
+ *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
+ *@param IconType -Describes whether the image is static or dynamic
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("SameParameterValue")
+ public void addCommand(@NonNull Integer commandID,
+ String menuText, Integer parentID, Integer position,
+ Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
+ throws SdlException {
+
+
+ AddCommand msg = new AddCommand(commandID);
+ msg.setCorrelationID(correlationID);
+
+ if (vrCommands != null) msg.setVrCommands(vrCommands);
+
+ Image cmdIcon = null;
+
+ if (IconValue != null && IconType != null)
+ {
+ cmdIcon = new Image();
+ cmdIcon.setValue(IconValue);
+ cmdIcon.setImageType(IconType);
+ }
+
+ if (cmdIcon != null) msg.setCmdIcon(cmdIcon);
+
+ if(menuText != null || parentID != null || position != null) {
+ MenuParams menuParams = new MenuParams();
+ menuParams.setMenuName(menuText);
+ menuParams.setPosition(position);
+ menuParams.setParentID(parentID);
+ msg.setMenuParams(menuParams);
+ }
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param position -Menu position for optional sub value containing menu parameters.
+ *@param vrCommands -VR synonyms for this AddCommand.
+ *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
+ *@param IconType -Describes whether the image is static or dynamic
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ String menuText, Integer position,
+ Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, menuText, null, position, vrCommands, IconValue, IconType, correlationID);
+ }
+
+ /**
+ *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param position -Menu position for optional sub value containing menu parameters.
+ *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
+ *@param IconType -Describes whether the image is static or dynamic
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ String menuText, Integer position, String IconValue, ImageType IconType,
+ Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, menuText, null, position, null, IconValue, IconType, correlationID);
+ }
+
+ /**
+ *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
+ *@param IconType -Describes whether the image is static or dynamic
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ String menuText, String IconValue, ImageType IconType, Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, menuText, null, null, null, IconValue, IconType, correlationID);
+ }
+
+ /**
+ * Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param commandID -Unique command ID of the command to add.
+ * @param menuText -Menu text for optional sub value containing menu parameters.
+ * @param vrCommands -VR synonyms for this AddCommand.
+ * @param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
+ * @param IconType -Describes whether the image is static or dynamic
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ String menuText, Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, menuText, null, null, vrCommands, IconValue, IconType, correlationID);
+ }
+
+ /**
+ * Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param commandID -Unique command ID of the command to add.
+ * @param vrCommands -VR synonyms for this AddCommand.
+ * @param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
+ * @param IconType -Describes whether the image is static or dynamic
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, null, null, null, vrCommands, IconValue, IconType, correlationID);
+ }
+
+ /*End V1 Enhanced helper*/
+
+ /**
+ *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param parentID -Menu parent ID for optional sub value containing menu parameters.
+ *@param position -Menu position for optional sub value containing menu parameters.
+ *@param vrCommands -VR synonyms for this AddCommand.
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("SameParameterValue")
+ public void addCommand(@NonNull Integer commandID,
+ String menuText, Integer parentID, Integer position,
+ Vector<String> vrCommands, Integer correlationID)
+ throws SdlException {
+
+ AddCommand msg = new AddCommand(commandID);
+ msg.setCorrelationID(correlationID);
+ msg.setVrCommands(vrCommands);
+ if(menuText != null || parentID != null || position != null) {
+ MenuParams menuParams = new MenuParams();
+ menuParams.setMenuName(menuText);
+ menuParams.setPosition(position);
+ menuParams.setParentID(parentID);
+ msg.setMenuParams(menuParams);
+ }
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param position -Menu position for optional sub value containing menu parameters.
+ *@param vrCommands -VR synonyms for this AddCommand.
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ String menuText, Integer position,
+ Vector<String> vrCommands, Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, menuText, null, position, vrCommands, correlationID);
+ }
+
+ /**
+ *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param position -Menu position for optional sub value containing menu parameters.
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ String menuText, Integer position,
+ Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, menuText, null, position, null, correlationID);
+ }
+
+ /**
+ *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ String menuText, Integer correlationID)
+ throws SdlException {
+ addCommand(commandID, menuText, null, null, (Vector<String>)null, correlationID);
+ }
+
+ /**
+ * Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param menuText -Menu text for optional sub value containing menu parameters.
+ *@param vrCommands -VR synonyms for this AddCommand.
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ String menuText, Vector<String> vrCommands, Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, menuText, null, null, vrCommands, correlationID);
+ }
+
+ /**
+ * Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ *@param commandID -Unique command ID of the command to add.
+ *@param vrCommands -VR synonyms for this AddCommand.
+ *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void addCommand(Integer commandID,
+ Vector<String> vrCommands, Integer correlationID)
+ throws SdlException {
+
+ addCommand(commandID, null, null, null, vrCommands, correlationID);
+ }
+
+ /**
+ * Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param menuID -Unique ID of the sub menu to add.
+ * @param menuName -Text to show in the menu for this sub menu.
+ * @param position -Position within the items that are are at top level of the in application menu.
+ * @param menuIcon -Image to be be shown along with the submenu item
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("SameParameterValue")
+ public void addSubMenu(@NonNull Integer menuID, @NonNull String menuName,
+ Integer position, Image menuIcon, Integer correlationID)
+ throws SdlException {
+
+ AddSubMenu msg = new AddSubMenu(menuID, menuName);
+ msg.setCorrelationID(correlationID);
+ msg.setPosition(position);
+ msg.setMenuIcon(menuIcon);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param menuID -Unique ID of the sub menu to add.
+ * @param menuName -Text to show in the menu for this sub menu.
+ * @param position -Position within the items that are are at top level of the in application menu.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @Deprecated
+ @SuppressWarnings("SameParameterValue")
+ public void addSubMenu(@NonNull Integer menuID, @NonNull String menuName,
+ Integer position, Integer correlationID)
+ throws SdlException {
+
+ addSubMenu(menuID, menuName, position, null, correlationID);
+ }
+
+ /**
+ * Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param menuID -Unique ID of the sub menu to add.
+ * @param menuName -Text to show in the menu for this sub menu.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @Deprecated
+ @SuppressWarnings("unused")
+ public void addSubMenu(Integer menuID, String menuName,
+ Integer correlationID) throws SdlException {
+
+ addSubMenu(menuID, menuName, null, null, correlationID);
+ }
+
+ /*Begin V1 Enhanced helper*/
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsText -The text to speech message in the form of a string.
+ * @param alertText1 -The first line of the alert text field.
+ * @param alertText2 -The second line of the alert text field.
+ * @param alertText3 -The optional third line of the alert text field.
+ * @param playTone -Defines if tone should be played.
+ * @param duration -Timeout in milliseconds.
+ * @param softButtons -A list of App defined SoftButtons.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("SameParameterValue")
+ public void alert(String ttsText, String alertText1,
+ String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons,
+ Integer correlationID) throws SdlException {
+
+ Vector<TTSChunk> chunks = TTSChunkFactory.createSimpleTTSChunks(ttsText);
+ Alert msg = new Alert();
+ msg.setCorrelationID(correlationID);
+ msg.setAlertText1(alertText1);
+ msg.setAlertText2(alertText2);
+ msg.setAlertText3(alertText3);
+ msg.setDuration(duration);
+ msg.setPlayTone(playTone);
+ msg.setTtsChunks(chunks);
+ msg.setSoftButtons(softButtons);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsChunks -Text/phonemes to speak in the form of ttsChunks.
+ * @param alertText1 -The first line of the alert text field.
+ * @param alertText2 -The second line of the alert text field.
+ * @param alertText3 -The optional third line of the alert text field.
+ * @param playTone -Defines if tone should be played.
+ * @param duration -Timeout in milliseconds.
+ * @param softButtons -A list of App defined SoftButtons.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ public void alert(Vector<TTSChunk> ttsChunks,
+ String alertText1, String alertText2, String alertText3, Boolean playTone,
+ Integer duration, Vector<SoftButton> softButtons, Integer correlationID) throws SdlException {
+
+ Alert msg = new Alert();
+ msg.setCorrelationID(correlationID);
+ msg.setAlertText1(alertText1);
+ msg.setAlertText2(alertText2);
+ msg.setAlertText3(alertText3);
+ msg.setDuration(duration);
+ msg.setPlayTone(playTone);
+ msg.setTtsChunks(ttsChunks);
+ msg.setSoftButtons(softButtons);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsText -The text to speech message in the form of a string.
+ * @param playTone -Defines if tone should be played.
+ * @param softButtons -A list of App defined SoftButtons.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void alert(String ttsText, Boolean playTone, Vector<SoftButton> softButtons,
+ Integer correlationID) throws SdlException {
+
+ alert(ttsText, null, null, null, playTone, null, softButtons, correlationID);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param chunks -A list of text/phonemes to speak in the form of ttsChunks.
+ * @param playTone -Defines if tone should be played.
+ * @param softButtons -A list of App defined SoftButtons.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void alert(Vector<TTSChunk> chunks, Boolean playTone, Vector<SoftButton> softButtons,
+ Integer correlationID) throws SdlException {
+
+ alert(chunks, null, null, null, playTone, null, softButtons, correlationID);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param alertText1 -The first line of the alert text field.
+ * @param alertText2 -The second line of the alert text field.
+ * @param alertText3 -The optional third line of the alert text field.
+ * @param playTone -Defines if tone should be played.
+ * @param duration -Timeout in milliseconds.
+ * @param softButtons -A list of App defined SoftButtons.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void alert(String alertText1, String alertText2, String alertText3,
+ Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID)
+ throws SdlException {
+
+ alert((Vector<TTSChunk>)null, alertText1, alertText2, alertText3, playTone, duration, softButtons, correlationID);
+ }
+
+ /*End V1 Enhanced helper*/
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsText -The text to speech message in the form of a string.
+ * @param alertText1 -The first line of the alert text field.
+ * @param alertText2 -The second line of the alert text field.
+ * @param playTone -Defines if tone should be played.
+ * @param duration -Timeout in milliseconds.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("SameParameterValue")
+ public void alert(String ttsText, String alertText1,
+ String alertText2, Boolean playTone, Integer duration,
+ Integer correlationID) throws SdlException {
+
+ Vector<TTSChunk> chunks = TTSChunkFactory.createSimpleTTSChunks(ttsText);
+ Alert msg = new Alert();
+ msg.setCorrelationID(correlationID);
+ msg.setAlertText1(alertText1);
+ msg.setAlertText2(alertText2);
+ msg.setDuration(duration);
+ msg.setPlayTone(playTone);
+ msg.setTtsChunks(chunks);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsChunks -A list of text/phonemes to speak in the form of ttsChunks.
+ * @param alertText1 -The first line of the alert text field.
+ * @param alertText2 -The second line of the alert text field.
+ * @param playTone -Defines if tone should be played.
+ * @param duration -Timeout in milliseconds.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ public void alert(Vector<TTSChunk> ttsChunks,
+ String alertText1, String alertText2, Boolean playTone,
+ Integer duration, Integer correlationID) throws SdlException {
+
+ Alert msg = new Alert();
+ msg.setCorrelationID(correlationID);
+ msg.setAlertText1(alertText1);
+ msg.setAlertText2(alertText2);
+ msg.setDuration(duration);
+ msg.setPlayTone(playTone);
+ msg.setTtsChunks(ttsChunks);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsText -The text to speech message in the form of a string.
+ * @param playTone -Defines if tone should be played.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void alert(String ttsText, Boolean playTone,
+ Integer correlationID) throws SdlException {
+
+ alert(ttsText, null, null, playTone, null, correlationID);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param chunks -A list of text/phonemes to speak in the form of ttsChunks.
+ * @param playTone -Defines if tone should be played.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void alert(Vector<TTSChunk> chunks, Boolean playTone,
+ Integer correlationID) throws SdlException {
+
+ alert(chunks, null, null, playTone, null, correlationID);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param alertText1 -The first line of the alert text field.
+ * @param alertText2 -The second line of the alert text field.
+ * @param playTone -Defines if tone should be played.
+ * @param duration -Timeout in milliseconds.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void alert(String alertText1, String alertText2,
+ Boolean playTone, Integer duration, Integer correlationID)
+ throws SdlException {
+
+ alert((Vector<TTSChunk>)null, alertText1, alertText2, playTone, duration, correlationID);
+ }
+
+ /**
+ * Sends a CreateInteractionChoiceSet RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param choiceSet to be sent to the module
+ * @param interactionChoiceSetID to be used in reference to the supplied choiceSet
+ * @param correlationID to be set to the RPCRequest
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void createInteractionChoiceSet(
+ @NonNull Vector<Choice> choiceSet, @NonNull Integer interactionChoiceSetID,
+ Integer correlationID) throws SdlException {
+
+ CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet(interactionChoiceSetID, choiceSet);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a DeleteCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param commandID -ID of the command(s) to delete.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void deleteCommand(@NonNull Integer commandID,
+ Integer correlationID) throws SdlException {
+
+ DeleteCommand msg = new DeleteCommand(commandID);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a DeleteInteractionChoiceSet RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param interactionChoiceSetID -ID of the interaction choice set to delete.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void deleteInteractionChoiceSet(
+ @NonNull Integer interactionChoiceSetID, Integer correlationID)
+ throws SdlException {
+
+ DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet(interactionChoiceSetID);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a DeleteSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param menuID -The menuID of the submenu to delete.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void deleteSubMenu(Integer menuID,
+ Integer correlationID) throws SdlException {
+
+ DeleteSubMenu msg = new DeleteSubMenu(menuID);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+
+
+ /*Begin V1 Enhanced helper*/
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
+ * @param displayText -Text to be displayed first.
+ * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.
+ * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performInteraction(String initPrompt,
+ @NonNull String displayText, @NonNull Integer interactionChoiceSetID, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) throws SdlException {
+
+ Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
+ interactionChoiceSetIDs.add(interactionChoiceSetID);
+ Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
+ PerformInteraction msg = new PerformInteraction(displayText, InteractionMode.BOTH, interactionChoiceSetIDs);
+ msg.setInitialPrompt(initChunks);
+ msg.setVrHelp(vrHelp);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
+ * @param displayText -Text to be displayed first.
+ * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.
+ * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.
+ * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.
+ * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
+ * @param timeout -Timeout in milliseconds.
+ * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performInteraction(String initPrompt,
+ @NonNull String displayText, @NonNull Integer interactionChoiceSetID,
+ String helpPrompt, String timeoutPrompt,
+ @NonNull InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) throws SdlException {
+
+ Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
+ interactionChoiceSetIDs.add(interactionChoiceSetID);
+ Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
+ Vector<TTSChunk> helpChunks = TTSChunkFactory.createSimpleTTSChunks(helpPrompt);
+ Vector<TTSChunk> timeoutChunks = TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt);
+ PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDs);
+ msg.setInitialPrompt(initChunks);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setTimeoutPrompt(timeoutChunks);
+ msg.setVrHelp(vrHelp);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
+ * @param displayText -Text to be displayed first.
+ * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.
+ * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.
+ * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.
+ * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
+ * @param timeout -Timeout in milliseconds.
+ * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performInteraction(String initPrompt,
+ @NonNull String displayText, @NonNull Vector<Integer> interactionChoiceSetIDList,
+ String helpPrompt, String timeoutPrompt,
+ @NonNull InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) throws SdlException {
+
+ Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
+ Vector<TTSChunk> helpChunks = TTSChunkFactory.createSimpleTTSChunks(helpPrompt);
+ Vector<TTSChunk> timeoutChunks = TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt);
+ PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDList);
+ msg.setInitialPrompt(initChunks);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setTimeoutPrompt(timeoutChunks);
+ msg.setVrHelp(vrHelp);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param initChunks -A list of text/phonemes to speak for the initial prompt in the form of ttsChunks.
+ * @param displayText -Text to be displayed first.
+ * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.
+ * @param helpChunks -A list of text/phonemes to speak for the help text that is spoken when a user speaks "help" during the interaction.
+ * @param timeoutChunks A list of text/phonems to speak for the timeout text that is spoken when a VR interaction times out.
+ * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
+ * @param timeout -Timeout in milliseconds.
+ * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performInteraction(
+ Vector<TTSChunk> initChunks, @NonNull String displayText,
+ @NonNull Vector<Integer> interactionChoiceSetIDList,
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ @NonNull InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) throws SdlException {
+
+ PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDList);
+ msg.setInitialPrompt(initChunks);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setTimeoutPrompt(timeoutChunks);
+ msg.setVrHelp(vrHelp);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /*End V1 Enhanced*/
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
+ * @param displayText -Text to be displayed first.
+ * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performInteraction(String initPrompt,
+ @NonNull String displayText, @NonNull Integer interactionChoiceSetID,
+ Integer correlationID) throws SdlException {
+
+ Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
+ interactionChoiceSetIDs.add(interactionChoiceSetID);
+ Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
+ PerformInteraction msg = new PerformInteraction(displayText, InteractionMode.BOTH, interactionChoiceSetIDs);
+ msg.setInitialPrompt(initChunks);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
+ * @param displayText -Text to be displayed first.
+ * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.
+ * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.
+ * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.
+ * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
+ * @param timeout -Timeout in milliseconds.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performInteraction(String initPrompt,
+ @NonNull String displayText, @NonNull Integer interactionChoiceSetID,
+ String helpPrompt, String timeoutPrompt,
+ @NonNull InteractionMode interactionMode, Integer timeout,
+ Integer correlationID) throws SdlException {
+
+ Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
+ interactionChoiceSetIDs.add(interactionChoiceSetID);
+ Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
+ Vector<TTSChunk> helpChunks = TTSChunkFactory.createSimpleTTSChunks(helpPrompt);
+ Vector<TTSChunk> timeoutChunks = TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt);
+ PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDs);
+ msg.setInitialPrompt(initChunks);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setTimeoutPrompt(timeoutChunks);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
+ * @param displayText -Text to be displayed first.
+ * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.
+ * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.
+ * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.
+ * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
+ * @param timeout -Timeout in milliseconds.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performInteraction(String initPrompt,
+ @NonNull String displayText, @NonNull Vector<Integer> interactionChoiceSetIDList,
+ String helpPrompt, String timeoutPrompt,
+ @NonNull InteractionMode interactionMode, Integer timeout,
+ Integer correlationID) throws SdlException {
+
+ Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
+ Vector<TTSChunk> helpChunks = TTSChunkFactory.createSimpleTTSChunks(helpPrompt);
+ Vector<TTSChunk> timeoutChunks = TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt);
+ PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDList);
+ msg.setInitialPrompt(initChunks);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setTimeoutPrompt(timeoutChunks);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param initChunks -A list of text/phonemes to speak for the initial prompt in the form of ttsChunks.
+ * @param displayText -Text to be displayed first.
+ * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.
+ * @param helpChunks -A list of text/phonemes to speak for the help text that is spoken when a user speaks "help" during the interaction.
+ * @param timeoutChunks A list of text/phonems to speak for the timeout text that is spoken when a VR interaction times out.
+ * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
+ * @param timeout -Timeout in milliseconds.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performInteraction(
+ Vector<TTSChunk> initChunks, @NonNull String displayText,
+ @NonNull Vector<Integer> interactionChoiceSetIDList,
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ @NonNull InteractionMode interactionMode, Integer timeout,
+ Integer correlationID) throws SdlException {
+
+ PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDList);
+ msg.setInitialPrompt(initChunks);
+ msg.setTimeout(timeout);
+ msg.setHelpPrompt(helpChunks);
+ msg.setTimeoutPrompt(timeoutChunks);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ // Protected registerAppInterface used to ensure only non-ALM applications call
+ // reqisterAppInterface
+ protected void registerAppInterfacePrivate(
+ @NonNull SdlMsgVersion sdlMsgVersion, @NonNull String appName, Vector<TTSChunk> ttsName,
+ String ngnMediaScreenAppName, Vector<String> vrSynonyms, @NonNull Boolean isMediaApp,
+ @NonNull Language languageDesired, @NonNull Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
+ @NonNull String appID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme, Integer correlationID)
+ throws SdlException {
+ String carrierName = null;
+ if(telephonyManager != null){
+ carrierName = telephonyManager.getNetworkOperatorName();
+ }
+
+ DeviceInfo deviceInfo = new DeviceInfo();
+ deviceInfo.setHardware(android.os.Build.MODEL);
+ deviceInfo.setOs(DeviceInfo.DEVICE_OS);
+ deviceInfo.setOsVersion(Build.VERSION.RELEASE);
+ deviceInfo.setCarrier(carrierName);
+
+ if (sdlMsgVersion == null) {
+ sdlMsgVersion = new SdlMsgVersion();
+ sdlMsgVersion.setMajorVersion(MAX_SUPPORTED_RPC_VERSION.getMajor());
+ sdlMsgVersion.setMinorVersion(MAX_SUPPORTED_RPC_VERSION.getMinor());
+ }
+ if (languageDesired == null) {
+ languageDesired = Language.EN_US;
+ }
+ if (hmiDisplayLanguageDesired == null) {
+ hmiDisplayLanguageDesired = Language.EN_US;
+ }
+
+ RegisterAppInterface msg = new RegisterAppInterface(sdlMsgVersion, appName, isMediaApp, languageDesired, hmiDisplayLanguageDesired, appID);
+
+ if (correlationID != null) {
+ msg.setCorrelationID(correlationID);
+ }
+
+ msg.setDeviceInfo(deviceInfo);
+
+ msg.setTtsName(ttsName);
+
+ if (ngnMediaScreenAppName == null) {
+ ngnMediaScreenAppName = appName;
+ }
+
+ msg.setNgnMediaScreenAppName(ngnMediaScreenAppName);
+
+ if (vrSynonyms == null) {
+ vrSynonyms = new Vector<String>();
+ vrSynonyms.add(appName);
+ }
+ msg.setVrSynonyms(vrSynonyms);
+
+ msg.setAppHMIType(appType);
+
+ msg.setDayColorScheme(dayColorScheme);
+ msg.setNightColorScheme(nightColorScheme);
+
+ if (_bAppResumeEnabled)
+ {
+ if (_lastHashID != null)
+ msg.setHashID(_lastHashID);
+ }
+
+ Intent sendIntent = createBroadcastIntent();
+ updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.REGISTER_APP_INTERFACE.toString());
+ updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_REQUEST);
+ updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
+ updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
+ sendBroadcastIntent(sendIntent);
+
+ sendRPCMessagePrivate(msg);
+ }
+
+ /*Begin V1 Enhanced helper function*/
+
+ /**
+ * Sends a SetGlobalProperties RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param helpPrompt that will be used for the VR screen
+ * @param timeoutPrompt string to be displayed after timeout
+ * @param vrHelpTitle string that may be displayed on VR prompt dialog
+ * @param vrHelp a list of VR synonyms that may be displayed to user
+ * @param correlationID to be attached to the request
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void setGlobalProperties(
+ String helpPrompt, String timeoutPrompt, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID)
+ throws SdlException {
+
+ SetGlobalProperties req = new SetGlobalProperties();
+ req.setCorrelationID(correlationID);
+ req.setHelpPrompt(TTSChunkFactory.createSimpleTTSChunks(helpPrompt));
+ req.setTimeoutPrompt(TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt));
+ req.setVrHelpTitle(vrHelpTitle);
+ req.setVrHelp(vrHelp);
+
+ sendRPCRequest(req);
+ }
+
+ /**
+ * Sends a SetGlobalProperties RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param helpChunks tts chunks that should be used when prompting the user
+ * @param timeoutChunks tts chunks that will be used when a timeout occurs
+ * @param vrHelpTitle string that may be displayed on VR prompt dialog
+ * @param vrHelp a list of VR synonyms that may be displayed to user
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void setGlobalProperties(
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, String vrHelpTitle, Vector<VrHelpItem> vrHelp,
+ Integer correlationID) throws SdlException {
+
+ SetGlobalProperties req = new SetGlobalProperties();
+ req.setCorrelationID(correlationID);
+ req.setHelpPrompt(helpChunks);
+ req.setTimeoutPrompt(timeoutChunks);
+ req.setVrHelpTitle(vrHelpTitle);
+ req.setVrHelp(vrHelp);
+
+ sendRPCRequest(req);
+ }
+
+ /*End V1 Enhanced helper function*/
+
+ /**
+ * Sends a SetGlobalProperties RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param helpPrompt that will be used for the VR screen
+ * @param timeoutPrompt string to be displayed after timeout
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void setGlobalProperties(
+ String helpPrompt, String timeoutPrompt, Integer correlationID)
+ throws SdlException {
+
+ SetGlobalProperties req = new SetGlobalProperties();
+ req.setCorrelationID(correlationID);
+ req.setHelpPrompt(TTSChunkFactory.createSimpleTTSChunks(helpPrompt));
+ req.setTimeoutPrompt(TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt));
+
+ sendRPCRequest(req);
+ }
+
+ /**
+ * Sends a SetGlobalProperties RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param helpChunks tts chunks that should be used when prompting the user
+ * @param timeoutChunks tts chunks that will be used when a timeout occurs
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void setGlobalProperties(
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ Integer correlationID) throws SdlException {
+
+ SetGlobalProperties req = new SetGlobalProperties();
+ req.setCorrelationID(correlationID);
+ req.setHelpPrompt(helpChunks);
+ req.setTimeoutPrompt(timeoutChunks);
+
+ sendRPCRequest(req);
+ }
+
+ @SuppressWarnings("unused")
+ public void resetGlobalProperties(Vector<GlobalProperty> properties,
+ Integer correlationID) throws SdlException {
+
+ ResetGlobalProperties req = new ResetGlobalProperties();
+
+ req.setCorrelationID(correlationID);
+ req.setProperties(properties);
+
+ sendRPCRequest(req);
+ }
+
+
+ /**
+ * Sends a SetMediaClockTimer RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param hours integer for hours
+ * @param minutes integer for minutes
+ * @param seconds integer for seconds
+ * @param updateMode mode in which the media clock timer should be updated
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void setMediaClockTimer(Integer hours,
+ Integer minutes, Integer seconds, @NonNull UpdateMode updateMode,
+ Integer correlationID) throws SdlException {
+
+ SetMediaClockTimer msg = new SetMediaClockTimer(updateMode);
+ if (hours != null || minutes != null || seconds != null) {
+ StartTime startTime = new StartTime(hours, minutes, seconds);
+ msg.setStartTime(startTime);
+ }
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Pauses the media clock. Responses are captured through callback on IProxyListener.
+ *
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void pauseMediaClockTimer(Integer correlationID)
+ throws SdlException {
+
+ SetMediaClockTimer msg = new SetMediaClockTimer(UpdateMode.PAUSE);
+ StartTime startTime = new StartTime(0, 0, 0);
+ msg.setStartTime(startTime);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Resumes the media clock. Responses are captured through callback on IProxyListener.
+ *
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void resumeMediaClockTimer(Integer correlationID)
+ throws SdlException {
+
+ SetMediaClockTimer msg = new SetMediaClockTimer(UpdateMode.RESUME);
+ StartTime startTime = new StartTime(0, 0, 0);
+ msg.setStartTime(startTime);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Clears the media clock. Responses are captured through callback on IProxyListener.
+ *
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void clearMediaClockTimer(Integer correlationID)
+ throws SdlException {
+
+ Show msg = new Show();
+ msg.setCorrelationID(correlationID);
+ msg.setMediaClock(" ");
+
+ sendRPCRequest(msg);
+ }
+
+ /*Begin V1 Enhanced helper*/
+ /**
+ * Sends a Show RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param mainText1 text displayed in a single or upper display line.
+ * @param mainText2 text displayed on the second display line.
+ * @param mainText3 text displayed on the second "page" first display line.
+ * @param mainText4 text displayed on the second "page" second display line.
+ * @param statusBar text is placed in the status bar area (Only valid for NAVIGATION apps)
+ * @param mediaClock text value for MediaClock field.
+ * @param mediaTrack text displayed in the track field.
+ * @param graphic image struct determining whether static or dynamic image to display in app.
+ * @param softButtons app defined SoftButtons.
+ * @param customPresets app labeled on-screen presets.
+ * @param alignment specifies how mainText1 and mainText2s texts should be aligned on display.
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("SameParameterValue")
+ public void show(String mainText1, String mainText2, String mainText3, String mainText4,
+ String statusBar, String mediaClock, String mediaTrack,
+ Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets,
+ TextAlignment alignment, Integer correlationID)
+ throws SdlException {
+
+ Show msg = new Show();
+ msg.setCorrelationID(correlationID);
+ msg.setMainField1(mainText1);
+ msg.setMainField2(mainText2);
+ msg.setStatusBar(statusBar);
+ msg.setMediaClock(mediaClock);
+ msg.setMediaTrack(mediaTrack);
+ msg.setAlignment(alignment);
+ msg.setMainField3(mainText3);
+ msg.setMainField4(mainText4);
+ msg.setGraphic(graphic);
+ msg.setSoftButtons(softButtons);
+ msg.setCustomPresets(customPresets);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a Show RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param mainText1 -Text displayed in a single or upper display line.
+ * @param mainText2 -Text displayed on the second display line.
+ * @param mainText3 -Text displayed on the second "page" first display line.
+ * @param mainText4 -Text displayed on the second "page" second display line.
+ * @param graphic -Image struct determining whether static or dynamic image to display in app.
+ * @param softButtons -App defined SoftButtons.
+ * @param customPresets -App labeled on-screen presets.
+ * @param alignment -Specifies how mainText1 and mainText2s texts should be aligned on display.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void show(String mainText1, String mainText2, String mainText3, String mainText4,
+ Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets,
+ TextAlignment alignment, Integer correlationID)
+ throws SdlException {
+
+ show(mainText1, mainText2, mainText3, mainText4, null, null, null, graphic, softButtons, customPresets, alignment, correlationID);
+ }
+ /*End V1 Enhanced helper*/
+
+ /**
+ * Sends a Show RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param mainText1 text displayed in a single or upper display line.
+ * @param mainText2 text displayed on the second display line.
+ * @param statusBar text is placed in the status bar area (Only valid for NAVIGATION apps)
+ * @param mediaClock text value for MediaClock field.
+ * @param mediaTrack text displayed in the track field.
+ * @param alignment specifies how mainText1 and mainText2s texts should be aligned on display.
+ * @param correlationID unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("SameParameterValue")
+ public void show(String mainText1, String mainText2,
+ String statusBar, String mediaClock, String mediaTrack,
+ TextAlignment alignment, Integer correlationID)
+ throws SdlException {
+
+ Show msg = new Show();
+ msg.setCorrelationID(correlationID);
+ msg.setMainField1(mainText1);
+ msg.setMainField2(mainText2);
+ msg.setStatusBar(statusBar);
+ msg.setMediaClock(mediaClock);
+ msg.setMediaTrack(mediaTrack);
+ msg.setAlignment(alignment);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a Show RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param mainText1 -Text displayed in a single or upper display line.
+ * @param mainText2 -Text displayed on the second display line.
+ * @param alignment -Specifies how mainText1 and mainText2s texts should be aligned on display.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void show(String mainText1, String mainText2,
+ TextAlignment alignment, Integer correlationID)
+ throws SdlException {
+
+ show(mainText1, mainText2, null, null, null, alignment, correlationID);
+ }
+
+ /**
+ * Sends a Speak RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsText -The text to speech message in the form of a string.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void speak(@NonNull String ttsText, Integer correlationID)
+ throws SdlException {
+
+ Speak msg = new Speak(TTSChunkFactory.createSimpleTTSChunks(ttsText));
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a Speak RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsChunks -Text/phonemes to speak in the form of ttsChunks.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void speak(@NonNull Vector<TTSChunk> ttsChunks,
+ Integer correlationID) throws SdlException {
+
+ Speak msg = new Speak(ttsChunks);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Sends a SubscribeButton RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param buttonName -Name of the button to subscribe.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void subscribeButton(@NonNull ButtonName buttonName,
+ Integer correlationID) throws SdlException {
+
+ SubscribeButton msg = new SubscribeButton(buttonName);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ // Protected unregisterAppInterface used to ensure no non-ALM app calls
+ // unregisterAppInterface.
+ protected void unregisterAppInterfacePrivate(Integer correlationID)
+ throws SdlException {
+
+ UnregisterAppInterface msg = new UnregisterAppInterface();
+ msg.setCorrelationID(correlationID);
+
+ Intent sendIntent = createBroadcastIntent();
+
+ updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.UNREGISTER_APP_INTERFACE.toString());
+ updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_REQUEST);
+ updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
+ updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
+ sendBroadcastIntent(sendIntent);
+
+ sendRPCMessagePrivate(msg);
+ }
+
+ /**
+ * Sends an UnsubscribeButton RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param buttonName -Name of the button to unsubscribe.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void unsubscribeButton(@NonNull ButtonName buttonName,
+ Integer correlationID) throws SdlException {
+
+ UnsubscribeButton msg = new UnsubscribeButton(buttonName);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Creates a choice to be added to a choiceset. Choice has both a voice and a visual menu component.
+ *
+ * @param choiceID -Unique ID used to identify this choice (returned in callback).
+ * @param choiceMenuName -Text name displayed for this choice.
+ * @param choiceVrCommands -Vector of vrCommands used to select this choice by voice. Must contain
+ * at least one non-empty element.
+ * @return Choice created.
+ */
+ @SuppressWarnings("unused")
+ public Choice createChoiceSetChoice(Integer choiceID, String choiceMenuName,
+ Vector<String> choiceVrCommands) {
+ Choice returnChoice = new Choice();
+
+ returnChoice.setChoiceID(choiceID);
+ returnChoice.setMenuName(choiceMenuName);
+ returnChoice.setVrCommands(choiceVrCommands);
+
+ return returnChoice;
+ }
+
+ /**
+ * Starts audio pass thru session. Responses are captured through callback on IProxyListener.
+ *
+ * @param initialPrompt -SDL will speak this prompt before opening the audio pass thru session.
+ * @param audioPassThruDisplayText1 -First line of text displayed during audio capture.
+ * @param audioPassThruDisplayText2 -Second line of text displayed during audio capture.
+ * @param samplingRate -Allowable values of 8 khz or 16 or 22 or 44 khz.
+ * @param maxDuration -The maximum duration of audio recording in milliseconds.
+ * @param bitsPerSample -Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.
+ * @param audioType -Specifies the type of audio data being requested.
+ * @param muteAudio -Defines if the current audio source should be muted during the APT session.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void performaudiopassthru(String initialPrompt, String audioPassThruDisplayText1, String audioPassThruDisplayText2,
+ @NonNull SamplingRate samplingRate, @NonNull Integer maxDuration, @NonNull BitsPerSample bitsPerSample,
+ @NonNull AudioType audioType, Boolean muteAudio, Integer correlationID) throws SdlException {
+ Vector<TTSChunk> chunks = TTSChunkFactory.createSimpleTTSChunks(initialPrompt);
+ PerformAudioPassThru msg = new PerformAudioPassThru(samplingRate, maxDuration, bitsPerSample, audioType);
+ msg.setCorrelationID(correlationID);
+ msg.setInitialPrompt(chunks);
+ msg.setAudioPassThruDisplayText1(audioPassThruDisplayText1);
+ msg.setAudioPassThruDisplayText2(audioPassThruDisplayText2);
+ msg.setMuteAudio(muteAudio);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Ends audio pass thru session. Responses are captured through callback on IProxyListener.
+ *
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void endaudiopassthru(Integer correlationID) throws SdlException
+ {
+ EndAudioPassThru msg = new EndAudioPassThru();
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Subscribes for specific published data items. The data will be only sent if it has changed.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param gps -Subscribes to GPS data.
+ * @param speed -Subscribes to vehicle speed data in kilometers per hour.
+ * @param rpm -Subscribes to number of revolutions per minute of the engine.
+ * @param fuelLevel -Subscribes to fuel level in the tank (percentage).
+ * @param fuelLevel_State -Subscribes to fuel level state.
+ * @param instantFuelConsumption -Subscribes to instantaneous fuel consumption in microlitres.
+ * @param externalTemperature -Subscribes to the external temperature in degrees celsius.
+ * @param prndl -Subscribes to PRNDL data that houses the selected gear.
+ * @param tirePressure -Subscribes to the TireStatus data containing status and pressure of tires.
+ * @param odometer -Subscribes to Odometer data in km.
+ * @param beltStatus -Subscribes to status of the seat belts.
+ * @param bodyInformation -Subscribes to body information including power modes.
+ * @param deviceStatus -Subscribes to device status including signal and battery strength.
+ * @param driverBraking -Subscribes to the status of the brake pedal.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public void subscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
+ boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID) throws SdlException
+ {
+ SubscribeVehicleData msg = new SubscribeVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+
+ /**
+ * Subscribes for specific published data items. The data will be only sent if it has changed.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param gps -Subscribes to GPS data.
+ * @param speed -Subscribes to vehicle speed data in kilometers per hour.
+ * @param rpm -Subscribes to number of revolutions per minute of the engine.
+ * @param fuelLevel -Subscribes to fuel level in the tank (percentage).
+ * @param fuelLevel_State -Subscribes to fuel level state.
+ * @param instantFuelConsumption -Subscribes to instantaneous fuel consumption in microlitres.
+ * @param externalTemperature -Subscribes to the external temperature in degrees celsius.
+ * @param prndl -Subscribes to PRNDL data that houses the selected gear.
+ * @param tirePressure -Subscribes to the TireStatus data containing status and pressure of tires.
+ * @param engineOilLife -Subscribes to Engine Oil Life data.
+ * @param odometer -Subscribes to Odometer data in km.
+ * @param beltStatus -Subscribes to status of the seat belts.
+ * @param bodyInformation -Subscribes to body information including power modes.
+ * @param deviceStatus -Subscribes to device status including signal and battery strength.
+ * @param driverBraking -Subscribes to the status of the brake pedal.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void subscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
+ boolean engineOilLife, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID) throws SdlException
+ {
+ SubscribeVehicleData msg = new SubscribeVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setEngineOilLife(engineOilLife);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+
+ /**
+ * Unsubscribes for specific published data items.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param gps -Unsubscribes to GPS data.
+ * @param speed -Unsubscribes to vehicle speed data in kilometers per hour.
+ * @param rpm -Unsubscribes to number of revolutions per minute of the engine.
+ * @param fuelLevel -Unsubscribes to fuel level in the tank (percentage).
+ * @param fuelLevel_State -Unsubscribes to fuel level state.
+ * @param instantFuelConsumption -Unsubscribes to instantaneous fuel consumption in microlitres.
+ * @param externalTemperature -Unsubscribes to the external temperature in degrees celsius.
+ * @param prndl -Unsubscribes to PRNDL data that houses the selected gear.
+ * @param tirePressure -Unsubscribes to the TireStatus data containing status and pressure of tires.
+ * @param odometer -Unsubscribes to Odometer data in km.
+ * @param beltStatus -Unsubscribes to status of the seat belts.
+ * @param bodyInformation -Unsubscribes to body information including power modes.
+ * @param deviceStatus -Unsubscribes to device status including signal and battery strength.
+ * @param driverBraking -Unsubscribes to the status of the brake pedal.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+
+ @SuppressWarnings("unused")
+ @Deprecated
+ public void unsubscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
+ boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID) throws SdlException
+ {
+ UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+
+ /**
+ * Unsubscribes for specific published data items.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param gps -Unsubscribes to GPS data.
+ * @param speed -Unsubscribes to vehicle speed data in kilometers per hour.
+ * @param rpm -Unsubscribes to number of revolutions per minute of the engine.
+ * @param fuelLevel -Unsubscribes to fuel level in the tank (percentage).
+ * @param fuelLevel_State -Unsubscribes to fuel level state.
+ * @param instantFuelConsumption -Unsubscribes to instantaneous fuel consumption in microlitres.
+ * @param externalTemperature -Unsubscribes to the external temperature in degrees celsius.
+ * @param prndl -Unsubscribes to PRNDL data that houses the selected gear.
+ * @param tirePressure -Unsubscribes to the TireStatus data containing status and pressure of tires.
+ * @param engineOilLife -Unsubscribes to Engine Oil Life data.
+ * @param odometer -Unsubscribes to Odometer data in km.
+ * @param beltStatus -Unsubscribes to status of the seat belts.
+ * @param bodyInformation -Unsubscribes to body information including power modes.
+ * @param deviceStatus -Unsubscribes to device status including signal and battery strength.
+ * @param driverBraking -Unsubscribes to the status of the brake pedal.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+
+ @SuppressWarnings("unused")
+ public void unsubscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
+ boolean engineOilLife, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID) throws SdlException
+ {
+ UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setEngineOilLife(engineOilLife);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+
+ /**
+ * Performs a Non periodic vehicle data read request.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param gps -Performs an ad-hoc request for GPS data.
+ * @param speed -Performs an ad-hoc request for vehicle speed data in kilometers per hour.
+ * @param rpm -Performs an ad-hoc request for number of revolutions per minute of the engine.
+ * @param fuelLevel -Performs an ad-hoc request for fuel level in the tank (percentage).
+ * @param fuelLevel_State -Performs an ad-hoc request for fuel level state.
+ * @param instantFuelConsumption -Performs an ad-hoc request for instantaneous fuel consumption in microlitres.
+ * @param externalTemperature -Performs an ad-hoc request for the external temperature in degrees celsius.
+ * @param vin -Performs an ad-hoc request for the Vehicle identification number
+ * @param prndl -Performs an ad-hoc request for PRNDL data that houses the selected gear.
+ * @param tirePressure -Performs an ad-hoc request for the TireStatus data containing status and pressure of tires.
+ * @param odometer -Performs an ad-hoc request for Odometer data in km.
+ * @param beltStatus -Performs an ad-hoc request for status of the seat belts.
+ * @param bodyInformation -Performs an ad-hoc request for body information including power modes.
+ * @param deviceStatus -Performs an ad-hoc request for device status including signal and battery strength.
+ * @param driverBraking -Performs an ad-hoc request for the status of the brake pedal.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public void getvehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure,
+ boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID) throws SdlException
+ {
+ GetVehicleData msg = new GetVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setVin(vin);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+
+ /**
+ * Performs a Non periodic vehicle data read request.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param gps -Performs an ad-hoc request for GPS data.
+ * @param speed -Performs an ad-hoc request for vehicle speed data in kilometers per hour.
+ * @param rpm -Performs an ad-hoc request for number of revolutions per minute of the engine.
+ * @param fuelLevel -Performs an ad-hoc request for fuel level in the tank (percentage).
+ * @param fuelLevel_State -Performs an ad-hoc request for fuel level state.
+ * @param instantFuelConsumption -Performs an ad-hoc request for instantaneous fuel consumption in microlitres.
+ * @param externalTemperature -Performs an ad-hoc request for the external temperature in degrees celsius.
+ * @param vin -Performs an ad-hoc request for the Vehicle identification number
+ * @param prndl -Performs an ad-hoc request for PRNDL data that houses the selected gear.
+ * @param tirePressure -Performs an ad-hoc request for the TireStatus data containing status and pressure of tires.
+ * @param engineOilLife -Performs an ad-hoc request for Engine Oil Life data.
+ * @param odometer -Performs an ad-hoc request for Odometer data in km.
+ * @param beltStatus -Performs an ad-hoc request for status of the seat belts.
+ * @param bodyInformation -Performs an ad-hoc request for body information including power modes.
+ * @param deviceStatus -Performs an ad-hoc request for device status including signal and battery strength.
+ * @param driverBraking -Performs an ad-hoc request for the status of the brake pedal.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void getvehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
+ boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure,
+ boolean engineOilLife, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
+ boolean driverBraking, Integer correlationID) throws SdlException
+ {
+ GetVehicleData msg = new GetVehicleData();
+ msg.setGps(gps);
+ msg.setSpeed(speed);
+ msg.setRpm(rpm);
+ msg.setFuelLevel(fuelLevel);
+ msg.setFuelLevel_State(fuelLevel_State);
+ msg.setInstantFuelConsumption(instantFuelConsumption);
+ msg.setExternalTemperature(externalTemperature);
+ msg.setVin(vin);
+ msg.setPrndl(prndl);
+ msg.setTirePressure(tirePressure);
+ msg.setEngineOilLife(engineOilLife);
+ msg.setOdometer(odometer);
+ msg.setBeltStatus(beltStatus);
+ msg.setBodyInformation(bodyInformation);
+ msg.setDeviceStatus(deviceStatus);
+ msg.setDriverBraking(driverBraking);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+
+ /**
+ * Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param scrollableMessageBody -Body of text that can include newlines and tabs.
+ * @param timeout -App defined timeout. Indicates how long of a timeout from the last action.
+ * @param softButtons -App defined SoftButtons.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void scrollablemessage(@NonNull String scrollableMessageBody, Integer timeout, Vector<SoftButton> softButtons, Integer correlationID) throws SdlException
+ {
+ ScrollableMessage msg = new ScrollableMessage(scrollableMessageBody);
+ msg.setCorrelationID(correlationID);
+ msg.setTimeout(timeout);
+ msg.setSoftButtons(softButtons);
+
+ sendRPCRequest(msg);
+ }
+
+
+ /**
+ * Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param numTicks -Number of selectable items on a horizontal axis.
+ * @param position -Initial position of slider control (cannot exceed numTicks).
+ * @param sliderHeader -Text header to display.
+ * @param sliderFooter - Text footer to display (meant to display min/max threshold descriptors).
+ * @param timeout -App defined timeout. Indicates how long of a timeout from the last action.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void slider(@NonNull Integer numTicks, @NonNull Integer position, @NonNull String sliderHeader, Vector<String> sliderFooter, Integer timeout, Integer correlationID) throws SdlException
+ {
+ Slider msg = new Slider(numTicks, position, sliderHeader);
+ msg.setCorrelationID(correlationID);
+ msg.setSliderFooter(sliderFooter);
+ msg.setTimeout(timeout);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param language requested SDL voice engine (VR+TTS) language registration
+ * @param hmiDisplayLanguage request display language registration.
+ * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void changeregistration(@NonNull Language language, @NonNull Language hmiDisplayLanguage, Integer correlationID) throws SdlException
+ {
+ ChangeRegistration msg = new ChangeRegistration(language, hmiDisplayLanguage);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile device.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param is - The input stream of byte data that putFileStream will read from
+ * @param sdlFileName - The file reference name used by the putFile RPC.
+ * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of the file.
+ * A value greater than zero is used for resuming partial data chunks.
+ * @param iLength - The total length of the file being sent.
+ * @throws SdlException if an unrecoverable error is encountered
+ * @see #putFileStream(InputStream, String, Long, Long)
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public void putFileStream(InputStream is, @NonNull String sdlFileName, Integer iOffset, Integer iLength) throws SdlException
+ {
+ PutFile msg = new PutFile(sdlFileName, FileType.BINARY);
+ msg.setCorrelationID(10000);
+ msg.setSystemFile(true);
+ msg.setOffset(iOffset);
+ msg.setLength(iLength);
+
+ startRPCStream(is, msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile
+ * device. Responses are captured through callback on IProxyListener.
+ *
+ * @param inputStream The input stream of byte data that will be read from.
+ * @param fileName The SDL file reference name used by the RPC.
+ * @param offset The data offset in bytes. A value of zero is used to
+ * indicate data starting from the beginning of the file and a value greater
+ * than zero is used for resuming partial data chunks.
+ * @param length The total length of the file being sent.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void putFileStream(InputStream inputStream, @NonNull String fileName, Long offset, Long length) throws SdlException {
+ PutFile msg = new PutFile(fileName, FileType.BINARY);
+ msg.setCorrelationID(10000);
+ msg.setSystemFile(true);
+ msg.setOffset(offset);
+ msg.setLength(length);
+
+ startRPCStream(inputStream, msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile device.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param sdlFileName - The file reference name used by the putFile RPC.
+ * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of a file.
+ * A value greater than zero is used for resuming partial data chunks.
+ * @param iLength - The total length of the file being sent.
+ *
+ * @return OutputStream - The output stream of byte data that is written to by the app developer
+ * @throws SdlException if an unrecoverable error is encountered
+ * @see #putFileStream(String, Long, Long)
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public OutputStream putFileStream(@NonNull String sdlFileName, Integer iOffset, Integer iLength) throws SdlException
+ {
+ PutFile msg = new PutFile(sdlFileName, FileType.BINARY);
+ msg.setCorrelationID(10000);
+ msg.setSystemFile(true);
+ msg.setOffset(iOffset);
+ msg.setLength(iLength);
+
+ return startRPCStream(msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile
+ * device. Responses are captured through callback on IProxyListener.
+ *
+ * @param fileName The SDL file reference name used by the RPC.
+ * @param offset The data offset in bytes. A value of zero is used to
+ * indicate data starting from the beginning of the file and a value greater
+ * than zero is used for resuming partial data chunks.
+ * @param length The total length of the file being sent.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public OutputStream putFileStream(@NonNull String fileName, Long offset, Long length) throws SdlException {
+ PutFile msg = new PutFile(fileName, FileType.BINARY);
+ msg.setCorrelationID(10000);
+ msg.setSystemFile(true);
+ msg.setOffset(offset);
+ msg.setLength(length);
+
+ return startRPCStream(msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile device.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param is - The input stream of byte data that PutFileStream will read from
+ * @param sdlFileName - The file reference name used by the putFile RPC.
+ * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of the file.
+ * A value greater than zero is used for resuming partial data chunks.
+ * @param iLength - The total length of the file being sent.
+ * @param fileType - The selected file type -- see the FileType enumeration for details
+ * @param bPersistentFile - Indicates if the file is meant to persist between sessions / ignition cycles.
+ * @param bSystemFile - Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ * @throws SdlException if an unrecoverable error is encountered
+ * @see #putFileStream(InputStream, String, Long, Long, FileType, Boolean, Boolean, OnPutFileUpdateListener)
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public void putFileStream(InputStream is, @NonNull String sdlFileName, Integer iOffset, Integer iLength, @NonNull FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) throws SdlException
+ {
+ PutFile msg = new PutFile(sdlFileName, fileType);
+ msg.setCorrelationID(10000);
+ msg.setPersistentFile(bPersistentFile);
+ msg.setSystemFile(bSystemFile);
+ msg.setOffset(iOffset);
+ msg.setLength(iLength);
+
+ startRPCStream(is, msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile
+ * device. Responses are captured through callback on IProxyListener.
+ *
+ * @param inputStream The input stream of byte data that will be read from.
+ * @param fileName The SDL file reference name used by the RPC.
+ * @param offset The data offset in bytes. A value of zero is used to
+ * indicate data starting from the beginning of the file and a value greater
+ * than zero is used for resuming partial data chunks.
+ * @param length The total length of the file being sent.
+ * @param fileType The selected file type. See the {@link FileType} enum for
+ * details.
+ * @param isPersistentFile Indicates if the file is meant to persist between
+ * sessions / ignition cycles.
+ * @param isSystemFile Indicates if the file is meant to be passed through
+ * core to elsewhere in the system.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void putFileStream(InputStream inputStream, @NonNull String fileName, Long offset, Long length, FileType fileType, Boolean isPersistentFile, Boolean isSystemFile, OnPutFileUpdateListener cb) throws SdlException {
+ PutFile msg = new PutFile(fileName, FileType.BINARY);
+ msg.setCorrelationID(10000);
+ msg.setSystemFile(true);
+ msg.setOffset(offset);
+ msg.setLength(length);
+ msg.setOnPutFileUpdateListener(cb);
+ startRPCStream(inputStream, msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile device.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param sdlFileName - The file reference name used by the putFile RPC.
+ * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of a file.
+ * A value greater than zero is used for resuming partial data chunks.
+ * @param iLength - The total length of the file being sent.
+ * @param fileType - The selected file type -- see the FileType enumeration for details
+ * @param bPersistentFile - Indicates if the file is meant to persist between sessions / ignition cycles.
+ * @param bSystemFile - Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ * @return OutputStream - The output stream of byte data that is written to by the app developer
+ * @throws SdlException if an unrecoverable error is encountered
+ * @see #putFileStream(String, Long, Long, FileType, Boolean, Boolean, OnPutFileUpdateListener)
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public OutputStream putFileStream(@NonNull String sdlFileName, Integer iOffset, Integer iLength, @NonNull FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) throws SdlException
+ {
+ PutFile msg = new PutFile(sdlFileName, fileType);
+ msg.setCorrelationID(10000);
+ msg.setPersistentFile(bPersistentFile);
+ msg.setSystemFile(bSystemFile);
+ msg.setOffset(iOffset);
+ msg.setLength(iLength);
+
+ return startRPCStream(msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile
+ * device. Responses are captured through callback on IProxyListener.
+ *
+ * @param fileName The SDL file reference name used by the RPC.
+ * @param offset The data offset in bytes. A value of zero is used to
+ * indicate data starting from the beginning of the file and a value greater
+ * than zero is used for resuming partial data chunks.
+ * @param length The total length of the file being sent.
+ * @param fileType The selected file type. See the {@link FileType} enum for
+ * details.
+ * @param isPersistentFile Indicates if the file is meant to persist between
+ * sessions / ignition cycles.
+ * @param isSystemFile Indicates if the file is meant to be passed through
+ * core to elsewhere in the system.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public OutputStream putFileStream(@NonNull String fileName, Long offset, Long length, FileType fileType, Boolean isPersistentFile, Boolean isSystemFile, OnPutFileUpdateListener cb) throws SdlException {
+ PutFile msg = new PutFile(fileName, FileType.BINARY);
+ msg.setCorrelationID(10000);
+ msg.setSystemFile(true);
+ msg.setOffset(offset);
+ msg.setLength(length);
+ msg.setOnPutFileUpdateListener(cb);
+
+ return startRPCStream(msg);
+ }
+
+ /**
+ * Used to push a stream of putfile RPC's containing binary data from a mobile device to the module.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param sPath - The physical file path on the mobile device.
+ * @param sdlFileName - The file reference name used by the putFile RPC.
+ * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of a file.
+ * A value greater than zero is used for resuming partial data chunks.
+ * @param fileType - The selected file type -- see the FileType enumeration for details
+ * @param bPersistentFile - Indicates if the file is meant to persist between sessions / ignition cycles.
+ * @param bSystemFile - Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ * @param iCorrelationID - A unique ID that correlates each RPCRequest and RPCResponse.
+ * @return RPCStreamController - If the putFileStream was not started successfully null is returned, otherwise a valid object reference is returned
+ * @throws SdlException if an unrecoverable error is encountered
+ * @see #putFileStream(String, String, Long, FileType, Boolean, Boolean, Boolean, Integer, OnPutFileUpdateListener)
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public RPCStreamController putFileStream(String sPath, @NonNull String sdlFileName, Integer iOffset, @NonNull FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Integer iCorrelationID) throws SdlException
+ {
+ PutFile msg = new PutFile(sdlFileName, fileType);
+ msg.setCorrelationID(iCorrelationID);
+ msg.setPersistentFile(bPersistentFile);
+ msg.setSystemFile(bSystemFile);
+ msg.setOffset(iOffset);
+ msg.setLength(0);
+
+ return startPutFileStream(sPath, msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile
+ * device. Responses are captured through callback on IProxyListener.
+ *
+ * @param path The physical file path on the mobile device.
+ * @param fileName The SDL file reference name used by the RPC.
+ * @param offset The data offset in bytes. A value of zero is used to
+ * indicate data starting from the beginning of the file and a value greater
+ * than zero is used for resuming partial data chunks.
+ * @param fileType The selected file type. See the {@link FileType} enum for
+ * details.
+ * @param isPersistentFile Indicates if the file is meant to persist between
+ * sessions / ignition cycles.
+ * @param isSystemFile Indicates if the file is meant to be passed through
+ * core to elsewhere in the system.
+ * @param correlationId A unique id that correlates each RPCRequest and
+ * RPCResponse.
+ * @return RPCStreamController If the putFileStream was not started
+ * successfully null is returned, otherwise a valid object reference is
+ * returned .
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public RPCStreamController putFileStream(String path, @NonNull String fileName, Long offset, @NonNull FileType fileType, Boolean isPersistentFile, Boolean isSystemFile, Boolean isPayloadProtected, Integer correlationId, OnPutFileUpdateListener cb ) throws SdlException {
+ PutFile msg = new PutFile(fileName, fileType);
+ msg.setCorrelationID(correlationId);
+ msg.setPersistentFile(isPersistentFile);
+ msg.setSystemFile(isSystemFile);
+ msg.setOffset(offset);
+ msg.setLength(0L);
+ msg.setPayloadProtected(isPayloadProtected);
+ msg.setOnPutFileUpdateListener(cb);
+
+ return startPutFileStream(path,msg);
+ }
+
+ /**
+ * Used to push a stream of putfile RPC's containing binary data from a mobile device to the module.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param is - The input stream of byte data that putFileStream will read from.
+ * @param sdlFileName - The file reference name used by the putFile RPC.
+ * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of a file.
+ * A value greater than zero is used for resuming partial data chunks.
+ * @param fileType - The selected file type -- see the FileType enumeration for details
+ * @param bPersistentFile - Indicates if the file is meant to persist between sessions / ignition cycles.
+ * @param bSystemFile - Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ * @param iCorrelationID - A unique ID that correlates each RPCRequest and RPCResponse.
+ * @return RPCStreamController - If the putFileStream was not started successfully null is returned, otherwise a valid object reference is returned
+ * @throws SdlException if an unrecoverable error is encountered
+ * @see #putFileStream(InputStream, String, Long, Long, FileType, Boolean, Boolean, Boolean, Integer)
+ */
+ @SuppressWarnings("unused")
+ @Deprecated
+ public RPCStreamController putFileStream(InputStream is, @NonNull String sdlFileName, Integer iOffset, Integer iLength, @NonNull FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Integer iCorrelationID) throws SdlException
+ {
+ PutFile msg = new PutFile(sdlFileName, fileType);
+ msg.setCorrelationID(iCorrelationID);
+ msg.setPersistentFile(bPersistentFile);
+ msg.setSystemFile(bSystemFile);
+ msg.setOffset(iOffset);
+ msg.setLength(iLength);
+
+ return startPutFileStream(is, msg);
+ }
+
+ /**
+ * Used to push a binary stream of file data onto the module from a mobile
+ * device. Responses are captured through callback on IProxyListener.
+ *
+ * @param inputStream The input stream of byte data that will be read from.
+ * @param fileName The SDL file reference name used by the RPC.
+ * @param offset The data offset in bytes. A value of zero is used to
+ * indicate data starting from the beginning of the file and a value greater
+ * than zero is used for resuming partial data chunks.
+ * @param length The total length of the file being sent.
+ * @param fileType The selected file type. See the {@link FileType} enum for
+ * details.
+ * @param isPersistentFile Indicates if the file is meant to persist between
+ * sessions / ignition cycles.
+ * @param isSystemFile Indicates if the file is meant to be passed through
+ * core to elsewhere in the system.
+ * @param correlationId A unique id that correlates each RPCRequest and
+ * RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public RPCStreamController putFileStream(InputStream inputStream, @NonNull String fileName, Long offset, Long length, @NonNull FileType fileType, Boolean isPersistentFile, Boolean isSystemFile, Boolean isPayloadProtected, Integer correlationId) throws SdlException {
+ PutFile msg = new PutFile(fileName, fileType);
+ msg.setCorrelationID(correlationId);
+ msg.setPersistentFile(isPersistentFile);
+ msg.setSystemFile(isSystemFile);
+ msg.setOffset(offset);
+ msg.setLength(length);
+ msg.setPayloadProtected(isPayloadProtected);
+
+ return startPutFileStream(inputStream, msg);
+ }
+
+ /**
+ *
+ * Used to end an existing putFileStream that was previously initiated with any putFileStream method.
+ *
+ */
+ @SuppressWarnings("unused")
+ public void endPutFileStream()
+ {
+ endRPCStream();
+ }
+
+
+ /**
+ * Used to push a binary data onto the SDL module from a mobile device, such as icons and album art. Not supported on first generation SDL vehicles.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param sdlFileName -File reference name.
+ * @param fileType -Selected file type.
+ * @param persistentFile -Indicates if the file is meant to persist between sessions / ignition cycles.
+ * @param fileData byte array of data of the file that is to be sent
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void putfile(@NonNull String sdlFileName, @NonNull FileType fileType, Boolean persistentFile, byte[] fileData, Integer correlationID) throws SdlException
+ {
+ PutFile msg = new PutFile(sdlFileName, fileType);
+ msg.setCorrelationID(correlationID);
+ msg.setPersistentFile(persistentFile);
+ msg.setBulkData(fileData);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Used to delete a file resident on the SDL module in the app's local cache. Not supported on first generation SDL vehicles.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param sdlFileName -File reference name.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void deletefile(@NonNull String sdlFileName, Integer correlationID) throws SdlException
+ {
+ DeleteFile msg = new DeleteFile(sdlFileName);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Requests the current list of resident filenames for the registered app. Not supported on first generation SDL vehicles.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void listfiles(Integer correlationID) throws SdlException
+ {
+ ListFiles msg = new ListFiles();
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Used to set existing local file on SDL as the app's icon. Not supported on first generation SDL vehicles.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param sdlFileName -File reference name.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void setappicon(@NonNull String sdlFileName, Integer correlationID) throws SdlException
+ {
+ SetAppIcon msg = new SetAppIcon(sdlFileName);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Set an alternate display layout. If not sent, default screen for given platform will be shown.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param displayLayout -Predefined or dynamically created screen layout.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void setdisplaylayout(@NonNull String displayLayout, Integer correlationID) throws SdlException
+ {
+ SetDisplayLayout msg = new SetDisplayLayout(displayLayout);
+ msg.setCorrelationID(correlationID);
+
+ sendRPCRequest(msg);
+ }
+
+ /**
+ * Set an alternate display layout. If not sent, default screen for given platform will be shown.
+ * Responses are captured through callback on IProxyListener.
+ *
+ * @param displayLayout -Predefined or dynamically created screen layout.
+ * @param dayColorScheme a TemplateColorScheme object representing the colors that will be used for day color scheme
+ * @param nightColorScheme a TemplateColorScheme object representing the colors that will be used for night color scheme
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @SuppressWarnings("unused")
+ public void setdisplaylayout(String displayLayout, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme, Integer correlationID) throws SdlException
+ {
+ SetDisplayLayout msg = new SetDisplayLayout(displayLayout);
+ msg.setCorrelationID(correlationID);
+ msg.setDayColorScheme(dayColorScheme);
+ msg.setNightColorScheme(nightColorScheme);
+ 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);
+ }
+
+ @SuppressWarnings("unused")
+ public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener){
+ if(_systemCapabilityManager != null){
+ _systemCapabilityManager.getCapability(systemCapabilityType, scListener);
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public Object getCapability(SystemCapabilityType systemCapabilityType){
+ if(_systemCapabilityManager != null ){
+ return _systemCapabilityManager.getCapability(systemCapabilityType);
+ }else{
+ return null;
+ }
+ }
+
+ /**
+ * 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 *************************/
+
+ /**
+ * Gets type of transport currently used by this SdlProxy.
+ *
+ * @return One of TransportType enumeration values.
+ *
+ * @see TransportType
+ */
+ @SuppressWarnings("unused")
+ public TransportType getCurrentTransportType() throws IllegalStateException {
+ if (sdlSession == null) {
+ throw new IllegalStateException("Incorrect state of SdlProxyBase: Calling for getCurrentTransportType() while connection is not initialized");
+ }
+
+ return sdlSession.getCurrentTransportType();
+ }
+
+ public void setSdlSecurityClassList(List<Class<? extends SdlSecurityBase>> list) {
+ _secList = list;
+ }
+
+ private void setSdlSecurity(SdlSecurityBase sec) {
+ if (sdlSession != null)
+ {
+ sdlSession.setSdlSecurity(sec);
+ }
+ }
+
+ /**
+ * Sets the minimum protocol version that will be permitted to connect.
+ * If the protocol version of the head unit connected is below this version,
+ * the app will disconnect with an EndService protocol message and will not register.
+ * @param minimumProtocolVersion
+ */
+ public void setMinimumProtocolVersion(Version minimumProtocolVersion){
+ this.minimumProtocolVersion = minimumProtocolVersion;
+ }
+
+ /**
+ * The minimum RPC version that will be permitted to connect.
+ * If the RPC version of the head unit connected is below this version, an UnregisterAppInterface will be sent.
+ * @param minimumRPCVersion
+ */
+ public void setMinimumRPCVersion(Version minimumRPCVersion){
+ this.minimumRPCVersion = minimumRPCVersion;
+ }
+
+ @SuppressWarnings("unused")
+ public boolean isServiceTypeProtected(SessionType sType) {
+ return sdlSession != null && sdlSession.isServiceProtected(sType);
+
+ }
+
+
+ public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
+ if(serviceType != null && sdlSession != null && sdlServiceListener != null){
+ sdlSession.addServiceListener(serviceType, sdlServiceListener);
+ }
+ }
+
+ public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
+ if(serviceType != null && sdlSession != null && sdlServiceListener != null){
+ sdlSession.removeServiceListener(serviceType, sdlServiceListener);
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public VideoStreamingParameters getAcceptedVideoParams(){
+ return sdlSession.getAcceptedVideoParams();
+ }
+
+ public IProxyListenerBase getProxyListener()
+ {
+ return _proxyListener;
+ }
+
+ @SuppressWarnings("unused")
+ public String getAppName()
+ {
+ return _applicationName;
+ }
+
+ @SuppressWarnings("unused")
+ public String getNgnAppName()
+ {
+ return _ngnMediaScreenAppName;
+ }
+
+ @SuppressWarnings("unused")
+ public String getAppID()
+ {
+ return _appID;
+ }
+ @SuppressWarnings("unused")
+ public DeviceInfo getDeviceInfo()
+ {
+ return deviceInfo;
+ }
+ @SuppressWarnings("unused")
+ public long getInstanceDT()
+ {
+ return instanceDateTime;
+ }
+ @SuppressWarnings("unused")
+ public void setConnectionDetails(String sDetails)
+ {
+ sConnectionDetails = sDetails;
+ }
+ @SuppressWarnings("unused")
+ public String getConnectionDetails()
+ {
+ return sConnectionDetails;
+ }
+ //for testing only
+ @SuppressWarnings("unused")
+ public void setPoliciesURL(String sText)
+ {
+ sPoliciesURL = sText;
+ }
+ //for testing only
+ public String getPoliciesURL()
+ {
+ return sPoliciesURL;
+ }
+
+ /**
+ * Tells developer whether or not their app icon has been resumed on core.
+ * @return boolean - true if icon was resumed, false if not
+ * @throws SdlException if proxy is disposed or app is not registered
+ */
+ public boolean getIconResumed() throws SdlException {
+ // Test if proxy has been disposed
+ if (_proxyDisposed) {
+ throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
+ }
+
+ // Test SDL availability
+ if (!_appInterfaceRegisterd) {
+ throw new SdlException("SDL is not connected. Unable to determine if app icon was resumed.", SdlExceptionCause.SDL_UNAVAILABLE);
+ }
+ return _iconResumed;
+ }
+
+ /**
+ * Method to retrieve the RegisterAppInterface Response message that was sent back from the
+ * module. It contains various attributes about the connected module and can be used to adapt
+ * to different module types and their supported features.
+ *
+ * @return RegisterAppInterfaceResponse received from the module or null if the app has not yet
+ * registered with the module.
+ */
+ public RegisterAppInterfaceResponse getRegisterAppInterfaceResponse(){
+ return this.raiResponse;
+ }
+
+ /**
+ * Get the current OnHMIStatus
+ * @return OnHMIStatus object represents the current OnHMIStatus
+ */
+ public OnHMIStatus getCurrentHMIStatus(){
+ return lastHmiStatus;
+ }
+
+ /**
+ * Retrieves the auth token, if any, that was attached to the StartServiceACK for the RPC
+ * service from the module. For example, this should be used to login to a user account.
+ * @return the string representation of the auth token
+ */
+ public String getAuthToken(){
+ return this.authToken;
+ }
+
+ /**
+ * VideoStreamingManager houses all the elements needed to create a scoped, streaming manager for video projection. It is only a private, instance
+ * dependant class at the moment until it can become public. Once the class is public and API defined, it will be moved into the SdlSession class
+ */
+ @TargetApi(19)
+ private class VideoStreamingManager implements ISdlServiceListener{
+ Context context;
+ ISdl internalInterface;
+ volatile VirtualDisplayEncoder encoder;
+ private Class<? extends SdlRemoteDisplay> remoteDisplayClass = null;
+ SdlRemoteDisplay remoteDisplay;
+ IVideoStreamListener streamListener;
+ float[] touchScalar = {1.0f,1.0f}; //x, y
+ private HapticInterfaceManager hapticManager;
+ SdlMotionEvent sdlMotionEvent = null;
+ VideoStreamingParameters videoStreamingParameters;
+
+ public VideoStreamingManager(Context context,ISdl iSdl){
+ this.context = context;
+ this.internalInterface = iSdl;
+ encoder = new VirtualDisplayEncoder();
+ internalInterface.addServiceListener(SessionType.NAV,this);
+ //Take care of the touch events
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_TOUCH_EVENT, new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ if(notification !=null && remoteDisplay != null){
+ MotionEvent event = convertTouchEvent((OnTouchEvent)notification);
+ if(event!=null){
+ remoteDisplay.handleMotionEvent(event);
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Starts the video service, caches the supplied params and prepares for the stream to start.
+ * @param remoteDisplayClass the extension of SdlRemoteDisplay that will be streamed
+ * @param parameters desired video streaming params
+ * @param encrypted if the service is to be encrypted or not
+ */
+ public void startVideoStreaming(Class<? extends SdlRemoteDisplay> remoteDisplayClass, VideoStreamingParameters parameters, boolean encrypted){
+ this.remoteDisplayClass = remoteDisplayClass;
+ this.videoStreamingParameters = parameters;
+ //Make sure the service is started, allows multi transports to connect and register without timing out
+ internalInterface.startVideoService(parameters, encrypted);
+ //After this, look to the
+ }
+
+ /**
+ * The video service should already be started at this point. Once called, it will start
+ * the encoders and fire up the remote display supplied by the user
+ * @param parameters
+ * @param encrypted
+ */
+ private void startStream(VideoStreamingParameters parameters, boolean encrypted){
+ //Start the service first
+ //streamListener = startVideoStream(encrypted,parameters);d
+ streamListener = sdlSession.startVideoStream();
+ if(streamListener == null){
+ Log.e(TAG, "Error starting video service");
+ return;
+ }
+ VideoStreamingCapability capability = (VideoStreamingCapability)_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING);
+ if(capability != null && capability.getIsHapticSpatialDataSupported()){
+ hapticManager = new HapticInterfaceManager(internalInterface);
+ }
+
+ try {
+ encoder.init(context, streamListener, parameters);
+ //We are all set so we can start streaming at at this point
+ encoder.start();
+ //Encoder should be up and running
+ createRemoteDisplay(encoder.getVirtualDisplay());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ Log.d(TAG, parameters.toString());
+ }
+
+ public void stopStreaming(){
+ if(remoteDisplay!=null){
+ remoteDisplay.stop();
+ remoteDisplay = null;
+ }
+ if(encoder!=null){
+ encoder.shutDown();
+ }
+ if(internalInterface!=null){
+ internalInterface.stopVideoService();
+ }
+ }
+
+ public void dispose(){
+ stopStreaming();
+ internalInterface.removeServiceListener(SessionType.NAV,this);
+ }
+
+ 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, 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
+ SdlProxyBase.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(protocolVersion!= null && protocolVersion.getMajor()>=5){ //At this point we should already have the capability
+ VideoStreamingCapability capability = (VideoStreamingCapability)_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING);
+ if (capability != null) {
+ resolution = capability.getPreferredResolution();
+ }
+ }
+
+ if(resolution == null){ //Either the protocol version is too low to access video streaming caps, or they were null
+ 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.");
+ }
+ }
+
+ @Override
+ public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
+ if(SessionType.NAV.equals(type) && session != null ){
+ DebugTool.logInfo("Video service has been started. Starting video stream from proxy");
+ if(session.getAcceptedVideoParams() != null){
+ videoStreamingParameters = session.getAcceptedVideoParams();
+ }
+ startStream(videoStreamingParameters, isEncrypted);
+ }
+ }
+
+ @Override
+ public void onServiceEnded(SdlSession session, SessionType type) {
+ if(SessionType.NAV.equals(type)){
+ if(remoteDisplay!=null){
+ stopStreaming();
+ }
+ }
+ }
+
+ @Override
+ public void onServiceError(SdlSession session, SessionType type, String reason) {
+
+ }
+
+ private 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);
+ }
+
+ }
+ }
+ }
+ }
+} // end-class
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java
new file mode 100644
index 000000000..897add3f5
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import android.app.Service;
+import android.content.Context;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.proxy.interfaces.IProxyListenerALM;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.transport.BTTransportConfig;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.MultiplexTransportConfig;
+
+import java.util.List;
+import java.util.Vector;
+
+public class SdlProxyBuilder {
+ // Required parameters
+ private IProxyListenerALM listener;
+ private String appId;
+ private String appName;
+ private Boolean isMediaApp;
+ private Context context;
+ private BaseTransportConfig mTransport;
+
+ // Optional parameters
+ private Service service;
+ private SdlProxyConfigurationResources sdlProxyConfigurationResources;
+ private Vector<TTSChunk> ttsChunks;
+ private String sShortAppName;
+ private Vector<String> vrSynonyms;
+ private SdlMsgVersion sdlMessageVersion;
+ private Language lang;
+ private Language hmiLang;
+ private Vector<AppHMIType> vrAppHMITypes;
+ private String autoActivateID;
+ private boolean callbackToUIThread;
+ private boolean preRegister;
+ private String sAppResumeHash;
+ private List<Class<? extends SdlSecurityBase>> sdlSecList;
+ private TemplateColorScheme dayColorScheme, nightColorScheme;
+
+ private SdlProxyBuilder() {
+ service = null;
+ sdlProxyConfigurationResources = null;
+ ttsChunks = null;
+ sShortAppName = null;
+ vrSynonyms = null;
+ sdlMessageVersion = null;
+ lang = Language.EN_US;
+ hmiLang = Language.EN_US;
+ vrAppHMITypes = null;
+ autoActivateID = null;
+ callbackToUIThread = false;
+ preRegister = false;
+ sAppResumeHash = null;
+ sdlSecList = null;
+ dayColorScheme = null;
+ nightColorScheme = null;
+}
+
+ public static class Builder {
+ SdlProxyBuilder sdlProxyBuilder;
+
+ /**
+ * @deprecated Use Builder(IProxyListenerALM, String, String, Boolean, Context) instead
+ */
+ @Deprecated
+ public Builder(IProxyListenerALM listener, String appId, String appName, Boolean isMediaApp) {
+ sdlProxyBuilder = new SdlProxyBuilder();
+ sdlProxyBuilder.listener = listener;
+ sdlProxyBuilder.appId = appId;
+ sdlProxyBuilder.appName = appName;
+ sdlProxyBuilder.isMediaApp = isMediaApp;
+ sdlProxyBuilder.mTransport = new BTTransportConfig();
+ }
+
+ public Builder(IProxyListenerALM listener, String appId, String appName, Boolean isMediaApp, Context context) {
+ sdlProxyBuilder = new SdlProxyBuilder();
+ sdlProxyBuilder.listener = listener;
+ sdlProxyBuilder.appId = appId;
+ sdlProxyBuilder.appName = appName;
+ sdlProxyBuilder.isMediaApp = isMediaApp;
+ sdlProxyBuilder.context = context;
+ sdlProxyBuilder.mTransport = new MultiplexTransportConfig(context, appId);
+ }
+
+ public Builder setService(Service val) {
+ sdlProxyBuilder.service = val;
+ return this;
+ }
+
+ public Builder setSdlProxyConfigurationResources(SdlProxyConfigurationResources val) {
+ sdlProxyBuilder.sdlProxyConfigurationResources = val;
+ return this;
+ }
+
+ public Builder setTtsName(Vector<TTSChunk> val) {
+ sdlProxyBuilder.ttsChunks = val;
+ return this;
+ }
+
+ public Builder setShortAppName(String val) {
+ sdlProxyBuilder.sShortAppName = val;
+ return this;
+ }
+
+ public Builder setVrSynonyms(Vector<String> val) {
+ sdlProxyBuilder.vrSynonyms = val;
+ return this;
+ }
+
+ public Builder setSdlMessageVersion(SdlMsgVersion val) {
+ sdlProxyBuilder.sdlMessageVersion = val;
+ return this;
+ }
+
+ public Builder setLangDesired(Language val) {
+ sdlProxyBuilder.lang = val;
+ return this;
+ }
+
+ public Builder setHMILangDesired(Language val) {
+ sdlProxyBuilder.hmiLang = val;
+ return this;
+ }
+
+ public Builder setVrAppHMITypes(Vector<AppHMIType> val) {
+ sdlProxyBuilder.vrAppHMITypes = val;
+ return this;
+ }
+
+ public Builder setAutoActivateID(String val) {
+ sdlProxyBuilder.autoActivateID = val;
+ return this;
+ }
+
+ public Builder setCallbackToUIThread(boolean val) {
+ sdlProxyBuilder.callbackToUIThread = val;
+ return this;
+ }
+
+ public Builder setPreRegister(boolean val) {
+ sdlProxyBuilder.preRegister = val;
+ return this;
+ }
+
+ public Builder setAppResumeDataHash(String val) {
+ sdlProxyBuilder.sAppResumeHash = val;
+ return this;
+ }
+
+ public Builder setTransportType(BaseTransportConfig val) {
+ sdlProxyBuilder.mTransport = val;
+ return this;
+ }
+
+ public Builder setSdlSecurity(List<Class<? extends SdlSecurityBase>> val) {
+ sdlProxyBuilder.sdlSecList = val;
+ return this;
+ }
+ public Builder setDayColorScheme(TemplateColorScheme val) {
+ sdlProxyBuilder.dayColorScheme = val;
+ return this;
+ }
+
+ public Builder setNightColorScheme(TemplateColorScheme val) {
+ sdlProxyBuilder.nightColorScheme = val;
+ return this;
+ }
+
+ public SdlProxyALM build() throws SdlException {
+ SdlProxyALM proxy = new SdlProxyALM(sdlProxyBuilder.service, sdlProxyBuilder.listener,
+ sdlProxyBuilder.sdlProxyConfigurationResources, sdlProxyBuilder.appName,
+ sdlProxyBuilder.ttsChunks, sdlProxyBuilder.sShortAppName, sdlProxyBuilder.vrSynonyms,
+ sdlProxyBuilder.isMediaApp, sdlProxyBuilder.sdlMessageVersion, sdlProxyBuilder.lang,
+ sdlProxyBuilder.hmiLang, sdlProxyBuilder.vrAppHMITypes, sdlProxyBuilder.appId,
+ sdlProxyBuilder.autoActivateID, sdlProxyBuilder.dayColorScheme, sdlProxyBuilder.nightColorScheme,
+ sdlProxyBuilder.callbackToUIThread, sdlProxyBuilder.preRegister,
+ sdlProxyBuilder.sAppResumeHash, sdlProxyBuilder.mTransport);
+ proxy.setSdlSecurityClassList(sdlProxyBuilder.sdlSecList);
+ return proxy;
+ }
+ }
+}
+
+
+
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java
new file mode 100644
index 000000000..c96df0f78
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import android.telephony.TelephonyManager;
+
+public class SdlProxyConfigurationResources {
+ private String _sdlConfigurationFilePath;
+ private TelephonyManager _telephonyManager;
+
+ public SdlProxyConfigurationResources() {
+ this(null, null);
+ }
+
+ public SdlProxyConfigurationResources(String sdlConfigurationFilePath,
+ TelephonyManager telephonyManager) {
+ _sdlConfigurationFilePath = sdlConfigurationFilePath;
+ _telephonyManager = telephonyManager;
+ }
+
+ public void setSdlConfigurationFilePath(String sdlConfigurationFilePath) {
+ _sdlConfigurationFilePath = sdlConfigurationFilePath;
+ }
+
+ public String getSdlConfigurationFilePath() {
+ return _sdlConfigurationFilePath;
+ }
+
+ public void setTelephonyManager(TelephonyManager telephonyManager) {
+ _telephonyManager = telephonyManager;
+ }
+
+ public TelephonyManager getTelephonyManager() {
+ return _telephonyManager;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java
new file mode 100644
index 000000000..9b6f0d971
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import com.smartdevicelink.BuildConfig;
+
+@Deprecated
+public class Version {
+ public static final String VERSION = BuildConfig.VERSION_NAME;
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java b/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
new file mode 100644
index 000000000..0323beb21
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.security;
+
+import android.app.Service;
+import android.content.Context;
+
+public abstract class SdlSecurityBase extends AbstractSdlSecurityBase{
+
+ protected static Service appService = null;
+ protected static Context context;
+
+ @Deprecated
+ public static Service getAppService() {
+ return appService;
+ }
+
+ @Deprecated
+ public static void setAppService(Service 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;
+ }
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
new file mode 100644
index 000000000..8c5d98d1a
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.streaming;
+
+import com.smartdevicelink.SdlConnection.SdlConnection;
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+public class StreamPacketizer extends AbstractPacketizer implements IVideoStreamListener, IAudioStreamListener, Runnable{
+
+ public final static String TAG = "StreamPacketizer";
+
+ private Thread t = null;
+
+
+ private final static int TLS_MAX_RECORD_SIZE = 16384;
+ private final static int TLS_RECORD_HEADER_SIZE = 5;
+ private final static int TLS_RECORD_MES_AUTH_CDE_SIZE = 32;
+ private final static int TLS_MAX_RECORD_PADDING_SIZE = 256;
+
+
+ private final static int BUFF_READ_SIZE = TLS_MAX_RECORD_SIZE - TLS_RECORD_HEADER_SIZE - TLS_RECORD_MES_AUTH_CDE_SIZE - TLS_MAX_RECORD_PADDING_SIZE;
+
+ // Approximate size of data that mOutputQueue can hold in bytes.
+ // By adding a buffer, we accept underlying transport being stuck for a short time. By setting
+ // a limit of the buffer size, we avoid buffer overflows when underlying transport is too slow.
+ private static final int MAX_QUEUE_SIZE = 256 * 1024;
+
+ public SdlConnection sdlConnection = null; //TODO remove completely
+ private Object mPauseLock;
+ private boolean mPaused;
+ private boolean isServiceProtected = false;
+ private BlockingQueue<ByteBuffer> mOutputQueue;
+
+ public StreamPacketizer(IStreamListener streamListener, InputStream is, SessionType sType, byte rpcSessionID, SdlSession session) throws IOException {
+ super(streamListener, is, sType, rpcSessionID, session);
+ mPauseLock = new Object();
+ mPaused = false;
+ isServiceProtected = _session.isServiceProtected(_serviceType);
+ if (bufferSize == 0) {
+ // fail safe
+ bufferSize = BUFF_READ_SIZE;
+ }
+ if(isServiceProtected){ //If our service is encrypted we can only use 1024 as the max buffer size.
+ bufferSize = BUFF_READ_SIZE;
+ buffer = new byte[bufferSize];
+ }
+ mOutputQueue = new LinkedBlockingQueue<ByteBuffer>(MAX_QUEUE_SIZE / bufferSize);
+ }
+
+ public void start() throws IOException {
+ if (t == null) {
+ t = new Thread(this);
+ t.start();
+ }
+ }
+
+ public void stop() {
+
+ if (t != null)
+ {
+ t.interrupt();
+ t = null;
+ }
+
+ }
+
+ public void run() {
+ int length;
+ try
+ {
+ while (t != null && !t.isInterrupted())
+ {
+ synchronized(mPauseLock)
+ {
+ while (mPaused)
+ {
+ try
+ {
+ mPauseLock.wait();
+ }
+ catch (InterruptedException e) {}
+ }
+ }
+
+ if (is != null) { // using InputStream interface
+ length = is.read(buffer, 0, bufferSize);
+
+ if (length >= 0) {
+ ProtocolMessage pm = new ProtocolMessage();
+ pm.setSessionID(_rpcSessionID);
+ pm.setSessionType(_serviceType);
+ pm.setFunctionID(0);
+ pm.setCorrID(0);
+ pm.setData(buffer, length);
+ pm.setPayloadProtected(isServiceProtected);
+
+ if (t != null && !t.isInterrupted()) {
+ _streamListener.sendStreamPacket(pm);
+ }
+ }
+ } else { // using sendFrame interface
+ ByteBuffer frame;
+ try {
+ frame = mOutputQueue.take();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ break;
+ }
+
+ while (frame.hasRemaining()) {
+ int len = frame.remaining() > bufferSize ? bufferSize : frame.remaining();
+
+ ProtocolMessage pm = new ProtocolMessage();
+ pm.setSessionID(_rpcSessionID);
+ pm.setSessionType(_serviceType);
+ pm.setFunctionID(0);
+ pm.setCorrID(0);
+ pm.setData(frame.array(), frame.arrayOffset() + frame.position(), len);
+ pm.setPayloadProtected(isServiceProtected);
+
+ if (t != null && !t.isInterrupted()) {
+ _streamListener.sendStreamPacket(pm);
+ }
+
+ frame.position(frame.position() + len);
+ }
+ }
+ }
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ if(_session == null) {
+ if (sdlConnection != null) {
+ sdlConnection.endService(_serviceType, _rpcSessionID);
+ }
+ }else{
+ _session.endService(_serviceType,_rpcSessionID);
+ }
+
+
+ }
+ }
+
+ @Override
+ public void pause() {
+ synchronized (mPauseLock) {
+ mPaused = true;
+ }
+ }
+
+ @Override
+ public void resume() {
+ synchronized (mPauseLock) {
+ mPaused = false;
+ mPauseLock.notifyAll();
+ }
+ }
+
+ /**
+ * Called by the app.
+ *
+ * @see com.smartdevicelink.proxy.interfaces.IVideoStreamListener#sendFrame(byte[], int, int, long)
+ */
+ @Override
+ public void sendFrame(byte[] data, int offset, int length, long presentationTimeUs)
+ throws ArrayIndexOutOfBoundsException {
+ sendArrayData(data, offset, length);
+ }
+
+ /**
+ * Called by the app.
+ *
+ * @see com.smartdevicelink.proxy.interfaces.IVideoStreamListener#sendFrame(ByteBuffer, long)
+ */
+ @Override
+ public void sendFrame(ByteBuffer data, long presentationTimeUs) {
+ sendByteBufferData(data);
+ }
+
+ /**
+ * Called by the app.
+ *
+ * @see com.smartdevicelink.proxy.interfaces.IAudioStreamListener#sendAudio(byte[], int, int, long)
+ */
+ @Override
+ public void sendAudio(byte[] data, int offset, int length, long presentationTimeUs)
+ throws ArrayIndexOutOfBoundsException {
+ sendArrayData(data, offset, length);
+ }
+
+ /**
+ * Called by the app.
+ *
+ * @see com.smartdevicelink.proxy.interfaces.IAudioStreamListener#sendAudio(ByteBuffer, long)
+ */
+ @Override
+ public void sendAudio(ByteBuffer data, long presentationTimeUs) {
+ sendByteBufferData(data);
+ }
+
+ private void sendArrayData(byte[] data, int offset, int length)
+ throws ArrayIndexOutOfBoundsException {
+ if (offset < 0 || offset > data.length || length <= 0 || offset + length > data.length) {
+ throw new ArrayIndexOutOfBoundsException();
+ }
+
+ // StreamPacketizer does not need to split a video frame into NAL units
+ ByteBuffer buffer = ByteBuffer.allocate(length);
+ buffer.put(data, offset, length);
+ buffer.flip();
+
+ try {
+ mOutputQueue.put(buffer);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ private void sendByteBufferData(ByteBuffer data) {
+ if (data == null || data.remaining() == 0) {
+ return;
+ }
+
+ // copy the whole buffer, so that even if the app modifies original ByteBuffer after
+ // sendFrame() or sendAudio() call, our buffer will stay intact
+ ByteBuffer buffer = ByteBuffer.allocate(data.remaining());
+ buffer.put(data);
+ buffer.flip();
+
+ try {
+ mOutputQueue.put(buffer);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
new file mode 100644
index 000000000..eb6b14e84
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
@@ -0,0 +1,337 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.streaming;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.SdlProxyBase;
+import com.smartdevicelink.proxy.interfaces.IProxyListenerBase;
+import com.smartdevicelink.proxy.interfaces.IPutFileResponseListener;
+import com.smartdevicelink.proxy.rpc.OnStreamRPC;
+import com.smartdevicelink.proxy.rpc.PutFile;
+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;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Hashtable;
+
+public class StreamRPCPacketizer extends AbstractPacketizer implements IPutFileResponseListener, Runnable{
+
+ private Integer iInitialCorrID = 0;
+ private Hashtable<Integer, OnStreamRPC> notificationList = new Hashtable<Integer, OnStreamRPC>();
+ private Thread thread = null;
+ private long lFileSize = 0;
+ private String sFileName;
+ private SdlProxyBase<IProxyListenerBase> _proxy;
+ private IProxyListenerBase _proxyListener;
+
+ private Object mPauseLock;
+ private boolean mPaused;
+ private boolean isRPCProtected = false;
+ 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);
+ 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();
+ }
+ }
+
+ 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) {
+ thread = new Thread(this);
+ thread.start();
+ }
+ }
+
+ @Override
+ public void stop() {
+ try {
+ is.close();
+ } catch (IOException ignore) {}
+ if (thread != null)
+ {
+ thread.interrupt();
+ thread = null;
+ }
+ }
+
+ private void handleStreamSuccess(RPCResponse rpc, Long iSize)
+ {
+ StreamRPCResponse result = new StreamRPCResponse();
+ result.setSuccess(rpc.getSuccess());
+ result.setResultCode(rpc.getResultCode());
+ result.setInfo(rpc.getInfo());
+ result.setFileName(sFileName);
+ result.setFileSize(iSize);
+ result.setCorrelationID(iInitialCorrID);
+ if (_proxyListener != null)
+ _proxyListener.onStreamRPCResponse(result);
+ stop();
+ _proxy.remPutFileResponseListener(this);
+ return;
+ }
+
+ private void handleStreamException(RPCResponse rpc, Exception e, String error)
+ {
+ StreamRPCResponse result = new StreamRPCResponse();
+ result.setFileName(sFileName);
+ result.setCorrelationID(iInitialCorrID);
+ if (rpc != null)
+ {
+ result.setSuccess(rpc.getSuccess());
+ result.setResultCode(rpc.getResultCode());
+ result.setInfo(rpc.getInfo());
+ }
+ else
+ {
+ result.setSuccess(false);
+ result.setResultCode(Result.GENERIC_ERROR);
+ String sException = "";
+
+ if (e != null)
+ sException = sException + " " + e.toString();
+
+ sException = sException + " " + error;
+ result.setInfo(sException);
+ }
+ if (_proxyListener != null)
+ _proxyListener.onStreamRPCResponse(result);
+ if (e != null)
+ e.printStackTrace();
+ stop();
+ _proxy.remPutFileResponseListener(this);
+ return;
+ }
+
+ @Override
+ public void pause() {
+ synchronized (mPauseLock) {
+ mPaused = true;
+ }
+ }
+
+ @Override
+ public void resume() {
+ synchronized (mPauseLock) {
+ mPaused = false;
+ mPauseLock.notifyAll();
+ }
+ }
+
+ public void run() {
+ int length;
+ byte[] msgBytes;
+ ProtocolMessage pm;
+ OnStreamRPC notification;
+
+ // Moves the current Thread into the background
+ android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
+
+ try {
+
+ int iCorrID = 0;
+ PutFile msg = (PutFile) _request;
+ sFileName = msg.getSdlFileName();
+ long iOffsetCounter = msg.getOffset();
+
+ int priorityCoefficient = 1;
+
+ if (lFileSize != 0)
+ {
+ Long iFileSize = (long) lFileSize;
+ //TODO: PutFile RPC needs to be updated to accept Long as we might run into overflows since a Long can store a wider range than an Integer
+ msg.setLength(iFileSize);
+ }
+ Long iFileLength = msg.getLength();
+
+ notificationList.clear();
+
+ //start reading from the stream at the given offset
+ long iSkipBytes = is.skip(iOffsetCounter);
+
+ if (iOffsetCounter != iSkipBytes)
+ {
+ handleStreamException(null,null," Error, PutFile offset invalid for file: " + sFileName);
+ }
+ if(callBack!=null){
+ callBack.onStart(_request.getCorrelationID(), lFileSize);
+ }
+ while (!Thread.interrupted()) {
+
+ synchronized (mPauseLock)
+ {
+ while (mPaused)
+ {
+ try
+ {
+ mPauseLock.wait();
+ }
+ catch (InterruptedException e) {}
+ }
+ }
+
+ length = is.read(buffer, 0, bufferSize);
+
+ if (length == -1)
+ stop();
+
+ if (length >= 0) {
+
+ if (msg.getOffset() != 0)
+ msg.setLength((Long)null); //only need to send length when offset 0
+
+ msg.format(rpcSpecVersion,true);
+ msgBytes = JsonRPCMarshaller.marshall(msg, (byte)_wiproVersion.getMajor());
+ pm = new ProtocolMessage();
+ pm.setData(msgBytes);
+
+ pm.setSessionID(_rpcSessionID);
+ pm.setMessageType(MessageType.RPC);
+ pm.setSessionType(_serviceType);
+ pm.setFunctionID(FunctionID.getFunctionId(msg.getFunctionName()));
+
+ if (buffer.length != length)
+ pm.setBulkData(buffer, length);
+ else
+ pm.setBulkDataNoCopy(buffer);
+
+ pm.setCorrID(msg.getCorrelationID());
+ pm.setPayloadProtected(isRPCProtected);
+ priorityCoefficient++;
+ pm.setPriorityCoefficient(priorityCoefficient);
+
+ notification = new OnStreamRPC();
+ notification.setFileName(msg.getSdlFileName());
+ notification.setFileSize(iFileLength);
+ iOffsetCounter = iOffsetCounter + length;
+ notification.setBytesComplete(iOffsetCounter);
+ notificationList.put(msg.getCorrelationID(),notification);
+
+ msg.setOffset(iOffsetCounter);
+ iCorrID = msg.getCorrelationID() + 1;
+ msg.setCorrelationID(iCorrID);
+
+ _streamListener.sendStreamPacket(pm);
+ }
+ }
+ } catch (Exception e) {
+ handleStreamException(null, e, "");
+ }
+ }
+
+ @Override
+ public void onPutFileResponse(PutFileResponse response)
+ {
+
+ OnStreamRPC streamNote = notificationList.get(response.getCorrelationID());
+ if (streamNote == null) return;
+
+ if (response.getSuccess())
+ {
+ if(callBack!=null){
+ callBack.onUpdate(response.getCorrelationID(), streamNote.getBytesComplete(), lFileSize);
+ }
+ if (_proxyListener != null){
+ _proxyListener.onOnStreamRPC(streamNote);
+ }
+
+ }
+ else
+ {
+ if(callBack!=null){
+ callBack.onError(response.getCorrelationID(), response.getResultCode(), response.getInfo());
+ }
+ handleStreamException(response, null, "");
+
+ }
+
+ if (response.getSuccess() && streamNote.getBytesComplete().equals(streamNote.getFileSize()) )
+ {
+ if(callBack!=null){
+ callBack.onResponse(iInitialCorrID, response, streamNote.getBytesComplete());
+ }
+ handleStreamSuccess(response, streamNote.getBytesComplete());
+
+ }
+ }
+
+ @Override
+ public void onPutFileStreamError(Exception e, String info)
+ {
+ if (thread != null)
+ handleStreamException(null, e, info);
+
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java
index 8af6b1c59..8af6b1c59 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java b/android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java
new file mode 100644
index 000000000..70ee2b547
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java
@@ -0,0 +1,500 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace;
+
+import android.annotation.SuppressLint;
+import android.bluetooth.BluetoothDevice;
+import android.os.Build;
+import android.os.Debug;
+import android.os.Process;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
+import com.smartdevicelink.protocol.enums.FrameType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.trace.enums.DetailLevel;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+import com.smartdevicelink.trace.enums.Mod;
+import com.smartdevicelink.transport.SiphonServer;
+import com.smartdevicelink.util.BitConverter;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.NativeLogTool;
+
+import java.sql.Timestamp;
+
+/* This class handles the global TraceSettings as requested by the users either through the combination of the following
+ 1. System defaults
+ 2. Application XML config
+ 3. Programmatic requests from application itself
+
+ It is manifested in the <SmartDeviceLink>...</SmartDeviceLink> tags
+ */
+
+@SuppressLint("DefaultLocale")
+public class SdlTrace {
+ private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
+
+ public static final String SYSTEM_LOG_TAG = "SdlTrace";
+
+ private static long baseTics = java.lang.System.currentTimeMillis();
+ private static boolean acceptAPITraceAdjustments = true;
+
+ protected static ISTListener m_appTraceListener = null;
+
+ ///
+ /// The PUBLIC interface to SdlTrace starts here
+ ///
+
+
+ public static void setAcceptAPITraceAdjustments(Boolean APITraceAdjustmentsAccepted) {
+ if (APITraceAdjustmentsAccepted != null) {
+ acceptAPITraceAdjustments = APITraceAdjustmentsAccepted;
+ }
+ }
+
+ public static boolean getAcceptAPITraceAdjustments() {
+ return acceptAPITraceAdjustments;
+ }
+
+ public static void setAppTraceListener(ISTListener listener) {
+ m_appTraceListener = listener;
+ } // end-method
+
+ public static void setAppTraceLevel(DetailLevel dt) {
+ if ( dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.app, dt);
+ } // end-method
+
+ public static void setProxyTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.proxy, dt);
+ } // end-method
+
+ public static void setRpcTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.rpc, dt);
+ } // end-method
+
+ public static void setMarshallingTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.mar, dt);
+ } // end-method
+
+ public static void setProtocolTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.proto, dt);
+ } // end-method
+
+ public static void setTransportTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.tran, dt);
+ } // end-method
+
+ private static String encodeTraceMessage(long timestamp, Mod module, InterfaceActivityDirection msgDirection, String msgBodyXml) {
+ StringBuilder sb = new StringBuilder("<msg><dms>");
+ sb.append(timestamp);
+ sb.append("</dms><pid>");
+ sb.append(Process.myPid());
+ sb.append("</pid><tid>");
+ sb.append(Thread.currentThread().getId());
+ sb.append("</tid><mod>");
+ sb.append(module.toString());
+ sb.append("</mod>");
+ if (msgDirection != InterfaceActivityDirection.None) {
+ sb.append("<dir>");
+ sb.append(interfaceActivityDirectionToString(msgDirection));
+ sb.append("</dir>");
+ } // end-if
+ sb.append(msgBodyXml);
+ sb.append("</msg>");
+
+ return sb.toString();
+ } // end-method
+
+ private static String interfaceActivityDirectionToString(InterfaceActivityDirection iaDirection) {
+ String str = "";
+ switch (iaDirection) {
+ case Receive:
+ str = "rx";
+ break;
+ case Transmit:
+ str = "tx";
+ break;
+ default:
+ break;
+ } // end-switch
+ return str;
+ } // end-method
+
+ static String B64EncodeForXML(String data) {
+ return Mime.base64Encode(data);
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: return Base64.encodeToString(data.getBytes(), Base64.DEFAULT);
+ } // end-method
+
+ public static boolean logProxyEvent(String eventText, String token) {
+ if (DiagLevel.getLevel(Mod.proxy) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ String msg = SdlTrace.B64EncodeForXML(eventText);
+ String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proxy, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logAppEvent(String eventText) {
+ if (DiagLevel.getLevel(Mod.app) == DetailLevel.OFF) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ String msg = SdlTrace.B64EncodeForXML(eventText);
+ String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.app, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logRPCEvent(InterfaceActivityDirection msgDirection, RPCMessage rpcMsg, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.rpc);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.rpc, msgDirection, rpc2Xml(dl, rpcMsg));
+ return writeXmlTraceMessage(xml);
+ }
+
+ private static String rpc2Xml(DetailLevel dl, RPCMessage rpcMsg) {
+ StringBuilder rpcAsXml = new StringBuilder();
+ rpcAsXml.append("<op>");
+ rpcAsXml.append(rpcMsg.getFunctionName());
+ rpcAsXml.append("</op>");
+ boolean hasCorrelationID = false;
+ Integer correlationID = -1;
+ if (rpcMsg instanceof RPCRequest) {
+ hasCorrelationID = true;
+ correlationID = ((RPCRequest)rpcMsg).getCorrelationID();
+ } else if (rpcMsg instanceof RPCResponse) {
+ hasCorrelationID = true;
+ correlationID = ((RPCResponse)rpcMsg).getCorrelationID();
+ } // end-if
+ if (hasCorrelationID) {
+ rpcAsXml.append("<cid>");
+ rpcAsXml.append(correlationID);
+ rpcAsXml.append("</cid>");
+ } // end-if
+ rpcAsXml.append("<type>");
+ rpcAsXml.append(rpcMsg.getMessageType());
+ rpcAsXml.append("</type>");
+ //rpcAsXml.append(newline);
+
+ if (dl == DetailLevel.VERBOSE) {
+ OpenRPCMessage orpcmsg = new OpenRPCMessage(rpcMsg);
+ String rpcParamList = orpcmsg.msgDump();
+ String msg = SdlTrace.B64EncodeForXML(rpcParamList);
+ rpcAsXml.append("<d>");
+ rpcAsXml.append(msg);
+ rpcAsXml.append("</d>");
+ } // end-if
+ return rpcAsXml.toString();
+ } // end-method
+
+ public static boolean logMarshallingEvent(InterfaceActivityDirection msgDirection, byte[] marshalledMessage, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.mar);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ StringBuilder msg = new StringBuilder();
+ msg.append("<sz>");
+ msg.append(marshalledMessage.length);
+ msg.append("</sz>");
+ if (dl == DetailLevel.VERBOSE) {
+ msg.append("<d>");
+ msg.append(Mime.base64Encode(marshalledMessage));
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: msg.append(Base64.encodeToString(marshalledMessage, Base64.DEFAULT));
+ msg.append("</d>");
+ }
+ String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.mar, msgDirection, msg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logProtocolEvent(InterfaceActivityDirection frameDirection, SdlPacket packet, int frameDataOffset, int frameDataLength, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.proto);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ StringBuffer protoMsg = new StringBuffer();
+ protoMsg.append("<frame>");
+ protoMsg.append(SdlTrace.getProtocolFrameHeaderInfo(packet));
+ if (dl == DetailLevel.VERBOSE) {
+ if (packet.getPayload() != null && frameDataLength > 0) {
+ protoMsg.append("<d>");
+ String bytesInfo = "";
+ bytesInfo = Mime.base64Encode(packet.getPayload(), frameDataOffset, frameDataLength);
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: bytesInfo = Base64.encodeToString(frameData, frameDataOffset, frameDataLength, Base64.DEFAULT);
+ protoMsg.append(bytesInfo);
+ protoMsg.append("</d>");
+ }
+ }
+ protoMsg.append("</frame>");
+ String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proto, frameDirection, protoMsg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ private static String getProtocolFrameType(FrameType f) {
+ if (f == FrameType.Control)
+ return "Control";
+ else if (f == FrameType.Consecutive)
+ return "Consecutive";
+ else if (f == FrameType.First)
+ return "First";
+ else if (f == FrameType.Single)
+ return "Single";
+
+ return "Unknown";
+ } // end-method
+
+ private static String getProtocolSessionType(SessionType serviceType) {
+ String s;
+ if (serviceType == SessionType.RPC )
+ s = "rpc";
+ else if (serviceType == SessionType.BULK_DATA)
+ s = "bulk";
+ else
+ s = "Unknown";
+ return s;
+ } // end-method
+
+ private static String getProtocolFrameHeaderInfo(SdlPacket hdr) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<hdr>");
+ sb.append("<ver>");
+ sb.append(hdr.getVersion());
+ sb.append("</ver><cmp>");
+ sb.append(hdr.isEncrypted());
+ sb.append("</cmp><ft>");
+ sb.append(getProtocolFrameType(hdr.getFrameType()));
+ sb.append("</ft><st>");
+ sb.append(getProtocolSessionType(SessionType.valueOf((byte)hdr.getServiceType())));
+ sb.append("</st><sid>");
+ sb.append(hdr.getSessionId());
+ sb.append("</sid><sz>");
+ sb.append(hdr.getDataSize());
+ sb.append("</sz>");
+
+ int frameData = hdr.getFrameInfo();
+ if (hdr.getFrameType() == FrameType.Control) {
+ sb.append("<ca>");
+ if (frameData == FrameDataControlFrameType.StartSession.getValue())
+ sb.append("StartSession");
+ else if (frameData == FrameDataControlFrameType.StartSessionACK.getValue())
+ sb.append("StartSessionACK");
+ else if (frameData == FrameDataControlFrameType.StartSessionNACK.getValue())
+ sb.append("StartSessionNACK");
+ else if (frameData == FrameDataControlFrameType.EndSession.getValue())
+ sb.append("EndSession");
+ sb.append("</ca>");
+ } else if (hdr.getFrameType() == FrameType.Consecutive ) {
+ sb.append("<fsn>");
+ if (frameData == 0 )
+ sb.append("lastFrame");
+ else
+ sb.append(String.format("%02X",frameData));
+ sb.append("</fsn>");
+ } else if (hdr.getFrameType() == FrameType.First ) {
+ int totalSize = BitConverter.intFromByteArray(hdr.getPayload(), 0);
+ int numFrames = BitConverter.intFromByteArray(hdr.getPayload(), 4);
+ sb.append("<total>" + totalSize + "</total><numframes>" + numFrames + "</numframes>");
+ } else if (hdr.getFrameType() == FrameType.Single ) {
+ sb.append("<single/>");
+ }
+
+ sb.append("</hdr>");
+
+ return sb.toString();
+ } // end-method
+
+ public static String getBTDeviceInfo(BluetoothDevice btDevice) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<btp>");
+ String btdn = btDevice.getName();
+ sb.append("<btn>");
+ sb.append(SdlTrace.B64EncodeForXML(btdn));
+ sb.append("</btn>");
+ sb.append("<bta>" + btDevice.getAddress() + "</bta>");
+ sb.append("<bts>" + btDevice.getBondState() + "</bts>");
+ sb.append("</btp>");
+ return sb.toString();
+ } // end-method
+
+ public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int byteLength, String token) {
+ return logTransportEvent(preamble, transportSpecificInfoXml, msgDirection, buf, 0, byteLength, token);
+ }
+
+ private static void checkB64(String x, byte[] buf, int offset, int byteLength) {
+ if ((x.length() % 4) != 0) {
+ NativeLogTool.logWarning(SdlTrace.SYSTEM_LOG_TAG, "b64 string length (" + x.length() + ") isn't multiple of 4: buf.length=" + buf.length + ", offset=" + offset + ", len=" + byteLength);
+ } // end-if
+ } // end-method
+
+ public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int offset, int byteLength, String token) {
+ if (DiagLevel.getLevel(Mod.tran) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ StringBuilder msg = new StringBuilder();
+ if (transportSpecificInfoXml != null && transportSpecificInfoXml.length() > 0) {
+ msg.append(transportSpecificInfoXml);
+ }
+ if (preamble != null && preamble.length() > 0) {
+ msg.append("<desc>");
+ msg.append(preamble);
+ msg.append("</desc>");
+ }
+ if (buf != null) {
+ msg.append("<sz>");
+ msg.append(byteLength);
+ msg.append("</sz>");
+ DetailLevel dl = DiagLevel.getLevel(Mod.tran);
+ if (dl == DetailLevel.VERBOSE) {
+ if (buf != null && byteLength > 0) {
+ msg.append("<d>");
+ String bytesInfo = Mime.base64Encode(buf, offset, byteLength);
+ checkB64(bytesInfo, buf, offset, byteLength);
+ msg.append(bytesInfo);
+ msg.append("</d>");
+ }
+ }
+ }
+ String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.tran, msgDirection, msg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ // Package-scoped
+ static long getBaseTicsDelta() {
+ return java.lang.System.currentTimeMillis() - getBaseTics();
+ }
+
+ // Package-scoped
+ static long getBaseTics() {
+ return baseTics;
+ } // end-method
+
+ public static Boolean writeMessageToSiphonServer(String info) {
+ return SiphonServer.sendFormattedTraceMessage(info);
+ }
+
+ private static boolean writeXmlTraceMessage(String msg) {
+ try {
+ // Attempt to write formatted message to the Siphon
+ if (false == writeMessageToSiphonServer(msg)) {
+ // If writing to the Siphon fails, write to the native log
+ NativeLogTool.logInfo(SdlTrace.SYSTEM_LOG_TAG, msg);
+ return false;
+ }
+
+ ISTListener localTraceListener = m_appTraceListener;
+
+ if (localTraceListener != null) {
+ try {
+ localTraceListener.logXmlMsg(msg, SDL_LIB_TRACE_KEY);
+ } catch (Exception ex) {
+ DebugTool.logError("Failure calling ISTListener: " + ex.toString(), ex);
+ return false;
+ }
+ }
+ } catch (Exception ex) {
+ NativeLogTool.logError(SdlTrace.SYSTEM_LOG_TAG, "Failure writing XML trace message: " + ex.toString());
+ return false;
+ }
+ return true;
+ }
+
+ // Package-scoped
+ @SuppressWarnings("deprecation")
+ public static String getLogHeader(String dumpReason, int seqNo) {
+ final String Sep = "-";
+ StringBuilder write = new StringBuilder("<?xml version=\"1.0\"?>" + "<logs>");
+ write.append("<info>");
+ StringBuilder infoBlock = new StringBuilder();
+ String hostInfo = Build.BRAND + Sep + Build.MANUFACTURER + Sep + Build.MODEL + "(" + Build.HOST + ")";
+ infoBlock.append("<host>" + SdlTrace.B64EncodeForXML(hostInfo) + "</host>");
+ String osv = Build.VERSION.RELEASE + " (" + Build.VERSION.CODENAME + ")";
+ infoBlock.append("<osv>" + SdlTrace.B64EncodeForXML(osv) + "</osv>");
+ infoBlock.append(TraceDeviceInfo.getTelephonyHeader());
+
+ long heapSize = Debug.getNativeHeapFreeSize() / 1024;
+ long heapAllocated = Debug.getNativeHeapAllocatedSize() / 1024;
+ infoBlock.append("<mem><hf>" + heapSize + "KB</hf><ha>" + heapAllocated + "KB</ha></mem>");
+ infoBlock.append("<np>" + Runtime.getRuntime().availableProcessors() + "</np>");
+ infoBlock.append("<pid>" + Process.myPid() + "</pid>");
+ infoBlock.append("<tid>" + Thread.currentThread().getId() + "</tid>");
+
+ // String dateStamp = (String)
+ // DateFormat.format("yy-MM-dd hh:mm:ss SSS", new Timestamp(baseTics));
+ Timestamp stamp = new Timestamp(SdlTrace.getBaseTics());
+ String GMTtime = stamp.toGMTString().substring(0, 19);
+ long fracSec = stamp.getNanos() / 1000000; // divide by a million
+ String fracSecStr = String.format("%03d", fracSec);
+ infoBlock.append("<utc>" + GMTtime + "." + fracSecStr + "</utc>");
+
+ infoBlock.append(TraceDeviceInfo.getLogHeaderBluetoothPairs());
+ infoBlock.append(getSmartDeviceLinkTraceRoot(dumpReason, seqNo));
+
+ write.append(infoBlock);
+
+ write.append("</info>" + "<msgs>");
+ return write.toString();
+ } // end-method
+
+ private static String getSmartDeviceLinkTraceRoot(String dumpReason, int seqNo) {
+ StringBuilder write = new StringBuilder("<SmartDeviceLinktraceroot>" + "<sequencenum>" + seqNo
+ + "</sequencenum>" + "<dumpreason>" + dumpReason
+ + "</dumpreason><tracelevel>");
+
+ write.append("<tran>" + DiagLevel.getLevel(Mod.tran) + "</tran>");
+ write.append("<proto>" + DiagLevel.getLevel(Mod.proto) + "</proto>");
+ write.append("<mar>" + DiagLevel.getLevel(Mod.mar) + "</mar>");
+ write.append("<rpc>" + DiagLevel.getLevel(Mod.rpc) + "</rpc>");
+ write.append("<proxy>" + DiagLevel.getLevel(Mod.proxy) + "</proxy>");
+ write.append("<app>" + DiagLevel.getLevel(Mod.app) + "</app>");
+
+ write.append("</tracelevel>");
+ write.append("</SmartDeviceLinktraceroot>");
+ return write.toString();
+ } // end-method
+} // end-class \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java b/android/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java
new file mode 100644
index 000000000..587a6ae2b
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ *
+ */
+package com.smartdevicelink.trace;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.telephony.TelephonyManager;
+
+import com.smartdevicelink.util.DebugTool;
+
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author vvolkman
+ *
+ */
+public class TraceDeviceInfo {
+ // http://developer.android.com/guide/topics/data/data-storage.html
+
+ private static TelephonyManager m_telephonyManager;
+
+ // Constructor
+ public TraceDeviceInfo(TelephonyManager telephonyManager) {
+ m_telephonyManager = telephonyManager;
+ }
+
+ public static void setTelephonyManager(TelephonyManager telephonyManager) {
+ m_telephonyManager = telephonyManager;
+ }
+
+ public static TelephonyManager getTelephonyManager() {
+ return m_telephonyManager;
+ }
+
+ // package scoped
+ static String getTelephonyHeader() {
+ // Telephony manager can tell us a few things...
+ String info = "";
+
+ if (m_telephonyManager != null) {
+ try { // getDeviceId() requires android.permission.READ_PHONE_STATE
+ info = "<deviceid>" + m_telephonyManager.getDeviceId() + "</deviceid>";
+ } catch (Exception e1) {
+ DebugTool.logError("Failure getting telephony device ID: " + e1.toString(), e1);
+ }
+
+ info = "<pt>";
+ switch (m_telephonyManager.getPhoneType()) {
+ case TelephonyManager.PHONE_TYPE_NONE:
+ info += "NONE";
+ break;
+ case TelephonyManager.PHONE_TYPE_GSM:
+ info += "GSM";
+ break;
+ case TelephonyManager.PHONE_TYPE_CDMA:
+ info += "CDMA";
+ break;
+ default:
+ info += "UNKNOWN";
+ } // end-switch
+
+ info += "</pt>" + "<nt>";
+
+ switch (m_telephonyManager.getNetworkType()) {
+ case TelephonyManager.NETWORK_TYPE_UNKNOWN:
+ info += "UKNOWN";
+ break;
+ case TelephonyManager.NETWORK_TYPE_GPRS:
+ info += "GPRS";
+ break;
+ case TelephonyManager.NETWORK_TYPE_EDGE:
+ info += "EDGE";
+ break;
+ case TelephonyManager.NETWORK_TYPE_UMTS:
+ info += "UMTS";
+ break;
+ case TelephonyManager.NETWORK_TYPE_HSDPA:
+ info += "HSDPA";
+ break;
+ case TelephonyManager.NETWORK_TYPE_HSUPA:
+ info += "HSUPA";
+ break;
+ case TelephonyManager.NETWORK_TYPE_HSPA:
+ info += "HSPA";
+ break;
+ case TelephonyManager.NETWORK_TYPE_CDMA:
+ info += "CDMA";
+ break;
+ case TelephonyManager.NETWORK_TYPE_EVDO_0:
+ info += "EVDO_O";
+ break;
+ case TelephonyManager.NETWORK_TYPE_EVDO_A:
+ info += "EVDO_A";
+ break;
+ case TelephonyManager.NETWORK_TYPE_1xRTT:
+ info += "1xRTT";
+ break;
+ default:
+ info += "UNKNOWN";
+ break;
+ } // end-switch
+
+ info += "</nt>";
+ } // end-if
+ return info;
+ } // end-method
+
+ // Package scoped
+ static String getLogHeaderBluetoothPairs() {
+ Set<BluetoothDevice> btDevices = BluetoothAdapter.getDefaultAdapter()
+ .getBondedDevices();
+
+ StringBuilder write = new StringBuilder("<btpairs>");
+ Iterator<BluetoothDevice> iter = btDevices.iterator();
+ while (iter.hasNext()) {
+ write.append(SdlTrace.getBTDeviceInfo(iter.next()));
+ }
+ write.append("</btpairs>");
+
+ return write.toString();
+ } // end-method
+} // end-class \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java
new file mode 100644
index 000000000..bc204ebaf
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java
@@ -0,0 +1,585 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothServerSocket;
+import android.bluetooth.BluetoothSocket;
+import android.os.Build;
+import android.os.Build.VERSION;
+
+import com.smartdevicelink.SdlConnection.SdlConnection;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.trace.SdlTrace;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.DebugTool;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.util.UUID;
+
+/**
+ * Bluetooth Transport Implementation. This transport advertises its existence to SDL by publishing an SDP record and waiting for an incoming connection from SDL. Connection is verified by checking for the SDL UUID. For more detailed information please refer to the <a href="#bluetoothTransport">Bluetooth Transport Guide</a>.
+ *
+ */
+@Deprecated
+public class BTTransport extends SdlTransport {
+ //936DA01F9ABD4D9D80C702AF85C822A8
+ private final static UUID SDL_V4_MOBILE_APPLICATION_SVC_CLASS = new UUID(0x936DA01F9ABD4D9DL, 0x80C702AF85C822A8L);
+
+ private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
+
+ private static final int READ_BUFFER_SIZE = 4096;
+
+ private BluetoothAdapter _adapter = null;
+ private BluetoothSocket _activeSocket = null;
+ private UUID _listeningServiceUUID = SDL_V4_MOBILE_APPLICATION_SVC_CLASS;
+ private BluetoothAdapterMonitor _bluetoothAdapterMonitor = null;
+ private TransportReaderThread _transportReader = null;
+ private OutputStream _output = null;
+ private BluetoothServerSocket _serverSocket = null;
+
+ private String sComment = "";
+ private boolean bKeepSocketActive = true;
+
+ // Boolean to monitor if the transport is in a disconnecting state
+ private boolean _disconnecting = false;
+
+ private final Object DISCONNECT_LOCK = new Object();
+
+ public BTTransport(ITransportListener transportListener) {
+ super(transportListener);
+ } // end-ctor
+
+ public BTTransport(ITransportListener transportListener, boolean bKeepSocket) {
+ super(transportListener);
+ bKeepSocketActive = bKeepSocket;
+ } // end-ctor
+
+ @Deprecated
+ public BluetoothSocket getBTSocket(BluetoothServerSocket bsSocket){
+
+ if(bsSocket == null || Build.VERSION.SDK_INT > Build.VERSION_CODES.O) { //Reflection is no longer allowed on SDK classes)
+ return null;
+ }
+
+ Field[] f = bsSocket.getClass().getDeclaredFields();
+
+ @SuppressWarnings("unused")
+ int channel = -1;
+
+ BluetoothSocket mySocket = null;
+
+ for (Field field : f) {
+ if(field.getName().equals("mSocket")){
+ field.setAccessible(true);
+ try {
+
+ mySocket = (BluetoothSocket) field.get(bsSocket);
+ return mySocket;
+ //channel = field.getInt(bsSocket);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ field.setAccessible(false);
+ }
+ }
+
+ return null;
+ }
+
+ @Deprecated
+ public int getChannel(BluetoothSocket bsSocket){
+
+ int channel = -1;
+ if (bsSocket == null || Build.VERSION.SDK_INT > Build.VERSION_CODES.O){ //Reflection is no longer allowed on SDK classes
+ return channel;
+ }
+
+ Field[] f = bsSocket.getClass().getDeclaredFields();
+
+ for (Field field : f) {
+ if(field.getName().equals("mPort")){
+ field.setAccessible(true);
+ try {
+
+
+ channel = field.getInt(bsSocket);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ field.setAccessible(false);
+ }
+ }
+
+ return channel;
+ }
+
+
+ /* private BluetoothServerSocket getBluetoothServerSocket() throws IOException {
+ BluetoothServerSocket tmp;
+
+ BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+
+
+ try {
+ // compatibility with pre SDK 10 devices
+ Method listener = mBluetoothAdapter.getClass().getMethod(
+ "listenUsingRfcommWithServiceRecord", String.class, UUID.class);
+ tmp = (BluetoothServerSocket) listener.invoke(mBluetoothAdapter, "SdlProxy", _listeningServiceUUID);
+
+ } catch (NoSuchMethodException e) {
+
+ throw new IOException(e);
+ } catch (InvocationTargetException e) {
+ throw new IOException(e);
+ } catch (IllegalAccessException e) {
+ throw new IOException(e);
+ }
+
+ return tmp;
+ }*/
+
+
+ public void openConnection () throws SdlException {
+ if (_serverSocket != null) {
+ return;
+ }
+
+ // Get the device's default Bluetooth Adapter
+ _adapter = BluetoothAdapter.getDefaultAdapter();
+
+
+ // Test if Adapter exists
+ if (_adapter == null) {
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("No Bluetooth adapter found. Bluetooth adapter must exist to communicate with SDL.", SdlExceptionCause.BLUETOOTH_ADAPTER_NULL);
+ }
+
+ // Test if Bluetooth is enabled
+ try {
+ if (!_adapter.isEnabled()) {
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("Bluetooth adapter must be enabled to instantiate a SdlProxy object.", SdlExceptionCause.BLUETOOTH_DISABLED);
+ }
+ } catch (SecurityException e) {
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("Insufficient permissions to interact with the Bluetooth Adapter.", SdlExceptionCause.PERMISSION_DENIED);
+ }
+
+ // Start BluetoothAdapterMonitor to ensure the Bluetooth Adapter continues to be enabled
+ _bluetoothAdapterMonitor = new BluetoothAdapterMonitor(_adapter);
+
+ try {
+ _serverSocket = _adapter.listenUsingRfcommWithServiceRecord("SdlProxy", _listeningServiceUUID);
+ BluetoothSocket mySock = getBTSocket(_serverSocket);
+ int iSocket = getChannel(mySock);
+
+ sComment = "Accepting Connections on SDP Server Port Number: " + iSocket + "\r\n";
+ sComment += "Keep Server Socket Open: " + bKeepSocketActive;
+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O && iSocket < 0)
+ {
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("Could not open connection to SDL.", SdlExceptionCause.BLUETOOTH_SOCKET_UNAVAILABLE);
+ }
+ } catch (IOException e) {
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("Could not open connection to SDL.", SdlExceptionCause.BLUETOOTH_SOCKET_UNAVAILABLE);
+
+ } catch (Exception ex) {
+
+ // Test to determine if the bluetooth has been disabled since last check
+ if (!_adapter.isEnabled()) {
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("Bluetooth adapter must be on to instantiate a SdlProxy object.", SdlExceptionCause.BLUETOOTH_DISABLED);
+ }
+
+ if(ex instanceof SdlException && ((SdlException) ex).getSdlExceptionCause() == SdlExceptionCause.BLUETOOTH_SOCKET_UNAVAILABLE) {
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("Could not open connection to SDL.", SdlExceptionCause.BLUETOOTH_SOCKET_UNAVAILABLE);
+
+ }
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("Could not open connection to SDL.", ex, SdlExceptionCause.SDL_CONNECTION_FAILED);
+ }
+
+ // Test to ensure serverSocket is not null
+ if (_serverSocket == null) {
+ SdlConnection.enableLegacyMode(false, null);
+ throw new SdlException("Could not open connection to SDL.", SdlExceptionCause.SDL_CONNECTION_FAILED);
+ }
+
+ SdlTrace.logTransportEvent("BTTransport: listening for incoming connect to service ID " + _listeningServiceUUID, null, InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
+
+ // Setup transportReader thread
+ _transportReader = new TransportReaderThread();
+ _transportReader.setName("TransportReader");
+ _transportReader.setDaemon(true);
+ _transportReader.start();
+
+ // Initialize the SiphonServer
+ if (SiphonServer.getSiphonEnabledStatus()) {
+ SiphonServer.init();
+ }
+
+ } // end-method
+
+ public void disconnect() {
+ disconnect(null, null);
+ }
+
+ /**
+ * Destroys the transport between SDL and the mobile app
+ *
+ * @param msg
+ * @param ex
+ */
+ private void disconnect(String msg, Exception ex) {
+ synchronized(DISCONNECT_LOCK) {
+ // If already disconnecting, return
+ if (_disconnecting) {
+ // No need to recursively call
+ return;
+ }
+ _disconnecting = true;
+ }
+
+ String disconnectMsg = (msg == null ? "" : msg);
+ if (ex != null) {
+ disconnectMsg += ", " + ex.toString();
+ } // end-if
+
+ SdlTrace.logTransportEvent("BTTransport.disconnect: " + disconnectMsg, null, InterfaceActivityDirection.Transmit, null, 0, SDL_LIB_TRACE_KEY);
+
+ try {
+ if (_transportReader != null) {
+ _transportReader.halt();
+ _transportReader = null;
+ }
+ } catch (Exception e) {
+ DebugTool.logError("Failed to stop transport reader thread.", e);
+ } // end-catch
+
+ try {
+ if (_bluetoothAdapterMonitor != null) {
+ _bluetoothAdapterMonitor.halt();
+ _bluetoothAdapterMonitor = null;
+ }
+ } catch (Exception e) {
+ DebugTool.logError("Failed to stop adapter monitor thread.", e);
+ }
+
+ try {
+ if (_serverSocket != null) {
+ _serverSocket.close();
+ _serverSocket = null;
+ }
+ } catch (Exception e) {
+ DebugTool.logError("Failed to close serverSocket", e);
+ } // end-catch
+
+ try {
+ if (_activeSocket != null) {
+ _activeSocket.close();
+ _activeSocket = null;
+ }
+ } catch (Exception e) {
+ DebugTool.logError("Failed to close activeSocket", e);
+ } // end-catch
+
+
+
+ try {
+ if (_output != null) {
+ _output.close();
+ _output = null;
+ }
+ } catch (Exception e) {
+ DebugTool.logError("Failed to close output stream", e);
+ } // end-catch
+
+ if (ex == null) {
+ // This disconnect was not caused by an error, notify the proxy that
+ // the trasport has been disconnected.
+ handleTransportDisconnected(msg);
+ } else {
+ // This disconnect was caused by an error, notify the proxy
+ // that there was a transport error.
+ handleTransportError(msg, ex);
+ }
+ _disconnecting = false;
+ } // end-method
+
+
+ /**
+ * Sends data over the transport. Takes a byte array and transmits data provided starting at the
+ * offset and of the provided length to fragment transmission.
+ */
+ public boolean sendBytesOverTransport(SdlPacket packet) {
+ boolean sendResult = false;
+ try {
+ byte[] msgBytes = packet.constructPacket();
+ _output.write(msgBytes, 0, msgBytes.length);
+ sendResult = true;
+ } catch (Exception ex) {
+ DebugTool.logError("Error writing to Bluetooth socket: " + ex.toString(), ex);
+ handleTransportError("Error writing to Bluetooth socket:", ex);
+ sendResult = false;
+ } // end-catch
+ return sendResult;
+ } // end-method
+
+
+
+ private class TransportReaderThread extends Thread {
+ private Boolean isHalted = false;
+ SdlPsm psm;
+ int bytesRead = 0;
+ byte[] buffer = new byte[READ_BUFFER_SIZE];
+ byte currentByte = -1;
+ boolean stateProgress = false;
+
+ private InputStream _input = null;
+
+
+ public TransportReaderThread(){
+ psm = new SdlPsm();
+ }
+ public void halt() {
+ isHalted = true;
+ }
+
+ private void acceptConnection() {
+ SdlTrace.logTransportEvent("BTTransport: Waiting for incoming RFCOMM connect", "", InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
+
+ try {
+ // Blocks thread until connection established.
+ _activeSocket = _serverSocket.accept();
+
+ // If halted after serverSocket.accept(), then return immediately
+ if (isHalted) {
+ return;
+ }
+
+ // Log info of the connected device
+ BluetoothDevice btDevice = _activeSocket.getRemoteDevice();
+ String btDeviceInfoXml = SdlTrace.getBTDeviceInfo(btDevice);
+ SdlTrace.logTransportEvent("BTTransport: RFCOMM Connection Accepted", btDeviceInfoXml, InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
+
+ _output = _activeSocket.getOutputStream();
+ _input = _activeSocket.getInputStream();
+
+ handleTransportConnected();
+
+ } catch (Exception e) {
+ if (!isHalted) {
+ // Only call disconnect if the thread has not been halted
+ clearInputStream();
+ // Check to see if Bluetooth was disabled
+ if (_adapter != null && !_adapter.isEnabled()) {
+ disconnect("Bluetooth Adapater has been disabled.", new SdlException("Bluetooth adapter must be enabled to instantiate a SdlProxy object.", e, SdlExceptionCause.BLUETOOTH_DISABLED));
+ } else {
+ disconnect("Failed to accept connection", e);
+ }
+ }
+ } finally {
+
+ if (!bKeepSocketActive && _serverSocket != null && !isHalted && (VERSION.SDK_INT > 0x00000010 /*VERSION_CODES.JELLY_BEAN*/) ) {
+ try {
+ _serverSocket.close();
+ } catch (IOException e) {
+ //do nothing
+ }
+ _serverSocket = null;
+ }
+ }
+ }
+
+ private void readFromTransport() {
+ try {
+ try {
+ bytesRead = _input.read(buffer);
+ } catch (Exception e) {
+ if (!isHalted) {
+ // Only call disconnect if the thread has not been halted
+ clearInputStream();
+ // Check to see if Bluetooth was disabled
+ if (_adapter != null && !_adapter.isEnabled()) {
+ disconnect("Bluetooth Adapater has been disabled.", new SdlException("Bluetooth adapter must be enabled to instantiate a SdlProxy object.", e, SdlExceptionCause.BLUETOOTH_DISABLED));
+ } else {
+ disconnect("Failed to read from Bluetooth transport.", e);
+ }
+ }
+ return;
+ } // end-catch
+
+ for (int i = 0; i < bytesRead; i++) {
+ currentByte = buffer[i];
+ stateProgress = psm.handleByte(currentByte);
+ if(!stateProgress){//We are trying to weed through the bad packet info until we get something
+ //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
+ psm.reset();
+ if(currentByte == -1){ //If we read a -1 and the psm didn't move forward, then there is a problem
+ if (!isHalted) {
+ // Only call disconnect if the thread has not been halted
+ DebugTool.logError("End of stream reached!");
+ disconnect("End of stream reached.", null);
+ }
+ }
+ }
+ if(psm.getState() == SdlPsm.FINISHED_STATE){
+ //Log.d(TAG, "Packet formed, sending off");
+ handleReceivedPacket((SdlPacket)psm.getFormedPacket());
+ //We put a trace statement in the message read so we can avoid all the extra bytes
+ psm.reset();
+ }
+ }
+
+ } catch (Exception excp) {
+ if (!isHalted) {
+ // Only call disconnect if the thread has not been halted
+ clearInputStream();
+ String errString = "Failure in BTTransport reader thread: " + excp.toString();
+ DebugTool.logError(errString, excp);
+ disconnect(errString, excp);
+ }
+ return;
+ } // end-catch
+ } // end-method
+
+ private void clearInputStream(){
+ try {
+ if (_input != null) {
+ _input.close();
+ _input = null;
+ }
+ } catch (Exception e) {
+ DebugTool.logError("Failed to close input stream", e);
+ } // end-catch
+ }
+
+ public void run() {
+ // acceptConnection blocks until the connection has been accepted
+ acceptConnection();
+ psm.reset();
+ while (!isHalted) {
+ readFromTransport();
+ }
+ }
+ }
+
+ private class BluetoothAdapterMonitor {
+ private boolean _isHalted = false;
+ private BluetoothAdapter _bluetoothAdapter = null;
+ private final String THREAD_NAME = "BluetoothAdapterMonitor";
+ private Thread _bluetoothAdapterMonitorThread = null;
+
+ public BluetoothAdapterMonitor(BluetoothAdapter bluetoothAdapter) {
+ if (bluetoothAdapter == null) {
+ throw new IllegalArgumentException("BluetoothAdapter cannot be null.");
+ }
+
+ // Set the bluetooth adapter
+ _bluetoothAdapter = bluetoothAdapter;
+
+ _bluetoothAdapterMonitorThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ while (!_isHalted) {
+ checkIfBluetoothAdapterDisabled();
+ try {
+ Thread.sleep(15000);
+ } catch (InterruptedException e) {
+ // Break if interrupted
+ break;
+ }
+ }
+ }
+ });
+ _bluetoothAdapterMonitorThread.setName(THREAD_NAME);
+ _bluetoothAdapterMonitorThread.setDaemon(true);
+ _bluetoothAdapterMonitorThread.start();
+ }
+
+ private void checkIfBluetoothAdapterDisabled() {
+ if (_bluetoothAdapter != null && !_bluetoothAdapter.isEnabled()) {
+ // Bluetooth adapter has been disabled, disconnect the transport
+ disconnect("Bluetooth adapter has been disabled.",
+ new SdlException("Bluetooth adapter must be enabled to instantiate a SdlProxy object.", SdlExceptionCause.BLUETOOTH_DISABLED));
+ }
+ }
+
+ public void halt() {
+ _isHalted = true;
+ _bluetoothAdapterMonitorThread.interrupt();
+ }
+ }
+
+ /**
+ * Overridden abstract method which returns specific type of this transport.
+ *
+ * @return Constant value - TransportType.BLUETOOTH.
+ *
+ * @see TransportType
+ */
+ public TransportType getTransportType() {
+ return TransportType.BLUETOOTH;
+ }
+
+ @Override
+ public String getBroadcastComment() {
+ return sComment;
+ }
+
+ @Override
+ protected void handleTransportDisconnected(String info) {
+ SdlConnection.enableLegacyMode(false, null);
+ super.handleTransportDisconnected(info);
+ }
+
+ @Override
+ protected void handleTransportError(String message, Exception ex) {
+ SdlConnection.enableLegacyMode(false, null);
+ super.handleTransportError(message, ex);
+ }
+
+} // end-class
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java
new file mode 100644
index 000000000..3b4123b3a
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.transport.enums.TransportType;
+
+/**
+ * Container of Bluetooth transport specific configuration.
+ */
+@Deprecated
+public final class BTTransportConfig extends BaseTransportConfig {
+
+ private boolean bKeepSocketActive = true;
+
+ /**
+ * Overridden abstract method which returns specific type of this transport configuration.
+ *
+ * @return Constant value TransportType.BLUETOOTH.
+ *
+ * @see TransportType
+ */
+ public TransportType getTransportType() {
+ return TransportType.BLUETOOTH;
+ }
+
+ public BTTransportConfig() {
+ this(true);
+ }
+
+ public BTTransportConfig(boolean shareConnection) {
+ super.shareConnection = shareConnection;
+ }
+
+ public void setKeepSocketActive(boolean bValue) {
+ bKeepSocketActive = bValue;
+ }
+
+ public boolean getKeepSocketActive() {
+ return bKeepSocketActive;
+ }
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java
index d1dc5cbb3..d1dc5cbb3 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
new file mode 100644
index 000000000..058fb0d7e
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
@@ -0,0 +1,870 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Note: This file has been modified from its original form.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.annotation.SuppressLint;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothServerSocket;
+import android.bluetooth.BluetoothSocket;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.util.Log;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.UUID;
+
+/**
+ * This class does all the work for setting up and managing Bluetooth
+ * connections with other devices. It has a thread that listens for
+ * incoming connections, a thread for connecting with a device, and a
+ * thread for performing data transmissions when connected.
+ *
+ * @author Joey Grover
+ *
+ */
+public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
+ //finals
+ private static final String TAG = "Bluetooth Transport";
+ private static final UUID SERVER_UUID= new UUID(0x936DA01F9ABD4D9DL, 0x80C702AF85C822A8L);
+ // Name for the SDP record when creating server socket
+ private static final String NAME_SECURE =" SdlRouterService";
+ // Key names received from the BluetoothSerialServer Handler
+ private static final long MS_TILL_TIMEOUT = 2500;
+ private static final int READ_BUFFER_SIZE = 4096;
+ private final Object THREAD_LOCK = new Object();;
+
+ protected static final String SHARED_PREFS = "sdl.bluetoothprefs";
+
+
+ // Member fields
+ private final BluetoothAdapter mAdapter = BluetoothAdapter.getDefaultAdapter();
+ private AcceptThread mSecureAcceptThread;
+ private ConnectThread mConnectThread;
+ private ConnectedThread mConnectedThread;
+ private ConnectedWriteThread mConnectedWriteThread;
+ private int mBluetoothLevel = 0;
+ Handler timeOutHandler;
+ Runnable socketRunable;
+ boolean keepSocketAlive = true;
+
+ /**
+ * Constructor. Prepares a new BluetoothChat session.
+ * @param handler A Handler to send messages back to the UI Activity
+ */
+ public MultiplexBluetoothTransport(Handler handler) {
+ super(handler, TransportType.BLUETOOTH);
+ //This will keep track of which method worked last night
+ mBluetoothLevel = SdlRouterService.getBluetoothPrefs(SHARED_PREFS);
+ }
+
+
+ /**
+ * This method has been deprecated. It will return an instance of MultiplexBluetoothTransport but <b>should not</b> be used.
+ * @param handler for receiving status messages from the transport
+ * @return an instance of MultiplexBluetoothTransport
+ * @deprecated
+ */
+ @Deprecated
+ public synchronized static MultiplexBluetoothTransport getBluetoothSerialServerInstance(Handler handler){
+ return new MultiplexBluetoothTransport(handler);
+ }
+ /**
+ * This method has been deprecated. It will return an instance of MultiplexBluetoothTransport but <b>should not</b> be used.
+ * @param handler for receiving status messages from the transport
+ * @param keepSocketAlive Flag for keeping the socket alive
+ * @return an instance of MultiplexBluetoothTransport
+ * @deprecated
+ */
+ @Deprecated
+ public synchronized static MultiplexBluetoothTransport getBluetoothSerialServerInstance(Handler handler, boolean keepSocketAlive){
+ MultiplexBluetoothTransport transport = new MultiplexBluetoothTransport(handler);
+ transport.setKeepSocketAlive(keepSocketAlive);
+ return transport;
+ }
+
+ /**
+ * This method has been deprecated. <b>It will always return null.</b>
+ * @return always null
+ * @deprecated
+ */
+ @Deprecated
+ public synchronized static MultiplexBluetoothTransport getBluetoothSerialServerInstance(){
+ return null;
+ }
+
+ //These methods are used so we can have a semi-static reference to the Accept Thread (Static reference inherited by housing class)
+ private synchronized AcceptThread getAcceptThread(){
+ return mSecureAcceptThread;
+ }
+ private synchronized void setAcceptThread(AcceptThread aThread){
+ mSecureAcceptThread = aThread;
+ }
+ protected synchronized void setStateManually(int state){
+ //Log.d(TAG, "Setting state from: " +mState + " to: " +state);
+ mState = state;
+ }
+
+ /**
+ * Return the current connection state. */
+ public synchronized int getState() {
+ return mState;
+ }
+
+ public void setKeepSocketAlive(boolean keepSocketAlive){
+ this.keepSocketAlive = keepSocketAlive;
+ }
+
+ /**
+ * Start the chat service. Specifically start AcceptThread to begin a
+ * session in listening (server) mode. Called by the Activity onResume() */
+ public synchronized void start() {
+ //Log.d(TAG, "Starting up Bluetooth Server to Listen");
+ // Cancel any thread attempting to make a connection
+ if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
+
+ // Cancel any thread currently running a connection
+ if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
+ if (mConnectedWriteThread != null) {mConnectedWriteThread.cancel(); mConnectedWriteThread = null;}
+
+
+
+ // Start the thread to listen on a BluetoothServerSocket
+ if (getAcceptThread() == null
+ && mAdapter != null
+ && mAdapter.isEnabled()) {
+ //Log.d(TAG, "Secure thread was null, attempting to create new");
+ setAcceptThread(new AcceptThread(true));
+ if(getAcceptThread()!=null){
+ setState(STATE_LISTEN);
+ getAcceptThread().start();
+ }
+ }
+ }
+
+ /**
+ * Start the ConnectThread to initiate a connection to a remote device.
+ * @param device The BluetoothDevice to connect
+ */
+ public synchronized void connect(BluetoothDevice device) {
+ // Cancel any thread attempting to make a connection
+ if (mState == STATE_CONNECTING) {
+ if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
+ }
+
+ // Cancel any thread currently running a connection
+ if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
+ if (mConnectedWriteThread != null) {mConnectedWriteThread.cancel(); mConnectedWriteThread = null;}
+
+
+ // Cancel the accept thread because we only want to connect to one device
+ if (mSecureAcceptThread != null) {
+ mSecureAcceptThread.cancel();
+ mSecureAcceptThread = null;
+ }
+
+ // Start the thread to connect with the given device
+ mConnectThread = new ConnectThread(device);
+ mConnectThread.start();
+ setState(STATE_CONNECTING);
+ }
+
+ /**
+ * Start the ConnectedThread to begin managing a Bluetooth connection
+ * @param socket The BluetoothSocket on which the connection was made
+ * @param device The BluetoothDevice that has been connected
+ */
+ public synchronized void connected(BluetoothSocket socket, BluetoothDevice device) {
+ // Cancel the thread that completed the connection
+ if (mConnectThread != null) {
+ mConnectThread.cancel();
+ mConnectThread = null;
+ }
+
+ // Cancel any thread currently running a connection
+ if (mConnectedThread != null) {
+ mConnectedThread.cancel();
+ mConnectedThread = null;
+ }
+ if (mConnectedWriteThread != null) {
+ mConnectedWriteThread.cancel();
+ mConnectedWriteThread = null;
+ }
+ // Cancel the accept thread because we only want to connect to one device
+ if (!keepSocketAlive && mSecureAcceptThread != null) {
+ mSecureAcceptThread.cancel();
+ mSecureAcceptThread = null;
+ }
+
+ // Start the thread to manage the connection and perform transmissions
+ mConnectedThread = new ConnectedThread(socket);
+ mConnectedThread.start();
+ // Start the thread to manage the connection and perform transmissions
+ mConnectedWriteThread = new ConnectedWriteThread(socket);
+ mConnectedWriteThread.start();
+
+ //Store a static name of the device that is connected.
+ if(device != null){
+ connectedDeviceName = device.getName();
+ connectedDeviceAddress = device.getAddress();
+ if(connectedDeviceAddress!=null){
+ //Update the transport record with the address
+ transportRecord = new TransportRecord(transportType, connectedDeviceAddress);
+ }
+ }
+
+ // Send the name of the connected device back to the UI Activity
+ Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_DEVICE_NAME);
+ Bundle bundle = new Bundle();
+ if(connectedDeviceName != null) {
+ bundle.putString(DEVICE_NAME, connectedDeviceName);
+ bundle.putString(DEVICE_ADDRESS, connectedDeviceAddress);
+ }
+ msg.setData(bundle);
+ handler.sendMessage(msg);
+ setState(STATE_CONNECTED);
+ }
+
+ /**
+ * Stop all threads
+ */
+ public synchronized void stop() {
+ stop(STATE_NONE);
+ }
+ protected synchronized void stop(int stateToTransitionTo) {
+ //Log.d(TAG, "Attempting to close the bluetooth serial server");
+ if (mConnectThread != null) {
+ mConnectThread.cancel();
+ mConnectThread = null;
+ }
+
+ if (mConnectedThread != null) {
+ mConnectedThread.cancel();
+ mConnectedThread = null;
+ }
+ if (mConnectedWriteThread != null) {mConnectedWriteThread.cancel(); mConnectedWriteThread = null;}
+
+ if (mSecureAcceptThread != null) {
+ mSecureAcceptThread.cancel();
+ mSecureAcceptThread = null;
+ }
+
+ setState(stateToTransitionTo);
+ }
+
+
+ /**
+ * Write to the ConnectedThread in an unsynchronized manner
+ * @param out The bytes to write
+ * @see ConnectedThread#write(byte[])
+ */
+ public void write(byte[] out, int offset, int count) {
+ // Create temporary object
+ ConnectedWriteThread r;
+ // Synchronize a copy of the ConnectedThread
+ synchronized (this) {
+ if (mState != STATE_CONNECTED) return;
+ r = mConnectedWriteThread;
+ //r.write(out,offset,count);
+ }
+ // Perform the write unsynchronized
+ r.write(out,offset,count);
+ }
+
+ /**
+ * Indicate that the connection attempt failed and notify the UI Activity.
+ */
+ private void connectionFailed() {
+ // Send a failure message back to the Activity
+ Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);
+ Bundle bundle = new Bundle();
+ bundle.putString(LOG, "Unable to connect device");
+ msg.setData(bundle);
+ handler.sendMessage(msg);
+
+ // Start the service over to restart listening mode
+ // BluetoothSerialServer.this.start();
+ }
+
+ /**
+ * Indicate that the connection was lost and notify the UI Activity.
+ */
+ private void connectionLost() {
+ // Send a failure message back to the Activity
+ Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);
+ Bundle bundle = new Bundle();
+ bundle.putString(LOG, "Device connection was lost");
+ msg.setData(bundle);
+ handler.sendMessage(msg);
+ stop();
+
+ }
+
+ private void timerDelayRemoveDialog(final BluetoothSocket sock){
+ timeOutHandler = new Handler();
+ socketRunable = new Runnable() {
+ public void run() {
+ //Log.e(TAG, "BLUETOOTH SOCKET CONNECT TIMEOUT - ATTEMPT TO CLOSE SOCKET");
+ try {
+ sock.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ timeOutHandler.postDelayed(socketRunable, MS_TILL_TIMEOUT);
+ }
+
+
+
+ /**
+ * This thread runs while listening for incoming connections. It behaves
+ * like a server-side client. It runs until a connection is accepted
+ * (or until cancelled).
+ */
+ private class AcceptThread extends Thread {
+ // The local server socket
+ private String mSocketType;
+ final BluetoothServerSocket mmServerSocket;
+
+ @SuppressLint("NewApi")
+ public AcceptThread(boolean secure) {
+ synchronized(THREAD_LOCK){
+ //Log.d(TAG, "Creating an Accept Thread");
+ BluetoothServerSocket tmp = null;
+ mSocketType = secure ? "Secure":"Insecure";
+ // Create a new listening server socket
+ try {
+ if (secure) {
+ tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME_SECURE, SERVER_UUID);
+ }
+ } catch (IOException e) {
+ //Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e);
+ //Let's try to shut down this thead
+ }catch(SecurityException e2){
+ //Log.e(TAG, "<LIVIO> Security Exception in Accept Thread - "+e2.toString());
+ interrupt();
+ }
+ mmServerSocket = tmp;
+ //Should only log on debug
+ //BluetoothSocket mySock = getBTSocket(mmServerSocket);
+ //Log.d(TAG, "Accepting Connections on SDP Server Port Number: " + getChannel(mySock) + "\r\n");
+ }
+ }
+
+ public void run() {
+ synchronized(THREAD_LOCK){
+ Log.d(TAG, "Socket Type: " + mSocketType +
+ " BEGIN mAcceptThread" + this);
+ setName("AcceptThread" + mSocketType);
+
+ BluetoothSocket socket = null;
+ int listenAttempts = 0;
+
+ // Listen to the server socket if we're not connected
+ while (mState != STATE_CONNECTED) {
+ try {
+ if(listenAttempts>=5){
+ Log.e(TAG, "Complete failure in attempting to listen for Bluetooth connection, erroring out.");
+ MultiplexBluetoothTransport.this.stop(STATE_ERROR);
+ return;
+ }
+ listenAttempts++;
+ Log.d(TAG, "SDL Bluetooth Accept thread is running.");
+
+ // This is a blocking call and will only return on a
+ // successful connection or an exception
+ if(mmServerSocket!=null){
+
+ socket = mmServerSocket.accept();
+
+ }
+ else{
+ Log.e(TAG, "Listening Socket was null, stopping the bluetooth serial server.");
+ MultiplexBluetoothTransport.this.stop(STATE_ERROR);
+ return;
+ }
+ } catch (IOException e) {
+ Log.e(TAG, "Socket Type: " + mSocketType + "accept() failed");
+ MultiplexBluetoothTransport.this.stop(STATE_ERROR);
+ return;
+ }
+
+ // If a connection was accepted
+ if (socket != null) {
+ synchronized (MultiplexBluetoothTransport.this) {
+ switch (mState) {
+ case STATE_LISTEN:
+ case STATE_CONNECTING:
+ // Situation normal. Start the connected thread.
+ connected(socket, socket.getRemoteDevice());
+
+ break;
+ case STATE_NONE:
+ case STATE_CONNECTED:
+ // Either not ready or already connected. Terminate new socket.
+ try {
+ Log.d(TAG, "Close unwanted socket");
+ socket.close();
+ } catch (IOException e) {
+ Log.e(TAG, "Could not close unwanted socket", e);
+ }
+ break;
+ }
+ }
+ }
+ }
+ Log.d(TAG, mState + " END mAcceptThread, socket Type: " + mSocketType);
+ }
+ }
+
+ public synchronized void cancel() {
+ Log.d(TAG, mState + " Socket Type " + mSocketType + " cancel ");
+ try {
+ if(mmServerSocket != null){
+ mmServerSocket.close();
+ }
+
+ } catch (IOException e) {
+ Log.e(TAG, mState + " Socket Type " + mSocketType + " close() of server failed "+ e.getStackTrace());
+ }
+ }
+ }
+
+
+ /**
+ * This thread runs while attempting to make an outgoing connection
+ * with a device. It runs straight through; the connection either
+ * succeeds or fails.
+ */
+ private class ConnectThread extends Thread {
+ private BluetoothSocket mmSocket;
+ private final BluetoothDevice mmDevice;
+ public ConnectThread(BluetoothDevice device) {
+ mmDevice = device;
+ //Log.d(TAG, "Attempting to conenct to " + device.getName());
+ //Log.d(TAG, "UUID to conenct to " + SERVER_UUID.toString());
+
+ }
+
+ public void attemptCancelDiscovery(){
+ try{
+ mAdapter.cancelDiscovery();
+ }catch(SecurityException e2){
+ Log.e(TAG, "Don't have required permision to cancel discovery. Moving on");
+ }
+ }
+
+ public void run() {
+ setName("ConnectThread");
+ // Always cancel discovery because it will slow down a connection
+ attemptCancelDiscovery();
+ // Make a connection to the BluetoothSocket
+ int attemptCount = 0;
+ boolean success = false;
+ Looper.prepare();
+
+ while(attemptCount < 5)
+ {
+ //Looper.loop()
+ attemptCount++;
+ try {
+ // This is a blocking call and will only return on a
+ // successful connection or an exception
+ mBluetoothLevel = SdlRouterService.getBluetoothPrefs(SHARED_PREFS);
+ long waitTime = 3000;
+ try {
+ Thread.sleep(waitTime);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ //This sequence tries to use reflection first to connect with a certain number of phones that require this
+ //Next is the most common methods for phones
+ //Finally if both have failed an insecure connection is attempted, though this is not available on lower SDK's
+ boolean tryInsecure = false;
+ boolean trySecure = false;
+ //Log.i(TAG,mmDevice.getName() + " socket connecting...");
+
+ if(mBluetoothLevel<=1){
+ try {
+ SdlRouterService.setBluetoothPrefs(2,SHARED_PREFS);
+ Method m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
+ //Log.i(TAG,"connecting using createRfcommSocket");
+ mmSocket = (BluetoothSocket) m.invoke(mmDevice, Integer.valueOf(1));
+ if(mmSocket!=null){
+ //Looper.prepare();
+ timerDelayRemoveDialog(mmSocket);
+ //Looper.loop();
+ mmSocket.connect();
+ timeOutHandler.removeCallbacks(socketRunable);
+ Looper.myLooper().quit();
+ success=true;
+ SdlRouterService.setBluetoothPrefs(1,SHARED_PREFS);
+ break;
+ } else{trySecure = true;}
+
+ } catch (Exception e) {
+ //Log.e(TAG,"createRfcommSocket exception - " + e.toString());
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+
+ trySecure = true;
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e2) {
+ e2.printStackTrace();
+ }
+ }
+ }else{trySecure = true;}
+ if(trySecure && mBluetoothLevel<=2){
+ try {
+ SdlRouterService.setBluetoothPrefs(3,SHARED_PREFS);
+ //Log.i(TAG, "connecting using createRfcommSocketToServiceRecord ");
+ mmSocket = mmDevice.createRfcommSocketToServiceRecord(SERVER_UUID);
+ if(mmSocket!=null){
+ //Looper.prepare();
+ timerDelayRemoveDialog(mmSocket);
+ //Looper.loop();
+ mmSocket.connect();
+ timeOutHandler.removeCallbacks(socketRunable);
+ Looper.myLooper().quit();
+ success=true;
+ SdlRouterService.setBluetoothPrefs(2,SHARED_PREFS);
+ break;
+ }else{tryInsecure = true;}
+ } catch (IOException io) {
+ tryInsecure = true;
+ Log.e(TAG,"createRfcommSocketToServiceRecord exception - " + io.toString());
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+
+ } catch (Exception e){
+ Log.e(TAG,"createRfcommSocketToServiceRecord exception - " + e.toString());
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+
+ }
+ }else{tryInsecure = true;}
+
+ if (tryInsecure && mBluetoothLevel<=3) {
+ // try again using insecure comm if available
+ try {
+ SdlRouterService.setBluetoothPrefs(4,SHARED_PREFS);
+ //Log.i(TAG,"connecting using createInsecureRfcommSocketToServiceRecord");
+ Method m = mmDevice.getClass().getMethod("createInsecureRfcommSocketToServiceRecord", new Class[] {UUID.class});
+ mmSocket = (BluetoothSocket) m.invoke(mmDevice, new Object[] {SERVER_UUID});
+ //Looper.prepare();
+ timerDelayRemoveDialog(mmSocket);
+ //Looper.loop();
+ mmSocket.connect();
+ timeOutHandler.removeCallbacks(socketRunable);
+ Looper.myLooper().quit();
+ success=true;
+ tryInsecure = false;
+ SdlRouterService.setBluetoothPrefs(3,SHARED_PREFS);
+ break;
+ } catch (NoSuchMethodException ie) {
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+ } catch (IllegalAccessException ie) {
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+ } catch (InvocationTargetException ie) {
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+ }
+ }
+ if (tryInsecure && mBluetoothLevel<=4) {
+ // try again using insecure comm if available
+ try {
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+ //Log.i(TAG,"connecting using createInsecureRfcommSocket()");
+ Method m = mmDevice.getClass().getMethod("createInsecureRfcommSocket()", new Class[] {UUID.class});
+ mmSocket = (BluetoothSocket) m.invoke(mmDevice, new Object[] {SERVER_UUID});
+ //Looper.prepare();
+ timerDelayRemoveDialog(mmSocket);
+ //Looper.loop();
+ mmSocket.connect();
+ timeOutHandler.removeCallbacks(socketRunable);
+ Looper.myLooper().quit();
+ success=true;
+ SdlRouterService.setBluetoothPrefs(4,SHARED_PREFS);
+ break;
+ } catch (NoSuchMethodException ie) {
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+ } catch (IllegalAccessException ie) {
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+ } catch (InvocationTargetException ie) {
+ SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+ }
+ }
+ } catch (IOException e) {
+ connectionFailed();
+ Log.e(TAG,e.getClass().getSimpleName()
+ + " caught connecting to the bluetooth socket: "
+ + e.toString());
+ try {
+ mmSocket.close();
+ } catch (IOException e2) {
+ Log.e(TAG,"unable to close() socket during connection failure" + e2);
+ }
+ return;
+ }
+ }
+ // Reset the ConnectThread because we're done
+ if(success)
+ {
+ synchronized (MultiplexBluetoothTransport.this) {
+ mConnectThread = null;
+ }
+
+
+ // Start the connected thread
+
+ connected(mmSocket, mmDevice);
+ }
+ else
+ {
+ Log.e(TAG, "There was a problem opening up RFCOMM");
+ }
+ }
+
+ public void cancel() {
+ try {
+ Log.d(TAG, "Calling Cancel in the connect thread");
+ mmSocket.close();
+ } catch (IOException e) {
+ // close() of connect socket failed
+ }
+ catch(NullPointerException e){
+ //mSocket was pry never initialized
+ }
+ }
+ }
+
+ /**
+ * This thread runs during a connection with a remote device.
+ * It handles all incoming and outgoing transmissions.
+ */
+ private class ConnectedWriteThread extends Thread {
+ private final BluetoothSocket mmSocket;
+ private final OutputStream mmOutStream;
+
+
+ public ConnectedWriteThread(BluetoothSocket socket) {
+ //Log.d(TAG, "Creating a Connected - Write Thread");
+ mmSocket = socket;
+ OutputStream tmpOut = null;
+ setName("SDL Router BT Write Thread");
+ // Get the BluetoothSocket input and output streams
+ try {
+ tmpOut = socket.getOutputStream();
+ } catch (IOException e) {
+ // temp sockets not created
+ Log.e(TAG, "Connected Write Thread: " + e.getMessage());
+ }
+ mmOutStream = tmpOut;
+
+
+ }
+ /**
+ * Write to the connected OutStream.
+ * @param buffer The bytes to write
+ */
+ public void write(byte[] buffer, int offset, int count) {
+ try {
+ if(buffer==null){
+ Log.w(TAG, "Can't write to device, nothing to send");
+ return;
+ }
+ //This would be a good spot to log out all bytes received
+ mmOutStream.write(buffer, offset, count);
+ //Log.w(TAG, "Wrote out to device: bytes = "+ count);
+ } catch (IOException|NullPointerException e) { // STRICTLY to catch mmOutStream NPE
+ // Exception during write
+ //OMG! WE MUST NOT BE CONNECTED ANYMORE! LET THE USER KNOW
+ Log.e(TAG, "Error sending bytes to connected device!");
+ connectionLost();
+ }
+ }
+
+ public synchronized void cancel() {
+ try {
+ if(mmOutStream!=null){
+ mmOutStream.flush();
+ mmOutStream.close();
+
+ }
+ if(mmSocket!=null){
+ mmSocket.close();
+ }
+ } catch (IOException e) {
+ // close() of connect socket failed
+ Log.d(TAG, "Write Thread: " + e.getMessage());
+ }
+ }
+ }
+
+ private class ConnectedThread extends Thread {
+ private final BluetoothSocket mmSocket;
+ private final InputStream mmInStream;
+ SdlPsm psm;
+ public ConnectedThread(BluetoothSocket socket) {
+ this.psm = new SdlPsm();
+ //Log.d(TAG, "Creating a Connected - Read Thread");
+ mmSocket = socket;
+ InputStream tmpIn = null;
+ setName("SDL Router BT Read Thread");
+ // Get the BluetoothSocket input and output streams
+ try {
+ tmpIn = socket.getInputStream();
+ } catch (IOException e) {
+ // temp sockets not created
+ Log.e(TAG, "Connected Read Thread: "+e.getMessage());
+ }
+ mmInStream = tmpIn;
+
+ }
+
+ @SuppressLint("NewApi")
+ public void run() {
+ Log.d(TAG, "Running the Connected Thread");
+ byte input = 0;
+ int bytesRead = 0;
+ byte[] buffer = new byte[READ_BUFFER_SIZE];
+ // Keep listening to the InputStream while connected
+ boolean stateProgress;
+
+ psm.reset();
+
+ while (true) {
+ try {
+ bytesRead = mmInStream.read(buffer);
+ // Log.i(getClass().getName(), "Received " + bytesRead + " bytes from Bluetooth");
+ for (int i = 0; i < bytesRead; i++) {
+ input = buffer[i];
+
+ // Send the response of what we received
+ stateProgress = psm.handleByte(input);
+ if (!stateProgress) { //We are trying to weed through the bad packet info until we get something
+ //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
+ psm.reset();
+ continue;
+ }
+
+ if (psm.getState() == SdlPsm.FINISHED_STATE) {
+ //Log.d(TAG, "Packet formed, sending off");
+ SdlPacket packet = psm.getFormedPacket();
+ packet.setTransportRecord(getTransportRecord());
+ handler.obtainMessage(SdlRouterService.MESSAGE_READ, packet).sendToTarget();
+ psm.reset();
+ }
+ }
+ } catch (IOException|NullPointerException e) { // NPE is ONLY to catch error on mmInStream
+ Log.e(TAG, "Lost connection in the Connected Thread");
+ e.printStackTrace();
+ connectionLost();
+ break;
+ }
+ }
+ }
+
+
+ public synchronized void cancel() {
+ try {
+ //Log.d(TAG, "Calling Cancel in the Read thread");
+ if(mmInStream!=null){
+ mmInStream.close();
+ }
+ if(mmSocket!=null){
+ mmSocket.close();
+ }
+
+ } catch (IOException|NullPointerException e) { // NPE is ONLY to catch error on mmInStream
+ // Log.trace(TAG, "Read Thread: " + e.getMessage());
+ // Socket or stream is already closed
+ }
+ }
+ }
+
+
+
+ public BluetoothSocket getBTSocket(BluetoothServerSocket bsSocket){
+ if(bsSocket == null){
+ return null;
+ }
+ Field[] f = bsSocket.getClass().getDeclaredFields();
+
+ //int channel = -1;
+ BluetoothSocket mySocket = null;
+ for (Field field : f) {
+ if(field.getName().equals("mSocket")){
+ field.setAccessible(true);
+ try {
+
+ mySocket = (BluetoothSocket) field.get(bsSocket);
+ return mySocket;
+ //channel = field.getInt(bsSocket);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ field.setAccessible(false);
+ }
+ }
+
+ return null;
+ }
+
+ public int getChannel(BluetoothSocket bsSocket){
+
+ int channel = -1;
+ if (bsSocket == null){
+ return channel;
+ }
+
+ Field[] f = bsSocket.getClass().getDeclaredFields();
+
+ for (Field field : f) {
+ if(field.getName().equals("mPort")){
+ field.setAccessible(true);
+ try {
+
+
+ channel = field.getInt(bsSocket);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ field.setAccessible(false);
+ }
+ }
+
+ return channel;
+ }
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java
index d5843f4c2..d5843f4c2 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransport.java
index eac5a27e0..eac5a27e0 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransport.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransport.java
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java
new file mode 100644
index 000000000..65989307e
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.content.ComponentName;
+import android.content.Context;
+
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import java.util.Arrays;
+import java.util.List;
+
+@SuppressWarnings("WeakerAccess")
+public class MultiplexTransportConfig extends BaseTransportConfig{
+
+ /**
+ * Multiplexing security will be turned off. All router services will be trusted.
+ */
+ public static final int FLAG_MULTI_SECURITY_OFF = 0x00;
+ /**
+ * Multiplexing security will be minimal. Only trusted router services will be used. Trusted router list will be obtain from
+ * server. List will be refreshed every <b>30 days</b> or during next connection session if an SDL enabled app has been
+ * installed or uninstalled.
+ */
+ public static final int FLAG_MULTI_SECURITY_LOW = 0x10;
+ /**
+ * Multiplexing security will be on at a normal level. Only trusted router services will be used. Trusted router list will be obtain from
+ * server. List will be refreshed every <b>7 days</b> or during next connection session if an SDL enabled app has been
+ * installed or uninstalled.
+ */
+ public static final int FLAG_MULTI_SECURITY_MED = 0x20;
+ /**
+ * Multiplexing security will be very strict. Only trusted router services installed from trusted app stores will
+ * be used. Trusted router list will be obtain from server. List will be refreshed every <b>7 days</b>
+ * or during next connection session if an SDL enabled app has been installed or uninstalled.
+ */
+ public static final int FLAG_MULTI_SECURITY_HIGH = 0x30;
+
+ Context context;
+ String appId;
+ ComponentName service;
+ int securityLevel;
+
+ List<TransportType> primaryTransports, secondaryTransports;
+ boolean requiresHighBandwidth = false;
+ TransportListener transportListener;
+
+
+ public MultiplexTransportConfig(Context context, String appId) {
+ this.context = context;
+ this.appId = appId;
+ this.securityLevel = FLAG_MULTI_SECURITY_MED;
+ this.primaryTransports = Arrays.asList(TransportType.USB, TransportType.BLUETOOTH);
+ this.secondaryTransports = Arrays.asList(TransportType.TCP, TransportType.USB, TransportType.BLUETOOTH);
+
+ }
+
+ public MultiplexTransportConfig(Context context, String appId, int securityLevel) {
+ this.context = context;
+ this.appId = appId;
+ this.securityLevel = securityLevel;
+ this.primaryTransports = Arrays.asList(TransportType.USB, TransportType.BLUETOOTH);
+ this.secondaryTransports = Arrays.asList(TransportType.TCP, TransportType.USB, TransportType.BLUETOOTH);
+ }
+
+ /**
+ * Overridden abstract method which returns specific type of this transport configuration.
+ *
+ * @return Constant value TransportType.MULTIPLEX.
+ *
+ * @see TransportType
+ */
+ public TransportType getTransportType() {
+ return TransportType.MULTIPLEX;
+ }
+
+ /**
+ * Gets the context attached to this config
+ * @return context supplied during creation
+ */
+ public Context getContext(){
+ return this.context;
+ }
+
+ /**
+ * Gets the ComponentName of the router service attached to this config
+ * @return ComponentName of the router service that will be bound to
+ */
+ public ComponentName getService() {
+ return service;
+ }
+
+ /**
+ * Supplies the config with the router service that should be bound to
+ * @param service the router service that should be bound to
+ */
+ public void setService(ComponentName service) {
+ this.service = service;
+ }
+
+ /**
+ * Sets the security level that should be used to verify a router service that is to be bound
+ * @param securityLevel the security level that will be used to perform certain tests
+ * @see #FLAG_MULTI_SECURITY_OFF
+ * @see #FLAG_MULTI_SECURITY_LOW
+ * @see #FLAG_MULTI_SECURITY_MED
+ * @see #FLAG_MULTI_SECURITY_HIGH
+ */
+ public void setSecurityLevel(int securityLevel){
+ this.securityLevel = securityLevel;
+ }
+
+ /**
+ * Get the securitly level that will be used to verify a router service before binding
+ * @return the set security level
+ * @see #FLAG_MULTI_SECURITY_OFF
+ * @see #FLAG_MULTI_SECURITY_LOW
+ * @see #FLAG_MULTI_SECURITY_MED
+ * @see #FLAG_MULTI_SECURITY_HIGH
+ */
+ public int getSecurityLevel(){
+ return securityLevel;
+ }
+
+ /**
+ * Set whether or not this app requires the use of a transport that supports high bandwidth
+ * services. Common use is when an app uses the video/audio streaming services and there is no
+ * other integration that could be useful to the user.
+ * <br><br> <b>For example:</b>
+ * <br><b>1. </b>If an app intends to perform audio or video streaming and does not wish
+ * to appear on the module when that isn't possible, a value of true should be sent.
+ * <br><b>2. </b>If the same app wishes to appear on the module even when those services aren't available
+ * a value of true should be sent. In this case, the app could display a message prompting the
+ * user to "Please connect USB or Wifi" or it could have a separate integration like giving turn
+ * by turn directions in place of streaming the full navigation map.
+ * @param requiresHighBandwidth whether the app should be treated as requiring a high
+ * bandwidth transport.
+ */
+ public void setRequiresHighBandwidth(boolean requiresHighBandwidth){
+ this.requiresHighBandwidth = requiresHighBandwidth;
+ }
+
+ /**
+ * Get the setting from this config to see whether the app should be treated as requiring a high
+ * bandwidth transport.
+ * @return whether the app should be treated as requiring a high
+ * bandwidth transport.
+ */
+ public boolean requiresHighBandwidth(){
+ return this.requiresHighBandwidth;
+ }
+
+ /**
+ * This will set the order in which a primary transport is determined to be accepted or not.
+ * In the case of previous protocol versions ( < 5.1)
+ * @param transports list of transports that can be used as primary
+ */
+ public void setPrimaryTransports(List<TransportType> transports){
+ if(transports != null){
+ //Sanitize
+ transports.remove(TransportType.MULTIPLEX);
+ this.primaryTransports = transports;
+ }
+ }
+
+ /**
+ * Get the list of primary transports that are set to be accepted by this config
+ * @return acceptable primary transports
+ */
+ public List<TransportType> getPrimaryTransports(){
+ return this.primaryTransports;
+ }
+
+ /**
+ * This will set the order in which a primary transport is determined to be accepted or not.
+ * In the case of previous protocol versions ( < 5.1)
+ * @param transports list of transports that can be used as secondary
+ **/
+ public void setSecondaryTransports(List<TransportType> transports){
+ if(transports != null){
+ //Sanitize
+ transports.remove(TransportType.MULTIPLEX);
+ this.secondaryTransports = transports;
+ }
+ }
+
+ /**
+ * Get the list of secondary transports that are set to be accepted by this config
+ * @return acceptable secondary transports
+ */
+ public List<TransportType> getSecondaryTransports(){
+ return this.secondaryTransports;
+ }
+
+ /**
+ * Set a lister for transport events. Useful when connected high bandwidth services like audio
+ * or video streaming
+ * @param listener the TransportListener that will be called back when transport events happen
+ */
+ public void setTransportListener(TransportListener listener){
+ this.transportListener = listener;
+ }
+
+ /**
+ * Getter for the supplied transport listener
+ * @return the transport listener if any
+ */
+ public TransportListener getTransportListener(){
+ return this.transportListener;
+ }
+
+ /**
+ * Callback to be used if the state of the transports needs to be monitored for any reason.
+ */
+ public interface TransportListener{
+ /**
+ * Gets called whenever there is a change in the available transports for use
+ * @param connectedTransports the currently connected transports
+ * @param audioStreamTransportAvail true if there is either an audio streaming supported
+ * transport currently connected or a transport is
+ * available to connect with. False if there is no
+ * transport connected to support audio streaming and
+ * no possibility in the foreseeable future.
+ * @param videoStreamTransportAvail true if there is either a video streaming supported
+ * transport currently connected or a transport is
+ * available to connect with. False if there is no
+ * transport connected to support video streaming and
+ * no possibility in the foreseeable future.
+ */
+ void onTransportEvent(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail,boolean videoStreamTransportAvail);
+ }
+
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
new file mode 100644
index 000000000..7ebcec1c2
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
@@ -0,0 +1,350 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.os.ParcelFileDescriptor;
+import android.util.Log;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.enums.TransportType;
+
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class MultiplexUsbTransport extends MultiplexBaseTransport{
+
+ private static final String TAG = "MultiplexUsbTransport";
+
+ public static final String MANUFACTURER = "manufacturer";
+ public static final String MODEL = "model";
+ public static final String VERSION = "version";
+ public static final String URI = "uri";
+ public static final String SERIAL = "serial";
+ public static final String DESCRIPTION = "description";
+
+ private final Bundle deviceInfo;
+ private ReaderThread readerThread;
+ private WriterThread writerThread;
+ private ParcelFileDescriptor parcelFileDescriptor;
+ private Boolean connectionSuccessful = null;
+
+ MultiplexUsbTransport(ParcelFileDescriptor parcelFileDescriptor, Handler handler, Bundle bundle){
+ super(handler, TransportType.USB);
+ if(parcelFileDescriptor == null){
+ Log.e(TAG, "Error with object");
+ this.parcelFileDescriptor = null;
+ throw new ExceptionInInitializerError("ParcelFileDescriptor can't be null");
+ }else{
+ this.parcelFileDescriptor = parcelFileDescriptor;
+ connectedDeviceName = "USB";
+ deviceInfo = bundle;
+ if(deviceInfo != null){
+ //Fill in info
+ connectedDeviceAddress = bundle.getString(SERIAL);
+ if(connectedDeviceAddress == null){
+ connectedDeviceAddress = bundle.getString(URI);
+ if(connectedDeviceAddress == null) {
+ connectedDeviceAddress = bundle.getString(DESCRIPTION);
+ if (connectedDeviceAddress == null) {
+ connectedDeviceAddress = bundle.getString(MODEL);
+ if (connectedDeviceAddress == null) {
+ connectedDeviceAddress = bundle.getString(MANUFACTURER);
+ }
+ }
+ }
+ }
+
+ }else{
+ connectedDeviceAddress = "USB";
+ }
+ }
+ }
+
+ public synchronized void start(){
+ setState(STATE_CONNECTING);
+ FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
+ if(fileDescriptor == null || !fileDescriptor.valid()){
+ Log.e(TAG, "USB FD was null or not valid,");
+ setState(STATE_NONE);
+ return;
+ }
+ readerThread = new ReaderThread(fileDescriptor);
+ readerThread.setDaemon(true);
+ writerThread = new WriterThread(fileDescriptor);
+ writerThread.setDaemon(true);
+
+ readerThread.start();
+ writerThread.start();
+
+ // Send the name of the connected device back to the UI Activity
+ Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_DEVICE_NAME);
+ Bundle bundle = new Bundle();
+ bundle.putString(DEVICE_NAME, connectedDeviceName);
+ bundle.putString(DEVICE_ADDRESS, connectedDeviceAddress);
+ msg.setData(bundle);
+ handler.sendMessage(msg);
+
+ setState(STATE_CONNECTED);
+ }
+
+ protected synchronized void stop(int stateToTransitionTo) {
+ //Log.d(TAG, "Attempting to close the Usb transports");
+ if (writerThread != null) {
+ writerThread.cancel();
+ writerThread.interrupt();
+ writerThread = null;
+ }
+
+ if (readerThread != null) {
+ readerThread.cancel();
+ readerThread.interrupt();
+ readerThread = null;
+ }
+
+ if( (connectionSuccessful== null || connectionSuccessful == true ) //else, the connection was bad. Not closing the PFD helps recover
+ && parcelFileDescriptor != null){
+ try {
+ parcelFileDescriptor.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ parcelFileDescriptor = null;
+
+ System.gc();
+
+ setState(stateToTransitionTo);
+ }
+
+
+ /**
+ * Write to the ConnectedThread in an unsynchronized manner
+ * @param out The bytes to write
+ */
+ public void write(byte[] out, int offset, int count) {
+ // Create temporary object
+ MultiplexUsbTransport.WriterThread r;
+ // Synchronize a copy of the ConnectedThread
+ synchronized (this) {
+ if (mState != STATE_CONNECTED) return;
+ r = writerThread;
+ //r.write(out,offset,count);
+ }
+ // Perform the write unsynchronized
+ r.write(out,offset,count);
+ }
+
+ /**
+ * Indicate that the connection attempt failed and notify the UI Activity.
+ */
+ private void connectionFailed() {
+ // Send a failure message back to the Activity
+ Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);
+ Bundle bundle = new Bundle();
+ bundle.putString(LOG, "Unable to connect device");
+ msg.setData(bundle);
+ handler.sendMessage(msg);
+
+ // Start the service over to restart listening mode
+ // BluetoothSerialServer.this.start();
+ }
+
+ /**
+ * Indicate that the connection was lost and notify the UI Activity.
+ */
+ private void connectionLost() {
+ // Send a failure message back to the Activity
+ Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);
+ Bundle bundle = new Bundle();
+ bundle.putString(LOG, "Device connection was lost");
+ msg.setData(bundle);
+ handler.sendMessage(msg);
+ handler.postDelayed(new Runnable() { //sends this stop back to the main thread to exit the reader thread
+ @Override
+ public void run() {
+ stop();
+ }
+ }, 250);
+ }
+
+ private class ReaderThread extends Thread{
+ SdlPsm psm;
+
+ final InputStream inputStream;
+
+ public ReaderThread(final FileDescriptor fileDescriptor){
+ psm = new SdlPsm();
+ inputStream = new FileInputStream(fileDescriptor);
+ }
+
+ @Override
+ public void run() { //FIXME probably check to see what the BT does
+ super.run();
+ final int READ_BUFFER_SIZE = 16384;
+ byte[] buffer = new byte[READ_BUFFER_SIZE];
+ int bytesRead;
+ boolean stateProgress;
+
+ // read loop
+ while (!isInterrupted()) {
+ try {
+ bytesRead = inputStream.read(buffer);
+ if (bytesRead == -1) {
+ if (isInterrupted()) {
+ Log.e(TAG,"EOF reached, and thread is interrupted");
+ } else {
+ Log.i(TAG,"EOF reached, disconnecting!");
+ connectionLost();
+ }
+ return;
+ }
+ if (isInterrupted()) {
+ Log.w(TAG,"Read some data, but thread is interrupted");
+ return;
+ }
+ if(connectionSuccessful != null && connectionSuccessful == false){
+ connectionSuccessful = true;
+ }
+ byte input;
+ for(int i=0;i<bytesRead; i++){
+ input=buffer[i];
+ stateProgress = psm.handleByte(input);
+ if(!stateProgress){//We are trying to weed through the bad packet info until we get something
+ //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
+ psm.reset();
+ buffer = new byte[READ_BUFFER_SIZE];
+ }
+
+ if(psm.getState() == SdlPsm.FINISHED_STATE){
+ synchronized (MultiplexUsbTransport.this) {
+ //Log.d(TAG, "Packet formed, sending off");
+ SdlPacket packet = psm.getFormedPacket();
+ packet.setTransportRecord(getTransportRecord());
+ handler.obtainMessage(SdlRouterService.MESSAGE_READ, packet).sendToTarget();
+ }
+ //We put a trace statement in the message read so we can avoid all the extra bytes
+ psm.reset();
+ buffer = new byte[READ_BUFFER_SIZE]; //FIXME just do an array copy and send off
+ }
+ }
+ } catch (IOException e) {
+ if (isInterrupted()) {
+ Log.w(TAG,"Can't read data, and thread is interrupted");
+ } else {
+ Log.w(TAG,"Can't read data, disconnecting!");
+ connectionLost();
+ }
+ return;
+ } catch (Exception e){
+ connectionLost();
+ }
+ }
+ }
+
+
+ public synchronized void cancel() {
+ try {
+ //Log.d(TAG, "Calling Cancel in the Read thread");
+ if(inputStream!=null){
+ inputStream.close();
+ }
+
+ } catch (IOException|NullPointerException e) { // NPE is ONLY to catch error on mmInStream
+ // Log.trace(TAG, "Read Thread: " + e.getMessage());
+ // Socket or stream is already closed
+ }
+ }
+
+ }
+
+
+ /**
+ * This thread runs during a connection with a remote device.
+ * It handles all incoming and outgoing transmissions.
+ */
+ private class WriterThread extends Thread {
+ private final OutputStream mmOutStream;
+
+ public WriterThread(FileDescriptor fileDescriptor) {
+ //Log.d(TAG, "Creating a Connected - Write Thread");
+ OutputStream tmpOut = null;
+ setName("SDL USB Write Thread");
+ // Get the Usb output streams
+ mmOutStream = new FileOutputStream(fileDescriptor);
+ }
+
+ /**
+ * Write to the connected OutStream.
+ * @param buffer The bytes to write
+ */
+ public void write(byte[] buffer, int offset, int count) {
+ try {
+ if(buffer==null){
+ Log.w(TAG, "Can't write to device, nothing to send");
+ return;
+ }
+ //This would be a good spot to log out all bytes received
+ mmOutStream.write(buffer, offset, count);
+ if(connectionSuccessful == null){
+ connectionSuccessful = false;
+ }
+ //Log.w(TAG, "Wrote out to device: bytes = "+ count);
+ } catch (IOException|NullPointerException e) { // STRICTLY to catch mmOutStream NPE
+ // Exception during write
+ //OMG! WE MUST NOT BE CONNECTED ANYMORE! LET THE USER KNOW
+ Log.e(TAG, "Error sending bytes to connected device!");
+ connectionLost();
+ }
+ }
+
+ public synchronized void cancel() {
+ try {
+ if(mmOutStream!=null){
+ mmOutStream.flush();
+ mmOutStream.close();
+
+ }
+ } catch (IOException e) {
+ // close() of connect socket failed
+ Log.d(TAG, "Write Thread: " + e.getMessage());
+ }
+ }
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java
new file mode 100644
index 000000000..187732a8e
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java
@@ -0,0 +1,725 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import android.app.ActivityManager;
+import android.app.ActivityManager.RunningServiceInfo;
+import android.bluetooth.BluetoothAdapter;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.ResolveInfo;
+import android.content.pm.ServiceInfo;
+import android.os.Build;
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.util.AndroidTools;
+import com.smartdevicelink.util.HttpRequestTask;
+import com.smartdevicelink.util.HttpRequestTask.HttpRequestTaskCallback;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * This class will tell us if the currently running router service is valid or not.
+ * To use this class simply create a new instance of RouterServiceValidator with a supplied context.
+ * After that, you have the option to set if you want to test in a production setting. If not, it will default to a debug setting.
+ * Once you are ready to check if the router service is trusted you simply call routerServiceValidator.validate();
+ * <br><br> This validator should be passed into the multiplexing transport construction as well.
+ * @author Joey Grover
+ *
+ */
+public class RouterServiceValidator {
+ private static final String TAG = "RSVP";
+ public static final String ROUTER_SERVICE_PACKAGE = "com.sdl.router";
+
+ private static final String REQUEST_PREFIX = "https://woprjr.smartdevicelink.com/api/1/applications/queryTrustedRouters";
+
+ private static final String DEFAULT_APP_LIST = "{\"response\": {\"com.livio.sdl\" : { \"versionBlacklist\":[] }, \"com.lexus.tcapp\" : { \"versionBlacklist\":[] }, \"com.toyota.tcapp\" : { \"versionBlacklist\": [] } , \"com.sdl.router\":{\"versionBlacklist\": [] },\"com.ford.fordpass\" : { \"versionBlacklist\":[] } }}";
+
+
+ private static final String JSON_RESPONSE_OBJECT_TAG = "response";
+ private static final String JSON_RESONSE_APP_VERSIONS_TAG = "versionBlacklist";
+
+ private static final String JSON_PUT_ARRAY_TAG = "installedApps";
+ private static final String JSON_APP_PACKAGE_TAG = "packageName";
+ private static final String JSON_APP_VERSION_TAG = "version";
+
+
+ private static final long REFRESH_TRUSTED_APP_LIST_TIME_DAY = 3600000 * 24; // A day in ms
+
+ private static final String SDL = "sdl";
+ private static final String SDL_PACKAGE_LIST = "sdl_package_list";
+ private static final String SDL_PACKAGE_LIST_TIMESTAMP = "sdl_package_list_timestamp";
+ private static final String SDL_LAST_REQUEST = "sdl_last_request";
+ private static final String SDL_RSVP_SECURITY_LEVEL = "sdl_rsvp_security_level";
+
+
+ //Flags to aid in debugging and production checks
+ public static final int FLAG_DEBUG_NONE = 0x00;
+ public static final int FLAG_DEBUG_PACKAGE_CHECK = 0x01;
+ /**
+ * This will flag the validator to check for app version during debugging.
+ * <br><br><b>NOTE: This flag will include a package check as well.
+ */
+ public static final int FLAG_DEBUG_VERSION_CHECK = 0x03; //We use 3 becuase version check will be 2, but since a version check implies a package check we do 2+1=3;
+ public static final int FLAG_DEBUG_INSTALLED_FROM_CHECK = 0x04;
+ public static final int FLAG_DEBUG_USE_TIMESTAMP_CHECK = 0x05;
+
+ public static final int FLAG_DEBUG_PERFORM_ALL_CHECKS = 0xFF;
+
+
+ private int flags = FLAG_DEBUG_NONE;
+
+ private Context context= null;
+ private boolean inDebugMode = false;
+ @SuppressWarnings("unused")
+ private static boolean pendingListRefresh = false;
+
+ private ComponentName service;//This is how we can save different routers over another in a waterfall method if we choose to.
+
+ private static int securityLevel = -1;
+
+ public RouterServiceValidator(Context context){
+ this.context = context;
+ inDebugMode = inDebugMode();
+ }
+
+ public RouterServiceValidator(Context context, ComponentName service){
+ this.context = context;
+ inDebugMode = inDebugMode();
+ this.service = service;
+ }
+
+ public RouterServiceValidator(@NonNull MultiplexTransportConfig config){
+ this.context = config.context;
+ this.service = config.service;
+ setSecurityLevel(config.securityLevel);
+ inDebugMode = inDebugMode();
+ }
+
+ /**
+ * Main function to call to ensure we are connecting to a validated router service
+ * @return whether or not the currently running router service can be trusted.
+ */
+ public boolean validate(){
+
+ if(securityLevel == -1){
+ securityLevel = getSecurityLevel(context);
+ }
+
+ if(securityLevel == MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF){ //If security isn't an issue, just return true;
+ return true;
+ }
+
+ PackageManager pm = context.getPackageManager();
+ //Grab the package for the currently running router service. We need this call regardless of if we are in debug mode or not.
+ String packageName = null;
+
+ if(this.service != null){
+ Log.d(TAG, "Supplied service name of " + this.service.getClassName());
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O && !isServiceRunning(context,this.service)){
+ //This means our service isn't actually running, so set to null. Hopefully we can find a real router service after this.
+ service = null;
+ Log.w(TAG, "Supplied service is not actually running.");
+ } else {
+ // If the running router service is created by this app, the validation is good by default
+ if (this.service.getPackageName().equals(context.getPackageName())) {
+ return true;
+ }
+ }
+ }
+ if(this.service == null){
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O ) {
+ this.service = componentNameForServiceRunning(pm); //Change this to an array if multiple services are started?
+ if (this.service == null) { //if this is still null we know there is no service running so we can return false
+ wakeUpRouterServices();
+ return false;
+ }
+ }else{
+ wakeUpRouterServices();
+ return false;
+ }
+
+ }
+
+ //Log.d(TAG, "Checking app package: " + service.getClassName());
+ packageName = this.appPackageForComponentName(service, pm);
+
+
+ if(packageName!=null){//Make sure there is a service running
+ if(wasInstalledByAppStore(packageName)){ //Was this package installed from a trusted app store
+ if( isTrustedPackage(packageName, pm)){//Is this package on the list of trusted apps.
+ return true;
+ }
+ }
+ }//No running service found. Might need to attempt to start one
+ //TODO spin up a known good router service
+ wakeUpRouterServices();
+ return false;
+ }
+
+ /**
+ * This will ensure that all router services are aware that there are no valid router services running and should start up
+ */
+ private void wakeUpRouterServices(){
+ if(BluetoothAdapter.getDefaultAdapter()!=null && BluetoothAdapter.getDefaultAdapter().isEnabled()){
+ Intent intent = new Intent(TransportConstants.START_ROUTER_SERVICE_ACTION);
+ intent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true);
+ AndroidTools.sendExplicitBroadcast(context,intent,null);
+ }
+ }
+ public ComponentName getService(){
+ return this.service;
+ }
+
+ private boolean shouldOverrideVersionCheck(){
+ return (this.inDebugMode && ((this.flags & FLAG_DEBUG_VERSION_CHECK) != FLAG_DEBUG_VERSION_CHECK));
+ }
+
+ private boolean shouldOverridePackageName(){
+ return (this.inDebugMode && ((this.flags & FLAG_DEBUG_PACKAGE_CHECK) != FLAG_DEBUG_PACKAGE_CHECK));
+ }
+
+ private boolean shouldOverrideInstalledFrom(){
+ return securityLevel< MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH
+ || (this.inDebugMode && ((this.flags & FLAG_DEBUG_INSTALLED_FROM_CHECK) != FLAG_DEBUG_INSTALLED_FROM_CHECK));
+ }
+
+ @SuppressWarnings("unused")
+ private boolean shouldOverrideTimeCheck(){
+ return (this.inDebugMode && ((this.flags & FLAG_DEBUG_USE_TIMESTAMP_CHECK) != FLAG_DEBUG_USE_TIMESTAMP_CHECK));
+ }
+
+
+ /**
+ * Use this method if you would like to test your app in a production setting rather than defaulting to a
+ * debug mode where you connect to whatever router service is running.
+ * <br><br><b>These flags are only used in debugging mode. During production they will be ignored.</b>
+ * @param flags
+ */
+ public void setFlags(int flags){
+ this.flags = flags;
+ }
+
+ public void setSecurityLevel(int securityLevel){
+ RouterServiceValidator.securityLevel = securityLevel;
+ cacheSecurityLevel(this.context,securityLevel);
+ }
+
+ protected static long getRefreshRate(){
+ switch(securityLevel){
+ case MultiplexTransportConfig.FLAG_MULTI_SECURITY_LOW:
+ return 30 * REFRESH_TRUSTED_APP_LIST_TIME_DAY;
+ case MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH:
+ case MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED:
+ default:
+ return 7 * REFRESH_TRUSTED_APP_LIST_TIME_DAY;
+
+ }
+ }
+
+ /**
+ * This method will find which router service is running. Use that info to find out more about that app and service.
+ * It will store the found service for later use and return the package name if found.
+ * @param context
+ * @return
+ */
+ public ComponentName componentNameForServiceRunning(PackageManager pm){
+ if(context==null){
+ return null;
+ }
+ ActivityManager manager = (ActivityManager) context.getSystemService("activity");
+ //PackageManager pm = context.getPackageManager();
+
+
+ for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
+ //Log.d(TAG, service.service.getClassName());
+ //We will check to see if it contains this name, should be pretty specific
+ if ((service.service.getClassName()).toLowerCase(Locale.US).contains(SdlBroadcastReceiver.SDL_ROUTER_SERVICE_CLASS_NAME)){
+ //this.service = service.service; //This is great
+ if(service.started && service.restarting==0){ //If this service has been started and is not crashed
+ return service.service; //appPackageForComponenetName(service.service,pm);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the package name for the component name
+ * @param cn
+ * @param pm
+ * @return
+ */
+ private String appPackageForComponentName(ComponentName cn,PackageManager pm ){
+ if(cn!=null && pm!=null){
+ ServiceInfo info;
+ try {
+ info = pm.getServiceInfo(cn, 0);
+ return info.applicationInfo.packageName;
+ } catch (NameNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * Check to see if the app was installed from a trusted app store.
+ * @param packageName the package name of the app to be tested
+ * @return whether or not the app was installed from a trusted app store
+ */
+ public boolean wasInstalledByAppStore(String packageName){
+ if(shouldOverrideInstalledFrom()){
+ return true;
+ }
+ PackageManager packageManager = context.getPackageManager();
+ try {
+ final ApplicationInfo applicationInfo = packageManager.getApplicationInfo(packageName, 0);
+ if(TrustedAppStore.isTrustedStore(packageManager.getInstallerPackageName(applicationInfo.packageName))){
+ // App was installed by trusted app store
+ return true;
+ }
+ } catch (final NameNotFoundException e) {
+ e.printStackTrace();
+ return false;
+ }
+ return false;
+ }
+
+ /**
+ * This method will check to see if this app is a debug build. If it is, we will attempt to connect to any router service.
+ * If false, it will only connect to approved apps with router services.
+ * @return
+ */
+ public boolean inDebugMode(){
+ return (0 != (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
+ }
+
+
+ private boolean isTrustedPackage(String packageName, PackageManager pm){
+ if(packageName == null){
+ return false;
+ }
+
+ if(shouldOverridePackageName()){ //If we don't care about package names, just return true;
+ return true;
+ }
+
+ int version = -1;
+ try {version = pm.getPackageInfo(packageName,0).versionCode;} catch (NameNotFoundException e1) {e1.printStackTrace(); return false;}
+
+ JSONObject trustedApps = stringToJson(getTrustedList(context));
+ JSONArray versions;
+ JSONObject app = null;
+
+ try {
+ app = trustedApps.getJSONObject(packageName);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ return false;
+ }
+
+ if(app!=null){
+ //At this point, an app object was found in the JSON list that matches the package name
+ if(shouldOverrideVersionCheck()){ //If we don't care about versions, just return true
+ return true;
+ }
+ try { versions = app.getJSONArray(JSON_RESONSE_APP_VERSIONS_TAG); } catch (JSONException e) { e.printStackTrace();return false;}
+ return verifyVersion(version, versions);
+ }
+
+ return false;
+ }
+
+ protected boolean verifyVersion(int version, JSONArray versions){
+ if(version<0){
+ return false;
+ }
+ if(versions == null || versions.length()==0){
+ return true;
+ }
+ for(int i=0;i<versions.length();i++){
+ try {
+ if(version == versions.getInt(i)){
+ return false;
+ }
+ } catch (JSONException e) {
+ continue;
+ }
+ }//We didn't find our version in the black list.
+ return true;
+ }
+
+ /**
+ * Using the knowledge that all SDL enabled apps have an SDL Broadcast Receiver that has an intent filter that includes a specific
+ * intent.
+ * @return
+ */
+ private static List<SdlApp> findAllSdlApps(Context context){
+ List<SdlApp> apps = new ArrayList<SdlApp>();
+ PackageManager packageManager = context.getPackageManager();
+ Intent intent = new Intent();
+ intent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION);
+ List<ResolveInfo> infoList = packageManager.queryBroadcastReceivers(intent, 0);
+ //We want to sort our list so that we know it's the same everytime
+ Collections.sort(infoList,new Comparator<ResolveInfo>() {
+ @Override
+ public int compare(ResolveInfo lhs, ResolveInfo rhs) {
+ return lhs.activityInfo.packageName.compareTo(rhs.activityInfo.packageName);
+ }
+ });
+ if(infoList!=null){
+ String packageName;
+ for(ResolveInfo info : infoList){
+ //Log.i(TAG, "SDL apps: " + info.activityInfo.packageName);
+ packageName = info.activityInfo.packageName;
+ try {
+ apps.add(new SdlApp(packageName,packageManager.getPackageInfo(packageName,0).versionCode));
+ } catch (NameNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return apps;
+ }else{
+ Log.i(TAG, "No SDL apps, list was null");
+ return null;
+ }
+ }
+
+ /**
+ * Performs a look up against installed SDL apps that support the router service.
+ * When it receives a list back from the server it will store it for later use.
+ * @param context
+ */
+ public static boolean createTrustedListRequest(final Context context, boolean forceRefresh){
+ return createTrustedListRequest(context,forceRefresh,null,null);
+ }
+ public static boolean createTrustedListRequest(final Context context, boolean forceRefresh, TrustedListCallback listCallback){Log.d(TAG,"Checking to make sure we have a list");
+ return createTrustedListRequest(context,forceRefresh,null,listCallback);
+ }
+
+ @Deprecated
+ protected static boolean createTrustedListRequest(final Context context, boolean forceRefresh,HttpRequestTask.HttpRequestTaskCallback cb ){
+ return createTrustedListRequest(context,forceRefresh,cb,null);
+ }
+
+ protected static boolean createTrustedListRequest(final Context context, boolean forceRefresh,HttpRequestTask.HttpRequestTaskCallback cb, final TrustedListCallback listCallback ){
+ if(context == null){
+ return false;
+ }
+ else if(getSecurityLevel(context) == MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF){ //If security is off, we can just return now
+ if(listCallback!=null){
+ listCallback.onListObtained(true);
+ }
+ return false;
+ }
+
+ pendingListRefresh = true;
+ //Might want to store a flag letting this class know a request is currently pending
+ StringBuilder builder = new StringBuilder();
+ builder.append(REQUEST_PREFIX);
+
+ List<SdlApp> apps = findAllSdlApps(context);
+
+ final JSONObject object = new JSONObject();
+ JSONArray array = new JSONArray();
+ JSONObject jsonApp;
+
+ for(SdlApp app: apps){ //Format all the apps into a JSON object and add it to the JSON array
+ try{
+ jsonApp = new JSONObject();
+ jsonApp.put(JSON_APP_PACKAGE_TAG, app.packageName);
+ jsonApp.put(JSON_APP_VERSION_TAG, app.versionCode);
+ array.put(jsonApp);
+ }catch(JSONException e){
+ e.printStackTrace();
+ continue;
+ }
+ }
+
+ try {object.put(JSON_PUT_ARRAY_TAG, array);} catch (JSONException e) {e.printStackTrace();}
+
+ if(!forceRefresh && (System.currentTimeMillis()-getTrustedAppListTimeStamp(context))<getRefreshRate()){
+ if(object.toString().equals(getLastRequest(context))){
+ //Our list should still be ok for now so we will skip the request
+ pendingListRefresh = false;
+ if(listCallback!=null){
+ listCallback.onListObtained(true);
+ }
+ return false;
+ }else{
+ Log.d(TAG, "Sdl apps have changed. Need to request new trusted router service list.");
+ }
+ }
+
+ if (cb == null) {
+ cb = new HttpRequestTaskCallback() {
+
+ @Override
+ public void httpCallComplete(String response) {
+ // Might want to check if this list is ok
+ //Log.d(TAG, "APPS! " + response);
+ setTrustedList(context, response);
+ setLastRequest(context, object.toString()); //Save our last request
+ pendingListRefresh = false;
+ if(listCallback!=null){listCallback.onListObtained(true);}
+ }
+
+ @Override
+ public void httpFailure(int statusCode) {
+ Log.e(TAG, "Error while requesting trusted app list: "
+ + statusCode);
+ pendingListRefresh = false;
+ if(listCallback!=null){listCallback.onListObtained(false);}
+ }
+ };
+ }
+
+ new HttpRequestTask(cb).execute(REQUEST_PREFIX,HttpRequestTask.REQUEST_TYPE_POST,object.toString(),"application/json","application/json");
+
+ return true;
+ }
+
+ /**
+ * This method will determine if our supplied component name is really running.
+ * @param context
+ * @param service
+ * @return
+ */
+ protected boolean isServiceRunning(Context context, ComponentName service){
+ ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+ for (RunningServiceInfo serviceInfo : manager.getRunningServices(Integer.MAX_VALUE)) {
+ if (serviceInfo.service.equals(service)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /**
+ * Parses a string into a JSON array
+ * @param json
+ * @return
+ */
+ protected JSONObject stringToJson(String json){
+ if(json==null){
+ return stringToJson(DEFAULT_APP_LIST);
+ }
+ try {
+ JSONObject object = new JSONObject(json);
+ JSONObject trustedApps = object.getJSONObject(JSON_RESPONSE_OBJECT_TAG);
+ return trustedApps;
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ if(!json.equalsIgnoreCase(DEFAULT_APP_LIST)){ //Since we were unable to parse, let's fall back to at least our last known good list. If this list is somehow messed up, just quit.
+ return stringToJson(DEFAULT_APP_LIST);
+ }else{
+ return null;
+ }
+ }
+ }
+
+ public static boolean invalidateList(Context context){
+ if(context == null){
+ return false;
+ }
+ SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
+ // Write the new prefs
+ SharedPreferences.Editor prefAdd = pref.edit();
+ prefAdd.putLong(SDL_PACKAGE_LIST_TIMESTAMP, 0); //This will be the last time we updated
+ return prefAdd.commit();
+ }
+ /******************************************************************
+ *
+ * Saving the list for later!!!
+ *
+ ******************************************************************/
+
+ /**
+ * Saves the list of available applications into user's shared prefs.
+ * @param context The application's environment
+ * @param jsonString The JSON string to save.
+ */
+ protected static boolean setTrustedList(Context context, String jsonString){
+ if(jsonString!=null && context!=null){
+ SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
+ // Write the new prefs
+ SharedPreferences.Editor prefAdd = pref.edit();
+ prefAdd.putString(SDL_PACKAGE_LIST, jsonString);
+ prefAdd.putLong(SDL_PACKAGE_LIST_TIMESTAMP, System.currentTimeMillis()); //This will be the last time we updated
+ return prefAdd.commit();
+ }
+ return false;
+ }
+
+ /**
+ * Retrieves the list of available applications from user's shared prefs.
+ * @param context The application's environment.
+ * @return The JSON string that was retrieved.
+ */
+ protected static String getTrustedList(Context context){
+ if(context!=null){
+ SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
+ return pref.getString(SDL_PACKAGE_LIST, DEFAULT_APP_LIST);
+ }
+ return null;
+ }
+
+ /**
+ * Retrieves the time stamp from the user's shared prefs.
+ * @param context The application's environment.
+ * @return The time stamp that was retrieved.
+ */
+ protected static Long getTrustedAppListTimeStamp(Context context){
+ if(context!=null){
+ SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
+ return pref.getLong(SDL_PACKAGE_LIST_TIMESTAMP, 0);
+ }
+ return -1L;
+ }
+
+ protected static boolean setLastRequest(Context context, String request){
+ if(context!=null){
+ SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
+ SharedPreferences.Editor prefAdd = pref.edit();
+ prefAdd.putString(SDL_LAST_REQUEST, request);
+ return prefAdd.commit();
+ }
+ return false;
+ }
+
+ /**
+ * Gets the last request JSON object we sent to the RSVP server. It basically contains a list of sdl enabled apps
+ * @param context
+ * @return
+ */
+ protected static String getLastRequest(Context context){
+ if(context!=null){
+ SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
+ return pref.getString(SDL_LAST_REQUEST, null);
+ }
+ return null;
+ }
+
+ protected static boolean cacheSecurityLevel(Context context, int securityLevel){
+ if(context!=null){
+ SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
+ SharedPreferences.Editor prefAdd = pref.edit();
+ prefAdd.putInt(SDL_RSVP_SECURITY_LEVEL, securityLevel);
+ return prefAdd.commit();
+ }
+ return false;
+ }
+
+ protected static int getSecurityLevel(Context context){
+ if(context!=null){
+ SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
+ return pref.getInt(SDL_RSVP_SECURITY_LEVEL, MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED);
+ }
+ return MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED;
+ }
+
+ /**
+ * Class that holds all the info we want to send/receive from the validation server
+ */
+ public static class SdlApp{
+ String packageName;
+ int versionCode;
+
+ SdlApp(String packageName, int versionCode){
+ this.packageName = packageName;
+ this.versionCode = versionCode;
+ }
+ }
+
+ public static enum TrustedAppStore{
+ PLAY_STORE("com.android.vending"),
+ AMAZON("com.amazon.venezia"),
+ XIAOMI("com.xiaomi.market"),
+ SAMSUNG("com.sec.android.app.samsungapps"),
+ WANDOUJIA("com.wandoujia.phoenix2"),
+ BAIDU_APP_SEARCH("com.baidu.appsearch"),
+ HIAPK("com.hiapk.marketpho"),
+ ;
+
+ String packageString;
+ private TrustedAppStore(String packageString){
+ this.packageString = packageString;
+ }
+
+ /**
+ * Test if the supplied store package is one of the trusted app stores
+ * @param packageString
+ * @return
+ */
+ public static boolean isTrustedStore(String packageString){
+ if(packageString == null){
+ return false;
+ }
+ TrustedAppStore[] stores = TrustedAppStore.values();
+ for(int i =0; i<stores.length; i++){
+ if(packageString.equalsIgnoreCase(stores[i].packageString)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ }
+ /**
+ * This interface is used as a callback to know when we have either obtained a list or at least returned from our attempt.
+ *
+ */
+ public static interface TrustedListCallback{
+ public void onListObtained(boolean successful);
+ }
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
new file mode 100644
index 000000000..94025de30
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
@@ -0,0 +1,493 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.app.ActivityManager;
+import android.app.ActivityManager.RunningServiceInfo;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothProfile;
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.hardware.usb.UsbManager;
+import android.os.Build;
+import android.os.Parcelable;
+import android.util.Log;
+
+import com.smartdevicelink.R;
+import com.smartdevicelink.transport.RouterServiceValidator.TrustedListCallback;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.AndroidTools;
+import com.smartdevicelink.util.SdlAppInfo;
+import com.smartdevicelink.util.ServiceFinder;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.Vector;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
+
+public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
+
+ private static final String TAG = "Sdl Broadcast Receiver";
+
+ protected static final String SDL_ROUTER_SERVICE_CLASS_NAME = "sdlrouterservice";
+
+ public static final String LOCAL_ROUTER_SERVICE_EXTRA = "router_service";
+ public static final String LOCAL_ROUTER_SERVICE_DID_START_OWN = "did_start";
+
+ public static final String TRANSPORT_GLOBAL_PREFS = "SdlTransportPrefs";
+ public static final String IS_TRANSPORT_CONNECTED = "isTransportConnected";
+
+ public static Vector<ComponentName> runningBluetoothServicePackage = null;
+
+ @SuppressWarnings("rawtypes")
+ private static Class localRouterClass;
+
+ private static final Object QUEUED_SERVICE_LOCK = new Object();
+ private static ComponentName queuedService = null;
+
+ public int getRouterServiceVersion(){
+ return SdlRouterService.ROUTER_SERVICE_VERSION_NUMBER;
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ //Log.i(TAG, "Sdl Receiver Activated");
+ final String action = intent.getAction();
+ BluetoothDevice device = null;
+
+ if(action.equalsIgnoreCase(Intent.ACTION_PACKAGE_ADDED)
+ || action.equalsIgnoreCase(Intent.ACTION_PACKAGE_REPLACED)){
+ //The package manager has sent out a new broadcast.
+ RouterServiceValidator.invalidateList(context);
+ return;
+ }
+
+ if(!(action.equalsIgnoreCase(BluetoothDevice.ACTION_ACL_CONNECTED)
+ || action.equalsIgnoreCase(USBTransport.ACTION_USB_ACCESSORY_ATTACHED)
+ || action.equalsIgnoreCase(TransportConstants.START_ROUTER_SERVICE_ACTION))){
+ //We don't want anything else here if the child class called super and has different intent filters
+ //Log.i(TAG, "Unwanted intent from child class");
+ return;
+ }
+
+ if(action.equalsIgnoreCase(USBTransport.ACTION_USB_ACCESSORY_ATTACHED)){
+ Log.d(TAG, "Usb connected");
+ intent.setAction(null);
+ onSdlEnabled(context, intent);
+ return;
+ }
+
+ if(intent.hasExtra(BluetoothDevice.EXTRA_DEVICE)){ //Grab the bluetooth device if available
+ device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
+ }
+
+ boolean didStart = false;
+ if (localRouterClass == null){
+ localRouterClass = defineLocalSdlRouterClass();
+ // we need to check this again because for USB apps, the returned class can still be null
+ if (localRouterClass != null) {
+
+ // Check if the service declaration in AndroidManifest has the intent-filter action specified correctly
+ boolean serviceFilterHasAction = false;
+ String className = localRouterClass.getName();
+ List<SdlAppInfo> services = AndroidTools.querySdlAppInfo(context, null);
+ for (SdlAppInfo sdlAppInfo : services) {
+ if(sdlAppInfo != null && sdlAppInfo.getRouterServiceComponentName() != null && className.equals((sdlAppInfo.getRouterServiceComponentName().getClassName()))){
+ serviceFilterHasAction = true;
+ break;
+ }
+ }
+ if (!serviceFilterHasAction){
+ Log.e(TAG, "WARNING: This application has not specified its intent-filter for the SdlRouterService. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
+ }
+
+ // Check if the service declaration in AndroidManifest has the router service version metadata specified correctly
+ ResolveInfo info = context.getPackageManager().resolveService(new Intent(context, localRouterClass), PackageManager.GET_META_DATA);
+ if (info != null) {
+ if (info.serviceInfo.metaData == null || !info.serviceInfo.metaData.containsKey(context.getString(R.string.sdl_router_service_version_name))) {
+ Log.e(TAG, "WARNING: This application has not specified its metadata tags for the SdlRouterService. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
+ }
+ } else {
+ Log.e(TAG, "WARNING: This application has not specified its SdlRouterService correctly in the manifest. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
+ }
+ }
+ }
+
+ if(localRouterClass != null && localRouterClass.getName().equalsIgnoreCase(com.smartdevicelink.transport.SdlRouterService.class.getName())){
+ Log.e(TAG, "You cannot use the default SdlRouterService class, it must be extended in your project. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
+ }
+
+ //This will only be true if we are being told to reopen our SDL service because SDL is enabled
+ if(action.equalsIgnoreCase(TransportConstants.START_ROUTER_SERVICE_ACTION)){
+ if(intent.hasExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_EXTRA)){
+ if(intent.getBooleanExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_EXTRA, false)){
+ String packageName = intent.getStringExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_APP_PACKAGE);
+ final ComponentName componentName = intent.getParcelableExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_CMP_NAME);
+ if(componentName!=null){
+ final Intent finalIntent = intent;
+ final Context finalContext = context;
+ RouterServiceValidator.createTrustedListRequest(context, false, new TrustedListCallback(){
+ @Override
+ public void onListObtained(boolean successful) {
+ //Log.v(TAG, "SDL enabled by router service from " + packageName + " compnent package " + componentName.getPackageName() + " - " + componentName.getClassName());
+ //List obtained. Let's start our service
+ queuedService = componentName;
+ finalIntent.setAction("com.sdl.noaction"); //Replace what's there so we do go into some unintended loop
+ String transportType = finalIntent.getStringExtra(TransportConstants.START_ROUTER_SERVICE_TRANSPORT_CONNECTED);
+ if(transportType!= null ){
+ if(TransportType.USB.toString().equals(transportType)){
+ finalIntent.putExtra(UsbManager.EXTRA_ACCESSORY, (Parcelable)null);
+ }
+ }
+ onSdlEnabled(finalContext, finalIntent);
+ }
+
+ });
+ }
+
+ }else{
+ //This was previously not hooked up, so let's leave it commented out
+ //onSdlDisabled(context);
+ }
+ return;
+ }else if(intent.getBooleanExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, false)){
+ //We were told to wake up our router services
+ boolean altServiceWake = intent.getBooleanExtra(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT, false);
+ didStart = wakeUpRouterService(context, false,altServiceWake,device );
+
+ }
+ }
+
+
+ Log.d(TAG, "Check for local router");
+ if(localRouterClass!=null){ //If there is a supplied router service lets run some logic regarding starting one
+
+ if(!didStart){Log.d(TAG, "attempting to wake up router service");
+ didStart = wakeUpRouterService(context, true,false, device);
+ }
+
+ //So even though we started our own version, on some older phones we find that two services are started up so we want to make sure we send our version that we are working with
+ //We will send it an intent with the version number of the local instance and an intent to start this instance
+
+ Intent serviceIntent = new Intent(context, localRouterClass);
+ SdlRouterService.LocalRouterService self = SdlRouterService.getLocalRouterService(serviceIntent, serviceIntent.getComponent());
+ Intent restart = new Intent(SdlRouterService.REGISTER_NEWER_SERVER_INSTANCE_ACTION);
+ restart.putExtra(LOCAL_ROUTER_SERVICE_EXTRA, self);
+ restart.putExtra(LOCAL_ROUTER_SERVICE_DID_START_OWN, didStart);
+ context.sendBroadcast(restart);
+ }
+ }
+
+ private boolean wakeUpRouterService(final Context context, final boolean ping, final boolean altTransportWake, final BluetoothDevice device){
+ new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() {
+ @Override
+ public void onComplete(Vector<ComponentName> routerServices) {
+ runningBluetoothServicePackage = new Vector<ComponentName>();
+ runningBluetoothServicePackage.addAll(routerServices);
+ if (runningBluetoothServicePackage.isEmpty()) {
+ //If there isn't a service running we should try to start one
+ //We will try to sort the SDL enabled apps and find the one that's been installed the longest
+ Intent serviceIntent;
+ List<SdlAppInfo> sdlAppInfoList = AndroidTools.querySdlAppInfo(context, new SdlAppInfo.BestRouterComparator());
+ if (sdlAppInfoList != null && !sdlAppInfoList.isEmpty()) {
+ serviceIntent = new Intent();
+ serviceIntent.setComponent(sdlAppInfoList.get(0).getRouterServiceComponentName());
+ } else{
+ Log.d(TAG, "No SDL Router Services found");
+ Log.d(TAG, "WARNING: This application has not specified its SdlRouterService correctly in the manifest. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
+ return;
+ }
+ if (altTransportWake) {
+ serviceIntent.setAction(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT);
+ }
+ if(device != null){
+ serviceIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
+ }
+ try {
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
+ context.startService(serviceIntent);
+ }else {
+ serviceIntent.putExtra(FOREGROUND_EXTRA, true);
+ context.startForegroundService(serviceIntent);
+
+ }
+ //Make sure to send this out for old apps to close down
+ SdlRouterService.LocalRouterService self = SdlRouterService.getLocalRouterService(serviceIntent, serviceIntent.getComponent());
+ Intent restart = new Intent(SdlRouterService.REGISTER_NEWER_SERVER_INSTANCE_ACTION);
+ restart.putExtra(LOCAL_ROUTER_SERVICE_EXTRA, self);
+ restart.putExtra(LOCAL_ROUTER_SERVICE_DID_START_OWN, true);
+ context.sendBroadcast(restart);
+
+ } catch (SecurityException e) {
+ Log.e(TAG, "Security exception, process is bad");
+ }
+ } else {
+ if (altTransportWake) {
+ wakeRouterServiceAltTransport(context);
+ return;
+ }else{
+ for(ComponentName service : runningBluetoothServicePackage){
+ pingRouterService(context,service.getPackageName(),service.getClassName());
+ }
+ }
+ return;
+ }
+ }
+ });
+ return true;
+ }
+
+ private void wakeRouterServiceAltTransport(Context context){
+ Intent serviceIntent = new Intent();
+ serviceIntent.setAction(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT);
+ for (ComponentName compName : runningBluetoothServicePackage) {
+ serviceIntent.setComponent(compName);
+ context.startService(serviceIntent);
+
+ }
+ }
+
+ /**
+ * Determines if an instance of the Router Service is currently running on the device.<p>
+ * <b>Note:</b> This method no longer works on Android Oreo or newer
+ * @param context A context to access Android system services through.
+ * @param pingService Set this to true if you want to make sure the service is up and listening to bluetooth
+ * @return True if a SDL Router Service is currently running, false otherwise.
+ */
+ private static boolean isRouterServiceRunning(Context context, boolean pingService){
+ if(context == null){
+ Log.e(TAG, "Can't look for router service, context supplied was null");
+ return false;
+ }
+ if (runningBluetoothServicePackage == null) {
+ runningBluetoothServicePackage = new Vector<ComponentName>();
+ } else {
+ runningBluetoothServicePackage.clear();
+ }
+ ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+ manager.getRunningAppProcesses();
+ List<RunningServiceInfo> runningServices = null;
+ try {
+ runningServices = manager.getRunningServices(Integer.MAX_VALUE);
+ } catch (NullPointerException e) {
+ Log.e(TAG, "Can't get list of running services");
+ return false;
+ }
+ for (RunningServiceInfo service : runningServices) {
+ //We will check to see if it contains this name, should be pretty specific
+ //Log.d(TAG, "Found Service: "+ service.service.getClassName());
+ if ((service.service.getClassName()).toLowerCase(Locale.US).contains(SDL_ROUTER_SERVICE_CLASS_NAME) && AndroidTools.isServiceExported(context, service.service)) {
+ runningBluetoothServicePackage.add(service.service); //Store which instance is running
+ if (pingService) {
+ pingRouterService(context, service.service.getPackageName(), service.service.getClassName());
+ }
+ }
+ }
+ return runningBluetoothServicePackage.size() > 0;
+
+ }
+
+ /**
+ * Attempts to ping a running router service
+ * @param context A context to access Android system services through.
+ * @param packageName Package name for service to ping
+ * @param className Class name for service to ping
+ */
+ protected static void pingRouterService(Context context, String packageName, String className){
+ if(context == null || packageName == null || className == null){
+ return;
+ }
+ try{
+ Intent intent = new Intent();
+ intent.setClassName(packageName, className);
+ intent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true);
+ 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
+ }
+ }
+
+ /**
+ * This call will reach out to all SDL related router services to check if they're connected. If a the router service is connected, it will react by pinging all clients. This receiver will then
+ * receive that ping and if the router service is trusted, the onSdlEnabled method will be called.
+ * @param context
+ */
+ public static void queryForConnectedService(final Context context){
+ //Leverage existing call. Include ping bit
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
+ ServiceFinder finder = new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() {
+ @Override
+ public void onComplete(Vector<ComponentName> routerServices) {
+ runningBluetoothServicePackage = new Vector<ComponentName>();
+ runningBluetoothServicePackage.addAll(routerServices);
+ requestTransportStatus(context,null,true,false);
+ }
+ });
+
+ }else{
+ requestTransportStatus(context,null,true,true);
+ }
+ }
+ /**
+ * If a Router Service is running, this method determines if that service is connected to a device over some form of transport.
+ * @param context A context to access Android system services through. If null is passed, this will always return false
+ * @param callback Use this callback to find out if the router service is connected or not.
+ */
+ @Deprecated
+ public static void requestTransportStatus(Context context, final SdlRouterStatusProvider.ConnectedStatusCallback callback){
+ requestTransportStatus(context,callback,false, true);
+ }
+
+ private static void requestTransportStatus(Context context, final SdlRouterStatusProvider.ConnectedStatusCallback callback, final boolean triggerRouterServicePing, final boolean lookForServices){
+ if(context == null){
+ if(callback!=null){
+ callback.onConnectionStatusUpdate(false, null,context);
+ }
+ return;
+ }
+ if((!lookForServices || isRouterServiceRunning(context,false)) && !runningBluetoothServicePackage.isEmpty()){ //So there is a service up, let's see if it's connected
+ final ConcurrentLinkedQueue<ComponentName> list = new ConcurrentLinkedQueue<ComponentName>(runningBluetoothServicePackage);
+ final SdlRouterStatusProvider.ConnectedStatusCallback sdlBrCallback = new SdlRouterStatusProvider.ConnectedStatusCallback() {
+
+ @Override
+ public void onConnectionStatusUpdate(boolean connected, ComponentName service,Context context) {
+ if(!connected && !list.isEmpty()){
+ SdlRouterStatusProvider provider = new SdlRouterStatusProvider(context,list.poll(), this);
+ if(triggerRouterServicePing){provider.setFlags(TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING); }
+ provider.checkIsConnected();
+ }else{
+ if(service!=null){
+ Log.d(TAG, service.getPackageName() + " is connected = " + connected);
+ }else{
+ Log.d(TAG,"No service is connected/running");
+ }
+ if(callback!=null){
+ callback.onConnectionStatusUpdate(connected, service,context);
+ }
+ list.clear();
+ }
+
+ }
+ };
+ final SdlRouterStatusProvider provider = new SdlRouterStatusProvider(context,list.poll(),sdlBrCallback);
+ if(triggerRouterServicePing){
+ provider.setFlags(TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING);
+ }
+ //Lets ensure we have a current list of trusted router services
+ RouterServiceValidator.createTrustedListRequest(context, false, new TrustedListCallback(){
+ @Override
+ public void onListObtained(boolean successful) {
+ //This will kick off our check of router services
+ provider.checkIsConnected();
+ }
+ });
+
+ }else{
+ Log.w(TAG, "Router service isn't running, returning false.");
+ if(isBluetoothConnected()){
+ Log.d(TAG, "Bluetooth is connected. Attempting to start Router Service");
+ Intent serviceIntent = new Intent();
+ serviceIntent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION);
+ serviceIntent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true);
+ AndroidTools.sendExplicitBroadcast(context,serviceIntent,null);
+ }
+ if(callback!=null){
+ callback.onConnectionStatusUpdate(false, null,context);
+ }
+ }
+ }
+
+ @SuppressWarnings({"MissingPermission"})
+ private static boolean isBluetoothConnected() {
+ BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ if(bluetoothAdapter != null && bluetoothAdapter.isEnabled()) {
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ int a2dpState = bluetoothAdapter.getProfileConnectionState(BluetoothProfile.A2DP);
+ int headSetState = bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET);
+
+ return ((a2dpState == BluetoothAdapter.STATE_CONNECTED || a2dpState == BluetoothAdapter.STATE_CONNECTING)
+ && (headSetState == BluetoothAdapter.STATE_CONNECTED || headSetState == BluetoothAdapter.STATE_CONNECTING));
+ }else{
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static ComponentName consumeQueuedRouterService(){
+ synchronized(QUEUED_SERVICE_LOCK){
+ ComponentName retVal = queuedService;
+ queuedService = null;
+ return retVal;
+ }
+ }
+
+ /**
+ * We need to define this for local copy of the Sdl Router Service class.
+ * It will be the main point of connection for Sdl enabled apps
+ * @return Return the local copy of SdlRouterService.class
+ * {@inheritDoc}
+ */
+ public abstract Class<? extends SdlRouterService> defineLocalSdlRouterClass();
+
+
+
+ /**
+ *
+ * The developer will need to define exactly what should happen when Sdl is enabled.
+ * This method will only get called when a Sdl session is initiated.
+ * <p> The most useful code here would be to start the activity or service that handles most of the Livio
+ * Connect code.
+ * @param context this is the context that was passed to this receiver when it was called.
+ * @param intent this is the intent that alerted this broadcast. Make sure to pass all extra it came with to your service/activity
+ * {@inheritDoc}
+ */
+ public abstract void onSdlEnabled(Context context, Intent intent);
+
+ //public abstract void onSdlDisabled(Context context); //Removing for now until we're able to abstract from developer
+
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
new file mode 100644
index 000000000..efc1fbe2e
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
@@ -0,0 +1,3643 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.Manifest;
+import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
+import android.app.ActivityManager;
+import android.app.ActivityManager.RunningAppProcessInfo;
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.SharedPreferences;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.os.BatteryManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.DeadObjectException;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.IBinder.DeathRecipient;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.Parcel;
+import android.os.ParcelFileDescriptor;
+import android.os.Parcelable;
+import android.os.RemoteException;
+import android.support.annotation.NonNull;
+import android.util.Log;
+import android.util.SparseArray;
+import android.util.SparseIntArray;
+
+import com.smartdevicelink.R;
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.BinaryFrameHeader;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.SdlPacketFactory;
+import com.smartdevicelink.protocol.enums.ControlFrameTags;
+import com.smartdevicelink.protocol.enums.FrameType;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.ByteAraryMessageAssembler;
+import com.smartdevicelink.transport.utl.ByteArrayMessageSpliter;
+import com.smartdevicelink.transport.utl.TransportRecord;
+import com.smartdevicelink.util.AndroidTools;
+import com.smartdevicelink.util.BitConverter;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.SdlAppInfo;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+import java.util.Vector;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import static com.smartdevicelink.transport.TransportConstants.CONNECTED_DEVICE_STRING_EXTRA_NAME;
+import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
+import static com.smartdevicelink.transport.TransportConstants.FORMED_PACKET_EXTRA_NAME;
+import static com.smartdevicelink.transport.TransportConstants.HARDWARE_DISCONNECTED;
+import static com.smartdevicelink.transport.TransportConstants.SDL_NOTIFICATION_CHANNEL_ID;
+import static com.smartdevicelink.transport.TransportConstants.SDL_NOTIFICATION_CHANNEL_NAME;
+import static com.smartdevicelink.transport.TransportConstants.SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME;
+import static com.smartdevicelink.transport.TransportConstants.TRANSPORT_DISCONNECTED;
+
+/**
+ * <b>This class should not be modified by anyone outside of the approved contributors of the SmartDeviceLink project.</b>
+ * This service is a central point of communication between hardware and the registered clients. It will multiplex a single transport
+ * to provide a connection for a theoretical infinite amount of SDL sessions.
+ * @author Joey Grover
+ *
+ */
+@SuppressWarnings({"UnusedReturnValue", "WeakerAccess", "Convert2Diamond", "deprecation"})
+public class SdlRouterService extends Service{
+
+ private static final String TAG = "Sdl Router Service";
+ /**
+ * <b> NOTE: DO NOT MODIFY THIS UNLESS YOU KNOW WHAT YOU'RE DOING.</b>
+ */
+ protected static final int ROUTER_SERVICE_VERSION_NUMBER = 9;
+
+ private static final String ROUTER_SERVICE_PROCESS = "com.smartdevicelink.router";
+
+ private static final int FOREGROUND_SERVICE_ID = 849;
+
+ private static final long CLIENT_PING_DELAY = 1000;
+
+ public static final String REGISTER_NEWER_SERVER_INSTANCE_ACTION = "com.sdl.android.newservice";
+
+ public static final String SDL_NOTIFICATION_FAQS_PAGE = "https://smartdevicelink.com/en/guides/android/frequently-asked-questions/sdl-notifications/";
+
+ /**
+ * @deprecated use {@link TransportConstants#START_ROUTER_SERVICE_ACTION} instead
+ */
+ @Deprecated
+ public static final String START_SERVICE_ACTION = "sdl.router.startservice";
+ public static final String REGISTER_WITH_ROUTER_ACTION = "com.sdl.android.register";
+
+ /** Message types sent from the BluetoothReadService Handler */
+ public static final int MESSAGE_STATE_CHANGE = 1;
+ public static final int MESSAGE_READ = 2;
+ @SuppressWarnings("unused")
+ public static final int MESSAGE_WRITE = 3;
+ public static final int MESSAGE_DEVICE_NAME = 4;
+ public static final int MESSAGE_LOG = 5;
+
+ @SuppressWarnings("FieldCanBeLocal")
+ private final int UNREGISTER_APP_INTERFACE_CORRELATION_ID = 65530;
+
+ /* Bluetooth Transport */
+ private MultiplexBluetoothTransport bluetoothTransport = null;
+ private final Handler bluetoothHandler = new TransportHandler(this);
+
+ /* USB Transport */
+ private MultiplexUsbTransport usbTransport;
+ private final Handler usbHandler = new TransportHandler(this);
+
+ /* TCP Transport */
+ private MultiplexTcpTransport tcpTransport;
+ private final Handler tcpHandler = new TransportHandler(this);
+
+ /**
+ * Preference location where the service stores known SDL status based on device address
+ */
+ protected static final String SDL_DEVICE_STATUS_SHARED_PREFS = "sdl.device.status";
+
+
+
+ private static boolean connectAsClient = false;
+ private static boolean closing = false;
+
+ private Handler altTransportTimerHandler, foregroundTimeoutHandler;
+ private Runnable altTransportTimerRunnable, foregroundTimeoutRunnable;
+ private final static int ALT_TRANSPORT_TIMEOUT_RUNNABLE = 30000, FOREGROUND_TIMEOUT = 10000;
+
+ private boolean wrongProcess = false;
+ private boolean initPassed = false;
+
+ public static HashMap<String,RegisteredApp> registeredApps;
+ private SparseArray<String> bluetoothSessionMap, usbSessionMap, tcpSessionMap;
+ private SparseIntArray sessionHashIdMap;
+ private SparseIntArray cleanedSessionMap;
+ 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;
+
+ private boolean startSequenceComplete = false;
+
+ private ExecutorService packetExecutor = null;
+ ConcurrentHashMap<TransportType, PacketWriteTaskMaster> packetWriteTaskMasterMap = null;
+
+
+ /**
+ * This flag is to keep track of if we are currently acting as a foreground service
+ */
+ private boolean isForeground = false;
+
+ private int cachedModuleVersion = -1;
+
+ /**
+ * Executor for making sure clients are still running during trying times
+ */
+ private ScheduledExecutorService clientPingExecutor = null;
+ Intent pingIntent = null;
+ private boolean isPingingClients = false;
+ int pingCount = 0;
+
+
+ /* **************************************************************************************************************************************
+ ****************************************************************************************************************************************
+ *********************************************** Broadcast Receivers START **************************************************************
+ ****************************************************************************************************************************************
+ ****************************************************************************************************************************************/
+
+ /** create our receiver from the router service */
+ final BroadcastReceiver mainServiceReceiver = new BroadcastReceiver()
+ {
+ @Override
+ public void onReceive(Context context, Intent intent)
+ {
+ //Let's grab where to reply to this intent at. We will keep it temp right now because we may have to deny registration
+ String action =intent.getStringExtra(SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME);
+ sendBroadcast(prepareRegistrationIntent(action));
+ }
+ };
+
+ private Intent prepareRegistrationIntent(String action){
+ Intent registrationIntent = new Intent();
+ registrationIntent.setAction(action);
+ registrationIntent.putExtra(TransportConstants.BIND_LOCATION_PACKAGE_NAME_EXTRA, this.getPackageName());
+ registrationIntent.putExtra(TransportConstants.BIND_LOCATION_CLASS_NAME_EXTRA, this.getClass().getName());
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
+ registrationIntent.setFlags((Intent.FLAG_RECEIVER_FOREGROUND));
+ }
+ return registrationIntent;
+ }
+
+ private void onAppRegistered(RegisteredApp app){
+ //Log.enableDebug(receivedIntent.getBooleanExtra(LOG_BASIC_DEBUG_BOOLEAN_EXTRA, false));
+ //Log.enableBluetoothTraceLogging(receivedIntent.getBooleanExtra(LOG_TRACE_BT_DEBUG_BOOLEAN_EXTRA, false));
+ //Ok this is where we should do some authenticating...maybe.
+ //Should we ask for all relevant data in this packet?
+ if(bluetoothAvailable()){
+ if(startSequenceComplete &&
+ !connectAsClient && (bluetoothTransport ==null
+ || bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_NONE)){
+ Log.e(TAG, "Serial service not initialized while registering app");
+ //Maybe we should try to do a connect here instead
+ Log.d(TAG, "Serial service being restarted");
+ initBluetoothSerialService();
+
+
+ }
+ }
+
+ Log.i(TAG, app.appId + " has just been registered with SDL Router Service");
+ }
+
+ /**
+ * If the user disconnects the bluetooth device we will want to stop SDL and our current
+ * connection through RFCOMM
+ */
+ final BroadcastReceiver mListenForDisconnect = new BroadcastReceiver()
+ {
+ @Override
+ @SuppressWarnings("MissingPermission")
+ public void onReceive(Context context, Intent intent)
+ {
+ String action = intent.getAction();
+ if(action == null){
+ Log.d(TAG, "Disconnect received with no action.");
+ }else {
+ Log.d(TAG, "Disconnect received. Action: " + intent.getAction());
+
+ if(action.equalsIgnoreCase(BluetoothAdapter.ACTION_STATE_CHANGED)){
+ int bluetoothState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1);
+ switch (bluetoothState) {
+ case BluetoothAdapter.STATE_TURNING_ON:
+ case BluetoothAdapter.STATE_ON:
+ //There is nothing to do in the case the adapter is turning on or just switched to on
+ return;
+ case BluetoothAdapter.STATE_TURNING_OFF:
+ case BluetoothAdapter.STATE_OFF:
+ Log.d(TAG, "Bluetooth is shutting off, SDL Router Service is closing.");
+ connectAsClient = false;
+ if(!shouldServiceRemainOpen(intent)){
+ closeSelf();
+ }
+ return;
+ default:
+ break;
+ }
+ }
+ //Otherwise
+ connectAsClient = false;
+ if (legacyModeEnabled) {
+ Log.d(TAG, "Legacy mode enabled and bluetooth d/c'ed, restarting router service bluetooth.");
+ enableLegacyMode(false);
+ onTransportDisconnected(new TransportRecord(TransportType.BLUETOOTH,null));
+ initBluetoothSerialService();
+ }
+ }
+ }
+ };
+
+/* **************************************************************************************************************************************
+*********************************************** Broadcast Receivers End **************************************************************
+****************************************************************************************************************************************/
+
+ /* **************************************************************************************************************************************
+ *********************************************** Handlers for bound clients **************************************************************
+ ****************************************************************************************************************************************/
+
+
+ /**
+ * Target we publish for clients to send messages to RouterHandler.
+ */
+ final Messenger routerMessenger = new Messenger(new RouterHandler(this));
+
+ /**
+ * Handler of incoming messages from clients.
+ */
+ @SuppressWarnings("Convert2Diamond")
+ static class RouterHandler extends Handler {
+ final WeakReference<SdlRouterService> provider;
+
+ public RouterHandler(SdlRouterService provider){
+ this.provider = new WeakReference<SdlRouterService>(provider);
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ if(this.provider.get() == null){
+ return;
+ }
+ final Bundle receivedBundle = msg.getData();
+ Bundle returnBundle;
+ final SdlRouterService service = this.provider.get();
+
+ switch (msg.what) {
+ case TransportConstants.ROUTER_REQUEST_BT_CLIENT_CONNECT:
+ if(receivedBundle.getBoolean(TransportConstants.CONNECT_AS_CLIENT_BOOLEAN_EXTRA, false)
+ && !connectAsClient){ //We check this flag to make sure we don't try to connect over and over again. On D/C we should set to false
+ //Log.d(TAG,"Attempting to connect as bt client");
+ BluetoothDevice device = receivedBundle.getParcelable(BluetoothDevice.EXTRA_DEVICE);
+ connectAsClient = true;
+ if(device==null || !service.bluetoothConnect(device)){
+ Log.e(TAG, "Unable to connect to bluetooth device");
+ connectAsClient = false;
+ }
+ }
+ //**************** We don't break here so we can let the app register as well
+ case TransportConstants.ROUTER_REGISTER_CLIENT: //msg.arg1 is appId
+ //pingClients();
+ Message message = Message.obtain();
+ message.what = TransportConstants.ROUTER_REGISTER_CLIENT_RESPONSE;
+ message.arg1 = TransportConstants.REGISTRATION_RESPONSE_SUCESS;
+ String appId = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
+ if(appId == null){
+ appId = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
+ }
+ if(appId.length()<=0 || msg.replyTo == null){
+ Log.w(TAG, "Unable to register app as no id or messenger was included");
+ if(msg.replyTo!=null){
+ message.arg1 = TransportConstants.REGISTRATION_RESPONSE_DENIED_APP_ID_NOT_INCLUDED;
+ try {
+ msg.replyTo.send(message);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ break;
+ }
+ if(service.legacyModeEnabled){
+ Log.w(TAG, "Unable to register app as legacy mode is enabled");
+ if(msg.replyTo!=null){
+ message.arg1 = TransportConstants.REGISTRATION_RESPONSE_DENIED_LEGACY_MODE_ENABLED;
+ try {
+ msg.replyTo.send(message);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ break;
+ }
+
+ int routerMessagingVersion = receivedBundle.getInt(TransportConstants.ROUTER_MESSAGING_VERSION,1);
+
+ RegisteredApp app = service.new RegisteredApp(appId, routerMessagingVersion, msg.replyTo);
+
+ synchronized(service.REGISTERED_APPS_LOCK){
+ RegisteredApp old = registeredApps.put(app.getAppId(), app);
+ if(old!=null){
+ Log.w(TAG, "Replacing already existing app with this app id");
+ service.removeAllSessionsForApp(old, true);
+ old.close();
+ }
+ }
+ service.onAppRegistered(app);
+
+ returnBundle = new Bundle();
+ //Add params if connected
+ if(service.isPrimaryTransportConnected()){
+ ArrayList<TransportRecord> records = service.getConnectedTransports();
+ returnBundle.putString(TransportConstants.HARDWARE_CONNECTED, records.get(records.size()-1).getType().name());
+ if(app.routerMessagingVersion > 1) {
+ returnBundle.putParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED, records);
+ }
+
+ if(service.bluetoothTransport != null){
+ returnBundle.putString(CONNECTED_DEVICE_STRING_EXTRA_NAME, service.bluetoothTransport.getDeviceName());
+ }
+ }
+ //Add the version of this router service
+ returnBundle.putInt(TransportConstants.ROUTER_SERVICE_VERSION, SdlRouterService.ROUTER_SERVICE_VERSION_NUMBER);
+
+ message.setData(returnBundle);
+
+ int result = app.sendMessage(message);
+ if(result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT){
+ synchronized(service.REGISTERED_APPS_LOCK){
+ registeredApps.remove(appId);
+ }
+ }
+ break;
+ case TransportConstants.ROUTER_UNREGISTER_CLIENT:
+ String appIdToUnregister = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
+ if(appIdToUnregister == null){
+ appIdToUnregister = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
+ }
+ Log.i(TAG, "Unregistering client: " + appIdToUnregister);
+ RegisteredApp unregisteredApp;
+ synchronized(service.REGISTERED_APPS_LOCK){
+ unregisteredApp = registeredApps.remove(appIdToUnregister);
+ }
+ Message response = Message.obtain();
+ response.what = TransportConstants.ROUTER_UNREGISTER_CLIENT_RESPONSE;
+ if(unregisteredApp == null){
+ response.arg1 = TransportConstants.UNREGISTRATION_RESPONSE_FAILED_APP_ID_NOT_FOUND;
+ service.removeAllSessionsWithAppId(appIdToUnregister);
+ }else{
+ response.arg1 = TransportConstants.UNREGISTRATION_RESPONSE_SUCESS;
+ service.removeAllSessionsForApp(unregisteredApp,false);
+ }
+ Log.i(TAG, "Unregistering client response: " + response.arg1 );
+ try {
+ msg.replyTo.send(response); //We do this because we aren't guaranteed to find the correct registeredApp to send the message through
+ } catch (RemoteException e) {
+ e.printStackTrace();
+
+ }catch(NullPointerException e2){
+ Log.e(TAG, "No reply address included, can't send a reply");
+ }
+
+ break;
+ case TransportConstants.ROUTER_SEND_PACKET:
+ //Log.d(TAG, "Received packet to send");
+ if(receivedBundle!=null){
+ Runnable packetRun = new Runnable(){
+ @Override
+ public void run() {
+ String buffAppId = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
+ if(buffAppId == null){
+ buffAppId = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
+ }
+
+ RegisteredApp buffApp;
+ synchronized(service.REGISTERED_APPS_LOCK){
+ buffApp = registeredApps.get(buffAppId);
+ }
+
+ if(buffApp !=null){
+ buffApp.handleIncommingClientMessage(receivedBundle);
+ }else{
+ TransportType transportType = TransportType.valueForString(receivedBundle.getString(TransportConstants.TRANSPORT_TYPE));
+ if(transportType == null){
+
+ /* We check bluetooth first because we assume if this value
+ * isn't included it is an older version of the proxy and
+ * therefore will be expecting this to be bluetooth.
+ */
+ if(service.bluetoothTransport != null && service.bluetoothTransport.isConnected()){
+ transportType = TransportType.BLUETOOTH;
+ } else if(service.usbTransport!= null && service.usbTransport.isConnected()){
+ transportType = TransportType.USB;
+ } else if(service.tcpTransport != null && service.tcpTransport.isConnected()){
+ transportType = TransportType.TCP;
+ }else{
+ // This means no transport is connected. Likely the
+ // router service has already disconnected and this
+ // is now just executing.
+ DebugTool.logError("Can't send packet, no transport specified and none are connected.");
+ return;
+ }
+ //Log.d(TAG, "Transport type was null, so router set it to " + transportType.name());
+ if(transportType != null){
+ receivedBundle.putString(TransportConstants.TRANSPORT_TYPE, transportType.name());
+ }
+ }
+ service.writeBytesToTransport(receivedBundle);
+ }
+ }
+ };
+ if(service.packetExecutor !=null){
+ service.packetExecutor.execute(packetRun);
+ }
+ }
+ break;
+ case TransportConstants.ROUTER_REQUEST_NEW_SESSION:
+ String appIdRequesting = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
+ if(appIdRequesting == null){
+ appIdRequesting = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
+ }
+ Message extraSessionResponse = Message.obtain();
+ extraSessionResponse.what = TransportConstants.ROUTER_REQUEST_NEW_SESSION_RESPONSE;
+ if(appIdRequesting.length()>0){
+ synchronized(service.REGISTERED_APPS_LOCK){
+ if(registeredApps!=null){
+ RegisteredApp appRequesting = registeredApps.get(appIdRequesting);
+ if(appRequesting!=null){
+ //Retrieve the transport the app is requesting a new session
+ String transport = receivedBundle.getString(TransportConstants.TRANSPORT_TYPE);
+ TransportType requestingTransport = null;
+ if(transport != null){
+ try{
+ requestingTransport = TransportType.valueOf(transport);
+ }catch (IllegalArgumentException e){}
+ }
+ if(requestingTransport == null){
+ /* We check bluetooth first because we assume if this value
+ * isn't included it is an older version of the proxy and
+ * therefore will be expecting this to be bluetooth.
+ */
+ if(service.bluetoothTransport != null && service.bluetoothTransport.isConnected()){
+ requestingTransport = TransportType.BLUETOOTH;
+ }else if(service.usbTransport!= null && service.usbTransport.isConnected()){
+ requestingTransport = TransportType.USB;
+ }else if(service.tcpTransport != null && service.tcpTransport.isConnected()){
+ requestingTransport = TransportType.TCP;
+ }
+ }
+ appRequesting.getSessionIds().add((long)-1); //Adding an extra session
+ appRequesting.getAwaitingSession().add(requestingTransport);
+ extraSessionResponse.arg1 = TransportConstants.ROUTER_REQUEST_NEW_SESSION_RESPONSE_SUCESS;
+ }else{
+ extraSessionResponse.arg1 = TransportConstants.ROUTER_REQUEST_NEW_SESSION_RESPONSE_FAILED_APP_NOT_FOUND;
+ }
+ }
+ }
+ }else{
+ extraSessionResponse.arg1 = TransportConstants.ROUTER_REQUEST_NEW_SESSION_RESPONSE_FAILED_APP_ID_NOT_INCL;
+ }
+ try {
+ msg.replyTo.send(extraSessionResponse); //We do this because we aren't guaranteed to find the correct registeredApp to send the message through
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }catch(NullPointerException e2){
+ Log.e(TAG, "No reply address included, can't send a reply");
+ }
+ break;
+ case TransportConstants.ROUTER_REMOVE_SESSION:
+ String appIdWithSession = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
+ if(appIdWithSession == null){
+ appIdWithSession = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
+ }
+ long sessionId = receivedBundle.getLong(TransportConstants.SESSION_ID_EXTRA, -1);
+
+ Message removeSessionResponse = Message.obtain();
+ removeSessionResponse.what = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE;
+ if(appIdWithSession.length()>0){
+ if(sessionId>=0){
+ synchronized(service.REGISTERED_APPS_LOCK){
+ if(registeredApps!=null){
+ RegisteredApp appRequesting = registeredApps.get(appIdWithSession);
+ if(appRequesting!=null){
+ //Might need to check which session is on which transport
+ service.removeSessionFromMap((int)sessionId, appRequesting.getTransportsForSession((int)sessionId));
+ if(appRequesting.removeSession(sessionId)){
+ removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_SUCESS;
+ }else{
+ removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_FAILED_SESSION_NOT_FOUND;
+ }
+ }else{
+ removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_FAILED_APP_NOT_FOUND;
+ }
+ }
+ }
+ }else{
+ removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_FAILED_SESSION_ID_NOT_INCL;
+ }
+ }else{
+ removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_FAILED_APP_ID_NOT_INCL;
+ }
+ try {
+ msg.replyTo.send(removeSessionResponse); //We do this because we aren't guaranteed to find the correct registeredApp to send the message through
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }catch(NullPointerException e2){
+ Log.e(TAG, "No reply address included, can't send a reply");
+ }
+ break;
+ case TransportConstants.ROUTER_REQUEST_SECONDARY_TRANSPORT_CONNECTION:
+ // Currently this only handles one TCP connection
+
+ String ipAddress = receivedBundle.getString(ControlFrameTags.RPC.TransportEventUpdate.TCP_IP_ADDRESS);
+ int port = receivedBundle.getInt(ControlFrameTags.RPC.TransportEventUpdate.TCP_PORT);
+
+ if(ipAddress != null){
+ if(service.tcpTransport != null){
+ switch (service.tcpTransport.getState()){
+ case MultiplexBaseTransport.STATE_CONNECTED:
+ case MultiplexBaseTransport.STATE_CONNECTING:
+ // A TCP connection is currently active. This version of the
+ // router service can't handle multiple TCP transports so just
+ // return a connected message to requester.
+ if(msg.replyTo != null){
+ // Send a transport connect message to the app that requested
+ // the tcp transport
+ try {
+ msg.replyTo.send(service.createHardwareConnectedMessage(service.tcpTransport.transportRecord));
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ //Nothing else to do, so return out of this method
+ return;
+
+ case MultiplexBaseTransport.STATE_NONE:
+ case MultiplexBaseTransport.STATE_LISTEN:
+ case MultiplexBaseTransport.STATE_ERROR:
+ //Clear out tcp transport
+ service.tcpTransport.stop(MultiplexBaseTransport.STATE_NONE);
+ service.tcpTransport = null;
+ //Do not return, need to create a new TCP connection
+ }
+
+ }//else { TCP transport does not exists.}
+
+ //TCP transport either doesn't exist or is not connected. Start one up.
+ service.tcpTransport = new MultiplexTcpTransport(port, ipAddress, true, service.tcpHandler, service);
+ service.tcpTransport.start();
+
+ }
+ break;
+ default:
+ super.handleMessage(msg);
+ }
+ }
+ }
+
+
+ /**
+ * Target we publish for alternative transport (USB) clients to send messages to RouterHandler.
+ */
+ final Messenger altTransportMessenger = new Messenger(new AltTransportHandler(this));
+
+ /**
+ * Handler of incoming messages from an alternative transport (USB).
+ */
+ @SuppressWarnings("Convert2Diamond")
+ static class AltTransportHandler extends Handler {
+ final ClassLoader loader;
+ final WeakReference<SdlRouterService> provider;
+
+ public AltTransportHandler(SdlRouterService provider){
+ this.provider = new WeakReference<SdlRouterService>(provider);
+ loader = getClass().getClassLoader();
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ if(this.provider.get() == null){
+ return;
+ }
+ SdlRouterService service = this.provider.get();
+ Bundle receivedBundle = msg.getData();
+ switch(msg.what){
+ case TransportConstants.HARDWARE_CONNECTION_EVENT:
+ if(receivedBundle.containsKey(TransportConstants.HARDWARE_DISCONNECTED)){
+ //We should shut down, so call
+ if(altTransportService != null
+ && altTransportService.equals(msg.replyTo)){
+ //The same transport that was connected to the router service is now telling us it's disconnected. Let's inform clients and clear our saved messenger
+ altTransportService = null;
+ service.onTransportDisconnected(new TransportRecord(TransportType.valueOf(receivedBundle.getString(TransportConstants.HARDWARE_DISCONNECTED)),null));
+ service.shouldServiceRemainOpen(null); //this will close the service if bluetooth is not available
+ }
+ }else if(receivedBundle.containsKey(TransportConstants.HARDWARE_CONNECTED)){
+ Message retMsg = Message.obtain();
+ retMsg.what = TransportConstants.ROUTER_REGISTER_ALT_TRANSPORT_RESPONSE;
+ if(altTransportService == null){ //Ok no other transport is connected, this is good
+ Log.d(TAG, "Alt transport connected.");
+ if(msg.replyTo == null){
+ break;
+ }
+ altTransportService = msg.replyTo;
+ //Clear out the timer to make sure the service knows we're good to go
+ if(service.altTransportTimerHandler!=null && service.altTransportTimerRunnable!=null){
+ service.altTransportTimerHandler.removeCallbacks(service.altTransportTimerRunnable);
+ }
+ service.altTransportTimerHandler = null;
+ service.altTransportTimerRunnable = null;
+
+ //Let the alt transport know they are good to go
+ retMsg.arg1 = TransportConstants.ROUTER_REGISTER_ALT_TRANSPORT_RESPONSE_SUCESS;
+ service.onTransportConnected(new TransportRecord(TransportType.valueOf(receivedBundle.getString(TransportConstants.HARDWARE_CONNECTED)),null));
+
+ }else{ //There seems to be some other transport connected
+ //Error
+ retMsg.arg1 = TransportConstants.ROUTER_REGISTER_ALT_TRANSPORT_ALREADY_CONNECTED;
+ }
+ if(msg.replyTo!=null){
+ try {msg.replyTo.send(retMsg);} catch (RemoteException e) {e.printStackTrace();}
+ }
+ }
+ break;
+ case TransportConstants.ROUTER_RECEIVED_PACKET:
+ if(receivedBundle!=null){
+ receivedBundle.setClassLoader(loader);//We do this because loading a custom parcelable object isn't possible without it
+ if(receivedBundle.containsKey(TransportConstants.FORMED_PACKET_EXTRA_NAME)){
+ SdlPacket packet = receivedBundle.getParcelable(TransportConstants.FORMED_PACKET_EXTRA_NAME);
+ if(packet!=null){
+ service.onPacketRead(packet);
+ }else{
+ Log.w(TAG, "Received null packet from alt transport service");
+ }
+ }else{
+ Log.w(TAG, "False positive packet reception");
+ }
+ }else{
+ Log.e(TAG, "Bundle was null while sending packet to router service from alt transport");
+ }
+ break;
+ default:
+ super.handleMessage(msg);
+ }
+
+ }
+ }
+
+ /**
+ * Target we publish for alternative transport (USB) clients to send messages to RouterHandler.
+ */
+ final Messenger routerStatusMessenger = new Messenger(new RouterStatusHandler(this));
+
+ /**
+ * Handler of incoming messages from an alternative transport (USB).
+ */
+ @SuppressWarnings("Convert2Diamond")
+ static class RouterStatusHandler extends Handler {
+ final WeakReference<SdlRouterService> provider;
+
+ public RouterStatusHandler(SdlRouterService provider){
+ this.provider = new WeakReference<SdlRouterService>(provider);
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ if(this.provider.get() == null){
+ return;
+ }
+ SdlRouterService service = this.provider.get();
+ switch(msg.what){
+ case TransportConstants.ROUTER_STATUS_CONNECTED_STATE_REQUEST:
+ int flags = msg.arg1;
+ if(msg.replyTo!=null){
+ Message message = Message.obtain();
+ message.what = TransportConstants.ROUTER_STATUS_CONNECTED_STATE_RESPONSE;
+ message.arg1 = (service.isPrimaryTransportConnected()) ? 1 : 0;
+ try {
+ msg.replyTo.send(message);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ if(service.isPrimaryTransportConnected() && ((TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING & flags) == TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING)){
+ if(service.pingIntent == null){
+ service.initPingIntent();
+ }
+ AndroidTools.sendExplicitBroadcast(service.getApplicationContext(),service.pingIntent, null);
+ }
+ break;
+ default:
+ Log.w(TAG, "Unsupported request: " + msg.what);
+ break;
+ }
+ }
+ }
+
+
+ /**
+ * Target we publish for alternative transport (USB) clients to send messages to RouterHandler.
+ */
+ final Messenger usbTransferMessenger = new Messenger(new UsbTransferHandler(this));
+
+ /**
+ * Handler of incoming messages from an alternative transport (USB).
+ */
+ @SuppressWarnings("Convert2Diamond")
+ static class UsbTransferHandler extends Handler {
+ final WeakReference<SdlRouterService> provider;
+ Runnable usbCableDisconnectRunnable;
+ BroadcastReceiver usbCableDisconnectBroadcastReceiver;
+
+ public UsbTransferHandler(SdlRouterService provider){
+ this.provider = new WeakReference<SdlRouterService>(provider);
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ if(this.provider.get() == null){
+ return;
+ }
+ SdlRouterService service = this.provider.get();
+ switch(msg.what){
+ case TransportConstants.USB_CONNECTED_WITH_DEVICE:
+ service.enterForeground("Opening USB connection",FOREGROUND_TIMEOUT,false);
+ service.resetForegroundTimeOut(FOREGROUND_TIMEOUT);
+ int flags = msg.arg1;
+
+ ParcelFileDescriptor parcelFileDescriptor = (ParcelFileDescriptor)msg.obj;
+
+ if(parcelFileDescriptor != null) {
+ //New USB constructor with PFD
+ service.usbTransport = new MultiplexUsbTransport(parcelFileDescriptor, service.usbHandler, msg.getData());
+
+
+ usbCableDisconnectRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if(provider.get() != null && AndroidTools.isUSBCableConnected(provider.get().getApplicationContext())) {
+ provider.get().usbTransport.start();
+ }
+ }
+ };
+ postDelayed(usbCableDisconnectRunnable, 4000);
+
+
+ // Register a BroadcastReceiver to stop USB transport if USB cable got disconnected
+ if (provider.get() != null) {
+ usbCableDisconnectBroadcastReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+ if (provider.get()!= null && plugged != BatteryManager.BATTERY_PLUGGED_AC && plugged != BatteryManager.BATTERY_PLUGGED_USB) {
+ try {
+ provider.get().getApplicationContext().unregisterReceiver(usbCableDisconnectBroadcastReceiver);
+ } catch (Exception e){ }
+ removeCallbacks(usbCableDisconnectRunnable);
+ if (provider.get().usbTransport != null) {
+ provider.get().usbTransport.stop();
+ }
+ }
+ }
+ };
+ provider.get().getApplicationContext().registerReceiver(usbCableDisconnectBroadcastReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
+ }
+
+
+ }
+
+ if(msg.replyTo!=null){
+ Message message = Message.obtain();
+ message.what = TransportConstants.ROUTER_USB_ACC_RECEIVED;
+ try {
+ msg.replyTo.send(message);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ break;
+ case TransportConstants.ALT_TRANSPORT_CONNECTED:
+ break;
+ default:
+ Log.w(TAG, "Unsupported request: " + msg.what);
+ break;
+ }
+ }
+ }
+
+/* **************************************************************************************************************************************
+*********************************************** Life Cycle **************************************************************
+****************************************************************************************************************************************/
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ //Check intent to send back the correct binder (client binding vs alt transport)
+ if(intent!=null){
+ if(closing){
+ Log.w(TAG, "Denying bind request due to service shutting down.");
+ return null;
+ }
+ String requestType = intent.getAction();//intent.getIntExtra(TransportConstants.ROUTER_BIND_REQUEST_TYPE_EXTRA, TransportConstants.BIND_REQUEST_TYPE_CLIENT);
+ if(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT.equals(requestType)){
+ if(0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)){ //Only allow alt transport in debug mode
+ return this.altTransportMessenger.getBinder();
+ }
+ }else if(TransportConstants.BIND_REQUEST_TYPE_CLIENT.equals(requestType)){
+ return this.routerMessenger.getBinder();
+ }else if(TransportConstants.BIND_REQUEST_TYPE_STATUS.equals(requestType)){
+ return this.routerStatusMessenger.getBinder();
+ }else if(TransportConstants.BIND_REQUEST_TYPE_USB_PROVIDER.equals(requestType)){
+ return this.usbTransferMessenger.getBinder();
+ }else{
+ Log.w(TAG, "Unknown bind request type");
+ }
+
+ }
+ return null;
+ }
+
+
+
+ @Override
+ public boolean onUnbind(Intent intent) {
+ Log.d(TAG, "Unbind being called.");
+ return super.onUnbind(intent);
+ }
+
+
+ private void notifyClients(final Message message){
+ if(message==null){
+ Log.w(TAG, "Can't notify clients, message was null");
+ return;
+ }
+ Log.d(TAG, "Notifying "+ registeredApps.size()+ " clients");
+ int result;
+ synchronized(REGISTERED_APPS_LOCK){
+ Collection<RegisteredApp> apps = registeredApps.values();
+ Iterator<RegisteredApp> it = apps.iterator();
+ Message formattedMessage = new Message();
+ while(it.hasNext()){
+ RegisteredApp app = it.next();
+ formattedMessage.copyFrom(message);
+ //Format the message for the receiving app and appropriate messaging version
+ if(formatMessage(app, formattedMessage)) {
+ result = app.sendMessage(formattedMessage);
+ if (result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT) {
+ app.close();
+ it.remove();
+ }
+ }
+ }
+
+ }
+ }
+
+ /**
+ * Formats the message for the app that is to receive it
+ * @param app
+ * @param message
+ * @return if the message should be sent or not
+ */
+ protected boolean formatMessage(RegisteredApp app, Message message){
+ if( app.routerMessagingVersion <= 1){
+ Bundle bundle = message.getData();
+ if (bundle != null){
+ if(message.what == TransportConstants.HARDWARE_CONNECTION_EVENT) {
+
+ switch (message.arg1){
+ case TransportConstants.HARDWARE_CONNECTION_EVENT_CONNECTED:
+ if(app.isRegisteredOnTransport(-1, null)){
+ //App is already registered on a transport and does not need this update
+ return false;
+ }
+ break;
+ case TransportConstants.HARDWARE_CONNECTION_EVENT_DISCONNECTED:
+ if(bundle.containsKey(TransportConstants.HARDWARE_DISCONNECTED)){
+ TransportType transportType = TransportType.valueOf(bundle.getString(TransportConstants.HARDWARE_DISCONNECTED));
+ if(!app.isRegisteredOnTransport(-1, transportType)){
+ //App is not registered on this transport, not sending
+ return false;
+ }
+ }
+ if (bundle.containsKey(TransportConstants.TRANSPORT_DISCONNECTED)) {
+ //Unable to handle new parcel TransportRecord
+ bundle.remove(TransportConstants.TRANSPORT_DISCONNECTED);
+ }
+ break;
+ }
+
+ //All connection event messages should have this as part of the bundle
+ if (bundle.containsKey(TransportConstants.CURRENT_HARDWARE_CONNECTED)) {
+ //Unable to handle new parcel TransportRecord
+ bundle.remove(TransportConstants.CURRENT_HARDWARE_CONNECTED);
+ }
+
+
+ }
+ }
+ }
+ return true;
+ }
+
+ @SuppressWarnings("unused")
+ private void pingClients(){
+ Message message = Message.obtain();
+ Log.d(TAG, "Pinging "+ registeredApps.size()+ " clients");
+ int result;
+ synchronized(REGISTERED_APPS_LOCK){
+ Collection<RegisteredApp> apps = registeredApps.values();
+ Iterator<RegisteredApp> it = apps.iterator();
+ while(it.hasNext()){
+ RegisteredApp app = it.next();
+ result = app.sendMessage(message);
+ if(result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT){
+ app.close();
+ Vector<Long> sessions = app.getSessionIds();
+ for(Long session:sessions){
+ if(session !=null && session != -1){
+ List<TransportType> transportTypes = app.getTransportsForSession(session.intValue());
+ if(transportTypes != null && transportTypes.size() > 0){
+ attemptToCleanUpModule(session.intValue(), cachedModuleVersion, transportTypes.get(0) );
+ }
+ }
+ }
+ it.remove();
+ }
+ }
+ }
+ }
+
+ /**
+ * We want to make sure we are in the right process here. If there is some sort of developer error
+ * we want to just close out right away.
+ * @return if this service is executing in the correct process
+ */
+ private boolean processCheck(){
+ int myPid = android.os.Process.myPid();
+ ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
+ if(am == null || am.getRunningAppProcesses() == null)
+ return false; // No RunningAppProcesses, let's close out
+ for (RunningAppProcessInfo processInfo : am.getRunningAppProcesses())
+ {
+ if (processInfo != null && processInfo.pid == myPid)
+ {
+ return ROUTER_SERVICE_PROCESS.equals(processInfo.processName);
+ }
+ }
+ return false;
+
+ }
+
+ @SuppressWarnings("SameParameterValue")
+ private boolean permissionCheck(String permissionToCheck){
+ if(permissionToCheck == null){
+ throw new IllegalArgumentException("permission is null");
+ }
+ return PackageManager.PERMISSION_GRANTED == getBaseContext().checkPermission(permissionToCheck, android.os.Process.myPid(), android.os.Process.myUid());
+ }
+
+ /**
+ * Runs several checks to ensure this router service has the correct conditions to run properly
+ * @return true if this service is set up correctly
+ */
+ private boolean initCheck(){
+ if(!processCheck()){
+ Log.e(TAG, "Not using correct process. Shutting down");
+ wrongProcess = true;
+ return false;
+ }
+ if(!permissionCheck(Manifest.permission.BLUETOOTH)){
+ Log.e(TAG, "Bluetooth Permission is not granted. Shutting down");
+ return false;
+ }
+ if(!AndroidTools.isServiceExported(this, new ComponentName(this, this.getClass()))){ //We want to check to see if our service is actually exported
+ Log.e(TAG, "Service isn't exported. Shutting down");
+ return false;
+ }
+ return true;
+ }
+
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ //This must be done regardless of if this service shuts down or not
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ enterForeground("Waiting for connection...", FOREGROUND_TIMEOUT/1000, false);
+ resetForegroundTimeOut(FOREGROUND_TIMEOUT/1000);
+ }
+
+
+ if(!initCheck()){ // Run checks on process and permissions
+ deployNextRouterService();
+ stopSelf();
+ return;
+ }
+ initPassed = true;
+
+
+ synchronized(REGISTERED_APPS_LOCK){
+ registeredApps = new HashMap<String,RegisteredApp>();
+ }
+ closing = false;
+
+ synchronized(SESSION_LOCK){
+ this.bluetoothSessionMap = new SparseArray<String>();
+ this.sessionHashIdMap = new SparseIntArray();
+ this.cleanedSessionMap = new SparseIntArray();
+ }
+
+ packetExecutor = Executors.newSingleThreadExecutor();
+
+ startUpSequence();
+ }
+
+ /**
+ * The method will attempt to start up the next router service in line based on the sorting criteria of best router service.
+ */
+ protected void deployNextRouterService(){
+ List<SdlAppInfo> sdlAppInfoList = AndroidTools.querySdlAppInfo(getApplicationContext(), new SdlAppInfo.BestRouterComparator());
+ if (sdlAppInfoList != null && !sdlAppInfoList.isEmpty()) {
+ ComponentName name = new ComponentName(this, this.getClass());
+ SdlAppInfo info;
+ int listSize = sdlAppInfoList.size();
+ for(int i = 0; i < listSize; i++) {
+ info = sdlAppInfoList.get(i);
+ if(info.getRouterServiceComponentName().equals(name) && listSize > i + 1){
+ SdlAppInfo nextUp = sdlAppInfoList.get(i+1);
+ Intent serviceIntent = new Intent();
+ serviceIntent.setComponent(nextUp.getRouterServiceComponentName());
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
+ startService(serviceIntent);
+ }else{
+ try{
+ startForegroundService(serviceIntent);
+ }catch (Exception e){
+ Log.e(TAG, "Unable to start next SDL router service. " + e.getMessage());
+ }
+ }
+ break;
+
+ }
+ }
+ } else{
+ Log.d(TAG, "No sdl apps found");
+ return;
+ }
+ closing = true;
+ closeBluetoothSerialServer();
+ notifyAltTransportOfClose(TransportConstants.ROUTER_SHUTTING_DOWN_REASON_NEWER_SERVICE);
+ }
+
+ public void startUpSequence(){
+ IntentFilter disconnectFilter = new IntentFilter();
+ disconnectFilter.addAction(BluetoothDevice.ACTION_CLASS_CHANGED);
+ disconnectFilter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
+ disconnectFilter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED);
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
+ disconnectFilter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
+ }
+ registerReceiver(mListenForDisconnect,disconnectFilter );
+
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(REGISTER_WITH_ROUTER_ACTION);
+ registerReceiver(mainServiceReceiver,filter);
+
+ if(!connectAsClient){
+ if(bluetoothAvailable()){
+ initBluetoothSerialService();
+ }
+ }
+
+ if(altTransportTimerHandler!=null){
+ //There's an alt transport waiting for this service to be started
+ Intent intent = new Intent(TransportConstants.ALT_TRANSPORT_RECEIVER);
+ sendBroadcast(intent);
+ }
+
+ startSequenceComplete= true;
+ }
+
+
+ @SuppressLint({"NewApi", "MissingPermission"})
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ if(!initPassed) {
+ return super.onStartCommand(intent, flags, startId);
+ }
+ if(registeredApps == null){
+ synchronized(REGISTERED_APPS_LOCK){
+ registeredApps = new HashMap<String,RegisteredApp>();
+ }
+ }
+ if(intent != null ){
+ if(intent.getBooleanExtra(FOREGROUND_EXTRA, false)){
+ if(!this.isPrimaryTransportConnected()) { //If there is no transport connected we need to ensure the service is moved to the foreground
+ String address = null;
+ if(intent.hasExtra(BluetoothDevice.EXTRA_DEVICE)){
+ BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
+ if(device != null){
+ address = device.getAddress();
+ }
+ }
+ int timeout = getNotificationTimeout(address);
+ enterForeground("Waiting for connection...", timeout, false);
+ resetForegroundTimeOut(timeout);
+ }else{
+ enterForeground(createConnectedNotificationText(),0,true);
+ }
+ }
+ if(intent.hasExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA)){
+ //Make sure we are listening on RFCOMM
+ if(startSequenceComplete){ //We only check if we are sure we are already through the start up process
+ Log.i(TAG, "Received ping, making sure we are listening to bluetooth rfcomm");
+ initBluetoothSerialService();
+ }
+ }
+ }
+ if(!shouldServiceRemainOpen(intent)){
+ closeSelf();
+ }
+ return super.onStartCommand(intent, flags, startId);
+ }
+
+ @SuppressWarnings("ConstantConditions")
+ @Override
+ public void onDestroy(){
+ stopClientPings();
+
+ if(altTransportTimerHandler!=null){
+ altTransportTimerHandler.removeCallbacks(altTransportTimerRunnable);
+ altTransportTimerHandler = null;
+ }
+
+ Log.w(TAG, "Sdl Router Service Destroyed");
+ closing = true;
+ //No need for this Broadcast Receiver anymore
+ unregisterAllReceivers();
+ closeBluetoothSerialServer();
+ if(registeredApps!=null){
+ synchronized(REGISTERED_APPS_LOCK){
+ registeredApps.clear();
+ registeredApps = null;
+ }
+ }
+ synchronized(SESSION_LOCK){
+ if(this.bluetoothSessionMap !=null){
+ this.bluetoothSessionMap.clear();
+ this.bluetoothSessionMap = null;
+ }
+ if(this.sessionHashIdMap!=null){
+ this.sessionHashIdMap.clear();
+ this.sessionHashIdMap = null;
+ }
+ }
+
+ //SESSION_LOCK = null;
+
+ startSequenceComplete=false;
+ if(packetExecutor !=null){
+ packetExecutor.shutdownNow();
+ packetExecutor = null;
+ }
+
+ exitForeground();
+ if(packetWriteTaskMasterMap != null && packetWriteTaskMasterMap.values() != null) {
+ Collection<PacketWriteTaskMaster> tasks = packetWriteTaskMasterMap.values();
+ for (PacketWriteTaskMaster packetWriteTaskMaster : tasks) {
+ if (packetWriteTaskMaster != null) {
+ packetWriteTaskMaster.close();
+ }
+ }
+ }
+ if(packetWriteTaskMasterMap != null){
+ packetWriteTaskMasterMap.clear();
+ }
+ packetWriteTaskMasterMap = null;
+
+
+ super.onDestroy();
+ System.gc(); //Lower end phones need this hint
+ if(!wrongProcess){
+ //noinspection EmptyCatchBlock
+ try{
+ android.os.Process.killProcess(android.os.Process.myPid());
+ }catch(Exception e){}
+ }
+ }
+
+ private void unregisterAllReceivers(){
+ //noinspection EmptyCatchBlock
+ try{
+ unregisterReceiver(mListenForDisconnect);
+ unregisterReceiver(mainServiceReceiver);
+ }catch(Exception e){}
+ }
+
+ @SuppressWarnings("SameParameterValue")
+ private void notifyAltTransportOfClose(int reason){
+ if(altTransportService!=null){
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_SHUTTING_DOWN_NOTIFICATION;
+ msg.arg1 = reason;
+ try {
+ altTransportService.send(msg);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Gets the correct timeout for the foreground notification.
+ * @param address the address of the device that is currently connected
+ * @return the amount of time for a timeout handler to remove the notification.
+ */
+ @SuppressLint("MissingPermission")
+ private int getNotificationTimeout(String address){
+ if(address != null){
+ if(hasSDLConnected(address)){
+ return FOREGROUND_TIMEOUT * 2;
+ }else if(this.isFirstStatusCheck(address)) {
+ // If this is the first time the service has ever connected to this device we want
+ // to ensure we have a record of it
+ setSDLConnectedStatus(address, false);
+ }
+ }
+ // If this is a new device or hasn't connected through SDL we want to limit the exposure
+ // of the SDL service in the foreground
+ return FOREGROUND_TIMEOUT/1000;
+ }
+
+ public void resetForegroundTimeOut(long delay){
+ if(android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR2){
+ return;
+ }
+ synchronized (NOTIFICATION_LOCK) {
+ if (foregroundTimeoutHandler == null) {
+ foregroundTimeoutHandler = new Handler();
+ }
+ if (foregroundTimeoutRunnable == null) {
+ foregroundTimeoutRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if(!getConnectedTransports().isEmpty()){
+ // Updates notification to one of still connected transport
+ enterForeground(createConnectedNotificationText(),0,true);
+ return;
+ }else{
+ exitForeground();//Leave our foreground state as we don't have a connection
+
+ }
+ }
+ };
+ } else {
+ //This instance likely means there is a callback in the queue so we should remove it
+ foregroundTimeoutHandler.removeCallbacks(foregroundTimeoutRunnable);
+ }
+ foregroundTimeoutHandler.postDelayed(foregroundTimeoutRunnable, delay);
+ }
+ }
+
+ public void cancelForegroundTimeOut(){
+ synchronized (NOTIFICATION_LOCK) {
+ if (foregroundTimeoutHandler != null && foregroundTimeoutRunnable != null) {
+ foregroundTimeoutHandler.removeCallbacks(foregroundTimeoutRunnable);
+ }
+ }
+
+ }
+
+ @SuppressLint("NewApi")
+ @SuppressWarnings("deprecation")
+ private void enterForeground(String content, long chronometerLength, boolean ongoing) {
+ if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB){
+ Log.w(TAG, "Unable to start service as foreground due to OS SDK version being lower than 11");
+ isForeground = false;
+ return;
+ }
+
+ Bitmap icon;
+ int resourcesIncluded = getResources().getIdentifier("ic_sdl", "drawable", getPackageName());
+
+ if ( resourcesIncluded != 0 ) { //No additional pylons required
+ icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_sdl);
+ }
+ else {
+ icon = BitmapFactory.decodeResource(getResources(), android.R.drawable.stat_sys_data_bluetooth);
+ }
+ // Bitmap icon = BitmapFactory.decodeByteArray(SdlLogo.SDL_LOGO_STRING, 0, SdlLogo.SDL_LOGO_STRING.length);
+
+ 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{
+ builder.setContentTitle("SmartDeviceLink");
+ }
+ builder.setTicker("SmartDeviceLink");
+ builder.setContentText(content);
+
+ //We should use icon from library resources if available
+ int trayId = getResources().getIdentifier("sdl_tray_icon", "drawable", getPackageName());
+
+ if ( resourcesIncluded != 0 ) { //No additional pylons required
+ builder.setSmallIcon(trayId);
+ }
+ else {
+ builder.setSmallIcon(android.R.drawable.stat_sys_data_bluetooth);
+ }
+ builder.setLargeIcon(icon);
+ builder.setOngoing(ongoing);
+
+ // Create an intent that will be fired when the user clicks the notification.
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(SDL_NOTIFICATION_FAQS_PAGE));
+ PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
+ builder.setContentIntent(pendingIntent);
+
+ if(chronometerLength > 0 && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ //The countdown method is only available in SDKs >= 24
+ builder.setWhen(chronometerLength + System.currentTimeMillis());
+ builder.setUsesChronometer(true);
+ builder.setChronometerCountDown(true);
+ }
+ 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();
+ }
+ if (notification == 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(){
+ synchronized (NOTIFICATION_LOCK) {
+ if (isForeground && !isPrimaryTransportConnected()) { //Ensure that the service is in the foreground and no longer connected to a transport
+ this.stopForeground(true);
+ isForeground = false;
+ }
+ }
+ }
+
+
+ /**
+ * Creates a notification message to attach to the foreground service notification.
+ *
+ * @return string to be used as the message
+ */
+ private String createConnectedNotificationText(){
+ StringBuilder builder = new StringBuilder();
+ builder.append("Connected to ");
+
+ if(bluetoothTransport!= null && bluetoothTransport.isConnected()){
+ if(bluetoothTransport.getDeviceName() != null){
+ builder.append(bluetoothTransport.getDeviceName());
+ if(0 == (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)) {
+ //If this is production, just the device name is fine
+ return builder.toString();
+ }
+ }else{
+ builder.append(TransportType.BLUETOOTH.name().toLowerCase());
+ }
+ }
+
+ if(usbTransport != null && usbTransport.isConnected()){
+ if(builder.length() > 13){ //13 characters for initial Connected to string
+ builder.append(" & ");
+ }
+ builder.append(TransportType.USB.name());
+ }
+
+ return builder.toString();
+ }
+
+
+ /* **************************************************************************************************************************************
+ *********************************************** Helper Methods **************************************************************
+ ****************************************************************************************************************************************/
+
+ @SuppressWarnings("SameReturnValue")
+ @Deprecated
+ public String getConnectedDeviceName(){
+ return null;
+ }
+
+ private ArrayList<TransportRecord> getConnectedTransports(){
+ ArrayList<TransportRecord> connected = new ArrayList<>();
+ if(bluetoothTransport != null && bluetoothTransport.isConnected()){
+ connected.add(bluetoothTransport.getTransportRecord());
+ }
+
+ if(tcpTransport != null && tcpTransport.isConnected()){
+ connected.add(tcpTransport.getTransportRecord());
+ }
+
+ if(usbTransport != null && usbTransport.isConnected()){
+ connected.add(usbTransport.getTransportRecord());
+ }
+
+ return connected;
+ }
+
+ private boolean isPrimaryTransportConnected(){
+ return isTransportConnected(TransportType.BLUETOOTH) || isTransportConnected(TransportType.USB);
+ }
+
+ private boolean isTransportConnected(TransportType transportType){
+ if(bluetoothTransport != null && transportType.equals(TransportType.BLUETOOTH)){
+ return bluetoothTransport.isConnected();
+ }else if(tcpTransport != null && transportType.equals(TransportType.TCP)){
+ return tcpTransport.isConnected();
+ }else if(usbTransport != null && transportType.equals(TransportType.USB)){
+ return usbTransport.isConnected();
+ }
+ return false;
+ }
+
+ /**
+ * Checks to make sure bluetooth adapter is available and on
+ * @return if the bluetooth adapter is available and is enabled
+ */
+ @SuppressWarnings("MissingPermission")
+ private boolean bluetoothAvailable(){
+ try {
+ return (!(BluetoothAdapter.getDefaultAdapter() == null) && BluetoothAdapter.getDefaultAdapter().isEnabled());
+ }catch(NullPointerException e){ // only for BluetoothAdapter.getDefaultAdapter().isEnabled() call
+ return false;
+ }
+ }
+
+ /**
+ *
+ * 1. If the app has SDL shut off, shut down
+ * 2. if The app has an Alt Transport address or was started by one, stay open
+ * 3. If Bluetooth is off/NA shut down
+ * 4. Anything else
+ */
+ public boolean shouldServiceRemainOpen(Intent intent){
+ ArrayList<TransportRecord> connectedTransports = getConnectedTransports();
+
+ if(connectedTransports != null && !connectedTransports.isEmpty()){ // stay open if we have any transports connected
+ Log.d(TAG, "1 or more transports connected, remaining open");
+ return true;
+ }else if(altTransportService!=null || altTransportTimerHandler !=null){
+ //We have been started by an alt transport, we must remain open. "My life for Auir...."
+ Log.d(TAG, "Alt Transport connected, remaining open");
+ return true;
+
+ }else if(intent!=null && TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT.equals(intent.getAction())){
+ Log.i(TAG, "Received start intent with alt transport request.");
+ startAltTransportTimer();
+ return true;
+ }else if(!bluetoothAvailable()){//If bluetooth isn't on...there's nothing to see here
+ //Bluetooth is off, we should shut down
+ Log.d(TAG, "Bluetooth not available, shutting down service");
+
+ return connectedTransports != null && connectedTransports.size() > 0; //If a transport is connected the list will be >0
+ }else{
+ Log.d(TAG, "Service to remain open");
+ return true;
+ }
+ }
+ /**
+ * This method is needed so that apps that choose not to implement this as a service as defined by Android, but rather
+ * just a simple class we have to know how to shut down.
+ */
+ public void closeSelf(){
+ closing = true;
+
+ if(getBaseContext()!=null){
+ stopSelf();
+ }
+
+ //For good measure.
+ onDestroy();
+
+ }
+ private synchronized void initBluetoothSerialService(){
+ if(legacyModeEnabled){
+ Log.d(TAG, "Not starting own bluetooth during legacy mode");
+ return;
+ }
+ //init serial service
+ if(bluetoothTransport == null || bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_ERROR){
+ bluetoothTransport = new MultiplexBluetoothTransport(bluetoothHandler);
+ }
+ if (bluetoothTransport != null) {
+ // Only if the state is STATE_NONE, do we know that we haven't started already
+ if (bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_NONE) {
+ // Start the Bluetooth services
+ Log.i(TAG, "Starting bluetooth transport");
+ bluetoothTransport.start();
+ }
+
+ }
+ }
+
+ @Deprecated
+ public void onTransportConnected(final TransportType type){
+ onTransportConnected(new TransportRecord(type,null));
+ }
+
+ public void onTransportConnected(final TransportRecord record){
+ cancelForegroundTimeOut();
+ enterForeground(createConnectedNotificationText(),0,true);
+
+ if(packetWriteTaskMasterMap == null){
+ packetWriteTaskMasterMap = new ConcurrentHashMap<>();
+ }
+
+ TransportType type = record.getType();
+ PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(type);
+
+ if(packetWriteTaskMaster!=null){
+ packetWriteTaskMaster.close();
+ packetWriteTaskMaster.alert();
+ }
+ packetWriteTaskMaster = new PacketWriteTaskMaster();
+ packetWriteTaskMaster.setTransportType(type);
+ packetWriteTaskMaster.start();
+ packetWriteTaskMasterMap.put(type,packetWriteTaskMaster);
+
+ Intent startService = new Intent();
+ startService.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION);
+
+ startService.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_EXTRA, true);
+ startService.putExtra(TransportConstants.FORCE_TRANSPORT_CONNECTED, true);
+ startService.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_APP_PACKAGE, getBaseContext().getPackageName());
+ startService.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_CMP_NAME, new ComponentName(this, this.getClass()));
+
+ if(record!= null && record.getType() != null){
+ startService.putExtra(TransportConstants.START_ROUTER_SERVICE_TRANSPORT_CONNECTED, record.getType().toString());
+ }
+
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+ startService.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
+ }
+
+ AndroidTools.sendExplicitBroadcast(getApplicationContext(),startService, null);
+
+ //HARDWARE_CONNECTED
+ if(!(registeredApps== null || registeredApps.isEmpty())){
+ //If we have clients
+ notifyClients(createHardwareConnectedMessage(record));
+ }
+ }
+
+ private Message createHardwareConnectedMessage(final TransportRecord record){
+ Message message = Message.obtain();
+ message.what = TransportConstants.HARDWARE_CONNECTION_EVENT;
+ message.arg1 = TransportConstants.HARDWARE_CONNECTION_EVENT_CONNECTED;
+ Bundle bundle = new Bundle();
+ bundle.putString(TransportConstants.HARDWARE_CONNECTED, record.getType().name());
+ bundle.putParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED, getConnectedTransports());
+
+ if(bluetoothTransport != null){
+ bundle.putString(CONNECTED_DEVICE_STRING_EXTRA_NAME, bluetoothTransport.getDeviceName());
+ }
+
+ message.setData(bundle);
+ return message;
+
+ }
+
+ @Deprecated
+ public void onTransportDisconnected(TransportType type) {
+ onTransportDisconnected(new TransportRecord(type,null));
+ }
+
+ public void onTransportDisconnected(TransportRecord record){
+ cachedModuleVersion = -1; //Reset our cached version
+ //Stop any current pings being sent before the proper state can be determined.
+ stopClientPings();
+
+ if(registeredApps != null && !registeredApps.isEmpty()){
+ Message message = Message.obtain();
+ message.what = TransportConstants.HARDWARE_CONNECTION_EVENT;
+ message.arg1 = TransportConstants.HARDWARE_CONNECTION_EVENT_DISCONNECTED;
+
+ Bundle bundle = new Bundle();
+ bundle.putParcelable(TRANSPORT_DISCONNECTED, record);
+ //For legacy
+ bundle.putString(HARDWARE_DISCONNECTED, record.getType().name());
+ bundle.putBoolean(TransportConstants.ENABLE_LEGACY_MODE_EXTRA, legacyModeEnabled);
+
+ //Still connected transports
+ bundle.putParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED,getConnectedTransports());
+
+ message.setData(bundle);
+ notifyClients(message);
+
+ synchronized (REGISTERED_APPS_LOCK) {
+ Collection<RegisteredApp> apps = registeredApps.values();
+ for (RegisteredApp app : apps) {
+ app.unregisterTransport(-1,record.getType());
+
+ }
+ }
+ }
+ //Remove and close the packet task master assigned to this transport
+ if(packetWriteTaskMasterMap != null
+ && record != null
+ && packetWriteTaskMasterMap.containsKey(record.getType())){
+ PacketWriteTaskMaster master = packetWriteTaskMasterMap.remove(record.getType());
+ if(master != null){
+ master.close();
+ master.alert();
+ }
+ }
+ //Ensure the associated transport is dealt with
+ switch (record.getType()){
+ case BLUETOOTH:
+ synchronized(SESSION_LOCK){
+ if(bluetoothSessionMap!= null){
+ bluetoothSessionMap.clear();
+ }
+ }
+ if(!connectAsClient ){
+ if(!legacyModeEnabled && !closing){
+ initBluetoothSerialService();
+ }
+ }
+ break;
+ case USB:
+ if(usbTransport != null){
+ usbTransport = null;
+ }
+ synchronized(SESSION_LOCK){
+ if(usbSessionMap!= null){
+ usbSessionMap.clear();
+ }
+ }
+ break;
+ case TCP:
+ if(tcpTransport != null){
+ tcpTransport = null;
+ }
+ synchronized(SESSION_LOCK){
+ if(tcpSessionMap!=null){
+ tcpSessionMap.clear();
+ }
+ }
+ break;
+ }
+
+ if(!getConnectedTransports().isEmpty()){
+ // Updates notification to one of still connected transport
+ enterForeground(createConnectedNotificationText(),0,true);
+ return;
+ }else{
+ exitForeground();//Leave our foreground state as we don't have a connection anymore
+ if(!shouldServiceRemainOpen(null)){
+ closeSelf();
+ }
+ }
+
+ if(altTransportService!=null){ //If we still have an alt transport open, then we don't need to tell the clients to close
+ return;
+ }
+
+ Log.e(TAG, "Notifying client service of hardware disconnect.");
+
+
+ //We've notified our clients, less clean up the mess now.
+ synchronized(SESSION_LOCK){
+ this.sessionHashIdMap.clear();
+ }
+ synchronized(REGISTERED_APPS_LOCK){
+ if(registeredApps==null){
+ return;
+ }
+ registeredApps.clear();
+ }
+ }
+
+ @Deprecated
+ public void onTransportError(TransportType transportType){
+ onTransportError(new TransportRecord(transportType,null));
+ }
+
+ public void onTransportError(TransportRecord transport){
+ switch (transport.getType()){
+ case BLUETOOTH:
+ if(bluetoothTransport !=null){
+ bluetoothTransport.setStateManually(MultiplexBluetoothTransport.STATE_NONE);
+ bluetoothTransport = null;
+ }
+ break;
+ case USB:
+ break;
+ case TCP:
+ break;
+ }
+
+ }
+
+ public void onPacketRead(SdlPacket packet){
+ try {
+ //Log.i(TAG, "******** Read packet with header: " +(packet).toString());
+ if(packet.getVersion() == 1){
+ if( packet.getFrameType() == FrameType.Control && packet.getFrameInfo() == SdlPacket.FRAME_INFO_START_SERVICE_ACK){
+ //We received a v1 packet from the head unit, this means we can't use the router service.
+ //Enable legacy mode
+ enableLegacyMode(true);
+ return;
+ }
+ }else if(cachedModuleVersion == -1){
+ cachedModuleVersion = packet.getVersion();
+ }
+ //Send the received packet to the registered app
+ sendPacketToRegisteredApp(packet);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Handler for all Multiplex Based transports.
+ * It will ensure messages are properly queued back to the router service.
+ */
+ private static class TransportHandler extends Handler{
+
+ final WeakReference<SdlRouterService> provider;
+
+ public TransportHandler(SdlRouterService provider){
+ this.provider = new WeakReference<SdlRouterService>(provider);
+ }
+ @Override
+ public void handleMessage(Message msg) {
+ if(this.provider.get() == null){
+ return;
+ }
+ SdlRouterService service = this.provider.get();
+ switch (msg.what) {
+ case MESSAGE_DEVICE_NAME:
+ Bundle bundle = msg.getData();
+ if(bundle !=null) {
+ service.setSDLConnectedStatus(bundle.getString(MultiplexBaseTransport.DEVICE_ADDRESS),true);
+ }
+ break;
+ case MESSAGE_STATE_CHANGE:
+ TransportRecord transportRecord = (TransportRecord) msg.obj;
+ switch (msg.arg1) {
+ case MultiplexBaseTransport.STATE_CONNECTED:
+ service.onTransportConnected(transportRecord);
+ break;
+ case MultiplexBaseTransport.STATE_CONNECTING:
+ // Currently attempting to connect - update UI?
+ break;
+ case MultiplexBaseTransport.STATE_LISTEN:
+ break;
+ case MultiplexBaseTransport.STATE_NONE:
+ // We've just lost the connection
+ service.onTransportDisconnected(transportRecord);
+ break;
+ case MultiplexBaseTransport.STATE_ERROR:
+ service.onTransportError(transportRecord);
+ break;
+ }
+ break;
+
+ case MESSAGE_READ:
+ service.onPacketRead((SdlPacket) msg.obj);
+ break;
+ }
+ }
+ }
+
+ @SuppressWarnings("unused") //The return false after the packet null check is not dead code. Read the getByteArray method from bundle
+ public boolean writeBytesToTransport(Bundle bundle){
+ if(bundle == null){
+ return false;
+ }
+ byte[] packet = bundle.getByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME);
+ if(packet==null) {
+ Log.w(TAG, "Ignoring null packet");
+ return false;
+ }
+ int offset = bundle.getInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, 0); //If nothing, start at the beginning of the array
+ int count = bundle.getInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, packet.length); //In case there isn't anything just send the whole packet.
+ TransportType transportType = TransportType.valueForString(bundle.getString(TransportConstants.TRANSPORT_TYPE));
+ switch ((transportType)){
+ case BLUETOOTH:
+ if(bluetoothTransport !=null && bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_CONNECTED) {
+ bluetoothTransport.write(packet, offset, count);
+ return true;
+ }
+ case USB:
+ if(usbTransport != null && usbTransport.getState() == MultiplexBaseTransport.STATE_CONNECTED) {
+ usbTransport.write(packet, offset, count);
+ return true;
+ }
+ case TCP:
+ if(tcpTransport != null && tcpTransport.getState() == MultiplexBaseTransport.STATE_CONNECTED) {
+ tcpTransport.write(packet, offset, count);
+ return true;
+ }
+ default:
+ if(sendThroughAltTransport(bundle)){
+ return true;
+ }
+ }
+ Log.e(TAG, "Can't send data, no transport of specified type connected");
+ return false;
+ }
+
+ private boolean manuallyWriteBytes(TransportType transportType, byte[] packet, int offset, int count){
+ switch ((transportType)){
+ case BLUETOOTH:
+ if(bluetoothTransport !=null && bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_CONNECTED) {
+ bluetoothTransport.write(packet, offset, count);
+ return true;
+ }
+ case USB:
+ if(usbTransport != null && usbTransport.getState() == MultiplexBaseTransport.STATE_CONNECTED) {
+ usbTransport.write(packet, offset, count);
+ return true;
+ }
+ case TCP:
+ if(tcpTransport != null && tcpTransport.getState() == MultiplexBaseTransport.STATE_CONNECTED) {
+ tcpTransport.write(packet, offset, count);
+ return true;
+ }
+ default:
+ return sendThroughAltTransport(packet, offset, count);
+ }
+ }
+
+
+ /**
+ * This Method will send the packets through the alt transport that is connected
+ * @param bundle This bundle will have its what changed and sent off to the alt transport
+ * @return If it was possible to send the packet off.
+ * <p><b>NOTE: This is not guaranteed. It is a best attempt at sending the packet, it may fail.</b>
+ */
+ private boolean sendThroughAltTransport(Bundle bundle){
+ if(altTransportService!=null){
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_SEND_PACKET;
+ msg.setData(bundle);
+ try {
+ altTransportService.send(msg);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to send through alt transport!");
+ e.printStackTrace();
+ }
+ return true;
+ }else{
+ Log.w(TAG, "Unable to send packet through alt transport, it was null");
+ }
+ return false;
+ }
+
+ /** This Method will send the packets through the alt transport that is connected
+ * @param bytes The byte array of data to be wrote out
+ * @return If it was possible to send the packet off.
+ * <p><b>NOTE: This is not guaranteed. It is a best attempt at sending the packet, it may fail.</b>
+ */
+ private boolean sendThroughAltTransport(byte[] bytes, int offset, int count){
+ if(altTransportService!=null){
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_SEND_PACKET;
+ Bundle bundle = new Bundle();
+ bundle.putByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME,bytes);
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, offset);
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, count);
+ msg.setData(bundle);
+ try {
+ altTransportService.send(msg);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to send through alt transport!");
+ e.printStackTrace();
+ }
+ return true;
+ }else{
+ Log.w(TAG, "Unable to send packet through alt transport, it was null");
+ }
+ return false;
+ }
+ /**
+ * This will send the received packet to the registered service. It will default to the single registered "foreground" app.
+ * This can be overridden to provide more specific functionality.
+ * @param packet the packet that is received
+ * @return whether or not the sending was successful
+ */
+ public boolean sendPacketToRegisteredApp(SdlPacket packet) {
+ if(registeredApps != null && registeredApps.size() > 0 ){
+ final int session = packet.getSessionId();
+ boolean isNewSessionRequest = false, isNewTransportRequest = false;
+
+ final int frameInfo = packet.getFrameInfo();
+ if(packet.getFrameType() == FrameType.Control){
+ isNewSessionRequest = (frameInfo == SdlPacket.FRAME_INFO_START_SERVICE_ACK ||frameInfo == SdlPacket.FRAME_INFO_START_SERVICE_NAK)
+ && packet.getServiceType() == SdlPacket.SERVICE_TYPE_RPC;
+ isNewTransportRequest = (frameInfo == SdlPacket.FRAME_INFO_REGISTER_SECONDARY_TRANSPORT_ACK
+ || frameInfo == SdlPacket.FRAME_INFO_REGISTER_SECONDARY_TRANSPORT_NAK); // && packet.getServiceType() != SdlPacket.SERVICE_TYPE_RPC;
+ }
+
+ //Find where this packet should go
+ String appid = getAppIDForSession(session, isNewSessionRequest, isNewTransportRequest, packet.getTransportRecord().getType());
+
+ if(appid != null && appid.length() > 0){
+
+ RegisteredApp app;
+ synchronized(REGISTERED_APPS_LOCK){
+ app = registeredApps.get(appid);
+ }
+
+ if(app == null){
+ Log.e(TAG, "No app found for app id " + appid + " Removing session mapping and sending unregisterAI to head unit.");
+
+ //We have no app to match the app id tied to this session
+ removeSessionFromMap(session, Collections.singletonList(packet.getTransportRecord().getType()));
+
+ final int serviceType = packet.getServiceType();
+ if(serviceType == SdlPacket.SERVICE_TYPE_RPC || serviceType == SdlPacket.SERVICE_TYPE_BULK_DATA) {
+ //This is a primary transport packet as it is an RPC packet
+ //Create an unregister app interface to remove the app as it doesn't appear to exist anymore
+ byte[] uai = createForceUnregisterApp((byte) session, (byte) packet.getVersion());
+ manuallyWriteBytes(packet.getTransportRecord().getType(),uai, 0, uai.length);
+
+ int hashId = 0;
+ synchronized(this.SESSION_LOCK){
+ if(this.sessionHashIdMap.indexOfKey(session)>=0){
+ hashId = this.sessionHashIdMap.get(session);
+ this.sessionHashIdMap.delete(session);
+ }
+ }
+
+ //TODO stop other services on that transport for the session with no app
+ byte[] stopService = SdlPacketFactory.createEndSession(SessionType.RPC, (byte)session, 0, (byte)packet.getVersion(), hashId).constructPacket();
+ manuallyWriteBytes(packet.getTransportRecord().getType(), stopService,0,stopService.length);
+ }else{
+ Log.w(TAG, "No where to send a packet from what appears to be a non primary transport");
+ }
+
+ return false;
+ }
+
+ //There is an app id and can continue to normal flow
+ byte version = (byte)packet.getVersion();
+
+ if(isNewSessionRequest && version > 1 && packet.getFrameInfo() == SdlPacket.FRAME_INFO_START_SERVICE_ACK){ //we know this was a start session response
+ if (version >= 5) {
+ Integer hashId = (Integer) packet.getTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID);
+ if (hashId != null) {
+ synchronized(SESSION_LOCK) {
+ this.sessionHashIdMap.put(session, hashId);
+ }
+ } else {
+ Log.w(TAG, "Hash ID not found in V5 start service ACK frame for session " + session);
+ }
+ } else {
+ if (packet.getPayload() != null && packet.getDataSize() == 4){ //hashid will be 4 bytes in length
+ synchronized(SESSION_LOCK){
+ this.sessionHashIdMap.put(session, (BitConverter.intFromByteArray(packet.getPayload(), 0)));
+ }
+ }
+ }
+ }
+
+ // check and prevent a UAI from being passed to an app that is using a recycled session id
+ if (cleanedSessionMap != null && cleanedSessionMap.size() > 0 ) {
+ if(packet.getFrameType() == FrameType.Single && packet.getServiceType() == SdlPacket.SERVICE_TYPE_RPC) {
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.parseBinaryHeader(packet.getPayload());
+ if (binFrameHeader != null && FunctionID.UNREGISTER_APP_INTERFACE.getId() == binFrameHeader.getFunctionID()) {
+ Log.d(TAG, "Received an unregister app interface. Checking session hash before sending");
+ // make sure that we don't try to unregister a recently added app that might have a
+ // session ID of a removed app whose UAI was delayed
+ int hashOfRemoved = this.cleanedSessionMap.get(session, -1);
+ int currentHash = this.sessionHashIdMap.get(session, -1);
+ if (hashOfRemoved != -1) {
+ // Current session contains key that was held before
+ if (hashOfRemoved != currentHash) {
+ // App assigned same session id but is a different app. Keep this from being killed
+ Log.d(TAG, "same session id for different apps found, dropping packet");
+ this.cleanedSessionMap.delete(session);
+ return false;
+ }
+ }
+ }
+ }
+ }
+
+ int packetSize = (int) (packet.getDataSize() + SdlPacket.HEADER_SIZE);
+ //Log.i(TAG, "Checking packet size: " + packetSize);
+ Message message = Message.obtain();
+ Bundle bundle = new Bundle();
+
+ if(packetSize < ByteArrayMessageSpliter.MAX_BINDER_SIZE){ //This is a small enough packet just send on through
+ //Log.w(TAG, " Packet size is just right " + packetSize + " is smaller than " + ByteArrayMessageSpliter.MAX_BINDER_SIZE + " = " + (packetSize<ByteArrayMessageSpliter.MAX_BINDER_SIZE));
+ message.what = TransportConstants.ROUTER_RECEIVED_PACKET;
+
+ // !!!! ADD ADDITIONAL ITEMS TO BUNDLE HERE !!!
+
+ packet.setMessagingVersion(app.routerMessagingVersion);
+ bundle.putParcelable(FORMED_PACKET_EXTRA_NAME, packet);
+ /* !!!!!! DO NOT ADD ANY ADDITIONAL ITEMS TO THE BUNDLE AFTER PACKET. ONLY BYTES_TO_SEND_FLAG !!!!!!!*/
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_NONE);
+ /* !!!!!! DO NOT ADD ANY ADDITIONAL ITEMS TO THE BUNDLE AFTER PACKET. ONLY BYTES_TO_SEND_FLAG !!!!!!!*/
+
+ message.setData(bundle);
+ return sendPacketMessageToClient(app,message, version);
+ }else{
+ //Log.w(TAG, "Packet too big for IPC buffer. Breaking apart and then sending to client.");
+ //We need to churn through the packet payload and send it in chunks
+ byte[] bytes = packet.getPayload();
+ SdlPacket copyPacket = new SdlPacket(packet.getVersion(),packet.isEncrypted(),
+ (int)packet.getFrameType().getValue(),
+ packet.getServiceType(),packet.getFrameInfo(), session,
+ (int)packet.getDataSize(),packet.getMessageId(),null);
+ message.what = TransportConstants.ROUTER_RECEIVED_PACKET;
+ // !!!! ADD ADDITIONAL ITEMS TO BUNDLE HERE !!!
+
+ bundle.putParcelable(FORMED_PACKET_EXTRA_NAME, copyPacket);
+ /* !!!!!! DO NOT ADD ANY ADDITIONAL ITEMS TO THE BUNDLE AFTER PACKET. ONLY BYTES_TO_SEND_FLAG !!!!!!!*/
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_SDL_PACKET_INCLUDED);
+ /* !!!!!! DO NOT ADD ANY ADDITIONAL ITEMS TO THE BUNDLE AFTER PACKET. ONLY BYTES_TO_SEND_FLAG !!!!!!!*/
+
+ message.setData(bundle);
+ //Log.d(TAG, "First packet before sending: " + message.getData().toString());
+ if(!sendPacketMessageToClient(app, message, version)){
+ Log.w(TAG, "Error sending first message of split packet to client " + app.appId);
+ return false;
+ }
+ //Log.w(TAG, "Message too big for single IPC transaction. Breaking apart. Size - " + packet.getDataSize());
+ ByteArrayMessageSpliter splitter = new ByteArrayMessageSpliter(appid,TransportConstants.ROUTER_RECEIVED_PACKET,bytes,0);
+ while(splitter.isActive()){
+ if(!sendPacketMessageToClient(app,splitter.nextMessage(),version)){
+ Log.w(TAG, "Error sending first message of split packet to client " + app.appId);
+ splitter.close();
+ return false;
+ }
+ }
+ //Log.i(TAG, "Large packet finished being sent");
+ }
+
+ }else{ //If we can't find a session for this packet we just drop the packet
+ Log.e(TAG, "App Id was NULL for session! " + session);
+ TransportType transportType = packet.getTransportRecord().getType();
+ if(removeSessionFromMap(session, Collections.singletonList(transportType))){ //If we found the session id still tied to an app in our map we need to remove it and send the proper shutdown sequence.
+ Log.i(TAG, "Removed session from map. Sending unregister request to module.");
+ attemptToCleanUpModule(session, packet.getVersion(), transportType);
+ }else{ //There was no mapping so let's try to resolve this
+
+ if(packet.getFrameType() == FrameType.Single && packet.getServiceType() == SdlPacket.SERVICE_TYPE_RPC){
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.parseBinaryHeader(packet.getPayload());
+ if(binFrameHeader!=null && FunctionID.UNREGISTER_APP_INTERFACE.getId() == binFrameHeader.getFunctionID()){
+ Log.d(TAG, "Received an unregister app interface with no where to send it, dropping the packet.");
+ }else{
+ attemptToCleanUpModule(session, packet.getVersion(),transportType);
+ }
+ }else if((packet.getFrameType() == FrameType.Control
+ && (packet.getFrameInfo() == SdlPacket.FRAME_INFO_END_SERVICE_ACK || packet.getFrameInfo() == SdlPacket.FRAME_INFO_END_SERVICE_NAK))){
+ //We want to ignore this
+ Log.d(TAG, "Received a stop service ack/nak with no where to send it, dropping the packet.");
+ }else{
+ attemptToCleanUpModule(session, packet.getVersion(),transportType);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * This method is an all else fails situation. If the head unit is out of sync with the apps on the phone
+ * this method will clear out an unwanted or out of date session.
+ * @param session the session id that is to be cleaned up
+ * @param version the last known version that this session was operating with
+ */
+ private void attemptToCleanUpModule(int session, int version, TransportType primaryTransport){
+ Log.i(TAG, "Attempting to stop session " + session);
+ byte[] uai = createForceUnregisterApp((byte)session, (byte)version);
+ manuallyWriteBytes(primaryTransport,uai,0,uai.length);
+ int hashId = 0;
+ synchronized(this.SESSION_LOCK){
+ if(this.sessionHashIdMap.indexOfKey(session)>=0){
+ hashId = this.sessionHashIdMap.get(session);
+ this.sessionHashIdMap.delete(session);
+ this.cleanedSessionMap.put(session,hashId);
+ }
+ }
+ byte[] stopService = SdlPacketFactory.createEndSession(SessionType.RPC, (byte)session, 0, (byte)version, hashId).constructPacket();
+ manuallyWriteBytes(primaryTransport,stopService,0,stopService.length);
+ }
+
+ private boolean sendPacketMessageToClient(RegisteredApp app, Message message, byte version){
+ int result = app.sendMessage(message);
+ if(result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT){
+ Log.d(TAG, "Dead object, removing app and sessions");
+ //Get all their sessions and send out unregister info
+ //Use the version in this packet as a best guess
+ app.close();
+ Vector<Long> sessions = app.getSessionIds();
+ byte[] unregister,stopService;
+ int size = sessions.size(), sessionId;
+ for(int i=0; i<size;i++){
+ sessionId = sessions.get(i).intValue();
+ unregister = createForceUnregisterApp((byte)sessionId,version);
+ List<TransportType> transportTypes = app.getTransportsForSession(sessionId);
+ if(transportTypes != null && !transportTypes.isEmpty()) {
+ manuallyWriteBytes(transportTypes.get(0),unregister, 0, unregister.length);
+ int hashId = 0;
+ synchronized (this.SESSION_LOCK) {
+ if (this.sessionHashIdMap.indexOfKey(sessionId) >= 0) {
+ hashId = this.sessionHashIdMap.get(sessionId);
+ }
+ }
+ stopService = SdlPacketFactory.createEndSession(SessionType.RPC, (byte) sessionId, 0, version, hashId).constructPacket();
+
+ manuallyWriteBytes(transportTypes.get(0),stopService, 0, stopService.length);
+ synchronized (SESSION_LOCK) {
+ this.bluetoothSessionMap.remove(sessionId);
+ this.sessionHashIdMap.delete(sessionId);
+ }
+ }
+ }
+ synchronized(REGISTERED_APPS_LOCK){
+ registeredApps.remove(app.appId);
+ }
+ return false;//We did our best to correct errors
+ }
+ return true;//We should have sent our packet, so we can return true now
+ }
+
+ private synchronized void closeBluetoothSerialServer(){
+ if(bluetoothTransport != null){
+ bluetoothTransport.stop();
+ bluetoothTransport = null;
+ }
+ }
+
+ /**
+ * This function looks through the phones currently paired bluetooth devices
+ * If one of the devices' names contain "sync", or livio it will attempt to connect the RFCOMM
+ * And start SDL
+ * @return a boolean if a connection was attempted
+ */
+ @SuppressWarnings({"MissingPermission", "unused"})
+ public synchronized boolean bluetoothQuerryAndConnect(){
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ if(adapter != null && adapter.isEnabled()){
+ Set<BluetoothDevice> pairedBT= adapter.getBondedDevices();
+ Log.d(TAG, "Query Bluetooth paired devices");
+ if (pairedBT.size() > 0) {
+ for (BluetoothDevice device : pairedBT) {
+ String name = device.getName().toLowerCase(Locale.US);
+ if(name.contains("sync") || name.contains("livio")){
+ bluetoothConnect(device);
+ return true;
+ }
+ }
+ }
+ }else{
+ Log.e(TAG, "There was an issue with connecting as client");
+ }
+ return false;
+ }
+
+ @SuppressWarnings("MissingPermission")
+ private synchronized boolean bluetoothConnect(BluetoothDevice device){
+ Log.d(TAG,"Connecting to device: " + device.getName());
+ if(bluetoothTransport == null || !bluetoothTransport.isConnected())
+ { // Set up the Bluetooth serial object
+ bluetoothTransport = new MultiplexBluetoothTransport(bluetoothHandler);
+ }
+ // We've been given a device - let's connect to it
+ if(bluetoothTransport.getState()!=MultiplexBluetoothTransport.STATE_CONNECTING){
+ bluetoothTransport.connect(device);
+ if(bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_CONNECTING){
+ return true;
+ }
+ }
+
+ Log.d(TAG, "Bluetooth SPP Connect Attempt Completed");
+ return false;
+ }
+
+
+ //**************************************************************************************************************************************
+ //********************************************************* PREFERENCES ****************************************************************
+ //**************************************************************************************************************************************
+ /**
+ * @deprecated
+ * This method will set the last known bluetooth connection method that worked with this phone.
+ * This helps speed up the process of connecting
+ * @param level The level of bluetooth connecting method that last worked
+ * @param prefLocation Where the preference should be stored
+ */
+ @SuppressWarnings("DeprecatedIsStillUsed")
+ @Deprecated
+ public static void setBluetoothPrefs (int level, String prefLocation) {
+ Log.w(TAG, "This method is deprecated and will not take any action");
+ }
+
+ /**
+ * @deprecated
+ * This method has been deprecated as it was bad practice.
+ */
+ @SuppressWarnings({"DeprecatedIsStillUsed", "SameReturnValue"})
+ @Deprecated
+ public static int getBluetoothPrefs(String prefLocation)
+ {
+ return 0;
+ }
+
+ /**
+ * Set the connection establishment status of the particular device
+ * @param address address of the device in quesiton
+ * @param hasSDLConnected true if a connection has been established, false if not
+ */
+ protected void setSDLConnectedStatus(String address, boolean hasSDLConnected){
+ SharedPreferences preferences = this.getSharedPreferences(SDL_DEVICE_STATUS_SHARED_PREFS, Context.MODE_PRIVATE);
+ SharedPreferences.Editor editor = preferences.edit();
+ editor.putBoolean(address,hasSDLConnected);
+ editor.commit();
+ }
+
+ /**
+ * Checks to see if a device address has connected to SDL before.
+ * @param address the mac address of the device in quesiton
+ * @return if this is the first status check of this device
+ */
+ protected boolean isFirstStatusCheck(String address){
+ SharedPreferences preferences = this.getSharedPreferences(SDL_DEVICE_STATUS_SHARED_PREFS, Context.MODE_PRIVATE);
+ return !preferences.contains(address) ;
+ }
+ /**
+ * Checks to see if a device address has connected to SDL before.
+ * @param address the mac address of the device in quesiton
+ * @return if an SDL connection has ever been established with this device
+ */
+ protected boolean hasSDLConnected(String address){
+ SharedPreferences preferences = this.getSharedPreferences(SDL_DEVICE_STATUS_SHARED_PREFS, Context.MODE_PRIVATE);
+ return preferences.contains(address) && preferences.getBoolean(address,false);
+ }
+
+
+
+ /* ***********************************************************************************************************************************************************************
+ * ***************************************************************** CUSTOM ADDITIONS ************************************************************************************
+ *************************************************************************************************************************************************************************/
+
+ @SuppressWarnings("DeprecatedIsStillUsed")
+ @Deprecated
+ protected static LocalRouterService getLocalRouterService(Intent launchIntent, ComponentName name){
+ if(launchIntent == null){
+ Log.w(TAG, "Supplied intent was null, local router service will not contain intent");
+ }
+ if(name == null){
+ Log.e(TAG, "Unable to create local router service object because component name was null");
+ return null;
+ }
+ //noinspection deprecation
+ return new LocalRouterService(launchIntent,ROUTER_SERVICE_VERSION_NUMBER, System.currentTimeMillis(), name);
+ }
+
+ /**
+ * This method is used to check for the newest version of this class to make sure the latest and greatest is up and running.
+ */
+ private void startAltTransportTimer(){
+ altTransportTimerHandler = new Handler();
+ altTransportTimerRunnable = new Runnable() {
+ public void run() {
+ altTransportTimerHandler = null;
+ altTransportTimerRunnable = null;
+ if(!shouldServiceRemainOpen(null)){
+ closeSelf();
+ }
+ }
+ };
+ altTransportTimerHandler.postDelayed(altTransportTimerRunnable, ALT_TRANSPORT_TIMEOUT_RUNNABLE);
+ }
+
+ /**
+ * Removes session from map if the key is found.
+ * @param sessionId the session id that is to be removed from our current mapping
+ * @return if the key was found
+ */
+ private boolean removeSessionFromMap(int sessionId, List<TransportType> transportTypes){
+ synchronized(SESSION_LOCK){
+ boolean retVal = false;
+ if(transportTypes != null) { //FIXME I don't believe this should be null
+ if (transportTypes.contains(TransportType.BLUETOOTH) && bluetoothSessionMap != null) {
+ if (bluetoothSessionMap.indexOfKey(sessionId) >= 0) {
+ bluetoothSessionMap.remove(sessionId);
+ retVal = true;
+ }
+ } else if (transportTypes.contains(TransportType.USB) && usbSessionMap != null) {
+ if (usbSessionMap.indexOfKey(sessionId) >= 0) {
+ usbSessionMap.remove(sessionId);
+ retVal = true;
+ }
+ } else if (transportTypes.contains(TransportType.TCP) && tcpSessionMap != null) {
+ if (tcpSessionMap.indexOfKey(sessionId) >= 0) {
+ tcpSessionMap.remove(sessionId);
+ retVal = true;
+ }
+ }
+ }
+ return retVal;
+ }
+ }
+
+
+
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ private boolean removeAllSessionsWithAppId(String appId){
+ synchronized(SESSION_LOCK){
+ if(bluetoothSessionMap !=null){
+ SparseArray<String> iter = bluetoothSessionMap.clone();
+ int size = iter.size();
+ for(int i = 0; i<size; i++){
+ if(iter.valueAt(i).compareTo(appId) == 0){
+ sessionHashIdMap.delete(iter.keyAt(i));
+ bluetoothSessionMap.removeAt(i);
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Removes all sessions from the sessions map for this given app id
+ * @param app the RegisteredApp object that should have all its sessions removed
+ * @param cleanModule a flag if this service should attempt to clear off the sessions tied to the app off the module
+ */
+ private void removeAllSessionsForApp(RegisteredApp app, boolean cleanModule){
+ Vector<Long> sessions = app.getSessionIds();
+ int size = sessions.size(), sessionId;
+ for(int i=0; i<size;i++){
+ //Log.d(TAG, "Investigating session " +sessions.get(i).intValue());
+ //Log.d(TAG, "App id is: " + bluetoothSessionMap.get(sessions.get(i).intValue()));
+ sessionId = sessions.get(i).intValue();
+ List<TransportType> transportTypes = app.getTransportsForSession(sessionId);
+ removeSessionFromMap(sessionId, transportTypes);
+ if(cleanModule){
+ if(transportTypes != null && transportTypes.size() > 0){
+ attemptToCleanUpModule(sessionId, cachedModuleVersion, transportTypes.get(0));
+ }
+ }
+ }
+ }
+
+ private boolean removeAppFromMap(RegisteredApp app){
+ synchronized(REGISTERED_APPS_LOCK){
+ //noinspection SuspiciousMethodCalls
+ RegisteredApp old = registeredApps.remove(app);
+ if(old!=null){
+ old.close();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private String getAppIDForSession(int sessionId, boolean newSession, boolean newTransport, TransportType transportType){
+ synchronized(SESSION_LOCK){
+ //Log.d(TAG, "Looking for session: " + sessionId);
+ //First get the session map for the correct transport
+ SparseArray<String> sessionMap;
+ switch(transportType){
+ case BLUETOOTH:
+ if(bluetoothSessionMap == null){
+ bluetoothSessionMap = new SparseArray<String>();
+ }
+ sessionMap = bluetoothSessionMap;
+ break;
+ case USB:
+ if(usbSessionMap == null){
+ usbSessionMap = new SparseArray<String>();
+ }
+ sessionMap = usbSessionMap;
+ break;
+ case TCP:
+ if(tcpSessionMap == null){
+ tcpSessionMap = new SparseArray<String>();
+ }
+ sessionMap = tcpSessionMap;
+ break;
+ default:
+ return null;
+ }
+
+ String appId = sessionMap.get(sessionId);
+ if(appId==null){
+ // If service type is RPC then we know we need to just skip ahead and see if there
+ // is a registered app awaiting a session.
+ if(newSession) {
+ int pos;
+ synchronized (REGISTERED_APPS_LOCK) {
+ for (RegisteredApp app : registeredApps.values()) {
+ if(app.getAwaitingSession().contains(transportType)) {
+ pos = app.containsSessionId(-1);
+ if (pos != -1) {
+ app.setSessionId(pos, sessionId);
+ app.registerTransport(sessionId, transportType);
+ app.getAwaitingSession().remove(transportType);
+ appId = app.getAppId();
+ sessionMap.put(sessionId, appId);
+ break;
+ }
+ }
+ }
+ }
+ }else if(newTransport){
+
+ // If this is anything other than RPC with a start service response we can assume
+ // the app wants to use a new transport as secondary.
+
+ // We would only receive a start service response for RPC service when an app is
+ // attempting to register for the first time. Other services can be ran on
+ //secondary transports.
+ switch (transportType){
+ case BLUETOOTH: //Check for BT as a secondary transport
+ //USB is potential primary
+ appId = usbSessionMap.get(sessionId);
+ // No other suitable transport for primary transport
+ break;
+ case USB: //Check for USB as a secondary transport
+ //BT potential primary transport
+ appId = bluetoothSessionMap.get(sessionId);
+ // No other suitable transport for primary transport
+ break;
+ case TCP: //Check for TCP as a secondary transport
+ //BT potential primary transport
+ appId = bluetoothSessionMap.get(sessionId);
+ if(appId == null){
+ //USB is potential primary transport
+ appId = usbSessionMap.get(sessionId);
+ }
+ break;
+ default:
+ return null;
+ }
+
+ if(appId != null){
+ //This means that there is a session id of the same id on another transport
+ synchronized(REGISTERED_APPS_LOCK){
+ RegisteredApp app = registeredApps.get(appId);
+ //Ensure a registered app actually exists and is not null
+ if(app != null){
+ //Register this new transport for the app and add the entry to the
+ //session map associated with this transport
+ app.registerTransport(sessionId, transportType);
+ sessionMap.put(sessionId,appId);
+ }else{
+ Log.w(TAG, "No registered app found when register secondary transport");
+ }
+ }
+ }
+ }
+
+ }
+ //Log.d(TAG, sessionId + " session returning App Id: " + appId);
+ return appId;
+ }
+ }
+
+ /* ****************************************************************************************************************************************
+ // *********************************************************** LEGACY ****************************************************************
+ //*****************************************************************************************************************************************/
+ private boolean legacyModeEnabled = false;
+
+ private void enableLegacyMode(boolean enable){
+ Log.d(TAG, "Enable legacy mode: " + enable);
+ legacyModeEnabled = enable; //We put this at the end to avoid a race condition between the bluetooth d/c and notify of legacy mode enabled
+
+ if(legacyModeEnabled){
+ //So we need to let the clients know they need to host their own bluetooth sessions because the currently connected head unit only supports a very old version of SDL/Applink
+ //Start by closing our own bluetooth connection. The following calls will handle actually notifying the clients of legacy mode
+ closeBluetoothSerialServer();
+ //Now wait until we get a d/c, then the apps should shut their bluetooth down and go back to normal
+
+ }//else{}
+
+ }
+
+ /* ****************************************************************************************************************************************
+ // *********************************************************** UTILITY ****************************************************************
+ //*****************************************************************************************************************************************/
+
+ @SuppressWarnings("unused")
+ private void debugPacket(byte[] bytes){
+ //DEBUG
+
+ if(bytes[0] != 0x00){
+ Log.d(TAG, "Writing packet with header: " + BitConverter.bytesToHex(bytes, 12)); //just want the header
+ }else{
+
+ //Log.d(TAG, "Writing packet with binary header: " + BitConverter.bytesToHex(bytes, 12)); //just want the header
+ //int length = bytes.length-12;
+ if(bytes.length<=8){
+ Log.w(TAG, "No payload to debug or too small");
+ return;
+ }
+ //Check first byte if 0, make to json
+ char[] buffer = new char[bytes.length];
+ for(int i = 12;i<bytes.length;i++){
+ buffer[i-12] = (char)(bytes[i] & 0xFF);
+ }
+ try {
+
+ JSONObject object = new JSONObject(new String(buffer));
+ Log.d(TAG, "JSON: " + object.toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+ /**
+ * If an app crashes the only way we can handle it being on the head unit is to send an unregister app interface rpc.
+ * This method should only be called when the router service recognizes the client is no longer valid
+ * @param sessionId session id that is currently being cleared from the module. It will be used to form the packet.
+ * @param version the last known version this session was operating with
+ * @return a byte array that contains the full packet for an UnregisterAppInterface that can be written out to the transport
+ */
+ 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);
+ pm.setSessionID(sessionId);
+ pm.setMessageType(MessageType.RPC);
+ pm.setSessionType(SessionType.RPC);
+ pm.setFunctionID(FunctionID.getFunctionId(request.getFunctionName()));
+ pm.setCorrID(request.getCorrelationID());
+ if (request.getBulkData() != null)
+ pm.setBulkData(request.getBulkData());
+ byte[] data;
+ if(version > 1) { //If greater than v1 we need to include a binary frame header in the data before all the JSON starts
+ data = new byte[12 + pm.getJsonSize()];
+ BinaryFrameHeader binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(pm.getRPCType(), pm.getFunctionID(), pm.getCorrID(), pm.getJsonSize());
+ System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
+ System.arraycopy(pm.getData(), 0, data, 12, pm.getJsonSize());
+ }else {
+ data = pm.getData();
+ }
+
+ SdlPacket packet = new SdlPacket(version,false,SdlPacket.FRAME_TYPE_SINGLE,SdlPacket.SERVICE_TYPE_RPC,0,sessionId,data.length,data.length+100,data);
+ return packet.constructPacket();
+ }
+
+
+ /**
+ * Method for finding the next, highest priority write task from all connected apps.
+ * @return the next task for writing out packets if one exists
+ */
+ protected PacketWriteTask getNextTask(TransportType transportType){
+ final long currentTime = System.currentTimeMillis();
+ RegisteredApp priorityApp = null;
+ long currentPriority = -Long.MAX_VALUE, peekWeight;
+ synchronized(REGISTERED_APPS_LOCK){
+ PacketWriteTask peekTask;
+ for (RegisteredApp app : registeredApps.values()) {
+ peekTask = app.peekNextTask(transportType);
+ if(peekTask!=null){
+ peekWeight = peekTask.getWeight(currentTime);
+ //Log.v(TAG, "App " + app.appId +" has a task with weight "+ peekWeight);
+ if(peekWeight>currentPriority){
+ if(app.queuePaused){
+ app.notIt(transportType);//Reset the timer
+ continue;
+ }
+ if(priorityApp!=null){
+ priorityApp.notIt(transportType);
+ }
+ currentPriority = peekWeight;
+ priorityApp = app;
+ }
+ }
+ }
+ if(priorityApp!=null){
+ return priorityApp.getNextTask(transportType);
+ }
+ }
+ return null;
+ }
+
+ private void initPingIntent(){
+ pingIntent = new Intent();
+ pingIntent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION);
+ pingIntent.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_EXTRA, true);
+ pingIntent.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_APP_PACKAGE, getBaseContext().getPackageName());
+ pingIntent.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_CMP_NAME, new ComponentName(SdlRouterService.this, SdlRouterService.this.getClass()));
+ pingIntent.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_PING, true);
+ }
+
+ private void startClientPings(){
+ synchronized(this){
+ if(!isPrimaryTransportConnected()){ //If we aren't connected, bail
+ return;
+ }
+ if(isPingingClients){
+ Log.w(TAG, "Already pinging clients. Resting count");
+ synchronized(PING_COUNT_LOCK){
+ pingCount = 0;
+ }
+ return;
+ }
+ if(clientPingExecutor == null){
+ clientPingExecutor = Executors.newSingleThreadScheduledExecutor();
+ }
+ isPingingClients = true;
+ synchronized(PING_COUNT_LOCK){
+ pingCount = 0;
+ }
+
+ clientPingExecutor.scheduleAtFixedRate(new Runnable(){
+ List<ResolveInfo> sdlApps;
+ @Override
+ public void run() {
+ if(getPingCount()>=10){
+ Log.d(TAG, "Hit ping limit");
+ stopClientPings();
+ return;
+ }
+ if(pingIntent == null){
+ initPingIntent();
+ }
+
+ if(sdlApps == null){
+ sdlApps = getPackageManager().queryBroadcastReceivers(pingIntent, 0);
+ }
+
+ AndroidTools.sendExplicitBroadcast(getApplicationContext(), pingIntent, sdlApps);
+ synchronized(PING_COUNT_LOCK){
+ pingCount++;
+ }
+
+ }
+ }, CLIENT_PING_DELAY, CLIENT_PING_DELAY, TimeUnit.MILLISECONDS); //Give a little delay for first call
+ }
+ }
+
+ private int getPingCount(){
+ synchronized(PING_COUNT_LOCK){
+ return pingCount;
+ }
+ }
+
+ private void stopClientPings(){
+ if(clientPingExecutor!=null && !clientPingExecutor.isShutdown()){
+ clientPingExecutor.shutdownNow();
+ clientPingExecutor = null;
+ isPingingClients = false;
+ }
+ pingIntent = null;
+ }
+
+ /* ****************************************************************************************************************************************
+ // ********************************************************** TINY CLASSES ************************************************************
+ //*****************************************************************************************************************************************/
+
+ /**
+ *This class enables us to compare two router services
+ * from different apps and determine which is the newest
+ * and therefore which one should be the one spun up.
+ * @author Joey Grover
+ * @deprecated Move to the new version checking system with meta-data
+ *
+ */
+ @SuppressWarnings({"unused", "DeprecatedIsStillUsed"})
+ @Deprecated
+ static class LocalRouterService implements Parcelable{
+ Intent launchIntent = null;
+ int version ;
+ final long timestamp;
+ ComponentName name;
+
+ @SuppressWarnings("SameParameterValue")
+ private LocalRouterService(Intent intent, int version, long timeStamp, ComponentName name ){
+ this.launchIntent = intent;
+ this.version = version;
+ this.timestamp = timeStamp;
+ this.name = name;
+ }
+ /**
+ * Check if input is newer than this version
+ * @param service a reference to another possible router service that is in quesiton
+ * @return if the supplied service is newer than this one
+ */
+ public boolean isNewer(@SuppressWarnings("deprecation") LocalRouterService service){
+ if(service.version>this.version){
+ return true;
+ }else if(service.version == this.version){ //If we have the same version, we will use a timestamp
+ return service.timestamp<this.timestamp;
+ }
+ return false;
+ }
+
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
+ public boolean isEqual(@SuppressWarnings("deprecation") LocalRouterService service) {
+ return service != null && service.name != null && this.name != null && this.name.equals(service.name);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder build = new StringBuilder();
+ build.append("Intent action: ");
+ if(launchIntent!=null && launchIntent.getComponent() != null){
+ build.append(launchIntent.getComponent().getClassName());
+ }else if(name!=null){
+ build.append(name.getClassName());
+ }
+
+ build.append(" Version: ");
+ build.append(version);
+ build.append(" Timestamp: ");
+ build.append(timestamp);
+
+ return build.toString();
+ }
+ public LocalRouterService(Parcel p) {
+ this.version = p.readInt();
+ this.timestamp = p.readLong();
+ try {
+ this.launchIntent = p.readParcelable(Intent.class.getClassLoader());
+ this.name = p.readParcelable(ComponentName.class.getClassLoader());
+ }catch (Exception e){
+ // catch DexException
+ }
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(version);
+ dest.writeLong(timestamp);
+ dest.writeParcelable(launchIntent, 0);
+ dest.writeParcelable(name, 0);
+
+ }
+
+ @SuppressWarnings("deprecation")
+ public static final Parcelable.Creator<LocalRouterService> CREATOR = new Parcelable.Creator<LocalRouterService>() {
+ @SuppressWarnings("deprecation")
+ public LocalRouterService createFromParcel(Parcel in) {
+ //noinspection deprecation
+ return new LocalRouterService(in);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public LocalRouterService[] newArray(int size) {
+ //noinspection deprecation
+ return new LocalRouterService[size];
+ }
+
+ };
+
+ }
+
+
+ /**
+ * This class helps keep track of all the different sessions established with the head unit
+ * and to which app they belong to.
+ * @author Joey Grover
+ *
+ */
+ @SuppressWarnings("Convert2Diamond")
+ class RegisteredApp {
+ protected static final int SEND_MESSAGE_SUCCESS = 0x00;
+ protected static final int SEND_MESSAGE_ERROR_MESSAGE_NULL = 0x01;
+ protected static final int SEND_MESSAGE_ERROR_MESSENGER_NULL = 0x02;
+ protected static final int SEND_MESSAGE_ERROR_MESSENGER_GENERIC_EXCEPTION = 0x03;
+ protected static final int SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT = 0x04;
+
+ protected static final int PAUSE_TIME_FOR_QUEUE = 1500;
+
+ private final Object TRANSPORT_LOCK = new Object();
+
+ final String appId;
+ final Messenger messenger;
+ final Vector<Long> sessionIds;
+ final Vector<TransportType> awaitingSession;
+ final int routerMessagingVersion;
+
+ ByteAraryMessageAssembler buffer;
+ int priorityForBuffingMessage;
+ DeathRecipient deathNote = null;
+ //Packet queue vars
+ final ConcurrentHashMap<TransportType, PacketWriteTaskBlockingQueue> queues;
+ Handler queueWaitHandler;
+ Runnable queueWaitRunnable = null;
+ boolean queuePaused = false;
+
+ //Primary will always be first
+ final SparseArray<ArrayList<TransportType>> registeredTransports;
+
+ /**
+ * This is a simple class to hold onto a reference of a registered app.
+ * @param appId the supplied id for this app that is attempting to register
+ * @param messenger the specific messenger that is tied to this app
+ */
+ @Deprecated
+ public RegisteredApp(String appId, Messenger messenger){
+ this.appId = appId;
+ this.messenger = messenger;
+ this.sessionIds = new Vector<Long>();
+ this.queues = new ConcurrentHashMap<>();
+ queueWaitHandler = new Handler();
+ registeredTransports = new SparseArray<ArrayList<TransportType>>();
+ awaitingSession = new Vector<>();
+ setDeathNote();
+ routerMessagingVersion = 1;
+ }
+
+ /**
+ * This is a simple class to hold onto a reference of a registered app.
+ * @param appId the supplied id for this app that is attempting to register
+ * @param routerMessagingVersion
+ * @param messenger the specific messenger that is tied to this app
+ */
+ public RegisteredApp(String appId, int routerMessagingVersion, Messenger messenger){
+ this.appId = appId;
+ this.messenger = messenger;
+ this.sessionIds = new Vector<Long>();
+ this.queues = new ConcurrentHashMap<>();
+ queueWaitHandler = new Handler();
+ registeredTransports = new SparseArray<ArrayList<TransportType>>();
+ awaitingSession = new Vector<>();
+ setDeathNote(); //messaging Version
+ this.routerMessagingVersion = routerMessagingVersion;
+ }
+
+
+ /**
+ * Closes this app properly.
+ */
+ public void close(){
+ clearDeathNote();
+ clearBuffer();
+ Collection<PacketWriteTaskBlockingQueue> queueCollection = queues.values();
+ for(PacketWriteTaskBlockingQueue queue : queueCollection) {
+ if (queue != null) {
+ queue.clear();
+ }
+ }
+ queueCollection.clear();
+
+ if(queueWaitHandler!=null){
+ if(queueWaitRunnable!=null){
+ queueWaitHandler.removeCallbacks(queueWaitRunnable);
+ }
+ queueWaitHandler = null;
+ }
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ /*public long getAppId() {
+ return appId;
+ }*/
+ /**
+ * This is a convenience variable and may not be used or useful in different protocols
+ * @return a vector of all the session ids associated with this app
+ */
+ public Vector<Long> getSessionIds() {
+ return sessionIds;
+ }
+
+ /**
+ * Returns the position of the desired object if it is contained in the vector. If not it will return -1.
+ * @param id a session id value that is in question to be associated with this app
+ * @return the index of the supplied session id or -1 if it is not associated with this app
+ */
+ public int containsSessionId(long id){
+ return sessionIds.indexOf(id);
+ }
+ /**
+ * This will remove a session from the session id list
+ * @param sessionId the id of the session that should be removed
+ * @return if the session was successfully removed, or false if the session id wasn't associated with this app.
+ */
+ public boolean removeSession(Long sessionId){
+ int location = sessionIds.indexOf(sessionId);
+ if(location>=0){
+ Long removedSessionId = sessionIds.remove(location);
+ registeredTransports.remove(sessionId.intValue());
+ return removedSessionId != null;
+ }else{
+ return false;
+ }
+ }
+
+ /**
+ * This method is to manually put a session id into the mapping. This method should be used with extreme caution and
+ * only in certain cases when the sesion id needs to exist at a specific position in the mapping (overwriting a value)
+ * @param position the position at which the session id should be placed
+ * @param sessionId the session id that will be put into the specific position in the mapping
+ * @throws ArrayIndexOutOfBoundsException if the position is outside of the current size of the sessionIds vector
+ */
+ public void setSessionId(int position,long sessionId) throws ArrayIndexOutOfBoundsException {
+ this.sessionIds.set(position, sessionId);
+ synchronized (TRANSPORT_LOCK){
+ this.registeredTransports.put((int)sessionId, new ArrayList<TransportType>());
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public void clearSessionIds(){
+ this.sessionIds.clear();
+ }
+
+ public Vector<TransportType> getAwaitingSession() {
+ return awaitingSession;
+ }
+
+ protected void registerTransport(int sessionId, TransportType transportType){
+ synchronized (TRANSPORT_LOCK){
+ ArrayList<TransportType> transportTypes = this.registeredTransports.get(sessionId);
+ if(transportTypes!= null){
+ if(queues.get(transportType) == null){
+ queues.put(transportType, new PacketWriteTaskBlockingQueue());
+ }
+ transportTypes.add(transportType);
+ this.registeredTransports.put(sessionId,transportTypes);
+ }
+
+ }
+ }
+
+ /**
+ *
+ * @param sessionId the session id to find if a transport is registered. -1 for sessionId will
+ * trigger a search through all sessions.
+ * @param transportType the transport type to find if a transport is registered. If null is
+ * passed, will return true for any transport being registered on
+ * @return
+ */
+ protected boolean isRegisteredOnTransport(int sessionId, TransportType transportType){
+ synchronized (TRANSPORT_LOCK){
+ if(this.registeredTransports.indexOfKey(sessionId) >= 0){
+ if(transportType == null){
+ return this.registeredTransports.get(sessionId).size() > 0;
+ }
+ return this.registeredTransports.get(sessionId).indexOf(transportType) >= 0;
+ }else if(sessionId < 0 ){
+
+ //Check if any session is registered on this transport
+ int numberOfSessions = registeredTransports.size();
+ ArrayList<TransportType> transportTypes;
+ for(int i = 0; i < numberOfSessions; i++){
+ transportTypes = registeredTransports.valueAt(i);
+ if(transportTypes != null) {
+ if(transportType == null && transportTypes.size() > 0){
+ return true;
+ }
+ for (TransportType type : transportTypes) {
+ if (type.equals(transportType)) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+
+ }else{
+ return false;
+ }
+ }
+ }
+
+ protected List<TransportType> getTransportsForSession(int sessionId){
+ synchronized (TRANSPORT_LOCK){
+ if(this.registeredTransports.indexOfKey(sessionId) >= 0){
+ return this.registeredTransports.get(sessionId);
+ }else{
+ return null;
+ }
+ }
+ }
+
+ protected boolean unregisterTransport(int sessionId, @NonNull TransportType transportType){
+ if(queues != null && queues.containsValue(transportType)){
+ PacketWriteTaskBlockingQueue queue = queues.remove(transportType);
+ queue.clear();
+ }
+ synchronized (TRANSPORT_LOCK){
+ if(sessionId == -1){
+ int size = this.registeredTransports.size();
+ for(int i = 0; i <size; i++){
+ this.registeredTransports.valueAt(i).remove(transportType);
+ }
+ return true;
+ }else if(this.registeredTransports.indexOfKey(sessionId) >= 0){
+ return this.registeredTransports.get(sessionId).remove(transportType);
+ }else{
+ return false;
+ }
+ }
+
+ }
+
+ protected void unregisterAllTransports(int sessionId){
+ synchronized (TRANSPORT_LOCK){
+ if(this.registeredTransports.indexOfKey(sessionId) >= 0){
+ this.registeredTransports.get(sessionId).clear();
+ }else if(sessionId == -1){
+ int size = this.registeredTransports.size();
+ for(int i = 0; i <size; i++){
+ this.registeredTransports.valueAt(i).clear();
+ }
+ }
+ }
+ }
+
+
+ /**
+ * This method will attempt to return a transport type that can be associated to this
+ * registered app
+ * @return
+ */
+ private TransportType getCompatPrimaryTransport(){
+ if(this.registeredTransports != null){
+ List<TransportType> transportTypes = this.registeredTransports.valueAt(0);
+ if(transportTypes != null){
+ if(transportTypes.get(0) != null){
+ return transportTypes.get(0);
+ }
+ }
+ }
+
+ //No transport stored
+ if(bluetoothTransport != null && bluetoothTransport.isConnected()){
+ return TransportType.BLUETOOTH;
+ } else if(usbTransport!= null && usbTransport.isConnected()){
+ return TransportType.USB;
+ } else if(tcpTransport != null && tcpTransport.isConnected()){
+ return TransportType.TCP;
+ }
+
+ return TransportType.BLUETOOTH;
+ }
+
+ @SuppressWarnings("SameReturnValue")
+ public boolean handleIncommingClientMessage(final Bundle receivedBundle){
+ int flags = receivedBundle.getInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_NONE);
+ TransportType transportType = TransportType.valueForString(receivedBundle.getString(TransportConstants.TRANSPORT_TYPE));
+ if(transportType == null){
+ transportType = getCompatPrimaryTransport();
+ receivedBundle.putString(TransportConstants.TRANSPORT_TYPE, transportType.name());
+ }
+
+ if(flags!=TransportConstants.BYTES_TO_SEND_FLAG_NONE){
+ byte[] packet = receivedBundle.getByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME);
+ if(flags == TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START){
+ this.priorityForBuffingMessage = receivedBundle.getInt(TransportConstants.PACKET_PRIORITY_COEFFICIENT,0);
+ }
+ handleMessage(flags, packet, transportType);
+ }else{
+ //Add the write task on the stack
+ PacketWriteTaskBlockingQueue queue = queues.get(transportType);
+ if(queue == null){ //TODO check to see if there is any better place to put this
+ queue = new PacketWriteTaskBlockingQueue();
+ queues.put(transportType,queue);
+ }
+ queue.add(new PacketWriteTask(receivedBundle));
+ PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(transportType);
+ if(packetWriteTaskMaster!=null){
+ packetWriteTaskMaster.alert();
+ }
+ }
+ return true;
+ }
+
+ public int sendMessage(Message message){
+ if(this.messenger == null){return SEND_MESSAGE_ERROR_MESSENGER_NULL;}
+ if(message == null){return SEND_MESSAGE_ERROR_MESSAGE_NULL;}
+ try {
+ this.messenger.send(message);
+ return SEND_MESSAGE_SUCCESS;
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ if(e instanceof DeadObjectException){
+ return SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT;
+ }else{
+ return SEND_MESSAGE_ERROR_MESSENGER_GENERIC_EXCEPTION;
+ }
+ }
+ }
+
+ @Deprecated
+ public void handleMessage(int flags, byte[] packet) {
+ handleMessage(flags,packet,null);
+ }
+
+ public void handleMessage(int flags, byte[] packet, TransportType transportType){
+ if(flags == TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START){
+ clearBuffer();
+ buffer = new ByteAraryMessageAssembler();
+ buffer.init();
+ buffer.setTransportType(transportType);
+ }
+ if(buffer != null){
+ if (!buffer.handleMessage(flags, packet)) { //If this returns false
+ Log.e(TAG, "Error handling bytes");
+ }
+ if (buffer.isFinished()) { //We are finished building the buffer so we should write the bytes out
+ byte[] bytes = buffer.getBytes();
+ PacketWriteTaskBlockingQueue queue = queues.get(transportType);
+ if (queue != null) {
+ queue.add(new PacketWriteTask(bytes, 0, bytes.length, this.priorityForBuffingMessage,transportType));
+ if(packetWriteTaskMasterMap != null) {
+ PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(transportType);
+ if (packetWriteTaskMaster != null) {
+ packetWriteTaskMaster.alert();
+ }
+ }
+ }
+ buffer.close();
+ }
+ }
+ }
+
+ protected PacketWriteTask peekNextTask(TransportType transportType){
+ PacketWriteTaskBlockingQueue queue = queues.get(transportType);
+ if(queue !=null){
+ return queue.peek();
+ }
+ return null;
+ }
+
+ protected PacketWriteTask getNextTask(TransportType transportType){
+ PacketWriteTaskBlockingQueue queue = queues.get(transportType);
+ if(queue !=null){
+ return queue.poll();
+ }
+ return null;
+ }
+
+ /**
+ * This will inform the local app object that it was not picked to have the highest priority. This will allow the user to continue to perform interactions
+ * with the module and not be bogged down by large packet requests.
+ */
+ protected void notIt(final TransportType transportType){
+ PacketWriteTaskBlockingQueue queue = queues.get(transportType);
+ if(queue!=null && queue.peek().priorityCoefficient>0){ //If this has any sort of priority coefficient we want to make it wait.
+ //Flag to wait
+ if(queueWaitHandler == null){
+ Log.e(TAG, "Unable to pause queue, handler was null");
+ }
+ if(queueWaitRunnable == null){
+ queueWaitRunnable = new Runnable(){
+
+ @Override
+ public void run() {
+ pauseQueue(false);
+ PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(transportType);
+ if(packetWriteTaskMaster!=null){
+ packetWriteTaskMaster.alert();
+ }
+ }
+ };
+ }
+ if(queuePaused){
+ queueWaitHandler.removeCallbacks(queueWaitRunnable);
+ }
+ pauseQueue(queueWaitHandler.postDelayed(queueWaitRunnable, PAUSE_TIME_FOR_QUEUE));
+ }
+ }
+ private void pauseQueue(boolean paused){
+ this.queuePaused = paused;
+ }
+ protected void clearBuffer(){
+ if(buffer!=null){
+ buffer.close();
+ buffer = null;
+ }
+ }
+
+ protected boolean setDeathNote(){
+ if(messenger!=null){
+ if(deathNote == null){
+ deathNote = new DeathRecipient(){
+ final Object deathLock = new Object();
+ @Override
+ public void binderDied() {
+ synchronized(deathLock){
+ Log.w(TAG, "Binder died for app " + RegisteredApp.this.appId);
+ if(messenger.getBinder()!=null){
+ messenger.getBinder().unlinkToDeath(this, 0);
+ }
+ removeAllSessionsForApp(RegisteredApp.this,true);
+ removeAppFromMap(RegisteredApp.this);
+ startClientPings();
+ }
+ }
+ };
+ }
+ try {
+ messenger.getBinder().linkToDeath(deathNote, 0);
+ return true;
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+ return false;
+ }
+
+ protected boolean clearDeathNote() {
+ return messenger != null && messenger.getBinder() != null && deathNote != null && messenger.getBinder().unlinkToDeath(deathNote, 0);
+ }
+ }
+
+ /**
+ * A runnable task for writing out packets.
+ * @author Joey Grover
+ *
+ */
+ public class PacketWriteTask implements Runnable{
+ private static final long DELAY_CONSTANT = 500; //250ms
+ private static final long SIZE_CONSTANT = 1000; //1kb
+ private static final long PRIORITY_COEF_CONSTANT = 500;
+ private static final int DELAY_COEF = 1;
+ private static final int SIZE_COEF = 1;
+
+ private byte[] bytesToWrite = null;
+ private final int offset, size, priorityCoefficient;
+ private final long timestamp;
+ final Bundle receivedBundle;
+ TransportType transportType;
+
+ @SuppressWarnings("SameParameterValue")
+ @Deprecated
+ public PacketWriteTask(byte[] bytes, int offset, int size, int priorityCoefficient) {
+ this(bytes, offset, size, priorityCoefficient,null);
+ }
+
+ public PacketWriteTask(byte[] bytes, int offset, int size, int priorityCoefficient, TransportType transportType){
+ timestamp = System.currentTimeMillis();
+ bytesToWrite = bytes;
+ this.offset = offset;
+ this.size = size;
+ this.priorityCoefficient = priorityCoefficient;
+ receivedBundle = null;
+ this.transportType = transportType;
+ }
+
+ public PacketWriteTask(Bundle bundle){
+ this.receivedBundle = bundle;
+ timestamp = System.currentTimeMillis();
+ bytesToWrite = bundle.getByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME);
+ offset = bundle.getInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, 0); //If nothing, start at the beginning of the array
+ size = bundle.getInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, bytesToWrite.length); //In case there isn't anything just send the whole packet.
+ this.priorityCoefficient = bundle.getInt(TransportConstants.PACKET_PRIORITY_COEFFICIENT,0);
+ this.transportType = TransportType.valueForString(receivedBundle.getString(TransportConstants.TRANSPORT_TYPE));
+
+ }
+
+ protected void setTransportType(TransportType transportType){
+ this.transportType = transportType;
+ }
+
+ @Override
+ public void run() {
+ if(receivedBundle != null){
+ writeBytesToTransport(receivedBundle);
+ }else if(bytesToWrite !=null){
+ manuallyWriteBytes(this.transportType, bytesToWrite, offset, size);
+ }
+ }
+
+ private long getWeight(long currentTime){ //Time waiting - size - priority_coef
+ return ((((currentTime-timestamp) + DELAY_CONSTANT) * DELAY_COEF ) - ((size -SIZE_CONSTANT) * SIZE_COEF) - (priorityCoefficient * PRIORITY_COEF_CONSTANT));
+ }
+ }
+
+ /**
+ * Extends thread to consume PacketWriteTasks in a priority queue fashion. It will attempt to look
+ * at all apps serial queue of tasks and compare them
+ * @author Joey Grover
+ *
+ */
+ private class PacketWriteTaskMaster extends Thread{
+ protected final Object QUEUE_LOCK = new Object();
+ private boolean isHalted = false, isWaiting = false;
+ private TransportType transportType;
+
+ public PacketWriteTaskMaster(){
+ this.setName("PacketWriteTaskMaster");
+ this.setDaemon(true);
+ }
+ protected void setTransportType(TransportType transportType){
+ this.transportType = transportType;
+ }
+
+ @Override
+ public void run() {
+ while(!isHalted){
+ try{
+ PacketWriteTask task;
+ synchronized(QUEUE_LOCK){
+ task = getNextTask(transportType);
+ if(task != null){
+ task.run();
+ }else{
+ isWaiting = true;
+ QUEUE_LOCK.wait();
+ isWaiting = false;
+ }
+ }
+ }catch(InterruptedException e){
+ break;
+ }
+ }
+ }
+
+ private void alert(){
+ if(isWaiting){
+ synchronized(QUEUE_LOCK){
+ QUEUE_LOCK.notify();
+ }
+ }
+ }
+
+ private void close(){
+ this.isHalted = true;
+ }
+ }
+
+ /**
+ * Custom queue to prioritize packet write tasks based on their priority coefficient.<br> The queue is a doubly linked list.<br><br>
+ * When a tasks is added to the queue, it will be evaluated using it's priority coefficient. If the coefficient is greater than 0, it will simply
+ * be placed at the end of the queue. If the coefficient is equal to 0, the queue will begin to iterate at the head and work it's way back. Once it is found that the current
+ * tasks has a priority coefficient greater than 0, it will be placed right before that task. The idea is to keep a semi-serial queue but creates a priority that allows urgent
+ * tasks such as UI related to skip near the front. However, it is assumed those tasks of higher priority should also be handled in a serial fashion.
+ *
+ * @author Joey Grover
+ *
+ */
+ @SuppressWarnings("Convert2Diamond")
+ private class PacketWriteTaskBlockingQueue{
+ final class Node<E> {
+ final E item;
+ Node<E> prev;
+ Node<E> next;
+ Node(E item, Node<E> previous, Node<E> next) {
+ this.item = item;
+ this.prev = previous;
+ this.next = next;
+ }
+ }
+
+ private Node<PacketWriteTask> head;
+ private Node<PacketWriteTask> tail;
+
+ /**
+ * This will take the given task and insert it at the tail of the queue
+ * @param task the task to be inserted at the tail of the queue
+ */
+ private void insertAtTail(PacketWriteTask task){
+ if (task == null){
+ throw new NullPointerException();
+ }
+ Node<PacketWriteTask> oldTail = tail;
+ Node<PacketWriteTask> newTail = new Node<PacketWriteTask>(task, oldTail, null);
+ tail = newTail;
+ if (head == null){
+ head = newTail;
+ }else{
+ oldTail.next = newTail;
+ }
+
+ }
+
+ /**
+ * This will take the given task and insert it at the head of the queue
+ * @param task the task to be inserted at the head of the queue
+ */
+ private void insertAtHead(PacketWriteTask task){
+ if (task == null){
+ throw new NullPointerException();
+ }
+ Node<PacketWriteTask> oldHead = head;
+ Node<PacketWriteTask> newHead = new Node<PacketWriteTask>(task, null, oldHead);
+ head = newHead;
+ if (tail == null){
+ tail = newHead;
+ }else{
+ if(oldHead!=null){
+ oldHead.prev = newHead;
+ }
+ }
+ }
+
+ /**
+ * Insert the task in the queue where it belongs
+ * @param task the new PacketWriteTask that needs to be added to the queue to be handled
+ */
+ public void add(PacketWriteTask task){
+ synchronized(this){
+ if (task == null){
+ throw new NullPointerException();
+ }
+
+ //If we currently don't have anything in our queue
+ if(head == null || tail == null){
+ Node<PacketWriteTask> taskNode = new Node<PacketWriteTask>(task, head, tail);
+ head = taskNode;
+ tail = taskNode;
+ }else if(task.priorityCoefficient>0){ //If the task is already a not high priority task, we just need to insert it at the tail
+ insertAtTail(task);
+ }else if(head.item.priorityCoefficient>0){ //If the head task is already a not high priority task, we just need to insert at head
+ insertAtHead(task);
+ }else{
+ if(tail.item.priorityCoefficient==0){ //Saves us from going through the entire list if all of these tasks are priority coef == 0
+ insertAtTail(task);
+ return;
+ }
+ Node<PacketWriteTask> currentPlace = head;
+ while(true){
+ if(currentPlace.item.priorityCoefficient==0){
+ if(currentPlace.next==null){
+ //We've reached the end of the list
+ insertAtTail(task);
+ return;
+ }else{
+ currentPlace = currentPlace.next;
+ }
+ }else{
+ //We've found where this task should be inserted
+ Node<PacketWriteTask> previous = currentPlace.prev;
+ Node<PacketWriteTask> taskNode = new Node<PacketWriteTask>(task, previous, currentPlace);
+ previous.next = taskNode;
+ currentPlace.prev = taskNode;
+ return;
+
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Peek at the current head of the queue
+ * @return the task at the head of the queue but does not remove it from the queue
+ */
+ public PacketWriteTask peek(){
+ synchronized(this){
+ if(head == null){
+ return null;
+ }else{
+ return head.item;
+ }
+ }
+ }
+
+ /**
+ * Remove the head of the queue
+ * @return the old head of the queue
+ */
+ public PacketWriteTask poll(){
+ synchronized(this){
+ if(head == null){
+ return null;
+ }else{
+ Node<PacketWriteTask> retValNode = head;
+ Node<PacketWriteTask> newHead = head.next;
+ if(newHead == null){
+ tail = null;
+ }
+ head = newHead;
+
+ return retValNode.item;
+ }
+ }
+ }
+
+ /**
+ * Currently only clears the head and the tail of the queue.
+ */
+ public void clear(){
+ //Should probably go through the linked list and clear elements, but gc should clear them out automatically.
+ head = null;
+ tail = null;
+ }
+ }
+
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java
new file mode 100644
index 000000000..fcd17a0fb
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Build;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.smartdevicelink.util.AndroidTools;
+
+import java.lang.ref.WeakReference;
+
+import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
+
+public class SdlRouterStatusProvider {
+
+ private static final String TAG = "SdlRouterStateProvider";
+
+ private Context context = null;
+ private boolean isBound = false;
+ ConnectedStatusCallback cb = null;
+ Messenger routerServiceMessenger = null;
+ private ComponentName routerService = null;
+ private int flags = 0;
+
+ final Messenger clientMessenger;
+
+ private ServiceConnection routerConnection= new ServiceConnection() {
+
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ Log.d(TAG, "Bound to service " + className.toString());
+ routerServiceMessenger = new Messenger(service);
+ isBound = true;
+ //So we just established our connection
+ //Register with router service
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_STATUS_CONNECTED_STATE_REQUEST;
+ msg.arg1 = flags;
+ msg.replyTo = clientMessenger;
+ try {
+ routerServiceMessenger.send(msg);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ if(cb!=null){
+ cb.onConnectionStatusUpdate(false, routerService, context);
+ }
+ }
+ }
+
+ public void onServiceDisconnected(ComponentName className) {
+ Log.d(TAG, "UN-Bound from service " + className.getClassName());
+ routerServiceMessenger = null;
+ isBound = false;
+ }
+ };
+
+ public SdlRouterStatusProvider(Context context, ComponentName service, ConnectedStatusCallback callback){
+ if(context == null || service == null || callback == null){
+ throw new IllegalStateException("Supplied params are not correct. Context == null? "+ (context==null) + " ComponentName == null? " + (service == null) + " ConnectedStatusListener == null? " + callback);
+ }
+ this.context = context;
+ this.routerService = service;
+ this.cb = callback;
+ this.clientMessenger = new Messenger(new ClientHandler(this));
+
+ }
+ public void setFlags(int flags){
+ this.flags = flags;
+ }
+ public void checkIsConnected(){
+ if(!AndroidTools.isServiceExported(context,routerService) || !bindToService()){
+ //We are unable to bind to service
+ cb.onConnectionStatusUpdate(false, routerService, context);
+ unBindFromService();
+ }
+ }
+
+ public void cancel(){
+ if(isBound){
+ unBindFromService();
+ }
+ }
+
+ private boolean bindToService(){
+ if(isBound){
+ return true;
+ }
+ if(clientMessenger == null){
+ return false;
+ }
+ Intent bindingIntent = new Intent();
+ bindingIntent.setClassName(this.routerService.getPackageName(), this.routerService.getClassName());//This sets an explicit intent
+ //Quickly make sure it's just up and running
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
+ context.startService(bindingIntent);
+ }else {
+ bindingIntent.putExtra(FOREGROUND_EXTRA, true);
+ context.startForegroundService(bindingIntent);
+
+ }
+ bindingIntent.setAction( TransportConstants.BIND_REQUEST_TYPE_STATUS);
+ return context.bindService(bindingIntent, routerConnection, Context.BIND_AUTO_CREATE);
+ }
+
+ private void unBindFromService(){
+ try{
+ if(context!=null && routerConnection!=null){
+ context.unbindService(routerConnection);
+ }else{
+ Log.w(TAG, "Unable to unbind from router service, context was null");
+ }
+
+ }catch(IllegalArgumentException e){
+ //This is ok
+ }
+ }
+
+ private void handleRouterStatusConnectedResponse(int connectedStatus){
+ if(cb!=null){
+ cb.onConnectionStatusUpdate(connectedStatus == 1, routerService,context);
+ }
+ unBindFromService();
+ routerServiceMessenger =null;
+ }
+
+ static class ClientHandler extends Handler {
+ final WeakReference<SdlRouterStatusProvider> provider;
+
+ public ClientHandler(SdlRouterStatusProvider provider){
+ super(Looper.getMainLooper());
+ this.provider = new WeakReference<SdlRouterStatusProvider>(provider);
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ if(provider.get()==null){
+ return;
+ }
+ switch (msg.what) {
+ case TransportConstants.ROUTER_STATUS_CONNECTED_STATE_RESPONSE:
+ provider.get().handleRouterStatusConnectedResponse(msg.arg1);
+ break;
+ default:
+ break;
+ }
+ }
+ };
+
+ public interface ConnectedStatusCallback{
+ public void onConnectionStatusUpdate(boolean connected, ComponentName service, Context context);
+ }
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java
new file mode 100644
index 000000000..0fa64d7f5
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.trace.SdlTrace;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.DebugTool;
+
+public abstract class SdlTransport {
+ private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
+
+ private final static String FailurePropagating_Msg = "Failure propagating ";
+ private Boolean isConnected = false;
+
+ private String _sendLockObj = "lock";
+
+
+ // Get status of transport connection
+ public Boolean getIsConnected() {
+ return isConnected;
+ }
+
+ //protected SdlTransport(String endpointName, String param2, ITransportListener transportListener)
+ protected SdlTransport(ITransportListener transportListener) {
+ if (transportListener == null) {
+ throw new IllegalArgumentException("Provided transport listener interface reference is null");
+ } // end-if
+ _transportListener = transportListener;
+ } // end-method
+
+ // This method is called by the subclass to indicate that data has arrived from
+ // the transport.
+ protected void handleReceivedPacket(SdlPacket packet) {
+ try {
+ // Trace received data
+ if (packet!=null) {
+ // Send transport data to the siphon server
+ //FIXME SiphonServer.sendBytesFromSDL(receivedBytes, 0, receivedBytesLength);
+ //SdlTrace.logTransportEvent("", null, InterfaceActivityDirection.Receive, receivedBytes, receivedBytesLength, SDL_LIB_TRACE_KEY);
+
+ _transportListener.onTransportPacketReceived(packet);
+ } // end-if
+ } catch (Exception excp) {
+ DebugTool.logError(FailurePropagating_Msg + "handleBytesFromTransport: " + excp.toString(), excp);
+ handleTransportError(FailurePropagating_Msg, excp);
+ } // end-catch
+ } // end-method
+
+ // This method must be implemented by transport subclass, and is called by this
+ // base class to actually send an array of bytes out over the transport. This
+ // method is meant to only be callable within the class hierarchy.
+ protected abstract boolean sendBytesOverTransport(SdlPacket packet);
+
+ // This method is called by whomever has reference to transport to have bytes
+ // sent out over transport.
+ /* public boolean sendBytes(byte[] message) {
+ return sendBytes(message, 0, message.length);
+ }*/ // end-method
+
+ // This method is called by whomever has reference to transport to have bytes
+ // sent out over transport.
+ public boolean sendBytes(SdlPacket packet) {
+ boolean bytesWereSent = false;
+ synchronized (_sendLockObj) {
+ bytesWereSent = sendBytesOverTransport(packet);//message, offset, length);
+ } // end-lock
+ // Send transport data to the siphon server
+ //FIXME SiphonServer.sendBytesFromAPP(message, offset, length);
+
+ //FIXME SdlTrace.logTransportEvent("", null, InterfaceActivityDirection.Transmit, message, offset, length, SDL_LIB_TRACE_KEY);
+ return bytesWereSent;
+ } // end-method
+
+ private ITransportListener _transportListener = null;
+
+ // This method is called by the subclass to indicate that transport connection
+ // has been established.
+ protected void handleTransportConnected() {
+ isConnected = true;
+ try {
+ SdlTrace.logTransportEvent("Transport.connected", null, InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
+ _transportListener.onTransportConnected();
+ } catch (Exception excp) {
+ DebugTool.logError(FailurePropagating_Msg + "onTransportConnected: " + excp.toString(), excp);
+ handleTransportError(FailurePropagating_Msg + "onTransportConnected", excp);
+ } // end-catch
+ } // end-method
+
+ // This method is called by the subclass to indicate that transport disconnection
+ // has occurred.
+ protected void handleTransportDisconnected(final String info) {
+ isConnected = false;
+
+ try {
+ SdlTrace.logTransportEvent("Transport.disconnect: " + info, null, InterfaceActivityDirection.Transmit, null, 0, SDL_LIB_TRACE_KEY);
+ _transportListener.onTransportDisconnected(info);
+ } catch (Exception excp) {
+ DebugTool.logError(FailurePropagating_Msg + "onTransportDisconnected: " + excp.toString(), excp);
+ } // end-catch
+ } // end-method
+
+ // This method is called by the subclass to indicate a transport error has occurred.
+ protected void handleTransportError(final String message, final Exception ex) {
+ isConnected = false;
+ _transportListener.onTransportError(message, ex);
+ }
+
+ public abstract void openConnection() throws SdlException;
+ public abstract void disconnect();
+
+ /**
+ * Abstract method which should be implemented by subclasses in order to return actual type of the transport.
+ *
+ * @return One of {@link TransportType} enumeration values.
+ *
+ * @see TransportType
+ */
+ public abstract TransportType getTransportType();
+
+ public abstract String getBroadcastComment();
+} // end-class
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java
new file mode 100644
index 000000000..4e9f4ffba
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java
@@ -0,0 +1,559 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import android.annotation.TargetApi;
+import android.os.Build;
+import android.os.NetworkOnMainThreadException;
+import android.util.Log;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.enums.TransportType;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+
+/**
+ * General comments:
+ *
+ * 1) Transport layer can be reorganized to properly incapsulate thread-related code according to Android OS guidelines
+ * 2) Currently there are different cases when transport error information sent to listener components
+ * a) when there are some errors during writing data to transport
+ * b) when there are errors during connection establishing/reading data
+ * But information about transport disconnection is sent only if disconnection was successful. So we have following
+ * sequences:
+ * a) handleTransportConnected -> read without errors -> handleTransportDisconnected
+ * b) handleTransportConnected -> handleTransportError(write with errors) -> handleTransportDisconnected
+ * c) handleTransportConnected -> handleTransportError(read with errors) -> handleTransportError(socket closed)
+ *
+ * They can be changed to be more natural and easy to use.
+ *
+ * 3) Public api is inconsistent. During single call of some api method (for example "openConnection") some of the
+ * following result can appears:
+ * a) SdlException thrown
+ * b) onTransportError callback called on listeners
+ *
+ * 4) Handling of connection must be more stable
+ * 5) General solution in case of reconnecting must be implemented
+ * 6) It must be common and same solution for handling information about physical device adapters (BT, WiFi etc.)
+ */
+
+/**
+ * Class that implements TCP transport
+ */
+public class TCPTransport extends SdlTransport {
+
+ /**
+ * Size of the read buffer.
+ */
+ private static final int READ_BUFFER_SIZE = 4096;
+
+ /**
+ * Delay between reconnect attempts
+ */
+ private static final int RECONNECT_DELAY = 5000;
+
+ /**
+ * Count of the reconnect retries
+ */
+ private static final int RECONNECT_RETRY_COUNT = 30;
+
+ /**
+ * Instance of TCP transport configuration
+ */
+ private TCPTransportConfig mConfig = null;
+
+ /**
+ * Instance of the client socket
+ */
+ private Socket mSocket = null;
+
+ /**
+ * Instance of the input stream. Used to read data from SmartDeviceLinkCore
+ */
+ private InputStream mInputStream = null;
+
+ /**
+ * Instance of the output stream. Used to send data to SmartDeviceLinkCore
+ */
+ private OutputStream mOutputStream = null;
+
+ /**
+ * Instance of the separate thread, that does actual work, related to connecting/reading/writing data
+ */
+ private TCPTransportThread mThread = null;
+
+ /**
+ * Initial internal state of the component. Used like a simple lightweight FSM replacement while component
+ * must behave differently in response to it's public function calls depending of it's current state
+ */
+ private TCPTransportState mCurrentState = TCPTransportState.IDLE;
+
+ /**
+ * Constructs TCP transport component instance
+ *
+ * @param tcpTransportConfig Instance of the TCP transport configuration
+ * @param transportListener Listener that will be notified on different TCP transport activities
+ */
+ public TCPTransport(TCPTransportConfig tcpTransportConfig, ITransportListener transportListener) {
+ super(transportListener);
+ this.mConfig = tcpTransportConfig;
+ }
+
+ /**
+ * Performs actual work of sending array of bytes over the transport
+ * @param msgBytes Bytes to send
+ * @param offset Offset in the bytes array to send data from
+ * @param length Number of bytes to send
+ * @return True if data was sent successfully, False otherwise
+ */
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ @Override
+ protected boolean sendBytesOverTransport(SdlPacket packet) {
+ TCPTransportState currentState = getCurrentState();
+ byte[] msgBytes = packet.constructPacket();
+ logInfo(String.format("TCPTransport: sendBytesOverTransport requested. Size: %d, Offset: %d, Length: %d, Current state is: %s"
+ , msgBytes.length, 0, msgBytes.length, currentState.name()));
+
+ boolean bResult = false;
+
+ if(currentState == TCPTransportState.CONNECTED) {
+ if (mOutputStream != null) {
+ logInfo("TCPTransport: sendBytesOverTransport request accepted. Trying to send data");
+ try {
+ mOutputStream.write(msgBytes, 0, msgBytes.length);
+ bResult = true;
+ logInfo("TCPTransport.sendBytesOverTransport: successfully send data");
+ } catch (IOException | NetworkOnMainThreadException e) {
+ logError("TCPTransport.sendBytesOverTransport: error during sending data: " + e.getMessage());
+ bResult = false;
+ }
+ } else {
+ logError("TCPTransport: sendBytesOverTransport request accepted, but output stream is null");
+ }
+ }
+ else {
+ logInfo("TCPTransport: sendBytesOverTransport request rejected. Transport is not connected");
+ bResult = false;
+ }
+
+ return bResult;
+ }
+
+ /**
+ * Tries to open connection to SmartDeviceLinkCore.
+ * Actual try will be performed only if no actual connection is available
+ * @throws SdlException
+ */
+ @Override
+ public void openConnection() throws SdlException {
+ TCPTransportState currentState = getCurrentState();
+ logInfo(String.format("TCPTransport: openConnection requested. Current state is: %s", currentState.name()));
+
+ if(currentState == TCPTransportState.IDLE) {
+ synchronized (this) {
+ setCurrentState(TCPTransportState.CONNECTING);
+ logInfo("TCPTransport: openConnection request accepted. Starting transport thread");
+ try {
+ mThread = new TCPTransportThread();
+ mThread.setDaemon(true);
+ mThread.start();
+
+ // Initialize the SiphonServer
+ if (SiphonServer.getSiphonEnabledStatus()) {
+ SiphonServer.init();
+ }
+
+ } catch (Exception e) {
+ logError("TCPTransport: Exception during transport thread starting", e);
+ throw new SdlException(e);
+ }
+ }
+ } else {
+ logInfo("TCPTransport: openConnection request rejected. Another connection is not finished");
+ }
+ }
+
+
+ /**
+ * Tries to disconnect from SmartDeviceLinkCore.
+ * Actual try will be performed only if connection is available
+ */
+ @Override
+ public void disconnect() {
+ TCPTransportState currentState = getCurrentState();
+ logInfo(String.format("TCPTransport: disconnect requested from client. Current state is: %s", currentState.name()));
+
+ if(currentState == TCPTransportState.CONNECTED) {
+ logInfo("TCPTransport: disconnect request accepted.");
+ synchronized (this) {
+ disconnect(null, null, true);
+ }
+ } else {
+ logInfo("TCPTransport: disconnect request rejected. Transport is not connected");
+ }
+ }
+
+ /**
+ * Performs actual work related to disconnecting from SmartDeviceLinkCore.
+ *
+ * @param message Message that describes disconnect reason
+ * @param exception Some of the possible exceptions that was the reason of disconnecting
+ * @param stopThread True if not only disconnection must be done but also thread that handles connection must be
+ * also stopped so no reconnect attempts will be made
+ */
+ private synchronized void disconnect(String message, Exception exception, boolean stopThread) {
+
+ if(getCurrentState() == TCPTransportState.DISCONNECTING) {
+ logInfo("TCPTransport: disconnecting already in progress");
+ return;
+ }
+
+ setCurrentState(TCPTransportState.DISCONNECTING);
+
+ String disconnectMsg = (message == null ? "" : message);
+ if (exception != null) {
+ disconnectMsg += ", " + exception.toString();
+ }
+
+ try {
+ if(mThread != null && stopThread) {
+ mThread.halt();
+ mThread.interrupt();
+ }
+
+ if(mSocket != null){
+ mSocket.close();
+ }
+ mSocket = null;
+ } catch (IOException e) {
+ logError("TCPTransport.disconnect: Exception during disconnect: " + e.getMessage());
+ }
+
+ if (exception == null) {
+ // This disconnect was not caused by an error, notify the proxy that
+ // the transport has been disconnected.
+ logInfo("Disconnect is correct. Handling it");
+ handleTransportDisconnected(disconnectMsg);
+ } else {
+ // This disconnect was caused by an error, notify the proxy
+ // that there was a transport error.
+ logError("Disconnect is incorrect. Handling it as error");
+ handleTransportError(disconnectMsg, exception);
+ }
+ }
+
+ /**
+ * Overridden abstract method which returns specific type of this transport.
+ *
+ * @return Constant value - TransportType.TCP.
+ *
+ * @see TransportType
+ */
+ public TransportType getTransportType() {
+ return TransportType.TCP;
+ }
+
+ /**
+ * Internal method for logging information messages
+ * @param message Message to log
+ */
+ protected void logInfo(String message) {
+ Log.i(getClass().getName(), message);
+ }
+
+ /**
+ * Internal method for logging error messages
+ * @param message Message to log
+ */
+ protected void logError(String message) {
+ Log.e(getClass().getName(), message);
+ }
+
+ /**
+ * Internal method for logging warning messages
+ * @param message Message to log
+ */
+ protected void logWarning(String message) {
+ Log.w(getClass().getName(), message);
+ }
+
+ /**
+ * Internal method for logging error message together with information about exception that was the reason of it
+ * @param message Message to log
+ * @param throwable Exception, that was the main reason for logged error message
+ */
+ protected void logError(String message, Throwable throwable) {
+ Log.e(getClass().getName(), message, throwable);
+ }
+
+ /**
+ * Internal class that represents separate thread, that does actual work, related to connecting/reading/writing data
+ */
+ private class TCPTransportThread extends Thread {
+ SdlPsm psm;
+ public TCPTransportThread(){
+ psm = new SdlPsm();
+ }
+ /**
+ * Represents current thread state - halted or not. This flag is used to change internal behavior depending
+ * on current state.
+ */
+ private Boolean isHalted = false;
+
+ /**
+ * Method that marks thread as halted.
+ */
+ public void halt() {
+ isHalted = true;
+ }
+
+ /**
+ * Tries to connect to the SmartDeviceLink core. Behavior depends autoReconnect configuration param:
+ * a) If autoReconnect is false, then only one connect try will be performed.
+ * b) If autoReconnect is true, then in case of connection error continuous reconnect will be performed
+ * after short delay until connection will be established or retry count will be reached
+ *
+ * @return true if connection established and false otherwise
+ */
+ private boolean connect() {
+ boolean bConnected;
+ int remainingRetry = RECONNECT_RETRY_COUNT;
+
+ synchronized (TCPTransport.this) {
+ do {
+ try {
+
+ if ((null != mSocket) && (!mSocket.isClosed())) {
+ logInfo("TCPTransport.connect: Socket is not closed. Trying to close it");
+ mSocket.close();
+ }
+
+ logInfo(String.format("TCPTransport.connect: Socket is closed. Trying to connect to %s", mConfig));
+ mSocket = new Socket();
+ mSocket.connect(new InetSocketAddress(mConfig.getIPAddress(), mConfig.getPort()));
+ mOutputStream = mSocket.getOutputStream();
+ mInputStream = mSocket.getInputStream();
+
+ } catch (IOException e) {
+ logError("TCPTransport.connect: Exception during connect stage: " + e.getMessage());
+ }
+
+ bConnected = (null != mSocket) && mSocket.isConnected();
+
+ if(bConnected){
+ logInfo("TCPTransport.connect: Socket connected");
+ }else{
+ if(mConfig.getAutoReconnect()){
+ remainingRetry--;
+ logInfo(String.format("TCPTransport.connect: Socket not connected. AutoReconnect is ON. retryCount is: %d. Waiting for reconnect delay: %d"
+ , remainingRetry, RECONNECT_DELAY));
+ waitFor(RECONNECT_DELAY);
+ } else {
+ logInfo("TCPTransport.connect: Socket not connected. AutoReconnect is OFF");
+ }
+ }
+ } while ((!bConnected) && (mConfig.getAutoReconnect()) && (remainingRetry > 0) && (!isHalted));
+
+ return bConnected;
+ }
+ }
+
+ /**
+ * Performs actual thread work
+ */
+ @Override
+ public void run() {
+ logInfo("TCPTransport.run: transport thread created. Starting connect stage");
+ psm.reset();
+ while(!isHalted) {
+ setCurrentState(TCPTransportState.CONNECTING);
+ if(!connect()){
+ if (isHalted) {
+ logInfo("TCPTransport.run: Connection failed, but thread already halted");
+ } else {
+ disconnect("Failed to connect to Sdl", new SdlException("Failed to connect to Sdl"
+ , SdlExceptionCause.SDL_CONNECTION_FAILED), true);
+ }
+ break;
+ }
+
+ synchronized (TCPTransport.this) {
+ setCurrentState(TCPTransportState.CONNECTED);
+ handleTransportConnected();
+ }
+
+ byte input;
+ byte[] buffer = new byte[READ_BUFFER_SIZE];
+ int bytesRead;
+ boolean stateProgress = false;
+ while (!isHalted) {
+ //logInfo("TCPTransport.run: Waiting for data...");
+ try {
+ //input = (byte) mInputStream.read();
+ bytesRead = mInputStream.read(buffer);
+ } catch (IOException e) {
+ internalHandleStreamReadError();
+ break;
+ }
+
+ synchronized (TCPTransport.this) {
+ if (mThread.isInterrupted()) {
+ logInfo("TCPTransport.run: Got new data but thread is interrupted");
+ break;
+ }
+ }
+ for (int i = 0; i < bytesRead; i++) {
+ //logInfo("TCPTransport.run: Got new data");
+ // Send the response of what we received
+ input = buffer[i];
+ stateProgress = psm.handleByte(input);
+ if (!stateProgress) {//We are trying to weed through the bad packet info until we get something
+
+ //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
+ psm.reset();
+ }
+
+ if (psm.getState() == SdlPsm.FINISHED_STATE)
+ {
+ synchronized (TCPTransport.this) {
+ //Log.d(TAG, "Packet formed, sending off");
+ handleReceivedPacket((SdlPacket) psm.getFormedPacket());
+ }
+ //We put a trace statement in the message read so we can avoid all the extra bytes
+ psm.reset();
+ }
+ //FIXME logInfo(String.format("TCPTransport.run: Received %d bytes", bytesRead));
+ }
+ }
+ }
+
+ logInfo("TCPTransport.run: Thread terminated");
+ setCurrentState(TCPTransportState.IDLE);
+ }
+
+ /**
+ * Internal handling of Tcp disconnection
+ */
+ private void internalHandleTCPDisconnect() {
+ if(isHalted){
+ logInfo("TCPTransport.run: TCP disconnect received, but thread already halted");
+ } else {
+ logInfo("TCPTransport.run: TCP disconnect received");
+ disconnect("TCPTransport.run: End of stream reached", null, false);
+ }
+ }
+
+ /**
+ * Internal handling of reading data from input stream
+ */
+ private void internalHandleStreamReadError() {
+ if(isHalted){
+ logError("TCPTransport.run: Exception during reading data, but thread already halted");
+ } else {
+ logError("TCPTransport.run: Exception during reading data");
+ disconnect("Failed to read data from Sdl", new SdlException("Failed to read data from Sdl"
+ , SdlExceptionCause.SDL_CONNECTION_FAILED), false);
+ }
+ }
+ }
+
+ /**
+ * Returns current TCP transport state
+ *
+ * @return current state
+ */
+ private synchronized TCPTransportState getCurrentState() {
+ return mCurrentState;
+ }
+
+ /**
+ * Sets current TCP transport state
+ * @param currentState New state
+ */
+ private synchronized void setCurrentState(TCPTransportState currentState) {
+ logInfo(String.format("Current state changed to: %s", currentState));
+ this.mCurrentState = currentState;
+ }
+
+ /**
+ * Implementation of waiting required delay that cannot be interrupted
+ * @param timeMs Time in milliseconds of required delay
+ */
+ private void waitFor(long timeMs) {
+ long endTime = System.currentTimeMillis() +timeMs;
+ while (System.currentTimeMillis() < endTime) {
+ synchronized (this) {
+ try {
+ wait(endTime - System.currentTimeMillis());
+ } catch (Exception e) {
+ // Nothing To Do, simple wait
+ }
+ }
+ }
+ }
+
+ /**
+ * Defines available states of the TCP transport
+ */
+ private enum TCPTransportState {
+ /**
+ * TCP transport is created. No connection opened
+ */
+ IDLE,
+
+ /**
+ * TCP transport is in progress of establishing connection.
+ */
+ CONNECTING,
+
+ /**
+ * TCP transport is connected to SmartDeviceLink core
+ */
+ CONNECTED,
+
+ /**
+ * TCP transport is in progress of disconnecting
+ */
+ DISCONNECTING
+ }
+
+ @Override
+ public String getBroadcastComment() {
+ return "";
+ }
+} // end-class
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportConfig.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportConfig.java
new file mode 100644
index 000000000..790aa0935
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportConfig.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.transport.enums.TransportType;
+
+/**
+ * Container of TCP transport specific configuration.
+ */
+public final class TCPTransportConfig extends BaseTransportConfig {
+
+ /**
+ * Value of port to use in TCP connection.
+ */
+ private final int mPort;
+
+ /**
+ * Value of IP address to use in TCP connection.
+ */
+ private final String mIpAddress;
+
+ /**
+ * Value of flag which is set to true if tcp connection must be automatically reestablished in case of disconnection
+ */
+ private final boolean mAutoReconnect;
+
+ /**
+ * Constructor. Objects of this class must be created for known port and IP address value.
+ *
+ * @param port Port for TCP connection.
+ * @param ipAddress IP address for TCP connection.
+ * @param autoReconnect Flag which must be set to true if tcp connection must be automatically reestablished in
+ * case of disconnection
+ */
+ public TCPTransportConfig(int port, String ipAddress, boolean autoReconnect) {
+ mPort = port;
+ mIpAddress = ipAddress;
+ mAutoReconnect = autoReconnect;
+ }
+
+ /**
+ * Gets value of Port.
+ *
+ * @return Port for TCP connection.
+ */
+ public int getPort() {
+ return mPort;
+ }
+
+ /**
+ * Gets value of IP address.
+ *
+ * @return IP address for TCP connection.
+ */
+ public String getIPAddress() {
+ return mIpAddress;
+ }
+
+ /**
+ * Gets value of AutoReconnect
+ * @return Flag that determines automatic reconnection
+ */
+ public boolean getAutoReconnect() {
+ return mAutoReconnect;
+ }
+
+ /**
+ * Overridden abstract method which returns specific type of this transport configuration.
+ *
+ * @return Constant value TransportType.TCP.
+ *
+ * @see TransportType
+ */
+ public TransportType getTransportType() {
+ return TransportType.TCP;
+ }
+
+ @Override
+ public String toString() {
+ return "TCPTransportConfig{" +
+ "Port=" + mPort +
+ ", IpAddress='" + mIpAddress + '\'' +
+ ", AutoReconnect=" + mAutoReconnect +
+ '}';
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java
new file mode 100644
index 000000000..0ab335bf9
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java
@@ -0,0 +1,823 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.annotation.SuppressLint;
+import android.app.ActivityManager;
+import android.app.ActivityManager.RunningServiceInfo;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.Parcelable;
+import android.os.RemoteException;
+import android.os.TransactionTooLargeException;
+import android.util.Log;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.ByteAraryMessageAssembler;
+import com.smartdevicelink.transport.utl.ByteArrayMessageSpliter;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import java.lang.ref.WeakReference;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+
+public class TransportBroker {
+
+ private static final String TAG = "SdlTransportBroker";
+
+ /**
+ * See version document included with library
+ */
+ private static final int MAX_MESSAGING_VERSION = 2;
+ private static final int MIN_MESSAGING_VERSION = 1;
+
+ /** Version of the router service that supports the new additional transports (USB and TCP) */
+ private static final int RS_MULTI_TRANSPORT_SUPPORT = 8;
+ private static final TransportRecord LEGACY_TRANSPORT_RECORD = new TransportRecord(TransportType.BLUETOOTH,null);
+
+ private final String WHERE_TO_REPLY_PREFIX = "com.sdl.android.";
+ private String appId = null;
+ private String whereToReply = null;
+ private Context currentContext = null;
+
+ private final Object INIT_LOCK = new Object();
+
+ private TransportType queuedOnTransportConnect = null;
+
+ Messenger routerServiceMessenger = null;
+ final Messenger clientMessenger;
+
+ boolean isBound = false, registeredWithRouterService = false;
+ private String routerPackage = null, routerClassName = null;
+ private ComponentName routerService = null;
+
+
+ private SdlPacket bufferedPacket = null;
+ private ByteAraryMessageAssembler bufferedPayloadAssembler = null;
+
+ private ServiceConnection routerConnection;
+ private int routerServiceVersion = 1;
+ private int messagingVersion = MAX_MESSAGING_VERSION;
+
+ private void initRouterConnection() {
+ routerConnection = new ServiceConnection() {
+
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ Log.d(TAG, "Bound to service " + className.toString());
+ routerServiceMessenger = new Messenger(service);
+ isBound = true;
+ //So we just established our connection
+ //Register with router service
+ sendRegistrationMessage();
+ }
+
+ public void onServiceDisconnected(ComponentName className) {
+ Log.d(TAG, "Unbound from service " + className.getClassName());
+ routerServiceMessenger = null;
+ registeredWithRouterService = false;
+ unBindFromRouterService();
+ isBound = false;
+ onHardwareDisconnected(null, null);
+ }
+ };
+ }
+
+ protected synchronized boolean sendMessageToRouterService(Message message) {
+ return sendMessageToRouterService(message, 0);
+ }
+
+ protected synchronized boolean sendMessageToRouterService(Message message, int retryCount) {
+ if (message == null) {
+ Log.w(TAG, "Attempted to send null message");
+ return false;
+ }
+ //Log.i(TAG, "Attempting to send message type - " + message.what);
+ if (isBound && routerServiceMessenger != null) {
+ if (registeredWithRouterService
+ || message.what == TransportConstants.ROUTER_REGISTER_CLIENT) { //We can send a message if we are registered or are attempting to register
+ try {
+ routerServiceMessenger.send(message);
+ return true;
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ //Let's check to see if we should retry
+ if (e instanceof TransactionTooLargeException
+ || (retryCount < 5 && routerServiceMessenger.getBinder().isBinderAlive() && routerServiceMessenger.getBinder().pingBinder())) { //We probably just failed on a small transaction =\
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e1) {
+ e1.printStackTrace();
+ }
+ return sendMessageToRouterService(message, retryCount++);
+ } else {
+ //DeadObject, time to kill our connection
+ Log.d(TAG, "Dead object while attempting to send packet");
+ routerServiceMessenger = null;
+ registeredWithRouterService = false;
+ isBound = false;
+ onHardwareDisconnected(null, null);
+ return false;
+ }
+ } catch (NullPointerException e) {
+ Log.d(TAG, "Null messenger while attempting to send packet"); // NPE, routerServiceMessenger is null
+ routerServiceMessenger = null;
+ registeredWithRouterService = false;
+ isBound = false;
+ onHardwareDisconnected(null, null);
+ return false;
+ }
+ } else {
+ Log.e(TAG, "Unable to send message to router service. Not registered.");
+ return false;
+ }
+ } else {
+ Log.e(TAG, "Unable to send message to router service. Not bound.");
+ return false;
+ }
+ }
+
+
+ /**
+ * Handler of incoming messages from service.
+ */
+ static class ClientHandler extends Handler {
+ ClassLoader loader;
+ final WeakReference<TransportBroker> provider;
+
+ public ClientHandler(TransportBroker provider) {
+ this.provider = new WeakReference<TransportBroker>(provider);
+ loader = getClass().getClassLoader();
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ TransportBroker broker = provider.get();
+ if (broker == null) {
+ Log.e(TAG, "Broker object null, unable to process message");
+ return;
+ }
+ Bundle bundle = msg.getData();
+
+ if (bundle != null) {
+ bundle.setClassLoader(loader);
+ }
+ //Log.d(TAG, "Bundle: " + bundle.toString());
+ /* DO NOT MOVE
+ * This needs to be first to make sure we already know if we are attempting to enter legacy mode or not
+ */
+ if (bundle != null
+ && bundle.containsKey(TransportConstants.ENABLE_LEGACY_MODE_EXTRA)) {
+ boolean enableLegacy = bundle.getBoolean(TransportConstants.ENABLE_LEGACY_MODE_EXTRA, false);
+ broker.enableLegacyMode(enableLegacy);
+ }
+
+ //Find out what message we have and what to do with it
+ switch (msg.what) {
+ case TransportConstants.ROUTER_REGISTER_CLIENT_RESPONSE:
+ switch (msg.arg1) {
+ case TransportConstants.REGISTRATION_RESPONSE_SUCESS:
+ // yay! we have been registered. Now what?
+ broker.registeredWithRouterService = true;
+ if (bundle != null) {
+
+ if (bundle.containsKey(TransportConstants.ROUTER_SERVICE_VERSION)) {
+ broker.routerServiceVersion = bundle.getInt(TransportConstants.ROUTER_SERVICE_VERSION);
+ }
+
+ if (bundle.containsKey(TransportConstants.HARDWARE_CONNECTED) || bundle.containsKey(TransportConstants.CURRENT_HARDWARE_CONNECTED)) {
+ //A connection is already available
+ handleConnectionEvent(bundle, broker);
+ }
+
+ }
+ break;
+ case TransportConstants.REGISTRATION_RESPONSE_DENIED_LEGACY_MODE_ENABLED:
+ Log.d(TAG, "Denied registration because router is in legacy mode");
+ broker.registeredWithRouterService = false;
+ broker.enableLegacyMode(true);
+ //We call this so we can start the process of legacy connection
+ //onHardwareDisconnected(TransportType.BLUETOOTH);
+ broker.onLegacyModeEnabled();
+ break;
+ default:
+ broker.registeredWithRouterService = false;
+ Log.w(TAG, "Registration denied from router service. Reason - " + msg.arg1);
+ break;
+ }
+ ;
+
+
+ break;
+ case TransportConstants.ROUTER_UNREGISTER_CLIENT_RESPONSE:
+ if (msg.arg1 == TransportConstants.UNREGISTRATION_RESPONSE_SUCESS) {
+ // We've been unregistered. Now what?
+
+
+ } else { //We were denied our unregister request to the router service, let's see why
+ Log.w(TAG, "Unregister request denied from router service. Reason - " + msg.arg1);
+ //Do we care?
+ }
+
+ break;
+ case TransportConstants.ROUTER_RECEIVED_PACKET:
+ //So the intent has a packet with it. PEFRECT! Let's send it through the library
+ int flags = bundle.getInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_NONE);
+
+ if (bundle.containsKey(TransportConstants.FORMED_PACKET_EXTRA_NAME)) {
+ SdlPacket packet = bundle.getParcelable(TransportConstants.FORMED_PACKET_EXTRA_NAME);
+
+ if (flags == TransportConstants.BYTES_TO_SEND_FLAG_NONE) {
+ if (packet != null) { //Log.i(TAG, "received packet to process "+ packet.toString());
+
+ if(packet.getTransportRecord() == null){
+ // If the transport record is null, one must be added
+ // This is likely due to an older router service being used
+ // in which only a bluetooth transport is available
+ packet.setTransportRecord(LEGACY_TRANSPORT_RECORD);
+ }
+
+ broker.onPacketReceived(packet);
+ } else {
+ Log.w(TAG, "Received null packet from router service, not passing along");
+ }
+ } else if (flags == TransportConstants.BYTES_TO_SEND_FLAG_SDL_PACKET_INCLUDED) {
+ broker.bufferedPacket = (SdlPacket) packet;
+ if (broker.bufferedPayloadAssembler != null) {
+ broker.bufferedPayloadAssembler.close();
+ broker.bufferedPayloadAssembler = null;
+ }
+
+ broker.bufferedPayloadAssembler = new ByteAraryMessageAssembler();
+ broker.bufferedPayloadAssembler.init();
+ }
+ } else if (bundle.containsKey(TransportConstants.BYTES_TO_SEND_EXTRA_NAME)) {
+ //This should contain the payload
+ if (broker.bufferedPayloadAssembler != null) {
+ byte[] chunk = bundle.getByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME);
+ if (!broker.bufferedPayloadAssembler.handleMessage(flags, chunk)) {
+ //If there was a problem
+ Log.e(TAG, "Error handling bytes for split packet");
+ }
+ if (broker.bufferedPayloadAssembler.isFinished()) {
+ broker.bufferedPacket.setPayload(broker.bufferedPayloadAssembler.getBytes());
+
+ broker.bufferedPayloadAssembler.close();
+ broker.bufferedPayloadAssembler = null;
+ broker.onPacketReceived(broker.bufferedPacket);
+ broker.bufferedPacket = null;
+ }
+ }
+ //}
+ //}
+ } else {
+ Log.w(TAG, "Flase positive packet reception");
+ }
+ break;
+ case TransportConstants.HARDWARE_CONNECTION_EVENT:
+ if (bundle.containsKey(TransportConstants.TRANSPORT_DISCONNECTED)
+ || bundle.containsKey(TransportConstants.HARDWARE_DISCONNECTED)) {
+ //We should shut down, so call
+ Log.d(TAG, "Hardware disconnected");
+ if (isLegacyModeEnabled()) {
+ broker.onLegacyModeEnabled();
+ } else {
+ if (bundle.containsKey(TransportConstants.TRANSPORT_DISCONNECTED)) {
+ TransportRecord disconnectedTransport = bundle.getParcelable(TransportConstants.TRANSPORT_DISCONNECTED);
+ List<TransportRecord> connectedTransports = bundle.getParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED);
+ broker.onHardwareDisconnected(disconnectedTransport, connectedTransports);
+ } else { //bundle contains key TransportConstants.HARDWARE_DISCONNECTED
+ // Since this is an older router service it can be assumed that the
+ // transport is bluetooth
+ broker.onHardwareDisconnected(LEGACY_TRANSPORT_RECORD, null);
+ }
+
+
+ }
+ break;
+ }
+
+ if (bundle.containsKey(TransportConstants.HARDWARE_CONNECTED) || bundle.containsKey(TransportConstants.CURRENT_HARDWARE_CONNECTED)) {
+ //This is a connection event
+ handleConnectionEvent(bundle,broker);
+ break;
+ }
+ break;
+ default:
+ super.handleMessage(msg);
+ }
+
+ }
+
+ /**
+ * Handle a potential connection event. This will adapt legacy router service implementaions
+ * into the new multiple transport scheme.
+ * @param bundle the received bundle from the router service
+ * @param broker reference to the transport broker that this handler exists
+ * @return if a connection event was triggered in the supplied broker
+ */
+ private boolean handleConnectionEvent(Bundle bundle, TransportBroker broker){
+ if (broker.routerServiceVersion < RS_MULTI_TRANSPORT_SUPPORT) {
+ //Previous versions of the router service only supports a single
+ //transport, so this will be the only extra received
+ if (bundle.containsKey(TransportConstants.HARDWARE_CONNECTED)) {
+ // Only bluetooth was a supported transport on previous versions of the router
+ // service so the constant legacy bluetooth transport record will be used.
+ broker.onHardwareConnected(Collections.singletonList(LEGACY_TRANSPORT_RECORD));
+ return true;
+ }
+ } else{
+ //Router service supports multiple transport
+
+ if (bundle.containsKey(TransportConstants.CURRENT_HARDWARE_CONNECTED)) {
+ ArrayList<TransportRecord> transports = bundle.getParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED);
+ broker.onHardwareConnected(transports);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ }
+
+
+ /***************************************************************************************************************************************
+ *********************************************** Life Cycle **************************************************************
+ ****************************************************************************************************************************************/
+
+
+ @SuppressLint("SimpleDateFormat")
+ public TransportBroker(Context context, String appId, ComponentName service) {
+ synchronized (INIT_LOCK) {
+ clientMessenger = new Messenger(new ClientHandler(this));
+ initRouterConnection();
+ //So the user should have set the AppId, lets define where the intents need to be sent
+ SimpleDateFormat s = new SimpleDateFormat("hhmmssss"); //So we have a time stamp of the event
+ String timeStamp = s.format(new Date(System.currentTimeMillis()));
+ if (whereToReply == null) {
+ if (appId == null) { //This should really just throw an error
+ whereToReply = WHERE_TO_REPLY_PREFIX + "." + timeStamp;
+ } else {
+ whereToReply = WHERE_TO_REPLY_PREFIX + appId + "." + timeStamp;
+ }
+ }
+ //this.appId = appId.concat(timeStamp);
+ this.appId = appId;
+ queuedOnTransportConnect = null;
+ currentContext = context;
+ //Log.d(TAG, "Registering our reply receiver: " + whereToReply);
+ this.routerService = service;
+ }
+ }
+
+ /**
+ * This beings the initial connection with the router service.
+ */
+ public boolean start() {
+ //Log.d(TAG, "Starting up transport broker for " + whereToReply);
+ synchronized (INIT_LOCK) {
+ if (currentContext == null) {
+ throw new IllegalStateException("This instance can't be started since it's local reference of context is null. Ensure when suppling a context to the TransportBroker that it is valid");
+ }
+ if (routerConnection == null) {
+ initRouterConnection();
+ }
+ //Log.d(TAG, "Registering our reply receiver: " + whereToReply);
+ if (!isBound) {
+ return registerWithRouterService();
+ } else {
+ return false;
+ }
+ }
+ }
+
+ public void resetSession() {
+ synchronized (INIT_LOCK) {
+ unregisterWithRouterService();
+ routerServiceMessenger = null;
+ queuedOnTransportConnect = null;
+ unBindFromRouterService();
+ isBound = false;
+ }
+ }
+
+ /**
+ * This method will end our communication with the router service.
+ */
+ public void stop() {
+ //Log.d(TAG, "STOPPING transport broker for " + whereToReply);
+ synchronized (INIT_LOCK) {
+ unregisterWithRouterService();
+ unBindFromRouterService();
+ routerServiceMessenger = null;
+ queuedOnTransportConnect = null;
+ currentContext = null;
+
+ }
+ }
+
+ private synchronized void unBindFromRouterService() {
+ try {
+ if (isBound && getContext() != null && routerConnection != null) {
+ getContext().unbindService(routerConnection);
+ isBound = false;
+ } else {
+ Log.w(TAG, "Unable to unbind from router service. bound? " + isBound + " context? " + (getContext()!=null) + " router connection?" + (routerConnection != null));
+ }
+
+ } catch (IllegalArgumentException e) {
+ //This is ok
+ }
+ }
+
+ /***************************************************************************************************************************************
+ *********************************************** Event Callbacks **************************************************************
+ ****************************************************************************************************************************************/
+
+
+ public void onServiceUnregsiteredFromRouterService(int unregisterCode) {
+ queuedOnTransportConnect = null;
+ }
+
+ @Deprecated
+ public void onHardwareDisconnected(TransportType type) {
+ routerServiceDisconnect();
+ }
+
+ public void onHardwareDisconnected(TransportRecord record, List<TransportRecord> connectedTransports) {
+
+ }
+
+ private void routerServiceDisconnect() {
+ synchronized (INIT_LOCK) {
+ unBindFromRouterService();
+ routerServiceMessenger = null;
+ routerConnection = null;
+ queuedOnTransportConnect = null;
+ }
+ }
+
+ /**
+ * WILL NO LONGER BE CALLED
+ *
+ * @param type
+ * @return
+ */
+ @Deprecated
+ public boolean onHardwareConnected(TransportType type) {
+ synchronized (INIT_LOCK) {
+ if (routerServiceMessenger == null) {
+ queuedOnTransportConnect = type;
+ return false;
+ }
+ return true;
+ }
+ }
+
+ public boolean onHardwareConnected(List<TransportRecord> transports) {
+ synchronized (INIT_LOCK) {
+ if (routerServiceMessenger == null && transports != null && transports.size() > 0) {
+ queuedOnTransportConnect = transports.get(transports.size() - 1).getType();
+ return false;
+ }
+ return true;
+ }
+ }
+
+ public void onPacketReceived(Parcelable packet) {
+
+ }
+
+ public void onLegacyModeEnabled() {
+
+ }
+
+ protected int getRouterServiceVersion(){
+ return routerServiceVersion;
+ }
+
+ /**
+ * We want to check to see if the Router service is already up and running
+ *
+ * @param context
+ * @return
+ */
+ private boolean isRouterServiceRunning(Context context) {
+ if (context == null) {
+
+ return false;
+ }
+ ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+ for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
+ //We will check to see if it contains this name, should be pretty specific
+ if ((service.service.getClassName()).toLowerCase(Locale.US).contains(SdlBroadcastReceiver.SDL_ROUTER_SERVICE_CLASS_NAME)) {
+ this.routerClassName = service.service.getClassName();
+ this.routerPackage = service.service.getPackageName();
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ public boolean sendPacketToRouterService(SdlPacket packet) { //We use ints because that is all that is supported by the outputstream class
+ //Log.d(TAG,whereToReply + "Sending packet to router service");
+
+ if (routerServiceMessenger == null) {
+ Log.d(TAG, whereToReply + " tried to send packet, but no where to send");
+ return false;
+ }
+ if (packet == null
+ //|| offset<0
+ //|| count<0
+ ) {//|| count>(bytes.length-offset)){
+ Log.w(TAG, whereToReply + "incorrect params supplied");
+ return false;
+ }
+ byte[] bytes = packet.constructPacket();
+ if (bytes.length < ByteArrayMessageSpliter.MAX_BINDER_SIZE) {//Determine if this is under the packet length.
+ Message message = Message.obtain(); //Do we need to always obtain new? or can we just swap bundles?
+ message.what = TransportConstants.ROUTER_SEND_PACKET;
+ Bundle bundle = new Bundle();
+ if (routerServiceVersion < TransportConstants.RouterServiceVersions.APPID_STRING) {
+ bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId));
+ }
+ bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
+ bundle.putByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME, bytes); //Do we just change this to the args and objs
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, 0);
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, bytes.length);
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_NONE);
+ bundle.putInt(TransportConstants.PACKET_PRIORITY_COEFFICIENT, packet.getPrioirtyCoefficient());
+ if (packet.getTransportRecord() != null) {
+ //Log.d(TAG, "Sending packet on transport " + packet.getTransportType().name());
+ TransportRecord record = packet.getTransportRecord();
+ bundle.putString(TransportConstants.TRANSPORT_TYPE, record.getType().name());
+ bundle.putString(TransportConstants.TRANSPORT_ADDRESS, record.getAddress());
+ } else {
+ //Log.d(TAG, "No transport to be found");
+ }
+ message.setData(bundle);
+
+ sendMessageToRouterService(message);
+ return true;
+ } else { //Message is too big for IPC transaction
+ //Log.w(TAG, "Message too big for single IPC transaction. Breaking apart. Size - " + bytes.length);
+ ByteArrayMessageSpliter splitter = new ByteArrayMessageSpliter(appId, TransportConstants.ROUTER_SEND_PACKET, bytes, packet.getPrioirtyCoefficient());
+ splitter.setRouterServiceVersion(routerServiceVersion);
+ splitter.setTransportRecord(packet.getTransportRecord());
+ while (splitter.isActive()) {
+ sendMessageToRouterService(splitter.nextMessage());
+ }
+ return splitter.close();
+ }
+
+ }
+
+ /**
+ * This registers this service with the router service
+ */
+ private boolean registerWithRouterService() {
+ if (getContext() == null) {
+ Log.e(TAG, "Context set to null, failing out");
+ return false;
+ }
+
+ if (routerServiceMessenger != null) {
+ Log.w(TAG, "Already registered with router service");
+ return false;
+ }
+ //Make sure we know where to bind to
+ if (this.routerService == null) {
+ if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.O) && !isRouterServiceRunning(getContext())) {//We should be able to ignore this case because of the validation now
+ Log.d(TAG, whereToReply + " found no router service. Shutting down.");
+ this.onHardwareDisconnected(null);
+ return false;
+ }
+ } else {//We were already told where to bind. This should be the case.
+ this.routerClassName = this.routerService.getClassName();
+ this.routerPackage = this.routerService.getPackageName();
+ }
+
+ if (!sendBindingIntent()) {
+ Log.e(TAG, "Something went wrong while trying to bind with the router service.");
+ SdlBroadcastReceiver.queryForConnectedService(currentContext);
+ return false;
+ }
+ return true;
+
+ }
+
+ @SuppressLint("InlinedApi")
+ private boolean sendBindingIntent() {
+ if(this.isBound){
+ Log.e(TAG, "Already bound");
+ return false;
+ }
+ if (this.routerPackage != null && this.routerClassName != null) {
+ Log.d(TAG, "Sending bind request to " + this.routerPackage + " - " + this.routerClassName);
+ Intent bindingIntent = new Intent();
+ bindingIntent.setClassName(this.routerPackage, this.routerClassName);//This sets an explicit intent
+ //Quickly make sure it's just up and running
+ getContext().startService(bindingIntent);
+ bindingIntent.setAction(TransportConstants.BIND_REQUEST_TYPE_CLIENT);
+ return getContext().bindService(bindingIntent, routerConnection, Context.BIND_AUTO_CREATE);
+ } else {
+ return false;
+ }
+ }
+
+ private void sendRegistrationMessage() {
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_REGISTER_CLIENT;
+ msg.replyTo = this.clientMessenger;
+ Bundle bundle = new Bundle();
+ bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId)); //We send this no matter what due to us not knowing what router version we are connecting to
+ bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
+ bundle.putInt(TransportConstants.ROUTER_MESSAGING_VERSION, messagingVersion);
+ msg.setData(bundle);
+ sendMessageToRouterService(msg);
+ }
+
+ private void unregisterWithRouterService() {
+ Log.i(TAG, "Attempting to unregister with Sdl Router Service");
+ if (isBound && routerServiceMessenger != null) {
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_UNREGISTER_CLIENT;
+ msg.replyTo = this.clientMessenger; //Including this in case this app isn't actually registered with the router service
+ Bundle bundle = new Bundle();
+ if (routerServiceVersion < TransportConstants.RouterServiceVersions.APPID_STRING) {
+ bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId));
+ }
+ bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
+ msg.setData(bundle);
+ sendMessageToRouterService(msg);
+ } else {
+ Log.w(TAG, "Unable to unregister, not bound to router service");
+ }
+
+ routerServiceMessenger = null;
+ }
+
+ protected ComponentName getRouterService() {
+ return this.routerService;
+ }
+
+ /**
+ * Since it doesn't always make sense to add another service, use this method to get
+ * the appropriate context that the rest of this class is using.
+ *
+ * @return The currently used context for this class
+ */
+ private Context getContext() {
+ return currentContext;
+ }
+
+
+ public static Long convertAppId(String appId) {
+ if (appId == null) {
+ return -1L;
+ }
+ try {
+ return Long.valueOf(appId);
+ } catch (NumberFormatException e) {
+ return -1L;
+ }
+ }
+
+ /***************************************************************************************************************************************
+ *********************************************** LEGACY *******************************************************************************
+ ****************************************************************************************************************************************/
+ /*
+ * Due to old implementations of SDL/Applink, old versions can't support multiple sessions per RFCOMM channel.
+ * This causes a race condition in the router service where only the first app registered will be able to communicate with the
+ * head unit. With this additional code, the router service will:
+ * 1) Acknowledge it's connected to an old system
+ * 2) d/c its bluetooth
+ * 3) Send a message to all clients connected that legacy mode is enabled
+ * 4) Each client spins up their own bluetooth RFCOMM listening channel
+ * 5) Head unit will need to query apps again
+ * 6) HU should then connect to each app by their own RFCOMM channel bypassing the router service
+ * 7) When the phone is D/C from the head unit the router service will reset and tell clients legacy mode is now off
+ */
+
+ private static boolean legacyModeEnabled = false;
+ private static Object LEGACY_LOCK = new Object();
+
+ protected void enableLegacyMode(boolean enable) {
+ synchronized (LEGACY_LOCK) {
+ legacyModeEnabled = enable;
+ }
+ }
+
+ protected static boolean isLegacyModeEnabled() {
+ synchronized (LEGACY_LOCK) {
+ return legacyModeEnabled;
+ }
+
+ }
+
+ /***************************************************************************************************************************************
+ **************************************************** LEGACY END ***********************************************************************
+ ****************************************************************************************************************************************/
+
+ /**
+ * Use this method to let the router service know that you are requesting a new session from the head unit.
+ */
+ @Deprecated
+ public void requestNewSession() {
+ requestNewSession(null);
+ }
+
+ public void requestNewSession(TransportRecord transportRecord) {
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_REQUEST_NEW_SESSION;
+ msg.replyTo = this.clientMessenger; //Including this in case this app isn't actually registered with the router service
+ Bundle bundle = new Bundle();
+ if (routerServiceVersion < TransportConstants.RouterServiceVersions.APPID_STRING) {
+ bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId));
+ }
+ bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
+ if (transportRecord != null) {
+ bundle.putString(TransportConstants.TRANSPORT_TYPE, transportRecord.getType().name());
+ bundle.putString(TransportConstants.TRANSPORT_ADDRESS, transportRecord.getAddress());
+ }
+ msg.setData(bundle);
+ this.sendMessageToRouterService(msg);
+ }
+
+ /**
+ * Request secondary transport and communicate details to router service
+ *
+ * @param sessionId
+ * @param bundle
+ */
+ public void requestSecondaryTransportConnection(byte sessionId, Bundle bundle) {
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_REQUEST_SECONDARY_TRANSPORT_CONNECTION;
+ msg.replyTo = this.clientMessenger;
+ if (bundle == null) {
+ bundle = new Bundle();
+ }
+ bundle.putByte(TransportConstants.SESSION_ID_EXTRA, sessionId);
+ msg.setData(bundle);
+ this.sendMessageToRouterService(msg);
+ }
+
+
+ public void removeSession(long sessionId) {
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.ROUTER_REMOVE_SESSION;
+ msg.replyTo = this.clientMessenger; //Including this in case this app isn't actually registered with the router service
+ Bundle bundle = new Bundle();
+ if (routerServiceVersion < TransportConstants.RouterServiceVersions.APPID_STRING) {
+ bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId));
+ }
+ bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
+ bundle.putLong(TransportConstants.SESSION_ID_EXTRA, sessionId);
+ msg.setData(bundle);
+ this.sendMessageToRouterService(msg);
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java
new file mode 100644
index 000000000..ad4b41b84
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java
@@ -0,0 +1,456 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.bluetooth.BluetoothDevice;
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Parcelable;
+import android.util.Log;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.enums.ControlFrameTags;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import java.lang.ref.WeakReference;
+import java.util.List;
+
+@SuppressWarnings("unused")
+public class TransportManager extends TransportManagerBase{
+ private static final String TAG = "TransportManager";
+
+
+ TransportBrokerImpl transport;
+
+ //Legacy Transport
+ MultiplexBluetoothTransport legacyBluetoothTransport;
+ LegacyBluetoothHandler legacyBluetoothHandler;
+
+ final WeakReference<Context> contextWeakReference;
+
+
+ /**
+ * Managing transports
+ * List for status of all transports
+ * If transport is not connected. Request Router service connect to it. Get connected message
+ */
+
+ public TransportManager(MultiplexTransportConfig config, TransportEventListener listener){
+ super(config,listener);
+
+ if(config.service == null) {
+ config.service = SdlBroadcastReceiver.consumeQueuedRouterService();
+ }
+
+ contextWeakReference = new WeakReference<>(config.context);
+
+ RouterServiceValidator validator = new RouterServiceValidator(config);
+ if(validator.validate()){
+ transport = new TransportBrokerImpl(config.context, config.appId,config.service);
+ }else{
+ enterLegacyMode("Router service is not trusted. Entering legacy mode");
+ }
+ }
+
+ @Override
+ public void start(){
+ if(transport != null){
+ transport.start();
+ }else if(legacyBluetoothTransport != null){
+ legacyBluetoothTransport.start();
+ }
+ }
+
+ @Override
+ public void close(long sessionId){
+ if(transport != null) {
+ transport.removeSession(sessionId);
+ transport.stop();
+ }else if(legacyBluetoothTransport != null){
+ legacyBluetoothTransport.stop();
+ legacyBluetoothTransport = null;
+ }
+ }
+
+ @Override
+ @Deprecated
+ public void resetSession(){
+ transport.resetSession();
+ }
+
+ /**
+ * Check to see if a transport is connected.
+ * @param transportType the transport to have its connection status returned. If `null` is
+ * passed in, all transports will be checked and if any are connected a
+ * true value will be returned.
+ * @param address the address associated with the transport type. If null, the first transport
+ * of supplied type will be used to return if connected.
+ * @return if a transport is connected based on included variables
+ */
+ @Override
+ public boolean isConnected(TransportType transportType, String address){
+ synchronized (TRANSPORT_STATUS_LOCK) {
+ if (transportType == null) {
+ return !transportStatus.isEmpty();
+ }
+ for (TransportRecord record : transportStatus) {
+ if (record.getType().equals(transportType)) {
+ if (address != null) {
+ if (address.equals(record.getAddress())) {
+ return true;
+ } // Address doesn't match, move forward
+ } else {
+ //If no address is included, assume any transport of correct type is acceptable
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ }
+ /**
+ * Retrieve a transport record with the supplied params
+ * @param transportType the transport to have its connection status returned.
+ * @param address the address associated with the transport type. If null, the first transport
+ * of supplied type will be returned.
+ * @return the transport record for the transport type and address if supplied
+ */
+ @Override
+ public TransportRecord getTransportRecord(TransportType transportType, String address){
+ synchronized (TRANSPORT_STATUS_LOCK) {
+ if (transportType == null) {
+ return null;
+ }
+ for (TransportRecord record : transportStatus) {
+ if (record.getType().equals(transportType)) {
+ if (address != null) {
+ if (address.equals(record.getAddress())) {
+ return record;
+ } // Address doesn't match, move forward
+ } else {
+ //If no address is included, assume any transport of correct type is acceptable
+ return record;
+ }
+ }
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Retrieves the currently connected transports
+ * @return the currently connected transports
+ */
+ @Override
+ public List<TransportRecord> getConnectedTransports(){
+ return this.transportStatus;
+ }
+
+ @Override
+ public boolean isHighBandwidthAvailable(){
+ synchronized (TRANSPORT_STATUS_LOCK) {
+ for (TransportRecord record : transportStatus) {
+ if (record.getType().equals(TransportType.USB)
+ || record.getType().equals(TransportType.TCP)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ @Override
+ public BaseTransportConfig updateTransportConfig(BaseTransportConfig config){
+ if(transport != null && TransportType.MULTIPLEX.equals(config.getTransportType())){
+ ((MultiplexTransportConfig)config).setService(transport.getRouterService());
+ }
+ return config;
+ }
+
+ @Deprecated
+ public ComponentName getRouterService(){
+ if(transport != null) {
+ return transport.getRouterService();
+ }
+ return null;
+ }
+
+ @Override
+ public void sendPacket(SdlPacket packet){
+ if(transport !=null){
+ transport.sendPacketToRouterService(packet);
+ }else if(legacyBluetoothTransport != null){
+ byte[] data = packet.constructPacket();
+ legacyBluetoothTransport.write(data, 0, data.length);
+ }
+ }
+
+ @Override
+ public void requestNewSession(TransportRecord transportRecord){
+ if(transport != null){
+ transport.requestNewSession(transportRecord);
+ }else if(legacyBluetoothTransport != null){
+ Log.w(TAG, "Session requested for non-bluetooth transport while in legacy mode");
+ }
+ }
+
+ @Deprecated
+ public void requestSecondaryTransportConnection(byte sessionId, Bundle params){
+ transport.requestSecondaryTransportConnection(sessionId, (Bundle)params);
+ }
+
+ @Override
+ public void requestSecondaryTransportConnection(byte sessionId, TransportRecord transportRecord){
+ if(transportRecord != null){
+ Bundle bundle = new Bundle();
+ bundle.putString(TransportConstants.TRANSPORT_TYPE, transportRecord.getType().name());
+ if(transportRecord.getType().equals(TransportType.TCP)) {
+ String address = transportRecord.getAddress();
+ if(address.contains(":")){
+ String[] split = address.split(":");
+ if(split.length == 2) {
+ bundle.putString(ControlFrameTags.RPC.TransportEventUpdate.TCP_IP_ADDRESS, split[0]);
+ bundle.putInt(ControlFrameTags.RPC.TransportEventUpdate.TCP_PORT, Integer.valueOf(split[1]));
+ } //else {something went wrong;}
+ }else{
+ bundle.putString(ControlFrameTags.RPC.TransportEventUpdate.TCP_IP_ADDRESS, address);
+ }
+
+
+ }
+ transport.requestSecondaryTransportConnection(sessionId, bundle);
+ }
+ }
+
+ protected class TransportBrokerImpl extends TransportBroker{
+
+ public TransportBrokerImpl(Context context, String appId, ComponentName routerService){
+ super(context,appId,routerService);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ @Deprecated
+ public boolean onHardwareConnected(TransportType transportType){
+ return false;
+ }
+
+ @Override
+ public boolean onHardwareConnected(List<TransportRecord> transports) {
+ super.onHardwareConnected(transports);
+ synchronized (TRANSPORT_STATUS_LOCK){
+ transportStatus.clear();
+ transportStatus.addAll(transports);
+ }
+ transportListener.onTransportConnected(transports);
+ return true;
+ }
+
+
+ @Override
+ public void onHardwareDisconnected(TransportRecord record, List<TransportRecord> connectedTransports) {
+ if(record != null){
+ Log.d(TAG, "Transport disconnected - " + record);
+ }else{
+ Log.d(TAG, "Transport disconnected");
+
+ }
+
+ synchronized (TRANSPORT_STATUS_LOCK){
+ boolean wasRemoved = TransportManager.this.transportStatus.remove(record);
+ //Might check connectedTransports vs transportStatus to ensure they are equal
+
+ //If the transport wasn't removed, check RS version for corner case
+ if(!wasRemoved && getRouterServiceVersion() == 8){
+ boolean foundMatch = false;
+ //There is an issue in the first gen of multi transport router services that
+ //will remove certain extras from messages to the TransportBroker if older apps
+ //are connected that do not support the multi transport messages. Because of
+ //that, we check the records we have and if the transport matches we assume it
+ //was the original transport that was received regardless of the address.
+ TransportType disconnectedTransportType = record.getType();
+ if(disconnectedTransportType != null) {
+ for (TransportRecord transportRecord : TransportManager.this.transportStatus) {
+ if (disconnectedTransportType.equals(transportRecord.getType())) {
+ //The record stored in the TM will contain the actual record the
+ //protocol layer used during the transport connection event
+ record = transportRecord;
+ foundMatch = true;
+ break;
+ }
+ }
+
+ if (foundMatch) { //Remove item after the loop to avoid concurrent modifications
+ TransportManager.this.transportStatus.remove(record);
+ Log.d(TAG, "Handling corner case of transport disconnect mismatch");
+ }
+ }
+ }
+ }
+
+ if(isLegacyModeEnabled()
+ && record != null
+ && TransportType.BLUETOOTH.equals(record.getType()) //Make sure it's bluetooth that has be d/c
+ && legacyBluetoothTransport == null){ //Make sure we aren't already in legacy mode
+ //Legacy mode has been enabled so we need to cycle
+ enterLegacyMode("Router service has enabled legacy mode");
+ }else{
+ //Inform the transport listener that a transport has disconnected
+ transportListener.onTransportDisconnected("", record, connectedTransports);
+ }
+ }
+
+ @Override
+ public void onPacketReceived(Parcelable packet) {
+ if(packet!=null){
+ transportListener.onPacketReceived((SdlPacket)packet);
+ }
+ }
+ }
+
+ @Override
+ synchronized void enterLegacyMode(final String info){
+ if(legacyBluetoothTransport != null && legacyBluetoothHandler != null){
+ return; //Already in legacy mode
+ }
+
+ if(transportListener.onLegacyModeEnabled(info)) {
+ if(Looper.myLooper() == null){
+ Looper.prepare();
+ }
+ legacyBluetoothHandler = new LegacyBluetoothHandler(this);
+ legacyBluetoothTransport = new MultiplexBluetoothTransport(legacyBluetoothHandler);
+ if(contextWeakReference.get() != null){
+ contextWeakReference.get().registerReceiver(legacyDisconnectReceiver,new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED) );
+ }
+ }else{
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ transportListener.onError(info + " - Legacy mode unacceptable; shutting down.");
+
+ }
+ },500);
+ }
+ }
+
+ @Override
+ synchronized void exitLegacyMode(String info ){
+ TransportRecord legacyTransportRecord = null;
+ if(legacyBluetoothTransport != null){
+ legacyTransportRecord = legacyBluetoothTransport.getTransportRecord();
+ legacyBluetoothTransport.stop();
+ legacyBluetoothTransport = null;
+ }
+ legacyBluetoothHandler = null;
+ synchronized (TRANSPORT_STATUS_LOCK){
+ TransportManager.this.transportStatus.clear();
+ }
+ if(contextWeakReference !=null){
+ try{
+ contextWeakReference.get().unregisterReceiver(legacyDisconnectReceiver);
+ }catch (Exception e){}
+ }
+ transportListener.onTransportDisconnected(info, legacyTransportRecord,null);
+ }
+
+
+ private BroadcastReceiver legacyDisconnectReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if(intent != null){
+ if(BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(intent.getAction())){
+ exitLegacyMode("Bluetooth disconnected");
+ }
+ }
+ }
+ };
+
+ protected static class LegacyBluetoothHandler extends Handler{
+
+ final WeakReference<TransportManager> provider;
+
+ public LegacyBluetoothHandler(TransportManager provider){
+ this.provider = new WeakReference<>(provider);
+ }
+ @Override
+ public void handleMessage(Message msg) {
+ if(this.provider.get() == null){
+ return;
+ }
+ TransportManager service = this.provider.get();
+ if(service.transportListener == null){
+ return;
+ }
+ switch (msg.what) {
+ case SdlRouterService.MESSAGE_STATE_CHANGE:
+ switch (msg.arg1) {
+ case MultiplexBaseTransport.STATE_CONNECTED:
+ synchronized (service.TRANSPORT_STATUS_LOCK){
+ service.transportStatus.clear();
+ service.transportStatus.add(service.legacyBluetoothTransport.getTransportRecord());
+ }
+ service.transportListener.onTransportConnected(service.transportStatus);
+ break;
+ case MultiplexBaseTransport.STATE_CONNECTING:
+ // Currently attempting to connect - update UI?
+ break;
+ case MultiplexBaseTransport.STATE_LISTEN:
+ break;
+ case MultiplexBaseTransport.STATE_NONE:
+ // We've just lost the connection
+ service.exitLegacyMode("Lost connection");
+ break;
+ case MultiplexBaseTransport.STATE_ERROR:
+ Log.d(TAG, "Bluetooth serial server error received, setting state to none, and clearing local copy");
+ service.exitLegacyMode("Transport error");
+ break;
+ }
+ break;
+
+ case SdlRouterService.MESSAGE_READ:
+ service.transportListener.onPacketReceived((SdlPacket) msg.obj);
+ break;
+ }
+ }
+ }
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java
new file mode 100644
index 000000000..878715147
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.hardware.usb.UsbAccessory;
+import android.hardware.usb.UsbManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.support.annotation.RequiresApi;
+import android.util.Log;
+
+import com.smartdevicelink.util.AndroidTools;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.SdlAppInfo;
+import com.smartdevicelink.util.ServiceFinder;
+
+import java.util.List;
+import java.util.Vector;
+
+import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
+
+/**
+ * The USBAccessoryAttachmentActivity is a proxy to listen for
+ * USB_ACCESSORY_ATTACHED intents.
+ * <br><br>
+ * Unfortunately, the USB_ACCESSORY_ATTACHED intent can only be sent to an
+ * activity. So this class is a workaround to get that intent.
+ * <br><br>
+ * Some reference: http://stackoverflow.com/questions/6981736/android-3-1-usb-host-broadcastreceiver-does-not-receive-usb-device-attached/9814826#9814826
+ * <br><br>
+ * Inspired by OpenXC-Android: https://github.com/openxc/openxc-android
+ * <br><br>
+ * <strong>NOTE:</strong> An application that wants to use USB transport
+ * must make the following changes to AndroidManifest.xml:
+ * <br><br>
+ * <b>1.</b> Add these lines to the {@literal <manifest>…</manifest>} scope:<br>
+ * <pre>{@code
+ * <!-- Required to use the USB Accessory mode -->
+ * <uses-feature android:name="android.hardware.usb.accessory"/>
+ * }</pre>
+ * <b>2.</b> Add these lines to the {@literal <application>…</application>} scope:
+ * <pre>{@code <activity android:name="com.smartdevicelink.transport.USBAccessoryAttachmentActivity">
+ * <intent-filter>
+ * <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"/>
+ * </intent-filter>
+ * <meta-data
+ * android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
+ * android:resource="@xml/accessory_filter"/>
+ * </activity>
+ * }</pre>
+ * <b>3.</b> Set minimum SDK version to 12:
+ * <pre>{@code <uses-sdk android:minSdkVersion="12"/>}</pre>
+ */
+@RequiresApi(12)
+public class USBAccessoryAttachmentActivity extends Activity {
+
+ private static final String TAG = USBAccessoryAttachmentActivity.class.getSimpleName();
+ private static final int USB_SUPPORTED_ROUTER_SERVICE_VERSION = 8;
+
+ UsbAccessory usbAccessory;
+ Parcelable permissionGranted;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ checkUsbAccessoryIntent("Resume");
+ }
+
+ @Override
+ protected void onNewIntent(Intent intent) {
+ super.onNewIntent(intent);
+ this.setIntent(intent);
+ }
+
+ private synchronized void checkUsbAccessoryIntent(String sourceAction) {
+ if(usbAccessory != null){
+ return;
+ }
+ final Intent intent = getIntent();
+ String action = intent.getAction();
+ Log.d(TAG, sourceAction + " with action: " + action);
+
+ if (UsbManager.ACTION_USB_ACCESSORY_ATTACHED.equals(action)) {
+ usbAccessory = intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
+ permissionGranted = intent.getParcelableExtra(UsbManager.EXTRA_PERMISSION_GRANTED);
+
+ wakeUpRouterService(getApplicationContext());
+
+ }else{
+ finish();
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ usbAccessory = null;
+ permissionGranted = null;
+ super.onDestroy();
+ }
+
+ @SuppressWarnings("deprecation")
+ private void wakeUpRouterService(final Context context){
+ new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() {
+ @Override
+ public void onComplete(Vector<ComponentName> routerServices) {
+ Vector<ComponentName> runningBluetoothServicePackage = new Vector<>(routerServices);
+ if (runningBluetoothServicePackage.isEmpty()) {
+ //If there isn't a service running we should try to start one
+ //We will try to sort the SDL enabled apps and find the one that's been installed the longest
+ Intent serviceIntent;
+ List<SdlAppInfo> sdlAppInfoList = AndroidTools.querySdlAppInfo(context, new SdlAppInfo.BestRouterComparator());
+
+ if (sdlAppInfoList != null && !sdlAppInfoList.isEmpty()) {
+ SdlAppInfo optimalRouterService = sdlAppInfoList.get(0);
+
+ if(optimalRouterService.getRouterServiceVersion() < USB_SUPPORTED_ROUTER_SERVICE_VERSION){
+ // The most optimal router service doesn't support the USB connection
+ // At this point to ensure that USB connection is still possible it might be
+ // worth trying to use the legacy USB transport scheme
+ attemptLegacyUsbConnection();
+ return;
+ }
+
+ serviceIntent = new Intent();
+ serviceIntent.setComponent(optimalRouterService.getRouterServiceComponentName());
+ } else{
+ Log.d(TAG, "No SDL Router Services found");
+ Log.d(TAG, "WARNING: This application has not specified its SdlRouterService correctly in the manifest. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
+ // At this point to ensure that USB connection is still possible it might be
+ // worth trying to use the legacy USB transport scheme
+ attemptLegacyUsbConnection();
+ return;
+ }
+ serviceIntent.setAction(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT);
+
+ ComponentName startedService;
+ try {
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
+ startedService = context.startService(serviceIntent);
+ }else {
+ serviceIntent.putExtra(FOREGROUND_EXTRA, true);
+ startedService = context.startForegroundService(serviceIntent);
+ }
+
+ if(startedService == null){
+ // A router service was not started or is not running.
+ DebugTool.logError(TAG + " - Error starting router service. Attempting legacy connection ");
+ attemptLegacyUsbConnection();
+ return;
+ }
+
+ //Make sure to send this out for old apps to close down
+ SdlRouterService.LocalRouterService self = SdlRouterService.getLocalRouterService(serviceIntent, serviceIntent.getComponent());
+ Intent restart = new Intent(SdlRouterService.REGISTER_NEWER_SERVER_INSTANCE_ACTION);
+ restart.putExtra(SdlBroadcastReceiver.LOCAL_ROUTER_SERVICE_EXTRA, self);
+ restart.putExtra(SdlBroadcastReceiver.LOCAL_ROUTER_SERVICE_DID_START_OWN, true);
+ context.sendBroadcast(restart);
+
+ if (usbAccessory!=null) {
+ new UsbTransferProvider(context, serviceIntent.getComponent(), usbAccessory, new UsbTransferProvider.UsbTransferCallback() {
+ @Override
+ public void onUsbTransferUpdate(boolean success) {
+ finish();
+ }
+ });
+
+ }
+
+ } catch (SecurityException e) {
+ Log.e(TAG, "Security exception, process is bad");
+ }
+ } else {
+ if (usbAccessory!=null) {
+ new UsbTransferProvider(context,runningBluetoothServicePackage.get(0),usbAccessory, new UsbTransferProvider.UsbTransferCallback(){
+ @Override
+ public void onUsbTransferUpdate(boolean success) {
+ finish();
+ }
+ });
+
+ }
+ }
+ }
+ });
+ }
+
+ private void attemptLegacyUsbConnection(){
+ DebugTool.logInfo("Attempting to send USB connection intent using legacy method");
+ Intent usbAccessoryAttachedIntent = new Intent(USBTransport.ACTION_USB_ACCESSORY_ATTACHED);
+ usbAccessoryAttachedIntent.putExtra(UsbManager.EXTRA_ACCESSORY, usbAccessory);
+ usbAccessoryAttachedIntent.putExtra(UsbManager.EXTRA_PERMISSION_GRANTED, permissionGranted);
+ AndroidTools.sendExplicitBroadcast(getApplicationContext(),usbAccessoryAttachedIntent,null);
+ finish();
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java
new file mode 100644
index 000000000..03e0fbb59
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java
@@ -0,0 +1,906 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import android.annotation.SuppressLint;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.hardware.usb.UsbAccessory;
+import android.hardware.usb.UsbManager;
+import android.os.ParcelFileDescriptor;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.trace.SdlTrace;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.DebugTool;
+
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * Class that implements USB transport.
+ *
+ * A note about USB Accessory protocol. If the device is already in the USB
+ * accessory mode, any side (computer or Android) can open connection even if
+ * the other side is not connected. Conversely, if one side simply disconnects,
+ * the other side will NOT be notified and unblocked from reading data until
+ * some data is sent again or the USB is physically disconnected.
+ */
+@SuppressLint("NewApi")
+@Deprecated
+public class USBTransport extends SdlTransport {
+
+ // Boolean to monitor if the transport is in a disconnecting state
+ private boolean _disconnecting = false;
+ /**
+ * Broadcast action: sent when a USB accessory is attached.
+ *
+ * UsbManager.EXTRA_ACCESSORY extra contains UsbAccessory object that has
+ * been attached.
+ */
+ public static final String ACTION_USB_ACCESSORY_ATTACHED =
+ "com.smartdevicelink.USB_ACCESSORY_ATTACHED";
+ /**
+ * String tag for logging.
+ */
+ private static final String TAG = USBTransport.class.getSimpleName();
+ /**
+ * Key for SdlTrace.
+ */
+ private static final String SDL_LIB_TRACE_KEY =
+ "42baba60-eb57-11df-98cf-0800200c9a66";
+ /**
+ * Broadcast action: sent when the user has granted access to the USB
+ * accessory.
+ */
+ private static final String ACTION_USB_PERMISSION =
+ "com.smartdevicelink.USB_PERMISSION";
+ /**
+ * Manufacturer name of the accessory we want to connect to. Must be the
+ * same as in accessory_filter.xml to work properly.
+ */
+ private final static String ACCESSORY_MANUFACTURER = "SDL";
+ /**
+ * Model name of the accessory we want to connect to. Must be the same as
+ * in accessory_filter.xml to work properly.
+ */
+ private final static String ACCESSORY_MODEL = "Core";
+ /**
+ * Version of the accessory we want to connect to. Must be the same as in
+ * accessory_filter.xml to work properly.
+ */
+ private final static String ACCESSORY_VERSION = "1.0";
+ /**
+ * Prefix string to indicate debug output.
+ */
+ private static final String DEBUG_PREFIX = "DEBUG: ";
+ /**
+ * String to prefix exception output.
+ */
+ private static final String EXCEPTION_STRING = " Exception String: ";
+ /**
+ * Broadcast receiver that receives different USB-related intents: USB
+ * accessory connected, disconnected, and permission granted.
+ */
+ private final BroadcastReceiver mUSBReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ logD("USBReceiver Action: " + action);
+
+ UsbAccessory accessory =
+ intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
+ if (accessory != null) {
+ if (ACTION_USB_ACCESSORY_ATTACHED.equals(action)) {
+ logI("Accessory " + accessory + " attached");
+ if (isAccessorySupported(accessory)) {
+ connectToAccessory(accessory);
+ } else {
+ logW("Attached accessory is not supported!");
+ }
+ } else if (UsbManager.ACTION_USB_ACCESSORY_DETACHED
+ .equals(action)) {
+ logI("Accessory " + accessory + " detached");
+ final String msg = "USB accessory has been detached";
+ disconnect(msg, new SdlException(msg,
+ SdlExceptionCause.SDL_USB_DETACHED));
+ } else if (ACTION_USB_PERMISSION.equals(action)) {
+ boolean permissionGranted = intent.getBooleanExtra(
+ UsbManager.EXTRA_PERMISSION_GRANTED, false);
+ if (permissionGranted) {
+ logI("Permission granted for accessory " + accessory);
+ openAccessory(accessory);
+ } else {
+ final String msg =
+ "Permission denied for accessory " + accessory;
+ logW(msg);
+ disconnect(msg, new SdlException(msg,
+ SdlExceptionCause.SDL_USB_PERMISSION_DENIED));
+ }
+ }
+ } else {
+ logW("Accessory is null");
+ }
+ }
+ };
+ /**
+ * USB config object.
+ */
+ private USBTransportConfig mConfig = null;
+ /**
+ * Current state of transport.
+ *
+ * Use setter and getter to access it.
+ */
+ private State mState = State.IDLE;
+ /**
+ * Current accessory the transport is working with if any.
+ */
+ private UsbAccessory mAccessory = null;
+ /**
+ * FileDescriptor that owns the input and output streams. We have to keep
+ * it, otherwise it will be garbage collected and the streams will become
+ * invalid.
+ */
+ private ParcelFileDescriptor mParcelFD = null;
+ /**
+ * Data input stream to read data from USB accessory.
+ */
+ private InputStream mInputStream = null;
+ /**
+ * Data output stream to write data to USB accessory.
+ */
+ private OutputStream mOutputStream = null;
+ /**
+ * Thread that connects and reads data from USB accessory.
+ *
+ * @see USBTransportReader
+ */
+ private Thread mReaderThread = null;
+
+ /**
+ * Constructs the USBTransport instance.
+ *
+ * @param usbTransportConfig Config object for the USB transport
+ * @param transportListener Listener that gets notified on different
+ * transport events
+ */
+ public USBTransport(USBTransportConfig usbTransportConfig,
+ ITransportListener transportListener) {
+ super(transportListener);
+ this.mConfig = usbTransportConfig;
+ registerReciever();
+ }
+
+ /**
+ * Returns the current state of transport.
+ *
+ * @return Current state of transport
+ */
+ public State getState() {
+ return this.mState;
+ }
+
+ /**
+ * Changes current state of transport.
+ *
+ * @param state New state
+ */
+ private void setState(State state) {
+ logD("Changing state " + this.mState + " to " + state);
+ this.mState = state;
+ }
+
+ /**
+ * Sends the array of bytes over USB.
+ *
+ * @param packet The packet that is to be written out on the USB transport
+ * @return true if the bytes are sent successfully
+ */
+ @Override
+ protected boolean sendBytesOverTransport(SdlPacket packet) {
+ byte[] msgBytes = packet.constructPacket();
+ logD("SendBytes: array size " + msgBytes.length + ", offset " + 0 +
+ ", length " + msgBytes.length);
+
+ boolean result = false;
+ final State state = getState();
+ switch (state) {
+ case CONNECTED:
+ if (mOutputStream != null) {
+ try {
+ mOutputStream.write(msgBytes, 0, msgBytes.length);
+ result = true;
+
+ logI("Bytes successfully sent");
+ SdlTrace.logTransportEvent(TAG + ": bytes sent",
+ null, InterfaceActivityDirection.Transmit,
+ msgBytes, 0, msgBytes.length,
+ SDL_LIB_TRACE_KEY);
+ } catch (IOException e) {
+ final String msg = "Failed to send bytes over USB";
+ logW(msg, e);
+ disconnect(msg, e);
+ }
+ } else {
+ final String msg =
+ "Can't send bytes when output stream is null";
+ logW(msg);
+ disconnect(msg, null);
+ }
+ break;
+
+ default:
+ logW("Can't send bytes from " + state + " state");
+ break;
+ }
+
+ return result;
+ }
+
+
+ public void registerReciever()
+ {
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(ACTION_USB_ACCESSORY_ATTACHED);
+ filter.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED);
+ filter.addAction(ACTION_USB_PERMISSION);
+ filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
+ getContext().registerReceiver(mUSBReceiver, filter);
+ }
+
+ /**
+ * Opens a USB connection if not open yet.
+ *
+ * @throws SdlException
+ */
+ @Override
+ public void openConnection() throws SdlException {
+ final State state = getState();
+ switch (state) {
+ case IDLE:
+ synchronized (this) {
+ logI("openConnection()");
+ setState(State.LISTENING);
+ }
+
+ logD("Registering receiver");
+ try {
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(ACTION_USB_ACCESSORY_ATTACHED);
+ filter.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED);
+ filter.addAction(ACTION_USB_PERMISSION);
+ getContext().registerReceiver(mUSBReceiver, filter);
+ initializeAccessory();
+ } catch (Exception e) {
+ String msg = "Couldn't start opening connection";
+ logE(msg, e);
+ throw new SdlException(msg, e,
+ SdlExceptionCause.SDL_CONNECTION_FAILED);
+ }
+
+ break;
+
+ default:
+ logW("openConnection() called from state " + state +
+ "; doing nothing");
+ break;
+ }
+ }
+
+ /**
+ * Closes the USB connection if open.
+ */
+ @Override
+ public void disconnect() {
+ disconnect(null, null);
+ }
+
+ /**
+ * Asks the reader thread to stop while it's possible. If it's blocked on
+ * read(), there is no way to stop it except for physical USB disconnect.
+ */
+ //@Override
+ public void stopReading() {
+ DebugTool.logInfo("USBTransport: stop reading requested, doing nothing");
+ // TODO - put back stopUSBReading(); @see <a href="https://adc.luxoft.com/jira/browse/SmartDeviceLink-3450">SmartDeviceLink-3450</a>
+ }
+
+ @SuppressWarnings("unused")
+ private void stopUSBReading() {
+ final State state = getState();
+ switch (state) {
+ case CONNECTED:
+ logI("Stopping reading");
+ synchronized (this) {
+ stopReaderThread();
+ }
+ break;
+
+ default:
+ logW("Stopping reading called from state " + state +
+ "; doing nothing");
+ break;
+ }
+ }
+
+ /**
+ * Actually asks the reader thread to interrupt.
+ */
+ private void stopReaderThread() {
+ if (mReaderThread != null) {
+ logI("Interrupting USB reader");
+ mReaderThread.interrupt();
+ // don't join() now
+ mReaderThread = null;
+ } else {
+ logD("USB reader is null");
+ }
+ }
+
+ /**
+ * Closes the USB connection from inside the transport with some extra info.
+ *
+ * @param msg Disconnect reason message, if any
+ * @param ex Disconnect exception, if any
+ */
+ private void disconnect(String msg, Exception ex) {
+
+ // If already disconnecting, return
+ if (_disconnecting) {
+ // No need to recursively call
+ return;
+ }
+ _disconnecting = true;
+
+ mConfig.setUsbAccessory(null);
+
+ final State state = getState();
+ switch (state) {
+ case LISTENING:
+ case CONNECTED:
+ synchronized (this) {
+ logI("Disconnect from state " + getState() + "; message: " +
+ msg + "; exception: " + ex);
+ setState(State.IDLE);
+
+ SdlTrace.logTransportEvent(TAG + ": disconnect", null,
+ InterfaceActivityDirection.None, null, 0,
+ SDL_LIB_TRACE_KEY);
+
+ stopReaderThread();
+
+ if (mAccessory != null) {
+ if (mOutputStream != null) {
+ try {
+ mOutputStream.close();
+ mOutputStream = null;
+ } catch (IOException e) {
+ logW("Can't close output stream", e);
+ mOutputStream = null;
+ }
+ }
+ if (mInputStream != null) {
+ try {
+ mInputStream.close();
+ mInputStream = null;
+ } catch (IOException e) {
+ logW("Can't close input stream", e);
+ mInputStream = null;
+ }
+ }
+ if (mParcelFD != null) {
+ try {
+ mParcelFD.close();
+ mParcelFD = null;
+ } catch (IOException e) {
+ logW("Can't close file descriptor", e);
+ mParcelFD = null;
+ }
+ }
+
+ mAccessory = null;
+ }
+ }
+
+ logD("Unregistering receiver");
+ try {
+ getContext().unregisterReceiver(mUSBReceiver);
+ } catch (IllegalArgumentException e) {
+ logW("Receiver was already unregistered", e);
+ }
+
+ String disconnectMsg = (msg == null ? "" : msg);
+ if (ex != null) {
+ disconnectMsg += ", " + ex.toString();
+
+ if(ex instanceof SdlException
+ && SdlExceptionCause.SDL_USB_PERMISSION_DENIED.equals(((SdlException)ex).getSdlExceptionCause())){
+ //If the USB device disconnected we don't want to cycle the proxy ourselves
+ ex = null;
+ }
+ }
+
+ if (ex == null) {
+ // This disconnect was not caused by an error, notify the
+ // proxy that the transport has been disconnected.
+ logI("Disconnect is correct. Handling it");
+ handleTransportDisconnected(disconnectMsg);
+ } else {
+ // This disconnect was caused by an error, notify the proxy
+ // that there was a transport error.
+ logI("Disconnect is incorrect. Handling it as error");
+ handleTransportError(disconnectMsg, ex);
+ }
+ break;
+
+ default:
+ logW("Disconnect called from state " + state +
+ "; doing nothing");
+ break;
+ }
+ _disconnecting = false;
+ }
+
+ /**
+ * Returns the type of the transport.
+ *
+ * @return TransportType.USB
+ * @see com.smartdevicelink.transport.enums.TransportType
+ */
+ @Override
+ public TransportType getTransportType() {
+ return TransportType.USB;
+ }
+
+ /**
+ * Looks for an already connected compatible accessory and connect to it.
+ */
+ private void initializeAccessory() {
+ UsbAccessory acc = mConfig.getUsbAccessory();
+
+ if (!mConfig.getQueryUsbAcc() && acc == null){
+ logI("Query for accessory is disabled and accessory in config was null.");
+ return;
+ }
+ logI("Looking for connected accessories");
+
+ if( acc == null || !isAccessorySupported(acc)){ //Check to see if our config included an accessory and that it is supported. If not, see if there are any other accessories connected.
+ UsbManager usbManager = getUsbManager();
+ UsbAccessory[] accessories = usbManager.getAccessoryList();
+ if (accessories != null) {
+ logD("Found total " + accessories.length + " accessories");
+ for (UsbAccessory accessory : accessories) {
+ if (isAccessorySupported(accessory)) {
+ acc = accessory;
+ break;
+ }
+ }
+ } else {
+ logI("No connected accessories found");
+ return;
+ }
+ }
+ connectToAccessory(acc);
+ }
+
+ /**
+ * Checks if the specified connected USB accessory is what we expect.
+ *
+ * @param accessory Accessory to check
+ * @return true if the accessory is right
+ */
+ public static boolean isAccessorySupported(UsbAccessory accessory) {
+ boolean manufacturerMatches =
+ ACCESSORY_MANUFACTURER.equals(accessory.getManufacturer());
+ boolean modelMatches = ACCESSORY_MODEL.equals(accessory.getModel());
+ boolean versionMatches =
+ ACCESSORY_VERSION.equals(accessory.getVersion());
+ return manufacturerMatches && modelMatches && versionMatches;
+ }
+
+ /**
+ * Attempts to connect to the specified accessory.
+ *
+ * If the permission is already granted, opens the accessory. Otherwise,
+ * requests permission to use it.
+ *
+ * @param accessory Accessory to connect to
+ */
+ private void connectToAccessory(UsbAccessory accessory) {
+ final State state = getState();
+ switch (state) {
+ case LISTENING:
+ UsbManager usbManager = getUsbManager();
+ if (usbManager.hasPermission(accessory)) {
+ logI("Already have permission to use " + accessory);
+ openAccessory(accessory);
+ } else {
+ logI("Requesting permission to use " + accessory);
+
+ PendingIntent permissionIntent = PendingIntent
+ .getBroadcast(getContext(), 0,
+ new Intent(ACTION_USB_PERMISSION), 0);
+ usbManager.requestPermission(accessory, permissionIntent);
+ }
+
+ break;
+
+ default:
+ logW("connectToAccessory() called from state " + state +
+ "; doing nothing");
+ }
+ }
+
+ /**
+ * Returns the UsbManager to use with accessories.
+ *
+ * @return System UsbManager
+ */
+ private UsbManager getUsbManager() {
+ return (UsbManager) getContext().getSystemService(Context.USB_SERVICE);
+ }
+
+ /**
+ * Opens a connection to the accessory.
+ *
+ * When this function is called, the permission to use it must have already
+ * been granted.
+ *
+ * @param accessory Accessory to open connection to
+ */
+ private void openAccessory(UsbAccessory accessory) {
+ final State state = getState();
+ switch (state) {
+ case LISTENING:
+ synchronized (this) {
+ logI("Opening accessory " + accessory);
+ mAccessory = accessory;
+
+ mReaderThread = new Thread(new USBTransportReader());
+ mReaderThread.setDaemon(true);
+ mReaderThread
+ .setName(USBTransportReader.class.getSimpleName());
+ mReaderThread.start();
+
+ // Initialize the SiphonServer
+ if (SiphonServer.getSiphonEnabledStatus()) {
+ SiphonServer.init();
+ }
+ }
+
+ break;
+
+ default:
+ logW("openAccessory() called from state " + state +
+ "; doing nothing");
+ }
+ }
+
+ /**
+ * Logs the string and the throwable with ERROR level.
+ *
+ * @param s string to log
+ * @param tr throwable to log
+ */
+ private void logE(String s, Throwable tr) {
+ DebugTool.logError(s, tr);
+ }
+
+ /**
+ * Logs the string with WARN level.
+ *
+ * @param s string to log
+ */
+ private void logW(String s) {
+ DebugTool.logWarning(s);
+ }
+
+ /**
+ * Logs the string and the throwable with WARN level.
+ *
+ * @param s string to log
+ * @param tr throwable to log
+ */
+ private void logW(String s, Throwable tr) {
+ StringBuilder res = new StringBuilder(s);
+ if (tr != null) {
+ res.append(EXCEPTION_STRING);
+ res.append(tr.toString());
+ }
+ logW(res.toString());
+ }
+
+ /**
+ * Logs the string with INFO level.
+ *
+ * @param s string to log
+ */
+ private void logI(String s) {
+ DebugTool.logInfo(s);
+ }
+
+ /**
+ * Logs the string with DEBUG level.
+ *
+ * @param s string to log
+ */
+ private void logD(String s) {
+ // DebugTool doesn't support DEBUG level, so we use INFO instead
+ DebugTool.logInfo(DEBUG_PREFIX + s);
+ }
+
+ /**
+ * Returns Context to communicate with the OS.
+ *
+ * @return current context to be used by the USB transport
+ */
+ private Context getContext() {
+ return mConfig.getUSBContext();
+ }
+
+ /**
+ * Possible states of the USB transport.
+ */
+ private enum State {
+ /**
+ * Transport initialized; no connections.
+ */
+ IDLE,
+
+ /**
+ * USB accessory not attached; SdlProxy wants connection as soon as
+ * accessory is attached.
+ */
+ LISTENING,
+
+ /**
+ * USB accessory attached; permission granted; data IO in progress.
+ */
+ CONNECTED
+ }
+
+ /**
+ * Internal task that connects to and reads data from a USB accessory.
+ *
+ * Since the class has to have access to the parent class' variables,
+ * synchronization must be taken in consideration! For now, all access
+ * to variables of USBTransport must be surrounded with
+ * synchronized (USBTransport.this) { … }
+ */
+ private class USBTransportReader implements Runnable {
+ /**
+ * String tag for logging inside the task.
+ */
+ private final String TAG = USBTransportReader.class.getSimpleName();
+
+ SdlPsm psm;
+
+ /**
+ * Checks if the thread has been interrupted.
+ *
+ * @return true if the thread has been interrupted
+ */
+ private boolean isInterrupted() {
+ return Thread.interrupted();
+ }
+
+ /**
+ * Entry function that is called when the task is started. It attempts
+ * to connect to the accessory, then starts a read loop until
+ * interrupted.
+ */
+ @Override
+ public void run() {
+ logD("USB reader started!");
+ psm = new SdlPsm();
+ psm.reset();
+ if (connect()) {
+ readFromTransport();
+ }
+
+ logD("USB reader finished!");
+ }
+
+ /**
+ * Attemps to open connection to USB accessory.
+ *
+ * @return true if connected successfully
+ */
+ private boolean connect() {
+ if (isInterrupted()) {
+ logI("Thread is interrupted, not connecting");
+ return false;
+ }
+
+ final State state = getState();
+ switch (state) {
+ case LISTENING:
+
+ synchronized (USBTransport.this) {
+ try {
+ mParcelFD =
+ getUsbManager().openAccessory(mAccessory);
+ } catch (Exception e) {
+ final String msg =
+ "Have no permission to open the accessory";
+ logE(msg, e);
+ disconnect(msg, e);
+ return false;
+ }
+ if (mParcelFD == null) {
+ if (isInterrupted()) {
+ logW("Can't open accessory, and thread is interrupted");
+ } else {
+ logW("Can't open accessory, disconnecting!");
+ String msg = "Failed to open USB accessory";
+ disconnect(msg, new SdlException(msg,
+ SdlExceptionCause.SDL_CONNECTION_FAILED));
+ }
+ return false;
+ }
+ FileDescriptor fd = mParcelFD.getFileDescriptor();
+ mInputStream = new FileInputStream(fd);
+ mOutputStream = new FileOutputStream(fd);
+ }
+
+ logI("Accessory opened!");
+
+ synchronized (USBTransport.this) {
+ setState(State.CONNECTED);
+ handleTransportConnected();
+ }
+ break;
+
+ default:
+ logW("connect() called from state " + state +
+ ", will not try to connect");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Continuously reads data from the transport's input stream, blocking
+ * when no data is available.
+ */
+ private void readFromTransport() {
+ final int READ_BUFFER_SIZE = 4096;
+ byte[] buffer = new byte[READ_BUFFER_SIZE];
+ int bytesRead;
+ // byte input;
+ boolean stateProgress = false;
+
+ // read loop
+ while (!isInterrupted()) {
+ try {
+ if (mInputStream == null)
+ continue;
+
+ bytesRead = mInputStream.read(buffer);
+ if (bytesRead == -1) {
+ if (isInterrupted()) {
+ logI("EOF reached, and thread is interrupted");
+ } else {
+ logI("EOF reached, disconnecting!");
+ disconnect("EOF reached", null);
+ }
+ return;
+ }
+ } catch (IOException e) {
+ if (isInterrupted()) {
+ logW("Can't read data, and thread is interrupted", e);
+ } else {
+ logW("Can't read data, disconnecting!", e);
+ disconnect("Can't read data from USB", e);
+ }
+ return;
+ }
+
+ logD("Read " + bytesRead + " bytes");
+ //FIXME SdlTrace.logTransportEvent(TAG + ": read bytes", null,
+ // InterfaceActivityDirection.Receive, buffer, bytesRead,
+ // SDL_LIB_TRACE_KEY);
+
+ if (isInterrupted()) {
+ logI("Read some data, but thread is interrupted");
+ return;
+ }
+ byte input;
+ for(int i=0;i<bytesRead; i++){
+ input=buffer[i];
+ stateProgress = psm.handleByte(input);
+ if(!stateProgress){//We are trying to weed through the bad packet info until we get something
+ //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
+ psm.reset();
+ buffer = new byte[READ_BUFFER_SIZE];
+ }
+
+ if(psm.getState() == SdlPsm.FINISHED_STATE){
+ synchronized (USBTransport.this) {
+ //Log.d(TAG, "Packet formed, sending off");
+ handleReceivedPacket((SdlPacket)psm.getFormedPacket());
+ }
+ //We put a trace statement in the message read so we can avoid all the extra bytes
+ psm.reset();
+ buffer = new byte[READ_BUFFER_SIZE]; //FIXME just do an array copy and send off
+
+ }
+ }
+ }
+ }
+
+ // Log functions
+
+ private void logD(String s) {
+ DebugTool.logInfo(DEBUG_PREFIX + s);
+ }
+
+ private void logI(String s) {
+ DebugTool.logInfo(s);
+ }
+
+ private void logW(String s) {
+ DebugTool.logWarning(s);
+ }
+
+ private void logW(String s, Throwable tr) {
+ StringBuilder res = new StringBuilder(s);
+ if (tr != null) {
+ res.append(EXCEPTION_STRING);
+ res.append(tr.toString());
+ }
+ logW(res.toString());
+ }
+
+ private void logE(String s, Throwable tr) {
+ DebugTool.logError(s, tr);
+ }
+ }
+
+ @Override
+ public String getBroadcastComment() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java
new file mode 100644
index 000000000..9aeb1a33a
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import android.content.Context;
+import android.hardware.usb.UsbAccessory;
+
+import com.smartdevicelink.transport.enums.TransportType;
+
+/**
+ * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
+ * understand how to implement USB multiplexing. This class and method of USB connection will be
+ * removed in the next major release. If a router service is available to handle multiplexing of the
+ * usb transport it will be used, and this app will connect to whatever router service hosts the USB
+ * connection.
+ * @see MultiplexTransportConfig
+ */
+@Deprecated
+public class USBTransportConfig extends BaseTransportConfig {
+
+ private Context mainActivity = null;
+ private UsbAccessory usbAccessory = null;
+ private Boolean queryUsbAcc = true;
+
+ /**
+ * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
+ * understand how to implement USB multiplexing. This class and method of USB connection will be
+ * removed in the next major release. If a router service is available to handle multiplexing of the
+ * usb transport it will be used, and this app will connect to whatever router service hosts the USB
+ * connection.
+ * @param mainActivity context used to start USB transport
+ * @see MultiplexTransportConfig
+ */
+ public USBTransportConfig (Context mainActivity) {
+ this.mainActivity = mainActivity;
+ }
+
+ /**
+ * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
+ * understand how to implement USB multiplexing. This class and method of USB connection will be
+ * removed in the next major release. If a router service is available to handle multiplexing of the
+ * usb transport it will be used, and this app will connect to whatever router service hosts the USB
+ * connection.
+ * @param mainActivity context used to start USB transport
+ * @param usbAccessory the accessory that was given to this app
+ * @see MultiplexTransportConfig
+ */
+ public USBTransportConfig (Context mainActivity, UsbAccessory usbAccessory) {
+ this.mainActivity = mainActivity;
+ this.usbAccessory = usbAccessory;
+ }
+
+ /**
+ * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
+ * understand how to implement USB multiplexing. This class and method of USB connection will be
+ * removed in the next major release. If a router service is available to handle multiplexing of the
+ * usb transport it will be used, and this app will connect to whatever router service hosts the USB
+ * connection.
+ * @param mainActivity context used to start USB transport
+ * @param shareConnection enable other sessions on this app to use this USB connection
+ * @param queryUsbAcc attempt to query the USB accessory if none is provided
+ * @see MultiplexTransportConfig
+ */
+ public USBTransportConfig (Context mainActivity, boolean shareConnection, boolean queryUsbAcc) {
+ this.mainActivity = mainActivity;
+ this.queryUsbAcc = queryUsbAcc;
+ super.shareConnection = shareConnection;
+ }
+
+ /**
+ * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
+ * understand how to implement USB multiplexing. This class and method of USB connection will be
+ * removed in the next major release. If a router service is available to handle multiplexing of the
+ * usb transport it will be used, and this app will connect to whatever router service hosts the USB
+ * connection.
+ * @param mainActivity context used to start USB transport
+ * @param usbAccessory the accessory that was given to this app
+ * @param shareConnection enable other sessions on this app to use this USB connection
+ * @param queryUsbAcc attempt to query the USB accessory if none is provided
+ * @see MultiplexTransportConfig
+ */
+ public USBTransportConfig (Context mainActivity, UsbAccessory usbAccessory, boolean shareConnection, boolean queryUsbAcc) {
+ this.mainActivity = mainActivity;
+ this.queryUsbAcc = queryUsbAcc;
+ this.usbAccessory = usbAccessory;
+ super.shareConnection = shareConnection;
+ }
+
+ public Boolean getQueryUsbAcc () {
+ return queryUsbAcc;
+ }
+
+ public Context getUSBContext () {
+ return mainActivity;
+ }
+
+ public UsbAccessory getUsbAccessory () {
+ return usbAccessory;
+ }
+
+ public void setUsbAccessory (UsbAccessory value) { usbAccessory = value; }
+
+ public TransportType getTransportType() {
+ return TransportType.USB;
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java
new file mode 100644
index 000000000..6fb17172a
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.hardware.usb.UsbAccessory;
+import android.hardware.usb.UsbManager;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.ParcelFileDescriptor;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.smartdevicelink.util.AndroidTools;
+
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+
+@TargetApi(12)
+public class UsbTransferProvider {
+ private static final String TAG = "UsbTransferProvider";
+
+ private Context context ;
+ private boolean isBound = false;
+ private ComponentName routerService;
+ private int flags = 0;
+
+ final Messenger clientMessenger;
+
+ UsbTransferCallback callback;
+ Messenger routerServiceMessenger = null;
+ ParcelFileDescriptor usbPfd;
+ Bundle usbInfoBundle;
+
+ private ServiceConnection routerConnection= new ServiceConnection() {
+
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ Log.d(TAG, "Bound to service " + className.toString());
+ routerServiceMessenger = new Messenger(service);
+ isBound = true;
+ //So we just established our connection
+ //Register with router service
+ Message msg = Message.obtain();
+ msg.what = TransportConstants.USB_CONNECTED_WITH_DEVICE;
+ msg.arg1 = flags;
+ msg.replyTo = clientMessenger;
+ msg.obj = usbPfd;
+ if(usbInfoBundle != null){
+ msg.setData(usbInfoBundle);
+ }
+ try {
+ routerServiceMessenger.send(msg);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void onServiceDisconnected(ComponentName className) {
+ Log.d(TAG, "UN-Bound from service " + className.getClassName());
+ routerServiceMessenger = null;
+ isBound = false;
+ }
+ };
+
+ public UsbTransferProvider(Context context, ComponentName service, UsbAccessory usbAccessory, UsbTransferCallback callback){
+ if(context == null || service == null || usbAccessory == null){
+ throw new IllegalStateException("Supplied params are not correct. Context == null? "+ (context==null) + " ComponentName == null? " + (service == null) + " Usb Accessory == null? " + usbAccessory);
+ }
+ usbPfd = getFileDescriptor(usbAccessory, context);
+ if(usbPfd != null && usbPfd.getFileDescriptor() != null && usbPfd.getFileDescriptor().valid()){
+ this.context = context;
+ this.routerService = service;
+ this.callback = callback;
+ this.clientMessenger = new Messenger(new ClientHandler(this));
+
+ usbInfoBundle = new Bundle();
+ usbInfoBundle.putString(MultiplexUsbTransport.MANUFACTURER, usbAccessory.getManufacturer());
+ usbInfoBundle.putString(MultiplexUsbTransport.MODEL, usbAccessory.getModel());
+ usbInfoBundle.putString(MultiplexUsbTransport.VERSION, usbAccessory.getVersion());
+ usbInfoBundle.putString(MultiplexUsbTransport.URI, usbAccessory.getUri());
+ usbInfoBundle.putString(MultiplexUsbTransport.SERIAL, usbAccessory.getSerial());
+ usbInfoBundle.putString(MultiplexUsbTransport.DESCRIPTION, usbAccessory.getDescription());
+ checkIsConnected();
+ }else{
+ Log.e(TAG, "Unable to open accessory");
+ clientMessenger = null;
+ if(callback != null){
+ callback.onUsbTransferUpdate(false);
+ }
+ }
+
+ }
+
+ @SuppressLint("NewApi")
+ private ParcelFileDescriptor getFileDescriptor(UsbAccessory accessory, Context context) {
+ if (AndroidTools.isUSBCableConnected(context)) {
+ try {
+ UsbManager manager = (UsbManager) context.getSystemService(Context.USB_SERVICE);
+
+ if (manager != null) {
+ return manager.openAccessory(accessory);
+ }
+ } catch (Exception e) {
+ }
+ }
+ return null;
+ }
+
+ public void setFlags(int flags){
+ this.flags = flags;
+ }
+
+ public void checkIsConnected(){
+ if(!AndroidTools.isServiceExported(context,routerService) || !bindToService()){
+ //We are unable to bind to service
+ Log.e(TAG, "Unable to bind to service");
+ unBindFromService();
+ }
+ }
+
+ public void cancel(){
+ if(isBound){
+ unBindFromService();
+ }
+ }
+
+ private boolean bindToService(){
+ if(isBound){
+ return true;
+ }
+ if(clientMessenger == null){
+ return false;
+ }
+ Intent bindingIntent = new Intent();
+ bindingIntent.setClassName(this.routerService.getPackageName(), this.routerService.getClassName());//This sets an explicit intent
+ //Quickly make sure it's just up and running
+ context.startService(bindingIntent);
+ bindingIntent.setAction( TransportConstants.BIND_REQUEST_TYPE_USB_PROVIDER);
+ return context.bindService(bindingIntent, routerConnection, Context.BIND_AUTO_CREATE);
+ }
+
+ private void unBindFromService(){
+ try{
+ if(context!=null && routerConnection!=null){
+ context.unbindService(routerConnection);
+ }else{
+ Log.w(TAG, "Unable to unbind from router service, context was null");
+ }
+
+ }catch(IllegalArgumentException e){
+ //This is ok
+ }
+ }
+
+ private void finish(){
+ try {
+ usbPfd.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ usbPfd = null;
+ unBindFromService();
+ routerServiceMessenger =null;
+ context = null;
+ System.gc();
+ if(callback != null){
+ callback.onUsbTransferUpdate(true);
+ }
+ }
+
+ static class ClientHandler extends Handler {
+ final WeakReference<UsbTransferProvider> provider;
+
+ public ClientHandler(UsbTransferProvider provider){
+ super(Looper.getMainLooper());
+ this.provider = new WeakReference<UsbTransferProvider>(provider);
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ if(provider.get()==null){
+ return;
+ }
+ switch (msg.what) {
+ case TransportConstants.ROUTER_USB_ACC_RECEIVED:
+ Log.d(TAG, "Successful USB transfer");
+ provider.get().finish();
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ public interface UsbTransferCallback{
+ void onUsbTransferUpdate(boolean success);
+ }
+
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteAraryMessageAssembler.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteAraryMessageAssembler.java
new file mode 100644
index 000000000..5747bbe4e
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteAraryMessageAssembler.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport.utl;
+
+import android.util.Log;
+
+import com.smartdevicelink.transport.TransportConstants;
+import com.smartdevicelink.transport.enums.TransportType;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+public class ByteAraryMessageAssembler {
+ private static final String TAG = "ByteAraryMessageAssembler";
+ ByteArrayOutputStream buffer;
+ boolean isFinished;
+ TransportType transportType;
+
+
+ public void init(){
+ close();
+ this.isFinished = false;
+ buffer = new ByteArrayOutputStream();
+ }
+
+ public void setTransportType(TransportType transportType){
+ this.transportType = transportType;
+ }
+
+ public TransportType getTransportType() {
+ return transportType;
+ }
+
+ public boolean close(){
+ if(buffer!=null){
+ try {
+ buffer.close();
+ buffer = null;
+ return true;
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+ return false;
+ }
+
+ public void append(byte[] bytes){
+ try {
+ buffer.write(bytes);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public synchronized boolean handleMessage(int flags, byte[] packet){
+ switch(flags){
+ case TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START: //Fall through to write the bytes after they buffer was init'ed
+ case TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_CONT:
+ append(packet);
+ break;
+ case TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_END:
+ append(packet);
+ this.isFinished = true;
+ break;
+ default:
+ Log.e(TAG, "Error handling message");
+ return false;
+ }
+
+ return true;
+ }
+
+ public byte[] getBytes(){
+ if(buffer == null){
+ return null;
+ }
+ return this.buffer.toByteArray();
+ }
+
+ public boolean isFinished(){
+ return this.isFinished;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java
new file mode 100644
index 000000000..107901ccb
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport.utl;
+
+import android.os.Bundle;
+import android.os.Message;
+import android.util.Log;
+
+import com.smartdevicelink.transport.TransportBroker;
+import com.smartdevicelink.transport.TransportConstants;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+public class ByteArrayMessageSpliter {
+ private static final String TAG = "ByteArrayMessageSpliter";
+
+ //To test set this value to something very small (eg, 50)
+ public static final int MAX_BINDER_SIZE = 1000000/4; //~1MB/4 We do this as a safety measure. IPC only allows 1MB for everything. We should never fill more than 25% of the buffer so here we make sure we stay under that
+
+ boolean firstPacket;
+ ByteArrayInputStream stream;
+ int bytesRead;
+ int what;
+ String appId;
+ byte[] buffer;
+ int orginalSize;
+ int priorityCoef;
+ int routerServiceVersion = 1;
+ TransportRecord transportRecord;
+
+ public ByteArrayMessageSpliter(String appId,int what, byte[] bytes, int priorityCoef){
+ this.appId = appId;
+ this.what = what;
+ stream = new ByteArrayInputStream(bytes);
+ orginalSize = stream.available();
+ bytesRead = 0;
+ firstPacket = true;
+ this.priorityCoef = priorityCoef;
+ }
+
+ @Deprecated
+ public ByteArrayMessageSpliter(Long appId,int what, byte[] bytes, int priorityCoef){
+ this.appId = appId+"";
+ this.what = what;
+ stream = new ByteArrayInputStream(bytes);
+ orginalSize = stream.available();
+ bytesRead = 0;
+ firstPacket = true;
+ this.priorityCoef = priorityCoef;
+ }
+
+ public void setRouterServiceVersion(int version){
+ this.routerServiceVersion = version;
+ }
+
+ public void setTransportRecord(TransportRecord transportRecord){
+ this.transportRecord = transportRecord;
+ }
+
+ public boolean isActive(){
+ if(stream!=null){
+ return stream.available()>0;
+ }
+ return false;
+ }
+
+ public boolean close(){
+ if(stream == null){
+ return false;
+ }
+ try {
+ stream.close();
+ stream = null;
+ return true;
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ }
+
+ }
+
+ public Message nextMessage(){
+ if(stream == null || stream.available()<=0){
+ return null;
+ }
+
+ Message message = Message.obtain(); //Do we need to always obtain new? or can we just swap bundles?
+ message.what = this.what;// TransportConstants.ROUTER_SEND_PACKET;
+ Bundle bundle = new Bundle();
+
+
+ if(stream.available()>=MAX_BINDER_SIZE){
+ buffer = new byte[MAX_BINDER_SIZE];
+ bytesRead = stream.read(buffer, 0, MAX_BINDER_SIZE);
+ }else{
+ buffer = new byte[stream.available()];
+ bytesRead = stream.read(buffer, 0, stream.available());
+ }
+
+ bundle.putByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME, buffer); //Do we just change this to the args and objs
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, 0);
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, bytesRead);
+ if(transportRecord != null){
+ bundle.putString(TransportConstants.TRANSPORT_TYPE, transportRecord.getType().name());
+ bundle.putString(TransportConstants.TRANSPORT_ADDRESS, transportRecord.getAddress());
+ }
+
+ //Determine which flag should be sent for this division of the packet
+ if(firstPacket){
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START);
+ bundle.putInt(TransportConstants.PACKET_PRIORITY_COEFFICIENT, this.priorityCoef);
+ firstPacket = false;
+ }else if(stream.available()<=0){ //We are at the end of the stream so let the flag reflect that
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_END);
+ }else{
+ bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_CONT);
+ }
+
+ if(routerServiceVersion< TransportConstants.RouterServiceVersions.APPID_STRING){
+ bundle.putLong(TransportConstants.APP_ID_EXTRA,TransportBroker.convertAppId(appId));
+ }
+ bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
+ message.setData(bundle);
+ Log.i(TAG, ((100 - ((stream.available()*100)/orginalSize) ))+ " percent complete.");
+ return message;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/WiFiSocketFactory.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/WiFiSocketFactory.java
new file mode 100644
index 000000000..6e7fd7c75
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/WiFiSocketFactory.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport.utl;
+
+import android.Manifest;
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.net.ConnectivityManager;
+import android.net.Network;
+import android.net.NetworkCapabilities;
+import android.os.Build;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import javax.net.SocketFactory;
+
+import static com.smartdevicelink.util.NativeLogTool.logInfo;
+
+public class WiFiSocketFactory {
+ /**
+ * Try to create a TCP socket which is bound to Wi-Fi network (for Android 5+)
+ *
+ * On Android 5 and later, this method tries to create a Socket instance which is bound to a
+ * Wi-Fi network. If the phone is not connected to a Wi-Fi network, or the app lacks
+ * required permission (ACCESS_NETWORK_STATE), then this method simply creates a Socket instance
+ * with "new Socket();".
+ *
+ * @return a Socket instance, preferably bound to a Wi-Fi network
+ */
+ public static Socket createSocket(Context context) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ Socket socket = createWiFiSocket(context);
+ if (socket != null) {
+ logInfo("Created a Socket bound to Wi-Fi network");
+ return socket;
+ }
+ }
+
+ return new Socket();
+ }
+
+ @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+ private static Socket createWiFiSocket(Context context) {
+ PackageManager pm = context.getPackageManager();
+ if (pm == null) {
+ logInfo("PackageManager isn't available.");
+ return null;
+ }
+ // getAllNetworks() and getNetworkCapabilities() require ACCESS_NETWORK_STATE
+ if (pm.checkPermission(Manifest.permission.ACCESS_NETWORK_STATE, context.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
+ logInfo("Router service doesn't have ACCESS_NETWORK_STATE permission. It cannot bind a TCP transport to Wi-Fi network.");
+ return null;
+ }
+
+ ConnectivityManager connMan = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ if (connMan == null) {
+ logInfo("ConnectivityManager isn't available.");
+ return null;
+ }
+
+ Network[] allNetworks = connMan.getAllNetworks();
+ if (allNetworks == null) {
+ logInfo("Failed to acquire a list of networks.");
+ return null;
+ }
+
+ // Samsung Galaxy S9 (with Android 8.0.0) provides two `Network` instances which have
+ // TRANSPORT_WIFI capability. The first one throws an IOException upon creating a Socket,
+ // and the second one actually works. To support such case, here we iterate over all
+ // `Network` instances until we can create a Socket.
+ for (Network network : allNetworks) {
+ if (network == null) {
+ continue;
+ }
+
+ NetworkCapabilities capabilities = connMan.getNetworkCapabilities(network);
+ if (capabilities == null) {
+ continue;
+ }
+
+ if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
+ try {
+ SocketFactory factory = network.getSocketFactory();
+ if (factory != null) {
+ return factory.createSocket();
+ }
+ } catch (IOException e) {
+ logInfo("IOException during socket creation (ignored): " + e.getMessage());
+ }
+ }
+ }
+
+ logInfo("Cannot find Wi-Fi network to bind a TCP transport.");
+ return null;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java
new file mode 100644
index 000000000..c54c8b4f2
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.util;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.ResolveInfo;
+import android.content.pm.ServiceInfo;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.os.BatteryManager;
+
+import com.smartdevicelink.transport.TransportConstants;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+
+public class AndroidTools {
+ /**
+ * Check to see if a component is exported
+ * @param context object used to retrieve the package manager
+ * @param name of the component in question
+ * @return true if this component is tagged as exported
+ */
+ public static boolean isServiceExported(Context context, ComponentName name) {
+ try {
+ ServiceInfo serviceInfo = context.getPackageManager().getServiceInfo(name, PackageManager.GET_META_DATA);
+ return serviceInfo.exported;
+ } catch (NameNotFoundException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+ /**
+ * Get all SDL enabled apps. If the package name is null, it will return all apps. However, if the package name is included, the
+ * resulting hash map will not include the app with that package name.
+ * @param context a context object used to get an instance of the package manager
+ * @param myPackageName the package of the requesting app. This should only be included if the app wants to exclude itself from the map
+ * @return a hash map of SDL apps with the package name as the key, and the ResolveInfo as the value
+ */
+ public static HashMap<String,ResolveInfo> getSdlEnabledApps(Context context, String myPackageName){
+ Intent intent = new Intent(TransportConstants.START_ROUTER_SERVICE_ACTION);
+ List<ResolveInfo> infos = context.getPackageManager().queryBroadcastReceivers(intent, 0);
+ HashMap<String,ResolveInfo> sdlMultiList = new HashMap<String,ResolveInfo>();
+ for(ResolveInfo info: infos){
+ if(info.activityInfo.applicationInfo.packageName.equals(myPackageName)){
+ continue; //Ignoring my own package
+ }
+ sdlMultiList.put(info.activityInfo.packageName, info);
+ }
+ return sdlMultiList;
+ }
+
+
+ /**
+ * Finds all SDL apps via their SdlRouterService manifest entry. It will return the metadata associated with that router service.
+ * @param context a context instance to obtain the package manager
+ * @param comparator the Comparator to sort the resulting list. If null is supplied, they will be returned as they are from the system
+ * @return the sorted list of SdlAppInfo objects that represent SDL apps
+ */
+ public static List<SdlAppInfo> querySdlAppInfo(Context context, Comparator<SdlAppInfo> comparator){
+ List<SdlAppInfo> sdlAppInfoList = new ArrayList<>();
+ Intent intent = new Intent(TransportConstants.ROUTER_SERVICE_ACTION);
+ List<ResolveInfo> resolveInfoList = context.getPackageManager().queryIntentServices(intent, PackageManager.GET_META_DATA);
+
+ if(resolveInfoList != null && resolveInfoList.size() > 0) {
+ PackageManager packageManager = context.getPackageManager();
+ if(packageManager != null) {
+
+ for (ResolveInfo info : resolveInfoList) {
+ PackageInfo packageInfo = null;
+ try {
+ packageInfo = packageManager.getPackageInfo(info.serviceInfo.packageName, 0);
+ sdlAppInfoList.add(new SdlAppInfo(info, packageInfo));
+ } catch (NameNotFoundException e) {
+ //Package was not found, likely a sign the resolve info can't be trusted.
+ }
+
+ }
+ }
+
+ if (comparator != null) {
+ Collections.sort(sdlAppInfoList, comparator);
+ }
+ }
+
+ return sdlAppInfoList;
+ }
+
+
+ /**
+ * Sends the provided intent to the specified destinations making it an explicit intent, rather
+ * than an implicit intent. A direct replacement of sendBroadcast(Intent). As of Android 8.0
+ * (API 26+) implicit broadcasts are no longer sent to broadcast receivers that are declared via
+ * the AndroidManifest. If no apps are found to receive the intent, this method will send the
+ * broadcast implicitly if no list of apps is provided.
+ *
+ * @param intent - the intent to send explicitly
+ * @param apps - the list of apps that this broadcast will be sent to. If null is passed in
+ * the intent will be sent to all apps that match the provided intent via a query
+ * to the package manager; it will also be sent implicitly to mimic
+ * sendBroadcast()'s original functionality.
+ */
+ public static void sendExplicitBroadcast(Context context, Intent intent, List<ResolveInfo> apps) {
+
+ if(context == null || intent == null){
+ return;
+ }
+
+ if (apps == null) {
+ apps = context.getPackageManager().queryBroadcastReceivers(intent, 0);
+ }
+
+ if (apps != null && apps.size()>0) {
+ for(ResolveInfo app: apps){
+ try {
+ intent.setClassName(app.activityInfo.applicationInfo.packageName, app.activityInfo.name);
+ context.sendBroadcast(intent);
+ }catch(Exception e){
+ //In case there is missing info in the app reference we want to keep moving
+ }
+ }
+ } else {
+ // fallback to implicit broadcast if we cannot resolve apps info.
+ context.sendBroadcast(intent);
+ }
+ }
+
+ /**
+ * Checks if the usb cable is physically connected or not
+ * Note: the intent here is a sticky intent so registerReceiver is actually a synchronous call and doesn't register a receiver on each call
+ * @param context a context instance
+ * @return boolean value that represents whether the usb cable is physically connected or not
+ */
+ public static boolean isUSBCableConnected(Context context) {
+ Intent intent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
+ int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+ return plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB;
+ }
+
+ public static Bitmap downloadImage(String urlStr) throws IOException {
+ URL url = new URL(urlStr);
+ URLConnection connection = url.openConnection();
+ BufferedInputStream bis = new BufferedInputStream(connection.getInputStream());
+ Bitmap result = BitmapFactory.decodeStream(bis);
+ bis.close();
+ return result;
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java
new file mode 100644
index 000000000..ad43c40f5
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+import android.graphics.Bitmap;
+
+import java.io.IOException;
+
+/**
+ * @see AndroidTools
+ */
+@Deprecated
+public class HttpUtils{
+
+ public static Bitmap downloadImage(String urlStr) throws IOException{
+ return AndroidTools.downloadImage(urlStr);
+ }
+
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java
new file mode 100644
index 000000000..bdc588b1b
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.util;
+
+import android.content.ComponentName;
+import android.content.pm.PackageInfo;
+import android.content.pm.ResolveInfo;
+import android.os.Bundle;
+import android.util.Log;
+
+import java.util.Comparator;
+
+/**
+ * Created by Joey Grover on 2/2/18.
+ */
+
+public class SdlAppInfo {
+ private static final String TAG = "SdlAppInfo";
+
+ //FIXME we shouldn't be duplicating constants, but this currently keeps us from needing a context instance.
+ private static final String SDL_ROUTER_VERSION_METADATA = "sdl_router_version";
+ private static final String SDL_CUSTOM_ROUTER_METADATA = "sdl_custom_router";
+
+
+ String packageName;
+ ComponentName routerServiceComponentName;
+ int routerServiceVersion = 4; //We use this as a default and assume if the number doens't exist in meta data it is because the app hasn't updated.
+ boolean isCustomRouterService = false;
+ long lastUpdateTime;
+
+
+ public SdlAppInfo(ResolveInfo resolveInfo, PackageInfo packageInfo){
+ if(resolveInfo.serviceInfo != null){
+
+ this.packageName = resolveInfo.serviceInfo.packageName;
+ this.routerServiceComponentName = new ComponentName(resolveInfo.serviceInfo.packageName, resolveInfo.serviceInfo.name);
+
+ Bundle metadata = resolveInfo.serviceInfo.metaData;
+ if(metadata != null) {
+
+ if (metadata.containsKey(SDL_ROUTER_VERSION_METADATA)){
+ this.routerServiceVersion = metadata.getInt(SDL_ROUTER_VERSION_METADATA);
+ }
+
+ if (metadata.containsKey(SDL_CUSTOM_ROUTER_METADATA)) {
+ this.isCustomRouterService = metadata.getBoolean(SDL_CUSTOM_ROUTER_METADATA);
+ }
+ } else {
+ Log.w(TAG, packageName + " has not supplied metadata with their router service!");
+ }
+ }
+
+ if(packageInfo != null){
+ this.lastUpdateTime = packageInfo.lastUpdateTime;
+ if(this.lastUpdateTime <= 0){
+ this.lastUpdateTime = packageInfo.firstInstallTime;
+ }
+ }
+ }
+
+ public int getRouterServiceVersion() {
+ return routerServiceVersion;
+ }
+
+ public boolean isCustomRouterService() {
+ return isCustomRouterService;
+ }
+
+
+ public ComponentName getRouterServiceComponentName() {
+ return routerServiceComponentName;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("-------- Sdl App Info ------\n");
+
+ builder.append("Package Name: ");
+ builder.append(packageName);
+
+ builder.append("\nRouter Service: ");
+ builder.append(this.routerServiceComponentName.getClassName());
+
+ builder.append("\nRouter Service Version: ");
+ builder.append(this.routerServiceVersion);
+
+ builder.append("\nCustom Router Service?: ");
+ builder.append(this.isCustomRouterService);
+
+ builder.append("\nLast updated: ");
+ builder.append(this.lastUpdateTime);
+
+ builder.append("\n-------- Sdl App Info End------");
+
+ return builder.toString();
+ }
+
+ /**
+ * This comparator will sort a list to find the best router service to start out of the known SDL enabled apps
+ *
+ */
+ public static class BestRouterComparator implements Comparator<SdlAppInfo>{
+
+ @Override
+ public int compare(SdlAppInfo one, SdlAppInfo two) {
+ if(one != null){
+ if(two != null){
+ if(one.isCustomRouterService){
+ if(two.isCustomRouterService){
+ return 0;
+ }else{
+ return 1;
+ }
+ }else if(two.isCustomRouterService){
+ return -1;
+
+ }//else, do nothing. Move to version check
+
+ int versionCompare = two.routerServiceVersion - one.routerServiceVersion;
+
+ if(versionCompare == 0){ //Versions are equal so lets use the one that has been updated most recently
+ int updateTime = (int)(two.lastUpdateTime - one.lastUpdateTime);
+ if(updateTime == 0){
+ //This is arbitrary, but we want to ensure all lists are sorted in the same order
+ return one.routerServiceComponentName.getPackageName().compareTo(two.routerServiceComponentName.getPackageName());
+ }else{
+ return updateTime;
+ }
+ }else{
+ return versionCompare;
+ }
+
+ }else{
+ return -1;
+ }
+ }else{
+ if(two != null){
+ return 1;
+ }
+ }
+ return 0;
+ }
+
+
+ }
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java
new file mode 100644
index 000000000..4e93f9a52
--- /dev/null
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.ResolveInfo;
+import android.os.Handler;
+import android.os.Looper;
+import android.util.Log;
+
+import com.smartdevicelink.transport.SdlRouterService;
+
+import java.util.HashMap;
+import java.util.Vector;
+
+import static com.smartdevicelink.transport.TransportConstants.BIND_LOCATION_CLASS_NAME_EXTRA;
+import static com.smartdevicelink.transport.TransportConstants.BIND_LOCATION_PACKAGE_NAME_EXTRA;
+import static com.smartdevicelink.transport.TransportConstants.SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME;
+
+/**
+ * Created by Joey Grover on 8/18/17.
+ */
+
+public class ServiceFinder {
+ public static final String TAG = ServiceFinder.class.getSimpleName();
+
+ private static final int TIMEOUT = 1000;
+ final String receiverLocation;
+ final Context context;
+ final ServiceFinderCallback callback;
+ final Vector<ComponentName> services;
+ final HashMap<String, ResolveInfo> sdlMultiMap;
+ final Handler timeoutHandler;
+ final Runnable timeoutRunnable;
+
+
+ public ServiceFinder(Context context, String packageName, final ServiceFinderCallback callback) {
+ this.receiverLocation = packageName + ".ServiceFinder";
+ this.context = context.getApplicationContext();
+ this.callback = callback;
+ this.services = new Vector<>();
+
+ this.sdlMultiMap = AndroidTools.getSdlEnabledApps(context, packageName);
+
+ this.context.registerReceiver(mainServiceReceiver, new IntentFilter(this.receiverLocation));
+
+ timeoutRunnable = new Runnable() {
+ @Override
+ public void run() {
+ onFinished();
+ }
+ };
+ timeoutHandler = new Handler(Looper.getMainLooper());
+ timeoutHandler.postDelayed(timeoutRunnable, TIMEOUT + (50 * packageName.length()));
+
+ //Send out our broadcast
+ context.sendBroadcast(createQueryIntent(this.receiverLocation));
+
+
+ }
+
+ BroadcastReceiver mainServiceReceiver = new BroadcastReceiver() {
+ private final Object LIST_LOCK = new Object();
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Log.d(TAG, "Received intent " + intent);
+ if (intent != null) {
+ String packageName = intent.getStringExtra(BIND_LOCATION_PACKAGE_NAME_EXTRA);
+ String className = intent.getStringExtra(BIND_LOCATION_CLASS_NAME_EXTRA);
+ Log.d(TAG, "Received intent from package: " + packageName + ". Classname: " + className);
+ synchronized (LIST_LOCK) {
+ //Add to running services
+ services.add(new ComponentName(packageName, className));
+ //Remove from our waiting for response list
+ sdlMultiMap.remove(packageName);
+
+ //If list is empty, return to callback and unregister
+ if (sdlMultiMap.isEmpty() && callback != null) {
+ timeoutHandler.removeCallbacks(timeoutRunnable);
+ onFinished();
+ }
+ }
+ }
+ }
+ };
+
+ private void onFinished() {
+ if (callback != null) {
+ callback.onComplete(services);
+ }
+ context.unregisterReceiver(mainServiceReceiver);
+
+ }
+
+// /**
+// * Get all SDL enabled apps. If the package name is null, it will return all apps. However, if the package name is included, the
+// * resulting hash map will not include the app with that package name.
+// *
+// * @param context
+// * @param packageName
+// * @return
+// */
+// public static HashMap<String, ResolveInfo> getSdlEnabledApps(Context context, String packageName) {
+// Intent intent = new Intent(TransportConstants.START_ROUTER_SERVICE_ACTION);
+// PackageManager manager = context.getPackageManager();
+// List<ResolveInfo> infos = manager.queryBroadcastReceivers(intent, 0);
+// HashMap<String, ResolveInfo> sdlMultiMap = new HashMap<String, ResolveInfo>();
+// for (ResolveInfo info : infos) {
+// //Log.d(TAG, "Sdl enabled app: " + info.activityInfo.packageName);
+// if (info.activityInfo.applicationInfo.packageName.equals(packageName)) {
+// //Log.d(TAG, "Ignoring my own package");
+// continue;
+// }
+//
+// sdlMultiMap.put(info.activityInfo.packageName, info);
+// try {
+// ServiceInfo[] services = manager.getPackageInfo(info.activityInfo.applicationInfo.packageName, PackageManager.GET_SERVICES).services;
+// for (int i = 0; i < services.length; i++) {
+// Log.d(TAG, "Found : " + services[i].name);
+// }
+// } catch (PackageManager.NameNotFoundException e) {
+// e.printStackTrace();
+// }
+// }
+// return sdlMultiMap;
+// }
+
+ private static Intent createQueryIntent(String receiverLocation) {
+ Intent intent = new Intent();
+ intent.setAction(SdlRouterService.REGISTER_WITH_ROUTER_ACTION);
+ intent.putExtra(SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME, receiverLocation);
+ intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);
+ return intent;
+ }
+
+ public interface ServiceFinderCallback {
+ void onComplete(Vector<ComponentName> routerServices);
+ }
+}
diff --git a/sdl_android/src/main/res/drawable-hdpi/ic_sdl.png b/android/sdl_android/src/main/res/drawable-hdpi/ic_sdl.png
index 3b2d27849..3b2d27849 100644
--- a/sdl_android/src/main/res/drawable-hdpi/ic_sdl.png
+++ b/android/sdl_android/src/main/res/drawable-hdpi/ic_sdl.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-hdpi/sdl_lockscreen_icon.png b/android/sdl_android/src/main/res/drawable-hdpi/sdl_lockscreen_icon.png
index 625eb35ea..625eb35ea 100644
--- a/sdl_android/src/main/res/drawable-hdpi/sdl_lockscreen_icon.png
+++ b/android/sdl_android/src/main/res/drawable-hdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-hdpi/sdl_tray_icon.png b/android/sdl_android/src/main/res/drawable-hdpi/sdl_tray_icon.png
index ae81fa257..ae81fa257 100644
--- a/sdl_android/src/main/res/drawable-hdpi/sdl_tray_icon.png
+++ b/android/sdl_android/src/main/res/drawable-hdpi/sdl_tray_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-mdpi/ic_sdl.png b/android/sdl_android/src/main/res/drawable-mdpi/ic_sdl.png
index 09464468e..09464468e 100644
--- a/sdl_android/src/main/res/drawable-mdpi/ic_sdl.png
+++ b/android/sdl_android/src/main/res/drawable-mdpi/ic_sdl.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png b/android/sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png
index d13a55e0b..d13a55e0b 100644
--- a/sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png
+++ b/android/sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-mdpi/sdl_tray_icon.png b/android/sdl_android/src/main/res/drawable-mdpi/sdl_tray_icon.png
index 17eedac5e..17eedac5e 100644
--- a/sdl_android/src/main/res/drawable-mdpi/sdl_tray_icon.png
+++ b/android/sdl_android/src/main/res/drawable-mdpi/sdl_tray_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-mdpi/transparent.png b/android/sdl_android/src/main/res/drawable-mdpi/transparent.png
index f21003d3a..f21003d3a 100644
--- a/sdl_android/src/main/res/drawable-mdpi/transparent.png
+++ b/android/sdl_android/src/main/res/drawable-mdpi/transparent.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xhdpi/ic_sdl.png b/android/sdl_android/src/main/res/drawable-xhdpi/ic_sdl.png
index 3694e4276..3694e4276 100644
--- a/sdl_android/src/main/res/drawable-xhdpi/ic_sdl.png
+++ b/android/sdl_android/src/main/res/drawable-xhdpi/ic_sdl.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png b/android/sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png
index d7de7cabe..d7de7cabe 100644
--- a/sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png
+++ b/android/sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xhdpi/sdl_tray_icon.png b/android/sdl_android/src/main/res/drawable-xhdpi/sdl_tray_icon.png
index 90b0c71b6..90b0c71b6 100644
--- a/sdl_android/src/main/res/drawable-xhdpi/sdl_tray_icon.png
+++ b/android/sdl_android/src/main/res/drawable-xhdpi/sdl_tray_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xxhdpi/ic_sdl.png b/android/sdl_android/src/main/res/drawable-xxhdpi/ic_sdl.png
index 0ff901fb4..0ff901fb4 100644
--- a/sdl_android/src/main/res/drawable-xxhdpi/ic_sdl.png
+++ b/android/sdl_android/src/main/res/drawable-xxhdpi/ic_sdl.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png b/android/sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png
index bd0c40e67..bd0c40e67 100644
--- a/sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png
+++ b/android/sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xxhdpi/sdl_tray_icon.png b/android/sdl_android/src/main/res/drawable-xxhdpi/sdl_tray_icon.png
index 029fc9d07..029fc9d07 100644
--- a/sdl_android/src/main/res/drawable-xxhdpi/sdl_tray_icon.png
+++ b/android/sdl_android/src/main/res/drawable-xxhdpi/sdl_tray_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xxxhdpi/ic_sdl.png b/android/sdl_android/src/main/res/drawable-xxxhdpi/ic_sdl.png
index b46511edd..b46511edd 100644
--- a/sdl_android/src/main/res/drawable-xxxhdpi/ic_sdl.png
+++ b/android/sdl_android/src/main/res/drawable-xxxhdpi/ic_sdl.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png b/android/sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png
index 21962c148..21962c148 100644
--- a/sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png
+++ b/android/sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xxxhdpi/sdl_tray_icon.png b/android/sdl_android/src/main/res/drawable-xxxhdpi/sdl_tray_icon.png
index 06e49819b..06e49819b 100644
--- a/sdl_android/src/main/res/drawable-xxxhdpi/sdl_tray_icon.png
+++ b/android/sdl_android/src/main/res/drawable-xxxhdpi/sdl_tray_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/layout/activity_sdllock_screen.xml b/android/sdl_android/src/main/res/layout/activity_sdllock_screen.xml
index dd2c2a6bb..dd2c2a6bb 100644
--- a/sdl_android/src/main/res/layout/activity_sdllock_screen.xml
+++ b/android/sdl_android/src/main/res/layout/activity_sdllock_screen.xml
diff --git a/android/sdl_android/src/main/res/values/sdl.xml b/android/sdl_android/src/main/res/values/sdl.xml
new file mode 100644
index 000000000..8ee8f70cb
--- /dev/null
+++ b/android/sdl_android/src/main/res/values/sdl.xml
@@ -0,0 +1,8 @@
+<?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">9</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/android/sdl_android/src/main/res/values/strings.xml
index 1d55ec24d..1d55ec24d 100644
--- a/sdl_android/src/main/res/values/strings.xml
+++ b/android/sdl_android/src/main/res/values/strings.xml
diff --git a/sdl_android/src/main/res/xml/accessory_filter.xml b/android/sdl_android/src/main/res/xml/accessory_filter.xml
index 4b0ab7c83..4b0ab7c83 100644
--- a/sdl_android/src/main/res/xml/accessory_filter.xml
+++ b/android/sdl_android/src/main/res/xml/accessory_filter.xml
diff --git a/android/sdl_android/src/test/java/com/smartdevicelink/ExampleUnitTest.java b/android/sdl_android/src/test/java/com/smartdevicelink/ExampleUnitTest.java
new file mode 100644
index 000000000..b6f81205c
--- /dev/null
+++ b/android/sdl_android/src/test/java/com/smartdevicelink/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.smartdevicelink;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/test/java/com/smartdevicelink/haptic/HapticInterfaceManagerTest.java b/android/sdl_android/src/test/java/com/smartdevicelink/haptic/HapticInterfaceManagerTest.java
new file mode 100644
index 000000000..3658db561
--- /dev/null
+++ b/android/sdl_android/src/test/java/com/smartdevicelink/haptic/HapticInterfaceManagerTest.java
@@ -0,0 +1,173 @@
+/***************************************************************************************************
+ * Copyright © 2017 Xevo Inc.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice, this list of conditions
+ * and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written
+ * permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ **************************************************************************************************/
+package com.smartdevicelink.haptic;
+
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.HapticRect;
+import com.smartdevicelink.proxy.rpc.Rectangle;
+import com.smartdevicelink.proxy.rpc.SendHapticData;
+
+import junit.framework.TestCase;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.stubbing.Answer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+/**
+ * Created on 9/26/2017.
+ */
+@RunWith(MockitoJUnitRunner.Strict.class)
+public class HapticInterfaceManagerTest extends TestCase {
+ @Mock
+ private ISdl mockProxy;
+
+ @Captor
+ private ArgumentCaptor<SendHapticData> captor;
+
+ private HapticInterfaceManager hapticMgr;
+
+ @Before
+ public void setUp() throws Exception {
+ hapticMgr = new HapticInterfaceManager(mockProxy);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ hapticMgr = null;
+ }
+
+ @Test
+ public void testSetHapticData() throws Exception {
+ List<HapticRect> rects = new ArrayList<>();
+ Rectangle rect = new Rectangle();
+ rect.setX(10f);
+ rect.setY(10f);
+ rect.setWidth(50f);
+ rect.setHeight(20f);
+ HapticRect hRect = new HapticRect();
+ hRect.setRect(rect);
+ rects.add(hRect);
+ hapticMgr.setHapticData(rects);
+ verify(mockProxy).sendRPCRequest(any(SendHapticData.class));
+ }
+
+ @Test
+ public void testRefreshHapticData() throws Exception {
+ View root = createViews();
+ hapticMgr.refreshHapticData(root);
+ verify(mockProxy).sendRPCRequest(captor.capture());
+ SendHapticData data = captor.getValue();
+ assertNotNull("SendHapticData RPC", data);
+ List<HapticRect> list = data.getHapticRectData();
+ assertNotNull("List", list);
+ assertEquals("Haptic Rects", 4, list.size());
+ }
+
+ @Test
+ public void testRefreshHapticDataNull() throws Exception {
+ hapticMgr.refreshHapticData(null);
+ verify(mockProxy).sendRPCRequest(captor.capture());
+ SendHapticData data = captor.getValue();
+ assertNotNull("SendHapticData RPC", data);
+ List<HapticRect> list = data.getHapticRectData();
+ assertNull("List", list);
+ }
+
+ @Test
+ public void testRefreshWithUserData() throws Exception {
+ List<HapticRect> rects = new ArrayList<>();
+ Rectangle rect = new Rectangle();
+ rect.setX(10f);
+ rect.setY(10f);
+ rect.setWidth(50f);
+ rect.setHeight(20f);
+ HapticRect hRect = new HapticRect();
+ hRect.setRect(rect);
+ rects.add(hRect);
+ hapticMgr.setHapticData(rects);
+ verify(mockProxy).sendRPCRequest(any(SendHapticData.class));
+
+ View root = createViews();
+ hapticMgr.refreshHapticData(root);
+ verify(mockProxy, times(1)).sendRPCRequest(any(SendHapticData.class));
+ }
+
+ private View createViews() {
+
+ View view = mock(View.class);
+
+ ViewGroup parent1 = mock(ViewGroup.class);
+ ViewGroup parent2 = mock(ViewGroup.class);
+
+ when(parent1.getChildCount()).thenReturn(5);
+
+ when(parent1.getChildAt(0)).thenReturn(view);
+ when(parent1.getChildAt(1)).thenReturn(view);
+ when(parent1.getChildAt(2)).thenReturn(view);
+ when(parent1.getChildAt(3)).thenReturn(parent2);
+ when(parent1.getChildAt(4)).thenReturn(view);
+
+ when(parent2.getChildCount()).thenReturn(2);
+ when(parent2.getChildAt(0)).thenReturn(view);
+ when(parent2.getChildAt(1)).thenReturn(view);
+
+ when(view.isFocusable()).then(new Answer<Boolean>() {
+ private int count = 0;
+
+ @Override
+ public Boolean answer(InvocationOnMock invocation) throws Throwable {
+ int curCount = count++;
+ return (curCount == 1) || (curCount == 2) || (curCount == 3);
+ }
+ });
+ when(view.isClickable()).then(new Answer<Boolean>() {
+ private int count = 0;
+
+ @Override
+ public Boolean answer(InvocationOnMock invocation) throws Throwable {
+ int curCount = count++;
+ return (curCount == 0) || (curCount == 3);
+ }
+ });
+
+ return parent1;
+ }
+}
diff --git a/settings.gradle b/android/settings.gradle
index a358feb22..a358feb22 100644
--- a/settings.gradle
+++ b/android/settings.gradle
diff --git a/base/README.md b/base/README.md
new file mode 100644
index 000000000..151424381
--- /dev/null
+++ b/base/README.md
@@ -0,0 +1,6 @@
+## SmartDeviceLink Base
+
+The Base Java Folder holds classes that are commonly shared amongst the Android, JavaSE, and JavaEE projects.
+
+This should not be directly imported, please refer to the readme's of the JavaSE, JavaEE, or Android projects for installation instructions.
+
diff --git a/base/src/main/java/android/os/AsyncTask.java b/base/src/main/java/android/os/AsyncTask.java
new file mode 100644
index 000000000..f3953f16a
--- /dev/null
+++ b/base/src/main/java/android/os/AsyncTask.java
@@ -0,0 +1,26 @@
+ /*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
+ */
+
+package android.os;
+
+public abstract class AsyncTask<Params, Progress, Result> {
+
+
+ abstract protected Result doInBackground(Params...params);
+
+}
diff --git a/base/src/main/java/android/os/Parcel.java b/base/src/main/java/android/os/Parcel.java
new file mode 100644
index 000000000..4dbf6b7ce
--- /dev/null
+++ b/base/src/main/java/android/os/Parcel.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2006 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
+ */
+
+package android.os;
+
+public class Parcel {
+
+ public void writeInt(int data){
+
+ }
+
+ public void writeByteArray(byte[] bytes){
+
+ }
+
+ public void writeString(String data){
+
+ }
+
+ public void writeParcelable(Parcelable p, int flags){
+
+ }
+
+ public int readInt(){
+ return 0;
+ }
+
+ public String readString(){
+ return "hello";
+ }
+
+ public byte[] readByteArray(byte[] array){
+ return array;
+ }
+
+ public Parcelable readParcelable(ClassLoader loader){
+ return null;
+ }
+
+ public int dataAvail(){
+ return 0;
+ }
+}
diff --git a/base/src/main/java/android/os/Parcelable.java b/base/src/main/java/android/os/Parcelable.java
new file mode 100644
index 000000000..76499a99c
--- /dev/null
+++ b/base/src/main/java/android/os/Parcelable.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2006 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
+ */
+package android.os;
+
+public interface Parcelable {
+
+ int describeContents();
+ void writeToParcel(Parcel dest, int flags);
+
+
+ abstract class Creator<T>{
+ public abstract T[] newArray(int size);
+ }
+
+}
diff --git a/base/src/main/java/android/util/Log.java b/base/src/main/java/android/util/Log.java
new file mode 100644
index 000000000..bdbc3cdc6
--- /dev/null
+++ b/base/src/main/java/android/util/Log.java
@@ -0,0 +1,70 @@
+ /*
+ * Copyright (C) 2006 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: This file has been modified from its original form.
+ */
+
+ package android.util;
+
+public class Log {
+
+
+ public static int i(String tag, String message){
+ System.out.print("\r\nINFO: " + tag+ " - " + message);
+ return 10;
+
+
+ }
+ public static int v(String tag, String message){
+ System.out.print("\r\nVERBOSE: " + tag+ " - " + message);
+ return 10;
+
+
+ }
+ public static int d(String tag, String message){
+ System.out.print("\r\nDEBUG: " + tag+ " - " + message);
+ return 10;
+
+
+ }
+ public static int w(String tag, String message){
+ System.out.print("\r\nWARN: " + tag+ " - " + message);
+ return 10;
+
+
+ }
+ public static int e(String tag, String message){
+ System.out.print("\r\nERROR: " + tag+ " - " + message);
+ return 10;
+
+ }
+ public static int e(String tag, String message, Exception e){
+ if(e != null){
+ System.out.print("\r\nERROR: " + tag+ " - " + message + " - " + e.getMessage());
+ }else{
+ System.out.print("\r\nERROR: " + tag+ " - " + message);
+ }
+ return 10;
+ }
+ public static int e(String tag, String message, Throwable t){
+ if(t != null){
+ System.out.print("\r\nERROR: " + tag+ " - " + message + " - " + t.getMessage());
+ }else{
+ System.out.print("\r\nERROR: " + tag+ " - " + message);
+ }
+ return 10;
+ }
+
+}
diff --git a/base/src/main/java/com/livio/BSON/BsonEncoder.java b/base/src/main/java/com/livio/BSON/BsonEncoder.java
new file mode 100644
index 000000000..c0e03f5cf
--- /dev/null
+++ b/base/src/main/java/com/livio/BSON/BsonEncoder.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.livio.BSON;
+
+import com.smartdevicelink.util.DebugTool;
+import org.bson.*;
+
+import java.util.*;
+
+public class BsonEncoder {
+
+
+ public static byte[] encodeToBytes(HashMap<String, Object> map) throws ClassCastException {
+ if(map != null) {
+ BasicBSONObject bson = new BasicBSONObject();
+ bson.putAll(sanitizeMap(map));
+ BasicBSONEncoder encoder = new BasicBSONEncoder();
+
+ return encoder.encode(bson);
+ }
+ DebugTool.logError("Something went wrong encoding the map into BSON bytes");
+
+ return null;
+ }
+
+ public static HashMap<String, Object> decodeFromBytes(byte[] bytes) {
+ if(bytes != null) {
+ BasicBSONDecoder decoder = new BasicBSONDecoder();
+ BSONObject object = decoder.readObject(bytes);
+ if (object != null) {
+ Map<String, Object> map = object.toMap();
+ if (map != null) {
+ return sanitizeMap(new HashMap<>(map));
+ }
+ }
+ }
+ DebugTool.logError("Something went wrong decoding bytes into BSON");
+ return null;
+ }
+
+ /**
+ * Goes thorugh the map and ensures that all the values included are supported by SDL. If they are not of a supported
+ * value it is removed from the map
+ * @param map the map to be sanitized
+ * @return a sanitized HashMap with non-supported object type removes
+ */
+ private static HashMap<String, Object> sanitizeMap(HashMap<String, Object> map){
+ Set<String> keys = map.keySet();
+ Object value;
+ for(String key : keys){
+ value = map.get(key);
+
+ //First check to see if it value is a valid type used in SDL
+ if(isSupportedType(value)){
+ continue;
+ }else if(value instanceof List){ //Next, check to see if it is a list of values
+ List list = (List)value;
+
+ //If the list is empty, there shouldn't be a problem leaving it in the map
+ if(list.isEmpty()){
+ continue;
+ }
+
+ //Since the list isn't empty, check the first item
+ if(isSupportedType(list.get(0))){
+ continue;
+ }
+ }
+ //If the item isn't valid, remove it from the map
+ map.remove(key);
+
+ }
+ return map;
+ }
+
+ /**
+ * Checks the value to ensure it is of a supported type
+ * @param value the generic object value
+ * @return if the object is an instanceOf one of the supported SDL BSON objects
+ */
+ private static boolean isSupportedType(Object value){
+ return value instanceof Integer
+ || value instanceof Long
+ || value instanceof Double
+ || value instanceof String
+ || value instanceof Boolean;
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java b/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java
new file mode 100644
index 000000000..ba5196c1b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.Dispatcher;
+
+public interface IDispatchingStrategy<T> {
+ public void dispatch(T message);
+
+ public void handleDispatchingError(String info, Exception ex);
+
+ public void handleQueueingError(String info, Exception ex);
+}
diff --git a/base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java b/base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java
new file mode 100644
index 000000000..a95ccaba0
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.Dispatcher;
+
+import com.smartdevicelink.util.DebugTool;
+
+import java.util.concurrent.LinkedBlockingQueue;
+
+public class ProxyMessageDispatcher<T> {
+ LinkedBlockingQueue<T> _queue = null;
+ private Thread _messageDispatchingThread = null;
+ IDispatchingStrategy<T> _strategy = null;
+
+ // Boolean to track if disposed
+ private Boolean dispatcherDisposed = false;
+
+ public ProxyMessageDispatcher(String THREAD_NAME, IDispatchingStrategy<T> strategy) {
+ _queue = new LinkedBlockingQueue<T>();
+
+ _strategy = strategy;
+
+ // Create dispatching thread
+ _messageDispatchingThread = new Thread(new Runnable() {public void run(){handleMessages();}});
+ _messageDispatchingThread.setName(THREAD_NAME);
+ _messageDispatchingThread.setDaemon(true);
+ _messageDispatchingThread.start();
+ }
+
+ public void dispose() {
+ dispatcherDisposed = true;
+
+ if(_messageDispatchingThread != null) {
+ _messageDispatchingThread.interrupt();
+ _messageDispatchingThread = null;
+ }
+ }
+
+ private void handleMessages() {
+
+ try {
+ T thisMessage;
+
+ while(dispatcherDisposed == false) {
+ thisMessage = _queue.take();
+ _strategy.dispatch(thisMessage);
+ }
+ } catch (InterruptedException e) {
+ // Thread was interrupted by dispose() method, no action required
+ return;
+ } catch (Exception e) {
+ DebugTool.logError("Error occurred dispating message.", e);
+ _strategy.handleDispatchingError("Error occurred dispating message.", e);
+ }
+ }
+
+ public void queueMessage(T message) {
+ try {
+ _queue.put(message);
+ } catch(ClassCastException e) {
+ _strategy.handleQueueingError("ClassCastException encountered when queueing message.", e);
+ } catch(Exception e) {
+ _strategy.handleQueueingError("Exception encountered when queueing message.", e);
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java b/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java
new file mode 100644
index 000000000..87fd35122
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.SdlConnection;
+
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.transport.BaseTransportConfig;
+
+import java.util.List;
+
+
+public interface ISdlConnectionListener {
+ @Deprecated
+ void onTransportDisconnected(String info);
+
+ void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig);
+
+
+ void onTransportError(String info, Exception e);
+
+ void onProtocolMessageReceived(ProtocolMessage msg);
+
+ void onProtocolSessionStartedNACKed(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, List<String> rejectedParams);
+
+ void onProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted);
+
+ void onProtocolSessionEnded(SessionType sessionType,
+ byte sessionID, String correlationID);
+
+ void onProtocolSessionEndedNACKed(SessionType sessionType,
+ byte sessionID, String correlationID);
+
+ void onProtocolError(String info, Exception e);
+
+ @Deprecated
+ void onHeartbeatTimedOut(byte sessionID);
+
+ void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID);
+
+ void onAuthTokenReceived(String authToken, byte sessionID);
+}
diff --git a/base/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/base/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
new file mode 100644
index 000000000..1afd69470
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
@@ -0,0 +1,482 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.SdlConnection;
+
+import android.util.Log;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.protocol.ISdlProtocol;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.protocol.SdlProtocol;
+import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+import com.smartdevicelink.security.ISecurityInitializedListener;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.Version;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+public class SdlSession implements ISdlProtocol, ISdlConnectionListener, ISecurityInitializedListener {
+
+ private static final String TAG = "SdlSession";
+
+ final protected SdlProtocol sdlProtocol;
+
+ protected BaseTransportConfig transportConfig;
+ protected ISdlConnectionListener sessionListener;
+ protected SdlSecurityBase sdlSecurity = null;
+ protected VideoStreamingParameters desiredVideoParams = null;
+ protected VideoStreamingParameters acceptedVideoParams = null;
+
+ protected byte sessionId;
+ protected int sessionHashId = 0;
+ protected HashMap<SessionType, CopyOnWriteArrayList<ISdlServiceListener>> serviceListeners;
+ protected CopyOnWriteArrayList<SessionType> encryptedServices = new CopyOnWriteArrayList<SessionType>();
+
+
+ public SdlSession(ISdlConnectionListener listener, BaseTransportConfig config){
+ this.transportConfig = config;
+ this.sessionListener = listener;
+ this.sdlProtocol = new SdlProtocol(this,config);
+
+ }
+
+
+ public int getMtu(){
+ if(this.sdlProtocol!=null){
+ return this.sdlProtocol.getMtu();
+ }else{
+ return 0;
+ }
+ }
+
+ public long getMtu(SessionType type) {
+ if (this.sdlProtocol != null) {
+ return this.sdlProtocol.getMtu(type);
+ } else {
+ return 0;
+ }
+ }
+
+ public void close() {
+ if (sdlSecurity != null)
+ {
+ sdlSecurity.resetParams();
+ sdlSecurity.shutDown();
+ }
+ if(sdlProtocol != null){
+ sdlProtocol.endSession(sessionId, sessionHashId);
+ }
+ }
+
+
+ public void startService (SessionType serviceType, byte sessionID, boolean isEncrypted) {
+ if (isEncrypted){
+ if (sdlSecurity != null){
+ List<SessionType> serviceList = sdlSecurity.getServiceList();
+ if (!serviceList.contains(serviceType))
+ serviceList.add(serviceType);
+
+ sdlSecurity.initialize();
+ }
+ return;
+ }
+ sdlProtocol.startService(serviceType, sessionID, isEncrypted);
+ }
+
+ public void endService (SessionType serviceType, byte sessionID) {
+ if (sdlProtocol == null) {
+ return;
+ }
+ sdlProtocol.endService(serviceType,sessionID);
+ }
+
+
+ public void startSession() throws SdlException {
+ sdlProtocol.start();
+ }
+
+
+ public void sendMessage(ProtocolMessage msg) {
+ if (sdlProtocol == null){
+ return;
+ }
+ sdlProtocol.sendMessage(msg);
+ }
+
+ public TransportType getCurrentTransportType() {
+ return transportConfig.getTransportType();
+ }
+
+ public boolean getIsConnected() {
+ return sdlProtocol != null && sdlProtocol.isConnected();
+ }
+
+
+ public void shutdown(String info){
+ Log.d(TAG, "Shutdown - " + info);
+ this.sessionListener.onTransportDisconnected(info);
+
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) {
+ this.sessionListener.onTransportDisconnected(info, altTransportAvailable, this.transportConfig);
+ }
+
+ /**
+ * Get the current protocol version used by this session
+ * @return Version that represents the Protocol version being used
+ */
+ public Version getProtocolVersion(){
+ if(sdlProtocol!=null){
+ return sdlProtocol.getProtocolVersion();
+ }
+ return new Version(1,0,0);
+ }
+
+
+ public BaseTransportConfig getTransportConfig() {
+ return this.transportConfig;
+ }
+
+ public int getSessionHashId() {
+ return this.sessionHashId;
+ }
+
+ public byte getSessionId() {
+ return this.sessionId;
+ }
+
+ public void setSdlSecurity(SdlSecurityBase sec) {
+ sdlSecurity = sec;
+ }
+
+ public SdlSecurityBase getSdlSecurity() {
+ return sdlSecurity;
+ }
+
+
+ protected void processControlService(ProtocolMessage msg) {
+ if (sdlSecurity == null)
+ return;
+ int ilen = msg.getData().length - 12;
+ byte[] data = new byte[ilen];
+ System.arraycopy(msg.getData(), 12, data, 0, ilen);
+
+ byte[] dataToRead = new byte[4096];
+
+ Integer iNumBytes = sdlSecurity.runHandshake(data, dataToRead);
+
+ if (iNumBytes == null || iNumBytes <= 0)
+ return;
+
+ byte[] returnBytes = new byte[iNumBytes];
+ System.arraycopy(dataToRead, 0, returnBytes, 0, iNumBytes);
+ ProtocolMessage protocolMessage = new ProtocolMessage();
+ protocolMessage.setSessionType(SessionType.CONTROL);
+ protocolMessage.setData(returnBytes);
+ protocolMessage.setFunctionID(0x01);
+ protocolMessage.setVersion((byte)sdlProtocol.getProtocolVersion().getMajor());
+ protocolMessage.setSessionID(getSessionId());
+
+ //sdlSecurity.hs();
+
+ sendMessage(protocolMessage);
+ }
+
+
+ public boolean isServiceProtected(SessionType sType) {
+ return encryptedServices.contains(sType);
+ }
+
+ @Override
+ public void onTransportDisconnected(String info) {
+ this.sessionListener.onTransportDisconnected(info);
+ }
+
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+ this.sessionListener.onTransportError(info, e);
+ }
+
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+ if (msg.getSessionType().equals(SessionType.CONTROL)) {
+ processControlService(msg);
+ return;
+ }
+
+ this.sessionListener.onProtocolMessageReceived(msg);
+ }
+
+ @Override
+ public void onHeartbeatTimedOut(byte sessionID) {
+ this.sessionListener.onHeartbeatTimedOut(sessionID);
+
+ }
+
+
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType,
+ byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
+
+ Log.i(TAG, "Protocol session started");
+
+ this.sessionId = sessionID;
+ if (sessionType.eq(SessionType.RPC)){
+ sessionHashId = hashID;
+ }
+ if (isEncrypted)
+ encryptedServices.addIfAbsent(sessionType);
+ this.sessionListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceStarted(this, sessionType, isEncrypted);
+ }
+ }
+
+ }
+
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
+ String correlationID) {
+ this.sessionListener.onProtocolSessionEnded(sessionType, sessionID, correlationID);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceEnded(this, sessionType);
+ }
+ }
+ encryptedServices.remove(sessionType);
+ }
+
+ @Override
+ public void onProtocolError(String info, Exception e) {
+ this.sessionListener.onProtocolError(info, e);
+ Log.e(TAG, "on protocol error", e);
+ }
+
+
+
+
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType,
+ byte sessionID, String correlationID) {
+ this.sessionListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceError(this, sessionType, "End "+ sessionType.toString() +" Service NACK'ed");
+ }
+ }
+ }
+
+ @Override
+ public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID) {
+ this.sessionListener.onProtocolServiceDataACK(sessionType, dataSize, sessionID);
+ }
+
+
+
+ @Override
+ public void onAuthTokenReceived(String token, byte sessionID) {
+ //This is not used in the base library. Will only be used in the Android library while it has the SdlConnection class
+ //See onAuthTokenReceived(String token) in this class instead
+
+ }
+
+ public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
+ if(serviceListeners == null){
+ serviceListeners = new HashMap<>();
+ }
+ if(serviceType != null && sdlServiceListener != null){
+ if(!serviceListeners.containsKey(serviceType)){
+ serviceListeners.put(serviceType,new CopyOnWriteArrayList<ISdlServiceListener>());
+ }
+ serviceListeners.get(serviceType).add(sdlServiceListener);
+ }
+ }
+
+ public boolean removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
+ if(serviceListeners!= null && serviceType != null && sdlServiceListener != null && serviceListeners.containsKey(serviceType)){
+ return serviceListeners.get(serviceType).remove(sdlServiceListener);
+ }
+ return false;
+ }
+
+
+ public HashMap<SessionType, CopyOnWriteArrayList<ISdlServiceListener>> getServiceListeners(){
+ return serviceListeners;
+ }
+
+ public void setDesiredVideoParams(VideoStreamingParameters params){
+ this.desiredVideoParams = params;
+ }
+
+ /**
+ * Returns the currently set desired video streaming parameters. If there haven't been any set,
+ * the default options will be returned and set for this instance.
+ * @return the desired video streaming parameters
+ */
+ public VideoStreamingParameters getDesiredVideoParams(){
+ if(desiredVideoParams == null){
+ desiredVideoParams = new VideoStreamingParameters();
+ }
+ return desiredVideoParams;
+ }
+
+ public void setAcceptedVideoParams(VideoStreamingParameters params){
+ this.acceptedVideoParams = params;
+ }
+
+ public VideoStreamingParameters getAcceptedVideoParams(){
+ return acceptedVideoParams;
+ }
+
+ private VideoStreamingProtocol getAcceptedProtocol() {
+ // acquire default protocol (RAW)
+ VideoStreamingProtocol protocol = new VideoStreamingParameters().getFormat().getProtocol();
+
+ if (acceptedVideoParams != null) {
+ VideoStreamingFormat format = acceptedVideoParams.getFormat();
+ if (format != null && format.getProtocol() != null) {
+ protocol = format.getProtocol();
+ }
+ }
+
+ return protocol;
+ }
+
+
+
+
+ /* ***********************************************************************************************************************************************************************
+ * ***************************************************************** IProtocol Listener ********************************************************************************
+ *************************************************************************************************************************************************************************/
+
+ public void onProtocolMessageBytesToSend(SdlPacket packet) {
+ //Log.d(TAG, "onProtocolMessageBytesToSend - " + packet.getTransportType());
+ sdlProtocol.sendPacket(packet);
+ }
+
+
+ public void onProtocolSessionStartedNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams){
+ onProtocolSessionNACKed(sessionType,sessionID,version,correlationID,rejectedParams);
+ }
+
+ public void onProtocolSessionNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+ this.sessionListener.onProtocolSessionStartedNACKed(sessionType,
+ sessionID, version, correlationID, rejectedParams);
+ if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
+ CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
+ for(ISdlServiceListener listener:listeners){
+ listener.onServiceError(this, sessionType, "Start "+ sessionType.toString() +" Service NAKed");
+ }
+ }
+ }
+ @Override
+ public void onAuthTokenReceived(String authToken) {
+ this.sessionListener.onAuthTokenReceived(authToken, sessionId);
+ }
+
+ /* Not supported methods from IProtocolListener */
+ public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) { /* Not supported */}
+ public void onProtocolHeartbeatACK(SessionType sessionType, byte sessionID) {/* Not supported */}
+ public void onResetOutgoingHeartbeat(SessionType sessionType, byte sessionID) {/* Not supported */}
+ public void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID) {/* Not supported */}
+
+ /* ***********************************************************************************************************************************************************************
+ * ***************************************************************** Security Listener *********************************************************************************
+ *************************************************************************************************************************************************************************/
+
+
+ @Override
+ public void onSecurityInitialized() {
+
+ if (sdlProtocol != null && sdlSecurity != null)
+ {
+ List<SessionType> list = sdlSecurity.getServiceList();
+
+ SessionType service;
+ ListIterator<SessionType> iter = list.listIterator();
+
+ while (iter.hasNext()) {
+ service = iter.next();
+
+ if (service != null)
+ sdlProtocol.startService(service, getSessionId(), true);
+
+ iter.remove();
+ }
+ }
+ }
+
+ @Override
+ public void stopStream(SessionType serviceType) {
+ //Currently does nothing as streaming is not available. Also should only be managed through managers
+ }
+
+
+ /**
+ * Check to see if a transport is available to start/use the supplied service.
+ * @param sessionType the session that should be checked for transport availability
+ * @return true if there is either a supported
+ * transport currently connected or a transport is
+ * available to connect with for the supplied service type.
+ * <br>false if there is no
+ * transport connected to support the service type in question and
+ * no possibility in the foreseeable future.
+ */
+ public boolean isTransportForServiceAvailable(SessionType sessionType){
+ return sdlProtocol!=null && sdlProtocol.isTransportForServiceAvailable(sessionType);
+ }
+
+
+ @Deprecated
+ public void clearConnection(){/* Not supported */}
+
+
+
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/exception/SdlException.java b/base/src/main/java/com/smartdevicelink/exception/SdlException.java
new file mode 100644
index 000000000..3bea33575
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/exception/SdlException.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.exception;
+
+
+public class SdlException extends Exception {
+
+ private static final long serialVersionUID = 5922492291870772815L;
+
+ protected Throwable detail = null;
+ private SdlExceptionCause _sdlExceptionCause = null;
+
+ public SdlException(String msg, SdlExceptionCause exceptionCause) {
+ super(msg);
+ _sdlExceptionCause = exceptionCause;
+ }
+
+ public SdlException(String msg, Throwable ex, SdlExceptionCause exceptionCause) {
+ super(msg + " --- Check inner exception for diagnostic details");
+ detail = ex;
+ _sdlExceptionCause = exceptionCause;
+ }
+
+ public SdlException(Throwable ex) {
+ super(ex.getMessage());
+ detail = ex;
+ }
+
+ public SdlExceptionCause getSdlExceptionCause() {
+ return _sdlExceptionCause;
+ }
+
+ public Throwable getInnerException() {
+ return detail;
+ }
+
+ public String toString() {
+ String ret = this.getClass().getName();
+ ret += ": " + this.getMessage();
+ if(this.getSdlExceptionCause() != null){
+ ret += "\nSdlExceptionCause: " + this.getSdlExceptionCause().name();
+ }
+ if (detail != null) {
+ ret += "\nnested: " + detail.toString();
+ detail.printStackTrace();
+ }
+ return ret;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/exception/SdlExceptionCause.java b/base/src/main/java/com/smartdevicelink/exception/SdlExceptionCause.java
new file mode 100644
index 000000000..0d8351d54
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/exception/SdlExceptionCause.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.exception;
+
+public enum SdlExceptionCause {
+ BLUETOOTH_ADAPTER_NULL,
+ BLUETOOTH_DISABLED,
+ BLUETOOTH_SOCKET_UNAVAILABLE,
+ HEARTBEAT_PAST_DUE,
+ INCORRECT_LIFECYCLE_MODEL,
+ INVALID_ARGUMENT,
+ INVALID_RPC_PARAMETER,
+ PERMISSION_DENIED,
+ RESERVED_CORRELATION_ID,
+ SDL_CONNECTION_FAILED,
+ SDL_PROXY_CYCLED,
+ SDL_PROXY_DISPOSED,
+ SDL_PROXY_OBSOLETE,
+ SDL_REGISTRATION_ERROR,
+ SDL_UNAVAILABLE,
+ INVALID_HEADER,
+ DATA_BUFFER_NULL,
+ SDL_USB_DETACHED,
+ SDL_USB_PERMISSION_DENIED,
+ LOCK_SCREEN_ICON_NOT_SUPPORTED,
+ ;
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java b/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java
new file mode 100644
index 000000000..5f73be39d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers;
+
+import android.util.Log;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCRequestListener;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.Version;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+import java.util.Vector;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+abstract class BaseSdlManager {
+
+ private static final String TAG = "BaseSubManager";
+
+ final Object STATE_LOCK = new Object();
+ int state = -1;
+
+ String appId, appName, shortAppName;
+ boolean isMediaApp;
+ Language hmiLanguage;
+ Vector<AppHMIType> hmiTypes;
+ BaseTransportConfig transport;
+ Vector<String> vrSynonyms;
+ Vector<TTSChunk> ttsChunks;
+ TemplateColorScheme dayColorScheme, nightColorScheme;
+ Version minimumProtocolVersion;
+ Version minimumRPCVersion;
+
+ Queue<RPCNotification> queuedNotifications = null;
+ OnRPCNotificationListener queuedNotificationListener = null;
+ Map<FunctionID, OnRPCNotificationListener> onRPCNotificationListeners;
+
+ // PROTECTED GETTERS
+ protected String getAppName() { return appName; }
+
+ protected String getAppId() { return appId; }
+
+ protected String getShortAppName() { return shortAppName; }
+
+ protected Version getMinimumProtocolVersion() { return minimumProtocolVersion; }
+
+ protected Version getMinimumRPCVersion() { return minimumRPCVersion; }
+
+ protected Language getHmiLanguage() { return hmiLanguage; }
+
+ protected TemplateColorScheme getDayColorScheme() { return dayColorScheme; }
+
+ protected TemplateColorScheme getNightColorScheme() { return nightColorScheme; }
+
+ protected Vector<AppHMIType> getAppTypes() { return hmiTypes; }
+
+ protected Vector<String> getVrSynonyms() { return vrSynonyms; }
+
+ protected Vector<TTSChunk> getTtsChunks() { return ttsChunks; }
+
+ protected BaseTransportConfig getTransport() { return transport; }
+
+
+ /**
+ * Get the current state for the SdlManager
+ * @return int value that represents the current state
+ * @see BaseSubManager
+ */
+ public int getState() {
+ synchronized (STATE_LOCK) {
+ return state;
+ }
+ }
+
+ protected void transitionToState(int state) {
+ synchronized (STATE_LOCK) {
+ this.state = state;
+ }
+ }
+
+ void checkSdlManagerState(){
+ if (getState() != BaseSubManager.READY && getState() != BaseSubManager.LIMITED){
+ Log.e(TAG, "SdlManager is not ready for use, be sure to initialize with start() method, implement callback, and use SubManagers in the SdlManager's callback");
+ }
+ }
+
+ void initNotificationQueue(){
+ //Setup the notification queue
+ if (onRPCNotificationListeners != null) {
+ Set<FunctionID> functionIDSet = onRPCNotificationListeners.keySet();
+ if (functionIDSet != null && !functionIDSet.isEmpty()) {
+ queuedNotifications = new ConcurrentLinkedQueue<RPCNotification>();
+ queuedNotificationListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ queuedNotifications.add(notification);
+ }
+ };
+ for (FunctionID functionID : functionIDSet) {
+ addOnRPCNotificationListener(functionID, queuedNotificationListener);
+ }
+ }
+ }
+ }
+
+ void handleQueuedNotifications(){
+ //Handle queued notifications and add the listeners
+ if (onRPCNotificationListeners != null) {
+ Set<FunctionID> functionIDSet = onRPCNotificationListeners.keySet();
+ if (queuedNotifications != null && queuedNotifications.size() > 0) {
+ for (RPCNotification notification : queuedNotifications) {
+ try {
+ onRPCNotificationListeners.get(notification.getFunctionID()).onNotified(notification);
+ } catch (Exception e) {
+ DebugTool.logError("Error going through queued notifications", e);
+ }
+ }
+ }
+
+ //Swap queued listener for developer's listeners
+ if (functionIDSet != null && !functionIDSet.isEmpty()) {
+ for (FunctionID functionID : functionIDSet) {
+ //Remove the old queue listener
+ removeOnRPCNotificationListener(functionID, queuedNotificationListener);
+ //Add the developer listener
+ addOnRPCNotificationListener(functionID, onRPCNotificationListeners.get(functionID));
+ }
+ }
+ //Set variables to null that are no longer needed
+ queuedNotifications = null;
+ queuedNotificationListener = null;
+ onRPCNotificationListeners = null;
+ }
+ }
+
+ abstract void checkState();
+
+ protected abstract void initialize();
+
+ //Public abstract API
+ public abstract void start();
+ public abstract void dispose();
+ public abstract void sendRPC(RPCMessage message);
+ public abstract void sendSequentialRPCs(final List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener);
+ public abstract void sendRPCs(List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener);
+ public abstract RegisterAppInterfaceResponse getRegisterAppInterfaceResponse();
+ public abstract OnHMIStatus getCurrentHMIStatus();
+ public abstract String getAuthToken();
+
+ public abstract void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener);
+
+ /**
+ * Remove an OnRPCNotificationListener
+ * @param listener listener that was previously added
+ */
+ public abstract void removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener);
+
+ /**
+ * Add an OnRPCRequestListener
+ * @param listener listener that will be called when a request is received
+ */
+ public abstract void addOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener);
+
+ /**
+ * Remove an OnRPCRequestListener
+ * @param listener listener that was previously added
+ */
+ public abstract void removeOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener);
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java b/base/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java
new file mode 100644
index 000000000..838d50835
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers;
+
+public interface BaseSdlManagerListener {
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java b/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
new file mode 100644
index 000000000..10477d31a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import java.util.List;
+
+/**
+ * <strong>BaseSubManager</strong> <br>
+ *
+ * Note: This class is extended by SubManagers <br>
+ *
+ * It is broken down to these areas: <br>
+ *
+ * 1. <br>
+ */
+public abstract class BaseSubManager {
+
+ // states - if this gets more complicated we can move elsewhere
+ private int state;
+ private final Object STATE_LOCK = new Object();
+ public static final int SETTING_UP = 0x00, READY = 0x30, LIMITED = 0x50, SHUTDOWN = 0x80, ERROR = 0xC0;
+ protected final ISdl internalInterface;
+ private CompletionListener completionListener;
+
+ public BaseSubManager(@NonNull ISdl internalInterface){
+ this.internalInterface = internalInterface;
+ transitionToState(SETTING_UP);
+ }
+
+ /**
+ * Starts up a BaseSubManager, and calls provided callback once BaseSubManager is done setting up or failed setup.
+ * @param listener CompletionListener that is called once the BaseSubManager's state is READY, LIMITED, or ERROR
+ */
+ public void start(CompletionListener listener){
+ this.completionListener = listener;
+ int state = getState();
+ if((state == READY || state == LIMITED || state == ERROR) && completionListener != null){
+ completionListener.onComplete(state == READY || state == LIMITED);
+ completionListener = null;
+ }
+ }
+
+ /**
+ * <p>Called when manager is being torn down</p>
+ */
+ public void dispose(){
+ transitionToState(SHUTDOWN);
+ }
+
+ protected void transitionToState(int state) {
+ synchronized (STATE_LOCK) {
+ this.state = state;
+ }
+ if((state == READY || state == LIMITED || state == ERROR) && completionListener != null ){
+ completionListener.onComplete(state == READY || state == LIMITED);
+ completionListener = null;
+ }
+ }
+
+ public int getState() {
+ synchronized (STATE_LOCK) {
+ return state;
+ }
+ }
+
+ //This allows the method to not be exposed to developers
+ protected void handleTransportUpdated(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail){
+ this.onTransportUpdate(connectedTransports,audioStreamTransportAvail,videoStreamTransportAvail);
+ }
+
+ /**
+ * Transport status has been updated
+ * @param connectedTransports currently connected transports
+ * @param audioStreamTransportAvail if there is a transport that could be used to carry the
+ * audio service
+ * @param videoStreamTransportAvail if there is a transport that could be used to carry the
+ * video service
+ */
+ protected void onTransportUpdate(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail){}
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/CompletionListener.java b/base/src/main/java/com/smartdevicelink/managers/CompletionListener.java
new file mode 100644
index 000000000..2a9c5b16c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/CompletionListener.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers;
+
+public interface CompletionListener {
+
+ /**
+ * Returns whether a specific operation was successful or not
+ * @param success - success or fail
+ */
+ void onComplete(boolean success);
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java b/base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java
new file mode 100644
index 000000000..6025167f5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers;
+
+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/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java b/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java
new file mode 100644
index 000000000..e3e4d325c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.audio;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+
+abstract class BaseAudioStreamManager extends BaseSubManager {
+ BaseAudioStreamManager(@NonNull ISdl internalInterface) {
+ super(internalInterface);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java b/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java
new file mode 100644
index 000000000..12cea8c63
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java
@@ -0,0 +1,378 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.file;
+
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.file.filetypes.SdlFile;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.DeleteFile;
+import com.smartdevicelink.proxy.rpc.ListFiles;
+import com.smartdevicelink.proxy.rpc.ListFilesResponse;
+import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <strong>FileManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+ *
+ * The SDLFileManager uploads files and keeps track of all the uploaded files names during a session. <br>
+ *
+ * We need to add the following struct: SDLFile<br>
+ *
+ * It is broken down to these areas: <br>
+ *
+ * 1. Getters <br>
+ * 2. Deletion methods <br>
+ * 3. Uploading Files / Artwork
+ */
+abstract class BaseFileManager extends BaseSubManager {
+
+ final static String TAG = "FileManager";
+ private List<String> remoteFiles, uploadedEphemeralFileNames;
+
+ BaseFileManager(ISdl internalInterface) {
+
+ // setup
+ super(internalInterface);
+ uploadedEphemeralFileNames = new ArrayList<>();
+ }
+
+ @Override
+ public void start(CompletionListener listener) {
+ // prepare manager - don't set state to ready until we have list of files
+ retrieveRemoteFiles();
+ super.start(listener);
+ }
+
+ // GETTERS
+
+ /**
+ * Returns a list of file names currently residing on core
+ * @return List<String> of remote file names
+ */
+ public List<String> getRemoteFileNames() {
+ if (getState() != BaseSubManager.READY){
+ // error and dont return list
+ throw new IllegalArgumentException("FileManager is not READY");
+ }
+ // return list (this is synchronous at this point)
+ return remoteFiles;
+ }
+
+ private void retrieveRemoteFiles(){
+ remoteFiles = new ArrayList<>();
+ // hold list in remoteFiles class var
+ ListFiles listFiles = new ListFiles();
+ listFiles.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ if(response.getSuccess()){
+ if(((ListFilesResponse) response).getFilenames() != null){
+ remoteFiles.addAll(((ListFilesResponse) response).getFilenames());
+ }
+ // on callback set manager to ready state
+ transitionToState(BaseSubManager.READY);
+ }
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ // file list could not be received
+ transitionToState(BaseSubManager.ERROR);
+ }
+ });
+ internalInterface.sendRPCRequest(listFiles);
+ }
+
+ // DELETION
+
+ /**
+ * Attempts to delete the desired file from core, calls listener with indication of success/failure
+ * @param fileName name of file to be deleted
+ * @param listener callback that is called on response from core
+ */
+ public void deleteRemoteFileWithName(@NonNull final String fileName, final CompletionListener listener){
+ DeleteFile deleteFile = new DeleteFile();
+ deleteFile.setSdlFileName(fileName);
+ deleteFile.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ if(response.getSuccess()){
+ remoteFiles.remove(fileName);
+ uploadedEphemeralFileNames.remove(fileName);
+ }
+ if(listener != null){
+ listener.onComplete(response.getSuccess());
+ }
+ }
+ });
+ internalInterface.sendRPCRequest(deleteFile);
+ }
+
+ /**
+ * Attempts to delete a list of files from core, calls listener with indication of success/failure
+ * @param fileNames list of file names to be deleted
+ * @param listener callback that is called once core responds to all deletion requests
+ */
+ public void deleteRemoteFilesWithNames(@NonNull List<String> fileNames, final MultipleFileCompletionListener listener){
+ if(fileNames.isEmpty()){
+ return;
+ }
+ final List<DeleteFile> deleteFileRequests = new ArrayList<>();
+ for(String fileName : fileNames){
+ DeleteFile deleteFile = new DeleteFile();
+ deleteFile.setSdlFileName(fileName);
+ deleteFileRequests.add(deleteFile);
+ }
+ sendMultipleFileOperations(deleteFileRequests, listener);
+ }
+
+ // UPLOAD FILES / ARTWORK
+
+ /**
+ * Creates and returns a PutFile request that would upload a given SdlFile
+ * @param file SdlFile with fileName and one of A) fileData, B) Uri, or C) resourceID set
+ * @return a valid PutFile request if SdlFile contained a fileName and sufficient data
+ */
+ abstract PutFile createPutFile(@NonNull final SdlFile file);
+
+ /**
+ * Sends list of provided requests (strictly PutFile or DeleteFile) asynchronously through internalInterface,
+ * calls listener on conclusion of sending requests.
+ * @param requests Non-empty list of PutFile or DeleteFile requests
+ * @param listener MultipleFileCompletionListener that is called upon conclusion of sending requests
+ */
+ private void sendMultipleFileOperations(final List<? extends RPCRequest> requests, final MultipleFileCompletionListener listener){
+ final Map<String, String> errors = new HashMap<>();
+ final HashMap<Integer,String> fileNameMap = new HashMap<>();
+ final boolean deletionOperation;
+ if(requests.get(0) instanceof PutFile){
+ deletionOperation = false;
+ }else if(requests.get(0) instanceof DeleteFile){
+ deletionOperation = true;
+ }else{
+ return; // requests are not DeleteFile or PutFile
+ }
+ internalInterface.sendRequests(requests, new OnMultipleRequestListener() {
+ int fileNum = 0;
+
+ @Override
+ public void addCorrelationId(int correlationid) {
+ super.addCorrelationId(correlationid);
+ if(deletionOperation){
+ fileNameMap.put(correlationid, ((DeleteFile) requests.get(fileNum++)).getSdlFileName());
+ }else{
+ fileNameMap.put(correlationid, ((PutFile) requests.get(fileNum++)).getSdlFileName());
+ }
+ }
+
+ @Override
+ public void onUpdate(int remainingRequests) {}
+
+ @Override
+ public void onFinished() {
+ if(listener != null) {
+ if (errors.isEmpty()) {
+ listener.onComplete(null);
+ } else {
+ listener.onComplete(errors);
+ }
+ }
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ if(fileNameMap.get(correlationId) != null){
+ errors.put(fileNameMap.get(correlationId), buildErrorString(resultCode, info));
+ }// else no fileName for given correlation ID
+ }
+
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ if(response.getSuccess()){
+ if(fileNameMap.get(correlationId) != null){
+ if(deletionOperation){
+ remoteFiles.remove(fileNameMap.get(correlationId));
+ uploadedEphemeralFileNames.remove(fileNameMap.get(correlationId));
+ }else{
+ remoteFiles.add(fileNameMap.get(correlationId));
+ uploadedEphemeralFileNames.add(fileNameMap.get(correlationId));
+ }
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Attempts to upload a SdlFile to core
+ * @param file SdlFile with file name and one of A) fileData, B) Uri, or C) resourceID set
+ * @param listener called when core responds to the attempt to upload the file
+ */
+ public void uploadFile(@NonNull final SdlFile file, final CompletionListener listener){
+ if (file.isStaticIcon()){
+ Log.w(TAG, "Static icons don't need to be uploaded");
+ listener.onComplete(true);
+ return;
+ }
+ PutFile putFile = createPutFile(file);
+
+ putFile.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ if(response.getSuccess()){
+ remoteFiles.add(file.getName());
+ uploadedEphemeralFileNames.add(file.getName());
+ }
+ if(listener != null){
+ listener.onComplete(response.getSuccess());
+ }
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ super.onError(correlationId, resultCode, info);
+ if(listener != null){
+ listener.onComplete(false);
+ }
+ }
+ });
+
+ internalInterface.sendRPCRequest(putFile);
+ }
+
+ /**
+ * Attempts to upload a list of SdlFiles to core
+ * @param files list of SdlFiles with file name and one of A) fileData, B) Uri, or C) resourceID set
+ * @param listener callback that is called once core responds to all upload requests
+ */
+ public void uploadFiles(@NonNull List<? extends SdlFile> files, final MultipleFileCompletionListener listener){
+ if(files.isEmpty()){
+ return;
+ }
+ final List<PutFile> putFileRequests = new ArrayList<>();
+ for(SdlFile file : files){
+ putFileRequests.add(createPutFile(file));
+ }
+ sendMultipleFileOperations(putFileRequests, listener);
+ }
+
+ /**
+ * Attempts to upload a SdlArtwork to core
+ * @param file SdlArtwork with file name and one of A) fileData, B) Uri, or C) resourceID set
+ * @param listener called when core responds to the attempt to upload the file
+ */
+ public void uploadArtwork(final SdlArtwork file, final CompletionListener listener){
+ uploadFile(file, listener);
+ }
+
+ /**
+ * Attempts to upload a list of SdlArtworks to core
+ * @param files list of SdlArtworks with file name and one of A) fileData, B) Uri, or C) resourceID set
+ * @param listener callback that is called once core responds to all upload requests
+ */
+ public void uploadArtworks(List<SdlArtwork> files, final MultipleFileCompletionListener listener){
+ uploadFiles(files, listener);
+ }
+
+ /**
+ * Check if an SdlFile has been uploaded to core
+ * @param file SdlFile
+ * @return boolean that tells whether file has been uploaded to core (true) or not (false)
+ */
+ public boolean hasUploadedFile(@NonNull SdlFile file){
+ if(file.isPersistent() && remoteFiles != null && remoteFiles.contains(file.getName())){
+ return true;
+ }else if(!file.isPersistent() && remoteFiles != null && remoteFiles.contains(file.getName())
+ && uploadedEphemeralFileNames.contains(file.getName())){
+ return true;
+ }
+ return false;
+ }
+
+ // HELPERS
+
+ /**
+ * Builds an error string for a given Result and info string
+ * @param resultCode Result
+ * @param info String returned from OnRPCRequestListener.onError()
+ * @return Error string
+ */
+ static public String buildErrorString(Result resultCode, String info){
+ return resultCode.toString() + " : " + info;
+ }
+
+ /**
+ * Helper method to take InputStream and turn it into byte array
+ * @param is valid InputStream
+ * @return Resulting byte array
+ */
+ byte[] contentsOfInputStream(InputStream is){
+ if(is == null){
+ return null;
+ }
+ try{
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ final int bufferSize = 4096;
+ final byte[] buffer = new byte[bufferSize];
+ int available;
+ while ((available = is.read(buffer)) >= 0) {
+ os.write(buffer, 0, available);
+ }
+ return os.toByteArray();
+ } catch (IOException e){
+ Log.e(TAG, "Can't read from InputStream", e);
+ return null;
+ }
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/file/MultipleFileCompletionListener.java b/base/src/main/java/com/smartdevicelink/managers/file/MultipleFileCompletionListener.java
new file mode 100644
index 000000000..588160f01
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/file/MultipleFileCompletionListener.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.file;
+
+import java.util.Map;
+
+public interface MultipleFileCompletionListener {
+
+ /**
+ * @param errors - a dictionary (map) property, of type <String: String>, and contains information
+ * on all failed uploads. The key is the name of the file that did not upload properly,
+ * the value is an error String describing what went wrong on that particular upload attempt.
+ * If all files are uploaded successfully, errors is null
+ */
+ void onComplete(Map<String, String> errors);
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java
new file mode 100644
index 000000000..254b0d505
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.lifecycle;
+
+abstract class BaseLifecycleManager {
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java
new file mode 100644
index 000000000..4960178dc
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.lifecycle;
+
+import android.util.Log;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.Headers;
+import com.smartdevicelink.proxy.rpc.OnSystemRequest;
+import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.proxy.rpc.SystemRequest;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+import com.smartdevicelink.util.DebugTool;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.ProtocolException;
+import java.net.URL;
+import java.util.List;
+import java.util.Vector;
+
+class PoliciesFetcher {
+
+ private static final String TAG = PoliciesFetcher.class.getSimpleName();
+ private static final int POLICIES_CORRELATION_ID = 65535;
+
+ private static HttpURLConnection getURLConnection(Headers myHeader, String sURLString, int Timeout, int iContentLen) {
+ String sContentType = "application/json";
+ int CONNECTION_TIMEOUT = Timeout * 1000;
+ int READ_TIMEOUT = Timeout * 1000;
+ boolean bDoOutput = true;
+ boolean bDoInput = true;
+ boolean bUsesCaches = false;
+ String sRequestMeth = "POST";
+
+ boolean bInstFolRed = false;
+ String sCharSet = "utf-8";
+ int iContentLength = iContentLen;
+
+ URL url;
+ HttpURLConnection urlConnection;
+
+ if (myHeader != null) {
+ //if the header isn't null, use it and replace the hardcoded params
+ int iTimeout;
+ int iReadTimeout;
+ sContentType = myHeader.getContentType();
+ iTimeout = myHeader.getConnectTimeout();
+ bDoOutput = myHeader.getDoOutput();
+ bDoInput = myHeader.getDoInput();
+ bUsesCaches = myHeader.getUseCaches();
+ sRequestMeth = myHeader.getRequestMethod();
+ iReadTimeout = myHeader.getReadTimeout();
+ bInstFolRed = myHeader.getInstanceFollowRedirects();
+ sCharSet = myHeader.getCharset();
+ iContentLength = myHeader.getContentLength();
+ CONNECTION_TIMEOUT = iTimeout * 1000;
+ READ_TIMEOUT = iReadTimeout * 1000;
+ }
+
+ try {
+ url = new URL(sURLString);
+ urlConnection = (HttpURLConnection) url.openConnection();
+ urlConnection.setConnectTimeout(CONNECTION_TIMEOUT);
+ urlConnection.setDoOutput(bDoOutput);
+ urlConnection.setDoInput(bDoInput);
+ urlConnection.setRequestMethod(sRequestMeth);
+ urlConnection.setReadTimeout(READ_TIMEOUT);
+ urlConnection.setInstanceFollowRedirects(bInstFolRed);
+ urlConnection.setRequestProperty("Content-Type", sContentType);
+ urlConnection.setRequestProperty("charset", sCharSet);
+ urlConnection.setRequestProperty("Content-Length", "" + Integer.toString(iContentLength));
+ urlConnection.setUseCaches(bUsesCaches);
+ return urlConnection;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+
+ public static RPCRequest fetchPolicies(OnSystemRequest msg) {
+ HttpURLConnection urlConnection = null;
+ boolean bLegacy = false;
+
+ String sURLString = msg.getUrl();
+
+ Integer iTimeout = msg.getTimeout();
+
+ if (iTimeout == null)
+ iTimeout = 2000;
+
+ Headers myHeader = msg.getHeader();
+
+ try {
+ String sBodyString = msg.getBody();
+
+ JSONObject jsonObjectToSendToServer;
+ String valid_json = "";
+ int length;
+ if (sBodyString == null) {
+ if (RequestType.HTTP.equals(msg.getRequestType())) {
+ length = msg.getBulkData().length;
+ } else {
+ List<String> legacyData = msg.getLegacyData();
+ JSONArray jsonArrayOfSdlPPackets = new JSONArray(legacyData);
+ jsonObjectToSendToServer = new JSONObject();
+ jsonObjectToSendToServer.put("data", jsonArrayOfSdlPPackets);
+ bLegacy = true;
+ valid_json = jsonObjectToSendToServer.toString().replace("\\", "");
+ length = valid_json.getBytes("UTF-8").length;
+ }
+ } else {
+ valid_json = sBodyString.replace("\\", "");
+ length = valid_json.getBytes("UTF-8").length;
+ }
+
+ urlConnection = getURLConnection(myHeader, sURLString, iTimeout, length);
+
+ if (urlConnection == null) {
+ Log.i(TAG, "urlConnection is null, check RPC input parameters");
+ return null;
+ }
+
+ DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream());
+ if (RequestType.HTTP.equals(msg.getRequestType())) {
+ wr.write(msg.getBulkData());
+ } else {
+ wr.writeBytes(valid_json);
+ }
+
+ wr.flush();
+ wr.close();
+
+
+ long BeforeTime = System.currentTimeMillis();
+ long AfterTime = System.currentTimeMillis();
+ final long roundtriptime = AfterTime - BeforeTime;
+
+ int iResponseCode = urlConnection.getResponseCode();
+
+ if (iResponseCode != HttpURLConnection.HTTP_OK) {
+ Log.i(TAG, "Response code not HTTP_OK, returning from sendOnSystemRequestToUrl.");
+ return null;
+ }
+
+ InputStream is = urlConnection.getInputStream();
+ BufferedReader rd = new BufferedReader(new InputStreamReader(is));
+ String line;
+ StringBuilder response = new StringBuilder();
+ while ((line = rd.readLine()) != null) {
+ response.append(line);
+ response.append('\r');
+ }
+ rd.close();
+ //We've read the body
+ if (RequestType.HTTP.equals(msg.getRequestType())) {
+ // Create the SystemRequest RPC to send to module.
+ PutFile putFile = new PutFile();
+ putFile.setFileType(FileType.JSON);
+ putFile.setCorrelationID(POLICIES_CORRELATION_ID);
+ putFile.setSdlFileName("response_data");
+ putFile.setFileData(response.toString().getBytes("UTF-8"));
+ putFile.setCRC(response.toString().getBytes());
+ return putFile;
+ } else {
+ Vector<String> cloudDataReceived = new Vector<String>();
+ final String dataKey = "data";
+ // Convert the response to JSON
+ JSONObject jsonResponse = new JSONObject(response.toString());
+ if (jsonResponse.has(dataKey)) {
+ if (jsonResponse.get(dataKey) instanceof JSONArray) {
+ JSONArray jsonArray = jsonResponse.getJSONArray(dataKey);
+ for (int i = 0; i < jsonArray.length(); i++) {
+ if (jsonArray.get(i) instanceof String) {
+ cloudDataReceived.add(jsonArray.getString(i));
+ //Log.i("sendSystemRequestToUrl", "jsonArray.getString(i): " + jsonArray.getString(i));
+ }
+ }
+ } else if (jsonResponse.get(dataKey) instanceof String) {
+ cloudDataReceived.add(jsonResponse.getString(dataKey));
+ //Log.i("sendSystemRequestToUrl", "jsonResponse.getString(data): " + jsonResponse.getString("data"));
+ }
+ } else {
+ DebugTool.logError("sendSystemRequestToUrl: Data in JSON Object neither an array nor a string.");
+ //Log.i("sendSystemRequestToUrl", "sendSystemRequestToUrl: Data in JSON Object neither an array nor a string.");
+ return null;
+ }
+
+ String sResponse = cloudDataReceived.toString();
+
+ if (sResponse.length() > 512) {
+ sResponse = sResponse.substring(0, 511);
+ }
+
+ // Send new SystemRequest to SDL
+ SystemRequest mySystemRequest = null;
+
+ if (bLegacy) {
+ if (cloudDataReceived != null) {
+ mySystemRequest = new SystemRequest(true);
+ mySystemRequest.setCorrelationID(POLICIES_CORRELATION_ID);
+ mySystemRequest.setLegacyData(cloudDataReceived);
+ }
+ } else {
+ if (response != null) {
+ mySystemRequest = new SystemRequest();
+ mySystemRequest.setRequestType(RequestType.PROPRIETARY);
+ mySystemRequest.setCorrelationID(POLICIES_CORRELATION_ID);
+ mySystemRequest.setBulkData(response.toString().getBytes());
+ }
+ }
+ return mySystemRequest;
+
+ }
+ } catch (JSONException e) {
+ DebugTool.logError("sendSystemRequestToUrl: JSONException: ", e);
+ } catch (UnsupportedEncodingException e) {
+ DebugTool.logError("sendSystemRequestToUrl: Could not encode string.", e);
+ } catch (ProtocolException e) {
+ DebugTool.logError("sendSystemRequestToUrl: Could not set request method to post.", e);
+ } catch (MalformedURLException e) {
+ DebugTool.logError("sendSystemRequestToUrl: URL Exception when sending SystemRequest to an external server.", e);
+ } catch (IOException e) {
+ DebugTool.logError("sendSystemRequestToUrl: IOException: ", e);
+ } catch (Exception e) {
+ DebugTool.logError("sendSystemRequestToUrl: Unexpected Exception: ", e);
+ } finally {
+ if (urlConnection != null) {
+ urlConnection.disconnect();
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java
new file mode 100644
index 000000000..8b705bb75
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.lifecycle;
+
+import android.util.Log;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.Version;
+
+import java.util.Hashtable;
+import java.util.Set;
+
+/**
+ * Converts a protocol message into an RPC.
+ * Built to reduce boiler plate code for each RPC added.
+ */
+public class RpcConverter {
+
+ private static final String TAG = "RpcConverter";
+
+ private static final String RPC_PACKAGE = "com.smartdevicelink.proxy.rpc.";
+ private static final String RESPONSE_KEY = "Response";
+ private static final String GENERIC_RESPONSE_STRING = FunctionID.GENERIC_RESPONSE.toString();
+
+ /**
+ * Extracts the RPC out of the payload of a given protocol message
+ * @param message protocolMessage that has the RPC in the payload
+ * @param protocolVersion RPC spec version that should be used to create RPC
+ * @return the extracted RPC
+ */
+ public static RPCMessage extractRpc(ProtocolMessage message, Version protocolVersion){
+ Hashtable<String, Object> tempTable = convertProtocolMessage(message, protocolVersion);
+ if(tempTable != null){
+ try{
+ return convertTableToRpc(tempTable);
+ }catch (Exception e){
+ DebugTool.logError("Error converting RPC",e);
+ }
+ }
+ return null;
+ }
+
+ static Hashtable<String, Object> convertProtocolMessage(ProtocolMessage message, Version protocolVersion){
+ Hashtable<String, Object> hash = new Hashtable<>();
+ if (protocolVersion!= null && protocolVersion.getMajor() > 1) {
+
+ Hashtable<String, Object> hashTemp = new Hashtable<>();
+ hashTemp.put(RPCMessage.KEY_CORRELATION_ID, message.getCorrID());
+ if (message.getJsonSize() > 0) {
+ final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());
+ if (mhash != null) {
+ hashTemp.put(RPCMessage.KEY_PARAMETERS, mhash);
+ }
+ }
+
+ String functionName = FunctionID.getFunctionName(message.getFunctionID());
+
+ if (functionName != null) {
+ hashTemp.put(RPCMessage.KEY_FUNCTION_NAME, functionName);
+ } else {
+ DebugTool.logWarning("Dispatch Incoming Message - function name is null unknown RPC. FunctionId: " + message.getFunctionID());
+ return null;
+ }
+
+ if (message.getRPCType() == 0x00) {
+ hash.put(RPCMessage.KEY_REQUEST, hashTemp);
+ } else if (message.getRPCType() == 0x01) {
+ hash.put(RPCMessage.KEY_RESPONSE, hashTemp);
+ } else if (message.getRPCType() == 0x02) {
+ hash.put(RPCMessage.KEY_NOTIFICATION, hashTemp);
+ }
+
+ if (message.getBulkData() != null) hash.put(RPCStruct.KEY_BULK_DATA, message.getBulkData());
+ if (message.getPayloadProtected()) hash.put(RPCStruct.KEY_PROTECTED, true);
+
+ return hash;
+ } else {
+ return JsonRPCMarshaller.unmarshall(message.getData());
+ }
+ }
+
+
+ public static RPCMessage convertTableToRpc(Hashtable<String,Object> rpcHashTable){
+
+ Hashtable<String,Object> params;
+ if(rpcHashTable.containsKey((RPCMessage.KEY_RESPONSE))){
+ params = (Hashtable)rpcHashTable.get((RPCMessage.KEY_RESPONSE));
+ }else if(rpcHashTable.containsKey((RPCMessage.KEY_NOTIFICATION))){
+ params = (Hashtable)rpcHashTable.get((RPCMessage.KEY_NOTIFICATION));
+ }else if(rpcHashTable.containsKey((RPCMessage.KEY_REQUEST))){
+ params = (Hashtable)rpcHashTable.get((RPCMessage.KEY_REQUEST));
+ }else{
+ DebugTool.logError(TAG + " Corrupted RPC table.");
+ return null;
+ }
+
+ if(DebugTool.isDebugEnabled()) {
+ if (params != null) {
+ Set<String> keySet = params.keySet();
+ for (String key : keySet) {
+ Log.i(TAG, key + " - " + params.get(key));
+ }
+ }
+ }
+
+ if(params.containsKey(RPCMessage.KEY_FUNCTION_NAME)){
+ StringBuilder rpcClassName = new StringBuilder();
+ String functionName = (String)params.get(RPCMessage.KEY_FUNCTION_NAME);
+ if(FunctionID.SHOW_CONSTANT_TBT.toString().equals(functionName)) {
+ functionName = "ShowConstantTbt";
+ }
+ rpcClassName.append(RPC_PACKAGE);
+ rpcClassName.append (functionName);
+
+ if(rpcHashTable.containsKey(RPCMessage.KEY_RESPONSE)
+ && !GENERIC_RESPONSE_STRING.equals(functionName)){
+ rpcClassName.append(RESPONSE_KEY);
+ }
+
+ DebugTool.logInfo(TAG + " Attempting to create " + rpcClassName.toString());
+ try {
+ Class rpcClass = Class.forName(rpcClassName.toString());
+ if(rpcClass != null){
+ java.lang.reflect.Constructor rpcConstructor = rpcClass.getConstructor(Hashtable.class);
+ if(rpcConstructor != null){
+ return (RPCMessage)rpcConstructor.newInstance(rpcHashTable);
+ }
+ } else {
+ DebugTool.logError(TAG + " Java class cannot be found for " + rpcClassName.toString());
+ }
+ } catch (Exception e) {
+ DebugTool.logError("RPCConverter was unable to process RPC", e);
+ }
+ }else{
+ DebugTool.logError(TAG + " Unable to parse into RPC");
+ }
+
+ return null;
+ }
+
+
+}
+
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java b/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java
new file mode 100644
index 000000000..6b9e198c2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java
@@ -0,0 +1,386 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.permission;
+
+import android.support.annotation.IntDef;
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
+import com.smartdevicelink.proxy.rpc.PermissionItem;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ PermissionManager gives the developer information about what permissions are permitted in specific HMI level
+ and helps developers setup listeners to be called when specific permissions become allowed.<br>
+
+ This should be used through the {@link com.smartdevicelink.managers.SdlManager} and not be instantiated by itself
+**/
+
+abstract class BasePermissionManager extends BaseSubManager{
+
+ private HMILevel currentHMILevel;
+ private Map<FunctionID, PermissionItem> currentPermissionItems;
+ private OnRPCNotificationListener onHMIStatusListener, onPermissionsChangeListener;
+ private List<PermissionFilter> filters;
+
+ // Permission groups status constants
+ @IntDef({PERMISSION_GROUP_STATUS_ALLOWED, PERMISSION_GROUP_STATUS_DISALLOWED,
+ PERMISSION_GROUP_STATUS_MIXED, PERMISSION_GROUP_STATUS_UNKNOWN})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface PermissionGroupStatus {}
+ public static final int PERMISSION_GROUP_STATUS_ALLOWED = 0; // Every permission in the group is currently allowed
+ public static final int PERMISSION_GROUP_STATUS_DISALLOWED = 1; // Every permission in the group is currently disallowed
+ public static final int PERMISSION_GROUP_STATUS_MIXED = 2; // Some permissions in the group are allowed and some disallowed
+ public static final int PERMISSION_GROUP_STATUS_UNKNOWN = 3; // The current status of the group is unknown
+
+ // Permission groups type constants
+ @IntDef({PERMISSION_GROUP_TYPE_ALL_ALLOWED, PERMISSION_GROUP_TYPE_ANY})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface PermissionGroupType {}
+ public static final int PERMISSION_GROUP_TYPE_ALL_ALLOWED = 0; // Be notified when all of the permission in the group are allowed, or, when they all stop being allowed in some sense, that is, when they were all allowed, and now they are not.
+ public static final int PERMISSION_GROUP_TYPE_ANY = 1; // Be notified when any change in availability occurs among the group
+
+ /**
+ * Creates a new instance of the PermissionManager
+ * @param internalInterface an instance of the ISdl interface that can be used for common SDL operations (sendRpc, addRpcListener, etc)
+ */
+ BasePermissionManager(@NonNull ISdl internalInterface){
+ super(internalInterface);
+ this.currentPermissionItems = new HashMap<>();
+ this.filters = new ArrayList<>();
+
+ // Set PermissionManager's OnHMIStatusListener to keep currentHMILevel updated and call developer's listeners if needed
+ onHMIStatusListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ HMILevel previousHMILevel = currentHMILevel;
+ currentHMILevel = ((OnHMIStatus)notification).getHmiLevel();
+ checkState();
+ notifyListeners(currentPermissionItems, previousHMILevel, currentPermissionItems, currentHMILevel);
+ }
+ };
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
+
+ // Set PermissionManager's PermissionsChangeListener to keep currentPermissionItems updated and call developer's listeners if needed
+ onPermissionsChangeListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ List<PermissionItem> permissionItems = ((OnPermissionsChange)notification).getPermissionItem();
+ Map<FunctionID, PermissionItem> previousPermissionItems = currentPermissionItems;
+ currentPermissionItems = new HashMap<>();
+ if (permissionItems != null && !permissionItems.isEmpty()) {
+ for (PermissionItem permissionItem : permissionItems) {
+ FunctionID functionID = FunctionID.getEnumForString(permissionItem.getRpcName());
+ if (functionID != null) {
+ currentPermissionItems.put(functionID, permissionItem);
+ }
+ }
+ }
+ notifyListeners(previousPermissionItems, currentHMILevel, currentPermissionItems, currentHMILevel);
+ previousPermissionItems.clear();
+ }
+ };
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_PERMISSIONS_CHANGE, onPermissionsChangeListener);
+ }
+
+ @Override
+ public void start(CompletionListener listener) {
+ checkState();
+ super.start(listener);
+ }
+
+ private synchronized void checkState(){
+ if(this.getState() == SETTING_UP && currentHMILevel != null){
+ transitionToState(READY);
+ }
+ }
+
+ /**
+ * Go over all developer's listeners and call them if needed because of HMI level change or permission items change
+ * @param previousPermissionItems
+ * @param previousHmiLevel
+ * @param currentPermissionItems
+ * @param currentHMILevel
+ */
+ private void notifyListeners(Map<FunctionID, PermissionItem> previousPermissionItems, HMILevel previousHmiLevel, Map<FunctionID, PermissionItem> currentPermissionItems, HMILevel currentHMILevel){
+ for (PermissionFilter filter : filters) {
+ boolean anyChange = false;
+ boolean allWereAllowed = true;
+ boolean allNowAllowed = true;
+ for (PermissionElement permissionElement : filter.getPermissionElements()) {
+ // If at any point this condition is satisfied, then we don't need to continue
+ if (anyChange && !allWereAllowed && !allNowAllowed){
+ break;
+ }
+ boolean rpcWasAllowed = isRPCAllowed(permissionElement.getRPCName(), previousPermissionItems, previousHmiLevel);
+ boolean rpcNowAllowed = isRPCAllowed(permissionElement.getRPCName(), currentPermissionItems, currentHMILevel);
+ if (rpcWasAllowed != rpcNowAllowed){
+ anyChange = true;
+ }
+ if (!rpcWasAllowed){
+ allWereAllowed = false;
+ }
+ if (!rpcNowAllowed){
+ allNowAllowed = false;
+ }
+ if (permissionElement.getParameters() != null && permissionElement.getParameters().size() > 0) {
+ for (String parameter : permissionElement.getParameters()) {
+ boolean parameterWasAllowed = isPermissionParameterAllowed(permissionElement.getRPCName(), parameter, previousPermissionItems, previousHmiLevel);
+ boolean parameterNowAllowed = isPermissionParameterAllowed(permissionElement.getRPCName(), parameter, currentPermissionItems, currentHMILevel);
+ if (parameterWasAllowed != parameterNowAllowed){
+ anyChange = true;
+ }
+ if (!parameterWasAllowed){
+ allWereAllowed = false;
+ }
+ if (!parameterNowAllowed){
+ allNowAllowed = false;
+ }
+ }
+ }
+ }
+ if (filter.getGroupType() == PERMISSION_GROUP_TYPE_ALL_ALLOWED && anyChange && (allWereAllowed || allNowAllowed)){
+ notifyListener(filter);
+ } else if (filter.getGroupType() == PERMISSION_GROUP_TYPE_ANY && anyChange){
+ notifyListener(filter);
+ }
+ }
+ }
+
+ /**
+ * Determine if an individual RPC is allowed
+ * @param rpcName FunctionID value that represents the name of the RPC
+ * @param permissionItems Map containing HMI and parameter permissions for a specific RPC
+ * @param hmiLevel If the RPC is allowed at that HMI Level. Ex: None or Full
+ * @return boolean represents whether the RPC is allowed or not
+ */
+ private boolean isRPCAllowed(@NonNull FunctionID rpcName, Map<FunctionID, PermissionItem> permissionItems, HMILevel hmiLevel){
+ PermissionItem permissionItem = permissionItems.get(rpcName);
+ if (hmiLevel == null || permissionItem == null || permissionItem.getHMIPermissions() == null || permissionItem.getHMIPermissions().getAllowed() == null){
+ return false;
+ } else if (permissionItem.getHMIPermissions().getUserDisallowed() != null){
+ return permissionItem.getHMIPermissions().getAllowed().contains(hmiLevel) && !permissionItem.getHMIPermissions().getUserDisallowed().contains(hmiLevel);
+ } else {
+ return permissionItem.getHMIPermissions().getAllowed().contains(hmiLevel);
+ }
+ }
+
+ /**
+ * Determine if an individual RPC is allowed for the current permission items and HMI level
+ * @param rpcName rpcName FunctionID value that represents the name of the RPC
+ * @return boolean represents whether the RPC is allowed or not
+ */
+ @SuppressWarnings("WeakerAccess")
+ public boolean isRPCAllowed(@NonNull FunctionID rpcName){
+ return isRPCAllowed(rpcName, currentPermissionItems, currentHMILevel);
+ }
+
+ /**
+ * Determine if an individual permission parameter is allowed
+ * @param rpcName FunctionID value that represents the name of the RPC
+ * @param parameter String value that represents a parameter for the RPC. Ex: "rpm" or "speed" for GetVehicleData
+ * @param permissionItems Map containing HMI and parameter permissions for a specific RPC
+ * @param hmiLevel If the RPC is allowed at that HMI Level. Ex: None or Full
+ * @return boolean represents whether the permission parameter is allowed or not
+ */
+ private boolean isPermissionParameterAllowed(@NonNull FunctionID rpcName, @NonNull String parameter, Map<FunctionID, PermissionItem> permissionItems, HMILevel hmiLevel){
+ PermissionItem permissionItem = permissionItems.get(rpcName);
+ if (!isRPCAllowed(rpcName, permissionItems, hmiLevel) || permissionItem.getParameterPermissions() == null || permissionItem.getParameterPermissions().getAllowed() == null){
+ return false;
+ } else if (permissionItem.getParameterPermissions().getUserDisallowed() != null){
+ return permissionItem.getParameterPermissions().getAllowed().contains(parameter) && !permissionItem.getParameterPermissions().getUserDisallowed().contains(parameter);
+ } else {
+ return permissionItem.getParameterPermissions().getAllowed().contains(parameter);
+ }
+ }
+
+ /**
+ * Determine if an individual permission parameter is allowed for current permission items and current HMI level
+ * @param rpcName FunctionID value that represents the name of the RPC
+ * @param parameter String value that represents a parameter for the RPC
+ * @return boolean represents whether the permission parameter is allowed or not
+ */
+ @SuppressWarnings("WeakerAccess")
+ public boolean isPermissionParameterAllowed(@NonNull FunctionID rpcName, @NonNull String parameter){
+ return isPermissionParameterAllowed(rpcName, parameter, currentPermissionItems, currentHMILevel);
+ }
+
+ /**
+ * Clean up everything after the manager is no longer needed
+ */
+ @Override
+ public void dispose(){
+ super.dispose();
+
+ // Remove onHMIStatusListener
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
+ onHMIStatusListener = null;
+
+ // Remove onPermissionsChangeListener
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onPermissionsChangeListener);
+ onPermissionsChangeListener = null;
+
+ // Remove developer's listeners
+ filters.clear();
+ }
+
+ /**
+ * Determine if a group of permissions is allowed for the current HMI level
+ * @param permissionElements list of PermissionElement that represents the RPC names and their parameters
+ * @return PermissionGroupStatus int value that gives an overall view whether the permissions are allowed or not
+ * @see PermissionGroupStatus
+ */
+ @SuppressWarnings("WeakerAccess")
+ public @PermissionGroupStatus int getGroupStatusOfPermissions(@NonNull List<PermissionElement> permissionElements){
+ if (currentHMILevel == null){
+ return PERMISSION_GROUP_STATUS_UNKNOWN;
+ }
+
+ boolean hasAllowed = false;
+ boolean hasDisallowed = false;
+
+ for (PermissionElement permissionElement : permissionElements) {
+ // If at any point, we have both allowed and disallowed permissions, return the mixed result
+ if (hasAllowed && hasDisallowed) {
+ return PERMISSION_GROUP_STATUS_MIXED;
+ }
+
+ if (permissionElement == null){
+ continue;
+ } else if (!isRPCAllowed(permissionElement.getRPCName())){
+ hasDisallowed = true;
+ } else {
+ if (permissionElement.getParameters() == null || permissionElement.getParameters().size() == 0){
+ hasAllowed = true;
+ } else {
+ for (String permissionParameter : permissionElement.getParameters()) {
+ if (isPermissionParameterAllowed(permissionElement.getRPCName(), permissionParameter)) {
+ hasAllowed = true;
+ } else {
+ hasDisallowed = true;
+ }
+ }
+ }
+ }
+ }
+
+ if (!hasAllowed && !hasDisallowed){
+ return PERMISSION_GROUP_STATUS_ALLOWED;
+ } else if (hasAllowed && hasDisallowed) {
+ return PERMISSION_GROUP_STATUS_MIXED;
+ } else if (hasAllowed) {
+ return PERMISSION_GROUP_STATUS_ALLOWED;
+ } else{
+ return PERMISSION_GROUP_STATUS_DISALLOWED;
+ }
+ }
+
+ /**
+ * Determine if a group of permissions is allowed for the current HMI level
+ * This method is similar to getGroupStatusOfPermissions() but returns more detailed result about each individual permission
+ * @param permissionElements list of PermissionElement that represents the RPC names and their parameters
+ * @return a map with keys that are the passed in RPC names specifying if that RPC and its parameter permissions are currently allowed for the current HMI level
+ */
+ @SuppressWarnings("WeakerAccess")
+ public Map <FunctionID, PermissionStatus> getStatusOfPermissions(@NonNull List<PermissionElement> permissionElements){
+ Map<FunctionID, PermissionStatus> statusOfPermissions = new HashMap<>();
+ for (PermissionElement permissionElement : permissionElements) {
+ if (permissionElement == null){
+ continue;
+ }
+ Map<String, Boolean> allowedParameters = null;
+ if (permissionElement.getParameters() != null && permissionElement.getParameters().size() > 0) {
+ allowedParameters = new HashMap<>();
+ for (String permissionParameter : permissionElement.getParameters()) {
+ allowedParameters.put(permissionParameter, isPermissionParameterAllowed(permissionElement.getRPCName(), permissionParameter));
+ }
+ }
+ PermissionStatus permissionStatus = new PermissionStatus(permissionElement.getRPCName(), isRPCAllowed(permissionElement.getRPCName()), allowedParameters);
+ statusOfPermissions.put(permissionElement.getRPCName(), permissionStatus);
+ }
+ return statusOfPermissions;
+ }
+
+ /**
+ * Call the listener for a specific filter
+ * @param filter the permission filter to cal
+ */
+ private void notifyListener(@NonNull PermissionFilter filter){
+ int permissionGroupStatus = getGroupStatusOfPermissions(filter.getPermissionElements());
+ Map <FunctionID, PermissionStatus> allowedPermissions = getStatusOfPermissions(filter.getPermissionElements());
+ filter.getListener().onPermissionsChange(allowedPermissions, permissionGroupStatus);
+ }
+
+ /**
+ * Add a listener to be called when there is permissions change
+ * @param permissionElements list of PermissionElement that represents the RPC names and their parameters
+ * @param groupType PermissionGroupType int value represents whether we need the listener to be called when there is any permissions change or only when all permission become allowed
+ * @param listener OnPermissionChangeListener interface
+ * @return unique uuid number for the listener. It can be used to remove the listener later.
+ */
+ @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"})
+ public UUID addListener(@NonNull List<PermissionElement> permissionElements, @PermissionGroupType int groupType, @NonNull OnPermissionChangeListener listener){
+ PermissionFilter filter = new PermissionFilter(null, permissionElements, groupType, listener);
+ filters.add(filter);
+ return filter.getIdentifier();
+ }
+
+ /**
+ * Removes specific listener
+ * @param listenerId the id of the listener
+ */
+ @SuppressWarnings("WeakerAccess")
+ public void removeListener(@NonNull UUID listenerId){
+ for (PermissionFilter filter : filters) {
+ if (filter.getIdentifier().equals(listenerId)) {
+ filters.remove(filter);
+ break;
+ }
+ }
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java b/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java
new file mode 100644
index 000000000..160d94e83
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.permission;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+
+import java.util.Map;
+
+/**
+ * OnPermissionChangeListener is a listener which includes a callback method that can be called when there are permission changes
+ */
+public interface OnPermissionChangeListener {
+ /**
+ * Call back method that PermissionManager will call to inform the developer about permission changes
+ * @param allowedPermissions an overall view about the status of the permissions
+ * @param permissionGroupStatus a detailed view about which permissions are allowed and which ones are not
+ * @see PermissionManager.PermissionGroupStatus
+ */
+ void onPermissionsChange(@NonNull Map<FunctionID, PermissionStatus> allowedPermissions, @NonNull @PermissionManager.PermissionGroupStatus int permissionGroupStatus);
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java
new file mode 100644
index 000000000..6a3d2ab0c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.permission;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+
+import java.util.List;
+
+/**
+ * PermissionElement holds the RPC name that the developer wants to add a listener for.
+ * It also holds any permission parameters for that RPC that the developer wants to track as well.
+ */
+public class PermissionElement {
+ private final FunctionID rpcName;
+ private final List<String> parameters;
+
+ /**
+ * Create a new instance of PermissionElement
+ * @param rpcName
+ * @param parameters
+ */
+ public PermissionElement(@NonNull FunctionID rpcName, List<String> parameters){
+ this.rpcName = rpcName;
+ this.parameters = parameters;
+ }
+
+ /**
+ * Get the RPC name
+ * @return FunctionID value represents the RPC name
+ */
+ public FunctionID getRPCName() {
+ return rpcName;
+ }
+
+ /**
+ * Get the permission parameters for the RPC
+ * @return List<String> represents the permission parameters for the RPC
+ */
+ public List<String> getParameters() {
+ return parameters;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java
new file mode 100644
index 000000000..740aca7b6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.permission;
+
+import android.support.annotation.NonNull;
+
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * PermissionFilter holds all the required information for a specific OnPermissionChangeListener
+ */
+class PermissionFilter {
+ private final UUID identifier;
+ private final List<PermissionElement> permissionElements;
+ private final int groupType;
+ private final OnPermissionChangeListener listener;
+
+ /**
+ * Creates a new instance of PermissionFilter
+ * @param identifier
+ * @param permissionElements
+ * @param groupType
+ * @param listener
+ * @see com.smartdevicelink.managers.permission.PermissionManager.PermissionGroupType
+ */
+ PermissionFilter(UUID identifier, @NonNull List<PermissionElement> permissionElements, @NonNull @PermissionManager.PermissionGroupType int groupType, @NonNull OnPermissionChangeListener listener) {
+ if (identifier == null) {
+ this.identifier = UUID.randomUUID();
+ } else {
+ this.identifier = identifier;
+ }
+ this.permissionElements = permissionElements;
+ this.groupType = groupType;
+ this.listener = listener;
+ }
+
+ /**
+ * Get the unique id for the listener
+ * @return UUID object represents the id for the listener
+ */
+ protected UUID getIdentifier() {
+ return identifier;
+ }
+
+ /**
+ * Get the permission elements that the developer wants to add a listener for
+ * @return List<PermissionElement> represents the RPCs and their parameters that the developer wants to add a listener for
+ */
+ protected List<PermissionElement> getPermissionElements() {
+ return permissionElements;
+ }
+
+ /**
+ * Get how we want the listener to be called: when any change happens? or when all permissions become allowed?
+ * @return PermissionGroupType int value represents whether the developer needs the listener to be called when there is any permissions change or only when all permission become allowed
+ * @see com.smartdevicelink.managers.permission.PermissionManager.PermissionGroupType
+ */
+ protected @PermissionManager.PermissionGroupType int getGroupType() {
+ return groupType;
+ }
+
+ /**
+ * Get the listener object
+ * @return OnPermissionChangeListener object represents the listener for that filter
+ */
+ protected OnPermissionChangeListener getListener() {
+ return listener;
+ }
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java
new file mode 100644
index 000000000..46256efbe
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.permission;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+
+import java.util.Map;
+
+/**
+ * PermissionStatus gives a detailed view about whether an RPC and its permission parameters are allowed or not
+ */
+public class PermissionStatus {
+ private final FunctionID rpcName;
+ private boolean isRPCAllowed;
+ private Map<String, Boolean> allowedParameters;
+
+ /**
+ * Creates a new PermissionStatus instance
+ * @param rpcName
+ * @param isRPCAllowed
+ * @param allowedParameters
+ */
+ public PermissionStatus(@NonNull FunctionID rpcName, @NonNull boolean isRPCAllowed, Map<String, Boolean> allowedParameters) {
+ this.rpcName = rpcName;
+ this.isRPCAllowed = isRPCAllowed;
+ this.allowedParameters = allowedParameters;
+ }
+
+ /**
+ * Get the name of the RPC
+ * @return FunctionID value represents the name of the RPC
+ */
+ public FunctionID getRPCName() {
+ return rpcName;
+ }
+
+ /**
+ * Get whether the RCP is allowed or not
+ * @return boolean represents whether the RCP is allowed or not
+ */
+ public boolean getIsRPCAllowed() {
+ return isRPCAllowed;
+ }
+
+ /**
+ * Set whether the RPC is allowed or not
+ * @param isRPCAllowed
+ */
+ protected void setIsRPCAllowed(@NonNull boolean isRPCAllowed) {
+ this.isRPCAllowed = isRPCAllowed;
+ }
+
+ /**
+ * Get the status of the permission parameter for the RPC
+ * @return Map<String, Boolean> object with keys that represent the permission parameter names and values that represent whether the parameters are allowed or not
+ */
+ public Map<String, Boolean> getAllowedParameters() {
+ return allowedParameters;
+ }
+
+ /**
+ * Set the status of the permission parameter for the RPC
+ * @param allowedParameters
+ */
+ protected void setAllowedParameters(Map<String, Boolean> allowedParameters) {
+ this.allowedParameters = allowedParameters;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java
new file mode 100644
index 000000000..74ba6fc58
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.enums.MetadataType;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+import com.smartdevicelink.util.DebugTool;
+
+import java.lang.ref.WeakReference;
+import java.util.List;
+
+/**
+ * <strong>ScreenManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+*/
+abstract class BaseScreenManager extends BaseSubManager {
+
+ private static String TAG = "ScreenManager";
+ private final WeakReference<FileManager> fileManager;
+ private SoftButtonManager softButtonManager;
+ private TextAndGraphicManager textAndGraphicManager;
+
+ // Sub manager listener
+ private final CompletionListener subManagerListener = new CompletionListener() {
+ @Override
+ public synchronized void onComplete(boolean success) {
+ if (softButtonManager != null && textAndGraphicManager != null) {
+ if (softButtonManager.getState() == BaseSubManager.READY && textAndGraphicManager.getState() == BaseSubManager.READY) {
+ DebugTool.logInfo("Starting screen manager, all sub managers are in ready state");
+ transitionToState(READY);
+ } else if (softButtonManager.getState() == BaseSubManager.ERROR && textAndGraphicManager.getState() == BaseSubManager.ERROR) {
+ Log.e(TAG, "ERROR starting screen manager, both sub managers in error state");
+ transitionToState(ERROR);
+ } else if (textAndGraphicManager.getState() == BaseSubManager.SETTING_UP || softButtonManager.getState() == BaseSubManager.SETTING_UP) {
+ DebugTool.logInfo("SETTING UP screen manager, one sub manager is still setting up");
+ transitionToState(SETTING_UP);
+ } else {
+ Log.w(TAG, "LIMITED starting screen manager, one sub manager in error state and the other is ready");
+ transitionToState(LIMITED);
+ }
+ } else {
+ // We should never be here, but somehow one of the sub-sub managers is null
+ Log.e(TAG, "ERROR one of the screen sub managers is null");
+ transitionToState(ERROR);
+ }
+ }
+ };
+
+ BaseScreenManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) {
+ super(internalInterface);
+ this.fileManager = new WeakReference<>(fileManager);
+ initialize();
+ }
+
+ @Override
+ public void start(CompletionListener listener) {
+ super.start(listener);
+ this.softButtonManager.start(subManagerListener);
+ this.textAndGraphicManager.start(subManagerListener);
+ }
+
+ private void initialize(){
+ if (fileManager.get() != null) {
+ this.softButtonManager = new SoftButtonManager(internalInterface, fileManager.get());
+ this.textAndGraphicManager = new TextAndGraphicManager(internalInterface, fileManager.get(), softButtonManager);
+ }
+ }
+
+ /**
+ * <p>Called when manager is being torn down</p>
+ */
+ @Override
+ public void dispose() {
+ softButtonManager.dispose();
+ textAndGraphicManager.dispose();
+ super.dispose();
+ }
+
+ /**
+ * Set the textField1 on the head unit screen
+ * Sending an empty String "" will clear the field
+ * @param textField1 String value represents the textField1
+ */
+ public void setTextField1(String textField1) {
+ this.softButtonManager.setCurrentMainField1(textField1);
+ this.textAndGraphicManager.setTextField1(textField1);
+ }
+
+ /**
+ * Get the current textField1 value
+ * @return a String value represents the current textField1 value
+ */
+ public String getTextField1() {
+ return this.textAndGraphicManager.getTextField1();
+ }
+
+ /**
+ * Set the textField2 on the head unit screen
+ * Sending an empty String "" will clear the field
+ * @param textField2 String value represents the textField1
+ */
+ public void setTextField2(String textField2) {
+ this.textAndGraphicManager.setTextField2(textField2);
+ }
+
+ /**
+ * Get the current textField2 value
+ * @return a String value represents the current textField2 value
+ */
+ public String getTextField2() {
+ return this.textAndGraphicManager.getTextField2();
+ }
+
+ /**
+ * Set the textField3 on the head unit screen
+ * Sending an empty String "" will clear the field
+ * @param textField3 String value represents the textField1
+ */
+ public void setTextField3(String textField3) {
+ this.textAndGraphicManager.setTextField3(textField3);
+ }
+
+ /**
+ * Get the current textField3 value
+ * @return a String value represents the current textField3 value
+ */
+ public String getTextField3() {
+ return this.textAndGraphicManager.getTextField3();
+ }
+
+ /**
+ * Set the textField4 on the head unit screen
+ * Sending an empty String "" will clear the field
+ * @param textField4 String value represents the textField1
+ */
+ public void setTextField4(String textField4) {
+ this.textAndGraphicManager.setTextField4(textField4);
+ }
+
+ /**
+ * Get the current textField4 value
+ * @return a String value represents the current textField4 value
+ */
+ public String getTextField4() {
+ return this.textAndGraphicManager.getTextField4();
+ }
+
+ /**
+ * Set the mediaTrackTextField on the head unit screen
+ * @param mediaTrackTextField String value represents the mediaTrackTextField
+ */
+ public void setMediaTrackTextField(String mediaTrackTextField) {
+ this.textAndGraphicManager.setMediaTrackTextField(mediaTrackTextField);
+ }
+
+ /**
+ * Get the current mediaTrackTextField value
+ * @return a String value represents the current mediaTrackTextField
+ */
+ public String getMediaTrackTextField() {
+ return this.textAndGraphicManager.getMediaTrackTextField();
+ }
+
+ /**
+ * Set the primaryGraphic on the head unit screen
+ * @param primaryGraphic an SdlArtwork object represents the primaryGraphic
+ */
+ public void setPrimaryGraphic(SdlArtwork primaryGraphic) {
+ if (primaryGraphic == null){
+ primaryGraphic = textAndGraphicManager.getBlankArtwork();
+ }
+ this.textAndGraphicManager.setPrimaryGraphic(primaryGraphic);
+ }
+
+ /**
+ * Get the current primaryGraphic value
+ * @return an SdlArtwork object represents the current primaryGraphic
+ */
+ public SdlArtwork getPrimaryGraphic() {
+ return this.textAndGraphicManager.getPrimaryGraphic();
+ }
+
+ /**
+ * Set the secondaryGraphic on the head unit screen
+ * @param secondaryGraphic an SdlArtwork object represents the secondaryGraphic
+ */
+ public void setSecondaryGraphic(SdlArtwork secondaryGraphic) {
+ if (secondaryGraphic == null){
+ secondaryGraphic = textAndGraphicManager.getBlankArtwork();
+ }
+ this.textAndGraphicManager.setSecondaryGraphic(secondaryGraphic);
+ }
+
+ /**
+ * Get the current secondaryGraphic value
+ * @return an SdlArtwork object represents the current secondaryGraphic
+ */
+ public SdlArtwork getSecondaryGraphic() {
+ return this.textAndGraphicManager.getSecondaryGraphic();
+ }
+
+ /**
+ * Set the alignment for the text fields
+ * @param textAlignment TextAlignment value represents the alignment for the text fields
+ */
+ public void setTextAlignment(TextAlignment textAlignment) {
+ this.textAndGraphicManager.setTextAlignment(textAlignment);
+ }
+
+ /**
+ * Get the alignment for the text fields
+ * @return a TextAlignment value represents the alignment for the text fields
+ */
+ public TextAlignment getTextAlignment() {
+ return this.textAndGraphicManager.getTextAlignment();
+ }
+
+ /**
+ * Set the metadata type for the textField1
+ * @param textField1Type a MetadataType value represents the metadata for textField1
+ */
+ public void setTextField1Type(MetadataType textField1Type) {
+ this.textAndGraphicManager.setTextField1Type(textField1Type);
+ }
+
+ /**
+ * Get the metadata type for textField1
+ * @return a MetadataType value represents the metadata for textField1
+ */
+ public MetadataType getTextField1Type() {
+ return this.textAndGraphicManager.getTextField1Type();
+ }
+
+ /**
+ * Set the metadata type for the textField2
+ * @param textField2Type a MetadataType value represents the metadata for textField2
+ */
+ public void setTextField2Type(MetadataType textField2Type) {
+ this.textAndGraphicManager.setTextField2Type(textField2Type);
+ }
+
+ /**
+ * Get the metadata type for textField2
+ * @return a MetadataType value represents the metadata for textField2
+ */
+ public MetadataType getTextField2Type() {
+ return this.textAndGraphicManager.getTextField2Type();
+ }
+
+ /**
+ * Set the metadata type for the textField3
+ * @param textField3Type a MetadataType value represents the metadata for textField3
+ */
+ public void setTextField3Type(MetadataType textField3Type) {
+ this.textAndGraphicManager.setTextField3Type(textField3Type);
+ }
+
+ /**
+ * Get the metadata type for textField3
+ * @return a MetadataType value represents the metadata for textField3
+ */
+ public MetadataType getTextField3Type() {
+ return this.textAndGraphicManager.getTextField3Type();
+ }
+
+ /**
+ * Set the metadata type for the textField4
+ * @param textField4Type a MetadataType value represents the metadata for textField4
+ */
+ public void setTextField4Type(MetadataType textField4Type) {
+ this.textAndGraphicManager.setTextField4Type(textField4Type);
+ }
+
+ /**
+ * Get the metadata type for textField4
+ * @return a MetadataType value represents the metadata for textField4
+ */
+ public MetadataType getTextField4Type() {
+ return this.textAndGraphicManager.getTextField4Type();
+ }
+
+ /**
+ * Set softButtonObjects list and upload the images to the head unit
+ * @param softButtonObjects the list of the SoftButtonObject values that should be displayed on the head unit
+ */
+ public void setSoftButtonObjects(@NonNull List<SoftButtonObject> softButtonObjects) {
+ softButtonManager.setSoftButtonObjects(softButtonObjects);
+ }
+
+ /**
+ * Get the soft button objects list
+ * @return a List<SoftButtonObject>
+ */
+ public List<SoftButtonObject> getSoftButtonObjects() {
+ return softButtonManager.getSoftButtonObjects();
+ }
+
+ /**
+ * Get the SoftButtonObject that has the provided name
+ * @param name a String value that represents the name
+ * @return a SoftButtonObject
+ */
+ public SoftButtonObject getSoftButtonObjectByName(@NonNull String name){
+ return softButtonManager.getSoftButtonObjectByName(name);
+ }
+
+ /**
+ * Get the SoftButtonObject that has the provided buttonId
+ * @param buttonId a int value that represents the id of the button
+ * @return a SoftButtonObject
+ */
+ public SoftButtonObject getSoftButtonObjectById(int buttonId){
+ return softButtonManager.getSoftButtonObjectById(buttonId);
+ }
+
+ /**
+ * Begin a multiple updates transaction. The updates will be applied when commit() is called<br>
+ * Note: if we don't use beginTransaction & commit, every update will be sent individually.
+ */
+ public void beginTransaction(){
+ softButtonManager.setBatchUpdates(true);
+ textAndGraphicManager.setBatchUpdates(true);
+ }
+
+ /**
+ * Send the updates that were started after beginning the transaction
+ * @param listener a CompletionListener that has a callback that will be called when the updates are finished
+ */
+ public void commit(final CompletionListener listener){
+ softButtonManager.setBatchUpdates(false);
+ softButtonManager.update(new CompletionListener() {
+ boolean updateSuccessful = true;
+ @Override
+ public void onComplete(boolean success) {
+ if (!success){
+ updateSuccessful = false;
+ }
+ textAndGraphicManager.setBatchUpdates(false);
+ textAndGraphicManager.update(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ if (!success){
+ updateSuccessful = false;
+ }
+ if (listener != null) {
+ listener.onComplete(updateSuccessful);
+ }
+ }
+ });
+ }
+ });
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java
new file mode 100644
index 000000000..5a6c229e7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java
@@ -0,0 +1,607 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.OnButtonEvent;
+import com.smartdevicelink.proxy.rpc.OnButtonPress;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+import com.smartdevicelink.util.DebugTool;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * <strong>SoftButtonManager</strong> <br>
+ * SoftButtonManager gives the developer the ability to control how soft buttons are displayed on the head unit.<br>
+ * Note: This class must be accessed through the SdlManager->ScreenManager. Do not instantiate it by itself.<br>
+ */
+abstract class BaseSoftButtonManager extends BaseSubManager {
+
+ private static final String TAG = "SoftButtonManager";
+ private WeakReference<FileManager> fileManager;
+ private DisplayCapabilities displayCapabilities;
+ private SoftButtonCapabilities softButtonCapabilities;
+ private CopyOnWriteArrayList<SoftButtonObject> softButtonObjects;
+ private HMILevel currentHMILevel;
+ private Show inProgressShowRPC;
+ private CompletionListener inProgressListener, queuedUpdateListener, cachedListener;
+ private boolean hasQueuedUpdate, batchUpdates, waitingOnHMILevelUpdateToSetButtons;
+ private final OnSystemCapabilityListener onSoftButtonCapabilitiesListener, onDisplayCapabilitiesListener;
+ private final OnRPCNotificationListener onHMIStatusListener, onButtonPressListener, onButtonEventListener;
+ private final SoftButtonObject.UpdateListener updateListener;
+
+ /**
+ * HAX: This is necessary due to a Ford Sync 3 bug that doesn't like Show requests without a main field being set (it will accept them, but with a GENERIC_ERROR, and 10-15 seconds late...)
+ */
+ private String currentMainField1;
+
+
+ /**
+ * Creates a new instance of the SoftButtonManager
+ * @param internalInterface an instance of the ISdl interface that can be used for common SDL operations (sendRpc, addRpcListener, etc)
+ * @param fileManager an instance of the FileManager so that button graphics can be sent
+ */
+ BaseSoftButtonManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) {
+ super(internalInterface);
+ this.fileManager = new WeakReference<>(fileManager);
+ this.softButtonObjects = new CopyOnWriteArrayList<>();
+ this.currentHMILevel = HMILevel.HMI_NONE; // Assume NONE until we get something else
+ this.waitingOnHMILevelUpdateToSetButtons = false;
+ this.updateListener = new SoftButtonObject.UpdateListener() {
+ @Override
+ public void onUpdate() {
+ update(null);
+ }
+ };
+
+
+ // Add OnSoftButtonCapabilitiesListener to keep softButtonCapabilities updated
+ onSoftButtonCapabilitiesListener = new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ List<SoftButtonCapabilities> softButtonCapabilitiesList = (List<SoftButtonCapabilities>) capability;
+ if (softButtonCapabilitiesList != null && !softButtonCapabilitiesList.isEmpty()) {
+ softButtonCapabilities = softButtonCapabilitiesList.get(0);
+ } else {
+ softButtonCapabilities = null;
+ }
+ }
+
+ @Override
+ public void onError(String info) {
+ Log.w(TAG, "SoftButton Capability cannot be retrieved:");
+ softButtonCapabilities = null;
+ }
+ };
+ this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.SOFTBUTTON, onSoftButtonCapabilitiesListener);
+
+
+ // Add OnDisplayCapabilitiesListener to keep displayCapabilities updated
+ onDisplayCapabilitiesListener = new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ displayCapabilities = (DisplayCapabilities) capability;
+ }
+
+ @Override
+ public void onError(String info) {
+ Log.w(TAG, "Display Capability cannot be retrieved:");
+ displayCapabilities = null;
+ }
+ };
+ this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAY, onDisplayCapabilitiesListener);
+
+
+ // Add OnHMIStatusListener to keep currentHMILevel updated
+ this.onHMIStatusListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+
+ OnHMIStatus onHMIStatus = (OnHMIStatus) notification;
+ HMILevel oldHmiLevel = currentHMILevel;
+ currentHMILevel = onHMIStatus.getHmiLevel();
+
+
+ // Auto-send an updated show if we were in NONE and now we are not
+ if (oldHmiLevel == HMILevel.HMI_NONE && currentHMILevel != HMILevel.HMI_NONE) {
+ if (waitingOnHMILevelUpdateToSetButtons) {
+ setSoftButtonObjects(softButtonObjects);
+ } else {
+ update(cachedListener);
+ }
+ }
+ }
+ };
+ this.internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
+
+
+ // Add OnButtonPressListener to notify SoftButtonObjects when there is a button press
+ this.onButtonPressListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnButtonPress onButtonPress = (OnButtonPress) notification;
+ if (onButtonPress!= null && onButtonPress.getButtonName() == ButtonName.CUSTOM_BUTTON) {
+ Integer buttonId = onButtonPress.getCustomButtonName();
+ if (getSoftButtonObjects() != null) {
+ for (SoftButtonObject softButtonObject : getSoftButtonObjects()) {
+ if (softButtonObject.getButtonId() == buttonId && softButtonObject.getOnEventListener() != null) {
+ softButtonObject.getOnEventListener().onPress(getSoftButtonObjectById(buttonId), onButtonPress);
+ break;
+ }
+ }
+ }
+ }
+ }
+ };
+ this.internalInterface.addOnRPCNotificationListener(FunctionID.ON_BUTTON_PRESS, onButtonPressListener);
+
+
+ // Add OnButtonEventListener to notify SoftButtonObjects when there is a button event
+ this.onButtonEventListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnButtonEvent onButtonEvent = (OnButtonEvent) notification;
+ if (onButtonEvent!= null && onButtonEvent.getButtonName() == ButtonName.CUSTOM_BUTTON) {
+ Integer buttonId = onButtonEvent.getCustomButtonID();
+ if (getSoftButtonObjects() != null) {
+ for (SoftButtonObject softButtonObject : getSoftButtonObjects()) {
+ if (softButtonObject.getButtonId() == buttonId && softButtonObject.getOnEventListener() != null) {
+ softButtonObject.getOnEventListener().onEvent(getSoftButtonObjectById(buttonId), onButtonEvent);
+ break;
+ }
+ }
+ }
+ }
+ }
+ };
+ this.internalInterface.addOnRPCNotificationListener(FunctionID.ON_BUTTON_EVENT, onButtonEventListener);
+ }
+
+ @Override
+ public void start(CompletionListener listener) {
+ transitionToState(READY);
+ super.start(listener);
+ }
+
+ /**
+ * Get the SoftButtonObject that has the provided name
+ * @param name a String value that represents the name
+ * @return a SoftButtonObject
+ */
+ protected SoftButtonObject getSoftButtonObjectByName(String name) {
+ for (SoftButtonObject softButtonObject : softButtonObjects) {
+ if (softButtonObject.getName().equals(name)) {
+ return softButtonObject;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get the SoftButtonObject that has the provided buttonId
+ * @param buttonId a int value that represents the id of the button
+ * @return a SoftButtonObject
+ */
+ protected SoftButtonObject getSoftButtonObjectById(int buttonId) {
+ for (SoftButtonObject softButtonObject : softButtonObjects) {
+ if (softButtonObject.getButtonId() == buttonId) {
+ return softButtonObject;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get the soft button objects list
+ * @return a List<SoftButtonObject>
+ */
+ protected List<SoftButtonObject> getSoftButtonObjects() {
+ return softButtonObjects;
+ }
+
+ /**
+ * Set softButtonObjects list and upload the images to the head unit
+ * @param list the list of the SoftButtonObject values that should be displayed on the head unit
+ */
+ protected void setSoftButtonObjects(@NonNull List<SoftButtonObject> list) {
+ // Convert the List to CopyOnWriteArrayList
+ CopyOnWriteArrayList<SoftButtonObject> softButtonObjects;
+ if(list instanceof CopyOnWriteArrayList){
+ softButtonObjects = (CopyOnWriteArrayList<SoftButtonObject>) list;
+ }else{
+ softButtonObjects = new CopyOnWriteArrayList<>(list);
+ }
+
+
+ if (hasTwoSoftButtonObjectsOfSameName(softButtonObjects)) {
+ this.softButtonObjects = new CopyOnWriteArrayList<>();
+ Log.e(TAG, "Attempted to set soft button objects, but two buttons had the same name");
+ return;
+ }
+
+ // Set ids and updateListeners for soft button objects
+ for (int i = 0; i < softButtonObjects.size(); i++) {
+ softButtonObjects.get(i).setButtonId(i * 100);
+ softButtonObjects.get(i).setUpdateListener(updateListener);
+ }
+ this.softButtonObjects = softButtonObjects;
+
+
+ if (currentHMILevel == null || currentHMILevel == HMILevel.HMI_NONE) {
+ waitingOnHMILevelUpdateToSetButtons = true;
+ return;
+ }
+
+
+ // End any in-progress update
+ inProgressShowRPC = null;
+ if (inProgressListener != null) {
+ inProgressListener.onComplete(false);
+ inProgressListener = null;
+ }
+
+
+ // End any queued update
+ hasQueuedUpdate = false;
+ if (queuedUpdateListener != null) {
+ queuedUpdateListener.onComplete(false);
+ queuedUpdateListener = null;
+ }
+
+
+ // Prepare soft button images to be uploaded to the head unit.
+ // we will prepare a list for initial state images and another list for other state images
+ // so we can upload the initial state images first, then the other states images.
+ List<SdlArtwork> initialStatesToBeUploaded = new ArrayList<>();
+ List<SdlArtwork> otherStatesToBeUploaded = new ArrayList<>();
+ if (softButtonImagesSupported() && fileManager.get() != null) {
+ for (SoftButtonObject softButtonObject : softButtonObjects) {
+ SoftButtonState initialState = null;
+ if (softButtonObject != null) {
+ initialState = softButtonObject.getCurrentState();
+ }
+ if (initialState != null && softButtonObject.getStates() != null) {
+ for (SoftButtonState softButtonState : softButtonObject.getStates()) {
+ if (softButtonState != null && softButtonState.getName() != null && sdlArtworkNeedsUpload(softButtonState.getArtwork())) {
+ if (softButtonState.getName().equals(initialState.getName())) {
+ initialStatesToBeUploaded.add(softButtonObject.getCurrentState().getArtwork());
+ } else{
+ otherStatesToBeUploaded.add(softButtonState.getArtwork());
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ // Upload initial state images
+ if (initialStatesToBeUploaded.size() > 0 && fileManager.get() != null) {
+ DebugTool.logInfo( "Uploading soft button initial state artworks");
+ fileManager.get().uploadArtworks(initialStatesToBeUploaded, new MultipleFileCompletionListener() {
+ @Override
+ public void onComplete(Map<String, String> errors) {
+ if (errors != null && errors.size() > 0) {
+ Log.e(TAG, "Error uploading soft button artworks");
+ }
+ DebugTool.logInfo( "Soft button initial artworks uploaded");
+ update(cachedListener);
+ }
+ });
+ }
+
+
+ // Upload other state images
+ if (otherStatesToBeUploaded.size() > 0 && fileManager.get() != null) {
+ DebugTool.logInfo("Uploading soft button other state artworks");
+ fileManager.get().uploadArtworks(otherStatesToBeUploaded, new MultipleFileCompletionListener() {
+ @Override
+ public void onComplete(Map<String, String> errors) {
+ if (errors != null && errors.size() > 0) {
+ Log.e(TAG, "Error uploading soft button artworks");
+ }
+ DebugTool.logInfo("Soft button other state artworks uploaded");
+ // In case our soft button states have changed in the meantime
+ update(cachedListener);
+ }
+ });
+ }
+
+ // This is necessary because there may be no images needed to be uploaded
+ update(cachedListener);
+ }
+
+ /**
+ * Update the SoftButtonManger by sending a new Show RPC to reflect the changes
+ * @param listener a CompletionListener
+ */
+ protected void update(CompletionListener listener) {
+ cachedListener = listener;
+
+ if (batchUpdates) {
+ return;
+ }
+
+ // Don't send if we're in HMI NONE
+ if (currentHMILevel == null || currentHMILevel == HMILevel.HMI_NONE) {
+ return;
+ }
+
+ DebugTool.logInfo("Updating soft buttons");
+
+ cachedListener = null;
+
+
+ // Check if we have update already in progress
+ if (inProgressShowRPC != null) {
+ DebugTool.logInfo("In progress update exists, queueing update");
+ // If we already have a pending update, we're going to tell the old listener that it was superseded by a new update and then return
+ if (queuedUpdateListener != null) {
+ DebugTool.logInfo("Queued update already exists, superseding previous queued update");
+ queuedUpdateListener.onComplete(false);
+ queuedUpdateListener = null;
+ }
+
+ // Note: the queued update will be started after the in-progress one finishes
+ if (listener != null) {
+ queuedUpdateListener = listener;
+ }
+ hasQueuedUpdate = true;
+ return;
+ }
+
+
+ // Send Show RPC with soft buttons representing the current state for the soft button objects
+ inProgressListener = listener;
+ inProgressShowRPC = new Show();
+ inProgressShowRPC.setMainField1(getCurrentMainField1());
+ if (softButtonObjects == null) {
+ DebugTool.logInfo("Soft button objects are null, sending an empty array");
+ inProgressShowRPC.setSoftButtons(new ArrayList<SoftButton>());
+ } else if ((currentStateHasImages() && !allCurrentStateImagesAreUploaded()) || !softButtonImagesSupported()) {
+ // The images don't yet exist on the head unit, or we cannot use images, send a text update if possible, otherwise, don't send anything yet
+ List<SoftButton> textOnlySoftButtons = createTextSoftButtonsForCurrentState();
+ if (textOnlySoftButtons != null) {
+ DebugTool.logInfo( "Soft button images unavailable, sending text buttons");
+ inProgressShowRPC.setSoftButtons(textOnlySoftButtons);
+
+ } else {
+ DebugTool.logInfo( "Soft button images unavailable, text buttons unavailable");
+ inProgressShowRPC = null;
+ return;
+ }
+
+ } else {
+ DebugTool.logInfo( "Sending soft buttons with images");
+ inProgressShowRPC.setSoftButtons(createSoftButtonsForCurrentState());
+ }
+
+
+ inProgressShowRPC.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ DebugTool.logInfo("Soft button update completed");
+ handleResponse(true);
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ super.onError(correlationId, resultCode, info);
+
+ Log.e(TAG, "Soft button update error");
+ handleResponse(false);
+
+ }
+
+ private void handleResponse(boolean success){
+
+ inProgressShowRPC = null;
+ CompletionListener currentListener;
+ if (inProgressListener != null) {
+ currentListener = inProgressListener;
+ inProgressListener = null;
+ currentListener.onComplete(success);
+ }
+
+
+ if (hasQueuedUpdate) {
+ DebugTool.logInfo("Queued update exists, sending another update");
+ currentListener = queuedUpdateListener;
+ queuedUpdateListener = null;
+ hasQueuedUpdate = false;
+ update(currentListener);
+ }
+ }
+ });
+
+
+ internalInterface.sendRPCRequest(inProgressShowRPC);
+ }
+
+ private boolean softButtonImagesSupported(){
+ return (displayCapabilities == null || displayCapabilities.getGraphicSupported()) && (softButtonCapabilities == null || softButtonCapabilities.getImageSupported());
+ }
+
+ /**
+ * Check if two SoftButtonObject have the same name
+ * @param softButtonObjects a list of SoftButton objects that will be iterated through
+ * @return true if two buttons exist that are the same in the list, false if not
+ */
+ private boolean hasTwoSoftButtonObjectsOfSameName(List<SoftButtonObject> softButtonObjects) {
+ for (int i = 0; i < softButtonObjects.size(); i++) {
+ String buttonName = softButtonObjects.get(i).getName();
+ for (int j = (i + 1); j < softButtonObjects.size(); j++) {
+ if (softButtonObjects.get(j).getName().equals(buttonName)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Get the current String associated with MainField1
+ * @return the string that is currently used for MainField1
+ */
+ protected String getCurrentMainField1() {
+ if (currentMainField1 == null){
+ return "";
+ }
+ return currentMainField1;
+ }
+
+ /**
+ * Sets the String to be associated with MainField1
+ * @param currentMainField1 the String that will be set to TextField1 on the current template
+ */
+ protected void setCurrentMainField1(String currentMainField1) {
+ this.currentMainField1 = currentMainField1;
+ }
+
+ /**
+ * Sets the batchUpdates flag that represents whether the manager should wait until commit() is called to send the updated show RPC
+ * @param batchUpdates Set true if the manager should batch updates together, or false if it should send them as soon
+ * as they happen
+ */
+ protected void setBatchUpdates(boolean batchUpdates) {
+ this.batchUpdates = batchUpdates;
+ }
+
+ /**
+ * Clean up everything after the manager is no longer needed
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+
+ // Remove listeners
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_BUTTON_PRESS, onButtonPressListener);
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_BUTTON_EVENT, onButtonEventListener);
+ internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.SOFTBUTTON, onSoftButtonCapabilitiesListener);
+ internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAY, onDisplayCapabilitiesListener);
+ }
+
+ /**
+ * Check if the current state for any SoftButtonObject has images
+ * @return a boolean value
+ */
+ private boolean currentStateHasImages() {
+ for (SoftButtonObject softButtonObject : this.softButtonObjects) {
+ if (softButtonObject.getCurrentState() != null && softButtonObject.getCurrentState().getArtwork() != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Check if the current state for any SoftButtonObject has images that are not uploaded yet
+ * @return a boolean value
+ */
+ private boolean allCurrentStateImagesAreUploaded() {
+ if (fileManager.get() != null) {
+ for (SoftButtonObject softButtonObject : softButtonObjects) {
+ SoftButtonState currentState = softButtonObject.getCurrentState();
+ if (currentState != null && sdlArtworkNeedsUpload(currentState.getArtwork())) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private boolean sdlArtworkNeedsUpload(SdlArtwork artwork){
+ if (fileManager.get() != null) {
+ return artwork != null && !fileManager.get().hasUploadedFile(artwork) && !artwork.isStaticIcon();
+ }
+ return false;
+ }
+
+ /**
+ * Returns text soft buttons representing the initial states of the button objects, or null if _any_ of the buttons' current states are image only buttons.
+ * @return The text soft buttons
+ */
+ private List<SoftButton> createTextSoftButtonsForCurrentState() {
+ List<SoftButton> textButtons = new ArrayList<>();
+ for (SoftButtonObject softButtonObject : softButtonObjects) {
+ SoftButton softButton = softButtonObject.getCurrentStateSoftButton();
+ if (softButton.getText() == null) {
+ return null;
+ }
+ // We should create a new softButtonObject rather than modifying the original one
+ SoftButton textOnlySoftButton = new SoftButton(SoftButtonType.SBT_TEXT, softButton.getSoftButtonID());
+ textOnlySoftButton.setText(softButton.getText());
+ textButtons.add(textOnlySoftButton);
+ }
+ return textButtons;
+ }
+
+ /**
+ * Returns a list of the SoftButton for the SoftButtonObjects' current state
+ * @return a List<SoftButton>
+ */
+ protected List<SoftButton> createSoftButtonsForCurrentState() {
+ List<SoftButton> softButtons = new ArrayList<>();
+ for (SoftButtonObject softButtonObject : softButtonObjects) {
+ softButtons.add(softButtonObject.getCurrentStateSoftButton());
+ }
+ return softButtons;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
new file mode 100644
index 000000000..45f1dad0b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
@@ -0,0 +1,923 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.MetadataTags;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.TextField;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.MetadataType;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+import com.smartdevicelink.util.DebugTool;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import static com.smartdevicelink.proxy.rpc.enums.TextAlignment.CENTERED;
+
+/**
+ * <strong>TextAndGraphicManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+ *
+ */
+abstract class BaseTextAndGraphicManager extends BaseSubManager {
+
+ private static final String TAG = "TextAndGraphicManager";
+
+ boolean isDirty, hasQueuedUpdate;
+ volatile Show inProgressUpdate;
+ Show currentScreenData, queuedImageUpdate;
+ HMILevel currentHMILevel;
+ protected DisplayCapabilities displayCapabilities;
+ private boolean pendingHMIFull, batchingUpdates;
+ private final WeakReference<FileManager> fileManager;
+ private final WeakReference<SoftButtonManager> softButtonManager;
+ private CompletionListener queuedUpdateListener, inProgressListener, pendingHMIListener;
+ SdlArtwork blankArtwork;
+ private OnRPCNotificationListener hmiListener;
+ private OnSystemCapabilityListener onDisplayCapabilitiesListener;
+ private SdlArtwork primaryGraphic, secondaryGraphic;
+ private TextAlignment textAlignment;
+ private String textField1, textField2, textField3, textField4, mediaTrackTextField;
+ private MetadataType textField1Type, textField2Type, textField3Type, textField4Type;
+
+ //Constructors
+
+ BaseTextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
+ // set class vars
+ super(internalInterface);
+ this.fileManager = new WeakReference<>(fileManager);
+ this.softButtonManager = new WeakReference<>(softButtonManager);
+ batchingUpdates = false;
+ isDirty = false;
+ pendingHMIFull = false;
+ textAlignment = CENTERED;
+ currentHMILevel = HMILevel.HMI_NONE;
+ currentScreenData = new Show();
+ addListeners();
+ getBlankArtwork();
+ }
+
+ @Override
+ public void start(CompletionListener listener) {
+ transitionToState(READY);
+ super.start(listener);
+ }
+
+ @Override
+ public void dispose(){
+
+ textField1 = null;
+ textField1Type = null;
+ textField2 = null;
+ textField2Type = null;
+ textField3 = null;
+ textField3Type = null;
+ textField4 = null;
+ textField4Type = null;
+ mediaTrackTextField = null;
+ textAlignment = null;
+ primaryGraphic = null;
+ secondaryGraphic = null;
+ blankArtwork = null;
+ displayCapabilities = null;
+ inProgressUpdate = null;
+ queuedImageUpdate = null;
+ currentScreenData = null;
+ queuedUpdateListener = null;
+ pendingHMIListener = null;
+ inProgressListener = null;
+ hasQueuedUpdate = false;
+ isDirty = false;
+ pendingHMIFull = false;
+
+ // remove listeners
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
+ internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAY, onDisplayCapabilitiesListener);
+
+ super.dispose();
+ }
+
+ private void addListeners() {
+ // add listener
+ hmiListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ currentHMILevel = ((OnHMIStatus)notification).getHmiLevel();
+ if (currentHMILevel == HMILevel.HMI_FULL){
+ if (pendingHMIFull){
+ DebugTool.logInfo( "Acquired HMI_FULL with pending update. Sending now");
+ pendingHMIFull = false;
+ sdlUpdate(pendingHMIListener);
+ pendingHMIListener = null;
+ }
+ }
+ }
+ };
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
+
+ // Add OnDisplayCapabilitiesListener to keep displayCapabilities updated
+ onDisplayCapabilitiesListener = new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ displayCapabilities = (DisplayCapabilities)capability;
+ }
+
+ @Override
+ public void onError(String info) {
+ Log.e(TAG, "DISPLAY Capability cannot be retrieved:");
+ displayCapabilities = null;
+ }
+ };
+ this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAY, onDisplayCapabilitiesListener);
+ }
+
+ // Upload / Send
+
+ protected void update(CompletionListener listener) {
+
+ // check if is batch update
+ if (batchingUpdates) {
+ return;
+ }
+
+ if (isDirty){
+ isDirty = false;
+ sdlUpdate(listener);
+ } else if (listener != null) {
+ listener.onComplete(true);
+ }
+ }
+
+ private synchronized void sdlUpdate(CompletionListener listener){
+
+ // make sure hmi is not none
+ if (currentHMILevel == null || currentHMILevel == HMILevel.HMI_NONE){
+ //Trying to send show on HMI_NONE, waiting for full
+ pendingHMIFull = true;
+ if (listener != null){
+ pendingHMIListener = listener;
+ }
+ return;
+ }
+
+ //Updating Text and Graphics
+ if (inProgressUpdate != null){
+
+ //In progress update exists, queueing update
+ if (queuedUpdateListener != null){
+
+ //Queued update already exists, superseding previous queued update
+ queuedUpdateListener.onComplete(false);
+ queuedUpdateListener = null;
+ }
+
+ if (listener != null){
+ queuedUpdateListener = listener;
+ }
+
+ hasQueuedUpdate = true;
+
+ return;
+ }
+
+ Show fullShow = new Show();
+ fullShow.setAlignment(textAlignment);
+ fullShow = assembleShowText(fullShow);
+ fullShow = assembleShowImages(fullShow);
+
+ inProgressListener = listener;
+
+ if (!shouldUpdatePrimaryImage() && !shouldUpdateSecondaryImage()){
+
+ //No Images to send, only sending text
+ inProgressUpdate = extractTextFromShow(fullShow);
+ sendShow();
+
+ }else if (!sdlArtworkNeedsUpload(primaryGraphic) && (secondaryGraphic == blankArtwork || !sdlArtworkNeedsUpload(secondaryGraphic))){
+
+ //Images already uploaded, sending full update
+ // The files to be updated are already uploaded, send the full show immediately
+ inProgressUpdate = fullShow;
+ sendShow();
+ } else{
+
+ // Images need to be uploaded, sending text and uploading images
+ inProgressUpdate = fullShow;
+ final Show thisUpdate = fullShow;
+
+ uploadImages(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ if (!success){
+ Log.e(TAG, "Error uploading image");
+ inProgressUpdate = extractTextFromShow(inProgressUpdate);
+ sendShow();
+ }
+ // Check if queued image update still matches our images (there could have been a new Show in the meantime)
+ // and send a new update if it does. Since the images will already be on the head unit, the whole show will be sent
+ if (thisUpdate.getGraphic() != null && thisUpdate.getGraphic().equals(queuedImageUpdate.getGraphic()) ||
+ (thisUpdate.getSecondaryGraphic() != null && queuedImageUpdate.getSecondaryGraphic() != null) && thisUpdate.getSecondaryGraphic().equals(queuedImageUpdate.getSecondaryGraphic())){
+ // Queued image update matches the images we need, sending update
+ sendShow();
+ }
+ // Else, Queued image update does not match the images we need, skipping update
+ }
+ });
+ queuedImageUpdate = fullShow;
+ }
+ }
+
+ private void sendShow(){
+ inProgressUpdate.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ handleResponse(response.getSuccess());
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ handleResponse(false);
+ }
+
+ private void handleResponse(boolean success){
+ if (success){
+ updateCurrentScreenDataState(inProgressUpdate);
+ }
+
+ inProgressUpdate = null;
+ if (inProgressListener != null){
+ inProgressListener.onComplete(success);
+ inProgressListener = null;
+ }
+
+ if (hasQueuedUpdate){
+ //Queued update exists, sending another update
+ hasQueuedUpdate = false;
+ CompletionListener temp = queuedUpdateListener;
+ queuedUpdateListener = null;
+ sdlUpdate(temp);
+ }
+ }
+ });
+
+ if (this.softButtonManager.get() != null) {
+ this.softButtonManager.get().setCurrentMainField1(inProgressUpdate.getMainField1());
+ }
+ internalInterface.sendRPCRequest(inProgressUpdate);
+ }
+
+ // Images
+
+ private void uploadImages(final CompletionListener listener) {
+
+ List<SdlArtwork> artworksToUpload = new ArrayList<>();
+
+ // add primary image
+ if (shouldUpdatePrimaryImage() && !primaryGraphic.isStaticIcon()){
+ artworksToUpload.add(primaryGraphic);
+ }
+
+ // add secondary image
+ if (shouldUpdateSecondaryImage() && !secondaryGraphic.isStaticIcon()){
+ artworksToUpload.add(secondaryGraphic);
+ }
+
+ if (artworksToUpload.size() == 0 && (primaryGraphic.isStaticIcon() || secondaryGraphic.isStaticIcon())){
+ DebugTool.logInfo("Upload attempted on static icons, sending them without upload instead");
+ listener.onComplete(true);
+ }
+
+ // use file manager to upload art
+ if (fileManager.get() != null) {
+ fileManager.get().uploadArtworks(artworksToUpload, new MultipleFileCompletionListener() {
+ @Override
+ public void onComplete(Map<String, String> errors) {
+ if (errors != null) {
+ Log.e(TAG, "Error Uploading Artworks. Error: " + errors.toString());
+ listener.onComplete(false);
+ } else {
+ listener.onComplete(true);
+ }
+ }
+ });
+ }
+ }
+
+ private Show assembleShowImages(Show show){
+
+ if (shouldUpdatePrimaryImage()){
+ show.setGraphic(primaryGraphic.getImageRPC());
+ }
+
+ if (shouldUpdateSecondaryImage()){
+ show.setSecondaryGraphic(secondaryGraphic.getImageRPC());
+ }
+
+ return show;
+ }
+
+ // Text
+
+ Show assembleShowText(Show show){
+
+ show = setBlankTextFields(show);
+
+ if (mediaTrackTextField != null){
+ show.setMediaTrack(mediaTrackTextField);
+ }
+
+ List<String> nonNullFields = findValidMainTextFields();
+ if (nonNullFields.isEmpty()){
+ return show;
+ }
+
+ int numberOfLines = getNumberOfLines();
+
+ switch (numberOfLines) {
+ case 1: show = assembleOneLineShowText(show, nonNullFields);
+ break;
+ case 2: show = assembleTwoLineShowText(show);
+ break;
+ case 3: show = assembleThreeLineShowText(show);
+ break;
+ case 4: show = assembleFourLineShowText(show);
+ break;
+ }
+
+ return show;
+ }
+
+ private Show assembleOneLineShowText(Show show, List<String> showFields){
+
+ StringBuilder showString1 = new StringBuilder();
+ for (int i = 0; i < showFields.size(); i++) {
+ if (i > 0) {
+ showString1.append(" - ").append(showFields.get(i));
+ }else{
+ showString1.append(showFields.get(i));
+ }
+ }
+ show.setMainField1(showString1.toString());
+
+ MetadataTags tags = new MetadataTags();
+ tags.setMainField1(findNonNullMetadataFields());
+
+ show.setMetadataTags(tags);
+
+ return show;
+ }
+
+ private Show assembleTwoLineShowText(Show show){
+
+ StringBuilder tempString = new StringBuilder();
+ MetadataTags tags = new MetadataTags();
+
+ if (textField1 != null && textField1.length() > 0) {
+ tempString.append(textField1);
+ if (textField1Type != null){
+ tags.setMainField1(textField1Type);
+ }
+ }
+
+ if (textField2 != null && textField2.length() > 0) {
+ if (( textField3 == null || !(textField3.length() > 0)) && (textField4 == null || !(textField4.length() > 0))){
+ // text does not exist in slots 3 or 4, put text2 in slot 2
+ show.setMainField2(textField2);
+ if (textField2Type != null){
+ tags.setMainField2(textField2Type);
+ }
+ } else if (textField1 != null && textField1.length() > 0) {
+ // If text 1 exists, put it in slot 1 formatted
+ tempString.append(" - ").append(textField2);
+ if (textField2Type != null){
+ List<MetadataType> typeList = new ArrayList<>();
+ typeList.add(textField2Type);
+ if (textField1Type != null){
+ typeList.add(textField1Type);
+ }
+ tags.setMainField1(typeList);
+ }
+ }else {
+ // If text 1 does not exist, put it in slot 1 unformatted
+ tempString.append(textField2);
+ if (textField2Type != null){
+ tags.setMainField1(textField2Type);
+ }
+ }
+ }
+
+ // set mainfield 1
+ show.setMainField1(tempString.toString());
+
+ // new stringbuilder object
+ tempString = new StringBuilder();
+
+ if (textField3 != null && textField3.length() > 0){
+ // If text 3 exists, put it in slot 2
+ tempString.append(textField3);
+ if (textField3Type != null){
+ List<MetadataType> typeList = new ArrayList<>();
+ typeList.add(textField3Type);
+ tags.setMainField2(typeList);
+ }
+ }
+
+ if (textField4 != null && textField4.length() > 0){
+ if (textField3 != null && textField3.length() > 0){
+ // If text 3 exists, put it in slot 2 formatted
+ tempString.append(" - ").append(textField4);
+ if (textField4Type != null){
+ List<MetadataType> typeList = new ArrayList<>();
+ typeList.add(textField4Type);
+ if (textField3Type != null){
+ typeList.add(textField3Type);
+ }
+ tags.setMainField2(typeList);
+ }
+ } else {
+ // If text 3 does not exist, put it in slot 3 unformatted
+ tempString.append(textField4);
+ if (textField4Type != null){
+ tags.setMainField2(textField4Type);
+ }
+ }
+ }
+
+ if (tempString.toString().length() > 0){
+ show.setMainField2(tempString.toString());
+ }
+
+ show.setMetadataTags(tags);
+ return show;
+ }
+
+ private Show assembleThreeLineShowText(Show show){
+
+ MetadataTags tags = new MetadataTags();
+
+ if (textField1 != null && textField1.length() > 0) {
+ show.setMainField1(textField1);
+ if (textField1Type != null){
+ tags.setMainField1(textField1Type);
+ }
+ }
+
+ if (textField2 != null && textField2.length() > 0) {
+ show.setMainField2(textField2);
+ if (textField2Type != null){
+ tags.setMainField2(textField2Type);
+ }
+ }
+
+ StringBuilder tempString = new StringBuilder();
+
+ if (textField3 != null && textField3.length() > 0){
+ tempString.append(textField3);
+ if (textField3Type != null){
+ tags.setMainField3(textField3Type);
+ }
+ }
+
+ if (textField4 != null && textField4.length() > 0) {
+ if (textField3 != null && textField3.length() > 0) {
+ // If text 3 exists, put it in slot 3 formatted
+ tempString.append(" - ").append(textField4);
+ if (textField4Type != null){
+ List<MetadataType> tags4 = new ArrayList<>();
+ if (textField3Type != null){
+ tags4.add(textField3Type);
+ }
+ tags4.add(textField4Type);
+ tags.setMainField3(tags4);
+ }
+ } else {
+ // If text 3 does not exist, put it in slot 3 formatted
+ tempString.append(textField4);
+ if (textField4Type != null){
+ tags.setMainField3(textField4Type);
+ }
+ }
+ }
+
+ show.setMainField3(tempString.toString());
+ show.setMetadataTags(tags);
+ return show;
+ }
+
+ private Show assembleFourLineShowText(Show show){
+
+ MetadataTags tags = new MetadataTags();
+
+ if (textField1 != null && textField1.length() > 0) {
+ show.setMainField1(textField1);
+ if (textField1Type != null){
+ tags.setMainField1(textField1Type);
+ }
+ }
+
+ if (textField2 != null && textField2.length() > 0) {
+ show.setMainField2(textField2);
+ if (textField2Type != null){
+ tags.setMainField2(textField2Type);
+ }
+ }
+
+ if (textField3 != null && textField3.length() > 0) {
+ show.setMainField3(textField3);
+ if (textField3Type != null){
+ tags.setMainField3(textField3Type);
+ }
+ }
+
+ if (textField4 != null && textField4.length() > 0) {
+ show.setMainField4(textField4);
+ if (textField4Type != null){
+ tags.setMainField4(textField4Type);
+ }
+ }
+
+ show.setMetadataTags(tags);
+ return show;
+ }
+
+ // Extraction
+
+ Show extractTextFromShow(Show show){
+
+ Show newShow = new Show();
+ newShow.setMainField1(show.getMainField1());
+ newShow.setMainField2(show.getMainField2());
+ newShow.setMainField3(show.getMainField3());
+ newShow.setMainField4(show.getMainField4());
+
+ return newShow;
+ }
+
+ private Show setBlankTextFields(Show newShow){
+
+ newShow.setMainField1("");
+ newShow.setMainField2("");
+ newShow.setMainField3("");
+ newShow.setMainField4("");
+ newShow.setMediaTrack("");
+
+ return newShow;
+ }
+
+ private void updateCurrentScreenDataState(Show show){
+
+ if (show == null){
+ Log.e(TAG, "can not updateCurrentScreenDataFromShow from null show");
+ return;
+ }
+
+ // If the items are null, they were not updated, so we can't just set it directly
+ if (show.getMainField1() != null){
+ currentScreenData.setMainField1(show.getMainField1());
+ }
+ if (show.getMainField2() != null){
+ currentScreenData.setMainField2(show.getMainField2());
+ }
+ if (show.getMainField3() != null){
+ currentScreenData.setMainField3(show.getMainField3());
+ }
+ if (show.getMainField4() != null){
+ currentScreenData.setMainField4(show.getMainField4());
+ }
+ if (show.getMediaTrack() != null){
+ currentScreenData.setMediaTrack(show.getMediaTrack());
+ }
+ if (show.getMetadataTags() != null){
+ currentScreenData.setMetadataTags(show.getMetadataTags());
+ }
+ if (show.getAlignment() != null){
+ currentScreenData.setAlignment(show.getAlignment());
+ }
+ if (show.getGraphic() != null){
+ currentScreenData.setGraphic(show.getGraphic());
+ }
+ if (show.getSecondaryGraphic() != null){
+ currentScreenData.setSecondaryGraphic(show.getSecondaryGraphic());
+ }
+ }
+
+ // Helpers
+
+ private List<String> findValidMainTextFields(){
+ List<String> array = new ArrayList<>();
+
+ if (textField1 != null && textField1.length() > 0) {
+ array.add(textField1);
+ }
+
+ if (textField2 != null && textField2.length() > 0) {
+ array.add(textField2);
+ }
+
+ if (textField3 != null && textField3.length() > 0) {
+ array.add(textField3);
+ }
+
+ if (textField4 != null && textField4.length() > 0) {
+ array.add(textField4);
+ }
+
+ return array;
+ }
+
+
+ private List<MetadataType> findNonNullMetadataFields(){
+ List<MetadataType> array = new ArrayList<>();
+
+ if (textField1Type != null) {
+ array.add(textField1Type);
+ }
+
+ if (textField2Type != null) {
+ array.add(textField2Type);
+ }
+
+ if (textField3Type != null) {
+ array.add(textField3Type);
+ }
+
+ if (textField4Type != null) {
+ array.add(textField4Type);
+ }
+
+ return array;
+ }
+
+ abstract SdlArtwork getBlankArtwork();
+
+ private boolean sdlArtworkNeedsUpload(SdlArtwork artwork){
+ if (fileManager.get() != null) {
+ return artwork != null && !fileManager.get().hasUploadedFile(artwork) && !artwork.isStaticIcon();
+ }
+ return false;
+ }
+
+ private boolean shouldUpdatePrimaryImage() {
+ if (displayCapabilities == null || displayCapabilities.getGraphicSupported()) {
+ if (currentScreenData.getGraphic() == null && primaryGraphic != null) {
+ return true;
+ } else if (currentScreenData.getGraphic() == null && primaryGraphic == null) {
+ return false;
+ }
+ return currentScreenData != null && (primaryGraphic != null && !currentScreenData.getGraphic().getValue().equalsIgnoreCase(primaryGraphic.getName()));
+ }
+ return false;
+ }
+
+ private boolean shouldUpdateSecondaryImage() {
+ // Cannot detect if there is a secondary image, so we'll just try to detect if there's a primary image and allow it if there is.
+ if (displayCapabilities == null || displayCapabilities.getGraphicSupported()) {
+ if (currentScreenData.getGraphic() == null && secondaryGraphic != null) {
+ return true;
+ } else if (currentScreenData.getGraphic() == null && secondaryGraphic == null) {
+ return false;
+ }
+ return currentScreenData != null && (secondaryGraphic != null && !currentScreenData.getGraphic().getValue().equalsIgnoreCase(secondaryGraphic.getName()));
+ }
+ return false;
+ }
+
+ int getNumberOfLines() {
+
+ if (displayCapabilities == null){
+ return 4;
+ }
+
+ int linesFound = 0;
+
+ List<TextField> textFields = displayCapabilities.getTextFields();
+ TextFieldName name;
+ for (TextField field : textFields) {
+ if (field.getName() != null) {
+ name = field.getName();
+ if (name == TextFieldName.mainField1 || name == TextFieldName.mainField2 || name == TextFieldName.mainField3 || name == TextFieldName.mainField4) {
+ linesFound += 1;
+ }
+ }
+ }
+
+ return linesFound;
+ }
+
+ // SCREEN ITEM SETTERS AND GETTERS
+
+ void setTextAlignment(TextAlignment textAlignment){
+ this.textAlignment = textAlignment;
+ // If we aren't batching, send the update immediately, if we are, set ourselves as dirty (so we know we should send an update after the batch ends)
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ TextAlignment getTextAlignment(){
+ return textAlignment;
+ }
+
+ void setMediaTrackTextField(String mediaTrackTextField){
+ this.mediaTrackTextField = mediaTrackTextField;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ String getMediaTrackTextField(){
+ return mediaTrackTextField;
+ }
+
+ void setTextField1(String textField1){
+ this.textField1 = textField1;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ String getTextField1(){
+ return textField1;
+ }
+
+ void setTextField2(String textField2){
+ this.textField2 = textField2;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ String getTextField2(){
+ return textField2;
+ }
+
+ void setTextField3(String textField3){
+ this.textField3 = textField3;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ String getTextField3(){
+ return textField3;
+ }
+
+ void setTextField4(String textField4){
+ this.textField4 = textField4;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ String getTextField4(){
+ return textField4;
+ }
+
+ void setTextField1Type(MetadataType textField1Type){
+ this.textField1Type = textField1Type;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ MetadataType getTextField1Type(){
+ return textField1Type;
+ }
+
+ void setTextField2Type(MetadataType textField2Type){
+ this.textField2Type = textField2Type;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ MetadataType getTextField2Type(){
+ return textField2Type;
+ }
+
+ void setTextField3Type(MetadataType textField3Type){
+ this.textField3Type = textField3Type;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ MetadataType getTextField3Type(){
+ return textField3Type;
+ }
+
+ void setTextField4Type(MetadataType textField4Type){
+ this.textField4Type = textField4Type;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ MetadataType getTextField4Type(){
+ return textField4Type;
+ }
+
+ void setPrimaryGraphic(SdlArtwork primaryGraphic){
+ this.primaryGraphic = primaryGraphic;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ SdlArtwork getPrimaryGraphic(){
+ return primaryGraphic;
+ }
+
+ void setSecondaryGraphic(SdlArtwork secondaryGraphic){
+ this.secondaryGraphic = secondaryGraphic;
+ if (!batchingUpdates){
+ sdlUpdate(null);
+ }else{
+ isDirty = true;
+ }
+ }
+
+ SdlArtwork getSecondaryGraphic(){
+ return secondaryGraphic;
+ }
+
+ void setBatchUpdates(boolean batching){
+ this.batchingUpdates = batching;
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java
new file mode 100644
index 000000000..78b0cbb0f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java
@@ -0,0 +1,303 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.proxy.rpc.OnButtonEvent;
+import com.smartdevicelink.proxy.rpc.OnButtonPress;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.util.DebugTool;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * <strong>SoftButtonObject</strong> <br>
+ * SoftButtonObject define a button that can have multiple SoftButtonState values.<br>
+ * The states of SoftButtonObject allow the developer to not have to manage multiple SoftButtons that have very similar functionality.<br>
+ * For example, a repeat button in a music app can be thought of as one SoftButtonObject with three typical states: repeat off, repeat 1, and repeat on.<br>
+ * @see SoftButtonState
+ */
+public class SoftButtonObject {
+
+ private static final String TAG = "SoftButtonObject";
+ private String name;
+ private List<SoftButtonState> states;
+ private String currentStateName;
+ private int buttonId;
+ private OnEventListener onEventListener;
+ private UpdateListener updateListener;
+
+ /**
+ * Create a new instance of the SoftButtonObject with multiple states
+ * @param name a String value represents name of the object
+ * @param states a list of SoftButtonState represents the SoftButtonState values for the object
+ * @param initialStateName a String value represents the name for the initial state
+ * @param onEventListener a listener that has a callback that will be triggered when a button event happens
+ * Note: the initialStateName should match exactly the name of one of the states for the object. Otherwise an exception will be thrown.
+ */
+ public SoftButtonObject(@NonNull String name, @NonNull List<SoftButtonState> states, @NonNull String initialStateName, OnEventListener onEventListener) {
+
+ // Make sure there aren't two states with the same name
+ if (hasTwoStatesOfSameName(states)) {
+ Log.e(TAG, "Two states have the same name in states list for soft button object");
+ return;
+ }
+
+ this.name = name;
+ this.states = states;
+ currentStateName = initialStateName;
+ this.buttonId = 0;
+ this.onEventListener = onEventListener;
+ }
+
+ /**
+ * Create a new instance of the SoftButtonObject with one state
+ * @param name a String value represents name of the object
+ * @param state a SoftButtonState represents state for the object
+ * @param onEventListener a listener that has a callback that will be triggered when a button event happens
+ */
+ public SoftButtonObject(@NonNull String name, @NonNull SoftButtonState state, OnEventListener onEventListener) {
+ this(name, Collections.singletonList(state), state.getName(), onEventListener);
+ }
+
+ /**
+ * Transition the SoftButtonObject to a specific state
+ * @param newStateName a String value represents the name fo the state that we want to transition the SoftButtonObject to
+ * @return a boolean value that represents whether the transition succeeded or failed
+ */
+ public boolean transitionToStateByName(@NonNull String newStateName) {
+ SoftButtonState newState = getStateByName(newStateName);
+ if (newState == null) {
+ Log.e(TAG, String.format("Attempted to transition to state: %s on soft button object: %s but no state with that name was found", newStateName, this.name));
+ return false;
+ }
+ DebugTool.logInfo(String.format("Transitioning soft button object %s to state %s", this.name, newStateName));
+ currentStateName = newStateName;
+
+ // Send a new Show RPC because the state has changed which means the actual SoftButton has changed
+ if (updateListener != null) {
+ updateListener.onUpdate();
+ } else {
+ Log.e(TAG, String.format("SoftButtonManager is not set for soft button object: %s. Update cannot be triggered", this.name));
+ }
+
+ return true;
+ }
+
+ /**
+ * Transition the SoftButtonObject to the next state
+ */
+ public void transitionToNextState() {
+ String nextStateName = null;
+ for (int i = 0; i < states.size(); i++) {
+ if (states.get(i).getName().equals(currentStateName)) {
+ if (i == (states.size() - 1)) {
+ nextStateName = states.get(0).getName();
+ } else {
+ nextStateName = states.get(i + 1).getName();
+ }
+ break;
+ }
+ }
+ if (nextStateName == null) {
+ Log.e(TAG, String.format("Current state name : %s cannot be found for soft button object %s", currentStateName, this.name));
+ return;
+ }
+ transitionToStateByName(nextStateName);
+ }
+
+ /**
+ * Get the current state for the SoftButtonObject
+ * @return a SoftButtonState represents the current state
+ */
+ public SoftButtonState getCurrentState() {
+ SoftButtonState state = getStateByName(currentStateName);
+ if (state == null) {
+ Log.e(TAG, String.format("Current state name : %s cannot be found for soft button object %s", currentStateName, this.name));
+ }
+ return state;
+ }
+
+ /**
+ * Get the SoftButton object for the current state
+ * @return a SoftButton object that is associated with the current state
+ */
+ public SoftButton getCurrentStateSoftButton() {
+ SoftButtonState currentState = getCurrentState();
+ if (currentState == null || currentState.getSoftButton() == null) {
+ return null;
+ }
+
+ SoftButton softButton = currentState.getSoftButton();
+ softButton.setSoftButtonID(this.buttonId);
+ return softButton;
+ }
+
+ /**
+ * Find and get the SoftButtonState that has the provided name
+ * @param stateName a String value that represents the name of the state
+ * @return a SoftButtonState object that represents the state that has the provided name
+ */
+ private SoftButtonState getStateByName(String stateName) {
+ if (stateName != null && states != null) {
+ for (SoftButtonState state : states) {
+ if (state.getName().equals(stateName)) {
+ return state;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Check if two SoftButtonState have the same name
+ * @param states a list of SoftButtonState
+ * @return a boolean value that represents whether we have two states with the same name
+ */
+ private boolean hasTwoStatesOfSameName(List<SoftButtonState> states) {
+ for (int i = 0; i < states.size(); i++) {
+ String stateName = states.get(i).getName();
+ for (int j = (i + 1); j < states.size(); j++) {
+ if (states.get(j).getName().equals(stateName)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Set the SoftButtonManager's update listener
+ * @param updateListener the SoftButtonManager.UpdateListener object
+ */
+ protected void setUpdateListener(UpdateListener updateListener) {
+ this.updateListener = updateListener;
+ }
+
+ /**
+ * Get the name of the SoftButtonObject
+ * @return a String that represents the name of the SoftButtonObject
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the name of the SoftButtonObject
+ * @param name a String that represents the name of the SoftButtonObject
+ */
+ public void setName(@NonNull String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the SoftButtonState list
+ * @return a list of the object's soft button states
+ */
+ public List<SoftButtonState> getStates() {
+ return states;
+ }
+
+ /**
+ * Set the the SoftButtonState list
+ * @param states a list of the object's soft button states
+ */
+ public void setStates(@NonNull List<SoftButtonState> states) {
+ this.states = states;
+ }
+
+ /**
+ * Get the name of the current state
+ * @return a String that represents the name of the current state
+ */
+ public String getCurrentStateName() {
+ return currentStateName;
+ }
+
+ /**
+ * Set the name of the current state
+ * @param currentStateName a String that represents the name of the current state
+ */
+ public void setCurrentStateName(@NonNull String currentStateName) {
+ this.currentStateName = currentStateName;
+ }
+
+ /**
+ * Get the dd of the SoftButtonObject
+ * @return an int value that represents the id of the SoftButtonObject
+ */
+ public int getButtonId() {
+ return buttonId;
+ }
+
+ /**
+ * Set the id of the SoftButtonObject
+ * @param buttonId an int value that represents the id of the SoftButtonObject
+ */
+ public void setButtonId(int buttonId) {
+ this.buttonId = buttonId;
+ }
+
+ /**
+ * Get the event listener for the SoftButtonObject
+ * @return OnEventListener
+ */
+ public OnEventListener getOnEventListener() {
+ return onEventListener;
+ }
+
+ /**
+ * Set the event listener for the SoftButtonObject
+ * @param onEventListener a listener that has a callback that will be triggered when a button event happens
+ */
+ public void setOnEventListener(OnEventListener onEventListener) {
+ this.onEventListener = onEventListener;
+ }
+
+ public interface OnEventListener{
+ void onPress(SoftButtonObject softButtonObject, OnButtonPress onButtonPress);
+ void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEvent);
+ }
+
+ /**
+ * A listener interface that is used by SoftButtonObject to request an update from SoftButtonManager
+ */
+ interface UpdateListener{
+ /**
+ * Requests an update from SoftButtonManager
+ */
+ void onUpdate();
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java
new file mode 100644
index 000000000..874d8e436
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.proxy.rpc.SoftButton;
+import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
+
+/**
+ * <strong>SoftButtonState</strong> <br>
+ * Defines an individual state for SoftButtonObject.<br>
+ * The states of SoftButtonObject allow the developer to not have to manage multiple SoftButtons that have very similar functionality.<br>
+ * For example, a repeat button in a music app can be thought of as one SoftButtonObject with three typical states: repeat off, repeat 1, and repeat on.<br>
+ * @see SoftButtonObject
+ */
+public class SoftButtonState {
+
+ private static final String TAG = "SoftButtonState";
+ private String name;
+ private SdlArtwork artwork;
+ private final SoftButton softButton;
+
+ /**
+ * Creates a new instance of SoftButtonState
+ * Note: state names should be different for each SoftButtonObject
+ * @param name a String value represents name of the state
+ * @param text a String represents the text for the state
+ * @param artwork an SdlArtwork represents the artwork for the state
+ */
+ public SoftButtonState(@NonNull String name, String text, SdlArtwork artwork) {
+ if (text == null && artwork == null) {
+ Log.e(TAG, "Attempted to create an invalid soft button state: text and artwork are both null");
+ softButton = null;
+ return;
+ }
+ this.name = name;
+ this.artwork = artwork;
+
+
+ // Create a SoftButton and set its Type
+ SoftButtonType type;
+ if (artwork != null && text != null) {
+ type = SoftButtonType.SBT_BOTH;
+ } else if (artwork != null) {
+ type = SoftButtonType.SBT_IMAGE;
+ } else {
+ type = SoftButtonType.SBT_TEXT;
+ }
+ this.softButton = new SoftButton(type, 0);
+
+
+ // Set the SoftButton's image
+ if (artwork != null) {
+ softButton.setImage(artwork.getImageRPC());
+ }
+
+ // Set the SoftButton's text
+ if (text != null) {
+ softButton.setText(text);
+ }
+ }
+
+ /**
+ * Get the state name
+ * @return a String value represents the name of the state
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the state name
+ * @param name a String value represents the name of the state
+ */
+ public void setName(@NonNull String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the SoftButton for the state
+ * @return a SoftButton object represents the SoftButton for the state
+ */
+ public SoftButton getSoftButton() {
+ return softButton;
+ }
+
+ /**
+ * Get the Artwork for the state
+ * @return an SdlArtwork object represents the artwork for the state
+ */
+ public SdlArtwork getArtwork() {
+ return artwork;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java b/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java
new file mode 100644
index 000000000..da8c35af3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.video;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.managers.BaseSubManager;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+
+abstract class BaseVideoStreamManager extends BaseSubManager {
+ BaseVideoStreamManager(@NonNull ISdl internalInterface) {
+ super(internalInterface);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java b/base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
new file mode 100644
index 000000000..1164ec58f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.marshal;
+
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.trace.SdlTrace;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+import com.smartdevicelink.util.DebugTool;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+/*
+ * Responsible for marshalling and unmarshing between RPC Objects and byte streams that are sent
+ * over transmission
+ */
+
+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 {
+ JSONObject jsonObject = msg.serializeJSON(version);
+ jsonBytes = jsonObject.toString().getBytes();
+
+ SdlTrace.logMarshallingEvent(InterfaceActivityDirection.Transmit, jsonBytes, SDL_LIB_PRIVATE_KEY);
+ } catch (JSONException e) {
+ DebugTool.logError("Failed to encode messages to JSON.", e);
+ }
+ return jsonBytes;
+ }
+
+ public static Hashtable<String, Object> unmarshall(byte[] message) {
+ SdlTrace.logMarshallingEvent(InterfaceActivityDirection.Receive, message, SDL_LIB_PRIVATE_KEY);
+ Hashtable<String, Object> ret = null;
+ try {
+ String jsonString = new String(message);
+ JSONObject jsonObject = new JSONObject(jsonString);
+ ret = deserializeJSONObject(jsonObject);
+ } catch (JSONException e) {
+ DebugTool.logError("Failed to parse JSON", e);
+ }
+ return ret;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Hashtable<String, Object> deserializeJSONObject(JSONObject jsonObject)
+ throws JSONException {
+ Hashtable<String, Object> ret = new Hashtable<String, Object>();
+ Iterator<String> it = jsonObject.keys();
+ String key = null;
+ while (it.hasNext()) {
+ key = it.next();
+ Object value = jsonObject.get(key);
+ if (value instanceof JSONObject) {
+ ret.put(key, deserializeJSONObject((JSONObject)value));
+ } else if (value instanceof JSONArray) {
+ JSONArray arrayValue = (JSONArray) value;
+ List<Object> putList = new ArrayList<Object>(arrayValue.length());
+ for (int i = 0; i < arrayValue.length(); i++) {
+ Object anObject = arrayValue.get(i);
+ if (anObject instanceof JSONObject) {
+ Hashtable<String, Object> deserializedObject = deserializeJSONObject((JSONObject)anObject);
+ putList.add(deserializedObject);
+ } else {
+ putList.add(anObject);
+ }
+ }
+ ret.put(key, putList);
+ } else {
+ ret.put(key, value);
+ }
+ }
+ return ret;
+ }
+
+ @SuppressWarnings("unchecked" )
+ private static JSONArray serializeList(List<?> list) throws JSONException{
+ JSONArray toPut = new JSONArray();
+ Iterator<Object> valueIterator = (Iterator<Object>) list.iterator();
+ while(valueIterator.hasNext()){
+ Object anObject = valueIterator.next();
+ if (anObject instanceof RPCStruct) {
+ RPCStruct toSerialize = (RPCStruct) anObject;
+ toPut.put(toSerialize.serializeJSON());
+ } else if(anObject instanceof Hashtable){
+ Hashtable<String, Object> toSerialize = (Hashtable<String, Object>)anObject;
+ toPut.put(serializeHashtable(toSerialize));
+ } else {
+ toPut.put(anObject);
+ }
+ }
+ return toPut;
+ }
+
+ @SuppressWarnings({"unchecked" })
+ public static JSONObject serializeHashtable(Hashtable<String, Object> hash) throws JSONException{
+ JSONObject obj = new JSONObject();
+ Iterator<String> hashKeyIterator = hash.keySet().iterator();
+ while (hashKeyIterator.hasNext()){
+ String key = (String) hashKeyIterator.next();
+ Object value = hash.get(key);
+ if (value instanceof RPCStruct) {
+ obj.put(key, ((RPCStruct) value).serializeJSON());
+ } else if (value instanceof List<?>) {
+ obj.put(key, serializeList((List<?>) value));
+ } else if (value instanceof Hashtable) {
+ obj.put(key, serializeHashtable((Hashtable<String, Object>)value));
+ } else {
+ obj.put(key, value);
+ }
+ }
+ return obj;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java b/base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
new file mode 100644
index 000000000..da6682918
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+import android.util.Log;
+
+import com.smartdevicelink.util.BitConverter;
+
+public class BinaryFrameHeader {
+ private static final String TAG = "BinaryFrameHeader";
+
+ private byte _rpcType;
+ private int _functionID;
+ private int _correlationID;
+ private int _jsonSize;
+
+ private byte[] _jsonData;
+ private byte[] _bulkData;
+
+ public BinaryFrameHeader() {}
+
+ public static BinaryFrameHeader parseBinaryHeader(byte[] binHeader) {
+ BinaryFrameHeader msg = new BinaryFrameHeader();
+
+ byte RPC_Type = (byte) (binHeader[0] >>> 4);
+ msg.setRPCType(RPC_Type);
+
+ int _functionID = (BitConverter.intFromByteArray(binHeader, 0) & 0x0FFFFFFF);
+ msg.setFunctionID(_functionID);
+
+ int corrID = BitConverter.intFromByteArray(binHeader, 4);
+ msg.setCorrID(corrID);
+
+ int _jsonSize = BitConverter.intFromByteArray(binHeader, 8);
+ msg.setJsonSize(_jsonSize);
+
+ try {
+ if (_jsonSize > 0) {
+ byte[] _jsonData = new byte[_jsonSize];
+ System.arraycopy(binHeader, 12, _jsonData, 0, _jsonSize);
+ msg.setJsonData(_jsonData);
+ }
+
+ if (binHeader.length - _jsonSize - 12 > 0) {
+ byte[] _bulkData = new byte[binHeader.length - _jsonSize - 12];
+ System.arraycopy(binHeader, 12 + _jsonSize, _bulkData, 0, _bulkData.length);
+ msg.setBulkData(_bulkData);
+ }
+ } catch (OutOfMemoryError|ArrayIndexOutOfBoundsException e){
+ Log.e(TAG, "Unable to process data to form header");
+ return null;
+ }
+
+ return msg;
+ }
+
+ public byte[] assembleHeaderBytes() {
+ int binHeader = _functionID;
+ // reset the 4 leftmost bits, for _rpcType
+ binHeader &= 0xFFFFFFFF >>> 4;
+ binHeader |= (_rpcType << 28);
+
+ byte[] ret = new byte[12];
+ System.arraycopy(BitConverter.intToByteArray(binHeader), 0, ret, 0, 4);
+ System.arraycopy(BitConverter.intToByteArray(_correlationID), 0, ret, 4, 4);
+ System.arraycopy(BitConverter.intToByteArray(_jsonSize), 0, ret, 8, 4);
+
+ return ret;
+ }
+
+ public byte getRPCType() {
+ return _rpcType;
+ }
+
+ public void setRPCType(byte _rpcType) {
+ this._rpcType = _rpcType;
+ }
+
+ public int getFunctionID() {
+ return _functionID;
+ }
+
+ public void setFunctionID(int _functionID) {
+ this._functionID = _functionID;
+ }
+
+ public int getCorrID() {
+ return _correlationID;
+ }
+
+ public void setCorrID(int _correlationID) {
+ this._correlationID = _correlationID;
+ }
+
+ public int getJsonSize() {
+ return _jsonSize;
+ }
+
+ public void setJsonSize(int _jsonSize) {
+ this._jsonSize = _jsonSize;
+ }
+
+ public byte[] getJsonData() {
+ return _jsonData;
+ }
+
+ public void setJsonData(byte[] _jsonData) {
+ this._jsonData = new byte[this._jsonSize];
+ System.arraycopy(_jsonData, 0, this._jsonData, 0, _jsonSize);
+ //this._jsonData = _jsonData;
+ }
+
+ public byte[] getBulkData() {
+ return _bulkData;
+ }
+
+ public void setBulkData(byte[] _bulkData) {
+ this._bulkData = _bulkData;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java b/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
new file mode 100644
index 000000000..a199e2a00
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+
+import com.smartdevicelink.protocol.enums.SessionType;
+
+import java.util.List;
+
+public interface IProtocolListener {
+ // Called to indicate that these bytes are to be sent as part of a message.
+ // This call includes the part of the message.
+ void onProtocolMessageBytesToSend(SdlPacket packet);
+
+ // Called to indicate that a complete message (RPC, BULK, etc.) has been
+ // received. This call includes the message.
+ void onProtocolMessageReceived(ProtocolMessage msg);
+
+ // Called to indicate that a protocol session has been started (from either side)
+ void onProtocolSessionStarted(SessionType sessionType, byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted);
+
+ void onProtocolSessionNACKed(SessionType sessionType, byte sessionID, byte version,
+ String correlationID, List<String> rejectedParams);
+
+ // Called to indicate that a protocol session has ended (from either side)
+ void onProtocolSessionEnded(SessionType sessionType, byte sessionID, String correlationID /*, String info, Exception ex*/);
+
+ void onProtocolSessionEndedNACKed(SessionType sessionType, byte sessionID, String correlationID /*, String info, Exception ex*/);
+
+ void onProtocolHeartbeat(SessionType sessionType, byte sessionID);
+
+ /**
+ * Called when a protocol heartbeat ACK message has been received from SDL.
+ */
+ void onProtocolHeartbeatACK(SessionType sessionType, byte sessionID);
+
+ void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID);
+
+ void onResetOutgoingHeartbeat(SessionType sessionType, byte sessionID);
+
+ void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID);
+
+ // Called to indicate that a protocol error was detected in received data.
+ void onProtocolError(String info, Exception e);
+
+} // end-interfCe
diff --git a/base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java b/base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java
new file mode 100644
index 000000000..9875178f1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.protocol;
+
+
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.transport.BaseTransportConfig;
+
+public interface ISdlProtocol extends IProtocolListener {
+
+ byte getSessionId();
+
+ void shutdown(String info);
+
+ void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig);
+
+ SdlSecurityBase getSdlSecurity();
+
+ VideoStreamingParameters getDesiredVideoParams();
+
+ void setAcceptedVideoParams(VideoStreamingParameters acceptedVideoParams);
+
+ void stopStream(SessionType serviceType);
+
+ void onAuthTokenReceived(String authToken);
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java b/base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
new file mode 100644
index 000000000..23ceafbdb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+public interface ISecondaryTransportListener {
+ void onConnectionSuccess(TransportRecord transportRecord);
+ void onConnectionFailure();
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java b/base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
new file mode 100644
index 000000000..d5e14d940
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+
+public class ProtocolMessage {
+ private byte version = 1;
+ private SessionType _sessionType = SessionType.RPC;
+ private MessageType _messageType = MessageType.UNDEFINED;
+ private byte _sessionID = 0;
+ private byte _rpcType;
+ private int _functionID;
+ private int _correlationID;
+ private int _jsonSize;
+ private boolean payloadProtected = false;
+
+ int priorityCoefficient = 0;
+
+ private byte[] _data = null;
+ private byte[] _bulkData = null;
+
+ public ProtocolMessage() {}
+
+ public byte getVersion() {
+ return version;
+ }
+
+ public void setVersion(byte version) {
+ this.version = version;
+ }
+
+ public byte getSessionID() {
+ return _sessionID;
+ }
+
+ public void setSessionID(byte sessionID) {
+ this._sessionID = sessionID;
+ }
+
+ public byte[] getData() {
+ return _data;
+ }
+
+ public void setData(byte[] data) {
+ this._data = data;
+ this._jsonSize = data.length;
+ }
+
+ public void setData(byte[] data, int length) {
+ setData(data, 0, length);
+ }
+
+ public void setData(byte[] data, int offset, int length) {
+ if (this._data != null)
+ this._data = null;
+ this._data = new byte[length];
+ System.arraycopy(data, offset, this._data, 0, length);
+ this._jsonSize = 0;
+ }
+
+ public byte[] getBulkData() {
+ return _bulkData;
+ }
+
+ public void setBulkDataNoCopy(byte[] bulkData) {
+ this._bulkData = bulkData;
+ }
+
+ public void setBulkData(byte[] bulkData) {
+ if (this._bulkData != null)
+ this._bulkData = null;
+ this._bulkData = new byte[bulkData.length];
+ System.arraycopy(bulkData, 0, this._bulkData, 0, bulkData.length);
+ //this._bulkData = bulkData;
+ }
+
+ public void setBulkData(byte[] bulkData, int length) {
+ if (this._bulkData != null)
+ this._bulkData = null;
+ this._bulkData = new byte[length];
+ System.arraycopy(bulkData, 0, this._bulkData, 0, length);
+ //this._bulkData = bulkData;
+ }
+
+ public SessionType getSessionType() {
+ return _sessionType;
+ }
+
+ public void setSessionType(SessionType sessionType) {
+ this._sessionType = sessionType;
+ }
+
+ public MessageType getMessageType() {
+ return _messageType;
+ }
+
+ public void setMessageType(MessageType messageType) {
+ this._messageType = messageType;
+ }
+
+ public byte getRPCType() {
+ return _rpcType;
+ }
+
+ public void setRPCType(byte _rpcType) {
+ this._rpcType = _rpcType;
+ }
+
+ public int getFunctionID() {
+ return _functionID;
+ }
+
+ public void setFunctionID(int _functionID) {
+ this._functionID = _functionID;
+ }
+
+ public int getCorrID() {
+ return _correlationID;
+ }
+
+ public void setCorrID(int _correlationID) {
+ this._correlationID = _correlationID;
+ }
+
+ public int getJsonSize() {
+ return _jsonSize;
+ }
+
+ public void setJsonSize(int _jsonSize) {
+ this._jsonSize = _jsonSize;
+ }
+
+ public void setPayloadProtected(boolean bVal) {
+ payloadProtected = bVal;
+ }
+
+ public boolean getPayloadProtected() {
+ return payloadProtected;
+ }
+
+ /**
+ * Set the priority for this packet. The lower the number the higher the priority. <br>0 is the highest priority and the default.
+ * @param priority the priority of this message
+ */
+ public void setPriorityCoefficient(int priority){
+ this.priorityCoefficient = priority;
+ }
+ public int getPrioirtyCoefficient(){
+ return this.priorityCoefficient;
+ }
+} // end-class \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlPacket.java b/base/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
new file mode 100644
index 000000000..6c4d89671
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
@@ -0,0 +1,469 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import com.livio.BSON.BsonEncoder;
+import com.smartdevicelink.protocol.enums.FrameType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+import com.smartdevicelink.util.DebugTool;
+
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+
+/**
+ * This class is only intended to be parcelable from the transport broker to the SDL Router Service.
+ * Any other binder transactions must include an additional int flag into their bundle or the parsing
+ * of this object will fail.
+ */
+public class SdlPacket implements Parcelable{
+
+ /**
+ * This is the amount of bytes added to the bundle from the router service for a specific int
+ * flag; this data will always and must be included. This flag is the
+ * TransportConstants.BYTES_TO_SEND_FLAGS.
+ *
+ * @see com.smartdevicelink.transport.TransportConstants#BYTES_TO_SEND_FLAGS
+ */
+ private static final int EXTRA_PARCEL_DATA_LENGTH = 24;
+
+ public static final int HEADER_SIZE = 12;
+ public static final int HEADER_SIZE_V1 = 8;//Backwards
+
+ private static final int ENCRYPTION_MASK = 0x08; //4th lowest bit
+
+ public static final int FRAME_TYPE_CONTROL = 0x00;
+ public static final int FRAME_TYPE_SINGLE = 0x01;
+ public static final int FRAME_TYPE_FIRST = 0x02;
+ public static final int FRAME_TYPE_CONSECUTIVE = 0x03;
+
+ /*
+ * Service Type
+ */
+ public static final int SERVICE_TYPE_CONTROL = 0x00;
+ //RESERVED 0x01 - 0x06
+ public static final int SERVICE_TYPE_RPC = 0x07;
+ //RESERVED 0x08 - 0x09
+ public static final int SERVICE_TYPE_PCM = 0x0A;
+ public static final int SERVICE_TYPE_VIDEO = 0x0B;
+ //RESERVED 0x0C - 0x0E
+ public static final int SERVICE_TYPE_BULK_DATA = 0x0F;
+ //RESERVED 0x10 - 0xFF
+
+
+ /*
+ * Frame Info
+ */
+ //Control Frame Info
+ public static final int FRAME_INFO_HEART_BEAT = 0x00;
+ public static final int FRAME_INFO_START_SERVICE = 0x01;
+ public static final int FRAME_INFO_START_SERVICE_ACK = 0x02;
+ public static final int FRAME_INFO_START_SERVICE_NAK = 0x03;
+ public static final int FRAME_INFO_END_SERVICE = 0x04;
+ public static final int FRAME_INFO_END_SERVICE_ACK = 0x05;
+ public static final int FRAME_INFO_END_SERVICE_NAK = 0x06;
+ public static final int FRAME_INFO_REGISTER_SECONDARY_TRANSPORT = 0x07;
+ public static final int FRAME_INFO_REGISTER_SECONDARY_TRANSPORT_ACK = 0x08;
+ public static final int FRAME_INFO_REGISTER_SECONDARY_TRANSPORT_NAK = 0x09;
+ //0x0A-0xFC are reserved
+ public static final int FRAME_INFO_TRANSPORT_EVENT_UPDATE = 0xFD;
+ public static final int FRAME_INFO_SERVICE_DATA_ACK = 0xFE;
+ public static final int FRAME_INFO_HEART_BEAT_ACK = 0xFF;
+
+ public static final int FRAME_INFO_FINAL_CONNESCUTIVE_FRAME = 0x00;
+
+ //Most others
+ public static final int FRAME_INFO_RESERVED = 0x00;
+
+
+ int version;
+ boolean encryption;
+ int frameType;
+ int serviceType;
+ int frameInfo;
+ int sessionId;
+ int dataSize;
+ int messageId;
+ int priorityCoefficient;
+ byte[] payload = null;
+ HashMap<String, Object> bsonPayload;
+
+ int messagingVersion = 1;
+ TransportRecord transportRecord;
+
+ public SdlPacket(int version, boolean encryption, int frameType,
+ int serviceType, int frameInfo, int sessionId,
+ int dataSize, int messageId, byte[] payload) {
+ this.version = version;
+ this.encryption = encryption;
+ this.frameType = frameType;
+ this.serviceType = serviceType;
+ this.frameInfo = frameInfo;
+ this.sessionId = sessionId;
+ this.dataSize = dataSize;
+ this.messageId = messageId;
+ this.priorityCoefficient = 0;
+ if(payload!=null){
+ this.payload = new byte[payload.length];
+ System.arraycopy(payload, 0, this.payload, 0, payload.length);
+ }
+ }
+
+ public SdlPacket(int version, boolean encryption, int frameType,
+ int serviceType, int frameInfo, int sessionId,
+ int dataSize, int messageId, byte[] payload, int offset,int bytesToWrite) {
+ this.version = version;
+ this.encryption = encryption;
+ this.frameType = frameType;
+ this.serviceType = serviceType;
+ this.frameInfo = frameInfo;
+ this.sessionId = sessionId;
+ this.dataSize = dataSize;
+ this.messageId = messageId;
+ this.priorityCoefficient = 0;
+ if(payload!=null){
+ this.payload = new byte[bytesToWrite];
+ System.arraycopy(payload, offset, this.payload, 0, bytesToWrite);
+ }
+ }
+ /**
+ * This constructor is available as a protected method. A few defaults have been set, however a few things <b>MUST</b> be set before use. The rest will "work"
+ * however, it won't be valid data.
+ *
+ * <p>Frame Type
+ * <p>Service Type
+ * <p>Frame Info
+ * <p>
+ */
+ protected SdlPacket(){
+ //Package only empty constructor
+ this.version = 1;
+ this.encryption = false;
+ this.frameType = -1; //This NEEDS to be set
+ this.serviceType = -1;
+ this.frameInfo = -1;
+ this.sessionId = 0;
+ this.dataSize = 0;
+ this.messageId = 0;
+
+ }
+
+ /**
+ * Creates a new packet based on previous packet definitions. Will not copy payload.
+ * @param packet an instance of the packet that should be copied.
+ */
+ protected SdlPacket(SdlPacket packet){
+ this.version = packet.version;
+ this.encryption = packet.encryption;
+ this.frameType = packet.frameType;
+ this.serviceType = packet.serviceType;
+ this.frameInfo = packet.frameInfo;
+ this.sessionId = packet.sessionId;
+ this.dataSize = 0;
+ this.messageId = 0;
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ public boolean isEncrypted() {
+ return encryption;
+ }
+
+ public FrameType getFrameType() {
+ switch(frameType){
+ case FRAME_TYPE_CONTROL:
+ return FrameType.Control;
+ case FRAME_TYPE_FIRST:
+ return FrameType.First;
+ case FRAME_TYPE_CONSECUTIVE:
+ return FrameType.Consecutive;
+ case FRAME_TYPE_SINGLE:
+ default:
+ return FrameType.Single;
+ }
+ }
+
+ public int getServiceType() {
+ return serviceType;
+ }
+
+ public int getFrameInfo() {
+ return frameInfo;
+ }
+
+ public int getSessionId() {
+ return sessionId;
+ }
+
+ public int getMessageId() {
+ return messageId;
+ }
+
+ public long getDataSize() {
+ return dataSize;
+ }
+
+ public byte[] getPayload() {
+ return payload;
+ }
+
+ public byte[] constructPacket() {
+ if (bsonPayload != null && !bsonPayload.isEmpty()) {
+ byte[] bsonBytes = BsonEncoder.encodeToBytes(bsonPayload);
+ if(bsonBytes != null) {
+ payload = bsonBytes;
+ dataSize = bsonBytes.length;
+ }
+ }
+ return constructPacket(version, encryption, frameType,
+ serviceType, frameInfo, sessionId,
+ dataSize, messageId, payload);
+ }
+ public void setPayload(byte[] bytes){
+ this.payload = bytes;
+ }
+ /**
+ * Set the priority for this packet. The lower the number the higher the priority. <br>0 is the highest priority and the default.
+ * @param priority the priority of this packet
+ */
+ public void setPriorityCoefficient(int priority){
+ this.priorityCoefficient = priority;
+ }
+ public int getPrioirtyCoefficient(){
+ return this.priorityCoefficient;
+ }
+
+ public void setTransportRecord(TransportRecord transportRecord){
+ this.transportRecord = transportRecord;
+ }
+
+ public TransportRecord getTransportRecord() {
+ return this.transportRecord;
+ }
+
+ /**
+ * This method takes in the various components to the SDL packet structure and creates a new byte array that can be sent via the transport
+ * @param version protocol version to use
+ * @param encryption whether or not this packet is encrypted
+ * @param frameType the packet frame type
+ * @param serviceType the service that this packet is associated with
+ * @param controlFrameInfo specific frame info related to this packet
+ * @param sessionId ID this packet is associated with
+ * @param dataSize size of the payload that will be added
+ * @param messageId ID of this specific packet
+ * @param payload raw data that will be attached to the packet (RPC message, raw bytes, etc)
+ * @return a byte[] representation of an SdlPacket built using the supplied params
+ */
+ public static byte[] constructPacket(int version, boolean encryption, int frameType,
+ int serviceType, int controlFrameInfo, int sessionId,
+ int dataSize, int messageId, byte[] payload){
+
+ ByteBuffer builder;
+ switch(version){
+ case 1:
+ builder = ByteBuffer.allocate(HEADER_SIZE_V1 + dataSize);
+ break;
+ default:
+ builder = ByteBuffer.allocate(HEADER_SIZE + dataSize);
+ break;
+ }
+
+ builder.put((byte)((version<<4) + getEncryptionBit(encryption) + frameType));
+ builder.put((byte)serviceType);
+ builder.put((byte)controlFrameInfo);
+ builder.put((byte)sessionId);
+
+ builder.put((byte)((dataSize&0xFF000000)>>24));
+ builder.put((byte)((dataSize&0x00FF0000)>>16));
+ builder.put((byte)((dataSize&0x0000FF00)>>8));
+ builder.put((byte)((dataSize&0x000000FF)));
+
+ if(version>1){ //Version 1 did not include this part of the header
+ builder.put((byte)((messageId&0xFF000000)>>24));
+ builder.put((byte)((messageId&0x00FF0000)>>16));
+ builder.put((byte)((messageId&0x0000FF00)>>8));
+ builder.put((byte)((messageId&0x000000FF)));
+ }
+
+ if(payload!=null && payload.length>0){
+ builder.put(payload);
+ }
+
+ return builder.array();
+ }
+
+
+ public static int getEncryptionBit(boolean encryption){
+ if(encryption){
+ return ENCRYPTION_MASK;
+ }else{
+ return 0;
+ }
+ }
+
+
+
+@Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("***** Sdl Packet ******");
+ builder.append( "\nVersion: " +version);
+ builder.append( "\nEncryption: " +encryption);
+ builder.append( "\nFrameType: " +frameType);
+ builder.append( "\nServiceType: " +serviceType);
+ builder.append( "\nFrameInfo: " +frameInfo);
+ builder.append( "\nSessionId: " +sessionId);
+ builder.append( "\nDataSize: " +dataSize);
+ if(version>1){
+ builder.append( "\nMessageId: " +messageId);
+ }
+ builder.append("\n***** Sdl Packet End******");
+
+
+ return builder.toString();
+ }
+
+ public void setMessagingVersion(int version){
+ this.messagingVersion = version;
+ }
+
+
+
+ /* ***************************************************************************************************************************************************
+ * *********************************************************** Parceable Overrides *****************************************************************
+ *****************************************************************************************************************************************************/
+
+
+
+ //I think this is FIFO...right?
+ public SdlPacket(Parcel p) {
+ this.version = p.readInt();
+ this.encryption = (p.readInt() == 0) ? false : true;
+ this.frameType = p.readInt();
+ this.serviceType = p.readInt();
+ this.frameInfo = p.readInt();
+ this.sessionId = p.readInt();
+ this.dataSize = p.readInt();
+ this.messageId = p.readInt();
+ if(p.readInt() == 1){ //We should have a payload attached
+ payload = new byte[dataSize];
+ p.readByteArray(payload);
+ }
+
+ this.priorityCoefficient = p.readInt();
+
+ if(p.dataAvail() > EXTRA_PARCEL_DATA_LENGTH) { //See note on constant for why not 0
+ try {
+ messagingVersion = p.readInt();
+ if (messagingVersion >= 2) {
+ if (p.readInt() == 1) { //We should have a transport type attached
+ this.transportRecord = (TransportRecord) p.readParcelable(TransportRecord.class.getClassLoader());
+ }
+ }
+ }catch (RuntimeException e){
+ DebugTool.logError("Error creating packet from parcel", e);
+ }
+ }
+ }
+
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+
+ dest.writeInt(version);
+ dest.writeInt(encryption? 1 : 0);
+ dest.writeInt(frameType);
+ dest.writeInt(serviceType);
+ dest.writeInt(frameInfo);
+ dest.writeInt(sessionId);
+ dest.writeInt(dataSize);
+ dest.writeInt(messageId);
+ dest.writeInt(payload!=null? 1 : 0);
+ if(payload!=null){
+ dest.writeByteArray(payload);
+ }
+ dest.writeInt(priorityCoefficient);
+
+ ///Additions after initial creation
+ if(messagingVersion > 1){
+ dest.writeInt(messagingVersion);
+
+ dest.writeInt(transportRecord!=null? 1 : 0);
+ if(transportRecord != null){
+ dest.writeParcelable(transportRecord,0);
+ }
+ }
+
+ }
+
+ public static final Parcelable.Creator<SdlPacket> CREATOR = new Parcelable.Creator<SdlPacket>() {
+ public SdlPacket createFromParcel(Parcel in) {
+ return new SdlPacket(in);
+ }
+
+ @Override
+ public SdlPacket[] newArray(int size) {
+ return new SdlPacket[size];
+ }
+
+ };
+
+ public void putTag(String tag, Object data){
+ if(bsonPayload == null){
+ bsonPayload = new HashMap<>();
+ }
+ bsonPayload.put(tag, data);
+ }
+
+ public Object getTag(String tag){
+ if(payload == null){
+ return null;
+ }else if(bsonPayload == null || bsonPayload.isEmpty()){
+ bsonPayload = BsonEncoder.decodeFromBytes(payload);
+ }
+
+ if(bsonPayload == null){
+ return null;
+ }
+
+ return bsonPayload.get(tag);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java b/base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
new file mode 100644
index 000000000..14ecc029d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+import com.smartdevicelink.protocol.enums.ControlFrameTags;
+import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.util.BitConverter;
+
+public class SdlPacketFactory {
+
+ /*
+ * public SdlPacket(int version, boolean compression, int frameType,
+ int serviceType, int frameInfo, int sessionId,
+ int dataSize, int messageId, byte[] payload) {
+ */
+ public static SdlPacket createStartSession(SessionType serviceType, int messageID, byte version, byte sessionID, boolean encrypted) {
+ SdlPacket packet = new SdlPacket(version,encrypted,SdlPacket.FRAME_TYPE_CONTROL,
+ serviceType.getValue(),SdlPacket.FRAME_INFO_START_SERVICE,sessionID,
+ 0,messageID,null);
+
+ return packet;
+ }
+
+ public static SdlPacket createHeartbeat(SessionType serviceType, byte sessionID, byte version) {
+
+ return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
+ serviceType.getValue(),FrameDataControlFrameType.Heartbeat.value(),sessionID,
+ 0,0,null);
+
+ }
+
+ public static SdlPacket createHeartbeatACK(SessionType serviceType, byte sessionID, byte version) {
+ return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
+ serviceType.getValue(),FrameDataControlFrameType.HeartbeatACK.value(),sessionID,
+ 0,0,null);
+ }
+
+ public static SdlPacket createStartSessionACK(SessionType serviceType, byte sessionID, int messageID, byte version) {
+
+ return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
+ serviceType.getValue(),FrameDataControlFrameType.StartSessionACK.value(),sessionID,
+ 0,messageID,null);
+
+ }
+
+ public static SdlPacket createStartSessionNACK(SessionType serviceType, byte sessionID, int messageID, byte version) {
+
+ return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
+ serviceType.getValue(),SdlPacket.FRAME_INFO_START_SERVICE_NAK,sessionID,
+ 0,messageID,null);
+ }
+
+ public static SdlPacket createEndSession(SessionType serviceType, byte sessionID, int messageID, byte version, byte[] payload) {
+ return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
+ serviceType.getValue(),SdlPacket.FRAME_INFO_END_SERVICE,sessionID,
+ payload.length,messageID,payload);
+ }
+
+ public static SdlPacket createEndSession(SessionType serviceType, byte sessionID, int messageID, byte version, int hashID) {
+ if (version < 5) {
+ byte[] payload = BitConverter.intToByteArray(hashID);
+ return new SdlPacket(version, false, SdlPacket.FRAME_TYPE_CONTROL,
+ serviceType.getValue(), SdlPacket.FRAME_INFO_END_SERVICE, sessionID,
+ payload.length, messageID, payload);
+ } else {
+ SdlPacket endSession = new SdlPacket(version, false, SdlPacket.FRAME_TYPE_CONTROL,
+ serviceType.getValue(), SdlPacket.FRAME_INFO_END_SERVICE, sessionID,
+ 0, messageID, null);
+ endSession.putTag(ControlFrameTags.RPC.EndService.HASH_ID, hashID);
+ return endSession;
+ }
+ }
+
+ public static SdlPacket createSingleSendData(SessionType serviceType, byte sessionID,
+ int dataLength, int messageID, byte version, byte[] payload, boolean encrypted) {
+
+ return new SdlPacket(version,encrypted,SdlPacket.FRAME_TYPE_SINGLE,
+ serviceType.getValue(),0,sessionID,
+ payload.length,messageID,payload);
+ }
+
+ public static SdlPacket createMultiSendDataFirst(SessionType serviceType, byte sessionID,
+ int messageID, byte version, byte[] payload, boolean encrypted) {
+
+ return new SdlPacket(version,encrypted,SdlPacket.FRAME_TYPE_FIRST,
+ serviceType.getValue(),0,sessionID,
+ 8,messageID,payload);
+
+ }
+
+ public static SdlPacket createMultiSendDataRest(SessionType serviceType, byte sessionID,
+ int dataLength, byte frameSequenceNumber, int messageID, byte version, byte[] payload,int offset,int length, boolean encrypted) {
+
+ return new SdlPacket(version,encrypted,SdlPacket.FRAME_TYPE_CONSECUTIVE,
+ serviceType.getValue(),frameSequenceNumber,sessionID,
+ length,messageID,payload,offset,length);
+ }
+
+ public static SdlPacket createRegisterSecondaryTransport(byte sessionID, byte version) {
+ return new SdlPacket(version, false, SdlPacket.FRAME_TYPE_CONTROL,
+ SessionType.CONTROL.getValue(), SdlPacket.FRAME_INFO_REGISTER_SECONDARY_TRANSPORT,
+ sessionID, 0, 0x01, null);
+ }
+
+ public static BinaryFrameHeader createBinaryFrameHeader(byte rpcType, int functionID, int corrID, int jsonSize) {
+ BinaryFrameHeader msg = new BinaryFrameHeader();
+ msg.setRPCType(rpcType);
+ msg.setFunctionID(functionID);
+ msg.setCorrID(corrID);
+ msg.setJsonSize(jsonSize);
+
+ return msg;
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
new file mode 100644
index 000000000..67ea25cc1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.protocol;
+
+
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.TransportManager;
+
+
+@SuppressWarnings("WeakerAccess")
+public class SdlProtocol extends SdlProtocolBase {
+ private static final String TAG ="SdlProtocol";
+
+ public SdlProtocol( ISdlProtocol iSdlProtocol, BaseTransportConfig config) {
+ super(iSdlProtocol, config);
+ this.setTransportManager(new TransportManager(config, transportEventListener));
+ }
+
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
new file mode 100644
index 000000000..bc91452c6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
@@ -0,0 +1,1450 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.protocol.enums.ControlFrameTags;
+import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
+import com.smartdevicelink.protocol.enums.FrameType;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.rpc.ImageResolution;
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.TransportConstants;
+import com.smartdevicelink.transport.TransportManagerBase;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+import com.smartdevicelink.util.BitConverter;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.Version;
+
+import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+public class SdlProtocolBase {
+ private static final String TAG ="SdlProtocol";
+ private final static String FailurePropagating_Msg = "Failure propagating ";
+
+ private static final int TLS_MAX_RECORD_SIZE = 16384;
+
+ private static final int PRIMARY_TRANSPORT_ID = 1;
+ private static final int SECONDARY_TRANSPORT_ID = 2;
+
+ /**
+ * Original header size based on version 1.0.0 only
+ */
+ public static final int V1_HEADER_SIZE = 8;
+ /**
+ * Larger header size that is used by versions 2.0.0 and up
+ */
+ public static final int V2_HEADER_SIZE = 12;
+
+ //If increasing MAX PROTOCOL VERSION major version, make sure to alter it in SdlPsm
+ private static final Version MAX_PROTOCOL_VERSION = new Version(5, 2, 0);
+
+ public static final int V1_V2_MTU_SIZE = 1500;
+ public static final int V3_V4_MTU_SIZE = 131072;
+
+ private static final List<SessionType> HIGH_BANDWIDTH_SERVICES
+ = Arrays.asList(SessionType.NAV, SessionType.PCM);
+
+ // Lock to ensure all frames are sent uninterrupted
+ private final Object FRAME_LOCK = new Object();
+
+ private final ISdlProtocol iSdlProtocol;
+ private final Hashtable<Integer, SdlProtocol.MessageFrameAssembler> _assemblerForMessageID = new Hashtable<>();
+ private final Hashtable<Byte, Object> _messageLocks = new Hashtable<>();
+ private final HashMap<SessionType, Long> mtus = new HashMap<>();
+ private final HashMap<SessionType, TransportRecord> activeTransports = new HashMap<>();
+ private final Map<TransportType, List<ISecondaryTransportListener>> secondaryTransportListeners = new HashMap<>();
+
+
+ private Version protocolVersion = new Version("1.0.0");
+ private int hashID = 0;
+ private int messageID = 0;
+ private int headerSize = V1_HEADER_SIZE;
+
+ /**
+ * Transport config that this protocol instance should use along with the supplied transport manager
+ */
+ final BaseTransportConfig transportConfig;
+
+ /**
+ * The transport manager used for this protocol instance.
+ */
+ TransportManagerBase transportManager;
+
+
+ /**
+ * Requested transports for primary and secondary
+ */
+ List<TransportType> requestedPrimaryTransports, requestedSecondaryTransports;
+
+ /**
+ * List of secondary transports supported by the module
+ */
+ List<TransportType> supportedSecondaryTransports;
+
+ /**
+ * Holds the priority of transports for a specific service when that service can be started
+ * on a primary or secondary transport.
+ */
+ Map<SessionType, List<Integer>> transportPriorityForServiceMap;
+ boolean requiresHighBandwidth;
+ Map<TransportType, TransportRecord> secondaryTransportParams;
+ TransportRecord connectedPrimaryTransport;
+
+
+ public SdlProtocolBase(@NonNull ISdlProtocol iSdlProtocol, @NonNull BaseTransportConfig config) {
+ if (iSdlProtocol == null ) {
+ throw new IllegalArgumentException("Provided protocol listener interface reference is null");
+ } // end-if
+
+ this.iSdlProtocol = iSdlProtocol;
+ this.transportConfig = config;
+ if(!config.getTransportType().equals(TransportType.MULTIPLEX)) {
+ this.requestedPrimaryTransports = Collections.singletonList(transportConfig.getTransportType());
+ this.requestedSecondaryTransports = Collections.emptyList();
+ this.requiresHighBandwidth = false;
+ }
+ mtus.put(SessionType.RPC, (long) (V1_V2_MTU_SIZE - headerSize));
+
+ } // end-ctor
+
+ void setTransportManager(TransportManagerBase transportManager){
+ this.transportManager = transportManager;
+ }
+
+ public void start(){
+ if(transportManager == null){
+ throw new IllegalStateException("Attempting to start without setting a transport manager.");
+ }
+ transportManager.start();
+
+ }
+ /**
+ * Retrieves the max payload size for a packet to be sent to the module
+ * @return the max transfer unit
+ */
+ public int getMtu(){
+ return mtus.get(SessionType.RPC).intValue();
+ }
+
+ public long getMtu(SessionType type){
+ Long mtu = mtus.get(type);
+ if(mtu == null){
+ mtu = mtus.get(SessionType.RPC);
+ }
+ return mtu;
+ }
+
+ public void resetSession (){
+ if(transportManager == null){
+ throw new IllegalStateException("Attempting to reset session without setting a transport manager.");
+ }
+ transportManager.resetSession();
+ }
+
+ public boolean isConnected(){
+ return transportManager != null && transportManager.isConnected(null,null);
+ }
+
+ /**
+ * Resets the protocol to init status
+ */
+ protected void reset(){
+ protocolVersion = new Version("1.0.0");
+ hashID = 0;
+ messageID = 0;
+ headerSize = V1_HEADER_SIZE;
+ this.activeTransports.clear();
+ this.mtus.clear();
+ mtus.put(SessionType.RPC, (long) (V1_V2_MTU_SIZE - headerSize));
+ this.secondaryTransportParams = null;
+ this._assemblerForMessageID.clear();
+ this._messageLocks.clear();
+ }
+
+ /**
+ * For logging purposes, prints active services on each connected transport
+ */
+ protected void printActiveTransports(){
+ StringBuilder activeTransportString = new StringBuilder();
+ activeTransportString.append("Active transports --- \n");
+
+ for(Map.Entry entry : activeTransports.entrySet()){
+ String sessionString = null;
+ if(entry.getKey().equals(SessionType.NAV)) {
+ sessionString = "NAV";
+ }else if(entry.getKey().equals(SessionType.PCM)) {
+ sessionString = "PCM";
+ }else if(entry.getKey().equals(SessionType.RPC)) {
+ sessionString = "RPC";
+ }
+ if(sessionString != null){
+ activeTransportString.append("Session: ");
+
+ activeTransportString.append(sessionString);
+ activeTransportString.append(" Transport: ");
+ activeTransportString.append(entry.getValue().toString());
+ activeTransportString.append("\n");
+ }
+ }
+ Log.d(TAG, activeTransportString.toString());
+ }
+
+ protected void printSecondaryTransportDetails(List<String> secondary, List<Integer> audio, List<Integer> video){
+ StringBuilder secondaryDetailsBldr = new StringBuilder();
+ secondaryDetailsBldr.append("Checking secondary transport details \n");
+
+ if(secondary != null){
+ secondaryDetailsBldr.append("Supported secondary transports: ");
+ for(String s : secondary){
+ secondaryDetailsBldr.append(" ").append(s);
+ }
+ secondaryDetailsBldr.append("\n");
+ }else{
+ Log.d(TAG, "Supported secondary transports list is empty!");
+ }
+ if(audio != null){
+ secondaryDetailsBldr.append("Supported audio transports: ");
+ for(int a : audio){
+ secondaryDetailsBldr.append(" ").append(a);
+ }
+ secondaryDetailsBldr.append("\n");
+ }
+ if(video != null){
+ secondaryDetailsBldr.append("Supported video transports: ");
+ for(int v : video){
+ secondaryDetailsBldr.append(" ").append(v);
+ }
+ secondaryDetailsBldr.append("\n");
+ }
+
+ Log.d(TAG, secondaryDetailsBldr.toString());
+ }
+
+
+ private TransportRecord getTransportForSession(SessionType type){
+ return activeTransports.get(type);
+ }
+
+ private void setTransportPriorityForService(SessionType serviceType, List<Integer> order){
+ if(transportPriorityForServiceMap == null){
+ transportPriorityForServiceMap = new HashMap<>();
+ }
+ this.transportPriorityForServiceMap.put(serviceType, order);
+ for(SessionType service : HIGH_BANDWIDTH_SERVICES){
+ if (transportPriorityForServiceMap.get(service) != null
+ && transportPriorityForServiceMap.get(service).contains(PRIMARY_TRANSPORT_ID)) {
+ if(connectedPrimaryTransport != null) {
+ activeTransports.put(service, connectedPrimaryTransport);
+ }
+ }
+ }
+ }
+
+ /**
+ * Handles when a secondary transport can be used to start services on or when the request as failed.
+ * @param transportRecord the transport type that the event has taken place on
+ * @param registered if the transport was successfully registered on
+ */
+ private void handleSecondaryTransportRegistration(TransportRecord transportRecord, boolean registered){
+ if(registered) {
+ //Session has been registered on secondary transport
+ Log.d(TAG, transportRecord.getType().toString() + " transport was registered!");
+ if (supportedSecondaryTransports.contains(transportRecord.getType())) {
+ // If the transport type that is now available to be used it should be checked
+ // against the list of services that might be able to be started on it
+
+ for(SessionType secondaryService : HIGH_BANDWIDTH_SERVICES){
+ if (transportPriorityForServiceMap.containsKey(secondaryService)) {
+ // If this service type has extra information from the RPC StartServiceACK
+ // parse through it to find which transport should be used to start this
+ // specific service type
+ for(int transportNum : transportPriorityForServiceMap.get(secondaryService)){
+ if(transportNum == PRIMARY_TRANSPORT_ID){
+ break; // Primary is favored for this service type, break out...
+ }else if(transportNum == SECONDARY_TRANSPORT_ID){
+ // The secondary transport can be used to start this service
+ activeTransports.put(secondaryService, transportRecord);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }else{
+ Log.d(TAG, transportRecord.toString() + " transport was NOT registered!");
+ }
+ //Notify any listeners for this secondary transport
+ List<ISecondaryTransportListener> listenerList = secondaryTransportListeners.remove(transportRecord.getType());
+ if(listenerList != null){
+ for(ISecondaryTransportListener listener : listenerList){
+ if(registered) {
+ listener.onConnectionSuccess(transportRecord);
+ }else{
+ listener.onConnectionFailure();
+ }
+ }
+ }
+
+ if(DebugTool.isDebugEnabled()){
+ printActiveTransports();
+ }
+ }
+
+ private void onTransportsConnectedUpdate(List<TransportRecord> transports){
+ //Log.d(TAG, "Connected transport update");
+
+ //Temporary: this logic should all be changed to handle multiple transports of the same type
+ ArrayList<TransportType> connectedTransports = new ArrayList<>();
+ if(transports != null) {
+ for (TransportRecord record : transports) {
+ connectedTransports.add(record.getType());
+ }
+ }
+
+ if(connectedPrimaryTransport != null && !connectedTransports.contains(connectedPrimaryTransport.getType())){
+ //The primary transport being used is no longer part of the connected transports
+ //The transport manager callbacks should handle the disconnect code
+ connectedPrimaryTransport = null;
+ notifyDevTransportListener();
+ return;
+ }
+
+ if(activeTransports.get(SessionType.RPC) == null){
+ //There is no currently active transport for the RPC service meaning no primary transport
+ TransportRecord preferredPrimaryTransport = getPreferredTransport(requestedPrimaryTransports,transports);
+ if(preferredPrimaryTransport != null) {
+ connectedPrimaryTransport = preferredPrimaryTransport;
+ startService(SessionType.RPC, (byte) 0x00, false);
+ }else{
+ onTransportNotAccepted("No transports match requested primary transport");
+ }
+ //Return to that the developer does not receive the transport callback at this time
+ // as it is better to wait until the RPC service is registered and secondary transport
+ //information is available
+ return;
+ }else if(secondaryTransportListeners != null
+ && transports != null
+ && iSdlProtocol!= null){
+ // Check to see if there is a listener for a given transport.
+ // If a listener exists, it can be assumed that the transport should be registered on
+ for(TransportRecord record: transports){
+ if(secondaryTransportListeners.get(record.getType()) != null
+ && !secondaryTransportListeners.get(record.getType()).isEmpty()){
+ registerSecondaryTransport(iSdlProtocol.getSessionId(), record);
+ }
+ }
+ }
+ //Update the developer that a new transport has become available
+ notifyDevTransportListener();
+ }
+
+
+ /**
+ * Check to see if a transport is available to start/use the supplied service.
+ * @param serviceType the session that should be checked for transport availability
+ * @return true if there is either a supported
+ * transport currently connected or a transport is
+ * available to connect with for the supplied service type.
+ * <br>false if there is no
+ * transport connected to support the service type in question and
+ * no possibility in the foreseeable future.
+ */
+ public boolean isTransportForServiceAvailable(@NonNull SessionType serviceType){
+ if(connectedPrimaryTransport == null){
+ //If there is no connected primary then there is no transport available for any service
+ return false;
+ }else if(activeTransports!= null && activeTransports.containsKey(serviceType)){
+ //There is an active transport that this service can be used on
+ //This should catch RPC, Bulk, and Control service types
+ return true;
+ }
+
+ if(transportPriorityForServiceMap != null) {
+ List<Integer> transportPriority = transportPriorityForServiceMap.get(serviceType);
+
+ if (transportPriority != null && !transportPriority.isEmpty()) {
+ if (transportPriority.contains(PRIMARY_TRANSPORT_ID)) {
+ //If the transport priority for this service type contains primary then
+ // the service can be used/started
+ return true;
+ } else if (transportPriority.contains(SECONDARY_TRANSPORT_ID)) {
+ //This would mean only secondary transport is supported for this service
+ return isSecondaryTransportAvailable(false);
+ }
+ }
+ }
+
+ //No transport priority for this service type
+ if(connectedPrimaryTransport.getType() == TransportType.USB || connectedPrimaryTransport.getType() == TransportType.TCP){
+ //Since the only service type that should reach this point are ones that require a high
+ //bandwidth, true can be returned if the primary transport is a high bandwidth transport
+ return true;
+ }else{
+ //Since the only service type that should reach this point are ones that require a high
+ //bandwidth, true can be returned if a secondary transport is a high bandwidth transport
+ return isSecondaryTransportAvailable(true);
+ }
+ }
+
+ /**
+ * Checks to see if a secondary transport is available for this session
+ * @param onlyHighBandwidth if only high bandwidth transports should be included in this check
+ * @return true if any connected or potential transport meets the criteria to be a secondary
+ * transport
+ */
+ private boolean isSecondaryTransportAvailable(boolean onlyHighBandwidth){
+ if (supportedSecondaryTransports != null) {
+ for (TransportType supportedSecondary : supportedSecondaryTransports) {
+ if(!onlyHighBandwidth || supportedSecondary == TransportType.USB || supportedSecondary == TransportType.TCP) {
+ if (transportManager.isConnected(supportedSecondary, null)) {
+ //A supported secondary transport is already connected
+ return true;
+ } else if (secondaryTransportParams != null && secondaryTransportParams.containsKey(supportedSecondary)) {
+ //A secondary transport is available to connect to
+ return true;
+ }
+ }
+ }
+ }
+ // No supported secondary transports
+ return false;
+ }
+
+
+ /**
+ * If the library allows for multiple transports per session this should be handled
+ */
+ void notifyDevTransportListener (){
+ //Does nothing in base class
+ }
+
+ /**
+ * Retrieves the preferred transport for the given connected transport
+ * @param preferredList the list of preferred transports (primary or secondary)
+ * @param connectedTransports the current list of connected transports
+ * @return the preferred connected transport
+ */
+ private TransportRecord getPreferredTransport(List<TransportType> preferredList, List<TransportRecord> connectedTransports) {
+ for (TransportType transportType : preferredList) {
+ for(TransportRecord record: connectedTransports) {
+ if (record.getType().equals(transportType)) {
+ return record;
+ }
+ }
+ }
+ return null;
+ }
+
+ private void onTransportNotAccepted(String info){
+ if(iSdlProtocol != null) {
+ iSdlProtocol.shutdown(info);
+ }
+ }
+
+
+ public Version getProtocolVersion(){
+ return this.protocolVersion;
+ }
+
+ /**
+ * This method will set the major protocol version that we should use. It will also set the default MTU based on version.
+ * @param version major version to use
+ */
+ protected void setVersion(byte version) {
+ if (version > 5) {
+ this.protocolVersion = new Version("5.0.0"); //protect for future, proxy only supports v5 or lower
+ headerSize = V2_HEADER_SIZE;
+ mtus.put(SessionType.RPC, (long) V3_V4_MTU_SIZE);
+ } else if (version == 5) {
+ this.protocolVersion = new Version("5.0.0");
+ headerSize = V2_HEADER_SIZE;
+ mtus.put(SessionType.RPC, (long) V3_V4_MTU_SIZE);
+ }else if (version == 4) {
+ this.protocolVersion = new Version("4.0.0");
+ headerSize = V2_HEADER_SIZE;
+ mtus.put(SessionType.RPC, (long) V3_V4_MTU_SIZE); //versions 4 supports 128k MTU
+ } else if (version == 3) {
+ this.protocolVersion = new Version("3.0.0");
+ headerSize = V2_HEADER_SIZE;
+ mtus.put(SessionType.RPC, (long) V3_V4_MTU_SIZE); //versions 3 supports 128k MTU
+ } else if (version == 2) {
+ this.protocolVersion = new Version("2.0.0");
+ headerSize = V2_HEADER_SIZE;
+ mtus.put(SessionType.RPC, (long) (V1_V2_MTU_SIZE - headerSize));
+ } else if (version == 1){
+ this.protocolVersion = new Version("1.0.0");
+ headerSize = V1_HEADER_SIZE;
+ mtus.put(SessionType.RPC, (long) (V1_V2_MTU_SIZE - headerSize));
+ }
+ }
+
+ public void endSession(byte sessionID, int hashId) {
+ SdlPacket header = SdlPacketFactory.createEndSession(SessionType.RPC, sessionID, hashId, (byte)protocolVersion.getMajor(), hashId);
+ handlePacketToSend(header);
+
+ } // end-method
+
+ public void sendPacket(SdlPacket packet){
+ if(transportManager != null){
+ transportManager.sendPacket(packet);
+ }
+ }
+
+ public void sendMessage(ProtocolMessage protocolMsg) {
+ SessionType sessionType = protocolMsg.getSessionType();
+ byte sessionID = protocolMsg.getSessionID();
+
+ byte[] data;
+ if (protocolVersion.getMajor() > 1 && sessionType != SessionType.NAV && sessionType != SessionType.PCM) {
+ if (sessionType.eq(SessionType.CONTROL)) {
+ final byte[] secureData = protocolMsg.getData().clone();
+ data = new byte[headerSize + secureData.length];
+
+ final BinaryFrameHeader binFrameHeader =
+ SdlPacketFactory.createBinaryFrameHeader(protocolMsg.getRPCType(),protocolMsg.getFunctionID(), protocolMsg.getCorrID(), 0);
+ System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, headerSize);
+ System.arraycopy(secureData, 0, data, headerSize, secureData.length);
+ }
+ else if (protocolMsg.getBulkData() != null) {
+ data = new byte[12 + protocolMsg.getJsonSize() + protocolMsg.getBulkData().length];
+ sessionType = SessionType.BULK_DATA;
+ } else {
+ data = new byte[12 + protocolMsg.getJsonSize()];
+ }
+ if (!sessionType.eq(SessionType.CONTROL)) {
+ BinaryFrameHeader binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(protocolMsg.getRPCType(), protocolMsg.getFunctionID(), protocolMsg.getCorrID(), protocolMsg.getJsonSize());
+ System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
+ System.arraycopy(protocolMsg.getData(), 0, data, 12, protocolMsg.getJsonSize());
+ if (protocolMsg.getBulkData() != null) {
+ System.arraycopy(protocolMsg.getBulkData(), 0, data, 12 + protocolMsg.getJsonSize(), protocolMsg.getBulkData().length);
+ }
+ }
+ } else {
+ data = protocolMsg.getData();
+ }
+
+ if (iSdlProtocol != null && protocolMsg.getPayloadProtected()){
+
+ if (data != null && data.length > 0) {
+ byte[] dataToRead = new byte[TLS_MAX_RECORD_SIZE];
+ SdlSecurityBase sdlSec = iSdlProtocol.getSdlSecurity();
+ if (sdlSec == null)
+ return;
+
+ Integer iNumBytes = sdlSec.encryptData(data, dataToRead);
+ if ((iNumBytes == null) || (iNumBytes <= 0))
+ return;
+
+ byte[] encryptedData = new byte[iNumBytes];
+ System.arraycopy(dataToRead, 0, encryptedData, 0, iNumBytes);
+ data = encryptedData;
+ }
+ }
+
+ // Get the message lock for this protocol session
+ Object messageLock = _messageLocks.get(sessionID);
+ if (messageLock == null) {
+ handleProtocolError("Error sending protocol message to SDL.",
+ new SdlException("Attempt to send protocol message prior to startSession ACK.", SdlExceptionCause.SDL_UNAVAILABLE));
+ return;
+ }
+
+ synchronized(messageLock) {
+ if (data.length > getMtu(sessionType)) {
+
+ messageID++;
+
+ // Assemble first frame.
+ Long mtu = getMtu(sessionType);
+ int frameCount = Long.valueOf(data.length / mtu).intValue();
+ if (data.length % mtu > 0) {
+ frameCount++;
+ }
+ byte[] firstFrameData = new byte[8];
+ // First four bytes are data size.
+ System.arraycopy(BitConverter.intToByteArray(data.length), 0, firstFrameData, 0, 4);
+ // Second four bytes are frame count.
+ System.arraycopy(BitConverter.intToByteArray(frameCount), 0, firstFrameData, 4, 4);
+
+ SdlPacket firstHeader = SdlPacketFactory.createMultiSendDataFirst(sessionType, sessionID, messageID, (byte)protocolVersion.getMajor(),firstFrameData,protocolMsg.getPayloadProtected());
+ firstHeader.setPriorityCoefficient(1+protocolMsg.priorityCoefficient);
+ firstHeader.setTransportRecord(activeTransports.get(sessionType));
+ //Send the first frame
+ handlePacketToSend(firstHeader);
+
+ int currentOffset = 0;
+ byte frameSequenceNumber = 0;
+
+ for (int i = 0; i < frameCount; i++) {
+ if (i < (frameCount - 1)) {
+ ++frameSequenceNumber;
+ if (frameSequenceNumber ==
+ SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME) {
+ // we can't use 0x00 as frameSequenceNumber, because
+ // it's reserved for the last frame
+ ++frameSequenceNumber;
+ }
+ } else {
+ frameSequenceNumber = SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME;
+ } // end-if
+
+ int bytesToWrite = data.length - currentOffset;
+ if (bytesToWrite > mtu) {
+ bytesToWrite = mtu.intValue();
+ }
+ SdlPacket consecHeader = SdlPacketFactory.createMultiSendDataRest(sessionType, sessionID, bytesToWrite, frameSequenceNumber , messageID, (byte)protocolVersion.getMajor(),data, currentOffset, bytesToWrite, protocolMsg.getPayloadProtected());
+ consecHeader.setTransportRecord(activeTransports.get(sessionType));
+ consecHeader.setPriorityCoefficient(i+2+protocolMsg.priorityCoefficient);
+ handlePacketToSend(consecHeader);
+ currentOffset += bytesToWrite;
+ }
+ } else {
+ messageID++;
+ SdlPacket header = SdlPacketFactory.createSingleSendData(sessionType, sessionID, data.length, messageID, (byte)protocolVersion.getMajor(),data, protocolMsg.getPayloadProtected());
+ header.setPriorityCoefficient(protocolMsg.priorityCoefficient);
+ header.setTransportRecord(activeTransports.get(sessionType));
+ handlePacketToSend(header);
+ }
+ }
+ }
+
+ protected void handlePacketReceived(SdlPacket packet){
+ //Check for a version difference
+ if (protocolVersion == null || protocolVersion.getMajor() == 1) {
+ setVersion((byte)packet.version);
+ }
+
+ SdlProtocolBase.MessageFrameAssembler assembler = getFrameAssemblerForFrame(packet);
+ assembler.handleFrame(packet);
+
+ }
+
+
+ protected SdlProtocolBase.MessageFrameAssembler getFrameAssemblerForFrame(SdlPacket packet) {
+ Integer iSessionId = packet.getSessionId();
+ Byte bySessionId = iSessionId.byteValue();
+
+ SdlProtocolBase.MessageFrameAssembler ret = _assemblerForMessageID.get(packet.getMessageId());
+ if (ret == null) {
+ ret = new SdlProtocolBase.MessageFrameAssembler();
+ _assemblerForMessageID.put(packet.getMessageId(), ret);
+ } // end-if
+
+ return ret;
+ } // end-method
+
+
+
+ private void registerSecondaryTransport(byte sessionId, TransportRecord transportRecord) {
+ SdlPacket header = SdlPacketFactory.createRegisterSecondaryTransport(sessionId, (byte)protocolVersion.getMajor());
+ header.setTransportRecord(transportRecord);
+ handlePacketToSend(header);
+ }
+
+ public void startService(SessionType serviceType, byte sessionID, boolean isEncrypted) {
+ final SdlPacket header = SdlPacketFactory.createStartSession(serviceType, 0x00, (byte)protocolVersion.getMajor(), sessionID, isEncrypted);
+ if(SessionType.RPC.equals(serviceType)){
+ if(connectedPrimaryTransport != null) {
+ header.setTransportRecord(connectedPrimaryTransport);
+ }
+ //This is going to be our primary transport
+ header.putTag(ControlFrameTags.RPC.StartService.PROTOCOL_VERSION, MAX_PROTOCOL_VERSION.toString());
+ handlePacketToSend(header);
+ return; // We don't need to go any further
+ }else if(serviceType.equals(SessionType.NAV)){
+ if(iSdlProtocol != null){
+ VideoStreamingParameters videoStreamingParameters = iSdlProtocol.getDesiredVideoParams();
+ if(videoStreamingParameters != null) {
+ ImageResolution desiredResolution = videoStreamingParameters.getResolution();
+ VideoStreamingFormat desiredFormat = videoStreamingParameters.getFormat();
+ if (desiredResolution != null) {
+ header.putTag(ControlFrameTags.Video.StartService.WIDTH, desiredResolution.getResolutionWidth());
+ header.putTag(ControlFrameTags.Video.StartService.HEIGHT, desiredResolution.getResolutionHeight());
+ }
+ if (desiredFormat != null) {
+ header.putTag(ControlFrameTags.Video.StartService.VIDEO_CODEC, desiredFormat.getCodec().toString());
+ header.putTag(ControlFrameTags.Video.StartService.VIDEO_PROTOCOL, desiredFormat.getProtocol().toString());
+ }
+ }
+ }
+ }
+ if(transportPriorityForServiceMap == null
+ || transportPriorityForServiceMap.get(serviceType) == null
+ || transportPriorityForServiceMap.get(serviceType).isEmpty()){
+ //If there is no transport priority for this service it can be assumed it's primary
+ header.setTransportRecord(connectedPrimaryTransport);
+ handlePacketToSend(header);
+ return;
+ }
+ int transportPriority = transportPriorityForServiceMap.get(serviceType).get(0);
+ if(transportPriority == PRIMARY_TRANSPORT_ID){
+ // Primary is favored, and we're already connected...
+ header.setTransportRecord(connectedPrimaryTransport);
+ handlePacketToSend(header);
+ }else if(transportPriority == SECONDARY_TRANSPORT_ID) {
+ // Secondary is favored
+ for(TransportType secondaryTransportType : supportedSecondaryTransports) {
+
+ if(!requestedSecondaryTransports.contains(secondaryTransportType)){
+ // Secondary transport is not accepted by the client
+ continue;
+ }
+
+ if(activeTransports.get(serviceType) != null
+ && activeTransports.get(serviceType).getType() !=null
+ && activeTransports.get(serviceType).getType().equals(secondaryTransportType)){
+ // Transport is already active and accepted
+ header.setTransportRecord(activeTransports.get(serviceType));
+ handlePacketToSend(header);
+ return;
+ }
+
+
+
+ //If the secondary transport isn't connected yet that will have to be performed first
+
+ List<ISecondaryTransportListener> listenerList = secondaryTransportListeners.get(secondaryTransportType);
+ if(listenerList == null){
+ listenerList = new ArrayList<>();
+ secondaryTransportListeners.put(secondaryTransportType, listenerList);
+ }
+
+ //Check to see if the primary transport can also be used as a backup
+ final boolean primaryTransportBackup = transportPriorityForServiceMap.get(serviceType).contains(PRIMARY_TRANSPORT_ID);
+
+ ISecondaryTransportListener secondaryListener = new ISecondaryTransportListener() {
+ @Override
+ public void onConnectionSuccess(TransportRecord transportRecord) {
+ header.setTransportRecord(transportRecord);
+ handlePacketToSend(header);
+ }
+
+ @Override
+ public void onConnectionFailure() {
+ if(primaryTransportBackup) {
+ // Primary is also supported as backup
+ header.setTransportRecord(connectedPrimaryTransport);
+ handlePacketToSend(header);
+ }else{
+ Log.d(TAG, "Failed to connect secondary transport, threw away StartService");
+ }
+ }
+ };
+
+ if(transportManager.isConnected(secondaryTransportType,null)){
+ //The transport is actually connected, however no service has been registered
+ listenerList.add(secondaryListener);
+ registerSecondaryTransport(sessionID,transportManager.getTransportRecord(secondaryTransportType,null));
+ }else if(secondaryTransportParams != null && secondaryTransportParams.containsKey(secondaryTransportType)) {
+ //No acceptable secondary transport is connected, so first one must be connected
+ header.setTransportRecord(new TransportRecord(secondaryTransportType,""));
+ listenerList.add(secondaryListener);
+ transportManager.requestSecondaryTransportConnection(sessionID,secondaryTransportParams.get(secondaryTransportType));
+ }else{
+ Log.w(TAG, "No params to connect to secondary transport");
+ //Unable to register or start a secondary connection. Use the callback in case
+ //there is a chance to use the primary transport for this service.
+ secondaryListener.onConnectionFailure();
+ }
+
+ }
+ }
+ }
+
+ private void sendHeartBeatACK(SessionType sessionType, byte sessionID) {
+ final SdlPacket heartbeat = SdlPacketFactory.createHeartbeatACK(SessionType.CONTROL, sessionID, (byte)protocolVersion.getMajor());
+ heartbeat.setTransportRecord(activeTransports.get(sessionType));
+ handlePacketToSend(heartbeat);
+ }
+
+ public void endService(SessionType serviceType, byte sessionID) {
+ if(serviceType.equals(SessionType.RPC)){ //RPC session will close all other sessions so we want to make sure we use the correct EndProtocolSession method
+ endSession(sessionID,hashID);
+ }else {
+ SdlPacket header = SdlPacketFactory.createEndSession(serviceType, sessionID, hashID, (byte)protocolVersion.getMajor(), new byte[0]);
+ TransportRecord transportRecord = activeTransports.get(serviceType);
+ if(transportRecord != null){
+ header.setTransportRecord(transportRecord);
+ handlePacketToSend(header);
+ }
+ }
+ }
+
+ /* --------------------------------------------------------------------------------------------
+ ----------------------------------- OLD ABSTRACT PROTOCOL ---------------------------------
+ -------------------------------------------------------------------------------------------*/
+
+
+ // This method is called whenever a protocol has an entire frame to send
+ /**
+ * SdlPacket should have included payload at this point.
+ * @param packet packet that will be sent to the router service
+ */
+ protected void handlePacketToSend(SdlPacket packet) {
+ synchronized(FRAME_LOCK) {
+
+ if(packet!=null){
+ iSdlProtocol.onProtocolMessageBytesToSend(packet);
+ }
+
+ }
+ }
+
+ /** This method handles the end of a protocol session. A callback is
+ * sent to the protocol listener.
+ **/
+ protected void handleServiceEndedNAK(SdlPacket packet, SessionType serviceType) {
+ if(packet.version >= 5){
+ if(DebugTool.isDebugEnabled()) {
+ //Currently this is only during a debugging session. Might pass back in the future
+ String rejectedTag = null;
+ if (serviceType.equals(SessionType.RPC)) {
+ rejectedTag = ControlFrameTags.RPC.EndServiceNAK.REJECTED_PARAMS;
+ } else if (serviceType.equals(SessionType.PCM)) {
+ rejectedTag = ControlFrameTags.Audio.EndServiceNAK.REJECTED_PARAMS;
+ } else if (serviceType.equals(SessionType.NAV)) {
+ rejectedTag = ControlFrameTags.Video.EndServiceNAK.REJECTED_PARAMS;
+ }
+
+ List<String> rejectedParams = (List<String>) packet.getTag(rejectedTag);
+ if(rejectedParams != null && rejectedParams.size() > 0){
+ StringBuilder builder = new StringBuilder();
+ builder.append("Rejected params for service type ");
+ builder.append(serviceType.getName());
+ builder.append(" :");
+ for(String rejectedParam : rejectedParams){
+ builder.append(rejectedParam);
+ builder.append(" ");
+ }
+ DebugTool.logWarning(builder.toString());
+ }
+
+ }
+ }
+
+ iSdlProtocol.onProtocolSessionEndedNACKed(serviceType, (byte)packet.getSessionId(), "");
+ }
+
+ // This method handles the end of a protocol session. A callback is
+ // sent to the protocol listener.
+ protected void handleServiceEnded(SdlPacket packet, SessionType sessionType) {
+
+ iSdlProtocol.onProtocolSessionEnded(sessionType, (byte)packet.getSessionId(), "");
+
+ }
+
+ /**
+ * This method handles the startup of a protocol session. A callback is sent
+ * to the protocol listener.
+ * @param packet StarServiceACK packet
+ * @param serviceType the service type that has just been started
+ */
+ protected void handleProtocolSessionStarted(SdlPacket packet, SessionType serviceType) {
+ // Use this sessionID to create a message lock
+ Object messageLock = _messageLocks.get((byte)packet.getSessionId());
+ if (messageLock == null) {
+ messageLock = new Object();
+ _messageLocks.put((byte)packet.getSessionId(), messageLock);
+ }
+ if(packet.version >= 5){
+ String mtuTag = null;
+ if(serviceType.equals(SessionType.RPC)){
+ mtuTag = ControlFrameTags.RPC.StartServiceACK.MTU;
+ }else if(serviceType.equals(SessionType.PCM)){
+ mtuTag = ControlFrameTags.Audio.StartServiceACK.MTU;
+ }else if(serviceType.equals(SessionType.NAV)){
+ mtuTag = ControlFrameTags.Video.StartServiceACK.MTU;
+ }
+ Object mtu = packet.getTag(mtuTag);
+ if(mtu!=null){
+ mtus.put(serviceType,(Long) packet.getTag(mtuTag));
+ }
+ if(serviceType.equals(SessionType.RPC)){
+ hashID = (Integer) packet.getTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID);
+ Object version = packet.getTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION);
+
+ if(version!=null) {
+ //At this point we have confirmed the negotiated version between the module and the proxy
+ protocolVersion = new Version((String) version);
+ }else{
+ protocolVersion = new Version("5.0.0");
+ }
+
+ //Check to make sure this is a transport we are willing to accept
+ TransportRecord transportRecord = packet.getTransportRecord();
+
+ if(transportRecord == null || !requestedPrimaryTransports.contains(transportRecord.getType())){
+ onTransportNotAccepted("Transport is not in requested primary transports");
+ return;
+ }
+
+
+ // This enables custom behavior based on protocol version specifics
+ if (protocolVersion.isNewerThan(new Version("5.1.0")) >= 0) {
+
+ if (activeTransports.get(SessionType.RPC) == null) { //Might be a better way to handle this
+
+ ArrayList<String> secondary = (ArrayList<String>) packet.getTag(ControlFrameTags.RPC.StartServiceACK.SECONDARY_TRANSPORTS);
+ ArrayList<Integer> audio = (ArrayList<Integer>) packet.getTag(ControlFrameTags.RPC.StartServiceACK.AUDIO_SERVICE_TRANSPORTS);
+ ArrayList<Integer> video = (ArrayList<Integer>) packet.getTag(ControlFrameTags.RPC.StartServiceACK.VIDEO_SERVICE_TRANSPORTS);
+
+ activeTransports.put(SessionType.RPC, transportRecord);
+ activeTransports.put(SessionType.BULK_DATA, transportRecord);
+ activeTransports.put(SessionType.CONTROL, transportRecord);
+
+ //Build out the supported secondary transports received from the
+ // RPC start service ACK.
+ supportedSecondaryTransports = new ArrayList<>();
+ if (secondary == null) {
+ // If no secondary transports were attached we should assume
+ // the Video and Audio services can be used on primary
+ if (requiresHighBandwidth
+ && TransportType.BLUETOOTH.equals(transportRecord.getType())) {
+ //transport can't support high bandwidth
+ onTransportNotAccepted(transportRecord.getType() + " can't support high bandwidth requirement, and secondary transport not supported.");
+ return;
+ }
+
+ if (video == null || video.contains(PRIMARY_TRANSPORT_ID)) {
+ activeTransports.put(SessionType.NAV, transportRecord);
+ }
+ if (audio == null || audio.contains(PRIMARY_TRANSPORT_ID)) {
+ activeTransports.put(SessionType.PCM, transportRecord);
+ }
+ }else{
+
+ if(DebugTool.isDebugEnabled()){
+ printSecondaryTransportDetails(secondary,audio,video);
+ }
+ for (String s : secondary) {
+ switch (s) {
+ case TransportConstants.TCP_WIFI:
+ supportedSecondaryTransports.add(TransportType.TCP);
+ break;
+ case TransportConstants.AOA_USB:
+ supportedSecondaryTransports.add(TransportType.USB);
+ break;
+ case TransportConstants.SPP_BLUETOOTH:
+ supportedSecondaryTransports.add(TransportType.BLUETOOTH);
+ break;
+ }
+ }
+ }
+
+ setTransportPriorityForService(SessionType.PCM, audio);
+ setTransportPriorityForService(SessionType.NAV, video);
+
+ //Update the developer on the transport status
+ notifyDevTransportListener();
+
+ } else {
+ Log.w(TAG, "Received a start service ack for RPC service while already active on a different transport.");
+ return;
+ }
+
+ if(protocolVersion.isNewerThan(new Version(5,2,0)) >= 0){
+ String authToken = (String)packet.getTag(ControlFrameTags.RPC.StartServiceACK.AUTH_TOKEN);
+ if(authToken != null){
+ iSdlProtocol.onAuthTokenReceived(authToken);
+ }
+ }
+ }else {
+
+ //Version is either not included or lower than 5.1.0
+ if (requiresHighBandwidth
+ && TransportType.BLUETOOTH.equals(transportRecord.getType())) {
+ //transport can't support high bandwidth
+ onTransportNotAccepted(transportRecord.getType() + " can't support high bandwidth requirement, and secondary transport not supported in this protocol version: " + version);
+ return;
+ }
+
+ activeTransports.put(SessionType.RPC, transportRecord);
+ activeTransports.put(SessionType.BULK_DATA, transportRecord);
+ activeTransports.put(SessionType.CONTROL, transportRecord);
+ activeTransports.put(SessionType.NAV, transportRecord);
+ activeTransports.put(SessionType.PCM, transportRecord);
+
+ //Inform the developer of the initial transport connection
+ notifyDevTransportListener();
+ }
+
+
+ }else if(serviceType.equals(SessionType.NAV)){
+ if(iSdlProtocol != null) {
+ ImageResolution acceptedResolution = new ImageResolution();
+ VideoStreamingFormat acceptedFormat = new VideoStreamingFormat();
+ acceptedResolution.setResolutionHeight((Integer) packet.getTag(ControlFrameTags.Video.StartServiceACK.HEIGHT));
+ acceptedResolution.setResolutionWidth((Integer) packet.getTag(ControlFrameTags.Video.StartServiceACK.WIDTH));
+ acceptedFormat.setCodec(VideoStreamingCodec.valueForString((String) packet.getTag(ControlFrameTags.Video.StartServiceACK.VIDEO_CODEC)));
+ acceptedFormat.setProtocol(VideoStreamingProtocol.valueForString((String) packet.getTag(ControlFrameTags.Video.StartServiceACK.VIDEO_PROTOCOL)));
+ VideoStreamingParameters agreedVideoParams = iSdlProtocol.getDesiredVideoParams();
+ agreedVideoParams.setResolution(acceptedResolution);
+ agreedVideoParams.setFormat(acceptedFormat);
+ iSdlProtocol.setAcceptedVideoParams(agreedVideoParams);
+ }
+ }
+ } else {
+ TransportRecord transportRecord = packet.getTransportRecord();
+ if(transportRecord == null || (requiresHighBandwidth
+ && TransportType.BLUETOOTH.equals(transportRecord.getType()))){
+ //transport can't support high bandwidth
+ onTransportNotAccepted((transportRecord != null ? transportRecord.getType().toString() : "Transport") + "can't support high bandwidth requirement, and secondary transport not supported in this protocol version");
+ return;
+ }
+ //If version < 5 and transport is acceptable we need to just add these
+ activeTransports.put(SessionType.RPC, transportRecord);
+ activeTransports.put(SessionType.BULK_DATA, transportRecord);
+ activeTransports.put(SessionType.CONTROL, transportRecord);
+ activeTransports.put(SessionType.NAV, transportRecord);
+ activeTransports.put(SessionType.PCM, transportRecord);
+
+ if (protocolVersion.getMajor() > 1){
+ if (packet.payload!= null && packet.dataSize == 4){ //hashid will be 4 bytes in length
+ hashID = BitConverter.intFromByteArray(packet.payload, 0);
+ }
+ }
+ }
+
+ iSdlProtocol.onProtocolSessionStarted(serviceType, (byte) packet.getSessionId(), (byte)protocolVersion.getMajor(), "", hashID, packet.isEncrypted());
+ }
+
+ protected void handleProtocolSessionNAKed(SdlPacket packet, SessionType serviceType) {
+ List<String> rejectedParams = null;
+ if(packet.version >= 5){
+ if(DebugTool.isDebugEnabled()) {
+ //Currently this is only during a debugging session. Might pass back in the future
+ String rejectedTag = null;
+ if (serviceType.equals(SessionType.RPC)) {
+ rejectedTag = ControlFrameTags.RPC.StartServiceNAK.REJECTED_PARAMS;
+ } else if (serviceType.equals(SessionType.PCM)) {
+ rejectedTag = ControlFrameTags.Audio.StartServiceNAK.REJECTED_PARAMS;
+ } else if (serviceType.equals(SessionType.NAV)) {
+ rejectedTag = ControlFrameTags.Video.StartServiceNAK.REJECTED_PARAMS;
+ }
+
+ rejectedParams = (List<String>) packet.getTag(rejectedTag);
+ if(rejectedParams != null && rejectedParams.size() > 0){
+ StringBuilder builder = new StringBuilder();
+ builder.append("Rejected params for service type ");
+ builder.append(serviceType.getName());
+ builder.append(" :");
+ for(String rejectedParam : rejectedParams){
+ builder.append(rejectedParam);
+ builder.append(" ");
+ }
+ DebugTool.logWarning(builder.toString());
+ }
+
+ }
+ }
+ if (serviceType.eq(SessionType.NAV) || serviceType.eq(SessionType.PCM)) {
+ iSdlProtocol.onProtocolSessionNACKed(serviceType, (byte)packet.sessionId, (byte)protocolVersion.getMajor(), "", rejectedParams);
+
+ } else {
+ handleProtocolError("Got StartSessionNACK for protocol sessionID = " + packet.getSessionId(), null);
+ }
+ }
+
+ // This method handles protocol errors. A callback is sent to the protocol
+ // listener.
+ protected void handleProtocolError(String string, Exception ex) {
+ iSdlProtocol.onProtocolError(string, ex);
+ }
+
+ protected void handleProtocolHeartbeat(SessionType sessionType, byte sessionID) {
+ sendHeartBeatACK(sessionType,sessionID);
+ }
+
+ protected void handleServiceDataACK(SdlPacket packet, SessionType sessionType) {
+
+ if (packet.getPayload() != null && packet.getDataSize() == 4){ //service data ack will be 4 bytes in length
+ int serviceDataAckSize = BitConverter.intFromByteArray(packet.getPayload(), 0);
+ iSdlProtocol.onProtocolServiceDataACK(sessionType, serviceDataAckSize, (byte)packet.getSessionId ());
+
+ }
+ }
+
+ /* --------------------------------------------------------------------------------------------
+ ----------------------------------- TRANSPORT_TYPE LISTENER ---------------------------------
+ -------------------------------------------------------------------------------------------*/
+
+ @SuppressWarnings("FieldCanBeLocal")
+ final TransportManagerBase.TransportEventListener transportEventListener = new TransportManagerBase.TransportEventListener() {
+ private boolean requestedSession = false;
+
+ @Override
+ public void onPacketReceived(SdlPacket packet) {
+ handlePacketReceived(packet);
+ }
+
+ @Override
+ public void onTransportConnected(List<TransportRecord> connectedTransports) {
+ Log.d(TAG, "onTransportConnected");
+ //In the future we should move this logic into the Protocol Layer
+ TransportRecord transportRecord = getTransportForSession(SessionType.RPC);
+ if(transportRecord == null && !requestedSession){ //There is currently no transport registered
+ requestedSession = true;
+ transportManager.requestNewSession(getPreferredTransport(requestedPrimaryTransports,connectedTransports));
+ }
+ onTransportsConnectedUpdate(connectedTransports);
+ if(DebugTool.isDebugEnabled()){
+ printActiveTransports();
+ }
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, TransportRecord disconnectedTransport, List<TransportRecord> connectedTransports) {
+ if (disconnectedTransport == null) {
+ Log.d(TAG, "onTransportDisconnected");
+ transportManager.close(iSdlProtocol.getSessionId());
+ iSdlProtocol.shutdown("No transports left connected");
+ return;
+ } else {
+ Log.d(TAG, "onTransportDisconnected - " + disconnectedTransport.getType().name());
+ }
+
+ //In the future we will actually compare the record but at this point we can assume only
+ //a single transport record per transport.
+ //TransportType type = disconnectedTransport.getType();
+ if(getTransportForSession(SessionType.NAV) != null && disconnectedTransport.equals(getTransportForSession(SessionType.NAV))){
+ //stopVideoStream();
+ iSdlProtocol.stopStream(SessionType.NAV);
+ activeTransports.remove(SessionType.NAV);
+ }
+ if(getTransportForSession(SessionType.PCM) != null && disconnectedTransport.equals(getTransportForSession(SessionType.PCM))){
+ //stopAudioStream();
+ iSdlProtocol.stopStream(SessionType.PCM);
+ activeTransports.remove(SessionType.PCM);
+ }
+
+ if((getTransportForSession(SessionType.RPC) != null && disconnectedTransport.equals(getTransportForSession(SessionType.RPC))) || disconnectedTransport.equals(connectedPrimaryTransport)){
+ //transportTypes.remove(type);
+ boolean primaryTransportAvailable = false;
+ if(requestedPrimaryTransports != null && requestedPrimaryTransports.size() > 1){
+ for (TransportType transportType: requestedPrimaryTransports){ Log.d(TAG, "Checking " + transportType.name());
+ if(!disconnectedTransport.getType().equals(transportType)
+ && transportManager != null
+ && transportManager.isConnected(transportType,null)){
+ primaryTransportAvailable = true;
+ transportManager.updateTransportConfig(transportConfig);
+ break;
+ }
+ }
+ }
+ connectedPrimaryTransport = null;
+ transportManager.close(iSdlProtocol.getSessionId());
+ transportManager = null;
+ requestedSession = false;
+
+ activeTransports.clear();
+
+ iSdlProtocol.onTransportDisconnected(info, primaryTransportAvailable, transportConfig);
+
+ } //else Transport was not primary, continuing to stay connected
+
+ //Update the developer since a transport just disconnected
+ notifyDevTransportListener();
+
+ }
+
+ @Override
+ public void onError(String info) {
+ iSdlProtocol.shutdown(info);
+
+ }
+
+ @Override
+ public boolean onLegacyModeEnabled(String info) {
+ //Await a connection from the legacy transport
+ if(requestedPrimaryTransports!= null && requestedPrimaryTransports.contains(TransportType.BLUETOOTH)
+ && !SdlProtocolBase.this.requiresHighBandwidth){
+ Log.d(TAG, "Entering legacy mode; creating new protocol instance");
+ reset();
+ return true;
+ }else{
+ Log.d(TAG, "Bluetooth is not an acceptable transport; not moving to legacy mode");
+ return false;
+ }
+ }
+ };
+
+/* -------------------------------------------------------------------------------------------------
+----------------------------------- Internal Classes ------------------------------------------
+--------------------------------------------------------------------------------------------------*/
+
+
+ protected class MessageFrameAssembler {
+ protected ByteArrayOutputStream accumulator = null;
+ protected int totalSize = 0;
+
+ protected void handleFirstDataFrame(SdlPacket packet) {
+ //The message is new, so let's figure out how big it is.
+ totalSize = BitConverter.intFromByteArray(packet.payload, 0) - headerSize;
+ try {
+ accumulator = new ByteArrayOutputStream(totalSize);
+ }catch(OutOfMemoryError e){
+ DebugTool.logError("OutOfMemory error", e); //Garbled bits were received
+ accumulator = null;
+ }
+ }
+
+ protected void handleRemainingFrame(SdlPacket packet) {
+ accumulator.write(packet.payload, 0, (int)packet.getDataSize());
+ notifyIfFinished(packet);
+ }
+
+ protected void notifyIfFinished(SdlPacket packet) {
+ if (packet.getFrameType() == FrameType.Consecutive && packet.getFrameInfo() == 0x0) {
+ ProtocolMessage message = new ProtocolMessage();
+ message.setPayloadProtected(packet.isEncrypted());
+ message.setSessionType(SessionType.valueOf((byte)packet.getServiceType()));
+ message.setSessionID((byte)packet.getSessionId());
+ //If it is WiPro 2.0 it must have binary header
+ if (protocolVersion.getMajor() > 1) {
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
+ parseBinaryHeader(accumulator.toByteArray());
+ if(binFrameHeader == null) {
+ return;
+ }
+ message.setVersion((byte)protocolVersion.getMajor());
+ message.setRPCType(binFrameHeader.getRPCType());
+ message.setFunctionID(binFrameHeader.getFunctionID());
+ message.setCorrID(binFrameHeader.getCorrID());
+ if (binFrameHeader.getJsonSize() > 0) message.setData(binFrameHeader.getJsonData());
+ if (binFrameHeader.getBulkData() != null) message.setBulkData(binFrameHeader.getBulkData());
+ } else{
+ message.setData(accumulator.toByteArray());
+ }
+
+ _assemblerForMessageID.remove(packet.getMessageId());
+
+ try {
+ iSdlProtocol.onProtocolMessageReceived(message);
+ } catch (Exception excp) {
+ DebugTool.logError(FailurePropagating_Msg + "onProtocolMessageReceived: " + excp.toString(), excp);
+ } // end-catch
+
+ accumulator = null;
+ } // end-if
+ } // end-method
+
+ protected void handleMultiFrameMessageFrame(SdlPacket packet) {
+ if (packet.getFrameType() == FrameType.First) {
+ handleFirstDataFrame(packet);
+ }
+ else{
+ if(accumulator != null){
+ handleRemainingFrame(packet);
+ }
+ }
+
+ } // end-method
+
+ protected void handleFrame(SdlPacket packet) {
+
+ if (packet.getPayload() != null && packet.getDataSize() > 0 && packet.isEncrypted() ) {
+
+ SdlSecurityBase sdlSec = iSdlProtocol.getSdlSecurity();
+ byte[] dataToRead = new byte[4096];
+
+ Integer iNumBytes = sdlSec.decryptData(packet.getPayload(), dataToRead);
+ if ((iNumBytes == null) || (iNumBytes <= 0)){
+ return;
+ }
+
+ byte[] decryptedData = new byte[iNumBytes];
+ System.arraycopy(dataToRead, 0, decryptedData, 0, iNumBytes);
+ packet.payload = decryptedData;
+ }
+
+ if (packet.getFrameType().equals(FrameType.Control)) {
+ handleControlFrame(packet);
+ } else {
+ // Must be a form of data frame (single, first, consecutive, etc.)
+ if ( packet.getFrameType() == FrameType.First
+ || packet.getFrameType() == FrameType.Consecutive
+ ) {
+ handleMultiFrameMessageFrame(packet);
+ } else {
+ handleSingleFrameMessageFrame(packet);
+ }
+ }
+ }
+
+ private void handleProtocolHeartbeatACK(SdlPacket packet) {
+ //Heartbeat is not supported in the SdlProtocol class beyond responding with ACKs to
+ //heartbeat messages. Receiving this ACK is suspicious and should be logged
+ DebugTool.logInfo("Received HeartbeatACK - " + packet.toString());
+ }
+
+ private void handleProtocolHeartbeat(SdlPacket packet) {
+ SdlProtocolBase.this.handleProtocolHeartbeat(SessionType.valueOf((byte)packet.getServiceType()),(byte)packet.getSessionId());
+ }
+
+ /**
+ * Directing method that will push the packet to the method that can handle it best
+ * @param packet a control frame packet
+ */
+ private void handleControlFrame(SdlPacket packet) {
+ Integer frameTemp = packet.getFrameInfo();
+ Byte frameInfo = frameTemp.byteValue();
+
+ SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
+
+ if (frameInfo == FrameDataControlFrameType.Heartbeat.getValue()) {
+
+ handleProtocolHeartbeat(packet);
+
+ }else if (frameInfo == FrameDataControlFrameType.HeartbeatACK.getValue()) {
+
+ handleProtocolHeartbeatACK(packet);
+
+ }else if (frameInfo == FrameDataControlFrameType.StartSessionACK.getValue()) {
+
+ handleProtocolSessionStarted(packet, serviceType);
+
+ } else if (frameInfo == FrameDataControlFrameType.StartSessionNACK.getValue()) {
+
+ handleProtocolSessionNAKed(packet, serviceType);
+
+ } else if (frameInfo == FrameDataControlFrameType.EndSession.getValue()
+ || frameInfo == FrameDataControlFrameType.EndSessionACK.getValue()) {
+
+ handleServiceEnded(packet,serviceType);
+
+ } else if (frameInfo == FrameDataControlFrameType.EndSessionNACK.getValue()) {
+
+ handleServiceEndedNAK(packet, serviceType);
+
+ } else if (frameInfo == FrameDataControlFrameType.ServiceDataACK.getValue()) {
+
+ handleServiceDataACK(packet, serviceType);
+
+ } else if (frameInfo == FrameDataControlFrameType.RegisterSecondaryTransportACK.getValue()) {
+
+ handleSecondaryTransportRegistration(packet.getTransportRecord(),true);
+
+ } else if (frameInfo == FrameDataControlFrameType.RegisterSecondaryTransportNACK.getValue()) {
+
+ String reason = (String) packet.getTag(ControlFrameTags.RPC.RegisterSecondaryTransportNAK.REASON);
+ DebugTool.logWarning(reason);
+ handleSecondaryTransportRegistration(packet.getTransportRecord(),false);
+
+ } else if (frameInfo == FrameDataControlFrameType.TransportEventUpdate.getValue()) {
+
+ // Get TCP params
+ String ipAddr = (String) packet.getTag(ControlFrameTags.RPC.TransportEventUpdate.TCP_IP_ADDRESS);
+ Integer port = (Integer) packet.getTag(ControlFrameTags.RPC.TransportEventUpdate.TCP_PORT);
+
+ if(secondaryTransportParams == null){
+ secondaryTransportParams = new HashMap<>();
+ }
+
+ if(ipAddr != null && port != null) {
+ String address = (port != null && port > 0) ? ipAddr + ":" + port : ipAddr;
+ secondaryTransportParams.put(TransportType.TCP, new TransportRecord(TransportType.TCP,address));
+
+ //A new secondary transport just became available. Notify the developer.
+ notifyDevTransportListener();
+ }
+
+ }
+
+ _assemblerForMessageID.remove(packet.getMessageId());
+
+ } // end-method
+
+ private void handleSingleFrameMessageFrame(SdlPacket packet) {
+ ProtocolMessage message = new ProtocolMessage();
+ message.setPayloadProtected(packet.isEncrypted());
+ SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
+ if (serviceType == SessionType.RPC) {
+ message.setMessageType(MessageType.RPC);
+ } else if (serviceType == SessionType.BULK_DATA) {
+ message.setMessageType(MessageType.BULK);
+ } // end-if
+ message.setSessionType(serviceType);
+ message.setSessionID((byte)packet.getSessionId());
+ //If it is WiPro 2.0 it must have binary header
+ boolean isControlService = message.getSessionType().equals(SessionType.CONTROL);
+ if (protocolVersion.getMajor() > 1 && !isControlService) {
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
+ parseBinaryHeader(packet.payload);
+ if(binFrameHeader == null) {
+ return;
+ }
+ message.setVersion((byte)protocolVersion.getMajor());
+ message.setRPCType(binFrameHeader.getRPCType());
+ message.setFunctionID(binFrameHeader.getFunctionID());
+ message.setCorrID(binFrameHeader.getCorrID());
+ if (binFrameHeader.getJsonSize() > 0){
+ message.setData(binFrameHeader.getJsonData());
+ }
+ if (binFrameHeader.getBulkData() != null){
+ message.setBulkData(binFrameHeader.getBulkData());
+ }
+ } else {
+ message.setData(packet.payload);
+ }
+
+ _assemblerForMessageID.remove(packet.getMessageId());
+
+ try {
+ iSdlProtocol.onProtocolMessageReceived(message);
+ } catch (Exception ex) {
+ DebugTool.logError(FailurePropagating_Msg + "onProtocolMessageReceived: " + ex.toString(), ex);
+ handleProtocolError(FailurePropagating_Msg + "onProtocolMessageReceived: ", ex);
+ } // end-catch
+ } // end-method
+ } // end-class
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java b/base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java
new file mode 100644
index 000000000..f5ea6836a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.enums;
+
+/**
+ * Control frame payload tags that relate to the respective services. Each class represents a different service, RPC, Audio, and Video services.
+ */
+public class ControlFrameTags {
+
+ private static class StartServiceACKBase{
+ /** Max transport unit to be used for this service */
+ public static final String MTU = "mtu";
+ }
+
+ private static class NAKBase{
+ /** An array of rejected parameters related to the corresponding request*/
+ public static final String REJECTED_PARAMS = "rejectedParams";
+ }
+
+ /**
+ * Control frame payloads that relate to the Remote Procedure Call (RPC) service.
+ */
+ public static class RPC {
+ public static class StartService {
+ /** The max version of the protocol supported by client requesting service to start.<br>
+ * Must be in the format "Major.Minor.Patch"
+ */
+ public static final String PROTOCOL_VERSION = "protocolVersion";
+ }
+ public static class StartServiceACK extends StartServiceACKBase{
+ /** The negotiated version of the protocol. Must be in the format "Major.Minor.Patch"*/
+ public static final String PROTOCOL_VERSION = StartService.PROTOCOL_VERSION;
+ /** Hash ID to identify this service and used when sending an EndService control frame*/
+ public static final String HASH_ID = "hashId";
+ /** HU allowed transport for secondary connection */
+ public static final String SECONDARY_TRANSPORTS = "secondaryTransports";
+ /** HU allowed transports for audio and video services (1 == Primary, 2 == Secondary) */
+ public static final String AUDIO_SERVICE_TRANSPORTS = "audioServiceTransports";
+ public static final String VIDEO_SERVICE_TRANSPORTS = "videoServiceTransports";
+ /** Auth token to be used for log in into services **/
+ public static final String AUTH_TOKEN = "authToken";
+
+ }
+ public static class StartServiceNAK extends NAKBase{}
+ public static class EndService {
+ /** Hash ID supplied in the StartServiceACK for this service type*/
+ public static final String HASH_ID = RPC.StartServiceACK.HASH_ID;
+ }
+ public static class EndServiceACK {}
+ public static class EndServiceNAK extends NAKBase{}
+ /** This frame is sent from Core to application to indicate that status or configuration of
+ * transport(s) is/are updated. This frame should not be sent prior to Version Negotiation.
+ **/
+ public static class TransportEventUpdate {
+ /** The HU reported IP address and port of TCP connection */
+ public static final String TCP_IP_ADDRESS = "tcpIpAddress";
+ public static final String TCP_PORT = "tcpPort";
+ }
+ /**This frame is sent from application to Core to notify that Secondary Transport has been
+ * established. This frame should be only sent on Secondary Transport.
+ **/
+ public static class RegisterSecondaryTransport {}
+ public static class RegisterSecondaryTransportACK {}
+ public static class RegisterSecondaryTransportNAK extends NAKBase {
+ public static final String REASON = "reason";
+ }
+ }
+
+ /**
+ * Control frame payloads that relate to the Audio streaming service. This service has also been referred to as the PCM service.
+ */
+ public static class Audio {
+ public static class StartService {}
+ public static class StartServiceACK extends StartServiceACKBase{}
+ public static class StartServiceNAK extends NAKBase{}
+ public static class EndService {}
+ public static class EndServiceACK {}
+ public static class EndServiceNAK extends NAKBase{}
+ }
+
+ /**
+ * Control frame payloads that relate to the Video streaming service. This service has also been referred to as the .h264 service.
+ */
+ public static class Video {
+ public static class StartService {
+ /** Desired height in pixels from the client requesting the video service to start*/
+ public static final String HEIGHT = "height";
+ /** Desired width in pixels from the client requesting the video service to start*/
+ public static final String WIDTH = "width";
+ /** Desired video protocol to be used*/
+ public static final String VIDEO_PROTOCOL = "videoProtocol";
+ /** Desired video codec to be used*/
+ public static final String VIDEO_CODEC = "videoCodec";
+ }
+ public static class StartServiceACK extends StartServiceACKBase{
+ /** Accepted height in pixels from the client requesting the video service to start*/
+ public static final String HEIGHT = StartService.HEIGHT;
+ /** Accepted width in pixels from the client requesting the video service to start*/
+ public static final String WIDTH = StartService.WIDTH;
+ /** Accepted video protocol to be used*/
+ public static final String VIDEO_PROTOCOL = StartService.VIDEO_PROTOCOL;
+ /** Accepted video codec to be used*/
+ public static final String VIDEO_CODEC = StartService.VIDEO_CODEC;
+ }
+
+ public static class StartServiceNAK extends NAKBase{}
+ public static class EndService {}
+ public static class EndServiceACK {}
+ public static class EndServiceNAK extends NAKBase{}
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java
new file mode 100644
index 000000000..745faf5f3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.enums;
+
+import com.smartdevicelink.util.ByteEnumer;
+
+import java.util.Vector;
+
+public class FrameData extends ByteEnumer {
+
+ private static Vector<FrameData> theList = new Vector<FrameData>();
+ public static Vector<FrameData> getList() { return theList; }
+
+ byte i = 0x00;
+
+ protected FrameData(byte value, String name) {
+ super(value, name);
+ }
+
+ public final static FrameData StartSession = new FrameData((byte)0x01, "StartSession");
+ public final static FrameData StartSessionACK = new FrameData((byte)0x02, "StartSessionACK");
+ public final static FrameData StartSessionNACK = new FrameData((byte)0x03, "StartSessionNACK");
+ public final static FrameData EndSession = new FrameData((byte)0x04, "EndSession");
+
+ public final static FrameData SingleFrame = new FrameData((byte)0x00, "SingleFrame");
+ public final static FrameData FirstFrame = new FrameData((byte)0x00, "FirstFrame");
+ public final static FrameData ConsecutiveFrame = new FrameData((byte)0x00, "ConsecutiveFrame");
+ public final static byte LastFrame = (byte)0x00;
+
+ static {
+ theList.addElement(StartSession);
+ theList.addElement(StartSessionACK);
+ theList.addElement(StartSessionNACK);
+ theList.addElement(EndSession);
+ }
+
+ public static FrameData valueOf(String passedButton) {
+ return (FrameData) get(theList, passedButton);
+ }
+
+ public static FrameData[] values() {
+ return theList.toArray(new FrameData[theList.size()]);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java
new file mode 100644
index 000000000..c0131d085
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.enums;
+
+import com.smartdevicelink.util.ByteEnumer;
+
+import java.util.Vector;
+
+public class FrameDataControlFrameType extends ByteEnumer {
+ private static Vector<FrameDataControlFrameType> theList = new Vector<FrameDataControlFrameType>();
+ public static Vector<FrameDataControlFrameType> getList() { return theList; }
+
+ @SuppressWarnings("unused")
+ private byte _i = 0x00;
+
+ protected FrameDataControlFrameType(byte value, String name) {
+ super(value, name);
+ }
+
+ public final static FrameDataControlFrameType Heartbeat = new FrameDataControlFrameType((byte)0x0, "Heartbeat");
+ public final static FrameDataControlFrameType StartSession = new FrameDataControlFrameType((byte)0x01, "StartSession");
+ public final static FrameDataControlFrameType StartSessionACK = new FrameDataControlFrameType((byte)0x02, "StartSessionACK");
+ public final static FrameDataControlFrameType StartSessionNACK = new FrameDataControlFrameType((byte)0x03, "StartSessionNACK");
+ public final static FrameDataControlFrameType EndSession = new FrameDataControlFrameType((byte)0x04, "EndSession");
+ public final static FrameDataControlFrameType EndSessionACK = new FrameDataControlFrameType((byte)0x05, "EndSessionACK");
+ public final static FrameDataControlFrameType EndSessionNACK = new FrameDataControlFrameType((byte)0x06, "EndSessionNACK");
+ public final static FrameDataControlFrameType RegisterSecondaryTransport = new FrameDataControlFrameType((byte)0x07, "RegisterSecondaryTransport");
+ public final static FrameDataControlFrameType RegisterSecondaryTransportACK = new FrameDataControlFrameType((byte)0x08, "RegisterSecondaryTransportACK");
+ public final static FrameDataControlFrameType RegisterSecondaryTransportNACK = new FrameDataControlFrameType((byte)0x09, "RegisterSecondaryTransportNACK");
+ public final static FrameDataControlFrameType TransportEventUpdate = new FrameDataControlFrameType((byte)0xFD, "TransportEventUpdate");
+ public final static FrameDataControlFrameType ServiceDataACK = new FrameDataControlFrameType((byte)0xFE, "ServiceDataACK");
+ public final static FrameDataControlFrameType HeartbeatACK = new FrameDataControlFrameType((byte)0xFF, "HeartbeatACK");
+
+ static {
+ theList.addElement(Heartbeat);
+ theList.addElement(StartSession);
+ theList.addElement(StartSessionACK);
+ theList.addElement(StartSessionNACK);
+ theList.addElement(EndSession);
+ theList.addElement(EndSessionACK);
+ theList.addElement(EndSessionNACK);
+ theList.addElement(RegisterSecondaryTransport);
+ theList.addElement(RegisterSecondaryTransportACK);
+ theList.addElement(RegisterSecondaryTransportNACK);
+ theList.addElement(TransportEventUpdate);
+ theList.addElement(ServiceDataACK);
+ theList.addElement(HeartbeatACK);
+ }
+
+ public static FrameDataControlFrameType valueOf(String passedButton) {
+ return (FrameDataControlFrameType) get(theList, passedButton);
+ }
+
+ public static FrameDataControlFrameType[] values() {
+ return theList.toArray(new FrameDataControlFrameType[theList.size()]);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java
new file mode 100644
index 000000000..085ae6b40
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.enums;
+
+import com.smartdevicelink.util.ByteEnumer;
+
+import java.util.Vector;
+
+public class FrameType extends ByteEnumer {
+
+ private static Vector<FrameType> theList = new Vector<FrameType>();
+ public static Vector<FrameType> getList() { return theList; }
+
+ byte i = 0x00;
+
+ protected FrameType(byte value, String name) {
+ super(value, name);
+ }
+
+ public final static FrameType Control = new FrameType((byte)0x00, "Control");
+ public final static FrameType Single = new FrameType((byte)0x01, "Single");
+ public final static FrameType First = new FrameType((byte)0x02, "First");
+ public final static FrameType Consecutive = new FrameType((byte)0x03, "Consecutive");
+
+ static {
+ theList.addElement(Control);
+ theList.addElement(Single);
+ theList.addElement(First);
+ theList.addElement(Consecutive);
+ }
+
+ public static FrameType valueOf(byte passed) {
+ return (FrameType) get(theList, passed);
+ }
+
+ public static FrameType[] values() {
+ return theList.toArray(new FrameType[theList.size()]);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java
new file mode 100644
index 000000000..c59dccfc9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.enums;
+
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map.Entry;
+
+public enum FunctionID{
+ // DEPRECATED FUNCTIONS
+ SYNC_P_DATA(65537, "SyncPData"),
+ ON_SYNC_P_DATA(98305, "OnSyncPData"),
+ ENCODED_SYNC_P_DATA(65536, "EncodedSyncPData"),
+ ON_ENCODED_SYNC_P_DATA(98304, "OnEncodedSyncPData"),
+
+ // REQUESTS & RESPONSES
+ REGISTER_APP_INTERFACE(1, "RegisterAppInterface"),
+ UNREGISTER_APP_INTERFACE(2, "UnregisterAppInterface"),
+ SET_GLOBAL_PROPERTIES(3, "SetGlobalProperties"),
+ RESET_GLOBAL_PROPERTIES(4, "ResetGlobalProperties"),
+ ADD_COMMAND(5, "AddCommand"),
+ DELETE_COMMAND(6, "DeleteCommand"),
+ ADD_SUB_MENU(7, "AddSubMenu"),
+ DELETE_SUB_MENU(8, "DeleteSubMenu"),
+ CREATE_INTERACTION_CHOICE_SET(9, "CreateInteractionChoiceSet"),
+ PERFORM_INTERACTION(10, "PerformInteraction"),
+ DELETE_INTERACTION_CHOICE_SET(11, "DeleteInteractionChoiceSet"),
+ ALERT(12, "Alert"),
+ SHOW(13, "Show"),
+ SPEAK(14, "Speak"),
+ SET_MEDIA_CLOCK_TIMER(15, "SetMediaClockTimer"),
+ PERFORM_AUDIO_PASS_THRU(16, "PerformAudioPassThru"),
+ END_AUDIO_PASS_THRU(17, "EndAudioPassThru"),
+ SUBSCRIBE_BUTTON(18, "SubscribeButton"),
+ UNSUBSCRIBE_BUTTON(19, "UnsubscribeButton"),
+ SUBSCRIBE_VEHICLE_DATA(20, "SubscribeVehicleData"),
+ UNSUBSCRIBE_VEHICLE_DATA(21, "UnsubscribeVehicleData"),
+ GET_VEHICLE_DATA(22, "GetVehicleData"),
+ READ_DID(23, "ReadDID"),
+ GET_DTCS(24, "GetDTCs"),
+ SCROLLABLE_MESSAGE(25, "ScrollableMessage"),
+ SLIDER(26, "Slider"),
+ SHOW_CONSTANT_TBT(27, "ShowConstantTBT"),
+ ALERT_MANEUVER(28, "AlertManeuver"),
+ UPDATE_TURN_LIST(29, "UpdateTurnList"),
+ CHANGE_REGISTRATION(30, "ChangeRegistration"),
+ GENERIC_RESPONSE(31, "GenericResponse"),
+ PUT_FILE(32, "PutFile"),
+ DELETE_FILE(33, "DeleteFile"),
+ LIST_FILES(34, "ListFiles"),
+ SET_APP_ICON(35, "SetAppIcon"),
+ SET_DISPLAY_LAYOUT(36, "SetDisplayLayout"),
+ DIAGNOSTIC_MESSAGE(37, "DiagnosticMessage"),
+ SYSTEM_REQUEST(38, "SystemRequest"),
+ SEND_LOCATION(39, "SendLocation"),
+ DIAL_NUMBER(40, "DialNumber"),
+
+ BUTTON_PRESS(41, "ButtonPress"),
+ GET_INTERIOR_VEHICLE_DATA(43, "GetInteriorVehicleData"),
+ SET_INTERIOR_VEHICLE_DATA(44, "SetInteriorVehicleData"),
+
+ GET_WAY_POINTS(45, "GetWayPoints"),
+ SUBSCRIBE_WAY_POINTS(46, "SubscribeWayPoints"),
+ UNSUBSCRIBE_WAY_POINTS(47, "UnsubscribeWayPoints"),
+ GET_SYSTEM_CAPABILITY(48, "GetSystemCapability"),
+ SEND_HAPTIC_DATA(49, "SendHapticData"),
+ SET_CLOUD_APP_PROPERTIES(50, "SetCloudAppProperties"),
+ GET_CLOUD_APP_PROPERTIES(51, "GetCloudAppProperties"),
+ PUBLISH_APP_SERVICE(52, "PublishAppService"),
+ GET_APP_SERVICE_DATA(53, "GetAppServiceData"),
+ GET_FILE(54, "GetFile"),
+ PERFORM_APP_SERVICES_INTERACTION(55, "PerformAppServiceInteraction"),
+
+ // NOTIFICATIONS
+ ON_HMI_STATUS(32768, "OnHMIStatus"),
+ ON_APP_INTERFACE_UNREGISTERED(32769, "OnAppInterfaceUnregistered"),
+ ON_BUTTON_EVENT(32770, "OnButtonEvent"),
+ ON_BUTTON_PRESS(32771, "OnButtonPress"),
+ ON_VEHICLE_DATA(32772, "OnVehicleData"),
+ ON_COMMAND(32773, "OnCommand"),
+ ON_TBT_CLIENT_STATE(32774, "OnTBTClientState"),
+ ON_DRIVER_DISTRACTION(32775, "OnDriverDistraction"),
+ ON_PERMISSIONS_CHANGE(32776, "OnPermissionsChange"),
+ ON_AUDIO_PASS_THRU(32777, "OnAudioPassThru"),
+ ON_LANGUAGE_CHANGE(32778, "OnLanguageChange"),
+ ON_KEYBOARD_INPUT(32779, "OnKeyboardInput"),
+ ON_TOUCH_EVENT(32780, "OnTouchEvent"),
+ ON_SYSTEM_REQUEST(32781, "OnSystemRequest"),
+ ON_HASH_CHANGE(32782, "OnHashChange"),
+ ON_INTERIOR_VEHICLE_DATA(32783, "OnInteriorVehicleData"),
+ ON_WAY_POINT_CHANGE(32784, "OnWayPointChange"),
+ ON_RC_STATUS(32785, "OnRCStatus"),
+ ON_APP_SERVICE_DATA(32786, "OnAppServiceData"),
+ ON_SYSTEM_CAPABILITY_UPDATED(32787, "OnSystemCapabilityUpdated"),
+
+ // MOCKED FUNCTIONS (NOT SENT FROM HEAD-UNIT)
+ ON_LOCK_SCREEN_STATUS(-1, "OnLockScreenStatus"),
+ ON_SDL_CHOICE_CHOSEN(-1, "OnSdlChoiceChosen"),
+ ON_STREAM_RPC(-1, "OnStreamRPC"),
+ STREAM_RPC(-1, "StreamRPC"),
+
+ ;
+
+ public static final int INVALID_ID = -1;
+
+ private static HashMap<String, Integer> functionMap;
+
+ private final int ID;
+ private final String JSON_NAME;
+
+ private FunctionID(int id, String jsonName){
+ this.ID = id;
+ this.JSON_NAME = jsonName;
+ }
+
+ public int getId(){
+ return this.ID;
+ }
+
+ @Override
+ public String toString(){
+ return this.JSON_NAME;
+ }
+
+ private static void initFunctionMap(){
+ functionMap = new HashMap<String, Integer>(values().length);
+
+ for(FunctionID value : EnumSet.allOf(FunctionID.class)){
+ functionMap.put(value.toString(), value.getId());
+ }
+ }
+
+ public static String getFunctionName(int i){
+ if(functionMap == null){
+ initFunctionMap();
+ }
+
+ Iterator<Entry<String, Integer>> iterator = functionMap.entrySet().iterator();
+ while(iterator.hasNext()){
+ Entry<String, Integer> thisEntry = iterator.next();
+ if(Integer.valueOf(i).equals(thisEntry.getValue())){
+ return thisEntry.getKey();
+ }
+ }
+
+ return null;
+ }
+
+ public static int getFunctionId(String functionName){
+ if(functionMap == null){
+ initFunctionMap();
+ }
+
+ Integer result = functionMap.get(functionName);
+ return ( result == null ) ? INVALID_ID : result;
+ }
+
+ /**
+ * This method gives the corresponding FunctionID enum value for a string RPC
+ * @param name String value represents the name of the RPC
+ * @return FunctionID represents the equivalent enum value for the provided string
+ */
+ public static FunctionID getEnumForString(String name){
+ for(FunctionID value : EnumSet.allOf(FunctionID.class)) {
+ if(value.JSON_NAME.equals(name)){
+ return value;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java b/base/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java
new file mode 100644
index 000000000..121d922d7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.enums;
+
+
+public enum MessageType {
+// START_SESSION,
+// START_SESSION_ACK,
+// START_SESSION_NACK,
+// END_SESSION,
+ UNDEFINED,
+ BULK,
+ RPC;
+
+ public static MessageType valueForString (String value) {
+ try{
+ return valueOf(value);
+ } catch(Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java b/base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java
new file mode 100644
index 000000000..158f4080c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.protocol.enums;
+
+import com.smartdevicelink.util.ByteEnumer;
+
+import java.util.Vector;
+
+
+public class SessionType extends ByteEnumer {
+
+ private static Vector<SessionType> theList = new Vector<SessionType>();
+ public static Vector<SessionType> getList() { return theList; }
+
+ byte i = 0x00;
+
+ protected SessionType(byte value, String name) {super(value, name);}
+ public final static SessionType CONTROL = new SessionType((byte) 0, "CONTROL");
+ public final static SessionType RPC = new SessionType((byte)0x07, "RPC");
+ public final static SessionType PCM = new SessionType((byte)0x0A, "PCM");
+ public final static SessionType NAV = new SessionType((byte)0x0B, "NAV");
+ public final static SessionType BULK_DATA = new SessionType((byte)0xF, "BULK_DATA");
+
+ static {
+ theList.addElement(RPC);
+ theList.addElement(PCM);
+ theList.addElement(NAV);
+ theList.addElement(BULK_DATA);
+ theList.addElement(CONTROL);
+ }
+
+ public static SessionType valueOf(byte passedButton) {
+ return (SessionType) get(theList, passedButton);
+ }
+
+ public static SessionType[] values() {
+ return theList.toArray(new SessionType[theList.size()]);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java b/base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
new file mode 100644
index 000000000..8a1006639
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import com.smartdevicelink.proxy.interfaces.IProxyListenerBase;
+import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
+import com.smartdevicelink.proxy.rpc.UnregisterAppInterfaceResponse;
+
+public interface IProxyListener extends IProxyListenerBase{
+ // Adds Legacy Life-cycle Management call-backs to the IProxyListenerAbstract interface
+
+ public void onProxyOpened();
+
+ public void onRegisterAppInterfaceResponse(RegisterAppInterfaceResponse response);
+
+ public void onOnAppInterfaceUnregistered(OnAppInterfaceUnregistered notification);
+
+ public void onUnregisterAppInterfaceResponse(UnregisterAppInterfaceResponse response);
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java b/base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
new file mode 100644
index 000000000..339dc4e75
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+
+import java.util.Hashtable;
+
+public class RPCMessage extends RPCStruct {
+ public static final String KEY_REQUEST = "request";
+ public static final String KEY_RESPONSE = "response";
+ public static final String KEY_NOTIFICATION = "notification";
+ public static final String KEY_FUNCTION_NAME = "name";
+ public static final String KEY_PARAMETERS = "parameters";
+ public static final String KEY_CORRELATION_ID = "correlationID";
+
+ public RPCMessage(String functionName) {
+ this(functionName, "request");
+ }
+
+ protected RPCMessage(RPCMessage rpcm) {
+ this(cloneStore(rpcm));
+ }
+
+ protected RPCMessage(RPCStruct rpcs) {
+ this("", "");
+ this.parameters = cloneStore(rpcs);
+ }
+
+ public RPCMessage(String functionName, String messageType) {
+ function = new Hashtable<String, Object>();
+ parameters = new Hashtable<String, Object>();
+
+ this.messageType = messageType;
+ function.put(KEY_PARAMETERS, parameters);
+
+ if (messageType != null)
+ store.put(messageType, function);
+ if (functionName != null)
+ function.put(KEY_FUNCTION_NAME, functionName);
+ }
+
+ @SuppressWarnings("unchecked")
+ public RPCMessage(Hashtable<String, Object> hash) {
+ store = hash;
+ messageType = getMessageTypeName(hash.keySet());
+ function = (Hashtable<String, Object>) hash.get(messageType);
+ parameters = (Hashtable<String, Object>) function.get(KEY_PARAMETERS);
+ if (hasKey(hash.keySet(), RPCStruct.KEY_BULK_DATA)) {
+ setBulkData((byte[]) hash.get(RPCStruct.KEY_BULK_DATA));
+ }
+ if (hasKey(hash.keySet(), RPCStruct.KEY_PROTECTED)) {
+ setPayloadProtected((Boolean) hash.get(RPCStruct.KEY_PROTECTED));
+ }
+ }
+
+ public FunctionID getFunctionID(){
+ if(function.containsKey(KEY_FUNCTION_NAME)){
+ return FunctionID.getEnumForString((String)function.get(KEY_FUNCTION_NAME));
+ }
+ return null;
+ }
+
+ protected String messageType;
+ protected Hashtable<String, Object> parameters;
+ protected Hashtable<String, Object> function;
+
+ public String getFunctionName() {
+ return (String)function.get(KEY_FUNCTION_NAME);
+ }
+
+ protected void setFunctionName(String functionName) {
+ function.put(KEY_FUNCTION_NAME, functionName);
+ }
+
+ public String getMessageType() {
+ if (messageType.equals(KEY_REQUEST) ||
+ messageType.equals(KEY_RESPONSE) ||
+ messageType.equals(KEY_NOTIFICATION)) {
+ return messageType;
+ }
+ return null;
+ }
+
+ // Generalized Getters and Setters
+
+ public void setParameters(String key, Object value) {
+ if (value != null) {
+ parameters.put(key, value);
+ } else {
+ parameters.remove(key);
+ }
+ }
+
+ public Object getParameters(String key) {
+ return parameters.get(key);
+ }
+
+ @Override
+ public Object getObject(Class tClass, String key) {
+ Object obj = parameters.get(key);
+ return formatObject(tClass, obj);
+ }
+
+ // Common Object Getters
+
+ @Override
+ public String getString(String key) {
+ return (String) parameters.get(key);
+ }
+
+ @Override
+ public Integer getInteger(String key) {
+ return (Integer) parameters.get(key);
+ }
+
+ @Override
+ public Float getFloat(String key) {
+ return (Float) parameters.get(key);
+ }
+
+ @Override
+ public Double getDouble(String key) {
+ return (Double) parameters.get(key);
+ }
+
+ @Override
+ public Boolean getBoolean(String key) { return (Boolean) parameters.get(key); }
+
+ @Override
+ public Long getLong(String key){
+ Object result = parameters.get(key);
+ if (result instanceof Integer) {
+ return ((Integer) result).longValue();
+ }else if(result instanceof Long){
+ return (Long) result;
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java b/base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
new file mode 100644
index 000000000..dd8388142
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import java.util.Hashtable;
+
+public class RPCNotification extends RPCMessage {
+
+ public RPCNotification(String functionName) {
+ super(functionName, RPCMessage.KEY_NOTIFICATION);
+ }
+
+ public RPCNotification(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public RPCNotification(RPCMessage rpcMsg) {
+ super(preprocessMsg(rpcMsg));
+ }
+
+ static RPCMessage preprocessMsg (RPCMessage rpcMsg) {
+ if (rpcMsg.getMessageType() != RPCMessage.KEY_NOTIFICATION) {
+ rpcMsg.messageType = RPCMessage.KEY_NOTIFICATION;
+ }
+
+ return rpcMsg;
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java b/base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
new file mode 100644
index 000000000..22ce1c2a5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+import com.smartdevicelink.util.CorrelationIdGenerator;
+
+import java.util.Hashtable;
+
+public class RPCRequest extends RPCMessage {
+
+ protected OnRPCResponseListener onResponseListener;
+
+ public RPCRequest(String functionName) {
+ super(functionName, RPCMessage.KEY_REQUEST);
+ messageType = RPCMessage.KEY_REQUEST;
+ }
+
+ public RPCRequest(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public RPCRequest(RPCRequest request){
+ super(request);
+ if (request == null || request.getCorrelationID() == null) {
+ setCorrelationID(CorrelationIdGenerator.generateId());
+ }
+ }
+
+ public Integer getCorrelationID() {
+ //First we check to see if a correlation ID is set. If not, create one.
+ if(!function.containsKey(RPCMessage.KEY_CORRELATION_ID)){
+ setCorrelationID(CorrelationIdGenerator.generateId());
+ }
+ return (Integer)function.get(RPCMessage.KEY_CORRELATION_ID);
+ }
+
+ public void setCorrelationID(Integer correlationID) {
+ if (correlationID != null) {
+ function.put(RPCMessage.KEY_CORRELATION_ID, correlationID );
+ } else {
+ function.remove(RPCMessage.KEY_CORRELATION_ID);
+ }
+ }
+ public void setOnRPCResponseListener(OnRPCResponseListener listener){
+ onResponseListener = listener;
+ }
+
+ public OnRPCResponseListener getOnRPCResponseListener(){
+ return this.onResponseListener;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java b/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
new file mode 100644
index 000000000..2a7473191
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Result sent by SDL after an RPC is processed, consists of four parts:
+ * <ul>
+ * <li>
+ * CorrelationID:
+ * <ul>
+ * An integer value correlating the response to the corresponding request.
+ * </ul>
+ * </li> <li>Success:
+ * <ul>
+ * A Boolean indicating whether the original request was successfully processed.
+ * </ul>
+ * </li> <li>ResultCode:
+ * <ul>
+ *
+ * <p>The result code provides additional information about a response returning a
+ * failed outcome.</p>
+ *
+ *
+ * <p>Any response can have at least one, or possibly more, of the following result
+ * code values: SUCCESS, INVALID_DATA, OUT_OF_MEMORY, TOO_MANY_PENDING_REQUESTS,
+ * APPLICATION_NOT_REGISTERED, GENERIC_ERROR,REJECTED.</p>
+ *
+ *
+ * <p>Any additional result codes for a given operation can be found in related
+ * RPCs</p>
+ *
+ * </ul>
+ * </li> <li>Info:
+ * <ul>
+ * A string of text representing additional information returned from SDL. This
+ * could be useful in debugging.
+ * </ul>
+ * </li>
+ * </ul>
+ */
+public class RPCResponse extends RPCMessage {
+ public static final String KEY_SUCCESS = "success";
+ public static final String KEY_INFO = "info";
+ public static final String KEY_RESULT_CODE = "resultCode";
+ /**
+ *<p>Constructs a newly allocated RPCResponse object using function name</p>
+ *@param functionName a string that indicates the function's name
+ */
+ public RPCResponse(String functionName) {
+ super(functionName, RPCMessage.KEY_RESPONSE);
+ }
+ /**
+ *<p>Constructs a newly allocated RPCResponse object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public RPCResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *<p>Constructs a newly allocated RPCResponse object using a RPCMessage object</p>
+ *@param rpcMsg The {@linkplain RPCMessage} to use
+ */
+ public RPCResponse(RPCMessage rpcMsg) {
+ super(preprocessMsg(rpcMsg));
+ }
+
+ static RPCMessage preprocessMsg (RPCMessage rpcMsg) {
+ if (rpcMsg.getMessageType() != RPCMessage.KEY_RESPONSE) {
+ rpcMsg.messageType = RPCMessage.KEY_RESPONSE;
+ }
+
+ return rpcMsg;
+ }
+
+ /**
+ * <p>
+ * Returns correlationID the ID of the request
+ * </p>
+ *
+ * @return int the ID of the request
+ */
+ public Integer getCorrelationID() {
+ return (Integer)function.get(RPCMessage.KEY_CORRELATION_ID);
+ }
+
+ /**
+ * <p>
+ * Set the correlationID
+ * </p>
+ *
+ * @param correlationID
+ * the ID of the response
+ */
+ public void setCorrelationID(Integer correlationID) {
+ if (correlationID != null) {
+ function.put(RPCMessage.KEY_CORRELATION_ID, correlationID );
+ } else {
+ function.remove(RPCMessage.KEY_CORRELATION_ID);
+ }
+ }
+ /**
+ * <p>
+ * Returns Success whether the request is successfully processed
+ * </p>
+ *
+ * @return Boolean the status of whether the request is successfully done
+ */
+ public Boolean getSuccess() {
+ return (Boolean) parameters.get( RPCResponse.KEY_SUCCESS );
+ }
+ /**
+ * <p>
+ * Set the Success status
+ * </p>
+ *
+ * @param success
+ * whether the request is successfully processed
+ */
+ public void setSuccess( @NonNull Boolean success ) {
+ if (success != null) {
+ parameters.put(RPCResponse.KEY_SUCCESS, success );
+ }
+ }
+ /**
+ * <p>
+ * Returns ResultCode additional information about a response returning a failed outcome
+ * </p>
+ *
+ * @return {@linkplain Result} the status of whether the request is successfully done
+ */
+ public Result getResultCode() {
+ Object obj = parameters.get(RPCResponse.KEY_RESULT_CODE);
+ if (obj instanceof Result) {
+ return (Result) obj;
+ } else if (obj instanceof String) {
+ return Result.valueForString((String) obj);
+ }
+ return null;
+ }
+ /**
+ * <p>
+ * Set the additional information about a response returning a failed outcome
+ * </p>
+ *
+ * @param resultCode
+ * whether the request is successfully processed
+ */
+ public void setResultCode( @NonNull Result resultCode ) {
+ if (resultCode != null) {
+ parameters.put(RPCResponse.KEY_RESULT_CODE, resultCode );
+ }
+ }
+ /**
+ * <p>
+ * Returns a string of text representing additional information returned from SDL
+ * </p>
+ *
+ * @return String A string of text representing additional information returned from SDL
+ */
+ public String getInfo() {
+ return (String) parameters.get( RPCResponse.KEY_INFO );
+ }
+ /**
+ * <p>
+ * Set a string of text representing additional information returned from SDL
+ * </p>
+ *
+ * @param info
+ * a string of text representing additional information returned from SDL
+ */
+ public void setInfo( String info ) {
+ if (info != null) {
+ parameters.put(RPCResponse.KEY_INFO, info );
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java b/base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
new file mode 100644
index 000000000..99af52156
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
@@ -0,0 +1,358 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.util.Version;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Set;
+
+public class RPCStruct {
+ public static final String KEY_BULK_DATA = "bulkData";
+ public static final String KEY_PROTECTED = "protected";
+
+ 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
+ return store.contains(key);
+ }
+
+ public Hashtable<String,Object> getStore () { // for unit testing
+ return store;
+ }
+
+ public RPCStruct() {
+ store = new Hashtable<String, Object>();
+ }
+
+ protected RPCStruct(RPCStruct rpcs) {
+ this.store = cloneStore(rpcs);
+ }
+
+ public RPCStruct(Hashtable<String, Object> hashtable) {
+ store = hashtable;
+ //store = (Hashtable<String, Object>) ObjectCopier.copy(hashtable);
+ }
+
+ static Hashtable<String, Object> cloneStore(RPCStruct rpcStruct){
+ if(rpcStruct!= null && rpcStruct.store !=null){
+ return (Hashtable)rpcStruct.store.clone();
+ }
+ return null;
+ }
+
+ public void deserializeJSON(JSONObject jsonObject) throws JSONException {
+ store = JsonRPCMarshaller.deserializeJSONObject(jsonObject);
+
+ }
+
+ // deserializeJSONObject method moved to JsonRPCMarshaller for consistency
+ // Keep reference here for backwards compatibility
+ @Deprecated
+ public static Hashtable<String, Object> deserializeJSONObject(JSONObject jsonObject)
+ throws JSONException {
+ return JsonRPCMarshaller.deserializeJSONObject(jsonObject);
+ }
+
+ public JSONObject serializeJSON() throws JSONException {
+ return JsonRPCMarshaller.serializeHashtable(store);
+ }
+
+ @SuppressWarnings("unchecked")
+ 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);
+ return JsonRPCMarshaller.serializeHashtable(parameters);
+ } 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;
+ }
+
+ if (parameters != null) {
+ 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;
+ }
+
+ public void setBulkData(byte[] bulkData) {
+ if (bulkData != null) {
+ this._bulkData = new byte[bulkData.length];
+ System.arraycopy(bulkData, 0, _bulkData, 0, bulkData.length);
+ }
+ else{
+ this._bulkData = null;
+ }
+ }
+
+ public void setPayloadProtected(Boolean bVal) {
+ protectedPayload = bVal;
+ }
+
+ public Boolean isPayloadProtected() {
+ return protectedPayload;
+ }
+
+ protected String getMessageTypeName(Set<String> keys) {
+ for (String key : keys) {
+ if (key == null) {
+ continue;
+ }
+ if (key.equals(RPCMessage.KEY_REQUEST) || key.equals(RPCMessage.KEY_RESPONSE) ||
+ key.equals(RPCMessage.KEY_NOTIFICATION)) {
+ return key;
+ }
+ }
+ return null;
+ }
+
+ protected boolean hasKey(Set<String> keys, String keyName) {
+ for (String key : keys) {
+ if (key == null) {
+ continue;
+ }
+ if (key.equals(keyName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // Generalized Getters and Setters
+
+ public void setValue(String key, Object value){
+ if (value != null) {
+ store.put(key, value);
+ } else {
+ store.remove(key);
+ }
+ }
+
+ public Object getValue(String key) {
+ return store.get(key);
+ }
+
+ public Object getObject(Class tClass, String key) {
+ Object obj = store.get(key);
+ return formatObject(tClass, obj);
+ }
+
+ // Helper methods
+
+ /**
+ * @param tClass a Class to cast Objects to
+ * @param obj Object returned from a stored hashtable
+ * @return A null object if obj is null or if none of the following is true:
+ * a) obj is an instance of tClass
+ * b) obj is an instance of String and it tClass has a valid `valueForString` method
+ * c) obj is an instance of a Hashtable
+ * d) obj is an instance of a List
+ */
+ protected Object formatObject(Class tClass, Object obj){
+ if(obj == null){
+ return null;
+ } else if (tClass.isInstance(obj)) {
+ return obj;
+ } else if (obj instanceof String) {
+ return getValueForString(tClass, (String) obj);
+ } else if (obj instanceof Hashtable) {
+ try {
+ Constructor constructor = tClass.getConstructor(Hashtable.class);
+ 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();
+ }
+ } else if (obj instanceof List<?>) {
+ List<?> list = (List<?>) obj;
+ if (list != null && list.size() > 0) {
+ Object item = list.get(0);
+ if (tClass.isInstance(item)) {
+ 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);
+ 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;
+ }
+ }
+ return newList;
+ } else if (item instanceof String){
+ List<Object> newList = new ArrayList<Object>();
+ for (Object hashObj : list) {
+ Object toAdd = getValueForString(tClass, (String) hashObj);
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @param tClass - a Class with a `valueForString(String s)` method that returns an Object for a given String
+ * @param s - a String to be converted to an Object using a `valueForString(String s)` method
+ * @return An Object converted using a `valueForString(String s)` method in the Class passed in, or a null object if such method does not exist
+ */
+ protected Object getValueForString(Class tClass, String s){
+ Method valueForString = null;
+ try {
+ valueForString = tClass.getDeclaredMethod("valueForString", String.class);
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ if(valueForString != null){
+ try {
+ Object value = valueForString.invoke(null, (String) s);
+ return value;
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+ // Common Object Getters
+ public String getString(String key) {
+ return (String) store.get(key);
+ }
+
+ public Integer getInteger(String key) {
+ return (Integer) store.get(key);
+ }
+
+ public Double getDouble(String key) {
+ return (Double) store.get(key);
+ }
+
+ public Float getFloat(String key) {
+ return (Float) store.get(key);
+ }
+
+ public Boolean getBoolean(String key) { return (Boolean) store.get(key); }
+
+ public Long getLong(String key){
+ Object result = store.get(key);
+ if (result instanceof Integer) {
+ return ((Integer) result).longValue();
+ }else if(result instanceof Long){
+ return (Long) result;
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java b/base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
new file mode 100644
index 000000000..24ba44331
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
@@ -0,0 +1,332 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
+import com.smartdevicelink.proxy.rpc.AppServiceCapability;
+import com.smartdevicelink.proxy.rpc.AppServicesCapabilities;
+import com.smartdevicelink.proxy.rpc.GetSystemCapability;
+import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
+import com.smartdevicelink.proxy.rpc.HMICapabilities;
+import com.smartdevicelink.proxy.rpc.OnSystemCapabilityUpdated;
+import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
+import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
+import com.smartdevicelink.proxy.rpc.SystemCapability;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+import com.smartdevicelink.util.CorrelationIdGenerator;
+import com.smartdevicelink.util.DebugTool;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+public class SystemCapabilityManager {
+ private final HashMap<SystemCapabilityType, Object> cachedSystemCapabilities;
+ private final HashMap<SystemCapabilityType, CopyOnWriteArrayList<OnSystemCapabilityListener>> onSystemCapabilityListeners;
+ private final Object LISTENER_LOCK;
+ private final ISdl callback;
+ private OnRPCListener rpcListener;
+
+ public SystemCapabilityManager(ISdl callback){
+ this.callback = callback;
+ this.LISTENER_LOCK = new Object();
+ this.onSystemCapabilityListeners = new HashMap<>();
+ this.cachedSystemCapabilities = new HashMap<>();
+
+ setupRpcListeners();
+ }
+
+ public void parseRAIResponse(RegisterAppInterfaceResponse response){
+ if(response!=null && response.getSuccess()) {
+ 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());
+ }
+ }
+
+ private void setupRpcListeners(){
+ rpcListener = new OnRPCListener() {
+ @Override
+ public void onReceived(RPCMessage message) {
+ if (message != null) {
+ if (RPCMessage.KEY_RESPONSE.equals(message.getMessageType())) {
+ switch (message.getFunctionID()) {
+ case SET_DISPLAY_LAYOUT:
+ SetDisplayLayoutResponse response = (SetDisplayLayoutResponse) message;
+ setCapability(SystemCapabilityType.DISPLAY, response.getDisplayCapabilities());
+ setCapability(SystemCapabilityType.BUTTON, response.getButtonCapabilities());
+ setCapability(SystemCapabilityType.PRESET_BANK, response.getPresetBankCapabilities());
+ setCapability(SystemCapabilityType.SOFTBUTTON, response.getSoftButtonCapabilities());
+ break;
+ }
+ } else if (RPCMessage.KEY_NOTIFICATION.equals(message.getMessageType())){
+ switch (message.getFunctionID()) {
+ case ON_SYSTEM_CAPABILITY_UPDATED:
+ OnSystemCapabilityUpdated onSystemCapabilityUpdated =(OnSystemCapabilityUpdated)message;
+ if(onSystemCapabilityUpdated.getSystemCapability() != null){
+ SystemCapability systemCapability = onSystemCapabilityUpdated.getSystemCapability();
+ SystemCapabilityType systemCapabilityType = systemCapability.getSystemCapabilityType();
+ Object capability = systemCapability.getCapabilityForType(systemCapabilityType);
+ if(cachedSystemCapabilities.containsKey(systemCapabilityType)) { //The capability already exists
+ switch (systemCapabilityType) {
+ case APP_SERVICES:
+ // App services only updates what was changed so we need
+ // to update the capability rather than override it
+ AppServicesCapabilities appServicesCapabilities = (AppServicesCapabilities) capability;
+ if(capability != null) {
+ List<AppServiceCapability> appServicesCapabilitiesList = appServicesCapabilities.getAppServices();
+ AppServicesCapabilities cachedAppServicesCapabilities = (AppServicesCapabilities) cachedSystemCapabilities.get(systemCapabilityType);
+ //Update the cached app services
+ cachedAppServicesCapabilities.updateAppServices(appServicesCapabilitiesList);
+ //Set the new capability object to the updated cached capabilities
+ capability = cachedAppServicesCapabilities;
+ }
+ break;
+ }
+ }
+ if(capability != null){
+ setCapability(systemCapabilityType, capability);
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+ if(callback != null){
+ callback.addOnRPCListener(FunctionID.SET_DISPLAY_LAYOUT, rpcListener);
+ callback.addOnRPCListener(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED, rpcListener);
+ }
+ }
+
+ /**
+ * Sets a capability in the cached map. This should only be done when an RPC is received and contains updates to the capability
+ * that is being cached in the SystemCapabilityManager.
+ * @param systemCapabilityType the system capability type that will be set
+ * @param capability the value of the capability that will be set
+ */
+ 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 the system capability type that was retrieved
+ * @param capability the system capability value that was retrieved
+ */
+ 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);
+ }
+ }
+ }
+ }
+
+ /**
+ * Ability to see if the connected module supports the given capability. Useful to check before
+ * attempting to query for capabilities that require asynchronous calls to initialize.
+ * @param type the SystemCapabilityType that is to be checked
+ * @return if that capability is supported with the current, connected module
+ */
+ public boolean isCapabilitySupported(SystemCapabilityType 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));
+ switch (type) {
+ case NAVIGATION:
+ return hmiCapabilities.isNavigationAvailable();
+ case PHONE_CALL:
+ return hmiCapabilities.isPhoneCallAvailable();
+ case VIDEO_STREAMING:
+ return hmiCapabilities.isVideoStreamingAvailable();
+ case REMOTE_CONTROL:
+ return hmiCapabilities.isRemoteControlAvailable();
+ default:
+ return false;
+ }
+ }else{
+ return false;
+ }
+ }
+ /**
+ * @param systemCapabilityType Type of capability desired
+ * @param scListener callback to execute upon retrieving capability
+ */
+ public void getCapability(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener scListener){
+ Object capability = cachedSystemCapabilities.get(systemCapabilityType);
+ if(capability != null){
+ scListener.onCapabilityRetrieved(capability);
+ return;
+ }else if(scListener == null){
+ return;
+ }
+
+ retrieveCapability(systemCapabilityType, scListener);
+ }
+
+ /**
+ * @param systemCapabilityType Type of capability desired
+ * @return Desired capability if it is cached in the manager, otherwise returns a null object
+ * and works in the background to retrieve the capability for the next call
+ */
+ public Object getCapability(final SystemCapabilityType systemCapabilityType){
+ Object capability = cachedSystemCapabilities.get(systemCapabilityType);
+ if(capability != null){
+ return capability;
+ }
+
+ retrieveCapability(systemCapabilityType, null);
+ return null;
+ }
+
+ /**
+ * 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.
+ * this method will send RPC and call the listener's callback only if the systemCapabilityType is queryable
+ */
+ private void retrieveCapability(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener scListener){
+ if (!systemCapabilityType.isQueryable()){
+ String message = "This systemCapabilityType cannot be queried for";
+ DebugTool.logError(message);
+ if( scListener != null){
+ scListener.onError(message);
+ }
+ return;
+ }
+ final GetSystemCapability request = new GetSystemCapability();
+ request.setSystemCapabilityType(systemCapabilityType);
+ request.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ if(response.getSuccess()){
+ Object retrievedCapability = ((GetSystemCapabilityResponse) response).getSystemCapability().getCapabilityForType(systemCapabilityType);
+ cachedSystemCapabilities.put(systemCapabilityType, retrievedCapability);
+ if(scListener!=null){scListener.onCapabilityRetrieved(retrievedCapability); }
+ }else{
+ if(scListener!=null){scListener.onError(response.getInfo());}
+ }
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ if(scListener!=null){scListener.onError(info);}
+ }
+ });
+ request.setCorrelationID(CorrelationIdGenerator.generateId());
+
+ if(callback!=null){
+ callback.sendRPCRequest(request);
+ }
+ }
+
+ /**
+ * Converts a capability object into a list.
+ * @param object the capability that needs to be converted
+ * @param classType The class type of that should be contained in the list
+ * @return a List of capabilities if object is instance of List, otherwise it will return null.
+ */
+ @SuppressWarnings({"unchecked"})
+ public static <T> List<T> convertToList(Object object, Class<T> classType){
+ if(classType!=null && object!=null && object instanceof List ){
+ List list = (List)object;
+ if(!list.isEmpty()){
+ if(classType.isInstance(list.get(0))){
+ return (List<T>)object;
+ }else{
+ //The list is not of the correct list type
+ return null;
+ }
+ }else {
+ //We return a new list of type T instead of null because while we don't know if
+ //the original list was of type T we want to ensure that we don't throw a cast class exception
+ //but still
+ return new ArrayList<T>();
+ }
+ }else{
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java b/base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
new file mode 100644
index 000000000..1b9a16b61
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy;
+
+import com.smartdevicelink.proxy.rpc.TTSChunk;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+
+import java.util.Vector;
+
+public class TTSChunkFactory {
+
+ public static TTSChunk createChunk(SpeechCapabilities type, String text) {
+ TTSChunk ret = new TTSChunk();
+ ret.setType(type);
+ ret.setText(text);
+ return ret;
+ }
+
+ public static Vector<TTSChunk> createSimpleTTSChunks(String simple) {
+ if (simple == null) {
+ return null;
+ }
+
+ Vector<TTSChunk> chunks = new Vector<TTSChunk>();
+
+ TTSChunk chunk = createChunk(SpeechCapabilities.TEXT, simple);
+ chunks.add(chunk);
+ return chunks;
+ }
+
+ public static Vector<TTSChunk> createPrerecordedTTSChunks(String prerecorded) {
+ if (prerecorded == null) {
+ return null;
+ }
+
+ Vector<TTSChunk> chunks = new Vector<TTSChunk>();
+ TTSChunk chunk = createChunk(SpeechCapabilities.PRE_RECORDED, prerecorded);
+ chunks.add(chunk);
+ return chunks;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java b/base/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java
new file mode 100644
index 000000000..4e13533d9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.callbacks;
+
+public class InternalProxyMessage {
+ private String _functionName;
+ public static final String OnProxyError = "OnProxyError";
+ public static final String OnProxyOpened = "OnProxyOpened";
+ public static final String OnProxyClosed = "OnProxyClosed";
+ public static final String OnServiceEnded = "OnServiceEnded";
+ public static final String OnServiceNACKed = "OnServiceNACKed";
+
+ public InternalProxyMessage(String functionName) {
+ //this(functionName, null, null);
+ this._functionName = functionName;
+ }
+
+ public String getFunctionName() {
+ return _functionName;
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java
new file mode 100644
index 000000000..e56e41a01
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.callbacks;
+
+public class OnError extends InternalProxyMessage {
+
+ private String _info;
+ private Exception _e;
+
+ public OnError() {
+ super(InternalProxyMessage.OnProxyError);
+ }
+
+ public OnError(String info, Exception e) {
+ super(InternalProxyMessage.OnProxyError);
+ this._info = info;
+ this._e = e;
+ }
+
+ public String getInfo() {
+ return _info;
+ }
+
+ public Exception getException() {
+ return _e;
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java
new file mode 100644
index 000000000..4f5aaf05b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.callbacks;
+
+import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
+
+public class OnProxyClosed extends InternalProxyMessage {
+
+ private String _info;
+ private Exception _e;
+ private SdlDisconnectedReason _reason;
+
+ public OnProxyClosed() {
+ super(InternalProxyMessage.OnProxyClosed);
+ }
+
+ public OnProxyClosed(String info, Exception e, SdlDisconnectedReason reason) {
+ super(InternalProxyMessage.OnProxyClosed);
+ this._info = info;
+ this._e = e;
+ this._reason = reason;
+ }
+
+ public String getInfo() {
+ return _info;
+ }
+
+ public SdlDisconnectedReason getReason() {
+ return _reason;
+ }
+
+ public Exception getException() {
+ return _e;
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java
new file mode 100644
index 000000000..9c22b57fe
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.callbacks;
+
+public class OnProxyOpened extends InternalProxyMessage {
+
+ public OnProxyOpened() {
+ super(InternalProxyMessage.OnProxyOpened);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java
new file mode 100644
index 000000000..579ba4441
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.callbacks;
+
+import com.smartdevicelink.protocol.enums.SessionType;
+
+public class OnServiceEnded extends InternalProxyMessage {
+ private SessionType sessionType;
+
+ public OnServiceEnded() {
+ super(InternalProxyMessage.OnServiceEnded);
+ }
+
+ public OnServiceEnded(SessionType sessionType) {
+ super(InternalProxyMessage.OnServiceEnded);
+ this.sessionType = sessionType;
+ }
+
+ public SessionType getSessionType() {
+ return this.sessionType;
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java
new file mode 100644
index 000000000..f27010f19
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.callbacks;
+
+import com.smartdevicelink.protocol.enums.SessionType;
+
+public class OnServiceNACKed extends InternalProxyMessage {
+ private SessionType sessionType;
+
+ public OnServiceNACKed() {
+ super(InternalProxyMessage.OnServiceNACKed);
+ }
+
+ public OnServiceNACKed(SessionType sessionType) {
+ super(InternalProxyMessage.OnServiceNACKed);
+ this.sessionType = sessionType;
+ }
+
+ public SessionType getSessionType() {
+ return this.sessionType;
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java b/base/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java
new file mode 100644
index 000000000..73f7adeeb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.constants;
+
+@Deprecated
+public class Jingles {
+ public static final String POSITIVE_JINGLE = "POSITIVE_JINGLE";
+
+ public static final String NEGATIVE_JINGLE = "NEGATIVE_JINGLE";
+
+ public static final String INITIAL_JINGLE = "INITIAL_JINGLE";
+
+ public static final String LISTEN_JINGLE = "LISTEN_JINGLE";
+
+ public static final String HELP_JINGLE = "HELP_JINGLE";
+
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/constants/Names.java b/base/src/main/java/com/smartdevicelink/proxy/constants/Names.java
new file mode 100644
index 000000000..fe63db715
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/constants/Names.java
@@ -0,0 +1,537 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.constants;
+
+@Deprecated
+public class Names {
+ public static final String request = "request";
+ public static final String response = "response";
+ public static final String notification = "notification";
+ public static final String function_name = "name";
+ public static final String parameters = "parameters";
+ public static final String bulkData = "bulkData";
+
+ public static final String RegisterAppInterface = "RegisterAppInterface";
+ public static final String UnregisterAppInterface = "UnregisterAppInterface";
+ public static final String Alert = "Alert";
+ public static final String Show = "Show";
+ public static final String Speak = "Speak";
+ public static final String AddCommand = "AddCommand";
+ public static final String DeleteCommand = "DeleteCommand";
+ public static final String AddSubMenu = "AddSubMenu";
+ public static final String DeleteSubMenu = "DeleteSubMenu";
+ public static final String CreateInteractionChoiceSet = "CreateInteractionChoiceSet";
+ public static final String DeleteInteractionChoiceSet = "DeleteInteractionChoiceSet";
+ public static final String PerformInteraction = "PerformInteraction";
+ public static final String DialNumber = "DialNumber";
+ public static final String EncodedSyncPData = "EncodedSyncPData";
+ public static final String SyncPData = "SyncPData";
+ public static final String SubscribeButton = "SubscribeButton";
+ public static final String UnsubscribeButton = "UnsubscribeButton";
+ public static final String SubscribeVehicleData = "SubscribeVehicleData";
+ public static final String UnsubscribeVehicleData = "UnsubscribeVehicleData";
+ public static final String SetMediaClockTimer = "SetMediaClockTimer";
+ public static final String SetGlobalProperties = "SetGlobalProperties";
+ public static final String GenericResponse = "GenericResponse";
+ public static final String ScrollableMessage = "ScrollableMessage";
+ public static final String GetDID = "GetDID";
+ public static final String GetDTCs = "GetDTCs";
+ public static final String DiagnosticMessage = "DiagnosticMessage";
+ public static final String SystemRequest = "SystemRequest";
+ public static final String ReadDID = "ReadDID";
+ public static final String OnVehicleData = "OnVehicleData";
+ public static final String GetFile = "GetFile";
+ public static final String PutFile = "PutFile";
+ public static final String DeleteFile = "DeleteFile";
+ public static final String ListFiles = "ListFiles";
+ public static final String EndAudioCapture = "EndAudioCapture";
+ public static final String GetVehicleData = "GetVehicleData";
+ public static final String ResetGlobalProperties = "ResetGlobalProperties";
+ public static final String PerformAudioCapture = "PerformAudioCapture";
+ public static final String SetAppIcon = "SetAppIcon";
+ public static final String ChangeRegistration = "ChangeRegistration";
+ public static final String SetDisplayLayout = "SetDisplayLayout";
+ public static final String keypressMode = "keypressMode";
+ public static final String keyboardLayout = "keyboardLayout";
+ public static final String limitedCharacterList = "limitedCharacterList";
+ public static final String autoCompleteText = "autoCompleteText";
+ public static final String OnLanguageChange = "OnLanguageChange";
+ public static final String hmiDisplayLanguage = "hmiDisplayLanguage";
+ public static final String displayLayout = "displayLayout";
+ public static final String ttsName = "ttsName";
+ public static final String hmiDisplayLanguageDesired = "hmiDisplayLanguageDesired";
+ public static final String appHMIType = "appHMIType";
+ public static final String hashID = "hashID";
+ public static final String appID = "appID";
+ public static final String vrHelpTitle = "vrHelpTitle";
+ public static final String graphic = "graphic";
+ public static final String customPresets = "customPresets";
+ public static final String softButtonCapabilities = "softButtonCapabilities";
+ public static final String presetBankCapabilities = "presetBankCapabilities";
+ public static final String vehicleType = "vehicleType";
+ public static final String make = "make";
+ public static final String model = "model";
+ public static final String modelYear = "modelYear";
+ public static final String trim = "trim";
+ public static final String allowed = "allowed";
+ public static final String userDisallowed = "userDisallowed";
+ public static final String rpcName = "rpcName";
+ public static final String hmiPermissions = "hmiPermissions";
+ public static final String parameterPermissions = "parameterPermissions";
+ public static final String permissionItem = "permissionItem";
+ public static final String numTicks = "numTicks";
+ public static final String sliderHeader = "sliderHeader";
+ public static final String sliderFooter = "sliderFooter";
+ public static final String PerformAudioPassThru = "PerformAudioPassThru";
+ public static final String PerformAudioPassThruResponse = "PerformAudioPassThruResponse";
+ public static final String EndAudioPassThru = "EndAudioPassThru";
+ public static final String EndAudioPassThruResponse = "EndAudioPassThruResponse";
+ public static final String OnAudioPassThru = "OnAudioPassThru";
+ public static final String ShowConstantTBT = "ShowConstantTBT";
+ public static final String AlertManeuver = "AlertManeuver";
+ public static final String UpdateTurnList = "UpdateTurnList";
+
+ public static final String OnCommand = "OnCommand";
+ public static final String OnDataPublished = "OnDataPublished";
+ public static final String OnButtonPress = "OnButtonPress";
+ public static final String OnButtonEvent = "OnButtonEvent";
+ public static final String OnHMIStatus = "OnHMIStatus";
+ public static final String OnTBTClientState = "OnTBTClientState";
+ public static final String OnEncodedSyncPData = "OnEncodedSyncPData";
+ public static final String onEncodedSyncPDataResponse = "onEncodedSyncPDataResponse";
+ public static final String OnSyncPData = "OnSyncPData";
+ public static final String onOnSyncPData = "onOnSyncPData";
+ public static final String OnDriverDistraction = "OnDriverDistraction";
+ public static final String OnAppInterfaceUnregistered = "OnAppInterfaceUnregistered";
+ public static final String OnKeyboardInput = "OnKeyboardInput";
+ public static final String OnTouchEvent = "OnTouchEvent";
+ public static final String OnSystemRequest = "OnSystemRequest";
+ public static final String OnHashChange = "OnHashChange";
+ public static final String OnProxyClosed = "OnProxyClosed";
+ public static final String OnProxyError = "OnProxyError";
+ public static final String OnProxyOpened = "OnProxyOpened";
+ public static final String OnProxyUnusable = "OnProxyUnusable";
+ public static final String OnHMILevelChange = "OnHMILevelChange";
+ public static final String OnSdlChoiceChosen = "OnSdlChoiceChosen";
+ public static final String OnPermissionsChange = "OnPermissionsChange";
+ public static final String OnScreenPresetsAvailable = "OnScreenPresetsAvailable";
+ public static final String isHighlighted = "isHighlighted";
+ public static final String softButtonID = "softButtonID";
+ public static final String fileType = "fileType";
+ public static final String url = "url";
+ public static final String requestType = "requestType";
+ public static final String fileName = "fileName";
+ public static final String persistentFile = "persistentFile";
+ public static final String spaceAvailable = "spaceAvailable";
+ public static final String filenames = "filenames";
+ public static final String cmdIcon = "cmdIcon";
+ public static final String Slider = "Slider";
+ public static final String sliderPosition = "sliderPosition";
+ public static final String samplingRate = "samplingRate";
+ public static final String audioType = "audioType";
+ public static final String satRadioESN = "satRadioESN";
+ public static final String dtc = "dtc";
+ public static final String tryAgainTime = "tryAgainTime";
+
+ public static final String success = "success";
+ public static final String resultCode = "resultCode";
+ public static final String info = "info";
+
+ public static final String payload = "payload";
+ public static final String reason = "reason";
+ public static final String state = "state";
+ public static final String cmdID = "cmdID";
+ public static final String menuParams = "menuParams";
+ public static final String parentID = "parentID";
+ public static final String position = "position";
+ public static final String menuName = "menuName";
+ public static final String vrCommands = "vrCommands";
+ public static final String language = "language";
+ public static final String languageDesired = "languageDesired";
+ public static final String triggerSource = "triggerSource";
+ public static final String subscriptionType = "subscriptionType";
+ public static final String data = "data";
+ public static final String event = "event";
+ public static final String correlationID = "correlationID";
+ public static final String sdlMsgVersion = "syncMsgVersion";
+ public static final String deviceInfo = "deviceInfo";
+ public static final String majorVersion = "majorVersion";
+ public static final String minorVersion = "minorVersion";
+ public static final String appName = "appName";
+ public static final String ngnMediaScreenAppName = "ngnMediaScreenAppName";
+ public static final String isMediaApplication = "isMediaApplication";
+ public static final String vrSynonyms = "vrSynonyms";
+ public static final String usesVehicleData = "usesVehicleData";
+ public static final String text = "text";
+ public static final String type = "type";
+ public static final String ttsChunks = "ttsChunks";
+ public static final String playTone = "playTone";
+ public static final String duration = "duration";
+ public static final String mainField1 = "mainField1";
+ public static final String mainField2 = "mainField2";
+ public static final String mainField3 = "mainField3";
+ public static final String mainField4 = "mainField4";
+ public static final String statusBar = "statusBar";
+ public static final String name = "name";
+ public static final String menuID = "menuID";
+ public static final String longPress = "longPress";
+ public static final String shortPress = "shortPress";
+ public static final String buttonName = "buttonName";
+ public static final String buttonPressMode = "buttonPressMode";
+ public static final String buttonEventMode = "buttonEventMode";
+ public static final String minutes = "minutes";
+ public static final String seconds = "seconds";
+ public static final String startTime = "startTime";
+ public static final String endTime = "endTime";
+ public static final String updateMode = "updateMode";
+ public static final String mediaClock = "mediaClock";
+ public static final String initialText = "initialText";
+ public static final String initialPrompt = "initialPrompt";
+ public static final String helpPrompt = "helpPrompt";
+ public static final String timeoutPrompt = "timeoutPrompt";
+ public static final String timeout = "timeout";
+ public static final String choiceSet = "choiceSet";
+ public static final String interactionMode = "interactionMode";
+ public static final String result = "result";
+ public static final String alertText1 = "alertText1";
+ public static final String alertText2 = "alertText2";
+ public static final String alertText3 = "alertText3";
+ public static final String shortPressAvailable = "shortPressAvailable";
+ public static final String longPressAvailable = "longPressAvailable";
+ public static final String upDownAvailable = "upDownAvailable";
+ public static final String width = "width";
+ public static final String height = "height";
+ public static final String resolutionWidth = "resolutionWidth";
+ public static final String resolutionHeight = "resolutionHeight";
+ public static final String characterSet = "characterSet";
+ public static final String displayType = "displayType";
+ public static final String mediaClockFormats = "mediaClockFormats";
+ public static final String textFields = "textFields";
+ public static final String imageFields = "imageFields";
+ public static final String autoActivateID = "autoActivateID";
+ public static final String vehicleDataCapabilities = "vehicleDataCapabilities";
+ public static final String speechCapabilities = "speechCapabilities";
+ public static final String vrCapabilities = "vrCapabilities";
+ public static final String audioPassThruCapabilities = "audioPassThruCapabilities";
+ public static final String buttonCapabilities = "buttonCapabilities";
+ public static final String displayCapabilities = "displayCapabilities";
+ public static final String hmiZoneCapabilities = "hmiZoneCapabilities";
+ public static final String interactionChoiceSetID = "interactionChoiceSetID";
+ public static final String interactionChoiceSetIDList = "interactionChoiceSetIDList";
+ public static final String audioFileName = "audioFileName";
+ public static final String gpsPositionValid = "gpsPositionValid";
+ public static final String longitudeDegrees = "longitudeDegrees";
+ public static final String latitudeDegrees = "latitudeDegrees";
+ public static final String utcYear = "utcYear";
+ public static final String utcMonth = "utcMonth";
+ public static final String utcDay = "utcDay";
+ public static final String utcHours = "utcHours";
+ public static final String utcMinutes = "utcMinutes";
+ public static final String utcSeconds = "utcSeconds";
+ public static final String compassDirection = "compassDirection";
+ public static final String pdop = "pdop";
+ public static final String vdop = "vdop";
+ public static final String hdop = "hdop";
+ public static final String actual = "actual";
+ public static final String satellites = "satellites";
+ public static final String dimension = "dimension";
+ public static final String altitude = "altitude";
+ public static final String heading = "heading";
+ public static final String speed = "speed";
+ public static final String number = "number";
+ public static final String smartDeviceLinkFileName = "syncFileName";
+ public static final String localFileName = "localFileName";
+ public static final String maxDuration = "maxDuration";
+ public static final String timerMode = "timerMode";
+ public static final String status = "status";
+ public static final String pressure = "pressure";
+ public static final String hours = "hours";
+ public static final String rows = "rows";
+ public static final String pressureTellTale = "pressureTellTale";
+ public static final String leftFront = "leftFront";
+ public static final String rightFront = "rightFront";
+ public static final String leftRear = "leftRear";
+ public static final String rightRear = "rightRear";
+ public static final String innerLeftRear = "innerLeftRear";
+ public static final String innerRightRear = "innerRightRear";
+ public static final String VehicleData = "VehicleData";
+ public static final String alignment = "alignment";
+ public static final String mediaTrack = "mediaTrack";
+ public static final String properties = "properties";
+ public static final String choiceID = "choiceID";
+ public static final String bitsPerSample = "bitsPerSample";
+ public static final String hmiLevel = "hmiLevel";
+ public static final String audioStreamingState = "audioStreamingState";
+ public static final String systemContext = "systemContext";
+ public static final String sdlChoice = "sdlChoice";
+ public static final String sdlCommand = "sdlCommand";
+ public static final String URL = "URL";
+ public static final String Timeout = "Timeout";
+ public static final String PermissionGroupName = "PermissionGroupName";
+ public static final String PermissionGroupStatus = "PermissionGroupStatus";
+ public static final String PermissionGroupItems = "PermissionGroupItems";
+ public static final String audioPacket = "audioPacket";
+ public static final String audioPassThruDisplayText1 = "audioPassThruDisplayText1";
+ public static final String audioPassThruDisplayText2 = "audioPassThruDisplayText2";
+ public static final String bitRate = "bitRate";
+ public static final String rpm = "rpm";
+ public static final String fuelLevel = "fuelLevel";
+ public static final String avgFuelEconomy = "avgFuelEconomy";
+ public static final String batteryVoltage = "batteryVoltage";
+ public static final String externalTemperature = "externalTemperature";
+ public static final String vin = "vin";
+ public static final String prndl = "prndl";
+ public static final String tirePressure = "tirePressure";
+ public static final String batteryPackVoltage = "batteryPackVoltage";
+ public static final String batteryPackCurrent = "batteryPackCurrent";
+ public static final String batteryPackTemperature = "batteryPackTemperature";
+ public static final String engineTorque = "engineTorque";
+ public static final String odometer = "odometer";
+ public static final String tripOdometer = "tripOdometer";
+ public static final String genericbinary = "genericbinary";
+ public static final String GPSData = "GPSData";
+ public static final String gps = "gps";
+ public static final String fuelLevel_State = "fuelLevel_State";
+ public static final String instantFuelConsumption = "instantFuelConsumption";
+ public static final String beltStatus = "beltStatus";
+ public static final String bodyInformation = "bodyInformation";
+ public static final String deviceStatus = "deviceStatus";
+ public static final String driverBraking = "driverBraking";
+ public static final String wiperStatus = "wiperStatus";
+ public static final String fuelEconomy = "fuelEconomy";
+ public static final String engineOilLife = "engineOilLife";
+ public static final String headLampStatus = "headLampStatus";
+ public static final String brakeTorque = "brakeTorque";
+ public static final String turboBoost = "turboBoost";
+ public static final String coolantTemp = "coolantTemp";
+ public static final String airFuelRatio = "airFuelRatio";
+ public static final String coolingHeadTemp = "coolingHeadTemp";
+ public static final String oilTemp = "oilTemp";
+ public static final String intakeAirTemp = "intakeAirTemp";
+ public static final String gearShiftAdvice = "gearShiftAdvice";
+ public static final String acceleration = "acceleration";
+ public static final String accPedalPosition = "accPedalPosition";
+ public static final String clutchPedalPosition = "clutchPedalPosition";
+ public static final String reverseGearStatus = "reverseGearStatus";
+ public static final String accTorque = "accTorque";
+ public static final String ambientLightStatus = "ambientLightStatus";
+ public static final String ambientLightSensorStatus = "ambientLightSensorStatus";
+ public static final String dataType = "dataType";
+ public static final String identifier = "identifier";
+ public static final String statusByte = "statusByte";
+ public static final String didResult = "didResult";
+ public static final String ecuName = "ecuName";
+ public static final String didLocation = "didLocation";
+ public static final String value = "value";
+ public static final String softButtonName = "softButtonName";
+ public static final String imageSupported = "imageSupported";
+ public static final String systemAction = "systemAction";
+ public static final String image = "image";
+ public static final String secondaryText = "secondaryText";
+ public static final String tertiaryText = "tertiaryText";
+ public static final String secondaryImage = "secondaryImage";
+ public static final String imageType = "imageType";
+ public static final String fileData = "fileData";
+ public static final String scrollableMessageBody = "scrollableMessageBody";
+ public static final String softButtons = "softButtons";
+ public static final String customButtonID = "customButtonID";
+ public static final String vrHelp = "vrHelp";
+ public static final String interactionLayout = "interactionLayout";
+ public static final String customButtonName = "customButtonName";
+ public static final String navigationText = "navigationText";
+ public static final String turnIcon = "turnIcon";
+ public static final String nextTurnIcon = "nextTurnIcon";
+ public static final String navigationText1 = "navigationText1";
+ public static final String navigationText2 = "navigationText2";
+ public static final String eta = "eta";
+ public static final String totalDistance = "totalDistance";
+ public static final String distanceToManeuver = "distanceToManeuver";
+ public static final String distanceToManeuverScale = "distanceToManeuverScale";
+ public static final String maneuverComplete = "maneuverComplete";
+ public static final String turnList = "turnList";
+ public static final String steeringWheelAngle = "steeringWheelAngle";
+ public static final String menuTitle = "menuTitle";
+ public static final String menuIcon = "menuIcon";
+ public static final String keyboardProperties = "keyboardProperties";
+ public static final String driverBeltDeployed = "driverBeltDeployed";
+ public static final String passengerBeltDeployed = "passengerBeltDeployed";
+ public static final String passengerBuckleBelted = "passengerBuckleBelted";
+ public static final String driverBuckleBelted = "driverBuckleBelted";
+ public static final String leftRow2BuckleBelted = "leftRow2BuckleBelted";
+ public static final String passengerChildDetected = "passengerChildDetected";
+ public static final String rightRow2BuckleBelted = "rightRow2BuckleBelted";
+ public static final String middleRow2BuckleBelted = "middleRow2BuckleBelted";
+ public static final String middleRow3BuckleBelted = "middleRow3BuckleBelted";
+ public static final String leftRow3BuckleBelted = "leftRow3BuckleBelted";
+ public static final String rightRow3BuckleBelted = "rightRow3BuckleBelted";
+ public static final String rearInflatableBelted = "rearInflatableBelted";
+ public static final String leftRearInflatableBelted = "leftRearInflatableBelted";
+ public static final String rightRearInflatableBelted = "rightRearInflatableBelted";
+ public static final String middleRow1BeltDeployed = "middleRow1BeltDeployed";
+ public static final String middleRow1BuckleBelted = "middleRow1BuckleBelted";
+
+ public static final String graphicSupported = "graphicSupported";
+ public static final String screenParams = "screenParams";
+ public static final String muteAudio = "muteAudio";
+ public static final String parkBrakeActive = "parkBrakeActive";
+ public static final String ignitionStableStatus = "ignitionStableStatus";
+ public static final String ignitionStatus = "ignitionStatus";
+ public static final String driverDoorAjar = "driverDoorAjar";
+ public static final String passengerDoorAjar = "passengerDoorAjar";
+ public static final String rearLeftDoorAjar = "rearLeftDoorAjar";
+ public static final String rearRightDoorAjar = "rearRightDoorAjar";
+ public static final String systemFile = "systemFile";
+
+ public static final String voiceRecOn = "voiceRecOn";
+ public static final String btIconOn = "btIconOn";
+ public static final String callActive = "callActive";
+ public static final String phoneRoaming = "phoneRoaming";
+ public static final String textMsgAvailable = "textMsgAvailable";
+ public static final String battLevelStatus = "battLevelStatus";
+ public static final String stereoAudioOutputMuted = "stereoAudioOutputMuted";
+ public static final String monoAudioOutputMuted = "monoAudioOutputMuted";
+ public static final String signalLevelStatus = "signalLevelStatus";
+ public static final String primaryAudioSource = "primaryAudioSource";
+ public static final String eCallEventActive = "eCallEventActive";
+
+ public static final String fuelEconomySinceLastReset = "fuelEconomySinceLastReset";
+ public static final String currentTripFuelEconomy = "currentTripFuelEconomy";
+ public static final String averageTripFuelEconomy = "averageTripFuelEconomy";
+ public static final String currentCycleFuelEconomy = "currentCycleFuelEconomy";
+
+ public static final String lightSwitchStatus = "lightSwitchStatus";
+ public static final String highBeamsOn = "highBeamsOn";
+ public static final String lowBeamsOn = "lowBeamsOn";
+
+ public static final String electricFuelConsumption = "electricFuelConsumption";
+ public static final String stateOfCharge = "stateOfCharge";
+ public static final String fuelMaintenanceMode = "fuelMaintenanceMode";
+ public static final String distanceToEmpty = "distanceToEmpty";
+
+ public static final String dtcMask = "dtcMask";
+ public static final String targetID = "targetID";
+ public static final String messageLength = "messageLength";
+ public static final String messageData = "messageData";
+ public static final String messageDataResult = "messageDataResult";
+
+ public static final String imageTypeSupported = "imageTypeSupported";
+ public static final String imageResolution = "imageResolution";
+ public static final String x = "x";
+ public static final String y = "y";
+ public static final String id = "id";
+ public static final String ts = "ts";
+ public static final String c = "c";
+ public static final String resolution = "resolution";
+ public static final String touchEventAvailable = "touchEventAvailable";
+
+ public static final String pressAvailable = "pressAvailable";
+ public static final String multiTouchAvailable = "multiTouchAvailable";
+ public static final String doublePressAvailable = "doublePressAvailable";
+ public static final String templatesAvailable = "templatesAvailable";
+ public static final String numCustomPresetsAvailable = "numCustomPresetsAvailable";
+ public static final String prerecordedSpeech = "prerecordedSpeech";
+ public static final String manualTextEntry = "manualTextEntry";
+ public static final String progressIndicator = "progressIndicator";
+ public static final String secondaryGraphic = "secondaryGraphic";
+ public static final String offset = "offset";
+ public static final String length = "length";
+
+ public static final String hardware = "hardware";
+ public static final String firmwareRev = "firmwareRev";
+ public static final String os = "os";
+ public static final String osVersion = "osVersion";
+ public static final String carrier = "carrier";
+ public static final String maxNumberRFCOMMPorts = "maxNumberRFCOMMPorts";
+
+ public static final String onReadDIDResponse = "onReadDIDResponse";
+ public static final String onGetDTCsResponse = "onGetDTCsResponse";
+ public static final String onOnKeyboardInput = "onOnKeyboardInput";
+ public static final String onOnTouchEvent = "onOnTouchEvent";
+ public static final String onOnSystemRequest = "onOnSystemRequest";
+
+ public static final String onDiagnosticMessageResponse = "onDiagnosticMessageResponse";
+ public static final String onSystemRequestResponse = "onSystemRequestResponse";
+ public static final String onGetVehicleDataResponse = "onGetVehicleDataResponse";
+ public static final String getSupportedDiagModes = "getSupportedDiagModes";
+ public static final String supportedDiagModes = "supportedDiagModes";
+
+ public static final String driverAirbagDeployed = "driverAirbagDeployed";
+ public static final String driverSideAirbagDeployed = "driverSideAirbagDeployed";
+ public static final String driverCurtainAirbagDeployed = "driverCurtainAirbagDeployed";
+ public static final String passengerAirbagDeployed = "passengerAirbagDeployed";
+ public static final String passengerCurtainAirbagDeployed = "passengerCurtainAirbagDeployed";
+ public static final String driverKneeAirbagDeployed = "driverKneeAirbagDeployed";
+ public static final String passengerSideAirbagDeployed = "passengerSideAirbagDeployed";
+ public static final String passengerKneeAirbagDeployed = "passengerKneeAirbagDeployed";
+
+ public static final String powerModeActive = "powerModeActive";
+ public static final String powerModeQualificationStatus = "powerModeQualificationStatus";
+ public static final String carModeStatus = "carModeStatus";
+ public static final String powerModeStatus = "powerModeStatus";
+
+ public static final String eCallNotificationStatus = "eCallNotificationStatus";
+ public static final String auxECallNotificationStatus = "auxECallNotificationStatus";
+ public static final String eCallConfirmationStatus = "eCallConfirmationStatus";
+ public static final String e911Override = "e911Override";
+
+ public static final String emergencyEventType = "emergencyEventType";
+ public static final String fuelCutoffStatus = "fuelCutoffStatus";
+ public static final String rolloverEvent = "rolloverEvent";
+ public static final String maximumChangeVelocity = "maximumChangeVelocity";
+ public static final String multipleEvents = "multipleEvents";
+
+ public static final String eCallInfo = "eCallInfo";
+ public static final String airbagStatus = "airbagStatus";
+ public static final String emergencyEvent = "emergencyEvent";
+ public static final String clusterModeStatus = "clusterModeStatus";
+ public static final String myKey = "myKey";
+ public static final String timeToDestination = "timeToDestination";
+
+ public static final String driverDistraction = "driverDistraction";
+ public static final String showLockScreen = "showLockScreen";
+ public static final String userSelected = "userSelected";
+ public static final String notSet = "notSet";
+
+ public static final String headers = "headers";
+ public static final String body = "body";
+
+ public static final String ContentType = "ContentType";
+ public static final String ConnectTimeout = "ConnectTimeout";
+ public static final String DoOutput = "DoOutput";
+ public static final String DoInput = "DoInput";
+ public static final String UseCaches = "UseCaches";
+ public static final String RequestMethod = "RequestMethod";
+ public static final String ReadTimeout = "ReadTimeout";
+ public static final String InstanceFollowRedirects = "InstanceFollowRedirects";
+ public static final String charset = "charset";
+ public static final String ContentLength = "Content-Length";
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java
index 8d21b7615..8d21b7615 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
new file mode 100644
index 000000000..13871a9f8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.interfaces;
+
+public interface IProxyListenerALM extends IProxyListenerBase {
+ // All methods moved into base interface
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java
new file mode 100644
index 000000000..45b5abcc0
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java
@@ -0,0 +1,417 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.interfaces;
+
+import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
+import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
+import com.smartdevicelink.proxy.rpc.AddCommandResponse;
+import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
+import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
+import com.smartdevicelink.proxy.rpc.AlertResponse;
+import com.smartdevicelink.proxy.rpc.ButtonPressResponse;
+import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
+import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
+import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
+import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
+import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
+import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
+import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
+import com.smartdevicelink.proxy.rpc.DialNumberResponse;
+import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
+import com.smartdevicelink.proxy.rpc.GenericResponse;
+import com.smartdevicelink.proxy.rpc.GetAppServiceDataResponse;
+import com.smartdevicelink.proxy.rpc.GetCloudAppPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
+import com.smartdevicelink.proxy.rpc.GetFileResponse;
+import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
+import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.GetWayPointsResponse;
+import com.smartdevicelink.proxy.rpc.ListFilesResponse;
+import com.smartdevicelink.proxy.rpc.OnAppServiceData;
+import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
+import com.smartdevicelink.proxy.rpc.OnButtonEvent;
+import com.smartdevicelink.proxy.rpc.OnButtonPress;
+import com.smartdevicelink.proxy.rpc.OnCommand;
+import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.OnHashChange;
+import com.smartdevicelink.proxy.rpc.OnInteriorVehicleData;
+import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
+import com.smartdevicelink.proxy.rpc.OnLanguageChange;
+import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
+import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
+import com.smartdevicelink.proxy.rpc.OnRCStatus;
+import com.smartdevicelink.proxy.rpc.OnStreamRPC;
+import com.smartdevicelink.proxy.rpc.OnSystemCapabilityUpdated;
+import com.smartdevicelink.proxy.rpc.OnSystemRequest;
+import com.smartdevicelink.proxy.rpc.OnTBTClientState;
+import com.smartdevicelink.proxy.rpc.OnTouchEvent;
+import com.smartdevicelink.proxy.rpc.OnVehicleData;
+import com.smartdevicelink.proxy.rpc.OnWayPointChange;
+import com.smartdevicelink.proxy.rpc.PerformAppServiceInteractionResponse;
+import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
+import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
+import com.smartdevicelink.proxy.rpc.PublishAppServiceResponse;
+import com.smartdevicelink.proxy.rpc.PutFileResponse;
+import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
+import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
+import com.smartdevicelink.proxy.rpc.SendHapticDataResponse;
+import com.smartdevicelink.proxy.rpc.SendLocationResponse;
+import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
+import com.smartdevicelink.proxy.rpc.SetCloudAppPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
+import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
+import com.smartdevicelink.proxy.rpc.SetInteriorVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
+import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
+import com.smartdevicelink.proxy.rpc.ShowResponse;
+import com.smartdevicelink.proxy.rpc.SliderResponse;
+import com.smartdevicelink.proxy.rpc.SpeakResponse;
+import com.smartdevicelink.proxy.rpc.StreamRPCResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
+import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse;
+import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
+import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
+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;
+
+
+public interface IProxyListenerBase {
+
+ /**
+ * onOnHMIStatus being called indicates that there has been an HMI Level change,
+ * system context change or audio streaming state change.
+ *
+ * @param notification - Contains information about the HMI Level,
+ * system context and audio streaming state.
+ */
+ public void onOnHMIStatus(OnHMIStatus notification);
+
+ /**
+ * onProxyClosed has different functionality for the different models.
+ * In the non-ALM model this indicates that the proxy has experienced an unrecoverable error.
+ * A new proxy object must be initiated to reestablish connection with SDL.
+ * In the ALM model this indicates that the app is no longer registered with SDL
+ * All resources on SDL (addCommands and ChoiceSets) have been deleted and will have to be
+ * recreated upon the next onReadyForInitialization() call-back.
+ *
+ * @param info - Includes information about the reason the proxy has been closed.
+ * @param e - The exception that occurred.
+ */
+ public void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason);
+
+ public void onServiceEnded(OnServiceEnded serviceEnded);
+
+ public void onServiceNACKed(OnServiceNACKed serviceNACKed);
+
+ public void onOnStreamRPC(OnStreamRPC notification);
+
+ public void onStreamRPCResponse(StreamRPCResponse response);
+
+ /**
+ * onProxyError() being called indicates that the SDL Proxy experenced an error.
+ *
+ * @param info - Includes information about the Exception that occurred.
+ * @param e - The exception that occurred.
+ */
+ public void onError(String info, Exception e);
+
+ /**
+ * onGenericResponse() being called indicates that SDL could not determine the
+ * type of request it is responding to. This is usually result of an unknown RPC Request
+ * being sent.
+ *
+ * @param response - Includes detailed information about the response.
+ */
+ public void onGenericResponse(GenericResponse response);
+
+ /**
+ * onOnCommand() being called indicates that the user selected a command on SDL.
+ *
+ * @param notification - Contains information about the command chosen.
+ */
+ public void onOnCommand(OnCommand notification);
+
+ /**
+ * onAddCommandResponse() being called indicates that SDL has responded to
+ * a request to add a command.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onAddCommandResponse(AddCommandResponse response);
+
+ /**
+ * onAddSubMenuResponse() being called indicates that SDL has responded to
+ * a request to add a command.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onAddSubMenuResponse(AddSubMenuResponse response);
+
+ /**
+ * onCreateInteractionChoiceSetResponse() being called indicates that SDL has
+ * responded to a request to add an interactionChoiceSet.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse response);
+
+ /**
+ * onAlertResponse being called indicates that SDL has
+ * responded to a request to alert the user.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onAlertResponse(AlertResponse response);
+
+ /**
+ * onDeleteCommandResponse being called indicates that SDL has
+ * responded to a request to delete a command.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onDeleteCommandResponse(DeleteCommandResponse response);
+
+ /**
+ * onDeleteCommandResponse being called indicates that SDL has
+ * responded to a request to delete an interaction choice set.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse response);
+
+ /**
+ * onDeleteCommandResponse being called indicates that SDL has
+ * responded to a request to delete a submenu.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onDeleteSubMenuResponse(DeleteSubMenuResponse response);
+
+ /**
+ * onPerformInteractionResponse being called indicates that SDL has
+ * responded to a request to perform an interaction.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onPerformInteractionResponse(PerformInteractionResponse response);
+
+ /**
+ * onResetGlobalPropertiesResponse being called indicates that SDL has
+ * responded to a request to reset global properties.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onResetGlobalPropertiesResponse(ResetGlobalPropertiesResponse response);
+
+ /**
+ * onSetGlobalPropertiesResponse being called indicates that SDL has
+ * responded to a request to set global properties.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse response);
+
+ /**
+ * onSetMediaClockTimerResponse being called indicates that SDL has
+ * responded to a request to set the media clock timer.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response);
+
+ /**
+ * onShowResponse being called indicates that SDL has
+ * responded to a request to display information to the user.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onShowResponse(ShowResponse response);
+
+ /**
+ * onSpeakResponse being called indicates that SDL has
+ * responded to a request to speak information to the user.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onSpeakResponse(SpeakResponse response);
+
+ /**
+ * onButtonEvent being called indicates that a button event has occurred.
+ *
+ * @param notification - Contains information about the notification sent from SDL.
+ */
+ public void onOnButtonEvent(OnButtonEvent notification);
+
+ /**
+ * onButtonPress being called indicates that SDL has a button has
+ * been pressed by the user.
+ *
+ * @param notification - Contains information about the notification sent from SDL.
+ */
+ public void onOnButtonPress(OnButtonPress notification);
+
+ /**
+ * onSubscribeButtonResponse being called indicates that SDL has
+ * responded to a request to subscribe to button events and button presses.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onSubscribeButtonResponse(SubscribeButtonResponse response);
+
+ /**
+ * onUnsubscribeButtonResponse being called indicates that SDL has
+ * responded to a request to unsubscribe from button events and button presses.
+ *
+ * @param response - Contains information about the response sent from SDL.
+ */
+ public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response);
+
+ /**
+ * onOnPermissionsChange being called indicates that your app permissions have
+ * changed due to a policy table change. This can mean your app has received additional
+ * permissions OR lost permissions.
+ *
+ * @param notification - Contains information about the changed permissions.
+ */
+ public void onOnPermissionsChange(OnPermissionsChange notification);
+
+ public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response);
+
+ public void onUnsubscribeVehicleDataResponse(UnsubscribeVehicleDataResponse response);
+
+ public void onGetVehicleDataResponse(GetVehicleDataResponse response);
+
+ public void onOnVehicleData(OnVehicleData notification);
+
+ public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response);
+
+ public void onEndAudioPassThruResponse(EndAudioPassThruResponse response);
+
+ public void onOnAudioPassThru(OnAudioPassThru notification);
+
+ public void onPutFileResponse(PutFileResponse response);
+
+ public void onDeleteFileResponse(DeleteFileResponse response);
+
+ public void onListFilesResponse(ListFilesResponse response);
+
+ public void onSetAppIconResponse(SetAppIconResponse response);
+
+ public void onScrollableMessageResponse(ScrollableMessageResponse response);
+
+ public void onChangeRegistrationResponse(ChangeRegistrationResponse response);
+
+ public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response);
+
+ public void onOnLanguageChange(OnLanguageChange notification);
+
+ public void onOnHashChange(OnHashChange notification);
+
+ public void onSliderResponse(SliderResponse response);
+
+ public void onOnDriverDistraction(OnDriverDistraction notification);
+
+ public void onOnTBTClientState(OnTBTClientState notification);
+
+ public void onOnSystemRequest(OnSystemRequest notification);
+
+ public void onSystemRequestResponse(SystemRequestResponse response);
+
+ public void onOnKeyboardInput(OnKeyboardInput notification);
+
+ public void onOnTouchEvent(OnTouchEvent notification);
+
+ public void onDiagnosticMessageResponse(DiagnosticMessageResponse response);
+
+ public void onReadDIDResponse(ReadDIDResponse response);
+
+ public void onGetDTCsResponse(GetDTCsResponse response);
+
+ public void onOnLockScreenNotification(OnLockScreenStatus notification);
+
+ public void onDialNumberResponse(DialNumberResponse response);
+
+ public void onSendLocationResponse(SendLocationResponse response);
+
+ public void onShowConstantTbtResponse(ShowConstantTbtResponse response);
+
+ public void onAlertManeuverResponse(AlertManeuverResponse response);
+
+ public void onUpdateTurnListResponse(UpdateTurnListResponse response);
+
+ public void onServiceDataACK(int dataSize);
+
+ public void onGetWayPointsResponse(GetWayPointsResponse response);
+
+ public void onSubscribeWayPointsResponse(SubscribeWayPointsResponse response);
+
+ public void onUnsubscribeWayPointsResponse(UnsubscribeWayPointsResponse response);
+
+ public void onOnWayPointChange(OnWayPointChange notification);
+
+ public void onGetSystemCapabilityResponse(GetSystemCapabilityResponse response);
+
+ public void onGetInteriorVehicleDataResponse(GetInteriorVehicleDataResponse response);
+
+ public void onButtonPressResponse(ButtonPressResponse response);
+
+ public void onSetInteriorVehicleDataResponse(SetInteriorVehicleDataResponse response);
+
+ public void onOnInteriorVehicleData(OnInteriorVehicleData notification);
+
+ public void onSendHapticDataResponse(SendHapticDataResponse response);
+
+ public void onOnRCStatus(OnRCStatus notification);
+
+ public void onSetCloudAppProperties(SetCloudAppPropertiesResponse response);
+
+ public void onGetCloudAppProperties(GetCloudAppPropertiesResponse response);
+
+ public void onPublishAppServiceResponse(PublishAppServiceResponse response);
+
+ public void onGetAppServiceDataResponse(GetAppServiceDataResponse response);
+
+ public void onGetFileResponse(GetFileResponse response);
+
+ public void onPerformAppServiceInteractionResponse(PerformAppServiceInteractionResponse response);
+
+ public void onOnAppServiceData(OnAppServiceData notification);
+
+ public void onOnSystemCapabilityUpdated(OnSystemCapabilityUpdated notification);
+
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
new file mode 100644
index 000000000..058678963
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.interfaces;
+
+import com.smartdevicelink.proxy.rpc.PutFileResponse;
+
+public interface IPutFileResponseListener {
+ public void onPutFileResponse(PutFileResponse response);
+
+ public void onPutFileStreamError(Exception e, String info);
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
new file mode 100644
index 000000000..8eaa74429
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
@@ -0,0 +1,266 @@
+package com.smartdevicelink.proxy.interfaces;
+
+import android.support.annotation.NonNull;
+
+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.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.proxy.rpc.listeners.OnRPCRequestListener;
+import com.smartdevicelink.streaming.audio.AudioStreamingCodec;
+import com.smartdevicelink.streaming.audio.AudioStreamingParams;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.util.Version;
+
+import java.util.List;
+
+/*
+ * Copyright (c) 2017 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+@SuppressWarnings("unused")
+public interface ISdl {
+
+ /**
+ * Starts the connection with the module
+ */
+ void start();
+
+ /**
+ * Ends connection with the module
+ */
+ void stop();
+
+ /**
+ * Method to check if the session is connected
+ * @return if there is a connected session
+ */
+ boolean isConnected();
+
+ /**
+ * Add a service listener for a specific service type
+ * @param serviceType service type that the listener will be attached to
+ * @param sdlServiceListener listener for events that happen to the service
+ */
+ void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener);
+
+ /**
+ * Remote a service listener for a specific service type
+ * @param serviceType service type that the listener was attached to
+ * @param sdlServiceListener service listener that was previously added for the service type
+ */
+ void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener);
+
+ /**
+ * Starts the video streaming service
+ * @param parameters desired video streaming params for this sevice to be started with
+ * @param encrypted flag to start this service with encryption or not
+ */
+ void startVideoService(VideoStreamingParameters parameters, boolean encrypted);
+
+ /**
+ * Stops the video service if open
+ */
+ void stopVideoService();
+
+ /**
+ * Starts the video streaming service
+ * @param isEncrypted flag to start this service with encryption or not
+ * @param parameters desired video streaming params for this sevice to be started with
+ */
+ IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters);
+
+ /**
+ * Starts the Audio streaming service
+ * @param encrypted flag to start this service with encryption or not
+ */
+ void startAudioService(boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params);
+
+ /**
+ * Starts the Audio streaming service
+ * @param encrypted flag to start this service with encryption or not
+ */
+ void startAudioService(boolean encrypted);
+
+ /**
+ * Stops the audio service if open
+ */
+ void stopAudioService();
+
+ /**
+ * Start Audio Stream and return IAudioStreamListener
+ * @param isEncrypted whether or not the audio stream should be encrypted
+ * @param codec the codec that should be used for the audio stream
+ * @param params specific options and settings associated with the audio stream
+ * @return IAudioStreamListener, an interface that allows the writing of audio data
+ */
+ IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec, AudioStreamingParams params);
+
+ /**
+ * Pass an RPC message through the proxy to be sent to the connected module
+ * @param message RPCRequest that should be sent to the module
+ */
+ @Deprecated
+ void sendRPCRequest(RPCRequest message);
+
+ /**
+ * Pass an RPC message through the proxy to be sent to the connected module
+ * @param message RPCMessage that should be sent to the module
+ */
+ void sendRPC(RPCMessage message);
+
+ /**
+ * Pass a list of RPC requests through the proxy to be sent to core
+ * @param rpcs List of RPC requests
+ * @param listener OnMultipleRequestListener that is called between requests and after all are processed
+ */
+ void sendRequests(List<? extends RPCRequest> rpcs, final OnMultipleRequestListener listener);
+
+ /**
+ * Takes a list of RPCMessages and sends it to SDL in a synchronous fashion. Responses are captured through callback on OnMultipleRequestListener.
+ * For sending requests asynchronously, use sendRequests <br>
+ *
+ * <strong>NOTE: This will override any listeners on individual RPCs</strong><br>
+ *
+ * <strong>ADDITIONAL NOTE: This only takes the type of RPCRequest for now, notifications and responses will be thrown out</strong>
+ *
+ * @param rpcs is the list of RPCMessages being sent
+ * @param listener listener for updates and completions
+ */
+ void sendSequentialRPCs(final List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener);
+
+ /**
+ * Add an OnRPCNotificationListener for specified notification
+ * @param notificationId FunctionID of the notification that is to be listened for
+ * @param listener listener that should be added for the notification ID
+ */
+ void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener);
+
+ /**
+ * Removes an OnRPCNotificationListener for specified notification
+ * @param notificationId FunctionID of the notification that was to be listened for
+ * @param listener listener that was previously added for the notification ID
+ */
+ boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener);
+
+ /**
+ * Add an OnRPCRequestListener for specified request
+ * @param functionID FunctionID of the request that is to be listened for
+ * @param listener listener that should be added for the request ID
+ */
+ void addOnRPCRequestListener(FunctionID functionID, OnRPCRequestListener listener);
+
+ /**
+ * Removes an OnRPCRequestListener for specified request
+ * @param functionID FunctionID of the request that was to be listened for
+ * @param listener listener that was previously added for the request ID
+ */
+ boolean removeOnRPCRequestListener(FunctionID functionID, OnRPCRequestListener 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 a system capability type that should be retrieved
+ * @return the system capability provided if available, null if not
+ */
+ Object getCapability(SystemCapabilityType systemCapabilityType);
+
+ /**
+ * Get Capability
+ * @param systemCapabilityType a system capability type that should be retrieved
+ * @param scListener listener that will be called when the system capability is retrieved. If already cached, it
+ * will be called immediately
+ */
+ void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener);
+
+ /**
+ * Check if capability is supported
+ * @param systemCapabilityType a system capability type that should be checked for support
+ * @return Boolean whether or not the supplied capability type is supported on the connected module
+ */
+ 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);
+
+ /**
+ * Check to see if a transport is available to start/use the supplied service.
+ * @param serviceType the session that should be checked for transport availability
+ * @return true if there is either a supported
+ * transport currently connected or a transport is
+ * available to connect with for the supplied service type.
+ * <br>false if there is no
+ * transport connected to support the service type in question and
+ * no possibility in the foreseeable future.
+ */
+ boolean isTransportForServiceAvailable(SessionType serviceType);
+
+ /**
+ * Get the RPC specification version currently being used for the SDL messages
+ * @return SdlMsgVersion the current RPC specification version
+ */
+ @NonNull SdlMsgVersion getSdlMsgVersion();
+
+ /**
+ * Get the protocol version of this session
+ * @return byte value representing WiPro version
+ */
+ @NonNull Version getProtocolVersion();
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java
new file mode 100644
index 000000000..06c324cb3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.interfaces;
+
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.enums.SessionType;
+
+public interface ISdlServiceListener {
+ public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted);
+ public void onServiceEnded(SdlSession session, SessionType type);
+ public void onServiceError(SdlSession session, SessionType type, String reason);
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java
index f645b0d55..f645b0d55 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java
new file mode 100644
index 000000000..f1dd490a8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.interfaces;
+
+public interface OnSystemCapabilityListener {
+ void onCapabilityRetrieved(Object capability);
+ void onError(String info);
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java
new file mode 100644
index 000000000..be6ffa130
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+*
+* <p>This class will add a command to the application's Command Menu</p>
+*
+*
+* <p><b>Note:</b> A command will be added to the end of the list of elements in
+* the Command Menu under the following conditions:</p>
+*
+* <ul>
+* <li>When a Command is added with no MenuParams value provided</li>
+* <li>When a MenuParams value is provided with a MenuParam.position value
+* greater than or equal to the number of menu items currently defined in the
+* menu specified by the MenuParam.parentID value</li>
+* </ul>
+*
+*
+* <p>The set of choices which the application builds using AddCommand can be a
+* mixture of:</p>
+*
+* <ul>
+* <li>Choices having only VR synonym definitions, but no MenuParams definitions
+* </li>
+* <li>Choices having only MenuParams definitions, but no VR synonym definitions
+* </li>
+* <li>Choices having both MenuParams and VR synonym definitions</li>
+* </ul>
+*
+* <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUD</b></p>
+*
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>cmdID</td>
+ * <td> Integer</td>
+ * <td>unique ID of the command to add</td>
+ * <td>Y</td>
+ * <td> minvalue:0; maxvalue:2000000000</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * <tr>
+ * <td>menuParams</td>
+ * <td>ButtonName</td>
+ * <td>Name of the button to unsubscribe.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>vrCommands</td>
+ * <td>String</td>
+ * <td><p>An array of strings to be used as VR synonyms for this command.</p> <p>If this array is provided, it may not be empty.</p></td>
+ * <td>N</td>
+ * <td>minsize:1; maxsize:100</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * <tr>
+ * <td>cmdIcon</td>
+ * <td>Image</td>
+ * <td><p>Image struct determining whether static or dynamic icon.</p><p>If omitted on supported displays, no (or the default if applicable) icon shall be displayed.</p></td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+* </table>
+* <p> <b>Response</b></p><p>Indicates that the corresponding request has failed or succeeded, if the response returns with a SUCCESS result code, this means a command was added to the Command Menu successfully.</p>
+*
+* <p><b>Non-default Result Codes:</b></p> <p>INVALID_ID</p> <p>DUPLICATE_NAME</p>
+* @since SmartDeviceLink 1.0
+* @see DeleteCommand
+* @see AddSubMenu
+* @see DeleteSubMenu
+*/
+
+public class AddCommand extends RPCRequest {
+ public static final String KEY_CMD_ICON = "cmdIcon";
+ public static final String KEY_MENU_PARAMS = "menuParams";
+ public static final String KEY_CMD_ID = "cmdID";
+ public static final String KEY_VR_COMMANDS = "vrCommands";
+
+ /**
+ * Constructs a new AddCommand object
+ */
+ public AddCommand() {
+ super(FunctionID.ADD_COMMAND.toString());
+ }
+
+ /**
+ * <p>
+ * Constructs a new AddCommand object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public AddCommand(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new AddCommand object
+ * @param cmdID an integer object representing a Command ID <p><b>Notes:</b> Min Value: 0; Max Value: 2000000000</p>
+ */
+ public AddCommand(@NonNull Integer cmdID) {
+ this();
+ setCmdID(cmdID);
+ }
+ /**
+ * <p>
+ * Returns an <i>Integer</i> object representing the Command ID that you want to add
+ * </p>
+ *
+ * @return Integer -an integer representation a Unique Command ID
+ */
+ public Integer getCmdID() {
+ return getInteger(KEY_CMD_ID);
+ }
+ /**
+ * <p>Sets an Unique Command ID that identifies the command. Is returned in an
+ * <i>{@linkplain OnCommand}</i> notification to identify the command
+ * selected by the user</p>
+ *
+ *
+ * @param cmdID
+ * an integer object representing a Command ID
+ * <p>
+ * <b>Notes:</b> Min Value: 0; Max Value: 2000000000</p>
+ */
+ public void setCmdID(@NonNull Integer cmdID) {
+ setParameters(KEY_CMD_ID, cmdID);
+ }
+ /**
+ * <p>
+ * Returns a <I>MenuParams</I> object which will defined the command and how
+ * it is added to the Command Menu
+ * </p>
+ *
+ * @return MenuParams -a MenuParams object
+ *
+ */
+ @SuppressWarnings("unchecked")
+ public MenuParams getMenuParams() {
+ return (MenuParams) getObject(MenuParams.class, KEY_MENU_PARAMS);
+ }
+ /**
+ * <p>
+ * Sets Menu parameters</p>
+ * If provided, this will define the command and how it is added to the
+ * Command Menu<p>
+ * If null, commands will not be accessible through the HMI application menu
+ * </p>
+ *
+ * @param menuParams
+ * a menuParams object
+ */
+ public void setMenuParams(MenuParams menuParams) {
+ setParameters(KEY_MENU_PARAMS, menuParams);
+ }
+ /**
+ * <p>
+ * Gets Voice Recognition Commands
+ * </p>
+ *
+ * @return List<String> -(List<String>) indicating one or more VR phrases
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getVrCommands() {
+ return (List<String>) getObject(String.class, KEY_VR_COMMANDS);
+ }
+ /**
+ * <p>
+ * Sets Voice Recognition Commands </p>
+ * <p>If provided, defines one or more VR phrases the recognition of any of
+ * which triggers the <i>{@linkplain OnCommand}</i> notification with this
+ * cmdID</p>
+ * <p>If null, commands will not be accessible by voice commands (when the user
+ * hits push-to-talk)
+ * </p>
+ *
+ * @param vrCommands
+ * List<String> indicating one or more VR phrases
+ * <p>
+ * <b>Notes: </b>Optional only if menuParams is provided. If
+ * provided, array must contain at least one non-empty (not null,
+ * not zero-length, not whitespace only) element</p>
+ */
+ public void setVrCommands( List<String> vrCommands ) {
+ setParameters(KEY_VR_COMMANDS, vrCommands);
+ }
+
+ /**
+ * <p>Gets the image to be shown along with a command </p>
+ *
+ * @return Image -an Image object
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public Image getCmdIcon() {
+ return (Image) getObject(Image.class, KEY_CMD_ICON);
+ }
+
+ /**
+ * <p>Sets the Image
+ * If provided, defines the image to be be shown along with a command</p>
+ * @param cmdIcon
+ * <p>an Image obj representing the Image obj shown along with a
+ * command</p>
+ * <p>
+ * <b>Notes: </b>If omitted on supported displays, no (or the
+ * default if applicable) icon will be displayed</p>
+ * @since SmartDeviceLink 2.0
+ */
+ public void setCmdIcon(Image cmdIcon) {
+ setParameters(KEY_CMD_ICON, cmdIcon);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java
new file mode 100644
index 000000000..897f6918c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Add Command Response is sent, when AddCommand has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class AddCommandResponse extends RPCResponse {
+ /**
+ * Constructs a new AddCommandResponse object
+ */
+ public AddCommandResponse() {
+ super(FunctionID.ADD_COMMAND.toString());
+ }
+
+ public AddCommandResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new AddCommandResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public AddCommandResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+}
+
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
new file mode 100644
index 000000000..a75b5899e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * <p>Add a SubMenu to the Command Menu</p>
+ *
+ * <p>A SubMenu can only be added to the Top Level Menu (i.e.a SubMenu cannot be
+ * added to a SubMenu), and may only contain commands as children</p>
+ *
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUD</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>menuID</td>
+ * <td>Integer</td>
+ * <td>Unique ID that identifies this sub menu. This value is used in AddCommand to which SubMenu is the parent of the command being added.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>position</td>
+ * <td>Integer</td>
+ * <td>Position within the items of the top level Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc. Position of any submenu will always be located before the return and exit options.</td>
+ * <td>N</td>
+ * <td>Min Value: 0 <p>Max Value: 1000</p> <p>If position is greater or equal than the number of items on top level, the sub menu will be appended by the end.</p><p>If this parameter is omitted, the entry will be added at the end of the list.</P></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>menuName</td>
+ * <td>String</td>
+ * <td>Text which is displayed representing this submenu item</td>
+ * <td>Y</td>
+ * <td>maxlength:500</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>menuIcon</td>
+ * <td>Image</td>
+ * <td>Image to be be shown along with the submenu item</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * </table>
+ * <b>Response</b>
+ * <p>Indicates that the corresponding request either failed or succeeded. If the response returns with a SUCCESS result code, this means the SubMenu was added to the Command Menu successfully</p>
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>INVALID_ID</p>
+ * <p>DUPLICATE NAME</p>
+ * @since SmartDeviceLink 1.0
+ * @see DeleteSubMenu
+ * @see AddCommand
+ * @see DeleteCommand
+ */
+public class AddSubMenu extends RPCRequest {
+ public static final String KEY_POSITION = "position";
+ public static final String KEY_MENU_NAME = "menuName";
+ public static final String KEY_MENU_ID = "menuID";
+ public static final String KEY_MENU_ICON = "menuIcon";
+
+ /**
+ * Constructs a new AddSubMenu object
+ */
+ public AddSubMenu() {
+ super(FunctionID.ADD_SUB_MENU.toString());
+ }
+ /**
+ * Constructs a new AddSubMenu object indicated by the Hashtable parameter
+ *
+ *
+ * @param hash The Hashtable to use
+ */
+ public AddSubMenu(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new AddSubMenu object
+ * @param menuID an integer object representing a Menu ID
+ * <p><b>Notes:</b> Min Value: 0; Max Value: 2000000000</p>
+ * @param menuName String which will be displayed representing this submenu item
+ */
+ public AddSubMenu(@NonNull Integer menuID, @NonNull String menuName) {
+ this();
+ setMenuID(menuID);
+ setMenuName(menuName);
+ }
+ /**
+ * Returns an <i>Integer</i> object representing the Menu ID that identifies
+ * a sub menu
+ *
+ * @return Integer -an integer representing the Menu ID that identifies a sub
+ * menu
+ */
+ public Integer getMenuID() {
+ return getInteger( KEY_MENU_ID );
+ }
+ /**
+ * <p>Sets a Menu ID that identifies a sub menu.</p><p> This value is used in
+ * {@linkplain AddCommand} to which SubMenu is the parent of the command
+ * being added</p>
+ *
+ *
+ * @param menuID
+ * an integer object representing a Menu ID
+ *
+ * <p><b>Notes:</b> Min Value: 0; Max Value: 2000000000</p>
+ */
+ public void setMenuID( @NonNull Integer menuID ) {
+ setParameters(KEY_MENU_ID, menuID);
+ }
+ /**
+ * <p>Returns an <i>Integer</i> object representing the position of menu</p>
+ *
+ *
+ * @return Integer -the value representing the relative position of menus
+ */
+ public Integer getPosition() {
+ return getInteger( KEY_POSITION );
+ }
+ /**
+ * Sets a position of menu
+ *
+ * @param position
+ * <p>An Integer object representing the position within the items
+ * of the top level Command Menu. 0 will insert at the front, 1
+ * will insert after the first existing element, etc. Position of
+ * any submenu will always be located before the return and exit
+ * options
+ * </p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>
+ * Min Value: 0; Max Value: 1000</li>
+ * <li>If position is greater than or equal to the number of items
+ * on top level, the sub menu will be appended by the end</li>
+ * <li>If this parameter is omitted, the entry will be added at
+ * the end of the list</li>
+ * </ul>
+ */
+ public void setPosition( Integer position ) {
+ setParameters(KEY_POSITION, position);
+ }
+ /**
+ * Returns String which is displayed representing this submenu item
+ *
+ * @return String -a Submenu item's name
+ */
+ public String getMenuName() {
+ return getString( KEY_MENU_NAME );
+ }
+ /**
+ * Sets a menuName which is displayed representing this submenu item
+ *
+ * @param menuName
+ * String which will be displayed representing this submenu item
+ */
+ public void setMenuName( @NonNull String menuName ) {
+ setParameters(KEY_MENU_NAME, menuName);
+ }
+ /**
+ * Returns Image to be be shown along with the submenu item
+ *
+ * @return Image - the submenu icon
+ */
+ public Image getMenuIcon() {
+ return (Image) getObject(Image.class, KEY_MENU_ICON);
+ }
+ /**
+ * Sets image to be be shown along with the submenu item
+ *
+ * @param menuIcon
+ * Image to be be shown along with the submenu item
+ */
+ public void setMenuIcon(Image menuIcon) {
+ setParameters(KEY_MENU_ICON, menuIcon);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java
new file mode 100644
index 000000000..1f824c7e2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Add SubMenu Response is sent, when AddSubMenu has been called
+ * @since SmartDeviceLink 1.0
+ */
+public class AddSubMenuResponse extends RPCResponse {
+ /**
+ * Constructs a new AddSubMenuResponse object
+ */
+
+ public AddSubMenuResponse() {
+ super(FunctionID.ADD_SUB_MENU.toString());
+ }
+ public AddSubMenuResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new AddSubMenuResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public AddSubMenuResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java
new file mode 100644
index 000000000..eeadd28a7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+
+import java.util.Hashtable;
+
+/**
+ * <p>The status of the air bags.</p>
+ *
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Version.</th>
+ * </tr>
+ * <tr>
+ * <td>driverAirbagDeployed </td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>Status of driver airbag.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>driverSideAirbagDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>Status of driver side airbag.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>driverCurtainAirbagDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>Status of driver curtain airbag.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>passengerAirbagDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>Status of passenger airbag.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>passengerCurtainAirbagDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>Status of passenger curtain airbag.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>driverKneeAirbagDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>Status of driver knee airbag.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>passengerSideAirbagDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>Status of passenger side airbag.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>passengerKneeAirbagDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>Status of passenger knee airbag</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ *
+ * </table>
+ *
+ * <p><b>Response:</b></p>
+ * If a resultCode of "SUCCESS" is returned, the request was accepted by SDL. By the time the corresponding response is received, the Alert will have completed.
+ *
+ * <p><b> Non-default Result Codes:</b></p>
+ * <p>REJECTED</p><p> ABORTED</P>
+ *
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ * @see Image
+ * @see SubscribeVehicleData
+ */
+public class AirbagStatus extends RPCStruct {
+ public static final String KEY_DRIVER_AIRBAG_DEPLOYED = "driverAirbagDeployed";
+ public static final String KEY_DRIVER_SIDE_AIRBAG_DEPLOYED = "driverSideAirbagDeployed";
+ public static final String KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED = "driverCurtainAirbagDeployed";
+ public static final String KEY_DRIVER_KNEE_AIRBAG_DEPLOYED = "driverKneeAirbagDeployed";
+ public static final String KEY_PASSENGER_AIRBAG_DEPLOYED = "passengerAirbagDeployed";
+ public static final String KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED = "passengerSideAirbagDeployed";
+ public static final String KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED = "passengerCurtainAirbagDeployed";
+ public static final String KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED = "passengerKneeAirbagDeployed";
+
+
+ public AirbagStatus() { }
+
+ /** Constructs a new AirbagStatus object indicated by the Hashtable
+ * parameter
+ * @param hash hashtable filled with params to create an instance of this RPC
+ * The hash table to use
+ */
+ public AirbagStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public AirbagStatus(@NonNull VehicleDataEventStatus driverAirbagDeployed, @NonNull VehicleDataEventStatus driverSideAirbagDeployed, @NonNull VehicleDataEventStatus driverCurtainAirbagDeployed, @NonNull VehicleDataEventStatus driverKneeAirbagDeployed,
+ @NonNull VehicleDataEventStatus passengerCurtainAirbagDeployed, @NonNull VehicleDataEventStatus passengerAirbagDeployed, @NonNull VehicleDataEventStatus passengerSideAirbagDeployed, @NonNull VehicleDataEventStatus passengerKneeAirbagDeployed) {
+ this();
+ setDriverAirbagDeployed(driverAirbagDeployed);
+ setDriverSideAirbagDeployed(driverSideAirbagDeployed);
+ setDriverCurtainAirbagDeployed(driverCurtainAirbagDeployed);
+ setDriverKneeAirbagDeployed(driverKneeAirbagDeployed);
+ setPassengerAirbagDeployed(passengerAirbagDeployed);
+ setPassengerSideAirbagDeployed(passengerSideAirbagDeployed);
+ setPassengerCurtainAirbagDeployed(passengerCurtainAirbagDeployed);
+ setPassengerKneeAirbagDeployed(passengerKneeAirbagDeployed);
+ }
+
+ public void setDriverAirbagDeployed(@NonNull VehicleDataEventStatus driverAirbagDeployed) {
+ setValue(KEY_DRIVER_AIRBAG_DEPLOYED, driverAirbagDeployed);
+ }
+ public VehicleDataEventStatus getDriverAirbagDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_AIRBAG_DEPLOYED);
+ }
+ public void setDriverSideAirbagDeployed(@NonNull VehicleDataEventStatus driverSideAirbagDeployed) {
+ setValue(KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, driverSideAirbagDeployed);
+ }
+ public VehicleDataEventStatus getDriverSideAirbagDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_SIDE_AIRBAG_DEPLOYED);
+ }
+ public void setDriverCurtainAirbagDeployed(@NonNull VehicleDataEventStatus driverCurtainAirbagDeployed) {
+ setValue(KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, driverCurtainAirbagDeployed);
+ }
+ public VehicleDataEventStatus getDriverCurtainAirbagDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED);
+ }
+ public void setPassengerAirbagDeployed(@NonNull VehicleDataEventStatus passengerAirbagDeployed) {
+ setValue(KEY_PASSENGER_AIRBAG_DEPLOYED, passengerAirbagDeployed);
+ }
+ public VehicleDataEventStatus getPassengerAirbagDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_AIRBAG_DEPLOYED);
+ }
+ public void setPassengerCurtainAirbagDeployed(@NonNull VehicleDataEventStatus passengerCurtainAirbagDeployed) {
+ setValue(KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, passengerCurtainAirbagDeployed);
+ }
+ public VehicleDataEventStatus getPassengerCurtainAirbagDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED);
+ }
+ public void setDriverKneeAirbagDeployed(@NonNull VehicleDataEventStatus driverKneeAirbagDeployed) {
+ setValue(KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, driverKneeAirbagDeployed);
+ }
+ public VehicleDataEventStatus getDriverKneeAirbagDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_KNEE_AIRBAG_DEPLOYED);
+ }
+ public void setPassengerSideAirbagDeployed(@NonNull VehicleDataEventStatus passengerSideAirbagDeployed) {
+ setValue(KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, passengerSideAirbagDeployed);
+ }
+ public VehicleDataEventStatus getPassengerSideAirbagDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED);
+ }
+ public void setPassengerKneeAirbagDeployed(@NonNull VehicleDataEventStatus passengerKneeAirbagDeployed) {
+ setValue(KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, passengerKneeAirbagDeployed);
+ }
+ public VehicleDataEventStatus getPassengerKneeAirbagDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java
new file mode 100644
index 000000000..1490a48f1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java
@@ -0,0 +1,377 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Provides information to the user using either TTS, the Display or both and
+ * can include a system-generated alert tone
+ *
+ * <ul>
+ * <li>The displayed portion of the Alert, if any, will persist until the
+ * specified timeout has elapsed, or the Alert is preempted</li>
+ * <li>An Alert will preempt (abort) any SmartDeviceLink Operation that is in-progress,
+ * except an already-in-progress Alert</li>
+ * <li>An Alert cannot be preempted by any SmartDeviceLink Operation</li>
+ * <li>An Alert can be preempted by a user action (button push)</li>
+ * <li>An Alert will fail if it is issued while another Alert is in progress</li>
+ * <li>Although each Alert parameter is optional, in fact each Alert request
+ * must supply at least one of the following parameters:
+ * <ul>
+ * <li>alertText1</li>
+ * <li>alertText2</li>
+ * <li>alertText3</li>
+ * <li>ttsChunks</li>
+ * </ul>
+ * </li>
+ * </ul>
+ *
+ * <p><b>HMILevel needs to be FULL or LIMITED.</b></p>
+ * <b>If the app has been granted function group Notification the HMILevel can
+ * also be BACKGROUND</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>alertText1</td>
+ * <td>String</td>
+ * <td>Text to be displayed in the first field of the display during the Alert. </td>
+ * <td>N</td>
+ * <td> Length is limited to what is indicated in RegisterAppInterface response. If omitted, top display line will be cleared. Text is always centered</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>alertText2</td>
+ * <td>String</td>
+ * <td>Text to be displayed in the second field of the display during the Alert. </td>
+ * <td>N</td>
+ * <td> Only permitted if HMI supports a second display line. Length is limited to what is indicated in RegisterAppInterface response. If omitted, second display line will be cleared. </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>alertText3</td>
+ * <td>String</td>
+ * <td>Text to be displayed in the third field of the display during the Alert.</td>
+ * <td>N</td>
+ * <td>Array must have a least one element. </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>ttsChunks</td>
+ * <td>TTSChunk[]</td>
+ * <td>Array of type TTSChunk which, taken together, specify what is to be spoken to the user.</td>
+ * <td>N</td>
+ * <td>Array must have a least one element. </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>duration</td>
+ * <td>Integer</td>
+ * <td><p>The duration of the displayed portion of the alert, in milliseconds.</p> After this amount of time has passed, the display fields alertText1 and alertText2 will revert to what was displayed in those fields before the alert began.</td>
+ * <td>N</td>
+ * <td>Min Value: 3000 Max Value: 10000 <p>If omitted, the default is 5000 milliseconds</p></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>playTone</td>
+ * <td>Boolean</td>
+ * <td>Specifies whether the alert tone should be played before the TTS (if any) is spoken.</td>
+ * <td>N</td>
+ * <td>If omitted, default is true.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>softButtons</td>
+ * <td>SoftButton[]</td>
+ * <td>Specifies the softbuttons, the apps wants to use in this alert.</td>
+ * <td></td>
+ * <td>If omitted on supported displays, the alert will not have any SoftButton.ArrayMin: 0; ArrayMax: 4</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>progressIndicator</td>
+ * <td>Boolean</td>
+ * <td>If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ *
+ *
+ * @see GetVehicleData
+ * @see OnVehicleData
+ * @see Show
+ * @see Speak
+ */
+public class Alert extends RPCRequest {
+ public static final String KEY_PLAY_TONE = "playTone";
+ public static final String KEY_DURATION = "duration";
+ public static final String KEY_ALERT_TEXT_1 = "alertText1";
+ public static final String KEY_ALERT_TEXT_2 = "alertText2";
+ public static final String KEY_ALERT_TEXT_3 = "alertText3";
+ public static final String KEY_PROGRESS_INDICATOR = "progressIndicator";
+ public static final String KEY_TTS_CHUNKS = "ttsChunks";
+ public static final String KEY_SOFT_BUTTONS = "softButtons";
+
+ /**
+ * Constructs a new Alert object
+ */
+ public Alert() {
+ super(FunctionID.ALERT.toString());
+ }
+ /**
+ * <p>Constructs a new Alert object indicated by the Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public Alert(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Gets the text which is displayed in the first field of the display during
+ * the Alert
+ *
+ * @return String - a String value representing the text which is displayed
+ * in the first field during the Alert
+ */
+ public String getAlertText1() {
+ return getString(KEY_ALERT_TEXT_1);
+ }
+ /**
+ * Sets the String to be displayed in the first field of the display during
+ * the Alert
+ *
+ * @param alertText1
+ * String Value
+ *
+ * <p><b>Notes: </b></p>
+ * <ul>
+ * <li>Length is limited to what is indicated in <i>
+ * {@linkplain RegisterAppInterface}</i> response</li>
+ * <li>If omitted, top display line will be cleared</li>
+ * <li>Text is always centered</li>
+ * </ul>
+ */
+ public void setAlertText1(String alertText1) {
+ setParameters(KEY_ALERT_TEXT_1, alertText1);
+ }
+ /**
+ * Gets the text which is displayed in the second field of the display
+ * during the Alert
+ *
+ * @return String -a String value representing the text which is displayed
+ * in the second field during the Alert
+ */
+ public String getAlertText2() {
+ return getString(KEY_ALERT_TEXT_2);
+ }
+ /**
+ * Sets the String to be displayed in the second field of the display during
+ * the Alert
+ *
+ * @param alertText2
+ * String Value
+ *
+ * <p><b>Notes: </b></p>
+ * <ul>
+ * <li>Only permitted if HMI supports a second display line</li>
+ * <li>Length is limited to what is indicated in <i>
+ * {@linkplain RegisterAppInterface}</i> response</li>
+ * <li>If omitted, second display line will be cleared</li>
+ * <li>Text is always centered</li>
+ * </ul>
+ */
+ public void setAlertText2(String alertText2) {
+ setParameters(KEY_ALERT_TEXT_2, alertText2);
+ }
+
+ /**
+ * Gets the text which is displayed in the third field of the display during
+ * the Alert
+ *
+ * @return String -a String value representing the text which is displayed
+ * in the third field during the Alert
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ public String getAlertText3() {
+ return getString(KEY_ALERT_TEXT_3);
+ }
+
+ /**
+ * Sets the String to be displayed in the third field of the display during
+ * the Alert
+ *
+ * @param alertText3
+ * String Value
+ *
+ * <p> <b>Notes: </b></p>
+ * <ul>
+ * <li>Only permitted if HMI supports a third display line</li>
+ * <li>Length is limited to what is indicated in <i>
+ * {@linkplain RegisterAppInterface}</i> response</li>
+ * <li>If omitted, third display line will be cleared</li>
+ * <li>Text is always centered</li>
+ * </ul>
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ public void setAlertText3(String alertText3) {
+ setParameters(KEY_ALERT_TEXT_3, alertText3);
+ }
+ /**
+ * Gets TTSChunk[], the Array of type TTSChunk which, taken together,
+ * specify what is to be spoken to the user
+ *
+ * @return List -a List<TTSChunk> value specify what is to be spoken to
+ * the user
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getTtsChunks() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_CHUNKS);
+ }
+ /**
+ * Sets array of type TTSChunk which, taken together, specify what is to be
+ * spoken to the user
+ *
+ * @param ttsChunks
+ *
+ * <p> <b>Notes: </b>Array must have a least one element</p>
+ */
+ public void setTtsChunks(List<TTSChunk> ttsChunks) {
+ setParameters(KEY_TTS_CHUNKS, ttsChunks);
+ }
+ /**
+ * Gets the duration of the displayed portion of the alert, in milliseconds
+ *
+ * @return Integer -an Integer value representing the duration of the
+ * displayed portion of the alert, in milliseconds
+ */
+ public Integer getDuration() {
+ return getInteger(KEY_DURATION);
+ }
+ /**
+ * <p>Sets the duration of the displayed portion of the alert, in milliseconds.
+ * After this amount of time has passed, the display fields alertText1 and
+ * alertText2 will revert to what was displayed in those fields before the
+ * alert began</p>
+ *
+ *
+ * @param duration
+ * the Integer values representing the duration time, in
+ * milliseconds
+ * <p>
+ * <b>Notes: </b></p>
+ * <ul>
+ * <li>Min Value: 3000; Max Value: 10000</li>
+ * <li>If omitted, the default is 5000 milliseconds</li>
+ * </ul>
+ */
+ public void setDuration(Integer duration) {
+ setParameters(KEY_DURATION, duration);
+ }
+ /**
+ * Gets a Boolean value representing the alert tone
+ *
+ * @return Boolean -If TRUE, means an alert tone will be played before the
+ * TTS (if any) is spoken
+ */
+ public Boolean getPlayTone() {
+ return getBoolean(KEY_PLAY_TONE);
+ }
+ /**
+ * Sets whether the alert tone should be played before the TTS (if any) is
+ * spoken
+ *
+ * @param playTone
+ * a Boolean value which specifies whether the alert tone should
+ * be played before the TTS (if any) is spoken
+ *
+ * <p> <b>Notes: </b>If omitted, default is true</p>
+ */
+ public void setPlayTone(Boolean playTone) {
+ setParameters(KEY_PLAY_TONE, playTone);
+ }
+
+ /**
+ * Gets the SoftButton List object
+ *
+ * @return List<SoftButton> -a List<SoftButton> representing the List
+ * object
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<SoftButton> getSoftButtons() {
+ return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
+ }
+
+ /**
+ * Sets the SoftButtons
+ *
+ * @param softButtons
+ * a List<SoftButton> value
+ * <p>
+ * <b>Notes: </b></p>
+ * <ul>
+ * <li>If omitted on supported displays, the alert will not have
+ * any SoftButton</li>
+ * <li>ArrayMin: 0</li>
+ * <li>ArrayMax: 4</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+
+ public void setSoftButtons(List<SoftButton> softButtons) {
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ }
+ public Boolean getProgressIndicator() {
+ return getBoolean(KEY_PROGRESS_INDICATOR);
+ }
+ public void setProgressIndicator(Boolean progressIndicator) {
+ setParameters(KEY_PROGRESS_INDICATOR, progressIndicator);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java
new file mode 100644
index 000000000..37b6c2da3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * <p>This will bring up an alert with information related to the next navigation maneuver including potential voice
+ * navigation instructions. Shown information will be taken from the ShowConstantTBT function
+ * </p>
+ * <p>Function Group: Navigation</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ *
+ * @since SmartDeviceLink 2.0
+ * @see ShowConstantTbt
+ */
+public class AlertManeuver extends RPCRequest{
+
+ public static final String KEY_TTS_CHUNKS = "ttsChunks";
+ public static final String KEY_SOFT_BUTTONS = "softButtons";
+
+ /**
+ * Constructs a new AlertManeuver object
+ */
+ public AlertManeuver(){
+ super(FunctionID.ALERT_MANEUVER.toString());
+ }
+
+ /**
+ *
+ * <p>Constructs a new AlertManeuver object indicated by the Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public AlertManeuver(Hashtable<String, Object> hash){
+ super(hash);
+ }
+
+ /**
+ * Gets the SoftButton List object
+ *
+ * @return List<SoftButton> -a List<SoftButton> representing the List object
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<SoftButton> getSoftButtons(){
+ return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
+ }
+
+ /**
+ * Sets the SoftButtons
+ *
+ * @param softButtons
+ * a List<SoftButton> value
+ * <p>
+ * <b>Notes: </b></p>
+ * <ul>
+ * <li>If omitted on supported displays, the alert will not have any SoftButton</li>
+ * <li>ArrayMin: 0</li>
+ * <li>ArrayMax: 4</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+
+ public void setSoftButtons(List<SoftButton> softButtons){
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ }
+
+ /**
+ * Gets TTSChunk[], the Array of type TTSChunk which, taken together, specify what is to be spoken to the user
+ *
+ * @return List -a List<TTSChunk> value specify what is to be spoken to the user
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getTtsChunks(){
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_CHUNKS);
+ }
+
+ /**
+ * Sets array of type TTSChunk which, taken together, specify what is to be spoken to the user
+ *
+ * @param ttsChunks
+ * <p>
+ * <b>Notes: </b></p>Array must have a least one element
+ */
+ public void setTtsChunks(List<TTSChunk> ttsChunks){
+ setParameters(KEY_TTS_CHUNKS, ttsChunks);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java
new file mode 100644
index 000000000..b630132af
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Alert Maneuver Response is sent, when AlertManeuver has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class AlertManeuverResponse extends RPCResponse{
+
+ /**
+ * Constructs a new AlertManeuverResponse object
+ */
+ public AlertManeuverResponse() {
+ super(FunctionID.ALERT_MANEUVER.toString());
+ }
+
+ /**
+ * <p>
+ * Constructs a new AlertManeuverResponse object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public AlertManeuverResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new AlertManeuverResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public AlertManeuverResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java
new file mode 100644
index 000000000..8463c8920
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Alert Response is sent, when Alert has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class AlertResponse extends RPCResponse {
+ public static final String KEY_TRY_AGAIN_TIME = "tryAgainTime";
+
+ /**
+ * Constructs a new AlertResponse object
+ */
+ public AlertResponse() {
+ super(FunctionID.ALERT.toString());
+ }
+
+ /**
+ * <p>Constructs a new AlertResponse object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public AlertResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new AlertResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public AlertResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+ public Integer getTryAgainTime() {
+ return getInteger(KEY_TRY_AGAIN_TIME);
+ }
+ public void setTryAgainTime(Integer tryAgainTime) {
+ setParameters(KEY_TRY_AGAIN_TIME, tryAgainTime);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java
new file mode 100644
index 000000000..e582162f4
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason;
+
+import java.util.Hashtable;
+
+public class AppServiceCapability extends RPCStruct {
+
+ public static final String KEY_UPDATE_REASON = "updateReason";
+ public static final String KEY_UPDATED_APP_SERVICE_RECORD = "updatedAppServiceRecord";
+
+ // Constructors
+
+ public AppServiceCapability(){}
+
+ /**
+ * @param hash of parameters
+ */
+ public AppServiceCapability(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+
+ /**
+ * @param updatedAppServiceRecord -
+ */
+ public AppServiceCapability(@NonNull AppServiceRecord updatedAppServiceRecord){
+ this();
+ setUpdatedAppServiceRecord(updatedAppServiceRecord);
+ }
+
+ // Setters and Getters
+
+ /**
+ * Only included in OnSystemCapabilityUpdated. Update reason for this service record.
+ * @param updateReason -
+ */
+ public void setUpdateReason(ServiceUpdateReason updateReason){
+ setValue(KEY_UPDATE_REASON, updateReason);
+ }
+
+ /**
+ * Only included in OnSystemCapabilityUpdated. Update reason for this service record.
+ * @return updateReason - The updateReason
+ */
+ public ServiceUpdateReason getUpdateReason(){
+ return (ServiceUpdateReason) getObject(ServiceUpdateReason.class, KEY_UPDATE_REASON);
+ }
+
+ /**
+ * Only included in OnSystemCapabilityUpdated. Update reason for this service record.
+ * @param updatedAppServiceRecord -
+ */
+ public void setUpdatedAppServiceRecord(AppServiceRecord updatedAppServiceRecord){
+ setValue(KEY_UPDATED_APP_SERVICE_RECORD, updatedAppServiceRecord);
+ }
+
+ /**
+ * Only included in OnSystemCapabilityUpdated. Update reason for this service record.
+ * @return updateReason - The updateReason
+ */
+ public AppServiceRecord getUpdatedAppServiceRecord(){
+ return (AppServiceRecord) getObject(AppServiceRecord.class, KEY_UPDATED_APP_SERVICE_RECORD);
+ }
+
+ /**
+ * Helper method to compare an AppServiceCapability to this instance.
+ * @param capability the AppServiceCapability to compare to this one
+ * @return if both AppServiceCapability objects refer to the same service
+ */
+ public boolean matchesAppService(AppServiceCapability capability){
+ if(capability != null){
+ AppServiceRecord appServiceRecord = getUpdatedAppServiceRecord();
+ AppServiceRecord otherASR = capability.getUpdatedAppServiceRecord();
+
+ if(appServiceRecord != null && otherASR != null) {
+ // If both service IDs exists we can compare them. If either is null we can't use
+ // only this check.
+ if(appServiceRecord.getServiceID() != null && otherASR.getServiceID() != null){
+ //return whether the app service IDs are equal or not
+ return appServiceRecord.getServiceID().equalsIgnoreCase(otherASR.getServiceID());
+ }else{
+ AppServiceManifest manifest = appServiceRecord.getServiceManifest();
+ AppServiceManifest otherManifest = otherASR.getServiceManifest();
+ if(manifest != null && otherManifest != null){
+ //Check the service names, if they are the same it can be assumed they are the same service
+ return (manifest.getServiceName() != null && manifest.getServiceName().equalsIgnoreCase(otherManifest.getServiceName()));
+ }
+ }
+ }
+ }
+ // If it got to this point it was not the same
+ return false;
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java
new file mode 100644
index 000000000..d5df5f75c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ Contains all the current data of the app service. The serviceType will link to which of the service data objects are
+ included in this object (e.g. if the service type is MEDIA, the mediaServiceData param should be included).
+ */
+public class AppServiceData extends RPCStruct {
+
+ public static final String KEY_SERVICE_TYPE = "serviceType";
+ public static final String KEY_SERVICE_ID = "serviceID";
+ public static final String KEY_MEDIA_SERVICE_DATA = "mediaServiceData";
+ public static final String KEY_WEATHER_SERVICE_DATA = "weatherServiceData";
+ public static final String KEY_NAVIGATION_SERVICE_DATA = "navigationServiceData";
+
+
+ // Constructors
+ public AppServiceData() { }
+
+ public AppServiceData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public AppServiceData(@NonNull String serviceType, @NonNull String serviceId) {
+ this();
+ setServiceType(serviceType);
+ setServiceID(serviceId);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param serviceType -
+ */
+ public void setServiceType(@NonNull String serviceType) {
+ setValue(KEY_SERVICE_TYPE, serviceType);
+ }
+
+ /**
+ * @return serviceType -
+ */
+ public String getServiceType() {
+ return getString(KEY_SERVICE_TYPE);
+ }
+
+ /**
+ * @param serviceId -
+ */
+ public void setServiceID(@NonNull String serviceId) {
+ setValue(KEY_SERVICE_ID, serviceId);
+ }
+
+ /**
+ * @return serviceId -
+ */
+ public String getServiceID() {
+ return getString(KEY_SERVICE_ID);
+ }
+
+ /**
+ * @param mediaServiceData -
+ */
+ public void setMediaServiceData(MediaServiceData mediaServiceData) {
+ setValue(KEY_MEDIA_SERVICE_DATA, mediaServiceData);
+ }
+
+ /**
+ * @return mediaServiceData -
+ */
+ public MediaServiceData getMediaServiceData() {
+ return (MediaServiceData) getObject(MediaServiceData.class,KEY_MEDIA_SERVICE_DATA);
+ }
+
+ /**
+ * @param weatherServiceData -
+ */
+ public void setWeatherServiceData(WeatherServiceData weatherServiceData) {
+ setValue(KEY_WEATHER_SERVICE_DATA, weatherServiceData);
+ }
+
+ /**
+ * @return weatherServiceData -
+ */
+ public WeatherServiceData getWeatherServiceData() {
+ return (WeatherServiceData) getObject(WeatherServiceData.class,KEY_WEATHER_SERVICE_DATA);
+ }
+
+ /**
+ * @param navigationServiceData -
+ */
+ public void setNavigationServiceData(NavigationServiceData navigationServiceData) {
+ setValue(KEY_NAVIGATION_SERVICE_DATA, navigationServiceData);
+ }
+
+ /**
+ * @return navigationServiceData -
+ */
+ public NavigationServiceData getNavigationServiceData() {
+ return (NavigationServiceData) getObject(NavigationServiceData.class, KEY_NAVIGATION_SERVICE_DATA);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java
new file mode 100644
index 000000000..db0106e3d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.AppServiceType;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This manifest contains all the information necessary for the service to be
+ * published, activated, and allow consumers to interact with it
+ */
+public class AppServiceManifest extends RPCStruct {
+
+ public static final String KEY_SERVICE_NAME = "serviceName";
+ public static final String KEY_SERVICE_TYPE = "serviceType";
+ public static final String KEY_SERVICE_ICON = "serviceIcon";
+ public static final String KEY_ALLOW_APP_CONSUMERS = "allowAppConsumers";
+ public static final String KEY_RPC_SPEC_VERSION = "rpcSpecVersion";
+ public static final String KEY_HANDLED_RPCS = "handledRPCs";
+ public static final String KEY_MEDIA_SERVICE_MANIFEST = "mediaServiceManifest";
+ public static final String KEY_WEATHER_SERVICE_MANIFEST = "weatherServiceManifest";
+ public static final String KEY_NAVIGATION_SERVICE_MANIFEST = "navigationServiceManifest";
+
+ // Constructors
+ public AppServiceManifest() { }
+
+ public AppServiceManifest(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructor that takes in the mandatory parameters.
+ * @param serviceType the type of service this is, use {@link com.smartdevicelink.proxy.rpc.enums.AppServiceType}
+ * @see com.smartdevicelink.proxy.rpc.enums.AppServiceType
+ */
+ public AppServiceManifest(@NonNull String serviceType) {
+ this();
+ setServiceType(serviceType);
+ }
+ /**
+ * Constructor that takes in the mandatory parameters.
+ * @param serviceType the type of service this is
+ * @see com.smartdevicelink.proxy.rpc.enums.AppServiceType
+ */
+ public AppServiceManifest(@NonNull AppServiceType serviceType) {
+ this();
+ setServiceType(serviceType.name());
+ }
+
+ // Setters and Getters
+ /**
+ * Unique name of this service
+ * @param serviceName - the service name
+ */
+ public void setServiceName(String serviceName){
+ setValue(KEY_SERVICE_NAME, serviceName);
+ }
+
+ /**
+ * Unique name of this service
+ * @return ServiceName
+ */
+ public String getServiceName(){
+ return getString(KEY_SERVICE_NAME);
+ }
+
+ /**
+ * The type of service that is to be offered by this app
+ * @param serviceType - the serviceType use {@link com.smartdevicelink.proxy.rpc.enums.AppServiceType}
+ * @see com.smartdevicelink.proxy.rpc.enums.AppServiceType
+ */
+ public void setServiceType(@NonNull String serviceType){
+ setValue(KEY_SERVICE_TYPE, serviceType);
+ }
+
+ /**
+ * The type of service that is to be offered by this app
+ * @return the AppServiceType
+ * @see com.smartdevicelink.proxy.rpc.enums.AppServiceType
+ */
+ public String getServiceType(){
+ return getString(KEY_SERVICE_TYPE);
+ }
+
+ /**
+ * The icon to be associated with this service Most likely the same as the appIcon.
+ * @param serviceIcon - The Service Icon Image
+ */
+ public void setServiceIcon(Image serviceIcon){
+ setValue(KEY_SERVICE_ICON, serviceIcon);
+ }
+
+ /**
+ * The icon to be associated with this service Most likely the same as the appIcon.
+ * @return serviceIcon Image
+ */
+ public Image getServiceIcon(){
+ return (Image) getObject(Image.class, KEY_SERVICE_ICON);
+ }
+
+ /**
+ * If true, app service consumers beyond the IVI system will be able to access this service. If false,
+ * only the IVI system will be able consume the service. If not provided, it is assumed to be false.
+ * @param allowAppConsumers - boolean
+ */
+ public void setAllowAppConsumers(Boolean allowAppConsumers){
+ setValue(KEY_ALLOW_APP_CONSUMERS, allowAppConsumers);
+ }
+
+ /**
+ * If true, app service consumers beyond the IVI system will be able to access this service. If false,
+ * only the IVI system will be able consume the service. If not provided, it is assumed to be false.
+ * @return allowAppConsumers - boolean
+ */
+ public Boolean getAllowAppConsumers(){
+ return getBoolean(KEY_ALLOW_APP_CONSUMERS);
+ }
+
+ /**
+ * This is the max RPC Spec version the app service understands. This is important during the RPC pass through functionality.
+ * If not included, it is assumed the max version of the module is acceptable.
+ * @param rpcSpecVersion - The rpcSpecVersion
+ */
+ public void setRpcSpecVersion(SdlMsgVersion rpcSpecVersion){
+ setValue(KEY_RPC_SPEC_VERSION, rpcSpecVersion);
+ }
+
+ /**
+ * This is the max RPC Spec version the app service understands. This is important during the RPC pass through functionality.
+ * If not included, it is assumed the max version of the module is acceptable.
+ * @return rpcSpecVersion - The rpcSpecVersion
+ */
+ public SdlMsgVersion getRpcSpecVersion(){
+ return (SdlMsgVersion) getObject(SdlMsgVersion.class,KEY_RPC_SPEC_VERSION);
+ }
+
+ /**
+ * This field contains the Function IDs for the RPCs that this service intends to handle correctly.
+ * This means the service will provide meaningful responses.
+ * @param handledRPCs - The List of Handled RPCs using their ID value from the FunctionID enum
+ * @see com.smartdevicelink.protocol.enums.FunctionID
+ * @see #setHandledRpcsUsingFunctionIDs(List)
+ */
+ public void setHandledRpcs(List<Integer> handledRPCs){
+ setValue(KEY_HANDLED_RPCS, handledRPCs);
+ }
+ /**
+ * This field contains the Function IDs for the RPCs that this service intends to handle correctly.
+ * This means the service will provide meaningful responses.
+ * @param handledRPCs - The List of Handled RPCs using the FunctionID enum
+ * @see #setHandledRpcs(List)
+ */
+ public void setHandledRpcsUsingFunctionIDs(List<FunctionID> handledRPCs){
+ if(handledRPCs != null){
+ List<Integer> rpcIds = new ArrayList<>();
+ for(FunctionID functionID : handledRPCs){
+ rpcIds.add(functionID.getId());
+ }
+ setHandledRpcs(rpcIds);
+ }else{
+ setValue(KEY_HANDLED_RPCS, null);
+ }
+ }
+
+ /**
+ * This field contains the FunctionID integer ID values for the RPCs that this service intends to handle correctly.
+ * This means the service will provide meaningful responses.
+ * @return handledRPCs - The List of Handled RPC IDs obtained through the FunctionID enum
+ * @see com.smartdevicelink.protocol.enums.FunctionID
+ */
+ @SuppressWarnings("unchecked")
+ public List<Integer> getHandledRpcs(){
+ return (List<Integer>) getObject(Integer.class,KEY_HANDLED_RPCS);
+ }
+
+ /**
+ * The MediaServiceManifest
+ * @param mediaServiceManifest - The mediaServiceManifest
+ */
+ public void setMediaServiceManifest(MediaServiceManifest mediaServiceManifest){
+ setValue(KEY_MEDIA_SERVICE_MANIFEST, mediaServiceManifest);
+ }
+
+ /**
+ * The MediaServiceManifest
+ * @return mediaServiceManifest - The mediaServiceManifest
+ */
+ public MediaServiceManifest getMediaServiceManifest(){
+ return (MediaServiceManifest) getObject(MediaServiceManifest.class,KEY_MEDIA_SERVICE_MANIFEST);
+ }
+
+ /**
+ * The WeatherServiceManifest
+ * @param weatherServiceManifest - The weatherServiceManifest
+ */
+ public void setWeatherServiceManifest(WeatherServiceManifest weatherServiceManifest){
+ setValue(KEY_WEATHER_SERVICE_MANIFEST, weatherServiceManifest);
+ }
+
+ /**
+ * The WeatherServiceManifest
+ * @return weatherServiceManifest - The weatherServiceManifest
+ */
+ public WeatherServiceManifest getWeatherServiceManifest(){
+ return (WeatherServiceManifest) getObject(WeatherServiceManifest.class,KEY_WEATHER_SERVICE_MANIFEST);
+ }
+
+ /**
+ * The NavigationServiceManifest
+ * @param navigationServiceManifest - The navigationServiceManifest
+ */
+ public void setNavigationServiceManifest(NavigationServiceManifest navigationServiceManifest){
+ setValue(KEY_NAVIGATION_SERVICE_MANIFEST, navigationServiceManifest);
+ }
+
+ /**
+ * The NavigationServiceManifest
+ * @return navigationServiceManifest - The navigationServiceManifest
+ */
+ public NavigationServiceManifest getNavigationServiceManifest(){
+ return (NavigationServiceManifest) getObject(NavigationServiceManifest.class,KEY_NAVIGATION_SERVICE_MANIFEST);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java
new file mode 100644
index 000000000..66524e237
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * This manifest contains all the information necessary for the
+ * service to be published, activated, and consumers able to interact with it
+ */
+public class AppServiceRecord extends RPCStruct {
+
+ public static final String KEY_SERVICE_ID = "serviceID";
+ public static final String KEY_SERVICE_MANIFEST = "serviceManifest";
+ public static final String KEY_SERVICE_PUBLISHED = "servicePublished";
+ public static final String KEY_SERVICE_ACTIVE = "serviceActive";
+
+
+ // Constructors
+ public AppServiceRecord() { }
+
+ public AppServiceRecord(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public AppServiceRecord(@NonNull String serviceID, @NonNull AppServiceManifest serviceManifest,
+ @NonNull Boolean servicePublished, @NonNull Boolean serviceActive) {
+ this();
+ setServiceID(serviceID);
+ setServiceManifest(serviceManifest);
+ setServicePublished(servicePublished);
+ setServiceActive(serviceActive);
+ }
+
+ // Setters and Getters
+ /**
+ * ID of this service
+ * @param serviceID - the service ID
+ */
+ public void setServiceID(@NonNull String serviceID){
+ setValue(KEY_SERVICE_ID, serviceID);
+ }
+
+ /**
+ * ID of this service
+ * @return serviceId
+ */
+ public String getServiceID(){
+ return getString(KEY_SERVICE_ID);
+ }
+
+ /**
+ * the App Service Manifest
+ * @param serviceManifest - the App Service Manifest
+ */
+ public void setServiceManifest(@NonNull AppServiceManifest serviceManifest){
+ setValue(KEY_SERVICE_MANIFEST, serviceManifest);
+ }
+
+ /**
+ * the App Service Manifest
+ * @return serviceManifest - the App Service Manifest
+ */
+ public AppServiceManifest getServiceManifest(){
+ return (AppServiceManifest) getObject(AppServiceManifest.class,KEY_SERVICE_MANIFEST);
+ }
+
+ /**
+ * If true, the service is published and available. If false, the service has likely just been
+ * unpublished, and should be considered unavailable.
+ * @param servicePublished - boolean
+ */
+ public void setServicePublished(@NonNull Boolean servicePublished){
+ setValue(KEY_SERVICE_PUBLISHED, servicePublished);
+ }
+
+ /**
+ * If true, the service is published and available. If false, the service has likely just been
+ * unpublished, and should be considered unavailable.
+ * @return servicePublished - boolean
+ */
+ public Boolean getServicePublished(){
+ return getBoolean(KEY_SERVICE_PUBLISHED);
+ }
+
+ /**
+ * If true, the service is the active primary service of the supplied service type. It will receive
+ * all potential RPCs that are passed through to that service type. If false, it is not the primary
+ * service of the supplied type. See servicePublished for its availability.
+ * @param serviceActive - boolean
+ */
+ public void setServiceActive(@NonNull Boolean serviceActive){
+ setValue(KEY_SERVICE_ACTIVE, serviceActive);
+ }
+
+ /**
+ * If true, the service is the active primary service of the supplied service type. It will receive
+ * all potential RPCs that are passed through to that service type. If false, it is not the primary
+ * service of the supplied type. See servicePublished for its availability.
+ * @return serviceActive - boolean
+ */
+ public Boolean getServiceActive(){
+ return getBoolean(KEY_SERVICE_ACTIVE);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java
new file mode 100644
index 000000000..36b14d8be
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Capabilities of app services including what service types are supported
+ * and the current state of services.
+ */
+public class AppServicesCapabilities extends RPCStruct {
+
+ public static final String KEY_APP_SERVICES = "appServices";
+
+ // Constructors
+
+ /**
+ * Capabilities of app services including what service types are supported
+ * and the current state of services.
+ */
+ public AppServicesCapabilities(){}
+
+ /**
+ * Capabilities of app services including what service types are supported
+ * and the current state of services.
+ * @param hash of parameters
+ */
+ public AppServicesCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ // Setters and Getters
+
+ /**
+ * An array of currently available services. If this is an update to the
+ * capability the affected services will include an update reason in that item
+ * @param appServices -
+ */
+ public void setAppServices(List<AppServiceCapability> appServices){
+ setValue(KEY_APP_SERVICES, appServices);
+ }
+
+ /**
+ * An array of currently available services. If this is an update to the
+ * capability the affected services will include an update reason in that item
+ * @return appServices
+ */
+ @SuppressWarnings("unchecked")
+ public List<AppServiceCapability> getAppServices(){
+ return (List<AppServiceCapability>) getObject(AppServiceCapability.class,KEY_APP_SERVICES);
+ }
+
+ /**
+ * This method will update the current List<AppServiceCapability> with the updated items. If the
+ * items don't exist in the original ist they will be added. If the original list is null or
+ * empty, the new list will simply be set as the list.
+ * @param updatedAppServiceCapabilities the List<AppServiceCapability> that have been updated
+ * @return if the list was updated
+ */
+ public boolean updateAppServices(@NonNull List<AppServiceCapability> updatedAppServiceCapabilities){
+ if(updatedAppServiceCapabilities == null){
+ return false;
+ }
+
+ List<AppServiceCapability> appServiceCapabilities = getAppServices();
+
+ if(appServiceCapabilities == null){
+ //If there are currently no app services, create one to iterate over with no entries
+ appServiceCapabilities = new ArrayList<>(0);
+ }
+
+ //Create a shallow copy for us to alter while iterating through the original list
+ List<AppServiceCapability> tempList = new ArrayList<>(appServiceCapabilities);
+
+ for(AppServiceCapability updatedAppServiceCapability: updatedAppServiceCapabilities){
+ if(updatedAppServiceCapability != null) {
+ //First search if the record exists in the current list and remove it if so
+ for (AppServiceCapability appServiceCapability : appServiceCapabilities) {
+ if (updatedAppServiceCapability.matchesAppService(appServiceCapability)) {
+ tempList.remove(appServiceCapability); //Remove the old entry
+ break;
+ }
+ }
+
+ if(!ServiceUpdateReason.REMOVED.equals(updatedAppServiceCapability.getUpdateReason())){
+ //If the app service was anything but removed, we can add the updated
+ //record back into the temp list. If it was REMOVED as the update reason
+ //it will not be added back.
+ tempList.add(updatedAppServiceCapability);
+ }
+ }
+ }
+
+ setAppServices(tempList);
+ return !tempList.equals(appServiceCapabilities); //Return if the list is not equal to the original
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java
new file mode 100644
index 000000000..c8e2d6d03
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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_KEEP_CONTEXT_AVAILABLE = "keepContextAvailable";
+ public static final String KEY_VOLUME_AVAILABLE = "volumeAvailable";
+ public static final String KEY_EQUALIZER_AVAILABLE = "equalizerAvailable";
+ public static final String KEY_EQUALIZER_MAX_CHANNEL_ID = "equalizerMaxChannelId";
+
+ /**
+ * 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 keepContextAvailable portion of the AudioControlCapabilities class
+ *
+ * @param keepContextAvailable Availability of the keepContext parameter.
+ */
+ public void setKeepContextAvailable(Boolean keepContextAvailable) {
+ setValue(KEY_KEEP_CONTEXT_AVAILABLE, keepContextAvailable);
+ }
+
+ /**
+ * Gets the keepContextAvailable portion of the AudioControlCapabilities class
+ *
+ * @return Boolean - Availability of the keepContext parameter.
+ */
+ public Boolean getKeepContextAvailable() {
+ return getBoolean(KEY_KEEP_CONTEXT_AVAILABLE);
+ }
+
+ /**
+ * Sets the sourceAvailable portion of the AudioControlCapabilities class
+ *
+ * @param sourceAvailable Availability of the control of audio source.
+ */
+ 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/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java
new file mode 100644
index 000000000..ff95186d5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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 not included.
+ * If it is false, the system not only changes the audio source but also brings the default application or
+ * system UI associated with the audio source to foreground.
+ * If it is true, the system only changes the audio source, but keeps the current application in foreground.
+ */
+ public void setKeepContext(Boolean keepContext) {
+ setValue(KEY_KEEP_CONTEXT, keepContext);
+ }
+
+ /**
+ * 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 not included.
+ * If it is false, the system not only changes the audio source but also brings the default application or
+ * system UI associated with the audio source to foreground.
+ * If it is true, the system only changes the audio source, but keeps the current application in foreground.
+ */
+ public Boolean getKeepContext() {
+ return getBoolean(KEY_KEEP_CONTEXT);
+ }
+
+ /**
+ * 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/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java
new file mode 100644
index 000000000..79396638a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+
+import java.util.Hashtable;
+
+/**
+ *<p> Describes different audio type configurations for PerformAudioPassThru, e.g. {8kHz,8-bit,PCM}
+ * Specifies the capabilities of audio capturing: sampling rate, bits per sample, audio type.</p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>samplingRate</td>
+ * <td>SamplingRate</td>
+ * <td>Describes the sampling rate for AudioPassThru
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>bitsPerSample</td>
+ * <td>BitsPerSample</td>
+ * <td>Describes the sample depth in bit for AudioPassThru
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>audioType</td>
+ * <td>AudioType</td>
+ * <td>Describes the audiotype for AudioPassThru
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class AudioPassThruCapabilities extends RPCStruct {
+ public static final String KEY_SAMPLING_RATE = "samplingRate";
+ public static final String KEY_AUDIO_TYPE = "audioType";
+ public static final String KEY_BITS_PER_SAMPLE = "bitsPerSample";
+
+ /**
+ * Constructs a newly allocated AudioPassThruCapabilities object
+ */
+ public AudioPassThruCapabilities() {}
+
+ /**
+ * Constructs a newly allocated AudioPassThruCapabilities object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public AudioPassThruCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a newly allocated AudioPassThruCapabilities object
+ * @param samplingRate the sampling rate for AudioPassThru
+ * @param bitsPerSample the sample depth in bit for AudioPassThru
+ * @param audioType the audiotype for AudioPassThru
+ */
+ public AudioPassThruCapabilities(@NonNull SamplingRate samplingRate, @NonNull BitsPerSample bitsPerSample, @NonNull AudioType audioType) {
+ this();
+ setSamplingRate(samplingRate);
+ setBitsPerSample(bitsPerSample);
+ setAudioType(audioType);
+ }
+
+ /**
+ * set the sampling rate for AudioPassThru
+ * @param samplingRate the sampling rate for AudioPassThru
+ */
+ public void setSamplingRate(@NonNull SamplingRate samplingRate) {
+ setValue(KEY_SAMPLING_RATE, samplingRate);
+ }
+
+ /**
+ * get the sampling rate for AudioPassThru
+ * @return the sampling rate for AudioPassThru
+ */
+ public SamplingRate getSamplingRate() {
+ return (SamplingRate) getObject(SamplingRate.class, KEY_SAMPLING_RATE);
+ }
+
+ /**
+ * set the sample depth in bit for AudioPassThru
+ * @param bitsPerSample the sample depth in bit for AudioPassThru
+ */
+ public void setBitsPerSample(@NonNull BitsPerSample bitsPerSample) {
+ setValue(KEY_BITS_PER_SAMPLE, bitsPerSample);
+ }
+
+ /**
+ * get the sample depth in bit for AudioPassThru
+ * @return the sample depth in bit for AudioPassThru
+ */
+ public BitsPerSample getBitsPerSample() {
+ return (BitsPerSample) getObject(BitsPerSample.class, KEY_BITS_PER_SAMPLE);
+ }
+
+ /**
+ * set the audiotype for AudioPassThru
+ * @param audioType the audiotype for AudioPassThru
+ */
+ public void setAudioType(@NonNull AudioType audioType) {
+ setValue(KEY_AUDIO_TYPE, audioType);
+ }
+
+ /**
+ * get the audiotype for AudioPassThru
+ * @return the audiotype for AudioPassThru
+ */
+ public AudioType getAudioType() {
+ return (AudioType) getObject(AudioType.class, KEY_AUDIO_TYPE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java
new file mode 100644
index 000000000..1596b851a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+
+import java.util.Hashtable;
+
+/** The status of the seat belts.
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>driverBeltDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The driver seat belt is deployed.</td>
+ * </tr>
+ * <tr>
+ * <td>passengerBeltDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The passenger seat belt is deployed.</td>
+ * </tr>
+ * <tr>
+ * <td>passengerBuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The passenger seat belt is buckled.</td>
+ * </tr>
+ * <tr>
+ * <td>driverBuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The driver seat belt is buckled.</td>
+ * </tr>
+ * <tr>
+ * <td>leftRow2BuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The left seat belt of the 2nd row is buckled.</td>
+ * </tr>
+ * <tr>
+ * <td>passengerChildDetected</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The child passenger is detected.</td>
+ * </tr>
+ * <tr>
+ * <td>rightRow2BuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The right seat belt of the 2nd row is buckled.</td>
+ * </tr>
+ * <tr>
+ * <td>middleRow2BuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The middle seat belt of the 2nd row is buckled.</td>
+ * </tr>
+ * <tr>
+ * <td>middleRow3BuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The middle seat belt of the 3rd row is buckled.</td>
+ * </tr>
+ * <tr>
+ * <td>leftRow3BuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The left seat belt of the 3rd row is buckled.</td>
+ * </tr>
+ * <tr>
+ * <td>rightRow3BuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The right seat belt of the 3rd row is buckled.</td>
+ * </tr>
+ * <tr>
+ * <td>leftRearInflatableBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The left rear inflatable is belted.</td>
+ * </tr>
+ * <tr>
+ * <td>rightRearInflatableBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The right rear inflatable is belted.</td>
+ * </tr>
+ * <tr>
+ * <td>middleRow1BeltDeployed</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The seat belt of the middle row is deployed.</td>
+ * </tr>
+ * <tr>
+ * <td>middleRow1BuckleBelted</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td>false</td>
+ * <td>The seat belt of the middle row is buckled.</td>
+ * </tr>
+ * </table>
+* @since SmartDeviceLink 2.0
+* @see VehicleDataEventStatus
+* @see GetVehicleData
+* @see OnVehicleData
+ * @see SubscribeVehicleData
+ */
+
+public class BeltStatus extends RPCStruct {
+ public static final String KEY_DRIVER_BELT_DEPLOYED = "driverBeltDeployed";
+ public static final String KEY_PASSENGER_BELT_DEPLOYED = "passengerBeltDeployed";
+ public static final String KEY_PASSENGER_BUCKLE_BELTED = "passengerBuckleBelted";
+ public static final String KEY_DRIVER_BUCKLE_BELTED = "driverBuckleBelted";
+ public static final String KEY_LEFT_ROW_2_BUCKLE_BELTED = "leftRow2BuckleBelted";
+ public static final String KEY_PASSENGER_CHILD_DETECTED = "passengerChildDetected";
+ public static final String KEY_RIGHT_ROW_2_BUCKLE_BELTED = "rightRow2BuckleBelted";
+ public static final String KEY_MIDDLE_ROW_2_BUCKLE_BELTED = "middleRow2BuckleBelted";
+ public static final String KEY_MIDDLE_ROW_3_BUCKLE_BELTED = "middleRow3BuckleBelted";
+ public static final String KEY_LEFT_ROW_3_BUCKLE_BELTED = "leftRow3BuckleBelted";
+
+ public static final String KEY_RIGHT_ROW_3_BUCKLE_BELTED = "rightRow3BuckleBelted";
+ public static final String KEY_REAR_INFLATABLE_BELTED = "rearInflatableBelted";
+ public static final String KEY_RIGHT_REAR_INFLATABLE_BELTED = "rightRearInflatableBelted";
+ public static final String KEY_MIDDLE_ROW_1_BELT_DEPLOYED = "middleRow1BeltDeployed";
+ public static final String KEY_MIDDLE_ROW_1_BUCKLE_BELTED = "middleRow1BuckleBelted";
+
+ public BeltStatus() { }
+
+ /** Constructs a new BeltStatus object indicated by the Hashtable
+ * parameter
+ * @param hash hashtable filled with params to create an instance of this RPC
+ * The hash table to use
+ */
+ public BeltStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public BeltStatus(@NonNull VehicleDataEventStatus driverBeltDeployed, @NonNull VehicleDataEventStatus passengerBeltDeployed, @NonNull VehicleDataEventStatus passengerBuckleBelted,
+ @NonNull VehicleDataEventStatus driverBuckleBelted, @NonNull VehicleDataEventStatus leftRow2BuckleBelted, @NonNull VehicleDataEventStatus passengerChildDetected,
+ @NonNull VehicleDataEventStatus rightRow2BuckleBelted, @NonNull VehicleDataEventStatus middleRow2BuckleBelted, @NonNull VehicleDataEventStatus middleRow3BuckleBelted,
+ @NonNull VehicleDataEventStatus leftRow3BuckleBelted, @NonNull VehicleDataEventStatus rightRow3BuckleBelted, @NonNull VehicleDataEventStatus leftRearInflatableBelted,
+ @NonNull VehicleDataEventStatus rightRearInflatableBelted, @NonNull VehicleDataEventStatus middleRow1BeltDeployed, @NonNull VehicleDataEventStatus middleRow1BuckleBelted
+ ) {
+ this();
+ setDriverBeltDeployed(driverBeltDeployed);
+ setPassengerBeltDeployed(passengerBeltDeployed);
+ setPassengerBuckleBelted(passengerBuckleBelted);
+ setDriverBuckleBelted(driverBuckleBelted);
+ setLeftRow2BuckleBelted(leftRow2BuckleBelted);
+ setPassengerChildDetected(passengerChildDetected);
+ setRightRow2BuckleBelted(rightRow2BuckleBelted);
+ setMiddleRow2BuckleBelted(middleRow2BuckleBelted);
+ setMiddleRow3BuckleBelted(middleRow3BuckleBelted);
+ setLeftRow3BuckleBelted(leftRow3BuckleBelted);
+ setRightRow3BuckleBelted(rightRow3BuckleBelted);
+ setLeftRearInflatableBelted(leftRearInflatableBelted);
+ setRightRearInflatableBelted(rightRearInflatableBelted);
+ setMiddleRow1BeltDeployed(middleRow1BeltDeployed);
+ setMiddleRow1BuckleBelted(middleRow1BuckleBelted);
+ }
+
+ public void setDriverBeltDeployed(@NonNull VehicleDataEventStatus driverBeltDeployed) {
+ setValue(KEY_DRIVER_BELT_DEPLOYED, driverBeltDeployed);
+ }
+ public VehicleDataEventStatus getDriverBeltDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BELT_DEPLOYED);
+ }
+ public void setPassengerBeltDeployed(@NonNull VehicleDataEventStatus passengerBeltDeployed) {
+ setValue(KEY_PASSENGER_BELT_DEPLOYED, passengerBeltDeployed);
+ }
+ public VehicleDataEventStatus getPassengerBeltDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_BELT_DEPLOYED);
+ }
+ public void setPassengerBuckleBelted(@NonNull VehicleDataEventStatus passengerBuckleBelted) {
+ setValue(KEY_PASSENGER_BUCKLE_BELTED, passengerBuckleBelted);
+ }
+ public VehicleDataEventStatus getPassengerBuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_BUCKLE_BELTED);
+ }
+ public void setDriverBuckleBelted(VehicleDataEventStatus driverBuckleBelted) {
+ setValue(KEY_DRIVER_BUCKLE_BELTED, driverBuckleBelted);
+ }
+ public VehicleDataEventStatus getDriverBuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BUCKLE_BELTED);
+ }
+ public void setLeftRow2BuckleBelted(VehicleDataEventStatus leftRow2BuckleBelted) {
+ setValue(KEY_LEFT_ROW_2_BUCKLE_BELTED, leftRow2BuckleBelted);
+ }
+ public VehicleDataEventStatus getLeftRow2BuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_LEFT_ROW_2_BUCKLE_BELTED);
+ }
+ public void setPassengerChildDetected(@NonNull VehicleDataEventStatus passengerChildDetected) {
+ setValue(KEY_PASSENGER_CHILD_DETECTED, passengerChildDetected);
+ }
+ public VehicleDataEventStatus getPassengerChildDetected() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_CHILD_DETECTED);
+ }
+ public void setRightRow2BuckleBelted(@NonNull VehicleDataEventStatus rightRow2BuckleBelted) {
+ setValue(KEY_RIGHT_ROW_2_BUCKLE_BELTED, rightRow2BuckleBelted);
+ }
+ public VehicleDataEventStatus getRightRow2BuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_ROW_2_BUCKLE_BELTED);
+ }
+ public void setMiddleRow2BuckleBelted(@NonNull VehicleDataEventStatus middleRow2BuckleBelted) {
+ setValue(KEY_MIDDLE_ROW_2_BUCKLE_BELTED, middleRow2BuckleBelted);
+ }
+ public VehicleDataEventStatus getMiddleRow2BuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_2_BUCKLE_BELTED);
+ }
+ public void setMiddleRow3BuckleBelted(@NonNull VehicleDataEventStatus middleRow3BuckleBelted) {
+ setValue(KEY_MIDDLE_ROW_3_BUCKLE_BELTED, middleRow3BuckleBelted);
+ }
+ public VehicleDataEventStatus getMiddleRow3BuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_3_BUCKLE_BELTED);
+ }
+ public void setLeftRow3BuckleBelted(@NonNull VehicleDataEventStatus leftRow3BuckleBelted) {
+ setValue(KEY_LEFT_ROW_3_BUCKLE_BELTED, leftRow3BuckleBelted);
+ }
+ public VehicleDataEventStatus getLeftRow3BuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_LEFT_ROW_3_BUCKLE_BELTED);
+ }
+ public void setRightRow3BuckleBelted(@NonNull VehicleDataEventStatus rightRow3BuckleBelted) {
+ setValue(KEY_RIGHT_ROW_3_BUCKLE_BELTED, rightRow3BuckleBelted);
+ }
+ public VehicleDataEventStatus getRightRow3BuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_ROW_3_BUCKLE_BELTED);
+ }
+ public void setLeftRearInflatableBelted(@NonNull VehicleDataEventStatus rearInflatableBelted) {
+ setValue(KEY_REAR_INFLATABLE_BELTED, rearInflatableBelted);
+ }
+ public VehicleDataEventStatus getLeftRearInflatableBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_REAR_INFLATABLE_BELTED);
+ }
+ public void setRightRearInflatableBelted(@NonNull VehicleDataEventStatus rightRearInflatableBelted) {
+ setValue(KEY_RIGHT_REAR_INFLATABLE_BELTED, rightRearInflatableBelted);
+ }
+ public VehicleDataEventStatus getRightRearInflatableBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_REAR_INFLATABLE_BELTED);
+ }
+ public void setMiddleRow1BeltDeployed(@NonNull VehicleDataEventStatus middleRow1BeltDeployed) {
+ setValue(KEY_MIDDLE_ROW_1_BELT_DEPLOYED, middleRow1BeltDeployed);
+ }
+ public VehicleDataEventStatus getMiddleRow1BeltDeployed() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_1_BELT_DEPLOYED);
+ }
+ public void setMiddleRow1BuckleBelted(@NonNull VehicleDataEventStatus middleRow1BuckleBelted) {
+ setValue(KEY_MIDDLE_ROW_1_BUCKLE_BELTED, middleRow1BuckleBelted);
+ }
+ public VehicleDataEventStatus getMiddleRow1BuckleBelted() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_1_BUCKLE_BELTED);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java
new file mode 100644
index 000000000..4dfb7ec5d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
+
+import java.util.Hashtable;
+
+/** The body information including power modes.
+ *
+ * <p><b>Note:</b> The structure defines the information about the park brake and ignition.</p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th>Description</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>parkBrakeActive</td>
+ * <td>Boolean</td>
+ * <td>true</td>
+ * <td>Describes, if the parkbreak is active. The information about the park brake: - true, if active - false if not.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>ignitionStableStatus</td>
+ * <td>IgnitionStableStatus</td>
+ * <td>true</td>
+ * <td>Describes, if the ignition situation is considered stableThe information about stability of the ignition switch. See {@linkplain IgnitionStableStatus}</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>ignitionStatus</td>
+ * <td>IgnitionStatus</td>
+ * <td>true</td>
+ * <td>The information about ignition status. See {@linkplain IgnitionStatus}</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>parkBrakeActive</td>
+ * <td>Boolean</td>
+ * <td>true</td>
+ * <td>The information about the park brake: - true, if active - false if not.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>driverDoorAjar</td>
+ * <td>Boolean</td>
+ * <td>true</td>
+ * <td>The information about the park brake: - true, if active - false if not.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>passengerDoorAjar</td>
+ * <td>Boolean</td>
+ * <td>true</td>
+ * <td>The information about the park brake: - true, if active - false if not.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>rearLeftDoorAjar</td>
+ * <td>Boolean</td>
+ * <td>true</td>
+ * <td>The information about the park brake: - true, if active - false if not.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>rearRightDoorAjar</td>
+ * <td>Boolean</td>
+ * <td>true</td>
+ * <td>References signal "DrStatRr_B_Actl".</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * </table>
+ * @since SmartDeviceLink 2.0
+ * @see SubscribeVehicleData
+ * @see GetVehicleData
+ * @see OnVehicleData
+ *
+ */
+
+public class BodyInformation extends RPCStruct {
+ public static final String KEY_PARK_BRAKE_ACTIVE = "parkBrakeActive";
+ public static final String KEY_IGNITION_STABLE_STATUS = "ignitionStableStatus";
+ public static final String KEY_IGNITION_STATUS = "ignitionStatus";
+ public static final String KEY_DRIVER_DOOR_AJAR = "driverDoorAjar";
+ public static final String KEY_PASSENGER_DOOR_AJAR = "passengerDoorAjar";
+ public static final String KEY_REAR_LEFT_DOOR_AJAR = "rearLeftDoorAjar";
+ public static final String KEY_REAR_RIGHT_DOOR_AJAR = "rearRightDoorAjar";
+
+ public BodyInformation() { }
+
+ /** Constructs a new BodyInformation object indicated by the Hashtable
+ * parameter
+ * @param hash hashtable filled with params to create an instance of this RPC
+ * The hash table to use
+ */
+ public BodyInformation(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ public BodyInformation(@NonNull Boolean parkBrakeActive, @NonNull IgnitionStableStatus ignitionStableStatus, @NonNull IgnitionStatus ignitionStatus) {
+ this();
+ setParkBrakeActive(parkBrakeActive);
+ setIgnitionStableStatus(ignitionStableStatus);
+ setIgnitionStatus(ignitionStatus);
+ }
+ public void setParkBrakeActive(@NonNull Boolean parkBrakeActive) {
+ setValue(KEY_PARK_BRAKE_ACTIVE, parkBrakeActive);
+ }
+ public Boolean getParkBrakeActive() {
+ return getBoolean(KEY_PARK_BRAKE_ACTIVE);
+ }
+ public void setIgnitionStableStatus(@NonNull IgnitionStableStatus ignitionStableStatus) {
+ setValue(KEY_IGNITION_STABLE_STATUS, ignitionStableStatus);
+ }
+ public IgnitionStableStatus getIgnitionStableStatus() {
+ return (IgnitionStableStatus) getObject(IgnitionStableStatus.class, KEY_IGNITION_STABLE_STATUS);
+ }
+ public void setIgnitionStatus(@NonNull IgnitionStatus ignitionStatus) {
+ setValue(KEY_IGNITION_STATUS, ignitionStatus);
+ }
+ public IgnitionStatus getIgnitionStatus() {
+ return (IgnitionStatus) getObject(IgnitionStatus.class, KEY_IGNITION_STATUS);
+ }
+
+ public void setDriverDoorAjar(Boolean driverDoorAjar) {
+ setValue(KEY_DRIVER_DOOR_AJAR, driverDoorAjar);
+ }
+ public Boolean getDriverDoorAjar() {
+ return getBoolean(KEY_DRIVER_DOOR_AJAR);
+ }
+
+
+ public void setPassengerDoorAjar(Boolean passengerDoorAjar) {
+ setValue(KEY_PASSENGER_DOOR_AJAR, passengerDoorAjar);
+ }
+ public Boolean getPassengerDoorAjar() {
+ return getBoolean(KEY_PASSENGER_DOOR_AJAR);
+ }
+
+ public void setRearLeftDoorAjar(Boolean rearLeftDoorAjar) {
+ setValue(KEY_REAR_LEFT_DOOR_AJAR, rearLeftDoorAjar);
+ }
+ public Boolean getRearLeftDoorAjar() {
+ return getBoolean(KEY_REAR_LEFT_DOOR_AJAR);
+ }
+
+ public void setRearRightDoorAjar(Boolean rearRightDoorAjar) {
+ setValue(KEY_REAR_RIGHT_DOOR_AJAR, rearRightDoorAjar);
+ }
+ public Boolean getRearRightDoorAjar() {
+ return getBoolean(KEY_REAR_RIGHT_DOOR_AJAR);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java
new file mode 100644
index 000000000..b92d3ef16
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+
+import java.util.Hashtable;
+
+/**
+ * Provides information about the capabilities of a SDL HMI button.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>name</td>
+ * <td>ButtonName</td>
+ * <td>The name of theSDL HMI button.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>shortPressAvailable</td>
+ * <td>Boolean</td>
+ * <td>The button supports a SHORT press. See {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode} for more information.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>longPressAvailable</td>
+ * <td>Boolean</td>
+ * <td>The button supports a LONG press. See {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode} for more information.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>upDownAvailable</td>
+ * <td>Boolean</td>
+ * <td>The button supports "button down" and "button up". When the button is depressed, the <i>{@linkplain OnButtonEvent}</i> notification will be invoked with a value of BUTTONDOWN.
+ * <p> When the button is released, the <i>{@linkplain OnButtonEvent}</i> notification will be invoked with a value of BUTTONUP.</p></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ *
+ * <p>Upon the request HMI must provide the list of the following information:</p>
+ * <p>The names of all existing/supported hardware buttons.</p>
+ * <p>The availability of LONG/SHORT press for each existing/supported hardware button correspondingly</p>
+ * <p>The availability of UP/DOWN events for each existing/supported hardware button correspondingly.</p>
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ * @see ButtonName
+ * @see com.smartdevicelink.proxy.rpc.enums.ButtonEventMode
+ * @see com.smartdevicelink.proxy.rpc.enums.ButtonPressMode
+ *
+ *
+ *
+ * @see OnButtonEvent
+ * @see OnButtonPress
+ *
+ */
+public class ButtonCapabilities extends RPCStruct {
+ public static final String KEY_NAME = "name";
+ public static final String KEY_SHORT_PRESS_AVAILABLE = "shortPressAvailable";
+ public static final String KEY_LONG_PRESS_AVAILABLE = "longPressAvailable";
+ public static final String KEY_UP_DOWN_AVAILABLE = "upDownAvailable";
+ /**
+ * Constructs a newly allocated ButtonCapabilities object
+ */
+ public ButtonCapabilities() { }
+ /**
+ * Constructs a newly allocated ButtonCapabilities object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public ButtonCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a newly allocated ButtonCapabilities object
+ * @param name the name of button
+ * @param shortPressAvailable True if support otherwise False.
+ * @param longPressAvailable True if support otherwise False.
+ * @param upDownAvailable True if support otherwise False.
+ */
+ public ButtonCapabilities(@NonNull ButtonName name, @NonNull Boolean shortPressAvailable, @NonNull Boolean longPressAvailable, @NonNull Boolean upDownAvailable) {
+ this();
+ setName(name);
+ setShortPressAvailable(shortPressAvailable);
+ setLongPressAvailable(longPressAvailable);
+ setUpDownAvailable(upDownAvailable);
+ }
+ /**
+ * Get the name of theSDL HMI button.
+ * @return ButtonName the name of the Button
+ */
+ public ButtonName getName() {
+ return (ButtonName) getObject(ButtonName.class, KEY_NAME);
+ }
+ /**
+ * Set the name of theSDL HMI button.
+ * @param name the name of button
+ */
+ public void setName( @NonNull ButtonName name ) {
+ setValue(KEY_NAME, name);
+ }
+ /**
+ * Whether the button supports a SHORT press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
+ * @return True if support otherwise False.
+ */
+ public Boolean getShortPressAvailable() {
+ return getBoolean( KEY_SHORT_PRESS_AVAILABLE );
+ }
+ /**
+ * Set the button supports a SHORT press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
+ * @param shortPressAvailable True if support otherwise False.
+ */
+ public void setShortPressAvailable( @NonNull Boolean shortPressAvailable ) {
+ setValue(KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable);
+ }
+ /**
+ * Whether the button supports a LONG press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
+ * @return True if support otherwise False.
+ */
+ public Boolean getLongPressAvailable() {
+ return getBoolean( KEY_LONG_PRESS_AVAILABLE );
+ }
+ /**
+ * Set the button supports a LONG press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
+ * @param longPressAvailable True if support otherwise False.
+ */
+ public void setLongPressAvailable( @NonNull Boolean longPressAvailable ) {
+ setValue(KEY_LONG_PRESS_AVAILABLE, longPressAvailable);
+ }
+ /**
+ * Whether the button supports "button down" and "button up". When the button is depressed, the <i>{@linkplain OnButtonEvent}</i> notification will be invoked with a value of BUTTONDOWN.
+ * @return True if support otherwise False.
+ */
+ public Boolean getUpDownAvailable() {
+ return getBoolean( KEY_UP_DOWN_AVAILABLE );
+ }
+ /**
+ * Set the button supports "button down" and "button up". When the button is depressed, the <i>{@linkplain OnButtonEvent}</i> notification will be invoked with a value of BUTTONDOWN.
+ * @param upDownAvailable True if support otherwise False.
+ */
+ public void setUpDownAvailable( @NonNull Boolean upDownAvailable ) {
+ setValue(KEY_UP_DOWN_AVAILABLE, upDownAvailable);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java
new file mode 100644
index 000000000..2272198be
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
+import com.smartdevicelink.proxy.rpc.enums.ModuleType;
+
+import java.util.Hashtable;
+
+/**
+ * This function allows a remote control type mobile application
+ * simulate a hardware button press event.
+ */
+public class ButtonPress extends RPCRequest {
+ public static final String KEY_MODULE_TYPE = "moduleType";
+ public static final String KEY_BUTTON_NAME = "buttonName";
+ public static final String KEY_BUTTON_PRESS_MODE = "buttonPressMode";
+
+ /**
+ * Constructs a new ButtonPress object
+ */
+ public ButtonPress() {
+ super(FunctionID.BUTTON_PRESS.toString());
+ }
+
+ /**
+ * <p>Constructs a new ButtonPress object indicated by the
+ * Hashtable parameter</p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public ButtonPress(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ButtonPress object
+ * @param moduleType Represents module where the button should be pressed
+ * @param buttonName Represents name of supported RC climate or radio button
+ * @param buttonPressMode Indicates whether this is a LONG or SHORT button press event.
+ */
+ public ButtonPress(@NonNull ModuleType moduleType, @NonNull ButtonName buttonName, @NonNull ButtonPressMode buttonPressMode) {
+ this();
+ setModuleType(moduleType);
+ setButtonName(buttonName);
+ setButtonPressMode(buttonPressMode);
+ }
+
+ /**
+ * Gets the ModuleType
+ *
+ * @return ModuleType - The module where the button should be pressed
+ */
+ public ModuleType getModuleType() {
+ return (ModuleType) getObject(ModuleType.class, KEY_MODULE_TYPE);
+ }
+
+ /**
+ * Sets a ModuleType
+ *
+ * @param moduleType
+ * Represents module where the button should be pressed
+ */
+ public void setModuleType(@NonNull ModuleType moduleType) {
+ setParameters(KEY_MODULE_TYPE, moduleType);
+ }
+
+ /**
+ * Gets the ButtonName
+ *
+ * @return ButtonName - The name of supported RC climate or radio button
+ */
+ public ButtonName getButtonName() {
+ return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
+ }
+
+ /**
+ * Sets a ButtonName
+ *
+ * @param buttonName
+ * Represents name of supported RC climate or radio button
+ */
+ public void setButtonName(@NonNull ButtonName buttonName) {
+ setParameters(KEY_BUTTON_NAME, buttonName);
+ }
+
+ /**
+ * Gets the ButtonPressMode
+ *
+ * @return ButtonPressMode - Indicates whether this is a LONG or SHORT button press event.
+ */
+ public ButtonPressMode getButtonPressMode() {
+ return (ButtonPressMode) getObject(ButtonPressMode.class, KEY_BUTTON_PRESS_MODE);
+ }
+
+ /**
+ * Sets a ButtonPressMode
+ *
+ * @param buttonPressMode
+ * Indicates whether this is a LONG or SHORT button press event.
+ */
+ public void setButtonPressMode(@NonNull ButtonPressMode buttonPressMode) {
+ setParameters(KEY_BUTTON_PRESS_MODE, buttonPressMode);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java
new file mode 100644
index 000000000..2caa1f5f7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class ButtonPressResponse extends RPCResponse {
+
+ /**
+ * Constructs a new ButtonPressResponse object
+ */
+ public ButtonPressResponse() {
+ super(FunctionID.BUTTON_PRESS.toString());
+ }
+
+ /**
+ * <p>Constructs a new ButtonPressResponse object indicated by the
+ * Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public ButtonPressResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new ButtonPressResponse object
+ * @param resultCode whether the request is successfully processed
+ * @param success whether the request is successfully processed
+ */
+ public ButtonPressResponse(@NonNull Result resultCode, @NonNull Boolean success) {
+ this();
+ setResultCode(resultCode);
+ setSuccess(success);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java
new file mode 100644
index 000000000..1dfe21e57
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java
@@ -0,0 +1,297 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * If the app recognizes during the app registration that the SDL HMI language
+ * (voice/TTS and/or display) does not match the app language, the app will be
+ * able (but does not need) to change this registration with changeRegistration
+ * prior to app being brought into focus.
+ *
+ * <p>Function Group: Base</p>
+ *
+ * <p><b>HMILevel can by any</b></p>
+ *
+ * <b>Note:</b>
+ *
+ * <p>SDL will send the language value confirmed to be supported by HMI via UI.GetCapabilities.</p>
+ * <p><b> Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>Language</td>
+ * <td>Language</td>
+ * <td>Requested SDL voice engine (VR+TTS) language registration.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>hmiDisplayLanguage</td>
+ * <td>Language</td>
+ * <td>Request display language registration.</td>
+ * <td>Y</td>
+ * <td>Minvalue=0; Maxvalue=2000000000</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>appName</td>
+ * <td>String</td>
+ * <td>Request new app name registration</td>
+ * <td>N</td>
+ * <td>maxlength:100</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>ttsName</td>
+ * <td>TTSChunk</td>
+ * <td>Request new ttsName registration</td>
+ * <td>N</td>
+ * <td>minsize:1; maxsize:100</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>ngnMediaScreenAppName</td>
+ * <td>String</td>
+ * <td>Request new app short name registration</td>
+ * <td>N</td>
+ * <td>maxlength: 100</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>vrSynonyms</td>
+ * <td>String</td>
+ * <td>Request new VR synonyms registration</td>
+ * <td>N</td>
+ * <td>maxlength: 40; minsize:1; maxsize:100</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ *
+ * <p><b>Response </b></p>
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ * <p>DISALLOWED</p>
+ *
+ * @since SmartDeviceLink 2.0
+ * @see RegisterAppInterface
+ */
+public class ChangeRegistration extends RPCRequest {
+ public static final String KEY_LANGUAGE = "language";
+ public static final String KEY_HMI_DISPLAY_LANGUAGE = "hmiDisplayLanguage";
+ public static final String KEY_APP_NAME = "appName";
+ public static final String KEY_TTS_NAME = "ttsName";
+ public static final String KEY_NGN_MEDIA_SCREEN_NAME = "ngnMediaScreenAppName";
+ public static final String KEY_VR_SYNONYMS = "vrSynonyms";
+
+ /**
+ * Constructs a new ChangeRegistration object
+ */
+ public ChangeRegistration() {
+ super(FunctionID.CHANGE_REGISTRATION.toString());
+ }
+
+ /**
+ * <p>Constructs a new ChangeRegistration object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public ChangeRegistration(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ChangeRegistration object
+ * @param language a language value
+ * @param hmiDisplayLanguage a Language value
+ */
+ public ChangeRegistration(@NonNull Language language, @NonNull Language hmiDisplayLanguage) {
+ this();
+ setLanguage(language);
+ setHmiDisplayLanguage(hmiDisplayLanguage);
+ }
+
+ /**
+ * Sets language
+ *
+ * @param language
+ * a language value
+ */
+ public void setLanguage(@NonNull Language language) {
+ setParameters(KEY_LANGUAGE, language);
+ }
+
+ /**
+ * Gets language
+ *
+ * @return Language -a Language value
+ */
+ public Language getLanguage() {
+ return (Language) getObject(Language.class, KEY_LANGUAGE);
+ }
+
+ /**
+ * Sets HMI display language
+ *
+ * @param hmiDisplayLanguage
+ * a Language value
+ */
+ public void setHmiDisplayLanguage(@NonNull Language hmiDisplayLanguage) {
+ setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
+ }
+
+ /**
+ * Gets HMI display language
+ *
+ * @return Language -a Language value
+ */
+ public Language getHmiDisplayLanguage() {
+ return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE);
+ }
+
+ /**
+ * Sets app name
+ *
+ * @param appName App name to set
+ */
+ public void setAppName(String appName){
+ setParameters(KEY_APP_NAME, appName);
+ }
+
+ /**
+ * Gets app name
+ *
+ * @return The app name
+ */
+ public String getAppName(){
+ return getString(KEY_APP_NAME);
+ }
+
+ /**
+ * Sets NGN media screen app name
+ *
+ * @param ngnAppName The NGN app name
+ */
+ public void setNgnMediaScreenAppName(String ngnAppName){
+ setParameters(KEY_NGN_MEDIA_SCREEN_NAME, ngnAppName);
+ }
+
+ /**
+ * Gets NGN media screen app name
+ *
+ * @return The NGN app name
+ */
+ public String getNgnMediaScreenAppName(){
+ return getString(KEY_NGN_MEDIA_SCREEN_NAME);
+ }
+
+ /**
+ * Sets the TTS name
+ *
+ * @param ttsName The TTS name to set
+ */
+ public void setTtsName(List<TTSChunk> ttsName){
+ setParameters(KEY_TTS_NAME, ttsName);
+ }
+
+ /**
+ * Gets the TTS name
+ *
+ * @return The TTS name
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getTtsName(){
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_NAME);
+ }
+
+ /**
+ * Gets the List<String> representing the an array of 1-100 elements, each
+ * element containing a voice-recognition synonym
+ *
+ * @return List<String> -a List value representing the an array of
+ * 1-100 elements, each element containing a voice-recognition
+ * synonym
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getVrSynonyms() {
+ return (List<String>) getObject(String.class, KEY_VR_SYNONYMS);
+ }
+
+ /**
+ * Sets a vrSynonyms representing the an array of 1-100 elements, each
+ * element containing a voice-recognition synonym
+ *
+ * @param vrSynonyms
+ * a List<String> value representing the an array of 1-100
+ * elements
+ * <p>
+ * <b>Notes: </b></p>
+ * <ul>
+ * <li>Each vr synonym is limited to 40 characters, and there can
+ * be 1-100 synonyms in array</li>
+ * <li>May not be the same (by case insensitive comparison) as
+ * the name or any synonym of any currently-registered
+ * application</li>
+ * </ul>
+ */
+ public void setVrSynonyms(List<String> vrSynonyms) {
+ setParameters(KEY_VR_SYNONYMS, vrSynonyms);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java
new file mode 100644
index 000000000..a141680eb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Change Registration Response is sent, when ChangeRegistration has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class ChangeRegistrationResponse extends RPCResponse {
+
+ /**
+ * Constructs a new ChangeRegistrationResponse object
+ */
+ public ChangeRegistrationResponse() {
+ super(FunctionID.CHANGE_REGISTRATION.toString());
+ }
+
+ /**
+ * <p>Constructs a new ChangeRegistrationResponse object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public ChangeRegistrationResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ChangeRegistrationResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public ChangeRegistrationResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
new file mode 100644
index 000000000..8c59eb99c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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;
+
+/**
+ * A choice is an option which a user can select either via the menu or via voice recognition (VR) during an application initiated interaction.
+ * For example, the application may request for the user`s choice among several suggested ones: Yes, No, Skip.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>choiceID</td>
+ * <td>Integer</td>
+ * <td>Application-scoped identifier that uniquely identifies this choice.
+ * Min: 0;
+ * Max: 65535
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>menuName</td>
+ * <td>String</td>
+ * <td>Text which appears in menu, representing this choice.
+ * Min: 1;
+ * Max: 100
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>vrCommands</td>
+ * <td>String[]</td>
+ * <td>An array of strings to be used as VR synonyms for this choice. If this array is provided, it must have at least one non-empty element</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>image</td>
+ * <td>Image</td>
+ * <td>Either a static hex icon value or a binary image file name identifier (sent by PutFile).</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ * @see AddCommand
+ * @see PerformInteraction
+ * @see Image
+ */
+public class Choice extends RPCStruct {
+ public static final String KEY_SECONDARY_TEXT = "secondaryText";
+ public static final String KEY_TERTIARY_TEXT = "tertiaryText";
+ public static final String KEY_SECONDARY_IMAGE = "secondaryImage";
+ public static final String KEY_MENU_NAME = "menuName";
+ 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
+ */
+ 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
+ */
+ public Integer getChoiceID() {
+ return getInteger(KEY_CHOICE_ID);
+ }
+ /**
+ * Set the application-scoped identifier that uniquely identifies this choice.
+ * @param choiceID Min: 0 Max: 65535
+ */
+ public void setChoiceID(@NonNull Integer choiceID) {
+ setValue(KEY_CHOICE_ID, choiceID);
+ }
+ /**
+ * Text which appears in menu, representing this choice.
+ * Min: 1;
+ * Max: 100
+ * @return menuName the menu name
+ */
+ public String getMenuName() {
+ return getString(KEY_MENU_NAME);
+ }
+ /**
+ * Text which appears in menu, representing this choice.
+ * Min: 1;
+ * Max: 100
+ * @param menuName the menu name
+ */
+ public void setMenuName(@NonNull String menuName) {
+ setValue(KEY_MENU_NAME, menuName);
+ }
+ /**
+ * Get an array of strings to be used as VR synonyms for this choice. If this array is provided, it must have at least one non-empty element
+ * @return vrCommands List
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getVrCommands() {
+ return (List<String>) getObject(String.class, KEY_VR_COMMANDS);
+ }
+ /**
+ * Set an array of strings to be used as VR synonyms for this choice. If this array is provided, it must have at least one non-empty element
+ * @param vrCommands the List of vrCommands
+ * @since SmartDeviceLink 2.0
+ */
+ public void setVrCommands(List<String> vrCommands) {
+ setValue(KEY_VR_COMMANDS, vrCommands);
+ }
+ /**
+ * Set the image
+ * @param image the image of the choice
+ */
+ public void setImage(Image image) {
+ setValue(KEY_IMAGE, image);
+ }
+ /**
+ * Get the image
+ * @return the image of the choice
+ */
+ @SuppressWarnings("unchecked")
+ public Image getImage() {
+ return (Image) getObject(Image.class, KEY_IMAGE);
+ }
+
+ public String getSecondaryText() {
+ return getString(KEY_SECONDARY_TEXT);
+ }
+
+ public void setSecondaryText(String secondaryText) {
+ setValue(KEY_SECONDARY_TEXT, secondaryText);
+ }
+
+ public String getTertiaryText() {
+ return getString(KEY_TERTIARY_TEXT);
+ }
+
+ public void setTertiaryText(String tertiaryText) {
+ setValue(KEY_TERTIARY_TEXT, tertiaryText);
+ }
+
+ public void setSecondaryImage(Image image) {
+ setValue(KEY_SECONDARY_IMAGE, image);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Image getSecondaryImage() {
+ return (Image) getObject(Image.class, KEY_SECONDARY_IMAGE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
new file mode 100644
index 000000000..6961faf94
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
@@ -0,0 +1,406 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.DefrostZone;
+import com.smartdevicelink.proxy.rpc.enums.VentilationMode;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Contains information about a climate control module's capabilities.
+ */
+
+public class ClimateControlCapabilities extends RPCStruct{
+ public static final String KEY_MODULE_NAME= "moduleName";
+ public static final String KEY_FAN_SPEED_AVAILABLE= "fanSpeedAvailable";
+ public static final String KEY_DESIRED_TEMPERATURE_AVAILABLE= "desiredTemperatureAvailable";
+ public static final String KEY_AC_ENABLE_AVAILABLE= "acEnableAvailable";
+ public static final String KEY_AC_MAX_ENABLE_AVAILABLE= "acMaxEnableAvailable";
+ public static final String KEY_CIRCULATE_AIR_ENABLE_AVAILABLE= "circulateAirEnableAvailable";
+ public static final String KEY_AUTO_MODE_ENABLE_AVAILABLE= "autoModeEnableAvailable";
+ public static final String KEY_DUAL_MODE_ENABLE_AVAILABLE= "dualModeEnableAvailable";
+ public static final String KEY_DEFROST_ZONE_AVAILABLE= "defrostZoneAvailable";
+ 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() {
+ }
+
+ public ClimateControlCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated ClimateControlCapabilities
+ *
+ * @param moduleName The short friendly name of the climate control module. It should not be used to identify a module by mobile application.
+ */
+ public ClimateControlCapabilities(@NonNull String moduleName) {
+ this();
+ setModuleName(moduleName);
+ }
+
+ /**
+ * Sets the moduleName portion of the ClimateControlCapabilities class
+ *
+ * @param moduleName The short friendly name of the climate 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 ClimateControlCapabilities class
+ *
+ * @return String - Short friendly name of the climate control module.
+ */
+ public String getModuleName() {
+ return getString(KEY_MODULE_NAME);
+ }
+
+ /**
+ * Sets the fanSpeedAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param fanSpeedAvailable
+ * Availability of the control of fan speed.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setFanSpeedAvailable(Boolean fanSpeedAvailable) {
+ setValue(KEY_FAN_SPEED_AVAILABLE, fanSpeedAvailable);
+ }
+
+ /**
+ * Gets the fanSpeedAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of fan speed.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getFanSpeedAvailable() {
+ return getBoolean(KEY_FAN_SPEED_AVAILABLE);
+ }
+
+ /**
+ * Sets the desiredTemperatureAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param desiredTemperatureAvailable
+ * Availability of the control of desired temperature.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setDesiredTemperatureAvailable(Boolean desiredTemperatureAvailable) {
+ setValue(KEY_DESIRED_TEMPERATURE_AVAILABLE, desiredTemperatureAvailable);
+ }
+
+ /**
+ * Gets the desiredTemperatureAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of desired temperature.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getDesiredTemperatureAvailable() {
+ return getBoolean(KEY_DESIRED_TEMPERATURE_AVAILABLE);
+ }
+
+ /**
+ * Sets the acEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param acEnableAvailable
+ * Availability of the control of turn on/off AC.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setAcEnableAvailable(Boolean acEnableAvailable) {
+ setValue(KEY_AC_ENABLE_AVAILABLE, acEnableAvailable);
+ }
+
+ /**
+ * Gets the acEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of turn on/off AC.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getAcEnableAvailable() {
+ return getBoolean(KEY_AC_ENABLE_AVAILABLE);
+ }
+
+ /**
+ * Sets the acMaxEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param acMaxEnableAvailable
+ * Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setAcMaxEnableAvailable(Boolean acMaxEnableAvailable) {
+ setValue(KEY_AC_MAX_ENABLE_AVAILABLE, acMaxEnableAvailable);
+ }
+
+ /**
+ * Gets the acMaxEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getAcMaxEnableAvailable() {
+ return getBoolean(KEY_AC_MAX_ENABLE_AVAILABLE);
+ }
+
+ /**
+ * Sets the circulateAirEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param circulateAirEnableAvailable
+ * Availability of the control of enable/disable circulate Air mode.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setCirculateAirEnableAvailable(Boolean circulateAirEnableAvailable) {
+ setValue(KEY_CIRCULATE_AIR_ENABLE_AVAILABLE, circulateAirEnableAvailable);
+ }
+
+ /**
+ * Gets the circulateAirEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of enable/disable circulate Air mode.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getCirculateAirEnableAvailable() {
+ return getBoolean(KEY_CIRCULATE_AIR_ENABLE_AVAILABLE);
+ }
+
+ /**
+ * Sets the autoModeEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param autoModeEnableAvailable
+ * Availability of the control of enable/disable auto mode.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setAutoModeEnableAvailable(Boolean autoModeEnableAvailable) {
+ setValue(KEY_AUTO_MODE_ENABLE_AVAILABLE, autoModeEnableAvailable);
+ }
+
+ /**
+ * Gets the autoModeEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of enable/disable auto mode.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getAutoModeEnableAvailable() {
+ return getBoolean(KEY_AUTO_MODE_ENABLE_AVAILABLE);
+ }
+
+ /**
+ * Sets the dualModeEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param dualModeEnableAvailable
+ * Availability of the control of enable/disable dual mode.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setDualModeEnableAvailable(Boolean dualModeEnableAvailable) {
+ setValue(KEY_DUAL_MODE_ENABLE_AVAILABLE, dualModeEnableAvailable);
+ }
+
+ /**
+ * Gets the dualModeEnableAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of enable/disable dual mode.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getDualModeEnableAvailable() {
+ return getBoolean(KEY_DUAL_MODE_ENABLE_AVAILABLE);
+ }
+
+ /**
+ * Sets the defrostZoneAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param defrostZoneAvailable
+ * Availability of the control of defrost zones.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setDefrostZoneAvailable(Boolean defrostZoneAvailable) {
+ setValue(KEY_DEFROST_ZONE_AVAILABLE, defrostZoneAvailable);
+ }
+
+ /**
+ * Gets the defrostZoneAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of defrost zones.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getDefrostZoneAvailable() {
+ return getBoolean(KEY_DEFROST_ZONE_AVAILABLE);
+ }
+
+ /**
+ * Gets the List<DefrostZone> portion of the ClimateControlCapabilities class
+ *
+ * @return List<DefrostZone> - A set of all defrost zones that are controllable.
+ */
+ public List<DefrostZone> getDefrostZone() {
+ return (List<DefrostZone>) getObject(DefrostZone.class, KEY_DEFROST_ZONE);
+ }
+
+ /**
+ * Sets the defrostZone portion of the ClimateControlCapabilities class
+ *
+ * @param defrostZone
+ * A set of all defrost zones that are controllable.
+ */
+ public void setDefrostZone(List<DefrostZone> defrostZone) {
+ setValue(KEY_DEFROST_ZONE, defrostZone);
+ }
+
+ /**
+ * Sets the ventilationModeAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param ventilationModeAvailable
+ * Availability of the control of air ventilation mode.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setVentilationModeAvailable(Boolean ventilationModeAvailable) {
+ setValue(KEY_VENTILATION_MODE_AVAILABLE, ventilationModeAvailable);
+ }
+
+ /**
+ * Gets the ventilationModeAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of air ventilation mode.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getVentilationModeAvailable() {
+ return getBoolean(KEY_VENTILATION_MODE_AVAILABLE);
+ }
+
+ /**
+ * Gets the List<VentilationMode> portion of the ClimateControlCapabilities class
+ *
+ * @return List<VentilationMode> - A set of all ventilation modes that are controllable.
+ */
+ public List<VentilationMode> getVentilationMode() {
+ return (List<VentilationMode>) getObject(VentilationMode.class, KEY_VENTILATION_MODE);
+ }
+
+ /**
+ * Sets the ventilationMode portion of the ClimateControlCapabilities class
+ *
+ * @param ventilationMode
+ * A set of all ventilation modes that are controllable.
+ */
+ 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/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
new file mode 100644
index 000000000..4f9a8d09f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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{
+ public static final String KEY_FAN_SPEED= "fanSpeed";
+ public static final String KEY_CURRENT_TEMPERATURE= "currentTemperature";
+ public static final String KEY_DESIRED_TEMPERATURE= "desiredTemperature";
+ public static final String KEY_AC_ENABLE= "acEnable";
+ public static final String KEY_CIRCULATE_AIR_ENABLE= "circulateAirEnable";
+ public static final String KEY_AUTO_MODE_ENABLE= "autoModeEnable";
+ public static final String KEY_DEFROST_ZONE= "defrostZone";
+ 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() {
+ }
+
+ public ClimateControlData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public void setFanSpeed(Integer fanSpeed) {
+ setValue(KEY_FAN_SPEED, fanSpeed);
+ }
+
+ public Integer getFanSpeed() {
+ return getInteger(KEY_FAN_SPEED);
+ }
+
+ public void setCurrentTemperature(Temperature currentTemperature) {
+ setValue(KEY_CURRENT_TEMPERATURE, currentTemperature);
+ }
+
+ public Temperature getCurrentTemperature() {
+ return (Temperature) getObject(Temperature.class, KEY_CURRENT_TEMPERATURE);
+ }
+
+ public void setDesiredTemperature(Temperature desiredTemperature) {
+ setValue(KEY_DESIRED_TEMPERATURE, desiredTemperature);
+ }
+
+ public Temperature getDesiredTemperature() {
+ return (Temperature) getObject(Temperature.class, KEY_DESIRED_TEMPERATURE);
+ }
+
+ public void setAcEnable(Boolean acEnable) {
+ setValue(KEY_AC_ENABLE, acEnable);
+ }
+
+ public Boolean getAcEnable() {
+ return getBoolean(KEY_AC_ENABLE);
+ }
+
+ public void setCirculateAirEnable(Boolean circulateAirEnable) {
+ setValue(KEY_CIRCULATE_AIR_ENABLE, circulateAirEnable);
+ }
+
+ public Boolean getCirculateAirEnable() {
+ return getBoolean(KEY_CIRCULATE_AIR_ENABLE);
+ }
+
+ public void setAutoModeEnable(Boolean autoModeEnable) {
+ setValue(KEY_AUTO_MODE_ENABLE, autoModeEnable);
+ }
+
+ public Boolean getAutoModeEnable() {
+ return getBoolean(KEY_AUTO_MODE_ENABLE);
+ }
+
+ public void setDefrostZone(DefrostZone defrostZone) {
+ setValue(KEY_DEFROST_ZONE, defrostZone);
+ }
+
+ public DefrostZone getDefrostZone() {
+ return (DefrostZone) getObject(DefrostZone.class, KEY_DEFROST_ZONE);
+ }
+
+ public void setDualModeEnable(Boolean dualModeEnable) {
+ setValue(KEY_DUAL_MODE_ENABLE, dualModeEnable);
+ }
+
+ public Boolean getDualModeEnable() {
+ return getBoolean(KEY_DUAL_MODE_ENABLE);
+ }
+
+ public void setAcMaxEnable(Boolean acMaxEnable) {
+ setValue(KEY_AC_MAX_ENABLE, acMaxEnable);
+ }
+
+ public Boolean getAcMaxEnable() {
+ return getBoolean(KEY_AC_MAX_ENABLE);
+ }
+
+ public void setVentilationMode(VentilationMode ventilationMode) {
+ setValue(KEY_VENTILATION_MODE, ventilationMode);
+ }
+
+ 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/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java
new file mode 100644
index 000000000..493083495
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.HybridAppPreference;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Properties that relate to a a cloud app entry.
+ */
+public class CloudAppProperties extends RPCStruct {
+ public static final String KEY_NICKNAMES = "nicknames";
+ public static final String KEY_APP_ID = "appID";
+ public static final String KEY_ENABLED = "enabled";
+ public static final String KEY_AUTH_TOKEN = "authToken";
+ public static final String KEY_CLOUD_TRANSPORT_TYPE = "cloudTransportType";
+ public static final String KEY_HYBRID_APP_PREFERENCE = "hybridAppPreference";
+ public static final String KEY_ENDPOINT = "endpoint";
+
+
+ public CloudAppProperties(){}
+
+ public CloudAppProperties(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public CloudAppProperties(@NonNull String appID){
+ this();
+ setValue(KEY_APP_ID, appID);
+ }
+
+ public void setNicknames(List<String> nicknames){
+ setValue(KEY_NICKNAMES, nicknames);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getNicknames(){
+ return (List<String>) getObject(String.class, KEY_NICKNAMES);
+ }
+
+ public void setAppID(@NonNull String appID){
+ setValue(KEY_APP_ID, appID);
+ }
+
+ public String getAppID(){
+ return getString(KEY_APP_ID);
+ }
+
+ /**
+ * If true, this cloud app entry will designate it should appear in the HMI
+ * @param enabled if the app should be
+ */
+ public void setEnabled(boolean enabled){
+ setValue(KEY_ENABLED, enabled);
+ }
+
+ /**
+ * @return if this cloud app entry will designate it should appear in the HMI
+ */
+ public Boolean isEnabled(){
+ return getBoolean(KEY_ENABLED);
+ }
+
+ public void setAuthToken(String token){
+ setValue(KEY_AUTH_TOKEN, token);
+ }
+
+ public String getAuthToken(){
+ return getString(KEY_AUTH_TOKEN);
+ }
+
+ public void setCloudTransportType(String transportType){
+ setValue(KEY_CLOUD_TRANSPORT_TYPE, transportType);
+ }
+
+ public String getCloudTransportType(){
+ return getString(KEY_CLOUD_TRANSPORT_TYPE);
+ }
+
+ public void setHybridAppPreference(HybridAppPreference hybridAppPreference){
+ setValue(KEY_HYBRID_APP_PREFERENCE, hybridAppPreference);
+ }
+
+ public HybridAppPreference getHybridAppPreference(){
+ return (HybridAppPreference)getObject(HybridAppPreference.class, KEY_HYBRID_APP_PREFERENCE);
+ }
+
+ /**
+ * @param token - max length ="65535"
+ */
+ public void setEndpoint(String token){
+ setValue(KEY_ENDPOINT, token);
+ }
+
+ /**
+ * @return token - max length ="65535"
+ */
+ public String getEndpoint(){
+ return getString(KEY_ENDPOINT);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java
new file mode 100644
index 000000000..3252a860c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
+import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
+import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
+
+import java.util.Hashtable;
+
+/** <p>The status modes of the instrument panel cluster.</p>
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>powerModeActive</td>
+ * <td>Boolean</td>
+ * <td></td>
+ * <td>References signal "PowerMode_UB".</td>
+ * </tr>
+ * <tr>
+ * <td>powerModeQualificationStatus</td>
+ * <td>PowerModeQualificationStatus</td>
+ * <td></td>
+ * <td>References signal "PowerModeQF".</td>
+ * </tr>
+ * <tr>
+ * <td>carModeStatus</td>
+ * <td>CarModeStatus</td>
+ * <td></td>
+ * <td>Describes the carmode the vehicle is in.</td>
+ * </tr>
+ * <tr>
+ * <td>powerModeStatus</td>
+ * <td>PowerModeStatus</td>
+ * <td>true</td>
+ * <td>Describes the different powermodes</td>
+ * </tr>
+ *
+ * </table>
+ * @since SmartDeviceLink 1.0
+ *
+ * @see SubscribeVehicleData
+ * @see SubscribeVehicleData
+ * @see Image
+ *
+ */
+
+public class ClusterModeStatus extends RPCStruct {
+ public static final String KEY_POWER_MODE_ACTIVE = "powerModeActive";
+ public static final String KEY_POWER_MODE_QUALIFICATION_STATUS = "powerModeQualificationStatus";
+ public static final String KEY_CAR_MODE_STATUS = "carModeStatus";
+ public static final String KEY_POWER_MODE_STATUS = "powerModeStatus";
+
+ public ClusterModeStatus() { }
+
+ /** <p>Constructs a new ClusterModeStatus object indicated by the Hashtable
+ * parameter</p>
+ * @param hash The hash table to use to create an instance of this RPC
+ *
+ */
+ public ClusterModeStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ public ClusterModeStatus(@NonNull Boolean powerModeActive, @NonNull PowerModeQualificationStatus powerModeQualificationStatus, @NonNull CarModeStatus carModeStatus, @NonNull PowerModeStatus powerModeStatus) {
+ this();
+ setPowerModeActive(powerModeActive);
+ setPowerModeQualificationStatus(powerModeQualificationStatus);
+ setCarModeStatus(carModeStatus);
+ setPowerModeStatus(powerModeStatus);
+ }
+
+ public void setPowerModeActive(@NonNull Boolean powerModeActive) {
+ setValue(KEY_POWER_MODE_ACTIVE, powerModeActive);
+ }
+ public Boolean getPowerModeActive() {
+ return getBoolean(KEY_POWER_MODE_ACTIVE);
+ }
+ public void setPowerModeQualificationStatus(@NonNull PowerModeQualificationStatus powerModeQualificationStatus) {
+ setValue(KEY_POWER_MODE_QUALIFICATION_STATUS, powerModeQualificationStatus);
+ }
+ public PowerModeQualificationStatus getPowerModeQualificationStatus() {
+ return (PowerModeQualificationStatus) getObject(PowerModeQualificationStatus.class, KEY_POWER_MODE_QUALIFICATION_STATUS);
+ }
+ public void setCarModeStatus(@NonNull CarModeStatus carModeStatus) {
+ setValue(KEY_CAR_MODE_STATUS, carModeStatus);
+ }
+ public CarModeStatus getCarModeStatus() {
+ return (CarModeStatus) getObject(CarModeStatus.class, KEY_CAR_MODE_STATUS);
+ }
+ public void setPowerModeStatus(@NonNull PowerModeStatus powerModeStatus) {
+ setValue(KEY_POWER_MODE_STATUS, powerModeStatus);
+ }
+ public PowerModeStatus getPowerModeStatus() {
+ return (PowerModeStatus) getObject(PowerModeStatus.class, KEY_POWER_MODE_STATUS);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java
new file mode 100644
index 000000000..3863b652a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import java.util.Hashtable;
+
+public class Coordinate extends RPCStruct{
+ public static final String KEY_LATITUDE_DEGREES = "latitudeDegrees";
+ public static final String KEY_LONGITUDE_DEGREES = "longitudeDegrees";
+
+ public Coordinate() {
+ }
+
+ public Coordinate(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public Coordinate(@NonNull Float latitudeDegrees, @NonNull Float longitudeDegrees) {
+ this();
+ setLatitudeDegrees(latitudeDegrees);
+ setLongitudeDegrees(longitudeDegrees);
+ }
+
+ public Float getLatitudeDegrees() {
+ Object value = getValue(KEY_LATITUDE_DEGREES);
+ return SdlDataTypeConverter.objectToFloat(value);
+ }
+
+ public void setLatitudeDegrees(@NonNull Float latitudeDegrees) {
+ setValue(KEY_LATITUDE_DEGREES, latitudeDegrees);
+ }
+
+ public Float getLongitudeDegrees() {
+ Object value = getValue(KEY_LONGITUDE_DEGREES);
+ return SdlDataTypeConverter.objectToFloat(value);
+ }
+
+ public void setLongitudeDegrees(@NonNull Float longitudeDegrees) {
+ setValue(KEY_LONGITUDE_DEGREES, longitudeDegrees);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java
new file mode 100644
index 000000000..af873e9a1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Creates a Choice Set which can be used in subsequent <i>
+ * {@linkplain PerformInteraction}</i> Operations.
+ *
+ * <p>Function Group: Base </p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p>AudioStreamingState : ANY</p>
+ *
+ * <p>SystemContext: MAIN, MENU, VR</p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>interactionChoiceSetID</td>
+ * <td>Integer</td>
+ * <td>A unique ID that identifies the Choice Set</td>
+ * <td>Y</td>
+ * <td>Min Value: 0; Max Value: 2000000000</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>choiceSet</td>
+ * <td>Choice[]</td>
+ * <td>Array of one or more elements.</td>
+ * <td>Y</td>
+ * <td>Min Value: 1; Max Value: 100</td>
+ * <td>SmartDeviceLink 1.0 </td>
+ * </tr>
+ * </table>
+ *
+ *
+ * <p> <b>Note:</b></p>Second Utterance issue with CreateInteractionChoiceSet RPC. Before a perform interaction
+ * is sent you MUST wait for the success from the CreateInteractionChoiceSet RPC.
+ * If you do not wait the system may not recognize the first utterance from the user.
+ *
+ * <p><b>Response</b></p>
+ *
+ * Indicates that the corresponding request either failed or succeeded. If the response returns with a SUCCESS result code, this means the Choice Set was created.
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p> REJECTED</p>
+ * <p> INVALID_ID</p>
+ * <p> DUPLICATE_NAME</p>
+ * <p>UNSUPPORTED_RESOURCE </p>
+ *
+ *
+ * @since SmartDeviceLink 1.0
+ * @see DeleteInteractionChoiceSet
+ * @see PerformInteraction
+ */
+public class CreateInteractionChoiceSet extends RPCRequest {
+ public static final String KEY_CHOICE_SET = "choiceSet";
+ public static final String KEY_INTERACTION_CHOICE_SET_ID = "interactionChoiceSetID";
+
+ /**
+ * Constructs a new CreateInteractionChoiceSet object
+ */
+ public CreateInteractionChoiceSet() {
+ super(FunctionID.CREATE_INTERACTION_CHOICE_SET.toString());
+ }
+ /**
+ * <p>Constructs a new CreateInteractionChoiceSet object indicated by the
+ * Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public CreateInteractionChoiceSet(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new CreateInteractionChoiceSet object
+ * @param interactionChoiceSetID: an Integer value representing the Choice Set ID
+ * <b>Notes: </b>Min Value: 0; Max Value: 2000000000
+ * @param choiceSet: a List<Choice> representing the array of one or more elements
+ * <b>Notes: </b>Min Value: 1; Max Value: 100
+ */
+ public CreateInteractionChoiceSet(@NonNull Integer interactionChoiceSetID, @NonNull List<Choice> choiceSet) {
+ this();
+ setInteractionChoiceSetID(interactionChoiceSetID);
+ setChoiceSet(choiceSet);
+ }
+ /**
+ * Gets the Choice Set unique ID
+ *
+ * @return Integer -an Integer representing the Choice Set ID
+ */
+ public Integer getInteractionChoiceSetID() {
+ return getInteger( KEY_INTERACTION_CHOICE_SET_ID );
+ }
+ /**
+ * Sets a unique ID that identifies the Choice Set
+ *
+ * @param interactionChoiceSetID
+ * an Integer value representing the Choice Set ID
+ *
+ * <b>Notes: </b>Min Value: 0; Max Value: 2000000000
+ */
+ public void setInteractionChoiceSetID( @NonNull Integer interactionChoiceSetID ) {
+ setParameters(KEY_INTERACTION_CHOICE_SET_ID, interactionChoiceSetID);
+ }
+ /**
+ * Gets Choice Set Array of one or more elements
+ *
+ * @return List<Choice> -a List<Choice> representing the array of one or
+ * more elements
+ */
+ @SuppressWarnings("unchecked")
+ public List<Choice> getChoiceSet() {
+ return (List<Choice>) getObject(Choice.class, KEY_CHOICE_SET);
+ }
+ /**
+ * Sets a Choice Set that is an Array of one or more elements
+ *
+ * @param choiceSet
+ * a List<Choice> representing the array of one or more
+ * elements
+ *
+ * <b>Notes: </b>Min Value: 1; Max Value: 100
+ */
+ public void setChoiceSet( @NonNull List<Choice> choiceSet ) {
+ setParameters(KEY_CHOICE_SET, choiceSet);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java
new file mode 100644
index 000000000..370eff3b3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Create Interaction ChoiceSet Response is sent, when CreateInteractionChoiceSet
+ * has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class CreateInteractionChoiceSetResponse extends RPCResponse {
+ /**
+ * Constructs a new CreateInteractionChoiceSetResponse object
+ */
+
+ public CreateInteractionChoiceSetResponse() {
+ super(FunctionID.CREATE_INTERACTION_CHOICE_SET.toString());
+ }
+ public CreateInteractionChoiceSetResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new CreateInteractionChoiceSetResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public CreateInteractionChoiceSetResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java
new file mode 100644
index 000000000..5e9858985
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
+
+import java.util.Hashtable;
+/** Individual requested DID result and data.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th> Additional</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>resultCode</td>
+ * <td>VehicleDataResultCode</td>
+ * <td>true</td>
+ * <td></td>
+ * <td>Individual DID result code </td>
+ * </tr>
+ * <tr>
+ * <td>didLocation</td>
+ * <td>Integer</td>
+ * <td>true</td>
+ * <td>minvalue = 0 maxvalue = 65535 </td>
+ * <td>The address of DID location from the ReadDID request.</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>data</td>
+ * <td>String</td>
+ * <td>false</td>
+ * <td>maxlength = 5000 </td>
+ * <td>The DID data which is the hex byte string of however many bytes are stored at that location</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ *
+ * @see VehicleDataResultCode
+ * @see ReadDID
+ */
+
+public class DIDResult extends RPCStruct {
+ public static final String KEY_RESULT_CODE = "resultCode";
+ public static final String KEY_DATA = "data";
+ public static final String KEY_DID_LOCATION = "didLocation";
+
+ public DIDResult() {}
+
+ /** <p>Constructs a new DIDResult object indicated by the Hashtable
+ * parameter</p>
+ * @param hash The hash table to use to create an instance of this RPC
+ */
+ public DIDResult(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ public DIDResult(@NonNull VehicleDataResultCode resultCode, @NonNull Integer didLocation) {
+ this();
+ setResultCode(resultCode);
+ setDidLocation(didLocation);
+ }
+ public void setResultCode(@NonNull VehicleDataResultCode resultCode) {
+ setValue(KEY_RESULT_CODE, resultCode);
+ }
+ public VehicleDataResultCode getResultCode() {
+ return (VehicleDataResultCode) getObject(VehicleDataResultCode.class, KEY_RESULT_CODE);
+ }
+ public void setDidLocation(@NonNull Integer didLocation) {
+ setValue(KEY_DID_LOCATION, didLocation);
+ }
+ public Integer getDidLocation() {
+ return getInteger(KEY_DID_LOCATION);
+ }
+ public void setData(String data) {
+ setValue(KEY_DATA, data);
+ }
+ public String getData() {
+ return getString(KEY_DATA);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java
new file mode 100644
index 000000000..697514a08
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * String containing hexadecimal identifier as well as other common names.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>statusByte</td>
+ * <td>String</td>
+ * <td>Hexadecimal byte string
+ * <ul>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class DTC extends RPCStruct {
+ public static final String KEY_IDENTIFIER = "identifier";
+ public static final String KEY_STATUS_BYTE = "statusByte";
+ /**
+ * Constructs a newly allocated DTC object
+ */
+ public DTC() { }
+
+ /**
+ * Constructs a newly allocated DTC object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public DTC(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * set identifier
+ * @param identifier the hexadecimal id of the DTC
+ */
+ public void setIdentifier(String identifier) {
+ setValue(KEY_IDENTIFIER, identifier);
+ }
+
+ /**
+ * get identifier
+ * @return identifier
+ */
+ public String getIdentifier() {
+ return getString(KEY_IDENTIFIER);
+ }
+
+ /**
+ * set Hexadecimal byte string
+ * @param statusByte Hexadecimal byte string
+ */
+ public void setStatusByte(String statusByte) {
+ setValue(KEY_STATUS_BYTE, statusByte);
+ }
+
+ /**
+ * get Hexadecimal byte string
+ * @return Hexadecimal byte string
+ */
+ public String getStatusByte() {
+ return getString(KEY_STATUS_BYTE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java
new file mode 100644
index 000000000..2335743d0
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class DateTime extends RPCStruct{
+ public static final String KEY_MILLISECOND = "millisecond";
+ public static final String KEY_SECOND = "second";
+ public static final String KEY_MINUTE = "minute";
+ public static final String KEY_HOUR = "hour";
+ public static final String KEY_DAY = "day";
+ public static final String KEY_MONTH = "month";
+ public static final String KEY_YEAR = "year";
+ public static final String KEY_TZ_HOUR = "tz_hour";
+ public static final String KEY_TZ_MINUTE = "tz_minute";
+
+ public DateTime() {
+ }
+
+ public DateTime(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+
+ /**
+ * Gets the Milliseconds portion of the DateTime class
+ *
+ * @return Integer - Milliseconds associated with this DateTime class
+ *
+ */
+ public Integer getMilliSecond() {
+ return getInteger(KEY_MILLISECOND);
+ }
+
+ /**
+ * Sets the Milliseconds portion of the DateTime class
+ *
+ * @param milliSecond
+ * The milliseconds associated with this DateTime class
+ *
+ */
+ public void setMilliSecond(Integer milliSecond) {
+ setValue(KEY_MILLISECOND, milliSecond);
+ }
+
+
+ /**
+ * Gets the Seconds portion of the DateTime class
+ *
+ * @return Integer - Seconds associated with this DateTime class
+ *
+ */
+ public Integer getSecond() {
+ return getInteger(KEY_SECOND);
+ }
+
+ /**
+ * Sets the Seconds portion of the DateTime class
+ *
+ * @param second
+ * The Seconds associated with this DateTime class
+ *
+ */
+ public void setSecond(Integer second) {
+ setValue(KEY_SECOND, second);
+ }
+
+
+ /**
+ * Gets the Minutes portion of the DateTime class
+ *
+ * @return Integer - Minutes associated with this DateTime class
+ *
+ */
+ public Integer getMinute() {
+ return getInteger(KEY_MINUTE);
+ }
+
+ /**
+ * Sets the Minutes portion of the DateTime class
+ *
+ * @param minute
+ * The Minutes associated with this DateTime class
+ *
+ */
+ public void setMinute(Integer minute) {
+ setValue(KEY_MINUTE, minute);
+ }
+
+ /**
+ * Gets the Hours portion of the DateTime class.
+ *
+ * @return Integer - Hours associated with this DateTime class.
+ *
+ */
+ public Integer getHour() {
+ return getInteger(KEY_HOUR);
+ }
+
+ /**
+ * Sets the Hours portion of the DateTime class.
+ *
+ * @param hour
+ * The Hours associated with this DateTime class. This structure is used to store hours in a 24 hour format.
+ *
+ */
+ public void setHour(Integer hour) {
+ setValue(KEY_HOUR, hour);
+ }
+
+ /**
+ * Gets the Day portion of the DateTime class.
+ *
+ * @return Integer - Day of the month associated with this DateTime class
+ *
+ */
+ public Integer getDay() {
+ return getInteger(KEY_DAY);
+ }
+
+ /**
+ * Sets the Day portion of the DateTime class
+ *
+ * @param day
+ * The Day of the month associated with this DateTime class
+ *
+ */
+ public void setDay(Integer day) {
+ setValue(KEY_DAY, day);
+ }
+
+ /**
+ * Gets the Month portion of the DateTime class.
+ *
+ * @return Integer - Month of the year associated with this DateTime class
+ *
+ */
+ public Integer getMonth() {
+ return getInteger(KEY_MONTH);
+ }
+
+ /**
+ * Sets the Month portion of the DateTime class
+ *
+ * @param month
+ * The Month of the year associate with this DateTime class
+ *
+ */
+ public void setMonth(Integer month) {
+ setValue(KEY_MONTH, month);
+ }
+
+ /**
+ * Gets the Year portion of the DateTime class.
+ *
+ * @return Integer - The year in YYYY format associated with this DateTime class
+ *
+ */
+ public Integer getYear() {
+ return getInteger(KEY_YEAR);
+ }
+
+ /**
+ * Sets the Year portion of the DateTime class
+ *
+ * @param year
+ * The Year in YYYY format associated with this DateTime class
+ *
+ */
+ public void setYear(Integer year) {
+ setValue(KEY_YEAR, year);
+ }
+
+ /**
+ * Gets the Time Zone Hours portion of the DateTime class.
+ *
+ * @return Integer - The time zone offset in Hours with regard to UTC time associated with this DateTime class
+ *
+ */
+ public Integer getTzHour() {
+ return getInteger(KEY_TZ_HOUR);
+ }
+
+ /**
+ * Sets the Time Zone Hours portion of the DateTime class
+ *
+ * @param tzHour
+ * The time zone offset in Hours with regard to UTC time associated with this DateTime class
+ *
+ */
+ public void setTzHour(Integer tzHour) {
+ setValue(KEY_TZ_HOUR, tzHour);
+ }
+
+ /**
+ * Gets the Time Zone Minutes portion of the DateTime class.
+ *
+ * @return Integer - The time zone offset in minutes with regard to UTC associated with this DateTime class
+ *
+ */
+ public Integer getTzMinute() {
+ return getInteger(KEY_TZ_MINUTE);
+ }
+
+ /**
+ * Sets the Time Zone Minutes portion of the DateTime class
+ *
+ * @param tzMinute
+ * The time zone offset in Minutes with regard to UTC associated with this DateTime class
+ */
+ public void setTzMinute(Integer tzMinute) {
+ setValue(KEY_TZ_MINUTE, tzMinute);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java
new file mode 100644
index 000000000..31c319101
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Removes a command from the Command Menu.
+ *
+ * <p><b>HMI Status Requirements:</b></p>
+ * <p>HMILevel: FULL, LIMITED or BACKGROUND</p>
+ * AudioStreamingState: N/A
+ * <p>SystemContext: Should not be attempted when VRSESSION or MENU</p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>cmdID</td>
+ * <td>Integer</td>
+ * <td>Unique ID that identifies the Command to be deleted from Command Menu</td>
+ * <td>Y</td>
+ * <td>Min Value: 0;Max Value: 2000000000</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ *
+ *<p><b> Response:</b></p>
+ *
+ * Indicates that the corresponding request either failed or succeeded. If the response returns with a SUCCESS result code,this means a command was removed from the Command Menu successfully.
+ *
+ *<p><b> Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ * <p> INVALID_ID</p>
+ * <p> IN_USER</p>
+ * @since SmartDeviceLink 1.0
+ * @see AddCommand
+ * @see AddSubMenu
+ * @see DeleteSubMenu
+ */
+public class DeleteCommand extends RPCRequest {
+ public static final String KEY_CMD_ID = "cmdID";
+
+ /**
+ * Constructs a new DeleteCommand object
+ */
+ public DeleteCommand() {
+ super(FunctionID.DELETE_COMMAND.toString());
+ }
+ /**
+ * Constructs a new DeleteCommand object indicated by the Hashtable
+ * parameter
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public DeleteCommand(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new DeleteCommand object
+ * @param cmdID: an Integer value representing Command ID
+ */
+ public DeleteCommand(@NonNull Integer cmdID) {
+ this();
+ setCmdID(cmdID);
+ }
+ /**
+ * Gets the Command ID that identifies the Command to be deleted from
+ * Command Menu
+ *
+ * @return Integer - Integer value representing Command ID that identifies
+ * the Command to be deleted from Command Menu
+ */
+ public Integer getCmdID() {
+ return getInteger( KEY_CMD_ID );
+ }
+ /**
+ * Sets the Command ID that identifies the Command to be deleted from Command Menu
+ *
+ * @param cmdID
+ * an Integer value representing Command ID
+ *
+ * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000</p>
+ */
+ public void setCmdID( @NonNull Integer cmdID ) {
+ setParameters(KEY_CMD_ID, cmdID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java
new file mode 100644
index 000000000..608590ba6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Delete Command Response is sent, when DeleteCommand has been called.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class DeleteCommandResponse extends RPCResponse {
+ /** Constructs a new DeleteCommandResponse object
+ *
+ */
+
+ public DeleteCommandResponse() {
+ super(FunctionID.DELETE_COMMAND.toString());
+ }
+ public DeleteCommandResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new DeleteCommandResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public DeleteCommandResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java
new file mode 100644
index 000000000..8f4985489
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Used to delete a file resident on the SDL module in the app's local cache.
+ * Not supported on first generation SDL vehicles
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink 2.0</th>
+ * </tr>
+ * <tr>
+ * <td>SDLFileName</td>
+ * <td>String</td>
+ * <td> File reference name.</td>
+ * <td>Y</td>
+ * <td>maxlength:500</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ *
+ * <p><b>Response </b></p>
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p> SUCCESS</p>
+ * <p> INVALID_DATA</p>
+ * <p> OUT_OF_MEMORY</p>
+ * <p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p> APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ * @since SmartDeviceLink 2.0
+ * @see PutFile
+ * @see ListFiles
+ */
+public class DeleteFile extends RPCRequest {
+ public static final String KEY_SDL_FILE_NAME = "syncFileName";
+
+ /**
+ * Constructs a new DeleteFile object
+ */
+ public DeleteFile() {
+ super(FunctionID.DELETE_FILE.toString());
+ }
+
+ /**
+ * <p>Constructs a new DeleteFile object indicated by the Hashtable parameter</p>
+ * @param hash The Hashtable to use
+ */
+ public DeleteFile(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new DeleteFile object
+ * @param sdlFileName a String value representing a file reference name
+ */
+ public DeleteFile(@NonNull String sdlFileName) {
+ this();
+ setSdlFileName(sdlFileName);
+ }
+
+ /**
+ * Sets a file reference name
+ *
+ * @param sdlFileName
+ * a String value representing a file reference name
+ */
+ public void setSdlFileName(@NonNull String sdlFileName) {
+ setParameters(KEY_SDL_FILE_NAME, sdlFileName);
+ }
+
+ /**
+ * Gets a file reference name
+ *
+ * @return String -a String value representing a file reference name
+ */
+ public String getSdlFileName() {
+ return getString(KEY_SDL_FILE_NAME);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java
new file mode 100644
index 000000000..386c25028
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.util.Version;
+
+import java.util.Hashtable;
+
+/**
+ * Delete File Response is sent, when DeleteFile has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class DeleteFileResponse extends RPCResponse {
+ public static final String KEY_SPACE_AVAILABLE = "spaceAvailable";
+ private static final Integer MAX_VALUE = 2000000000;
+
+ /**
+ * Constructs a new DeleteFileResponse object
+ */
+ public DeleteFileResponse() {
+ super(FunctionID.DELETE_FILE.toString());
+ }
+
+ public DeleteFileResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * @deprecated use {@link DeleteFileResponse#DeleteFileResponse(Boolean, Result)} instead <br>
+ *
+ * Constructs a new DeleteFileResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ * @param spaceAvailable the total local space available on the module for the registered app.
+ */
+ @Deprecated
+ public DeleteFileResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer spaceAvailable) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ setSpaceAvailable(spaceAvailable);
+ }
+
+ /**
+ * Constructs a new DeleteFileResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public DeleteFileResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ /**
+ * SpaceAvailable became optional as of RPC Spec 5.0. If a system that expected the value to
+ * always have a value connects to such a system, it could return null. Check to see if there
+ * is a value, and if not, set it to MAX_VALUE as defined by the RPC Spec
+ *
+ * @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){
+ if (getSpaceAvailable() == null){
+ setSpaceAvailable(MAX_VALUE);
+ }
+ }
+ super.format(rpcVersion, formatParams);
+ }
+
+ public void setSpaceAvailable(Integer spaceAvailable) {
+ setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
+ }
+
+ public Integer getSpaceAvailable() {
+ return getInteger(KEY_SPACE_AVAILABLE);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java
new file mode 100644
index 000000000..6bec1ff67
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Deletes an existing Choice Set identified by the parameter
+ * interactionChoiceSetID. If the specified interactionChoiceSetID is currently
+ * in use by an active <i> {@linkplain PerformInteraction}</i> this call to
+ * delete the Choice Set will fail returning an IN_USE resultCode
+ *
+ * <p>Function Group: Base</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUD</b></p>
+ *
+ * <p>AudioStreamingState: Any</p>
+ *
+ * <p>SystemContext: MAIN, MENU, VR </p>
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>interactionChoiceSetID</td>
+ * <td>Integer</td>
+ * <td> A unique ID that identifies the Choice Set (specified in a previous call to CreateInteractionChoiceSet)</td>
+ * <td>Y</td>
+ * <td>Min Value: 0 ; Max Value: 2000000000</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ *
+ * <p><b>Response </b></p>
+ *
+ * If a resultCode of "SUCCESS" is returned, the requested choice set has been created and can now be referenced by the application using the value of interactionChoiceSetID provided by the application.
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ * <p>INVALID_ID</p>
+
+ * @since SmartDeviceLink 1.0
+ * @see CreateInteractionChoiceSet
+ * @see PerformInteraction
+ */
+public class DeleteInteractionChoiceSet extends RPCRequest {
+ public static final String KEY_INTERACTION_CHOICE_SET_ID = "interactionChoiceSetID";
+
+ /**
+ * Constructs a new DeleteInteractionChoiceSet object
+ */
+ public DeleteInteractionChoiceSet() {
+ super(FunctionID.DELETE_INTERACTION_CHOICE_SET.toString());
+ }
+ /**
+ * <p>Constructs a new DeleteInteractionChoiceSet object indicated by the
+ * Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public DeleteInteractionChoiceSet(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new DeleteInteractionChoiceSet object
+ * @param interactionChoiceSetID a unique ID that identifies the Choice Set
+ * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000 </p>
+ */
+ public DeleteInteractionChoiceSet(@NonNull Integer interactionChoiceSetID) {
+ this();
+ setInteractionChoiceSetID(interactionChoiceSetID);
+ }
+ /**
+ * Gets a unique ID that identifies the Choice Set
+ * @return Integer -an Integer value representing the unique Choice Set ID
+ */
+ public Integer getInteractionChoiceSetID() {
+ return getInteger( KEY_INTERACTION_CHOICE_SET_ID );
+ }
+ /**
+ * Sets a unique ID that identifies the Choice Set
+ * @param interactionChoiceSetID a unique ID that identifies the Choice Set
+ * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000 </p>
+ */
+ public void setInteractionChoiceSetID( @NonNull Integer interactionChoiceSetID ) {
+ setParameters(KEY_INTERACTION_CHOICE_SET_ID, interactionChoiceSetID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java
new file mode 100644
index 000000000..b2457e876
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Delete Interaction ChoiceSet Response is sent, when DeleteInteractionChoiceSet has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class DeleteInteractionChoiceSetResponse extends RPCResponse {
+
+ public DeleteInteractionChoiceSetResponse() {
+ super(FunctionID.DELETE_INTERACTION_CHOICE_SET.toString());
+ }
+ public DeleteInteractionChoiceSetResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new DeleteInteractionChoiceSetResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public DeleteInteractionChoiceSetResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java
new file mode 100644
index 000000000..296e02897
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Deletes a submenu from the Command Menu.
+ *
+ * <p><b>Notes: </b>When an app deletes a submenu that has child commands, those
+ * child commands are also deleted</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>menuID</td>
+ * <td>Integer</td>
+ * <td>Unique ID that identifies the SubMenu to be delete</td>
+ * <td>Y</td>
+ * <td>Min Value: 0; Max Value: 2000000000</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ *
+ *<p> <b>Response </b></p>
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ *<p>SUCCESS</p>
+ *<p> INVALID_DATA</p>
+ * <p> OUT_OF_MEMORY</p>
+ * <p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p> APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR</p>
+ * <p> REJECTED</p>
+ * <p> INVALID_ID</p>
+ * <p> IN_USE </p>
+ *
+ * @since SmartDeviceLink 1.0
+ * @see AddCommand
+ * @see AddSubMenu
+ * @see DeleteCommand
+ */
+public class DeleteSubMenu extends RPCRequest {
+ public static final String KEY_MENU_ID = "menuID";
+ /**
+ * Constructs a new DeleteSubMenu object
+ */
+ public DeleteSubMenu() {
+ super(FunctionID.DELETE_SUB_MENU.toString());
+ }
+ /**
+ * Constructs a new DeleteSubMenu object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public DeleteSubMenu(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new DeleteSubMenu object
+ * @param menuID an Integer value representing menuID that identifies the SubMenu to be delete
+ *
+ * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000</p>
+ */
+ public DeleteSubMenu(@NonNull Integer menuID) {
+ this();
+ setMenuID(menuID);
+ }
+ /**
+ * Gets the Menu ID that identifies the SubMenu to be delete
+ * @return Integer -an Integer value representing menuID that identifies the SubMenu to be delete
+ */
+ public Integer getMenuID() {
+ return getInteger( KEY_MENU_ID );
+ }
+ /**
+ * Sets the MenuID that identifies the SubMenu to be delete
+ * @param menuID an Integer value representing menuID that identifies the SubMenu to be delete
+ *
+ * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000</p>
+ */
+ public void setMenuID( @NonNull Integer menuID ) {
+ setParameters(KEY_MENU_ID, menuID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java
new file mode 100644
index 000000000..40de5ba0c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Delete SubMenu Response is sent, when DeleteSubMenu has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class DeleteSubMenuResponse extends RPCResponse {
+ /**
+ * Constructs a new DeleteSubMenuResponse object
+ */
+
+ public DeleteSubMenuResponse() {
+ super(FunctionID.DELETE_SUB_MENU.toString());
+ }
+ public DeleteSubMenuResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new DeleteSubMenuResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public DeleteSubMenuResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java
new file mode 100644
index 000000000..2322b2f24
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/**
+ * Various information about connecting device.
+ *
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>hardware</td>
+ * <td>String</td>
+ * <td>Device model</td>
+ * <td>N</td>
+ * <td>Max Length: 500</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>firmwareRev</td>
+ * <td>String</td>
+ * <td>Device firmware revision</td>
+ * <td>N</td>
+ * <td>Max Length: 500</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>os</td>
+ * <td>String</td>
+ * <td>Device OS version</td>
+ * <td>N</td>
+ * <td>Max Length: 500</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>osVersion</td>
+ * <td>String</td>
+ * <td>Device OS version</td>
+ * <td>N</td>
+ * <td>Max Length: 500</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>carrier</td>
+ * <td>String</td>
+ * <td>Device mobile carrier (if applicable)</td>
+ * <td>N</td>
+ * <td>Max Length: 500</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>maxNumberRFCOMMPorts</td>
+ * <td>Integer</td>
+ * <td>Omitted if connected not via BT.</td>
+ * <td>N</td>
+ * <td>Min Value: 0; Max Value: 100</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * </table>
+ *
+ */
+public class DeviceInfo extends RPCStruct{
+ public static final String KEY_HARDWARE = "hardware";
+ public static final String KEY_FIRMWARE_REV = "firmwareRev";
+ public static final String KEY_OS = "os";
+ public static final String KEY_OS_VERSION = "osVersion";
+ public static final String KEY_CARRIER = "carrier";
+ public static final String KEY_MAX_NUMBER_RFCOMM_PORTS = "maxNumberRFCOMMPorts";
+ public static final String DEVICE_OS = "Android";
+
+ public DeviceInfo() { }
+
+ /** Constructs a new DeviceInfo object indicated by the Hashtable
+ * parameter
+ * @param hash The hash table to use to create an instance of this RPC
+ */
+ public DeviceInfo(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public void setHardware(String hardware) {
+ setValue(KEY_HARDWARE, hardware);
+ }
+
+ public String getHardware() {
+ return getString(KEY_HARDWARE);
+ }
+
+ public void setFirmwareRev(String firmwareRev) {
+ setValue(KEY_FIRMWARE_REV, firmwareRev);
+ }
+
+ public String getFirmwareRev() {
+ return getString(KEY_FIRMWARE_REV);
+ }
+
+ public void setOs(String os) {
+ setValue(KEY_OS, os);
+ }
+
+ public String getOs() {
+ return getString(KEY_OS);
+ }
+
+ public void setOsVersion(String osVersion) {
+ setValue(KEY_OS_VERSION, osVersion);
+}
+
+public String getOsVersion() {
+ return getString(KEY_OS_VERSION);
+}
+
+public void setCarrier(String carrier) {
+ setValue(KEY_CARRIER, carrier);
+}
+
+public String getCarrier() {
+ return getString(KEY_CARRIER);
+}
+
+public Integer getMaxNumberRFCOMMPorts() {
+ return getInteger( KEY_MAX_NUMBER_RFCOMM_PORTS );
+}
+
+public void setMaxNumberRFCOMMPorts( Integer maxNumberRFCOMMPorts ) {
+ setValue(KEY_MAX_NUMBER_RFCOMM_PORTS, maxNumberRFCOMMPorts);
+}
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java
new file mode 100644
index 000000000..6a747f05b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java
@@ -0,0 +1,353 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
+import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
+
+import java.util.Hashtable;
+
+/**
+ * Describes the status related to a connected mobile device or SDL and if or how it is represented in the vehicle.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>voiceRecOn</td>
+ * <td>Boolean</td>
+ * <td>Voice recognition is on
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>btIconOn</td>
+ * <td>Boolean</td>
+ * <td>Bluetooth connection established
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>callActive</td>
+ * <td>Boolean</td>
+ * <td>A call is being active
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>phoneRoaming</td>
+ * <td>Boolean</td>
+ * <td>The phone is in roaming mode
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>textMsgAvailable</td>
+ * <td>Boolean</td>
+ * <td>A textmessage is available
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>battLevelStatus</td>
+ * <td>DeviceLevelStatus</td>
+ * <td>Battery level status
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>stereoAudioOutputMuted</td>
+ * <td>Boolean</td>
+ * <td>Status of the stereo audio output channel
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>monoAudioOutputMuted</td>
+ * <td>Boolean</td>
+ * <td>Status of the mono audio output channel
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>signalLevelStatus</td>
+ * <td>DeviceLevelStatus</td>
+ * <td>Signal level status
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>primaryAudioSource</td>
+ * <td>PrimaryAudioSource</td>
+ * <td>Reflects the current primary audio source of SDL (if selected).
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>eCallEventActive</td>
+ * <td>Boolean</td>
+ * <td>Reflects, if an eCall event is active
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ *
+ * @see DeviceLevelStatus
+ * @see GetVehicleData
+ * @see OnVehicleData
+ *
+ */
+public class DeviceStatus extends RPCStruct {
+ public static final String KEY_VOICE_REC_ON = "voiceRecOn";
+ public static final String KEY_BT_ICON_ON = "btIconOn";
+ public static final String KEY_CALL_ACTIVE = "callActive";
+ public static final String KEY_PHONE_ROAMING = "phoneRoaming";
+ public static final String KEY_TEXT_MSG_AVAILABLE = "textMsgAvailable";
+ public static final String KEY_BATT_LEVEL_STATUS = "battLevelStatus";
+ public static final String KEY_STEREO_AUDIO_OUTPUT_MUTED = "stereoAudioOutputMuted";
+ public static final String KEY_MONO_AUDIO_OUTPUT_MUTED = "monoAudioOutputMuted";
+ public static final String KEY_SIGNAL_LEVEL_STATUS = "signalLevelStatus";
+ public static final String KEY_PRIMARY_AUDIO_SOURCE = "primaryAudioSource";
+ public static final String KEY_E_CALL_EVENT_ACTIVE = "eCallEventActive";
+
+ /**
+ * Constructs a newly allocated DeviceStatus object
+ */
+ public DeviceStatus() {}
+
+ /**
+ * Constructs a newly allocated DeviceStatus object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public DeviceStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated DeviceStatus object
+ * @param voiceRecOn
+ * @param btIconOn the bluetooth connection established
+ * @param callActive a call is being active
+ * @param phoneRoaming the phone is in roaming mode
+ * @param textMsgAvailable a textmessage is available
+ * @param battLevelStatus battery level status
+ * @param stereoAudioOutputMuted the status of the stereo audio output channel
+ * @param monoAudioOutputMuted the status of the mono audio output channel
+ * @param signalLevelStatus signal level status
+ * @param primaryAudioSource the current primary audio source of SDL (if selected
+ * @param eCallEventActive
+ */
+ public DeviceStatus(@NonNull Boolean voiceRecOn, @NonNull Boolean btIconOn, @NonNull Boolean callActive, @NonNull Boolean phoneRoaming, @NonNull Boolean textMsgAvailable, @NonNull DeviceLevelStatus battLevelStatus,
+ @NonNull Boolean stereoAudioOutputMuted, @NonNull Boolean monoAudioOutputMuted, @NonNull DeviceLevelStatus signalLevelStatus, @NonNull PrimaryAudioSource primaryAudioSource, @NonNull Boolean eCallEventActive) {
+ this();
+ setVoiceRecOn(voiceRecOn);
+ setBtIconOn(btIconOn);
+ setCallActive(callActive);
+ setPhoneRoaming(phoneRoaming);
+ setTextMsgAvailable(textMsgAvailable);
+ setBattLevelStatus(battLevelStatus);
+ setStereoAudioOutputMuted(stereoAudioOutputMuted);
+ setMonoAudioOutputMuted(monoAudioOutputMuted);
+ setSignalLevelStatus(signalLevelStatus);
+ setPrimaryAudioSource(primaryAudioSource);
+ setECallEventActive(eCallEventActive);
+ }
+
+ /**
+ * set the voice recognition on or off
+ * @param voiceRecOn
+ */
+ public void setVoiceRecOn(@NonNull Boolean voiceRecOn) {
+ setValue(KEY_VOICE_REC_ON, voiceRecOn);
+ }
+
+ /**
+ * get whether the voice recognition is on
+ * @return whether the voice recognition is on
+ */
+ public Boolean getVoiceRecOn() {
+ return getBoolean(KEY_VOICE_REC_ON);
+ }
+
+ /**
+ * set the bluetooth connection established
+ * @param btIconOn the bluetooth connection established
+ */
+ public void setBtIconOn(@NonNull Boolean btIconOn) {
+ setValue(KEY_BT_ICON_ON, btIconOn);
+ }
+
+ /**
+ * get the bluetooth connection established
+ * @return the bluetooth connection established
+ */
+ public Boolean getBtIconOn() {
+ return getBoolean(KEY_BT_ICON_ON);
+ }
+
+ /**
+ * set a call is being active
+ * @param callActive a call is being active
+ */
+ public void setCallActive(@NonNull Boolean callActive) {
+ setValue(KEY_CALL_ACTIVE, callActive);
+ }
+
+ /**
+ * get a call is being active
+ * @return a call is being active
+ */
+ public Boolean getCallActive() {
+ return getBoolean(KEY_CALL_ACTIVE);
+ }
+
+ /**
+ * set the phone is in roaming mode
+ * @param phoneRoaming the phone is in roaming mode
+ */
+ public void setPhoneRoaming(@NonNull Boolean phoneRoaming) {
+ setValue(KEY_PHONE_ROAMING, phoneRoaming);
+ }
+
+ /**
+ * get the phone is in roaming mode
+ * @return the phone is in roaming mode
+ */
+ public Boolean getPhoneRoaming() {
+ return getBoolean(KEY_PHONE_ROAMING);
+ }
+ public void setTextMsgAvailable(@NonNull Boolean textMsgAvailable) {
+ setValue(KEY_TEXT_MSG_AVAILABLE, textMsgAvailable);
+ }
+
+ /**
+ * get a textmessage is available
+ * @return a textmessage is available
+ */
+ public Boolean getTextMsgAvailable() {
+ return getBoolean(KEY_TEXT_MSG_AVAILABLE);
+ }
+
+ /**
+ * set battery level status
+ * @param battLevelStatus battery level status
+ */
+ public void setBattLevelStatus(@NonNull DeviceLevelStatus battLevelStatus) {
+ setValue(KEY_BATT_LEVEL_STATUS, battLevelStatus);
+ }
+
+ /**
+ * get battery level status
+ * @return battery level status
+ */
+ public DeviceLevelStatus getBattLevelStatus() {
+ return (DeviceLevelStatus) getObject(DeviceLevelStatus.class, KEY_BATT_LEVEL_STATUS);
+ }
+
+ /**
+ * set the status of the stereo audio output channel
+ * @param stereoAudioOutputMuted the status of the stereo audio output channel
+ */
+ public void setStereoAudioOutputMuted(@NonNull Boolean stereoAudioOutputMuted) {
+ setValue(KEY_STEREO_AUDIO_OUTPUT_MUTED, stereoAudioOutputMuted);
+ }
+
+ /**
+ * get the status of the stereo audio output channel
+ * @return the status of the stereo audio output channel
+ */
+ public Boolean getStereoAudioOutputMuted() {
+ return getBoolean(KEY_STEREO_AUDIO_OUTPUT_MUTED);
+ }
+
+ /**
+ * set the status of the mono audio output channel
+ * @param monoAudioOutputMuted the status of the mono audio output channel
+ */
+ public void setMonoAudioOutputMuted(@NonNull Boolean monoAudioOutputMuted) {
+ setValue(KEY_MONO_AUDIO_OUTPUT_MUTED, monoAudioOutputMuted);
+ }
+
+ /**
+ * get the status of the mono audio output channel
+ * @return the status of the mono audio output channel
+ */
+ public Boolean getMonoAudioOutputMuted() {
+ return getBoolean(KEY_MONO_AUDIO_OUTPUT_MUTED);
+ }
+
+ /**
+ * set signal level status
+ * @param signalLevelStatus signal level status
+ */
+ public void setSignalLevelStatus(@NonNull DeviceLevelStatus signalLevelStatus) {
+ setValue(KEY_SIGNAL_LEVEL_STATUS, signalLevelStatus);
+ }
+
+ /**
+ * get signal level status
+ * @return signal level status
+ */
+ public DeviceLevelStatus getSignalLevelStatus() {
+ return (DeviceLevelStatus) getObject(DeviceLevelStatus.class, KEY_SIGNAL_LEVEL_STATUS);
+ }
+
+ /**
+ * set the current primary audio source of SDL (if selected).
+ * @param primaryAudioSource the current primary audio source of SDL (if selected).
+ */
+ public void setPrimaryAudioSource(@NonNull PrimaryAudioSource primaryAudioSource) {
+ setValue(KEY_PRIMARY_AUDIO_SOURCE, primaryAudioSource);
+ }
+
+ /**
+ * get the current primary audio source of SDL (if selected).
+ * @return the current primary audio source of SDL (if selected).
+ */
+ public PrimaryAudioSource getPrimaryAudioSource() {
+ return (PrimaryAudioSource) getObject(PrimaryAudioSource.class, KEY_PRIMARY_AUDIO_SOURCE);
+ }
+ public void setECallEventActive(@NonNull Boolean eCallEventActive) {
+ setValue(KEY_E_CALL_EVENT_ACTIVE, eCallEventActive);
+ }
+ public Boolean getECallEventActive() {
+ return getBoolean(KEY_E_CALL_EVENT_ACTIVE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java
new file mode 100644
index 000000000..ea71394ec
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/** Non periodic vehicle diagnostic request.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>targetID</td>
+ * <td>Integer</td>
+ * <td>Name of target ECU.</td>
+ * <td>Y</td>
+ * <td>Min Value: 0; Max Value: 65535</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>messageLength</td>
+ * <td>Integer</td>
+ * <td>Length of message (in bytes).</td>
+ * <td>Y</td>
+ * <td>Min Value: 0; Max Value:65535</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>messageData</td>
+ * <td>Integer</td>
+ * <td>Array of bytes comprising CAN message.</td>
+ * <td>Y</td>
+ * <td>Min Value: 0; Max Value:255; Min Size:1; Max Size:65535</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * </table>
+ * <p><b>HMI must:</b> </p>
+ *
+ * <p>1. Check the requested data using provided information of targetID (name of ECU),messageLength and messageData.</p>
+ * <p> 2. Respond with one of the appropriate result codes.And in case of SUCCESS return messageDataResult which is an array of bytes comprising CAN message result.</p>
+ * @since SmartDeviceLink 3.0
+ *
+ */
+
+public class DiagnosticMessage extends RPCRequest {
+ public static final String KEY_TARGET_ID = "targetID";
+ public static final String KEY_MESSAGE_LENGTH = "messageLength";
+ public static final String KEY_MESSAGE_DATA = "messageData";
+
+ /**
+ * Constructs a new DiagnosticMessage object
+ */
+ public DiagnosticMessage() {
+ super(FunctionID.DIAGNOSTIC_MESSAGE.toString());
+ }
+
+ /**
+ * <p>
+ * Constructs a new DiagnosticMessage object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use to create this RPC
+ *
+ */
+ public DiagnosticMessage(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new DiagnosticMessage object
+ */
+ public DiagnosticMessage(@NonNull Integer targetID, @NonNull Integer messageLength, @NonNull List<Integer> messageData) {
+ this();
+ setTargetID(targetID);
+ setMessageLength(messageLength);
+ setMessageData(messageData);
+ }
+
+ /** Sets TargetID
+ *
+ * @param targetID the target for this Diagnostic Message
+ */
+ public void setTargetID(@NonNull Integer targetID) {
+ setParameters(KEY_TARGET_ID, targetID);
+ }
+
+ /**
+ * <p>
+ * Returns an <i>Integer</i> object representing the Target ID that you want to add
+ * </p>
+ *
+ * @return Integer -an integer representation a Unique Target ID
+ */
+ public Integer getTargetID() {
+ return getInteger(KEY_TARGET_ID);
+ }
+
+ public void setMessageLength(@NonNull Integer messageLength) {
+ setParameters(KEY_MESSAGE_LENGTH, messageLength);
+ }
+ public Integer getMessageLength() {
+ return getInteger(KEY_MESSAGE_LENGTH);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<Integer> getMessageData() {
+ return (List<Integer>) getObject(Integer.class, KEY_MESSAGE_DATA);
+ }
+
+ public void setMessageData(@NonNull List<Integer> messageData) {
+ setParameters(KEY_MESSAGE_DATA, messageData);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
new file mode 100644
index 000000000..bd8c5599c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Diagnostic Message Response is sent, when DiagnosticMessage has been called.
+ *
+ * @since SmartDeviceLink 3.0
+ */
+public class DiagnosticMessageResponse extends RPCResponse {
+ public static final String KEY_MESSAGE_DATA_RESULT = "messageDataResult";
+ /**
+ * Constructs a new DiagnosticMessageResponse object
+ */
+
+ public DiagnosticMessageResponse() {
+ super(FunctionID.DIAGNOSTIC_MESSAGE.toString());
+ }
+ public DiagnosticMessageResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new DiagnosticMessageResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public DiagnosticMessageResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull List<Integer> messageDataResult) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ setMessageDataResult(messageDataResult);
+ }
+ @SuppressWarnings("unchecked")
+ public List<Integer> getMessageDataResult() {
+ return (List<Integer>) getObject(Integer.class, KEY_MESSAGE_DATA_RESULT);
+ }
+
+ public void setMessageDataResult(@NonNull List<Integer> messageDataResult) {
+ setParameters(KEY_MESSAGE_DATA_RESULT, messageDataResult);
+ }
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java
new file mode 100644
index 000000000..1264f8efa
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Dials a phone number and switches to phone application.
+ *
+ * @since SmartDeviceLink 4.0
+ */
+public class DialNumber extends RPCRequest {
+ public static final String KEY_NUMBER = "number";
+
+
+ public DialNumber(){
+ super(FunctionID.DIAL_NUMBER.toString());
+ }
+
+ public DialNumber(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public DialNumber(@NonNull String number){
+ this();
+ setNumber(number);
+ }
+ /**
+ * Sets a number to dial
+ *
+ * @param number
+ * a phone number is a string, which can be up to 40 chars.
+ * <p>
+ * <b>Notes: </b>Maxlength=40</p>
+ * All characters shall be stripped from string except digits 0-9 and * # , ; +
+ */
+ public void setNumber(@NonNull String number) {
+ if (number != null) {
+ number = number.replaceAll("[^0-9*#,;+]", ""); //This will sanitize the input
+ }
+ setParameters(KEY_NUMBER, number);
+ }
+
+ /**
+ * Gets a number to dial
+ *
+ * @return String - a String value representing a number to dial
+ */
+ public String getNumber() {
+ return getString(KEY_NUMBER);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java
new file mode 100644
index 000000000..d2c7f0531
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Dial Number Response is sent, when DialNumber has been called
+ *
+ * @since SmartDeviceLink 4.0
+ */
+public class DialNumberResponse extends RPCResponse {
+
+ public DialNumberResponse() {
+ super(FunctionID.DIAL_NUMBER.toString());
+ }
+
+ public DialNumberResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new DialNumberResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public DialNumberResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java
new file mode 100644
index 000000000..fc093f0a8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.DisplayType;
+import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Contains information about the display for the SDL system to which the application is currently connected.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>@Deprecated <s>displayType</s></td>
+ * <td><s>DisplayType</s></td>
+ * <td><s>The type of display</s>
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>displayName</td>
+ * <td>String</td>
+ * <td>The name of the display
+ * </td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>textField</td>
+ * <td>TextField[]</td>
+ * <td>An array of TextField structures, each of which describes a field in the HMI which the application can write to using operations such as <i>{@linkplain Show}</i>, <i>{@linkplain SetMediaClockTimer}</i>, etc.
+ * This array of TextField structures identify all the text fields to which the application can write on the current display (identified by DisplayType ).
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>mediaClockFormats</td>
+ * <td>MediaClockFormat[]</td>
+ * <td>An array of MediaClockFormat elements, defining the valid string formats used in specifying the contents of the media clock field</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>graphicSupported</td>
+ * <td>Boolean</td>
+ * <td>The display's persistent screen supports referencing a static or dynamic image.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ * @see DisplayType
+ * @see MediaClockFormat
+ * @see TextField
+ * @see ImageField
+ *
+ */
+public class DisplayCapabilities extends RPCStruct {
+ public static final String KEY_DISPLAY_TYPE = "displayType";
+ public static final String KEY_DISPLAY_NAME = "displayName";
+ public static final String KEY_MEDIA_CLOCK_FORMATS = "mediaClockFormats";
+ public static final String KEY_TEXT_FIELDS = "textFields";
+ public static final String KEY_IMAGE_FIELDS = "imageFields";
+ public static final String KEY_GRAPHIC_SUPPORTED = "graphicSupported";
+ public static final String KEY_SCREEN_PARAMS = "screenParams";
+ public static final String KEY_TEMPLATES_AVAILABLE = "templatesAvailable";
+ public static final String KEY_NUM_CUSTOM_PRESETS_AVAILABLE = "numCustomPresetsAvailable";
+ /**
+ * Constructs a newly allocated DisplayCapabilities object
+ */
+ public DisplayCapabilities() { }
+ /**
+ * Constructs a newly allocated DisplayCapabilities object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public DisplayCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a newly allocated DisplayCapabilities object
+ * @param displayType the display type
+ * @param textFields the List of textFields
+ * @param mediaClockFormats the List of MediaClockFormat
+ * @param graphicSupported true if the display supports graphics, false if it does not
+ */
+ @Deprecated
+ public DisplayCapabilities(@NonNull DisplayType displayType, @NonNull List<TextField> textFields, @NonNull List<MediaClockFormat> mediaClockFormats, @NonNull Boolean graphicSupported) {
+ this();
+ setDisplayType(displayType);
+ setTextFields(textFields);
+ setMediaClockFormats(mediaClockFormats);
+ setGraphicSupported(graphicSupported);
+ }
+ /**
+ * Constructs a newly allocated DisplayCapabilities object
+ * @param displayName the display name (String)
+ * @param textFields the List of textFields
+ * @param mediaClockFormats the List of MediaClockFormat
+ * @param graphicSupported true if the display supports graphics, false if it does not
+ */
+ public DisplayCapabilities(String displayName, @NonNull List<TextField> textFields, @NonNull List<MediaClockFormat> mediaClockFormats, @NonNull Boolean graphicSupported) {
+ this();
+ setDisplayName(displayName);
+ setTextFields(textFields);
+ setMediaClockFormats(mediaClockFormats);
+ setGraphicSupported(graphicSupported);
+ }
+ /**
+ * Get the type of display
+ * @return the type of display
+ */
+ @Deprecated
+ public DisplayType getDisplayType() {
+ return (DisplayType) getObject(DisplayType.class, KEY_DISPLAY_TYPE);
+ }
+ /**
+ * Set the type of display
+ * @param displayType the display type
+ */
+ @Deprecated
+ public void setDisplayType( @NonNull DisplayType displayType ) {
+ setValue(KEY_DISPLAY_TYPE, displayType);
+ }
+ /** Get the name of the display
+ * @return the name of the display
+ */
+ public String getDisplayName() {
+ return getString(KEY_DISPLAY_NAME);
+ }
+ /**
+ * Set the name of the display
+ * @param displayName the name of the display
+ */
+ public void setDisplayName( String displayName ) {
+ setValue(KEY_DISPLAY_NAME, displayName);
+ }
+ /**
+ *Get an array of TextField structures, each of which describes a field in the HMI which the application can write to using operations such as <i>{@linkplain Show}</i>, <i>{@linkplain SetMediaClockTimer}</i>, etc.
+ * This array of TextField structures identify all the text fields to which the application can write on the current display (identified by DisplayType ).
+ * @return the List of textFields
+ */
+ @SuppressWarnings("unchecked")
+ public List<TextField> getTextFields() {
+ return (List<TextField>) getObject(TextField.class, KEY_TEXT_FIELDS);
+ }
+ /**
+ * Set an array of TextField structures, each of which describes a field in the HMI which the application can write to using operations such as <i>{@linkplain Show}</i>, <i>{@linkplain SetMediaClockTimer}</i>, etc.
+ * This array of TextField structures identify all the text fields to which the application can write on the current display (identified by DisplayType ).
+ * @param textFields the List of textFields
+ */
+ public void setTextFields( @NonNull List<TextField> textFields ) {
+ setValue(KEY_TEXT_FIELDS, textFields);
+ }
+
+
+
+ @SuppressWarnings("unchecked")
+ public List<ImageField> getImageFields() {
+ return (List<ImageField>) getObject(ImageField.class, KEY_IMAGE_FIELDS);
+ }
+
+ public void setImageFields( List<ImageField> imageFields ) {
+ setValue(KEY_IMAGE_FIELDS, imageFields);
+ }
+
+ public Integer getNumCustomPresetsAvailable() {
+ return getInteger(KEY_NUM_CUSTOM_PRESETS_AVAILABLE);
+ }
+
+ public void setNumCustomPresetsAvailable(Integer numCustomPresetsAvailable) {
+ setValue(KEY_NUM_CUSTOM_PRESETS_AVAILABLE, numCustomPresetsAvailable);
+ }
+
+ /**
+ * Get an array of MediaClockFormat elements, defining the valid string formats used in specifying the contents of the media clock field
+ * @return the Veotor of mediaClockFormat
+ */
+ @SuppressWarnings("unchecked")
+ public List<MediaClockFormat> getMediaClockFormats() {
+ return (List<MediaClockFormat>) getObject(MediaClockFormat.class, KEY_MEDIA_CLOCK_FORMATS);
+ }
+ /**
+ * Set an array of MediaClockFormat elements, defining the valid string formats used in specifying the contents of the media clock field
+ * @param mediaClockFormats the List of MediaClockFormat
+ */
+ public void setMediaClockFormats( @NonNull List<MediaClockFormat> mediaClockFormats ) {
+ setValue(KEY_MEDIA_CLOCK_FORMATS, mediaClockFormats);
+ }
+
+ /**
+ * set the display's persistent screen supports.
+ * @param graphicSupported true if the display supports graphics, false if it does not
+ * @since SmartDeviceLink 2.0
+ */
+ public void setGraphicSupported(@NonNull Boolean graphicSupported) {
+ setValue(KEY_GRAPHIC_SUPPORTED, graphicSupported);
+ }
+
+ /**
+ * Get the display's persistent screen supports.
+ * @return true if the display supports graphics, false if it does not
+ * @since SmartDeviceLink 2.0
+ */
+ public Boolean getGraphicSupported() {
+ return getBoolean(KEY_GRAPHIC_SUPPORTED);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getTemplatesAvailable() {
+ return (List<String>) getObject(String.class, KEY_TEMPLATES_AVAILABLE);
+ }
+
+ public void setTemplatesAvailable(List<String> templatesAvailable) {
+ setValue(KEY_TEMPLATES_AVAILABLE, templatesAvailable);
+ }
+
+ public void setScreenParams(ScreenParams screenParams) {
+ setValue(KEY_SCREEN_PARAMS, screenParams);
+ }
+
+ @SuppressWarnings("unchecked")
+ public ScreenParams getScreenParams() {
+ return (ScreenParams) getObject(ScreenParams.class, KEY_SCREEN_PARAMS);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java
new file mode 100644
index 000000000..cce644c6b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
+
+import java.util.Hashtable;
+
+/** Emergency Call notification and confirmation data.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>eCallNotificationStatus</td>
+ * <td>VehicleDataNotificationStatus</td>
+ * <td>References signal "eCallNotification_4A".</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>auxECallNotificationStatus</td>
+ * <td>VehicleDataNotificationStatus</td>
+ * <td>References signal "eCallNotification". This is an alternative signal available on some carlines replacing the eCallNotificationStatus, but showing the same values.</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>eCallConfirmationStatus</td>
+ * <td>ECallConfirmationStatus</td>
+ * <td>References signal "eCallConfirmation"</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ * @see SubscribeVehicleData
+ *
+ *
+ *
+ */
+
+public class ECallInfo extends RPCStruct {
+ public static final String KEY_E_CALL_NOTIFICATION_STATUS = "eCallNotificationStatus";
+ public static final String KEY_AUX_E_CALL_NOTIFICATION_STATUS = "auxECallNotificationStatus";
+ public static final String KEY_E_CALL_CONFIRMATION_STATUS = "eCallConfirmationStatus";
+ /** Constructs a new ECallInfo object
+ */
+ public ECallInfo() { }
+ /** Constructs a new ECallInfo object indicated by the Hashtable
+ * parameter
+ * @param hash <p>The hash table to use</p>
+ */
+ public ECallInfo(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new ECallInfo object
+ */
+ public ECallInfo(@NonNull VehicleDataNotificationStatus eCallNotificationStatus, @NonNull VehicleDataNotificationStatus auxECallNotificationStatus, @NonNull ECallConfirmationStatus eCallConfirmationStatus) {
+ this();
+ setECallNotificationStatus(eCallNotificationStatus);
+ setAuxECallNotificationStatus(auxECallNotificationStatus);
+ setECallConfirmationStatus(eCallConfirmationStatus);
+ }
+
+ public void setECallNotificationStatus(@NonNull VehicleDataNotificationStatus eCallNotificationStatus) {
+ setValue(KEY_E_CALL_NOTIFICATION_STATUS, eCallNotificationStatus);
+ }
+ public VehicleDataNotificationStatus getECallNotificationStatus() {
+ return (VehicleDataNotificationStatus) getObject(VehicleDataNotificationStatus.class, KEY_E_CALL_NOTIFICATION_STATUS);
+ }
+ public void setAuxECallNotificationStatus(@NonNull VehicleDataNotificationStatus auxECallNotificationStatus) {
+ setValue(KEY_AUX_E_CALL_NOTIFICATION_STATUS, auxECallNotificationStatus);
+ }
+ public VehicleDataNotificationStatus getAuxECallNotificationStatus() {
+ return (VehicleDataNotificationStatus) getObject(VehicleDataNotificationStatus.class, KEY_AUX_E_CALL_NOTIFICATION_STATUS);
+ }
+ public void setECallConfirmationStatus(@NonNull ECallConfirmationStatus eCallConfirmationStatus) {
+ setValue(KEY_E_CALL_CONFIRMATION_STATUS, eCallConfirmationStatus);
+ }
+ public ECallConfirmationStatus getECallConfirmationStatus() {
+ return (ECallConfirmationStatus) getObject(ECallConfirmationStatus.class, KEY_E_CALL_CONFIRMATION_STATUS);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java
new file mode 100644
index 000000000..b66d4d931
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
+import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+
+import java.util.Hashtable;
+
+/** Information related to an emergency event (and if it occurred).
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th>Description</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>emergencyEventType</td>
+ * <td>EmergencyEventType</td>
+ * <td></td>
+ * <td>References signal "VedsEvntType_D_Ltchd". See{@linkplain EmergencyEventType}</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelCutoffStatus</td>
+ * <td>FuelCutoffStatus</td>
+ * <td></td>
+ * <td>References signal "RCM_FuelCutoff". See{@linkplain FuelCutoffStatus}</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>rolloverEvent</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td></td>
+ * <td>References signal "VedsEvntRoll_D_Ltchd". See{@linkplain VehicleDataEventStatus}</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>maximumChangeVelocity</td>
+ * <td>Integer</td>
+ * <td></td>
+ * <td>References signal "VedsMaxDeltaV_D_Ltchd".</td>
+ * <td>minvalue=0; maxvalue=255;<p> Additional reserved values:</p> <p>0x00 No event; 0xFE Not supported; 0xFF Fault</p> </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ *
+ * <tr>
+ * <td>multipleEvents</td>
+ * <td>VehicleDataEventStatus</td>
+ * <td></td>
+ * <td>References signal "VedsMultiEvnt_D_Ltchd". See{@linkplain VehicleDataEventStatus}</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ *
+ * @see Image
+ * @see SubscribeVehicleData
+ * @since SmartDeviceLink 2.0
+ *
+ */
+
+public class EmergencyEvent extends RPCStruct {
+ public static final String KEY_EMERGENCY_EVENT_TYPE = "emergencyEventType";
+ public static final String KEY_FUEL_CUTOFF_STATUS = "fuelCutoffStatus";
+ public static final String KEY_ROLLOVER_EVENT = "rolloverEvent";
+ public static final String KEY_MAXIMUM_CHANGE_VELOCITY = "maximumChangeVelocity";
+ public static final String KEY_MULTIPLE_EVENTS = "multipleEvents";
+
+ /** Constructs a new EmergencyEvent object
+ *
+ */
+ public EmergencyEvent() { }
+ /** Constructs a new EmergencyEvent object indicated by the Hashtable
+ * parameter
+ * @param hash <p>The hash table to use</p>
+ */
+ public EmergencyEvent(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new EmergencyEvent object
+ */
+ public EmergencyEvent(@NonNull EmergencyEventType emergencyEventType, @NonNull FuelCutoffStatus fuelCutoffStatus, @NonNull VehicleDataEventStatus rolloverEvent, @NonNull Integer maximumChangeVelocity, @NonNull VehicleDataEventStatus multipleEvents) {
+ this();
+ setEmergencyEventType(emergencyEventType);
+ setFuelCutoffStatus(fuelCutoffStatus);
+ setRolloverEvent(rolloverEvent);
+ setMaximumChangeVelocity(maximumChangeVelocity);
+ setMultipleEvents(multipleEvents);
+ }
+
+ public void setEmergencyEventType(@NonNull EmergencyEventType emergencyEventType) {
+ setValue(KEY_EMERGENCY_EVENT_TYPE, emergencyEventType);
+ }
+ public EmergencyEventType getEmergencyEventType() {
+ return (EmergencyEventType) getObject(EmergencyEventType.class, KEY_EMERGENCY_EVENT_TYPE);
+ }
+ public void setFuelCutoffStatus(@NonNull FuelCutoffStatus fuelCutoffStatus) {
+ setValue(KEY_FUEL_CUTOFF_STATUS, fuelCutoffStatus);
+ }
+ public FuelCutoffStatus getFuelCutoffStatus() {
+ return (FuelCutoffStatus) getObject(FuelCutoffStatus.class, KEY_FUEL_CUTOFF_STATUS);
+ }
+ public void setRolloverEvent(@NonNull VehicleDataEventStatus rolloverEvent) {
+ setValue(KEY_ROLLOVER_EVENT, rolloverEvent);
+ }
+ public VehicleDataEventStatus getRolloverEvent() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_ROLLOVER_EVENT);
+ }
+ public void setMaximumChangeVelocity(@NonNull Integer maximumChangeVelocity) {
+ setValue(KEY_MAXIMUM_CHANGE_VELOCITY, maximumChangeVelocity);
+ }
+ public Integer getMaximumChangeVelocity() {
+ return getInteger(KEY_MAXIMUM_CHANGE_VELOCITY);
+ }
+ public void setMultipleEvents(@NonNull VehicleDataEventStatus multipleEvents) {
+ setValue(KEY_MULTIPLE_EVENTS, multipleEvents);
+ }
+ public VehicleDataEventStatus getMultipleEvents() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MULTIPLE_EVENTS);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThru.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThru.java
new file mode 100644
index 000000000..a51ef4672
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThru.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * When this request is invoked, the audio capture stops
+ *
+ * <p>Function Group: AudioPassThru</p>
+ *
+ * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>
+ *
+ * <p><b>Request</b></p>
+ *
+ * <p>No parameters.</p>
+ * <p><b>Response</b> </p>
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ * <p>DISALLOWED</p>
+ * @since SmartDeviceLink 2.0
+ * @see PerformAudioPassThru
+ */
+public class EndAudioPassThru extends RPCRequest {
+
+ /**
+ * Constructs a new EndAudioPassThru object
+ */
+ public EndAudioPassThru() {
+ super(FunctionID.END_AUDIO_PASS_THRU.toString());
+ }
+
+ /**
+ * <p>Constructs a new EndAudioPassThru object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public EndAudioPassThru(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java
new file mode 100644
index 000000000..277cd236f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * End Audio Pass Thru Response is sent, when EndAudioPassThru has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class EndAudioPassThruResponse extends RPCResponse {
+
+ /**
+ * Constructs a new EndAudioPassThruResponse object
+ */
+ public EndAudioPassThruResponse() {
+ super(FunctionID.END_AUDIO_PASS_THRU.toString());
+ }
+ public EndAudioPassThruResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new EndAudioPassThruResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public EndAudioPassThruResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java
new file mode 100644
index 000000000..a680cfdb0
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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 ID that represents the channel these settings should be applied
+ */
+ 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/base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java
new file mode 100644
index 000000000..1457a7459
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.FuelType;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import java.util.Hashtable;
+
+public class FuelRange extends RPCStruct{
+ public static final String KEY_TYPE = "type";
+ public static final String KEY_RANGE = "range";
+
+ /**
+ * Constructs a new FuelRange object
+ */
+ public FuelRange() { }
+
+ /**
+ * <p>Constructs a new FuelRange object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public FuelRange(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the type portion of the FuelRange class
+ *
+ * @param fuelType the type of fuel related to this FuelRange object.
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.FuelType
+ */
+ public void setType(FuelType fuelType) {
+ setValue(KEY_TYPE, fuelType);
+ }
+
+ /**
+ * Gets the type portion of the FuelRange class
+ *
+ * @return FuelType.
+ */
+ public FuelType getType() {
+ return (FuelType) getObject(FuelType.class, KEY_TYPE);
+ }
+
+ /**
+ * Gets the range portion of the FuelRange class
+ *
+ * @return Float - The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ */
+ public Float getRange() {
+ Object object = getValue(KEY_RANGE);
+ return SdlDataTypeConverter.objectToFloat(object);
+ }
+
+ /**
+ * Sets the range portion of the FuelRange class
+ *
+ * @param range
+ * The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ */
+ public void setRange(Float range) {
+ setValue(KEY_RANGE, range);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
new file mode 100644
index 000000000..40b5af70f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
@@ -0,0 +1,524 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
+import com.smartdevicelink.proxy.rpc.enums.Dimension;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import java.util.Hashtable;
+
+/**
+ * Describes the GPS data. Not all data will be available on all carlines.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>longitudeDegrees</td>
+ * <td>Double</td>
+ * <td>Minvalue: - 180
+ * <b>Maxvalue: 180
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>latitudeDegrees</td>
+ * <td>Double</td>
+ * <td>Minvalue: - 90<b>Maxvalue: 90
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>utcYear</td>
+ * <td>Integer</td>
+ * <td>Minvalue: 2010<b>Maxvalue: 2100
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>utcMonth</td>
+ * <td>Integer</td>
+ * <td>Minvalue: 1<b>Maxvalue: 12
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>utcDay</td>
+ * <td>Integer</td>
+ * <td>Minvalue: 1<b>Maxvalue: 31
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>utcHours</td>
+ * <td>Integer</td>
+ * <td>Minvalue: 0<b>Maxvalue: 23
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>utcMinutes</td>
+ * <td>Integer</td>
+ * <td>Minvalue: 0<b>Maxvalue: 59
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>utcSeconds</td>
+ * <td>Integer</td>
+ * <td>Minvalue: 0<b>Maxvalue: 59
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>pdop</td>
+ * <td>Integer</td>
+ * <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. 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. 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>actual</td>
+ * <td>Boolean</td>
+ * <td>True, if coordinates are based on satellites.
+ * False, if based on dead reckoning
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>satellites</td>
+ * <td>Integer</td>
+ * <td>Number of satellites in view
+ * <b>Minvalue: 0
+ * <b>Maxvalue: 31
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>altitude</td>
+ * <td>Integer</td>
+ * <td>Altitude in meters
+ * <b>Minvalue: -10000</b>
+ * <b>Maxvalue: 10000</b>
+ * <b>Note:</b> SYNC uses Mean Sea Level for calculating GPS. </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>heading</td>
+ * <td>Double</td>
+ * <td>The heading. North is 0, East is 90, etc.
+ * <b>Minvalue: 0
+ * <b>Maxvalue: 359.99
+ * <b>Resolution is 0.01
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>speed</td>
+ * <td>Integer</td>
+ * <td>The speed in KPH
+ * <b>Minvalue: 0
+ * <b>Maxvalue: 500
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class GPSData extends RPCStruct {
+ public static final String KEY_LONGITUDE_DEGREES = "longitudeDegrees";
+ public static final String KEY_LATITUDE_DEGREES = "latitudeDegrees";
+ public static final String KEY_UTC_YEAR = "utcYear";
+ public static final String KEY_UTC_MONTH = "utcMonth";
+ public static final String KEY_UTC_DAY = "utcDay";
+ public static final String KEY_UTC_HOURS = "utcHours";
+ public static final String KEY_UTC_MINUTES = "utcMinutes";
+ public static final String KEY_UTC_SECONDS = "utcSeconds";
+ public static final String KEY_COMPASS_DIRECTION = "compassDirection";
+ public static final String KEY_PDOP = "pdop";
+ public static final String KEY_VDOP = "vdop";
+ public static final String KEY_HDOP = "hdop";
+ public static final String KEY_ACTUAL = "actual";
+ public static final String KEY_SATELLITES = "satellites";
+ public static final String KEY_DIMENSION = "dimension";
+ public static final String KEY_ALTITUDE = "altitude";
+ public static final String KEY_HEADING = "heading";
+ public static final String KEY_SPEED = "speed";
+
+ /**
+ * 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
+ */
+ public GPSData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * 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,
+ @NonNull Double pdop, @NonNull Double hdop, @NonNull Double vdop, @NonNull Boolean actual,
+ @NonNull Integer satellites, @NonNull Dimension dimension, @NonNull Double altitude, @NonNull Double heading, @NonNull Double speed) {
+ this();
+ setLongitudeDegrees(longitudeDegrees);
+ setLatitudeDegrees(latitudeDegrees);
+ setUtcYear(utcYear);
+ setUtcMonth(utcMonth);
+ setUtcDay(utcDay);
+ setUtcHours(utcHours);
+ setUtcMinutes(utcMinutes);
+ setUtcSeconds(utcSeconds);
+ setCompassDirection(compassDirection);
+ setPdop(pdop);
+ setHdop(hdop);
+ setVdop(vdop);
+ setActual(actual);
+ setSatellites(satellites);
+ setDimension(dimension);
+ setAltitude(altitude);
+ 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 degrees of the longitudinal position
+ */
+ public void setLongitudeDegrees(@NonNull Double longitudeDegrees) {
+ setValue(KEY_LONGITUDE_DEGREES, longitudeDegrees);
+ }
+
+ /**
+ * get longitude degrees
+ * @return longitude degrees
+ */
+ public Double getLongitudeDegrees() {
+ Object object = getValue(KEY_LONGITUDE_DEGREES);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ /**
+ * set latitude degrees
+ * @param latitudeDegrees degrees of the latitudinal position
+ */
+ public void setLatitudeDegrees(@NonNull Double latitudeDegrees) {
+ setValue(KEY_LATITUDE_DEGREES, latitudeDegrees);
+ }
+
+ /**
+ * get latitude degrees
+ * @return latitude degrees
+ */
+ public Double getLatitudeDegrees() {
+ Object object = getValue(KEY_LATITUDE_DEGREES);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ /**
+ * set utc year
+ * @param utcYear utc year
+ */
+ public void setUtcYear(Integer utcYear) {
+ setValue(KEY_UTC_YEAR, utcYear);
+ }
+
+ /**
+ * get utc year
+ * @return utc year
+ */
+ public Integer getUtcYear() {
+ return getInteger(KEY_UTC_YEAR);
+ }
+
+ /**
+ * set utc month
+ * @param utcMonth utc month
+ */
+ public void setUtcMonth(Integer utcMonth) {
+ setValue(KEY_UTC_MONTH, utcMonth);
+ }
+
+ /**
+ * get utc month
+ * @return utc month
+ */
+ public Integer getUtcMonth() {
+ return getInteger(KEY_UTC_MONTH);
+ }
+
+ /**
+ * set utc day
+ * @param utcDay utc day
+ */
+ public void setUtcDay(Integer utcDay) {
+ setValue(KEY_UTC_DAY, utcDay);
+ }
+
+ /**
+ * get utc day
+ * @return utc day
+ */
+ public Integer getUtcDay() {
+ return getInteger(KEY_UTC_DAY);
+ }
+
+ /**
+ * set utc hours
+ * @param utcHours utc hours
+ */
+ public void setUtcHours(Integer utcHours) {
+ setValue(KEY_UTC_HOURS, utcHours);
+ }
+
+ /**
+ * get utc hours
+ * @return utc hours
+ */
+ public Integer getUtcHours() {
+ return getInteger(KEY_UTC_HOURS);
+ }
+
+ /**
+ * set utc minutes
+ * @param utcMinutes utc minutes
+ */
+ public void setUtcMinutes(Integer utcMinutes) {
+ setValue(KEY_UTC_MINUTES, utcMinutes);
+ }
+
+ /**
+ * get utc minutes
+ * @return utc minutes
+ */
+ public Integer getUtcMinutes() {
+ return getInteger(KEY_UTC_MINUTES);
+ }
+
+ /**
+ * set utc seconds
+ * @param utcSeconds utc seconds
+ */
+ public void setUtcSeconds(Integer utcSeconds) {
+ setValue(KEY_UTC_SECONDS, utcSeconds);
+ }
+
+ /**
+ * get utc seconds
+ * @return utc seconds
+ */
+ public Integer getUtcSeconds() {
+ return getInteger(KEY_UTC_SECONDS);
+ }
+ public void setCompassDirection(CompassDirection compassDirection) {
+ setValue(KEY_COMPASS_DIRECTION, compassDirection);
+ }
+ public CompassDirection getCompassDirection() {
+ return (CompassDirection) getObject(CompassDirection.class, KEY_COMPASS_DIRECTION);
+ }
+
+ /**
+ * set the positional dilution of precision
+ * @param pdop the positional dilution of precision
+ */
+ public void setPdop(Double pdop) {
+ setValue(KEY_PDOP, pdop);
+ }
+
+ /**
+ * get the positional dilution of precision
+ */
+ public Double getPdop() {
+ Object object = getValue(KEY_PDOP);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ /**
+ * set the horizontal dilution of precision
+ * @param hdop the horizontal dilution of precision
+ */
+ public void setHdop(Double hdop) {
+ setValue(KEY_HDOP, hdop);
+ }
+
+ /**
+ * get the horizontal dilution of precision
+ * @return the horizontal dilution of precision
+ */
+ public Double getHdop() {
+ Object object = getValue(KEY_HDOP);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ /**
+ * set the vertical dilution of precision
+ * @param vdop the vertical dilution of precision
+ */
+ public void setVdop(Double vdop) {
+ setValue(KEY_VDOP, vdop);
+ }
+
+ /**
+ * get the vertical dilution of precision
+ * @return the vertical dilution of precision
+ */
+ public Double getVdop() {
+ Object object = getValue(KEY_VDOP);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ /**
+ * set what coordinates based on
+ * @param actual True, if coordinates are based on satellites.False, if based on dead reckoning
+ */
+ public void setActual(Boolean actual) {
+ setValue(KEY_ACTUAL, actual);
+ }
+
+ /**
+ * get what coordinates based on
+ * @return True, if coordinates are based on satellites.False, if based on dead reckoning
+ */
+ public Boolean getActual() {
+ return getBoolean(KEY_ACTUAL);
+ }
+
+ /**
+ * set the number of satellites in view
+ * @param satellites the number of satellites in view
+ */
+ public void setSatellites(Integer satellites) {
+ setValue(KEY_SATELLITES, satellites);
+ }
+
+ /**
+ * get the number of satellites in view
+ * @return the number of satellites in view
+ */
+ public Integer getSatellites() {
+ return getInteger(KEY_SATELLITES);
+ }
+ public void setDimension(Dimension dimension) {
+ setValue(KEY_DIMENSION, dimension);
+ }
+ public Dimension getDimension() {
+ return (Dimension) getObject(Dimension.class, KEY_DIMENSION);
+ }
+
+ /**
+ * set altitude in meters
+ * @param altitude altitude in meters
+ */
+ public void setAltitude(Double altitude) {
+ setValue(KEY_ALTITUDE, altitude);
+ }
+
+ /**
+ * get altitude in meters
+ * @return altitude in meters
+ */
+ public Double getAltitude() {
+ Object object = getValue(KEY_ALTITUDE);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ /**
+ * set the heading.North is 0, East is 90, etc.
+ * @param heading the heading.
+ */
+ public void setHeading(Double heading) {
+ setValue(KEY_HEADING, heading);
+ }
+
+ /**
+ * get the heading
+ */
+ public Double getHeading() {
+ Object object = getValue(KEY_HEADING);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ /**
+ * set speed in KPH
+ * @param speed the speed
+ */
+ public void setSpeed(Double speed) {
+ setValue(KEY_SPEED, speed);
+ }
+
+ /**
+ * get the speed in KPH
+ * @return the speed in KPH
+ */
+ public Double getSpeed() {
+ Object object = getValue(KEY_SPEED);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java
new file mode 100644
index 000000000..857322939
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Generic Response is sent, when the name of a received msg cannot be
+ * retrieved. Only used in case of an error. Currently, only resultCode
+ * INVALID_DATA is used.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>success</td>
+ * <td>Boolean</td>
+ * <td>true, if successful; false, if failed</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>resultCode</td>
+ * <td>Result</td>
+ * <td>Defines the possible result codes returned by SDL to the application in a Response to a requested operation</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>info</td>
+ * <td>String</td>
+ * <td>Provides additional human readable info regarding the result.</td>
+ * <td>N</td>
+ * <td>maxlength=1000</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ */
+public class GenericResponse extends RPCResponse {
+
+ public GenericResponse() {
+ super(FunctionID.GENERIC_RESPONSE.toString());
+ }
+ public GenericResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new GenericResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public GenericResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java
new file mode 100644
index 000000000..aefb1ef41
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * This request asks the module for current data related to the specific service.
+ * It also includes an option to subscribe to that service for future updates
+ */
+public class GetAppServiceData extends RPCRequest {
+
+ public static final String KEY_SERVICE_TYPE = "serviceType";
+ public static final String KEY_SUBSCRIBE = "subscribe";
+
+ // Constructors
+ /**
+ * Constructs a new GetAppServiceData object
+ */
+ public GetAppServiceData() {
+ super(FunctionID.GET_APP_SERVICE_DATA.toString());
+ }
+
+ /**
+ * Constructs a new GetAppServiceData object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public GetAppServiceData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new GetAppServiceData object with the mandatory appServiceType parameter
+ * @param appServiceType - The appServiceType
+ */
+ public GetAppServiceData(@NonNull String appServiceType) {
+ this();
+ setServiceType(appServiceType);
+ }
+
+ // Getters / Setters
+
+ /**
+ * @param appServiceType - the appServiceType
+ */
+ public void setServiceType(@NonNull String appServiceType){
+ setParameters(KEY_SERVICE_TYPE, appServiceType);
+ }
+
+ /**
+ * @return appServiceType
+ */
+ public String getServiceType(){
+ return getString(KEY_SERVICE_TYPE);
+ }
+
+ /**
+ * If true, the consumer is requesting to subscribe to all future updates from the service
+ * publisher. If false, the consumer doesn't wish to subscribe and should be unsubscribed
+ * if it was previously subscribed.
+ * @param subscribe -
+ */
+ public void setSubscribe(Boolean subscribe){
+ setParameters(KEY_SUBSCRIBE, subscribe);
+ }
+
+ /**
+ * If true, the consumer is requesting to subscribe to all future updates from the service
+ * publisher. If false, the consumer doesn't wish to subscribe and should be unsubscribed
+ * if it was previously subscribed.
+ * @return subscribe
+ */
+ public Boolean getSubscribe(){
+ return getBoolean(KEY_SUBSCRIBE);
+ }
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java
new file mode 100644
index 000000000..c7aabd7fe
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * This response includes the data that was requested from the specific service
+ */
+public class GetAppServiceDataResponse extends RPCResponse {
+
+ public static final String KEY_SERVICE_DATA = "serviceData";
+
+ // Constructors
+
+ public GetAppServiceDataResponse(){
+ super(FunctionID.GET_APP_SERVICE_DATA.toString());
+ }
+
+ public GetAppServiceDataResponse(Hashtable<String, Object> hash){
+ super(hash);
+ }
+
+ public GetAppServiceDataResponse(@NonNull Boolean success, @NonNull Result resultCode){
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param serviceData -
+ */
+ public void setServiceData(AppServiceData serviceData){
+ setParameters(KEY_SERVICE_DATA, serviceData);
+ }
+
+ /**
+ * @return serviceData
+ */
+ public AppServiceData getServiceData(){
+ return (AppServiceData) getObject(AppServiceData.class, KEY_SERVICE_DATA);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java
new file mode 100644
index 000000000..c08d4e92f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+public class GetCloudAppProperties extends RPCRequest {
+
+ public static final String KEY_APP_ID = "appID";
+
+ public GetCloudAppProperties() {
+ super(FunctionID.GET_CLOUD_APP_PROPERTIES.toString());
+ }
+
+ public GetCloudAppProperties(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public GetCloudAppProperties(@NonNull String appID){
+ this();
+ setParameters(KEY_APP_ID, appID);
+ }
+
+ public void setAppID(String appId){
+ setParameters(KEY_APP_ID, appId);
+ }
+
+ public String getAppID(){
+ return getString((KEY_APP_ID));
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java
new file mode 100644
index 000000000..7f779feff
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class GetCloudAppPropertiesResponse extends RPCResponse {
+
+ public static final String KEY_PROPERTIES = "properties";
+
+ public GetCloudAppPropertiesResponse() {
+ super(FunctionID.GET_CLOUD_APP_PROPERTIES.toString());
+ }
+
+ public GetCloudAppPropertiesResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new GetCloudAppPropertiesResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public GetCloudAppPropertiesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ public void setCloudAppProperties(CloudAppProperties cloudAppProperties){
+ setParameters(KEY_PROPERTIES, cloudAppProperties);
+ }
+
+ public CloudAppProperties getCloudAppProperties(){
+ return (CloudAppProperties) getObject(CloudAppProperties.class, KEY_PROPERTIES);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java
new file mode 100644
index 000000000..9a632d5db
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * This RPC allows to request diagnostic module trouble codes from a certain
+ * vehicle module.
+ *
+ *<p> Function Group: ProprietaryData</p>
+ *
+ *<p> <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>ecuName</td>
+ * <td>Integer</td>
+ * <td>Name of ECU.</td>
+ * <td>Y</td>
+ * <td>Min Value: 0; Max Value: 65535</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>dtcMask</td>
+ * <td>Integer</td>
+ * <td>DTC Mask Byte to be sent in diagnostic request to module.</td>
+ * <td>N</td>
+ * <td>Min Value: 0; Max Value: 255</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * </table>
+ * <p><b>Response</b></p>
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ *<p> SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ *<p> OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ *<p>GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ * <p>DISALLOWED </p>
+ * <p>USER_DISALLOWED</p>
+ * @since SmartDeviceLink 2.0
+ */
+public class GetDTCs extends RPCRequest {
+ public static final String KEY_DTC_MASK = "dtcMask";
+ public static final String KEY_ECU_NAME = "ecuName";
+
+ /**
+ * Constructs a new GetDTCs object
+ */
+ public GetDTCs() {
+ super(FunctionID.GET_DTCS.toString());
+ }
+
+ /**
+ * <p>Constructs a new GetDTCs object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public GetDTCs(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new GetDTCs object
+ * @param ecuName an Integer value representing a name of the module to receive the DTC form <br>
+ * <b>Notes: </b>Minvalue:0; Maxvalue:65535
+ */
+ public GetDTCs(@NonNull Integer ecuName) {
+ this();
+ setEcuName(ecuName);
+ }
+
+ /**
+ * Sets a name of the module to receive the DTC form
+ *
+ * @param ecuName
+ * an Integer value representing a name of the module to receive
+ * the DTC form
+ * <p>
+ * <b>Notes:</p> </b>Minvalue:0; Maxvalue:65535
+ */
+ public void setEcuName(@NonNull Integer ecuName) {
+ setParameters(KEY_ECU_NAME, ecuName);
+ }
+
+ /**
+ * Gets a name of the module to receive the DTC form
+ *
+ * @return Integer -an Integer value representing a name of the module to
+ * receive the DTC form
+ */
+ public Integer getEcuName() {
+ return getInteger(KEY_ECU_NAME);
+ }
+ public void setDtcMask(Integer dtcMask) {
+ setParameters(KEY_DTC_MASK, dtcMask);
+ }
+ public Integer getDtcMask() {
+ return getInteger(KEY_DTC_MASK);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
new file mode 100644
index 000000000..be970cc39
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Get DTCs Response is sent, when GetDTCs has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class GetDTCsResponse extends RPCResponse{
+
+ public static final String KEY_ECU_HEADER = "ecuHeader";
+ public static final String KEY_DTC = "dtc";
+
+ public GetDTCsResponse(){
+ super(FunctionID.GET_DTCS.toString());
+ }
+
+ public GetDTCsResponse(Hashtable<String, Object> hash){
+ super(hash);
+ }
+
+ /**
+ * Constructs a new GetDTCsResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ * @param ecuHeader representation of the ecu header that was returned from the GetDTC request
+ */
+ public GetDTCsResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer ecuHeader) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ setEcuHeader(ecuHeader);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getDtc(){
+ return (List<String>) getObject(String.class, KEY_DTC);
+ }
+
+ public void setDtc(List<String> dtc){
+ setParameters(KEY_DTC, dtc);
+ }
+
+ public Integer getEcuHeader(){
+ return getInteger(KEY_ECU_HEADER);
+ }
+
+ public void setEcuHeader(@NonNull Integer ecuHeader){
+ setParameters(KEY_ECU_HEADER, ecuHeader);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java
new file mode 100644
index 000000000..b67782fa3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+
+import java.util.Hashtable;
+
+/**
+ * This request is sent to the module to retrieve a file
+ */
+public class GetFile extends RPCRequest {
+
+ public static final String KEY_FILE_NAME = "fileName";
+ public static final String KEY_APP_SERVICE_ID = "appServiceId";
+ public static final String KEY_FILE_TYPE = "fileType";
+ public static final String KEY_OFFSET = "offset";
+ public static final String KEY_LENGTH = "length";
+
+ // Constructors
+
+ public GetFile() {
+ super(FunctionID.GET_FILE.toString());
+ }
+
+ public GetFile(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public GetFile(@NonNull String fileName) {
+ this();
+ setFileName(fileName);
+ }
+
+ // Setters and Getters
+
+ /**
+ * File name that should be retrieved.
+ * maxlength="255"
+ * @param fileName -
+ */
+ public void setFileName(@NonNull String fileName){
+ setParameters(KEY_FILE_NAME, fileName);
+ }
+
+ /**
+ * File name that should be retrieved.
+ * maxlength="255"
+ * @return fileName
+ */
+ public String getFileName(){
+ return getString(KEY_FILE_NAME);
+ }
+
+ /**
+ * ID of the service that should have uploaded the requested file
+ * @param appServiceId -
+ */
+ public void setAppServiceId(String appServiceId){
+ setParameters(KEY_APP_SERVICE_ID, appServiceId);
+ }
+
+ /**
+ * ID of the service that should have uploaded the requested file
+ * @return appServiceId
+ */
+ public String getAppServiceId(){
+ return getString(KEY_APP_SERVICE_ID);
+ }
+
+ /**
+ * Selected file type.
+ * @param fileType -
+ */
+ public void setFileType(FileType fileType){
+ setParameters(KEY_FILE_TYPE, fileType);
+ }
+
+ /**
+ * Selected file type.
+ * @return fileType
+ */
+ public FileType getFileType(){
+ return (FileType) getObject(FileType.class, KEY_FILE_TYPE);
+ }
+
+ /**
+ * Optional offset in bytes for resuming partial data chunks
+ * minvalue="0" maxvalue="2000000000"
+ * @param offset -
+ */
+ public void setOffset(Integer offset){
+ setParameters(KEY_OFFSET, offset);
+ }
+
+ /**
+ * Optional offset in bytes for resuming partial data chunks
+ * minvalue="0" maxvalue="2000000000"
+ * @return offset
+ */
+ public Integer getOffset(){
+ return getInteger(KEY_OFFSET);
+ }
+
+ /**
+ * Optional length in bytes for resuming partial data chunks if offset is set to 0, then length
+ * is the total length of the file to be downloaded
+ * minvalue="0" maxvalue="2000000000"
+ * @param length -
+ */
+ public void setLength(Integer length){
+ setParameters(KEY_LENGTH, length);
+ }
+
+ /**
+ * Optional length in bytes for resuming partial data chunks if offset is set to 0, then length
+ * is the total length of the file to be downloaded
+ * minvalue="0" maxvalue="2000000000"
+ * @return length
+ */
+ public Integer getLength(){
+ return getInteger(KEY_LENGTH);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java
new file mode 100644
index 000000000..e5ed08a85
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class GetFileResponse extends RPCResponse {
+
+ public static final String KEY_OFFSET = "offset";
+ public static final String KEY_LENGTH = "length";
+ public static final String KEY_FILE_TYPE = "fileType";
+ public static final String KEY_CRC = "crc";
+ /**
+ * Constructs a new PublishAppServiceResponse object
+ */
+ public GetFileResponse() {
+ super(FunctionID.GET_FILE.toString());
+ }
+
+ public GetFileResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new PublishAppServiceResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public GetFileResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ // Custom Getters / Setters
+
+ /**
+ * File type that is being sent in response
+ * @param fileType -
+ */
+ public void setFileType(FileType fileType){
+ setParameters(KEY_FILE_TYPE, fileType);
+ }
+
+ /**
+ * File type that is being sent in response
+ * @return fileType
+ */
+ public FileType getFileType(){
+ return (FileType) getObject(FileType.class, KEY_FILE_TYPE);
+ }
+
+ /**
+ * Optional offset in bytes for resuming partial data chunks
+ * minvalue="0" maxvalue="2000000000"
+ * @param offset -
+ */
+ public void setOffset(Integer offset){
+ setParameters(KEY_OFFSET, offset);
+ }
+
+ /**
+ * Optional offset in bytes for resuming partial data chunks
+ * minvalue="0" maxvalue="2000000000"
+ * @return offset
+ */
+ public Integer getOffset(){
+ return getInteger(KEY_OFFSET);
+ }
+
+ /**
+ * Optional length in bytes for resuming partial data chunks if offset is set to 0, then length
+ * is the total length of the file to be downloaded
+ * minvalue="0" maxvalue="2000000000"
+ * @param length -
+ */
+ public void setLength(Integer length){
+ setParameters(KEY_LENGTH, length);
+ }
+
+ /**
+ * Optional length in bytes for resuming partial data chunks if offset is set to 0, then length
+ * is the total length of the file to be downloaded
+ * minvalue="0" maxvalue="2000000000"
+ * @return length
+ */
+ public Integer getLength(){
+ return getInteger(KEY_LENGTH);
+ }
+
+ /**
+ * Additional CRC32 checksum to protect data integrity up to 512 Mbits
+ * minvalue="0" maxvalue="4294967295"
+ * @param crc -
+ */
+ public void setCRC(Integer crc){
+ setParameters(KEY_CRC, crc);
+ }
+
+ /**
+ * Additional CRC32 checksum to protect data integrity up to 512 Mbits
+ * minvalue="0" maxvalue="4294967295"
+ * @return crc
+ */
+ public Integer getCRC(){
+ return getInteger(KEY_CRC);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java
new file mode 100644
index 000000000..fecf4463f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.ModuleType;
+
+import java.util.Hashtable;
+
+/**
+ * Read the current status value of specified remote control module (type). In addition,
+ * When subscribe=true, subscribes for specific remote control module data items;
+ * When subscribe=false, un-subscribes for specific remote control module data items.
+ * Once subscribed, the application will be notified by the onInteriorVehicleData notification
+ * whenever new data is available for the module.
+ */
+public class GetInteriorVehicleData extends RPCRequest {
+ public static final String KEY_MODULE_TYPE = "moduleType";
+ public static final String KEY_SUBSCRIBE = "subscribe";
+
+ /**
+ * Constructs a new GetInteriorVehicleData object
+ */
+ public GetInteriorVehicleData() {
+ super(FunctionID.GET_INTERIOR_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * <p>Constructs a new GetInteriorVehicleData object indicated by the
+ * Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public GetInteriorVehicleData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new GetInteriorVehicleData object
+ */
+ public GetInteriorVehicleData(@NonNull ModuleType moduleType) {
+ this();
+ setModuleType(moduleType);
+ }
+
+ /**
+ * Gets the ModuleType
+ *
+ * @return ModuleType - The type of a RC module to retrieve module data from the vehicle.
+ * In the future, this should be the Identification of a module.
+ */
+ public ModuleType getModuleType() {
+ return (ModuleType) getObject(ModuleType.class, KEY_MODULE_TYPE);
+ }
+
+ /**
+ * Sets a ModuleType
+ *
+ * @param moduleType
+ * The type of a RC module to retrieve module data from the vehicle.
+ * In the future, this should be the Identification of a module.
+ */
+ public void setModuleType(@NonNull ModuleType moduleType) {
+ setParameters(KEY_MODULE_TYPE, moduleType);
+ }
+
+ /**
+ * Sets subscribe parameter
+ *
+ * @param subscribe
+ * If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType.
+ * If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType.
+ */
+ public void setSubscribe(Boolean subscribe) {
+ setParameters(KEY_SUBSCRIBE, subscribe);
+ }
+
+ /**
+ * Gets subscribe parameter
+ *
+ * @return Boolean - If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType.
+ * If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType.
+ */
+ public Boolean getSubscribe() {
+ return getBoolean(KEY_SUBSCRIBE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
new file mode 100644
index 000000000..6c27b8b37
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class GetInteriorVehicleDataResponse extends RPCResponse {
+ public static final String KEY_MODULE_DATA = "moduleData";
+ public static final String KEY_IS_SUBSCRIBED = "isSubscribed";
+
+ /**
+ * Constructs a new GetInteriorVehicleDataResponse object
+ */
+ public GetInteriorVehicleDataResponse() {
+ super(FunctionID.GET_INTERIOR_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * <p>Constructs a new GetInteriorVehicleDataResponse object indicated by the
+ * Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public GetInteriorVehicleDataResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new GetInteriorVehicleDataResponse object
+ * @param moduleData specific data for the module that was requested
+ * @param resultCode whether the request is successfully processed
+ * @param success whether the request is successfully processed
+
+ */
+ public GetInteriorVehicleDataResponse( @NonNull ModuleData moduleData, @NonNull Result resultCode, @NonNull Boolean success) {
+ this();
+ setModuleData(moduleData);
+ setResultCode(resultCode);
+ setSuccess(success);
+ }
+
+ /**
+ * Gets the moduleData
+ *
+ * @return ModuleData
+ */
+ public ModuleData getModuleData() {
+ return (ModuleData) getObject(ModuleData.class, KEY_MODULE_DATA);
+ }
+
+ /**
+ * Sets the moduleData
+ *
+ * @param moduleData specific data for the module that was requested
+ */
+ public void setModuleData(ModuleData moduleData) {
+ setParameters(KEY_MODULE_DATA, moduleData);
+ }
+
+ /**
+ * Sets isSubscribed parameter
+ *
+ * @param isSubscribed
+ * It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
+ * If "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType.
+ * If "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.
+ * */
+ public void setIsSubscribed(Boolean isSubscribed) {
+ setParameters(KEY_IS_SUBSCRIBED, isSubscribed);
+ }
+
+ /**
+ * Gets isSubscribed parameter
+ *
+ * @return Boolean - It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
+ * If "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType.
+ * If "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.
+ * */
+ public Boolean getIsSubscribed() {
+ return getBoolean(KEY_IS_SUBSCRIBED);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java
new file mode 100644
index 000000000..e27031182
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+
+import java.util.Hashtable;
+
+/**
+ * Used to request the corresponding capability object for a given capability.
+ */
+
+public class GetSystemCapability extends RPCRequest {
+ public static final String KEY_SYSTEM_CAPABILITY_TYPE = "systemCapabilityType";
+ public static final String KEY_SUBSCRIBE = "subscribe";
+
+ /**
+ * Constructs a new GetSystemCapability object
+ */
+ public GetSystemCapability(){
+ super(FunctionID.GET_SYSTEM_CAPABILITY.toString());
+ }
+
+ /**
+ * <p>Constructs a new GetSystemCapability object indicated by the Hashtable parameter</p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public GetSystemCapability(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new GetSystemCapability object
+ * @param systemCapabilityType SystemCapabilityType being requested
+ */
+ public GetSystemCapability(@NonNull SystemCapabilityType systemCapabilityType){
+ this();
+ setSystemCapabilityType(systemCapabilityType);
+ }
+
+ /**
+ * Used to get the SystemCapabilityType being requested
+ * @return the SystemCapabilityType being requested
+ */
+ public SystemCapabilityType getSystemCapabilityType(){
+ return (SystemCapabilityType) getObject(SystemCapabilityType.class, KEY_SYSTEM_CAPABILITY_TYPE);
+ }
+
+ /**
+ * Used to set the SystemCapabilityType being requested
+ * @param value SystemCapabilityType being requested
+ */
+ public void setSystemCapabilityType(@NonNull SystemCapabilityType value){
+ setParameters(KEY_SYSTEM_CAPABILITY_TYPE, value);
+ }
+
+ /**
+ * Flag to subscribe to updates of the supplied service capability type. If true, the requester
+ * will be subscribed. If false, the requester will not be subscribed and be removed as a
+ * subscriber if it was previously subscribed.
+ * @return if the SystemCapabilityType is subscribed to
+ */
+ public Boolean getSubscribe(){
+ return getBoolean(KEY_SUBSCRIBE);
+ }
+
+ /**
+ * Flag to subscribe to updates of the supplied service capability type. If true, the requester
+ * will be subscribed. If false, the requester will not be subscribed and be removed as a
+ * subscriber if it was previously subscribed.
+ * @param subscribe to changes in the SystemCapabilityType
+ */
+ public void setSubscribe(Boolean subscribe){
+ setParameters(KEY_SUBSCRIBE, subscribe);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
new file mode 100644
index 000000000..8029e77e2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * GetSystemCapabilityResponse is sent, when GetSystemCapability has been called
+ */
+
+public class GetSystemCapabilityResponse extends RPCResponse {
+ public static final String KEY_SYSTEM_CAPABILITY = "systemCapability";
+
+ /**
+ * Constructs a new GetSystemCapability object
+ */
+ public GetSystemCapabilityResponse(){
+ super(FunctionID.GET_SYSTEM_CAPABILITY.toString());
+ }
+
+ /**
+ * <p>Constructs a new GetSystemCapability object indicated by the Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public GetSystemCapabilityResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new GetSystemCapabilityResponse object
+ * @param systemCapability SystemCapability object
+ * @param resultCode whether the request is successfully processed
+ * @param success whether the request is successfully processed
+ */
+ public GetSystemCapabilityResponse(@NonNull SystemCapability systemCapability, @NonNull Result resultCode, @NonNull Boolean success) {
+ this();
+ setSystemCapability(systemCapability);
+ setResultCode(resultCode);
+ setSuccess(success);
+ }
+
+ /**
+ * Get the SystemCapability object returned after a GetSystemCapability call
+ * @return SystemCapability object
+ */
+ public SystemCapability getSystemCapability(){
+ return (SystemCapability) getObject(SystemCapability.class, KEY_SYSTEM_CAPABILITY);
+ }
+
+ /**
+ * Set a SystemCapability object in the response
+ * @param value SystemCapability object
+ */
+ public void setSystemCapability(@NonNull SystemCapability value){
+ setParameters(KEY_SYSTEM_CAPABILITY, value);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java
new file mode 100644
index 000000000..d8c9d7077
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java
@@ -0,0 +1,543 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Non periodic vehicle data read request.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>gps</td>
+ * <td>Boolean</td>
+ * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData }for details</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>speed</td>
+ * <td>Boolean</td>
+ * <td>The vehicle speed in kilometers per hour</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>rpm</td>
+ * <td>Boolean</td>
+ * <td>The number of revolutions per minute of the engine</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelLevel</td>
+ * <td>Boolean</td>
+ * <td>The fuel level in the tank (percentage)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelLevel_State</td>
+ * <td>Boolean</td>
+ * <td>The fuel level state</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>instantFuelConsumption</td>
+ * <td>Boolean</td>
+ * <td>The instantaneous fuel consumption in microlitres</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>externalTemperature</td>
+ * <td>Boolean</td>
+ * <td>The external temperature in degrees celsius</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>vin</td>
+ * <td>Boolean</td>
+ * <td>Vehicle identification number</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>prndl</td>
+ * <td>Boolean</td>
+ * <td>Currently selected gear.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>tirePressure</td>
+ * <td>Boolean</td>
+ * <td>Tire pressure status</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>odometer</td>
+ * <td>Boolean</td>
+ * <td>Odometer in km</td>
+ * <td>N</td>
+ * <td>Max Length: 500</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>beltStatus</td>
+ * <td>Boolean</td>
+ * <td>The status of the seat belts</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>bodyInformation</td>
+ * <td>Boolean</td>
+ * <td>The body information including ignition status and internal temp</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>deviceStatus</td>
+ * <td>Boolean</td>
+ * <td>The device status including signal and battery strength</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>driverBraking</td>
+ * <td>Boolean</td>
+ * <td>The status of the brake pedal</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>wiperStatus</td>
+ * <td>Boolean</td>
+ * <td>The status of the wipers</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>headLampStatus</td>
+ * <td>Boolean</td>
+ * <td>Status of the head lamps</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>engineTorque</td>
+ * <td>Boolean</td>
+ * <td>Torque value for engine (in Nm) on non-diesel variants</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>engineOilLife</td>
+ * <td>Boolean</td>
+ * <td>The estimated percentage of remaining oil life of the engine</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>accPedalPosition</td>
+ * <td>Boolean</td>
+ * <td>Accelerator pedal position (percentage depressed)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>steeringWheelAngle</td>
+ * <td>Boolean</td>
+ * <td>Current angle of the steering wheel (in deg)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>turnSignal</td>
+ * <td>Boolean</td>
+ * <td>@see TurnSignal</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>cloudAppVehicleID</td>
+ * <td>Boolean</td>
+ * <td>ID for the vehicle when connecting to cloud applications</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.1 </td>
+ * </tr>
+ * </table>
+ *
+ *
+ * <p><b>Response</b></p>
+ *
+ * <p> <b>Non-default Result Codes:</b></p>
+ * <p> SUCCESS</p>
+ * <p> INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR</p>
+ * <p> REJECTED</p>
+ * <p> VEHICLE_DATA_NOT_ALLOWED</p>
+ * <p>VEHICLE_DATA_NOT_AVAILABLE</p>
+ * <p> USER_DISALLOWED</p>
+ *
+ * @see SubscribeVehicleData
+ * @see UnsubscribeVehicleData
+ * @since SmartDeviceLink 2.0
+ *
+ *
+ */
+public class GetVehicleData extends RPCRequest {
+ public static final String KEY_SPEED = "speed";
+ public static final String KEY_RPM = "rpm";
+ public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ public static final String KEY_VIN = "vin";
+ public static final String KEY_PRNDL = "prndl";
+ public static final String KEY_TIRE_PRESSURE = "tirePressure";
+ public static final String KEY_ENGINE_TORQUE = "engineTorque";
+ public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
+ public static final String KEY_ODOMETER = "odometer";
+ public static final String KEY_GPS = "gps";
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
+ public static final String KEY_BELT_STATUS = "beltStatus";
+ public static final String KEY_BODY_INFORMATION = "bodyInformation";
+ public static final String KEY_DEVICE_STATUS = "deviceStatus";
+ public static final String KEY_DRIVER_BRAKING = "driverBraking";
+ public static final String KEY_WIPER_STATUS = "wiperStatus";
+ public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
+ public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
+ public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
+ public static final String KEY_E_CALL_INFO = "eCallInfo";
+ public static final String KEY_AIRBAG_STATUS = "airbagStatus";
+ public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
+ public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
+ public static final String KEY_MY_KEY = "myKey";
+ public static final String KEY_FUEL_RANGE = "fuelRange";
+ public static final String KEY_TURN_SIGNAL = "turnSignal";
+ public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
+ public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+
+ /**
+ * Constructs a new GetVehicleData object
+ */
+
+ public GetVehicleData() {
+ super(FunctionID.GET_VEHICLE_DATA.toString());
+ }
+ /**
+ * <p>
+ * Constructs a new GetVehicleDta object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+
+ public GetVehicleData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ public void setGps(Boolean gps) {
+ setParameters(KEY_GPS, gps);
+ }
+ public Boolean getGps() {
+ return getBoolean(KEY_GPS);
+ }
+ public void setSpeed(Boolean speed) {
+ setParameters(KEY_SPEED, speed);
+ }
+ public Boolean getSpeed() {
+ return getBoolean(KEY_SPEED);
+ }
+ public void setRpm(Boolean rpm) {
+ setParameters(KEY_RPM, rpm);
+ }
+ public Boolean getRpm() {
+ return getBoolean(KEY_RPM);
+ }
+ public void setFuelLevel(Boolean fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ }
+ public Boolean getFuelLevel() {
+ return getBoolean(KEY_FUEL_LEVEL);
+ }
+ @Deprecated
+ public void setFuelLevel_State(Boolean fuelLevel_State) {
+ setFuelLevelState(fuelLevel_State);
+ }
+ @Deprecated
+ public Boolean getFuelLevel_State() {
+ return getFuelLevelState();
+ }
+ public void setFuelLevelState(Boolean fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ }
+ public Boolean getFuelLevelState() {
+ return getBoolean(KEY_FUEL_LEVEL_STATE);
+ }
+ public void setInstantFuelConsumption(Boolean instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ }
+ public Boolean getInstantFuelConsumption() {
+ return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
+ }
+ public void setExternalTemperature(Boolean externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ }
+ public Boolean getExternalTemperature() {
+ return getBoolean(KEY_EXTERNAL_TEMPERATURE);
+ }
+
+ public void setVin(Boolean vin) {
+ setParameters(KEY_VIN, vin);
+ }
+ public Boolean getVin() {
+ return getBoolean(KEY_VIN);
+ }
+
+ public void setPrndl(Boolean prndl) {
+ setParameters(KEY_PRNDL, prndl);
+ }
+ public Boolean getPrndl() {
+ return getBoolean(KEY_PRNDL);
+ }
+ public void setTirePressure(Boolean tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ }
+ public Boolean getTirePressure() {
+ return getBoolean(KEY_TIRE_PRESSURE);
+ }
+ public void setOdometer(Boolean odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ }
+ public Boolean getOdometer() {
+ return getBoolean(KEY_ODOMETER);
+ }
+ public void setBeltStatus(Boolean beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ }
+ public Boolean getBeltStatus() {
+ return getBoolean(KEY_BELT_STATUS);
+ }
+ public void setBodyInformation(Boolean bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ }
+ public Boolean getBodyInformation() {
+ return getBoolean(KEY_BODY_INFORMATION);
+ }
+ public void setDeviceStatus(Boolean deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ }
+ public Boolean getDeviceStatus() {
+ return getBoolean(KEY_DEVICE_STATUS);
+ }
+ public void setDriverBraking(Boolean driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ }
+ public Boolean getDriverBraking() {
+ return getBoolean(KEY_DRIVER_BRAKING);
+ }
+ public void setWiperStatus(Boolean wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ }
+ public Boolean getWiperStatus() {
+ return getBoolean(KEY_WIPER_STATUS);
+ }
+ public void setHeadLampStatus(Boolean headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ }
+ public Boolean getHeadLampStatus() {
+ return getBoolean(KEY_HEAD_LAMP_STATUS);
+ }
+ public void setEngineTorque(Boolean engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ }
+ public Boolean getEngineTorque() {
+ return getBoolean(KEY_ENGINE_TORQUE);
+ }
+ public void setEngineOilLife(Boolean engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ }
+ public Boolean getEngineOilLife() {
+ return getBoolean(KEY_ENGINE_OIL_LIFE);
+ }
+ public void setAccPedalPosition(Boolean accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ }
+ public Boolean getAccPedalPosition() {
+ return getBoolean(KEY_ACC_PEDAL_POSITION);
+ }
+
+ public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ }
+ public Boolean getSteeringWheelAngle() {
+ return getBoolean(KEY_STEERING_WHEEL_ANGLE);
+ }
+ public void setECallInfo(Boolean eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ }
+ public Boolean getECallInfo() {
+ return getBoolean(KEY_E_CALL_INFO);
+ }
+
+
+ public void setAirbagStatus(Boolean airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ }
+ public Boolean getAirbagStatus() {
+ return getBoolean(KEY_AIRBAG_STATUS);
+ }
+ public void setEmergencyEvent(Boolean emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ }
+ public Boolean getEmergencyEvent() {
+ return getBoolean(KEY_EMERGENCY_EVENT);
+ }
+ public void setClusterModeStatus(Boolean clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ }
+ public Boolean getClusterModeStatus() {
+ return getBoolean(KEY_CLUSTER_MODE_STATUS);
+ }
+ public void setMyKey(Boolean myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ }
+ public Boolean getMyKey() {
+ return getBoolean(KEY_MY_KEY);
+ }
+
+ /**
+ * Sets a boolean value. If true, gets fuelRange data
+ * @param fuelRange
+ * a boolean value
+ */
+ public void setFuelRange(Boolean fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ }
+
+ /**
+ * Gets a boolean value.
+ *
+ * @return Boolean -a Boolean value.
+ *
+ */
+ public Boolean getFuelRange() {
+ return getBoolean(KEY_FUEL_RANGE);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes turnSignal data
+ * @param turnSignal a boolean value
+ */
+ public void setTurnSignal(Boolean turnSignal) { setParameters(KEY_TURN_SIGNAL, turnSignal); }
+
+ /**
+ * Gets a boolean value. If true, means the turnSignal data has been subscribed.
+ * @return a Boolean value.
+ */
+ public Boolean getTurnSignal() { return getBoolean(KEY_TURN_SIGNAL); }
+
+ /**
+ * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
+ * @param electronicParkBrakeStatus a boolean value
+ */
+ public void setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus){
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
+ * @return a Boolean value.
+ */
+ public Boolean getElectronicParkBrakeStatus(){
+ return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, gets the cloudAppVehicleID data
+ * @param cloudAppVehicleID a boolean value
+ */
+ public void setCloudAppVehicleID(boolean cloudAppVehicleID){
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the cloudAppVehicleDataID data has been set to retrieve.
+ * @return a Boolean value.
+ */
+ public Boolean getCloudAppVehicleID(){
+ return getBoolean(KEY_CLOUD_APP_VEHICLE_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java
new file mode 100644
index 000000000..db09d86e5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java
@@ -0,0 +1,375 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
+import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
+import com.smartdevicelink.proxy.rpc.enums.PRNDL;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Get Vehicle Data Response is sent, when GetVehicleData has been called.
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class GetVehicleDataResponse extends RPCResponse {
+ public static final String KEY_SPEED = "speed";
+ public static final String KEY_RPM = "rpm";
+ public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ public static final String KEY_VIN = "vin";
+ public static final String KEY_PRNDL = "prndl";
+ public static final String KEY_TIRE_PRESSURE = "tirePressure";
+ public static final String KEY_ENGINE_TORQUE = "engineTorque";
+ public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
+ public static final String KEY_ODOMETER = "odometer";
+ public static final String KEY_GPS = "gps";
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
+ public static final String KEY_BELT_STATUS = "beltStatus";
+ public static final String KEY_BODY_INFORMATION = "bodyInformation";
+ public static final String KEY_DEVICE_STATUS = "deviceStatus";
+ public static final String KEY_DRIVER_BRAKING = "driverBraking";
+ public static final String KEY_WIPER_STATUS = "wiperStatus";
+ public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
+ public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
+ public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
+ public static final String KEY_E_CALL_INFO = "eCallInfo";
+ public static final String KEY_AIRBAG_STATUS = "airbagStatus";
+ public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
+ public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
+ public static final String KEY_MY_KEY = "myKey";
+ public static final String KEY_FUEL_RANGE = "fuelRange";
+ public static final String KEY_TURN_SIGNAL = "turnSignal";
+ public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
+ public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+
+ /**
+ * Constructs a new GetVehicleDataResponse object
+ */
+
+ public GetVehicleDataResponse() {
+ super(FunctionID.GET_VEHICLE_DATA.toString());
+ }
+ public GetVehicleDataResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new GetVehicleDataResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public GetVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+ public void setGps(GPSData gps) {
+ setParameters(KEY_GPS, gps);
+ }
+ @SuppressWarnings("unchecked")
+ public GPSData getGps() {
+ return (GPSData) getObject(GPSData.class, KEY_GPS);
+ }
+ public void setSpeed(Double speed) {
+ setParameters(KEY_SPEED, speed);
+ }
+ public Double getSpeed() {
+ Object object = getParameters(KEY_SPEED);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setRpm(Integer rpm) {
+ setParameters(KEY_RPM, rpm);
+ }
+ public Integer getRpm() {
+ return getInteger(KEY_RPM);
+ }
+ public void setFuelLevel(Double fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ }
+ public Double getFuelLevel() {
+ Object object = getParameters(KEY_FUEL_LEVEL);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ @Deprecated
+ public void setFuelLevel_State(ComponentVolumeStatus fuelLevel_State) {
+ setFuelLevelState(fuelLevel_State);
+ }
+ @Deprecated
+ public ComponentVolumeStatus getFuelLevel_State() {
+ return getFuelLevelState();
+ }
+ public void setFuelLevelState(ComponentVolumeStatus fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ }
+ public ComponentVolumeStatus getFuelLevelState() {
+ return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE);
+ }
+ public void setInstantFuelConsumption(Double instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ }
+ public Double getInstantFuelConsumption() {
+ Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setExternalTemperature(Double externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ }
+ public Double getExternalTemperature() {
+ Object object = getParameters(KEY_EXTERNAL_TEMPERATURE);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setVin(String vin) {
+ setParameters(KEY_VIN, vin);
+ }
+ public String getVin() {
+ return getString(KEY_VIN);
+ }
+ public void setPrndl(PRNDL prndl) {
+ setParameters(KEY_PRNDL, prndl);
+ }
+ public PRNDL getPrndl() {
+ return (PRNDL) getObject(PRNDL.class, KEY_PRNDL);
+ }
+ public void setTirePressure(TireStatus tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ }
+ @SuppressWarnings("unchecked")
+ public TireStatus getTirePressure() {
+ return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE);
+ }
+ public void setOdometer(Integer odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ }
+ public Integer getOdometer() {
+ return getInteger(KEY_ODOMETER);
+ }
+ public void setBeltStatus(BeltStatus beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public BeltStatus getBeltStatus() {
+ return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS);
+ }
+ public void setBodyInformation(BodyInformation bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ }
+ @SuppressWarnings("unchecked")
+ public BodyInformation getBodyInformation() {
+ return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION);
+ }
+ public void setDeviceStatus(DeviceStatus deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public DeviceStatus getDeviceStatus() {
+ return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS);
+ }
+ public void setDriverBraking(VehicleDataEventStatus driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ }
+ public VehicleDataEventStatus getDriverBraking() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING);
+ }
+ public void setWiperStatus(WiperStatus wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ }
+ public WiperStatus getWiperStatus() {
+ return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS);
+ }
+
+ public void setHeadLampStatus(HeadLampStatus headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public HeadLampStatus getHeadLampStatus() {
+ return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS);
+ }
+ public void setEngineTorque(Double engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ }
+ public Double getEngineTorque() {
+ Object object = getParameters(KEY_ENGINE_TORQUE);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setEngineOilLife(Float engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ }
+ public Float getEngineOilLife() {
+ Object object = getParameters(KEY_ENGINE_OIL_LIFE);
+ return SdlDataTypeConverter.objectToFloat(object);
+ }
+
+ public void setAccPedalPosition(Double accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ }
+ public Double getAccPedalPosition() {
+ Object object = getParameters(KEY_ACC_PEDAL_POSITION);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ public void setSteeringWheelAngle(Double steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ }
+ public Double getSteeringWheelAngle() {
+ Object object = getParameters(KEY_STEERING_WHEEL_ANGLE);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+
+ public void setECallInfo(ECallInfo eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ }
+ @SuppressWarnings("unchecked")
+ public ECallInfo getECallInfo() {
+ return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO);
+ }
+
+ public void setAirbagStatus(AirbagStatus airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public AirbagStatus getAirbagStatus() {
+ return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS);
+ }
+
+ public void setEmergencyEvent(EmergencyEvent emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ }
+ @SuppressWarnings("unchecked")
+ public EmergencyEvent getEmergencyEvent() {
+ return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT);
+ }
+ public void setClusterModeStatus(ClusterModeStatus clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public ClusterModeStatus getClusterModeStatus() {
+ return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS);
+ }
+ public void setMyKey(MyKey myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ }
+ @SuppressWarnings("unchecked")
+ public MyKey getMyKey() {
+ return (MyKey) getObject(MyKey.class, KEY_MY_KEY);
+ }
+
+ /**
+ * Sets Fuel Range List. Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ * @param fuelRange the range in KM left as well as fuel type
+ *
+ * @see com.smartdevicelink.proxy.rpc.FuelRange
+ * @see com.smartdevicelink.proxy.rpc.enums.FuelType
+ */
+ public void setFuelRange(List<FuelRange> fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ }
+
+ /**
+ * Gets Fuel Range List
+ * @return List<FuelRange>
+ * Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ */
+ @SuppressWarnings("unchecked")
+ public List<FuelRange> getFuelRange() {
+ return (List<FuelRange>) getObject(FuelRange.class, KEY_FUEL_RANGE);
+ }
+
+ /**
+ * Sets turnSignal
+ * @param turnSignal status of the turn signals
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.TurnSignal
+ */
+ public void setTurnSignal(TurnSignal turnSignal) {
+ setParameters(KEY_TURN_SIGNAL, turnSignal);
+ }
+
+ /**
+ * Gets turnSignal
+ * @return TurnSignal status of the turn signals
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.TurnSignal
+ */
+ @SuppressWarnings("unchecked")
+ public TurnSignal getTurnSignal() {
+ return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL);
+ }
+
+ /**
+ * Sets electronicParkBrakeStatus
+ * @param electronicParkBrakeStatus status of the electronic park brake of the connected vehicle
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus
+ */
+ public void setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus){
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ }
+
+ /**
+ * Gets electronicParkBrakeStatus
+ * @return ElectronicParkBrakeStatus status of the electronic park brake of the connected vehicle
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus
+ */
+ public ElectronicParkBrakeStatus getElectronicParkBrakeStatus(){
+ return (ElectronicParkBrakeStatus) getObject(ElectronicParkBrakeStatus.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ }
+
+ /**
+ * Sets a string value for the cloud app vehicle ID
+ * @param cloudAppVehicleID a string value
+ */
+ public void setCloudAppVehicleID(String cloudAppVehicleID){
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ }
+
+ /**
+ * Gets a String value of the returned cloud app vehicle ID
+ * @return a String value.
+ */
+ public String getCloudAppVehicleID(){
+ return getString(KEY_CLOUD_APP_VEHICLE_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java
new file mode 100644
index 000000000..ca23b990c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.WayPointType;
+
+import java.util.Hashtable;
+
+public class GetWayPoints extends RPCRequest {
+ public static final String KEY_WAY_POINT_TYPE = "wayPointType";
+
+ public GetWayPoints() {
+ super(FunctionID.GET_WAY_POINTS.toString());
+ }
+
+ public GetWayPoints(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public GetWayPoints(@NonNull WayPointType wayPointType) {
+ this();
+ setWayPointType(wayPointType);
+ }
+
+ public WayPointType getWayPointType() {
+ return (WayPointType) getObject(WayPointType.class, KEY_WAY_POINT_TYPE);
+ }
+
+ public void setWayPointType(@NonNull WayPointType wayPointType) {
+ setParameters(KEY_WAY_POINT_TYPE, wayPointType);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java
new file mode 100644
index 000000000..76fa76df2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class GetWayPointsResponse extends RPCResponse {
+ public static final String KEY_WAY_POINTS = "wayPoints";
+
+ public GetWayPointsResponse() {
+ super(FunctionID.GET_WAY_POINTS.toString());
+ }
+ public GetWayPointsResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new GetWayPointsResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public GetWayPointsResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+ public void setWayPoints(List<LocationDetails> wayPoints) {
+ setParameters(KEY_WAY_POINTS, wayPoints);
+ }
+ @SuppressWarnings("unchecked")
+ public List<LocationDetails> getWayPoints() {
+ return (List<LocationDetails>) getObject(LocationDetails.class, KEY_WAY_POINTS);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java
new file mode 100644
index 000000000..7b772c822
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class HMICapabilities extends RPCStruct{
+ public static final String KEY_NAVIGATION = "navigation";
+ public static final String KEY_PHONE_CALL = "phoneCall";
+ public static final String KEY_VIDEO_STREAMING = "videoStreaming";
+ public static final String KEY_REMOTE_CONTROL = "remoteControl";
+
+ public HMICapabilities() { }
+
+ public HMICapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public boolean isNavigationAvailable(){
+ Object available = getValue(KEY_NAVIGATION);
+ if(available == null){
+ return false;
+ }
+ return (Boolean)available;
+ }
+
+ public void setNavigationAvilable(Boolean available){
+ setValue(KEY_NAVIGATION, available);
+ }
+
+ public boolean isPhoneCallAvailable(){
+ Object available = getValue(KEY_PHONE_CALL);
+ if(available == null){
+ return false;
+ }
+ return (Boolean)available;
+ }
+
+ public void setPhoneCallAvilable(Boolean available){
+ setValue(KEY_PHONE_CALL, available);
+ }
+
+ public boolean isVideoStreamingAvailable(){
+ Object available = getValue(KEY_VIDEO_STREAMING);
+ if(available == null){
+ return false;
+ }
+ return (Boolean)available;
+ }
+
+ public void setVideoStreamingAvailable(Boolean available){
+ setValue(KEY_VIDEO_STREAMING, available);
+ }
+
+ public boolean isRemoteControlAvailable(){
+ Object available = getValue(KEY_REMOTE_CONTROL);
+ if(available == null){
+ return false;
+ }
+ return (Boolean)available;
+ }
+
+ public void setRemoteControlAvailable(Boolean available){
+ setValue(KEY_REMOTE_CONTROL, available);
+ }
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java
new file mode 100644
index 000000000..aecb9853f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Defining sets of HMI levels, which are permitted or prohibited for a given RPC.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>allowed</td>
+ * <td>HMILevel</td>
+ * <td>A set of all HMI levels that are permitted for this given RPC.
+ * <ul>
+ * <li>Min: 0</li>
+ * <li>Max: 100</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>userDisallowed</td>
+ * <td>HMILevel</td>
+ * <td>A set of all HMI levels that are prohibited for this given RPC.
+ * <ul>
+ * <li>Min: 0</li>
+ * <li>Max: 100</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class HMIPermissions extends RPCStruct {
+ public static final String KEY_ALLOWED = "allowed";
+ public static final String KEY_USER_DISALLOWED = "userDisallowed";
+ /**
+ * Constructs a newly allocated HMIPermissions object
+ */
+ public HMIPermissions() { }
+
+ /**
+ * Constructs a newly allocated HMIPermissions object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public HMIPermissions(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a newly allocated HMIPermissions object
+ * @param allowed HMI level that is permitted for this given RPC
+ * @param userDisallowed HMI level that is prohibited for this given RPC
+ */
+ public HMIPermissions(@NonNull List<HMILevel> allowed, @NonNull List<HMILevel> userDisallowed) {
+ this();
+ setAllowed(allowed);
+ setUserDisallowed(userDisallowed);
+ }
+ /**
+ * get a set of all HMI levels that are permitted for this given RPC.
+ * @return a set of all HMI levels that are permitted for this given RPC
+ */
+ @SuppressWarnings("unchecked")
+ public List<HMILevel> getAllowed() {
+ return (List<HMILevel>) getObject(HMILevel.class, KEY_ALLOWED);
+ }
+
+ /**
+ * set HMI level that is permitted for this given RPC.
+ * @param allowed HMI level that is permitted for this given RPC
+ */
+ public void setAllowed(@NonNull List<HMILevel> allowed) {
+ setValue(KEY_ALLOWED, allowed);
+ }
+
+ /**
+ * get a set of all HMI levels that are prohibited for this given RPC
+ * @return a set of all HMI levels that are prohibited for this given RPC
+ */
+ @SuppressWarnings("unchecked")
+ public List<HMILevel> getUserDisallowed() {
+ return (List<HMILevel>) getObject(HMILevel.class, KEY_USER_DISALLOWED);
+ }
+
+ /**
+ * set a set of all HMI levels that are prohibited for this given RPC
+ * @param userDisallowed HMI level that is prohibited for this given RPC
+ */
+ public void setUserDisallowed(@NonNull List<HMILevel> userDisallowed) {
+ setValue(KEY_USER_DISALLOWED, userDisallowed);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java
new file mode 100644
index 000000000..80b030ad2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java
new file mode 100644
index 000000000..6030e712a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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 the display mode (DAY, NIGHT, AUTO) of screen on the respective module
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.DisplayMode
+ */
+ public void setDisplayMode(DisplayMode displayMode) {
+ setValue(KEY_DISPLAY_MODE, displayMode);
+ }
+
+ /**
+ * Gets the displayMode portion of the HMISettingsControlData class
+ *
+ * @return DisplayMode the display mode (DAY, NIGHT, AUTO) of screen on the respective module
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.DisplayMode
+ */
+ public DisplayMode getDisplayMode() {
+ return (DisplayMode) getObject(DisplayMode.class, KEY_DISPLAY_MODE);
+ }
+
+ /**
+ * Sets the temperatureUnit portion of the HMISettingsControlData class
+ *
+ * @param temperatureUnit enum value of temperature unit associated with the display of the current module
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.TemperatureUnit
+ */
+ public void setTemperatureUnit(TemperatureUnit temperatureUnit) {
+ setValue(KEY_TEMPERATURE_UNIT, temperatureUnit);
+ }
+
+ /**
+ * Gets the temperatureUnit portion of the HMISettingsControlData class
+ *
+ * @return TemperatureUnit enum value of temperature unit associated with the display of the current module
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.TemperatureUnit
+ */
+ public TemperatureUnit getTemperatureUnit() {
+ return (TemperatureUnit) getObject(TemperatureUnit.class, KEY_TEMPERATURE_UNIT);
+ }
+
+ /**
+ * Sets the distanceUnit portion of the HMISettingsControlData class
+ *
+ * @param distanceUnit enum value of distance unit associated with the display of the current module
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.DistanceUnit
+ */
+ public void setDistanceUnit(DistanceUnit distanceUnit) {
+ setValue(KEY_DISTANCE_UNIT, distanceUnit);
+ }
+
+ /**
+ * Gets the distanceUnit portion of the HMISettingsControlData class
+ *
+ * @return DistanceUnit enum value of distance unit associated with the display of the current module
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.DistanceUnit
+ */
+ public DistanceUnit getDistanceUnit() {
+ return (DistanceUnit) getObject(DistanceUnit.class, KEY_DISTANCE_UNIT);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java
index a102f3eb1..a102f3eb1 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java
new file mode 100644
index 000000000..719c957b4
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
+
+import java.util.Hashtable;
+/** Status of the head lamps.
+ *
+ * <p><table border="1" rules="all"></p>
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>lowBeamsOn</td>
+ * <td>Boolean</td>
+ * <td>true</td>
+ * <td>Status of the low beam lamps. </td>
+ * </tr>
+ * <tr>
+ * <td>highBeamsOn</td>
+ * <td>Boolean</td>
+ * <td>true</td>
+ * <td>Status of the high beam lamps. </td>
+ * </tr>
+ * <tr>
+ * <td>ambientLightSensorStatus</td>
+ * <td>AmbientLightStatus</td>
+ * <td>true</td>
+ * <td>Status of the ambient light sensor.</td>
+ * </tr>
+ *
+ *
+ * </table>
+ * @see OnVehicleData
+ * @see GetVehicleData
+ * @since SmartDeviceLink 1.0
+ *
+ */
+
+public class HeadLampStatus extends RPCStruct {
+ public static final String KEY_AMBIENT_LIGHT_SENSOR_STATUS = "ambientLightSensorStatus";
+ public static final String KEY_HIGH_BEAMS_ON = "highBeamsOn";
+ public static final String KEY_LOW_BEAMS_ON = "lowBeamsOn";
+
+ /**
+ * Constructs a new HeadLampStatus object
+ */
+ public HeadLampStatus() {}
+ /**
+ * <p>Constructs a new HeadLampStatus object indicated by the Hashtable
+ * parameter</p>
+ * @param hash The hash table to use
+ */
+ public HeadLampStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new HeadLampStatus object
+ */
+ public HeadLampStatus(@NonNull Boolean lowBeamsOn, @NonNull Boolean highBeamsOn) {
+ this();
+ setLowBeamsOn(lowBeamsOn);
+ setHighBeamsOn(highBeamsOn);
+ }
+ public void setAmbientLightStatus(AmbientLightStatus ambientLightSensorStatus) {
+ setValue(KEY_AMBIENT_LIGHT_SENSOR_STATUS, ambientLightSensorStatus);
+ }
+ public AmbientLightStatus getAmbientLightStatus() {
+ return (AmbientLightStatus) getObject(AmbientLightStatus.class, KEY_AMBIENT_LIGHT_SENSOR_STATUS);
+ }
+ public void setHighBeamsOn(@NonNull Boolean highBeamsOn) {
+ setValue(KEY_HIGH_BEAMS_ON, highBeamsOn);
+ }
+ public Boolean getHighBeamsOn() {
+ return getBoolean(KEY_HIGH_BEAMS_ON);
+ }
+ public void setLowBeamsOn(@NonNull Boolean lowBeamsOn) {
+ setValue(KEY_LOW_BEAMS_ON, lowBeamsOn);
+ }
+ public Boolean getLowBeamsOn() {
+ return getBoolean(KEY_LOW_BEAMS_ON);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java
new file mode 100644
index 000000000..845f4649f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/**
+ *
+ * @since SmartDeviceLink 3.0
+ *
+ */
+
+public class Headers extends RPCStruct {
+ public static final String KEY_CONTENT_TYPE = "ContentType";
+ public static final String KEY_CONNECT_TIMEOUT = "ConnectTimeout";
+ public static final String KEY_DO_OUTPUT = "DoOutput";
+ public static final String KEY_DO_INPUT = "DoInput";
+ public static final String KEY_USE_CACHES = "UseCaches";
+ public static final String KEY_REQUEST_METHOD = "RequestMethod";
+ public static final String KEY_READ_TIMEOUT = "ReadTimeout";
+ public static final String KEY_INSTANCE_FOLLOW_REDIRECTS = "InstanceFollowRedirects";
+ public static final String KEY_CHARSET = "charset";
+ public static final String KEY_CONTENT_LENGTH = "Content-Length";
+
+ public Headers() { }
+ /**
+ * <p>
+ * Constructs a new Headers object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+
+ public Headers(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public void setContentType(String contenttype) {
+ setValue(KEY_CONTENT_TYPE, contenttype);
+ }
+
+ public String getContentType() {
+ return getString(KEY_CONTENT_TYPE);
+ }
+
+ public void setConnectTimeout(Integer connectiontimeout) {
+ setValue(KEY_CONNECT_TIMEOUT, connectiontimeout);
+ }
+
+ public Integer getConnectTimeout() {
+ return getInteger(KEY_CONNECT_TIMEOUT);
+ }
+
+ public void setDoOutput(Boolean dooutput) {
+ setValue(KEY_DO_OUTPUT, dooutput);
+ }
+
+ public Boolean getDoOutput() {
+ return getBoolean(KEY_DO_OUTPUT);
+ }
+
+ public void setDoInput(Boolean doinput) {
+ setValue(KEY_DO_INPUT, doinput);
+ }
+
+ public Boolean getDoInput() {
+ return getBoolean(KEY_DO_INPUT);
+ }
+
+ public void setUseCaches(Boolean usescaches) {
+ setValue(KEY_USE_CACHES, usescaches);
+ }
+
+ public Boolean getUseCaches() {
+ return getBoolean(KEY_USE_CACHES);
+ }
+
+ public void setRequestMethod(String requestmethod) {
+ setValue(KEY_REQUEST_METHOD, requestmethod);
+ }
+
+ public String getRequestMethod() {
+ return getString(KEY_REQUEST_METHOD);
+ }
+
+
+ public void setReadTimeout(Integer readtimeout) {
+ setValue(KEY_READ_TIMEOUT, readtimeout);
+ }
+
+ public Integer getReadTimeout() {
+ return getInteger(KEY_READ_TIMEOUT);
+ }
+
+ public void setInstanceFollowRedirects(Boolean instancefollowredirects) {
+ setValue(KEY_INSTANCE_FOLLOW_REDIRECTS, instancefollowredirects);
+ }
+
+ public Boolean getInstanceFollowRedirects() {
+ return getBoolean(KEY_INSTANCE_FOLLOW_REDIRECTS);
+ }
+
+ public void setCharset(String charset) {
+ setValue(KEY_CHARSET, charset);
+ }
+
+ public String getCharset() {
+ return getString(KEY_CHARSET);
+ }
+
+ public void setContentLength(Integer contentlength) {
+ setValue(KEY_CONTENT_LENGTH, contentlength);
+ }
+
+ public Integer getContentLength() {
+ return getInteger(KEY_CONTENT_LENGTH);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java
new file mode 100644
index 000000000..197265cad
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+
+import java.util.Hashtable;
+
+/**
+ *Specifies, which image shall be used, e.g. in Alerts or on Softbuttons provided the display supports it.
+ *<p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>value</td>
+ * <td>String</td>
+ * <td>Either the static hex icon value or the binary image file name identifier (sent by PutFile).
+ * <ul>
+ * <li>Min: 0</li>
+ * <li>Max: 65535</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>imageType</td>
+ * <td>ImageType</td>
+ * <td>Describes, whether it is a static or dynamic image.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class Image extends RPCStruct {
+ public static final String KEY_VALUE = "value";
+ public static final String KEY_IMAGE_TYPE = "imageType";
+ public static final String KEY_IS_TEMPLATE = "isTemplate";
+
+ /**
+ * Constructs a newly allocated Image object
+ */
+ public Image() { }
+
+ /**
+ * Constructs a newly allocated Image object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public Image(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated Image object
+ * @param value either the static hex icon value or the binary image file name identifier (sent by PutFile)
+ * @param imageType whether it is a static or dynamic image
+ */
+ public Image(@NonNull String value, @NonNull ImageType imageType) {
+ this();
+ setValue(value);
+ setImageType(imageType);
+ }
+
+ /**
+ * Set either the static hex icon value or the binary image file name identifier (sent by PutFile)
+ * @param value either the static hex icon value or the binary image file name identifier (sent by PutFile)
+ */
+ public void setValue(@NonNull String value) {
+ setValue(KEY_VALUE, value);
+ }
+
+ /**
+ * Get either the static hex icon value or the binary image file name identifier (sent by PutFile)
+ * @return either the static hex icon value or the binary image file name identifier (sent by PutFile)
+ */
+ public String getValue() {
+ return getString(KEY_VALUE);
+ }
+
+ /**
+ * Set the image type (static or dynamic image)
+ * @param imageType whether it is a static or dynamic image
+ */
+ public void setImageType(@NonNull ImageType imageType) {
+ setValue(KEY_IMAGE_TYPE, imageType);
+ }
+
+ /**
+ * Get image type (static or dynamic image)
+ * @return the image type (static or dynamic image)
+ */
+ public ImageType getImageType() {
+ return (ImageType) getObject(ImageType.class, KEY_IMAGE_TYPE);
+ }
+
+ /**
+ * Set whether this Image is a template image whose coloring should be decided by the HMI
+ * @param isTemplate boolean that tells whether this Image is a template image
+ */
+ public void setIsTemplate(Boolean isTemplate){
+ setValue(KEY_IS_TEMPLATE, isTemplate);
+ }
+
+ /**
+ * Get whether this Image is a template image whose coloring should be decided by the HMI
+ * @return boolean that tells whether this Image is a template image
+ */
+ public Boolean getIsTemplate(){
+ return getBoolean(KEY_IS_TEMPLATE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java
new file mode 100644
index 000000000..c52bd706c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/** <p>The name that identifies the field.For example AppIcon,SoftButton, LocationImage, etc.</p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th> Version</th>
+ * </tr>
+ * <tr>
+ * <td>name</td>
+ * <td>ImageFieldName</td>
+ * <td>The name that identifies the field.{@linkplain ImageFieldName}</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>imageTypeSupported</td>
+ * <td>FileType</td>
+ * <td>The image types that are supported in this field. {@linkplain FileType}</td>
+ * <td></td>
+ * <td>maxlength: 100</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>imageResolution</td>
+ * <td>ImageResolution</td>
+ * <td>The image resolution of this field.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 3.0
+ * @see com.smartdevicelink.proxy.rpc.enums.ImageType
+ * @see com.smartdevicelink.proxy.rpc.ImageResolution
+ * @see com.smartdevicelink.proxy.rpc.enums.ImageFieldName
+ *
+ *
+ *
+ *
+ */
+
+public class ImageField extends RPCStruct {
+ public static final String KEY_IMAGE_TYPE_SUPPORTED = "imageTypeSupported";
+ public static final String KEY_IMAGE_RESOLUTION = "imageResolution";
+ public static final String KEY_NAME = "name";
+
+
+ public ImageField() { }
+
+ public ImageField(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public ImageField(@NonNull ImageFieldName name, @NonNull List<FileType> imageTypeSupported) {
+ this();
+ setName(name);
+ setImageTypeSupported(imageTypeSupported);
+ }
+
+ public ImageFieldName getName() {
+ return (ImageFieldName) getObject(ImageFieldName.class, KEY_NAME);
+ }
+ public void setName(@NonNull ImageFieldName name ) {
+ setValue(KEY_NAME, name);
+ }
+ @SuppressWarnings("unchecked")
+ public List<FileType> getImageTypeSupported() {
+ return (List<FileType>) getObject(FileType.class, KEY_IMAGE_TYPE_SUPPORTED);
+ }
+ public void setImageTypeSupported(@NonNull List<FileType> imageTypeSupported ) {
+ setValue(KEY_IMAGE_TYPE_SUPPORTED, imageTypeSupported);
+ }
+ @SuppressWarnings("unchecked")
+ public ImageResolution getImageResolution() {
+ return (ImageResolution) getObject(ImageResolution.class, KEY_IMAGE_RESOLUTION);
+ }
+ public void setImageResolution( ImageResolution imageResolution ) {
+ setValue(KEY_IMAGE_RESOLUTION, imageResolution);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java
new file mode 100644
index 000000000..1e6f25c24
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/** The image resolution of this field.
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>resolutionWidth</td>
+ * <td>Integer</td>
+ * <td>The image resolution width.</td>
+ * <td></td>
+ * <td>minvalue:1; maxvalue: 10000</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>resolutionHeight</td>
+ * <td>Integer</td>
+ * <td>The image resolution height.</td>
+ * <td></td>
+ * <td>minvalue:1; maxvalue: 10000</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ *
+ * </table>
+ * @since SmartDeviceLink 3.0
+ *
+ */
+
+public class ImageResolution extends RPCStruct {
+ public static final String KEY_RESOLUTION_WIDTH = "resolutionWidth";
+ public static final String KEY_RESOLUTION_HEIGHT = "resolutionHeight";
+
+ public ImageResolution() {}
+ /**
+ * <p>
+ * Constructs a new ImageResolution object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+
+ public ImageResolution(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public ImageResolution(@NonNull Integer resolutionWidth, @NonNull Integer resolutionHeight) {
+ this();
+ setResolutionWidth(resolutionWidth);
+ setResolutionHeight(resolutionHeight);
+ }
+
+ public void setResolutionWidth(@NonNull Integer resolutionWidth) {
+ setValue(KEY_RESOLUTION_WIDTH, resolutionWidth);
+ }
+
+ public Integer getResolutionWidth() {
+ return getInteger(KEY_RESOLUTION_WIDTH);
+ }
+
+ public void setResolutionHeight(@NonNull Integer resolutionHeight) {
+ setValue(KEY_RESOLUTION_HEIGHT, resolutionHeight);
+ }
+
+ public Integer getResolutionHeight() {
+ return getInteger(KEY_RESOLUTION_HEIGHT);
+ }
+
+ @Override
+ public String toString() {
+ return "width=" + String.valueOf(getResolutionWidth()) +
+ ", height=" + String.valueOf(getResolutionHeight());
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
new file mode 100644
index 000000000..6ceada6a5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
+import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/** This mode causes the interaction to immediately display a keyboard entry through the HMI.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th> Additional</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>language</td>
+ * <td>Language</td>
+ * <td>false</td>
+ * <td></td>
+ * <td>The keyboard language. </td>
+ * </tr>
+ * <tr>
+ * <td>keyboardLayout</td>
+ * <td>KeyboardLayout</td>
+ * <td>false</td>
+ * <td></td>
+ * <td>Desired keyboard layout.</td>
+ * </tr>
+ * <tr>
+ * <td>sendDynamicEntry</td>
+ * <td>Boolean</td>
+ * <td>false</td>
+ * <td></td>
+ * <td>In this mode, all keypresses will be sent as they occur. If disabled, entire string of text will be returned only once submitted by user.If omitted, this value will be set to FALSE.</td>
+ * </tr>
+ * <tr>
+ * <td>keypressMode</td>
+ * <td>KeypressMode</td>
+ * <td>False</td>
+ * <td></td>
+ * <td>Desired keypress mode.If omitted, this value will be set to RESEND_CURRENT_ENTRY. </td>
+ * </tr>
+ * <tr>
+ * <td>limitedCharacterList</td>
+ * <td>String</td>
+ * <td>false</td>
+ * <td>Array = true maxlength = 1 minsize = 1 maxsize = 100</td>
+ * <td>Array of keyboard characters to enable. All omitted characters will be greyed out (disabled) on the keyboard. If omitted, the entire keyboard will be enabled.</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>autoCompleteText</td>
+ * <td>String</td>
+ * <td>false</td>
+ * <td>maxlength = 1000 </td>
+ * <td>Allows an app to prepopulate the text field with a suggested or completed entry as the user types.</td>
+ * </tr>
+ * </table>
+ *
+ * @since SmartDeviceLink 3.0
+ *
+ */
+
+public class KeyboardProperties extends RPCStruct {
+ public static final String KEY_KEYPRESS_MODE = "keypressMode";
+ public static final String KEY_KEYBOARD_LAYOUT = "keyboardLayout";
+ public static final String KEY_LIMITED_CHARACTER_LIST = "limitedCharacterList";
+ public static final String KEY_AUTO_COMPLETE_TEXT = "autoCompleteText";
+ public static final String KEY_LANGUAGE = "language";
+
+ private static final KeypressMode KEYPRESS_MODE_DEFAULT = KeypressMode.RESEND_CURRENT_ENTRY;
+
+ public KeyboardProperties() {
+ setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
+ }
+
+ public KeyboardProperties(Hashtable<String, Object> hash) {
+ super(hash);
+ if (!store.containsKey(KEY_KEYPRESS_MODE)) {
+ setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
+ }
+ }
+
+ public Language getLanguage() {
+ return (Language) getObject(Language.class, KEY_LANGUAGE);
+ }
+
+ public void setLanguage(Language language) {
+ setValue(KEY_LANGUAGE, language);
+ }
+
+ public KeyboardLayout getKeyboardLayout() {
+ return (KeyboardLayout) getObject(KeyboardLayout.class, KEY_KEYBOARD_LAYOUT);
+ }
+
+ public void setKeyboardLayout(KeyboardLayout keyboardLayout) {
+ setValue(KEY_KEYBOARD_LAYOUT, keyboardLayout);
+ }
+
+ public KeypressMode getKeypressMode() {
+ KeypressMode kp = (KeypressMode) getObject(KeypressMode.class, KEY_KEYPRESS_MODE);
+ if(kp == null){
+ kp = KEYPRESS_MODE_DEFAULT;
+ }
+ return kp;
+ }
+
+ public void setKeypressMode(KeypressMode keypressMode) {
+ if (keypressMode != null) {
+ setValue(KEY_KEYPRESS_MODE, keypressMode);
+ } else {
+ setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getLimitedCharacterList() {
+ return (List<String>) getObject(String.class, KEY_LIMITED_CHARACTER_LIST);
+ }
+
+ public void setLimitedCharacterList(List<String> limitedCharacterList) {
+ setValue(KEY_LIMITED_CHARACTER_LIST, limitedCharacterList);
+ }
+
+ public String getAutoCompleteText() {
+ return (String) getObject(String.class, KEY_AUTO_COMPLETE_TEXT);
+ }
+
+ public void setAutoCompleteText(String autoCompleteText) {
+ setValue(KEY_AUTO_COMPLETE_TEXT, autoCompleteText);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java
new file mode 100644
index 000000000..93c526efa
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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 enum value of type LightName that describes the specific light
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.LightName
+ */
+ public void setName(@NonNull LightName name) {
+ setValue(KEY_NAME, name);
+ }
+
+ /**
+ * Gets the name portion of the LightCapabilities class
+ *
+ * @return LightName enum value that describes the specific light
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.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/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java
new file mode 100644
index 000000000..2c1e63455
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java
new file mode 100644
index 000000000..5f7323773
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java
new file mode 100644
index 000000000..5009e4a44
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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 enum value of type LightStatus that describes the specific lights state
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.LightStatus
+ */
+ public void setStatus(@NonNull LightStatus status) {
+ setValue(KEY_STATUS, status);
+ }
+
+ /**
+ * Gets the status portion of the LightState class
+ *
+ * @return LightStatus enum value that describes the specific lights state
+ *
+ * @see com.smartdevicelink.proxy.rpc.enums.LightStatus
+ */
+ public LightStatus getStatus() {
+ return (LightStatus) getObject(LightStatus.class, KEY_STATUS);
+ }
+
+ /**
+ * Gets the density portion of the LightState class
+ *
+ * @return a float representation of the density of the specific light state
+ */
+ public Float getDensity() {
+ Object value = getValue(KEY_DENSITY);
+ return SdlDataTypeConverter.objectToFloat(value);
+ }
+
+ /**
+ * Sets the density portion of the LightState class
+ *
+ * @param density a float representation of the density of the specific light state
+ */
+ public void setDensity(Float density) {
+ setValue(KEY_DENSITY, density);
+ }
+
+ /**
+ * Gets the color portion of the LightState class
+ *
+ * @return an RGBColor representation of the color of this specific light state
+ *
+ * @see com.smartdevicelink.proxy.rpc.RGBColor
+ */
+ @SuppressWarnings("unchecked")
+ public RGBColor getColor() {
+ return (RGBColor) getObject(RGBColor.class, KEY_COLOR);
+ }
+
+ /**
+ * Sets the color portion of the LightState class
+ *
+ * @param color an RGBColor representation of the color of this specific light state
+ *
+ * @see com.smartdevicelink.proxy.rpc.RGBColor
+ */
+ public void setColor(RGBColor color) {
+ setValue(KEY_COLOR, color);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFiles.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFiles.java
new file mode 100644
index 000000000..046421b32
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFiles.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Requests the current list of resident filenames for the registered app. Not
+ * supported on First generation SDL vehicles.
+ *
+ * <p><b>Request</b></p>
+ * <p>No parameters.</p>
+ * <p><b>Response:</b></p>
+ * Returns the current list of resident filenames for the registered app along with the current space available.
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR </p>
+ * <p>REJECTED</p>
+ * @since SmartDeviceLink 2.0
+ */
+public class ListFiles extends RPCRequest {
+
+ /**
+ * Constructs a new ListFiles object
+ */
+ public ListFiles() {
+ super(FunctionID.LIST_FILES.toString());
+ }
+
+ /**
+ * <p>Constructs a new ListFiles object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public ListFiles(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java
new file mode 100644
index 000000000..715fa915c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.util.Version;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * List Files Response is sent, when ListFiles has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class ListFilesResponse extends RPCResponse {
+ public static final String KEY_FILENAMES = "filenames";
+ public static final String KEY_SPACE_AVAILABLE = "spaceAvailable";
+ private static final Integer MAX_VALUE = 2000000000;
+
+ /**
+ * Constructs a new ListFilesResponse object
+ */
+ public ListFilesResponse() {
+ super(FunctionID.LIST_FILES.toString());
+ }
+ public ListFilesResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * @deprecated use {@link ListFilesResponse#ListFilesResponse(Boolean, Result)} instead <br>
+ *
+ * Constructs a new ListFilesResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ @Deprecated
+ public ListFilesResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer spaceAvailable) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ setSpaceAvailable(spaceAvailable);
+ }
+
+ /**
+ * Constructs a new ListFilesResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public ListFilesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ /**
+ * SpaceAvailable became optional as of RPC Spec 5.0. If a system that expected the value to
+ * always have a value connects to such a system, it could return null. Check to see if there
+ * is a value, and if not, set it to MAX_VALUE as defined by the RPC Spec
+ *
+ * @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){
+ if (getSpaceAvailable() == null){
+ setSpaceAvailable(MAX_VALUE);
+ }
+ }
+ super.format(rpcVersion, formatParams);
+ }
+
+ public void setFilenames(List<String> filenames) {
+ setParameters(KEY_FILENAMES, filenames);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getFilenames() {
+ return (List<String>) getObject(String.class, KEY_FILENAMES);
+ }
+
+ public void setSpaceAvailable(Integer spaceAvailable) {
+ setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
+ }
+
+ public Integer getSpaceAvailable() {
+ return getInteger(KEY_SPACE_AVAILABLE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java
new file mode 100644
index 000000000..f548336f2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class LocationDetails extends RPCStruct{
+ public static final String KEY_COORDINATE = "coordinate";
+ public static final String KEY_LOCATION_NAME = "locationName";
+ public static final String KEY_ADDRESS_LINES = "addressLines";
+ public static final String KEY_LOCATION_DESCRIPTION = "locationDescription";
+ public static final String KEY_PHONE_NUMBER = "phoneNumber";
+ public static final String KEY_LOCATION_IMAGE = "locationImage";
+ public static final String KEY_SEARCH_ADDRESS = "searchAddress";
+
+ public LocationDetails() {
+ }
+
+ public LocationDetails(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Coordinate getCoordinate() {
+ return (Coordinate) getObject(Coordinate.class, KEY_COORDINATE);
+ }
+ public void setCoordinate(Coordinate coordinate) {
+ setValue(KEY_COORDINATE, coordinate);
+ }
+
+ public String getLocationName() {
+ return getString(KEY_LOCATION_NAME);
+ }
+
+ public void setLocationName(String locationName) {
+ setValue(KEY_LOCATION_NAME, locationName);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getAddressLines() {
+ return (List<String>) getObject(String.class, KEY_ADDRESS_LINES);
+ }
+
+ public void setAddressLines(List<String> addressLines) {
+ setValue(KEY_ADDRESS_LINES, addressLines);
+ }
+
+ public String getLocationDescription() {
+ return getString(KEY_LOCATION_DESCRIPTION);
+ }
+
+ public void setLocationDescription(String locationDescription) {
+ setValue(KEY_LOCATION_DESCRIPTION, locationDescription);
+ }
+
+ public String getPhoneNumber() {
+ return getString(KEY_PHONE_NUMBER);
+ }
+
+ public void setPhoneNumber(String phoneNumber) {
+ setValue(KEY_PHONE_NUMBER, phoneNumber);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Image getLocationImage() {
+ return (Image) getObject(Image.class, KEY_LOCATION_IMAGE);
+ }
+
+ public void setLocationImage(Image locationImage) {
+ setValue(KEY_LOCATION_IMAGE, locationImage);
+ }
+
+ @SuppressWarnings("unchecked")
+ public OasisAddress getSearchAddress() {
+ return (OasisAddress) getObject(OasisAddress.class, KEY_SEARCH_ADDRESS);
+ }
+ public void setSearchAddress(OasisAddress searchAddress) {
+ setValue(KEY_SEARCH_ADDRESS, searchAddress);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java
new file mode 100644
index 000000000..4f0da27d8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.MassageCushion;
+
+import java.util.Hashtable;
+
+/**
+ * The intensity or firmness of a cushion.
+ */
+public class MassageCushionFirmness extends RPCStruct {
+ public static final String KEY_CUSHION = "cushion";
+ public static final String KEY_FIRMNESS = "firmness";
+
+ /**
+ * Constructs a new MassageCushionFirmness object
+ */
+ public MassageCushionFirmness() {
+ }
+
+ /**
+ * <p>Constructs a new MassageCushionFirmness object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use to create this RPC
+ */
+ public MassageCushionFirmness(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated MassageCushionFirmness object
+ * @param cushion type of MassageCushion for multi-contour massage seat
+ * @param firmness Min: 0 Max: 100
+ */
+ public MassageCushionFirmness(@NonNull MassageCushion cushion, @NonNull Integer firmness) {
+ this();
+ setCushion(cushion);
+ setFirmness(firmness);
+ }
+
+ /**
+ * Sets the type of MassageCushion for multi-contour massage seat
+ *
+ * @param cushion type of MassageCushion for multi-contour massage seat
+ */
+ public void setCushion(@NonNull MassageCushion cushion) {
+ setValue(KEY_CUSHION, cushion);
+ }
+
+ /**
+ * Gets the type of MassageCushion for multi-contour massage seat
+ *
+ * @return the type of MassageCushion for multi-contour massage seat.
+ */
+ public MassageCushion getCushion() {
+ return (MassageCushion) getObject(MassageCushion.class, KEY_CUSHION);
+ }
+
+ /**
+ * Sets the firmness associated with the supplied MassageCushion
+ *
+ * @param firmness firmness of the supplied MassageCushion (Min: 0 Max: 100)
+ */
+ public void setFirmness(@NonNull Integer firmness) {
+ setValue(KEY_FIRMNESS, firmness);
+ }
+
+ /**
+ * Gets the firmness associated with the supplied MassageCushion
+ *
+ * @return firmness of the supplied MassageCushion (Min: 0 Max: 100)
+ */
+ public Integer getFirmness() {
+ return getInteger(KEY_FIRMNESS);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java
new file mode 100644
index 000000000..e60b2e953
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.MassageMode;
+import com.smartdevicelink.proxy.rpc.enums.MassageZone;
+
+import java.util.Hashtable;
+
+/**
+ * Specify the mode of a massage zone.
+ */
+public class MassageModeData extends RPCStruct {
+ public static final String KEY_MASSAGE_ZONE = "massageZone";
+ public static final String KEY_MASSAGE_MODE = "massageMode";
+
+ /**
+ * Constructs a new MassageModeData object
+ */
+ public MassageModeData() {
+ }
+
+ /**
+ * <p>Constructs a new MassageModeData object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use to create this RPC
+ */
+ public MassageModeData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated MassageModeData object
+ * @param massageZone type of MassageZone for multi-contour massage seat
+ * @param massageMode mode of massage zone.
+ */
+ public MassageModeData(@NonNull MassageZone massageZone, @NonNull MassageMode massageMode) {
+ this();
+ setMassageZone(massageZone);
+ setMassageMode(massageMode);
+ }
+
+ /**
+ * Sets the massageZone that will be associated with the supplied massage mode
+ *
+ * @param massageZone the zone of a multi-contour massage seat
+ */
+ public void setMassageZone(@NonNull MassageZone massageZone) {
+ setValue(KEY_MASSAGE_ZONE, massageZone);
+ }
+
+ /**
+ * Gets the massageZone that will be associated with the supplied massage mode
+ *
+ * @return the zone of a multi-contour massage seat.
+ */
+ public MassageZone getMassageZone() {
+ return (MassageZone) getObject(MassageZone.class, KEY_MASSAGE_ZONE);
+ }
+
+ /**
+ * Gets the massageMode that will be associated with the supplied massage zone
+ *
+ * @return MassageMode
+ */
+ public MassageMode getMassageMode() {
+ return (MassageMode) getObject(MassageMode.class, KEY_MASSAGE_MODE);
+ }
+
+ /**
+ * Sets the massageMode that will be associated with the supplied massage zone
+ *
+ * @param massageMode mode of massage to be used (OFF, LOW, HIGH)
+ */
+ public void setMassageMode(@NonNull MassageMode massageMode) {
+ setValue(KEY_MASSAGE_MODE, massageMode);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java
new file mode 100644
index 000000000..cdd5d21a4
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java
@@ -0,0 +1,295 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.MediaType;
+
+import java.util.Hashtable;
+
+/**
+ * This data is related to what a media service should provide
+ */
+public class MediaServiceData extends RPCStruct {
+
+ public static final String KEY_MEDIA_TYPE = "mediaType";
+ public static final String KEY_MEDIA_TITLE = "mediaTitle";
+ public static final String KEY_MEDIA_ARTIST = "mediaArtist";
+ public static final String KEY_MEDIA_ALBUM = "mediaAlbum";
+ public static final String KEY_PLAYLIST_NAME = "playlistName";
+ public static final String KEY_IS_EXPLICIT = "isExplicit";
+ public static final String KEY_TRACK_PLAYBACK_PROGRESS = "trackPlaybackProgress";
+ public static final String KEY_TRACK_PLAYBACK_DURATION = "trackPlaybackDuration";
+ public static final String KEY_QUEUE_PLAYBACK_PROGRESS = "queuePlaybackProgress";
+ public static final String KEY_QUEUE_PLAYBACK_DURATION = "queuePlaybackDuration";
+ public static final String KEY_QUEUE_CURRENT_TRACK_NUMBER = "queueCurrentTrackNumber";
+ public static final String KEY_QUEUE_TOTAL_TRACK_COUNT = "queueTotalTrackCount";
+
+ // Constructors
+
+ public MediaServiceData() { }
+
+ public MediaServiceData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param mediaType - The type of the currently playing or paused track.
+ */
+ public void setMediaType(MediaType mediaType) {
+ setValue(KEY_MEDIA_TYPE, mediaType);
+ }
+
+ /**
+ * @return mediaType - The type of the currently playing or paused track.
+ */
+ public MediaType getMediaType() {
+ return (MediaType) getObject(MediaType.class,KEY_MEDIA_TYPE);
+ }
+
+ /**
+ * Music: The name of the current track
+ * Podcast: The name of the current episode
+ * Audiobook: The name of the current chapter
+ * @param mediaTitle -
+ */
+ public void setMediaTitle(String mediaTitle) {
+ setValue(KEY_MEDIA_TITLE, mediaTitle);
+ }
+
+ /**
+ * Music: The name of the current track
+ * Podcast: The name of the current episode
+ * Audiobook: The name of the current chapter
+ * @return mediaTitle -
+ */
+ public String getMediaTitle() {
+ return getString(KEY_MEDIA_TITLE);
+ }
+
+ /**
+ * Music: The name of the current album artist
+ * Podcast: The provider of the podcast (hosts, network, company)
+ * Audiobook: The book author's name
+ * @param mediaArtist -
+ */
+ public void setMediaArtist(String mediaArtist) {
+ setValue(KEY_MEDIA_ARTIST, mediaArtist);
+ }
+
+ /**
+ * Music: The name of the current album artist
+ * Podcast: The provider of the podcast (hosts, network, company)
+ * Audiobook: The book author's name
+ * @return mediaArtist -
+ */
+ public String getMediaArtist() {
+ return getString(KEY_MEDIA_ARTIST);
+ }
+
+ /**
+ * Music: The name of the current album
+ * Podcast: The name of the current podcast show
+ * Audiobook: The name of the current book
+ * @param mediaAlbum -
+ */
+ public void setMediaAlbum(String mediaAlbum) {
+ setValue(KEY_MEDIA_ALBUM, mediaAlbum);
+ }
+
+ /**
+ * Music: The name of the current album
+ * Podcast: The name of the current podcast show
+ * Audiobook: The name of the current book
+ * @return mediaAlbum -
+ */
+ public String getMediaAlbum() {
+ return getString(KEY_MEDIA_ALBUM);
+ }
+
+ /**
+ * Music: The name of the playlist or radio station, if the user is playing from a playlist, otherwise, Null
+ * Podcast: The name of the playlist, if the user is playing from a playlist, otherwise, Null
+ * Audiobook: Likely not applicable, possibly a collection or "playlist" of books
+ * @param playlistName -
+ */
+ public void setPlaylistName(String playlistName) {
+ setValue(KEY_PLAYLIST_NAME, playlistName);
+ }
+
+ /**
+ * Music: The name of the playlist or radio station, if the user is playing from a playlist, otherwise, Null
+ * Podcast: The name of the playlist, if the user is playing from a playlist, otherwise, Null
+ * Audiobook: Likely not applicable, possibly a collection or "playlist" of books
+ * @return playlistName -
+ */
+ public String getPlaylistName() {
+ return getString(KEY_PLAYLIST_NAME);
+ }
+
+ /**
+ * @param isExplicit - Whether or not the content currently playing (e.g. the track, episode, or book) contains explicit content
+ */
+ public void setIsExplicit(Boolean isExplicit) {
+ setValue(KEY_IS_EXPLICIT, isExplicit);
+ }
+
+ /**
+ * @return isExplicit - Whether or not the content currently playing (e.g. the track, episode, or book) contains explicit content
+ */
+ public Boolean getIsExplicit() {
+ return getBoolean(KEY_IS_EXPLICIT);
+ }
+
+ /**
+ * Music: The current progress of the track in seconds
+ * Podcast: The current progress of the episode in seconds
+ * Audiobook: The current progress of the current segment (e.g. the chapter) in seconds
+ * @param trackPlaybackProgress -
+ */
+ public void setTrackPlaybackProgress(Integer trackPlaybackProgress) {
+ setValue(KEY_TRACK_PLAYBACK_PROGRESS, trackPlaybackProgress);
+ }
+
+ /**
+ * Music: The current progress of the track in seconds
+ * Podcast: The current progress of the episode in seconds
+ * Audiobook: The current progress of the current segment (e.g. the chapter) in seconds
+ * @return trackPlaybackProgress -
+ */
+ public Integer getTrackPlaybackProgress() {
+ return getInteger(KEY_TRACK_PLAYBACK_PROGRESS);
+ }
+
+ /**
+ * Music: The total duration of the track in seconds
+ * Podcast: The total duration of the episode in seconds
+ * Audiobook: The total duration of the current segment (e.g. the chapter) in seconds
+ * @param trackPlaybackDuration -
+ */
+ public void setTrackPlaybackDuration(Integer trackPlaybackDuration) {
+ setValue(KEY_TRACK_PLAYBACK_DURATION, trackPlaybackDuration);
+ }
+
+ /**
+ * Music: The total duration of the track in seconds
+ * Podcast: The total duration of the episode in seconds
+ * Audiobook: The total duration of the current segment (e.g. the chapter) in seconds
+ * @return trackPlaybackDuration -
+ */
+ public Integer getTrackPlaybackDuration() {
+ return getInteger(KEY_TRACK_PLAYBACK_DURATION);
+ }
+
+ /**
+ * Music: The current progress of the playback queue in seconds
+ * Podcast: The current progress of the playback queue in seconds
+ * Audiobook: The current progress of the playback queue (e.g. the book) in seconds
+ * @param queuePlaybackProgress -
+ */
+ public void setQueuePlaybackProgress(Integer queuePlaybackProgress) {
+ setValue(KEY_QUEUE_PLAYBACK_PROGRESS, queuePlaybackProgress);
+ }
+
+ /**
+ * Music: The current progress of the playback queue in seconds
+ * Podcast: The current progress of the playback queue in seconds
+ * Audiobook: The current progress of the playback queue (e.g. the book) in seconds
+ * @return queuePlaybackProgress -
+ */
+ public Integer getQueuePlaybackProgress() {
+ return getInteger(KEY_QUEUE_PLAYBACK_PROGRESS);
+ }
+
+ /**
+ * Music: The total duration of the playback queue in seconds
+ * Podcast: The total duration of the playback queue in seconds
+ * Audiobook: The total duration of the playback queue (e.g. the book) in seconds
+ * @param queuePlaybackDuration -
+ */
+ public void setQueuePlaybackDuration(Integer queuePlaybackDuration) {
+ setValue(KEY_QUEUE_PLAYBACK_DURATION, queuePlaybackDuration);
+ }
+
+ /**
+ * Music: The total duration of the playback queue in seconds
+ * Podcast: The total duration of the playback queue in seconds
+ * Audiobook: The total duration of the playback queue (e.g. the book) in seconds
+ * @return queuePlaybackDuration -
+ */
+ public Integer getQueuePlaybackDuration() {
+ return getInteger(KEY_QUEUE_PLAYBACK_DURATION);
+ }
+
+ /**
+ * Music: The current number (1 based) of the track in the playback queue
+ * Podcast: The current number (1 based) of the episode in the playback queue
+ * Audiobook: The current number (1 based) of the episode in the playback queue (e.g. the chapter number in the book)
+ * @param queueCurrentTrackNumber -
+ */
+ public void setQueueCurrentTrackNumber(Integer queueCurrentTrackNumber) {
+ setValue(KEY_QUEUE_CURRENT_TRACK_NUMBER, queueCurrentTrackNumber);
+ }
+
+ /**
+ * Music: The current number (1 based) of the track in the playback queue
+ * Podcast: The current number (1 based) of the episode in the playback queue
+ * Audiobook: The current number (1 based) of the episode in the playback queue (e.g. the chapter number in the book)
+ * @return queueCurrentTrackNumber -
+ */
+ public Integer getQueueCurrentTrackNumber() {
+ return getInteger(KEY_QUEUE_CURRENT_TRACK_NUMBER);
+ }
+
+ /**
+ * Music: The total number of tracks in the playback queue
+ * Podcast: The total number of episodes in the playback queue
+ * Audiobook: The total number of sections in the playback queue (e.g. the number of chapters in the book)
+ * @param queueTotalTrackCount -
+ */
+ public void setQueueTotalTrackCount(Integer queueTotalTrackCount) {
+ setValue(KEY_QUEUE_TOTAL_TRACK_COUNT, queueTotalTrackCount);
+ }
+
+ /**
+ * Music: The total number of tracks in the playback queue
+ * Podcast: The total number of episodes in the playback queue
+ * Audiobook: The total number of sections in the playback queue (e.g. the number of chapters in the book)
+ * @return queueTotalTrackCount -
+ */
+ public Integer getQueueTotalTrackCount() {
+ return getInteger(KEY_QUEUE_TOTAL_TRACK_COUNT);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceManifest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceManifest.java
new file mode 100644
index 000000000..c03329331
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceManifest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+
+public class MediaServiceManifest extends RPCStruct {
+
+ public MediaServiceManifest() { }
+
+ public MediaServiceManifest(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java
new file mode 100644
index 000000000..8b00d67c7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/**
+ * Used when adding a sub menu to an application menu or existing sub menu.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>parentID</td>
+ * <td>Integer</td>
+ * <td>The unique ID of an existing submenu to which a command will be added.
+ * If this element is not provided, the command will be added to the top level of the Command Menu.
+ * <ul>
+ * <li>Min: 0</li>
+ * <li>Max: 2000000000</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>position</td>
+ * <td>Integer</td>
+ * <td>Position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc.
+ * Position of any submenu will always be located before the return and exit options.
+ * <ul>
+ * <li>Min Value: 0</li>
+ * <li>Max Value: 1000</li>
+ * <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>
+ * <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>menuName</td>
+ * <td>String</td>
+ * <td>Text which appears in menu, representing this command.
+ * <ul>
+ * <li>Min: 1</li>
+ * <li>Max: 100</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ * @see AddCommand
+ * @see AddSubMenu
+ */
+public class MenuParams extends RPCStruct {
+ public static final String KEY_PARENT_ID = "parentID";
+ public static final String KEY_POSITION = "position";
+ public static final String KEY_MENU_NAME = "menuName";
+ /**
+ * Constructs a newly allocated MenuParams object
+ */
+ public MenuParams() { }
+ /**
+ * Constructs a newly allocated MenuParams object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public MenuParams(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a newly allocated MenuParams object
+ * @param menuName the menu name
+ */
+ public MenuParams(@NonNull String menuName) {
+ this();
+ setMenuName(menuName);
+ }
+ /**
+ * Get the unique ID of an existing submenu to which a command will be added.
+ * If this element is not provided, the command will be added to the top level of the Command Menu.
+ * @return parentID Min: 0 Max: 2000000000
+ */
+ public Integer getParentID() {
+ return getInteger( KEY_PARENT_ID );
+ }
+ /**
+ * Set the unique ID of an existing submenu to which a command will be added.
+ * If this element is not provided, the command will be added to the top level of the Command Menu.
+ * @param parentID Min: 0; Max: 2000000000
+ */
+ public void setParentID( Integer parentID ) {
+ setValue(KEY_PARENT_ID, parentID);
+ }
+ /**
+ * Get the position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc.
+ * Position of any submenu will always be located before the return and exit options.
+ * <ul>
+ * <li>Min Value: 0</li>
+ * <li>Max Value: 1000</li>
+ * <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>
+ * <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>
+ * </ul>
+ * @return the position within the items of the parent Command Menu
+ */
+ public Integer getPosition() {
+ return getInteger( KEY_POSITION );
+ }
+ /**
+ * Set the position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc.
+ * Position of any submenu will always be located before the return and exit options.
+ * <ul>
+ * <li>Min Value: 0</li>
+ * <li>Max Value: 1000</li>
+ * <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>
+ * <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>
+ * </ul>
+ * @param position Mix: 0 Max: 1000
+ */
+ public void setPosition( Integer position ) {
+ setValue(KEY_POSITION, position);
+ }
+ /**
+ * Get the text which appears in menu, representing this command.
+ * <ul>
+ * <li>Min: 1</li>
+ * <li>Max: 100</li>
+ * </ul>
+ * @return menuName the menu name
+ */
+
+ public String getMenuName() {
+ return getString( KEY_MENU_NAME );
+ }
+ /**
+ * Set text which appears in menu, representing this command.
+ * <ul>
+ * <li>Min: 1</li>
+ * <li>Max: 100</li>
+ * </ul>
+ * @param menuName the menu name
+ */
+
+ public void setMenuName( @NonNull String menuName ) {
+ setValue(KEY_MENU_NAME, menuName);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java
new file mode 100644
index 000000000..49afcd86b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.MetadataType;
+
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.List;
+
+public class MetadataTags extends RPCStruct {
+
+ public static final String KEY_MAIN_FIELD_1_TYPE = "mainField1";
+ public static final String KEY_MAIN_FIELD_2_TYPE = "mainField2";
+ public static final String KEY_MAIN_FIELD_3_TYPE = "mainField3";
+ public static final String KEY_MAIN_FIELD_4_TYPE = "mainField4";
+
+ /**
+ * Constructs a newly allocated MetadataTags object
+ */
+ public MetadataTags(){}
+
+ /**
+ * Constructs a newly allocated MetadataTags object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public MetadataTags(Hashtable<String, Object> hash){super(hash);}
+
+ /**
+ * Set the metadata types of data contained in the "mainField1" text field
+ */
+ public void setMainField1( List<MetadataType> metadataTypes ) {
+ setValue(KEY_MAIN_FIELD_1_TYPE, metadataTypes);
+ }
+
+ /**
+ * Set the metadata type of data contained in the "mainField1" text field
+ */
+ public void setMainField1(MetadataType metadataType) {
+ setValue(KEY_MAIN_FIELD_1_TYPE, Collections.singletonList(metadataType));
+ }
+
+ /**
+ * @return The type of data contained in the "mainField1" text field
+ */
+ @SuppressWarnings("unchecked")
+ public List<MetadataType> getMainField1() {
+ return (List<MetadataType>) getObject(MetadataType.class, KEY_MAIN_FIELD_1_TYPE);
+ }
+
+ /**
+ * Set the metadata types of data contained in the "mainField2" text field
+ */
+ public void setMainField2( List<MetadataType> metadataTypes ) {
+ setValue(KEY_MAIN_FIELD_2_TYPE, metadataTypes);
+ }
+
+ /**
+ * Set the metadata type of data contained in the "mainField2" text field
+ */
+ public void setMainField2(MetadataType metadataType) {
+ setValue(KEY_MAIN_FIELD_2_TYPE, Collections.singletonList(metadataType));
+ }
+
+ /**
+ * @return The type of data contained in the "mainField2" text field
+ */
+ @SuppressWarnings("unchecked")
+ public List<MetadataType> getMainField2() {
+ return (List<MetadataType>) getObject(MetadataType.class, KEY_MAIN_FIELD_2_TYPE);
+ }
+
+ /**
+ * Set the metadata types of data contained in the "mainField3" text field
+ */
+ public void setMainField3( List<MetadataType> metadataTypes ) {
+ setValue(KEY_MAIN_FIELD_3_TYPE, metadataTypes);
+ }
+
+ /**
+ * Set the metadata type of data contained in the "mainField3" text field
+ */
+ public void setMainField3(MetadataType metadataType) {
+ setValue(KEY_MAIN_FIELD_3_TYPE, Collections.singletonList(metadataType));
+ }
+
+ /**
+ * @return The type of data contained in the "mainField3" text field
+ */
+ @SuppressWarnings("unchecked")
+ public List<MetadataType> getMainField3() {
+ return (List<MetadataType>) getObject(MetadataType.class, KEY_MAIN_FIELD_3_TYPE);
+ }
+
+ /**
+ * Set the metadata types of data contained in the "mainField4" text field
+ */
+ public void setMainField4( List<MetadataType> metadataTypes ) {
+ setValue(KEY_MAIN_FIELD_4_TYPE, metadataTypes);
+ }
+
+ /**
+ * Set the metadata type of data contained in the "mainField4" text field
+ */
+ public void setMainField4(MetadataType metadataType) {
+ setValue(KEY_MAIN_FIELD_4_TYPE, Collections.singletonList(metadataType));
+ }
+
+ /**
+ * @return The type of data contained in the "mainField4" text field
+ */
+ @SuppressWarnings("unchecked")
+ public List<MetadataType> getMainField4() {
+ return (List<MetadataType>) getObject(MetadataType.class, KEY_MAIN_FIELD_4_TYPE);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
new file mode 100644
index 000000000..8f11dc556
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.ModuleType;
+
+import java.util.Hashtable;
+
+public class ModuleData extends RPCStruct {
+ public static final String KEY_MODULE_TYPE = "moduleType";
+ 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() {
+ }
+
+ public ModuleData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public ModuleData(@NonNull ModuleType moduleType) {
+ this();
+ setModuleType(moduleType);
+ }
+
+ /**
+ * Sets the moduleType portion of the ModuleData class
+ *
+ * @param moduleType The moduleType indicates which type of data should be changed and identifies which data object exists in this struct.
+ * For example, if the moduleType is CLIMATE then a "climateControlData" should exist
+ */
+ public void setModuleType(@NonNull ModuleType moduleType) {
+ setValue(KEY_MODULE_TYPE, moduleType);
+ }
+
+ /**
+ * Gets the moduleType portion of the ModuleData class
+ *
+ * @return ModuleType - The moduleType indicates which type of data should be changed and identifies which data object exists in this struct.
+ * For example, if the moduleType is CLIMATE then a "climateControlData" should exist.
+ */
+ public ModuleType getModuleType() {
+ return (ModuleType) getObject(ModuleType.class, KEY_MODULE_TYPE);
+ }
+
+ /**
+ * Sets the radioControlData portion of the ModuleData class
+ *
+ * @param radioControlData
+ */
+ public void setRadioControlData(RadioControlData radioControlData) {
+ setValue(KEY_RADIO_CONTROL_DATA, radioControlData);
+ }
+
+ /**
+ * Gets the radioControlData portion of the ModuleData class
+ *
+ * @return RadioControlData
+ */
+ public RadioControlData getRadioControlData() {
+ return (RadioControlData) getObject(RadioControlData.class, KEY_RADIO_CONTROL_DATA);
+ }
+
+ /**
+ * Sets the climateControlData portion of the ModuleData class
+ *
+ * @param climateControlData
+ */
+ public void setClimateControlData(ClimateControlData climateControlData) {
+ setValue(KEY_CLIMATE_CONTROL_DATA, climateControlData);
+ }
+
+ /**
+ * Gets the climateControlData portion of the ModuleData class
+ *
+ * @return ClimateControlData
+ */
+ public ClimateControlData getClimateControlData() {
+ return (ClimateControlData) getObject(ClimateControlData.class, KEY_CLIMATE_CONTROL_DATA);
+ }
+
+ /**
+ * Sets the seatControlData portion of the ModuleData class
+ *
+ * @param seatControlData
+ */
+ public void setSeatControlData(SeatControlData seatControlData) {
+ setValue(KEY_SEAT_CONTROL_DATA, seatControlData);
+ }
+
+ /**
+ * Gets the seatControlData portion of the ModuleData class
+ *
+ * @return SeatControlData
+ */
+ 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/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java
new file mode 100644
index 000000000..ba085e90b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
+
+import java.util.Hashtable;
+/** Information related to the MyKey feature.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Mandatory</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>e911Override</td>
+ * <td>VehicleDataStatus</td>
+ * <td>true</td>
+ * <td>Indicates whether e911 override is on.</td>
+ * </tr>
+ * </table>
+ *
+ *@since SmartDeviceLink 2.0
+ *
+ *@see GetVehicleData
+ *@see OnVehicleData
+ *@see VehicleDataStatus
+ *
+ *
+ */
+
+public class MyKey extends RPCStruct {
+ public static final String KEY_E_911_OVERRIDE = "e911Override";
+ /**
+ * Constructs a new MyKey object indicated
+ */
+ public MyKey() { }
+ /**
+ * <p>Constructs a new MyKey object indicated by the Hashtable
+ * parameter</p>
+ * @param hash The Hashtable to use
+ */
+ public MyKey(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new MyKey object indicated
+ */
+ public MyKey(@NonNull VehicleDataStatus e911Override) {
+ this();
+ setE911Override(e911Override);
+ }
+ public void setE911Override(@NonNull VehicleDataStatus e911Override) {
+ setValue(KEY_E_911_OVERRIDE, e911Override);
+ }
+ public VehicleDataStatus getE911Override() {
+ return (VehicleDataStatus) getObject(VehicleDataStatus.class, KEY_E_911_OVERRIDE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java
new file mode 100644
index 000000000..486a3c2ea
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/*
+ * Extended capabilities for an onboard navigation system
+ */
+public class NavigationCapability extends RPCStruct{
+ public static final String KEY_LOCATION_ENABLED = "sendLocationEnabled";
+ public static final String KEY_GETWAYPOINTS_ENABLED = "getWayPointsEnabled";
+
+ public NavigationCapability(){}
+
+ public NavigationCapability(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public Boolean getSendLocationEnabled(){
+ return getBoolean(KEY_LOCATION_ENABLED);
+ }
+
+ public void setSendLocationEnabled(Boolean sendLocationEnabled){
+ setValue(KEY_LOCATION_ENABLED, sendLocationEnabled);
+ }
+
+ public Boolean getWayPointsEnabled(){
+ return getBoolean(KEY_GETWAYPOINTS_ENABLED);
+ }
+
+ public void setWayPointsEnabled(Boolean getWayPointsEnabled){
+ setValue(KEY_GETWAYPOINTS_ENABLED, getWayPointsEnabled);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java
new file mode 100644
index 000000000..d7e21b92d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.Direction;
+import com.smartdevicelink.proxy.rpc.enums.NavigationAction;
+import com.smartdevicelink.proxy.rpc.enums.NavigationJunction;
+
+import java.util.Hashtable;
+
+public class NavigationInstruction extends RPCStruct {
+
+ public static final String KEY_LOCATION_DETAILS = "locationDetails";
+ public static final String KEY_ACTION = "action";
+ public static final String KEY_ETA = "eta";
+ public static final String KEY_BEARING = "bearing";
+ public static final String KEY_JUNCTION_TYPE = "junctionType";
+ public static final String KEY_DRIVING_SIDE = "drivingSide";
+ public static final String KEY_DETAILS = "details";
+ public static final String KEY_IMAGE = "image";
+
+ // Constructors
+
+ public NavigationInstruction() { }
+
+ public NavigationInstruction(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public NavigationInstruction(@NonNull LocationDetails locationDetails, @NonNull NavigationAction action){
+ this();
+ setLocationDetails(locationDetails);
+ setAction(action);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param locationDetails -
+ */
+ public void setLocationDetails(@NonNull LocationDetails locationDetails){
+ setValue(KEY_LOCATION_DETAILS, locationDetails);
+ }
+
+ /**
+ * @return locationDetails
+ */
+ public LocationDetails getLocationDetails(){
+ return (LocationDetails) getObject(LocationDetails.class, KEY_LOCATION_DETAILS);
+ }
+
+ /**
+ * @param action -
+ */
+ public void setAction(@NonNull NavigationAction action){
+ setValue(KEY_ACTION, action);
+ }
+
+ /**
+ * @return action
+ */
+ public NavigationAction getAction(){
+ return (NavigationAction) getObject(NavigationAction.class, KEY_ACTION);
+ }
+
+ /**
+ * @param eta -
+ */
+ public void setEta(DateTime eta){
+ setValue(KEY_ETA, eta);
+ }
+
+ /**
+ * @return eta
+ */
+ public DateTime getEta(){
+ return (DateTime) getObject(DateTime.class, KEY_ETA);
+ }
+
+ /**
+ * The angle at which this instruction takes place. For example, 0 would mean straight, <=45
+ * is bearing right, >= 135 is sharp right, between 45 and 135 is a regular right, and 180 is
+ * a U-Turn, etc.
+ * @param bearing - minValue="0" maxValue="359"
+ */
+ public void setBearing(Integer bearing){
+ setValue(KEY_BEARING, bearing);
+ }
+
+ /**
+ * The angle at which this instruction takes place. For example, 0 would mean straight, <=45
+ * is bearing right, >= 135 is sharp right, between 45 and 135 is a regular right, and 180 is
+ * a U-Turn, etc.
+ * @return bearing - minValue="0" maxValue="359"
+ */
+ public Integer getBearing(){
+ return getInteger(KEY_BEARING);
+ }
+
+ /**
+ * @param junctionType -
+ */
+ public void setJunctionType(NavigationJunction junctionType){
+ setValue(KEY_JUNCTION_TYPE, junctionType);
+ }
+
+ /**
+ * @return junctionType
+ */
+ public NavigationJunction getJunctionType(){
+ return (NavigationJunction) getObject(NavigationJunction.class, KEY_JUNCTION_TYPE);
+ }
+
+ /**
+ * Used to infer which side of the road this instruction takes place. For a U-Turn (action=TURN, bearing=180) this
+ * will determine which direction the turn should take place.
+ * @param drivingSide - Direction enum value that represents the driving side
+ */
+ public void setDrivingSide(Direction drivingSide){
+ setValue(KEY_DRIVING_SIDE, drivingSide);
+ }
+
+ /**
+ * Used to infer which side of the road this instruction takes place. For a U-Turn (action=TURN, bearing=180) this
+ * will determine which direction the turn should take place.
+ * @return drivingSide
+ */
+ public Direction getDrivingSide(){
+ return (Direction) getObject(Direction.class, KEY_DRIVING_SIDE);
+ }
+
+ /**
+ * This is a string representation of this instruction, used to display instructions to the
+ * users. This is not intended to be read aloud to the users, see the param prompt in
+ * NavigationServiceData for that.
+ * @param details -
+ */
+ public void setDetails(String details){
+ setValue(KEY_DETAILS, details);
+ }
+
+ /**
+ * This is a string representation of this instruction, used to display instructions to the
+ * users. This is not intended to be read aloud to the users, see the param prompt in
+ * NavigationServiceData for that.
+ * @return details
+ */
+ public String getDetails(){
+ return getString(KEY_DETAILS);
+ }
+
+ /**
+ * An image representation of this instruction.
+ * @param image -
+ */
+ public void setImage(Image image){
+ setValue(KEY_IMAGE, image);
+ }
+
+ /**
+ * An image representation of this instruction.
+ * @return image
+ */
+ public Image getImage(){
+ return (Image) getObject(Image.class, KEY_IMAGE);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java
new file mode 100644
index 000000000..8f34697af
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This data is related to what a navigation service would provide.
+ */
+public class NavigationServiceData extends RPCStruct {
+
+ public static final String KEY_TIMESTAMP = "timeStamp";
+ public static final String KEY_ORIGIN= "origin";
+ public static final String KEY_DESTINATION = "destination";
+ public static final String KEY_DESTINATION_ETA = "destinationETA";
+ public static final String KEY_INSTRUCTIONS = "instructions";
+ public static final String KEY_NEXT_INSTRUCTION_ETA = "nextInstructionETA";
+ public static final String KEY_NEXT_INSTRUCTION_DISTANCE = "nextInstructionDistance";
+ public static final String KEY_NEXT_INSTRUCTION_DISTANCE_SCALE= "nextInstructionDistanceScale";
+ public static final String KEY_PROMPT = "prompt";
+
+ // Constructors
+
+ public NavigationServiceData() { }
+
+ public NavigationServiceData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public NavigationServiceData(@NonNull DateTime timeStamp){
+ this();
+ setTimeStamp(timeStamp);
+ }
+
+ // Setters and Getters
+
+ /**
+ * This is the timeStamp of when the data was generated. This is to ensure any time or distance
+ * given in the data can accurately be adjusted if necessary.
+ * @param timeStamp -
+ */
+ public void setTimeStamp(@NonNull DateTime timeStamp){
+ setValue(KEY_TIMESTAMP, timeStamp);
+ }
+
+ /**
+ * This is the timeStamp of when the data was generated. This is to ensure any time or distance
+ * given in the data can accurately be adjusted if necessary.
+ * @return timeStamp
+ */
+ public DateTime getTimeStamp(){
+ return (DateTime) getObject(DateTime.class, KEY_TIMESTAMP);
+ }
+
+ /**
+ * @param origin -
+ */
+ public void setOrigin(LocationDetails origin){
+ setValue(KEY_ORIGIN, origin);
+ }
+
+ /**
+ * @return origin
+ */
+ public LocationDetails getOrigin(){
+ return (LocationDetails) getObject(LocationDetails.class, KEY_ORIGIN);
+ }
+
+ /**
+ * @param destination -
+ */
+ public void setDestination(LocationDetails destination){
+ setValue(KEY_DESTINATION, destination);
+ }
+
+ /**
+ * @return destination
+ */
+ public LocationDetails getDestination(){
+ return (LocationDetails) getObject(LocationDetails.class, KEY_DESTINATION);
+ }
+
+ /**
+ * @param destinationETA -
+ */
+ public void setDestinationETA(DateTime destinationETA){
+ setValue(KEY_DESTINATION_ETA, destinationETA);
+ }
+
+ /**
+ * @return destinationETA
+ */
+ public DateTime getDestinationETA(){
+ return (DateTime) getObject(DateTime.class, KEY_DESTINATION_ETA);
+ }
+
+ /**
+ * This array should be ordered with all remaining instructions. The start of this array should
+ * always contain the next instruction.
+ * @param instructions -
+ */
+ public void setInstructions(List<NavigationInstruction> instructions){
+ setValue(KEY_INSTRUCTIONS, instructions);
+ }
+
+ /**
+ * This array should be ordered with all remaining instructions. The start of this array should
+ * always contain the next instruction.
+ * @return instructions
+ */
+ @SuppressWarnings("unchecked")
+ public List<NavigationInstruction> getInstructions(){
+ return (List<NavigationInstruction>) getObject(NavigationInstruction.class,KEY_INSTRUCTIONS);
+ }
+
+ /**
+ * @param nextInstructionETA -
+ */
+ public void setNextInstructionETA(DateTime nextInstructionETA){
+ setValue(KEY_NEXT_INSTRUCTION_ETA, nextInstructionETA);
+ }
+
+ /**
+ * @return nextInstructionETA
+ */
+ public DateTime getNextInstructionETA(){
+ return (DateTime) getObject(DateTime.class, KEY_NEXT_INSTRUCTION_ETA);
+ }
+
+ /**
+ * The distance to this instruction from current location. This should only be updated every
+ * .1 unit of distance. For more accuracy the consumer can use the GPS location of itself and
+ * the next instruction.
+ * @param nextInstructionDistance -
+ */
+ public void setNextInstructionDistance(Float nextInstructionDistance){
+ setValue(KEY_NEXT_INSTRUCTION_DISTANCE, nextInstructionDistance);
+ }
+
+ /**
+ * The distance to this instruction from current location. This should only be updated every
+ * .1 unit of distance. For more accuracy the consumer can use the GPS location of itself and
+ * the next instruction.
+ * @return nextInstructionDistance
+ */
+ public Float getNextInstructionDistance(){
+ return getFloat(KEY_NEXT_INSTRUCTION_DISTANCE);
+ }
+
+ /**
+ * Distance till next maneuver (starting from) from previous maneuver.
+ * @param nextInstructionDistanceScale -
+ */
+ public void setNextInstructionDistanceScale(Float nextInstructionDistanceScale){
+ setValue(KEY_NEXT_INSTRUCTION_DISTANCE_SCALE, nextInstructionDistanceScale);
+ }
+
+ /**
+ * Distance till next maneuver (starting from) from previous maneuver.
+ * @return nextInstructionDistanceScale
+ */
+ public Float getNextInstructionDistanceScale(){
+ return getFloat(KEY_NEXT_INSTRUCTION_DISTANCE_SCALE);
+ }
+
+ /**
+ * This is a prompt message that should be conveyed to the user through either display or voice
+ * (TTS). This param will change often as it should represent the following: approaching
+ * instruction, post instruction, alerts that affect the current navigation session, etc.
+ * @param prompt -
+ */
+ public void setPrompt(String prompt){
+ setValue(KEY_PROMPT, prompt);
+ }
+
+ /**
+ * This is a prompt message that should be conveyed to the user through either display or voice
+ * (TTS). This param will change often as it should represent the following: approaching
+ * instruction, post instruction, alerts that affect the current navigation session, etc.
+ * @return prompt
+ */
+ public String getPrompt(){
+ return getString(KEY_PROMPT);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java
new file mode 100644
index 000000000..78b392865
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class NavigationServiceManifest extends RPCStruct {
+
+ public static final String KEY_ACCEPTS_WAY_POINTS = "acceptsWayPoints";
+
+ // Constructors
+
+ public NavigationServiceManifest() { }
+
+ public NavigationServiceManifest(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ // Setters and Getters
+
+ /**
+ * Informs the subscriber if this service can actually accept way points.
+ * @param acceptsWayPoints -
+ */
+ public void setAcceptsWayPoints(Boolean acceptsWayPoints){
+ setValue(KEY_ACCEPTS_WAY_POINTS, acceptsWayPoints);
+ }
+
+ /**
+ * Informs the subscriber if this service can actually accept way points.
+ * @return acceptsWayPoints
+ */
+ public Boolean getAcceptsWayPoints(){
+ return getBoolean(KEY_ACCEPTS_WAY_POINTS);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java
new file mode 100644
index 000000000..7b4d09478
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class OasisAddress extends RPCStruct{
+ public static final String KEY_COUNTRY_NAME = "countryName";
+ public static final String KEY_COUNTRY_CODE = "countryCode";
+ public static final String KEY_POSTAL_CODE = "postalCode";
+ public static final String KEY_ADMINISTRATIVE_AREA = "administrativeArea";
+ public static final String KEY_SUB_ADMINISTRATIVE_AREA = "subAdministrativeArea";
+ public static final String KEY_LOCALITY = "locality";
+ public static final String KEY_SUB_LOCALITY = "subLocality";
+ public static final String KEY_THOROUGH_FARE = "thoroughfare";
+ public static final String KEY_SUB_THOROUGH_FARE = "subThoroughfare";
+
+ /**
+ * OASIS Address - A standard based address class that has been established by The Organization for the Advancement of Structured Information Standards (OASIS).
+ * Oasis is a global nonprofit consortium that works on the development, convergence, and adoption of standards for security,
+ * Internet of Things, energy, content technologies, emergency management, and other areas.
+ *
+ */
+ public OasisAddress() {
+ }
+
+ public OasisAddress(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Gets the localized Name of the country associated with the OasisAddress class.
+ *
+ * @return String - The localized Name of the country associated with the OasisAddress class.
+ *
+ */
+ public String getCountryName() {
+ return getString(KEY_COUNTRY_NAME);
+ }
+
+ /**
+ * Sets the localized Name of the country associated with the OasisAddress class.
+ *
+ * @param countryName
+ * The localized Name of the country associated with the OasisAddress class.
+ *
+ */
+ public void setCountryName(String countryName) {
+ setValue(KEY_COUNTRY_NAME, countryName);
+ }
+
+ /**
+ * Gets the country code in ISO 3166-2 format associated with the OasisAddress class.
+ *
+ * @return String - The country code in ISO 3166-2 format associated with the OasisAddress class.
+ *
+ */
+ public String getCountryCode() {
+ return getString(KEY_COUNTRY_CODE);
+ }
+
+ /**
+ * Sets the country code in ISO 3166-2 format associated with the OasisAddress class.
+ *
+ * @param countryCode
+ * The country code in ISO 3166-2 format associated with the OasisAddress class.
+ *
+ */
+ public void setCountryCode(String countryCode) {
+ setValue(KEY_COUNTRY_CODE, countryCode);
+ }
+
+ /**
+ * Gets the Postal Code associated with the OasisAddress class.
+ *
+ * @return String - The Postal Code associated with the OasisAddress class.
+ *
+ */
+ public String getPostalCode() {
+ return getString(KEY_POSTAL_CODE);
+ }
+
+ /**
+ * Sets the Postal Code associated with the OasisAddress class.
+ *
+ * @param postalCode
+ * The Postal Code associated with the OasisAddress class.
+ *
+ */
+ public void setPostalCode(String postalCode) {
+ setValue(KEY_POSTAL_CODE, postalCode);
+ }
+
+ /**
+ * Gets the Administrative Area associated with the OasisAddress class. A portion of the country - Administrative Area's can include details of the top-level area division in the country, such as state, district, province, island, region, etc.
+ *
+ * @return String - The Administrative Area associated with the OasisAddress class.
+ *
+ */
+ public String getAdministrativeArea() {
+ return getString(KEY_ADMINISTRATIVE_AREA);
+ }
+
+ /**
+ * Sets the Administrative Area associated with the OasisAddress class. A portion of the country - Administrative Area can include details of the top-level area division in the country, such as state, district, province, island, region, etc.
+ *
+ * @param administrativeArea
+ * The Administrative Area associated with the OasisAddress class.
+ *
+ */
+ public void setAdministrativeArea(String administrativeArea) {
+ setValue(KEY_ADMINISTRATIVE_AREA, administrativeArea);
+ }
+
+ /**
+ * Gets the SubAdministrative Area associated with the OasisAddress class. A portion of the administrativeArea - The next level down division of the area. E.g. state / county, province / reservation.
+ *
+ * @return String - The SubAdministrative Area associated with the OasisAddress class.
+ *
+ */
+ public String getSubAdministrativeArea() {
+ return getString(KEY_SUB_ADMINISTRATIVE_AREA);
+ }
+
+ /**
+ * Sets the SubAdministrative Area associated with the OasisAddress class. A portion of the administrativeArea - The next level down division of the area. E.g. state / county, province / reservation.
+ *
+ * @param subAdministrativeArea
+ * The SubAdministrative Area associated with the OasisAddress class.
+ *
+ */
+ public void setSubAdministrativeArea(String subAdministrativeArea) {
+ setValue(KEY_SUB_ADMINISTRATIVE_AREA, subAdministrativeArea);
+ }
+
+ /**
+ * Gets the Locality associated with the OasisAddress class. - A hypernym for city/village
+ *
+ * @return String - The Locality associated with the OasisAddress class.
+ *
+ */
+ public String getLocality() {
+ return getString(KEY_LOCALITY);
+ }
+
+ /**
+ * Sets the Locality associated with the OasisAddress class. - A hypernym for city/village.
+ *
+ * @param locality
+ * The Locality associated with the OasisAddress class.
+ *
+ */
+ public void setLocality(String locality) {
+ setValue(KEY_LOCALITY, locality);
+ }
+
+ /**
+ * Gets the Sub-Locality associated with the OasisAddress class. - Hypernym for district.
+ *
+ * @return String - The Sub-Locality associated with the OasisAddress class.
+ *
+ */
+ public String getSubLocality() {
+ return getString(KEY_SUB_LOCALITY);
+ }
+
+ /**
+ * Sets the Sub-Locality associated with the OasisAddress class. A hypernym for district.
+ *
+ * @param subLocality
+ * The Sub-Locality associated with the OasisAddress class.
+ *
+ */
+ public void setSubLocality(String subLocality) {
+ setValue(KEY_SUB_LOCALITY, subLocality);
+ }
+
+ /**
+ * Gets the Thoroughfare associated with the OasisAddress class. - A hypernym for street, road etc.
+ *
+ * @return String - The Thoroughfare associated with the OasisAddress class.
+ *
+ */
+ public String getThoroughfare() {
+ return getString(KEY_THOROUGH_FARE);
+ }
+
+ /**
+ * Sets the Thoroughfare associated with the OasisAddress class. A hypernym for street, road etc.
+ *
+ * @param thoroughFare
+ * The Thoroughfare associated with the OasisAddress class.
+ *
+ */
+ public void setThoroughfare(String thoroughFare) {
+ setValue(KEY_THOROUGH_FARE, thoroughFare);
+ }
+
+ /**
+ * Gets the Sub-Thoroughfare associated with the OasisAddress class. - A Portion of thoroughfare (e.g. house number).
+ *
+ * @return String - The Sub-Thoroughfare associated with the OasisAddress class.
+ */
+ public String getSubThoroughfare() {
+ return getString(KEY_SUB_THOROUGH_FARE);
+ }
+
+ /**
+ * Sets the Sub-Thoroughfare associated with the OasisAddress class. - A Portion of thoroughfare (e.g. house number).
+ *
+ * @param subThoroughfare
+ * The Sub-Thoroughfare associated with the OasisAddress class.
+ *
+ */
+ public void setSubThoroughfare(String subThoroughfare) {
+ setValue(KEY_SUB_THOROUGH_FARE, subThoroughfare);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java
new file mode 100644
index 000000000..31ea950dd
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
+
+import java.util.Hashtable;
+
+/**
+ * <p>Notifies an application that its interface registration has been terminated. This means that all SDL resources
+ * associated with the application are discarded, including the Command Menu, Choice Sets, button subscriptions, etc.</p>
+ * For more information about SDL resources related to an interface registration, see {@linkplain RegisterAppInterface}.
+ * <p></p>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul><li>Any</li></ul>
+ * AudioStreamingState:
+ * <ul><li>Any</li></ul>
+ * SystemContext:
+ * <ul><li>Any</li></ul>
+ * </ul>
+ * <p></p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>reason</td>
+ * <td>{@linkplain AppInterfaceUnregisteredReason}</td>
+ * <td>The reason the application's interface registration was terminated</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ * @see RegisterAppInterface
+ */
+public class OnAppInterfaceUnregistered extends RPCNotification {
+ public static final String KEY_REASON = "reason";
+ /**
+ *Constructs a newly allocated OnAppInterfaceUnregistered object
+ */
+ public OnAppInterfaceUnregistered() {
+ super(FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString());
+ }
+ /**
+ *<p>Constructs a newly allocated OnAppInterfaceUnregistered object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public OnAppInterfaceUnregistered(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *Constructs a newly allocated OnAppInterfaceUnregistered object
+ * @param reason The reason application's interface registration was terminated
+ */
+ public OnAppInterfaceUnregistered(@NonNull AppInterfaceUnregisteredReason reason) {
+ this();
+ setReason(reason);
+ }
+ /**
+ * <p>Get the reason the registration was terminated</p>
+ * @return {@linkplain AppInterfaceUnregisteredReason} the reason the application's interface registration was terminated
+ */
+ public AppInterfaceUnregisteredReason getReason() {
+ return (AppInterfaceUnregisteredReason) getObject(AppInterfaceUnregisteredReason.class, KEY_REASON);
+ }
+ /**
+ * <p>Set the reason application's interface was terminated</p>
+ * @param reason The reason application's interface registration was terminated
+ */
+ public void setReason( @NonNull AppInterfaceUnregisteredReason reason ) {
+ setParameters(KEY_REASON, reason);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java
new file mode 100644
index 000000000..638488664
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+import java.util.Hashtable;
+
+/**
+ * This notification includes the data that is updated from the specific service
+ */
+public class OnAppServiceData extends RPCNotification {
+
+ public static final String KEY_SERVICE_DATA = "serviceData";
+
+ // Constructors
+
+ public OnAppServiceData() {
+ super(FunctionID.ON_APP_SERVICE_DATA.toString());
+ }
+
+ public OnAppServiceData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public OnAppServiceData(@NonNull AppServiceData serviceData) {
+ this();
+ setServiceData(serviceData);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param serviceData -
+ */
+ public void setServiceData(@NonNull AppServiceData serviceData){
+ setParameters(KEY_SERVICE_DATA, serviceData);
+ }
+
+ /**
+ * @return serviceData
+ */
+ public AppServiceData getServiceData(){
+ return (AppServiceData) getObject(AppServiceData.class, KEY_SERVICE_DATA);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java
new file mode 100644
index 000000000..ab1ea3770
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+import java.util.Hashtable;
+
+/**
+ * Binary data is in binary part of hybrid msg.
+ * <p>
+ * </p>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul>
+ * <li>BACKGROUND, FULL, LIMITED</li>
+ * </ul>
+ * AudioStreamingState:
+ * <ul>
+ * <li>TBD</li>
+ * </ul>
+ * SystemContext:
+ * <ul>
+ * <li>TBD</li>
+ * </ul>
+ * </ul>
+ * <p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Req</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * </table>
+ * </p>
+ *
+ */
+public class OnAudioPassThru extends RPCNotification {
+ /**
+ *Constructs a newly allocated OnCommand object
+ */
+ public OnAudioPassThru() {
+ super(FunctionID.ON_AUDIO_PASS_THRU.toString());
+ }
+ /**
+ *<p>Constructs a newly allocated OnAudioPassThru object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public OnAudioPassThru(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ public void setAPTData(byte[] aptData) {
+ setBulkData(aptData);
+ }
+ public byte[] getAPTData() {
+ return getBulkData();
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java
new file mode 100644
index 000000000..96c78abc1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+
+import java.util.Hashtable;
+
+/**
+ * Notifies application that user has depressed or released a button to which
+ * the application has subscribed.Further information about button events
+ * and button-presses can be found at {@linkplain SubscribeButton}.
+ * <p>
+ * </p>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul>
+ * <li>The application will receive OnButtonEvent notifications for all
+ * subscribed buttons when HMILevel is FULL.</li>
+ * <li>The application will receive OnButtonEvent notifications for subscribed
+ * media buttons when HMILevel is LIMITED.</li>
+ * <li>Media buttons include SEEKLEFT, SEEKRIGHT, TUNEUP, TUNEDOWN, and
+ * PRESET_0-PRESET_9.</li>
+ * <li>The application will not receive OnButtonEvent notification when HMILevel
+ * is BACKGROUND.</li>
+ * </ul>
+ * AudioStreamingState:
+ * <ul>
+ * <li> Any </li>
+ * </ul>
+ * SystemContext:
+ * <ul>
+ * <li>MAIN, VR. In MENU, only PRESET buttons. In VR, pressing any subscribable
+ * button will cancel VR.</li>
+ * </ul>
+ * </ul>
+ * <p></p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Req</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>buttonName</td>
+ * <td>{@linkplain ButtonName}</td>
+ * <td>Name of the button which triggered this event</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>buttonEventMode</td>
+ * <td>{@linkplain ButtonEventMode}</td>
+ * <td>Indicats button was depressed (DOWN) or released (UP)</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>customButtonID</td>
+ * <td>Integer</td>
+ * <td>If ButtonName is CUSTOM_BUTTON", this references the integer ID passed
+ * by a custom button. (e.g. softButton ID)</td>
+ * <td>N</td>
+ * <td>Minvalue=0 Maxvalue=65536</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * <p></p>
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ * @see SubscribeButton
+ * @see UnsubscribeButton
+ *
+ *
+ */
+public class OnButtonEvent extends RPCNotification {
+ public static final String KEY_BUTTON_EVENT_MODE = "buttonEventMode";
+ public static final String KEY_BUTTON_NAME = "buttonName";
+ public static final String KEY_CUSTOM_BUTTON_ID = "customButtonID";
+ /**
+ *Constructs a newly allocated OnButtonEvent object
+ */
+
+ public OnButtonEvent() {
+ super(FunctionID.ON_BUTTON_EVENT.toString());
+ }
+ /**
+ * <p>
+ * Constructs a newly allocated OnButtonEvent object indicated by the
+ * Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use to create this RPC
+ *
+ */
+ public OnButtonEvent(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+
+ /**
+ *Constructs a newly allocated OnButtonEvent object
+ * @param buttonName name of the button
+ * @param buttonEventMode indicates the button is pressed or released
+ */
+ public OnButtonEvent(@NonNull ButtonName buttonName, @NonNull ButtonEventMode buttonEventMode) {
+ this();
+ setButtonName(buttonName);
+ setButtonEventMode(buttonEventMode);
+ }
+
+ /**
+ * <p>Returns <i>{@linkplain ButtonName}</i> the button's name</p>
+ * @return ButtonName Name of the button
+ */
+ public ButtonName getButtonName() {
+ return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
+ }
+
+ /**
+ * <p>Set the button's name</p>
+ * @param buttonName name of the button
+ */
+ public void setButtonName(@NonNull ButtonName buttonName) {
+ setParameters(KEY_BUTTON_NAME, buttonName);
+ }
+
+ /**
+ * <p>Return <i>{@linkplain ButtonEventMode} indicates the button was depressed or released</i></p>
+ * @return ButtonEventMode the button depressed or released
+ */
+ public ButtonEventMode getButtonEventMode() {
+ return (ButtonEventMode) getObject(ButtonEventMode.class, KEY_BUTTON_EVENT_MODE);
+ }
+
+ /**
+ * <p> Set the event mode of the button,pressed or released</p>
+ * @param buttonEventMode indicates the button is pressed or released
+ * @see ButtonEventMode
+ */
+ public void setButtonEventMode(@NonNull ButtonEventMode buttonEventMode) {
+ setParameters(KEY_BUTTON_EVENT_MODE, buttonEventMode);
+ }
+
+ public void setCustomButtonID(Integer customButtonID) {
+ setParameters(KEY_CUSTOM_BUTTON_ID, customButtonID);
+ }
+ public Integer getCustomButtonID() {
+ return getInteger(KEY_CUSTOM_BUTTON_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java
new file mode 100644
index 000000000..bd254b55a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
+
+import java.util.Hashtable;
+
+/**
+ * <p>
+ * Notifies application of button press events for buttons to which the
+ * application is subscribed. SDL supports two button press events defined as
+ * follows:
+ * </p>
+ * <ul>
+ * <li>SHORT - Occurs when a button is depressed, then released within two
+ * seconds. The event is considered to occur immediately after the button is
+ * released.</li>
+ * <li>LONG - Occurs when a button is depressed and held for two seconds or
+ * more. The event is considered to occur immediately after the two second
+ * threshold has been crossed, before the button is released</li>
+ * </ul>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul>
+ * <li>The application will receive OnButtonPress notifications for all
+ * subscribed buttons when HMILevel is FULL.</li>
+ * <li>The application will receive OnButtonPress notifications for subscribed
+ * media buttons when HMILevel is LIMITED.</li>
+ * <li>Media buttons include SEEKLEFT, SEEKRIGHT, TUNEUP, TUNEDOWN, and
+ * PRESET_0-PRESET_9.</li>
+ * <li>The application will not receive OnButtonPress notification when HMILevel
+ * is BACKGROUND or NONE.</li>
+ * </ul>
+ * AudioStreamingState:
+ * <ul>
+ * <li> Any </li>
+ * </ul>
+ * SystemContext:
+ * <ul>
+ * <li>MAIN, VR. In MENU, only PRESET buttons. In VR, pressing any subscribable
+ * button will cancel VR.</li>
+ * </ul>
+ * </ul>
+ * <p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Req</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>buttonName</td>
+ * <td>{@linkplain ButtonName}</td>
+ * <td>Name of the button which triggered this event</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>buttonPressMode</td>
+ * <td>{@linkplain ButtonPressMode}</td>
+ * <td>Indicates whether this is an SHORT or LONG button press event.</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>customButtonID</td>
+ * <td>Integer</td>
+ * <td>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed
+ * by a custom button. (e.g. softButton ID)</td>
+ * <td>N</td>
+ * <td>Minvalue=0 Maxvalue=65536</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * </p>
+ *
+ * @since SmartDeviceLink 1.0
+ * @see SubscribeButton
+ * @see UnsubscribeButton
+ */
+public class OnButtonPress extends RPCNotification {
+ public static final String KEY_BUTTON_PRESS_MODE = "buttonPressMode";
+ public static final String KEY_BUTTON_NAME = "buttonName";
+ public static final String KEY_CUSTOM_BUTTON_ID = "customButtonID";
+ /**
+ *Constructs a newly allocated OnButtonPress object
+ */
+ public OnButtonPress() {
+ super(FunctionID.ON_BUTTON_PRESS.toString());
+ }
+ /**
+ * <p>
+ * Constructs a newly allocated OnButtonPress object indicated by the
+ * Hashtable parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public OnButtonPress(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *Constructs a newly allocated OnButtonPress object
+ * @param buttonName name of the button
+ * @param buttonPressMode indicates whether this is a short or long press
+ */
+ public OnButtonPress(@NonNull ButtonName buttonName, @NonNull ButtonPressMode buttonPressMode) {
+ this();
+ setButtonName(buttonName);
+ setButtonPressMode(buttonPressMode);
+ }
+ /**
+ * <p>Returns an <i>{@linkplain ButtonName}</i> the button's name</p>
+ * @return ButtonName Name of the button
+ */
+ public ButtonName getButtonName() {
+ return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
+ }
+ /**
+ * <p>Set the button's name</p>
+ * @param buttonName name of the button
+ */
+ public void setButtonName( @NonNull ButtonName buttonName ) {
+ setParameters(KEY_BUTTON_NAME, buttonName);
+ }
+ /**<p>Returns <i>{@linkplain ButtonPressMode}</i></p>
+ * @return ButtonPressMode whether this is a long or short button press event
+ */
+ public ButtonPressMode getButtonPressMode() {
+ return (ButtonPressMode) getObject(ButtonPressMode.class, KEY_BUTTON_PRESS_MODE);
+ }
+ /**
+ * <p>Set the button press mode of the event</p>
+ * @param buttonPressMode indicates whether this is a short or long press
+ */
+ public void setButtonPressMode( @NonNull ButtonPressMode buttonPressMode ) {
+ setParameters(KEY_BUTTON_PRESS_MODE, buttonPressMode);
+ }
+ public void setCustomButtonName(Integer customButtonID) {
+ setParameters(KEY_CUSTOM_BUTTON_ID, customButtonID);
+ }
+ public Integer getCustomButtonName() {
+ return getInteger(KEY_CUSTOM_BUTTON_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java
new file mode 100644
index 000000000..e4c55afb6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
+
+import java.util.Hashtable;
+
+/**
+ * This is called when a command was selected via VR after pressing the PTT button, or selected from the menu after
+ * pressing the MENU button. <p>
+ * <b>Note: </b>Sequence of OnHMIStatus and OnCommand notifications for user-initiated interactions is indeterminate.
+ * <p></p>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul><li>FULL,LIMITED</li></ul>
+ * AudioStreamingState:
+ * <ul><li>Any</li></ul>
+ * SystemContext:
+ * <ul><li>Any</li></ul>
+ * </ul>
+ * <p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>cmdID</td>
+ * <td>Integer</td>
+ * <td>The cmdID of the command the user selected. This is the cmdID value provided by the application in the AddCommand operation that created the command.</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>triggerSource</td>
+ * <td>{@linkplain TriggerSource}</td>
+ * <td>Indicates whether command was selected via VR or via a menu selection (using the OKbutton).</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * </p>
+ * @since SmartDeviceLink 1.0
+ * @see AddCommand
+ * @see DeleteCommand
+ * @see DeleteSubMenu
+ */
+public class OnCommand extends RPCNotification {
+ public static final String KEY_CMD_ID = "cmdID";
+ public static final String KEY_TRIGGER_SOURCE = "triggerSource";
+ /**
+ *Constructs a newly allocated OnCommand object
+ */
+ public OnCommand() {
+ super(FunctionID.ON_COMMAND.toString());
+ }
+ /**
+ *<p>Constructs a newly allocated OnCommand object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public OnCommand(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *Constructs a newly allocated OnCommand object
+ * @param cmdID an integer object representing a Command ID
+ * @param triggerSource a TriggerSource object
+ */
+ public OnCommand(@NonNull Integer cmdID, @NonNull TriggerSource triggerSource) {
+ this();
+ setCmdID(cmdID);
+ setTriggerSource(triggerSource);
+ }
+ /**
+ * <p>Returns an <i>Integer</i> object representing the Command ID</p>
+ * @return Integer an integer representation of this object
+ */
+ public Integer getCmdID() {
+ return getInteger( KEY_CMD_ID );
+ }
+ /**
+ * <p>Sets a Command ID</p>
+ * @param cmdID an integer object representing a Command ID
+ */
+ public void setCmdID( @NonNull Integer cmdID ) {
+ setParameters(KEY_CMD_ID, cmdID);
+ }
+ /**
+ * <p>Returns a <I>TriggerSource</I> object which will be shown in the HMI</p>
+ * @return TriggerSource a TriggerSource object
+ */
+ public TriggerSource getTriggerSource() {
+ return (TriggerSource) getObject(TriggerSource.class, KEY_TRIGGER_SOURCE);
+ }
+ /**
+ * <p>Sets TriggerSource</p>
+ * <p>Indicates whether command was selected via VR or via a menu selection (using the OK button).</p>
+ * @param triggerSource a TriggerSource object
+ */
+ public void setTriggerSource( @NonNull TriggerSource triggerSource ) {
+ setParameters(KEY_TRIGGER_SOURCE, triggerSource);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java
new file mode 100644
index 000000000..e4efe5e13
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
+
+import java.util.Hashtable;
+
+/**
+ * <p>Notifies the application of the current driver distraction state (whether driver distraction rules are in effect, or
+ * not).</p>
+ *
+ * <p></p>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul><li>Can be sent with FULL, LIMITED or BACKGROUND</li></ul>
+ * AudioStreamingState:
+ * <ul><li>Any</li></ul>
+ * SystemContext:
+ * <ul><li>Any</li></ul>
+ * </ul>
+ * <p></p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>state</td>
+ * <td>{@linkplain DriverDistractionState}</td>
+ * <td>Current driver distraction state (i.e. whether driver distraction rules are in effect, or not). </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ */
+public class OnDriverDistraction extends RPCNotification {
+ public static final String KEY_STATE = "state";
+ /**
+ *Constructs a newly allocated OnDriverDistraction object
+ */
+ public OnDriverDistraction() {
+ super(FunctionID.ON_DRIVER_DISTRACTION.toString());
+ }
+ /**
+ *<p>Constructs a newly allocated OnDriverDistraction object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public OnDriverDistraction(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *Constructs a newly allocated OnDriverDistraction object
+ * @param state the current driver distraction state
+ */
+ public OnDriverDistraction(@NonNull DriverDistractionState state) {
+ this();
+ setState(state);
+ }
+ /**
+ * <p>Called to get the current driver distraction state(i.e. whether driver distraction rules are in effect, or not)</p>
+ * @return {@linkplain DriverDistractionState} the Current driver distraction state.
+ */
+ public DriverDistractionState getState() {
+ return (DriverDistractionState) getObject(DriverDistractionState.class, KEY_STATE);
+ }
+ /**
+ * <p>Called to set the driver distraction state(i.e. whether driver distraction rules are in effect, or not)</p>
+ * @param state the current driver distraction state
+ */
+ public void setState( @NonNull DriverDistractionState state ) {
+ setParameters(KEY_STATE, state);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
new file mode 100644
index 000000000..8f98d65a8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.SystemContext;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingState;
+
+import java.util.Hashtable;
+
+/**
+ * <p>Notifies an application that HMI conditions have changed for the application. This indicates whether the application
+ * can speak phrases, display text, perform interactions, receive button presses and events, stream audio, etc. This
+ * notification will be sent to the application when there has been a change in any one or several of the indicated
+ * states ({@linkplain HMILevel}, {@linkplain AudioStreamingState} or {@linkplain SystemContext}) for the application</p>
+ * <p>All three values are, in principle, independent of each other (though there may be some relationships). A value for
+ * one parameter should not be interpreted from the value of another parameter.</p>
+ * <p>There are no guarantees about the timeliness or latency of the OnHMIStatus notification. Therefore, for example,
+ * information such as {@linkplain AudioStreamingState} may not indicate that the audio stream became inaudible to the user
+ * exactly when the OnHMIStatus notification was received.</p>
+ *
+ * <p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>hmiLevel</td>
+ * <td>{@linkplain HMILevel}</td>
+ * <td>The current HMI Level in effect for the application.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>audioStreamingState</td>
+ * <td>{@linkplain AudioStreamingState}</td>
+ * <td>Current state of audio streaming for the application.
+ * When this parameter has a value of NOT_AUDIBLE,
+ * the application must stop streaming audio to SDL.
+ * Informs app whether any currently streaming audio is
+ * audible to user (AUDIBLE) or not (NOT_AUDIBLE). A
+ * value of NOT_AUDIBLE means that either the
+ * application's audio will not be audible to the user, or
+ * that the application's audio should not be audible to
+ * the user (i.e. some other application on the mobile
+ * device may be streaming audio and the application's
+ * audio would be blended with that other audio). </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>videoStreamingState</td>
+ * <td>{@linkplain VideoStreamingState}</td>
+ * <td>If it is NOT_STREAMABLE, the app must stop streaming video to SDL Core(stop service).</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>systemContext</td>
+ * <td>{@linkplain SystemContext}</td>
+ * <td>Indicates that a user-initiated interaction is in-progress
+ * (VRSESSION or MENU), or not (MAIN)</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * </p>
+ * @since SmartDeviceLink 1.0
+ * @see RegisterAppInterface
+ */
+public class OnHMIStatus extends RPCNotification {
+ public static final String KEY_AUDIO_STREAMING_STATE = "audioStreamingState";
+ public static final String KEY_VIDEO_STREAMING_STATE = "videoStreamingState";
+ public static final String KEY_SYSTEM_CONTEXT = "systemContext";
+ public static final String KEY_HMI_LEVEL = "hmiLevel";
+
+ private Boolean firstRun;
+
+ /**
+ *Constructs a newly allocated OnHMIStatus object
+ */
+ public OnHMIStatus() {
+ super(FunctionID.ON_HMI_STATUS.toString());
+ }
+ /**
+ *<p>Constructs a newly allocated OnHMIStatus object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public OnHMIStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *Constructs a newly allocated OnHMIStatus object
+ * @param hmiLevel the HMILevel to set
+ * @param audioStreamingState the state of audio streaming of the application
+ * @param systemContext Indicates that a user-initiated interaction is in-progress
+ */
+ public OnHMIStatus(@NonNull HMILevel hmiLevel, @NonNull AudioStreamingState audioStreamingState, @NonNull SystemContext systemContext) {
+ this();
+ setHmiLevel(hmiLevel);
+ 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
+ */
+ public HMILevel getHmiLevel() {
+ return (HMILevel) getObject(HMILevel.class, KEY_HMI_LEVEL);
+ }
+ /**
+ * <p>Set the HMILevel of OnHMIStatus</p>
+ * @param hmiLevel the HMILevel to set
+ */
+ public void setHmiLevel( @NonNull HMILevel hmiLevel ) {
+ setParameters(KEY_HMI_LEVEL, hmiLevel);
+ }
+ /**
+ * <p>Get current state of audio streaming for the application</p>
+ * @return {@linkplain AudioStreamingState} Returns current state of audio streaming for the application
+ */
+ public AudioStreamingState getAudioStreamingState() {
+ return (AudioStreamingState) getObject(AudioStreamingState.class, KEY_AUDIO_STREAMING_STATE);
+ }
+ /**
+ * <p>Set the audio streaming state</p>
+ * @param audioStreamingState the state of audio streaming of the application
+ */
+ public void setAudioStreamingState(@NonNull AudioStreamingState audioStreamingState ) {
+ setParameters(KEY_AUDIO_STREAMING_STATE, audioStreamingState);
+ }
+ /**
+ * <p>Get current state of video streaming for the application</p>
+ * @return {@linkplain VideoStreamingState} Returns current state of video streaming for the application
+ */
+ public VideoStreamingState getVideoStreamingState() {
+ return (VideoStreamingState) getObject(VideoStreamingState.class, KEY_VIDEO_STREAMING_STATE);
+ }
+ /**
+ * <p>Set the video streaming state</p>
+ * @param videoStreamingState the state of video streaming of the application
+ */
+ public void setVideoStreamingState( VideoStreamingState videoStreamingState ) {
+ setParameters(KEY_VIDEO_STREAMING_STATE, videoStreamingState);
+ }
+ /**
+ * <p>Get the System Context</p>
+ * @return {@linkplain SystemContext} whether a user-initiated interaction is in-progress (VRSESSION or MENU), or not (MAIN).
+ */
+ public SystemContext getSystemContext() {
+ return (SystemContext) getObject(SystemContext.class, KEY_SYSTEM_CONTEXT);
+ }
+ /**
+ * <p>Set the System Context of OnHMIStatus</p>
+ * @param systemContext Indicates that a user-initiated interaction is in-progress
+ * (VRSESSION or MENU), or not (MAIN)
+ */
+ public void setSystemContext( @NonNull SystemContext systemContext ) {
+ setParameters(KEY_SYSTEM_CONTEXT, systemContext);
+ }
+ /**
+ * <p>Query whether it's the first run</p>
+ * @return boolean whether it's the first run
+ */
+ public Boolean getFirstRun() {
+ return this.firstRun;
+ }
+ /**
+ * <p>Set the firstRun value</p>
+ * @param firstRun True if it is the first run, False or not
+ */
+ public void setFirstRun(Boolean firstRun) {
+ this.firstRun = firstRun;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java
new file mode 100644
index 000000000..dda2d57d9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+import java.util.Hashtable;
+
+/**
+ * Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
+ * Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
+ * <p></p>
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>hashID</td>
+ * <td>String</td>
+ * <td>Calculated hash ID to be referenced during RegisterAppInterface.</td>
+ * <td>Y</td>
+ * <td>maxlength: 100</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 3.0
+ *
+ */
+public class OnHashChange extends RPCNotification {
+ public static final String KEY_HASH_ID = "hashID";
+ /**
+ * Constructs a new OnHashChange object
+ */
+
+ public OnHashChange() {
+ super(FunctionID.ON_HASH_CHANGE.toString());
+ }
+ /**
+ * <p>
+ * Constructs a new OnKeyboardInput object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+
+ public OnHashChange(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new OnHashChange object
+ */
+ public OnHashChange(@NonNull String hashID) {
+ this();
+ setHashID(hashID);
+ }
+
+ public String getHashID() {
+ return getString(KEY_HASH_ID);
+ }
+
+ public void setHashID(@NonNull String hashID) {
+ setParameters(KEY_HASH_ID, hashID);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java
new file mode 100644
index 000000000..0d05452c2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+import java.util.Hashtable;
+
+public class OnInteriorVehicleData extends RPCNotification {
+ public static final String KEY_MODULE_DATA = "moduleData";
+
+ /**
+ * Constructs a new OnInteriorVehicleData object
+ */
+ public OnInteriorVehicleData() {
+ super(FunctionID.ON_INTERIOR_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * <p>Constructs a new OnInteriorVehicleData object indicated by the
+ * Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public OnInteriorVehicleData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new OnInteriorVehicleData object
+ * @param moduleData
+ */
+ public OnInteriorVehicleData(@NonNull ModuleData moduleData) {
+ this();
+ setModuleData(moduleData);
+ }
+
+ /**
+ * Gets the moduleData
+ *
+ * @return ModuleData
+ */
+ public ModuleData getModuleData() {
+ return (ModuleData) getObject(ModuleData.class, KEY_MODULE_DATA);
+ }
+
+ /**
+ * Sets the moduleData
+ *
+ * @param moduleData
+ */
+ public void setModuleData(@NonNull ModuleData moduleData) {
+ setParameters(KEY_MODULE_DATA, moduleData);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java
new file mode 100644
index 000000000..10078a707
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
+
+import java.util.Hashtable;
+
+/**
+ * On-screen keyboard event. Can be full string or individual keypresses depending on keyboard mode.
+ * <p></p>
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>event</td>
+ * <td>KeyboardEvent</td>
+ * <td>On-screen keyboard input data.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0</td>
+ * </tr>
+ * <tr>
+ * <td>data</td>
+ * <td>String</td>
+ * <td>On-screen keyboard input data.For dynamic keypress events, this will be the current compounded string of entry text.For entry cancelled and entry aborted events, this data param will be omitted.</td>
+ * <td></td>
+ * <td>Maxlength: 500</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ *
+ * </table>
+ *
+ */
+
+public class OnKeyboardInput extends RPCNotification {
+ public static final String KEY_DATA = "data";
+ public static final String KEY_EVENT = "event";
+ /**
+ * Constructs a new OnKeyboardInput object
+ */
+ public OnKeyboardInput() {
+ super(FunctionID.ON_KEYBOARD_INPUT.toString());
+ }
+ /**
+ * <p>
+ * Constructs a new OnKeyboardInput object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+
+ public OnKeyboardInput(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new OnKeyboardInput object
+ */
+ public OnKeyboardInput(@NonNull KeyboardEvent event) {
+ this();
+ setEvent(event);
+ }
+
+ public KeyboardEvent getEvent() {
+ return (KeyboardEvent) getObject(KeyboardEvent.class, KEY_EVENT);
+ }
+
+ public void setEvent(@NonNull KeyboardEvent event) {
+ setParameters(KEY_EVENT, event);
+ }
+
+ public void setData(String data) {
+ setParameters(KEY_DATA, data);
+ }
+ public String getData() {
+ Object obj = getParameters(KEY_DATA);
+ if (obj instanceof String) {
+ return (String) obj;
+ }
+ return null;
+ }
+
+ @Override
+ public String toString(){
+ String result = this.getFunctionName() +": " + " data: " + this.getData() + " event:" + this.getEvent().toString();
+ return result;
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java
new file mode 100644
index 000000000..82c49a1b3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+
+import java.util.Hashtable;
+
+/**
+ * Provides information to what language the Sdl HMI language was changed
+ * <p>
+ * </p>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul>
+ * <li>TBD</li>
+ * </ul>
+ * AudioStreamingState:
+ * <ul>
+ * <li>TBD</li>
+ * </ul>
+ * SystemContext:
+ * <ul>
+ * <li>TBD</li>
+ * </ul>
+ * </ul>
+ * <p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Req</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>language</td>
+ * <td>{@linkplain Language}</td>
+ * <td>Current SDL voice engine (VR+TTS) language</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>hmiDisplayLanguage</td>
+ * <td>{@linkplain Language}</td>
+ * <td>Current display language</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * </p>
+ *
+ */
+public class OnLanguageChange extends RPCNotification {
+ public static final String KEY_LANGUAGE = "language";
+ public static final String KEY_HMI_DISPLAY_LANGUAGE = "hmiDisplayLanguage";
+ /**
+ *Constructs a newly allocated OnCommand object
+ */
+ public OnLanguageChange() {
+ super(FunctionID.ON_LANGUAGE_CHANGE.toString());
+ }
+ /**
+ *<p>Constructs a newly allocated OnLanguageChange object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public OnLanguageChange(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *Constructs a newly allocated OnCommand object
+ * @param language language that current SDL voice engine(VR+TTS) use
+ * @param hmiDisplayLanguage language that current SDL voice engine(VR+TTS) use
+ */
+ public OnLanguageChange(@NonNull Language language, @NonNull Language hmiDisplayLanguage) {
+ this();
+ setLanguage(language);
+ setHmiDisplayLanguage(hmiDisplayLanguage);
+ }
+ /**
+ * <p>Sets language that current SDL voice engine(VR+TTS) use</p>
+ * @param language language that current SDL voice engine(VR+TTS) use
+ */
+ public void setLanguage(@NonNull Language language) {
+ setParameters(KEY_LANGUAGE, language);
+ }
+ /**
+ * <p>Returns language that current SDL voice engine(VR+TTS) use</p>
+ * @return {@linkplain Language} language that current SDL voice engine(VR+TTS) use
+ */
+ public Language getLanguage() {
+ return (Language) getObject(Language.class, KEY_LANGUAGE);
+ }
+ /**
+ * <p>Sets language that current display use</p>
+ * @param hmiDisplayLanguage language that current SDL voice engine(VR+TTS) use
+ */
+ public void setHmiDisplayLanguage(@NonNull Language hmiDisplayLanguage) {
+ setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
+ }
+ /**
+ * <p>Returns language that current display use</p>
+ * @return {@linkplain Language} language that current display use
+ */
+ public Language getHmiDisplayLanguage() {
+ return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLockScreenStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLockScreenStatus.java
new file mode 100644
index 000000000..69dd0e2df
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLockScreenStatus.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
+
+import static com.smartdevicelink.proxy.rpc.OnHMIStatus.KEY_HMI_LEVEL;
+
+/**
+ * The lockscreen must perform the following:
+ * Limit all application control usability from the mobile device with a full-screen static image overlay or separate view.
+ * For simplicity, the OnLockScreenStatus RPC will be provided via the onOnLockScreenNotification call back. The call back will include the LockScreenStatus enum which indicates if the lockscreen is required, optional or not required.
+ * The call back also includes details regarding the current HMI_Status level, driver distraction status and user selection status of the application.
+ *
+ *
+ */
+public class OnLockScreenStatus extends RPCNotification {
+ public static final String KEY_DRIVER_DISTRACTION = "driverDistraction";
+ public static final String KEY_SHOW_LOCK_SCREEN = "showLockScreen";
+ public static final String KEY_USER_SELECTED = "userSelected";
+
+ public OnLockScreenStatus() {
+ super(FunctionID.ON_LOCK_SCREEN_STATUS.toString());
+ }
+ /**
+ * <p>Get the current driver distraction status(i.e. whether driver distraction rules are in effect, or not)</p>
+ * @return Boolean
+ */
+
+ public Boolean getDriverDistractionStatus() {
+ return getBoolean(KEY_DRIVER_DISTRACTION);
+ }
+
+ public void setDriverDistractionStatus(Boolean driverDistractionStatus) {
+ setParameters(KEY_DRIVER_DISTRACTION, driverDistractionStatus);
+ }
+ /**
+ * <p>Get the {@linkplain LockScreenStatus} enumeration, indicating if the lockscreen should be required, optional or off </p>
+ * @return {@linkplain LockScreenStatus}
+ */
+
+ public LockScreenStatus getShowLockScreen() {
+ return (LockScreenStatus) getParameters(KEY_SHOW_LOCK_SCREEN);
+ }
+
+ public void setShowLockScreen(LockScreenStatus showLockScreen) {
+ setParameters(KEY_SHOW_LOCK_SCREEN, showLockScreen);
+ }
+ /**
+ * <p>Get user selection status for the application (has the app been selected via hmi or voice command)</p>
+ * @return Boolean the current user selection status
+ */
+
+ public Boolean getUserSelected() {
+ return getBoolean(KEY_USER_SELECTED);
+ }
+
+ public void setUserSelected(Boolean userSelected) {
+ setParameters(KEY_USER_SELECTED, userSelected);
+ }
+ /**
+ * <p>Get HMILevel in effect for the application</p>
+ * @return {@linkplain HMILevel} the current HMI Level in effect for the application
+ */
+
+ public HMILevel getHMILevel() {
+ return (HMILevel) getParameters(KEY_HMI_LEVEL);
+ }
+
+ public void setHMILevel(HMILevel setHMILevel) {
+ setParameters(KEY_HMI_LEVEL, setHMILevel);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java
new file mode 100644
index 000000000..4f5845e4a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Provides update to app of which sets of functions are available
+ * <p>
+ * </p>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul>
+ * <li>Any</li>
+ * </ul>
+ * AudioStreamingState:
+ * <ul>
+ * <li>TBD</li>
+ * </ul>
+ * SystemContext:
+ * <ul>
+ * <li>TBD</li>
+ * </ul>
+ * </ul>
+ * <p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Req</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>permissionItem</td>
+ * <td>PermissionItem[]</td>
+ * <td>Change in permissions for a given set of RPCs</td>
+ * <td>Y</td>
+ * <td>Minsize=1 Maxsize=100</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * </p>
+ */
+public class OnPermissionsChange extends RPCNotification {
+ public static final String KEY_PERMISSION_ITEM = "permissionItem";
+ /**
+ *Constructs a newly allocated OnCommand object
+ */
+ public OnPermissionsChange() {
+ super(FunctionID.ON_PERMISSIONS_CHANGE.toString());
+ }
+ /**
+ *<p>Constructs a newly allocated OnPermissionsChange object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public OnPermissionsChange(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *Constructs a newly allocated OnCommand object
+ * @param permissionItem an List of PermissionItem describing change in permissions for a given set of RPCs
+ */
+ public OnPermissionsChange(@NonNull List<PermissionItem> permissionItem) {
+ this();
+ setPermissionItem(permissionItem);
+ }
+ /**
+ * <p>Returns List<PermissionItem> object describing change in permissions for a given set of RPCs</p>
+ * @return List<{@linkplain PermissionItem}> an object describing describing change in permissions for a given set of RPCs
+ */
+ @SuppressWarnings("unchecked")
+ public List<PermissionItem> getPermissionItem() {
+ return (List<PermissionItem>) getObject(PermissionItem.class, KEY_PERMISSION_ITEM);
+ }
+ /**
+ * <p>Sets PermissionItems describing change in permissions for a given set of RPCs</p>
+ * @param permissionItem an List of PermissionItem describing change in permissions for a given set of RPCs
+ */
+ public void setPermissionItem(@NonNull List<PermissionItem> permissionItem) {
+ setParameters(KEY_PERMISSION_ITEM, permissionItem);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java
new file mode 100644
index 000000000..08ffb803b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class OnRCStatus extends RPCNotification {
+ public static final String KEY_ALLOCATED_MODULES = "allocatedModules";
+ public static final String KEY_FREE_MODULES = "freeModules";
+ public static final String KEY_ALLOWED = "allowed";
+
+ /**
+ * Constructs a new OnRCStatus object
+ */
+ public OnRCStatus() {
+ super(FunctionID.ON_RC_STATUS.toString());
+ }
+
+ /**
+ * Constructs a new OnRCStatus object indicated by the Hashtable
+ * parameter
+ * @param hash The Hashtable to use
+ */
+ public OnRCStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated OnRCStatus object
+ *
+ * @param allocatedModules Contains a list (zero or more) of module types that are allocated to the application.
+ * @param freeModules Contains a list (zero or more) of module types that are free to access for the application.
+ */
+ public OnRCStatus(@NonNull List<ModuleData> allocatedModules, @NonNull List<ModuleData> freeModules) {
+ this();
+ setAllocatedModules(allocatedModules);
+ setFreeModules(freeModules);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<ModuleData> getAllocatedModules() {
+ return (List<ModuleData>) getObject(ModuleData.class, KEY_ALLOCATED_MODULES);
+ }
+
+ public void setAllocatedModules(@NonNull List<ModuleData> allocatedModules) {
+ setParameters(KEY_ALLOCATED_MODULES, allocatedModules);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<ModuleData> getFreeModules() {
+ return (List<ModuleData>) getObject(ModuleData.class, KEY_FREE_MODULES);
+ }
+
+ public void setFreeModules(@NonNull List<ModuleData> freeModules) {
+ setParameters(KEY_FREE_MODULES, freeModules);
+ }
+
+ public Boolean getAllowed() {
+ return getBoolean(KEY_ALLOWED);
+ }
+
+ public void setAllowed(Boolean allowed) {
+ setParameters(KEY_ALLOWED, allowed);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSdlChoiceChosen.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSdlChoiceChosen.java
new file mode 100644
index 000000000..f210bc99a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSdlChoiceChosen.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class OnSdlChoiceChosen extends RPCNotification {
+ public static final String KEY_SDL_CHOICE = "sdlChoice";
+ public static final String KEY_TRIGGER_SOURCE = "triggerSource";
+
+ public class SdlSubMenu {
+ private Integer _menuID = null;
+ @SuppressWarnings("unused")
+ private Integer _position = null;
+ private String _menuName = null;
+
+ // Constructor
+ SdlSubMenu(Integer menuID, Integer position, String menuName) {
+ _menuID = menuID;
+ _position = position;
+ _menuName = menuName;
+ }
+
+ // Restrict no-arg constructor
+ @SuppressWarnings("unused")
+ private SdlSubMenu() {}
+
+ // Public Getters
+ public Integer getMenuID() {
+ return _menuID;
+ }
+
+ public String getMenuName() {
+ return _menuName;
+ }
+
+ public String toString() {
+ return _menuName;
+ }
+ }
+
+ public class SdlCommand {
+ private Integer _commandID = null;
+ private SdlSubMenu _parentSubMenu = null;
+ @SuppressWarnings("unused")
+ private Integer _position = null;
+ private String _menuName = null;
+ private List<String> _vrCommands = null;
+
+ // Constructor
+ SdlCommand(Integer commandID, SdlSubMenu parentSubMenu, Integer position, String menuName, List<String> vrCommands) {
+ _commandID = commandID;
+ _parentSubMenu = parentSubMenu;
+ _position = position;
+ _menuName = menuName;
+ _vrCommands = vrCommands;
+ }
+
+ // Restrict no-arg constructor
+ @SuppressWarnings("unused")
+ private SdlCommand() {}
+
+ // Public Getters
+ public Integer getCommandID() {
+ return _commandID;
+ }
+
+ public SdlSubMenu getParentSubMenu() {
+ return _parentSubMenu;
+ }
+
+ public String getMenuName() {
+ return _menuName;
+ }
+
+ public List<String> getVrCommands() {
+ return _vrCommands;
+ }
+
+ public String toString() {
+ return _menuName;
+ }
+ }
+
+ public class SdlChoice {
+
+ private Choice _choice = null;
+
+ // Constructor
+ public SdlChoice(Choice choice) {
+ _choice = choice;
+ }
+
+ public Choice getChoice() {
+ return _choice;
+ }
+
+ public Integer getChoiceID() {
+ return _choice.getChoiceID();
+ }
+
+ public String getMenuName() {
+ return _choice.getMenuName();
+ }
+
+ public List<String> getVrCommands() {
+ return _choice.getVrCommands();
+ }
+
+ public String toString() {
+ return _choice.getMenuName();
+ }
+ }
+
+ public class SdlChoiceSet {
+ private Integer _choiceSetID = null;
+ private List<SdlChoice> _choiceSet = null;
+
+ // Constructor
+ SdlChoiceSet(Integer choiceSetID, List<SdlChoice> choiceSet) {
+ _choiceSetID = choiceSetID;
+ _choiceSet = choiceSet;
+ }
+
+ public Integer getChoiceSetID() {
+ return _choiceSetID;
+ }
+
+ public List<SdlChoice> getChoiceSet() {
+ return _choiceSet;
+ }
+ }
+
+
+
+
+ public OnSdlChoiceChosen() {
+ super(FunctionID.ON_SDL_CHOICE_CHOSEN.toString());
+ }
+ public OnSdlChoiceChosen(Hashtable<String, Object> hash){
+ super(hash);
+ }
+ public SdlChoice getSdlChoice() {
+ return (SdlChoice) getParameters(KEY_SDL_CHOICE);
+ }
+ public void setSdlChoice(SdlChoice sdlChoice) {
+ setParameters(KEY_SDL_CHOICE, sdlChoice);
+ }
+ public TriggerSource getTriggerSource() {
+ return (TriggerSource) getObject(TriggerSource.class, KEY_TRIGGER_SOURCE);
+ }
+ public void setTriggerSource( TriggerSource triggerSource ) {
+ setParameters(KEY_TRIGGER_SOURCE, triggerSource);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnStreamRPC.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnStreamRPC.java
new file mode 100644
index 000000000..cb087c7a4
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnStreamRPC.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+public class OnStreamRPC extends RPCNotification {
+ public static final String KEY_FILENAME = "fileName";
+ public static final String KEY_BYTESCOMPLETE = "bytesComplete";
+ public static final String KEY_FILESIZE = "fileSize";
+
+ public OnStreamRPC() {
+ super(FunctionID.ON_STREAM_RPC.toString());
+ }
+
+ public void setFileName(String fileName) {
+ setParameters(KEY_FILENAME, fileName);
+ }
+ public String getFileName() {
+ return getString(KEY_FILENAME);
+ }
+
+ public void setBytesComplete(Long bytesComplete) {
+ setParameters(KEY_BYTESCOMPLETE, bytesComplete);
+ }
+ public Long getBytesComplete() {
+ return getLong(KEY_BYTESCOMPLETE);
+ }
+
+ public void setFileSize(Long fileSize) {
+ setParameters(KEY_FILESIZE, fileSize);
+ }
+ public Long getFileSize() {
+ return getLong(KEY_FILESIZE);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java
new file mode 100644
index 000000000..10f7fd7ce
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+import java.util.Hashtable;
+
+/**
+ * A notification to inform the connected device that a specific system capability has changed.
+ */
+public class OnSystemCapabilityUpdated extends RPCNotification {
+
+ public static final String KEY_SYSTEM_CAPABILITY = "systemCapability";
+
+ // Constructors
+
+ public OnSystemCapabilityUpdated() {
+ super(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.toString());
+ }
+
+ public OnSystemCapabilityUpdated(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public OnSystemCapabilityUpdated(@NonNull SystemCapability serviceData) {
+ this();
+ setSystemCapability(serviceData);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param systemCapability - The system capability that has been updated
+ */
+ public void setSystemCapability(@NonNull SystemCapability systemCapability){
+ setParameters(KEY_SYSTEM_CAPABILITY, systemCapability);
+ }
+
+ /**
+ * @return systemCapability - The system capability that has been updated
+ */
+ public SystemCapability getSystemCapability(){
+ return (SystemCapability) getObject(SystemCapability.class, KEY_SYSTEM_CAPABILITY);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java
new file mode 100644
index 000000000..819ab95fc
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud. Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>requestType</td>
+ * <td>RequestType</td>
+ * <td>The type of system request.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.3.2 </td>
+ * </tr>
+ * </tr>
+ * <tr>
+ * <td>requestSubType</td>
+ * <td>String</td>
+ * <td>This parameter is filled for supporting OEM proprietary data exchanges.</td>
+ * <td>N</td>
+ * <td>Max Length: 255</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>url</td>
+ * <td>Array of Strings</td>
+ * <td>Optional URL for HTTP requests.If blank, the binary data shall be forwarded to the app.If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds.</td>
+ * <td>N</td>
+ * <td>maxlength: 1000; minsize:1; maxsize: 100</td>
+ * <td>SmartDeviceLink 2.3.2 </td>
+ * </tr>
+ * <tr>
+ * <td>timeout</td>
+ * <td>Integer</td>
+ * <td>Optional timeout for HTTP requests;Required if a URL is provided</td>
+ * <td>N</td>
+ * <td>minvalue:0; maxvalue: 2000000000</td>
+ * <td>SmartDeviceLink </td>
+ * </tr>
+ * <tr>
+ * <td>fileType</td>
+ * <td>FileType</td>
+ * <td>Optional file type (meant for HTTP file requests).</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.3.2 </td>
+ * </tr>
+ * <tr>
+ * <td>offset</td>
+ * <td>Float</td>
+ * <td>Optional offset in bytes for resuming partial data chunks</td>
+ * <td>N</td>
+ * <td>minvalue:0; maxvalue:100000000000</td>
+ * <td>SmartDeviceLink 2.3.2 </td>
+ * </tr>
+ * <tr>
+ * <td>length</td>
+ * <td>Float</td>
+ * <td>Optional length in bytes for resuming partial data chunks</td>
+ * <td>N</td>
+ * <td>minvalue: 0; maxvalue:100000000000</td>
+ * <td>SmartDeviceLink 2.3.2 </td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.3.2
+ */
+public class OnSystemRequest extends RPCNotification {
+ public static final String KEY_URL_V1 = "URL";
+ public static final String KEY_URL = "url";
+ public static final String KEY_TIMEOUT_V1 = "Timeout";
+ public static final String KEY_TIMEOUT = "timeout";
+ public static final String KEY_HEADERS = "headers";
+ public static final String KEY_BODY = "body";
+ public static final String KEY_FILE_TYPE = "fileType";
+ public static final String KEY_REQUEST_TYPE = "requestType";
+ public static final String KEY_REQUEST_SUB_TYPE = "requestSubType";
+ public static final String KEY_DATA = "data";
+ public static final String KEY_OFFSET = "offset";
+ public static final String KEY_LENGTH = "length";
+
+ private String body;
+ private Headers headers;
+
+ /**
+ * Constructs a new OnSystemsRequest object
+ */
+ public OnSystemRequest() {
+ super(FunctionID.ON_SYSTEM_REQUEST.toString());
+ }
+
+ public OnSystemRequest(Hashtable<String, Object> hash) {
+ this(hash, (byte[]) hash.get(RPCStruct.KEY_BULK_DATA));
+ }
+
+ public OnSystemRequest(Hashtable<String, Object> hash, byte[] bulkData){
+ super(hash);
+ setBulkData(bulkData);
+ }
+
+ /**
+ * Constructs a new OnSystemsRequest object
+ */
+ public OnSystemRequest(@NonNull RequestType requestType) {
+ this();
+ setRequestType(requestType);
+ }
+
+ private void handleBulkData(byte[] bulkData){
+ if(bulkData == null){
+ return;
+ }
+
+ JSONObject httpJson;
+ String tempBody = null;
+ Headers tempHeaders = null;
+ if(RequestType.PROPRIETARY.equals(this.getRequestType())){
+ try{
+ JSONObject bulkJson = new JSONObject(new String(bulkData));
+
+ httpJson = bulkJson.getJSONObject("HTTPRequest");
+ tempBody = getBody(httpJson);
+ tempHeaders = getHeaders(httpJson);
+ }catch(JSONException e){
+ Log.e("OnSystemRequest", "HTTPRequest in bulk data was malformed.");
+ e.printStackTrace();
+ }catch(NullPointerException e){
+ Log.e("OnSystemRequest", "Invalid HTTPRequest object in bulk data.");
+ e.printStackTrace();
+ }
+ }else if(RequestType.HTTP.equals(this.getRequestType())){
+ tempHeaders = new Headers();
+ tempHeaders.setContentType("application/json");
+ tempHeaders.setConnectTimeout(7);
+ tempHeaders.setDoOutput(true);
+ tempHeaders.setDoInput(true);
+ tempHeaders.setUseCaches(false);
+ tempHeaders.setRequestMethod("POST");
+ tempHeaders.setReadTimeout(7);
+ tempHeaders.setInstanceFollowRedirects(false);
+ tempHeaders.setCharset("utf-8");
+ tempHeaders.setContentLength(bulkData.length);
+ }
+
+ this.body = tempBody;
+ this.headers = tempHeaders;
+ }
+
+ private String getBody(JSONObject httpJson){
+ String result = null;
+
+ try{
+ result = httpJson.getString("body");
+ }catch(JSONException e){
+ Log.e("OnSystemRequest", "\"body\" key doesn't exist in bulk data.");
+ e.printStackTrace();
+ }
+
+ return result;
+ }
+
+ private Headers getHeaders(JSONObject httpJson){
+ Headers result = null;
+
+ try{
+ JSONObject httpHeadersJson = httpJson.getJSONObject("headers");
+ Hashtable<String, Object> httpHeadersHash = JsonRPCMarshaller.deserializeJSONObject(httpHeadersJson);
+ result = new Headers(httpHeadersHash);
+ }catch(JSONException e){
+ Log.e("OnSystemRequest", "\"headers\" key doesn't exist in bulk data.");
+ e.printStackTrace();
+ }
+
+ return result;
+ }
+
+ @Deprecated
+ public void setBinData(byte[] aptData) {
+ setBulkData(aptData);
+ }
+
+ @Deprecated
+ public byte[] getBinData() {
+ return getBulkData();
+ }
+
+ @Override
+ public void setBulkData(byte[] bulkData){
+ super.setBulkData(bulkData);
+ handleBulkData(bulkData);
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public List<String> getLegacyData() {
+ return (List<String>) getObject(String.class, KEY_DATA);
+ }
+
+ public String getBody(){
+ return this.body;
+ }
+
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+ public void setHeaders(Headers header) {
+ this.headers = header;
+ }
+
+ public Headers getHeader() {
+ return this.headers;
+ }
+
+ public RequestType getRequestType() {
+ return (RequestType) getObject(RequestType.class, KEY_REQUEST_TYPE);
+ }
+
+ public void setRequestType(@NonNull RequestType requestType) {
+ setParameters(KEY_REQUEST_TYPE, requestType);
+ }
+
+ public String getRequestSubType() {
+ return getString(KEY_REQUEST_SUB_TYPE);
+ }
+
+ public void setRequestSubType(String requestSubType) {
+ setParameters(KEY_REQUEST_SUB_TYPE, requestSubType);
+ }
+
+ public String getUrl() {
+ Object o = getParameters(KEY_URL);
+ if (o == null)
+ {
+ //try again for gen 1.1
+ o = getParameters(KEY_URL_V1);
+ }
+ if (o == null)
+ return null;
+
+ if (o instanceof String) {
+ return (String) o;
+ }
+ return null;
+ }
+
+ public void setUrl(String url) {
+ setParameters(KEY_URL, url);
+ }
+
+ public FileType getFileType() {
+ return (FileType) getObject(FileType.class, KEY_FILE_TYPE);
+ }
+
+ public void setFileType(FileType fileType) {
+ setParameters(KEY_FILE_TYPE, fileType);
+ }
+
+ /**
+ * @deprecated as of SmartDeviceLink 4.0
+ * @param offset of the data attached
+ */
+ public void setOffset(Integer offset) {
+ if(offset == null){
+ setOffset((Long)null);
+ }else{
+ setOffset(offset.longValue());
+ }
+ }
+
+ public Long getOffset() {
+ final Object o = getParameters(KEY_OFFSET);
+
+ if (o == null){
+ return null;
+ }
+
+ if (o instanceof Integer) {
+ return ((Integer) o).longValue();
+ }else if(o instanceof Long){
+ return (Long) o;
+ }
+ return null;
+ }
+
+ public void setOffset(Long offset) {
+ setParameters(KEY_OFFSET, offset);
+ }
+
+ public Integer getTimeout() {
+ Object o = getParameters(KEY_TIMEOUT);
+
+ if (o == null){
+ o = getParameters(KEY_TIMEOUT_V1);
+ if (o == null) return null;
+ }
+
+ if (o instanceof Integer) {
+ return (Integer) o;
+ }
+ return null;
+ }
+
+ public void setTimeout(Integer timeout) {
+ setParameters(KEY_TIMEOUT, timeout);
+ }
+
+ public Long getLength() {
+ final Object o = getParameters(KEY_LENGTH);
+ if (o == null){
+ return null;
+ }
+
+ if (o instanceof Integer) {
+ return ((Integer) o).longValue();
+ }else if(o instanceof Long){
+ return (Long) o;
+ }
+ return null;
+ }
+
+ /**
+ * @deprecated as of SmartDeviceLink 4.0
+ * @param length of the data attached
+ */
+ public void setLength(Integer length) {
+ if(length == null){
+ setLength((Long)null);
+ }else{
+ setLength(length.longValue());
+ }
+ }
+
+ public void setLength(Long length) {
+ setParameters(KEY_LENGTH, length);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java
new file mode 100644
index 000000000..f3e481039
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.TBTState;
+
+import java.util.Hashtable;
+
+/**
+ * <p>Notifies the application of the current TBT client status on the module.</p>
+ *
+ * <p></p>
+ * <b>HMI Status Requirements:</b>
+ * <ul>
+ * HMILevel:
+ * <ul><li>Can be sent with FULL, LIMITED or BACKGROUND</li></ul>
+ * AudioStreamingState:
+ * <ul><li>Any</li></ul>
+ * SystemContext:
+ * <ul><li>Any</li></ul>
+ * </ul>
+ * <p></p>
+ * <b>Parameter List:</b>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver Available</th>
+ * </tr>
+ * <tr>
+ * <td>state</td>
+ * <td>{@linkplain TBTState}</td>
+ * <td>Current state of TBT client.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ *
+ */
+public class OnTBTClientState extends RPCNotification {
+ public static final String KEY_STATE = "state";
+ /**
+ *Constructs a newly allocated OnTBTClientState object
+ */
+ public OnTBTClientState() {
+ super(FunctionID.ON_TBT_CLIENT_STATE.toString());
+ }
+ /**
+ *<p>Constructs a newly allocated OnTBTClientState object indicated by the Hashtable parameter</p>
+ *@param hash The Hashtable to use
+ */
+ public OnTBTClientState(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ *Constructs a newly allocated OnTBTClientState object
+ * @param state current state of TBT client
+ */
+ public OnTBTClientState(@NonNull TBTState state) {
+ this();
+ setState(state);
+ }
+ /**
+ * <p>Called to get the current state of TBT client</p>
+ * @return {@linkplain TBTState} the current state of TBT client
+ */
+ public TBTState getState() {
+ return (TBTState) getObject(TBTState.class, KEY_STATE);
+ }
+ /**
+ * <p>Called to set the current state of TBT client</p>
+ * @param state current state of TBT client
+ */
+ public void setState( TBTState state ) {
+ setParameters(KEY_STATE, state);
+ }
+} // end-class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java
new file mode 100644
index 000000000..3982a8c3c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.TouchType;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ *
+ * Notifies about touch events on the screen's prescribed area.
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>type</td>
+ * <td>TouchType</td>
+ * <td>The type of touch event.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>event</td>
+ * <td>TouchEvent</td>
+ * <td>List of all individual touches involved in this event.</td>
+ * <td>Y</td>
+ * <td>minsize:1; maxsize:10</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * </table>
+ *
+ * <p><b>Note:</b></p>
+ * <p>SDL needs to be informed about every User`s touching the touch screen.</p>
+ *
+ */
+public class OnTouchEvent extends RPCNotification {
+ public static final String KEY_EVENT = "event";
+ public static final String KEY_TYPE = "type";
+ /**
+ * Constructs a new OnTouchEvent object
+ */
+
+ public OnTouchEvent() {
+ super(FunctionID.ON_TOUCH_EVENT.toString());
+ }
+ /**
+ * <p>
+ * Constructs a new OnTouchEvent object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+
+ public OnTouchEvent(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new OnTouchEvent object
+ */
+ public OnTouchEvent(@NonNull TouchType type, @NonNull List<TouchEvent> event) {
+ this();
+ setType(type);
+ setEvent(event);
+ }
+
+ public void setType(@NonNull TouchType type) {
+ setParameters(KEY_TYPE, type);
+ }
+
+ public TouchType getType() {
+ return (TouchType) getObject(TouchType.class, KEY_TYPE);
+ }
+
+ public void setEvent(@NonNull List<TouchEvent> event) {
+ setParameters(KEY_EVENT, event);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<TouchEvent> getEvent() {
+ return (List<TouchEvent>) getObject(TouchEvent.class, KEY_EVENT);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java
new file mode 100644
index 000000000..45dba173c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java
@@ -0,0 +1,585 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
+import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
+import com.smartdevicelink.proxy.rpc.enums.PRNDL;
+import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
+import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ *Individual requested DID result and data.
+ *
+ *
+ * <p>Callback for the periodic and non periodic vehicle data read function.</p>
+ *
+ * <p> <b>Note:</b></p>
+ *
+ * Initially SDL sends SubscribeVehicleData for getting the periodic updates from HMI whenever each of subscribed data types changes. OnVehicleData is expected to bring such updated values to SDL
+ *
+ *
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>Gps</td>
+ * <td>Boolean</td>
+ * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData} for details</td>
+ * <td>N</td>
+ * <td>Subscribable </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>Speed</td>
+ * <td>Float</td>
+ * <td>The vehicle speed in kilometers per hour</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>rpm</td>
+ * <td>Integer</td>
+ * <td>The number of revolutions per minute of the engine</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelLevel</td>
+ * <td>Float</td>
+ * <td>The fuel level in the tank (percentage)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelLevel_State</td>
+ * <td>ComponentVolumeStatus</td>
+ * <td>The fuel level state (Ok/Low)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>instantFuelConsumption</td>
+ * <td>Float</td>
+ * <td>The instantaneous fuel consumption in microlitres</td>
+ * <td>N</td>
+ * <td>Subscribable </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>externalTemperature</td>
+ * <td>Float</td>
+ * <td>The external temperature in degrees celsius.</td>
+ * <td>N</td>
+ * <td>Subscribable </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>vin</td>
+ * <td>String</td>
+ * <td>Vehicle identification number.</td>
+ * <td>N</td>
+ * <td>Subscribable </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>prndl</td>
+ * <td>PRNDL</td>
+ * <td>Currently selected gear.</td>
+ * <td>N</td>
+ * <td>Subscribable </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>tirePressure</td>
+ * <td>TireStatus</td>
+ * <td>Tire pressure status</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>odometer</td>
+ * <td>Integer</td>
+ * <td>Odometer in km</td>
+ * <td>N</td>
+ * <td>Subscribable </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>beltStatus</td>
+ * <td>BeltStatus</td>
+ * <td>The status of the seat belts.</td>
+ * <td>N</td>
+ * <td>Subscribable </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>bodyInformation</td>
+ * <td>BodyInformation</td>
+ * <td>The body information including power modes.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>deviceStatus</td>
+ * <td>DeviceStatus</td>
+ * <td>The connected mobile device status including signal and battery strength.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>eCallInfo</td>
+ * <td>ECallInfo</td>
+ * <td>Emergency Call notification and confirmation data.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>airbagStatus</td>
+ * <td>AirBagStatus</td>
+ * <td>The status of the air bags.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>emergencyEvent</td>
+ * <td>EmergencyEvernt</td>
+ * <td>Information related to an emergency event (and if it occurred).</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>clusterModeStatus</td>
+ * <td>ClusterModeStatus</td>
+ * <td>The status modes of the instrument panel cluster.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>myKey</td>
+ * <td>MyKey</td>
+ * <td>Information related to the MyKey feature.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>driverBraking</td>
+ * <td>vehicleDataEventStatus</td>
+ * <td>The status of the brake pedal.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>wiperStatus</td>
+ * <td>WiperStatus</td>
+ * <td>The status of the wipers</td>
+ * <td>N</td>
+ * <td> </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>headLampStatus</td>
+ * <td>headLampStatus</td>
+ * <td>Status of the head lamps</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>engineTorque</td>
+ * <td>Float</td>
+ * <td>Torque value for engine (in Nm) on non-diesel variants</td>
+ * <td>N</td>
+ * <td>minvalue:-1000; maxvalue:2000</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>engineOilLife</td>
+ * <td>Float</td>
+ * <td>The estimated percentage of remaining oil life of the engine</td>
+ * <td>N</td>
+ * <td>minvalue:0; maxvalue:100</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>accPedalPosition</td>
+ * <td>Float</td>
+ * <td>Accelerator pedal position (percentage depressed)</td>
+ * <td>N</td>
+ * <td>minvalue: 0; maxvalue:100</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>steeringWheelAngle</td>
+ * <td>Float</td>
+ * <td>Current angle of the steering wheel (in deg)</td>
+ * <td>N</td>
+ * <td> minvalue: -2000; maxvalue:2000</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>cloudAppVehicleID</td>
+ * <td>String</td>
+ * <td>ID for the vehicle when connecting to cloud applications</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 5.1 </td>
+ * </tr>
+ * </table>
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ * @see SubscribeVehicleData
+ * @see UnsubscribeVehicleData
+ *
+ *
+ */
+public class OnVehicleData extends RPCNotification {
+ public static final String KEY_SPEED = "speed";
+ public static final String KEY_RPM = "rpm";
+ public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ public static final String KEY_VIN = "vin";
+ public static final String KEY_PRNDL = "prndl";
+ public static final String KEY_TIRE_PRESSURE = "tirePressure";
+ public static final String KEY_ENGINE_TORQUE = "engineTorque";
+ public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
+ public static final String KEY_ODOMETER = "odometer";
+ public static final String KEY_GPS = "gps";
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
+ public static final String KEY_BELT_STATUS = "beltStatus";
+ public static final String KEY_BODY_INFORMATION = "bodyInformation";
+ public static final String KEY_DEVICE_STATUS = "deviceStatus";
+ public static final String KEY_DRIVER_BRAKING = "driverBraking";
+ public static final String KEY_WIPER_STATUS = "wiperStatus";
+ public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
+ public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
+ public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
+ public static final String KEY_E_CALL_INFO = "eCallInfo";
+ public static final String KEY_AIRBAG_STATUS = "airbagStatus";
+ public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
+ public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
+ public static final String KEY_MY_KEY = "myKey";
+ public static final String KEY_FUEL_RANGE = "fuelRange";
+ public static final String KEY_TURN_SIGNAL = "turnSignal";
+ public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
+ public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+
+
+ public OnVehicleData() {
+ super(FunctionID.ON_VEHICLE_DATA.toString());
+ }
+ public OnVehicleData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ public void setGps(GPSData gps) {
+ setParameters(KEY_GPS, gps);
+ }
+ @SuppressWarnings("unchecked")
+ public GPSData getGps() {
+ return (GPSData) getObject(GPSData.class, KEY_GPS);
+ }
+ public void setSpeed(Double speed) {
+ setParameters(KEY_SPEED, speed);
+ }
+ public Double getSpeed() {
+ Object object = getParameters(KEY_SPEED);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setRpm(Integer rpm) {
+ setParameters(KEY_RPM, rpm);
+ }
+ public Integer getRpm() {
+ return getInteger(KEY_RPM);
+ }
+ public void setFuelLevel(Double fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ }
+ public Double getFuelLevel() {
+ Object object = getParameters(KEY_FUEL_LEVEL);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ @Deprecated
+ public void setFuelLevel_State(ComponentVolumeStatus fuelLevel_State) {
+ setFuelLevelState(fuelLevel_State);
+ }
+ @Deprecated
+ public ComponentVolumeStatus getFuelLevel_State() {
+ return getFuelLevelState();
+ }
+ public void setFuelLevelState(ComponentVolumeStatus fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ }
+ public ComponentVolumeStatus getFuelLevelState() {
+ return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE);
+ }
+ public void setInstantFuelConsumption(Double instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ }
+ public Double getInstantFuelConsumption() {
+ Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setExternalTemperature(Double externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ }
+ public Double getExternalTemperature() {
+ Object object = getParameters(KEY_EXTERNAL_TEMPERATURE);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setVin(String vin) {
+ setParameters(KEY_VIN, vin);
+ }
+ public String getVin() {
+ return getString(KEY_VIN);
+ }
+ public void setPrndl(PRNDL prndl) {
+ setParameters(KEY_PRNDL, prndl);
+ }
+ public PRNDL getPrndl() {
+ return (PRNDL) getObject(PRNDL.class, KEY_PRNDL);
+ }
+ public void setTirePressure(TireStatus tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ }
+ @SuppressWarnings("unchecked")
+ public TireStatus getTirePressure() {
+ return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE);
+ }
+ public void setOdometer(Integer odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ }
+ public Integer getOdometer() {
+ return getInteger(KEY_ODOMETER);
+ }
+ public void setBeltStatus(BeltStatus beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public BeltStatus getBeltStatus() {
+ return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS);
+ }
+ public void setBodyInformation(BodyInformation bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ }
+ @SuppressWarnings("unchecked")
+ public BodyInformation getBodyInformation() {
+ return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION);
+ }
+ public void setDeviceStatus(DeviceStatus deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public DeviceStatus getDeviceStatus() {
+ return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS);
+ }
+ public void setDriverBraking(VehicleDataEventStatus driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ }
+ public VehicleDataEventStatus getDriverBraking() {
+ return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING);
+ }
+ public void setWiperStatus(WiperStatus wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ }
+ public WiperStatus getWiperStatus() {
+ return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS);
+ }
+ public void setHeadLampStatus(HeadLampStatus headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public HeadLampStatus getHeadLampStatus() {
+ return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS);
+ }
+ public void setEngineTorque(Double engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ }
+ public Double getEngineTorque() {
+ Object object = getParameters(KEY_ENGINE_TORQUE);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setEngineOilLife(Float engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ }
+ public Float getEngineOilLife() {
+ Object object = getParameters(KEY_ENGINE_OIL_LIFE);
+ return SdlDataTypeConverter.objectToFloat(object);
+ }
+ public void setAccPedalPosition(Double accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ }
+ public Double getAccPedalPosition() {
+ Object object = getParameters(KEY_ACC_PEDAL_POSITION);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setSteeringWheelAngle(Double steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ }
+ public Double getSteeringWheelAngle() {
+ Object object = getParameters(KEY_STEERING_WHEEL_ANGLE);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public void setECallInfo(ECallInfo eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ }
+ @SuppressWarnings("unchecked")
+ public ECallInfo getECallInfo() {
+ return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO);
+ }
+ public void setAirbagStatus(AirbagStatus airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public AirbagStatus getAirbagStatus() {
+ return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS);
+ }
+ public void setEmergencyEvent(EmergencyEvent emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ }
+ @SuppressWarnings("unchecked")
+ public EmergencyEvent getEmergencyEvent() {
+ return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT);
+ }
+ public void setClusterModeStatus(ClusterModeStatus clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public ClusterModeStatus getClusterModeStatus() {
+ return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS);
+ }
+ public void setMyKey(MyKey myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ }
+ @SuppressWarnings("unchecked")
+ public MyKey getMyKey() {
+ return (MyKey) getObject(MyKey.class, KEY_MY_KEY);
+ }
+
+ /**
+ * Sets Fuel Range List. Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ * @param fuelRange
+ */
+ public void setFuelRange(List<FuelRange> fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ }
+
+ /**
+ * Gets Fuel Range List.
+ * @return List<FuelRange>
+ * Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ */
+ @SuppressWarnings("unchecked")
+ public List<FuelRange> getFuelRange() {
+ return (List<FuelRange>) getObject(FuelRange.class, KEY_FUEL_RANGE);
+ }
+
+ /**
+ * Sets turnSignal
+ * @param turnSignal
+ */
+ public void setTurnSignal(TurnSignal turnSignal) {
+ setParameters(KEY_TURN_SIGNAL, turnSignal);
+ }
+
+ /**
+ * Gets turnSignal
+ * @return TurnSignal
+ */
+ @SuppressWarnings("unchecked")
+ public TurnSignal getTurnSignal() {
+ return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL);
+ }
+
+ /**
+ * Sets electronicParkBrakeStatus
+ * @param electronicParkBrakeStatus
+ */
+ public void setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus){
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ }
+
+ /**
+ * Gets electronicParkBrakeStatus
+ * @return ElectronicParkBrakeStatus
+ */
+ public ElectronicParkBrakeStatus getElectronicParkBrakeStatus(){
+ return (ElectronicParkBrakeStatus) getObject(ElectronicParkBrakeStatus.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ }
+
+ /**
+ * Sets a string value for the cloud app vehicle ID
+ * @param cloudAppVehicleID a string value
+ */
+ public void setCloudAppVehicleID(String cloudAppVehicleID){
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ }
+
+ /**
+ * Gets a String value of the returned cloud app vehicle ID
+ * @return a String value.
+ */
+ public String getCloudAppVehicleID(){
+ return getString(KEY_CLOUD_APP_VEHICLE_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java
new file mode 100644
index 000000000..44d3475a1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class OnWayPointChange extends RPCNotification {
+ public static final String KEY_WAY_POINTS = "wayPoints";
+
+ public OnWayPointChange() {
+ super(FunctionID.ON_WAY_POINT_CHANGE.toString());
+ }
+
+ public OnWayPointChange(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public OnWayPointChange(@NonNull List<LocationDetails> wayPoints) {
+ this();
+ setWayPoints(wayPoints);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<LocationDetails> getWayPoints() {
+ return (List<LocationDetails>) getObject(LocationDetails.class, KEY_WAY_POINTS);
+ }
+
+ public void setWayPoints(@NonNull List<LocationDetails> wayPoints) {
+ setParameters(KEY_WAY_POINTS, wayPoints);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java
new file mode 100644
index 000000000..99aa2f13b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Defining sets of parameters, which are permitted or prohibited for a given RPC.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>allowed</td>
+ * <td>String</td>
+ * <td>A set of all parameters that are permitted for this given RPC.
+ * <ul>
+ * <li>Min size: 0</li>
+ * <li>Max size: 100</li>
+ * <li>Max length: 100</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>userDisallowed</td>
+ * <td>String</td>
+ * <td>A set of all parameters that are prohibated for this given RPC.
+ * <ul>
+ * <li>Min size: 0</li>
+ * <li>Max size: 100</li>
+ * <li>Max length: 100</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class ParameterPermissions extends RPCStruct {
+ public static final String KEY_ALLOWED = "allowed";
+ public static final String KEY_USER_DISALLOWED = "userDisallowed";
+
+ /**
+ * Constructs a newly allocated ParameterPermissions object
+ */
+ public ParameterPermissions() { }
+
+ /**
+ * Constructs a newly allocated ParameterPermissions object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public ParameterPermissions(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated ParameterPermissions object
+ * @param allowed parameter that is permitted for this given RPC
+ * @param userDisallowed parameter that is prohibited for this given RPC
+ */
+ public ParameterPermissions(@NonNull List<String> allowed, @NonNull List<String> userDisallowed) {
+ this();
+ setAllowed(allowed);
+ setUserDisallowed(userDisallowed);
+ }
+
+ /**
+ * get a set of all parameters that are permitted for this given RPC.
+ * @return a set of all parameters that are permitted for this given RPC.
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getAllowed() {
+ return (List<String>) getObject(String.class, KEY_ALLOWED);
+ }
+
+ /**
+ * set a set of all parameters that are permitted for this given RPC.
+ * @param allowed parameter that is permitted for this given RPC
+ */
+ public void setAllowed(@NonNull List<String> allowed) {
+ setValue(KEY_ALLOWED, allowed);
+ }
+
+ /**
+ * get a set of all parameters that are prohibited for this given RPC.
+ * @return a set of all parameters that are prohibited for this given RPC
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getUserDisallowed() {
+ return (List<String>) getObject(String.class, KEY_USER_DISALLOWED);
+ }
+
+ /**
+ * set a set of all parameters that are prohibited for this given RPC.
+ * @param userDisallowed paramter that is prohibited for this given RPC
+ */
+ public void setUserDisallowed(@NonNull List<String> userDisallowed) {
+ setValue(KEY_USER_DISALLOWED, userDisallowed);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java
new file mode 100644
index 000000000..24e58ab1e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+public class PerformAppServiceInteraction extends RPCRequest {
+
+ public static final String KEY_SERVICE_URI = "serviceUri";
+ public static final String KEY_SERVICE_ID = "serviceID";
+ public static final String KEY_ORIGIN_APP = "originApp";
+ public static final String KEY_REQUEST_SERVICE_ACTIVE = "requestServiceActive";
+
+ // Constructors
+
+ public PerformAppServiceInteraction() {
+ super(FunctionID.PERFORM_APP_SERVICES_INTERACTION.toString());
+ }
+
+ public PerformAppServiceInteraction(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public PerformAppServiceInteraction(@NonNull String serviceUri, @NonNull String appServiceId, @NonNull String originApp) {
+ this();
+ setServiceUri(serviceUri);
+ setServiceID(appServiceId);
+ setOriginApp(originApp);
+ }
+
+ /**
+ * Fully qualified URI based on a predetermined scheme provided by the app service. SDL makes no guarantee that this
+ * URI is correct.
+ * @param serviceUri -
+ */
+ public void setServiceUri(@NonNull String serviceUri){
+ setParameters(KEY_SERVICE_URI, serviceUri);
+ }
+
+ /**
+ * Fully qualified URI based on a predetermined scheme provided by the app service. SDL makes no guarantee that this
+ * URI is correct.
+ * @return serviceUri
+ */
+ public String getServiceUri(){
+ return getString(KEY_SERVICE_URI);
+ }
+
+ /**
+ * The service ID that the app consumer wishes to send this URI.
+ * @param appServiceId -
+ */
+ public void setServiceID(@NonNull String appServiceId){
+ setParameters(KEY_SERVICE_ID, appServiceId);
+ }
+
+ /**
+ * The service ID that the app consumer wishes to send this URI.
+ * @return appServiceId
+ */
+ public String getServiceID(){
+ return getString(KEY_SERVICE_ID);
+ }
+
+ /**
+ * This string is the appID of the app requesting the app service provider take the specific action.
+ * @param originApp -
+ */
+ public void setOriginApp(@NonNull String originApp){
+ setParameters(KEY_ORIGIN_APP, originApp);
+ }
+
+ /**
+ * This string is the appID of the app requesting the app service provider take the specific action.
+ * @return originApp
+ */
+ public String getOriginApp(){
+ return getString(KEY_ORIGIN_APP);
+ }
+
+ /**
+ * This flag signals the requesting consumer would like this service to become the active primary
+ * service of the destination's type.
+ * @param requestServiceActive -
+ */
+ public void setRequestServiceActive(Boolean requestServiceActive){
+ setParameters(KEY_REQUEST_SERVICE_ACTIVE, requestServiceActive);
+ }
+
+ /**
+ * This string is the appID of the app requesting the app service provider take the specific action.
+ * @return requestServiceActive
+ */
+ public Boolean getRequestServiceActive(){
+ return getBoolean(KEY_REQUEST_SERVICE_ACTIVE);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java
new file mode 100644
index 000000000..7e0f77f6d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class PerformAppServiceInteractionResponse extends RPCResponse {
+
+ public static final String KEY_SERVICE_SPECIFIC_RESULT = "serviceSpecificResult";
+
+ /**
+ * Constructs a new PerformAppServiceInteractionResponse object
+ */
+ public PerformAppServiceInteractionResponse() {
+ super(FunctionID.PERFORM_APP_SERVICES_INTERACTION.toString());
+ }
+
+ public PerformAppServiceInteractionResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new PerformAppServiceInteractionResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public PerformAppServiceInteractionResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ // Setters / getters
+
+ /**
+ * The service can provide specific result strings to the consumer through this param.
+ * @param serviceSpecificResult -
+ */
+ public void setServiceSpecificResult(String serviceSpecificResult){
+ setParameters(KEY_SERVICE_SPECIFIC_RESULT, serviceSpecificResult);
+ }
+
+ /**
+ * The service can provide specific result strings to the consumer through this param.
+ * @return serviceSpecificResult
+ */
+ public String getServiceSpecificResult(){
+ return getString(KEY_SERVICE_SPECIFIC_RESULT);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java
new file mode 100644
index 000000000..77d656beb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java
@@ -0,0 +1,357 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.AudioType;
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This will open an audio pass thru session. By doing so the app can receive
+ * audio data through the vehicles microphone
+ *
+ * <p>Function Group: AudioPassThru</p>
+ *
+ * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th> Version</th>
+ * </tr>
+ * <tr>
+ * <td>initialPrompt</td>
+ * <td>TTSChunk[]</td>
+ * <td>SDL will speak this prompt before opening the audio pass thru session. </td>
+ * <td>N</td>
+ * <td>This is an array of text chunks of type TTSChunk. The array must have at least one item If omitted, then no initial prompt is spoken: <p>Array Minsize: 1</p> Array Maxsize: 100</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>audioPassThruDisplayText1</td>
+ * <td>String</td>
+ * <td>First line of text displayed during audio capture.</td>
+ * <td>N</td>
+ * <td>Maxlength = 500</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>samplingRate</td>
+ * <td>SamplingRate</td>
+ * <td>This value shall is allowed to be 8 or 16 or 22 or 44 khz.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>maxDuration</td>
+ * <td>Integer</td>
+ * <td>The maximum duration of audio recording in milliseconds.</td>
+ * <td>Y</td>
+ * <td>Minvalue: 1; Maxvalue: 1000000</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>bitsPerSample</td>
+ * <td>BitsPerSample</td>
+ * <td>Specifies the quality the audio is recorded - 8 bit or 16 bit.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>audioType</td>
+ * <td>AudioType</td>
+ * <td>Specifies the type of audio data being requested.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>muteAudio</td>
+ * <td>Boolean</td>
+ * <td>N</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ *
+ *
+ *
+ *
+ * </table>
+ * @since SmartDeviceLink 2.0
+ * @see EndAudioPassThru
+ */
+public class PerformAudioPassThru extends RPCRequest {
+ public static final String KEY_MAX_DURATION = "maxDuration";
+ public static final String KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1 = "audioPassThruDisplayText1";
+ public static final String KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2 = "audioPassThruDisplayText2";
+ public static final String KEY_MUTE_AUDIO = "muteAudio";
+ public static final String KEY_SAMPLING_RATE = "samplingRate";
+ public static final String KEY_AUDIO_TYPE = "audioType";
+ public static final String KEY_INITIAL_PROMPT = "initialPrompt";
+ public static final String KEY_BITS_PER_SAMPLE = "bitsPerSample";
+
+ /**
+ * Constructs a new PerformAudioPassThru object
+ */
+ public PerformAudioPassThru() {
+ super(FunctionID.PERFORM_AUDIO_PASS_THRU.toString());
+ }
+
+ /**
+ * <p>Constructs a new PerformAudioPassThru object indicated by the Hashtable
+ * parameter</p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public PerformAudioPassThru(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new PerformAudioPassThru object
+ * @param samplingRate a SamplingRate value representing a 8 or 16 or 22 or 24 khz
+ * @param maxDuration an Integer value representing the maximum duration of audio recording in millisecond <b>Notes: </b>Minvalue:1; Maxvalue:1000000
+ * @param bitsPerSample a BitsPerSample value representing 8 bit or 16 bit
+ * @param audioType an audioType
+ */
+ public PerformAudioPassThru(@NonNull SamplingRate samplingRate, @NonNull Integer maxDuration, @NonNull BitsPerSample bitsPerSample, @NonNull AudioType audioType) {
+ this();
+ setSamplingRate(samplingRate);
+ setMaxDuration(maxDuration);
+ setBitsPerSample(bitsPerSample);
+ setAudioType(audioType);
+ }
+
+ /**
+ * Sets initial prompt which will be spoken before opening the audio pass
+ * thru session by SDL
+ *
+ * @param initialPrompt
+ * a List<TTSChunk> value represents the initial prompt which
+ * will be spoken before opening the audio pass thru session by
+ * SDL
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>This is an array of text chunks of type TTSChunk</li>
+ * <li>The array must have at least one item</li>
+ * <li>If omitted, then no initial prompt is spoken</li>
+ * <li>Array Minsize: 1</li>
+ * <li>Array Maxsize: 100</li>
+ * </ul>
+ */
+ public void setInitialPrompt(List<TTSChunk> initialPrompt) {
+ setParameters(KEY_INITIAL_PROMPT, initialPrompt);
+ }
+
+ /**
+ * Gets a List value representing an initial prompt which will be spoken
+ * before opening the audio pass thru session by SDL
+ *
+ * @return List<TTSChunk> -a List value representing an initial prompt
+ * which will be spoken before opening the audio pass thru session
+ * by SDL
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getInitialPrompt() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_INITIAL_PROMPT);
+ }
+
+ /**
+ * Sets a line of text displayed during audio capture
+ *
+ * @param audioPassThruDisplayText1
+ * <p>a String value representing the line of text displayed during
+ * audio capture</p>
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public void setAudioPassThruDisplayText1(String audioPassThruDisplayText1) {
+ setParameters(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1, audioPassThruDisplayText1);
+ }
+
+ /**
+ * Gets a first line of text displayed during audio capture
+ *
+ * @return String -a String value representing a first line of text
+ * displayed during audio capture
+ */
+ public String getAudioPassThruDisplayText1() {
+ return getString(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1);
+ }
+
+ /**
+ * Sets a line of text displayed during audio capture
+ *
+ * @param audioPassThruDisplayText2
+ * <p>a String value representing the line of text displayed during
+ * audio capture</p>
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public void setAudioPassThruDisplayText2(String audioPassThruDisplayText2) {
+ setParameters(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2, audioPassThruDisplayText2);
+ }
+
+ /**
+ * Gets a second line of text displayed during audio capture
+ *
+ * @return String -a String value representing a first line of text
+ * displayed during audio capture
+ */
+ public String getAudioPassThruDisplayText2() {
+ return getString(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2);
+ }
+
+ /**
+ * Sets a samplingRate
+ *
+ * @param samplingRate
+ * a SamplingRate value representing a 8 or 16 or 22 or 24 khz
+ */
+ public void setSamplingRate(@NonNull SamplingRate samplingRate) {
+ setParameters(KEY_SAMPLING_RATE, samplingRate);
+ }
+
+ /**
+ * Gets a samplingRate
+ *
+ * @return SamplingRate -a SamplingRate value
+ */
+ public SamplingRate getSamplingRate() {
+ return (SamplingRate) getObject(SamplingRate.class, KEY_SAMPLING_RATE);
+ }
+
+ /**
+ * Sets the maximum duration of audio recording in milliseconds
+ *
+ * @param maxDuration
+ * an Integer value representing the maximum duration of audio
+ * recording in millisecond
+ * <p></p>
+ * <b>Notes: </b>Minvalue:1; Maxvalue:1000000
+ */
+ public void setMaxDuration(@NonNull Integer maxDuration) {
+ setParameters(KEY_MAX_DURATION, maxDuration);
+ }
+
+ /**
+ * Gets a max duration of audio recording in milliseconds
+ *
+ * @return int -an int value representing the maximum duration of audio
+ * recording in milliseconds
+ */
+ public Integer getMaxDuration() {
+ return getInteger(KEY_MAX_DURATION);
+ }
+
+ /**
+ * Sets the quality the audio is recorded - 8 bit or 16 bit
+ *
+ * @param audioQuality
+ * a BitsPerSample value representing 8 bit or 16 bit
+ */
+ public void setBitsPerSample(@NonNull BitsPerSample audioQuality) {
+ setParameters(KEY_BITS_PER_SAMPLE, audioQuality);
+ }
+
+ /**
+ * Gets a BitsPerSample value, 8 bit or 16 bit
+ *
+ * @return BitsPerSample -a BitsPerSample value
+ */
+ public BitsPerSample getBitsPerSample() {
+ return (BitsPerSample) getObject(BitsPerSample.class, KEY_BITS_PER_SAMPLE);
+ }
+
+ /**
+ * Sets an audioType
+ *
+ * @param audioType
+ * an audioType
+ */
+ public void setAudioType(@NonNull AudioType audioType) {
+ setParameters(KEY_AUDIO_TYPE, audioType);
+ }
+
+ /**
+ * Gets a type of audio data
+ *
+ * @return AudioType -an AudioType
+ */
+ public AudioType getAudioType() {
+ return (AudioType) getObject(AudioType.class, KEY_AUDIO_TYPE);
+ }
+
+ /**
+ *<p> Gets a Boolean value representing if the current audio source should be
+ * muted during the APT session</p>
+ *
+ *
+ * @return Boolean -a Boolean value representing if the current audio source
+ * should be muted during the APT session
+ */
+ public Boolean getMuteAudio() {
+ return getBoolean(KEY_MUTE_AUDIO);
+ }
+
+ /**
+ * <p>Sets a muteAudio value representing if the current audio source should be
+ * muted during the APT session
+ * If not, the audio source will play without interruption. If omitted, the
+ * value is set to true</p>
+ *
+ *
+ * @param muteAudio
+ * a Boolean value representing if the current audio source
+ * should be muted during the APT session
+ */
+ public void setMuteAudio(Boolean muteAudio) {
+ setParameters(KEY_MUTE_AUDIO, muteAudio);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java
new file mode 100644
index 000000000..b676a7913
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Perform Audio Pass Thru Response is sent, when PerformAudioPassThru has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class PerformAudioPassThruResponse extends RPCResponse {
+
+ /**
+ * Constructs a new PerformAudioPassThruResponse object
+ */
+ public PerformAudioPassThruResponse() {
+ super(FunctionID.PERFORM_AUDIO_PASS_THRU.toString());
+ }
+
+ /**
+ * <p>Constructs a new PerformAudioPassThruResponse object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public PerformAudioPassThruResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new PerformAudioPassThruResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public PerformAudioPassThruResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java
new file mode 100644
index 000000000..12be13e9f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java
@@ -0,0 +1,398 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
+import com.smartdevicelink.proxy.rpc.enums.LayoutMode;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Performs an application-initiated interaction in which the user can select a
+ * {@linkplain Choice} from among the specified Choice Sets. For instance, an
+ * application may use a PerformInteraction to ask a user to say the name of a
+ * song to play. The user's response is only valid if it appears in the
+ * specified Choice Sets and is recognized by SDL
+ * <p></p>
+ * <p>Function Group: Base</p>
+ *
+ * <p><b>HMILevel needs to be FULL</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>initialText</td>
+ * <td>String</td>
+ * <td>Displayed when the interaction begins. This text may be overlaid by the "Listening" prompt during the interaction. Text is displayed on first line of multiline display, and is centered. If text does not fit on line, it will be truncated</td>
+ * <td>Y</td>
+ * <td>maxlength:500</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>initialPrompt</td>
+ * <td>TTSChunk</td>
+ * <td>An array of one or more TTSChunks that, taken together, specify what is to be spoken to the user at the start of an interaction.</td>
+ * <td>Y</td>
+ * <td>minsize:1; maxsize:100</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>interactionMode</td>
+ * <td>InteractionMode</td>
+ * <td>Indicates how user selects interaction choice. User can choose either by voice (VR_ONLY), by visual selection from the menu (MANUAL_ONLY), or by either mode (BOTH). </td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>interactionChoiceSetIDList</td>
+ * <td>Integer</td>
+ * <td>Array of one or more Choice Set IDs. User can select any choice from any of the specified Choice Sets.</td>
+ * <td>Y</td>
+ * <td>minsize:0; maxsize:100; minvalue:0; maxvalue:2000000000</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>helpPrompt</td>
+ * <td>TTSChunk</td>
+ * <td>An array of TTSChunks which, taken together, specify the help phrase to be spoken when the user says "help" during the VR session. If this parameter is omitted, the help prompt will be constructed by SDL from the first vrCommand of each choice of all the Choice Sets specified in the interactionChoiceSetIDList parameter. </td>
+ * <td>N</td>
+ * <td>minsize:1; maxsize:100; The helpPrompt specified in SetGlobalProperties is not used by PerformInteraction.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>timeoutPrompt</td>
+ * <td>TTSChunk</td>
+ * <td>An array of TTSChunks which, taken together, specify the phrase to be spoken when the listen times out during the VR session. If this parameter is omitted, the timeout prompt will be the same as the help prompt (see helpPrompt parameter). </td>
+ * <td>N</td>
+ * <td>The timeoutPrompt specified in SetGlobalProperties is not used by PerformInteraction. minsize:1;maxsize:100</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>timeout</td>
+ * <td>Integer</td>
+ * <td>The amount of time, in milliseconds, SDL will wait for the user to make a choice (VR or Menu). If this time elapses without the user making a choice, the timeoutPrompt will be spoken. After this timeout value has been reached, the interaction will stop and a subsequent interaction will take place after SDL speaks the timeout prompt. If that times out as well, the interaction will end completely. If omitted, the default is 10000ms.</td>
+ * <td>N</td>
+ * <td>minvalue:5000; maxvalue:100000; defvalue:10000</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>vrHelp</td>
+ * <td>VrHelpItem</td>
+ * <td>Ability to send suggested VR Help Items to display on-screen during Perform Interaction If omitted on supported displays, the default SDL generated list of suggested choices will be displayed.</td>
+ * <td>N</td>
+ * <td>Min = 1;Max = 100</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>interactionLayout</td>
+ * <td>LayoutMode</td>
+ * <td>See {@linkplain LayoutMode}</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0</td>
+ * </tr>
+ * </table>
+ *
+ *
+ * @since SmartDeviceLink 1.0
+ * @see CreateInteractionChoiceSet
+ * @see DeleteInteractionChoiceSet
+ */
+public class PerformInteraction extends RPCRequest {
+ public static final String KEY_INITIAL_TEXT = "initialText";
+ public static final String KEY_INTERACTION_MODE = "interactionMode";
+ public static final String KEY_INTERACTION_CHOICE_SET_ID_LIST = "interactionChoiceSetIDList";
+ public static final String KEY_INTERACTION_LAYOUT = "interactionLayout";
+ public static final String KEY_INITIAL_PROMPT = "initialPrompt";
+ public static final String KEY_HELP_PROMPT = "helpPrompt";
+ public static final String KEY_TIMEOUT_PROMPT = "timeoutPrompt";
+ public static final String KEY_TIMEOUT = "timeout";
+ public static final String KEY_VR_HELP = "vrHelp";
+ /**
+ * Constructs a new PerformInteraction object
+ */
+ public PerformInteraction() {
+ super(FunctionID.PERFORM_INTERACTION.toString());
+ }
+ /**
+ * Constructs a new PerformInteraction object indicated by the Hashtable
+ * parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public PerformInteraction(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new PerformInteraction object
+ * @param initialText a String value that Displayed when the interaction begins
+ * @param interactionMode indicate how user selects interaction choice (VR_ONLY, MANUAL_ONLY or BOTH)
+ * @param interactionChoiceSetIDList a List<Integer> representing an Array of one or more Choice Set IDs. User can select any choice from any of the specified
+ * Choice Sets <b>Notes: </b>Min Value: 0; Max Vlaue: 2000000000
+ */
+ public PerformInteraction(@NonNull String initialText, @NonNull InteractionMode interactionMode, @NonNull List<Integer> interactionChoiceSetIDList) {
+ this();
+ setInitialText(initialText);
+ setInteractionMode(interactionMode);
+ setInteractionChoiceSetIDList(interactionChoiceSetIDList);
+ }
+ /**
+ * Gets the Text that Displayed when the interaction begins. This text may
+ * be overlaid by the "Listening" prompt during the interaction. Text is
+ * displayed on first line of multiline display, and is centered. If text
+ * does not fit on line, it will be truncated
+ *
+ * @return String -the text displayed when the interaction begins
+ */
+ public String getInitialText() {
+ return getString(KEY_INITIAL_TEXT);
+ }
+ /**
+ * Sets the Text that Displayed when the interaction begins. This text may
+ * be overlaid by the "Listening" prompt during the interaction. Text is
+ * displayed on first line of multiline display, and is centered. If text
+ * does not fit on line, it will be truncated
+ *
+ * @param initialText
+ * a String value that Displayed when the interaction begins
+ */
+ public void setInitialText(@NonNull String initialText) {
+ setParameters(KEY_INITIAL_TEXT, initialText);
+ }
+ /**
+ * Gets an An array of one or more TTSChunks that, taken together, specify
+ * what is to be spoken to the user at the start of an interaction
+ *
+ * @return List<TTSChunk> -a List<TTSChunk> value, specify what is to be
+ * spoken to the user at the start of an interaction
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getInitialPrompt() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_INITIAL_PROMPT);
+ }
+ /**
+ * Sets An array of one or more TTSChunks that, taken together, specify what
+ * is to be spoken to the user at the start of an interaction
+ *
+ * @param initialPrompt
+ * a List<TTSChunk> value, specify what is to be spoken to the
+ * user at the start of an interaction
+ */
+ public void setInitialPrompt(List<TTSChunk> initialPrompt) {
+ setParameters(KEY_INITIAL_PROMPT, initialPrompt);
+ }
+ /**
+ * Gets the Indicates mode that indicate how user selects interaction
+ * choice. User can choose either by voice (VR_ONLY), by visual selection
+ * from the menu (MANUAL_ONLY), or by either mode (BOTH)
+ *
+ * @return InteractionMode -indicate how user selects interaction choice
+ * (VR_ONLY, MANUAL_ONLY or BOTH)
+ */
+ public InteractionMode getInteractionMode() {
+ return (InteractionMode) getObject(InteractionMode.class, KEY_INTERACTION_MODE);
+ }
+ /**
+ * Sets the Indicates mode that indicate how user selects interaction
+ * choice. User can choose either by voice (VR_ONLY), by visual selection
+ * from the menu (MANUAL_ONLY), or by either mode (BOTH)
+ *
+ * @param interactionMode
+ * indicate how user selects interaction choice (VR_ONLY,
+ * MANUAL_ONLY or BOTH)
+ */
+ public void setInteractionMode(@NonNull InteractionMode interactionMode) {
+ setParameters(KEY_INTERACTION_MODE, interactionMode);
+ }
+ /**
+ * Gets a List<Integer> value representing an Array of one or more Choice
+ * Set IDs
+ *
+ * @return List<Integer> -a List<Integer> value representing an Array of
+ * one or more Choice Set IDs. User can select any choice from any
+ * of the specified Choice Sets
+ */
+ @SuppressWarnings("unchecked")
+ public List<Integer> getInteractionChoiceSetIDList() {
+ return (List<Integer>) getObject(Integer.class, KEY_INTERACTION_CHOICE_SET_ID_LIST);
+ }
+ /**
+ * Sets a List<Integer> representing an Array of one or more Choice Set
+ * IDs. User can select any choice from any of the specified Choice Sets
+ *
+ * @param interactionChoiceSetIDList
+ * -a List<Integer> representing an Array of one or more Choice
+ * Set IDs. User can select any choice from any of the specified
+ * Choice Sets
+ * <p></p>
+ * <b>Notes: </b>Min Value: 0; Max Vlaue: 2000000000
+ */
+ public void setInteractionChoiceSetIDList(@NonNull List<Integer> interactionChoiceSetIDList) {
+ setParameters(KEY_INTERACTION_CHOICE_SET_ID_LIST, interactionChoiceSetIDList);
+ }
+ /**
+ * Gets a List<TTSChunk> which taken together, specify the help phrase to
+ * be spoken when the user says "help" during the VR session
+ *
+ * @return List<TTSChunk> -a List<TTSChunk> which taken together,
+ * specify the help phrase to be spoken when the user says "help"
+ * during the VR session
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getHelpPrompt() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_HELP_PROMPT);
+ }
+ /**
+ * Sets An array of TTSChunks which, taken together, specify the help phrase
+ * to be spoken when the user says "help" during the VR session
+ * <p></p>
+ * If this parameter is omitted, the help prompt will be constructed by SDL
+ * from the first vrCommand of each choice of all the Choice Sets specified
+ * in the interactionChoiceSetIDList parameter
+ * <P></p>
+ * <b>Notes: </b>The helpPrompt specified in
+ * {@linkplain SetGlobalProperties} is not used by PerformInteraction
+ *
+ * @param helpPrompt
+ * a List<TTSChunk> which taken together, specify the help
+ * phrase to be spoken when the user says "help" during the VR
+ * session
+ */
+ public void setHelpPrompt(List<TTSChunk> helpPrompt) {
+ setParameters(KEY_HELP_PROMPT, helpPrompt);
+ }
+ /**
+ * Gets An array of TTSChunks which, taken together, specify the phrase to
+ * be spoken when the listen times out during the VR session
+ *
+ * @return List<TTSChunk> -a List<TTSChunk> specify the phrase to be
+ * spoken when the listen times out during the VR session
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getTimeoutPrompt() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TIMEOUT_PROMPT);
+ }
+ /**
+ * Sets An array of TTSChunks which, taken together, specify the phrase to
+ * be spoken when the listen times out during the VR session
+ * <p></p>
+ * <b>Notes: </b>The timeoutPrompt specified in
+ * {@linkplain SetGlobalProperties} is not used by PerformInteraction
+ *
+ * @param timeoutPrompt
+ * a List<TTSChunk> specify the phrase to be spoken when the
+ * listen times out during the VR session
+ */
+ public void setTimeoutPrompt(List<TTSChunk> timeoutPrompt) {
+ setParameters(KEY_TIMEOUT_PROMPT, timeoutPrompt);
+ }
+ /**
+ * Gets a Integer value representing the amount of time, in milliseconds,
+ * SDL will wait for the user to make a choice (VR or Menu)
+ *
+ * @return Integer -a Integer representing the amount of time, in
+ * milliseconds, SDL will wait for the user to make a choice (VR or
+ * Menu)
+ */
+ public Integer getTimeout() {
+ return getInteger(KEY_TIMEOUT);
+ }
+ /**
+ * Sets the amount of time, in milliseconds, SDL will wait for the user to
+ * make a choice (VR or Menu). If this time elapses without the user making
+ * a choice, the timeoutPrompt will be spoken. After this timeout value has
+ * been reached, the interaction will stop and a subsequent interaction will
+ * take place after SDL speaks the timeout prompt. If that times out as
+ * well, the interaction will end completely. If omitted, the default is
+ * 10000ms
+ *
+ * @param timeout
+ * an Integer value representing the amount of time, in
+ * milliseconds, SDL will wait for the user to make a choice (VR
+ * or Menu)
+ * <p></p>
+ * <b>Notes: </b>Min Value: 5000; Max Value: 100000
+ */
+ public void setTimeout(Integer timeout) {
+ setParameters(KEY_TIMEOUT, timeout);
+ }
+
+ /**
+ * Gets a Voice recognition Help, which is a suggested VR Help Items to
+ * display on-screen during Perform Interaction
+ *
+ * @return List<VrHelpItem> -a List value representing a suggested VR
+ * Help Items to display on-screen during Perform Interaction
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<VrHelpItem> getVrHelp() {
+ return (List<VrHelpItem>) getObject(VrHelpItem.class, KEY_VR_HELP);
+ }
+
+ /**
+ *
+ * @param vrHelp
+ * a List representing a suggested VR Help Items to display
+ * on-screen during Perform Interaction
+ * If omitted on supported displays, the default SDL generated
+ * list of suggested choices will be displayed
+ * <p></p>
+ * <b>Notes: </b>Min=1; Max=100
+ * @since SmartDeviceLink 2.0
+ */
+ public void setVrHelp(List<VrHelpItem> vrHelp) {
+ setParameters(KEY_VR_HELP, vrHelp);
+ }
+
+ public LayoutMode getInteractionLayout() {
+ return (LayoutMode) getObject(LayoutMode.class, KEY_INTERACTION_LAYOUT);
+ }
+
+ public void setInteractionLayout( LayoutMode interactionLayout ) {
+ setParameters(KEY_INTERACTION_LAYOUT, interactionLayout);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java
new file mode 100644
index 000000000..55fa94ca2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
+
+import java.util.Hashtable;
+
+/**
+ * PerformInteraction Response is sent, when PerformInteraction has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class PerformInteractionResponse extends RPCResponse {
+ public static final String KEY_MANUAL_TEXT_ENTRY = "manualTextEntry";
+ public static final String KEY_TRIGGER_SOURCE = "triggerSource";
+ public static final String KEY_CHOICE_ID = "choiceID";
+
+ /**
+ * Constructs a new PerformInteractionResponse object
+ */
+ public PerformInteractionResponse() {
+ super(FunctionID.PERFORM_INTERACTION.toString());
+ }
+
+ /**
+ * Constructs a new PerformInteractionResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public PerformInteractionResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new PerformInteractionResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public PerformInteractionResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+ /**
+ * Gets the application-scoped identifier that uniquely identifies this choice.
+ * @return choiceID Min: 0 Max: 65535
+ */
+ public Integer getChoiceID() {
+ return getInteger( KEY_CHOICE_ID );
+ }
+ /**
+ * Sets the application-scoped identifier that uniquely identifies this choice.
+ * @param choiceID Min: 0 Max: 65535
+ */
+ public void setChoiceID( Integer choiceID ) {
+ setParameters(KEY_CHOICE_ID, choiceID);
+ }
+ /**
+ * <p>Returns a <I>TriggerSource</I> object which will be shown in the HMI</p>
+ * @return TriggerSource a TriggerSource object
+ */
+ public TriggerSource getTriggerSource() {
+ return (TriggerSource) getObject(TriggerSource.class, KEY_TRIGGER_SOURCE);
+ }
+ /**
+ * <p>Sets TriggerSource
+ * Indicates whether command was selected via VR or via a menu selection (using the OK button).</p>
+ * @param triggerSource a TriggerSource object
+ */
+ public void setTriggerSource( TriggerSource triggerSource ) {
+ setParameters(KEY_TRIGGER_SOURCE, triggerSource);
+ }
+
+ public void setManualTextEntry(String manualTextEntry) {
+ setParameters(KEY_MANUAL_TEXT_ENTRY, manualTextEntry);
+ }
+ public String getManualTextEntry() {
+ return getString(KEY_MANUAL_TEXT_ENTRY);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java
new file mode 100644
index 000000000..7b5801b96
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/**
+ * Change in permissions for a given set of RPCs
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>rpcName</td>
+ * <td>String</td>
+ * <td>Name of the individual RPC in the policy table.</td>
+ * <td></td>
+ * <td>maxlength:100</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>hmiPermissions</td>
+ * <td>HMIPermissions</td>
+ * <td>Sets of parameters, which are permitted or prohibited for the given RPC.</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>parameterPermissions</td>
+ * <td>ParameterPermissions</td>
+ * <td>Sets of parameters, which are permitted or prohibited for the given RPC.</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class PermissionItem extends RPCStruct {
+ public static final String KEY_RPC_NAME = "rpcName";
+ public static final String KEY_HMI_PERMISSIONS = "hmiPermissions";
+ public static final String KEY_PARAMETER_PERMISSIONS = "parameterPermissions";
+ /**
+ * Constructs a new PermissionItem object
+ */
+ public PermissionItem(@NonNull String rpcName, @NonNull HMIPermissions hmiPermissions, @NonNull ParameterPermissions parameterPermissions) {
+ this();
+ setRpcName(rpcName);
+ setHMIPermissions(hmiPermissions);
+ setParameterPermissions(parameterPermissions);
+ }
+ /**
+ * Constructs a new PermissionItem object indicated by the Hashtable
+ * parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public PermissionItem(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new PermissionItem object
+ */
+ public PermissionItem() { }
+ public String getRpcName() {
+ return getString(KEY_RPC_NAME);
+ }
+ public void setRpcName(@NonNull String rpcName) {
+ setValue(KEY_RPC_NAME, rpcName);
+ }
+ @SuppressWarnings("unchecked")
+ public HMIPermissions getHMIPermissions() {
+ return (HMIPermissions) getObject(HMIPermissions.class, KEY_HMI_PERMISSIONS);
+ }
+ public void setHMIPermissions(@NonNull HMIPermissions hmiPermissions) {
+ setValue(KEY_HMI_PERMISSIONS, hmiPermissions);
+ }
+ @SuppressWarnings("unchecked")
+ public ParameterPermissions getParameterPermissions() {
+ return (ParameterPermissions) getObject(ParameterPermissions.class, KEY_PARAMETER_PERMISSIONS);
+ }
+ public void setParameterPermissions(@NonNull ParameterPermissions parameterPermissions) {
+ setValue(KEY_PARAMETER_PERMISSIONS, parameterPermissions);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
new file mode 100644
index 000000000..348f23f25
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Extended capabilities of the module's phone feature
+ */
+
+public class PhoneCapability extends RPCStruct {
+ public static final String KEY_DIALNUMBER_ENABLED = "dialNumberEnabled";
+
+ public PhoneCapability(){}
+
+ public PhoneCapability(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public Boolean getDialNumberEnabled(){
+ return getBoolean(KEY_DIALNUMBER_ENABLED);
+ }
+
+ public void setDialNumberEnabled(Boolean dialNumberEnabled){
+ setValue(KEY_DIALNUMBER_ENABLED, dialNumberEnabled);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java
new file mode 100644
index 000000000..acd2638bf
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Contains information about on-screen preset capabilities.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>onScreenPresetsAvailable</td>
+ * <td>Boolean</td>
+ * <td>Defines, if Onscreen custom presets are available.
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class PresetBankCapabilities extends RPCStruct {
+ public static final String KEY_ON_SCREEN_PRESETS_AVAILABLE = "OnScreenPresetsAvailable";
+
+ /**
+ * Constructs a newly allocated PresetBankCapabilities object
+ */
+ public PresetBankCapabilities() { }
+
+ /**
+ * Constructs a newly allocated PresetBankCapabilities object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public PresetBankCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated PresetBankCapabilities object
+ * @param onScreenPresetsAvailable if Onscreen custom presets are available.
+ */
+ public PresetBankCapabilities(@NonNull Boolean onScreenPresetsAvailable) {
+ this();
+ setOnScreenPresetsAvailable(onScreenPresetsAvailable);
+ }
+
+ /**
+ * set if Onscreen custom presets are available.
+ * @param onScreenPresetsAvailable if Onscreen custom presets are available.
+ */
+ public void setOnScreenPresetsAvailable(@NonNull Boolean onScreenPresetsAvailable) {
+ setValue(KEY_ON_SCREEN_PRESETS_AVAILABLE, onScreenPresetsAvailable);
+ }
+
+ /**
+ * Defines, if Onscreen custom presets are available.
+ * @return if Onscreen custom presets are available
+ */
+ public Boolean onScreenPresetsAvailable() {
+ return getBoolean(KEY_ON_SCREEN_PRESETS_AVAILABLE);
+ }
+
+ /**
+ * Defines, if Onscreen custom presets are available.
+ * @return if Onscreen custom presets are available
+ */
+ public Boolean getOnScreenPresetsAvailable() {
+ return getBoolean(KEY_ON_SCREEN_PRESETS_AVAILABLE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java
new file mode 100644
index 000000000..383d22430
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Registers a service offered by this app on the module
+ */
+public class PublishAppService extends RPCRequest {
+
+ public static final String KEY_APP_SERVICE_MANIFEST = "appServiceManifest";
+
+ // Constructors
+ /**
+ * Constructs a new PublishAppService object
+ */
+ public PublishAppService() {
+ super(FunctionID.PUBLISH_APP_SERVICE.toString());
+ }
+
+ /**
+ * Constructs a new PublishAppService object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public PublishAppService(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new PublishAppService object
+ * @param appServiceManifest - The appServiceManifest
+ */
+ public PublishAppService(@NonNull AppServiceManifest appServiceManifest) {
+ this();
+ setAppServiceManifest(appServiceManifest);
+ }
+
+ // Getters / Setters
+
+ /**
+ * The manifest of the service that wishes to be published.
+ * @param serviceManifest - the App Service Manifest
+ */
+ public void setAppServiceManifest(@NonNull AppServiceManifest serviceManifest){
+ setParameters(KEY_APP_SERVICE_MANIFEST, serviceManifest);
+ }
+
+ /**
+ * The manifest of the service that wishes to be published.
+ * @return serviceManifest - the App Service Manifest
+ */
+ public AppServiceManifest getAppServiceManifest(){
+ return (AppServiceManifest) getObject(AppServiceManifest.class,KEY_APP_SERVICE_MANIFEST);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java
new file mode 100644
index 000000000..8939e9084
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class PublishAppServiceResponse extends RPCResponse {
+
+ public static final String KEY_APP_SERVICE_RECORD = "appServiceRecord";
+ /**
+ * Constructs a new PublishAppServiceResponse object
+ */
+ public PublishAppServiceResponse() {
+ super(FunctionID.PUBLISH_APP_SERVICE.toString());
+ }
+
+ public PublishAppServiceResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new PublishAppServiceResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public PublishAppServiceResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ // Custom Getters / Setters
+
+ /**
+ * If the request was successful, this object will be the current status of the service record
+ * for the published service. This will include the Core supplied service ID.
+ * @param appServiceRecord - the App Service Record
+ */
+ public void setServiceRecord(AppServiceRecord appServiceRecord){
+ setParameters(KEY_APP_SERVICE_RECORD, appServiceRecord);
+ }
+
+ /**
+ * If the request was successful, this object will be the current status of the service record
+ * for the published service. This will include the Core supplied service ID.
+ * @return appServiceRecord - the App Service Record
+ */
+ public AppServiceRecord getServiceRecord(){
+ return (AppServiceRecord) getObject(AppServiceRecord.class,KEY_APP_SERVICE_RECORD);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java
new file mode 100644
index 000000000..fd06498ca
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java
@@ -0,0 +1,406 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.listeners.OnPutFileUpdateListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+
+import java.util.Hashtable;
+import java.util.zip.CRC32;
+
+/**
+ * Used to push a binary data onto the SDL module from a mobile device, such as
+ * icons and album art.
+ *
+ * <p><b> Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>FileName</td>
+ * <td>String</td>
+ * <td>File reference name.</td>
+ * <td>Y</td>
+ * <td>Maxlength=500</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>fileType</td>
+ * <td>FileType</td>
+ * <td>Selected file type.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>persistentFile</td>
+ * <td>Boolean</td>
+ * <td>Indicates if the file is meant to persist between sessions / ignition cycles. If set to TRUE,then the system will aim to persist this file through session / cycles. While files with this designation will have priority over others,they are subject to deletion by the system at any time.In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file. If omitted, the value will be set to false.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>systemFile</td>
+ * <td>Boolean</td>
+ * <td>Indicates if the file is meant to be passed thru core to elsewhere on the system. If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core. If omitted, the value will be set to false.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * <tr>
+ * <td>offset</td>
+ * <td>Float</td>
+ * <td>Optional offset in bytes for resuming partial data chunks</td>
+ * <td>N</td>
+ * <td>Minvalue=0; Maxvalue=100000000000</td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * <tr>
+ * <td>length</td>
+ * <td>Float</td>
+ * <td>Optional length in bytes for resuming partial data chunks. If offset is set to 0, then length is the total length of the file to be downloaded</td>
+ * <td>N</td>
+ * <td>Minvalue=0; Maxvalue=100000000000</td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * <tr>
+ * <td>crc</td>
+ * <td>Long</td>
+ * <td>Additional CRC32 checksum to protect data integrity up to 512 Mbits .</td>
+ * <td>N</td>
+ * <td>minvalue="0" maxvalue="4294967295"</td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * </table>
+ * <p> <b>Note: </b></p>
+ * When using PutFiles you may want to check for memory
+ *
+ * <p><b>Response</b> </p>
+ * Response is sent, when the file data was copied (success case). Or when an error occurred. Not supported on First generation SDL modules.
+ *
+ * <p><b> Non-default Result Codes:</b></p>
+ * <p> SUCCESS</p>
+ * <p> INVALID_DATA</p>
+ * <p> OUT_OF_MEMORY</p>
+ * <p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p> APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ *
+ * <p><table border="1" rules="all"></p>
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>spaceAvailable</td>
+ * <td>Integer</td>
+ * <td>Provides the total local space available on SDL for the registered app.</td>
+ * <td></td>
+ * <td>Minvalue=0; Maxvalue=2000000000</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * </table>
+ * @since SmartDeviceLink 2.0
+ * @see DeleteFile
+ * @see ListFiles
+ */
+public class PutFile extends RPCRequest {
+ public static final String KEY_PERSISTENT_FILE = "persistentFile";
+ public static final String KEY_SYSTEM_FILE = "systemFile";
+ public static final String KEY_FILE_TYPE = "fileType";
+ public static final String KEY_SDL_FILE_NAME = "syncFileName";
+ public static final String KEY_OFFSET = "offset";
+ public static final String KEY_LENGTH = "length";
+ public static final String KEY_CRC = "crc";
+
+ /**
+ * Constructs a new PutFile object
+ */
+ public PutFile() {
+ super(FunctionID.PUT_FILE.toString());
+ }
+
+ /**
+ * Constructs a new PutFile object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public PutFile(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new PutFile object
+ * @param syncFileName a String value representing a file reference name
+ * <b>Notes: </b>Maxlength=500, however the max file name length may vary based on remote filesystem limitations
+ * @param fileType a FileType value representing a selected file type
+ */
+ public PutFile(@NonNull String syncFileName, @NonNull FileType fileType) {
+ this();
+ setSdlFileName(syncFileName);
+ setFileType(fileType);
+ }
+
+ /**
+ * Sets a file reference name
+ *
+ * @param sdlFileName
+ * a String value representing a file reference name
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500, however the max file name length may vary based on remote filesystem limitations
+ */
+ public void setSdlFileName(@NonNull String sdlFileName) {
+ setParameters(KEY_SDL_FILE_NAME, sdlFileName);
+ }
+
+ /**
+ * Gets a file reference name
+ *
+ * @return String - a String value representing a file reference name
+ */
+ public String getSdlFileName() {
+ return getString(KEY_SDL_FILE_NAME);
+ }
+
+ /**
+ * Sets file type
+ *
+ * @param fileType
+ * a FileType value representing a selected file type
+ */
+ public void setFileType(@NonNull FileType fileType) {
+ setParameters(KEY_FILE_TYPE, fileType);
+ }
+
+ /**
+ * Gets a file type
+ *
+ * @return FileType -a FileType value representing a selected file type
+ */
+ public FileType getFileType() {
+ return (FileType) getObject(FileType.class, KEY_FILE_TYPE);
+ }
+
+ /**
+ * Sets a value to indicates if the file is meant to persist between
+ * sessions / ignition cycles. If set to TRUE, then the system will aim to
+ * persist this file through session / cycles. While files with this
+ * designation will have priority over others, they are subject to deletion
+ * by the system at any time. In the event of automatic deletion by the
+ * system, the app will receive a rejection and have to resend the file. If
+ * omitted, the value will be set to false
+ * <p></p>
+ *
+ * @param persistentFile
+ * a Boolean value
+ */
+ public void setPersistentFile(Boolean persistentFile) {
+ setParameters(KEY_PERSISTENT_FILE, persistentFile);
+ }
+
+ /**
+ * Gets a value to Indicates if the file is meant to persist between
+ * sessions / ignition cycles
+ *
+ * @return Boolean -a Boolean value to indicates if the file is meant to
+ * persist between sessions / ignition cycles
+ */
+ public Boolean getPersistentFile() {
+ return getBoolean(KEY_PERSISTENT_FILE);
+ }
+ public void setFileData(byte[] fileData) {
+ setBulkData(fileData);
+ }
+ public byte[] getFileData() {
+ return getBulkData();
+ }
+
+ /**
+ * @deprecated as of SmartDeviceLink 4.0
+ * @param offset Optional offset in bytes for resuming partial data chunks
+ */
+ public void setOffset(Integer offset) {
+ if(offset == null){
+ setOffset((Long)null);
+ }else{
+ setOffset(offset.longValue());
+ }
+ }
+
+ /**
+ * @param offset Optional offset in bytes for resuming partial data chunks
+ */
+ public void setOffset(Long offset) {
+ setParameters(KEY_OFFSET, offset);
+ }
+
+ public Long getOffset() {
+ final Object o = getParameters(KEY_OFFSET);
+ if (o == null){
+ return null;
+ }
+ if (o instanceof Integer) {
+ return ((Integer) o).longValue();
+ }else if(o instanceof Long){
+ return (Long) o;
+ }
+
+
+ return null;
+ }
+
+ /**
+ * @deprecated as of SmartDeviceLink 4.0
+ * @param length Optional length in bytes for resuming partial data chunks. If offset is set to 0, then length is
+ * the total length of the file to be downloaded
+ */
+ public void setLength(Integer length) {
+ if(length == null){
+ setLength((Long)null);
+ }else{
+ setLength(length.longValue());
+ }
+ }
+
+ /**
+ * @param length Optional length in bytes for resuming partial data chunks. If offset is set to 0, then length is
+ * the total length of the file to be downloaded
+ */
+ public void setLength(Long length) {
+ setParameters(KEY_LENGTH, length);
+ }
+
+ public Long getLength() {
+ final Object o = getParameters(KEY_LENGTH);
+ if (o == null){
+ return null;
+ }
+ if (o instanceof Integer) {
+ return ((Integer) o).longValue();
+ }else if(o instanceof Long){
+ return (Long) o;
+ }
+
+ return null;
+ }
+
+ public void setSystemFile(Boolean systemFile) {
+ setParameters(KEY_SYSTEM_FILE, systemFile);
+ }
+
+ public Boolean getSystemFile() {
+ final Object o = getParameters(KEY_SYSTEM_FILE);
+ if (o instanceof Boolean) {
+ return (Boolean) o;
+ }
+ else
+ return null;
+ }
+
+ /**
+ * This takes the file data as an array of bytes and calculates the
+ * CRC32 for it.
+ * @param fileData - the file as a byte array
+ */
+ public void setCRC(byte[] fileData) {
+ if (fileData != null) {
+ CRC32 crc = new CRC32();
+ crc.update(fileData);
+ parameters.put(KEY_CRC, crc.getValue());
+ } else {
+ parameters.remove(KEY_CRC);
+ }
+ }
+
+ /**
+ * This assumes you have created your own CRC32 and are setting it with the file
+ * <STRONG>Please avoid using your own calculations for this, and use the method
+ * included in java.util</STRONG>
+ * @param crc - the CRC32 of the file being set
+ */
+ public void setCRC(Long crc) {
+ if (crc != null) {
+ parameters.put(KEY_CRC, crc);
+ } else {
+ parameters.remove(KEY_CRC);
+ }
+ }
+
+ /**
+ * This returns the CRC, if it has been set, for the file object
+ * @return - a CRC32 Long
+ */
+ public Long getCRC() {
+ final Object o = parameters.get(KEY_CRC);
+ if (o == null){
+ return null;
+ }
+ if (o instanceof Integer) {
+ return ((Integer) o).longValue();
+ }else if(o instanceof Long){
+ return (Long) o;
+ }
+ return null;
+ }
+
+ @Override
+ public final void setOnRPCResponseListener(OnRPCResponseListener listener) {
+ super.setOnRPCResponseListener(listener);
+ }
+
+ public void setOnPutFileUpdateListener(OnPutFileUpdateListener listener) {
+ super.setOnRPCResponseListener(listener); //We can use the same method because it get stored as a parent class
+ }
+
+ public OnPutFileUpdateListener getOnPutFileUpdateListener() {
+ return (OnPutFileUpdateListener)getOnRPCResponseListener();
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java
new file mode 100644
index 000000000..70bb48157
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.util.Version;
+
+import java.util.Hashtable;
+
+/**
+ * Put File Response is sent, when PutFile has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class PutFileResponse extends RPCResponse {
+ public static final String KEY_SPACE_AVAILABLE = "spaceAvailable";
+ private static final Integer MAX_VALUE = 2000000000;
+
+ /**
+ * Constructs a new PutFileResponse object
+ */
+ public PutFileResponse() {
+ super(FunctionID.PUT_FILE.toString());
+ }
+
+ /**
+ * Constructs a new PutFileResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public PutFileResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * @deprecated use {@link PutFileResponse#PutFileResponse(Boolean, Result)} <br>
+ *
+ * Constructs a new PutFileResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ * @param spaceAvailable the spaceAvailable on the head unit
+ */
+ @Deprecated
+ public PutFileResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer spaceAvailable) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ setSpaceAvailable(spaceAvailable);
+ }
+
+ /**
+ * Constructs a new PutFileResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public PutFileResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ /**
+ * SpaceAvailable became optional as of RPC Spec 5.0. If a system that expected the value to
+ * always have a value connects to such a system, it could return null. Check to see if there
+ * is a value, and if not, set it to MAX_VALUE as defined by the RPC Spec
+ *
+ * @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){
+ if (getSpaceAvailable() == null){
+ setSpaceAvailable(MAX_VALUE);
+ }
+ }
+ super.format(rpcVersion, formatParams);
+ }
+
+ public void setSpaceAvailable(Integer spaceAvailable) {
+ setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
+ }
+
+ public Integer getSpaceAvailable() {
+ return getInteger(KEY_SPACE_AVAILABLE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java
new file mode 100644
index 000000000..0cac1951d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * A color class that stores RGB values
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>red</td>
+ * <td>Integer</td>
+ * <td>Y</td>
+ * <td><ul><li>minvalue="0"</li><li>maxvalue="255"</li></ul></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>green</td>
+ * <td>Integer</td>
+ * <td>Y</td>
+ * <td><ul><li>minvalue="0"</li><li>maxvalue="255"</li></ul></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>blue</td>
+ * <td>Integer</td>
+ * <td>Y</td>
+ * <td><ul><li>minvalue="0"</li><li>maxvalue="255"</li></ul></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 5.0
+ */
+public class RGBColor extends RPCStruct{
+ public static final String KEY_RED = "red";
+ public static final String KEY_GREEN = "green";
+ public static final String KEY_BLUE = "blue";
+ private static final Integer MIN_VALUE = 0, MAX_VALUE = 255;
+
+ /**
+ * Constructs a new RGBColor object
+ */
+ public RGBColor(){
+ this(MIN_VALUE, MIN_VALUE, MIN_VALUE);
+ }
+
+ /**
+ * Constructs a new RGBColor object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public RGBColor(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new RGB object
+ * @param red red value - min: 0; max: 255
+ * @param green green value - min: 0; max: 255
+ * @param blue blue value - min: 0; max: 255
+ */
+ public RGBColor(Integer red, Integer green, Integer blue) {
+ Hashtable<String, Object> hash = new Hashtable<>();
+ if (red != null && red >= MIN_VALUE && red <= MAX_VALUE) {
+ hash.put(KEY_RED, red);
+ } else {
+ hash.put(KEY_RED, MIN_VALUE);
+ }
+ if (green != null && green >= MIN_VALUE && green <= MAX_VALUE) {
+ hash.put(KEY_GREEN, green);
+ } else {
+ hash.put(KEY_GREEN, MIN_VALUE);
+ }
+ if (blue != null && blue >= MIN_VALUE && blue <= MAX_VALUE) {
+ hash.put(KEY_BLUE, blue);
+ } else {
+ hash.put(KEY_BLUE, MIN_VALUE);
+ }
+ this.store = hash;
+ }
+
+ /**
+ * Sets the red value of the color object
+ * @param color red value - min: 0; max: 255
+ */
+ public void setRed(Integer color) {
+ if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
+ setValue(KEY_RED, color);
+ }
+ }
+
+ /**
+ * Gets the red value of the color
+ * @return red value
+ */
+ public Integer getRed() {
+ return getInteger(KEY_RED);
+ }
+
+ /**
+ * Sets the green value of the color object
+ * @param color green value - min: 0; max: 255
+ */
+ public void setGreen(Integer color) {
+ if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
+ setValue(KEY_GREEN, color);
+ }
+ }
+
+ /**
+ * Gets the green value of the color
+ * @return green value
+ */
+ public Integer getGreen() {
+ return getInteger(KEY_GREEN);
+ }
+
+ /**
+ * Sets the blue value of the color object
+ * @param color blue value - min: 0; max: 255
+ */
+ public void setBlue(Integer color) {
+ if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
+ setValue(KEY_BLUE, color);
+ }
+ }
+
+ /**
+ * Gets the green value of the color
+ * @return green value
+ */
+ public Integer getBlue() {
+ return getInteger(KEY_BLUE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
new file mode 100644
index 000000000..da987e48a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Contains information about a radio control module's capabilities.
+ */
+public class RadioControlCapabilities extends RPCStruct{
+ public static final String KEY_MODULE_NAME= "moduleName";
+ public static final String KEY_RADIO_ENABLE_AVAILABLE= "radioEnableAvailable";
+ public static final String KEY_RADIO_BAND_AVAILABLE= "radioBandAvailable";
+ public static final String KEY_RADIO_FREQUENCY_AVAILABLE= "radioFrequencyAvailable";
+ public static final String KEY_HD_CHANNEL_AVAILABLE= "hdChannelAvailable";
+ public static final String KEY_RDS_DATA_AVAILABLE= "rdsDataAvailable";
+ public static final String KEY_AVAILABLE_HDS_AVAILABLE= "availableHDsAvailable";
+ 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_HD_RADIO_ENABLE_AVAILABLE = "hdRadioEnableAvailable";
+ public static final String KEY_SIRIUS_XM_RADIO_AVAILABLE = "siriusxmRadioAvailable";
+ public static final String KEY_SIS_DATA_AVAILABLE = "sisDataAvailable";
+
+ public RadioControlCapabilities() {
+ }
+
+ public RadioControlCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new RadioControlCapabilities object
+ * @param moduleName
+ * The short friendly name of the climate control module.
+ * It should not be used to identify a module by mobile application.
+ */
+ public RadioControlCapabilities(@NonNull String moduleName) {
+ this();
+ setModuleName(moduleName);
+ }
+ /**
+ * Sets the moduleName portion of the RadioControlCapabilities class
+ *
+ * @param moduleName
+ * The short friendly name of the climate 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 RadioControlCapabilities class
+ *
+ * @return String - Short friendly name of the climate control module.
+ */
+ public String getModuleName() {
+ return getString(KEY_MODULE_NAME);
+ }
+
+ /**
+ * Sets the radioEnableAvailable portion of the RadioControlCapabilities class
+ *
+ * @param radioEnableAvailable
+ * Availability of the control of enable/disable radio.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setRadioEnableAvailable(Boolean radioEnableAvailable) {
+ setValue(KEY_RADIO_ENABLE_AVAILABLE, radioEnableAvailable);
+ }
+
+ /**
+ * Gets the radioEnableAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of enable/disable radio.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getRadioEnableAvailable() {
+ return getBoolean(KEY_RADIO_ENABLE_AVAILABLE);
+ }
+
+ /**
+ * Sets the radioBandAvailable portion of the RadioControlCapabilities class
+ *
+ * @param radioBandAvailable
+ * Availability of the control of radio band.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setRadioBandAvailable(Boolean radioBandAvailable) {
+ setValue(KEY_RADIO_BAND_AVAILABLE, radioBandAvailable);
+ }
+
+ /**
+ * Gets the radioBandAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of radio band.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getRadioBandAvailable() {
+ return getBoolean(KEY_RADIO_BAND_AVAILABLE);
+ }
+
+ /**
+ * Sets the radioFrequencyAvailable portion of the RadioControlCapabilities class
+ *
+ * @param radioFrequencyAvailable
+ * Availability of the control of radio frequency.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setRadioFrequencyAvailable(Boolean radioFrequencyAvailable) {
+ setValue(KEY_RADIO_FREQUENCY_AVAILABLE, radioFrequencyAvailable);
+ }
+
+ /**
+ * Gets the radioFrequencyAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of radio frequency.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getRadioFrequencyAvailable() {
+ return getBoolean(KEY_RADIO_FREQUENCY_AVAILABLE);
+ }
+
+ /**
+ * Sets the hdChannelAvailable portion of the RadioControlCapabilities class
+ *
+ * @param hdChannelAvailable
+ * Availability of the control of HD radio channel.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setHdChannelAvailable(Boolean hdChannelAvailable) {
+ setValue(KEY_HD_CHANNEL_AVAILABLE, hdChannelAvailable);
+ }
+
+ /**
+ * Gets the hdChannelAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of HD radio channel.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getHdChannelAvailable() {
+ return getBoolean(KEY_HD_CHANNEL_AVAILABLE);
+ }
+
+ /**
+ * Sets the rdsDataAvailable portion of the RadioControlCapabilities class
+ *
+ * @param rdsDataAvailable
+ * Availability of the getting Radio Data System (RDS) data.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setRdsDataAvailable(Boolean rdsDataAvailable) {
+ setValue(KEY_RDS_DATA_AVAILABLE, rdsDataAvailable);
+ }
+
+ /**
+ * Gets the rdsDataAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the getting Radio Data System (RDS) data.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getRdsDataAvailable() {
+ return getBoolean(KEY_RDS_DATA_AVAILABLE);
+ }
+
+ /**
+ * Sets the availableHDsAvailable portion of the RadioControlCapabilities class
+ *
+ * @param availableHDsAvailable
+ * Availability of the getting the number of available HD channels.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setAvailableHDsAvailable(Boolean availableHDsAvailable) {
+ setValue(KEY_AVAILABLE_HDS_AVAILABLE, availableHDsAvailable);
+ }
+
+ /**
+ * Gets the availableHDsAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the getting the number of available HD channels.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getAvailableHDsAvailable() {
+ return getBoolean(KEY_AVAILABLE_HDS_AVAILABLE);
+ }
+
+ /**
+ * Sets the stateAvailable portion of the RadioControlCapabilities class
+ *
+ * @param stateAvailable
+ * Availability of the getting the Radio state.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setStateAvailable(Boolean stateAvailable) {
+ setValue(KEY_STATE_AVAILABLE, stateAvailable);
+ }
+
+ /**
+ * Gets the stateAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the getting the Radio state.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getStateAvailable() {
+ return getBoolean(KEY_STATE_AVAILABLE);
+ }
+
+ /**
+ * Sets the signalStrengthAvailable portion of the RadioControlCapabilities class
+ *
+ * @param signalStrengthAvailable
+ * Availability of the getting the signal strength.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setSignalStrengthAvailable(Boolean signalStrengthAvailable) {
+ setValue(KEY_SIGNAL_STRENGTH_AVAILABLE, signalStrengthAvailable);
+ }
+
+ /**
+ * Gets the signalStrengthAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the getting the signal strength.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getSignalStrengthAvailable() {
+ return getBoolean(KEY_SIGNAL_STRENGTH_AVAILABLE);
+ }
+
+ /**
+ * Sets the signalChangeThresholdAvailable portion of the RadioControlCapabilities class
+ *
+ * @param signalChangeThresholdAvailable
+ * Availability of the getting the signal Change Threshold.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setSignalChangeThresholdAvailable(Boolean signalChangeThresholdAvailable) {
+ setValue(KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, signalChangeThresholdAvailable);
+ }
+
+ /**
+ * Gets the signalChangeThresholdAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the getting the signal Change Threshold.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getSignalChangeThresholdAvailable() {
+ return getBoolean(KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE);
+ }
+
+ /**
+ * Sets the hdRadioEnableAvailable portion of the RadioControlCapabilities class
+ *
+ * @param hdRadioEnableAvailable Availability of the control of enable/disable HD radio.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setHdRadioEnableAvailable(Boolean hdRadioEnableAvailable) {
+ setValue(KEY_HD_RADIO_ENABLE_AVAILABLE, hdRadioEnableAvailable);
+ }
+
+ /**
+ * Gets the hdRadioEnableAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of enable/disable HD radio.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getHdRadioEnableAvailable() {
+ return getBoolean(KEY_HD_RADIO_ENABLE_AVAILABLE);
+ }
+
+ /**
+ * Sets the siriusxmRadioAvailable portion of the RadioControlCapabilities class
+ *
+ * @param siriusxmRadioAvailable Availability of sirius XM radio.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setSiriusXMRadioAvailable(Boolean siriusxmRadioAvailable) {
+ setValue(KEY_SIRIUS_XM_RADIO_AVAILABLE, siriusxmRadioAvailable);
+ }
+
+ /**
+ * Gets the siriusxmRadioAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of sirius XM radio.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getSiriusXMRadioAvailable() {
+ return getBoolean(KEY_SIRIUS_XM_RADIO_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/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
new file mode 100644
index 000000000..8fbd001fb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.RadioBand;
+import com.smartdevicelink.proxy.rpc.enums.RadioState;
+
+import java.util.Hashtable;
+
+/**
+ * Include information (both read-only and changeable data) about a
+ * remote control radio module.
+ */
+public class RadioControlData extends RPCStruct{
+ public static final String KEY_FREQUENCY_INTEGER= "frequencyInteger";
+ public static final String KEY_FREQUENCY_FRACTION= "frequencyFraction";
+ public static final String KEY_BAND= "band";
+ public static final String KEY_RDS_DATA= "rdsData";
+ public static final String KEY_AVAILABLE_HDS= "availableHDs";
+ public static final String KEY_HD_CHANNEL= "hdChannel";
+ public static final String KEY_SIGNAL_STRENGTH= "signalStrength";
+ 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_HD_RADIO_ENABLE = "hdRadioEnable";
+ public static final String KEY_SIS_DATA = "sisData";
+
+ public RadioControlData() {
+ }
+
+ public RadioControlData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the frequencyInteger portion of the RadioControlData class
+ *
+ * @param frequencyInteger
+ * The integer part of the frequency i.e. for 101.7 this value should be 101
+ */
+ public void setFrequencyInteger(Integer frequencyInteger) {
+ setValue(KEY_FREQUENCY_INTEGER, frequencyInteger);
+ }
+
+ /**
+ * Gets the frequencyInteger portion of the RadioControlData class
+ *
+ * @return Integer - The integer part of the frequency i.e. for 101.7 this value should be 101.
+ */
+ public Integer getFrequencyInteger() {
+ return getInteger(KEY_FREQUENCY_INTEGER);
+ }
+
+ /**
+ * Sets the frequencyFraction portion of the RadioControlData class
+ *
+ * @param frequencyFraction
+ * The fractional part of the frequency i.e. for 101.7 is 7.
+ */
+ public void setFrequencyFraction(Integer frequencyFraction) {
+ setValue(KEY_FREQUENCY_FRACTION, frequencyFraction);
+ }
+
+ /**
+ * Gets the frequencyFraction portion of the RadioControlData class
+ *
+ * @return Integer - The fractional part of the frequency i.e. for 101.7 is 7.
+ */
+ public Integer getFrequencyFraction() {
+ return getInteger(KEY_FREQUENCY_FRACTION);
+ }
+
+ /**
+ * Sets the band portion of the RadioControlData class
+ *
+ * @param band
+ * The radio band (AM|FM|XM) of the radio tuner.
+ */
+ public void setBand(RadioBand band) {
+ setValue(KEY_BAND, band);
+ }
+
+ /**
+ * Gets the band portion of the RadioControlData class
+ *
+ * @return RadioBand - The radio band (AM|FM|XM) of the radio tuner.
+ */
+ public RadioBand getBand() {
+ return (RadioBand) getObject(RadioBand.class, KEY_BAND);
+ }
+
+ /**
+ * Sets the rdsData portion of the RadioControlData class
+ *
+ * @param rdsData
+ * Read only parameter. See RdsData data type for details.
+ */
+ public void setRdsData(RdsData rdsData) {
+ setValue(KEY_RDS_DATA, rdsData);
+ }
+
+ /**
+ * Gets the rdsData portion of the RadioControlData class
+ *
+ * @return RdsData - Read only parameter. See RdsData data type for details.
+ */
+ public RdsData getRdsData() {
+ return (RdsData) getObject(RdsData.class, KEY_RDS_DATA);
+ }
+
+ /**
+ * Sets the availableHDs portion of the RadioControlData class
+ *
+ * @param availableHDs
+ * Number of HD sub-channels if available.
+ */
+ public void setAvailableHDs(Integer availableHDs) {
+ setValue(KEY_AVAILABLE_HDS, availableHDs);
+ }
+
+ /**
+ * Gets the availableHDs portion of the RadioControlData class
+ *
+ * @return Integer - Number of HD sub-channels if available.
+ */
+ public Integer getAvailableHDs() {
+ return getInteger(KEY_AVAILABLE_HDS);
+ }
+
+ /**
+ * Sets the hdChannel portion of the RadioControlData class
+ *
+ * @param hdChannel
+ * Current HD sub-channel if available.
+ */
+ public void setHdChannel(Integer hdChannel) {
+ setValue(KEY_HD_CHANNEL, hdChannel);
+ }
+
+ /**
+ * Gets the hdChannel portion of the RadioControlData class
+ *
+ * @return Integer - Current HD sub-channel if available.
+ */
+ public Integer getHdChannel() {
+ return getInteger(KEY_HD_CHANNEL);
+ }
+
+ /**
+ * Sets the signalStrength portion of the RadioControlData class
+ *
+ * @param signalStrength
+ * Read only parameter. Indicates the strength of receiving radio signal in current frequency.
+ */
+ public void setSignalStrength(Integer signalStrength) {
+ setValue(KEY_SIGNAL_STRENGTH, signalStrength);
+ }
+
+ /**
+ * Gets the signalStrength portion of the RadioControlData class
+ *
+ * @return Integer - Read only parameter. Indicates the strength of receiving radio signal in current frequency.
+ */
+ public Integer getSignalStrength() {
+ return getInteger(KEY_SIGNAL_STRENGTH);
+ }
+
+ /**
+ * Sets the signalChangeThreshold portion of the RadioControlData class
+ *
+ * @param signalChangeThreshold
+ * If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency.
+ */
+ public void setSignalChangeThreshold(Integer signalChangeThreshold) {
+ setValue(KEY_SIGNAL_CHANGE_THRESHOLD, signalChangeThreshold);
+ }
+
+ /**
+ * Gets the signalChangeThreshold portion of the RadioControlData class
+ *
+ * @return Integer - If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency.
+ */
+ public Integer getSignalChangeThreshold() {
+ return getInteger(KEY_SIGNAL_CHANGE_THRESHOLD);
+ }
+
+ /**
+ * Sets the radioEnable portion of the RadioControlData class
+ * <br><b>Note: </b> If this is set to false, no other data will be included.
+ * <br><b>Note: </b> This setting is normally a <b>READ-ONLY</b> setting.
+ *
+ * @param radioEnable
+ * True if the radio is on, false is the radio is off.
+ */
+ public void setRadioEnable(Boolean radioEnable) {
+ setValue(KEY_RADIO_ENABLE, radioEnable);
+ }
+
+ /**
+ * Gets the radioEnable portion of the RadioControlData class
+ * <br><b>Note: </b> If this is set to false, no other data will be included.
+ *
+ * @return Boolean - True if the radio is on, false is the radio is off.
+ */
+ public Boolean getRadioEnable() {
+ return getBoolean(KEY_RADIO_ENABLE);
+ }
+
+ /**
+ * Sets the state portion of the RadioControlData class
+ *
+ * @param state
+ * Read only parameter. See RadioState data type for details.
+ */
+ public void setState(RadioState state) {
+ setValue(KEY_STATE, state);
+ }
+
+ /**
+ * Gets the state portion of the RadioControlData class
+ *
+ * @return RadioState - Read only parameter. See RadioState data type for details.
+ */
+ public RadioState getState() {
+ return (RadioState) getObject(RadioState.class, KEY_STATE);
+ }
+
+ /**
+ * Sets the hdRadioEnable portion of the RadioControlData class
+ *
+ * @param hdRadioEnable True if the hd radio is on, false if the radio is off.
+ */
+ public void setHdRadioEnable(Boolean hdRadioEnable) {
+ setValue(KEY_HD_RADIO_ENABLE, hdRadioEnable);
+ }
+
+ /**
+ * Gets the hdRadioEnable portion of the RadioControlData class
+ *
+ * @return Boolean - True if the hd radio is on, false if the radio is off.
+ */
+ public Boolean getHdRadioEnable() {
+ return getBoolean(KEY_HD_RADIO_ENABLE);
+ }
+
+ /**
+ * 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/base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java
new file mode 100644
index 000000000..29326e550
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Include the data defined in Radio Data System, which is a communications protocol standard
+ * for embedding small amounts of digital information in conventional FM radio broadcasts.
+ */
+public class RdsData extends RPCStruct{
+ public static final String KEY_PS= "PS";
+ public static final String KEY_RT= "RT";
+ public static final String KEY_CT= "CT";
+ public static final String KEY_PI= "PI";
+ public static final String KEY_PTY= "PTY";
+ public static final String KEY_TP= "TP";
+ public static final String KEY_TA= "TA";
+ public static final String KEY_REG= "REG";
+
+ public RdsData() {
+ }
+
+ public RdsData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the programService portion of the RdsData class
+ *
+ * @param programService
+ * Program Service Name.
+ */
+ public void setProgramService(String programService) {
+ setValue(KEY_PS, programService);
+ }
+
+ /**
+ * Gets the programService portion of the RdsData class
+ *
+ * @return String - Program Service Name.
+ */
+ public String getProgramService() {
+ return getString(KEY_PS);
+ }
+
+ /**
+ * Sets the radioText portion of the RdsData class
+ *
+ * @param radioText
+ * Radio Text.
+ */
+ public void setRadioText(String radioText) {
+ setValue(KEY_RT, radioText);
+ }
+
+ /**
+ * Gets the radioText portion of the RdsData class
+ *
+ * @return String - Radio Text.
+ */
+ public String getRadioText() {
+ return getString(KEY_RT);
+ }
+
+ /**
+ * Sets the clockText portion of the RdsData class
+ *
+ * @param clockText
+ * The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD.
+ */
+ public void setClockText(String clockText) {
+ setValue(KEY_CT, clockText);
+ }
+
+ /**
+ * Gets the clockText portion of the RdsData class
+ *
+ * @return String - The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD.
+ */
+ public String getClockText() {
+ return getString(KEY_CT);
+ }
+
+ /**
+ * Sets the programIdentification portion of the RdsData class
+ *
+ * @param programIdentification
+ * Program Identification - the call sign for the radio station.
+ */
+ public void setProgramIdentification(String programIdentification) {
+ setValue(KEY_PI, programIdentification);
+ }
+
+ /**
+ * Gets the programIdentification portion of the RdsData class
+ *
+ * @return String - Program Identification - the call sign for the radio station.
+ */
+ public String getProgramIdentification() {
+ return getString(KEY_PI);
+ }
+
+ /**
+ * Sets the region portion of the RdsData class
+ *
+ * @param region
+ * Region.
+ */
+ public void setRegion(String region) {
+ setValue(KEY_REG, region);
+ }
+
+ /**
+ * Gets the region portion of the RdsData class
+ *
+ * @return String - Region.
+ */
+ public String getRegion() {
+ return getString(KEY_REG);
+ }
+
+ /**
+ * Sets the trafficProgram portion of the RdsData class
+ *
+ * @param trafficProgram
+ * Traffic Program Identification - Identifies a station that offers traffic.
+ */
+ public void setTrafficProgram(Boolean trafficProgram) {
+ setValue(KEY_TP, trafficProgram);
+ }
+
+ /**
+ * Gets the trafficProgram portion of the RdsData class
+ *
+ * @return Boolean - Traffic Program Identification - Identifies a station that offers traffic.
+ */
+ public Boolean getTrafficProgram() {
+ return getBoolean(KEY_TP);
+ }
+
+ /**
+ * Sets the trafficAnnouncement portion of the RdsData class
+ *
+ * @param trafficAnnouncement
+ * Traffic Announcement Identification - Indicates an ongoing traffic announcement.
+ */
+ public void setTrafficAnnouncement(Boolean trafficAnnouncement) {
+ setValue(KEY_TA, trafficAnnouncement);
+ }
+
+ /**
+ * Gets the trafficAnnouncement portion of the RdsData class
+ *
+ * @return Boolean - Traffic Announcement Identification - Indicates an ongoing traffic announcement.
+ */
+ public Boolean getTrafficAnnouncement() {
+ return getBoolean(KEY_TA);
+ }
+
+ /**
+ * Sets the programType portion of the RdsData class
+ *
+ * @param programType
+ * The program type - The region should be used to differentiate between EU and North America program types.
+ */
+ public void setProgramType(Integer programType) {
+ setValue(KEY_PTY, programType);
+ }
+
+ /**
+ * Gets the programType portion of the RdsData class
+ *
+ * @return Integer - The program type.
+ * The region should be used to differentiate between EU and North America program types.
+ */
+ public Integer getProgramType() {
+ return getInteger(KEY_PTY);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java
new file mode 100644
index 000000000..83bef72af
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * <p>Non periodic vehicle data read request. This is an RPC to get diagnostics
+ * data from certain vehicle modules. DIDs of a certain module might differ from
+ * vehicle type to vehicle type</p>
+ *
+ * <p>Function Group: ProprietaryData</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>ecuName</td>
+ * <td>Integer</td>
+ * <td>Name of ECU.</td>
+ * <td>Y</td>
+ * <td>Minvalue: 0; Maxvalue: 65535</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>didLocation</td>
+ * <td>Integer</td>
+ * <td>Get raw data from vehicle data DID location(s).</td>
+ * <td>Y</td>
+ * <td>Minvalue: 0; Maxvalue: 65535</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <td>appID</td>
+ * <td>Integer</td>
+ * <td>ID of the application that requested this RPC.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ *
+ * <p><b>Response</b></p>
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ * <p> DISALLOWED</p>
+ * <p>USER_DISALLOWED </p>
+ * <p>TRUNCATED_DATA</p>
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class ReadDID extends RPCRequest {
+ public static final String KEY_ECU_NAME = "ecuName";
+ public static final String KEY_DID_LOCATION = "didLocation";
+
+ /**
+ * Constructs a new ReadDID object
+ */
+ public ReadDID() {
+ super(FunctionID.READ_DID.toString());
+ }
+
+ /**
+ * Constructs a new ReadDID object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public ReadDID(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ReadDID object
+ * @param ecuName an Integer value representing the ID of the vehicle module
+ * <b>Notes: </b>Minvalue:0; Maxvalue:65535
+ * @param didLocation a List<Integer> value representing raw data from vehicle data DID location(s) <br>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Minvalue:0; Maxvalue:65535</li>
+ * <li>ArrayMin:0; ArrayMax:1000</li>
+ * </ul>
+ */
+ public ReadDID(@NonNull Integer ecuName, @NonNull List<Integer> didLocation) {
+ this();
+ setEcuName(ecuName);
+ setDidLocation(didLocation);
+ }
+
+ /**
+ * Sets an ID of the vehicle module
+ *
+ * @param ecuName
+ * an Integer value representing the ID of the vehicle module
+ * <p></p>
+ * <b>Notes: </b>Minvalue:0; Maxvalue:65535
+ */
+ public void setEcuName(@NonNull Integer ecuName) {
+ setParameters(KEY_ECU_NAME, ecuName);
+ }
+
+ /**
+ * Gets the ID of the vehicle module
+ *
+ * @return Integer -an Integer value representing the ID of the vehicle
+ * module
+ */
+ public Integer getEcuName() {
+ return getInteger(KEY_ECU_NAME);
+ }
+
+ /**
+ * Sets raw data from vehicle data DID location(s)
+ *
+ * @param didLocation
+ * a List<Integer> value representing raw data from vehicle
+ * data DID location(s)
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Minvalue:0; Maxvalue:65535</li>
+ * <li>ArrayMin:0; ArrayMax:1000</li>
+ * </ul>
+ */
+ public void setDidLocation(@NonNull List<Integer> didLocation) {
+ setParameters(KEY_DID_LOCATION, didLocation);
+ }
+
+ /**
+ * Gets raw data from vehicle data DID location(s)
+ *
+ * @return List<Integer> -a List<Integer> value representing raw data
+ * from vehicle data DID location(s)
+ */
+ @SuppressWarnings("unchecked")
+ public List<Integer> getDidLocation() {
+ return (List<Integer>) getObject(Integer.class, KEY_DID_LOCATION);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java
new file mode 100644
index 000000000..a7cd3ca57
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Read DID Response is sent, when ReadDID has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class ReadDIDResponse extends RPCResponse {
+ public static final String KEY_DID_RESULT = "didResult";
+
+ public ReadDIDResponse() {
+ super(FunctionID.READ_DID.toString());
+ }
+ public ReadDIDResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new ReadDIDResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public ReadDIDResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+ public void setDidResult(List<DIDResult> didResult) {
+ setParameters(KEY_DID_RESULT, didResult);
+ }
+ @SuppressWarnings("unchecked")
+ public List<DIDResult> getDidResult() {
+ return (List<DIDResult>) getObject(DIDResult.class, KEY_DID_RESULT);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java
index d2545b5e5..d2545b5e5 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
new file mode 100644
index 000000000..c54ea9589
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
@@ -0,0 +1,738 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+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;
+/**
+ * Registers the application's interface with SDL&reg;, declaring properties of
+ * the registration, including the messaging interface version, the app name,
+ * etc. The mobile application must establish its interface registration with
+ * SDL&reg; before any other interaction with SDL&reg; can take place. The
+ * registration lasts until it is terminated either by the application calling
+ * the <i> {@linkplain UnregisterAppInterface}</i> method, or by SDL&reg;
+ * sending an <i> {@linkplain OnAppInterfaceUnregistered}</i> notification, or
+ * by loss of the underlying transport connection, or closing of the underlying
+ * message transmission protocol RPC session
+ * <p></p>
+ * Until the application receives its first <i>{@linkplain OnHMIStatus}</i>
+ * Notification, its HMI Status is assumed to be: <i>
+ * {@linkplain com.smartdevicelink.proxy.rpc.enums.HMILevel}</i>=NONE, <i>
+ * {@linkplain com.smartdevicelink.proxy.rpc.enums.AudioStreamingState}
+ * </i>=NOT_AUDIBLE, <i>
+ * {@linkplain com.smartdevicelink.proxy.rpc.enums.SystemContext}</i>=MAIN
+ * <p></p>
+ * All SDL&reg; resources which the application creates or uses (e.g. Choice
+ * Sets, Command Menu, etc.) are associated with the application's interface
+ * registration. Therefore, when the interface registration ends, the SDL&reg;
+ * resources associated with the application are disposed of. As a result, even
+ * though the application itself may continue to run on its host platform (e.g.
+ * mobile device) after the interface registration terminates, the application
+ * will not be able to use the SDL&reg; HMI without first establishing a new
+ * interface registration and re-creating its required SDL&reg; resources. That
+ * is, SDL&reg; resources created by (or on behalf of) an application do not
+ * persist beyond the life-span of the interface registration
+ * <p></p>
+ * Resources and settings whose lifespan is tied to the duration of an
+ * application's interface registration:
+ * <ul>
+ * <li>Choice Sets</li>
+ * <li>Command Menus (built by successive calls to <i>{@linkplain AddCommand}
+ * </i>)</li>
+ * <li>Media clock timer display value</li>
+ * <li>Media clock timer display value</li>
+ * <li>Media clock timer display value</li>
+ * </ul>
+ * <p></p>
+ * The autoActivateID is used to grant an application the HMILevel and
+ * AudioStreamingState it had when it last disconnected
+ * <p></p>
+ * <b>Notes: </b>The autoActivateID parameter, and associated behavior, is
+ * currently ignored by SDL&reg;
+ * <p></p>
+ * When first calling this method (i.e. first time within life cycle of mobile
+ * app), an autoActivateID should not be included. After successfully
+ * registering an interface, an autoActivateID is returned to the mobile
+ * application for it to use in subsequent connections. If the connection
+ * between SDL&reg; and the mobile application is lost, such as the vehicle is
+ * turned off while the application is running, the autoActivateID can then be
+ * passed in another call to RegisterAppInterface to re-acquire <i>
+ * {@linkplain com.smartdevicelink.proxy.rpc.enums.HMILevel}</i>=FULL
+ * <p></p>
+ * If the application intends to stream audio it is important to indicate so via
+ * the isMediaApp parameter. When set to true, audio will reliably stream
+ * without any configuration required by the user. When not set, audio may
+ * stream, depending on what the user might have manually configured as a media
+ * source on SDL&reg;
+ * <p></p>
+ * There is no time limit for how long the autoActivateID is "valid" (i.e. would
+ * confer focus and opt-in)
+ *
+ *<p> <b>HMILevel is not defined before registering</b></p>
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>MsgVersion</td>
+ * <td>MsgVersion</td>
+ * <td>Declares what version of the SDL interface the application expects to use with SDL</td>
+ * <td>Y</td>
+ * <td>To be compatible, app msg major version number must be less than or equal to SDL major version number. <p>If msg versions are incompatible, app has 20 seconds to attempt successful RegisterAppInterface (w.r.t. msg version) on underlying protocol session, else will be terminated. Major version number is a compatibility declaration. Minor version number indicates minor functional variations (e.g. features, capabilities, bug fixes) when sent from SDL to app (in RegisterAppInterface response).</p>However, the minor version number sent from the app to SDL (in RegisterAppInterface request) is ignored by SDL.</td>
+ * <td>SmartDeviceLink 1.0 </td>
+ * </tr>
+ * <tr>
+ * <td>appName</td>
+ * <td>String</td>
+ * <td>The mobile application's name. This name is displayed in the SDL Mobile Applications menu. It also serves as the unique identifier of the application for SDL .</td>
+ * <td>Y</td>
+ * <td><p> Must be 1-100 characters in length. Must consist of following characters: </p><p>May not be the same (by case insensitive comparison) as the name or any synonym of any currently registered application.</p> </td>
+ * <td>SmartDeviceLink 1.0 </td>
+ * </tr>
+ * <tr>
+ * <td>ttsName</td>
+ * <td>TTSChunk</td>
+ * <td>TTS string for VR recognition of the mobile application name. Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.</td>
+ * <td>N</td>
+ * <td><p>Size must be 1-100 Needs to be unique over all applications. May not be empty.<p>May not start with a new line character.</p></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>ngnMediaScreenAppName</td>
+ * <td>String</td>
+ * <td>Provides an abbreviated version of the app name (if necessary) that will be displayed on the NGN media screen.</td>
+ * <td>N</td>
+ * <td>- Must be 1-5 characters. If not provided, value will be derived from appName truncated to 5 characters.</td>
+ * <td>SmartDeviceLink 1.0 </td>
+ * </tr>
+ * <tr>
+ * <td>vrSynonyms</td>
+ * <td>String</td>
+ * <td>An array of 1-100 elements, each element containing a voice-recognition synonym by which this app can be called when being addressed in the mobile applications menu.</td>
+ * <td>N</td>
+ * <td>Each vr synonym is limited to 40 characters, and there can be 1-100 synonyms in array. May not be the same (by case insensitive comparison) as the name or any synonym of any currently-registered application.</td>
+ * <td>SmartDeviceLink 1.0 </td>
+ * </tr>
+ * <tr>
+ * <td>isMediaApplication</td>
+ * <td>Boolean</td>
+ * <td>Indicates that the application will be streaming audio to SDL (via A2DP) that is audible outside of the BT media source.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0 </td>
+ * </tr>
+ * <tr>
+ * <td>languageDesired</td>
+ * <td>Language</td>
+ * <td>An enumeration indicating what language the application intends to use for user interaction (Display, TTS and VR).</td>
+ * <td>Y</td>
+ * <td>If the language indicated does not match the active language on SDL, the interface registration will be rejected.If the user changes the SDL language while this interface registration is active, the interface registration will be terminated. </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>hmiDisplayLanguageDesired</td>
+ * <td>Language</td>
+ * <td>An enumeration indicating what language the application intends to use for user interaction ( Display).</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>appHMIType</td>
+ * <td>AppHMIType</td>
+ * <td>List of all applicable app types stating which classifications to be given to the app.e.g. for platforms , like GEN2, this will determine which "corner(s)" the app can populate</td>
+ * <td>N</td>
+ * <td>Array Minsize: 1; Array Maxsize: 100</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>hashID</td>
+ * <td>String</td>
+ * <td>ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece. If omitted, then the previous state of an app's commands, etc. will not be restored.When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.). </td>
+ * <td>N</td>
+ * <td>maxlength:100</td>
+ * <td>SmartDeviceLink 2.3.1 </td>
+ * </tr>
+ * <tr>
+ * <td>deviceInfo</td>
+ * <td>DeviceInfo</td>
+ * <td>Various information abount connecting device.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.3.1 </td>
+ * </tr>
+ * <tr>
+ * <td>appID</td>
+ * <td>String</td>
+ * <td>ID used to validate app with policy table entries</td>
+ * <td>Y</td>
+ * <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 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>hmiCapabilities</td>
+ * <td>HMICapabilities</td>
+ * <td>Specifies the HMI capabilities.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.3.2.2 </td>
+ * </tr>
+ *
+ * <tr>
+ * <td>sdlVersion</td>
+ * <td>String</td>
+ * <td>The SmartDeviceLink version.</td>
+ * <td>N</td>
+ * <td>Maxlength: 100</td>
+ * <td>SmartDeviceLink 2.3.2.2</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>systemSoftwareVersion</td>
+ * <td>String</td>
+ * <td>The software version of the system that implements the SmartDeviceLink core.</td>
+ * <td>N</td>
+ * <td>Maxlength: 100</td>
+ * <td>SmartDeviceLink 2.3.2.2</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>dayColorScheme</td>
+ * <td>TemplateColorScheme</td>
+ * <td>The color scheme that is used for day.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>nightColorScheme</td>
+ * <td>TemplateColorScheme</td>
+ * <td>The color scheme that is used for night.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * </table>
+ * <p></p>
+ * @since SmartDeviceLink 1.0
+ * @see UnregisterAppInterface
+ * @see OnAppInterfaceUnregistered
+ */
+public class RegisterAppInterface extends RPCRequest {
+ public static final String KEY_TTS_NAME = "ttsName";
+ 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";
+ public static final String KEY_NGN_MEDIA_SCREEN_APP_NAME = "ngnMediaScreenAppName";
+ public static final String KEY_IS_MEDIA_APPLICATION = "isMediaApplication";
+ public static final String KEY_VR_SYNONYMS = "vrSynonyms";
+ public static final String KEY_SDL_MSG_VERSION = "syncMsgVersion";
+ 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
+ */
+ public RegisterAppInterface() {
+ super(FunctionID.REGISTER_APP_INTERFACE.toString());
+ }
+ /**
+ * Constructs a new RegisterAppInterface object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public RegisterAppInterface(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new RegisterAppInterface object
+ * @param syncMsgVersion a SdlMsgVersion object representing version of the SDL&reg; SmartDeviceLink interface <br>
+ * <b>Notes: </b>To be compatible, app msg major version number
+ * must be less than or equal to SDL&reg; major version number.
+ * If msg versions are incompatible, app has 20 seconds to
+ * attempt successful RegisterAppInterface (w.r.t. msg version)
+ * on underlying protocol session, else will be terminated. Major
+ * version number is a compatibility declaration. Minor version
+ * number indicates minor functional variations (e.g. features,
+ * capabilities, bug fixes) when sent from SDL&reg; to app (in
+ * RegisterAppInterface response). However, the minor version
+ * number sent from the app to SDL&reg; (in RegisterAppInterface
+ * request) is ignored by SDL&reg;
+ * @param appName a String value representing the Mobile Application's Name <br>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Must be 1-100 characters in length</li>
+ * <li>May not be the same (by case insensitive comparison) as
+ * the name or any synonym of any currently-registered
+ * application</li>
+ * </ul>
+ * @param isMediaApplication a Boolean value
+ * @param languageDesired a Language Enumeration
+ * @param hmiDisplayLanguageDesired the requested language to be used on the HMI/Display
+ * @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 fullAppID) {
+ this();
+ setSdlMsgVersion(syncMsgVersion);
+ setAppName(appName);
+ setIsMediaApplication(isMediaApplication);
+ setLanguageDesired(languageDesired);
+ setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
+ setFullAppID(fullAppID);
+ }
+ /**
+ * Gets the version of the SDL&reg; SmartDeviceLink interface
+ *
+ * @return SdlMsgVersion -a SdlMsgVersion object representing version of
+ * the SDL&reg; SmartDeviceLink interface
+ */
+ @SuppressWarnings("unchecked")
+ public SdlMsgVersion getSdlMsgVersion() {
+ return (SdlMsgVersion) getObject(SdlMsgVersion.class, KEY_SDL_MSG_VERSION);
+ }
+ /**
+ * Sets the version of the SDL&reg; SmartDeviceLink interface
+ *
+ * @param sdlMsgVersion
+ * a SdlMsgVersion object representing version of the SDL&reg;
+ * SmartDeviceLink interface
+ * <p></p>
+ * <b>Notes: </b>To be compatible, app msg major version number
+ * must be less than or equal to SDL&reg; major version number.
+ * If msg versions are incompatible, app has 20 seconds to
+ * attempt successful RegisterAppInterface (w.r.t. msg version)
+ * on underlying protocol session, else will be terminated. Major
+ * version number is a compatibility declaration. Minor version
+ * number indicates minor functional variations (e.g. features,
+ * capabilities, bug fixes) when sent from SDL&reg; to app (in
+ * RegisterAppInterface response). However, the minor version
+ * number sent from the app to SDL&reg; (in RegisterAppInterface
+ * request) is ignored by SDL&reg;
+ *
+ */
+ public void setSdlMsgVersion(@NonNull SdlMsgVersion sdlMsgVersion) {
+ setParameters(KEY_SDL_MSG_VERSION, sdlMsgVersion);
+ }
+
+ @SuppressWarnings("unchecked")
+ public DeviceInfo getDeviceInfo() {
+ return (DeviceInfo) getObject(DeviceInfo.class, KEY_DEVICE_INFO);
+ }
+
+ public void setDeviceInfo(DeviceInfo deviceInfo) {
+ setParameters(KEY_DEVICE_INFO, deviceInfo);
+ }
+ /**
+ * Gets Mobile Application's Name
+ *
+ * @return String -a String representing the Mobile Application's Name
+ */
+ public String getAppName() {
+ return getString(KEY_APP_NAME);
+ }
+ /**
+ * Sets Mobile Application's Name, This name is displayed in the SDL&reg;
+ * Mobile Applications menu. It also serves as the unique identifier of the
+ * application for SmartDeviceLink
+ *
+ * @param appName
+ * a String value representing the Mobile Application's Name
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Must be 1-100 characters in length</li>
+ * <li>May not be the same (by case insensitive comparison) as
+ * the name or any synonym of any currently-registered
+ * application</li>
+ * </ul>
+ */
+ public void setAppName(@NonNull String appName) {
+ setParameters(KEY_APP_NAME, appName);
+ }
+
+ /**
+ * Gets TTS string for VR recognition of the mobile application name
+ *
+ * @return List<TTSChunk> -List value representing the TTS string
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getTtsName() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_NAME);
+ }
+
+ /**
+ *
+ * @param ttsName
+ * a List<TTSChunk> value represeting the TTS Name
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Size must be 1-100</li>
+ * <li>Needs to be unique over all applications</li>
+ * <li>May not be empty</li>
+ * <li>May not start with a new line character</li>
+ * <li>May not interfere with any name or synonym of previously
+ * registered applications and the following list of words</li>
+ * <li>Needs to be unique over all applications. Applications
+ * with the same name will be rejected</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+ public void setTtsName(List<TTSChunk> ttsName) {
+ setParameters(KEY_TTS_NAME, ttsName);
+ }
+ /**
+ * Gets a String representing an abbreviated version of the mobile
+ * applincation's name (if necessary) that will be displayed on the NGN
+ * media screen
+ *
+ * @return String -a String value representing an abbreviated version of the
+ * mobile applincation's name
+ */
+ public String getNgnMediaScreenAppName() {
+ return getString(KEY_NGN_MEDIA_SCREEN_APP_NAME);
+ }
+ /**
+ * Sets a String representing an abbreviated version of the mobile
+ * applincation's name (if necessary) that will be displayed on the NGN
+ * media screen
+ *
+ * @param ngnMediaScreenAppName
+ * a String value representing an abbreviated version of the
+ * mobile applincation's name
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Must be 1-5 characters</li>
+ * <li>If not provided, value will be derived from appName
+ * truncated to 5 characters</li>
+ * </ul>
+ */
+ public void setNgnMediaScreenAppName(String ngnMediaScreenAppName) {
+ setParameters(KEY_NGN_MEDIA_SCREEN_APP_NAME, ngnMediaScreenAppName);
+ }
+ /**
+ * Gets the List<String> representing the an array of 1-100 elements, each
+ * element containing a voice-recognition synonym
+ *
+ * @return List<String> -a List value representing the an array of
+ * 1-100 elements, each element containing a voice-recognition
+ * synonym
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getVrSynonyms() {
+ return (List<String>) getObject(String.class, KEY_VR_SYNONYMS);
+ }
+ /**
+ * Sets a vrSynonyms representing the an array of 1-100 elements, each
+ * element containing a voice-recognition synonym
+ *
+ * @param vrSynonyms
+ * a List<String> value representing the an array of 1-100
+ * elements
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Each vr synonym is limited to 40 characters, and there can
+ * be 1-100 synonyms in array</li>
+ * <li>May not be the same (by case insensitive comparison) as
+ * the name or any synonym of any currently-registered
+ * application</li>
+ * </ul>
+ */
+ public void setVrSynonyms(List<String> vrSynonyms) {
+ setParameters(KEY_VR_SYNONYMS, vrSynonyms);
+ }
+ /**
+ * Gets a Boolean representing MediaApplication
+ *
+ * @return Boolean -a Boolean value representing a mobile application that is
+ * a media application or not
+ */
+ public Boolean getIsMediaApplication() {
+ return getBoolean(KEY_IS_MEDIA_APPLICATION);
+ }
+ /**
+ * Sets a Boolean to indicate a mobile application that is a media
+ * application or not
+ *
+ * @param isMediaApplication
+ * a Boolean value
+ */
+ public void setIsMediaApplication(@NonNull Boolean isMediaApplication) {
+ setParameters(KEY_IS_MEDIA_APPLICATION, isMediaApplication);
+ }
+ /**
+ * Gets a Language enumeration indicating what language the application
+ * intends to use for user interaction (Display, TTS and VR)
+ *
+ * @return Enumeration -a language enumeration
+ */
+ public Language getLanguageDesired() {
+ return (Language) getObject(Language.class, KEY_LANGUAGE_DESIRED);
+ }
+ /**
+ * Sets an enumeration indicating what language the application intends to
+ * use for user interaction (Display, TTS and VR)
+ *
+ * @param languageDesired
+ * a Language Enumeration
+ *
+ *
+ */
+ public void setLanguageDesired(@NonNull Language languageDesired) {
+ setParameters(KEY_LANGUAGE_DESIRED, languageDesired);
+ }
+
+ /**
+ * Gets an enumeration indicating what language the application intends to
+ * use for user interaction ( Display)
+ *
+ * @return Language - a Language value representing an enumeration
+ * indicating what language the application intends to use for user
+ * interaction ( Display)
+ * @since SmartDeviceLink 2.0
+ */
+ public Language getHmiDisplayLanguageDesired() {
+ return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE_DESIRED);
+ }
+
+ /**
+ * Sets an enumeration indicating what language the application intends to
+ * use for user interaction ( Display)
+ *
+ * @param hmiDisplayLanguageDesired the requested language to be used on the HMI/Display
+ * @since SmartDeviceLink 2.0
+ */
+ public void setHmiDisplayLanguageDesired(@NonNull Language hmiDisplayLanguageDesired) {
+ setParameters(KEY_HMI_DISPLAY_LANGUAGE_DESIRED, hmiDisplayLanguageDesired);
+ }
+
+ /**
+ * Gets a list of all applicable app types stating which classifications to
+ * be given to the app.e.g. for platforms , like GEN2, this will determine
+ * which "corner(s)" the app can populate
+ *
+ * @return List<AppHMIType> - a List value representing a list of all
+ * applicable app types stating which classifications to be given to
+ * the app
+ * @since SmartDeviceLinke 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<AppHMIType> getAppHMIType() {
+ return (List<AppHMIType>) getObject(AppHMIType.class, KEY_APP_HMI_TYPE);
+ }
+
+ /**
+ * Sets a a list of all applicable app types stating which classifications
+ * to be given to the app. e.g. for platforms , like GEN2, this will
+ * determine which "corner(s)" the app can populate
+ *
+ * @param appHMIType
+ * a List<AppHMIType>
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Array Minsize: = 1</li>
+ * <li>Array Maxsize = 100</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+ public void setAppHMIType(List<AppHMIType> appHMIType) {
+ setParameters(KEY_APP_HMI_TYPE, appHMIType);
+ }
+
+ public String getHashID() {
+ return getString(KEY_HASH_ID);
+ }
+
+ 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);
+ }
+
+ /**
+ * 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
+ * <p></p>
+ * <b>Notes: </b>Maxlength = 100
+ * @since SmartDeviceLink 2.0
+ */
+ 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 5.0
+ */
+ 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 5.0
+ */
+ 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
+ *
+ * @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used
+ * for day color scheme
+ * @since SmartDeviceLink 5.0
+ */
+ public TemplateColorScheme getDayColorScheme(){
+ return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_DAY_COLOR_SCHEME);
+ }
+
+ /**
+ * Sets the color scheme that is intended to be used for day
+ *
+ * @param templateColorScheme a TemplateColorScheme object representing the colors that will be
+ * used for day color scheme
+ * @since SmartDeviceLink 5.0
+ */
+ public void setDayColorScheme(TemplateColorScheme templateColorScheme){
+ setParameters(KEY_DAY_COLOR_SCHEME, templateColorScheme);
+ }
+
+ /**
+ * Gets the color scheme that is currently used for night
+ *
+ * @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used
+ * for night color scheme
+ * @since SmartDeviceLink 5.0
+ */
+ public TemplateColorScheme getNightColorScheme(){
+ return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_NIGHT_COLOR_SCHEME);
+ }
+
+ /**
+ * Sets the color scheme that is intended to be used for night
+ *
+ * @param templateColorScheme a TemplateColorScheme object representing the colors that will be
+ * used for night color scheme
+ * @since SmartDeviceLink 5.0
+ */
+ public void setNightColorScheme(TemplateColorScheme templateColorScheme){
+ setParameters(KEY_NIGHT_COLOR_SCHEME, templateColorScheme);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
new file mode 100644
index 000000000..a2e2ef646
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
@@ -0,0 +1,458 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Register AppInterface Response is sent, when RegisterAppInterface has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class RegisterAppInterfaceResponse extends RPCResponse {
+ public static final String KEY_VEHICLE_TYPE = "vehicleType";
+ public static final String KEY_SPEECH_CAPABILITIES = "speechCapabilities";
+ public static final String KEY_VR_CAPABILITIES = "vrCapabilities";
+ public static final String KEY_AUDIO_PASS_THRU_CAPABILITIES = "audioPassThruCapabilities";
+ public static final String KEY_HMI_ZONE_CAPABILITIES = "hmiZoneCapabilities";
+ public static final String KEY_PRERECORDED_SPEECH = "prerecordedSpeech";
+ public static final String KEY_SUPPORTED_DIAG_MODES = "supportedDiagModes";
+ public static final String KEY_SDL_MSG_VERSION = "syncMsgVersion";
+ public static final String KEY_LANGUAGE = "language";
+ public static final String KEY_BUTTON_CAPABILITIES = "buttonCapabilities";
+ public static final String KEY_DISPLAY_CAPABILITIES = "displayCapabilities";
+ public static final String KEY_HMI_DISPLAY_LANGUAGE = "hmiDisplayLanguage";
+ public static final String KEY_SOFT_BUTTON_CAPABILITIES = "softButtonCapabilities";
+ public static final String KEY_PRESET_BANK_CAPABILITIES = "presetBankCapabilities";
+ public static final String KEY_HMI_CAPABILITIES = "hmiCapabilities"; //As of v4.0
+ public static final String KEY_SDL_VERSION = "sdlVersion"; //As of v4.0
+ public static final String KEY_SYSTEM_SOFTWARE_VERSION = "systemSoftwareVersion"; //As of v4.0
+ public static final String KEY_ICON_RESUMED = "iconResumed";
+ public static final String KEY_PCM_STREAM_CAPABILITIES = "pcmStreamCapabilities";
+
+ /**
+ * Constructs a new RegisterAppInterfaceResponse object
+ */
+ public RegisterAppInterfaceResponse() {
+ super(FunctionID.REGISTER_APP_INTERFACE.toString());
+ }
+
+ /**
+ * Constructs a new RegisterAppInterfaceResponse object indicated by the Hashtable
+ * parameter
+ * <p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public RegisterAppInterfaceResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new RegisterAppInterfaceResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public RegisterAppInterfaceResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ 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);
+ }
+
+ List<ButtonCapabilities> capabilities = getButtonCapabilities();
+ if(capabilities != null){
+ List<ButtonCapabilities> additions = new ArrayList<>();
+ for(ButtonCapabilities capability : capabilities){
+ if(ButtonName.OK.equals(capability.getName())){
+ if(rpcVersion == null || rpcVersion.getMajor() < 5){
+ //If version is < 5, the play pause button must also be added
+ additions.add(new ButtonCapabilities(ButtonName.PLAY_PAUSE, capability.getShortPressAvailable(), capability.getLongPressAvailable(), capability.getUpDownAvailable()));
+ }
+ }
+ }
+ capabilities.addAll(additions);
+ setButtonCapabilities(capabilities);
+ }
+
+
+ super.format(rpcVersion,formatParams);
+ }
+
+
+ /**
+ * Gets the version of the SDL&reg; SmartDeviceLink interface
+ *
+ * @return SdlMsgVersion -a SdlMsgVersion object representing version of
+ * the SDL&reg; SmartDeviceLink interface
+ */
+ @SuppressWarnings("unchecked")
+ public SdlMsgVersion getSdlMsgVersion() {
+ return (SdlMsgVersion) getObject(SdlMsgVersion.class, KEY_SDL_MSG_VERSION);
+ }
+
+ /**
+ * Sets the version of the SDL&reg; SmartDeviceLink interface
+ *
+ * @param sdlMsgVersion
+ * a SdlMsgVersion object representing version of the SDL&reg;
+ * SmartDeviceLink interface
+ * <p></p>
+ * <b>Notes: </b>To be compatible, app msg major version number
+ * must be less than or equal to SDL&reg; major version number.
+ * If msg versions are incompatible, app has 20 seconds to
+ * attempt successful RegisterAppInterface (w.r.t. msg version)
+ * on underlying protocol session, else will be terminated. Major
+ * version number is a compatibility declaration. Minor version
+ * number indicates minor functional variations (e.g. features,
+ * capabilities, bug fixes) when sent from SDL&reg; to app (in
+ * RegisterAppInterface response). However, the minor version
+ * number sent from the app to SDL&reg; (in RegisterAppInterface
+ * request) is ignored by SDL&reg;
+ */
+ public void setSdlMsgVersion(SdlMsgVersion sdlMsgVersion) {
+ setParameters(KEY_SDL_MSG_VERSION, sdlMsgVersion);
+ }
+
+ /**
+ * Gets a Language enumeration indicating what language the application
+ * intends to use for user interaction (Display, TTS and VR)
+ *
+ * @return Enumeration -a language enumeration
+ */
+ public Language getLanguage() {
+ return (Language) getObject(Language.class, KEY_LANGUAGE);
+ }
+
+ /**
+ * Sets an enumeration indicating what language the application intends to
+ * use for user interaction (Display, TTS and VR)
+ *
+ * @param language
+ * a Language Enumeration
+ *
+ *
+ */
+ public void setLanguage(Language language) {
+ setParameters(KEY_LANGUAGE, language);
+ }
+
+ /**
+ * Gets an enumeration indicating what language the application intends to
+ * use for user interaction ( Display)
+ *
+ * @return Language - a Language value representing an enumeration
+ * indicating what language the application intends to use for user
+ * interaction ( Display)
+ * @since SmartDeviceLink 2.0
+ */
+ public Language getHmiDisplayLanguage() {
+ return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE);
+ }
+
+ /**
+ * Sets an enumeration indicating what language the application intends to
+ * use for user interaction ( Display)
+ *
+ * @param hmiDisplayLanguage
+ * @since SmartDeviceLink 2.0
+ */
+ public void setHmiDisplayLanguage(Language hmiDisplayLanguage) {
+ setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
+ }
+
+ /**
+ * Gets getDisplayCapabilities set when application interface is registered.
+ *
+ * @return DisplayCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public DisplayCapabilities getDisplayCapabilities() {
+ return (DisplayCapabilities) getObject(DisplayCapabilities.class, KEY_DISPLAY_CAPABILITIES);
+ }
+ /**
+ * Sets Display Capabilities
+ * @param displayCapabilities
+ */
+ public void setDisplayCapabilities(DisplayCapabilities displayCapabilities) {
+ setParameters(KEY_DISPLAY_CAPABILITIES, displayCapabilities);
+ }
+
+ /**
+ * Gets buttonCapabilities set when application interface is registered.
+ *
+ * @return buttonCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public List<ButtonCapabilities> getButtonCapabilities() {
+ return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES);
+ }
+ /**
+ * Sets Button Capabilities
+ * @param buttonCapabilities
+ */
+ public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
+ setParameters(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
+ }
+ /**
+ * Gets getSoftButtonCapabilities set when application interface is registered.
+ *
+ * @return SoftButtonCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public List<SoftButtonCapabilities> getSoftButtonCapabilities() {
+ return (List<SoftButtonCapabilities>) getObject(SoftButtonCapabilities.class, KEY_SOFT_BUTTON_CAPABILITIES);
+ }
+ /**
+ * Sets softButtonCapabilities
+ * @param softButtonCapabilities
+ */
+ public void setSoftButtonCapabilities(List<SoftButtonCapabilities> softButtonCapabilities) {
+ setParameters(KEY_SOFT_BUTTON_CAPABILITIES, softButtonCapabilities);
+ }
+
+ /**
+ * Gets getPresetBankCapabilities set when application interface is registered.
+ *
+ * @return PresetBankCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public PresetBankCapabilities getPresetBankCapabilities() {
+ return (PresetBankCapabilities) getObject(PresetBankCapabilities.class, KEY_PRESET_BANK_CAPABILITIES);
+ }
+ /**
+ * Sets presetBankCapabilities
+ * @param presetBankCapabilities
+ */
+ public void setPresetBankCapabilities(PresetBankCapabilities presetBankCapabilities) {
+ setParameters(KEY_PRESET_BANK_CAPABILITIES, presetBankCapabilities);
+ }
+
+ /**
+ * Gets hmiZoneCapabilities set when application interface is registered.
+ *
+ * @return HmiZoneCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public List<HmiZoneCapabilities> getHmiZoneCapabilities() {
+ return (List<HmiZoneCapabilities>) getObject(HmiZoneCapabilities.class, KEY_HMI_ZONE_CAPABILITIES);
+ }
+ /**
+ * Sets hmiZoneCapabilities
+ * @param hmiZoneCapabilities
+ */
+ public void setHmiZoneCapabilities(List<HmiZoneCapabilities> hmiZoneCapabilities) {
+ setParameters(KEY_HMI_ZONE_CAPABILITIES, hmiZoneCapabilities);
+ }
+
+ /**
+ * Gets speechCapabilities set when application interface is registered.
+ *
+ * @return SpeechCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public List<SpeechCapabilities> getSpeechCapabilities() {
+ Object speechCapabilities = getObject(SpeechCapabilities.class, KEY_SPEECH_CAPABILITIES);
+ if (speechCapabilities instanceof List<?>) {
+ return (List<SpeechCapabilities>) speechCapabilities;
+ } else if (speechCapabilities instanceof SpeechCapabilities) {
+ // this is a known issue observed with some core implementations
+ List<SpeechCapabilities> newSpeechCapList = new ArrayList<>();
+ newSpeechCapList.add((SpeechCapabilities) speechCapabilities);
+ return newSpeechCapList;
+ }
+ return null;
+ }
+ /**
+ * Sets speechCapabilities
+ * @param speechCapabilities
+ */
+ public void setSpeechCapabilities(List<SpeechCapabilities> speechCapabilities) {
+ setParameters(KEY_SPEECH_CAPABILITIES, speechCapabilities);
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public List<PrerecordedSpeech> getPrerecordedSpeech() {
+ return (List<PrerecordedSpeech>) getObject(PrerecordedSpeech.class, KEY_PRERECORDED_SPEECH);
+ }
+
+ public void setPrerecordedSpeech(List<PrerecordedSpeech> prerecordedSpeech) {
+ setParameters(KEY_PRERECORDED_SPEECH, prerecordedSpeech);
+ }
+
+
+ /**
+ * Gets vrCapabilities set when application interface is registered.
+ *
+ * @return VrCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public List<VrCapabilities> getVrCapabilities() {
+ return (List<VrCapabilities>) getObject(VrCapabilities.class, KEY_VR_CAPABILITIES);
+ }
+ /**
+ * Sets VrCapabilities
+ * @param vrCapabilities
+ */
+ public void setVrCapabilities(List<VrCapabilities> vrCapabilities) {
+ setParameters(KEY_VR_CAPABILITIES, vrCapabilities);
+ }
+
+ /**
+ * Gets getVehicleType set when application interface is registered.
+ *
+ * @return vehicleType
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleType getVehicleType() {
+ return (VehicleType) getObject(VehicleType.class, KEY_VEHICLE_TYPE);
+ }
+ /**
+ * Sets vehicleType
+ * @param vehicleType
+ */
+ public void setVehicleType(VehicleType vehicleType) {
+ setParameters(KEY_VEHICLE_TYPE, vehicleType);
+ }
+
+ /**
+ * Gets AudioPassThruCapabilities set when application interface is registered.
+ *
+ * @return AudioPassThruCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public List<AudioPassThruCapabilities> getAudioPassThruCapabilities() {
+ return (List<AudioPassThruCapabilities>) getObject(AudioPassThruCapabilities.class, KEY_AUDIO_PASS_THRU_CAPABILITIES);
+ }
+ /**
+ * Sets AudioPassThruCapabilities
+ * @param audioPassThruCapabilities
+ */
+ public void setAudioPassThruCapabilities(List<AudioPassThruCapabilities> audioPassThruCapabilities) {
+ setParameters(KEY_AUDIO_PASS_THRU_CAPABILITIES, audioPassThruCapabilities);
+ }
+
+ /**
+ * Gets pcmStreamingCapabilities set when application interface is registered.
+ *
+ * @return pcmStreamingCapabilities
+ */
+ @SuppressWarnings("unchecked")
+ public AudioPassThruCapabilities getPcmStreamingCapabilities() {
+ return (AudioPassThruCapabilities) getObject(AudioPassThruCapabilities.class, KEY_PCM_STREAM_CAPABILITIES);
+ }
+ /**
+ * Sets pcmStreamingCapabilities
+ * @param pcmStreamingCapabilities
+ */
+ public void setPcmStreamingCapabilities(AudioPassThruCapabilities pcmStreamingCapabilities) {
+ setParameters(KEY_PCM_STREAM_CAPABILITIES, pcmStreamingCapabilities);
+ }
+ @Deprecated
+ public String getProxyVersionInfo() {
+ return null;
+ }
+ public void setSupportedDiagModes(List<Integer> supportedDiagModes) {
+ setParameters(KEY_SUPPORTED_DIAG_MODES, supportedDiagModes);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<Integer> getSupportedDiagModes() {
+ return (List<Integer>) getObject(Integer.class, KEY_SUPPORTED_DIAG_MODES);
+ }
+
+ public void setHmiCapabilities(HMICapabilities hmiCapabilities) {
+ setParameters(KEY_HMI_CAPABILITIES, hmiCapabilities);
+ }
+
+ @SuppressWarnings("unchecked")
+ public HMICapabilities getHmiCapabilities() {
+ return (HMICapabilities) getObject(HMICapabilities.class, KEY_HMI_CAPABILITIES);
+ }
+
+ public void setSdlVersion(String sdlVersion) {
+ setParameters(KEY_SDL_VERSION, sdlVersion);
+ }
+
+ public String getSdlVersion() {
+ return getString(KEY_SDL_VERSION);
+ }
+
+ public void setSystemSoftwareVersion(String systemSoftwareVersion) {
+ setParameters(KEY_SYSTEM_SOFTWARE_VERSION, systemSoftwareVersion);
+ }
+
+ public String getSystemSoftwareVersion() {
+ return getString(KEY_SYSTEM_SOFTWARE_VERSION);
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * 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/base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
new file mode 100644
index 000000000..5703f1cc2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class RemoteControlCapabilities extends RPCStruct {
+ public static final String KEY_CLIMATE_CONTROL_CAPABILITIES = "climateControlCapabilities";
+ 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() {
+ }
+
+ public RemoteControlCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the climateControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @param climateControlCapabilities If included, the platform supports RC climate controls.
+ * For this baseline version, maxsize=1. i.e. only one climate control module is supported.
+ */
+ public void setClimateControlCapabilities(List<ClimateControlCapabilities> climateControlCapabilities) {
+ setValue(KEY_CLIMATE_CONTROL_CAPABILITIES, climateControlCapabilities);
+ }
+
+ /**
+ * Gets the climateControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @return List<ClimateControlCapabilities>
+ * If included, the platform supports RC climate controls.
+ * For this baseline version, maxsize=1. i.e. only one climate control module is supported.
+ */
+ public List<ClimateControlCapabilities> getClimateControlCapabilities() {
+ return (List<ClimateControlCapabilities>) getObject(ClimateControlCapabilities.class, KEY_CLIMATE_CONTROL_CAPABILITIES);
+ }
+
+ /**
+ * Sets the radioControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @param radioControlCapabilities If included, the platform supports RC climate controls.
+ * For this baseline version, maxsize=1. i.e. only one radio control module is supported.
+ */
+ public void setRadioControlCapabilities(List<RadioControlCapabilities> radioControlCapabilities) {
+ setValue(KEY_RADIO_CONTROL_CAPABILITIES, radioControlCapabilities);
+ }
+
+ /**
+ * Gets the radioControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @return List<RadioControlCapabilities>
+ * If included, the platform supports RC climate controls.
+ * For this baseline version, maxsize=1. i.e. only one radio control module is supported.
+ */
+ public List<RadioControlCapabilities> getRadioControlCapabilities() {
+ return (List<RadioControlCapabilities>) getObject(RadioControlCapabilities.class, KEY_RADIO_CONTROL_CAPABILITIES);
+ }
+
+ /**
+ * Sets the buttonCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @param buttonCapabilities If included, the platform supports RC button controls with the included button names.
+ */
+ public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
+ setValue(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
+ }
+
+ /**
+ * Gets the buttonCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @return List<ButtonCapabilities>
+ * If included, the platform supports RC button controls with the included button names.
+ */
+ public List<ButtonCapabilities> getButtonCapabilities() {
+ return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES);
+ }
+
+ /**
+ * Sets the seatControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @param seatControlCapabilities If included, the platform supports seat controls.
+ */
+ public void setSeatControlCapabilities(List<SeatControlCapabilities> seatControlCapabilities) {
+ setValue(KEY_SEAT_CONTROL_CAPABILITIES, seatControlCapabilities);
+ }
+
+ /**
+ * Gets the seatControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @return List<SeatControlCapabilities>
+ * If included, the platform supports seat controls.
+ */
+ 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/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java
new file mode 100644
index 000000000..daea6a7f8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Resets the passed global properties to their default values as defined by
+ * SDL
+ * <p></p>
+ * The HELPPROMPT global property default value is generated by SDL consists of
+ * the first vrCommand of each Command Menu item defined at the moment PTT is
+ * pressed
+ * <p>The TIMEOUTPROMPT global property default value is the same as the HELPPROMPT
+ * global property default value</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>properties</td>
+ * <td>GlobalProperty</td>
+ * <td>An array of one or more GlobalProperty enumeration elements indicating which global properties to reset to their default value.</td>
+ * <td>Y</td>
+ * <td>Array must have at least one element.; minsize:1; maxsize:100</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ *
+ * </table>
+ * <p><b>Response</b></p>
+ *
+ * <p>Indicates whether the Global Properties were successfully set to their default values.</p>
+ *
+ * <p><b>Non-default Result Codes:</b></p>
+ *
+ * <p> SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p> OUT_OF_MEMORY</p>
+ * <p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p> APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR </p>
+ * <p> REJECTED </p>
+ * <p>DISALLOWED </p>
+ * @since SmartDeviceLink 1.0
+ * @see SetGlobalProperties
+ */
+public class ResetGlobalProperties extends RPCRequest {
+ public static final String KEY_PROPERTIES = "properties";
+ /**
+ * Constructs a new ResetGlobalProperties object
+ */
+ public ResetGlobalProperties() {
+ super(FunctionID.RESET_GLOBAL_PROPERTIES.toString());
+ }
+ /**
+ * Constructs a new ResetGlobalProperties object indicated by the Hashtable
+ * parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public ResetGlobalProperties(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new ResetGlobalProperties object
+ * @param properties a List<GlobalProperty> An array of one or more
+ * GlobalProperty enumeration elements indicating which global
+ * properties to reset to their default value <br>
+ * <b>Notes: </b>Array must have at least one element
+ */
+ public ResetGlobalProperties(@NonNull List<GlobalProperty> properties) {
+ this();
+ setProperties(properties);
+ }
+ /**
+ * Gets an array of one or more GlobalProperty enumeration elements
+ * indicating which global properties to reset to their default value
+ *
+ * @return List<GlobalProperty> -an array of one or more GlobalProperty
+ * enumeration elements
+ */
+ @SuppressWarnings("unchecked")
+ public List<GlobalProperty> getProperties() {
+ return (List<GlobalProperty>) getObject(GlobalProperty.class, KEY_PROPERTIES);
+ }
+ /**
+ * Sets an array of one or more GlobalProperty enumeration elements
+ * indicating which global properties to reset to their default value
+ *
+ * @param properties
+ * a List<GlobalProperty> An array of one or more
+ * GlobalProperty enumeration elements indicating which global
+ * properties to reset to their default value
+ * <p></p>
+ * <b>Notes: </b>Array must have at least one element
+ */
+ public void setProperties(@NonNull List<GlobalProperty> properties ) {
+ setParameters(KEY_PROPERTIES, properties);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java
new file mode 100644
index 000000000..482b86fc4
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Reset Global Properties Response is sent, when ResetGlobalProperties has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class ResetGlobalPropertiesResponse extends RPCResponse {
+
+ /**
+ * Constructs a new ResetGlobalPropertiesResponse object
+ */
+ public ResetGlobalPropertiesResponse() {
+ super(FunctionID.RESET_GLOBAL_PROPERTIES.toString());
+ }
+
+ /**
+ * Constructs a new ResetGlobalPropertiesResponse object indicated by the Hashtable
+ * parameter
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public ResetGlobalPropertiesResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new ResetGlobalPropertiesResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public ResetGlobalPropertiesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java
new file mode 100644
index 000000000..1c6bdc241
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/** The resolution of the prescribed screen area.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>resolution</td>
+ * <td>ImageResolution</td>
+ * <td>The resolution of the prescribed screen area.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * <tr>
+ * <td>touchEventAvailable</td>
+ * <td>TouchEventCapabilities</td>
+ * <td>Types of screen touch events available in screen area.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ *
+ * </table>
+ * @since SmartDeviceLink 2.3.2
+ *
+ */
+
+public class ScreenParams extends RPCStruct {
+ public static final String KEY_RESOLUTION = "resolution";
+ public static final String KEY_TOUCH_EVENT_AVAILABLE = "touchEventAvailable";
+ /**
+ * Constructs a new ScreenParams object
+ */
+
+ public ScreenParams() { }
+ /**
+ * <p>
+ * Constructs a new ScreenParamst object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+
+ public ScreenParams(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ScreenParams object
+ */
+
+ public ScreenParams(@NonNull ImageResolution resolution) {
+ this();
+ setImageResolution(resolution);
+ }
+
+ @SuppressWarnings("unchecked")
+ public ImageResolution getImageResolution() {
+ return (ImageResolution) getObject(ImageResolution.class, KEY_RESOLUTION);
+ }
+ public void setImageResolution( @NonNull ImageResolution resolution ) {
+ setValue(KEY_RESOLUTION, resolution);
+ }
+ @SuppressWarnings("unchecked")
+ public TouchEventCapabilities getTouchEventAvailable() {
+ return (TouchEventCapabilities) getObject(TouchEventCapabilities.class, KEY_TOUCH_EVENT_AVAILABLE);
+ }
+ public void setTouchEventAvailable( TouchEventCapabilities touchEventAvailable ) {
+ setValue(KEY_TOUCH_EVENT_AVAILABLE, touchEventAvailable);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java
new file mode 100644
index 000000000..b4e212fcc
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Creates a full screen overlay containing a large block of formatted text that
+ * can be scrolled with up to 8 SoftButtons defined
+ *
+ * <p>Function Group: ScrollableMessage</p>
+ *
+ * <p><b>HMILevel needs to be FULL</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>scrollableMessageBody</td>
+ * <td>String</td>
+ * <td>Body of text that can include newlines and tabs.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDevice Link 1.0 </td>
+ * </tr>
+ * <tr>
+ * <td>timeout</td>
+ * <td>Integer</td>
+ * <td>App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout).</td>
+ * <td>N</td>
+ * <td>minvalue=1000; maxvalue=65535; defvalue=30000</td>
+ * <td>SmartDevice Link 1.0 </td>
+ * </tr>
+ * <tr>
+ * <td>softButtons</td>
+ * <td>SoftButton</td>
+ * <td>App defined SoftButtons. If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.</td>
+ * <td>N</td>
+ * <td>minsize=0; maxsize=8</td>
+ * <td>SmartDevice Link 1.0 </td>
+ * </tr>
+ * </table>
+ * <p> <b>Response</b></p>
+ *<b>Non-default Result Codes:</b>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA </p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>CHAR_LIMIT_EXCEEDED</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR </p>
+ * <p>DISALLOWED</p>
+ * <p>UNSUPPORTED_RESOURCE</p>
+ * <p>REJECTED </p>
+ * <p>ABORTED</p>
+ *
+ * @see com.smartdevicelink.proxy.rpc.SoftButton
+ */
+public class ScrollableMessage extends RPCRequest {
+ public static final String KEY_SCROLLABLE_MESSAGE_BODY = "scrollableMessageBody";
+ public static final String KEY_TIMEOUT = "timeout";
+ public static final String KEY_SOFT_BUTTONS = "softButtons";
+
+ /**
+ * Constructs a new ScrollableMessage object
+ */
+ public ScrollableMessage() {
+ super(FunctionID.SCROLLABLE_MESSAGE.toString());
+ }
+
+ /**
+ * Constructs a new ScrollableMessage object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public ScrollableMessage(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ScrollableMessage object
+ * @param scrollableMessageBody a String value representing the Body of text that can include newlines and tabs <br>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public ScrollableMessage(@NonNull String scrollableMessageBody) {
+ this();
+ setScrollableMessageBody(scrollableMessageBody);
+ }
+
+ /**
+ * Sets a Body of text that can include newlines and tabs
+ *
+ * @param scrollableMessageBody
+ * a String value representing the Body of text that can include
+ * newlines and tabs
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public void setScrollableMessageBody(@NonNull String scrollableMessageBody) {
+ setParameters(KEY_SCROLLABLE_MESSAGE_BODY, scrollableMessageBody);
+ }
+
+ /**
+ * Gets a Body of text that can include newlines and tabs
+ *
+ * @return String -a String value
+ */
+ public String getScrollableMessageBody() {
+ return getString(KEY_SCROLLABLE_MESSAGE_BODY);
+ }
+
+ /**
+ * Sets an App defined timeout. Indicates how long of a timeout from the
+ * last action
+ *
+ * @param timeout
+ * an Integer value representing an App defined timeout
+ * <p></p>
+ * <b>Notes</b>:Minval=0; Maxval=65535;Default=30000
+ */
+ public void setTimeout(Integer timeout) {
+ setParameters(KEY_TIMEOUT, timeout);
+ }
+
+ /**
+ * Gets an App defined timeout
+ *
+ * @return Integer -an Integer value representing an App defined timeout
+ */
+ public Integer getTimeout() {
+ return getInteger(KEY_TIMEOUT);
+ }
+
+ /**
+ * Sets App defined SoftButtons.If omitted on supported displays, only the
+ * system defined "Close" SoftButton will be displayed
+ *
+ * @param softButtons
+ * a List<SoftButton> value representing App defined
+ * SoftButtons
+ * <p></p>
+ * <b>Notes: </b>Minsize=0, Maxsize=8
+ */
+ public void setSoftButtons(List<SoftButton> softButtons) {
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ }
+
+ /**
+ * Gets App defined soft button
+ * @return List -List<SoftButton> value
+ */
+ @SuppressWarnings("unchecked")
+ public List<SoftButton> getSoftButtons() {
+ return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java
new file mode 100644
index 000000000..31f7518f0
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Scrollable Message Response is sent, when ScrollableMessage has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class ScrollableMessageResponse extends RPCResponse {
+
+ /**
+ * Constructs a new ScrollableMessageResponse object
+ */
+ public ScrollableMessageResponse() {
+ super(FunctionID.SCROLLABLE_MESSAGE.toString());
+ }
+
+ /**
+ * Constructs a new ScrollableMessageResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public ScrollableMessageResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new ScrollableMessageResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public ScrollableMessageResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
new file mode 100644
index 000000000..0b800ba5e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.util.Version;
+
+import java.util.Hashtable;
+
+/**
+ * Specifies the version number of the SDL V4 interface. This is used by both the application and SDL to declare what interface version each is using.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>majorVersion</td>
+ * <td>Integer</td>
+ * <td>
+ * <ul>
+ * <li>minvalue="1"</li>
+ * <li>maxvalue="10"</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>minorVersion</td>
+ * <td>Integer</td>
+ * <td>
+ * <ul>
+ * <li>minvalue="0"</li>
+ * <li>maxvalue="1000"</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ */
+public class SdlMsgVersion extends RPCStruct {
+ public static final String KEY_MAJOR_VERSION = "majorVersion";
+ public static final String KEY_MINOR_VERSION = "minorVersion";
+ public static final String KEY_PATCH_VERSION = "patchVersion";
+
+ /**
+ * Constructs a newly allocated SdlMsgVersion object
+ */
+ public SdlMsgVersion() { }
+ /**
+ * Constructs a newly allocated SdlMsgVersion object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public SdlMsgVersion(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated SdlMsgVersion object
+ * @param majorVersion minvalue="1" and maxvalue="10"
+ * @param minorVersion min: 0; max: 1000
+ */
+ public SdlMsgVersion(@NonNull Integer majorVersion, @NonNull Integer minorVersion) {
+ this();
+ setMajorVersion(majorVersion);
+ setMinorVersion(minorVersion);
+
+ }
+ /**
+ * Constructs a newly allocated SdlMsgVersion object
+ * @param version Creates a new RPC struct SdlMsgVersion based on the utility class
+ */
+ public SdlMsgVersion(@NonNull Version version) {
+ this();
+ setMajorVersion(version.getMajor());
+ setMinorVersion(version.getMinor());
+ setPatchVersion(version.getPatch());
+
+ }
+
+ @Override
+ public void format(com.smartdevicelink.util.Version rpcVersion, boolean formatParams) {
+ if(getPatchVersion() == null){
+ setPatchVersion(0);
+ }
+ super.format(rpcVersion,formatParams);
+ }
+
+ /**
+ * Get major version
+ * <ul>
+ * <li>minvalue="1"</li>
+ * <li>maxvalue="10"</li>
+ * </ul>
+ * @return the major version
+ */
+ public Integer getMajorVersion() {
+ return getInteger( KEY_MAJOR_VERSION );
+ }
+ /**
+ * Set major version
+ * <ul>
+ * <li>minvalue="1"</li>
+ * <li>maxvalue="10"</li>
+ * </ul>
+ * @param majorVersion minvalue="1" and maxvalue="10"
+ */
+ public void setMajorVersion( @NonNull Integer majorVersion ) {
+ setValue(KEY_MAJOR_VERSION, majorVersion);
+ }
+ /**
+ * Get minor version
+ * <ul>
+ * <li>minvalue="0"</li>
+ * <li>maxvalue="1000"</li>
+ * </ul>
+ * @return the minor version
+ */
+ public Integer getMinorVersion() {
+ return getInteger( KEY_MINOR_VERSION );
+ }
+ /**
+ * Set minor version
+ * <ul>
+ * <li>minvalue="0"</li>
+ * <li>maxvalue="1000"</li>
+ * </ul>
+ * @param minorVersion min: 0; max: 1000
+ */
+ public void setMinorVersion( @NonNull Integer minorVersion ) {
+ setValue(KEY_MINOR_VERSION, minorVersion);
+ }
+
+ /**
+ * Get patch version
+ * <ul>
+ * <li>minvalue="0"</li>
+ * <li>maxvalue="1000"</li>
+ * </ul>
+ * @return the patch version
+ */
+ public Integer getPatchVersion() {
+ return getInteger( KEY_PATCH_VERSION );
+ }
+ /**
+ * Set patch version
+ * <ul>
+ * <li>minvalue="0"</li>
+ * <li>maxvalue="1000"</li>
+ * </ul>
+ * @param patchVersion min: 0; max: 1000
+ */
+ public void setPatchVersion( Integer patchVersion ) {
+ setValue(KEY_PATCH_VERSION, patchVersion);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java
new file mode 100644
index 000000000..3c875d0d1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java
@@ -0,0 +1,370 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class SeatControlCapabilities extends RPCStruct {
+ public static final String KEY_MODULE_NAME = "moduleName";
+ public static final String KEY_HEATING_ENABLED_AVAILABLE = "heatingEnabledAvailable";
+ public static final String KEY_COOLING_ENABLED_AVAILABLE = "coolingEnabledAvailable";
+ public static final String KEY_HEATING_LEVEL_AVAILABLE = "heatingLevelAvailable";
+ public static final String KEY_COOLING_LEVEL_AVAILABLE = "coolingLevelAvailable";
+ public static final String KEY_HORIZONTAL_POSITION_AVAILABLE = "horizontalPositionAvailable";
+ public static final String KEY_VERTICAL_POSITION_AVAILABLE = "verticalPositionAvailable";
+ public static final String KEY_FRONT_VERTICAL_POSITION_AVAILABLE = "frontVerticalPositionAvailable";
+ public static final String KEY_BACK_VERTICAL_POSITION_AVAILABLE = "backVerticalPositionAvailable";
+ public static final String KEY_BACK_TILT_ANGLE_AVAILABLE = "backTiltAngleAvailable";
+ public static final String KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE = "headSupportHorizontalPositionAvailable";
+ public static final String KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE = "headSupportVerticalPositionAvailable";
+ public static final String KEY_MASSAGE_ENABLED_AVAILABLE = "massageEnabledAvailable";
+ public static final String KEY_MASSAGE_MODE_AVAILABLE = "massageModeAvailable";
+ public static final String KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE = "massageCushionFirmnessAvailable";
+ public static final String KEY_MEMORY_AVAILABLE = "memoryAvailable";
+
+ /**
+ * Constructs a new SeatControlCapabilities object
+ */
+ public SeatControlCapabilities() {
+ }
+
+ /**
+ * <p>Constructs a new SeatControlCapabilities object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public SeatControlCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated SeatControlCapabilities object
+ * @param moduleName short friendly name of the light control module.
+ */
+ public SeatControlCapabilities(@NonNull String moduleName) {
+ this();
+ setModuleName(moduleName);
+ }
+
+ /**
+ * Get the moduleName portion of the SeatControlCapabilities class
+ *
+ * @return String
+ */
+ public String getModuleName() {
+ return getString(KEY_MODULE_NAME);
+ }
+
+ /**
+ * Sets the moduleName portion of the SeatControlCapabilities 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);
+ }
+
+ /**
+ * Sets the heatingEnabledAvailable portion of the SeatControlCapabilities class
+ *
+ * @param heatingEnabledAvailable
+ */
+ public void setHeatingEnabledAvailable(Boolean heatingEnabledAvailable) {
+ setValue(KEY_HEATING_ENABLED_AVAILABLE, heatingEnabledAvailable);
+ }
+
+ /**
+ * Gets the heatingEnabledAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getHeatingEnabledAvailable() {
+ return getBoolean(KEY_HEATING_ENABLED_AVAILABLE);
+ }
+
+ /**
+ * Sets the coolingEnabledAvailable portion of the SeatControlCapabilities class
+ *
+ * @param coolingEnabledAvailable
+ */
+ public void setCoolingEnabledAvailable(Boolean coolingEnabledAvailable) {
+ setValue(KEY_COOLING_ENABLED_AVAILABLE, coolingEnabledAvailable);
+ }
+
+ /**
+ * Gets the coolingEnabledAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getCoolingEnabledAvailable() {
+ return getBoolean(KEY_COOLING_ENABLED_AVAILABLE);
+ }
+
+ /**
+ * Sets the heatingLevelAvailable portion of the SeatControlCapabilities class
+ *
+ * @param heatingLevelAvailable
+ */
+ public void setHeatingLevelAvailable(Boolean heatingLevelAvailable) {
+ setValue(KEY_HEATING_LEVEL_AVAILABLE, heatingLevelAvailable);
+ }
+
+ /**
+ * Gets the heatingLevelAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getHeatingLevelAvailable() {
+ return getBoolean(KEY_HEATING_LEVEL_AVAILABLE);
+ }
+
+ /**
+ * Sets the coolingLevelAvailable portion of the SeatControlCapabilities class
+ *
+ * @param coolingLevelAvailable
+ */
+ public void setCoolingLevelAvailable(Boolean coolingLevelAvailable) {
+ setValue(KEY_COOLING_LEVEL_AVAILABLE, coolingLevelAvailable);
+ }
+
+ /**
+ * Gets the coolingLevelAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getCoolingLevelAvailable() {
+ return getBoolean(KEY_COOLING_LEVEL_AVAILABLE);
+ }
+
+ /**
+ * Sets the horizontalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @param horizontalPositionAvailable
+ */
+ public void setHorizontalPositionAvailable(Boolean horizontalPositionAvailable) {
+ setValue(KEY_HORIZONTAL_POSITION_AVAILABLE, horizontalPositionAvailable);
+ }
+
+ /**
+ * Gets the horizontalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getHorizontalPositionAvailable() {
+ return getBoolean(KEY_HORIZONTAL_POSITION_AVAILABLE);
+ }
+
+ /**
+ * Sets the verticalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @param verticalPositionAvailable
+ */
+ public void setVerticalPositionAvailable(Boolean verticalPositionAvailable) {
+ setValue(KEY_VERTICAL_POSITION_AVAILABLE, verticalPositionAvailable);
+ }
+
+ /**
+ * Gets the verticalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getVerticalPositionAvailable() {
+ return getBoolean(KEY_VERTICAL_POSITION_AVAILABLE);
+ }
+
+ /**
+ * Sets the frontVerticalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @param frontVerticalPositionAvailable
+ */
+ public void setFrontVerticalPositionAvailable(Boolean frontVerticalPositionAvailable) {
+ setValue(KEY_FRONT_VERTICAL_POSITION_AVAILABLE, frontVerticalPositionAvailable);
+ }
+
+ /**
+ * Gets the frontVerticalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getFrontVerticalPositionAvailable() {
+ return getBoolean(KEY_FRONT_VERTICAL_POSITION_AVAILABLE);
+ }
+
+ /**
+ * Sets the backVerticalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @param backVerticalPositionAvailable
+ */
+ public void setBackVerticalPositionAvailable(Boolean backVerticalPositionAvailable) {
+ setValue(KEY_BACK_VERTICAL_POSITION_AVAILABLE, backVerticalPositionAvailable);
+ }
+
+ /**
+ * Gets the backVerticalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getBackVerticalPositionAvailable() {
+ return getBoolean(KEY_BACK_VERTICAL_POSITION_AVAILABLE);
+ }
+
+ /**
+ * Sets the backTiltAngleAvailable portion of the SeatControlCapabilities class
+ *
+ * @param backTiltAngleAvailable
+ */
+ public void setBackTiltAngleAvailable(Boolean backTiltAngleAvailable) {
+ setValue(KEY_BACK_TILT_ANGLE_AVAILABLE, backTiltAngleAvailable);
+ }
+
+ /**
+ * Gets the backTiltAngleAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getBackTiltAngleAvailable() {
+ return getBoolean(KEY_BACK_TILT_ANGLE_AVAILABLE);
+ }
+
+ /**
+ * Sets the headSupportHorizontalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @param headSupportHorizontalPositionAvailable
+ */
+ public void setHeadSupportHorizontalPositionAvailable(Boolean headSupportHorizontalPositionAvailable) {
+ setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE, headSupportHorizontalPositionAvailable);
+ }
+
+ /**
+ * Gets the headSupportHorizontalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getHeadSupportHorizontalPositionAvailable() {
+ return getBoolean(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE);
+ }
+
+ /**
+ * Sets the headSupportVerticalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @param headSupportVerticalPositionAvailable
+ */
+ public void setHeadSupportVerticalPositionAvailable(Boolean headSupportVerticalPositionAvailable) {
+ setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE, headSupportVerticalPositionAvailable);
+ }
+
+ /**
+ * Gets the headSupportVerticalPositionAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getHeadSupportVerticalPositionAvailable() {
+ return getBoolean(KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE);
+ }
+
+ /**
+ * Sets the massageEnabledAvailable portion of the SeatControlCapabilities class
+ *
+ * @param massageEnabledAvailable
+ */
+ public void setMassageEnabledAvailable(Boolean massageEnabledAvailable) {
+ setValue(KEY_MASSAGE_ENABLED_AVAILABLE, massageEnabledAvailable);
+ }
+
+ /**
+ * Gets the massageEnabledAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getMassageEnabledAvailable() {
+ return getBoolean(KEY_MASSAGE_ENABLED_AVAILABLE);
+ }
+
+ /**
+ * Sets the massageModeAvailable portion of the SeatControlCapabilities class
+ *
+ * @param massageModeAvailable
+ */
+ public void setMassageModeAvailable(Boolean massageModeAvailable) {
+ setValue(KEY_MASSAGE_MODE_AVAILABLE, massageModeAvailable);
+ }
+
+ /**
+ * Gets the massageModeAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getMassageModeAvailable() {
+ return getBoolean(KEY_MASSAGE_MODE_AVAILABLE);
+ }
+
+ /**
+ * Sets the massageCushionFirmnessAvailable portion of the SeatControlCapabilities class
+ *
+ * @param massageCushionFirmnessAvailable
+ */
+ public void setMassageCushionFirmnessAvailable(Boolean massageCushionFirmnessAvailable) {
+ setValue(KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE, massageCushionFirmnessAvailable);
+ }
+
+ /**
+ * Gets the massageCushionFirmnessAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getMassageCushionFirmnessAvailable() {
+ return getBoolean(KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE);
+ }
+
+ /**
+ * Sets the memoryAvailable portion of the SeatControlCapabilities class
+ *
+ * @param memoryAvailable
+ */
+ public void setMemoryAvailable(Boolean memoryAvailable) {
+ setValue(KEY_MEMORY_AVAILABLE, memoryAvailable);
+ }
+
+ /**
+ * Gets the memoryAvailable portion of the SeatControlCapabilities class
+ *
+ * @return Boolean.
+ */
+ public Boolean getMemoryAvailable() {
+ return getBoolean(KEY_MEMORY_AVAILABLE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java
new file mode 100644
index 000000000..e63b09105
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java
@@ -0,0 +1,378 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.SupportedSeat;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Seat control data corresponds to "SEAT" ModuleType.
+ */
+public class SeatControlData extends RPCStruct {
+ public static final String KEY_ID = "id";
+ public static final String KEY_HEATING_ENABLED = "heatingEnabled";
+ public static final String KEY_COOLING_ENABLED = "coolingEnabled";
+ public static final String KEY_HEATING_LEVEL = "heatingLevel";
+ public static final String KEY_COOLING_LEVEL = "coolingLevel";
+ public static final String KEY_HORIZONTAL_POSITION = "horizontalPosition";
+ public static final String KEY_VERTICAL_POSITION = "verticalPosition";
+ public static final String KEY_FRONT_VERTICAL_POSITION = "frontVerticalPosition";
+ public static final String KEY_BACK_VERTICAL_POSITION = "backVerticalPosition";
+ public static final String KEY_BACK_TILT_ANGLE = "backTiltAngle";
+ public static final String KEY_HEAD_SUPPORT_HORIZONTAL_POSITION = "headSupportHorizontalPosition";
+ public static final String KEY_HEAD_SUPPORT_VERTICAL_POSITION = "headSupportVerticalPosition";
+ public static final String KEY_MASSAGE_ENABLED = "massageEnabled";
+ public static final String KEY_MASSAGE_MODE = "massageMode";
+ public static final String KEY_MASSAGE_CUSHION_FIRMNESS = "massageCushionFirmness";
+ public static final String KEY_MEMORY = "memory";
+
+ /**
+ * Constructs a new SeatControlData object
+ */
+ public SeatControlData() {
+ }
+
+ /**
+ * <p>Constructs a new SeatControlData object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public SeatControlData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated SeatControlData object
+ * @param id type of SupportedSeat.
+ */
+ public SeatControlData(@NonNull SupportedSeat id) {
+ this();
+ setId(id);
+ }
+
+ /**
+ * Sets the id portion of the SeatControlData class
+ *
+ * @param id
+ */
+ public void setId(@NonNull SupportedSeat id) {
+ setValue(KEY_ID, id);
+ }
+
+ /**
+ * Gets the id portion of the SeatControlData class
+ *
+ * @return SupportedSeat.
+ */
+ public SupportedSeat getId() {
+ return (SupportedSeat) getObject(SupportedSeat.class, KEY_ID);
+ }
+
+ /**
+ * Sets the heatingEnabled portion of the SeatControlData class
+ *
+ * @param heatingEnabled
+ */
+ public void setHeatingEnabled(Boolean heatingEnabled) {
+ setValue(KEY_HEATING_ENABLED, heatingEnabled);
+ }
+
+ /**
+ * Gets the heatingEnabled portion of the SeatControlData class
+ *
+ * @return Boolean.
+ */
+ public Boolean getHeatingEnabled() {
+ return getBoolean(KEY_HEATING_ENABLED);
+ }
+
+ /**
+ * Sets the coolingEnabled portion of the SeatControlData class
+ *
+ * @param coolingEnabled
+ */
+ public void setCoolingEnabled(Boolean coolingEnabled) {
+ setValue(KEY_COOLING_ENABLED, coolingEnabled);
+ }
+
+ /**
+ * Gets the coolingEnabled portion of the SeatControlData class
+ *
+ * @return Boolean.
+ */
+ public Boolean getCoolingEnabled() {
+ return getBoolean(KEY_COOLING_ENABLED);
+ }
+
+ /**
+ * Sets the heatingLevel portion of the SeatControlData class
+ *
+ * @param heatingLevel
+ */
+ public void setHeatingLevel(Integer heatingLevel) {
+ setValue(KEY_HEATING_LEVEL, heatingLevel);
+ }
+
+ /**
+ * Gets the heatingLevel portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getHeatingLevel() {
+ return getInteger(KEY_HEATING_LEVEL);
+ }
+
+ /**
+ * Sets the coolingLevel portion of the SeatControlData class
+ *
+ * @param coolingLevel
+ */
+ public void setCoolingLevel(Integer coolingLevel) {
+ setValue(KEY_COOLING_LEVEL, coolingLevel);
+ }
+
+ /**
+ * Gets the coolingLevel portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getCoolingLevel() {
+ return getInteger(KEY_COOLING_LEVEL);
+ }
+
+ /**
+ * Sets the horizontalPosition portion of the SeatControlData class
+ *
+ * @param horizontalPosition
+ */
+ public void setHorizontalPosition(Integer horizontalPosition) {
+ setValue(KEY_HORIZONTAL_POSITION, horizontalPosition);
+ }
+
+ /**
+ * Gets the horizontalPosition portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getHorizontalPosition() {
+ return getInteger(KEY_HORIZONTAL_POSITION);
+ }
+
+ /**
+ * Sets the verticalPosition portion of the SeatControlData class
+ *
+ * @param verticalPosition
+ */
+ public void setVerticalPosition(Integer verticalPosition) {
+ setValue(KEY_VERTICAL_POSITION, verticalPosition);
+ }
+
+ /**
+ * Gets the verticalPosition portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getVerticalPosition() {
+ return getInteger(KEY_VERTICAL_POSITION);
+ }
+
+ /**
+ * Sets the frontVerticalPosition portion of the SeatControlData class
+ *
+ * @param frontVerticalPosition
+ */
+ public void setFrontVerticalPosition(Integer frontVerticalPosition) {
+ setValue(KEY_FRONT_VERTICAL_POSITION, frontVerticalPosition);
+ }
+
+ /**
+ * Gets the frontVerticalPosition portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getFrontVerticalPosition() {
+ return getInteger(KEY_FRONT_VERTICAL_POSITION);
+ }
+
+ /**
+ * Sets the backVerticalPosition portion of the SeatControlData class
+ *
+ * @param backVerticalPosition
+ */
+ public void setBackVerticalPosition(Integer backVerticalPosition) {
+ setValue(KEY_BACK_VERTICAL_POSITION, backVerticalPosition);
+ }
+
+ /**
+ * Gets the backVerticalPosition portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getBackVerticalPosition() {
+ return getInteger(KEY_BACK_VERTICAL_POSITION);
+ }
+
+ /**
+ * Sets the backTiltAngle portion of the SeatControlData class
+ *
+ * @param backTiltAngle
+ */
+ public void setBackTiltAngle(Integer backTiltAngle) {
+ setValue(KEY_BACK_TILT_ANGLE, backTiltAngle);
+ }
+
+ /**
+ * Gets the backTiltAngle portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getBackTiltAngle() {
+ return getInteger(KEY_BACK_TILT_ANGLE);
+ }
+
+ /**
+ * Sets the headSupportHorizontalPosition portion of the SeatControlData class
+ *
+ * @param headSupportHorizontalPosition
+ */
+ public void setHeadSupportHorizontalPosition(Integer headSupportHorizontalPosition) {
+ setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION, headSupportHorizontalPosition);
+ }
+
+ /**
+ * Gets the headSupportHorizontalPosition portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getHeadSupportHorizontalPosition() {
+ return getInteger(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION);
+ }
+
+ /**
+ * Sets the headSupportVerticalPosition portion of the SeatControlData class
+ *
+ * @param headSupportVerticalPosition
+ */
+ public void setHeadSupportVerticalPosition(Integer headSupportVerticalPosition) {
+ setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION, headSupportVerticalPosition);
+ }
+
+ /**
+ * Gets the headSupportVerticalPosition portion of the SeatControlData class
+ *
+ * @return Integer
+ */
+ public Integer getHeadSupportVerticalPosition() {
+ return getInteger(KEY_HEAD_SUPPORT_VERTICAL_POSITION);
+ }
+
+ /**
+ * Sets the massageEnabled portion of the SeatControlData class
+ *
+ * @param massageEnabled
+ */
+ public void setMassageEnabled(Boolean massageEnabled) {
+ setValue(KEY_MASSAGE_ENABLED, massageEnabled);
+ }
+
+ /**
+ * Gets the massageEnabled portion of the SeatControlData class
+ *
+ * @return Boolean.
+ */
+ public Boolean getMassageEnabled() {
+ return getBoolean(KEY_MASSAGE_ENABLED);
+ }
+
+ /**
+ * Gets the List<MassageModeData> portion of the SeatControlData class
+ *
+ * @return List<MassageModeData>.
+ */
+ @SuppressWarnings("unchecked")
+ public List<MassageModeData> getMassageMode() {
+ return (List<MassageModeData>) getObject(MassageModeData.class, KEY_MASSAGE_MODE);
+ }
+
+ /**
+ * Sets the massageMode portion of the SeatControlData class
+ *
+ * @param massageMode
+ */
+ public void setMassageMode(List<MassageModeData> massageMode) {
+ setValue(KEY_MASSAGE_MODE, massageMode);
+ }
+
+ /**
+ * Gets the List<MassageCushionFirmness> portion of the SeatControlData class
+ *
+ * @return List<MassageCushionFirmness>.
+ */
+ @SuppressWarnings("unchecked")
+ public List<MassageCushionFirmness> getMassageCushionFirmness() {
+ return (List<MassageCushionFirmness>) getObject(MassageCushionFirmness.class, KEY_MASSAGE_CUSHION_FIRMNESS);
+ }
+
+ /**
+ * Sets the massageCushionFirmness portion of the SeatControlData class
+ *
+ * @param massageCushionFirmness
+ */
+ public void setMassageCushionFirmness(List<MassageCushionFirmness> massageCushionFirmness) {
+ setValue(KEY_MASSAGE_CUSHION_FIRMNESS, massageCushionFirmness);
+ }
+
+ /**
+ * Sets the memory portion of the SeatControlData class
+ *
+ * @param memory
+ */
+ public void setMemory(SeatMemoryAction memory) {
+ setValue(KEY_MEMORY, memory);
+ }
+
+ /**
+ * Gets the memory portion of the SeatControlData class
+ *
+ * @return SeatMemoryAction.
+ */
+ @SuppressWarnings("unchecked")
+ public SeatMemoryAction getMemory() {
+ return (SeatMemoryAction) getObject(SeatMemoryAction.class, KEY_MEMORY);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java
new file mode 100644
index 000000000..bdd4f850e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType;
+
+import java.util.Hashtable;
+
+public class SeatMemoryAction extends RPCStruct {
+ public static final String KEY_ID = "id";
+ public static final String KEY_LABEL = "label";
+ public static final String KEY_ACTION = "action";
+
+ /**
+ * Constructs a new SeatMemoryAction object
+ */
+ public SeatMemoryAction() {
+ }
+
+ /**
+ * <p>Constructs a new SeatMemoryAction object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public SeatMemoryAction(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated SeatMemoryAction object
+ * @param id Min: 0 Max: 10
+ * @param action type of SeatMemoryActionType.
+ */
+ public SeatMemoryAction(@NonNull Integer id, @NonNull SeatMemoryActionType action) {
+ this();
+ setId(id);
+ setAction(action);
+ }
+
+ /**
+ * Sets the id portion of the SeatMemoryAction class
+ *
+ * @param id
+ */
+ public void setId(@NonNull Integer id) {
+ setValue(KEY_ID, id);
+ }
+
+ /**
+ * Gets the id portion of the SeatMemoryAction class
+ *
+ * @return Integer
+ */
+ public Integer getId() {
+ return getInteger(KEY_ID);
+ }
+
+ /**
+ * Sets the label portion of the SeatMemoryAction class
+ *
+ * @param label
+ */
+ public void setLabel(String label) {
+ setValue(KEY_LABEL, label);
+ }
+
+ /**
+ * Gets the label portion of the SeatMemoryAction class
+ *
+ * @return String
+ */
+ public String getLabel() {
+ return getString(KEY_LABEL);
+ }
+
+ /**
+ * Sets the action portion of the SeatMemoryAction class
+ *
+ * @param action
+ */
+ public void setAction(@NonNull SeatMemoryActionType action) {
+ setValue(KEY_ACTION, action);
+ }
+
+ /**
+ * Gets the action portion of the SeatMemoryAction class
+ *
+ * @return SeatMemoryActionType.
+ */
+ public SeatMemoryActionType getAction() {
+ return (SeatMemoryActionType) getObject(SeatMemoryActionType.class, KEY_ACTION);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java
new file mode 100644
index 000000000..6cee332f1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java
@@ -0,0 +1,87 @@
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/*
+ * Copyright (c) 2017 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * Request to describe UI elements boundaries to a connected modules.
+ * @since SmartDeviceLink 4.5.0
+ */
+public class SendHapticData extends RPCRequest {
+
+ public static final String KEY_HAPTIC_RECT_DATA = "hapticRectData";
+
+ /**
+ * Constructs a new SendHapticData object
+ */
+ public SendHapticData(){
+ super(FunctionID.SEND_HAPTIC_DATA.toString());
+ }
+
+ /**
+ * <p>
+ * Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI.
+ * This data will be utilized by the HMI to determine how and when haptic events should occur
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public SendHapticData(Hashtable<String, Object> hash){
+ super(hash);
+ }
+
+ /**
+ * Array of spatial data structures that represent the locations of all user controls present on the app's layout.
+ * This data should be updated if/when the application presents a new screen.
+ * When a request is sent, if successful, it will replace all spatial data previously sent through RPC.
+ * If an empty array is sent, the existing spatial data will be cleared
+ */
+ public void setHapticRectData(List<HapticRect> hapticRectData) {
+ setParameters(KEY_HAPTIC_RECT_DATA, hapticRectData);
+ }
+
+ /**
+ * Get the haptic data
+ * @return array of spatial data structures that represent the locations of all user controls present on the app's layout.
+ */
+ @SuppressWarnings("unchecked")
+ public List<HapticRect> getHapticRectData() {
+ return (List<HapticRect>) getObject(HapticRect.class, KEY_HAPTIC_RECT_DATA);
+ }
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java
index 58761a4a5..58761a4a5 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticDataResponse.java
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java
new file mode 100644
index 000000000..87fa67bb6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.DeliveryMode;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import java.util.Hashtable;
+import java.util.List;
+
+
+/**
+ * Sends a location to the head-unit to display on a map or list.
+ *
+ * @since SmartDeviceLink 3.0
+ *
+ */
+public class SendLocation extends RPCRequest{
+
+ public static final String KEY_LAT_DEGREES = "latitudeDegrees";
+ public static final String KEY_LON_DEGREES = "longitudeDegrees";
+ public static final String KEY_LOCATION_NAME = "locationName";
+ public static final String KEY_LOCATION_DESCRIPTION = "locationDescription";
+ public static final String KEY_PHONE_NUMBER = "phoneNumber";
+ public static final String KEY_ADDRESS_LINES = "addressLines";
+ public static final String KEY_LOCATION_IMAGE = "locationImage";
+ public static final String KEY_DELIVERY_MODE = "deliveryMode";
+ public static final String KEY_TIME_STAMP = "timeStamp";
+ public static final String KEY_ADDRESS = "address";
+
+ /**
+ * Constructs a new SendLocation object
+ */
+ public SendLocation(){
+ super(FunctionID.SEND_LOCATION.toString());
+ }
+
+ /**
+ * <p>
+ * Constructs a new SendLocation object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SendLocation(Hashtable<String, Object> hash){
+ super(hash);
+ }
+
+ /**
+ * Getter for longitude of the location to send.
+ *
+ * <p><b>IMPORTANT NOTE:</b> </p><p>A previous version of this method call returned a Float
+ * value, however, it has been changed to return a Double.</p> This will compile,
+ * but cause a ClassCastException if your value is not also a Double type.
+ * @since SmartDeviceLink v4.0
+ *
+ * @return The longitude of the location
+ */
+ public Double getLongitudeDegrees(){
+ Object value = getParameters(KEY_LON_DEGREES);
+ return SdlDataTypeConverter.objectToDouble(value);
+ }
+
+ /**
+ * Setter for longitude of the location to send.
+ * @param longitudeDegrees degrees of the longitudinal position
+ */
+ public void setLongitudeDegrees(Double longitudeDegrees){
+ setParameters(KEY_LON_DEGREES, longitudeDegrees);
+ }
+
+ /**
+ * Getter for latitude of the location to send.
+ *
+ * <p><b>IMPORTANT NOTE:</b> </p><p>A previous version of this method call returned a Float
+ * value, however, it has been changed to return a Double.</p> This will compile,
+ * but cause a ClassCastException if your value is not also a Double type.
+ * @since SmartDeviceLink v4.0
+ *
+ * @return The latitude of the location
+ */
+ public Double getLatitudeDegrees(){
+ Object value = getParameters(KEY_LAT_DEGREES);
+ return SdlDataTypeConverter.objectToDouble(value);
+ }
+
+ /**
+ * Setter for latitude of the location to send.
+ * @param latitudeDegrees degrees of the latitudinal position
+ */
+ public void setLatitudeDegrees(Double latitudeDegrees){
+ setParameters(KEY_LAT_DEGREES, latitudeDegrees);
+ }
+
+ /**
+ * Getter for name of the location to send.
+ * @return The name of the location
+ */
+ public String getLocationName(){
+ return getString(KEY_LOCATION_NAME);
+ }
+
+ /**
+ * Setter for name of the location to send.
+ * @param locationName The name of the location
+ */
+ public void setLocationName(String locationName){
+ setParameters(KEY_LOCATION_NAME, locationName);
+ }
+
+ /**
+ * Getter for description of the location to send.
+ * @return The description of the location to send
+ */
+ public String getLocationDescription(){
+ return getString(KEY_LOCATION_DESCRIPTION);
+ }
+
+ /**
+ * Setter for description of the location to send.
+ * @param locationDescription The description of the location
+ */
+ public void setLocationDescription(String locationDescription){
+ setParameters(KEY_LOCATION_DESCRIPTION, locationDescription);
+ }
+
+ /**
+ * Getter for phone number of the location to send.
+ * @return
+ */
+ public String getPhoneNumber(){
+ return getString(KEY_PHONE_NUMBER);
+ }
+
+ /**
+ * Setter for phone number of the location to send.
+ * @param phoneNumber The phone number of the location
+ */
+ public void setPhoneNumber(String phoneNumber){
+ setParameters(KEY_PHONE_NUMBER, phoneNumber);
+ }
+
+ /**
+ * Getter for address lines of the location to send.
+ * @return The address lines of the location
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getAddressLines(){
+ return (List<String>) getObject(String.class, KEY_ADDRESS_LINES);
+ }
+
+ /**
+ * Setter for address lines of the location to send.
+ * @param addressLines The address lines of the location
+ */
+ public void setAddressLines(List<String> addressLines){
+ setParameters(KEY_ADDRESS_LINES, addressLines);
+ }
+
+ /**
+ * Getter for image of the location to send.
+ * @return The image of the location to send
+ */
+ @SuppressWarnings("unchecked")
+ public Image getLocationImage(){
+ return (Image) getObject(Image.class, KEY_LOCATION_IMAGE);
+ }
+
+ /**
+ * Setter for image of the location to send.
+ * @param locationImage The image of the location to send
+ */
+ public void setLocationImage(Image locationImage){
+ setParameters(KEY_LOCATION_IMAGE, locationImage);
+ }
+
+ public DeliveryMode getDeliveryMode() {
+ return (DeliveryMode) getObject(DeliveryMode.class, KEY_DELIVERY_MODE);
+ }
+
+ public void setDeliveryMode(DeliveryMode deliveryMode) {
+ setParameters(KEY_DELIVERY_MODE, deliveryMode);
+ }
+
+ @SuppressWarnings("unchecked")
+ public DateTime getTimeStamp() {
+ return (DateTime) getObject(DateTime.class, KEY_TIME_STAMP);
+ }
+
+ public void setTimeStamp(DateTime timeStamp) {
+ setParameters(KEY_TIME_STAMP, timeStamp);
+ }
+
+ @SuppressWarnings("unchecked")
+ public OasisAddress getAddress() {
+ return (OasisAddress) getObject(OasisAddress.class, KEY_ADDRESS);
+ }
+
+ public void setAddress(OasisAddress address) {
+ setParameters(KEY_ADDRESS, address);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java
new file mode 100644
index 000000000..f5e971533
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Add SendLocation Response is sent, when SendLocation has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class SendLocationResponse extends RPCResponse{
+
+ public SendLocationResponse(){
+ super(FunctionID.SEND_LOCATION.toString());
+ }
+
+ public SendLocationResponse(Hashtable<String, Object> hash){
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SendLocationResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SendLocationResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java
new file mode 100644
index 000000000..85ec49ab6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Used to set existing local file on SDL as the app's icon. Not supported on
+ * first generation SDL vehicles
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>SDLFileName</td>
+ * <td>String</td>
+ * <td>File reference name.</td>
+ * <td>Y</td>
+ * <td>Maxlength=500</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * </table>
+ *
+ *<p><b>Response </b></p>
+ *<p><b> Non-default Result Codes: </b></p>
+ *<p>SUCCESS</p>
+ * <p> INVALID_DATA</p>
+ * <p> OUT_OF_MEMORY</p>
+ * <p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p> APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR</p>
+ * <p> REJECTED</p>
+ *
+ * @since SmartDeviceLink 2.0
+ * @see Image
+ */
+public class SetAppIcon extends RPCRequest {
+ public static final String KEY_SDL_FILE_NAME = "syncFileName";
+
+ /**
+ * Constructs a new SetAppIcon object
+ */
+ public SetAppIcon() {
+ super(FunctionID.SET_APP_ICON.toString());
+ }
+
+ /**
+ * Constructs a new SetAppIcon object indicated by the Hashtable parameter
+ * <p></p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public SetAppIcon(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SetAppIcon object
+ * @param sdlFileName a String value representing a file reference name <br>
+ * <b>Notes: </b>Maxlength=500, however the max file name length may vary based on remote filesystem limitations
+ */
+ public SetAppIcon(@NonNull String sdlFileName) {
+ this();
+ setSdlFileName(sdlFileName);
+ }
+
+ /**
+ * Sets a file reference name
+ *
+ * @param sdlFileName
+ * a String value representing a file reference name
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500, however the max file name length may vary based on remote filesystem limitations
+ */
+ public void setSdlFileName(@NonNull String sdlFileName) {
+ setParameters(KEY_SDL_FILE_NAME, sdlFileName);
+ }
+
+ /**
+ * Gets a file reference name
+ * @return String -a String value
+ */
+ public String getSdlFileName() {
+ return getString(KEY_SDL_FILE_NAME);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java
new file mode 100644
index 000000000..1da9099dc
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Set App Icon Response is sent, when SetAppIcon has been called.
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class SetAppIconResponse extends RPCResponse {
+ /**
+ * Constructs a new SetAppIconResponse object
+ */
+
+ public SetAppIconResponse() {
+ super(FunctionID.SET_APP_ICON.toString());
+ }
+ /**
+ * Constructs a new SetAppIconResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+
+ public SetAppIconResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ResetGlobalPropertiesResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SetAppIconResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java
new file mode 100644
index 000000000..204c42518
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+public class SetCloudAppProperties extends RPCRequest {
+
+ public static final String KEY_PROPERTIES = "properties";
+
+ public SetCloudAppProperties(){
+ super(FunctionID.SET_CLOUD_APP_PROPERTIES.toString());
+ }
+
+ public SetCloudAppProperties(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public SetCloudAppProperties(@NonNull CloudAppProperties cloudAppProperties){
+ this();
+ setParameters(KEY_PROPERTIES, cloudAppProperties);
+ }
+
+ public void setProperties(@NonNull CloudAppProperties cloudAppProperties){
+ setParameters(KEY_PROPERTIES, cloudAppProperties);
+ }
+
+ public CloudAppProperties getProperties(){
+ return (CloudAppProperties) getObject(CloudAppProperties.class, KEY_PROPERTIES);
+ }
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppPropertiesResponse.java
new file mode 100644
index 000000000..310bfbd43
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppPropertiesResponse.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class SetCloudAppPropertiesResponse extends RPCResponse {
+
+ public SetCloudAppPropertiesResponse(){
+ super(FunctionID.SET_CLOUD_APP_PROPERTIES.toString());
+ }
+
+ public SetCloudAppPropertiesResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SetCloudAppPropertiesResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SetCloudAppPropertiesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java
new file mode 100644
index 000000000..18550c1ce
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Used to set an alternate display layout. If not sent, default screen for
+ * given platform will be shown
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>displayLayout</td>
+ * <td>string</td>
+ * <td>Predefined or dynamically created screen layout.<p>Currently only predefined screen layouts are defined.</p> Predefined layouts include: "ONSCREEN_PRESETS" Custom screen containing app-defined onscreen presets. </td>
+ * <td>Y</td>
+ * <td>maxlength: 500</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>dayColorScheme</td>
+ * <td>TemplateColorScheme</td>
+ * <td>The color scheme that is used for day.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>nightColorScheme</td>
+ * <td>TemplateColorScheme</td>
+ * <td>The color scheme that is used for night.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ *
+ * </table>
+ *<p><b>Response </b></p>
+ *
+ *<p><b> Non-default Result Codes: </b></p>
+ *<p> SUCCESS </p>
+ *<p> INVALID_DATA</p>
+ *<p> OUT_OF_MEMORY</p>
+ *<p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p> APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR</p>
+ * <p> REJECTED</p>
+ * @since SmartDeviceLink 2.0
+ */
+public class SetDisplayLayout extends RPCRequest {
+ public static final String KEY_DISPLAY_LAYOUT = "displayLayout";
+ public static final String KEY_DAY_COLOR_SCHEME = "dayColorScheme";
+ public static final String KEY_NIGHT_COLOR_SCHEME = "nightColorScheme";
+ /**
+ * Constructs a new SetDisplayLayout object
+ */
+ public SetDisplayLayout() {
+ super(FunctionID.SET_DISPLAY_LAYOUT.toString());
+ }
+
+ /**
+ * Constructs a new SetDisplayLayout object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SetDisplayLayout(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SetDisplayLayout object
+ * @param displayLayout
+ * a String value representing a display layout
+ */
+ public SetDisplayLayout(@NonNull String displayLayout) {
+ this();
+ setDisplayLayout(displayLayout);
+ }
+
+ /**
+ * Sets a display layout. Predefined or dynamically created screen layout.
+ * Currently only predefined screen layouts are defined. Predefined layouts
+ * include: "ONSCREEN_PRESETS" Custom screen containing app-defined onscreen
+ * presets. Currently defined for GEN2
+ *
+ * @param displayLayout
+ * a String value representing a display layout
+ */
+ public void setDisplayLayout(@NonNull String displayLayout) {
+ setParameters(KEY_DISPLAY_LAYOUT, displayLayout);
+ }
+
+ /**
+ * Gets a display layout.
+ */
+ public String getDisplayLayout() {
+ return getString(KEY_DISPLAY_LAYOUT);
+ }
+
+ /**
+ * Gets the color scheme that is currently used for day
+ *
+ * @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used
+ * for day color scheme
+ * @since SmartDeviceLink 5.0
+ */
+ public TemplateColorScheme getDayColorScheme(){
+ return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_DAY_COLOR_SCHEME);
+ }
+
+ /**
+ * Sets the color scheme that is intended to be used for day
+ *
+ * @param templateColorScheme a TemplateColorScheme object representing the colors that will be
+ * used for day color scheme
+ * @since SmartDeviceLink 5.0
+ */
+ public void setDayColorScheme(TemplateColorScheme templateColorScheme){
+ setParameters(KEY_DAY_COLOR_SCHEME, templateColorScheme);
+ }
+
+ /**
+ * Gets the color scheme that is currently used for night
+ *
+ * @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used
+ * for night color scheme
+ * @since SmartDeviceLink 5.0
+ */
+ public TemplateColorScheme getNightColorScheme(){
+ return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_NIGHT_COLOR_SCHEME);
+ }
+
+ /**
+ * Sets the color scheme that is intended to be used for night
+ *
+ * @param templateColorScheme a TemplateColorScheme object representing the colors that will be
+ * used for night color scheme
+ * @since SmartDeviceLink 5.0
+ */
+ public void setNightColorScheme(TemplateColorScheme templateColorScheme){
+ setParameters(KEY_NIGHT_COLOR_SCHEME, templateColorScheme);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java
new file mode 100644
index 000000000..070879a1a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Set Display Layout Response is sent, when SetDisplayLayout has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class SetDisplayLayoutResponse extends RPCResponse {
+ public static final String KEY_BUTTON_CAPABILITIES = "buttonCapabilities";
+ public static final String KEY_DISPLAY_CAPABILITIES = "displayCapabilities";
+ public static final String KEY_SOFT_BUTTON_CAPABILITIES = "softButtonCapabilities";
+ public static final String KEY_PRESET_BANK_CAPABILITIES = "presetBankCapabilities";
+
+ /**
+ * Constructs a new SetDisplayLayoutResponse object
+ */
+ public SetDisplayLayoutResponse() {
+ super(FunctionID.SET_DISPLAY_LAYOUT.toString());
+ }
+
+ /**
+ * Constructs a new SetDisplayLayoutResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SetDisplayLayoutResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SetDisplayLayoutResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SetDisplayLayoutResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ @SuppressWarnings("unchecked")
+ public DisplayCapabilities getDisplayCapabilities() {
+ return (DisplayCapabilities) getObject(DisplayCapabilities.class, KEY_DISPLAY_CAPABILITIES);
+ }
+
+ public void setDisplayCapabilities(DisplayCapabilities displayCapabilities) {
+ setParameters(KEY_DISPLAY_CAPABILITIES, displayCapabilities);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<ButtonCapabilities> getButtonCapabilities() {
+ return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES);
+ }
+
+ public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
+ setParameters(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<SoftButtonCapabilities> getSoftButtonCapabilities() {
+ return (List<SoftButtonCapabilities>) getObject(SoftButtonCapabilities.class, KEY_SOFT_BUTTON_CAPABILITIES);
+ }
+
+ public void setSoftButtonCapabilities(List<SoftButtonCapabilities> softButtonCapabilities) {
+ setParameters(KEY_SOFT_BUTTON_CAPABILITIES, softButtonCapabilities);
+ }
+
+ @SuppressWarnings("unchecked")
+ public PresetBankCapabilities getPresetBankCapabilities() {
+ return (PresetBankCapabilities) getObject(PresetBankCapabilities.class, KEY_PRESET_BANK_CAPABILITIES);
+ }
+
+ public void setPresetBankCapabilities(PresetBankCapabilities presetBankCapabilities) {
+ setParameters(KEY_PRESET_BANK_CAPABILITIES, presetBankCapabilities);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java
new file mode 100644
index 000000000..62aca4657
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java
@@ -0,0 +1,310 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Sets value(s) for the specified global property(ies)
+ *
+ * <p>Function Group: Base </p>
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p><b>AudioStreamingState:</b></p>
+ * Any
+ *
+ * <p><b>SystemContext:</b></p>
+ * Any
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>helpPrompt</td>
+ * <td>TTSChunk</td>
+ * <td>The help prompt. An array of text chunks of type TTSChunk. See {@linkplain TTSChunk}.The array must have at least one item.</td>
+ * <td>N</td>
+ * <td>Array must have at least one element.<p>Only optional it timeoutPrompt has been specified.</p>minsize:1; maxsize: 100</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>timeoutPrompt</td>
+ * <td>TTSChunk</td>
+ * <td>Array of one or more TTSChunk elements specifying the help prompt used in an interaction started by PTT.</td>
+ * <td>N</td>
+ * <td>Array must have at least one element. Only optional it helpPrompt has been specified <p>minsize: 1; maxsize: 100</p></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>vrHelpTitle</td>
+ * <td>string</td>
+ * <td>Text, which is shown as title of the VR help screen used in an interaction started by PTT.</td>
+ * <td>N</td>
+ * <td>If omitted on supported displays, the default SDL help title will be used. <p>If omitted and one or more vrHelp items are provided, the request will be rejected.</p>maxlength: 500</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>vrHelp</td>
+ * <td>VrHelep</td>
+ * <td>Items listed in the VR help screen used in an interaction started by PTT.</td>
+ * <td>N</td>
+ * <td>If omitted on supported displays, the default SDL VR help / What Can I Say? screen will be used<p>If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC will be rejected.</p><p>If omitted and a vrHelpTitle is provided, the request will be rejected.</p>minsize:1; maxsize: 100 </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>menuTitle</td>
+ * <td></td>
+ * <td>Optional text to label an app menu button (for certain touchscreen platforms).</td>
+ * <td>N</td>
+ * <td>maxlength: 500</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>menuIcon</td>
+ * <td> Image</td>
+ * <td>Optional icon to draw on an app menu button (for certain touchscreen platforms).</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>keyboardProperties</td>
+ * <td>KeyboardProperties</td>
+ * <td>On-screen keybaord configuration (if available).</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ *
+ * </table>
+ *
+ * <p><b>Note: </b>Your application shall send a SetGlobalProperties to establish an advanced help prompt before sending any voice commands.</p>
+ *
+ * <p><b>Response</b></p>
+ * Indicates whether the requested Global Properties were successfully set.
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * </p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p>REJECTED</p>
+ * <p>DISALLOWED</p>
+ * @since SmartDeviceLink 1.0
+ * @see ResetGlobalProperties
+ */
+public class SetGlobalProperties extends RPCRequest {
+ public static final String KEY_VR_HELP_TITLE = "vrHelpTitle";
+ public static final String KEY_MENU_TITLE = "menuTitle";
+ public static final String KEY_MENU_ICON = "menuIcon";
+ public static final String KEY_KEYBOARD_PROPERTIES = "keyboardProperties";
+ public static final String KEY_HELP_PROMPT = "helpPrompt";
+ public static final String KEY_TIMEOUT_PROMPT = "timeoutPrompt";
+ public static final String KEY_VR_HELP = "vrHelp";
+ /**
+ * Constructs a new SetGlobalProperties object
+ */
+ public SetGlobalProperties() {
+ super(FunctionID.SET_GLOBAL_PROPERTIES.toString());
+ }
+ /**
+ * Constructs a new SetGlobalProperties object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SetGlobalProperties(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Gets a List<TTSChunk> for Help Prompt representing Array of one or more
+ * TTSChunk elements specifying the help prompt used in an interaction
+ * started by PTT
+ *
+ * @return List<TTSChunk> -an Array of one or more TTSChunk elements
+ * specifying the help prompt used in an interaction started by PTT
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getHelpPrompt() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_HELP_PROMPT);
+ }
+ /**
+ * Sets a List<TTSChunk> for Help Prompt that Array of one or more
+ * TTSChunk elements specifying the help prompt used in an interaction
+ * started by PTT
+ *
+ * @param helpPrompt
+ * a List<TTSChunk> of one or more TTSChunk elements
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Array must have at least one element</li>
+ * <li>Only optional it timeoutPrompt has been specified</li>
+ * </ul>
+ */
+ public void setHelpPrompt(List<TTSChunk> helpPrompt) {
+ setParameters(KEY_HELP_PROMPT, helpPrompt);
+ }
+ /**
+ * Gets a List<TTSChunk> for Timeout Prompt representing Array of one or
+ * more TTSChunk elements specifying the help prompt used in an interaction
+ * started by PTT
+ *
+ * @return List<TTSChunk> -an Array of one or more TTSChunk elements
+ * specifying the help prompt used in an interaction started by PTT
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getTimeoutPrompt() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TIMEOUT_PROMPT);
+ }
+ /**
+ * Sets a List<TTSChunk> for Timeout Prompt representing Array of one or
+ * more TTSChunk elements specifying the help prompt used in an interaction
+ * started by PTT
+ *
+ */
+ public void setTimeoutPrompt(List<TTSChunk> timeoutPrompt) {
+ setParameters(KEY_TIMEOUT_PROMPT, timeoutPrompt);
+ }
+
+ /**
+ * Gets a voice recognition Help Title
+ *
+ * @return String - a String value representing the text, which is shown as
+ * title of the VR help screen used in an interaction started by PTT
+ * @since SmartDeviceLink 2.0
+ */
+ public String getVrHelpTitle() {
+ return getString(KEY_VR_HELP_TITLE);
+ }
+
+ /**
+ * Sets a voice recognition Help Title
+ *
+ * @param vrHelpTitle
+ * a String value representing a voice recognition Help Title
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If omitted on supported displays, the default SDL help
+ * title will be used</li>
+ * <li>If omitted and one or more vrHelp items are provided, the
+ * request will be rejected.</li>
+ * <li>String Maxlength = 500</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+ public void setVrHelpTitle(String vrHelpTitle) {
+ setParameters(KEY_VR_HELP_TITLE, vrHelpTitle);
+ }
+
+ /**
+ * Gets items listed in the VR help screen used in an interaction started by
+ * PTT
+ *
+ * @return List<VrHelpItem> - a List value representing items listed in
+ * the VR help screen used in an interaction started by PTT
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<VrHelpItem> getVrHelp() {
+ return (List<VrHelpItem>) getObject(VrHelpItem.class, KEY_VR_HELP);
+ }
+
+ /**
+ * Sets the items listed in the VR help screen used in an interaction
+ * started by PTT
+ *
+ * @param vrHelp
+ * a List value representing items listed in the VR help screen
+ * used in an interaction started by PTT
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If omitted on supported displays, the default SmartDeviceLink VR
+ * help / What Can I Say? screen will be used</li>
+ * <li>If the list of VR Help Items contains nonsequential
+ * positions (e.g. [1,2,4]), the RPC will be rejected</li>
+ * <li>If omitted and a vrHelpTitle is provided, the request
+ * will be rejected</li>
+ * <li>Array Minsize: = 1</li>
+ * <li>Array Maxsize = 100</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+ public void setVrHelp(List<VrHelpItem> vrHelp) {
+ setParameters(KEY_VR_HELP, vrHelp);
+ }
+
+ public String getMenuTitle() {
+ return getString(KEY_MENU_TITLE);
+ }
+
+ public void setMenuTitle(String menuTitle) {
+ setParameters(KEY_MENU_TITLE, menuTitle);
+ }
+
+ public void setMenuIcon(Image menuIcon) {
+ setParameters(KEY_MENU_ICON, menuIcon);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Image getMenuIcon() {
+ return (Image) getObject(Image.class, KEY_MENU_ICON);
+ }
+
+ public void setKeyboardProperties(KeyboardProperties keyboardProperties) {
+ setParameters(KEY_KEYBOARD_PROPERTIES, keyboardProperties);
+ }
+
+ @SuppressWarnings("unchecked")
+ public KeyboardProperties getKeyboardProperties() {
+ return (KeyboardProperties) getObject(KeyboardProperties.class, KEY_KEYBOARD_PROPERTIES);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java
new file mode 100644
index 000000000..cb0d3f223
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Set Global Properties Response is sent, when SetGlobalProperties has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class SetGlobalPropertiesResponse extends RPCResponse {
+
+ /**
+ * Constructs a new SetGlobalPropertiesResponse object
+ */
+ public SetGlobalPropertiesResponse() {
+ super(FunctionID.SET_GLOBAL_PROPERTIES.toString());
+ }
+
+ /**
+ * Constructs a new SetGlobalPropertiesResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SetGlobalPropertiesResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SetGlobalPropertiesResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SetGlobalPropertiesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java
new file mode 100644
index 000000000..396d700ce
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * This function allows a remote control type mobile application change the settings
+ * of a specific remote control module.
+ */
+public class SetInteriorVehicleData extends RPCRequest {
+ public static final String KEY_MODULE_DATA = "moduleData";
+
+ /**
+ * Constructs a new SetInteriorVehicleData object
+ */
+ public SetInteriorVehicleData() {
+ super(FunctionID.SET_INTERIOR_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * <p>Constructs a new SetInteriorVehicleData object indicated by the
+ * Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SetInteriorVehicleData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SetInteriorVehicleData object
+ * @param moduleData
+ */
+ public SetInteriorVehicleData(@NonNull ModuleData moduleData) {
+ this();
+ setModuleData(moduleData);
+ }
+
+ /**
+ * Sets the moduleData
+ *
+ * @param moduleData
+ */
+ public void setModuleData(@NonNull ModuleData moduleData) {
+ setParameters(KEY_MODULE_DATA, moduleData);
+ }
+
+ /**
+ * Gets the moduleData
+ *
+ * @return ModuleData
+ */
+ public ModuleData getModuleData() {
+ return (ModuleData) getObject(ModuleData.class, KEY_MODULE_DATA);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
new file mode 100644
index 000000000..072aac498
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class SetInteriorVehicleDataResponse extends RPCResponse {
+ public static final String KEY_MODULE_DATA = "moduleData";
+
+ /**
+ * Constructs a new SetInteriorVehicleDataResponse object
+ */
+ public SetInteriorVehicleDataResponse() {
+ super(FunctionID.SET_INTERIOR_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * <p>Constructs a new SetInteriorVehicleDataResponse object indicated by the
+ * Hashtable parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SetInteriorVehicleDataResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SetInteriorVehicleDataResponse object
+ * @param moduleData
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SetInteriorVehicleDataResponse(@NonNull ModuleData moduleData, @NonNull Result resultCode, @NonNull Boolean success) {
+ this();
+ setModuleData(moduleData);
+ setResultCode(resultCode);
+ setSuccess(success);
+ }
+
+ /**
+ * Gets the moduleData
+ *
+ * @return ModuleData
+ */
+ public ModuleData getModuleData() {
+ return (ModuleData) getObject(ModuleData.class, KEY_MODULE_DATA);
+ }
+
+ /**
+ * Sets the moduleData
+ *
+ * @param moduleData
+ */
+ public void setModuleData(@NonNull ModuleData moduleData) {
+ setParameters(KEY_MODULE_DATA, moduleData);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java
new file mode 100644
index 000000000..4de5bfb05
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java
@@ -0,0 +1,336 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator;
+import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
+
+import java.util.Hashtable;
+
+/**
+ * Sets the media clock/timer value and the update method (e.g.count-up,
+ * count-down, etc.)
+ *
+ * <p>Function Group: Base </p>
+ * <p><b>HMILevel needs to be FULL, LIMITIED or BACKGROUND</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>startTime</td>
+ * <td>StartTime</td>
+ * <td>StartTime struct specifying hour, minute, second values to which media clock timer is set.</td>
+ * <td>N</td>
+ * <td> </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>endTime</td>
+ * <td>StartTime</td>
+ * <td> EndTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
+ * If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
+ * endTime will be ignored for "RESUME", and "CLEAR"
+ * endTime can be sent for "PAUSE", in which case it will update the paused endTime</td>
+ * <td>N</td>
+ * <td>Array must have at least one element.<p>Only optional it helpPrompt has been specified</p> minsize: 1; maxsize: 100</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>updateMode</td>
+ * <td>UpdateMode</td>
+ * <td>Specifies how the media clock/timer is to be updated (COUNTUP/COUNTDOWN/PAUSE/RESUME), based at the startTime.</td>
+ * <td>Y</td>
+ * <td>If "updateMode" is COUNTUP or COUNTDOWN, this parameter must be provided. Will be ignored for PAUSE,RESUME and CLEAR</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>audioStreamingIndicator</td>
+ * <td>AudioStreamingIndicator</td>
+ * <td></td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ *
+ * </table>
+ *
+ *<p><b>Response </b></p>
+ *
+ *<p><b> Non-default Result Codes: </b></p>
+ *
+ * <p> SUCCESS </p>
+ * <p> INVALID_DATA</p>
+ * <p> OUT_OF_MEMORY</p>
+ * <p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p> APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR</p>
+ * <p> REJECTED </p>
+ * <p> IGNORED </p>
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class SetMediaClockTimer extends RPCRequest {
+ public static final String KEY_START_TIME = "startTime";
+ public static final String KEY_END_TIME = "endTime";
+ public static final String KEY_UPDATE_MODE = "updateMode";
+ public static final String KEY_AUDIO_STREAMING_INDICATOR = "audioStreamingIndicator";
+ /**
+ * Constructs a new SetMediaClockTimer object
+ */
+ public SetMediaClockTimer() {
+ super(FunctionID.SET_MEDIA_CLOCK_TIMER.toString());
+ }
+ /**
+ * Constructs a new SetMediaClockTimer object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public SetMediaClockTimer(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new SetMediaClockTimer object
+ * @param updateMode a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME) <br>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>When updateMode is PAUSE, RESUME or CLEAR, the start time value
+ * is ignored</li>
+ * <li>When updateMode is RESUME, the timer resumes counting from
+ * the timer's value when it was paused</li>
+ * </ul>
+ */
+ public SetMediaClockTimer(@NonNull UpdateMode updateMode) {
+ this();
+ setUpdateMode(updateMode);
+ }
+ private SetMediaClockTimer(@NonNull UpdateMode updateMode, @Nullable StartTime startTime, @Nullable StartTime endTime, @Nullable AudioStreamingIndicator audioStreamingIndicator){
+ this();
+ this.setUpdateMode(updateMode);
+ if (startTime != null) {
+ this.setStartTime(startTime);
+ }
+ if (endTime != null) {
+ this.setEndTime(endTime);
+ }
+ if (audioStreamingIndicator != null) {
+ this.setAudioStreamingIndicator(audioStreamingIndicator);
+ }
+ }
+ /**
+ * Create a media clock timer that counts up, e.g from 0:00 to 4:18.
+ *
+ * @param startTimeInterval The start time interval, e.g. (0) 0:00
+ * @param endTimeInterval The end time interval, e.g. (258) 4:18
+ * @param audioStreamingIndicator playPauseIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer countUpFromStartTimeInterval(@NonNull Integer startTimeInterval, @NonNull Integer endTimeInterval, @Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.COUNTUP, new StartTime(startTimeInterval), new StartTime(endTimeInterval), audioStreamingIndicator);
+ }
+ /**
+ * Create a media clock timer that counts up, e.g from 0:00 to 4:18.
+ *
+ * @param startTime The start time interval, e.g. 0:00
+ * @param endTime The end time interval, e.g. 4:18
+ * @param audioStreamingIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer countUpFromStartTime(@NonNull StartTime startTime, @NonNull StartTime endTime, @Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.COUNTUP, startTime, endTime, audioStreamingIndicator);
+ }
+ /**
+ * Create a media clock timer that counts down, e.g. from 4:18 to 0:00
+ * This will fail if endTime is greater than startTime
+ *
+ * @param startTimeInterval The start time interval, e.g. (258) 4:18
+ * @param endTimeInterval The end time interval, e.g. (0) 0:00
+ * @param audioStreamingIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer countDownFromStartTimeInterval(@NonNull Integer startTimeInterval, @NonNull Integer endTimeInterval, @Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.COUNTDOWN, new StartTime(startTimeInterval), new StartTime(endTimeInterval), audioStreamingIndicator);
+ }
+ /**
+ * Create a media clock timer that counts down, e.g. from 4:18 to 0:00
+ * This will fail if endTime is greater than startTime
+ *
+ * @param startTime The start time interval, e.g. 4:18
+ * @param endTime The end time interval, e.g. 0:00
+ * @param audioStreamingIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer countDownFromStartTime(@NonNull StartTime startTime, @NonNull StartTime endTime, @Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.COUNTDOWN, startTime, endTime, audioStreamingIndicator);
+ }
+ /**
+ * Pause an existing (counting up / down) media clock timer
+ *
+ * @param audioStreamingIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer pauseWithPlayPauseIndicator(@Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.PAUSE, null, null, audioStreamingIndicator);
+ }
+ /**
+ * Update a pause time (or pause and update the time) on a media clock timer
+ *
+ * @param startTimeInterval The new start time interval
+ * @param endTimeInterval The new end time interval
+ * @param audioStreamingIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer updatePauseWithNewStartTimeInterval(@NonNull Integer startTimeInterval, @NonNull Integer endTimeInterval, @Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.PAUSE, new StartTime(startTimeInterval), new StartTime(endTimeInterval), audioStreamingIndicator);
+ }
+ /**
+ * Update a pause time (or pause and update the time) on a media clock timer
+ *
+ * @param startTime The new start time
+ * @param endTime The new end time
+ * @param audioStreamingIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer updatePauseWithNewStartTime(@NonNull StartTime startTime, @NonNull StartTime endTime, @Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.PAUSE, startTime, endTime, audioStreamingIndicator);
+ }
+ /**
+ * Resume a paused media clock timer. It resumes at the same time at which it was paused.
+ *
+ * @param audioStreamingIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer resumeWithPlayPauseIndicator(@Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.RESUME, null, null, audioStreamingIndicator);
+ }
+ /**
+ * Remove a media clock timer from the screen
+ *
+ * @param audioStreamingIndicator An optional audio indicator to change the play/pause button
+ * @return An object of SetMediaClockTimer
+ */
+ public static SetMediaClockTimer clearWithPlayPauseIndicator(@Nullable AudioStreamingIndicator audioStreamingIndicator) {
+ return new SetMediaClockTimer(UpdateMode.CLEAR, null, null, audioStreamingIndicator);
+ }
+ /**
+ * Gets the Start Time which media clock timer is set
+ *
+ * @return StartTime -a StartTime object specifying hour, minute, second
+ * values
+ */
+ @SuppressWarnings("unchecked")
+ public StartTime getStartTime() {
+ return (StartTime) getObject(StartTime.class, KEY_START_TIME);
+ }
+ /**
+ * Sets a Start Time with specifying hour, minute, second values
+ *
+ * @param startTime
+ * a startTime object with specifying hour, minute, second values
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If "updateMode" is COUNTUP or COUNTDOWN, this parameter
+ * must be provided</li>
+ * <li>Will be ignored for PAUSE/RESUME and CLEAR</li>
+ * </ul>
+ */
+ public void setStartTime( StartTime startTime ) {
+ setParameters(KEY_START_TIME, startTime);
+ }
+
+ @SuppressWarnings("unchecked")
+ public StartTime getEndTime() {
+ return (StartTime) getObject(StartTime.class, KEY_END_TIME);
+ }
+
+ public void setEndTime( StartTime endTime ) {
+ setParameters(KEY_END_TIME, endTime);
+ }
+
+ /**
+ * Gets the media clock/timer update mode (COUNTUP/COUNTDOWN/PAUSE/RESUME)
+ *
+ * @return UpdateMode -a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME)
+ */
+ public UpdateMode getUpdateMode() {
+ return (UpdateMode) getObject(UpdateMode.class, KEY_UPDATE_MODE);
+ }
+ /**
+ * Sets the media clock/timer update mode (COUNTUP/COUNTDOWN/PAUSE/RESUME)
+ *
+ * @param updateMode
+ * a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME)
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>When updateMode is PAUSE, RESUME or CLEAR, the start time value
+ * is ignored</li>
+ * <li>When updateMode is RESUME, the timer resumes counting from
+ * the timer's value when it was paused</li>
+ * </ul>
+ */
+ public void setUpdateMode( @NonNull UpdateMode updateMode ) {
+ setParameters(KEY_UPDATE_MODE, updateMode);
+ }
+
+ /**
+ * Gets the playback status of a media app
+ *
+ * @return AudioStreamingIndicator - a Enumeration value
+ */
+ public AudioStreamingIndicator getAudioStreamingIndicator() {
+ return (AudioStreamingIndicator) getObject(AudioStreamingIndicator.class, KEY_AUDIO_STREAMING_INDICATOR);
+ }
+
+ /**
+ * Sets the playback status of a media app
+ */
+ public void setAudioStreamingIndicator(AudioStreamingIndicator audioStreamingIndicator ) {
+ setParameters(KEY_AUDIO_STREAMING_INDICATOR, audioStreamingIndicator);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java
new file mode 100644
index 000000000..8174152d8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Set Media Clock Timer Response is sent, when SetMediaClockTimer has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class SetMediaClockTimerResponse extends RPCResponse {
+
+ /**
+ * Constructs a new SetMediaClockTimerResponse object
+ */
+ public SetMediaClockTimerResponse() {
+ super(FunctionID.SET_MEDIA_CLOCK_TIMER.toString());
+ }
+
+ /**
+ * Constructs a new SetMediaClockTimerResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SetMediaClockTimerResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new SetMediaClockTimerResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SetMediaClockTimerResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java
new file mode 100644
index 000000000..8a536e4a9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java
@@ -0,0 +1,580 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Updates the application's display text area, regardless of whether or not
+ * this text area is visible to the user at the time of the request. The
+ * application's display text area remains unchanged until updated by subsequent
+ * calls to Show
+ * <p></p>
+ * The content of the application's display text area is visible to the user
+ * when the application's {@linkplain com.smartdevicelink.proxy.rpc.enums.HMILevel}
+ * is FULL or LIMITED, and the
+ * {@linkplain com.smartdevicelink.proxy.rpc.enums.SystemContext}=MAIN and no
+ * {@linkplain Alert} is in progress
+ * <p></p>
+ * The Show operation cannot be used to create an animated scrolling screen. To
+ * avoid distracting the driver, Show commands cannot be issued more than once
+ * every 4 seconds. Requests made more frequently than this will be rejected
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>mainField1</td>
+ * <td>String</td>
+ * <td>Text to be displayed in a single-line display, or in the upper display line in a two-line display.</td>
+ * <td>N</td>
+ * <td>If this parameter is omitted, the text of mainField1 does not change. If this parameter is an empty string, the field will be cleared. <p>Maxlength = 500</p></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>mainField2</td>
+ * <td>String</td>
+ * <td>Text to be displayed on the second display line of a two-line display.</td>
+ * <td>N</td>
+ * <td><p>If this parameter is omitted, the text of mainField2 does not change. </p> <p>If this parameter is an empty string, the field will be cleared.</p><p>If provided and the display is a single-line display, the parameter is ignored.</p>Maxlength = 500</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>mainField3</td>
+ * <td>String</td>
+ * <td>Text to be displayed on the first display line of the second page.</td>
+ * <td>N</td>
+ * <td><p>If this parameter is omitted, the text of mainField3 does not change. </p><p>If this parameter is an empty string, the field will be cleared.</p><p>If provided and the display is a single-line display, the parameter is ignored.</p> Maxlength = 500</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>mainField4</td>
+ * <td>String</td>
+ * <td>Text to be displayed on the second display line of the second page.</td>
+ * <td>N</td>
+ * <td><p>If this parameter is omitted, the text of mainField4 does not change. </p><p>If this parameter is an empty string, the field will be cleared.</p><p>If provided and the display is a single-line display, the parameter is ignored.</p>Maxlength = 500</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>alignment</td>
+ * <td>TextAlignment</td>
+ * <td>Specifies how mainField1 and mainField2 text should be aligned on display.</td>
+ * <td>N</td>
+ * <td><p>Applies only to mainField1 and mainField2 provided on this call, not to what is already showing in display.</p><p>If this parameter is omitted, text in both mainField1 and mainField2 will be centered. </p>Has no effect with navigation display</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>statusBar</td>
+ * <td>String</td>
+ * <td>The text is placed in the status bar area.</td>
+ * <td>N</td>
+ * <td><p>Note: The status bar only exists on navigation displays</p><p>If this parameter is omitted, the status bar text will remain unchanged.</p><p>If this parameter is an empty string, the field will be cleared.</p><p>If provided and the display has no status bar, this parameter is ignored.</p>Maxlength = 500</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>mediaClock</td>
+ * <td>String</td>
+ * <td><p>Text value for MediaClock field.</p> <p>Has to be properly formatted by Mobile App according to SDL capabilities.</p>If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.</td>
+ * <td>N</td>
+ * <td><p>Must be properly formatted as described in the MediaClockFormat enumeration. </p><p>If a value of five spaces is provided, this will clear that field on the display (i.e. the media clock timer field will not display anything) </p>Maxlength = 500</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>mediaTrack</td>
+ * <td>String</td>
+ * <td>Array of one or more TTSChunk elements specifying the help prompt used in an interaction started by PTT.</td>
+ * <td>N</td>
+ * <td><p>If parameter is omitted, the track field remains unchanged.</p><p>If an empty string is provided, the field will be cleared.</p><p>This field is only valid for media applications on navigation displays.</p>Maxlength = 500</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>graphic</td>
+ * <td>Image</td>
+ * <td>Image to be shown on supported displays.</td>
+ * <td>N</td>
+ * <td>If omitted on supported displays, the displayed graphic shall not change.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>secondaryGraphic</td>
+ * <td>Image</td>
+ * <td> <p>Image struct determining whether static or dynamic secondary image to display in app.</p>If omitted on supported displays, the displayed secondary graphic shall not change.</td>
+ * <td>N</td>
+ * <td> </td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * <tr>
+ * <td>softButtons</td>
+ * <td>SoftButton</td>
+ * <td>Soft buttons as defined by the App</td>
+ * <td>N</td>
+ * <td><p>If omitted on supported displays, the currently displayed SoftButton values will not change.</p>Array Minsize: 0; Array Maxsize: 8</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>customPresets</td>
+ * <td>String</td>
+ * <td>Custom presets as defined by the App.</td>
+ * <td>N</td>
+ * <td><p>If omitted on supported displays, the presets will be shown as not defined.</p>Minsize: 0; Maxsize: 6</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * </table>
+ *<p><b>Response </b></p>
+ *
+ *<p><b> Non-default Result Codes: </b></p>
+ * <p>SUCCESS </p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p> TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p> GENERIC_ERROR</p>
+ * <p> REJECTED</p>
+ * <p> DISALLOWED</p>
+ * <p> UNSUPPORTED_RESOURCE </p>
+ * <p>ABORTED</p>
+ *
+ * @since SmartDeviceLink 1.0
+ * @see Alert
+ * @see SetMediaClockTimer
+ */
+public class Show extends RPCRequest {
+ public static final String KEY_GRAPHIC = "graphic";
+ public static final String KEY_CUSTOM_PRESETS = "customPresets";
+ public static final String KEY_MAIN_FIELD_1 = "mainField1";
+ public static final String KEY_MAIN_FIELD_2 = "mainField2";
+ public static final String KEY_MAIN_FIELD_3 = "mainField3";
+ public static final String KEY_MAIN_FIELD_4 = "mainField4";
+ public static final String KEY_STATUS_BAR = "statusBar";
+ public static final String KEY_MEDIA_CLOCK = "mediaClock";
+ public static final String KEY_ALIGNMENT = "alignment";
+ public static final String KEY_MEDIA_TRACK = "mediaTrack";
+ public static final String KEY_SECONDARY_GRAPHIC = "secondaryGraphic";
+ public static final String KEY_SOFT_BUTTONS = "softButtons";
+ public static final String KEY_METADATA_TAGS = "metadataTags";
+ /**
+ * Constructs a new Show object
+ */
+ public Show() {
+ super(FunctionID.SHOW.toString());
+ }
+ /**
+ * Constructs a new Show object indicated by the Hashtable parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public Show(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Gets the text displayed in a single-line display, or in the upper display
+ * line in a two-line display
+ *
+ * @return String -a String value representing the text displayed in a
+ * single-line display, or in the upper display line in a two-line
+ * display
+ */
+ public String getMainField1() {
+ return getString(KEY_MAIN_FIELD_1);
+ }
+ /**
+ * Sets the text displayed in a single-line display, or in the upper display
+ * line in a two-line display
+ *
+ * @param mainField1
+ * the String value representing the text displayed in a
+ * single-line display, or in the upper display line in a
+ * two-line display
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If this parameter is omitted, the text of mainField1 does
+ * not change</li>
+ * <li>If this parameter is an empty string, the field will be
+ * cleared</li>
+ * </ul>
+ */
+ public void setMainField1(String mainField1) {
+ setParameters(KEY_MAIN_FIELD_1, mainField1);
+ }
+ /**
+ * Gets the text displayed on the second display line of a two-line display
+ *
+ * @return String -a String value representing the text displayed on the
+ * second display line of a two-line display
+ */
+ public String getMainField2() {
+ return getString(KEY_MAIN_FIELD_2);
+ }
+ /**
+ * Sets the text displayed on the second display line of a two-line display
+ *
+ * @param mainField2
+ * the String value representing the text displayed on the second
+ * display line of a two-line display
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If this parameter is omitted, the text of mainField2 does
+ * not change</li>
+ * <li>If this parameter is an empty string, the field will be
+ * cleared</li>
+ * <li>If provided and the display is a single-line display, the
+ * parameter is ignored</li>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ */
+ public void setMainField2(String mainField2) {
+ setParameters(KEY_MAIN_FIELD_2, mainField2);
+ }
+
+ /**
+ * Gets the text displayed on the first display line of the second page
+ *
+ * @return String -a String value representing the text displayed on the
+ * first display line of the second page
+ * @since SmartDeviceLink 2.0
+ */
+ public String getMainField3() {
+ return getString(KEY_MAIN_FIELD_3);
+ }
+
+ /**
+ * Sets the text displayed on the first display line of the second page
+ *
+ * @param mainField3
+ * the String value representing the text displayed on the first
+ * display line of the second page
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If this parameter is omitted, the text of mainField3 does
+ * not change</li>
+ * <li>If this parameter is an empty string, the field will be
+ * cleared</li>
+ * <li>If provided and the display is a single-line display, the
+ * parameter is ignored</li>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+ public void setMainField3(String mainField3) {
+ setParameters(KEY_MAIN_FIELD_3, mainField3);
+ }
+
+ /**
+ * Gets the text displayed on the second display line of the second page
+ *
+ * @return String -a String value representing the text displayed on the
+ * first display line of the second page
+ * @since SmartDeviceLink 2.0
+ */
+ public String getMainField4() {
+ return getString(KEY_MAIN_FIELD_4);
+ }
+
+ /**
+ * Sets the text displayed on the second display line of the second page
+ *
+ * @param mainField4
+ * the String value representing the text displayed on the second
+ * display line of the second page
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If this parameter is omitted, the text of mainField4 does
+ * not change</li>
+ * <li>If this parameter is an empty string, the field will be
+ * cleared</li>
+ * <li>If provided and the display is a single-line display, the
+ * parameter is ignored</li>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+ public void setMainField4(String mainField4) {
+ setParameters(KEY_MAIN_FIELD_4, mainField4);
+ }
+ /**
+ * Gets the alignment that Specifies how mainField1 and mainField2 text
+ * should be aligned on display
+ *
+ * @return TextAlignment -an Enumeration value
+ */
+ public TextAlignment getAlignment() {
+ return (TextAlignment) getObject(TextAlignment.class, KEY_ALIGNMENT);
+ }
+ /**
+ * Sets the alignment that Specifies how mainField1 and mainField2 text
+ * should be aligned on display
+ *
+ * @param alignment
+ * an Enumeration value
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Applies only to mainField1 and mainField2 provided on this
+ * call, not to what is already showing in display</li>
+ * <li>If this parameter is omitted, text in both mainField1 and
+ * mainField2 will be centered</li>
+ * <li>Has no effect with navigation display</li>
+ * </ul>
+ */
+ public void setAlignment(TextAlignment alignment) {
+ setParameters(KEY_ALIGNMENT, alignment);
+ }
+ /**
+ * Gets text in the Status Bar
+ *
+ * @return String -the value in the Status Bar
+ */
+ public String getStatusBar() {
+ return getString(KEY_STATUS_BAR);
+ }
+ /**
+ * Sets text in the Status Bar
+ *
+ * @param statusBar
+ * a String representing the text you want to add in the Status
+ * Bar
+ * <p></p>
+ * <b>Notes: </b><i>The status bar only exists on navigation
+ * displays</i>
+ * <ul>
+ * <li>If this parameter is omitted, the status bar text will
+ * remain unchanged</li>
+ * <li>If this parameter is an empty string, the field will be
+ * cleared</li>
+ * <li>If provided and the display has no status bar, this
+ * parameter is ignored</li>
+ * </ul>
+ */
+ public void setStatusBar(String statusBar) {
+ setParameters(KEY_STATUS_BAR, statusBar);
+ }
+ /**
+ * Gets the String value of the MediaClock
+ *
+ * @return String -a String value of the MediaClock
+ */
+ @Deprecated
+ public String getMediaClock() {
+ return getString(KEY_MEDIA_CLOCK);
+ }
+ /**
+ * Sets the value for the MediaClock field using a format described in the
+ * MediaClockFormat enumeration
+ *
+ * @param mediaClock
+ * a String value for the MdaiaClock
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>Must be properly formatted as described in the
+ * MediaClockFormat enumeration</li>
+ * <li>If a value of five spaces is provided, this will clear
+ * that field on the display (i.e. the media clock timer field
+ * will not display anything)</li>
+ * </ul>
+ */
+ @Deprecated
+ public void setMediaClock(String mediaClock) {
+ setParameters(KEY_MEDIA_CLOCK, mediaClock);
+ }
+ /**
+ * Gets the text in the track field
+ *
+ * @return String -a String displayed in the track field
+ */
+ public String getMediaTrack() {
+ return getString(KEY_MEDIA_TRACK);
+ }
+ /**
+ * Sets the text in the track field
+ *
+ * @param mediaTrack
+ * a String value disaplayed in the track field
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If parameter is omitted, the track field remains unchanged</li>
+ * <li>If an empty string is provided, the field will be cleared</li>
+ * <li>This field is only valid for media applications on navigation displays</li>
+ * </ul>
+ */
+ public void setMediaTrack(String mediaTrack) {
+ setParameters(KEY_MEDIA_TRACK, mediaTrack);
+ }
+
+ /**
+ * Sets an image to be shown on supported displays
+ *
+ * @param graphic
+ * the value representing the image shown on supported displays
+ * <p></p>
+ * <b>Notes: </b>If omitted on supported displays, the displayed
+ * graphic shall not change
+ * @since SmartDeviceLink 2.0
+ */
+ public void setGraphic(Image graphic) {
+ setParameters(KEY_GRAPHIC, graphic);
+ }
+
+ /**
+ * Gets an image to be shown on supported displays
+ *
+ * @return Image -the value representing the image shown on supported
+ * displays
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public Image getGraphic() {
+ return (Image) getObject(Image.class, KEY_GRAPHIC);
+ }
+
+
+ public void setSecondaryGraphic(Image secondaryGraphic) {
+ setParameters(KEY_SECONDARY_GRAPHIC, secondaryGraphic);
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public Image getSecondaryGraphic() {
+ return (Image) getObject(Image.class, KEY_SECONDARY_GRAPHIC);
+ }
+
+
+ /**
+ * Gets the Soft buttons defined by the App
+ *
+ * @return List<SoftButton> -a List value representing the Soft buttons
+ * defined by the App
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<SoftButton> getSoftButtons() {
+ return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
+ }
+
+ /**
+ * Sets the the Soft buttons defined by the App
+ *
+ * @param softButtons
+ * a List value represemting the Soft buttons defined by the
+ * App
+ * <p></p>
+ * <b>Notes: </b>
+ * <ul>
+ * <li>If omitted on supported displays, the currently displayed
+ * SoftButton values will not change</li>
+ * <li>Array Minsize: 0</li>
+ * <li>Array Maxsize: 8</li>
+ * </ul>
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ public void setSoftButtons(List<SoftButton> softButtons) {
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ }
+
+ /**
+ * Gets the Custom Presets defined by the App
+ *
+ * @return List<String> - a List value representing the Custom presets
+ * defined by the App
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getCustomPresets() {
+ return (List<String>) getObject(String.class, KEY_CUSTOM_PRESETS);
+ }
+
+ /**
+ * Sets the Custom Presets defined by the App
+ *
+ * @param customPresets
+ * a List value representing the Custom Presets defined by the
+ * App
+ * <p></p>
+ * <ul>
+ * <li>If omitted on supported displays, the presets will be shown as not defined</li>
+ * <li>Array Minsize: 0</li>
+ * <li>Array Maxsize: 6</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+ public void setCustomPresets(List<String> customPresets) {
+ setParameters(KEY_CUSTOM_PRESETS, customPresets);
+ }
+
+ /**
+ * Sets text field metadata defined by the App
+ *
+ * @param metadataTags
+ * A Struct containing metadata pertaining to the main text fields
+ * <p></p>
+ * <ul>
+ * @since SmartDeviceLink 4.5.0
+ */
+ public void setMetadataTags(MetadataTags metadataTags){
+ setParameters(KEY_METADATA_TAGS, metadataTags);
+ }
+
+ /**
+ * Gets text field metadata defined by the App
+ *
+ * @return metadataTags - App defined metadata information. See MetadataTags. Uses mainField1, mainField2, mainField3, mainField4.
+ * If omitted on supported displays, the currently set metadata tags will not change.
+ * If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.
+ * @since SmartDeviceLink 4.5.0
+ */
+ public MetadataTags getMetadataTags() {
+ return (MetadataTags) getObject(MetadataTags.class, KEY_METADATA_TAGS);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java
new file mode 100644
index 000000000..43ab3a137
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java
@@ -0,0 +1,304 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * <p>This RPC is used to update the user with navigation information for the constantly shown screen (base screen), but
+ * also for the alert type screen</p>
+ *
+ * <p>Function Group: Navigation</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ *
+ * @since SmartDeviceLink 2.0
+ * @see AlertManeuver
+ * @see UpdateTurnList
+ */
+public class ShowConstantTbt extends RPCRequest{
+
+ public static final String KEY_TEXT1 = "navigationText1";
+ public static final String KEY_TEXT2 = "navigationText2";
+ public static final String KEY_ETA = "eta";
+ public static final String KEY_TOTAL_DISTANCE = "totalDistance";
+ public static final String KEY_MANEUVER_DISTANCE = "distanceToManeuver";
+ public static final String KEY_MANEUVER_DISTANCE_SCALE = "distanceToManeuverScale";
+ public static final String KEY_MANEUVER_IMAGE = "turnIcon";
+ public static final String KEY_NEXT_MANEUVER_IMAGE = "nextTurnIcon";
+ public static final String KEY_MANEUVER_COMPLETE = "maneuverComplete";
+ public static final String KEY_SOFT_BUTTONS = "softButtons";
+ public static final String KEY_TIME_TO_DESTINATION = "timeToDestination";
+
+ /**
+ * Constructs a new ShowConstantTbt object
+ */
+ public ShowConstantTbt(){
+ super(FunctionID.SHOW_CONSTANT_TBT.toString());
+ }
+
+ /**
+ * Constructs a new ShowConstantTbt object indicated by the Hashtable parameter
+ * <p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public ShowConstantTbt(Hashtable<String, Object> hash){
+ super(hash);
+ }
+
+ /**
+ * Sets a text for navigation text field 1
+ *
+ * @param navigationText1
+ * a String value representing a text for navigation text field 1
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public void setNavigationText1(String navigationText1){
+ setParameters(KEY_TEXT1, navigationText1);
+ }
+
+ /**
+ * Gets a text for navigation text field 1
+ *
+ * @return String -a String value representing a text for navigation text field 1
+ */
+ public String getNavigationText1(){
+ return getString(KEY_TEXT1);
+ }
+
+ /**
+ * Sets a text for navigation text field 2
+ *
+ * @param navigationText2
+ * a String value representing a text for navigation text field 2
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public void setNavigationText2(String navigationText2){
+ setParameters(KEY_TEXT2, navigationText2);
+ }
+
+ /**
+ * Gets a text for navigation text field 2
+ *
+ * @return String -a String value representing a text for navigation text field 2
+ */
+ public String getNavigationText2(){
+ return getString(KEY_TEXT2);
+ }
+
+ /**
+ * Sets a text field for estimated time of arrival
+ *
+ * @param eta
+ * a String value representing a text field for estimated time of arrival
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public void setEta(String eta){
+ setParameters(KEY_ETA, eta);
+ }
+
+ /**
+ * Gets a text field for estimated time of arrival
+ *
+ * @return String -a String value representing a text field for estimated time of arrival
+ */
+ public String getEta(){
+ return getString(KEY_ETA);
+ }
+
+ /**
+ * Sets a text field for total distance
+ *
+ * @param totalDistance
+ * a String value representing a text field for total distance
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public void setTotalDistance(String totalDistance){
+ setParameters(KEY_TOTAL_DISTANCE, totalDistance);
+ }
+
+ /**
+ * Gets a text field for total distance
+ *
+ * @return String -a String value representing a text field for total distance
+ */
+ public String getTotalDistance(){
+ return getString(KEY_TOTAL_DISTANCE);
+ }
+
+ /**
+ * Sets an Image for turnicon
+ *
+ * @param turnIcon
+ * an Image value
+ */
+ public void setTurnIcon(Image turnIcon){
+ setParameters(KEY_MANEUVER_IMAGE, turnIcon);
+ }
+
+ /**
+ * Gets an Image for turnicon
+ *
+ * @return Image -an Image value representing an Image for turnicon
+ */
+ @SuppressWarnings("unchecked")
+ public Image getTurnIcon(){
+ return (Image) getObject(Image.class, KEY_MANEUVER_IMAGE);
+ }
+
+ /**
+ * Sets an Image for nextTurnIcon
+ *
+ * @param nextTurnIcon
+ * an Image value
+ */
+ public void setNextTurnIcon(Image nextTurnIcon){
+ setParameters(KEY_NEXT_MANEUVER_IMAGE, nextTurnIcon);
+ }
+
+ /**
+ * Gets an Image for nextTurnIcon
+ *
+ * @return Image -an Image value representing an Image for nextTurnIcon
+ */
+ @SuppressWarnings("unchecked")
+ public Image getNextTurnIcon(){
+ return (Image) getObject(Image.class, KEY_NEXT_MANEUVER_IMAGE);
+ }
+
+ /**
+ * Sets a Fraction of distance till next maneuver
+ *
+ * @param distanceToManeuver
+ * a Double value representing a Fraction of distance till next maneuver
+ * <p></p>
+ * <b>Notes: </b>Minvalue=0; Maxvalue=1000000000
+ */
+ public void setDistanceToManeuver(Double distanceToManeuver){
+ setParameters(KEY_MANEUVER_DISTANCE, distanceToManeuver);
+ }
+
+ /**
+ * Gets a Fraction of distance till next maneuver
+ *
+ * @return Double -a Double value representing a Fraction of distance till next maneuver
+ */
+ public Double getDistanceToManeuver(){
+ return getDouble(KEY_MANEUVER_DISTANCE);
+ }
+
+ /**
+ * Sets a Distance till next maneuver (starting from) from previous maneuver
+ *
+ * @param distanceToManeuverScale
+ * a Double value representing a Distance till next maneuver (starting from) from previous maneuver
+ * <p></p>
+ * <b>Notes: </b>Minvalue=0; Maxvalue=1000000000
+ */
+ public void setDistanceToManeuverScale(Double distanceToManeuverScale){
+ setParameters(KEY_MANEUVER_DISTANCE_SCALE, distanceToManeuverScale);
+ }
+
+ /**
+ * Gets a Distance till next maneuver (starting from) from previous maneuver
+ *
+ * @return Double -a Double value representing a Distance till next maneuver (starting from) from previous maneuver
+ */
+ public Double getDistanceToManeuverScale(){
+ return getDouble(KEY_MANEUVER_DISTANCE_SCALE);
+ }
+
+ /**
+ * <p>Sets a maneuver complete flag. If and when a maneuver has completed while an AlertManeuver is active, the app
+ * must send this value set to TRUE in order to clear the AlertManeuver overlay
+ * If omitted the value will be assumed as FALSE</p>
+ *
+ *
+ * @param maneuverComplete
+ * a Boolean value
+ */
+ public void setManeuverComplete(Boolean maneuverComplete){
+ setParameters(KEY_MANEUVER_COMPLETE, maneuverComplete);
+ }
+
+ /**
+ * Gets a maneuver complete flag
+ *
+ * @return Boolean -a Boolean value
+ */
+ public Boolean getManeuverComplete(){
+ return getBoolean(KEY_MANEUVER_COMPLETE);
+ }
+
+ /**
+ * <p>Sets Three dynamic SoftButtons available (first SoftButton is fixed to "Turns"). If omitted on supported
+ * displays, the currently displayed SoftButton values will not change</p>
+ *
+ * <p><b>Notes: </b>Minsize=0; Maxsize=3</p>
+ *
+ * @param softButtons
+ * a List<SoftButton> value
+ */
+ public void setSoftButtons(List<SoftButton> softButtons){
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ }
+
+ /**
+ * Gets Three dynamic SoftButtons available (first SoftButton is fixed to "Turns"). If omitted on supported
+ * displays, the currently displayed SoftButton values will not change
+ *
+ * @return Vector<SoftButton> -a Vector<SoftButton> value
+ */
+ @SuppressWarnings("unchecked")
+ public List<SoftButton> getSoftButtons(){
+ return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
+ }
+
+ public void setTimeToDestination(String timeToDestination){
+ setParameters(KEY_TIME_TO_DESTINATION, timeToDestination);
+ }
+
+ public String getTimeToDestination(){
+ return getString(KEY_TIME_TO_DESTINATION);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java
new file mode 100644
index 000000000..e6e4a9f97
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Show Constant TBT Response is sent, when ShowConstantTBT has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class ShowConstantTbtResponse extends RPCResponse{
+
+ public ShowConstantTbtResponse() {
+ super(FunctionID.SHOW_CONSTANT_TBT.toString());
+ }
+
+ public ShowConstantTbtResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ShowConstantTbtResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public ShowConstantTbtResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java
new file mode 100644
index 000000000..b1c8dc70a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Show Response is sent, when Show has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class ShowResponse extends RPCResponse {
+
+ /**
+ * Constructs a new ShowResponse object
+ */
+ public ShowResponse() {
+ super(FunctionID.SHOW.toString());
+ }
+
+ /**
+ * Constructs a new ShowResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public ShowResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new ShowResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public ShowResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java
new file mode 100644
index 000000000..de2061e2c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
+import com.smartdevicelink.proxy.rpc.enums.TPMS;
+
+import java.util.Hashtable;
+
+/**
+ * Tire pressure status of a single tire.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>status</td>
+ * <td>ComponentVolumeStatus</td>
+ * <td>Describes the volume status of a single tire
+ * See {@linkplain ComponentVolumeStatus}
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>tpms</td>
+ * <td>TPMS</td>
+ * <td>The status of TPMS according to the particular tire.
+ * See {@linkplain com.smartdevicelink.proxy.rpc.enums.TPMS}
+ * </td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>pressure</td>
+ * <td>Float</td>
+ * <td>The pressure value of the particular tire in kilo pascal.</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class SingleTireStatus extends RPCStruct {
+ public static final String KEY_STATUS = "status";
+ public static final String KEY_TPMS = "tpms";
+ public static final String KEY_PRESSURE = "pressure";
+
+ /**
+ * Constructs a newly allocated SingleTireStatus object
+ */
+ public SingleTireStatus() { }
+
+ /**
+ * Constructs a newly allocated SingleTireStatus object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public SingleTireStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated SingleTireStatus object
+ * @param status Describes the volume status of a single tire
+ */
+ public SingleTireStatus(@NonNull ComponentVolumeStatus status){
+ this();
+ setStatus(status);
+ }
+
+ /**
+ * set the volume status of a single tire
+ * @param status the volume status of a single tire
+ */
+ public void setStatus(@NonNull ComponentVolumeStatus status) {
+ setValue(KEY_STATUS, status);
+ }
+
+ /**
+ * get the volume status of a single tire
+ * @return the volume status of a single tire
+ */
+ public ComponentVolumeStatus getStatus() {
+ return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_STATUS);
+ }
+
+ /**
+ * Set the status of TPMS according to the particular tire.
+ * @param tpms The status of TPMS
+ */
+ public void setTPMS(@NonNull TPMS tpms) { setValue(KEY_TPMS, tpms); }
+
+ /**
+ * Get the status of TPMS according to the particular tire.
+ * @return the TPMS status
+ */
+ public TPMS getTPMS() {
+ return (TPMS) getObject(TPMS.class, KEY_TPMS);
+ }
+
+ /**
+ * @param pressure The pressure value of the particular tire in kilo pascal.
+ */
+ public void setPressure(@NonNull Float pressure) { setValue(KEY_PRESSURE, pressure); }
+
+ /**
+ * @return the pressure value of the particular tire in kilo pascal.
+ */
+ public Float getPressure() {
+ return getFloat(KEY_PRESSURE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java
new file mode 100644
index 000000000..be97e14cd
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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 which is used for network Application. Consists of Country Code and FCC Facility ID
+ *
+ * @param stationIDNumber Consists of Country Code and FCC Facility ID
+ */
+ public void setStationIDNumber(StationIDNumber stationIDNumber) {
+ setValue(KEY_STATION_ID_NUMBER, stationIDNumber);
+ }
+
+ /**
+ * Gets the stationIDNumber which is used for network Application. Consists of Country Code and FCC Facility ID
+ *
+ * @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/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java
new file mode 100644
index 000000000..530352c6d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * <p>Creates a full screen or pop-up overlay (depending on platform) with a single
+ * user controlled slider.</p>
+ *
+ * <p>Function Group: Base</p>
+ *
+ * <p><b>HMILevel needs to be FULL</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>numTicks</td>
+ * <td>Integer</td>
+ * <td>Number of selectable items on a horizontal axis.</td>
+ * <td>Y</td>
+ * <td>Minvalue=2; Maxvalue=26</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>position</td>
+ * <td>Integer</td>
+ * <td>Initial position of slider control (cannot exceed numTicks),</td>
+ * <td>Y</td>
+ * <td>Minvalue=1; Maxvalue=26</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>sliderHeader</td>
+ * <td>String</td>
+ * <td>Text header to display</td>
+ * <td>N</td>
+ * <td>Maxlength=500</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>sliderFooter</td>
+ * <td>Integer</td>
+ * <td><p>Text footer to display (meant to display min/max threshold descriptors).</p>For a static text footer, only one footer string shall be provided in the array. For a dynamic text footer, the number of footer text string in the array must match the numTicks value.For a dynamic text footer, text array string should correlate with potential slider position index.If omitted on supported displays, no footer text shall be displayed.</td>
+ * <td>N</td>
+ * <td>Maxlength=500; Minvalue=1; Maxvalue=26</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * <tr>
+ * <td>timeout</td>
+ * <td>String</td>
+ * <td>App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout). If omitted, the value is set to 10000.</td>
+ * <td>N</td>
+ * <td>Minvalue=0; Maxvalue=65535; Defvalue= 10000</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+*<p><b>Response </b></p>
+*
+*<p><b>Non-default Result Codes:</b></p>
+* <p> SAVED </p>
+* <p> INVALID_DATA</p>
+* <p>OUT_OF_MEMORY</p>
+* <p>TOO_MANY_PENDING_REQUESTS</p>
+* <p>APPLICATION_NOT_REGISTERED</p>
+* <p>GENERIC_ERROR</p>
+*<p> DISALLOWED</p>
+*<p> UNSUPPORTED_RESOURCE </p>
+*<p> REJECTED </p>
+* <p>ABORTED </p>
+*
+ * @since SmartDeviceLink 2.0
+ *
+ */
+public class Slider extends RPCRequest {
+
+ public static final String KEY_NUM_TICKS = "numTicks";
+ public static final String KEY_SLIDER_HEADER = "sliderHeader";
+ public static final String KEY_SLIDER_FOOTER = "sliderFooter";
+ public static final String KEY_POSITION = "position";
+ public static final String KEY_TIMEOUT = "timeout";
+ /**
+ * Constructs a new Slider object
+ */
+ public Slider() {
+ super(FunctionID.SLIDER.toString());
+ }
+
+ /**
+ * Constructs a new Slider object indicated by the Hashtable parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public Slider(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new Slider object \
+ * @param numTicks Number of selectable items on a horizontal axis.
+ * @param position Initial position of slider control (cannot exceed numTicks)
+ * @param sliderHeader Text header to display
+ */
+ public Slider(@NonNull Integer numTicks, @NonNull Integer position, @NonNull String sliderHeader){
+ this();
+ setNumTicks(numTicks);
+ setPosition(position);
+ setSliderHeader(sliderHeader);
+ }
+
+ /**
+ * Sets a number of selectable items on a horizontal axis
+ *
+ * @param numTicks
+ * an Integer value representing a number of selectable items on
+ * a horizontal axis
+ * <p></p>
+ * <b>Notes: </b>Minvalue=2; Maxvalue=26
+ */
+ public void setNumTicks(@NonNull Integer numTicks) {
+ setParameters(KEY_NUM_TICKS, numTicks);
+ }
+
+ /**
+ * Gets a number of selectable items on a horizontal axis
+ *
+ * @return Integer -an Integer value representing a number of selectable
+ * items on a horizontal axis
+ */
+ public Integer getNumTicks() {
+ return getInteger(KEY_NUM_TICKS);
+ }
+
+ /**
+ * Sets an Initial position of slider control
+ *
+ * @param position
+ * an Integer value representing an Initial position of slider
+ * control
+ * <p></p>
+ * <b>Notes: </b>Minvalue=1; Maxvalue=26
+ */
+ public void setPosition(@NonNull Integer position) {
+ setParameters(KEY_POSITION, position);
+ }
+
+ /**
+ * Gets an Initial position of slider control
+ *
+ * @return Integer -an Integer value representing an Initial position of
+ * slider control
+ */
+ public Integer getPosition() {
+ return getInteger(KEY_POSITION);
+ }
+
+ /**
+ * Sets a text header to display
+ *
+ * @param sliderHeader
+ * a String value
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500
+ */
+ public void setSliderHeader(@NonNull String sliderHeader) {
+ setParameters(KEY_SLIDER_HEADER, sliderHeader);
+ }
+
+ /**
+ * Gets a text header to display
+ *
+ * @return String -a String value representing a text header to display
+ */
+ public String getSliderHeader() {
+ return getString(KEY_SLIDER_HEADER);
+ }
+
+ /**
+ * Sets a text footer to display
+ *
+ * @param sliderFooter
+ * a List<String> value representing a text footer to display
+ * <p></p>
+ * <b>Notes: </b>Maxlength=500; Minvalue=1; Maxvalue=26
+ */
+ public void setSliderFooter(List<String> sliderFooter) {
+ setParameters(KEY_SLIDER_FOOTER, sliderFooter);
+ }
+
+ /**
+ * Gets a text footer to display
+ *
+ * @return String -a String value representing a text footer to display
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getSliderFooter() {
+ return (List<String>) getObject(String.class, KEY_SLIDER_FOOTER);
+ }
+
+ /**
+ * Sets an App defined timeout
+ *
+ * @param timeout
+ * an Integer value representing an App defined timeout
+ * <p></p>
+ * <b>Notes: </b>Minvalue=0; Maxvalue=65535; Defvalue=10000
+ */
+ public void setTimeout(Integer timeout) {
+ setParameters(KEY_TIMEOUT, timeout);
+ }
+
+ /**
+ * Gets an App defined timeout
+ * @return Integer -an Integer value representing an App defined timeout
+ */
+ public Integer getTimeout() {
+ return getInteger(KEY_TIMEOUT);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java
new file mode 100644
index 000000000..d8bb5dc69
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Slider Response is sent, when Slider has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class SliderResponse extends RPCResponse {
+ public static final String KEY_SLIDER_POSITION = "sliderPosition";
+
+ /**
+ * Constructs a new SliderResponse object
+ */
+ public SliderResponse() {
+ super(FunctionID.SLIDER.toString());
+ }
+
+ /**
+ * Constructs a new SliderResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SliderResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SliderResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SliderResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ /**
+ * Sets an Initial position of slider control
+ * @param sliderPosition the starting position of the slider control
+ */
+ public void setSliderPosition(Integer sliderPosition) {
+ setParameters(KEY_SLIDER_POSITION, sliderPosition);
+ }
+ /**
+ * Gets an Initial position of slider control
+ * @return the starting position of the slider control
+ */
+ public Integer getSliderPosition() {
+ return getInteger(KEY_SLIDER_POSITION);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java
new file mode 100644
index 000000000..8fa5166d1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
+import com.smartdevicelink.proxy.rpc.enums.SystemAction;
+
+import java.util.Hashtable;
+/**
+ * <p> A simulated button or keyboard key that is displayed on a touch screen.</p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>type</td>
+ * <td>SoftButtonType</td>
+ * <td>Describes, whether it is text, highlighted text, icon, or dynamic image. </td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>text</td>
+ * <td>String</td>
+ * <td>Optional text to display (if defined as TEXT or BOTH)</td>
+ * <td>N</td>
+ * <td>Min: 0; Maxlength: 500</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>image</td>
+ * <td>Image</td>
+ * <td>Optional image struct for SoftButton (if defined as IMAGE or BOTH).</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>isHighlighted</td>
+ * <td>Boolean</td>
+ * <td>True, if highlighted False, if not highlighted</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>softButtonID</td>
+ * <td>Integer</td>
+ * <td>Value which is returned via OnButtonPress / OnButtonEvent</td>
+ * <td></td>
+ * <td>Min: 0; Max: 65535</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>systemAction</td>
+ * <td>SystemAction</td>
+ * <td>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</td>
+ * <td>N</td>
+ * <td>defvalue: DEFAULT_ACTION</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ *
+ * </table>
+ *
+ */
+public class SoftButton extends RPCStruct {
+
+ public static final String KEY_IS_HIGHLIGHTED = "isHighlighted";
+ public static final String KEY_SOFT_BUTTON_ID = "softButtonID";
+ public static final String KEY_SYSTEM_ACTION = "systemAction";
+ public static final String KEY_TEXT = "text";
+ public static final String KEY_TYPE = "type";
+ public static final String KEY_IMAGE = "image";
+
+ public SoftButton() { }
+
+ /**
+ *
+ * <p>Constructs a new SoftButton object indicated by the Hashtable
+ * parameter</p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public SoftButton(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SoftButton object
+ * @param type Describes, whether it is text, highlighted text, icon, or dynamic image.
+ * @param softButtonID Value which is returned via OnButtonPress / OnButtonEvent
+ */
+ public SoftButton(@NonNull SoftButtonType type, @NonNull Integer softButtonID){
+ this();
+ setType(type);
+ setSoftButtonID(softButtonID);
+ }
+
+ public void setType(@NonNull SoftButtonType type) {
+ setValue(KEY_TYPE, type);
+ }
+ public SoftButtonType getType() {
+ return (SoftButtonType) getObject(SoftButtonType.class, KEY_TYPE);
+ }
+ public void setText(String text) {
+ setValue(KEY_TEXT, text);
+ }
+ public String getText() {
+ return getString(KEY_TEXT);
+ }
+ public void setImage(Image image) {
+ setValue(KEY_IMAGE, image);
+ }
+ @SuppressWarnings("unchecked")
+ public Image getImage() {
+ return (Image) getObject(Image.class, KEY_IMAGE);
+ }
+ public void setIsHighlighted(Boolean isHighlighted) {
+ setValue(KEY_IS_HIGHLIGHTED, isHighlighted);
+ }
+ public Boolean getIsHighlighted() {
+ return getBoolean(KEY_IS_HIGHLIGHTED);
+ }
+ public void setSoftButtonID(@NonNull Integer softButtonID) {
+ setValue(KEY_SOFT_BUTTON_ID, softButtonID);
+ }
+ public Integer getSoftButtonID() {
+ return getInteger(KEY_SOFT_BUTTON_ID);
+ }
+ public void setSystemAction(SystemAction systemAction) {
+ setValue(KEY_SYSTEM_ACTION, systemAction);
+ }
+ public SystemAction getSystemAction() {
+ return (SystemAction) getObject(SystemAction.class, KEY_SYSTEM_ACTION);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java
new file mode 100644
index 000000000..27d60290b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * <p>Contains information about a SoftButton's capabilities.</p>
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>shortPressAvailable</td>
+ * <td>Boolean</td>
+ * <td>The button supports a short press.
+ * Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>longPressAvailable</td>
+ * <td>Boolean</td>
+ * <td>The button supports a LONG press.
+ * Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>upDownAvailable</td>
+ * <td>Boolean</td>
+ * <td>The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ * Whenever the button is released, onButtonEvent( UP) will be invoked. *
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>imageSupported</td>
+ * <td>Boolean</td>
+ * <td>The button supports referencing a static or dynamic image.
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class SoftButtonCapabilities extends RPCStruct {
+ public static final String KEY_IMAGE_SUPPORTED = "imageSupported";
+ public static final String KEY_SHORT_PRESS_AVAILABLE = "shortPressAvailable";
+ public static final String KEY_LONG_PRESS_AVAILABLE = "longPressAvailable";
+ public static final String KEY_UP_DOWN_AVAILABLE = "upDownAvailable";
+
+ /**
+ * Constructs a newly allocated SoftButtonCapabilities object
+ */
+ public SoftButtonCapabilities() { }
+
+ /**
+ * Constructs a newly allocated SoftButtonCapabilities object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public SoftButtonCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated SoftButtonCapabilities object
+ * @param shortPressAvailable The button supports a short press.
+ * @param longPressAvailable The button supports a LONG press
+ * @param upDownAvailable The button supports "button down" and "button up".
+ * @param imageSupported The button supports referencing a static or dynamic image.
+ */
+ public SoftButtonCapabilities(@NonNull Boolean shortPressAvailable, @NonNull Boolean longPressAvailable, @NonNull Boolean upDownAvailable, @NonNull Boolean imageSupported){
+ this();
+ setShortPressAvailable(shortPressAvailable);
+ setLongPressAvailable(longPressAvailable);
+ setUpDownAvailable(upDownAvailable);
+ setImageSupported(imageSupported);
+ }
+
+ /**
+ * set the button supports a short press.
+ * @param shortPressAvailable whether the button supports a short press.
+ */
+ public void setShortPressAvailable(@NonNull Boolean shortPressAvailable) {
+ setValue(KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable);
+ }
+
+ /**
+ * get whether the button supports a short press.
+ * @return whether the button supports a short press
+ */
+ public Boolean getShortPressAvailable() {
+ return getBoolean( KEY_SHORT_PRESS_AVAILABLE);
+ }
+
+ /**
+ * set the button supports a LONG press.
+ * @param longPressAvailable whether the button supports a long press
+ */
+ public void setLongPressAvailable(@NonNull Boolean longPressAvailable) {
+ setValue(KEY_LONG_PRESS_AVAILABLE, longPressAvailable);
+ }
+
+ /**
+ * get whether the button supports a LONG press.
+ * @return whether the button supports a LONG press
+ */
+ public Boolean getLongPressAvailable() {
+ return getBoolean( KEY_LONG_PRESS_AVAILABLE);
+ }
+
+ /**
+ * set the button supports "button down" and "button up".
+ * @param upDownAvailable the button supports "button down" and "button up".
+ */
+ public void setUpDownAvailable(@NonNull Boolean upDownAvailable) {
+ setValue(KEY_UP_DOWN_AVAILABLE, upDownAvailable);
+ }
+
+ /**
+ * get the button supports "button down" and "button up".
+ * @return the button supports "button down" and "button up".
+ */
+ public Boolean getUpDownAvailable() {
+ return getBoolean( KEY_UP_DOWN_AVAILABLE);
+ }
+
+ /**
+ * set the button supports referencing a static or dynamic image.
+ * @param imageSupported whether the button supports referencing a static or dynamic image.
+ */
+ public void setImageSupported(@NonNull Boolean imageSupported) {
+ setValue(KEY_IMAGE_SUPPORTED, imageSupported);
+ }
+
+ /**
+ * get the button supports referencing a static or dynamic image.
+ * @return the button supports referencing a static or dynamic image.
+ */
+ public Boolean getImageSupported() {
+ return getBoolean( KEY_IMAGE_SUPPORTED);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java
new file mode 100644
index 000000000..71fedd4ca
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Speaks a phrase over the vehicle audio system using SDL's TTS
+ * (text-to-speech) engine. The provided text to be spoken can be simply a text
+ * phrase, or it can consist of phoneme specifications to direct SDL's TTS
+ * engine to speak a "speech-sculpted" phrase
+ * <p></p>
+ * Receipt of the Response indicates the completion of the Speak operation,
+ * regardless of how the Speak operation may have completed (i.e. successfully,
+ * interrupted, terminated, etc.)
+ * <p></p>
+ * Requesting a new Speak operation while the application has another Speak
+ * operation already in progress (i.e. no corresponding Response for that
+ * in-progress Speak operation has been received yet) will terminate the
+ * in-progress Speak operation (causing its corresponding Response to be sent by
+ * SDL) and begin the requested Speak operation
+ * <p></p>
+ * Requesting a new Speak operation while the application has an <i>
+ * {@linkplain Alert}</i> operation already in progress (i.e. no corresponding
+ * Response for that in-progress <i>{@linkplain Alert}</i> operation has been
+ * received yet) will result in the Speak operation request being rejected
+ * (indicated in the Response to the Request)
+ * <p></p>
+ * Requesting a new <i>{@linkplain Alert}</i> operation while the application
+ * has a Speak operation already in progress (i.e. no corresponding Response for
+ * that in-progress Speak operation has been received yet) will terminate the
+ * in-progress Speak operation (causing its corresponding Response to be sent by
+ * SDL) and begin the requested <i>{@linkplain Alert}</i> operation
+ * <p></p>
+ * Requesting a new Speak operation while the application has a <i>
+ * {@linkplain PerformInteraction}</i> operation already in progress (i.e. no
+ * corresponding Response for that in-progress <i>
+ * {@linkplain PerformInteraction}</i> operation has been received yet) will
+ * result in the Speak operation request being rejected (indicated in the
+ * Response to the Request)
+ * <p></p>
+ * Requesting a <i> {@linkplain PerformInteraction}</i> operation while the
+ * application has a Speak operation already in progress (i.e. no corresponding
+ * Response for that in-progress Speak operation has been received yet) will
+ * terminate the in-progress Speak operation (causing its corresponding Response
+ * to be sent by SDL) and begin the requested <i>
+ * {@linkplain PerformInteraction}</i> operation
+ * <p></p>
+ *
+ * <p><b>HMI Status Requirements:</b></p>
+ * <p>HMILevel: FULL, Limited</p>
+ *<p> AudioStreamingState: Any</p>
+ * <p>SystemContext: MAIN, MENU, VR</p>
+ *
+ * <p><b>Notes: </b></p>
+ * <ul>
+ * <li>When <i>{@linkplain Alert}</i> is issued with MENU in effect, <i>
+ * {@linkplain Alert}</i> is queued and "played" when MENU interaction is
+ * completed (i.e. SystemContext reverts to MAIN). When <i>{@linkplain Alert}
+ * </i> is issued with VR in effect, <i>{@linkplain Alert}</i> is queued and
+ * "played" when VR interaction is completed (i.e. SystemContext reverts to
+ * MAIN)</li>
+ * <li>When both <i>{@linkplain Alert}</i> and Speak are queued during MENU or
+ * VR, they are "played" back in the order in which they were queued, with all
+ * existing rules for "collisions" still in effect</li>
+ * </ul>
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th> Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>ttsChunks</td>
+ * <td>String</td>
+ * <td>An array of 1-100 TTSChunk structs which, taken together, specify the phrase to be spoken.</td>
+ * <td>Y</td>
+ * <td><p>The array must have 1-100 elements. </p><p>The total length of the phrase composed from the ttsChunks provided must be less than 500 characters or the request will be rejected. </p>Each chunk can be no more than 500 characters.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * <p><b>Response</b> </p>
+ * <p>This Response notifies the application of the completion, interruption, or failure of a Speak Request.</p>
+ *
+ * <p><b>Non-default Result Codes:</b> </p>
+ *
+ * <p> SUCCESS </p>
+ *<p> INVALID_DATA</p>
+ * <p> OUT_OF_MEMORY </p>
+ * <p>APPLICATION_NOT_REGISTERED </p>
+ * <p>TOO_MANY_PENDING_REQUESTS </p>
+ *<p> GENERIC_ERROR </p>
+ * <p>REJECTED </p>
+ * <p>DISALLOWED </p>
+ * <p>ABORTED </p>
+ *
+ * <p><b>Additional Notes:</b></p><ul>Total character limit depends on platform. Chunks are limited to 500 characters; however you can have multiple TTS chunks. On Gen 1.1 there is a total character limit of 500 characters across all chunks. This could vary according to the VCA.
+ *
+ * @since SmartDeviceLink 1.0
+ * @see Alert
+ */
+public class Speak extends RPCRequest {
+ public static final String KEY_TTS_CHUNKS = "ttsChunks";
+
+ /**
+ * Constructs a new Speak object
+ */
+ public Speak() {
+ super(FunctionID.SPEAK.toString());
+ }
+ /**
+ * Constructs a new Speak object indicated by the Hashtable parameter
+ * <p></p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public Speak(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new Speak object
+ * @param ttsChunks An array of 1-100 TTSChunk structs which, taken together, specify the phrase to be spoken.
+ */
+ public Speak(@NonNull List<TTSChunk> ttsChunks){
+ this();
+ setTtsChunks(ttsChunks);
+ }
+ /**
+ * Gets a List<TTSChunk> representing an array of 1-100 TTSChunk structs
+ * which, taken together, specify the phrase to be spoken
+ *
+ * @return List<TTSChunk> -an Array of 1-100 TTSChunk specify the phrase to be spoken
+ */
+ @SuppressWarnings("unchecked")
+ public List<TTSChunk> getTtsChunks() {
+ return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_CHUNKS);
+ }
+ /**
+ * Sets a List<TTSChunk> representing an array of 1-100 TTSChunk structs
+ * which, taken together, specify the phrase to be spoken
+ *
+ * @param ttsChunks
+ * a List<TTSChunk> value representing an array of 1-100 TTSChunk structs
+ * which specify the phrase to be spoken
+ * <p></p>
+ * <ul>
+ * <li>The array must have 1-100 elements</li>
+ * <li>The total length of the phrase composed from the ttsChunks
+ * provided must be less than 500 characters or the request will
+ * be rejected</li>
+ * <li>Each chunk can be no more than 500 characters</li>
+ * </ul>
+ */
+ public void setTtsChunks( @NonNull List<TTSChunk> ttsChunks ) {
+ setParameters(KEY_TTS_CHUNKS, ttsChunks);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java
new file mode 100644
index 000000000..59c7d3dbb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Speak Response is sent, when Speak has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class SpeakResponse extends RPCResponse {
+
+ /**
+ * Constructs a new SpeakResponse object
+ */
+ public SpeakResponse() {
+ super(FunctionID.SPEAK.toString());
+ }
+
+ /**
+ * Constructs a new SpeakResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SpeakResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SpeakResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SpeakResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java
new file mode 100644
index 000000000..875139153
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Describes the hour, minute and second values used to set the media clock.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>hours</td>
+ * <td>Integer</td>
+ * <td>The hour. Minvalue="0", maxvalue="59"
+ * <p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>minutes</td>
+ * <td>Integer</td>
+ * <td>The minute. Minvalue="0", maxvalue="59".</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>seconds</td>
+ * <td>Integer</td>
+ * <td>The second. Minvalue="0", maxvalue="59".</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ */
+public class StartTime extends RPCStruct {
+ public static final String KEY_MINUTES = "minutes";
+ public static final String KEY_SECONDS = "seconds";
+ public static final String KEY_HOURS = "hours";
+
+ /**
+ * Constructs a newly allocated StartTime object
+ */
+ public StartTime() { }
+ /**
+ * Constructs a newly allocated StartTime object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public StartTime(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated StartTime object
+ * @param timeInterval time interval in seconds
+ */
+ public StartTime(@NonNull Integer timeInterval){
+ this();
+ int hours = timeInterval / 3600;
+ int minutes = (timeInterval % 3600) / 60;
+ int seconds = timeInterval % 60;
+ setHours(hours);
+ setMinutes(minutes);
+ setSeconds(seconds);
+ }
+ /**
+ * Constructs a newly allocated StartTime object
+ * @param hours The hour
+ * @param minutes The minute
+ * @param seconds The second
+ */
+ public StartTime(@NonNull Integer hours, @NonNull Integer minutes, @NonNull Integer seconds){
+ this();
+ setHours(hours);
+ setMinutes(minutes);
+ setSeconds(seconds);
+ }
+ /**
+ * Get the hour. Minvalue="0", maxvalue="59"
+ * <p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
+ * @return hours Minvalue="0", maxvalue="59"
+ */
+ public Integer getHours() {
+ return getInteger( KEY_HOURS );
+ }
+ /**
+ * Set the hour. Minvalue="0", maxvalue="59"
+ * <p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
+ * @param hours min: 0; max: 59
+ */
+ public void setHours(@NonNull Integer hours ) {
+ setValue(KEY_HOURS, hours);
+ }
+ /**
+ * Get the minute. Minvalue="0", maxvalue="59".
+ * @return minutes Minvalue="0", maxvalue="59"
+ */
+ public Integer getMinutes() {
+ return getInteger( KEY_MINUTES );
+ }
+ /**
+ * Set the minute. Minvalue="0", maxvalue="59".
+ * @param minutes min: 0; max: 59
+ */
+ public void setMinutes( @NonNull Integer minutes ) {
+ setValue(KEY_MINUTES, minutes);
+ }
+ /**
+ * Get the second. Minvalue="0", maxvalue="59".
+ * @return seconds. Minvalue="0", maxvalue="59".
+ */
+ public Integer getSeconds() {
+ return getInteger( KEY_SECONDS );
+ }
+ /**
+ * Set the second. Minvalue="0", maxvalue="59".
+ * @param seconds min: 0 max: 59
+ */
+ public void setSeconds( @NonNull Integer seconds ) {
+ setValue(KEY_SECONDS, seconds);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java
new file mode 100644
index 000000000..b75cb3752
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/StreamRPCResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/StreamRPCResponse.java
new file mode 100644
index 000000000..ffb2df1bb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/StreamRPCResponse.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+
+import java.util.Hashtable;
+
+public class StreamRPCResponse extends RPCResponse {
+ public static final String KEY_FILENAME = "fileName";
+ public static final String KEY_FILESIZE = "fileSize";
+
+ public StreamRPCResponse() {
+ super(FunctionID.STREAM_RPC.toString());
+ }
+ public StreamRPCResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public void setFileName(String fileName) {
+ setParameters(KEY_FILENAME, fileName);
+ }
+ public String getFileName() {
+ return getString(KEY_FILENAME);
+ }
+
+ public void setFileSize(Long fileSize) {
+ setParameters(KEY_FILESIZE, fileSize);
+ }
+ public Long getFileSize() {
+ return getLong(KEY_FILESIZE);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java
new file mode 100644
index 000000000..d799847ce
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+
+import java.util.Hashtable;
+
+/**
+ *<p> Establishes a subscription to button notifications for HMI buttons. Buttons
+ * are not necessarily physical buttons, but can also be "soft" buttons on a
+ * touch screen, depending on the display in the vehicle. Once subscribed to a
+ * particular button, an application will receive both
+ * {@linkplain OnButtonEvent} and {@linkplain OnButtonPress} notifications
+ * whenever that button is pressed. The application may also unsubscribe from
+ * notifications for a button by invoking the {@linkplain UnsubscribeButton}
+ * operation</p>
+ *
+ * <p>When a button is depressed, an {@linkplain OnButtonEvent} notification is
+ * sent to the application with a ButtonEventMode of BUTTONDOWN. When that same
+ * button is released, an {@linkplain OnButtonEvent} notification is sent to the
+ * application with a ButtonEventMode of BUTTONUP</p>
+ *
+ * <p>When the duration of a button depression (that is, time between depression
+ * and release) is less than two seconds, an {@linkplain OnButtonPress}
+ * notification is sent to the application (at the moment the button is
+ * released) with a ButtonPressMode of SHORT. When the duration is two or more
+ * seconds, an {@linkplain OnButtonPress} notification is sent to the
+ * application (at the moment the two seconds have elapsed) with a
+ * ButtonPressMode of LONG</p>
+ *
+ * The purpose of {@linkplain OnButtonPress} notifications is to allow for
+ * programmatic detection of long button presses similar to those used to store
+ * presets while listening to the radio, for example
+ *
+ * <p>When a button is depressed and released, the sequence in which notifications
+ * will be sent to the application is as follows:</p>
+ *
+ * <p>For short presses:</p>
+ * <ul>
+ * <li>OnButtonEvent (ButtonEventMode = BUTTONDOWN)</li>
+ * <li>OnButtonEvent (ButtonEventMode = BUTTONUP)</li>
+ * <li>OnButtonPress (ButtonPressMode = SHORT)</li>
+ * </ul>
+ *
+ * <p>For long presses:</p>
+ * <ul>
+ * <li>OnButtonEvent (ButtonEventMode = BUTTONDOWN)</li>
+ * <li>OnButtonEvent (ButtonEventMode = BUTTONUP)</li>
+ * <li>OnButtonPress (ButtonPressMode = LONG)</li>
+ * </ul>
+ *
+ *<p> <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>buttonName</td>
+ * <td>ButtonName</td>
+ * <td>Name of the button to subscribe.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0 </td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ * @see UnsubscribeButton
+ */
+public class SubscribeButton extends RPCRequest {
+ public static final String KEY_BUTTON_NAME = "buttonName";
+
+ /**
+ * Constructs a new SubscribeButton object
+ */
+ public SubscribeButton() {
+ super(FunctionID.SUBSCRIBE_BUTTON.toString());
+ }
+ /**
+ * <p>Constructs a new SubscribeButton object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash The Hashtable to use
+ */
+ public SubscribeButton(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SubscribeButton object
+ * @param buttonName Name of the button to subscribe.
+ */
+ public SubscribeButton(@NonNull ButtonName buttonName){
+ this();
+ setButtonName(buttonName);
+ }
+ /**
+ * Gets the name of the button to subscribe to
+ * @return ButtonName -an enum value, see <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i>
+ */
+ public ButtonName getButtonName() {
+ return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
+ }
+ /**
+ * Sets a name of the button to subscribe to
+ * @param buttonName a <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i> value
+ */
+ public void setButtonName(@NonNull ButtonName buttonName ) {
+ setParameters(KEY_BUTTON_NAME, buttonName);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java
new file mode 100644
index 000000000..87ba0e235
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Sub scribeButton Response is sent, when SubscribeButton has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class SubscribeButtonResponse extends RPCResponse {
+
+ /**
+ * Constructs a new SubscribeButtonResponse object
+ */
+ public SubscribeButtonResponse() {
+ super(FunctionID.SUBSCRIBE_BUTTON.toString());
+ }
+
+ /**
+ * <p>Constructs a new SubscribeButtonResponse object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash The Hashtable to use
+ */
+ public SubscribeButtonResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SubscribeButtonResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SubscribeButtonResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java
new file mode 100644
index 000000000..ccce22d04
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java
@@ -0,0 +1,867 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Subscribes for specific published vehicle data items. The data will be only
+ * sent, if it has changed. The application will be notified by the
+ * onVehicleData notification whenever new data is available. The update rate is
+ * very much dependent on sensors, vehicle architecture and vehicle type. Be
+ * also prepared for the situation that a signal is not available on a vehicle
+ *
+ * <p>Function Group: Location, VehicleInfo and DrivingChara</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink Version</th>
+ * </tr>
+ * <tr>
+ * <td>gps</td>
+ * <td>Boolean</td>
+ * <td>GPS data. See {@linkplain GPSData}for details</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>speed</td>
+ * <td>Boolean</td>
+ * <td>The vehicle speed in kilometers per hour</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>rpm</td>
+ * <td>Boolean</td>
+ * <td>The number of revolutions per minute of the engine</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>fuelLevel</td>
+ * <td>Boolean</td>
+ * <td>The fuel level in the tank (percentage)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>fuelLevel_State</td>
+ * <td>Boolean</td>
+ * <td>The fuel level state</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>instantFuelConsumption</td>
+ * <td>Boolean</td>
+ * <td>The instantaneous fuel consumption in microlitres</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>externalTemperature</td>
+ * <td>Boolean</td>
+ * <td>The external temperature in degrees celsius</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>prndl</td>
+ * <td>Boolean</td>
+ * <td>Currently selected gear.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>tirePressure</td>
+ * <td>Boolean</td>
+ * <td>Tire pressure status</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>odometer</td>
+ * <td>Boolean</td>
+ * <td>Odometer in km</td>
+ * <td>N</td>
+ * <td>Max Length: 500</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>beltStatus</td>
+ * <td>Boolean</td>
+ * <td>The status of the seat belts</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>bodyInformation</td>
+ * <td>Boolean</td>
+ * <td>The body information including ignition status and internal temp</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>deviceStatus</td>
+ * <td>Boolean</td>
+ * <td>The device status including signal and battery strength</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>driverBraking</td>
+ * <td>Boolean</td>
+ * <td>The status of the brake pedal</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>wiperStatus</td>
+ * <td>Boolean</td>
+ * <td>The status of the wipers</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>headLampStatus</td>
+ * <td>Boolean</td>
+ * <td>Status of the head lamps</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>engineTorque</td>
+ * <td>Boolean</td>
+ * <td>Torque value for engine (in Nm) on non-diesel variants</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>engineOilLife</td>
+ * <td>Boolean</td>
+ * <td>The estimated percentage of remaining oil life of the engine</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0 </td>
+ * </tr>
+ * <tr>
+ * <td>accPedalPosition</td>
+ * <td>Boolean</td>
+ * <td>Accelerator pedal position (percentage depressed)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>steeringWheelAngle</td>
+ * <td>Boolean</td>
+ * <td>Current angle of the steering wheel (in deg)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>eCallInfo</td>
+ * <td>Boolean</td>
+ * <td>Emergency Call notification and confirmation data.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>airbagStatus</td>
+ * <td>Boolean</td>
+ * <td>The status of the air bags.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>emergencyEvent</td>
+ * <td>Boolean</td>
+ * <td>Information related to an emergency event (and if it occurred).</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>clusterModeStatus</td>
+ * <td>Boolean</td>
+ * <td>The status modes of the instrument panel cluster.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>myKey</td>
+ * <td>Boolean</td>
+ * <td>Information related to the MyKey feature.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>turnSignal</td>
+ * <td>Boolean</td>
+ * <td>@see TurnSignal</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0 </td>
+ * </tr>
+ * <tr>
+ * <td>cloudAppVehicleID</td>
+ * <td>Boolean</td>
+ * <td>ID for the vehicle when connecting to cloud applications</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.1 </td>
+ * </tr>
+ * </table>
+ *
+ * <p> <b>Response</b></p>
+ *<p><b>Non-default Result Codes:</b></p>
+ *<p>SUCCESS</p>
+ *<p>WARNINGS </p>
+ *<p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p>IGNORED </p>
+ * <p>DISALLOWED</p>
+ * <p>USER_DISALLOWED </p>
+ *
+ * @since SmartDeviceLink 2.0
+ * @see UnsubscribeVehicleData
+ * @see GetVehicleData
+ */
+public class SubscribeVehicleData extends RPCRequest {
+ public static final String KEY_RPM = "rpm";
+ public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ public static final String KEY_PRNDL = "prndl";
+ public static final String KEY_TIRE_PRESSURE = "tirePressure";
+ public static final String KEY_ENGINE_TORQUE = "engineTorque";
+ public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
+ public static final String KEY_ODOMETER = "odometer";
+ public static final String KEY_GPS = "gps";
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
+ public static final String KEY_BELT_STATUS = "beltStatus";
+ public static final String KEY_BODY_INFORMATION = "bodyInformation";
+ public static final String KEY_DEVICE_STATUS = "deviceStatus";
+ public static final String KEY_DRIVER_BRAKING = "driverBraking";
+ public static final String KEY_WIPER_STATUS = "wiperStatus";
+ public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
+ public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
+ public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
+ public static final String KEY_E_CALL_INFO = "eCallInfo";
+ public static final String KEY_AIRBAG_STATUS = "airbagStatus";
+ public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
+ public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
+ public static final String KEY_MY_KEY = "myKey";
+ public static final String KEY_SPEED = "speed";
+ public static final String KEY_FUEL_RANGE = "fuelRange";
+ public static final String KEY_TURN_SIGNAL = "turnSignal";
+ public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
+ public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+
+ /**
+ * Constructs a new SubscribeVehicleData object
+ */
+ public SubscribeVehicleData() {
+ super(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * <p>Constructs a new SubscribeVehicleData object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public SubscribeVehicleData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes Gps data
+ *
+ * @param gps
+ * a boolean value
+ */
+ public void setGps(Boolean gps) {
+ setParameters(KEY_GPS, gps);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Gps data has been subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Gps data has been
+ * subscribed.
+ */
+ public Boolean getGps() {
+ return getBoolean(KEY_GPS);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes speed data
+ *
+ * @param speed
+ * a boolean value
+ */
+ public void setSpeed(Boolean speed) {
+ setParameters(KEY_SPEED, speed);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Speed data has been subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Speed data has been
+ * subscribed.
+ */
+ public Boolean getSpeed() {
+ return getBoolean(KEY_SPEED);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes rpm data
+ *
+ * @param rpm
+ * a boolean value
+ */
+ public void setRpm(Boolean rpm) {
+ setParameters(KEY_RPM, rpm);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the rpm data has been subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the rpm data has been
+ * subscribed.
+ */
+ public Boolean getRpm() {
+ return getBoolean(KEY_RPM);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes FuelLevel data
+ *
+ * @param fuelLevel
+ * a boolean value
+ */
+ public void setFuelLevel(Boolean fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the FuelLevel data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the FuelLevel data has
+ * been subscribed.
+ */
+ public Boolean getFuelLevel() {
+ return getBoolean(KEY_FUEL_LEVEL);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes fuelLevel_State data
+ *
+ * @param fuelLevel_State
+ * a boolean value
+ */
+ @Deprecated
+ public void setFuelLevel_State(Boolean fuelLevel_State) {
+ setFuelLevelState(fuelLevel_State);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the fuelLevel_State data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the fuelLevel_State data
+ * has been subscribed.
+ */
+ @Deprecated
+ public Boolean getFuelLevel_State() {
+ return getFuelLevelState();
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes fuelLevelState data
+ *
+ * @param fuelLevelState
+ * a boolean value
+ */
+ public void setFuelLevelState(Boolean fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the fuelLevelState data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the fuelLevelState data
+ * has been subscribed.
+ */
+ public Boolean getFuelLevelState() {
+ return getBoolean(KEY_FUEL_LEVEL_STATE);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes instantFuelConsumption data
+ *
+ * @param instantFuelConsumption
+ * a boolean value
+ */
+ public void setInstantFuelConsumption(Boolean instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the getInstantFuelConsumption data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the getInstantFuelConsumption data
+ * has been subscribed.
+ */
+ public Boolean getInstantFuelConsumption() {
+ return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes externalTemperature data
+ *
+ * @param externalTemperature
+ * a boolean value
+ */
+ public void setExternalTemperature(Boolean externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the externalTemperature data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the externalTemperature data
+ * has been subscribed.
+ */
+ public Boolean getExternalTemperature() {
+ return getBoolean(KEY_EXTERNAL_TEMPERATURE);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes Currently selected gear data
+ *
+ * @param prndl
+ * a boolean value
+ */
+ public void setPrndl(Boolean prndl) {
+ setParameters(KEY_PRNDL, prndl);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Currently selected gear data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Currently selected gear data
+ * has been subscribed.
+ */
+ public Boolean getPrndl() {
+ return getBoolean(KEY_PRNDL);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes tire pressure status data
+ *
+ * @param tirePressure
+ * a boolean value
+ */
+ public void setTirePressure(Boolean tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the tire pressure status data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the tire pressure status data
+ * has been subscribed.
+ */
+ public Boolean getTirePressure() {
+ return getBoolean(KEY_TIRE_PRESSURE);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes odometer data
+ *
+ * @param odometer
+ * a boolean value
+ */
+ public void setOdometer(Boolean odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the odometer data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the odometer data
+ * has been subscribed.
+ */
+ public Boolean getOdometer() {
+ return getBoolean(KEY_ODOMETER);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes belt Status data
+ *
+ * @param beltStatus
+ * a boolean value
+ */
+ public void setBeltStatus(Boolean beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the belt Status data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the belt Status data
+ * has been subscribed.
+ */
+ public Boolean getBeltStatus() {
+ return getBoolean(KEY_BELT_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes body Information data
+ *
+ * @param bodyInformation
+ * a boolean value
+ */
+ public void setBodyInformation(Boolean bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the body Information data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the body Information data
+ * has been subscribed.
+ */
+ public Boolean getBodyInformation() {
+ return getBoolean(KEY_BODY_INFORMATION);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes device Status data
+ *
+ * @param deviceStatus
+ * a boolean value
+ */
+ public void setDeviceStatus(Boolean deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the device Status data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the device Status data
+ * has been subscribed.
+ */
+ public Boolean getDeviceStatus() {
+ return getBoolean(KEY_DEVICE_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes driver Braking data
+ *
+ * @param driverBraking
+ * a boolean value
+ */
+ public void setDriverBraking(Boolean driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the driver Braking data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the driver Braking data
+ * has been subscribed.
+ */
+ public Boolean getDriverBraking() {
+ return getBoolean(KEY_DRIVER_BRAKING);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes wiper Status data
+ *
+ * @param wiperStatus
+ * a boolean value
+ */
+ public void setWiperStatus(Boolean wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the wiper Status data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the wiper Status data
+ * has been subscribed.
+ */
+ public Boolean getWiperStatus() {
+ return getBoolean(KEY_WIPER_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes Head Lamp Status data
+ *
+ * @param headLampStatus
+ * a boolean value
+ */
+ public void setHeadLampStatus(Boolean headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Head Lamp Status data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Head Lamp Status data
+ * has been subscribed.
+ */
+ public Boolean getHeadLampStatus() {
+ return getBoolean(KEY_HEAD_LAMP_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes Engine Torque data
+ *
+ * @param engineTorque
+ * a boolean value
+ */
+ public void setEngineTorque(Boolean engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Engine Oil Life data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Engine Oil Life data
+ * has been subscribed.
+ */
+ public Boolean getEngineOilLife() {
+ return getBoolean(KEY_ENGINE_OIL_LIFE);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes Engine Oil Life data
+ *
+ * @param engineOilLife
+ * a boolean value
+ */
+ public void setEngineOilLife(Boolean engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Engine Torque data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Engine Torque data
+ * has been subscribed.
+ */
+ public Boolean getEngineTorque() {
+ return getBoolean(KEY_ENGINE_TORQUE);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes accPedalPosition data
+ *
+ * @param accPedalPosition
+ * a boolean value
+ */
+ public void setAccPedalPosition(Boolean accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the accPedalPosition data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the accPedalPosition data
+ * has been subscribed.
+ */
+ public Boolean getAccPedalPosition() {
+ return getBoolean(KEY_ACC_PEDAL_POSITION);
+ }
+
+ public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ }
+
+ public Boolean getSteeringWheelAngle() {
+ return getBoolean(KEY_STEERING_WHEEL_ANGLE);
+ }
+ public void setECallInfo(Boolean eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ }
+ public Boolean getECallInfo() {
+ return getBoolean(KEY_E_CALL_INFO);
+ }
+ public void setAirbagStatus(Boolean airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ }
+ public Boolean getAirbagStatus() {
+ return getBoolean(KEY_AIRBAG_STATUS);
+ }
+ public void setEmergencyEvent(Boolean emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ }
+ public Boolean getEmergencyEvent() {
+ return getBoolean(KEY_EMERGENCY_EVENT);
+ }
+ public void setClusterModeStatus(Boolean clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ }
+ public Boolean getClusterModeStatus() {
+ return getBoolean(KEY_CLUSTER_MODE_STATUS);
+ }
+ public void setMyKey(Boolean myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ }
+ public Boolean getMyKey() {
+ return getBoolean(KEY_MY_KEY);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes fuelRange data
+ *
+ * @param fuelRange
+ * a boolean value
+ */
+ public void setFuelRange(Boolean fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Fuel Range data has been
+ * subscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Fuel Range data
+ * has been subscribed.
+ *
+ */
+ public Boolean getFuelRange() {
+ return getBoolean(KEY_FUEL_RANGE);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes turnSignal data
+ * @param turnSignal a boolean value
+ */
+ public void setTurnSignal(Boolean turnSignal) { setParameters(KEY_TURN_SIGNAL, turnSignal); }
+
+ /**
+ * Gets a boolean value. If true, means the turnSignal data has been subscribed.
+ * @return a Boolean value.
+ */
+ public Boolean getTurnSignal() { return getBoolean(KEY_TURN_SIGNAL); }
+
+ /**
+ * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
+ * @param electronicParkBrakeStatus a boolean value
+ */
+ public void setElectronicParkBrakeStatus(boolean electronicParkBrakeStatus){
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
+ * @return a Boolean value.
+ */
+ public Boolean getElectronicParkBrakeStatus(){
+ return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, subscribes cloudAppVehicleID data
+ * @param cloudAppVehicleID a boolean value
+ */
+ public void setCloudAppVehicleID(boolean cloudAppVehicleID){
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the cloudAppVehicleDataID data has been subscribed.
+ * @return a Boolean value.
+ */
+ public Boolean getCloudAppVehicleID(){
+ return getBoolean(KEY_CLOUD_APP_VEHICLE_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java
new file mode 100644
index 000000000..c045961a3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java
@@ -0,0 +1,517 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Subscribe Vehicle Data Response is sent, when SubscribeVehicleData has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class SubscribeVehicleDataResponse extends RPCResponse {
+ public static final String KEY_SPEED = "speed";
+ public static final String KEY_RPM = "rpm";
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ public static final String KEY_PRNDL = "prndl";
+ public static final String KEY_TIRE_PRESSURE = "tirePressure";
+ public static final String KEY_ENGINE_TORQUE = "engineTorque";
+ public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
+ public static final String KEY_ODOMETER = "odometer";
+ public static final String KEY_GPS = "gps";
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
+ public static final String KEY_BELT_STATUS = "beltStatus";
+ public static final String KEY_BODY_INFORMATION = "bodyInformation";
+ public static final String KEY_DEVICE_STATUS = "deviceStatus";
+ public static final String KEY_DRIVER_BRAKING = "driverBraking";
+ public static final String KEY_WIPER_STATUS = "wiperStatus";
+ public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
+ public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
+ public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
+ public static final String KEY_E_CALL_INFO = "eCallInfo";
+ public static final String KEY_AIRBAG_STATUS = "airbagStatus";
+ public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
+ public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
+ public static final String KEY_MY_KEY = "myKey";
+ public static final String KEY_FUEL_RANGE = "fuelRange";
+ public static final String KEY_TURN_SIGNAL = "turnSignal";
+ public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
+ public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+
+ /**
+ * Constructs a new SubscribeVehicleDataResponse object
+ */
+ public SubscribeVehicleDataResponse() {
+ super(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * <p>Constructs a new SubscribeVehicleDataResponse object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash The Hashtable to use
+ */
+ public SubscribeVehicleDataResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a new SubscribeVehicleDataResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SubscribeVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+ /**
+ * Sets Gps
+ * @param gps a VehicleDataResult related to GPS
+ */
+ public void setGps(VehicleDataResult gps) {
+ setParameters(KEY_GPS, gps);
+ }
+ /**
+ * Gets Gps
+ * @return a VehicleDataResult related to GPS
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getGps() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS);
+ }
+ /**
+ * Sets Speed
+ * @param speed a VehicleDataResult related to speed
+ */
+ public void setSpeed(VehicleDataResult speed) {
+ setParameters(KEY_SPEED, speed);
+ }
+ /**
+ * Gets Speed
+ * @return a VehicleDataResult related to speed
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getSpeed() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED);
+ }
+ /**
+ * Sets rpm
+ * @param rpm a VehicleDataResult related to RPM
+ */
+ public void setRpm(VehicleDataResult rpm) {
+ setParameters(KEY_RPM, rpm);
+ }
+ /**
+ * Gets rpm
+ * @return a VehicleDataResult related to RPM
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getRpm() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_RPM);
+ }
+ /**
+ * Sets Fuel Level
+ * @param fuelLevel a VehicleDataResult related to Fuel Level
+ */
+ public void setFuelLevel(VehicleDataResult fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ }
+ /**
+ * Gets Fuel Level
+ * @return a VehicleDataResult related to FuelLevel
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getFuelLevel() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL);
+ }
+ /**
+ * Sets Fuel Level State
+ * @param fuelLevel_State a VehicleDataResult related to FuelLevel State
+ */
+ @Deprecated
+ public void setFuelLevel_State(VehicleDataResult fuelLevel_State) {
+ setFuelLevel(fuelLevel_State);
+ }
+ /**
+ * Gets Fuel Level State
+ * @return a VehicleDataResult related to FuelLevel State
+ */
+ @Deprecated
+ public VehicleDataResult getFuelLevel_State() {
+ return getFuelLevelState();
+ }
+ /**
+ * Sets Fuel Level State
+ * @param fuelLevelState a VehicleDataResult related to FuelLevel State
+ */
+ public void setFuelLevelState(VehicleDataResult fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ }
+ /**
+ * Gets Fuel Level State
+ * @return a VehicleDataResult related to FuelLevel State
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getFuelLevelState() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE);
+ }
+ /**
+ * Sets Instant Fuel Consumption
+ * @param instantFuelConsumption a VehicleDataResult related to instant fuel consumption
+ */
+ public void setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ }
+ /**
+ * Gets Instant Fuel Consumption
+ * @return a VehicleDataResult related to instant fuel consumption
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getInstantFuelConsumption() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_INSTANT_FUEL_CONSUMPTION);
+ }
+ /**
+ * Sets External Temperature
+ * @param externalTemperature a VehicleDataResult related to external temperature
+ */
+ public void setExternalTemperature(VehicleDataResult externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ }
+ /**
+ * Gets External Temperature
+ * @return a VehicleDataResult related to external temperature
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getExternalTemperature() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE);
+ }
+ /**
+ * Gets currently selected gear data
+ * @param prndl a VehicleDataResult related to the PRNDL status (automatic transmission gear)
+ */
+ public void setPrndl(VehicleDataResult prndl) {
+ setParameters(KEY_PRNDL, prndl);
+ }
+ /**
+ * Gets currently selected gear data
+ * @return a VehicleDataResult related to the PRNDL status (automatic transmission gear)
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getPrndl() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL);
+ }
+ /**
+ * Sets Tire Pressure
+ * @param tirePressure a VehicleDataResult related to tire pressure
+ */
+ public void setTirePressure(VehicleDataResult tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ }
+ /**
+ * Gets Tire Pressure
+ * @return a VehicleDataResult related to tire pressure
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getTirePressure() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE);
+ }
+ /**
+ * Sets Odometer
+ * @param odometer a VehicleDataResult related to the odometer
+ */
+ public void setOdometer(VehicleDataResult odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ }
+ /**
+ * Gets Odometer
+ * @return a VehicleDataResult related to the odometer
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getOdometer() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER);
+ }
+ /**
+ * Sets Belt Status
+ * @param beltStatus a VehicleDataResult related to the seat belt status
+ */
+ public void setBeltStatus(VehicleDataResult beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ }
+ /**
+ * Gets Belt Status
+ * @return a VehicleDataResult related to the seat belt status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getBeltStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BELT_STATUS);
+ }
+ /**
+ * Sets Body Information
+ * @param bodyInformation a VehicleDataResult related to the body info
+ */
+ public void setBodyInformation(VehicleDataResult bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ }
+ /**
+ * Gets Body Information
+ * @return a VehicleDataResult related to the body info
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getBodyInformation() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION);
+ }
+ /**
+ * Sets Device Status
+ * @param deviceStatus a VehicleDataResult related to the device status of the connected device
+ */
+ public void setDeviceStatus(VehicleDataResult deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ }
+ /**
+ * Gets Device Status
+ * @return a VehicleDataResult related to the device status of the connected device
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getDeviceStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DEVICE_STATUS);
+ }
+ /**
+ * Sets Driver Braking
+ * @param driverBraking a VehicleDataResult related to the driver breaking status
+ */
+ public void setDriverBraking(VehicleDataResult driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ }
+ /**
+ * Gets Driver Braking
+ * @return a VehicleDataResult related to the driver breaking status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getDriverBraking() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DRIVER_BRAKING);
+ }
+ /**
+ * Sets Wiper Status
+ * @param wiperStatus a VehicleDataResult related to the wiper status
+ */
+ public void setWiperStatus(VehicleDataResult wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ }
+ /**
+ * Gets Wiper Status
+ * @return a VehicleDataResult related to the wiper status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getWiperStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS);
+ }
+ /**
+ * Sets Head Lamp Status
+ * @param headLampStatus a VehicleDataResult related to the headlamp status
+ */
+ public void setHeadLampStatus(VehicleDataResult headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ }
+ /**
+ * Gets Head Lamp Status
+ * @return a VehicleDataResult related to the headlamp status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getHeadLampStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HEAD_LAMP_STATUS);
+ }
+ /**
+ * Sets Engine Torque
+ * @param engineTorque a VehicleDataResult related to the engine's torque
+ */
+ public void setEngineTorque(VehicleDataResult engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ }
+ /**
+ * Gets Engine Torque
+ * @return a VehicleDataResult related to the engine's torque
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getEngineTorque() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE);
+ }
+ /**
+ * Sets Engine Oil Life
+ * @param engineOilLife a VehicleDataResult related to the engine's oil life
+ */
+ public void setEngineOilLife(VehicleDataResult engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ }
+ /**
+ * Gets Engine Oil Life
+ * @return a VehicleDataResult related to the engine's oil life
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getEngineOilLife() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_OIL_LIFE);
+ }
+ /**
+ * Sets AccPedal Position
+ * @param accPedalPosition a VehicleDataResult related to the accelerator pedal's position
+ */
+ public void setAccPedalPosition(VehicleDataResult accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ }
+ /**
+ * Gets AccPedal Position
+ * @return a VehicleDataResult related to the accelerator pedal's position
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getAccPedalPosition() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ACC_PEDAL_POSITION);
+ }
+
+ public void setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ }
+
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getSteeringWheelAngle() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE);
+ }
+
+ public void setECallInfo(VehicleDataResult eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getECallInfo() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO);
+ }
+ public void setAirbagStatus(VehicleDataResult airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getAirbagStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS);
+ }
+ public void setEmergencyEvent(VehicleDataResult emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getEmergencyEvent() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT);
+ }
+ public void setClusterModeStatus(VehicleDataResult clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getClusterModeStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODE_STATUS);
+ }
+ public void setMyKey(VehicleDataResult myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getMyKey() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_MY_KEY);
+ }
+
+ /**
+ * Sets Fuel Range
+ * @param fuelRange a VehicleDataResult related to the fuel range
+ */
+ public void setFuelRange(VehicleDataResult fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ }
+
+ /**
+ * Gets Fuel Range
+ * @return a VehicleDataResult related to the fuel range
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getFuelRange() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE);
+ }
+
+ /**
+ * Sets turnSignal
+ * @param turnSignal a VehicleDataResult related to the turn signal status
+ */
+ public void setTurnSignal(VehicleDataResult turnSignal) {
+ setParameters(KEY_TURN_SIGNAL, turnSignal);
+ }
+
+ /**
+ * Gets turnSignal
+ * @return a VehicleDataResult related to the turn signal status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getTurnSignal() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL);
+ }
+
+ /**
+ * Sets electronicParkBrakeStatus
+ * @param electronicParkBrakeStatus a VehicleDataResult related to the electronic park brake status
+ */
+ public void setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus){
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ }
+
+ /**
+ * Gets electronicParkBrakeStatus
+ * @return a VehicleDataResult related to the electronic park brake status
+ */
+ public VehicleDataResult getElectronicParkBrakeStatus(){
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ }
+
+ /**
+ * Sets cloudAppVehicleID
+ * @param cloudAppVehicleID a VehicleDataResult related to the cloud app vehicle ID
+ */
+ public void setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID){
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ }
+
+ /**
+ * Gets a VehicleDataResult for the subscription response of the CloudAppVehicleID vehicle data item.
+ * @return a VehicleDataResult related to the cloud app vehicle ID
+ */
+ public VehicleDataResult getCloudAppVehicleID(){
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLOUD_APP_VEHICLE_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPoints.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPoints.java
new file mode 100644
index 000000000..49b208e78
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPoints.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+public class SubscribeWayPoints extends RPCRequest {
+ public SubscribeWayPoints() {
+ super(FunctionID.SUBSCRIBE_WAY_POINTS.toString());
+ }
+ public SubscribeWayPoints(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java
new file mode 100644
index 000000000..1d9e2a6cd
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class SubscribeWayPointsResponse extends RPCResponse {
+
+ public SubscribeWayPointsResponse() {
+ super(FunctionID.SUBSCRIBE_WAY_POINTS.toString());
+ }
+ public SubscribeWayPointsResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SubscribeWayPointsResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SubscribeWayPointsResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
new file mode 100644
index 000000000..82cb366d7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+
+import java.util.Hashtable;
+
+/**
+ * Struct that indicates the a SystemCapabilityType and houses different structs to describe particular capabilities
+ */
+
+public class SystemCapability extends RPCStruct {
+ public static final String KEY_SYSTEM_CAPABILITY_TYPE = "systemCapabilityType";
+ public static final String KEY_NAVIGATION_CAPABILITY = "navigationCapability";
+ public static final String KEY_PHONE_CAPABILITY = "phoneCapability";
+ public static final String KEY_VIDEO_STREAMING_CAPABILITY = "videoStreamingCapability";
+ public static final String KEY_REMOTE_CONTROL_CAPABILITY = "remoteControlCapability";
+ public static final String KEY_APP_SERVICES_CAPABILITIES = "appServicesCapabilities";
+
+ public SystemCapability(){}
+
+ public SystemCapability(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Create a systemCapability object
+ * @param systemCapabilityType The type
+ */
+ public SystemCapability(@NonNull SystemCapabilityType systemCapabilityType){
+ this();
+ setSystemCapabilityType(systemCapabilityType);
+ }
+
+ /**
+ *
+ * @return The SystemCapabilityType that indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist
+ */
+ public SystemCapabilityType getSystemCapabilityType(){
+ return (SystemCapabilityType) getObject(SystemCapabilityType.class, KEY_SYSTEM_CAPABILITY_TYPE);
+ }
+
+ /**
+ * @param value Set the SystemCapabilityType that indicates which type of data should be changed and identifies which data object exists in this struct.
+ */
+ public void setSystemCapabilityType(@NonNull SystemCapabilityType value){
+ setValue(KEY_SYSTEM_CAPABILITY_TYPE, value);
+ }
+
+ public RPCStruct getCapabilityForType(SystemCapabilityType type) {
+ if(type == null) {
+ return null;
+ }else if (type.equals(SystemCapabilityType.NAVIGATION)) {
+ return (RPCStruct) getObject(NavigationCapability.class, KEY_NAVIGATION_CAPABILITY);
+ } else if (type.equals(SystemCapabilityType.PHONE_CALL)) {
+ return (RPCStruct) getObject(PhoneCapability.class, KEY_PHONE_CAPABILITY);
+ } else if (type.equals(SystemCapabilityType.VIDEO_STREAMING)){
+ return (RPCStruct) getObject(VideoStreamingCapability.class, KEY_VIDEO_STREAMING_CAPABILITY);
+ }else if(type.equals(SystemCapabilityType.REMOTE_CONTROL)){
+ return (RPCStruct) getObject(RemoteControlCapabilities.class, KEY_REMOTE_CONTROL_CAPABILITY);
+ }else if(type.equals(SystemCapabilityType.APP_SERVICES)){
+ return (RPCStruct) getObject(AppServicesCapabilities.class, KEY_APP_SERVICES_CAPABILITIES);
+ }else{
+ return null;
+ }
+ }
+
+ public void setCapabilityForType(SystemCapabilityType type, RPCStruct capability){
+ if(type == null) {
+ return;
+ }else if(type.equals(SystemCapabilityType.NAVIGATION)){
+ setValue(KEY_NAVIGATION_CAPABILITY, capability);
+ }else if(type.equals(SystemCapabilityType.PHONE_CALL)){
+ setValue(KEY_PHONE_CAPABILITY, capability);
+ }else if(type.equals(SystemCapabilityType.VIDEO_STREAMING)){
+ setValue(KEY_VIDEO_STREAMING_CAPABILITY, capability);
+ }else if(type.equals(SystemCapabilityType.REMOTE_CONTROL)){
+ setValue(KEY_REMOTE_CONTROL_CAPABILITY, capability);
+ }else if(type.equals(SystemCapabilityType.APP_SERVICES)){
+ setValue(KEY_APP_SERVICES_CAPABILITIES, capability);
+ }else{
+ return;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java
new file mode 100644
index 000000000..90865585a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/** An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests)
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>requestType</td>
+ * <td>RequestType</td>
+ * <td>The type of system request. Note that Proprietary requests should forward the binary data to the known proprietary module on the system.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>requestSubType</td>
+ * <td>String</td>
+ * <td>This parameter is filled for supporting OEM proprietary data exchanges.</td>
+ * <td>N</td>
+ * <td>Max Length: 255</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>fileName</td>
+ * <td>String</td>
+ * <td>Filename of HTTP data to store in predefined system staging area. Mandatory if requestType is HTTP. PROPRIETARY requestType should ignore this parameter. </td>
+ * <td>N</td>
+ * <td>Max Length: 255</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 3.0
+ *
+ *
+ *
+ */
+
+public class SystemRequest extends RPCRequest {
+ public static final String KEY_FILE_NAME = "fileName";
+ public static final String KEY_REQUEST_TYPE = "requestType";
+ public static final String KEY_REQUEST_SUB_TYPE = "requestSubType";
+ public static final String KEY_DATA = "data";
+ /**
+ * Constructs a new SystemRequest object
+ */
+
+ public SystemRequest() {
+ super(FunctionID.SYSTEM_REQUEST.toString());
+ }
+
+ public SystemRequest(boolean bLegacy) {
+ super(FunctionID.ENCODED_SYNC_P_DATA.toString());
+ }
+
+ public SystemRequest(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SystemRequest object
+ * @param requestType The type of system request.
+ */
+ public SystemRequest(@NonNull RequestType requestType){
+ this();
+ setRequestType(requestType);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getLegacyData() {
+ return (List<String>) getObject(String.class, KEY_DATA);
+ }
+
+ public void setLegacyData( List<String> data ) {
+ setParameters(KEY_DATA, data);
+ }
+
+ public String getFileName() {
+ return getString(KEY_FILE_NAME);
+ }
+
+ public void setFileName(String fileName) {
+ setParameters(KEY_FILE_NAME, fileName);
+ }
+
+ public RequestType getRequestType() {
+ return (RequestType) getObject(RequestType.class, KEY_REQUEST_TYPE);
+ }
+
+ public void setRequestType(@NonNull RequestType requestType) {
+ setParameters(KEY_REQUEST_TYPE, requestType);
+ }
+
+ public String getRequestSubType() {
+ return getString(KEY_REQUEST_SUB_TYPE);
+ }
+
+ public void setRequestSubType(String requestSubType) {
+ setParameters(KEY_REQUEST_SUB_TYPE, requestSubType);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java
new file mode 100644
index 000000000..b1b0ce983
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * System Request Response is sent, when SystemRequest has been called
+ *
+ * @since SmartDeviceLink 3.0
+ */
+public class SystemRequestResponse extends RPCResponse {
+ public SystemRequestResponse() {
+ super(FunctionID.SYSTEM_REQUEST.toString());
+ }
+
+ public SystemRequestResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new SystemRequestResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SystemRequestResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java
new file mode 100644
index 000000000..8f73770a7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
+
+import java.util.Hashtable;
+
+/**
+ * <p>Specifies what is to be spoken. This can be simply a text phrase, which SDL will speak according to its own rules.
+ * It can also be phonemes from either the Microsoft SAPI phoneme set, or from the LHPLUS phoneme set.
+ * It can also be a pre-recorded sound in WAV format (either developer-defined, or provided by the SDL platform).</p>
+ *
+ * <p>In SDL, words, and therefore sentences, can be built up from phonemes and are used to explicitly provide the proper pronounciation to the TTS engine.
+ * For example, to have SDL pronounce the word "read" as "red", rather than as when it is pronounced like "reed",
+ * the developer would use phonemes to express this desired pronounciation.</p>
+ * <p>For more information about phonemes, see <a href="http://en.wikipedia.org/wiki/Phoneme">http://en.wikipedia.org/wiki/Phoneme</a></p>.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>text</td>
+ * <td>String</td>
+ * <td>Text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field.</td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>type</td>
+ * <td>SpeechCapabilities</td>
+ * <td>Indicates the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound). </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ */
+public class TTSChunk extends RPCStruct {
+ public static final String KEY_TEXT = "text";
+ public static final String KEY_TYPE = "type";
+ /**
+ * Constructs a newly allocated TTSChunk object
+ */
+ public TTSChunk() { }
+ /**
+ * Constructs a newly allocated TTSChunk object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public TTSChunk(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated TTSChunk object
+ * @param text Text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field.
+ * @param type Indicates the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound).
+ */
+ public TTSChunk(@NonNull String text, @NonNull SpeechCapabilities type){
+ this();
+ setText(text);
+ setType(type);
+ }
+ /**
+ * Get text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field.
+ * @return text to be spoken, or a phoneme specification, or the name of a pre-recorded sound
+ */
+ public String getText() {
+ return getString( KEY_TEXT );
+ }
+ /**
+ * Set the text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field.
+ * @param text to be spoken, or a phoneme specification, or the name of a pre-recorded sound.
+ */
+ public void setText(@NonNull String text ) {
+ setValue(KEY_TEXT, text);
+ }
+ /**
+ * Get the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound).
+ * @return the type of information in the "text" field
+ */
+ public SpeechCapabilities getType() {
+ return (SpeechCapabilities) getObject(SpeechCapabilities.class, KEY_TYPE);
+ }
+ /**
+ * Set the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound).
+ * @param type the type of information in the "text" field
+ */
+ public void setType(@NonNull SpeechCapabilities type ) {
+ setValue(KEY_TYPE, type);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java
new file mode 100644
index 000000000..ac1503ee9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import java.util.Hashtable;
+
+public class Temperature extends RPCStruct{
+ public static final String KEY_UNIT = "unit";
+ public static final String KEY_VALUE = "value";
+
+ public Temperature() { }
+ public Temperature(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Create the temperature object
+ * @param unit Temperature Unit.
+ * @param value Temperature Value in TemperatureUnit specified unit
+ */
+ public Temperature(@NonNull TemperatureUnit unit, @NonNull Float value){
+ this();
+ setUnit(unit);
+ setValue(value);
+ }
+
+ /**
+ * Sets the unit portion of the Temperature class
+ *
+ * @param unit
+ * Temperature Unit.
+ */
+ public void setUnit(@NonNull TemperatureUnit unit) {
+ setValue(KEY_UNIT, unit);
+ }
+
+ /**
+ * Gets the unit portion of the Temperature class
+ *
+ * @return TemperatureUnit - Temperature Unit.
+ */
+ public TemperatureUnit getUnit() {
+ return (TemperatureUnit) getObject(TemperatureUnit.class, KEY_UNIT);
+ }
+
+ /**
+ * Gets the value portion of the Temperature class
+ *
+ * @return Float - Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.
+ */
+ public Float getValue() {
+ Object value = getValue(KEY_VALUE);
+ return SdlDataTypeConverter.objectToFloat(value);
+ }
+
+ /**
+ * Sets the value portion of the Temperature class
+ *
+ * @param value
+ * Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.
+ */
+ public void setValue(@NonNull Float value) {
+ setValue(KEY_VALUE, value);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java
new file mode 100644
index 000000000..aa2e2b2f6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * A color scheme for all display layout templates.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>primaryColor</td>
+ * <td>RGBColor</td>
+ * <td>The primary "accent" color</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>secondaryColor</td>
+ * <td>RGBColor</td>
+ * <td>The secondary "accent" color</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * <tr>
+ * <td>backgroundColor</td>
+ * <td>RGBColor</td>
+ * <td>The color of the background</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 5.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 5.0
+ */
+public class TemplateColorScheme extends RPCStruct {
+
+ public static final String KEY_PRIMARY_COLOR = "primaryColor";
+ public static final String KEY_SECONDARY_COLOR = "secondaryColor";
+ public static final String KEY_BACKGROUND_COLOR = "backgroundColor";
+
+ /**
+ * Constructs a new TemplateColorScheme object
+ */
+ public TemplateColorScheme(){
+ }
+
+ /**
+ * Constructs a new TemplateColorScheme object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public TemplateColorScheme(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the primaryColor of the scheme
+ * @param color an RGBColor object representing the primaryColor
+ */
+ public void setPrimaryColor(RGBColor color) {
+ setValue(KEY_PRIMARY_COLOR, color);
+ }
+
+ /**
+ * Gets the primaryColor of the scheme
+ * @return an RGBColor object representing the primaryColor
+ */
+ public RGBColor getPrimaryColor() {
+ return (RGBColor) getObject(RGBColor.class, KEY_PRIMARY_COLOR);
+ }
+
+ /**
+ * Sets the secondaryColor of the scheme
+ * @param color an RGBColor object representing the secondaryColor
+ */
+ public void setSecondaryColor(RGBColor color) {
+ setValue(KEY_SECONDARY_COLOR, color);
+ }
+
+ /**
+ * Gets the secondaryColor of the scheme
+ * @return an RGBColor object representing the secondaryColor
+ */
+ public RGBColor getSecondaryColor() {
+ return (RGBColor) getObject(RGBColor.class, KEY_SECONDARY_COLOR);
+ }
+
+ /**
+ * Sets the backgroundColor of the scheme
+ * @param color an RGBColor object representing the backgroundColor
+ */
+ public void setBackgroundColor(RGBColor color) {
+ setValue(KEY_BACKGROUND_COLOR, color);
+ }
+
+ /**
+ * Gets the backgroundColor of the scheme
+ * @return an RGBColor object representing the backgroundColor
+ */
+ public RGBColor getBackgroundColor() {
+ return (RGBColor) getObject(RGBColor.class, KEY_BACKGROUND_COLOR);
+ }
+}
+
+
+
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java
new file mode 100644
index 000000000..514b5ba0f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
+import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+
+import java.util.Hashtable;
+
+/**
+ * Struct defining the characteristics of a displayed field on the HMI.
+ * <p><b> Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>name</td>
+ * <td>TextFieldName</td>
+ * <td>Enumeration identifying the field. </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>characterSet</td>
+ * <td>CharacterSet</td>
+ * <td>The character set that is supported in this field. </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>width</td>
+ * <td>Integer</td>
+ * <td>The number of characters in one row of this field.
+ * <ul>
+ * <li>Minvalue="1"</li>
+ * <li>maxvalue="500"</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>rows</td>
+ * <td>Integer</td>
+ * <td>The number of rows for this text field.
+ * <ul>
+ * <li>Minvalue="1"</li>
+ * <li>maxvalue="3"</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 1.0
+ *
+ * @see TextFieldName
+ * @see Alert
+ * @see Show
+ * @see PerformInteraction
+ * @see ScrollableMessage
+ * @see PerformAudioPassThru
+ * @see ShowConstantTbt
+ *
+ */
+public class TextField extends RPCStruct {
+ public static final String KEY_WIDTH = "width";
+ public static final String KEY_CHARACTER_SET = "characterSet";
+ public static final String KEY_ROWS = "rows";
+ public static final String KEY_NAME = "name";
+ /**
+ * Constructs a newly allocated TextField object
+ */
+ public TextField() { }
+ /**
+ * Constructs a newly allocated TextField object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public TextField(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Constructs a newly allocated TextField object
+ * @param name Enumeration identifying the field.
+ * @param characterSet The character set that is supported in this field.
+ * @param width The number of characters in one row of this field.
+ * @param rows The number of rows for this text field.
+ */
+ public TextField(@NonNull TextFieldName name, @NonNull CharacterSet characterSet, @NonNull Integer width, @NonNull Integer rows){
+ this();
+ setName(name);
+ setCharacterSet(characterSet);
+ setWidth(width);
+ setRows(rows);
+ }
+ /**
+ * Get the enumeration identifying the field.
+ * @return the name of TextField
+ */
+ public TextFieldName getName() {
+ return (TextFieldName) getObject(TextFieldName.class, KEY_NAME);
+ }
+ /**
+ * Set the enumeration identifying the field.
+ * @param name the name of TextField
+ */
+ public void setName(@NonNull TextFieldName name ) {
+ setValue(KEY_NAME, name);
+ }
+ /**
+ * Get the character set that is supported in this field.
+ * @return the character set
+ */
+ public CharacterSet getCharacterSet() {
+ return (CharacterSet) getObject(CharacterSet.class, KEY_CHARACTER_SET);
+ }
+ /**
+ * Set the character set that is supported in this field.
+ * @param characterSet - the character set
+ */
+ public void setCharacterSet(@NonNull CharacterSet characterSet ) {
+ setValue(KEY_CHARACTER_SET, characterSet);
+ }
+ /**
+ * Get the number of characters in one row of this field.
+ * <ul>
+ * <li>Minvalue="1"</li>
+ * <li>maxvalue="500"</li>
+ * </ul>
+ * @return the number of characters in one row of this field
+ */
+ public Integer getWidth() {
+ return getInteger( KEY_WIDTH );
+ }
+ /**
+ * Set the number of characters in one row of this field.
+ * <ul>
+ * <li>Minvalue="1"</li>
+ * <li>maxvalue="500"</li>
+ * </ul>
+ * @param width the number of characters in one row of this field
+ */
+ public void setWidth(@NonNull Integer width ) {
+ setValue(KEY_WIDTH, width);
+ }
+ /**
+ *Get the number of rows for this text field.
+ * <ul>
+ * <li>Minvalue="1"</li>
+ * <li>maxvalue="3"</li>
+ * </ul>
+ * @return the number of rows for this text field
+ */
+ public Integer getRows() {
+ return getInteger( KEY_ROWS );
+ }
+ public void setRows(@NonNull Integer rows ) {
+ setValue(KEY_ROWS, rows);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
new file mode 100644
index 000000000..f8bcdbac1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
+
+import java.util.Hashtable;
+
+/** <p>The status and pressure of the tires.</p>
+ * <p><b> Parameter List:</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>PressureTellTale</td>
+ * <td>WarningLightStatus</td>
+ * <td>Status of the Tire Pressure TellTale</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>LeftFront</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the left front tire.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>RightFront</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the right front tire.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>LeftRear</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the left rear tire.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>RightRear</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the right rear tire</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>InnerLeftRear</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the inner left rear tire.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>InnerRightRear</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the inner right rear tire.</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ * @see WarningLightStatus
+ * @see SingleTireStatus
+ * @see GetVehicleData
+ * @see OnVehicleData
+ */
+
+public class TireStatus extends RPCStruct {
+ public static final String KEY_PRESSURE_TELL_TALE = "pressureTellTale";
+ public static final String KEY_LEFT_FRONT = "leftFront";
+ public static final String KEY_RIGHT_FRONT = "rightFront";
+ public static final String KEY_LEFT_REAR = "leftRear";
+ public static final String KEY_INNER_LEFT_REAR = "innerLeftRear";
+ public static final String KEY_INNER_RIGHT_REAR = "innerRightRear";
+ public static final String KEY_RIGHT_REAR = "rightRear";
+
+ public TireStatus() { }
+
+ /**
+ * <p>Constructs a new TireStatus object indicated by the Hashtable parameter</p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public TireStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new TireStatus object
+ * @param pressureTellTale Status of the Tire Pressure TellTale
+ * @param leftFront The status of the left front tire.
+ * @param rightFront The status of the right front tire.
+ * @param leftRear The status of the left rear tire.
+ * @param rightRear The status of the right rear tire
+ * @param innerLeftRear The status of the inner left rear tire.
+ * @param innerRightRear The status of the inner right rear tire.
+ */
+ public TireStatus(@NonNull WarningLightStatus pressureTellTale, @NonNull SingleTireStatus leftFront, @NonNull SingleTireStatus rightFront, @NonNull SingleTireStatus leftRear, @NonNull SingleTireStatus rightRear, @NonNull SingleTireStatus innerLeftRear, @NonNull SingleTireStatus innerRightRear){
+ this();
+ setPressureTellTale(pressureTellTale);
+ setLeftFront(leftFront);
+ setRightFront(rightFront);
+ setLeftRear(leftRear);
+ setRightRear(rightRear);
+ setInnerLeftRear(innerLeftRear);
+ setInnerRightRear(innerRightRear);
+ }
+
+ public void setPressureTellTale(@NonNull WarningLightStatus pressureTellTale) {
+ setValue(KEY_PRESSURE_TELL_TALE, pressureTellTale);
+ }
+ public WarningLightStatus getPressureTellTale() {
+ return (WarningLightStatus) getObject(WarningLightStatus.class, KEY_PRESSURE_TELL_TALE);
+ }
+ public void setLeftFront(@NonNull SingleTireStatus leftFront) {
+ setValue(KEY_LEFT_FRONT, leftFront);
+ }
+ @SuppressWarnings("unchecked")
+ public SingleTireStatus getLeftFront() {
+ return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_FRONT);
+ }
+ public void setRightFront(@NonNull SingleTireStatus rightFront) {
+ setValue(KEY_RIGHT_FRONT, rightFront);
+ }
+ @SuppressWarnings("unchecked")
+ public SingleTireStatus getRightFront() {
+ return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_FRONT);
+ }
+ public void setLeftRear(@NonNull SingleTireStatus leftRear) {
+ setValue(KEY_LEFT_REAR, leftRear);
+ }
+ @SuppressWarnings("unchecked")
+ public SingleTireStatus getLeftRear() {
+ return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_REAR);
+ }
+ public void setRightRear(@NonNull SingleTireStatus rightRear) {
+ setValue(KEY_RIGHT_REAR, rightRear);
+ }
+ @SuppressWarnings("unchecked")
+ public SingleTireStatus getRightRear() {
+ return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_REAR);
+ }
+ public void setInnerLeftRear(@NonNull SingleTireStatus innerLeftRear) {
+ setValue(KEY_INNER_LEFT_REAR, innerLeftRear);
+ }
+ @SuppressWarnings("unchecked")
+ public SingleTireStatus getInnerLeftRear() {
+ return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_INNER_LEFT_REAR);
+ }
+ public void setInnerRightRear(@NonNull SingleTireStatus innerRightRear) {
+ setValue(KEY_INNER_RIGHT_REAR, innerRightRear);
+ }
+ @SuppressWarnings("unchecked")
+ public SingleTireStatus getInnerRightRear() {
+ return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_INNER_RIGHT_REAR);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java
new file mode 100644
index 000000000..a7584ff4b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/**
+ * <p>The x or y coordinate of the touch.</p>
+ *
+ *
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th> Version</th>
+ * </tr>
+ * <tr>
+ * <td>x</td>
+ * <td>Integer</td>
+ * <td>The x coordinate of the touch.</td>
+ * <td>Y</td>
+ * <td>minvalue = 0; maxvalue = 10000</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>y</td>
+ * <td>Integer</td>
+ * <td>The y coordinate of the touch.</td>
+ * <td>Y</td>
+ * <td>minvalue = 0; maxvalue = 10000</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * </table>
+ *@see SoftButtonCapabilities
+ *@see ButtonCapabilities
+ *@see OnButtonPress
+ *
+ *@since SmartDeviceLink 3.0
+ */
+
+public class TouchCoord extends RPCStruct {
+ public static final String KEY_X = "x";
+ public static final String KEY_Y = "y";
+
+ public TouchCoord() {}
+
+ /**
+ * <p>Constructs a new TouchCoord object indicated by the Hashtable parameter</p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public TouchCoord(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new TouchCoord object
+ * @param x The x coordinate of the touch.
+ * @param y The y coordinate of the touch.
+ */
+ public TouchCoord(@NonNull Integer x, @NonNull Integer y){
+ this();
+ setX(x);
+ setY(y);
+ }
+
+ public void setX(@NonNull Integer x) {
+ setValue(KEY_X, x);
+ }
+
+ public Integer getX() {
+ return getInteger(KEY_X);
+ }
+
+ public void setY(@NonNull Integer y) {
+ setValue(KEY_Y, y);
+ }
+
+ public Integer getY() {
+ return getInteger(KEY_Y);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java
new file mode 100644
index 000000000..625a3d462
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * <p>For touchscreen interactions, the mode of how the choices are presented.</p>
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>id</td>
+ * <td>Integer</td>
+ * <td> A touch's unique identifier. The application can track the current touch events by id. If a touch event has type begin, the id should be added to the set of touches. If a touch event has type end, the id should be removed from the set of touches.</td>
+ * <td>N</td>
+ * <td>Min Value: 0; Max Value: 9</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>ts</td>
+ * <td>Float</td>
+ * <td>The time that the touch was recorded. <p> This number can the time since the beginning of the session or something else as long as the units are in milliseconds.</p>
+ * <p>The timestamp is used to determined the rate of change of position of a touch.</p><p>The application also uses the time to verify whether two touches,with different ids, are part of a single action by the user.</p>
+ * <p>If there is only a single timestamp in this array,</p> it is the same for every coordinate in the coordinates array.</td>
+ * <td>Y</td>
+ * <td>minvalue="0" maxvalue="5000000000" minsize="1" maxsize="1000"</td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>c</td>
+ * <td>Integer</td>
+ * <td>The coordinates of the screen area where the touch event occurred.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0</td>
+ * </tr>
+ * </table>
+ *
+ * @since SmartDeviceLink 3.0
+ *
+ * @see SoftButtonCapabilities
+ * @see ButtonCapabilities
+ * @see OnButtonPress
+ */
+
+public class TouchEvent extends RPCStruct {
+ public static final String KEY_ID = "id";
+ public static final String KEY_TS = "ts";
+ public static final String KEY_C = "c";
+
+ public TouchEvent() { }
+ /**
+ * <p>Constructs a new TouchEvent object indicated by the Hashtable parameter</p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public TouchEvent(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new TouchEvent object
+ * @param id A touch's unique identifier.
+ * @param ts The time that the touch was recorded.
+ * @param c The coordinates of the screen area where the touch event occurred.
+ */
+ public TouchEvent(@NonNull Integer id, @NonNull List<Long> ts, @NonNull List<TouchCoord> c){
+ this();
+ setId(id);
+ setTimestamps(ts);
+ setTouchCoordinates(c);
+ }
+
+ public void setId(@NonNull Integer id) {
+ setValue(KEY_ID, id);
+ }
+
+ public Integer getId() {
+ return getInteger(KEY_ID);
+ }
+
+ /**
+ * Use getTimestamps
+ * @deprecated 4.0.2
+ * @return
+ */
+ @Deprecated
+ public List<Long> getTs() {
+ return getTimestamps();
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<Long> getTimestamps() {
+ if(getValue(KEY_TS) instanceof List<?>){
+ List<?> list = (List<?>) getValue(KEY_TS);
+ if(list != null && list.size()>0){
+ Object obj = list.get(0);
+ if(obj instanceof Integer){ //Backwards case
+ int size = list.size();
+ List<Integer> listOfInt = (List<Integer>) list;
+ List<Long> listofLongs = new ArrayList<Long>(size);
+ for(int i = 0; i<size;i++){
+ listofLongs.add(listOfInt.get(i).longValue());
+ }
+ return listofLongs;
+ }else if(obj instanceof Long){
+ return (List<Long>) list;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setTimestamps(@NonNull List<Long> ts){
+ setValue(KEY_TS, ts);
+ }
+
+ /**
+ * Use setTimestamps.
+ * @deprecated 4.0.2
+ * @param ts
+ */
+ @Deprecated
+ public void setTs(List<Long> ts) {
+ setTimestamps(ts);
+ }
+
+ /**
+ * Use getTouchCoordinates
+ * @deprecated 4.0.2
+ * @return
+ */
+ @Deprecated
+ public List<TouchCoord> getC() {
+ return getTouchCoordinates();
+ }
+ @SuppressWarnings("unchecked")
+ public List<TouchCoord> getTouchCoordinates() {
+ return (List<TouchCoord>) getObject(TouchCoord.class, KEY_C);
+ }
+
+ /**
+ * Use setTouchCoordinates
+ * @deprecated 4.0.2
+ * @return
+ */
+ @Deprecated
+ public void setC( List<TouchCoord> c ) {
+ setTouchCoordinates(c);
+ }
+
+ public void setTouchCoordinates(@NonNull List<TouchCoord> c ) {
+ setValue(KEY_C, c);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java
new file mode 100644
index 000000000..d52ca219b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/**
+ * Types of screen touch events available in screen area.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>SmartDeviceLink Version</th>
+ * </tr>
+ * <tr>
+ * <td>pressAvailable</td>
+ * <td>Boolean</td>
+ * <td></td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>multiTouchAvailable</td>
+ * <td>Boolean</td>
+ * <td></td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * <tr>
+ * <td>doublePressAvailable</td>
+ * <td>Boolean</td>
+ * <td></td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 3.0 </td>
+ * </tr>
+ * </table>
+ *
+ */
+public class TouchEventCapabilities extends RPCStruct {
+ public static final String KEY_PRESS_AVAILABLE = "pressAvailable";
+ public static final String KEY_MULTI_TOUCH_AVAILABLE = "multiTouchAvailable";
+ public static final String KEY_DOUBLE_PRESS_AVAILABLE = "doublePressAvailable";
+ public TouchEventCapabilities() {}
+
+ public TouchEventCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Types of screen touch events available in screen area.
+ * @param pressAvailable if press is available
+ * @param multiTouchAvailable if multi touch is available
+ * @param doublePressAvailable if double press is available
+ */
+ public TouchEventCapabilities(@NonNull Boolean pressAvailable, @NonNull Boolean multiTouchAvailable, @NonNull Boolean doublePressAvailable){
+ this();
+ setPressAvailable(pressAvailable);
+ setMultiTouchAvailable(multiTouchAvailable);
+ setDoublePressAvailable(doublePressAvailable);
+ }
+
+ public void setPressAvailable(@NonNull Boolean pressAvailable) {
+ setValue(KEY_PRESS_AVAILABLE, pressAvailable);
+ }
+
+ public Boolean getPressAvailable() {
+ return getBoolean(KEY_PRESS_AVAILABLE);
+ }
+
+ public void setMultiTouchAvailable(@NonNull Boolean multiTouchAvailable) {
+ setValue(KEY_MULTI_TOUCH_AVAILABLE, multiTouchAvailable);
+ }
+
+ public Boolean getMultiTouchAvailable() {
+ return getBoolean(KEY_MULTI_TOUCH_AVAILABLE);
+ }
+
+ public void setDoublePressAvailable(@NonNull Boolean doublePressAvailable) {
+ setValue(KEY_DOUBLE_PRESS_AVAILABLE, doublePressAvailable);
+ }
+
+ public Boolean getDoublePressAvailable() {
+ return getBoolean(KEY_DOUBLE_PRESS_AVAILABLE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java
new file mode 100644
index 000000000..0498023ea
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Describes a navigation turn including an optional icon
+ *
+ * <p><b>Parameter List</p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>navigationText</td>
+ * <td>String</td>
+ * <td>Text to describe the turn (e.g. streetname)
+ * <ul>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>turnIcon</td>
+ * <td>Image</td>
+ * <td>Image to be shown for a turn</td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class Turn extends RPCStruct{
+ public static final String KEY_NAVIGATION_TEXT = "navigationText";
+ public static final String KEY_TURN_IMAGE = "turnIcon";
+
+ public Turn() { }
+ public Turn(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * set the text to describe the turn (e.g. streetname)
+ *
+ * @param navigationText
+ * the text to describe the turn (e.g. streetname)
+ */
+ public void setNavigationText(String navigationText){
+ setValue(KEY_NAVIGATION_TEXT, navigationText);
+ }
+
+ /**
+ * get the text to describe the turn (e.g. streetname)
+ *
+ * @return the text to describe the turn (e.g. streetname)
+ */
+ public String getNavigationText(){
+ return getString(KEY_NAVIGATION_TEXT);
+ }
+
+ /**
+ * set Image to be shown for a turn
+ *
+ * @param turnIcon
+ * the image to be shown for a turn
+ */
+ public void setTurnIcon(Image turnIcon){
+ setValue(KEY_TURN_IMAGE, turnIcon);
+ }
+
+ /**
+ * get the image to be shown for a turn
+ *
+ * @return the image to be shown for a turn
+ */
+ @SuppressWarnings("unchecked")
+ public Image getTurnIcon(){
+ return (Image) getObject(Image.class, KEY_TURN_IMAGE);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterface.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterface.java
new file mode 100644
index 000000000..eb1675a11
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterface.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * Terminates an application's interface registration. This causes SDL&reg; to
+ * dispose of all resources associated with the application's interface
+ * registration (e.g. Command Menu items, Choice Sets, button subscriptions,
+ * etc.)
+ *
+ * <p>After the UnregisterAppInterface operation is performed, no other operations
+ * can be performed until a new app interface registration is established by
+ * calling <i>{@linkplain RegisterAppInterface}</i></p>
+ *
+ * @see RegisterAppInterface
+ * @see OnAppInterfaceUnregistered
+ */
+public class UnregisterAppInterface extends RPCRequest {
+ /**
+ * Constructs a new UnregisterAppInterface object
+ */
+ public UnregisterAppInterface() {
+ super(FunctionID.UNREGISTER_APP_INTERFACE.toString());
+ }
+ /**
+ * <p>Constructs a new UnregisterAppInterface object indicated by the Hashtable
+ * parameter</p>
+ *
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public UnregisterAppInterface(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java
new file mode 100644
index 000000000..b5fa9b990
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Unregister AppInterface Response is sent, when UnregisterAppInterface has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class UnregisterAppInterfaceResponse extends RPCResponse {
+
+ /**
+ * Constructs a new UnregisterAppInterfaceResponse object
+ */
+ public UnregisterAppInterfaceResponse() {
+ super(FunctionID.UNREGISTER_APP_INTERFACE.toString());
+ }
+
+ /**
+ * Constructs a new UnregisterAppInterfaceResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public UnregisterAppInterfaceResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new UnregisterAppInterfaceResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public UnregisterAppInterfaceResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java
new file mode 100644
index 000000000..860772861
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;
+
+import java.util.Hashtable;
+
+/**
+ * Deletes a subscription to button notifications for the specified button. For
+ * more information about button subscriptions, see {@linkplain SubscribeButton}
+ *
+ * <p>Application can unsubscribe from a button that is currently being pressed
+ * (i.e. has not yet been released), but app will not get button event</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>buttonName</td>
+ * <td>ButtonName</td>
+ * <td>Name of the button to unsubscribe.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ *
+ * <p> <b>Response</b></p>
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR </p>
+ * <p>UNSUPPORTED_RESOURCE</p>
+ * <p>IGNORED</p>
+ * <p>REJECTED</p>
+ * @since SmartDeviceLink 1.0
+ * @see SubscribeButton
+ */
+public class UnsubscribeButton extends RPCRequest {
+ public static final String KEY_BUTTON_NAME = "buttonName";
+
+ /**
+ * Constructs a new UnsubscribeButton object
+ */
+ public UnsubscribeButton() {
+ super(FunctionID.UNSUBSCRIBE_BUTTON.toString());
+ }
+ /**
+ * Constructs a new UnsubscribeButton object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public UnsubscribeButton(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new UnsubscribeButton object
+ * @param buttonName Name of the button to unsubscribe.
+ */
+ public UnsubscribeButton(@NonNull ButtonName buttonName){
+ this();
+ setButtonName(buttonName);
+ }
+
+ /**
+ * Gets a name of the button to unsubscribe from
+ *
+ * @return ButtonName -an Enumeration value, see <i> {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i>
+ */
+ public ButtonName getButtonName() {
+ return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
+ }
+ /**
+ * Sets the name of the button to unsubscribe from
+ *
+ * @param buttonName an enum value, see <i> {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i>
+ */
+ public void setButtonName(@NonNull ButtonName buttonName ) {
+ setParameters(KEY_BUTTON_NAME, buttonName);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java
new file mode 100644
index 000000000..3bcfd4898
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Unsubscribe Button Response is sent, when UnsubscribeButton has been called
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public class UnsubscribeButtonResponse extends RPCResponse {
+
+ /**
+ * Constructs a new UnsubscribeButtonResponse object
+ */
+ public UnsubscribeButtonResponse() {
+ super(FunctionID.UNSUBSCRIBE_BUTTON.toString());
+ }
+
+ /**
+ * Constructs a new UnsubscribeButtonResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public UnsubscribeButtonResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new UnsubscribeButtonResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public UnsubscribeButtonResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java
new file mode 100644
index 000000000..134ab5976
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java
@@ -0,0 +1,853 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+/**
+ * This function is used to unsubscribe the notifications from the
+ * subscribeVehicleData function
+ * <p>Function Group: Location, VehicleInfo and DrivingChara</p>
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Reg.</th>
+ * <th>Notes</th>
+ * <th>Version</th>
+ * </tr>
+ * <tr>
+ * <td>gps</td>
+ * <td>Boolean</td>
+ * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData} for details</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>speed</td>
+ * <td>Boolean</td>
+ * <td>The vehicle speed in kilometers per hour</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>rpm</td>
+ * <td>Boolean</td>
+ * <td>The number of revolutions per minute of the engine</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>fuelLevel</td>
+ * <td>Boolean</td>
+ * <td>The fuel level in the tank (percentage)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>fuelLevel_State</td>
+ * <td>Boolean</td>
+ * <td>The fuel level state</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>instantFuelConsumption</td>
+ * <td>Boolean</td>
+ * <td>The instantaneous fuel consumption in microlitres</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>externalTemperature</td>
+ * <td>Boolean</td>
+ * <td>The external temperature in degrees celsius</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>prndl</td>
+ * <td>Boolean</td>
+ * <td>Currently selected gear.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>tirePressure</td>
+ * <td>Boolean</td>
+ * <td>Tire pressure status</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>odometer</td>
+ * <td>Boolean</td>
+ * <td>Odometer in km</td>
+ * <td>N</td>
+ * <td>Max Length: 500</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>beltStatus</td>
+ * <td>Boolean</td>
+ * <td>The status of the seat belts</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>bodyInformation</td>
+ * <td>Boolean</td>
+ * <td>The body information including ignition status and internal temp</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>deviceStatus</td>
+ * <td>Boolean</td>
+ * <td>The device status including signal and battery strength</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>driverBraking</td>
+ * <td>Boolean</td>
+ * <td>The status of the brake pedal</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>wiperStatus</td>
+ * <td>Boolean</td>
+ * <td>The status of the wipers</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>headLampStatus</td>
+ * <td>Boolean</td>
+ * <td>Status of the head lamps</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>engineTorque</td>
+ * <td>Boolean</td>
+ * <td>Torque value for engine (in Nm) on non-diesel variants</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>engineOilLife</td>
+ * <td>Boolean</td>
+ * <td>The estimated percentage of remaining oil life of the engine</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0 </td>
+ * </tr>
+ * <tr>
+ * <td>accPedalPosition</td>
+ * <td>Boolean</td>
+ * <td>Accelerator pedal position (percentage depressed)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>steeringWheelAngle</td>
+ * <td>Boolean</td>
+ * <td>Current angle of the steering wheel (in deg)</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>eCallInfo</td>
+ * <td>Boolean</td>
+ * <td>Emergency Call notification and confirmation data.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>airbagStatus</td>
+ * <td>Boolean</td>
+ * <td>The status of the air bags.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>emergencyEvent</td>
+ * <td>Boolean</td>
+ * <td>Information related to an emergency event (and if it occurred).</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>clusterModeStatus</td>
+ * <td>Boolean</td>
+ * <td>The status modes of the instrument panel cluster.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>myKey</td>
+ * <td>Boolean</td>
+ * <td>Information related to the MyKey feature.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 2.0 </td>
+ * </tr>
+ * <tr>
+ * <td>turnSignal</td>
+ * <td>Boolean</td>
+ * <td>@see TurnSignal</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0 </td>
+ * </tr>
+ * </table>
+ * <p><b> Response</b></p>
+ * <p><b>Non-default Result Codes:</b></p>
+ * <p>SUCCESS</p>
+ * <p>WARNINGS</p>
+ * <p>INVALID_DATA</p>
+ * <p>OUT_OF_MEMORY</p>
+ * <p>TOO_MANY_PENDING_REQUESTS</p>
+ * <p>APPLICATION_NOT_REGISTERED</p>
+ * <p>GENERIC_ERROR</p>
+ * <p>IGNORED</p>
+ * <p>DISALLOWED</p>
+ *
+ * @since SmartDeviceLink 2.0
+ * @see SubscribeVehicleData
+ * @see GetVehicleData
+ */
+public class UnsubscribeVehicleData extends RPCRequest {
+ public static final String KEY_SPEED = "speed";
+ public static final String KEY_RPM = "rpm";
+ public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ public static final String KEY_PRNDL = "prndl";
+ public static final String KEY_TIRE_PRESSURE = "tirePressure";
+ public static final String KEY_ENGINE_TORQUE = "engineTorque";
+ public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
+ public static final String KEY_ODOMETER = "odometer";
+ public static final String KEY_GPS = "gps";
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
+ public static final String KEY_BELT_STATUS = "beltStatus";
+ public static final String KEY_BODY_INFORMATION = "bodyInformation";
+ public static final String KEY_DEVICE_STATUS = "deviceStatus";
+ public static final String KEY_DRIVER_BRAKING = "driverBraking";
+ public static final String KEY_WIPER_STATUS = "wiperStatus";
+ public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
+ public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
+ public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
+ public static final String KEY_E_CALL_INFO = "eCallInfo";
+ public static final String KEY_AIRBAG_STATUS = "airbagStatus";
+ public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
+ public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
+ public static final String KEY_MY_KEY = "myKey";
+ public static final String KEY_FUEL_RANGE = "fuelRange";
+ public static final String KEY_TURN_SIGNAL = "turnSignal";
+ public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
+ public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+
+ /**
+ * Constructs a new UnsubscribeVehicleData object
+ */
+ public UnsubscribeVehicleData() {
+ super(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * Constructs a new UnsubscribeVehicleData object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public UnsubscribeVehicleData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from Gps data
+ *
+ * @param gps
+ * a boolean value
+ */
+ public void setGps(Boolean gps) {
+ setParameters(KEY_GPS, gps);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Gps data has been unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Gps data has been
+ * unsubscribed.
+ */
+ public Boolean getGps() {
+ return getBoolean(KEY_GPS);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from speed data
+ *
+ * @param speed
+ * a boolean value
+ */
+ public void setSpeed(Boolean speed) {
+ setParameters(KEY_SPEED, speed);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Speed data has been unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Speed data has been
+ * unsubscribed.
+ */
+ public Boolean getSpeed() {
+ return getBoolean(KEY_SPEED);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribe data
+ *
+ * @param rpm
+ * a boolean value
+ */
+ public void setRpm(Boolean rpm) {
+ setParameters(KEY_RPM, rpm);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the rpm data has been unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the rpm data has been
+ * unsubscribed.
+ */
+ public Boolean getRpm() {
+ return getBoolean(KEY_RPM);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from FuelLevel data
+ *
+ * @param fuelLevel
+ * a boolean value
+ */
+ public void setFuelLevel(Boolean fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the FuelLevel data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the FuelLevel data has
+ * been unsubscribed.
+ */
+ public Boolean getFuelLevel() {
+ return getBoolean(KEY_FUEL_LEVEL);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from fuelLevel_State data
+ *
+ * @param fuelLevel_State
+ * a boolean value
+ */
+ @Deprecated
+ public void setFuelLevel_State(Boolean fuelLevel_State) {
+ setFuelLevelState(fuelLevel_State);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the fuelLevel_State data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the fuelLevel_State data
+ * has been unsubscribed.
+ */
+ @Deprecated
+ public Boolean getFuelLevel_State() {
+ return getFuelLevelState();
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from fuelLevelState data
+ *
+ * @param fuelLevelState
+ * a boolean value
+ */
+ public void setFuelLevelState(Boolean fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the fuelLevel_State data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the fuelLevelState data
+ * has been unsubscribed.
+ */
+ public Boolean getFuelLevelState() {
+ return getBoolean(KEY_FUEL_LEVEL_STATE);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from instantFuelConsumption data
+ *
+ * @param instantFuelConsumption
+ * a boolean value
+ */
+ public void setInstantFuelConsumption(Boolean instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the getInstantFuelConsumption data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the getInstantFuelConsumption data
+ * has been unsubscribed.
+ */
+ public Boolean getInstantFuelConsumption() {
+ return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from externalTemperature data
+ *
+ * @param externalTemperature
+ * a boolean value
+ */
+ public void setExternalTemperature(Boolean externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the externalTemperature data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the externalTemperature data
+ * has been unsubscribed.
+ */
+ public Boolean getExternalTemperature() {
+ return getBoolean(KEY_EXTERNAL_TEMPERATURE);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes Currently selected gear data
+ *
+ * @param prndl
+ * a boolean value
+ */
+ public void setPrndl(Boolean prndl) {
+ setParameters(KEY_PRNDL, prndl);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Currently selected gear data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Currently selected gear data
+ * has been unsubscribed.
+ */
+ public Boolean getPrndl() {
+ return getBoolean(KEY_PRNDL);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from tire pressure status data
+ *
+ * @param tirePressure
+ * a boolean value
+ */
+ public void setTirePressure(Boolean tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the tire pressure status data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the tire pressure status data
+ * has been unsubscribed.
+ */
+ public Boolean getTirePressure() {
+ return getBoolean(KEY_TIRE_PRESSURE);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from odometer data
+ *
+ * @param odometer
+ * a boolean value
+ */
+ public void setOdometer(Boolean odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the odometer data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the odometer data
+ * has been unsubscribed.
+ */
+ public Boolean getOdometer() {
+ return getBoolean(KEY_ODOMETER);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from belt Status data
+ *
+ * @param beltStatus
+ * a boolean value
+ */
+ public void setBeltStatus(Boolean beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the belt Status data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the belt Status data
+ * has been unsubscribed.
+ */
+ public Boolean getBeltStatus() {
+ return getBoolean(KEY_BELT_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from body Information data
+ *
+ * @param bodyInformation
+ * a boolean value
+ */
+ public void setBodyInformation(Boolean bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the body Information data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the body Information data
+ * has been unsubscribed.
+ */
+ public Boolean getBodyInformation() {
+ return getBoolean(KEY_BODY_INFORMATION);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from device Status data
+ *
+ * @param deviceStatus
+ * a boolean value
+ */
+ public void setDeviceStatus(Boolean deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the device Status data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the device Status data
+ * has been unsubscribed.
+ */
+ public Boolean getDeviceStatus() {
+ return getBoolean(KEY_DEVICE_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from driver Braking data
+ *
+ * @param driverBraking
+ * a boolean value
+ */
+ public void setDriverBraking(Boolean driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the driver Braking data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the driver Braking data
+ * has been unsubscribed.
+ */
+ public Boolean getDriverBraking() {
+ return getBoolean(KEY_DRIVER_BRAKING);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from wiper Status data
+ *
+ * @param wiperStatus
+ * a boolean value
+ */
+ public void setWiperStatus(Boolean wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the wiper Status data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the wiper Status data
+ * has been unsubscribed.
+ */
+ public Boolean getWiperStatus() {
+ return getBoolean(KEY_WIPER_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from Head Lamp Status data
+ *
+ * @param headLampStatus
+ * a boolean value
+ */
+ public void setHeadLampStatus(Boolean headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Head Lamp Status data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Head Lamp Status data
+ * has been unsubscribed.
+ */
+ public Boolean getHeadLampStatus() {
+ return getBoolean(KEY_HEAD_LAMP_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from Engine Torque data
+ *
+ * @param engineTorque
+ * a boolean value
+ */
+ public void setEngineTorque(Boolean engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Engine Torque data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Engine Torque data
+ * has been unsubscribed.
+ */
+ public Boolean getEngineTorque() {
+ return getBoolean(KEY_ENGINE_TORQUE);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from Engine Oil Life data
+ *
+ * @param engineOilLife
+ * a boolean value
+ */
+ public void setEngineOilLife(Boolean engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the Engine Oil Life data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the Engine Oil Life data
+ * has been unsubscribed.
+ */
+ public Boolean getEngineOilLife() {
+ return getBoolean(KEY_ENGINE_OIL_LIFE);
+ }
+
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from accPedalPosition data
+ *
+ * @param accPedalPosition
+ * a boolean value
+ */
+ public void setAccPedalPosition(Boolean accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the accPedalPosition data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the accPedalPosition data
+ * has been unsubscribed.
+ */
+ public Boolean getAccPedalPosition() {
+ return getBoolean(KEY_ACC_PEDAL_POSITION);
+ }
+
+ public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ }
+
+ public Boolean getSteeringWheelAngle() {
+ return getBoolean(KEY_STEERING_WHEEL_ANGLE);
+ }
+
+ public void setECallInfo(Boolean eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ }
+ public Boolean getECallInfo() {
+ return getBoolean(KEY_E_CALL_INFO);
+ }
+ public void setAirbagStatus(Boolean airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ }
+ public Boolean getAirbagStatus() {
+ return getBoolean(KEY_AIRBAG_STATUS);
+ }
+ public void setEmergencyEvent(Boolean emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ }
+ public Boolean getEmergencyEvent() {
+ return getBoolean(KEY_EMERGENCY_EVENT);
+ }
+ public void setClusterModeStatus(Boolean clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ }
+ public Boolean getClusterModeStatus() {
+ return getBoolean(KEY_CLUSTER_MODE_STATUS);
+ }
+ public void setMyKey(Boolean myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ }
+ public Boolean getMyKey() {
+ return getBoolean(KEY_MY_KEY);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from fuelRange data
+ *
+ * @param fuelRange
+ * a boolean value
+ */
+ public void setFuelRange(Boolean fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the fuelRange data has been
+ * unsubscribed.
+ *
+ * @return Boolean -a Boolean value. If true, means the fuelRange data
+ * has been unsubscribed.
+ */
+ public Boolean getFuelRange() {
+ return getBoolean(KEY_FUEL_RANGE);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from turnSignal data
+ * @param turnSignal a boolean value
+ */
+ public void setTurnSignal(Boolean turnSignal) { setParameters(KEY_TURN_SIGNAL, turnSignal); }
+
+ /**
+ * Gets a boolean value. If true, means the turnSignal data has been unsubscribed.
+ * @return a Boolean value.
+ */
+ public Boolean getTurnSignal() { return getBoolean(KEY_TURN_SIGNAL); }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from electronicParkBrakeStatus data
+ * @param electronicParkBrakeStatus a boolean value
+ */
+ public void setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus) {
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
+ * @return a Boolean value.
+ */
+ public Boolean getElectronicParkBrakeStatus() {
+ return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ }
+
+ /**
+ * Sets a boolean value. If true, unsubscribes from cloudAppVehicleID data
+ * @param cloudAppVehicleID a boolean value.
+ */
+ public void setCloudAppVehicleID(boolean cloudAppVehicleID){
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ }
+
+ /**
+ * Gets a boolean value. If true, means the cloudAppVehicleID data has been unsubscribed.
+ * @return a Boolean value.
+ */
+ public Boolean getCloudAppVehicleID(){
+ return getBoolean( KEY_CLOUD_APP_VEHICLE_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java
new file mode 100644
index 000000000..6b3fb499f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java
@@ -0,0 +1,519 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Unsubscribe Vehicle Data Response is sent, when UnsubscribeVehicleData has been called.
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class UnsubscribeVehicleDataResponse extends RPCResponse {
+ public static final String KEY_SPEED = "speed";
+ public static final String KEY_RPM = "rpm";
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ public static final String KEY_PRNDL = "prndl";
+ public static final String KEY_TIRE_PRESSURE = "tirePressure";
+ public static final String KEY_ENGINE_TORQUE = "engineTorque";
+ public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
+ public static final String KEY_ODOMETER = "odometer";
+ public static final String KEY_GPS = "gps";
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
+ public static final String KEY_BELT_STATUS = "beltStatus";
+ public static final String KEY_BODY_INFORMATION = "bodyInformation";
+ public static final String KEY_DEVICE_STATUS = "deviceStatus";
+ public static final String KEY_DRIVER_BRAKING = "driverBraking";
+ public static final String KEY_WIPER_STATUS = "wiperStatus";
+ public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
+ public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
+ public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
+ public static final String KEY_E_CALL_INFO = "eCallInfo";
+ public static final String KEY_AIRBAG_STATUS = "airbagStatus";
+ public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
+ public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
+ public static final String KEY_MY_KEY = "myKey";
+ public static final String KEY_FUEL_RANGE = "fuelRange";
+ public static final String KEY_TURN_SIGNAL = "turnSignal";
+ public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
+ public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
+
+ /**
+ * Constructs a new UnsubscribeVehicleDataResponse object
+ */
+ public UnsubscribeVehicleDataResponse() {
+ super(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString());
+ }
+
+ /**
+ * Constructs a new UnsubscribeVehicleDataResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public UnsubscribeVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+ /**
+ * Constructs a new UnsubscribeVehicleDataResponse object indicated by the Hashtable
+ * parameter
+ * <p></p>
+ *
+ * @param hash The Hashtable to use to build this RPC
+ *
+ */
+ public UnsubscribeVehicleDataResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+ /**
+ * Sets Gps
+ * @param gps a VehicleDataResult related to GPS
+ */
+ public void setGps(VehicleDataResult gps) {
+ setParameters(KEY_GPS, gps);
+ }
+ /**
+ * Gets Gps
+ * @return a VehicleDataResult related to GPS
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getGps() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS);
+ }
+ /**
+ * Sets Speed
+ * @param speed a VehicleDataResult related to speed
+ */
+ public void setSpeed(VehicleDataResult speed) {
+ setParameters(KEY_SPEED, speed);
+ }
+ /**
+ * Gets Speed
+ * @return a VehicleDataResult related to speed
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getSpeed() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED);
+ }
+ /**
+ * Sets rpm
+ * @param rpm a VehicleDataResult related to RPM
+ */
+ public void setRpm(VehicleDataResult rpm) {
+ setParameters(KEY_RPM, rpm);
+ }
+ /**
+ * Gets rpm
+ * @return a VehicleDataResult related to RPM
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getRpm() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_RPM);
+ }
+ /**
+ * Sets Fuel Level
+ * @param fuelLevel a VehicleDataResult related to Fuel Level
+ */
+ public void setFuelLevel(VehicleDataResult fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ }
+ /**
+ * Gets Fuel Level
+ * @return a VehicleDataResult related to FuelLevel
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getFuelLevel() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL);
+ }
+ /**
+ * Sets Fuel Level State
+ * @param fuelLevel_State a VehicleDataResult related to FuelLevel State
+ */
+ @Deprecated
+ public void setFuelLevel_State(VehicleDataResult fuelLevel_State) {
+ setFuelLevel(fuelLevel_State);
+ }
+ /**
+ * Gets Fuel Level State
+ * @return a VehicleDataResult related to FuelLevel State
+ */
+ @Deprecated
+ public VehicleDataResult getFuelLevel_State() {
+ return getFuelLevelState();
+ }
+ /**
+ * Sets Fuel Level State
+ * @param fuelLevelState a VehicleDataResult related to FuelLevel State
+ */
+ public void setFuelLevelState(VehicleDataResult fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ }
+ /**
+ * Gets Fuel Level State
+ * @return a VehicleDataResult related to FuelLevel State
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getFuelLevelState() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE);
+ }
+ /**
+ * Sets Instant Fuel Consumption
+ * @param instantFuelConsumption a VehicleDataResult related to instant fuel consumption
+ */
+ public void setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ }
+ /**
+ * Gets Instant Fuel Consumption
+ * @return a VehicleDataResult related to instant fuel consumption
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getInstantFuelConsumption() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_INSTANT_FUEL_CONSUMPTION);
+ }
+ /**
+ * Sets External Temperature
+ * @param externalTemperature a VehicleDataResult related to external temperature
+ */
+ public void setExternalTemperature(VehicleDataResult externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ }
+ /**
+ * Gets External Temperature
+ * @return a VehicleDataResult related to external temperature
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getExternalTemperature() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE);
+ }
+ /**
+ * Gets currently selected gear data
+ * @param prndl a VehicleDataResult related to the PRNDL status (automatic transmission gear)
+ */
+ public void setPrndl(VehicleDataResult prndl) {
+ setParameters(KEY_PRNDL, prndl);
+ }
+ /**
+ * Gets currently selected gear data
+ * @return a VehicleDataResult related to the PRNDL status (automatic transmission gear)
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getPrndl() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL);
+ }
+ /**
+ * Sets Tire Pressure
+ * @param tirePressure a VehicleDataResult related to tire pressure
+ */
+ public void setTirePressure(VehicleDataResult tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ }
+ /**
+ * Gets Tire Pressure
+ * @return a VehicleDataResult related to tire pressure
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getTirePressure() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE);
+ }
+ /**
+ * Sets Odometer
+ * @param odometer a VehicleDataResult related to the odometer
+ */
+ public void setOdometer(VehicleDataResult odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ }
+ /**
+ * Gets Odometer
+ * @return a VehicleDataResult related to the odometer
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getOdometer() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER);
+ }
+ /**
+ * Sets Belt Status
+ * @param beltStatus a VehicleDataResult related to the seat belt status
+ */
+ public void setBeltStatus(VehicleDataResult beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ }
+ /**
+ * Gets Belt Status
+ * @return a VehicleDataResult related to the seat belt status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getBeltStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BELT_STATUS);
+ }
+ /**
+ * Sets Body Information
+ * @param bodyInformation a VehicleDataResult related to the body info
+ */
+ public void setBodyInformation(VehicleDataResult bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ }
+ /**
+ * Gets Body Information
+ * @return a VehicleDataResult related to the body info
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getBodyInformation() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION);
+ }
+ /**
+ * Sets Device Status
+ * @param deviceStatus a VehicleDataResult related to the device status of the connected device
+ */
+ public void setDeviceStatus(VehicleDataResult deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ }
+ /**
+ * Gets Device Status
+ * @return a VehicleDataResult related to the device status of the connected device
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getDeviceStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DEVICE_STATUS);
+ }
+ /**
+ * Sets Driver Braking
+ * @param driverBraking a VehicleDataResult related to the driver breaking status
+ */
+ public void setDriverBraking(VehicleDataResult driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ }
+ /**
+ * Gets Driver Braking
+ * @return a VehicleDataResult related to the driver breaking status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getDriverBraking() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DRIVER_BRAKING);
+ }
+ /**
+ * Sets Wiper Status
+ * @param wiperStatus a VehicleDataResult related to the wiper status
+ */
+ public void setWiperStatus(VehicleDataResult wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ }
+ /**
+ * Gets Wiper Status
+ * @return a VehicleDataResult related to the wiper status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getWiperStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS);
+ }
+ /**
+ * Sets Head Lamp Status
+ * @param headLampStatus a VehicleDataResult related to the headlamp status
+ */
+ public void setHeadLampStatus(VehicleDataResult headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ }
+ /**
+ * Gets Head Lamp Status
+ * @return a VehicleDataResult related to the headlamp status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getHeadLampStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HEAD_LAMP_STATUS);
+ }
+ /**
+ * Sets Engine Torque
+ * @param engineTorque a VehicleDataResult related to the engine's torque
+ */
+ public void setEngineTorque(VehicleDataResult engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ }
+ /**
+ * Gets Engine Torque
+ * @return a VehicleDataResult related to the enginer's torque
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getEngineTorque() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE);
+ }
+ /**
+ * Sets Engine Oil Life
+ * @param engineOilLife a VehicleDataResult related to the engine's oil life
+ */
+ public void setEngineOilLife(VehicleDataResult engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ }
+ /**
+ * Gets Engine Oil Life
+ * @return a VehicleDataResult related to the engine's oil life
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getEngineOilLife() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_OIL_LIFE);
+ }
+ /**
+ * Sets AccPedal Position
+ * @param accPedalPosition a VehicleDataResult related to the accelerator pedal's position
+ */
+ public void setAccPedalPosition(VehicleDataResult accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ }
+ /**
+ * Gets AccPedal Position
+ * @return a VehicleDataResult related to the accelerator pedal's position
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getAccPedalPosition() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ACC_PEDAL_POSITION);
+ }
+
+ public void setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ }
+
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getSteeringWheelAngle() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE);
+ }
+
+ public void setECallInfo(VehicleDataResult eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getECallInfo() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO);
+ }
+ public void setAirbagStatus(VehicleDataResult airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getAirbagStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS);
+ }
+ public void setEmergencyEvent(VehicleDataResult emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getEmergencyEvent() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT);
+ }
+ public void setClusterModeStatus(VehicleDataResult clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getClusterModeStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODE_STATUS);
+ }
+ public void setMyKey(VehicleDataResult myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ }
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getMyKey() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_MY_KEY);
+ }
+
+ /**
+ * Sets Fuel Range
+ * @param fuelRange a VehicleDataResult related to the fuel range
+ */
+ public void setFuelRange(VehicleDataResult fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ }
+
+ /**
+ * Gets Fuel Range
+ * @return a VehicleDataResult related to the fuel range
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getFuelRange() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE);
+ }
+
+ /**
+ * Sets turnSignal
+ * @param turnSignal a VehicleDataResult related to the turn signal status
+ */
+ public void setTurnSignal(VehicleDataResult turnSignal) {
+ setParameters(KEY_TURN_SIGNAL, turnSignal);
+ }
+
+ /**
+ * Gets turnSignal
+ * @return a VehicleDataResult related to the turn signal status
+ */
+ @SuppressWarnings("unchecked")
+ public VehicleDataResult getTurnSignal() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL);
+ }
+
+ /**
+ * Sets electronicParkBrakeStatus
+ * @param electronicParkBrakeStatus a VehicleDataResult related to the electronic park brake status
+ */
+ public void setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus){
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ }
+
+ /**
+ * Gets electronicParkBrakeStatus
+ * @return a VehicleDataResult related to the electronic park brake status
+ */
+ public VehicleDataResult getElectronicParkBrakeStatus(){
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
+ }
+
+ /**
+ * Sets cloudAppVehicleID
+ * @param cloudAppVehicleID a VehicleDataResult related to the cloud app vehicle ID
+ */
+ public void setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID){
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ }
+
+ /**
+ * Gets a VehicleDataResult for the unsubscribe response of the CloudAppVehicleID vehicle data item.
+ * @return a VehicleDataResult related to the cloud app vehicle ID
+ */
+ public VehicleDataResult getCloudAppVehicleID(){
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLOUD_APP_VEHICLE_ID);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPoints.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPoints.java
new file mode 100644
index 000000000..a20845c38
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPoints.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+
+public class UnsubscribeWayPoints extends RPCRequest {
+ public UnsubscribeWayPoints() {
+ super(FunctionID.UNSUBSCRIBE_WAY_POINTS.toString());
+ }
+ public UnsubscribeWayPoints(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java
new file mode 100644
index 000000000..b49536bf2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+public class UnsubscribeWayPointsResponse extends RPCResponse {
+
+ public UnsubscribeWayPointsResponse() {
+ super(FunctionID.UNSUBSCRIBE_WAY_POINTS.toString());
+ }
+ public UnsubscribeWayPointsResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new UnsubscribeWayPointsResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public UnsubscribeWayPointsResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java
new file mode 100644
index 000000000..cafd04d88
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCRequest;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Updates the list of next maneuvers, which can be requested by the user pressing the softbutton "Turns" on the
+ * Navigation base screen. Three softbuttons are predefined by the system: Up, Down, Close
+ *
+ * <p>Function Group: Navigation</p>
+ *
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
+ *
+ *
+ * @since SmartDeviceLink 2.0
+ * @see ShowConstantTbt
+ */
+public class UpdateTurnList extends RPCRequest{
+ public static final String KEY_TURN_LIST = "turnList";
+ public static final String KEY_SOFT_BUTTONS = "softButtons";
+
+ /**
+ * Constructs a new UpdateTurnList object
+ */
+ public UpdateTurnList() {
+ super(FunctionID.UPDATE_TURN_LIST.toString());
+ }
+
+ /**
+ * <p>
+ * Constructs a new UpdateTurnList object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
+ public UpdateTurnList(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets a list of turns to be shown to the user
+ *
+ * @param turnList
+ * a List<Turn> value representing a list of turns to be shown to the user
+ * <p>
+ * <b>Notes: </b>Minsize=1; Maxsize=100</p>
+ */
+ public void setTurnList(List<Turn> turnList){
+ setParameters(KEY_TURN_LIST, turnList);
+ }
+
+ /**
+ * Gets a list of turns to be shown to the user
+ *
+ * @return List<Turn> -a List value representing a list of turns
+ */
+ @SuppressWarnings("unchecked")
+ public List<Turn> getTurnList(){
+ return (List<Turn>) getObject(Turn.class, KEY_TURN_LIST);
+ }
+
+ /**
+ * Gets the SoftButton List object
+ *
+ * @return List<SoftButton> -a List<SoftButton> representing the List object
+ * @since SmartDeviceLink 2.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<SoftButton> getSoftButtons(){
+ return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
+ }
+
+ /**
+ * Sets the SoftButtons
+ *
+ * @param softButtons
+ * a List<SoftButton> value
+ * <p>
+ * <b>Notes: </b></p>
+ * <ul>
+ * <li>If omitted on supported displays, the alert will not have any SoftButton</li>
+ * <li>ArrayMin: 0</li>
+ * <li>ArrayMax: 1</li>
+ * </ul>
+ * @since SmartDeviceLink 2.0
+ */
+
+ public void setSoftButtons(List<SoftButton> softButtons){
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java
new file mode 100644
index 000000000..d29ffafc7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Hashtable;
+
+/**
+ * Update Turn List Response is sent, when UpdateTurnList has been called
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public class UpdateTurnListResponse extends RPCResponse{
+
+ /**
+ * Constructs a new UpdateTurnListResponse object
+ */
+ public UpdateTurnListResponse() {
+ super(FunctionID.UPDATE_TURN_LIST.toString());
+ }
+
+ public UpdateTurnListResponse(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a new UpdateTurnListResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public UpdateTurnListResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java
new file mode 100644
index 000000000..09bd9bcbe
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
+
+import java.util.Hashtable;
+/**
+ *
+ * Individual published data request result.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>dataType</td>
+ * <td>VehicleDataType</td>
+ * <td>Defined published data element type.</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * <tr>
+ * <td>resultCode</td>
+ * <td>VehicleDataResultCode</td>
+ * <td>Published data result code.</td>
+ * <td></td>
+ * <td></td>
+ * <td>SmartDeviceLink 1.0</td>
+ * </tr>
+ * </table>
+ *
+ */
+public class VehicleDataResult extends RPCStruct {
+ public static final String KEY_DATA_TYPE = "dataType";
+ public static final String KEY_RESULT_CODE = "resultCode";
+
+ public VehicleDataResult() { }
+ /**
+ * <p>
+ * Constructs a new VehicleDataResult object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash the Hashtable to use
+ */
+ public VehicleDataResult(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Individual published data request result.
+ * @param dataType Defined published data element type.
+ * @param resultCode Published data result code.
+ */
+ public VehicleDataResult(@NonNull VehicleDataType dataType, @NonNull VehicleDataResultCode resultCode){
+ this();
+ setDataType(dataType);
+ setResultCode(resultCode);
+ }
+
+ public void setDataType(@NonNull VehicleDataType dataType) {
+ setValue(KEY_DATA_TYPE, dataType);
+ }
+ public VehicleDataType getDataType() {
+ return (VehicleDataType) getObject(VehicleDataType.class, KEY_DATA_TYPE);
+ }
+ public void setResultCode(@NonNull VehicleDataResultCode resultCode) {
+ setValue(KEY_RESULT_CODE, resultCode);
+ }
+ public VehicleDataResultCode getResultCode() {
+ return (VehicleDataResultCode) getObject(VehicleDataResultCode.class, KEY_RESULT_CODE);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java
new file mode 100644
index 000000000..5858ce39e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Describes the type of vehicle the mobile phone is connected with.
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>SmartDeviceLink Ver. Available</th>
+ * </tr>
+ * <tr>
+ * <td>make</td>
+ * <td>String</td>
+ * <td>Make of the vehicle
+ * <ul>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>Model</td>
+ * <td>String</td>
+ * <td>Model of the vehicle, e.g. Fiesta
+ * <ul>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>modelYear</td>
+ * <td>String</td>
+ * <td>Model Year of the vehicle, e.g. 2013
+ * <ul>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * <tr>
+ * <td>trim</td>
+ * <td>String</td>
+ * <td>Trim of the vehicle, e.g. SE
+ * <ul>
+ * <li>Maxlength = 500</li>
+ * </ul>
+ * </td>
+ * <td>SmartDeviceLink 2.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 2.0
+ */
+public class VehicleType extends RPCStruct {
+ public static final String KEY_MAKE = "make";
+ public static final String KEY_MODEL = "model";
+ public static final String KEY_MODEL_YEAR = "modelYear";
+ public static final String KEY_TRIM = "trim";
+
+ /**
+ * Constructs a newly allocated VehicleType object
+ */
+ public VehicleType() { }
+
+ /**
+ * Constructs a newly allocated VehicleType object indicated by the Hashtable parameter
+ * @param hash The Hashtable to use
+ */
+ public VehicleType(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * get the make of the vehicle
+ * @return the make of the vehicle
+ */
+ public String getMake() {
+ return getString(KEY_MAKE);
+ }
+
+ /**
+ * set the make of the vehicle
+ *@param make the make of the vehicle
+ */
+ public void setMake(String make) {
+ setValue(KEY_MAKE, make);
+ }
+
+ /**
+ * get the model of the vehicle
+ * @return the model of the vehicle
+ */
+ public String getModel() {
+ return getString(KEY_MODEL);
+ }
+
+ /**
+ * set the model of the vehicle
+ * @param model the model of the vehicle
+ */
+ public void setModel(String model) {
+ setValue(KEY_MODEL, model);
+ }
+
+ /**
+ * get the model year of the vehicle
+ * @return the model year of the vehicle
+ */
+ public String getModelYear() {
+ return getString(KEY_MODEL_YEAR);
+ }
+
+ /**
+ * set the model year of the vehicle
+ * @param modelYear the model year of the vehicle
+ */
+ public void setModelYear(String modelYear) {
+ setValue(KEY_MODEL_YEAR, modelYear);
+ }
+
+ /**
+ * get the trim of the vehicle
+ * @return the trim of the vehicle
+ */
+ public String getTrim() {
+ return getString(KEY_TRIM);
+ }
+
+ /**
+ * set the trim of the vehicle
+ * @param trim the trim of the vehicle
+ */
+ public void setTrim(String trim) {
+ setValue(KEY_TRIM, trim);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java
new file mode 100644
index 000000000..e3bd9425c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Contains information about this system's video streaming capabilities.
+ */
+
+public class VideoStreamingCapability extends RPCStruct {
+ public static final String KEY_PREFERRED_RESOLUTION = "preferredResolution";
+ public static final String KEY_MAX_BITRATE = "maxBitrate";
+ public static final String KEY_SUPPORTED_FORMATS = "supportedFormats";
+ public static final String KEY_HAPTIC_SPATIAL_DATA_SUPPORTED = "hapticSpatialDataSupported";
+
+ public VideoStreamingCapability(){}
+ public VideoStreamingCapability(Hashtable<String, Object> hash){super(hash);}
+
+ public void setPreferredResolution(ImageResolution res){
+ setValue(KEY_PREFERRED_RESOLUTION, res);
+ }
+
+ public ImageResolution getPreferredResolution(){
+ return (ImageResolution) getObject(ImageResolution.class, KEY_PREFERRED_RESOLUTION);
+ }
+
+ /**
+ * Set the max bitrate supported by this module.
+ *
+ * <b>NOTE: </b> Unit is in kbps.
+ * @param maxBitrate in kbps
+ */
+ public void setMaxBitrate(Integer maxBitrate){
+ setValue(KEY_MAX_BITRATE, maxBitrate);
+ }
+
+ /**
+ * Retrieves the max bitrate supported by this module.
+ *
+ * <b>NOTE: </b> Unit is in kbps.
+ * @return max bitrate in kbps
+ */
+ public Integer getMaxBitrate(){
+ return getInteger(KEY_MAX_BITRATE);
+ }
+
+ public void setSupportedFormats(List<VideoStreamingFormat> formats){
+ setValue(KEY_SUPPORTED_FORMATS, formats);
+ }
+
+ public List<VideoStreamingFormat> getSupportedFormats(){
+ return (List<VideoStreamingFormat>) getObject(VideoStreamingFormat.class, KEY_SUPPORTED_FORMATS);
+ }
+
+ public Boolean getIsHapticSpatialDataSupported() {
+ return getBoolean(KEY_HAPTIC_SPATIAL_DATA_SUPPORTED);
+ }
+
+ public void setIsHapticSpatialDataSupported(Boolean hapticSpatialDataSupported) {
+ setValue(KEY_HAPTIC_SPATIAL_DATA_SUPPORTED, hapticSpatialDataSupported);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java
new file mode 100644
index 000000000..afad87256
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+
+import java.util.Hashtable;
+
+/**
+ * Video streaming formats and their specifications.
+ */
+
+public class VideoStreamingFormat extends RPCStruct {
+ public static final String KEY_PROTOCOL = "protocol";
+ public static final String KEY_CODEC = "codec";
+
+ public VideoStreamingFormat(){}
+ public VideoStreamingFormat(Hashtable<String, Object> hash){super(hash);}
+
+ /**
+ * Create the VideoStreamingFormat object
+ * @param protocol The protocol used
+ * @param codec The codec used
+ */
+ public VideoStreamingFormat(@NonNull VideoStreamingProtocol protocol, @NonNull VideoStreamingCodec codec){
+ this();
+ setProtocol(protocol);
+ setCodec(codec);
+ }
+
+ public void setProtocol(@NonNull VideoStreamingProtocol protocol){
+ setValue(KEY_PROTOCOL, protocol);
+ }
+
+ public VideoStreamingProtocol getProtocol(){
+ return (VideoStreamingProtocol) getObject(VideoStreamingProtocol.class, KEY_PROTOCOL);
+ }
+
+ public void setCodec(@NonNull VideoStreamingCodec codec){
+ setValue(KEY_CODEC, codec);
+ }
+
+ public VideoStreamingCodec getCodec(){
+ return (VideoStreamingCodec) getObject(VideoStreamingCodec.class, KEY_CODEC);
+ }
+
+ @Override
+ public String toString() {
+ return "codec=" + String.valueOf(getCodec()) +
+ ", protocol=" + String.valueOf(getProtocol());
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java
new file mode 100644
index 000000000..fcfa55f5f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+/**
+ *
+ * VR help items i.e. the text strings to be displayed, and when pronounced by the user the recognition of any of which must trigger the corresponding VR command.
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th> Req.</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>text</td>
+ * <td>String</td>
+ * <td>Text to display for VR Help item</td>
+ * <td>Y</td>
+ * <td>maxlength: 500</td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * <tr>
+ * <td>image</td>
+ * <td>Image</td>
+ * <td>Image struct for VR Help item</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * <tr>
+ * <td>position</td>
+ * <td>Integer</td>
+ * <td>Position to display item in VR Help list</td>
+ * <td>N</td>
+ * <td> minvalue=1; maxvalue=100</td>
+ * <td>SmartDeviceLink 2.3.2</td>
+ * </tr>
+ * </table>
+ *
+ */
+public class VrHelpItem extends RPCStruct {
+ public static final String KEY_POSITION = "position";
+ public static final String KEY_TEXT = "text";
+ public static final String KEY_IMAGE = "image";
+
+ public VrHelpItem() { }
+ /**
+ * <p>
+ * Constructs a new VrHelpItem object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash -The Hashtable to use
+ */
+ public VrHelpItem(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * VR help items i.e. the text strings to be displayed, and when pronounced
+ * by the user the recognition of any of which must trigger the corresponding VR command.
+ * @param text Text to display for VR Help item
+ * @param position Position to display item in VR Help list
+ */
+ public VrHelpItem(@NonNull String text, @NonNull Integer position){
+ this();
+ setText(text);
+ setPosition(position);
+ }
+
+ public void setText(@NonNull String text) {
+ setValue(KEY_TEXT, text);
+ }
+ public String getText() {
+ return getString(KEY_TEXT);
+ }
+ public void setImage(Image image) {
+ setValue(KEY_IMAGE, image);
+ }
+ @SuppressWarnings("unchecked")
+ public Image getImage() {
+ return (Image) getObject(Image.class, KEY_IMAGE);
+ }
+ public void setPosition(@NonNull Integer position) {
+ setValue(KEY_POSITION, position);
+ }
+ public Integer getPosition() {
+ return getInteger(KEY_POSITION);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java
new file mode 100644
index 000000000..2e7b0a0cd
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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 WeatherAlert extends RPCStruct {
+
+ public static final String KEY_TITLE = "title";
+ public static final String KEY_SUMMARY = "summary";
+ public static final String KEY_EXPIRES = "expires";
+ public static final String KEY_REGIONS = "regions";
+ public static final String KEY_SEVERITY = "severity";
+ public static final String KEY_TIME_ISSUED = "timeIssued";
+
+ // Constructors
+
+ public WeatherAlert() { }
+
+ public WeatherAlert(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public WeatherAlert(@NonNull List<String> regions) {
+ this();
+ setRegions(regions);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param title -
+ */
+ public void setTitle(String title) {
+ setValue(KEY_TITLE, title);
+ }
+
+ /**
+ * @return title
+ */
+ public String getTitle() {
+ return getString(KEY_TITLE);
+ }
+
+ /**
+ * @param summary -
+ */
+ public void setSummary(String summary) {
+ setValue(KEY_SUMMARY, summary);
+ }
+
+ /**
+ * @return summary
+ */
+ public String getSummary() {
+ return getString(KEY_SUMMARY);
+ }
+
+ /**
+ * @param severity -
+ */
+ public void setSeverity(String severity) {
+ setValue(KEY_SEVERITY, severity);
+ }
+
+ /**
+ * @return severity
+ */
+ public String getSeverity() {
+ return getString(KEY_SEVERITY);
+ }
+
+ /**
+ * Min Size: 1, Max Size: 99
+ * @param regions -
+ */
+ public void setRegions(@NonNull List<String> regions) {
+ setValue(KEY_REGIONS, regions);
+ }
+
+ /**
+ * @return regions list
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getRegions(){
+ return (List<String>) getObject(String.class,KEY_REGIONS);
+ }
+
+ /**
+ * @param expires -
+ */
+ public void setExpires(DateTime expires) {
+ setValue(KEY_EXPIRES, expires);
+ }
+
+ /**
+ * @return expires
+ */
+ public DateTime getExpires() {
+ return (DateTime) getObject(DateTime.class,KEY_EXPIRES);
+ }
+
+ /**
+ * @param timeIssued -
+ */
+ public void setTimeIssued(DateTime timeIssued) {
+ setValue(KEY_TIME_ISSUED, timeIssued);
+ }
+
+ /**
+ * @return timeIssued
+ */
+ public DateTime getTimeIssued() {
+ return (DateTime) getObject(DateTime.class,KEY_TIME_ISSUED);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java
new file mode 100644
index 000000000..a3b897acb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java
@@ -0,0 +1,389 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class WeatherData extends RPCStruct {
+
+ public static final String KEY_CURRENT_TEMPERATURE = "currentTemperature";
+ public static final String KEY_TEMPERATURE_HIGH = "temperatureHigh";
+ public static final String KEY_TEMPERATURE_LOW = "temperatureLow";
+ public static final String KEY_APPARENT_TEMPERATURE = "apparentTemperature";
+ public static final String KEY_APPARENT_TEMPERATURE_HIGH = "apparentTemperatureHigh";
+ public static final String KEY_APPARENT_TEMPERATURE_LOW = "apparentTemperatureLow";
+ public static final String KEY_WEATHER_SUMMARY = "weatherSummary";
+ public static final String KEY_TIME = "time";
+ public static final String KEY_HUMIDITY = "humidity";
+ public static final String KEY_CLOUD_COVER = "cloudCover";
+ public static final String KEY_MOON_PHASE = "moonPhase";
+ public static final String KEY_WIND_BEARING = "windBearing";
+ public static final String KEY_WIND_GUST = "windGust";
+ public static final String KEY_WIND_SPEED = "windSpeed";
+ public static final String KEY_NEAREST_STORM_BEARING = "nearestStormBearing";
+ public static final String KEY_NEAREST_STORM_DISTANCE = "nearestStormDistance";
+ public static final String KEY_PRECIP_ACCUMULATION = "precipAccumulation";
+ public static final String KEY_PRECIP_INTENSITY = "precipIntensity";
+ public static final String KEY_PRECIP_PROBABILITY = "precipProbability";
+ public static final String KEY_PRECIP_TYPE = "precipType";
+ public static final String KEY_VISIBILITY = "visibility";
+ public static final String KEY_WEATHER_ICON = "weatherIcon";
+
+ // Constructors
+
+ public WeatherData() { }
+
+ public WeatherData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param currentTemperature -
+ */
+ public void setCurrentTemperature(Temperature currentTemperature) {
+ setValue(KEY_CURRENT_TEMPERATURE, currentTemperature);
+ }
+
+ /**
+ * @return currentTemperature
+ */
+ public Temperature getCurrentTemperature() {
+ return (Temperature) getObject(Temperature.class,KEY_CURRENT_TEMPERATURE);
+ }
+
+ /**
+ * @param temperatureHigh -
+ */
+ public void setTemperatureHigh(Temperature temperatureHigh) {
+ setValue(KEY_TEMPERATURE_HIGH, temperatureHigh);
+ }
+
+ /**
+ * @return temperatureHigh
+ */
+ public Temperature getTemperatureHigh() {
+ return (Temperature) getObject(Temperature.class,KEY_TEMPERATURE_HIGH);
+ }
+
+ /**
+ * @param temperatureLow -
+ */
+ public void setTemperatureLow(Temperature temperatureLow) {
+ setValue(KEY_TEMPERATURE_LOW, temperatureLow);
+ }
+
+ /**
+ * @return temperatureLow
+ */
+ public Temperature getTemperatureLow() {
+ return (Temperature) getObject(Temperature.class,KEY_TEMPERATURE_LOW);
+ }
+
+ /**
+ * @param apparentTemperature -
+ */
+ public void setApparentTemperature(Temperature apparentTemperature) {
+ setValue(KEY_APPARENT_TEMPERATURE, apparentTemperature);
+ }
+
+ /**
+ * @return apparentTemperature
+ */
+ public Temperature getApparentTemperature() {
+ return (Temperature) getObject(Temperature.class,KEY_APPARENT_TEMPERATURE);
+ }
+
+ /**
+ * @param apparentTemperatureHigh -
+ */
+ public void setApparentTemperatureHigh(Temperature apparentTemperatureHigh) {
+ setValue(KEY_APPARENT_TEMPERATURE_HIGH, apparentTemperatureHigh);
+ }
+
+ /**
+ * @return apparentTemperatureHigh
+ */
+ public Temperature getApparentTemperatureHigh() {
+ return (Temperature) getObject(Temperature.class,KEY_APPARENT_TEMPERATURE_HIGH);
+ }
+
+ /**
+ * @param apparentTemperatureLow -
+ */
+ public void setApparentTemperatureLow(Temperature apparentTemperatureLow) {
+ setValue(KEY_APPARENT_TEMPERATURE_LOW, apparentTemperatureLow);
+ }
+
+ /**
+ * @return apparentTemperatureLow
+ */
+ public Temperature getApparentTemperatureLow() {
+ return (Temperature) getObject(Temperature.class,KEY_APPARENT_TEMPERATURE_LOW);
+ }
+
+ /**
+ * @param weatherSummary -
+ */
+ public void setWeatherSummary(String weatherSummary) {
+ setValue(KEY_WEATHER_SUMMARY, weatherSummary);
+ }
+
+ /**
+ * @return weatherSummary
+ */
+ public String getWeatherSummary() {
+ return getString(KEY_WEATHER_SUMMARY);
+ }
+
+ /**
+ * @param time -
+ */
+ public void setTime(DateTime time) {
+ setValue(KEY_TIME, time);
+ }
+
+ /**
+ * @return time
+ */
+ public DateTime getTime() {
+ return (DateTime) getObject(DateTime.class,KEY_TIME);
+ }
+
+ /**
+ * minValue: 0, maxValue: 1
+ * @param humidity - percentage humidity
+ */
+ public void setHumidity(Float humidity) {
+ setValue(KEY_HUMIDITY, humidity);
+ }
+
+ /**
+ * minValue: 0, maxValue: 1
+ * @return humidity - percentage humidity
+ */
+ public Float getHumidity() {
+ return getFloat(KEY_HUMIDITY);
+ }
+
+ /**
+ * minValue: 0, maxValue: 1
+ * @param cloudCover - cloud cover
+ */
+ public void setCloudCover(Float cloudCover) {
+ setValue(KEY_CLOUD_COVER, cloudCover);
+ }
+
+ /**
+ * minValue: 0, maxValue: 1
+ * @return cloudCover - cloud cover
+ */
+ public Float getCloudCover() {
+ return getFloat(KEY_CLOUD_COVER);
+ }
+
+ /**
+ * minValue: 0, maxValue: 1
+ * @param moonPhase - percentage of the moon seen, e.g. 0 = no moon, 0.25 = quarter moon
+ */
+ public void setMoonPhase(Float moonPhase) {
+ setValue(KEY_MOON_PHASE, moonPhase);
+ }
+
+ /**
+ * minValue: 0, maxValue: 1
+ * @return moonPhase - percentage of the moon seen, e.g. 0 = no moon, 0.25 = quarter moon
+ */
+ public Float getMoonPhase() {
+ return getFloat(KEY_MOON_PHASE);
+ }
+
+ /**
+ * @param windBearing - In degrees, true north at 0 degrees
+ */
+ public void setWindBearing(Integer windBearing) {
+ setValue(KEY_WIND_BEARING, windBearing);
+ }
+
+ /**
+ * @return windBearing - In degrees, true north at 0 degrees
+ */
+ public Integer getWindBearing() {
+ return getInteger(KEY_WIND_BEARING);
+ }
+
+ /**
+ * @param windGust - km/hr
+ */
+ public void setWindGust(Float windGust) {
+ setValue(KEY_WIND_GUST, windGust);
+ }
+
+ /**
+ * @return windGust - km/hr
+ */
+ public Float getWindGust() {
+ return getFloat(KEY_WIND_GUST);
+ }
+
+ /**
+ * @param windSpeed - km/hr
+ */
+ public void setWindSpeed(Float windSpeed) {
+ setValue(KEY_WIND_SPEED, windSpeed);
+ }
+
+ /**
+ * @return windSpeed - km/hr
+ */
+ public Float getWindSpeed() {
+ return getFloat(KEY_WIND_SPEED);
+ }
+
+ /**
+ * @param nearestStormBearing - In degrees, true north at 0 degrees
+ */
+ public void setNearestStormBearing(Integer nearestStormBearing) {
+ setValue(KEY_NEAREST_STORM_BEARING, nearestStormBearing);
+ }
+
+ /**
+ * @return nearestStormBearing - In degrees, true north at 0 degrees
+ */
+ public Integer getNearestStormBearing() {
+ return getInteger(KEY_NEAREST_STORM_BEARING);
+ }
+
+ /**
+ * @param nearestStormDistance - In km
+ */
+ public void setNearestStormDistance(Integer nearestStormDistance) {
+ setValue(KEY_NEAREST_STORM_DISTANCE, nearestStormDistance);
+ }
+
+ /**
+ * @return nearestStormDistance - In km
+ */
+ public Integer getNearestStormDistance() {
+ return getInteger(KEY_NEAREST_STORM_DISTANCE);
+ }
+
+ /**
+ * @param precipAccumulation - cm
+ */
+ public void setPrecipAccumulation(Float precipAccumulation) {
+ setValue(KEY_PRECIP_ACCUMULATION, precipAccumulation);
+ }
+
+ /**
+ * @return precipAccumulation - cm
+ */
+ public Float getPrecipAccumulation() {
+ return getFloat(KEY_PRECIP_ACCUMULATION);
+ }
+
+ /**
+ * @param precipIntensity - cm of water per hour
+ */
+ public void setPrecipIntensity(Float precipIntensity) {
+ setValue(KEY_PRECIP_INTENSITY, precipIntensity);
+ }
+
+ /**
+ * @return precipIntensity - cm of water per hour
+ */
+ public Float getPrecipIntensity() {
+ return getFloat(KEY_PRECIP_INTENSITY);
+ }
+
+ /**
+ * minValue: 0, maxValue: 1
+ * @param precipProbability - percentage chance
+ */
+ public void setPrecipProbability(Float precipProbability) {
+ setValue(KEY_PRECIP_PROBABILITY, precipProbability);
+ }
+
+ /**
+ * minValue: 0, maxValue: 1
+ * @return precipProbability - percentage chance
+ */
+ public Float getPrecipProbability() {
+ return getFloat(KEY_PRECIP_PROBABILITY);
+ }
+
+ /**
+ * @param precipType - e.g. "rain", "snow", "sleet", "hail"
+ */
+ public void setPrecipType(String precipType) {
+ setValue(KEY_PRECIP_TYPE, precipType);
+ }
+
+ /**
+ * @return precipType - e.g. "rain", "snow", "sleet", "hail"
+ */
+ public String getPrecipType() {
+ return getString(KEY_PRECIP_TYPE);
+ }
+
+ /**
+ * @param weatherIcon -
+ */
+ public void setWeatherIcon(Image weatherIcon) {
+ setValue(KEY_WEATHER_ICON, weatherIcon);
+ }
+
+ /**
+ * @return weatherIcon
+ */
+ public Image getWeatherIcon() {
+ return (Image) getObject(Image.class, KEY_WEATHER_ICON);
+ }
+
+ /**
+ * @param visibility - In km
+ */
+ public void setVisibility(Float visibility) {
+ setValue(KEY_VISIBILITY, visibility);
+ }
+
+ /**
+ * @return visibility - In km
+ */
+ public Float getVisibility() {
+ return getFloat(KEY_VISIBILITY);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java
new file mode 100644
index 000000000..81e6586f0
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * This data is related to what a weather service would provide
+ */
+public class WeatherServiceData extends RPCStruct {
+
+ public static final String KEY_LOCATION = "location";
+ public static final String KEY_CURRENT_FORECAST = "currentForecast";
+ public static final String KEY_MINUTE_FORECAST = "minuteForecast";
+ public static final String KEY_HOURLY_FORECAST = "hourlyForecast";
+ public static final String KEY_MULTIDAY_FORECAST = "multidayForecast";
+ public static final String KEY_ALERTS = "alerts";
+
+ // Constructors
+
+ public WeatherServiceData() { }
+
+ public WeatherServiceData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public WeatherServiceData(@NonNull LocationDetails location) {
+ this();
+ setLocation(location);
+ }
+
+ // Setters and Getters
+
+ /**
+ * @param location -
+ */
+ public void setLocation(@NonNull LocationDetails location) {
+ setValue(KEY_LOCATION, location);
+ }
+
+ /**
+ * @return location
+ */
+ public LocationDetails getLocation() {
+ return (LocationDetails) getObject(LocationDetails.class,KEY_LOCATION);
+ }
+
+ /**
+ * @param currentForecast -
+ */
+ public void setCurrentForecast(WeatherData currentForecast) {
+ setValue(KEY_CURRENT_FORECAST, currentForecast);
+ }
+
+ /**
+ * @return currentForecast
+ */
+ public WeatherData getCurrentForecast() {
+ return (WeatherData) getObject(WeatherData.class,KEY_CURRENT_FORECAST);
+ }
+
+ /**
+ * minsize: 15, maxsize: 60
+ * @param minuteForecast -
+ */
+ public void setMinuteForecast(List<WeatherData> minuteForecast){
+ setValue(KEY_MINUTE_FORECAST, minuteForecast);
+ }
+
+ /**
+ * minsize: 15, maxsize: 60
+ * @return minuteForecast
+ */
+ @SuppressWarnings("unchecked")
+ public List<WeatherData> getMinuteForecast(){
+ return (List<WeatherData>) getObject(WeatherData.class,KEY_MINUTE_FORECAST);
+ }
+
+ /**
+ * minsize: 1, maxsize: 96
+ * @param hourlyForecast -
+ */
+ public void setHourlyForecast(List<WeatherData> hourlyForecast){
+ setValue(KEY_HOURLY_FORECAST, hourlyForecast);
+ }
+
+ /**
+ * minsize: 1, maxsize: 96
+ * @return hourlyForecast
+ */
+ @SuppressWarnings("unchecked")
+ public List<WeatherData> getHourlyForecast(){
+ return (List<WeatherData>) getObject(WeatherData.class,KEY_HOURLY_FORECAST);
+ }
+
+ /**
+ * minsize: 1, maxsize: 30
+ * @param multidayForecast -
+ */
+ public void setMultidayForecast(List<WeatherData> multidayForecast){
+ setValue(KEY_MULTIDAY_FORECAST, multidayForecast);
+ }
+
+ /**
+ * minsize: 1, maxsize: 30
+ * @return multidayForecast
+ */
+ @SuppressWarnings("unchecked")
+ public List<WeatherData> getMultidayForecast(){
+ return (List<WeatherData>) getObject(WeatherData.class,KEY_MULTIDAY_FORECAST);
+ }
+
+ /**
+ * minsize: 1, maxsize: 10
+ * @param alerts -
+ */
+ public void setAlerts(List<WeatherAlert> alerts){
+ setValue(KEY_ALERTS, alerts);
+ }
+
+ /**
+ * minsize: 1, maxsize: 10
+ * @return alerts
+ */
+ @SuppressWarnings("unchecked")
+ public List<WeatherAlert> getAlerts(){
+ return (List<WeatherAlert>) getObject(WeatherAlert.class,KEY_ALERTS);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java
new file mode 100644
index 000000000..2f6a9f8d3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class WeatherServiceManifest extends RPCStruct {
+
+ public static final String KEY_CURRENT_FORECAST_SUPPORTED = "currentForecastSupported";
+ public static final String KEY_MAX_MULTIDAY_FORECAST_AMOUNT = "maxMultidayForecastAmount";
+ public static final String KEY_MAX_HOURLY_FORECAST_AMOUNT = "maxHourlyForecastAmount";
+ public static final String KEY_MAX_MINUTELY_FORECAST_AMOUNT = "maxMinutelyForecastAmount";
+ public static final String KEY_WEATHER_FOR_LOCATION_SUPPORTED = "weatherForLocationSupported";
+
+ // Constructors
+
+ public WeatherServiceManifest() { }
+
+ public WeatherServiceManifest(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ // Setters and Getters
+ /**
+ * Set whether the current forecast is supported
+ * @param currentForecastSupported -
+ */
+ public void setCurrentForecastSupported(Boolean currentForecastSupported){
+ setValue(KEY_CURRENT_FORECAST_SUPPORTED, currentForecastSupported);
+ }
+
+ /**
+ * Get whether the current forecast is supported
+ * @return currentForecastSupported
+ */
+ public Boolean getCurrentForecastSupported(){
+ return getBoolean(KEY_CURRENT_FORECAST_SUPPORTED);
+ }
+
+ /**
+ * Set the max multi day forecast amount
+ * @param maxMultidayForecastAmount -
+ */
+ public void setMaxMultidayForecastAmount(Integer maxMultidayForecastAmount){
+ setValue(KEY_MAX_MULTIDAY_FORECAST_AMOUNT, maxMultidayForecastAmount);
+ }
+
+ /**
+ * Get the max multi day forecast amount
+ * @return maxMultidayForecastAmount
+ */
+ public Integer getMaxMultidayForecastAmount(){
+ return getInteger(KEY_MAX_MULTIDAY_FORECAST_AMOUNT);
+ }
+
+ /**
+ * Set the max hourly forecast amount
+ * @param maxHourlyForecastAmount -
+ */
+ public void setMaxHourlyForecastAmount(Integer maxHourlyForecastAmount){
+ setValue(KEY_MAX_HOURLY_FORECAST_AMOUNT, maxHourlyForecastAmount);
+ }
+
+ /**
+ * Get the max hourly forecast amount
+ * @return maxHourlyForecastAmount
+ */
+ public Integer getMaxHourlyForecastAmount(){
+ return getInteger(KEY_MAX_HOURLY_FORECAST_AMOUNT);
+ }
+
+ /**
+ * Set the max minutely forecast amount
+ * @param maxMinutelyForecastAmount -
+ */
+ public void setMaxMinutelyForecastAmount(Integer maxMinutelyForecastAmount){
+ setValue(KEY_MAX_MINUTELY_FORECAST_AMOUNT, maxMinutelyForecastAmount);
+ }
+
+ /**
+ * Get the max minutely forecast amount
+ * @return maxMinutelyForecastAmount
+ */
+ public Integer getMaxMinutelyForecastAmount(){
+ return getInteger(KEY_MAX_MINUTELY_FORECAST_AMOUNT);
+ }
+
+ /**
+ * Set whether the weather is supported for the current location
+ * @param weatherForLocationSupported -
+ */
+ public void setWeatherForLocationSupported(Boolean weatherForLocationSupported){
+ setValue(KEY_WEATHER_FOR_LOCATION_SUPPORTED, weatherForLocationSupported);
+ }
+
+ /**
+ * Get whether the weather is supported for the current location
+ * @return weatherForLocationSupported
+ */
+ public Boolean getWeatherForLocationSupported(){
+ return getBoolean(KEY_WEATHER_FOR_LOCATION_SUPPORTED);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AmbientLightStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AmbientLightStatus.java
new file mode 100644
index 000000000..144da6f5b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AmbientLightStatus.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+
+/** Reflects the status of the ambient light sensor.
+ *
+ * @since SmartDeviceLink 2.3.2
+ *
+ */
+
+public enum AmbientLightStatus {
+ NIGHT,
+ TWILIGHT_1,
+ TWILIGHT_2,
+ TWILIGHT_3,
+ TWILIGHT_4,
+ DAY,
+ UNKNOWN,
+ INVALID;
+ /**
+ * Convert String to AmbientLightStatus
+ * @param value String
+ * @return AmbientLightStatus
+ */
+
+ public static AmbientLightStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java
new file mode 100644
index 000000000..f15fa34c5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enumeration listing possible app hmi types.
+ * @since SmartDeviceLink 2.0
+ */
+public enum AppHMIType {
+ /**
+ * The App will have default rights.
+ */
+ DEFAULT,
+ /**
+ * Communication type of App
+ */
+ COMMUNICATION,
+ /**
+ * App dealing with Media
+ */
+ MEDIA,
+ /**
+ * Messaging App
+ */
+ MESSAGING,
+ /**
+ * Navigation App
+ */
+ NAVIGATION,
+ /**
+ * Information App
+ */
+ INFORMATION,
+ /**
+ * App dealing with social media
+ */
+ SOCIAL,
+ BACKGROUND_PROCESS,
+ /**
+ * App only for Testing purposes
+ */
+ TESTING,
+ /**
+ * Custom App Interfaces
+ */
+ PROJECTION,
+ /**
+ * System App
+ */
+ SYSTEM,
+ /**
+ * Remote Control
+ */
+ REMOTE_CONTROL,
+ ;
+
+ /**
+ * Convert String to AppHMIType
+ * @param value String
+ * @return AppHMIType
+ */
+ public static AppHMIType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java
new file mode 100644
index 000000000..ed4c21dba
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Indicates reason why app interface was unregistered. The application is being
+ * disconnected by SDL.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum AppInterfaceUnregisteredReason {
+ USER_EXIT,
+ /**
+ * Vehicle ignition turned off.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ IGNITION_OFF,
+ /**
+ * Bluetooth was turned off, causing termination of a necessary Bluetooth
+ * connection.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ BLUETOOTH_OFF,
+ /**
+ * USB was disconnected, causing termination of a necessary iAP connection.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ USB_DISCONNECTED,
+ /**
+ * Application attempted SmartDeviceLink RPC request while {@linkplain HMILevel}
+ * =NONE. App must have HMILevel other than NONE to issue RPC requests or
+ * get notifications or RPC responses.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ REQUEST_WHILE_IN_NONE_HMI_LEVEL,
+ /**
+ * Either too many -- or too many per unit of time -- requests were made by
+ * the application.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ TOO_MANY_REQUESTS,
+ /**
+ * The application has issued requests which cause driver distraction rules
+ * to be violated.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ DRIVER_DISTRACTION_VIOLATION,
+ /**
+ * The user has changed the language in effect on the SDL platform to a
+ * language that is incompatible with the language declared by the
+ * application in its RegisterAppInterface request.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ LANGUAGE_CHANGE,
+ /**
+ * The user performed a MASTER RESET on the SDL platform, causing removal
+ * of a necessary Bluetooth pairing.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ MASTER_RESET,
+ /**
+ * The user restored settings to FACTORY DEFAULTS on the SDL platform.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ FACTORY_DEFAULTS,
+ /**
+ * The app is not being authorized to be connected to SDL.
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ APP_UNAUTHORIZED,
+ /**
+ * The app has committed a protocol violation.
+ *
+ * @since SmartDeviceLink 4.0
+ */
+ PROTOCOL_VIOLATION,
+ ;
+ /**
+ * Convert String to AppInterfaceUnregisteredReason
+ * @param value String
+ * @return AppInterfaceUnregisteredReason
+ */
+ public static AppInterfaceUnregisteredReason valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppServiceType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppServiceType.java
new file mode 100644
index 000000000..c52796db5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppServiceType.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enumeration listing possible app service types.
+ */
+public enum AppServiceType {
+
+ MEDIA,
+
+ WEATHER,
+
+ NAVIGATION,
+
+ ;
+
+ /**
+ * Convert String to AppServiceType
+ * @param value String
+ * @return AppServiceType
+ */
+ public static AppServiceType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingIndicator.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingIndicator.java
new file mode 100644
index 000000000..78fd11e3b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingIndicator.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Identifies the playback status of a media app
+ *
+ * @since SmartDeviceLink 5.0
+ */
+public enum AudioStreamingIndicator {
+ /**
+ * Default playback indicator.
+ *
+ * @since SmartDeviceLink 5.0
+ */
+ PLAY_PAUSE,
+
+ /**
+ * Indicates that a button press of the Play/Pause button would start the playback.
+ *
+ * @since SmartDeviceLink 5.0
+ */
+ PLAY,
+ /**
+ * Indicates that a button press of the Play/Pause button would pause the current playback.
+ *
+ * @since SmartDeviceLink 5.0
+ */
+ PAUSE,
+ /**
+ * Indicates that a button press of the Play/Pause button would stop the current playback.
+ *
+ * @since SmartDeviceLink 5.0
+ */
+ STOP,
+ ;
+
+ /**
+ * Convert String to AudioStreamingIndicator
+ * @param value String
+ * @return AudioStreamingIndicator
+ */
+ public static AudioStreamingIndicator valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingState.java
new file mode 100644
index 000000000..3d28272bd
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingState.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Describes whether or not streaming audio is currently audible to the user.
+ * Though provided in every OnHMIStatus notification, this information is only
+ * relevant for applications that declare themselves as media apps in
+ * RegisterAppInterface
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum AudioStreamingState {
+ /**
+ * Currently streaming audio, if any, is audible to user.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ AUDIBLE,
+
+ /**
+ * Some kind of audio mixing is taking place. Currently streaming audio, if
+ * any, is audible to the user at a lowered volume.
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ ATTENUATED,
+ /**
+ * Currently streaming audio, if any, is not audible to user. made via VR
+ * session.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ NOT_AUDIBLE;
+ /**
+ * Convert String to AudioStreamingState
+ * @param value String
+ * @return AudioStreamingState
+ */
+
+ public static AudioStreamingState valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioType.java
new file mode 100644
index 000000000..c3892f404
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioType.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Describes different audio type options for PerformAudioPassThru
+ *
+ * @since SmartDeviceLink 2.0
+
+ */
+public enum AudioType {
+ /**
+ * PCM raw audio
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ PCM;
+ /**
+ * Convert String to AudioType
+ * @param value String
+ * @return AudioType
+ */
+
+ public static AudioType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/BitsPerSample.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/BitsPerSample.java
new file mode 100644
index 000000000..a91bd4d37
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/BitsPerSample.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ * Describes different bit depth options for PerformAudioPassThru.
+ * @see com.smartdevicelink.proxy.rpc.PerformAudioPassThru
+ * @since SmartDeviceLink 2.0
+ */
+public enum BitsPerSample {
+ /**
+ * 8 bits per sample
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ _8_BIT("8_BIT"),
+ /**
+ * 16 bits per sample
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ _16_BIT("16_BIT");
+
+ private final String INTERNAL_NAME;
+
+ private BitsPerSample(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ public static BitsPerSample valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (BitsPerSample anEnum : EnumSet.allOf(BitsPerSample.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java
new file mode 100644
index 000000000..9188627e7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Indicates whether the button was depressed or released. A BUTTONUP event will
+ * always be preceded by a BUTTONDOWN event
+ *
+ * @see com.smartdevicelink.proxy.rpc.SoftButtonCapabilities
+ * @see com.smartdevicelink.proxy.rpc.OnButtonEvent
+ * @since SmartDeviceLink 1.0
+ */
+public enum ButtonEventMode {
+ /**
+ * The button was released
+ */
+ BUTTONUP,
+ /**
+ * The button was depressed
+ */
+ BUTTONDOWN;
+
+ /**
+ * Returns a ButtonEventMode (BUTTONUP or BUTTONDOWN)
+ *
+ * @param value
+ * a String
+ * @return ButtonEventMode -BUTTONUP or BUTTONDOWN
+ */
+
+ public static ButtonEventMode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java
new file mode 100644
index 000000000..75c1e9461
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * <p>
+ * Defines logical buttons which, on a given SDL unit, would correspond to
+ * either physical or soft (touchscreen) buttons. These logical buttons present
+ * a standard functional abstraction which the developer can rely upon,
+ * independent of the SDL unit. For example, the developer can rely upon the OK
+ * button having the same meaning to the user across SDL platforms.
+ * </p>
+ * <p>
+ * The preset buttons (0-9) can typically be interpreted by the application as
+ * corresponding to some user-configured choices, though the application is free
+ * to interpret these button presses as it sees fit.
+ * </p>
+ * <p>
+ * The application can discover which buttons a given SDL unit implements by
+ * interrogating the ButtonCapabilities parameter of the
+ * RegisterAppInterface response.
+ * </p>
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum ButtonName{
+ /**
+ * <br><b>THIS ENUM VALUE WILL CHANGE IN FUNCITONALITY DURING THE NEXT MAJOR RELEASE!</b>
+ * <br><br>
+ * This ButtonName value originally was used for both the OK button and PLAY_PAUSE button. As of
+ * SmartDeviceLink 5.0.0, the functionality was broken out into the OK and PLAY_PAUSE buttons.
+ * <br><br> For this version of the library OK will be received for both OK and PLAY_PAUSE to
+ * mitigate a potential break in functionliaty. If the desire is only for the OK functionality,
+ * this button should still be used. If the desired functionality was actually for the play/pause
+ * toggle, then the new PLAY_PAUSE should be used.
+ * <br><br>
+ * Represents the button usually labeled "OK". A typical use of this button
+ * is for the user to press it to make a selection (and until a major library version release,
+ * play pause toggle).
+ *
+ * @since SmartDeviceLink 1.0
+ * @see #PLAY_PAUSE
+ */
+ OK,
+ /**
+ * Represents the seek-left button. A typical use of this button is for the
+ * user to scroll to the left through menu choices one menu item per press.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ SEEKLEFT,
+ /**
+ * Represents the seek-right button. A typical use of this button is for the
+ * user to scroll to the right through menu choices one menu item per press.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ SEEKRIGHT,
+ /**
+ * Represents a turn of the tuner knob in the clockwise direction one tick.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ TUNEUP,
+ /**
+ * Represents a turn of the tuner knob in the counter-clockwise direction
+ * one tick.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ TUNEDOWN,
+ /**
+ * Represents the preset 0 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_0,
+ /**
+ * Represents the preset 1 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_1,
+ /**
+ * Represents the preset 2 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_2,
+ /**
+ * Represents the preset 3 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_3,
+ /**
+ * Represents the preset 4 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_4,
+ /**
+ * Represents the preset 5 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_5,
+ /**
+ * Represents the preset 6 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_6,
+ /**
+ * Represents the preset 7 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_7,
+ /**
+ * Represents the preset 8 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_8,
+ /**
+ * Represents the preset 9 button.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ PRESET_9,
+ CUSTOM_BUTTON,
+ SEARCH,
+ AC_MAX,
+ AC,
+ RECIRCULATE,
+ FAN_UP,
+ FAN_DOWN,
+ TEMP_UP,
+ TEMP_DOWN,
+ DEFROST_MAX,
+ DEFROST,
+ DEFROST_REAR,
+ UPPER_VENT,
+ LOWER_VENT,
+ VOLUME_UP,
+ VOLUME_DOWN,
+ EJECT,
+ SOURCE,
+ SHUFFLE,
+ REPEAT,
+ /**
+ * Represents the play/pause button. A typical use of this button
+ * is for the user to press it to toggle between media playing and pausing.
+ *
+ * <br><br><b>NOTE:</b> This functionality used to be represented by the OK button.
+ *
+ * @since SmartDeviceLink 5.0
+ * @see #OK
+ */
+ PLAY_PAUSE,
+
+ ;
+
+ public static ButtonName valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+
+ /**
+ * indexForPresetButton returns the integer index for preset buttons
+ * which match the preset order. E.G.: indexForPresetButton(PRESET_1)
+ * returns the value 1. If the buttonName given is not a preset button,
+ * the method will return null.
+ *
+ * @param buttonName the buttonName of PRESET_0 through PRESET_9 to
+ * @return Integer that represents which preset the supplied button name represents. It will return null if the
+ * ButtonName is not one of the PRESET_# names.
+ */
+ public static Integer indexForPresetButton(ButtonName buttonName) {
+ if(buttonName == null){
+ return null;
+ }
+
+ Integer returnIndex = null;
+
+ switch(buttonName) {
+ case PRESET_0:
+ returnIndex = 0;
+ break;
+ case PRESET_1:
+ returnIndex = 1;
+ break;
+ case PRESET_2:
+ returnIndex = 2;
+ break;
+ case PRESET_3:
+ returnIndex = 3;
+ break;
+ case PRESET_4:
+ returnIndex = 4;
+ break;
+ case PRESET_5:
+ returnIndex = 5;
+ break;
+ case PRESET_6:
+ returnIndex = 6;
+ break;
+ case PRESET_7:
+ returnIndex = 7;
+ break;
+ case PRESET_8:
+ returnIndex = 8;
+ break;
+ case PRESET_9:
+ returnIndex = 9;
+ break;
+ default:
+ break;
+ }
+
+ return returnIndex;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonPressMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonPressMode.java
new file mode 100644
index 000000000..1236084f2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonPressMode.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Indicates whether this is a LONG or SHORT button press.
+ * <p></p>
+ *@see ButtonEventMode
+ *@since SmartDeviceLink 1.0
+ */
+public enum ButtonPressMode {
+ /**
+ * The button has been depressed for 2 seconds. The button may remain
+ * depressed after receiving this event
+ */
+ LONG,
+ /**
+ * The button was released before the 2-second long-press interval had
+ * elapsed
+ */
+ SHORT;
+ /**
+ * Returns a ButtonPressMode (LONG or SHORT)
+ *
+ * @param value
+ * a String
+ * @return ButtonPressMode -LONG or SHORT
+ */
+
+ public static ButtonPressMode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java
new file mode 100644
index 000000000..22bfe6c9e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/** Describes the carmode the vehicle is in.
+ * @since SmartDeviceLink 2.0
+ */
+public enum CarModeStatus {
+ /** Provides carmode NORMAL to each module.
+ */
+
+ NORMAL,
+ /** Provides carmode FACTORY to each module.
+ */
+
+ FACTORY,
+ /** Provides carmode TRANSPORT to each module.
+ */
+
+ TRANSPORT,
+ /** Provides carmode CRASH to each module.
+ */
+
+
+ CRASH;
+ /** Convert String to CarModeStatus
+ * @param value String
+ * @return CarModeStatus
+ */
+
+ public static CarModeStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CharacterSet.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CharacterSet.java
new file mode 100644
index 000000000..a1fb294e2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CharacterSet.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * Character sets supported by SDL.
+ * @since SmartDeviceLink 1.0
+ */
+public enum CharacterSet {
+ TYPE2SET,
+ TYPE5SET,
+ CID1SET,
+ CID2SET;
+
+ /**
+ * Convert String to CharacterSet
+ * @param value String
+ * @return CharacterSet
+ */
+ public static CharacterSet valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CompassDirection.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CompassDirection.java
new file mode 100644
index 000000000..dd4493747
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CompassDirection.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * The list of potential compass directions
+ * @since SmartDeviceLink 2.0
+ */
+public enum CompassDirection {
+ /**
+ * Direction North
+ */
+ NORTH,
+ /**
+ * Direction Northwest
+ */
+ NORTHWEST,
+ /**
+ * Direction West
+ */
+ WEST,
+ /**
+ * Direction Southwest
+ */
+ SOUTHWEST,
+ /**
+ * Direction South
+ */
+ SOUTH,
+ /**
+ * Direction Southeast
+ */
+ SOUTHEAST,
+ /**
+ * Direction East
+ */
+ EAST,
+ /**
+ * Direction Northeast
+ */
+ NORTHEAST;
+
+ /**
+ * Convert String to CompassDirection
+ * @param value String
+ * @return CompassDirection
+ */
+ public static CompassDirection valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ComponentVolumeStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ComponentVolumeStatus.java
new file mode 100644
index 000000000..c2ef627f9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ComponentVolumeStatus.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * The volume status of a vehicle component
+ * @since SmartDeviceLink 2.0
+ */
+public enum ComponentVolumeStatus {
+ /**
+ * Unknown
+ */
+ UNKNOWN,
+ /**
+ * Normal
+ */
+ NORMAL,
+ /**
+ * Low
+ */
+ LOW,
+ /**
+ * Fault
+ */
+ FAULT,
+ /**
+ * Alert
+ */
+ ALERT,
+ /**
+ * Not supported
+ */
+ NOT_SUPPORTED;
+
+ /**
+ * Convert String to ComponentVolumeStatus
+ * @param value String
+ * @return ComponentVolumeStatus
+ */
+ public static ComponentVolumeStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DefrostZone.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DefrostZone.java
new file mode 100644
index 000000000..fb6c8b9b0
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DefrostZone.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum DefrostZone {
+ FRONT,
+ REAR,
+ ALL,
+ NONE,
+ ;
+
+ public static DefrostZone valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeliveryMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeliveryMode.java
new file mode 100644
index 000000000..bc83a4927
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeliveryMode.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum DeliveryMode {
+ PROMPT,
+ DESTINATION,
+ QUEUE,
+ ;
+
+ public static DeliveryMode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeviceLevelStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeviceLevelStatus.java
new file mode 100644
index 000000000..89bd99219
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeviceLevelStatus.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Reflects the reported battery status of the connected device, if reported.
+ * @since SmartDeviceLink 2.0
+ */
+public enum DeviceLevelStatus {
+ /**
+ * Zero level bars
+ */
+ ZERO_LEVEL_BARS,
+ /**
+ * One level bars
+ */
+ ONE_LEVEL_BARS,
+ /**
+ * Two level bars
+ */
+ TWO_LEVEL_BARS,
+ /**
+ * Three level bars
+ */
+ THREE_LEVEL_BARS,
+ /**
+ * Four level bars
+ */
+ FOUR_LEVEL_BARS,
+ /**
+ * Not provided
+ */
+ NOT_PROVIDED;
+
+ /**
+ * Convert String to DeviceLevelStatus
+ * @param value String
+ * @return DeviceLevelStatus
+ */
+ public static DeviceLevelStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Dimension.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Dimension.java
new file mode 100644
index 000000000..dd0669795
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Dimension.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ * The supported dimensions of the GPS.
+ * @since SmartDeviceLink 2.0
+ */
+public enum Dimension {
+ /**
+ * No GPS at all
+ */
+ NO_FIX("NO_FIX"),
+ /**
+ * Longitude and latitude
+ */
+ _2D("2D"),
+ /**
+ * Longitude and latitude and altitude
+ */
+ _3D("3D");
+
+ private final String INTERNAL_NAME;
+
+ private Dimension(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ /**
+ * Convert String to Dimension
+ * @param value String
+ * @return Dimension
+ */
+ public static Dimension valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (Dimension anEnum : EnumSet.allOf(Dimension.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Direction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Direction.java
new file mode 100644
index 000000000..2b63424b8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Direction.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum Direction {
+
+ LEFT,
+
+ RIGHT,
+
+ ;
+
+ public static Direction valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java
new file mode 100644
index 000000000..0573208ef
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java
new file mode 100644
index 000000000..109aef943
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** The type of the display.
+ *
+ *
+ * @since SmartDevcieLink 1.0
+ *
+ */
+
+public enum DisplayType {
+ /**
+ * Center Information Display.
+ *This display type provides a 2-line x 20 character "dot matrix" display.
+ *
+ */
+
+ CID("CID"),
+ /** TYPE II display.
+ 1 line older radio head unit. */
+
+ TYPE2("TYPE2"),
+ /**
+ * TYPE V display
+ Old radio head unit.
+
+ */
+
+ TYPE5("TYPE5"),
+ /**
+ * Next Generation Navigation display.
+ */
+
+ NGN("NGN"),
+ /**
+ * GEN-2, 8 inch display.
+ */
+
+ GEN2_8_DMA("GEN2_8_DMA"),
+ /**
+ * GEN-2, 6 inch display.
+ */
+
+ GEN2_6_DMA("GEN2_6_DMA"),
+ /**
+ * 3 inch GEN1.1 display.
+ */
+
+ MFD3("MFD3"),
+ /**
+ * 4 inch GEN1.1 display
+ */
+
+ MFD4("MFD4"),
+ /**
+ * 5 inch GEN1.1 display.
+ */
+
+ MFD5("MFD5"),
+ /**
+ * GEN-3, 8 inch display.
+ */
+
+ GEN3_8_INCH("GEN3_8-INCH"),
+
+ /**
+ * SDL_GENERIC display type. Used for most SDL integrations.
+ */
+ SDL_GENERIC("SDL_GENERIC"),
+
+ ;
+
+ private final String INTERNAL_NAME;
+
+ private DisplayType(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public static DisplayType valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (DisplayType type : DisplayType.values()) {
+ if (type.toString().equals(value)) {
+ return type;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return INTERNAL_NAME;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java
new file mode 100644
index 000000000..8d79cd4ed
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DriverDistractionState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DriverDistractionState.java
new file mode 100644
index 000000000..4ff83592e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DriverDistractionState.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enumeration that describes possible states of driver distraction.
+ * @since SmartDeviceLink 1.0
+ */
+public enum DriverDistractionState {
+ /**
+ * Driver distraction rules are in effect.
+ */
+ DD_ON,
+ /**
+ * Driver distraction rules are NOT in effect.
+ */
+ DD_OFF;
+
+ /**
+ * Convert String to DriverDistractionState
+ * @param value String
+ * @return DriverDistractionState
+ */
+ public static DriverDistractionState valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ECallConfirmationStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ECallConfirmationStatus.java
new file mode 100644
index 000000000..698c2af8a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ECallConfirmationStatus.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** Reflects the status of the eCall Notification.
+ * <p>
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ */
+
+public enum ECallConfirmationStatus {
+ /**
+ * No E-Call signal triggered.
+ */
+ NORMAL,
+ /**
+ * An E-Call is being in progress.
+ */
+ CALL_IN_PROGRESS,
+ /**
+ * An E-Call was cancelled by the user.
+ */
+ CALL_CANCELLED,
+ /**
+ * The E-Call sequence is completed.
+ */
+ CALL_COMPLETED,
+ /**
+ * An E-Call could not be connected.
+ */
+ CALL_UNSUCCESSFUL,
+ /**
+ * E-Call is not configured on this vehicle.
+ */
+ ECALL_CONFIGURED_OFF,
+ /**
+ * E-Call is considered to be complete without Emergency Operator contact.
+ */
+ CALL_COMPLETE_DTMF_TIMEOUT;
+
+ public static ECallConfirmationStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ElectronicParkBrakeStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ElectronicParkBrakeStatus.java
new file mode 100644
index 000000000..d3c9a9908
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ElectronicParkBrakeStatus.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum ElectronicParkBrakeStatus {
+ /**
+ * Park brake actuators have been fully applied.
+ */
+ CLOSED,
+ /**
+ * Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
+ */
+ TRANSITION,
+ /**
+ * Park brake actuators are released.
+ */
+ OPEN,
+ /**
+ * When driver pulls the Electronic Park Brake switch while driving "at speed".
+ */
+ DRIVE_ACTIVE,
+ /**
+ * When system has a fault or is under maintenance.
+ */
+ FAULT,
+ ;
+
+ /**
+ * Convert String to ElectronicParkBrakeStatus
+ * @param value String
+ * @return ElectronicParkBrakeStatus
+ */
+ public static ElectronicParkBrakeStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/EmergencyEventType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/EmergencyEventType.java
new file mode 100644
index 000000000..9811d494b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/EmergencyEventType.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ *
+ * Reflects the emergency event status of the vehicle.
+ *
+ */
+public enum EmergencyEventType {
+ /** No emergency event has happened.
+ */
+ NO_EVENT,
+ /** Frontal collision has happened.
+ */
+ FRONTAL,
+ /** Side collision has happened.
+ */
+ SIDE,
+ /**Rear collision has happened.
+ */
+ REAR,
+ /** A rollover event has happened.
+ */
+ ROLLOVER,
+ /** The signal is not supported
+ */
+ NOT_SUPPORTED,
+ /** Emergency status cannot be determined
+ */
+ FAULT;
+ /**
+ * Convert String to EmergencyEventType
+ * @param value String
+ * @return EmergencyEventTpe
+ */
+ public static EmergencyEventType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FileType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FileType.java
new file mode 100644
index 000000000..112d3d259
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FileType.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enumeration listing possible file types.
+ * @since SmartDeviceLink 2.0
+ */
+public enum FileType {
+ /**
+ * BMP
+ */
+ GRAPHIC_BMP,
+ /**
+ * JPEG
+ */
+ GRAPHIC_JPEG,
+ /**
+ * PNG
+ */
+ GRAPHIC_PNG,
+ /**
+ * WAVE
+ */
+ AUDIO_WAVE,
+ AUDIO_AAC,
+ /**
+ * MP3
+ */
+ AUDIO_MP3,
+ BINARY,
+ JSON;
+
+ /**
+ * Convert String to FileType
+ * @param value String
+ * @return FileType
+ */
+ public static FileType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelCutoffStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelCutoffStatus.java
new file mode 100644
index 000000000..2098de77f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelCutoffStatus.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** Reflects the status of the Restraints Control Module fuel pump cutoff.<br> The fuel pump is cut off typically after the vehicle has had a collision.
+ * <p>
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ */
+public enum FuelCutoffStatus {
+ /** Fuel is cut off
+ */
+ TERMINATE_FUEL,
+ /** Fuel is not cut off
+ *
+ */
+ NORMAL_OPERATION,
+ /** Status of the fuel pump cannot be determined
+ *
+ */
+ FAULT;
+ /**
+ * Convert String to FuelCutoffStatus
+ * @param value String
+ * @return FuelCuttoffStatus
+ */
+ public static FuelCutoffStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelType.java
new file mode 100644
index 000000000..7ddc3cc9d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelType.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum FuelType {
+ GASOLINE,
+ DIESEL,
+ /**
+ * For vehicles using compressed natural gas.
+ */
+ CNG,
+ /**
+ * For vehicles using liquefied petroleum gas.
+ */
+ LPG,
+ /**
+ * For FCEV (fuel cell electric vehicle).
+ */
+ HYDROGEN,
+ /**
+ * For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery.
+ */
+ BATTERY,
+ ;
+
+ public static FuelType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/GlobalProperty.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/GlobalProperty.java
new file mode 100644
index 000000000..d6a0a63aa
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/GlobalProperty.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Properties of a user-initiated VR interaction (i.e. interactions started by the user pressing the PTT button).
+ * @since SmartDeviceLink 1.0
+ */
+public enum GlobalProperty{
+ /**
+ * The help prompt to be spoken if the user needs assistance during a user-initiated interaction.
+ */
+ HELPPROMPT,
+ /**
+ * The prompt to be spoken if the user-initiated interaction times out waiting for the user's verbal input.
+ */
+ TIMEOUTPROMPT,
+ /**
+ * The property vrHelpTitle of setGlobalProperties
+ */
+
+ VRHELPTITLE,
+ /**
+ * The property array of vrHelp of setGlobalProperties
+ */
+
+ VRHELPITEMS,
+ /**
+ * The property in-app menu name of setGlobalProperties
+ */
+
+ MENUNAME,
+ /**
+ * The property in-app menu icon of setGlobalProperties
+ */
+
+ MENUICON,
+ /**
+ * The on-screen keyboard configuration of setGlobalProperties
+ */
+
+ KEYBOARDPROPERTIES;
+
+ /**
+ * Convert String to GlobalProperty
+ * @param value String
+ * @return GlobalProperty
+ */
+ public static GlobalProperty valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java
new file mode 100644
index 000000000..f0ffcbed1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ * Specifies current level of the HMI. An HMI level indicates the degree of user interaction possible through the HMI (e.g. TTS only, display only, VR, etc.). The HMI level varies for an application based on the type of display (i.e. Nav or non-Nav) and the user directing "focus" to other applications (e.g. phone, other mobile applications, etc.)
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum HMILevel {
+ /**
+ * The application has full use of the SDL HMI. The app may output via TTS, display, or streaming audio and may gather input via VR, Menu, and button presses
+ */
+ HMI_FULL("FULL"),
+ /**
+ * This HMI Level is only defined for a media application using an HMI with an 8 inch touchscreen (Nav) system. The application's {@linkplain com.smartdevicelink.proxy.rpc.Show} text is displayed and it receives button presses from media-oriented buttons (SEEKRIGHT, SEEKLEFT, TUNEUP, TUNEDOWN, PRESET_0-9)
+ */
+ HMI_LIMITED("LIMITED"),
+ /**
+ * App cannot interact with user via TTS, VR, Display or Button Presses. App can perform the following operations:
+ * <ul>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.AddCommand}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.DeleteCommand}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.AddSubMenu}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.DeleteSubMenu}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.SubscribeButton}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.UnsubscribeButton}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.Show}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.UnregisterAppInterface}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.ResetGlobalProperties}</li>
+ * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.SetGlobalProperties}</li>
+ * </ul>
+ */
+ HMI_BACKGROUND("BACKGROUND"),
+ /**
+ * Application has been discovered by SDL, but application cannot send any requests or receive any notifications
+ * An HMILevel of NONE can also mean that the user has exited the application by saying "exit appname" or selecting "exit" from the application's menu. When this happens, the application still has an active interface registration with SDL and all SDL resources the application has created (e.g. Choice Sets, subscriptions, etc.) still exist. But while the HMILevel is NONE, the application cannot send any messages to SDL, except <i>{@linkplain com.smartdevicelink.proxy.rpc.UnregisterAppInterface}</li>
+ */
+ HMI_NONE("NONE");
+
+ private final String INTERNAL_NAME;
+
+ private HMILevel(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ /**
+ * Returns a HMILevel Status (FULL, LIMITED, BACKGROUND or NONE)
+ * @param value a String
+ * @return HMILevel -a String value (FULL, LIMITED, BACKGROUND or NONE)
+ */
+ public static HMILevel valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (HMILevel anEnum : EnumSet.allOf(HMILevel.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HmiZoneCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HmiZoneCapabilities.java
new file mode 100644
index 000000000..0a0a654b1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HmiZoneCapabilities.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Specifies HMI Zones in the vehicle.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum HmiZoneCapabilities {
+ /**
+ * Indicates HMI available for front seat passengers.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ FRONT,
+ /**
+ * Indicates HMI available for rear seat passengers.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ BACK;
+ /**
+ * Convert String to HMIZoneCapabilities
+ * @param value String
+ * @return HMIZoneCapabilities
+ */
+
+ public static HmiZoneCapabilities valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HybridAppPreference.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HybridAppPreference.java
new file mode 100644
index 000000000..4c8a9205b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HybridAppPreference.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum HybridAppPreference {
+
+ MOBILE,
+ CLOUD,
+ BOTH;
+
+ public static HybridAppPreference valueForString(String value){
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStableStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStableStatus.java
new file mode 100644
index 000000000..6404ef0bc
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStableStatus.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Reflects the ignition switch stability.
+ * @since SmartDeviceLink 2.0
+ */
+public enum IgnitionStableStatus {
+ /**
+ * The current ignition switch status is considered not to be stable.
+ */
+ IGNITION_SWITCH_NOT_STABLE,
+ /**
+ * The current ignition switch status is considered to be stable.
+ */
+ IGNITION_SWITCH_STABLE,
+ MISSING_FROM_TRANSMITTER;
+
+ /**
+ * Convert String to IgnitionStableStatus
+ * @param value String
+ * @return IgnitionStableStatus
+ */
+ public static IgnitionStableStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStatus.java
new file mode 100644
index 000000000..f917d7221
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStatus.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Reflects the status of ignition.
+ * @since SmartDeviceLink 2.0
+ */
+public enum IgnitionStatus {
+ /**
+ * Ignition status currently unknown
+ */
+ UNKNOWN,
+ /**
+ * Ignition is off
+ */
+ OFF,
+ /**
+ * Ignition is in mode accessory
+ */
+ ACCESSORY,
+ /**
+ * Ignition is in mode run
+ */
+ RUN,
+ /**
+ * Ignition is in mode run
+ */
+ START,
+ /**
+ * Signal is invalid
+ */
+ INVALID;
+
+ /**
+ * Convert String to IgnitionStatus
+ * @param value String
+ * @return IgnitionStatus
+ */
+ public static IgnitionStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java
new file mode 100644
index 000000000..c88591a23
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * The name that identifies the field.
+ *
+ * @since SmartDeviceLink 2.3.2
+ */
+public enum ImageFieldName {
+ /** The image field for SoftButton
+ *
+ */
+
+ softButtonImage,
+ /** The first image field for Choice.
+ *
+ */
+
+ choiceImage,
+ /** The secondary image field for Choice.
+ *
+ */
+
+ choiceSecondaryImage,
+ /** The image field for vrHelpItem.
+ *
+ */
+
+ vrHelpItem,
+ /** The image field for Turn.
+ *
+ */
+
+ turnIcon,
+ /** The image field for the menu icon in SetGlobalProperties.
+ *
+ */
+
+ menuIcon,
+ /** The image filed for AddCommand.
+ *
+ */
+
+ cmdIcon,
+ /** The image field for the app icon ( set by setAppIcon).
+ *
+ */
+
+ appIcon,
+ /** The image filed for Show.
+ *
+ */
+
+ graphic,
+ /** The primary image field for ShowConstant TBT.
+ *
+ */
+
+ showConstantTBTIcon,
+
+ /** The secondary image field for ShowConstant TBT.
+ *
+ */
+ showConstantTBTNextTurnIcon,
+ /**
+ * The optional image of a destination / location
+ *
+ * @since SmartDeviceLink 4.0
+ */
+ locationImage,
+ /**
+ * The secondary graphic image field
+ *
+ * @since SmartDeviceLink 5.0
+ */
+ secondaryGraphic,
+ ;
+
+ /**
+ * Convert String to ImageFieldName
+ * @param value String
+ * @return ImageFieldName
+ */
+ public static ImageFieldName valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageType.java
new file mode 100644
index 000000000..9eb89a794
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageType.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Contains information about the type of image.
+ * @since SmartDeviceLink 2.0
+ */
+public enum ImageType {
+ /**
+ * Just the static hex icon value to be used
+ */
+ STATIC,
+ /**
+ * Binary image file to be used (identifier to be sent by PutFile)
+ */
+ DYNAMIC;
+
+ /**
+ * Convert String to ImageType
+ * @param value String
+ * @return ImageType
+ */
+ public static ImageType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/InteractionMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/InteractionMode.java
new file mode 100644
index 000000000..a6a8c1e07
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/InteractionMode.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * For application-initiated interactions (<i>{@linkplain com.smartdevicelink.proxy.rpc.PerformInteraction}</i>), this specifies
+ * the mode by which the user is prompted and by which the user's selection is
+ * indicated
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum InteractionMode {
+ /**
+ * This mode causes the interaction to occur only on the display, meaning
+ * the choices are presented and selected only via the display. Selections
+ * are viewed with the SEEKRIGHT, SEEKLEFT, TUNEUP, TUNEDOWN buttons. User's
+ * selection is indicated with the OK button
+ */
+ MANUAL_ONLY,
+ /**
+ * This mode causes the interaction to occur only through TTS and VR. The
+ * user is prompted via TTS to select a choice by saying one of the choice's
+ * synonyms
+ */
+ VR_ONLY,
+ /**
+ * This mode is a combination of MANUAL_ONLY and VR_ONLY, meaning the user
+ * is prompted both visually and audibly. The user can make a selection
+ * either using the mode described in MANUAL_ONLY or using the mode
+ * described in VR_ONLY. If the user views selections as described in
+ * MANUAL_ONLY mode, the interaction becomes strictly, and irreversibly, a
+ * MANUAL_ONLY interaction (i.e. the VR session is cancelled, although the
+ * interaction itself is still in progress). If the user interacts with the
+ * VR session in any way (e.g. speaks a phrase, even if it is not a
+ * recognized choice), the interaction becomes strictly, and irreversibly, a
+ * VR_ONLY interaction (i.e. the MANUAL_ONLY mode forms of interaction will
+ * no longer be honored)
+ *
+ * <p>The TriggerSource parameter of the
+ * {@linkplain com.smartdevicelink.proxy.rpc.PerformInteraction} response will
+ * indicate which interaction mode the user finally chose to attempt the
+ * selection (even if the interaction did not end with a selection being
+ * made)</P>
+ */
+ BOTH;
+
+ /**
+ * Returns InteractionMode (MANUAL_ONLY, VR_ONLY or BOTH)
+ * @param value a String
+ * @return InteractionMode -MANUAL_ONLY, VR_ONLY or BOTH
+ */
+
+ public static InteractionMode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Jingle.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Jingle.java
new file mode 100644
index 000000000..99ab804eb
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Jingle.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+
+public enum Jingle{
+ POSITIVE("POSITIVE_JINGLE"),
+ NEGATIVE("NEGATIVE_JINGLE"),
+ INITIAL("INITIAL_JINGLE"),
+ LISTEN("LISTEN_JINGLE"),
+ HELP("HELP_JINGLE");
+
+ private final String INTERNAL_NAME;
+
+ private Jingle(String name){
+ this.INTERNAL_NAME = name;
+ }
+
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ public static Jingle valueForString(String value) {
+ for (Jingle anEnum : EnumSet.allOf(Jingle.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardEvent.java
new file mode 100644
index 000000000..94eb79f79
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardEvent.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * Enumeration listing possible keyboard events.
+ *
+ *
+ */
+public enum KeyboardEvent {
+ /** The use has pressed the keyboard key (applies to both SINGLE_KEYPRESS and RESEND_CURRENT_ENTRY modes).
+ *
+ */
+
+ KEYPRESS,
+ /** The User has finished entering text from the keyboard and submitted the entry.
+ *
+ */
+
+ ENTRY_SUBMITTED,
+ /** The User has pressed the HMI-defined "Cancel" button.
+ *
+ */
+
+ ENTRY_CANCELLED,
+ /** The User has not finished entering text and the keyboard is aborted with the event of higher priority.
+ *
+ */
+ ENTRY_ABORTED,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ ENTRY_VOICE,
+ ;
+ /**
+ * Convert String to KeyboardEvent
+ * @param value String
+ * @return KeyboardEvent
+ */
+
+ public static KeyboardEvent valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardLayout.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardLayout.java
new file mode 100644
index 000000000..f2b3fadd5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardLayout.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * Enumeration listing possible keyboard layouts.
+ *
+ * @since SmartDeviceLink 2.3.2
+ */
+public enum KeyboardLayout {
+ QWERTY,
+ QWERTZ,
+ AZERTY;
+
+ public static KeyboardLayout valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java
new file mode 100644
index 000000000..432b8f150
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * Enumeration listing possible keyboard events.
+ *
+ *
+ */
+public enum KeypressMode {
+ /**
+ * Each keypress is individually sent as the user presses the keyboard keys.
+ */
+ SINGLE_KEYPRESS,
+ /**
+ * The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.
+ */
+ QUEUE_KEYPRESSES,
+ /**
+ * The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.
+ */
+ RESEND_CURRENT_ENTRY;
+
+ public static KeypressMode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Language.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Language.java
new file mode 100644
index 000000000..d0671fdc3
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Language.java
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ * Specifies the language to be used for TTS, VR, displayed messages/menus
+ *
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ */
+public enum Language {
+ /**
+ * English - SA
+ */
+
+ EN_SA("EN-SA"),
+
+ /**
+ * Hebrew - IL
+ */
+
+ HE_IL("HE-IL"),
+
+ /**
+ * Romanian - RO
+ */
+
+ RO_RO("RO-RO"),
+
+ /**
+ * Ukrainian - UA
+ */
+
+ UK_UA("UK-UA"),
+
+ /**
+ * Indonesian - ID
+ */
+
+ ID_ID("ID-ID"),
+
+ /**
+ * Vietnamese - VN
+ */
+
+ VI_VN("VI-VN"),
+
+ /**
+ * Malay - MY
+ */
+
+ MS_MY("MS-MY"),
+
+ /**
+ * Hindi - IN
+ */
+
+ HI_IN("HI-IN"),
+
+ /**
+ * Dutch - BE
+ */
+
+ NL_BE("NL-BE"),
+
+ /**
+ * Greek - GR
+ */
+
+ EL_GR("EL-GR"),
+
+ /**
+ * Hungarian - HU
+ */
+
+ HU_HU("HU-HU"),
+
+ /**
+ * Finnish - FI
+ */
+
+ FI_FI("FI-FI"),
+
+ /**
+ * Slovak - SK
+ */
+
+ SK_SK("SK-SK"),
+ /**
+ * English - US
+ */
+
+ EN_US("EN-US"),
+ /**
+ * Spanish - Mexico
+ */
+
+ ES_MX("ES-MX"),
+ /**
+ * French - Canada
+ */
+
+ FR_CA("FR-CA"),
+ /**
+ * German - Germany
+ */
+
+ DE_DE("DE-DE"),
+ /**
+ * Spanish - Spain
+ */
+
+ ES_ES("ES-ES"),
+ /**
+ * English - GB
+ */
+
+ EN_GB("EN-GB"),
+ /**
+ * Russian - Russia
+ */
+
+ RU_RU("RU-RU"),
+ /**
+ * Turkish - Turkey
+ */
+
+ TR_TR("TR-TR"),
+ /**
+ * Polish - Poland
+ */
+
+ PL_PL("PL-PL"),
+ /**
+ * French - France
+ */
+
+ FR_FR("FR-FR"),
+ /**
+ * Italian - Italy
+ */
+
+ IT_IT("IT-IT"),
+ /**
+ * Swedish - Sweden
+ */
+
+ SV_SE("SV-SE"),
+ /**
+ * Portuguese - Portugal
+ */
+
+ PT_PT("PT-PT"),
+ /**
+ * Dutch (Standard) - Netherlands
+ */
+
+ NL_NL("NL-NL"),
+ /**
+ * English - Australia
+ */
+
+ EN_AU("EN-AU"),
+ /**
+ * Mandarin - China
+ */
+
+ ZH_CN("ZH-CN"),
+ /**
+ * Mandarin - Taiwan
+ */
+
+ ZH_TW("ZH-TW"),
+ /**
+ * Japanese - Japan
+ */
+
+ JA_JP("JA-JP"),
+ /**
+ * Arabic - Saudi Arabia
+ */
+
+ AR_SA("AR-SA"),
+ /**
+ * Korean - South Korea
+ */
+
+ KO_KR("KO-KR"),
+ /**
+ * Portuguese - Brazil
+ */
+
+ PT_BR("PT-BR"),
+ /**
+ * Czech - Czech Republic
+ */
+
+ CS_CZ("CS-CZ"),
+ /**
+ * Danish - Denmark
+ */
+
+ DA_DK("DA-DK"),
+ /**
+ * Norwegian - Norway
+ */
+
+ NO_NO("NO-NO"),
+ /**
+ * English - India
+ */
+
+ EN_IN("EN-IN"),
+ /**
+ * Thai - Thailand
+ */
+
+ TH_TH("TH-TH");
+
+ private final String INTERNAL_NAME;
+
+ private Language(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+ /**
+ * Returns a String representing a kind of Language
+ */
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ /**
+ * Returns a Language's name
+ * @param value a String
+ * @return Language -EN-US, ES-MX or FR-CA
+ */
+ public static Language valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (Language anEnum : EnumSet.allOf(Language.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LayoutMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LayoutMode.java
new file mode 100644
index 000000000..2d2d3685d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LayoutMode.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * For touchscreen interactions, the mode of how the choices are presented.
+ *
+ *
+ */
+public enum LayoutMode {
+ /**
+ * This mode causes the interaction to display the previous set of choices as icons.
+ */
+ ICON_ONLY,
+ /**
+ * This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.
+ */
+ ICON_WITH_SEARCH,
+ /**
+ * This mode causes the interaction to display the previous set of choices as a list
+ */
+ LIST_ONLY,
+ /**
+ * This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.
+ */
+ LIST_WITH_SEARCH,
+ /**
+ * This mode causes the interaction to immediately display a keyboard entry through the HMI.
+ */
+ KEYBOARD;
+
+ public static LayoutMode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java
new file mode 100644
index 000000000..b44431a23
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java
new file mode 100644
index 000000000..cd21978c9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LockScreenStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LockScreenStatus.java
new file mode 100644
index 000000000..9895c679f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/LockScreenStatus.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ *
+ * Status of the Lock Screen.
+ *
+ */
+public enum LockScreenStatus {
+ /**
+ * LockScreen is Required
+ */
+
+ REQUIRED,
+ /**
+ * LockScreen is Optional
+ */
+
+ OPTIONAL,
+ /**
+ * LockScreen is Not Required
+ */
+
+ OFF;
+
+ public static LockScreenStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java
new file mode 100644
index 000000000..618c166a5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * List possible cushions of a multi-contour massage seat.
+ */
+public enum MassageCushion {
+ TOP_LUMBAR,
+ MIDDLE_LUMBAR,
+ BOTTOM_LUMBAR,
+ BACK_BOLSTERS,
+ SEAT_BOLSTERS,
+ ;
+
+ public static MassageCushion valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java
new file mode 100644
index 000000000..e1faa2ace
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * List possible modes of a massage zone.
+ */
+public enum MassageMode {
+ OFF,
+ LOW,
+ HIGH,
+ ;
+
+ public static MassageMode valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java
new file mode 100644
index 000000000..8c7b62f6b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * List possible zones of a multi-contour massage seat.
+ */
+public enum MassageZone {
+ /**
+ * The back of a multi-contour massage seat. or SEAT_BACK
+ */
+ LUMBAR,
+ /**
+ * The bottom a multi-contour massage seat. or SEAT_BOTTOM
+ */
+ SEAT_CUSHION,
+ ;
+
+ public static MassageZone valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java
new file mode 100644
index 000000000..d4a512088
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Indicates the format of the time displayed on the connected SDL unit.Format
+ * description follows the following nomenclature:<p> Sp = Space</p> <p>| = or </p><p>c =
+ * character</p>
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum MediaClockFormat {
+ /**
+ * <p>
+ * </p>
+ * <ul>
+ * <li>maxHours = 19</li>
+ * <li>maxMinutes = 59</li>
+ * <li>maxSeconds = 59</li>
+ * </ul>
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ */
+ CLOCK1,
+ /**
+ * <p>
+ * </p>
+ * <ul>
+ * <li>maxHours = 59</li>
+ * <li>maxMinutes = 59</li>
+ * <li>maxSeconds = 59</li>
+ * </ul>
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ */
+ CLOCK2,
+ /**
+ * <p>
+ * </p>
+ * <ul>
+ * <li>maxHours = 9</li>
+ * <li>maxMinutes = 59</li>
+ * <li>maxSeconds = 59</li>
+ * </ul>
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ */
+ CLOCK3,
+ /**
+ * <p>
+ * </p>
+ * <ul>
+ * <li>5 characters possible</li>
+ * <li>Format: 1|sp c :|sp c c</li>
+ * <li>1|sp : digit "1" or space</li>
+ * <li>c : character out of following character set: sp|0-9|[letters, see
+ * TypeII column in XLS.</li>
+ * <li>:|sp : colon or space</li>
+ * <li>used for Type II headunit</li>
+ * </ul>
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ CLOCKTEXT1,
+ /**
+ * <p>
+ * </p>
+ * <ul>
+ * <li>5 characters possible</li>
+ * <li>Format: 1|sp c :|sp c c</li>
+ * <li>1|sp : digit "1" or space</li>
+ * <li>c : character out of following character set: sp|0-9|[letters, see
+ * CID column in XLS.</li>
+ * <li>:|sp : colon or space</li>
+ * <li>used for CID headunit</li>
+ * </ul>
+ * difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character
+ * set
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ CLOCKTEXT2,
+ /**
+ * <p>
+ * </p>
+ * <ul>
+ * <li>6 chars possible</li>
+ * <li>Format: 1|sp c c :|sp c c</li>
+ * <li>1|sp : digit "1" or space</li>
+ * <li>c : character out of following character set: sp|0-9|[letters, see
+ * Type 5 column in XLS].</li>
+ * <li>:|sp : colon or space</li>
+ * <li>used for Type V headunit</li>
+ * </ul>
+ * difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character
+ * set
+ *
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ CLOCKTEXT3,
+ /**
+ * <p>
+ * </p>
+ * <ul>
+ * <li>6 chars possible</li>
+ * <li>Format: c :|sp c c : c c</li>
+ * <li>:|sp : colon or space</li>
+ * <li>c : character out of following character set: sp|0-9|[letters]</li>
+ * <li>used for MFD3/4/5 headunits</li>
+ * </ul>
+ *
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ CLOCKTEXT4;
+
+ public static MediaClockFormat valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaType.java
new file mode 100644
index 000000000..a2b2e2e6a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaType.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+
+public enum MediaType {
+
+ MUSIC,
+
+ PODCAST,
+
+ AUDIOBOOK,
+
+ OTHER,
+
+ ;
+
+ public static MediaType valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MetadataType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MetadataType.java
new file mode 100644
index 000000000..07750b81f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MetadataType.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ * Defines the metadata types that can be applied to text fields
+ *
+ */
+public enum MetadataType {
+
+ /**
+ * The data in this field contains the title of the currently playing audio track.
+ */
+ MEDIA_TITLE("mediaTitle"),
+
+ /**
+ * The data in this field contains the artist or creator of the currently playing audio track.
+ */
+ MEDIA_ARTIST("mediaArtist"),
+
+ /**
+ * The data in this field contains the album title of the currently playing audio track.
+ */
+ MEDIA_ALBUM("mediaAlbum"),
+
+ /**
+ * The data in this field contains the creation year of the currently playing audio track.
+ */
+ MEDIA_YEAR("mediaYear"),
+
+ /**
+ * The data in this field contains the genre of the currently playing audio track.
+ */
+ MEDIA_GENRE("mediaGenre"),
+
+ /**
+ * The data in this field contains the name of the current source for the media.
+ */
+ MEDIA_STATION("mediaStation"),
+
+ /**
+ * The data in this field is a rating.
+ */
+ RATING("rating"),
+
+ /**
+ * The data in this field is the current temperature.
+ */
+ CURRENT_TEMPERATURE("currentTemperature"),
+
+ /**
+ * The data in this field is the maximum temperature for the day.
+ */
+ MAXIMUM_TEMPERATURE("maximumTemperature"),
+
+ /**
+ * The data in this field is the minimum temperature for the day.
+ */
+ MINIMUM_TEMPERATURE("minimumTemperature"),
+
+ /**
+ * The data in this field describes the current weather (ex. cloudy, clear, etc.).
+ */
+ WEATHER_TERM("weatherTerm"),
+
+ /**
+ * The data in this field describes the current humidity value.
+ */
+ HUMIDITY("humidity"),
+
+
+ ;
+
+ private final String internalName;
+
+ private MetadataType(String internalName) {
+ this.internalName = internalName;
+ }
+
+ public String toString() {
+ return this.internalName;
+ }
+
+ public static MetadataType valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (MetadataType anEnum : EnumSet.allOf(MetadataType.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java
new file mode 100644
index 000000000..22b9be8a6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum ModuleType {
+ CLIMATE,
+ RADIO,
+ SEAT,
+ AUDIO,
+ LIGHT,
+ HMI_SETTINGS,
+ ;
+
+ public static ModuleType valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/NavigationAction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/NavigationAction.java
new file mode 100644
index 000000000..a576d69bf
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/NavigationAction.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum NavigationAction {
+
+ /**
+ * Using this action plus a supplied direction can give the type of turn.
+ */
+ TURN,
+
+ EXIT,
+
+ STAY,
+
+ MERGE,
+
+ FERRY,
+
+ CAR_SHUTTLE_TRAIN,
+
+ WAYPOINT,
+
+ ;
+
+ public static NavigationAction valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/NavigationJunction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/NavigationJunction.java
new file mode 100644
index 000000000..f7c535657
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/NavigationJunction.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum NavigationJunction {
+
+ /**
+ * A junction that represents a standard intersection with a single road crossing another.
+ */
+ REGULAR,
+
+ /**
+ * A junction where the road splits off into two paths; a fork in the road.
+ */
+ BIFURCATION,
+
+ /**
+ * A junction that has multiple intersections and paths.
+ */
+ MULTI_CARRIAGEWAY,
+
+ /**
+ * A junction where traffic moves in a single direction around a central, non-traversable point
+ * to reach one of the connecting roads.
+ */
+ ROUNDABOUT,
+
+ /**
+ * Similar to a roundabout, however the center of the roundabout is fully traversable. Also
+ * known as a mini-roundabout.
+ */
+ TRAVERSABLE_ROUNDABOUT,
+
+ /**
+ * A junction where lefts diverge to the right, then curve to the left, converting a left turn
+ * to a crossing maneuver.
+ */
+ JUGHANDLE,
+
+ /**
+ * Multiple way intersection that allows traffic to flow based on priority; most commonly right
+ * of way and first in, first out.
+ */
+ ALL_WAY_YIELD,
+
+ /**
+ * A junction designated for traffic turn arounds.
+ */
+ TURN_AROUND,
+
+ ;
+
+ public static NavigationJunction valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PRNDL.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PRNDL.java
new file mode 100644
index 000000000..a605ade87
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PRNDL.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * The selected gear.
+ * @since SmartDeviceLink 2.0
+ */
+public enum PRNDL {
+ /**
+ * Parking
+ */
+ PARK,
+ /**
+ * Reverse gear
+ */
+ REVERSE,
+ /**
+ * No gear
+ */
+ NEUTRAL,
+ DRIVE,
+ /**
+ * Drive Sport mode
+ */
+ SPORT,
+ /**
+ * 1st gear hold
+ */
+ LOWGEAR,
+ /**
+ * First gear
+ */
+ FIRST,
+ /**
+ * Second gear
+ */
+ SECOND,
+ /**
+ * Third gear
+ */
+ THIRD,
+ /**
+ * Fourth gear
+ */
+ FOURTH,
+ /**
+ * Fifth gear
+ */
+ FIFTH,
+ /**
+ * Sixth gear
+ */
+ SIXTH,
+ SEVENTH,
+ EIGHTH,
+ UNKNOWN,
+ FAULT;
+
+ /**
+ * Convert String to PRNDL
+ * @param value String
+ * @return PRNDL
+ */
+ public static PRNDL valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeQualificationStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeQualificationStatus.java
new file mode 100644
index 000000000..1a98b73ba
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeQualificationStatus.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** Reflects the status of the current power mode qualification.
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ */
+
+public enum PowerModeQualificationStatus {
+ /** The power mode of the vehicle is currently considered undefined
+ *
+ */
+
+ POWER_MODE_UNDEFINED,
+ /** The evaluation of the power mode is in progress
+ *
+ */
+
+ POWER_MODE_EVALUATION_IN_PROGRESS,
+ /** Currently undefined
+ *
+ */
+
+ NOT_DEFINED,
+ /** The power mode of the vehicle
+ *
+ */
+
+ POWER_MODE_OK;
+ /**
+ * Convert String to PowerModeQualificationStatus
+ * @param value String
+ * @return PowerModeQualificationStatus
+ */
+
+ public static PowerModeQualificationStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java
new file mode 100644
index 000000000..a16399201
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** Reflects the status of the current power mode.
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ */
+public enum PowerModeStatus {
+ /** Key not inserted
+ *
+ */
+ KEY_OUT,
+ /** Key is currently out
+ *
+ */
+ KEY_RECENTLY_OUT,
+
+ KEY_APPROVED_0,
+ POST_ACCESORY_0,
+ /** Key is in accessory positon
+ *
+ */
+
+ ACCESORY_1,
+ POST_IGNITION_1,
+
+ /** Key is in position ignition on
+ *
+ */
+ IGNITION_ON_2,
+ /** Key is in position running
+ *
+ */
+
+ RUNNING_2,
+ /** Key is in crank position
+ *
+ */
+
+ CRANK_3;
+
+ public static PowerModeStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java
new file mode 100644
index 000000000..74f01165c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrerecordedSpeech.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrerecordedSpeech.java
new file mode 100644
index 000000000..6b06b9b97
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrerecordedSpeech.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * Contains a list of Pre-recorded speech items present on the platform.
+ *
+ *
+ */
+public enum PrerecordedSpeech {
+ HELP_JINGLE,
+ INITIAL_JINGLE,
+ LISTEN_JINGLE,
+ POSITIVE_JINGLE,
+ NEGATIVE_JINGLE;
+ /**
+ * Convert String to PrerecordedSpeech
+ * @param value String
+ * @return PrerecordedSpeech
+ */
+
+ public static PrerecordedSpeech valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java
new file mode 100644
index 000000000..36d3d4c9a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Reflects the current primary audio source of SDL (if selected).
+ * @since SmartDeviceLink 2.0
+ */
+public enum PrimaryAudioSource {
+ /**
+ * Currently no source selected
+ */
+ NO_SOURCE_SELECTED,
+ /**
+ * CD is current source
+ */
+ CD,
+ /**
+ * USB is current source
+ */
+ USB,
+ /**
+ * USB2 is current source
+ */
+ USB2,
+ /**
+ * Bluetooth Stereo is current source
+ */
+ BLUETOOTH_STEREO_BTST,
+ /**
+ * Line in is current source
+ */
+ LINE_IN,
+ /**
+ * iPod is current source
+ */
+ IPOD,
+ /**
+ * Mobile app is current source
+ */
+ 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;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioBand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioBand.java
new file mode 100644
index 000000000..e7724e8ce
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioBand.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum RadioBand {
+ AM,
+ FM,
+ XM,
+ ;
+
+ public static RadioBand valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioState.java
new file mode 100644
index 000000000..0408f6061
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioState.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * List possible states of a remote control radio module.
+ */
+public enum RadioState {
+ ACQUIRING,
+ ACQUIRED,
+ MULTICAST,
+ NOT_FOUND,
+ ;
+
+ public static RadioState valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RequestType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RequestType.java
new file mode 100644
index 000000000..4ad9438e9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/RequestType.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * Enumeration listing possible asynchronous requests.
+ *
+ *
+ */
+public enum RequestType {
+
+ HTTP,
+ FILE_RESUME,
+ AUTH_REQUEST,
+ AUTH_CHALLENGE,
+ AUTH_ACK,
+ PROPRIETARY,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ QUERY_APPS,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ LAUNCH_APP,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ LOCK_SCREEN_ICON_URL,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ TRAFFIC_MESSAGE_CHANNEL,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ DRIVER_PROFILE,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ VOICE_SEARCH,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ NAVIGATION,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ PHONE,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ CLIMATE,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ SETTINGS,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ VEHICLE_DIAGNOSTICS,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ EMERGENCY,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ MEDIA,
+ /**
+ * @since SmartDeviceLink 4.0
+ */
+ FOTA,
+ /**
+ * @since SmartDeviceLink 5.0
+ */
+ OEM_SPECIFIC,
+ /**
+ * @since SmartDeviceLink 5.1
+ */
+ ICON_URL,
+ ;
+ /**
+ * Convert String to RequestType
+ * @param value String
+ * @return RequestType
+ */
+ public static RequestType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Result.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Result.java
new file mode 100644
index 000000000..1df3bcba5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/Result.java
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Defines the possible result codes returned by SDL to the application in a
+ * Response to a requested operation
+ *
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum Result {
+ /**
+ * The request succeeded
+ */
+ SUCCESS,
+ /**
+ * <p>The data sent is invalid. For example:</p>
+ * <ul>
+ * <li>Invalid Json syntax</li>
+ * <li>Parameters out of bounds (number or enum range)</li>
+ * <li>Mandatory parameters not provided</li>
+ * <li>Parameter provided with wrong type</li>
+ * <li>Invalid characters</li>
+ * <li>Empty string</li>
+ * </ul>
+ */
+ INVALID_DATA,
+ /**
+ * The request is not supported by SDL
+ */
+ UNSUPPORTED_REQUEST,
+ /**
+ * The system could not process the request because the necessary memory
+ * couldn't be allocated
+ */
+ OUT_OF_MEMORY,
+ /**
+ * There are too many requests pending (means that the response has not been
+ * delivered yet). There is a limit of 1000 pending requests at a time
+ */
+ TOO_MANY_PENDING_REQUESTS,
+ /**
+ * <p>One of the provided IDs is not valid. For example:</p>
+ * <ul>
+ * <li>CorrelationID</li>
+ * <li>CommandID</li>
+ * <li>MenuID</li>
+ * </ul>
+ */
+ INVALID_ID,
+ /**
+ * The provided name or synonym is a duplicate of some already-defined name
+ * or synonym
+ */
+ DUPLICATE_NAME,
+ /**
+ * Specified application name is already associated with an active interface
+ * registration. Attempts at doing a second <i>
+ * {@linkplain com.smartdevicelink.proxy.rpc.RegisterAppInterface}</i> on a
+ * given protocol session will also cause this
+ */
+ TOO_MANY_APPLICATIONS,
+ /**
+ * SDL does not support the interface version requested by the mobile
+ * application
+ */
+ APPLICATION_REGISTERED_ALREADY,
+ /**
+ * The requested language is currently not supported. Might be because of a
+ * mismatch of the currently active language
+ */
+ UNSUPPORTED_VERSION,
+ /**
+ * The request cannot be executed because no application interface has been
+ * registered via <i>
+ * {@linkplain com.smartdevicelink.proxy.rpc.RegisterAppInterface}</i>
+ */
+ WRONG_LANGUAGE,
+ /**
+ * The request cannot be executed because no application interface has been
+ * registered via <i>
+ * {@linkplain com.smartdevicelink.proxy.rpc.RegisterAppInterface}</i>
+ */
+ APPLICATION_NOT_REGISTERED,
+ /**
+ * The data may not be changed, because it is currently in use. For example,
+ * when trying to delete a Choice Set that is currently involved in an
+ * interaction
+ */
+ IN_USE,
+ /**
+ *The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.
+ */
+ VEHICLE_DATA_NOT_ALLOWED,
+ /**
+ * The requested vehicle data is not available on this vehicle or is not published.
+ */
+ VEHICLE_DATA_NOT_AVAILABLE,
+ /**
+ * The requested operation was rejected. No attempt was made to perform the
+ * operation
+ */
+ REJECTED,
+ /**
+ * The requested operation was aborted due to some pre-empting event (e.g.
+ * button push, <i>{@linkplain com.smartdevicelink.proxy.rpc.Alert}</i>
+ * pre-empts <i>{@linkplain com.smartdevicelink.proxy.rpc.Speak}</i>, etc.)
+ */
+ ABORTED,
+ /**
+ * The requested operation was ignored because it was determined to be
+ * redundant (e.g. pause media clock when already paused)
+ */
+ IGNORED,
+ /**
+ * A button that was requested for subscription is not supported on the
+ * currently connected SDL platform. See DisplayCapabilities for further
+ * information on supported buttons on the currently connected SDL platform
+ */
+ UNSUPPORTED_RESOURCE,
+ /**
+ * A specified file could not be found on Sync.
+ */
+ FILE_NOT_FOUND,
+ /**
+ * Provided data is valid but something went wrong in the lower layers.
+ */
+ GENERIC_ERROR,
+ /**
+ * RPC is not authorized in local policy table.
+ */
+ DISALLOWED,
+ /**
+ * RPC is included in a functional group explicitly blocked by the user.
+ */
+ USER_DISALLOWED,
+ /**
+ * Overlay reached the maximum timeout and closed.
+ */
+ TIMED_OUT,
+ /**
+ * User selected to Cancel Route.
+ */
+ CANCEL_ROUTE,
+ /**
+ * The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.
+ */
+ TRUNCATED_DATA,
+ /**
+ * The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.
+ */
+ RETRY,
+ /**
+ * The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.
+ */
+ WARNINGS,
+ /**
+ * The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.
+ */
+ SAVED,
+ /**
+ * The certificate provided during authentication is invalid.
+ */
+ INVALID_CERT,
+ /**
+ * The certificate provided during authentication is expired.
+ */
+ EXPIRED_CERT,
+ /**
+ * The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.
+ */
+ RESUME_FAILED,
+ /**
+ * The requested data is not available on this vehicle or is not published for the connected app.
+ */
+ DATA_NOT_AVAILABLE,
+ /**
+ * The requested data is read only thus cannot be change via remote control
+ */
+ READ_ONLY,
+ /**
+ * The data sent failed to pass CRC check in receiver end
+ */
+ CORRUPTED_DATA,
+
+ ;
+ /**
+ * Convert String to Result
+ * @param value String
+ * @return Result
+ */
+
+ public static Result valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SamplingRate.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SamplingRate.java
new file mode 100644
index 000000000..05cdc5519
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SamplingRate.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ * Describes different sampling rates for PerformAudioPassThru
+ * @since SmartDeviceLink 2.0
+ */
+public enum SamplingRate {
+
+ /**
+ * Sampling rate of 8 kHz
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ _8KHZ("8KHZ"),
+ /**
+ * Sampling rate of 16 kHz
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ _16KHZ("16KHZ"),
+ /**
+ * Sampling rate of 22 kHz
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ _22KHZ("22KHZ"),
+ /**
+ * Sampling rate of 44 kHz
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ _44KHZ("44KHZ");
+
+ private final String INTERNAL_NAME;
+
+ private SamplingRate(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ public static SamplingRate valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (SamplingRate anEnum : EnumSet.allOf(SamplingRate.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlConnectionState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlConnectionState.java
new file mode 100644
index 000000000..2107fb739
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlConnectionState.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum SdlConnectionState {
+ SDL_CONNECTED,
+ SDL_DISCONNECTED;
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java
new file mode 100644
index 000000000..e344fb87f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum SdlDisconnectedReason {
+ USER_EXIT,
+ IGNITION_OFF,
+ BLUETOOTH_OFF,
+ USB_DISCONNECTED,
+ REQUEST_WHILE_IN_NONE_HMI_LEVEL,
+ TOO_MANY_REQUESTS,
+ DRIVER_DISTRACTION_VIOLATION,
+ LANGUAGE_CHANGE,
+ MASTER_RESET,
+ FACTORY_DEFAULTS,
+ TRANSPORT_ERROR,
+ APPLICATION_REQUESTED_DISCONNECT,
+ DEFAULT,
+ TRANSPORT_DISCONNECT,
+ HB_TIMEOUT,
+ BLUETOOTH_DISABLED,
+ BLUETOOTH_ADAPTER_ERROR,
+ SDL_REGISTRATION_ERROR,
+ APP_INTERFACE_UNREG,
+ GENERIC_ERROR,
+ /**
+ * This only occurs when multiplexing is running and it is found to be on an old gen 1 system.
+ */
+ LEGACY_BLUETOOTH_MODE_ENABLED,
+ RPC_SESSION_ENDED,
+ PRIMARY_TRANSPORT_CYCLE_REQUEST,
+ MINIMUM_PROTOCOL_VERSION_HIGHER_THAN_SUPPORTED,
+ MINIMUM_RPC_VERSION_HIGHER_THAN_SUPPORTED,
+ ;
+
+
+ public static SdlDisconnectedReason valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+
+ public static SdlDisconnectedReason convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason reason) {
+ if(reason == null){
+ return null;
+ }
+
+ SdlDisconnectedReason returnReason = SdlDisconnectedReason.DEFAULT;
+
+ switch(reason) {
+ case USER_EXIT:
+ returnReason = SdlDisconnectedReason.USER_EXIT;
+ break;
+ case IGNITION_OFF:
+ returnReason = SdlDisconnectedReason.IGNITION_OFF;
+ break;
+ case BLUETOOTH_OFF:
+ returnReason = SdlDisconnectedReason.BLUETOOTH_OFF;
+ break;
+ case USB_DISCONNECTED:
+ returnReason = SdlDisconnectedReason.USB_DISCONNECTED;
+ break;
+ case REQUEST_WHILE_IN_NONE_HMI_LEVEL:
+ returnReason = SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL;
+ break;
+ case TOO_MANY_REQUESTS:
+ returnReason = SdlDisconnectedReason.TOO_MANY_REQUESTS;
+ break;
+ case DRIVER_DISTRACTION_VIOLATION:
+ returnReason = SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION;
+ break;
+ case LANGUAGE_CHANGE:
+ returnReason = SdlDisconnectedReason.LANGUAGE_CHANGE;
+ break;
+ case MASTER_RESET:
+ returnReason = SdlDisconnectedReason.MASTER_RESET;
+ break;
+ case FACTORY_DEFAULTS:
+ returnReason = SdlDisconnectedReason.FACTORY_DEFAULTS;
+ break;
+ default:
+ break;
+ }
+
+ return returnReason;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java
new file mode 100644
index 000000000..40fbc59a9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum SdlInterfaceAvailability {
+ SDL_INTERFACE_AVAILABLE,
+ SDL_INTERFACE_UNAVAILABLE;
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java
new file mode 100644
index 000000000..ef368743d
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum SeatMemoryActionType {
+ /**
+ * Save current seat positions and settings to seat memory.
+ */
+ SAVE,
+ /**
+ * Restore / apply the seat memory settings to the current seat.
+ */
+ RESTORE,
+ /**
+ * No action to be performed.
+ */
+ NONE,
+ ;
+
+ public static SeatMemoryActionType valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ServiceUpdateReason.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ServiceUpdateReason.java
new file mode 100644
index 000000000..bb003284b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ServiceUpdateReason.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enumeration listing possible Service update reasons.
+ */
+public enum ServiceUpdateReason {
+
+ /**
+ * The service has just been published with the module and once
+ * activated to the primary service of its type, it will be ready for possible consumption.
+ */
+ PUBLISHED,
+
+ /**
+ * The service has just been unpublished with the module and is no longer accessible
+ */
+ REMOVED,
+
+ /**
+ * The service is activated as the primary service of this type. All requests dealing with
+ * this service type will be handled by this service.
+ */
+ ACTIVATED,
+
+ /**
+ * The service has been deactivated as the primary service of its type
+ */
+ DEACTIVATED,
+
+ /**
+ * The service has updated its manifest. This could imply updated capabilities
+ */
+ MANIFEST_UPDATE,
+
+ ;
+
+ /**
+ * Convert String to ServiceUpdateReason
+ * @param value String
+ * @return ServiceUpdateReason
+ */
+ public static ServiceUpdateReason valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SoftButtonType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SoftButtonType.java
new file mode 100644
index 000000000..82019ca99
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SoftButtonType.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+/** The enumeration defines the types of the soft buttons to be displayed on UI component:<p>The text is displayed on the soft button</p>
+ *<p>The image is displayed on the soft button</p>
+ *<p>Both image and text are displayed on the soft button.</p>
+ *
+ * @since SmartDeviceLink 2.0
+ */
+public enum SoftButtonType {
+ /** Text displayed
+ *
+ */
+ SBT_TEXT("TEXT"),
+ /** Image displayed
+ *
+ */
+ SBT_IMAGE("IMAGE"),
+ /** Image displayed
+ *
+ */
+ SBT_BOTH("BOTH");
+
+ private final String INTERNAL_NAME;
+
+ private SoftButtonType(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ public static SoftButtonType valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (SoftButtonType anEnum : EnumSet.allOf(SoftButtonType.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SpeechCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SpeechCapabilities.java
new file mode 100644
index 000000000..83dbbec8f
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SpeechCapabilities.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/**
+ * Contains information about TTS capabilities on the SDL platform.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum SpeechCapabilities {
+ /**
+ * The SDL platform can speak text phrases.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ TEXT,
+ /**
+ * The SDL platform can interpret and speak LHPLUS phonemes
+ */
+
+ SAPI_PHONEMES,
+
+ /**
+ * The SDL platform can interpret and speak LHPLUS phonemes
+ */
+
+ LHPLUS_PHONEMES,
+ /**
+ * The SDL platform can play pre-recorded sounds as part of a TTS operation.<p>(e.g. Speak, Alert, PerformInteraction, etc.).</p>
+ */
+ PRE_RECORDED,
+ /**
+ * The SDL platform can play the prerecorded sound of 1 second of silence (i.e. no sound at all).
+ */
+
+ SILENCE,
+
+ /**
+ * The SDL platform can play audio files in conjunction with/without TTS text.
+ */
+ FILE;
+ /**
+ * Convert String to SpeechCapabilities
+ * @param value String
+ * @return SpeechCapabilities
+ */
+
+ public static SpeechCapabilities valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java
new file mode 100644
index 000000000..03e321e61
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java
@@ -0,0 +1,941 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java
new file mode 100644
index 000000000..996e7d34a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * List possible seats that is a remote controllable seat.
+ */
+public enum SupportedSeat {
+ DRIVER,
+ FRONT_PASSENGER,
+ ;
+
+ public static SupportedSeat valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemAction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemAction.java
new file mode 100644
index 000000000..70697e5f6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemAction.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** Enumeration that describes system actions that can be triggered.
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ */
+
+public enum SystemAction {
+ /** Default action occurs. Standard behavior (e.g. SoftButton clears overlay).
+ *
+ */
+
+ DEFAULT_ACTION,
+ /** App is brought into HMI_FULL.
+ *
+ */
+
+ STEAL_FOCUS,
+ /** Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.
+ *
+ */
+
+ KEEP_CONTEXT;
+ /**
+ * Convert String to SystemAction
+ * @param value String
+ * @return SystemAction
+ */
+
+ public static SystemAction valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java
new file mode 100644
index 000000000..69ead0602
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java
@@ -0,0 +1,497 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * <p>The SystemCapabilityType indicates which type of capability information exists in a SystemCapability struct.</p>
+ *
+ * <p><b>Enum List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>NAVIGATION</td>
+ * <td>NavigationCapability</td>
+ * <td>Returns Navigation Capabilities</td>
+ * <td align=center>Y</td>
+ * <td>Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * <tr>
+ * <td>PHONE_CALL</td>
+ * <td>PhoneCapability</td>
+ * <td>Returns Phone Capabilities</td>
+ * <td align=center>Y</td>
+ * <td>Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * <tr>
+ * <td>VIDEO_STREAMING</td>
+ * <td>VideoStreamingCapability</td>
+ * <td>Returns Video Streaming Capabilities</td>
+ * <td align=center>Y</td>
+ * <td>Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * <tr>
+ * <td>REMOTE_CONTROL</td>
+ * <td>RemoteControlCapabilities</td>
+ * <td>Returns Remote Control Capabilities</td>
+ * <td align=center>Y</td>
+ * <td>Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * <tr>
+ * <td>HMI</td>
+ * <td>HMICapabilities</td>
+ * <td>Returns HMI Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * <tr>
+ * <td>DISPLAY</td>
+ * <td>DisplayCapabilities</td>
+ * <td>Returns Display Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * <tr>
+ * <td>AUDIO_PASSTHROUGH</td>
+ * <td>List<AudioPassThruCapabilities></td>
+ * <td>Returns a List of AudioPassThruCapabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
+ * </tr>
+ * <tr>
+ * <td>PCM_STREAMING</td>
+ * <td>AudioPassThruCapabilities</td>
+ * <td>Returns an AudioPassThruCapabilities Object</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
+ * </tr>
+ * <tr>
+ * <td>BUTTON</td>
+ * <td>List<ButtonCapabilities></td>
+ * <td>Returns a List of ButtonCapabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
+ * </tr>
+ * <tr>
+ * <td>HMI_ZONE</td>
+ * <td>HmiZoneCapabilities</td>
+ * <td>Returns HmiZone Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * <tr>
+ * <td>PRESET_BANK</td>
+ * <td>PresetBankCapabilities</td>
+ * <td>Returns PresetBank Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * <tr>
+ * <td>SOFTBUTTON</td>
+ * <td>List<SoftButtonCapabilities></td>
+ * <td>Returns a List of SoftButtonCapabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
+ * </tr>
+ * <tr>
+ * <td>SPEECH</td>
+ * <td>SpeechCapabilities</td>
+ * <td>Returns Speech Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * <tr>
+ * <td>VOICE_RECOGNITION</td>
+ * <td>VrCapabilities</td>
+ * <td>Returns VOICE_RECOGNITION</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * <tr>
+ * <td>APP_SERVICES</td>
+ * <td>AppServicesCapabilities</td>
+ * <td>Returns APP_SERVICES</td>
+ * <td align=center>N</td>
+ * <td>Available Asynchronously, Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * </table>
+ *
+ */
+
+public enum SystemCapabilityType {
+
+ /**
+ * <strong>Requires</strong> initial asynchronous call, then available synchronously after successful call. <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>NAVIGATION</td>
+ * <td>NavigationCapability</td>
+ * <td>Returns Navigation Capabilities</td>
+ * <td align=center>Y</td>
+ * <td>Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * </table>
+ */
+ NAVIGATION (true),
+
+ /**
+ * <strong>Requires</strong> initial asynchronous call, then available synchronously after successful call. <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>PHONE_CALL</td>
+ * <td>PhoneCapability</td>
+ * <td>Returns Phone Capabilities</td>
+ * <td align=center>Y</td>
+ * <td>Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * </table>
+ */
+ PHONE_CALL (true),
+
+ /**
+ * <strong>Requires</strong> initial asynchronous call, then available synchronously after successful call. <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>VIDEO_STREAMING</td>
+ * <td>VideoStreamingCapability</td>
+ * <td>Returns Video Streaming Capabilities</td>
+ * <td align=center>Y</td>
+ * <td>Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * </table>
+ */
+ VIDEO_STREAMING (true),
+
+ /**
+ * <strong>Requires</strong> initial asynchronous call, then available synchronously after successful call. <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <td>REMOTE_CONTROL</td>
+ * <td>RemoteControlCapabilities</td>
+ * <td>Returns Remote Control Capabilities</td>
+ * <td align=center>Y</td>
+ * <td>Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * </table>
+ *
+ */
+ REMOTE_CONTROL (true),
+
+ /* These below are not part of the RPC spec. Only for Internal Proxy use */
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>HMI</td>
+ * <td>HMICapabilities</td>
+ * <td>Returns HMI Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * </table>
+ */
+ HMI (false),
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * Returns: DisplayCapabilities
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>DISPLAY</td>
+ * <td>DisplayCapabilities</td>
+ * <td>Returns Display Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response received</td>
+ * </tr>
+ * </table>
+ */
+ DISPLAY (false),
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <b>Note:</b> @SuppressWarnings("unchecked") may be needed when casting depending on implementation
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>AUDIO_PASSTHROUGH</td>
+ * <td>List<AudioPassThruCapabilities></td>
+ * <td>Returns a List of AudioPassThruCapabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
+ * </tr>
+ * </table>
+ */
+ AUDIO_PASSTHROUGH (false),
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <b>Note:</b> @SuppressWarnings("unchecked") may be needed when casting depending on implementation
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>PCM_STREAMING</td>
+ * <td>AudioPassThruCapabilities</td>
+ * <td>Returns a AudioPassThruCapabilities Object</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
+ * </tr>
+ * </table>
+ */
+ PCM_STREAMING (false),
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <b>Note:</b> @SuppressWarnings("unchecked") may be needed when casting depending on implementation
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>BUTTON</td>
+ * <td>List<ButtonCapabilities></td>
+ * <td>Returns a List of ButtonCapabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
+ * </tr>
+ * </table>
+ */
+ BUTTON (false),
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>HMI_ZONE</td>
+ * <td>HmiZoneCapabilities</td>
+ * <td>Returns HmiZone Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * </table>
+ */
+ HMI_ZONE (false),
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>PRESET_BANK</td>
+ * <td>PresetBankCapabilities</td>
+ * <td>Returns PresetBank Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * </table>
+ */
+ PRESET_BANK (false),
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * Returns: List<SoftButtonCapabilities> <br>
+ * Note: @SuppressWarnings("unchecked") may be needed when casting depending on implementation
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>SOFTBUTTON</td>
+ * <td>List<SoftButtonCapabilities></td>
+ * <td>Returns a List of SoftButtonCapabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
+ * </tr>
+ * </table>
+ */
+ SOFTBUTTON (false),
+
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>SPEECH</td>
+ * <td>SpeechCapabilities</td>
+ * <td>Returns Speech Capabilities</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * </table>
+ */
+ SPEECH (false),
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>VOICE_RECOGNITION</td>
+ * <td>VrCapabilities</td>
+ * <td>Returns VOICE_RECOGNITION</td>
+ * <td align=center>N</td>
+ * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
+ * </tr>
+ * </table>
+ */
+ VOICE_RECOGNITION (false),
+ /**
+ * Available Synchronously after Register App Interface response <br>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Enum Name</th>
+ * <th>Return Type</th>
+ * <th>Description</th>
+ * <th>Requires Async?</th>
+ * <th>Notes</th>
+ * </tr>
+ * <tr>
+ * <td>APP_SERVICES</td>
+ * <td>AppServicesCapabilities</td>
+ * <td>Returns APP_SERVICES</td>
+ * <td align=center>N</td>
+ * <td>Available Asynchronously, Call is synchronous <strong>after</strong> initial call</td>
+ * </tr>
+ * </table>
+ */
+ APP_SERVICES (true),
+
+ ;
+
+ boolean IS_QUERYABLE;
+
+ SystemCapabilityType(boolean isQueryable) {
+ this.IS_QUERYABLE = isQueryable;
+ }
+
+ public boolean isQueryable() {
+ return IS_QUERYABLE;
+ }
+
+ public static SystemCapabilityType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemContext.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemContext.java
new file mode 100644
index 000000000..c78640a1e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemContext.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ * Indicates whether or not a user-initiated interaction is in progress, and if
+ * so, in what mode (i.e. MENU or VR).
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum SystemContext {
+ /**
+ * No user interaction (user-initiated or app-initiated) is in progress.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ SYSCTXT_MAIN("MAIN"),
+ /**
+ * VR-oriented, user-initiated or app-initiated interaction is in-progress.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ SYSCTXT_VRSESSION("VRSESSION"),
+ /**
+ * Menu-oriented, user-initiated or app-initiated interaction is
+ * in-progress.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ SYSCTXT_MENU("MENU"),
+ /**
+ * The app's display HMI is currently being obscured by either a system or
+ * other app's overlay.
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ SYSCTXT_HMI_OBSCURED("HMI_OBSCURED"),
+ /**
+ * Broadcast only to whichever app has an alert currently being displayed.
+ *
+ * @since SmartDeviceLink 2.0
+ */
+ SYSCTXT_ALERT("ALERT");
+
+ private final String INTERNAL_NAME;
+
+ private SystemContext(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ public static SystemContext valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (SystemContext anEnum : EnumSet.allOf(SystemContext.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TBTState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TBTState.java
new file mode 100644
index 000000000..80e113190
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TBTState.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Describes possible states of turn-by-turn module.
+ * @since SmartDeviceLink 1.0
+ */
+public enum TBTState {
+ /**
+ * Indicates that driver requested a route update.
+ */
+ ROUTE_UPDATE_REQUEST,
+ /**
+ * Confirmation from HMI about accepting the route.
+ */
+
+ ROUTE_ACCEPTED,
+ /**
+ * Information from HMI about the route refusal.
+ */
+
+ ROUTE_REFUSED,
+ /**
+ * Information from HMI about canceling the route.
+ */
+
+ ROUTE_CANCELLED,
+ /**
+ * Request from HMI for Estimated time of arrival.
+ */
+
+ ETA_REQUEST,
+ /**
+ * Request from HMI for the information of the next turn.
+ */
+
+ NEXT_TURN_REQUEST,
+ /**
+ * Request from HMI for the route status.
+ */
+
+ ROUTE_STATUS_REQUEST,
+ /**
+ * Request from HMI for the route summary.
+ */
+
+ ROUTE_SUMMARY_REQUEST,
+ /**
+ * Request from HMI for the information about trip status.
+ */
+
+ TRIP_STATUS_REQUEST,
+ /**
+ * Request from HMI for the timeout for waiting for the route updating.
+ */
+
+ ROUTE_UPDATE_REQUEST_TIMEOUT;
+
+ /**
+ * Convert String to TBTState
+ * @param value String
+ * @return TBTState
+ */
+ public static TBTState valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TPMS.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TPMS.java
new file mode 100644
index 000000000..a1c0fe30b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TPMS.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enums for Tire Pressure Monitoring Systems
+ *
+ * @since SmartDeviceLink 5.0
+ */
+public enum TPMS {
+
+ /**
+ * If set the status of the tire is not known.
+ */
+ UNKNOWN,
+ /**
+ * TPMS does not function.
+ */
+ SYSTEM_FAULT,
+ /**
+ * The sensor of the tire does not function.
+ */
+ SENSOR_FAULT,
+ /**
+ * TPMS is reporting a low tire pressure for the tire.
+ */
+ LOW,
+ /**
+ * TPMS is active and the tire pressure is monitored.
+ */
+ SYSTEM_ACTIVE,
+ /**
+ * TPMS is reporting that the tire must be trained.
+ */
+ TRAIN,
+ /**
+ * TPMS reports the training for the tire is completed.
+ */
+ TRAINING_COMPLETE,
+ /**
+ * TPMS reports the tire is not trained.
+ */
+ NOT_TRAINED,
+ ;
+
+ public static TPMS valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TemperatureUnit.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TemperatureUnit.java
new file mode 100644
index 000000000..5c732c957
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TemperatureUnit.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum TemperatureUnit {
+ CELSIUS,
+ FAHRENHEIT;
+
+ public static TemperatureUnit valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextAlignment.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextAlignment.java
new file mode 100644
index 000000000..366082c99
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextAlignment.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * The list of possible alignments of text in a field.
+ * @since SmartDeviceLink 1.0
+ */
+public enum TextAlignment {
+ /**
+ * Text aligned left.
+ */
+ LEFT_ALIGNED,
+ /**
+ * Text aligned right.
+ */
+ RIGHT_ALIGNED,
+ /**
+ * Text aligned centered.
+ */
+ CENTERED;
+
+ /**
+ * Convert String to TextAlignment
+ * @param value String
+ * @return TextAlignment
+ */
+ public static TextAlignment valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java
new file mode 100644
index 000000000..f7258b933
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** Names of the text fields that can appear on the display.
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ */
+
+public enum TextFieldName {
+ /** The first line of first set of main fields of the persistent display; applies to "Show"
+ *
+ */
+
+ mainField1,
+ /** The second line of first set of main fields of the persistent display; applies to "Show"
+ *
+ */
+
+ mainField2,
+ /** The first line of second set of main fields of persistent display; applies to "Show"
+ *
+ */
+
+ mainField3,
+ /** The second line of second set of main fields of the persistent display; applies to "Show"
+ *
+ */
+
+ mainField4,
+ /** The status bar on NGN; applies to "Show"
+ *
+ */
+
+ statusBar,
+ /** Text value for MediaClock field; applies to "Show"
+ *
+ */
+
+ mediaClock,
+ /** The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"
+ *
+ */
+
+ mediaTrack,
+ /** The first line of the alert text field; applies to "Alert"
+ *
+ */
+
+ alertText1,
+ /** The second line of the alert text field; applies to "Alert"
+ *
+ */
+
+ alertText2,
+ /** The third line of the alert text field; applies to "Alert"
+ *
+ */
+
+ alertText3,
+ /** Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"
+ *
+ */
+
+ scrollableMessageBody,
+ /** First line suggestion for a user response (in the case of VR enabled interaction)
+ *
+ */
+
+ initialInteractionText,
+ /** First line of navigation text
+ *
+ */
+
+ navigationText1,
+ /** Second line of navigation text
+ *
+ */
+
+ navigationText2,
+ /** Estimated Time of Arrival time for navigation
+ *
+ */
+
+ ETA,
+ /** Total distance to destination for navigation
+ *
+ */
+
+ totalDistance,
+ /** First line of text for audio pass thru
+ *
+ */
+
+ audioPassThruDisplayText1,
+ /** Second line of text for audio pass thru
+ *
+ */
+
+ audioPassThruDisplayText2,
+ /** Header text for slider
+ *
+ */
+
+ sliderHeader,
+ /** Footer text for slider
+ *
+ */
+
+ sliderFooter,
+ /** Primary text for Choice
+ *
+ */
+
+ menuName,
+ /** Secondary text for Choice
+ *
+ */
+
+ secondaryText,
+ /** Tertiary text for Choice
+ *
+ */
+
+ tertiaryText,
+ /** Optional text to label an app menu button (for certain touchscreen platforms).
+ *
+ */
+ menuTitle,
+ /**
+ * Optional name / title of intended location for SendLocation.
+ *
+ * @since SmartDeviceLink 4.0
+ */
+ locationName,
+ /**
+ * Optional description of intended location / establishment (if applicable) for SendLocation
+ *
+ * @since SmartDeviceLink 4.0
+ */
+ locationDescription,
+ /**
+ * Optional location address (if applicable) for SendLocation.
+ *
+ * @since SmartDeviceLink 4.0
+ */
+ addressLines,
+ /**
+ * Optional hone number of intended location / establishment (if applicable) for SendLocation.
+ *
+ * @since SmartDeviceLink 4.0
+ */
+ phoneNumber,
+ ;
+ /**
+ * Convert String to TextFieldName
+ * @param value String
+ * @return TextFieldName
+ */
+
+ public static TextFieldName valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TouchType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TouchType.java
new file mode 100644
index 000000000..f12c2965c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TouchType.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** The type of touch event.
+ *
+ * @since SmartDeviceLink 2.3.2
+ *
+ */
+
+public enum TouchType {
+ /** The user has touched the screen.
+ *
+ */
+
+ BEGIN,
+ /** The User has moved his finger over the screen.
+ *
+ */
+
+ MOVE,
+ /** The User has removed his finger from the screen.
+ *
+ */
+
+ END,
+ /** The user has made a cancellation gesture.
+ *
+ */
+ CANCEL;
+ /**
+ * Convert String to TouchType
+ * @param value String
+ * @return TouchType
+ */
+
+ public static TouchType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TriggerSource.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TriggerSource.java
new file mode 100644
index 000000000..4cab304f7
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TriggerSource.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ * Indicates whether choice/command was selected via VR or via a menu selection
+ * (using SEEKRIGHT/SEEKLEFT, TUNEUP, TUNEDOWN and OK buttons)
+ *
+ * @since SmartDeviceLink 1.0
+ *
+ */
+public enum TriggerSource {
+ /**
+ * Selection made via menu (i.e. using SEEKRIGHT/SEEKLEFT, TUNEUP, TUNEDOWN
+ * and OK buttons)
+ */
+ TS_MENU("MENU"),
+ /**
+ * Selection made via VR session
+ */
+ TS_VR("VR"),
+
+ TS_KEYBOARD("KEYBOARD");
+
+ private final String INTERNAL_NAME;
+
+ private TriggerSource(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ public static TriggerSource valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (TriggerSource anEnum : EnumSet.allOf(TriggerSource.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TurnSignal.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TurnSignal.java
new file mode 100644
index 000000000..fb490f7f0
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TurnSignal.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enumeration that describes the status of the turn light indicator.
+ *
+ * @since SmartDeviceLink 5.0
+ */
+public enum TurnSignal {
+
+ /**
+ * Turn signal is OFF
+ */
+ OFF,
+ /**
+ * Left turn signal is on
+ */
+ LEFT,
+ /**
+ * Right turn signal is on
+ */
+ RIGHT,
+ /**
+ * Both signals (left and right) are on.
+ */
+ BOTH,
+ ;
+
+ public static TurnSignal valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/UpdateMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/UpdateMode.java
new file mode 100644
index 000000000..d43940153
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/UpdateMode.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Specifies what function should be performed on the media clock/counter
+ *
+ *
+ * @since SmartDeviceLink 1.0
+ */
+public enum UpdateMode {
+ /**
+ * Starts the media clock timer counting upward, in increments of 1 second
+ */
+ COUNTUP,
+ /**
+ * Starts the media clock timer counting downward, in increments of 1 second
+ */
+ COUNTDOWN,
+ /**
+ * Pauses the media clock timer
+ */
+ PAUSE,
+ /**
+ * Resumes the media clock timer. The timer resumes counting in whatever
+ * mode was in effect before pausing (i.e. COUNTUP or COUNTDOWN)
+ */
+ RESUME,
+ CLEAR;
+
+
+ /**
+ * Returns an UpdateMode value (COUNTUP, COUNTDOWN, PAUSE or RESUME)
+ * @param value a String
+ * @return UpdateMode -COUNTUP, COUNTDOWN, PAUSE or RESUME
+ */
+ public static UpdateMode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataEventStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataEventStatus.java
new file mode 100644
index 000000000..529c79431
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataEventStatus.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Reflects the status of a vehicle data event; e.g. a seat belt event status.
+ * @since SmartDeviceLink 2.0
+ */
+public enum VehicleDataEventStatus {
+ /**
+ * No event available
+ */
+ NO_EVENT,
+ NO,
+ YES,
+ /**
+ * Vehicle data event is not support
+ */
+ NOT_SUPPORTED,
+ FAULT;
+
+ /**
+ * Convert String to VehicleDataEventStatus
+ * @param value String
+ * @return VehicleDataEventStatus
+ */
+ public static VehicleDataEventStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataNotificationStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataNotificationStatus.java
new file mode 100644
index 000000000..ec0aa048a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataNotificationStatus.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Reflects the status of a vehicle data notification.
+ * @since SmartDeviceLink 2.0
+ *
+ */
+public enum VehicleDataNotificationStatus {
+ /**
+ * VehicleDataNotificationStatus is not supported.
+ */
+ NOT_SUPPORTED,
+ /**
+ * VehicleDataNotificationStatus is normal.
+ */
+ NORMAL,
+ /**
+ * VehicleDataNotificationStatus is active.
+ */
+ ACTIVE,
+ /**
+ * VehicleDataNotificationStatus is not in use.
+ */
+ NOT_USED;
+
+ /**
+ * Convert String to VehicleDataNotificationStatus
+ * @param value String
+ * @return VehicleDataNotificationStatus
+ */
+ public static VehicleDataNotificationStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java
new file mode 100644
index 000000000..7f12b8623
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** Enumeration that describes possible result codes of a vehicle data entry request.
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ *@see com.smartdevicelink.proxy.rpc.DIDResult
+ *@see com.smartdevicelink.proxy.rpc.ReadDID
+ */
+
+public enum VehicleDataResultCode {
+ /**Individual vehicle data item / DTC / DID request or subscription successful
+ *
+ */
+
+ SUCCESS,
+ /**
+ *DTC / DID request successful, however, not all active DTCs or full contents of DID location available
+ *
+ * @since SmartDeviceLink 4.0
+ */
+
+ TRUNCATED_DATA,
+ /** This vehicle data item is not allowed for this app .The request is not authorized in local policies.
+ *
+ */
+
+ DISALLOWED,
+ /** The user has not granted access to this type of vehicle data item at this time.
+ *
+ */
+
+ USER_DISALLOWED,
+ /** The ECU ID referenced is not a valid ID on the bus / system.
+ *
+ */
+
+ INVALID_ID,
+ /** The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system.
+ *
+ */
+
+ VEHICLE_DATA_NOT_AVAILABLE,
+ /** The vehicle data item is already subscribed.
+ *
+ */
+
+ DATA_ALREADY_SUBSCRIBED,
+ /** The vehicle data item cannot be unsubscribed because it is not currently subscribed.
+ *
+ */
+
+ DATA_NOT_SUBSCRIBED,
+ /** The request for this item is ignored because it is already in progress
+ */
+
+ IGNORED;
+
+ public static VehicleDataResultCode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataStatus.java
new file mode 100644
index 000000000..1319791b2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataStatus.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Reflects the status of a binary vehicle data item.
+ * @since SmartDeviceLink 2.0
+ *
+ */
+public enum VehicleDataStatus {
+ /**
+ * No data available
+ */
+ NO_DATA_EXISTS,
+ /**
+ * The vehicle item is in Off state
+ */
+
+ OFF,
+ /**
+ * The vehicle item is in On state
+ */
+
+ ON;
+
+ /**
+ * Convert String to VehicleDataStatus
+ * @param value String
+ * @return VehicleDataStatus
+ */
+ public static VehicleDataStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java
new file mode 100644
index 000000000..3ec32481a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Defines the vehicle data types that can be published and subscribed to.
+ *
+ */
+public enum VehicleDataType {
+ /**
+ * Notifies GPSData may be subscribed
+ */
+ VEHICLEDATA_GPS,
+ /**
+ * Notifies SPEED Data may be subscribed
+ */
+ VEHICLEDATA_SPEED,
+ /**
+ * Notifies RPMData may be subscribed
+ */
+ VEHICLEDATA_RPM,
+ /**
+ * Notifies FUELLEVELData may be subscribed
+ */
+ VEHICLEDATA_FUELLEVEL,
+ /**
+ * Notifies FUELLEVEL_STATEData may be subscribed
+ */
+ VEHICLEDATA_FUELLEVEL_STATE,
+/**
+ * Notifies FUELCONSUMPTIONData may be subscribed
+ */
+ VEHICLEDATA_FUELCONSUMPTION,
+ /**
+ * Notifies EXTERNTEMPData may be subscribed
+ */
+ VEHICLEDATA_EXTERNTEMP,
+ /**
+ * Notifies VINData may be subscribed
+ */
+ VEHICLEDATA_VIN,
+ /**
+ * Notifies PRNDLData may be subscribed
+ */
+ VEHICLEDATA_PRNDL,
+ /**
+ * Notifies TIREPRESSUREData may be subscribed
+ */
+ VEHICLEDATA_TIREPRESSURE,
+ /**
+ * Notifies ODOMETERData may be subscribed
+ */
+ VEHICLEDATA_ODOMETER,
+ /**
+ * Notifies BELTSTATUSData may be subscribed
+ */
+ VEHICLEDATA_BELTSTATUS,
+ /**
+ * Notifies BODYINFOData may be subscribed
+ */
+ VEHICLEDATA_BODYINFO,
+ /**
+ * Notifies DEVICESTATUSData may be subscribed
+ */
+ VEHICLEDATA_DEVICESTATUS,
+ /**
+ * Notifies BRAKINGData may be subscribed
+ */
+ VEHICLEDATA_BRAKING,
+ /**
+ * Notifies WIPERSTATUSData may be subscribed
+ */
+ VEHICLEDATA_WIPERSTATUS,
+ /**
+ * Notifies HEADLAMPSTATUSData may be subscribed
+ */
+ VEHICLEDATA_HEADLAMPSTATUS,
+ /**
+ * Notifies BATTVOLTAGEData may be subscribed
+ */
+ VEHICLEDATA_BATTVOLTAGE,
+ /**
+ * Notifies EGINETORQUEData may be subscribed
+ */
+ VEHICLEDATA_ENGINETORQUE,
+ /**
+ * Notifies ENGINEOILLIFEData may be subscribed
+ */
+ VEHICLEDATA_ENGINEOILLIFE,
+ /**
+ * Notifies ACCPEDALData may be subscribed
+ */
+ VEHICLEDATA_ACCPEDAL,
+ /**
+ * Notifies STEERINGWHEELData may be subscribed
+ */
+ VEHICLEDATA_STEERINGWHEEL,
+ /**
+ * Notifies ECALLINFOData may be subscribed
+ */
+ VEHICLEDATA_ECALLINFO,
+ /**
+ * Notifies AIRBAGSTATUSData may be subscribed
+ */
+ VEHICLEDATA_AIRBAGSTATUS,
+ /**
+ * Notifies EMERGENCYEVENTData may be subscribed
+ */
+ VEHICLEDATA_EMERGENCYEVENT,
+ /**
+ * Notifies CLUSTERMODESTATUSData may be subscribed
+ */
+ VEHICLEDATA_CLUSTERMODESTATUS,
+ /**
+ * Notifies MYKEYData may be subscribed
+ */
+ VEHICLEDATA_MYKEY,
+
+ VEHICLEDATA_FUELRANGE,
+
+ /**
+ * Notifies TURNSIGNALData may be subscribed
+ */
+ VEHICLEDATA_TURNSIGNAL,
+
+ /**
+ * Notifies ELECTRONICPARKBRAKESTATUSData may be subscribed
+ */
+ VEHICLEDATA_ELECTRONICPARKBRAKESTATUS,
+
+ /**
+ * Notifies VEHICLEDATA_CLOUDAPPVEHICLEID may be subscribed
+ */
+ VEHICLEDATA_CLOUDAPPVEHICLEID,
+ ;
+
+ /**
+ * Convert String to VehicleDataType
+ * @param value String
+ * @return VehicleDataType
+ */
+
+ public static VehicleDataType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VentilationMode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VentilationMode.java
new file mode 100644
index 000000000..a66c6d34e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VentilationMode.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum VentilationMode {
+ UPPER,
+ LOWER,
+ BOTH,
+ NONE,
+ ;
+
+ public static VentilationMode valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingCodec.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingCodec.java
new file mode 100644
index 000000000..f390df075
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingCodec.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enum for each type of video streaming codec.
+ */
+
+public enum VideoStreamingCodec {
+ /**
+ * A block-oriented motion-compensation-based video compression standard. As of 2014 it is one
+ * of the most commonly used formats for the recording, compression, and distribution of video
+ * content.
+ */
+ H264,
+ /**
+ * High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video
+ * compression standard, one of several potential successors to the widely used AVC
+ * (H.264 or MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data
+ * compression ratio at the same level of video quality, or substantially improved video quality
+ * at the same bit rate. It supports resolutions up to 8192x4320, including 8K UHD.
+ */
+ H265,
+ /**
+ * Theora is derived from the formerly proprietary VP3 codec, released into the public domain by
+ * On2 Technologies. It is broadly comparable in design and bitrate efficiency to MPEG-4 Part 2,
+ * early versions of Windows Media Video, and RealVideo while lacking some of the features
+ * present in some of these other codecs. It is comparable in open standards philosophy to the
+ * BBC's Dirac codec.
+ */
+ Theora,
+ /**
+ * VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and
+ * Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct
+ * successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance
+ * for Open Media (AOMedia) are based on VP8.
+ */
+ VP8,
+ /**
+ * Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video
+ * (UHD) and also enables lossless compression.
+ */
+ VP9;
+
+ public static VideoStreamingCodec valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingProtocol.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingProtocol.java
new file mode 100644
index 000000000..bd7e426c5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingProtocol.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enum for each type of video streaming protocol type.
+ */
+
+public enum VideoStreamingProtocol {
+ /**
+ * Raw stream bytes that contains no timestamp data and is the lowest supported video streaming
+ */
+ RAW,
+ /**
+ * RTP facilitates the transfer of real-time data. Information provided by this protocol include
+ * timestamps (for synchronization), sequence numbers (for packet loss and reordering detection)
+ * and the payload format which indicates the encoded format of the data.
+ */
+ RTP,
+ /**
+ * The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the
+ * Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for
+ * media stream delivery. However, some vendors implement proprietary transport protocols.
+ */
+ RTSP,
+ /**
+ * Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by
+ * Macromedia for streaming audio, video and data over the Internet, between a Flash player and
+ * a server. Macromedia is now owned by Adobe, which has released an incomplete version of the
+ * specification of the protocol for public use.
+ */
+ RTMP,
+ /**
+ * The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and
+ * Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.
+ */
+ WEBM;
+
+ public static VideoStreamingProtocol valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingState.java
new file mode 100644
index 000000000..6952919c8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingState.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enumeration that describes possible states of video streaming.
+ * @since SmartDeviceLink 5.0
+ */
+public enum VideoStreamingState {
+ /**
+ * @since SmartDeviceLink 5.0
+ */
+ STREAMABLE,
+ /**
+ * @since SmartDeviceLink 5.0
+ */
+ NOT_STREAMABLE;
+ public static VideoStreamingState valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VrCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VrCapabilities.java
new file mode 100644
index 000000000..69fc0c8de
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VrCapabilities.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * The VR capabilities of the connected SDL platform.
+ *
+ */
+public enum VrCapabilities {
+ /**
+ * The SDL platform is capable of recognizing spoken text in the current
+ * language.
+ *
+ * @since SmartDeviceLink 1.0
+ */
+ @Deprecated
+ Text,
+
+ /**
+ * The SDL platform is capable of recognizing spoken text in the current
+ * language.
+ *
+ * @since SmartDeviceLink 3.0
+ */
+ TEXT,
+ ;
+
+ public static VrCapabilities valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ if (value.equalsIgnoreCase(TEXT.toString()))
+ {
+ return TEXT;
+ }
+
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java
new file mode 100644
index 000000000..1c5296510
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Reflects the status of a cluster instrument warning light.
+ * @since SmartDeviceLink 2.0
+ */
+public enum WarningLightStatus {
+ /**
+ * Warninglight Off
+ */
+ OFF,
+ /**
+ * Warninglight On
+ */
+ ON,
+ /**
+ * Warninglight is flashing
+ */
+ FLASH,
+ NOT_USED;
+
+ /**
+ * Convert String to WarningLightStatus
+ * @param value String
+ * @return WarningLightStatus
+ */
+ public static WarningLightStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WayPointType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WayPointType.java
new file mode 100644
index 000000000..03f8e06f2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WayPointType.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum WayPointType {
+ ALL,
+ DESTINATION,
+ ;
+
+ public static WayPointType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WiperStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WiperStatus.java
new file mode 100644
index 000000000..b03ceeae2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WiperStatus.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.enums;
+/** This enumeration reflects the status of the wipers.
+ *
+ * @since SmartDeviceLink 2.0
+ *
+ * @see com.smartdevicelink.proxy.rpc.GetVehicleData
+ * @see com.smartdevicelink.proxy.rpc.OnVehicleData
+ */
+
+public enum WiperStatus {
+ /** The wipers are off.
+ *
+ */
+
+ OFF,
+ /** The wipers are automatically off after detecting the wipers do not need to be engaged (rain stopped, etc.).
+ *
+ */
+
+ AUTO_OFF,
+ /** Means that though set to off, somehow the wipers have been engaged (physically moved enough to engage a wiping motion).
+ *
+ */
+
+ OFF_MOVING,
+ /** The wipers are manually off after having been working.
+ *
+ */
+
+ MAN_INT_OFF,
+ /** The wipers are manually on.
+ *
+ */
+
+ MAN_INT_ON,
+ /** The wipers are manually set to low speed.
+ *
+ */
+
+ MAN_LOW,
+ /** The wipers are manually set to high speed.
+ *
+ */
+
+ MAN_HIGH,
+ /** The wipers are manually set for doing a flick.
+ *
+ */
+
+ MAN_FLICK,
+ /** The wipers are set to use the water from vehicle washer bottle for cleaning the windscreen.
+ *
+ */
+
+ WASH,
+ /** The wipers are automatically set to low speed.
+ *
+ */
+
+ AUTO_LOW,
+ /** The wipers are automatically set to high speed.
+ *
+ */
+
+ AUTO_HIGH,
+ /** This is for when a user has just initiated a WASH and several seconds later a secondary wipe is automatically initiated to clear remaining fluid
+ */
+
+ COURTESYWIPE,
+ /** This is set as the user moves between possible automatic wiper speeds.
+ *
+ */
+
+ AUTO_ADJUST,
+ /** The wiper is stalled to its place. There may be an obstruction.
+ *
+ */
+
+ STALLED,
+ /** The sensor / module cannot provide any information for wiper.
+ *
+ */
+
+ NO_DATA_EXISTS;
+ /**
+ * Convert String to WiperStatus
+ * @param value String
+ * @return WiperStatus
+ */
+
+ public static WiperStatus valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java
new file mode 100644
index 000000000..c1e7f7645
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.listeners;
+
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+import java.util.Vector;
+
+/**
+ * This is the listener for sending Multiple RPCs.
+ */
+public abstract class OnMultipleRequestListener extends OnRPCResponseListener {
+
+ final Vector<Integer> correlationIds;
+ OnRPCResponseListener rpcResponseListener;
+ private static String TAG = "OnMultipleRequestListener";
+
+ public OnMultipleRequestListener(){
+ setListenerType(UPDATE_LISTENER_TYPE_MULTIPLE_REQUESTS);
+ correlationIds = new Vector<>();
+
+ rpcResponseListener = new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ OnMultipleRequestListener.this.onResponse(correlationId, response);
+ update(correlationId);
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ super.onError(correlationId, resultCode, info);
+ OnMultipleRequestListener.this.onError(correlationId, resultCode, info);
+ update(correlationId);
+ }
+
+ private synchronized void update(int correlationId){
+ correlationIds.remove(Integer.valueOf(correlationId));
+ if(correlationIds.size()>0){
+ onUpdate(correlationIds.size());
+ }else{
+ onFinished();
+ }
+ }
+ };
+ }
+
+ public void addCorrelationId(int correlationid){
+ correlationIds.add(correlationid);
+ }
+ /**
+ * onUpdate is called during multiple stream request
+ * @param remainingRequests of the original request
+ */
+ public abstract void onUpdate(int remainingRequests);
+ public abstract void onFinished();
+ public abstract void onError(int correlationId, Result resultCode, String info);
+
+ public OnRPCResponseListener getSingleRpcResponseListener(){
+ return rpcResponseListener;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java
new file mode 100644
index 000000000..76f3891aa
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.listeners;
+
+import com.smartdevicelink.proxy.RPCResponse;
+
+public abstract class OnPutFileUpdateListener extends OnRPCResponseListener{
+
+ long totalSize = 0;
+
+ public OnPutFileUpdateListener(){
+ setListenerType(UPDATE_LISTENER_TYPE_PUT_FILE);
+ }
+
+ @Override
+ public final void onStart(int correlationId) {
+ super.onStart(correlationId);
+ onStart(correlationId, totalSize); //We do this so we can send back the total size
+ }
+
+ public void onStart(int correlationId, long totalSize){
+
+ }
+
+ @Override
+ public final void onResponse(int correlationId, RPCResponse response) {
+ onResponse(correlationId, response, totalSize); //Calling our special abstract method
+ }
+ /**
+ * Called when the putfile request is responded to.
+ * @param correlationId correlation ID tied to the original response
+ * @param response the PutFile response RPC
+ * @param totalSize total size of the file sent
+ */
+ public abstract void onResponse(int correlationId, RPCResponse response, long totalSize);
+
+ /**
+ * onUpdate is called during a putfile stream request
+ * @param correlationId of the original request
+ * @param bytesWritten the amount of bytes that have been written so far
+ * @param totalSize total size of the file that is being sent
+ */
+ public void onUpdate(int correlationId, long bytesWritten, long totalSize){
+
+ };
+
+ public final void setTotalSize(long totalSize){
+ this.totalSize = totalSize;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java
new file mode 100644
index 000000000..85a32c02e
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCNotificationListener.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCNotificationListener.java
new file mode 100644
index 000000000..33ddf9b83
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCNotificationListener.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.listeners;
+
+import com.smartdevicelink.proxy.RPCNotification;
+
+public abstract class OnRPCNotificationListener {
+
+ public abstract void onNotified(RPCNotification notification);
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCRequestListener.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCRequestListener.java
new file mode 100644
index 000000000..c4df348d9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCRequestListener.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.proxy.rpc.listeners;
+
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCRequest;
+
+public abstract class OnRPCRequestListener extends OnRPCListener {
+
+ public final void onReceived(final RPCMessage message){
+ if (message instanceof RPCRequest){
+ onRequest((RPCRequest)message);
+ }
+ }
+
+ /**
+ * @param request - The incoming RPC Request
+ */
+ public abstract void onRequest(final RPCRequest request);
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java
new file mode 100644
index 000000000..01980eb28
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+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/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java b/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java
new file mode 100644
index 000000000..3f1c54a6a
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.security;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.enums.SessionType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+abstract class AbstractSdlSecurityBase {
+
+ protected SdlSession session = null;
+ protected String appId = null;
+ protected List<String> makeList = null;
+ protected boolean isInitSuccess = false;
+ protected byte sessionId = 0;
+ protected List<SessionType> startServiceList = new ArrayList<SessionType>();
+
+ public AbstractSdlSecurityBase() {
+ }
+
+ public abstract void initialize();
+
+ public abstract Integer runHandshake(byte[] inputData,byte[] outputData);
+
+ public abstract Integer encryptData(byte[] inputData,byte[] outputData);
+
+ public abstract Integer decryptData(byte[] inputData,byte[] outputData);
+
+ public abstract void shutDown();
+
+ public void resetParams() {
+ session = null;
+ appId = null;
+ isInitSuccess = false;
+ startServiceList.clear();
+ }
+
+ public List<SessionType> getServiceList() {
+ return startServiceList;
+ }
+
+ public void handleInitResult(boolean val) {
+ if (session == null) return;
+
+ setInitSuccess(val);
+ session.onSecurityInitialized();
+ }
+
+ public void handleSdlSession(SdlSession val) {
+ if (val == null) return;
+
+ setSessionId(val.getSessionId());
+ setSdlSession(val);
+ }
+
+ private void setInitSuccess(boolean val) {
+ isInitSuccess = val;
+ }
+
+ public boolean getInitSuccess() {
+ return isInitSuccess;
+ }
+
+ private void setSessionId(byte val) {
+ sessionId = val;
+ }
+
+ public byte getSessionId() {
+ return sessionId;
+ }
+
+ private void setSdlSession(SdlSession val) {
+ session = val;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String val) {
+ appId = val;
+ }
+
+ public List<String> getMakeList() {
+ return makeList;
+ }
+
+ public void setMakeList(List<String> val) {
+ makeList = val;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java b/base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java
new file mode 100644
index 000000000..6ad0c2a54
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.security;
+
+public interface ISecurityInitializedListener {
+ public void onSecurityInitialized();
+}
diff --git a/base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java b/base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
new file mode 100644
index 000000000..0cfdb4c76
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.streaming;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.util.Version;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+abstract public class AbstractPacketizer {
+
+ protected IStreamListener _streamListener = null;
+ protected byte _rpcSessionID = 0;
+
+ protected SessionType _serviceType = null;
+ protected SdlSession _session = null;
+ protected InputStream is = null;
+ protected int bufferSize;
+ protected byte[] buffer;
+ protected boolean upts = false;
+ protected RPCRequest _request = null;
+ protected Version _wiproVersion = new Version("1.0.0");
+
+ //protected long ts = 0, intervalBetweenReports = 5000, delta = 0;
+ protected long intervalBetweenReports = 5000, delta = 0;
+
+ public AbstractPacketizer(IStreamListener streamListener, InputStream is, SessionType sType, byte rpcSessionID, SdlSession session) throws IOException, IllegalArgumentException {
+ this._streamListener = streamListener;
+ this.is = is;
+ _rpcSessionID = rpcSessionID;
+ _serviceType = sType;
+ this._session = session;
+ if (this._session != null) {
+ bufferSize = this._session.getMtu();
+ buffer = new byte[bufferSize];
+ }else{
+ throw new IllegalArgumentException("Session variable is null");
+ }
+ }
+
+ @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 = 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();
+ buffer = new byte[bufferSize];
+ }else{
+ throw new IllegalArgumentException("Session variable is null");
+ }
+ }
+
+ public abstract void start() throws IOException;
+
+ public abstract void stop();
+
+ public abstract void pause();
+
+ public abstract void resume();
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java b/base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
new file mode 100644
index 000000000..e759268ec
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.streaming;
+
+import com.smartdevicelink.protocol.ProtocolMessage;
+
+public interface IStreamListener {
+ void sendStreamPacket(ProtocolMessage pm);
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java b/base/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
new file mode 100644
index 000000000..3f7c528f4
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.streaming;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.util.DebugTool;
+
+public class StreamPacketizer extends AbstractPacketizer implements IVideoStreamListener, IAudioStreamListener, Runnable{
+
+ public final static String TAG = "StreamPacketizer";
+
+ private Thread t = null;
+
+
+ private final static int TLS_MAX_RECORD_SIZE = 16384;
+ private final static int TLS_RECORD_HEADER_SIZE = 5;
+ private final static int TLS_RECORD_MES_AUTH_CDE_SIZE = 32;
+ private final static int TLS_MAX_RECORD_PADDING_SIZE = 256;
+
+
+ private final static int BUFF_READ_SIZE = TLS_MAX_RECORD_SIZE - TLS_RECORD_HEADER_SIZE - TLS_RECORD_MES_AUTH_CDE_SIZE - TLS_MAX_RECORD_PADDING_SIZE;
+
+ // Approximate size of data that mOutputQueue can hold in bytes.
+ // By adding a buffer, we accept underlying transport being stuck for a short time. By setting
+ // a limit of the buffer size, we avoid buffer overflows when underlying transport is too slow.
+ private static final int MAX_QUEUE_SIZE = 256 * 1024;
+
+ private Object mPauseLock;
+ private boolean mPaused;
+ private boolean isServiceProtected = false;
+ private BlockingQueue<ByteBuffer> mOutputQueue;
+
+ public StreamPacketizer(IStreamListener streamListener, InputStream is, SessionType sType, byte rpcSessionID, SdlSession session) throws IOException {
+ super(streamListener, is, sType, rpcSessionID, session);
+ mPauseLock = new Object();
+ mPaused = false;
+ isServiceProtected = _session.isServiceProtected(_serviceType);
+ if (bufferSize == 0) {
+ // fail safe
+ bufferSize = BUFF_READ_SIZE;
+ }
+ if(isServiceProtected){ //If our service is encrypted we can only use 1024 as the max buffer size.
+ bufferSize = BUFF_READ_SIZE;
+ buffer = new byte[bufferSize];
+ }
+ mOutputQueue = new LinkedBlockingQueue<ByteBuffer>(MAX_QUEUE_SIZE / bufferSize);
+ }
+
+ public void start() throws IOException {
+ if (t == null) {
+ t = new Thread(this);
+ t.start();
+ }
+ }
+
+ public void stop() {
+
+ if (t != null)
+ {
+ t.interrupt();
+ t = null;
+ }
+
+ }
+
+ public void run() {
+ int length;
+ try
+ {
+ while (t != null && !t.isInterrupted())
+ {
+ synchronized(mPauseLock)
+ {
+ while (mPaused)
+ {
+ try
+ {
+ mPauseLock.wait();
+ }
+ catch (InterruptedException e) {
+ DebugTool.logError("Streaming thread has been interrupted", e);
+ }
+ }
+ }
+
+ if (is != null) { // using InputStream interface
+ length = is.read(buffer, 0, bufferSize);
+
+ if (length >= 0) {
+ ProtocolMessage pm = new ProtocolMessage();
+ pm.setSessionID(_rpcSessionID);
+ pm.setSessionType(_serviceType);
+ pm.setFunctionID(0);
+ pm.setCorrID(0);
+ pm.setData(buffer, length);
+ pm.setPayloadProtected(isServiceProtected);
+
+ if (t != null && !t.isInterrupted()) {
+ _streamListener.sendStreamPacket(pm);
+ }
+ }
+ } else { // using sendFrame interface
+ ByteBuffer frame;
+ try {
+ frame = mOutputQueue.take();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ break;
+ }
+
+ while (frame.hasRemaining()) {
+ int len = frame.remaining() > bufferSize ? bufferSize : frame.remaining();
+
+ ProtocolMessage pm = new ProtocolMessage();
+ pm.setSessionID(_rpcSessionID);
+ pm.setSessionType(_serviceType);
+ pm.setFunctionID(0);
+ pm.setCorrID(0);
+ pm.setData(frame.array(), frame.arrayOffset() + frame.position(), len);
+ pm.setPayloadProtected(isServiceProtected);
+
+ if (t != null && !t.isInterrupted()) {
+ _streamListener.sendStreamPacket(pm);
+ }
+
+ frame.position(frame.position() + len);
+ }
+ }
+ }
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ if(_session != null) {
+ _session.endService(_serviceType,_rpcSessionID);
+ }
+
+
+ }
+ }
+
+ @Override
+ public void pause() {
+ synchronized (mPauseLock) {
+ mPaused = true;
+ }
+ }
+
+ @Override
+ public void resume() {
+ synchronized (mPauseLock) {
+ mPaused = false;
+ mPauseLock.notifyAll();
+ }
+ }
+
+ /**
+ * Called by the app.
+ *
+ * @see IVideoStreamListener#sendFrame(byte[], int, int, long)
+ */
+ @Override
+ public void sendFrame(byte[] data, int offset, int length, long presentationTimeUs)
+ throws ArrayIndexOutOfBoundsException {
+ sendArrayData(data, offset, length);
+ }
+
+ /**
+ * Called by the app.
+ *
+ * @see IVideoStreamListener#sendFrame(ByteBuffer, long)
+ */
+ @Override
+ public void sendFrame(ByteBuffer data, long presentationTimeUs) {
+ sendByteBufferData(data);
+ }
+
+ /**
+ * Called by the app.
+ *
+ * @see IAudioStreamListener#sendAudio(byte[], int, int, long)
+ */
+ @Override
+ public void sendAudio(byte[] data, int offset, int length, long presentationTimeUs)
+ throws ArrayIndexOutOfBoundsException {
+ sendArrayData(data, offset, length);
+ }
+
+ /**
+ * Called by the app.
+ *
+ * @see IAudioStreamListener#sendAudio(ByteBuffer, long)
+ */
+ @Override
+ public void sendAudio(ByteBuffer data, long presentationTimeUs) {
+ sendByteBufferData(data);
+ }
+
+ private void sendArrayData(byte[] data, int offset, int length)
+ throws ArrayIndexOutOfBoundsException {
+ if (offset < 0 || offset > data.length || length <= 0 || offset + length > data.length) {
+ throw new ArrayIndexOutOfBoundsException();
+ }
+
+ // StreamPacketizer does not need to split a video frame into NAL units
+ ByteBuffer buffer = ByteBuffer.allocate(length);
+ buffer.put(data, offset, length);
+ buffer.flip();
+
+ try {
+ mOutputQueue.put(buffer);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ private void sendByteBufferData(ByteBuffer data) {
+ if (data == null || data.remaining() == 0) {
+ return;
+ }
+
+ // copy the whole buffer, so that even if the app modifies original ByteBuffer after
+ // sendFrame() or sendAudio() call, our buffer will stay intact
+ ByteBuffer buffer = ByteBuffer.allocate(data.remaining());
+ buffer.put(data);
+ buffer.flip();
+
+ try {
+ mOutputQueue.put(buffer);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingCodec.java b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingCodec.java
index bf69a792b..bf69a792b 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingCodec.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingCodec.java
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java
index bde6abc4c..bde6abc4c 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java
index fe0f7a981..fe0f7a981 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java
diff --git a/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java b/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
new file mode 100644
index 000000000..2da7b5133
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
@@ -0,0 +1,503 @@
+/*
+ * Copyright (c) 2017, Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.streaming.video;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.streaming.AbstractPacketizer;
+import com.smartdevicelink.streaming.IStreamListener;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.Random;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+/*
+ * Note for testing.
+ * The RTP stream generated by this packetizer can be tested with GStreamer (1.4 or later).
+ * Assuming that "VideoStreamPort" is configured as 5050 in smartDeviceLink.ini, here is the
+ * GStreamer pipeline that receives the stream, decode it and render it:
+ *
+ * $ gst-launch-1.0 souphttpsrc location=http://127.0.0.1:5050 ! "application/x-rtp-stream" ! rtpstreamdepay ! "application/x-rtp,media=(string)video,clock-rate=90000,encoding-name=(string)H264" ! rtph264depay ! "video/x-h264, stream-format=(string)avc, alignment=(string)au" ! avdec_h264 ! autovideosink sync=false
+ */
+
+/**
+ * This class receives H.264 byte stream (in Annex-B format), parses it, construct RTP packets
+ * from it based on RFC 6184, then frame the packets based on RFC 4571.
+ * The primary purpose of using RTP is to carry timestamp information along with the data.
+ *
+ * @author Sho Amano
+ */
+public class RTPH264Packetizer extends AbstractPacketizer implements IVideoStreamListener, Runnable {
+
+ // Approximate size of data that mOutputQueue can hold in bytes.
+ // By adding a buffer, we accept underlying transport being stuck for a short time. By setting
+ // a limit of the buffer size, we avoid buffer overflows when underlying transport is too slow.
+ private static final int MAX_QUEUE_SIZE = 256 * 1024;
+
+ private static final int FRAME_LENGTH_LEN = 2;
+ private static final int MAX_RTP_PACKET_SIZE = 65535; // because length field is two bytes (RFC 4571)
+ private static final int RTP_HEADER_LEN = 12;
+ private static final byte DEFAULT_RTP_PAYLOAD_TYPE = 96;
+ private static final int FU_INDICATOR_LEN = 1;
+ private static final int FU_HEADER_LEN = 1;
+ private static final byte TYPE_FU_A = 28;
+
+ // To align with StreamPacketizer class
+ private final static int TLS_MAX_RECORD_SIZE = 16384;
+ private final static int TLS_RECORD_HEADER_SIZE = 5;
+ private final static int TLS_RECORD_MES_AUTH_CDE_SIZE = 32;
+ private final static int TLS_MAX_RECORD_PADDING_SIZE = 256;
+
+ private final static int MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE =
+ TLS_MAX_RECORD_SIZE - TLS_RECORD_HEADER_SIZE - TLS_RECORD_MES_AUTH_CDE_SIZE- TLS_MAX_RECORD_PADDING_SIZE;
+
+ private boolean mServiceProtected;
+ private Thread mThread;
+ private BlockingQueue<ByteBuffer> mOutputQueue;
+ private volatile boolean mPaused;
+ private boolean mWaitForIDR;
+ private NALUnitReader mNALUnitReader;
+ private byte mPayloadType = 0;
+ private int mSSRC = 0;
+ private char mSequenceNum = 0;
+ private int mInitialPTS = 0;
+
+ /**
+ * Constructor
+ *
+ * @param streamListener The listener which this packetizer outputs SDL frames to
+ * @param serviceType The value of "Service Type" field in SDL frames
+ * @param sessionID The value of "Session ID" field in SDL frames
+ * @param session The SdlSession instance that this packetizer belongs to
+ */
+ public RTPH264Packetizer(IStreamListener streamListener,
+ SessionType serviceType, byte sessionID, SdlSession session) throws IOException {
+
+ super(streamListener, null, serviceType, sessionID, session);
+
+ mServiceProtected = session.isServiceProtected(_serviceType);
+
+ bufferSize = (int)this._session.getMtu(SessionType.NAV);
+ if (bufferSize == 0) {
+ // fail safe
+ bufferSize = MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE;
+ }
+ if (mServiceProtected && bufferSize > MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE) {
+ bufferSize = MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE;
+ }
+
+ mOutputQueue = new LinkedBlockingQueue<ByteBuffer>(MAX_QUEUE_SIZE / bufferSize);
+ mNALUnitReader = new NALUnitReader();
+ mPayloadType = DEFAULT_RTP_PAYLOAD_TYPE;
+
+ Random r = new Random();
+ mSSRC = r.nextInt();
+
+ // initial value of the sequence number and timestamp should be random ([5.1] in RFC3550)
+ mSequenceNum = (char)r.nextInt(65536);
+ mInitialPTS = r.nextInt();
+ }
+
+ /**
+ * Sets the Payload Type (PT) of RTP header field.
+ *
+ * Use this method if PT needs to be specified. The value should be between 0 and 127.
+ * Otherwise, a default value (96) is used.
+ *
+ * @param type A value indicating the Payload Type
+ */
+ public void setPayloadType(byte type) {
+ if (type >= 0 && type <= 127) {
+ mPayloadType = type;
+ } else {
+ mPayloadType = DEFAULT_RTP_PAYLOAD_TYPE;
+ }
+ }
+
+ /**
+ * Sets the SSRC of RTP header field.
+ *
+ * Use this method if SSRC needs to be specified. Otherwise, a random value is generated and
+ * used.
+ *
+ * @param ssrc An integer value representing SSRC
+ */
+ public void setSSRC(int ssrc) {
+ mSSRC = ssrc;
+ }
+
+ /**
+ * Starts this packetizer.
+ *
+ * It is recommended that the video encoder is started after the packetizer is started.
+ */
+ @Override
+ public void start() throws IOException {
+ if (mThread != null) {
+ return;
+ }
+
+ mThread = new Thread(this);
+ mThread.start();
+ }
+
+ /**
+ * Stops this packetizer.
+ *
+ * It is recommended that the video encoder is stopped prior to the packetizer.
+ */
+ @Override
+ public void stop() {
+ if (mThread == null) {
+ return;
+ }
+
+ mThread.interrupt();
+ mThread = null;
+
+ mPaused = false;
+ mWaitForIDR = false;
+ mOutputQueue.clear();
+ }
+
+ /**
+ * Pauses this packetizer.
+ *
+ * This pauses the packetizer but does not pause the video encoder.
+ */
+ @Override
+ public void pause() {
+ mPaused = true;
+ }
+
+ /**
+ * Resumes this packetizer.
+ */
+ @Override
+ public void resume() {
+ mWaitForIDR = true;
+ mPaused = false;
+ }
+
+ /**
+ * The thread routine.
+ */
+ public void run() {
+
+ while (mThread != null && !mThread.isInterrupted()) {
+ ByteBuffer frame;
+ try {
+ frame = mOutputQueue.take();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ break;
+ }
+
+ while (frame.hasRemaining()) {
+ int len = frame.remaining() > bufferSize ? bufferSize : frame.remaining();
+
+ ProtocolMessage pm = new ProtocolMessage();
+ pm.setSessionID(_rpcSessionID);
+ pm.setSessionType(_serviceType);
+ pm.setFunctionID(0);
+ pm.setCorrID(0);
+ pm.setData(frame.array(), frame.arrayOffset() + frame.position(), len);
+ pm.setPayloadProtected(mServiceProtected);
+
+ _streamListener.sendStreamPacket(pm);
+
+ frame.position(frame.position() + len);
+ }
+ }
+
+ // XXX: This is added to sync with StreamPacketizer. Actually it shouldn't be here since
+ // it's confusing that a packetizer takes care of End Service request.
+ if (_session != null) {
+ _session.endService(_serviceType, _rpcSessionID);
+ }
+ }
+
+ /**
+ * Called by the app and encoder.
+ *
+ * @see IVideoStreamListener#sendFrame(byte[], int, int, long)
+ */
+ @Override
+ public void sendFrame(byte[] data, int offset, int length, long presentationTimeUs)
+ throws ArrayIndexOutOfBoundsException {
+ mNALUnitReader.init(data, offset, length);
+ onEncoderOutput(mNALUnitReader, presentationTimeUs);
+ }
+
+ /**
+ * Called by the app and encoder.
+ *
+ * @see IVideoStreamListener#sendFrame(ByteBuffer, long)
+ */
+ @Override
+ public void sendFrame(ByteBuffer data, long presentationTimeUs) {
+ mNALUnitReader.init(data);
+ onEncoderOutput(mNALUnitReader, presentationTimeUs);
+ }
+
+ private void onEncoderOutput(NALUnitReader nalUnitReader, long ptsInUs) {
+ if (mPaused) {
+ return;
+ }
+
+ ByteBuffer nalUnit;
+
+ while ((nalUnit = nalUnitReader.getNalUnit()) != null) {
+ if (mWaitForIDR) {
+ if (isIDR(nalUnit)) {
+ mWaitForIDR = false;
+ } else {
+ continue;
+ }
+ }
+ outputRTPFrames(nalUnit, ptsInUs, nalUnitReader.hasConsumedAll());
+ }
+ }
+
+ private boolean outputRTPFrames(ByteBuffer nalUnit, long ptsInUs, boolean isLast) {
+ if (RTP_HEADER_LEN + nalUnit.remaining() > MAX_RTP_PACKET_SIZE) {
+ // Split into multiple Fragmentation Units ([5.8] in RFC 6184)
+ byte firstByte = nalUnit.get();
+ boolean firstFragment = true;
+ boolean lastFragment = false;
+
+ while (nalUnit.remaining() > 0) {
+ int payloadLength = MAX_RTP_PACKET_SIZE - (RTP_HEADER_LEN + FU_INDICATOR_LEN + FU_HEADER_LEN);
+ if (nalUnit.remaining() <= payloadLength) {
+ payloadLength = nalUnit.remaining();
+ lastFragment = true;
+ }
+
+ ByteBuffer frame = allocateRTPFrame(FU_INDICATOR_LEN + FU_HEADER_LEN + payloadLength,
+ false, isLast, ptsInUs);
+ // FU indicator
+ frame.put((byte)((firstByte & 0xE0) | TYPE_FU_A));
+ // FU header
+ frame.put((byte)((firstFragment ? 0x80 : lastFragment ? 0x40 : 0) | (firstByte & 0x1F)));
+ // FU payload
+ frame.put(nalUnit.array(), nalUnit.position(), payloadLength);
+ nalUnit.position(nalUnit.position() + payloadLength);
+ frame.flip();
+
+ try {
+ mOutputQueue.put(frame);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ return false;
+ }
+
+ firstFragment = false;
+ }
+ } else {
+ // Use Single NAL Unit Packet ([5.6] in RFC 6184)
+ ByteBuffer frame = allocateRTPFrame(nalUnit.remaining(), false, isLast, ptsInUs);
+ frame.put(nalUnit);
+ frame.flip();
+
+ try {
+ mOutputQueue.put(frame);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private ByteBuffer allocateRTPFrame(int rtpPayloadLen,
+ boolean hasPadding, boolean isLast, long ptsInUs) {
+ if (rtpPayloadLen <= 0) {
+ throw new IllegalArgumentException("Invalid rtpPayloadLen value: " + rtpPayloadLen);
+ }
+ if (ptsInUs < 0) {
+ throw new IllegalArgumentException("Invalid ptsInUs value: " + ptsInUs);
+ }
+
+ int packetLength = RTP_HEADER_LEN + rtpPayloadLen;
+ if (packetLength > MAX_RTP_PACKET_SIZE) {
+ throw new IllegalArgumentException("Invalid rtpPayloadLen value: " + rtpPayloadLen);
+ }
+ int ptsIn90kHz = (int)(ptsInUs * 9 / 100) + mInitialPTS;
+
+ ByteBuffer frame = ByteBuffer.allocate(FRAME_LENGTH_LEN + packetLength);
+ frame.order(ByteOrder.BIG_ENDIAN);
+ frame.putShort((short)packetLength);
+
+ // Version = 2, Padding = hasPadding, Extension = 0, CSRC count = 0
+ frame.put((byte)(0x80 | (hasPadding ? 0x20 : 0)))
+ // Marker = isLast, Payload type = mPayloadType
+ .put((byte)((isLast ? 0x80 : 0) | (mPayloadType & 0x7F)))
+ .putChar(mSequenceNum)
+ .putInt(ptsIn90kHz)
+ .putInt(mSSRC);
+
+ if (frame.position() != FRAME_LENGTH_LEN + RTP_HEADER_LEN) {
+ throw new RuntimeException("Data size in ByteBuffer mismatch");
+ }
+
+ mSequenceNum++;
+ return frame;
+ }
+
+ private static boolean isIDR(ByteBuffer nalUnit) {
+ if (nalUnit == null || !nalUnit.hasRemaining()) {
+ throw new IllegalArgumentException("Invalid nalUnit arg");
+ }
+
+ byte nalUnitType = (byte)(nalUnit.get(nalUnit.position()) & 0x1F);
+ return nalUnitType == 5;
+ }
+
+
+ private static int SKIP_TABLE[] = new int[256];
+ static {
+ // Sunday's quick search algorithm is used to find the start code.
+ // Prepare the table (SKIP_TABLE[0] = 2, SKIP_TABLE[1] = 1 and other elements will be 4).
+ byte[] NAL_UNIT_START_CODE = {0, 0, 1};
+ int searchStringLen = NAL_UNIT_START_CODE.length;
+ for (int i = 0; i < SKIP_TABLE.length; i++) {
+ SKIP_TABLE[i] = searchStringLen + 1;
+ }
+ for (int i = 0; i < searchStringLen; i++) {
+ SKIP_TABLE[NAL_UNIT_START_CODE[i] & 0xFF] = searchStringLen - i;
+ }
+ }
+
+ private class NALUnitReader {
+ private byte[] mData;
+ private int mOffset;
+ private int mLimit;
+
+ NALUnitReader() {
+ }
+
+ void init(byte[] data) {
+ mData = data;
+ mOffset = 0;
+ mLimit = data.length;
+ }
+
+ void init(byte[] data, int offset, int length) throws ArrayIndexOutOfBoundsException {
+ if (offset < 0 || offset > data.length || length <= 0 || offset + length > data.length) {
+ throw new ArrayIndexOutOfBoundsException();
+ }
+ mData = data;
+ mOffset = offset;
+ mLimit = offset + length;
+ }
+
+ void init(ByteBuffer data) {
+ if (data == null || data.remaining() == 0) {
+ mData = null;
+ mOffset = 0;
+ mLimit = 0;
+ return;
+ }
+
+ if (data.hasArray()) {
+ mData = data.array();
+ mOffset = data.position() + data.arrayOffset();
+ mLimit = mOffset + data.remaining();
+
+ // mark the buffer as consumed
+ data.position(data.position() + data.remaining());
+ } else {
+ byte[] buffer = new byte[data.remaining()];
+ data.get(buffer);
+
+ mData = buffer;
+ mOffset = 0;
+ mLimit = buffer.length;
+ }
+ }
+
+ ByteBuffer getNalUnit() {
+ if (hasConsumedAll()) {
+ return null;
+ }
+
+ int pos = mOffset;
+ int start = -1;
+
+ while (mLimit - pos >= 3) {
+ if (mData[pos] == 0 && mData[pos+1] == 0 && mData[pos+2] == 1) {
+ if (start != -1) {
+ // We've found a start code, a NAL unit and then another start code.
+ mOffset = pos;
+ // remove 0x00s in front of the start code
+ while (pos > start && mData[pos-1] == 0) {
+ pos--;
+ }
+ if (pos > start) {
+ return ByteBuffer.wrap(mData, start, pos - start);
+ } else {
+ // No NAL unit between two start codes?! Forget it and search for
+ // another start code.
+ pos = mOffset;
+ }
+ }
+ // This is the first start code.
+ pos += 3;
+ start = pos;
+ } else {
+ try {
+ pos += SKIP_TABLE[mData[pos+3] & 0xFF];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ break;
+ }
+ }
+ }
+
+ mOffset = mLimit;
+ if (start != -1 && mLimit > start) {
+ // We've found a start code and then reached to the end of array.
+ return ByteBuffer.wrap(mData, start, mLimit - start);
+ }
+ // A start code was not found
+ return null;
+ }
+
+ boolean hasConsumedAll() {
+ return (mData == null) || (mLimit - mOffset < 4);
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java b/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
new file mode 100644
index 000000000..09919c598
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2017 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.streaming.video;
+
+import com.smartdevicelink.proxy.rpc.ImageResolution;
+import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
+import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
+
+import java.util.List;
+
+@SuppressWarnings("FieldCanBeLocal")
+public class VideoStreamingParameters {
+ private final VideoStreamingProtocol DEFAULT_PROTOCOL = VideoStreamingProtocol.RAW;
+ private final VideoStreamingCodec DEFAULT_CODEC = VideoStreamingCodec.H264;
+ private final int DEFAULT_WIDTH = 1024;
+ private final int DEFAULT_HEIGHT = 576;
+ private final int DEFAULT_DENSITY = 240;
+ private final int DEFAULT_FRAMERATE = 30;
+ private final int DEFAULT_BITRATE = 512000;
+ private final int DEFAULT_INTERVAL = 5;
+
+
+ private int displayDensity;
+ private int frameRate;
+ private int bitrate;
+ private int interval;
+ private ImageResolution resolution;
+ private VideoStreamingFormat format;
+
+ public VideoStreamingParameters(){
+ displayDensity = DEFAULT_DENSITY;
+ frameRate = DEFAULT_FRAMERATE;
+ bitrate = DEFAULT_BITRATE;
+ interval = DEFAULT_INTERVAL;
+ resolution = new ImageResolution();
+ resolution.setResolutionWidth(DEFAULT_WIDTH);
+ resolution.setResolutionHeight(DEFAULT_HEIGHT);
+ format = new VideoStreamingFormat();
+ format.setProtocol(DEFAULT_PROTOCOL);
+ format.setCodec(DEFAULT_CODEC);
+ }
+
+ public VideoStreamingParameters(int displayDensity, int frameRate, int bitrate, int interval,
+ ImageResolution resolution, VideoStreamingFormat format){
+ this.displayDensity = displayDensity;
+ this.frameRate = frameRate;
+ this.bitrate = bitrate;
+ this.interval = interval;
+ this.resolution = resolution;
+ this.format = format;
+ }
+
+ /**
+ * Will only copy values that are not null or are greater than 0
+ * @param params VideoStreamingParameters that should be copied into this new instants
+ */
+ @SuppressWarnings("unused")
+ public VideoStreamingParameters(VideoStreamingParameters params){
+ update(params);
+ }
+
+ /**
+ * Will only copy values that are not null or are greater than 0
+ * @param params VideoStreamingParameters that should be copied into this new instants
+ */
+ public void update(VideoStreamingParameters params){
+ if(params!=null) {
+ if (params.displayDensity > 0) {
+ this.displayDensity = params.displayDensity;
+ }
+ if (params.frameRate > 0) {
+ this.frameRate = params.frameRate;
+ }
+ if (params.bitrate > 0) {
+ this.bitrate = params.bitrate;
+ }
+ if (params.interval > 0) {
+ this.interval = params.interval;
+ }
+ if (params.resolution != null) {
+ if (params.resolution.getResolutionHeight() != null && params.resolution.getResolutionHeight() > 0) {
+ this.resolution.setResolutionHeight(params.resolution.getResolutionHeight());
+ }
+ if (params.resolution.getResolutionWidth() != null && params.resolution.getResolutionWidth() > 0) {
+ this.resolution.setResolutionWidth(params.resolution.getResolutionWidth());
+ }
+ }
+ if (params.format != null) {
+ this.format = params.format;
+ }
+ }
+ }
+
+ /**
+ * Update the values contained in the capability that should have been returned through the SystemCapabilityManager.
+ * This update will use the most preferred streaming format from the module.
+ * @param capability the video streaming capability returned from the SystemCapabilityManager
+ * @see com.smartdevicelink.proxy.SystemCapabilityManager
+ * @see VideoStreamingCapability
+ */
+ public void update(VideoStreamingCapability capability){
+ if(capability.getMaxBitrate()!=null){ this.bitrate = capability.getMaxBitrate() * 1000; } // NOTE: the unit of maxBitrate in getSystemCapability is kbps.
+ ImageResolution resolution = capability.getPreferredResolution();
+ if(resolution!=null){
+ if(resolution.getResolutionHeight()!=null && resolution.getResolutionHeight() > 0){ this.resolution.setResolutionHeight(resolution.getResolutionHeight()); }
+ if(resolution.getResolutionWidth()!=null && resolution.getResolutionWidth() > 0){ this.resolution.setResolutionWidth(resolution.getResolutionWidth()); }
+ }
+ List<VideoStreamingFormat> formats = capability.getSupportedFormats();
+ if(formats != null && formats.size()>0){
+ this.format = formats.get(0);
+ }
+
+ }
+
+ @SuppressWarnings("unused")
+ public void setDisplayDensity(int displayDensity) {
+ this.displayDensity = displayDensity;
+ }
+
+ public int getDisplayDensity() {
+ return displayDensity;
+ }
+
+ public void setFrameRate(int frameRate) {
+ this.frameRate = frameRate;
+ }
+
+ public int getFrameRate() {
+ return frameRate;
+ }
+
+ public void setBitrate(int bitrate) {
+ this.bitrate = bitrate;
+ }
+
+ public int getBitrate() {
+ return bitrate;
+ }
+
+ public void setInterval(int interval) {
+ this.interval = interval;
+ }
+
+ public int getInterval() {
+ return interval;
+ }
+
+ public void setFormat(VideoStreamingFormat format){
+ this.format = format;
+ }
+
+ public VideoStreamingFormat getFormat(){
+ return format;
+ }
+
+ public void setResolution(ImageResolution resolution){
+ this.resolution = resolution;
+ }
+
+ public ImageResolution getResolution() {
+ return resolution;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("VideoStreamingParams - format: {");
+ builder.append(format.toString());
+ builder.append("}, resolution: {");
+ builder.append(resolution.getResolutionHeight());
+ builder.append(" , ");
+ builder.append(resolution.getResolutionWidth());
+ builder.append("}, frame rate {");
+ builder.append(frameRate);
+ builder.append("}, displayDensity{ ");
+ builder.append(displayDensity);
+ builder.append("}, bitrate");
+ builder.append(bitrate);
+ builder.append("}, IFrame interval{ ");
+ builder.append(interval);
+ builder.append("}");
+ return builder.toString();
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/trace/DiagLevel.java b/base/src/main/java/com/smartdevicelink/trace/DiagLevel.java
new file mode 100644
index 000000000..8203d0247
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/trace/DiagLevel.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace;
+
+import com.smartdevicelink.trace.enums.DetailLevel;
+import com.smartdevicelink.trace.enums.Mod;
+
+
+public class DiagLevel {
+
+ static private DetailLevel[] levels;
+
+ static { // this is a static c-tor!!
+ levels = new DetailLevel[Mod.values().length];
+ setAllLevels(DetailLevel.OFF);
+ }
+
+ public static void setAllLevels(DetailLevel thisDetail) {
+ if (thisDetail != null) {
+ for (int i = 0; i < levels.length; i++) {
+ levels[i] = thisDetail; //
+ }
+ }
+ }
+
+ public static void setLevel(Mod thisMod, DetailLevel thisDetail) {
+ if (thisMod != null && thisDetail != null) {
+ levels[thisMod.ordinal()] = thisDetail;
+ }
+ }
+
+ public static DetailLevel getLevel(Mod thisMod) {
+ if (thisMod != null) {
+ return levels[thisMod.ordinal()];
+ }
+ return null;
+ }
+
+ public static boolean isValidDetailLevel(String dtString) {
+ // Assume false
+ Boolean isValid = false;
+
+ if (dtString != null) {
+ if (dtString.equalsIgnoreCase("verbose"))
+ isValid = true;
+ else if (dtString.equalsIgnoreCase("terse"))
+ isValid = true;
+ else if (dtString.equalsIgnoreCase("off"))
+ isValid = true;
+ }
+
+ return isValid;
+ }
+
+ public static DetailLevel toDetailLevel(String dtString) {
+ DetailLevel dt = DetailLevel.OFF;
+ if (dtString.equalsIgnoreCase("verbose"))
+ dt = DetailLevel.VERBOSE;
+ else if (dtString.equalsIgnoreCase("terse"))
+ dt = DetailLevel.TERSE;
+ return dt;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/trace/ISTListener.java b/base/src/main/java/com/smartdevicelink/trace/ISTListener.java
new file mode 100644
index 000000000..7b5296d12
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/trace/ISTListener.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace;
+
+public interface ISTListener {
+ void logXmlMsg(String msg, String token);
+} // end-interface \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/trace/Mime.java b/base/src/main/java/com/smartdevicelink/trace/Mime.java
new file mode 100644
index 000000000..814dc1ec6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/trace/Mime.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace;
+
+// Borrowed from Dave Boll's infamous SdlLinkRelay.java
+
+public class Mime {
+
+ private static final String BASE_64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+ /**
+ * @param str A String to encode into base64 String.
+ * @return Base64 encoded String or a null String if input is null.
+ */
+ public static String base64Encode(String str) {
+ if(str == null){
+ return null;
+ }
+
+ String b64String = "";
+ try {
+ byte[] strBytes = str.getBytes("US-ASCII");
+ b64String = base64Encode(strBytes);
+ } catch (Exception ex) {
+ // Don't care?
+ }
+ return b64String;
+ }
+
+ /**
+ * @param bytesToEncode A byte array to encode into base64 String.
+ * @return Base64 encoded String or a null String if input array is null.
+ */
+ public static String base64Encode(byte bytesToEncode[]) {
+ if(bytesToEncode != null){
+ return base64Encode(bytesToEncode, 0, bytesToEncode.length);
+ }
+ return null;
+ }
+
+ /**
+ * @param bytesToEncode A byte array to encode into base64 String.
+ * @param offset Offset to begin at
+ * @param length Length to read
+ * @return Base64 encoded String or a null String if input array is null or the input range is out of bounds.
+ */
+ public static String base64Encode(byte bytesToEncode[], int offset, int length) {
+ if (bytesToEncode == null || bytesToEncode.length < length || bytesToEncode.length < offset + length) {
+ return null;
+ }
+
+ StringBuilder sb = new StringBuilder();
+
+ int idxin = 0;
+ int b64idx = 0;
+
+ for (idxin = offset; idxin < offset + length; idxin++) {
+ switch ((idxin - offset) % 3) {
+ case 0:
+ b64idx = (bytesToEncode[idxin] >> 2) & 0x3f;
+ break;
+ case 1:
+ b64idx = (bytesToEncode[idxin] >> 4) & 0x0f;
+ b64idx |= ((bytesToEncode[idxin - 1] << 4) & 0x30);
+ break;
+ case 2:
+ b64idx = (bytesToEncode[idxin] >> 6) & 0x03;
+ b64idx |= ((bytesToEncode[idxin - 1] << 2) & 0x3c);
+ sb.append(getBase64Char(b64idx));
+ b64idx = bytesToEncode[idxin] & 0x3f;
+ break;
+ }
+ sb.append(getBase64Char(b64idx));
+ }
+
+ switch ((idxin - offset) % 3) {
+ case 0:
+ break;
+ case 1:
+ b64idx = (bytesToEncode[idxin - 1] << 4) & 0x30;
+ sb.append(getBase64Char(b64idx));
+ sb.append("==");
+ break;
+ case 2:
+ b64idx = ((bytesToEncode[idxin - 1] << 2) & 0x3c);
+ sb.append(getBase64Char(b64idx));
+ sb.append('=');
+ break;
+ }
+
+ return sb.toString();
+
+ }
+
+ private static char getBase64Char(int b64idx){
+ if(b64idx >= 0 && b64idx < BASE_64_CHARS.length()) {
+ return BASE_64_CHARS.charAt(b64idx);
+ }else{
+ return 0x20;
+ }
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java b/base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
new file mode 100644
index 000000000..9aebffd48
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace;
+
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+class OpenRPCMessage extends RPCMessage {
+ private OpenRPCMessage() {super("");}
+ public OpenRPCMessage(RPCMessage rpcm) {
+ super(rpcm);
+ } // end-method
+
+ public OpenRPCMessage(RPCStruct rpcs) {
+ super(rpcs);
+ } // end-method
+
+ public String msgDump() {
+ StringBuilder pd = new StringBuilder();
+
+ pd.append(this.getFunctionName() + " " + this.getMessageType());
+
+ msgDump(pd);
+
+ return pd.toString();
+ } // end-method
+
+ public void msgDump(StringBuilder pd) {
+ pd.append("[");
+
+ dumpParams(parameters, pd);
+
+ pd.append("]");
+
+ return;
+ } // end-method
+
+ private void dumpParams(Hashtable<String, Object> ht, StringBuilder pd) {
+ Iterator<String> keySet = ht.keySet().iterator();
+ Object obj = null;
+ String key = "";
+ boolean isFirstParam = true;
+
+ while (keySet.hasNext()) {
+ key = (String)keySet.next();
+ obj = ht.get(key);
+ if (isFirstParam) {
+ isFirstParam = false;
+ } else {
+ pd.append(", ");
+ } // end-if
+
+ dumpParamNode(key, obj, pd);
+
+ } // end-while
+ } // end-method
+
+ @SuppressWarnings("unchecked")
+ private void dumpParamNode(String key, Object obj, StringBuilder pd) {
+
+ if (obj instanceof Hashtable) {
+ pd.append("[");
+ dumpParams((Hashtable<String, Object>)obj, pd);
+ pd.append("]");
+ } else if (obj instanceof RPCStruct) {
+ pd.append("[");
+ OpenRPCMessage orpcm = new OpenRPCMessage((RPCStruct)obj);
+ orpcm.msgDump(pd);
+ pd.append("]");
+ } else if (obj instanceof List) {
+ pd.append("[");
+ List<?> list = (List<?>)obj;
+ for (int idx=0;idx < list.size();idx++) {
+ if (idx > 0) {
+ pd.append(", ");
+ }
+ dumpParamNode(key, list.get(idx), pd);
+ } // end-for
+ pd.append("]");
+ } else {
+ pd.append("\"" + key + "\" = \"" + obj.toString() + "\"");
+ }
+ } // end-method
+} // end-class OpenRPCMessage
diff --git a/base/src/main/java/com/smartdevicelink/trace/SdlTrace.java b/base/src/main/java/com/smartdevicelink/trace/SdlTrace.java
new file mode 100644
index 000000000..c02d5b8c8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/trace/SdlTrace.java
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace;
+
+
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
+import com.smartdevicelink.protocol.enums.FrameType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.trace.enums.DetailLevel;
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
+import com.smartdevicelink.trace.enums.Mod;
+import com.smartdevicelink.transport.SiphonServer;
+import com.smartdevicelink.util.BitConverter;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.NativeLogTool;
+
+/* This class handles the global TraceSettings as requested by the users either through the combination of the following
+ 1. System defaults
+ 2. Application XML config
+ 3. Programmatic requests from application itself
+
+ It is manifested in the <SmartDeviceLink>...</SmartDeviceLink> tags
+ */
+
+//@SuppressLint("DefaultLocale")
+public class SdlTrace {
+ private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
+
+ public static final String SYSTEM_LOG_TAG = "SdlTrace";
+
+ private static long baseTics = System.currentTimeMillis();
+ private static boolean acceptAPITraceAdjustments = true;
+
+ protected static ISTListener m_appTraceListener = null;
+
+ ///
+ /// The PUBLIC interface to SdlTrace starts here
+ ///
+
+
+ public static void setAcceptAPITraceAdjustments(Boolean APITraceAdjustmentsAccepted) {
+ if (APITraceAdjustmentsAccepted != null) {
+ acceptAPITraceAdjustments = APITraceAdjustmentsAccepted;
+ }
+ }
+
+ public static boolean getAcceptAPITraceAdjustments() {
+ return acceptAPITraceAdjustments;
+ }
+
+ public static void setAppTraceListener(ISTListener listener) {
+ m_appTraceListener = listener;
+ } // end-method
+
+ public static void setAppTraceLevel(DetailLevel dt) {
+ if ( dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.app, dt);
+ } // end-method
+
+ public static void setProxyTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.proxy, dt);
+ } // end-method
+
+ public static void setRpcTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.rpc, dt);
+ } // end-method
+
+ public static void setMarshallingTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.mar, dt);
+ } // end-method
+
+ public static void setProtocolTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.proto, dt);
+ } // end-method
+
+ public static void setTransportTraceLevel(DetailLevel dt) {
+ if (dt != null && acceptAPITraceAdjustments)
+ DiagLevel.setLevel(Mod.tran, dt);
+ } // end-method
+
+ private static String getPid(){
+ //Default implementation is not able to get this information
+ return "UNKNOWN";
+ }
+
+ private static String encodeTraceMessage(long timestamp, Mod module, InterfaceActivityDirection msgDirection, String msgBodyXml) {
+ StringBuilder sb = new StringBuilder("<msg><dms>");
+ sb.append(timestamp);
+ sb.append("</dms><pid>");
+ sb.append(getPid());
+ sb.append("</pid><tid>");
+ sb.append(Thread.currentThread().getId());
+ sb.append("</tid><mod>");
+ sb.append(module.toString());
+ sb.append("</mod>");
+ if (msgDirection != InterfaceActivityDirection.None) {
+ sb.append("<dir>");
+ sb.append(interfaceActivityDirectionToString(msgDirection));
+ sb.append("</dir>");
+ } // end-if
+ sb.append(msgBodyXml);
+ sb.append("</msg>");
+
+ return sb.toString();
+ } // end-method
+
+ private static String interfaceActivityDirectionToString(InterfaceActivityDirection iaDirection) {
+ String str = "";
+ switch (iaDirection) {
+ case Receive:
+ str = "rx";
+ break;
+ case Transmit:
+ str = "tx";
+ break;
+ default:
+ break;
+ } // end-switch
+ return str;
+ } // end-method
+
+ static String B64EncodeForXML(String data) {
+ return Mime.base64Encode(data);
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: return Base64.encodeToString(data.getBytes(), Base64.DEFAULT);
+ } // end-method
+
+ public static boolean logProxyEvent(String eventText, String token) {
+ if (DiagLevel.getLevel(Mod.proxy) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ String msg = SdlTrace.B64EncodeForXML(eventText);
+ String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proxy, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logAppEvent(String eventText) {
+ if (DiagLevel.getLevel(Mod.app) == DetailLevel.OFF) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ String msg = SdlTrace.B64EncodeForXML(eventText);
+ String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.app, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logRPCEvent(InterfaceActivityDirection msgDirection, RPCMessage rpcMsg, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.rpc);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.rpc, msgDirection, rpc2Xml(dl, rpcMsg));
+ return writeXmlTraceMessage(xml);
+ }
+
+ private static String rpc2Xml(DetailLevel dl, RPCMessage rpcMsg) {
+ StringBuilder rpcAsXml = new StringBuilder();
+ rpcAsXml.append("<op>");
+ rpcAsXml.append(rpcMsg.getFunctionName());
+ rpcAsXml.append("</op>");
+ boolean hasCorrelationID = false;
+ Integer correlationID = -1;
+ if (rpcMsg instanceof RPCRequest) {
+ hasCorrelationID = true;
+ correlationID = ((RPCRequest)rpcMsg).getCorrelationID();
+ } else if (rpcMsg instanceof RPCResponse) {
+ hasCorrelationID = true;
+ correlationID = ((RPCResponse)rpcMsg).getCorrelationID();
+ } // end-if
+ if (hasCorrelationID) {
+ rpcAsXml.append("<cid>");
+ rpcAsXml.append(correlationID);
+ rpcAsXml.append("</cid>");
+ } // end-if
+ rpcAsXml.append("<type>");
+ rpcAsXml.append(rpcMsg.getMessageType());
+ rpcAsXml.append("</type>");
+ //rpcAsXml.append(newline);
+
+ if (dl == DetailLevel.VERBOSE) {
+ OpenRPCMessage orpcmsg = new OpenRPCMessage(rpcMsg);
+ String rpcParamList = orpcmsg.msgDump();
+ String msg = SdlTrace.B64EncodeForXML(rpcParamList);
+ rpcAsXml.append("<d>");
+ rpcAsXml.append(msg);
+ rpcAsXml.append("</d>");
+ } // end-if
+ return rpcAsXml.toString();
+ } // end-method
+
+ public static boolean logMarshallingEvent(InterfaceActivityDirection msgDirection, byte[] marshalledMessage, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.mar);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ long timestamp = SdlTrace.getBaseTicsDelta();
+ StringBuilder msg = new StringBuilder();
+ msg.append("<sz>");
+ msg.append(marshalledMessage.length);
+ msg.append("</sz>");
+ if (dl == DetailLevel.VERBOSE) {
+ msg.append("<d>");
+ msg.append(Mime.base64Encode(marshalledMessage));
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: msg.append(Base64.encodeToString(marshalledMessage, Base64.DEFAULT));
+ msg.append("</d>");
+ }
+ String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.mar, msgDirection, msg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ public static boolean logProtocolEvent(InterfaceActivityDirection frameDirection, SdlPacket packet, int frameDataOffset, int frameDataLength, String token) {
+ DetailLevel dl = DiagLevel.getLevel(Mod.proto);
+ if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ StringBuffer protoMsg = new StringBuffer();
+ protoMsg.append("<frame>");
+ protoMsg.append(SdlTrace.getProtocolFrameHeaderInfo(packet));
+ if (dl == DetailLevel.VERBOSE) {
+ if (packet.getPayload() != null && frameDataLength > 0) {
+ protoMsg.append("<d>");
+ String bytesInfo = "";
+ bytesInfo = Mime.base64Encode(packet.getPayload(), frameDataOffset, frameDataLength);
+ // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: bytesInfo = Base64.encodeToString(frameData, frameDataOffset, frameDataLength, Base64.DEFAULT);
+ protoMsg.append(bytesInfo);
+ protoMsg.append("</d>");
+ }
+ }
+ protoMsg.append("</frame>");
+ String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proto, frameDirection, protoMsg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ private static String getProtocolFrameType(FrameType f) {
+ if (f == FrameType.Control)
+ return "Control";
+ else if (f == FrameType.Consecutive)
+ return "Consecutive";
+ else if (f == FrameType.First)
+ return "First";
+ else if (f == FrameType.Single)
+ return "Single";
+
+ return "Unknown";
+ } // end-method
+
+ private static String getProtocolSessionType(SessionType serviceType) {
+ String s;
+ if (serviceType == SessionType.RPC )
+ s = "rpc";
+ else if (serviceType == SessionType.BULK_DATA)
+ s = "bulk";
+ else
+ s = "Unknown";
+ return s;
+ } // end-method
+
+ private static String getProtocolFrameHeaderInfo(SdlPacket hdr) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<hdr>");
+ sb.append("<ver>");
+ sb.append(hdr.getVersion());
+ sb.append("</ver><cmp>");
+ sb.append(hdr.isEncrypted());
+ sb.append("</cmp><ft>");
+ sb.append(getProtocolFrameType(hdr.getFrameType()));
+ sb.append("</ft><st>");
+ sb.append(getProtocolSessionType(SessionType.valueOf((byte)hdr.getServiceType())));
+ sb.append("</st><sid>");
+ sb.append(hdr.getSessionId());
+ sb.append("</sid><sz>");
+ sb.append(hdr.getDataSize());
+ sb.append("</sz>");
+
+ int frameData = hdr.getFrameInfo();
+ if (hdr.getFrameType() == FrameType.Control) {
+ sb.append("<ca>");
+ if (frameData == FrameDataControlFrameType.StartSession.getValue())
+ sb.append("StartSession");
+ else if (frameData == FrameDataControlFrameType.StartSessionACK.getValue())
+ sb.append("StartSessionACK");
+ else if (frameData == FrameDataControlFrameType.StartSessionNACK.getValue())
+ sb.append("StartSessionNACK");
+ else if (frameData == FrameDataControlFrameType.EndSession.getValue())
+ sb.append("EndSession");
+ sb.append("</ca>");
+ } else if (hdr.getFrameType() == FrameType.Consecutive ) {
+ sb.append("<fsn>");
+ if (frameData == 0 )
+ sb.append("lastFrame");
+ else
+ sb.append(String.format("%02X",frameData));
+ sb.append("</fsn>");
+ } else if (hdr.getFrameType() == FrameType.First ) {
+ int totalSize = BitConverter.intFromByteArray(hdr.getPayload(), 0);
+ int numFrames = BitConverter.intFromByteArray(hdr.getPayload(), 4);
+ sb.append("<total>" + totalSize + "</total><numframes>" + numFrames + "</numframes>");
+ } else if (hdr.getFrameType() == FrameType.Single ) {
+ sb.append("<single/>");
+ }
+
+ sb.append("</hdr>");
+
+ return sb.toString();
+ } // end-method
+
+ public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int byteLength, String token) {
+ return logTransportEvent(preamble, transportSpecificInfoXml, msgDirection, buf, 0, byteLength, token);
+ }
+
+ private static void checkB64(String x, byte[] buf, int offset, int byteLength) {
+ if ((x.length() % 4) != 0) {
+ NativeLogTool.logWarning(SdlTrace.SYSTEM_LOG_TAG, "b64 string length (" + x.length() + ") isn't multiple of 4: buf.length=" + buf.length + ", offset=" + offset + ", len=" + byteLength);
+ } // end-if
+ } // end-method
+
+ public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int offset, int byteLength, String token) {
+ if (DiagLevel.getLevel(Mod.tran) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
+ return false;
+ }
+
+ StringBuilder msg = new StringBuilder();
+ if (transportSpecificInfoXml != null && transportSpecificInfoXml.length() > 0) {
+ msg.append(transportSpecificInfoXml);
+ }
+ if (preamble != null && preamble.length() > 0) {
+ msg.append("<desc>");
+ msg.append(preamble);
+ msg.append("</desc>");
+ }
+ if (buf != null) {
+ msg.append("<sz>");
+ msg.append(byteLength);
+ msg.append("</sz>");
+ DetailLevel dl = DiagLevel.getLevel(Mod.tran);
+ if (dl == DetailLevel.VERBOSE) {
+ if (buf != null && byteLength > 0) {
+ msg.append("<d>");
+ String bytesInfo = Mime.base64Encode(buf, offset, byteLength);
+ checkB64(bytesInfo, buf, offset, byteLength);
+ msg.append(bytesInfo);
+ msg.append("</d>");
+ }
+ }
+ }
+ String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.tran, msgDirection, msg.toString());
+ return writeXmlTraceMessage(xml);
+ }
+
+ // Package-scoped
+ static long getBaseTicsDelta() {
+ return System.currentTimeMillis() - getBaseTics();
+ }
+
+ // Package-scoped
+ static long getBaseTics() {
+ return baseTics;
+ } // end-method
+
+ public static Boolean writeMessageToSiphonServer(String info) {
+ return SiphonServer.sendFormattedTraceMessage(info);
+ }
+
+ private static boolean writeXmlTraceMessage(String msg) {
+ try {
+ // Attempt to write formatted message to the Siphon
+ if (false == writeMessageToSiphonServer(msg)) {
+ // If writing to the Siphon fails, write to the native log
+ NativeLogTool.logInfo(SdlTrace.SYSTEM_LOG_TAG, msg);
+ return false;
+ }
+
+ ISTListener localTraceListener = m_appTraceListener;
+
+ if (localTraceListener != null) {
+ try {
+ localTraceListener.logXmlMsg(msg, SDL_LIB_TRACE_KEY);
+ } catch (Exception ex) {
+ DebugTool.logError("Failure calling ISTListener: " + ex.toString(), ex);
+ return false;
+ }
+ }
+ } catch (Exception ex) {
+ NativeLogTool.logError(SdlTrace.SYSTEM_LOG_TAG, "Failure writing XML trace message: " + ex.toString());
+ return false;
+ }
+ return true;
+ }
+
+
+
+
+ private static String getSmartDeviceLinkTraceRoot(String dumpReason, int seqNo) {
+ StringBuilder write = new StringBuilder("<SmartDeviceLinktraceroot>" + "<sequencenum>" + seqNo
+ + "</sequencenum>" + "<dumpreason>" + dumpReason
+ + "</dumpreason><tracelevel>");
+
+ write.append("<tran>" + DiagLevel.getLevel(Mod.tran) + "</tran>");
+ write.append("<proto>" + DiagLevel.getLevel(Mod.proto) + "</proto>");
+ write.append("<mar>" + DiagLevel.getLevel(Mod.mar) + "</mar>");
+ write.append("<rpc>" + DiagLevel.getLevel(Mod.rpc) + "</rpc>");
+ write.append("<proxy>" + DiagLevel.getLevel(Mod.proxy) + "</proxy>");
+ write.append("<app>" + DiagLevel.getLevel(Mod.app) + "</app>");
+
+ write.append("</tracelevel>");
+ write.append("</SmartDeviceLinktraceroot>");
+ return write.toString();
+ } // end-method
+} // end-class \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/trace/enums/DetailLevel.java b/base/src/main/java/com/smartdevicelink/trace/enums/DetailLevel.java
new file mode 100644
index 000000000..24b746d22
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/trace/enums/DetailLevel.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace.enums;
+
+
+public enum DetailLevel {
+ OFF,
+ TERSE,
+ VERBOSE;
+
+ public static DetailLevel valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/trace/enums/InterfaceActivityDirection.java b/base/src/main/java/com/smartdevicelink/trace/enums/InterfaceActivityDirection.java
new file mode 100644
index 000000000..5a75025e4
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/trace/enums/InterfaceActivityDirection.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace.enums;
+
+public enum InterfaceActivityDirection {
+ Transmit,
+ Receive,
+ None;
+
+ public static InterfaceActivityDirection valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/trace/enums/Mod.java b/base/src/main/java/com/smartdevicelink/trace/enums/Mod.java
new file mode 100644
index 000000000..ecc89dd15
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/trace/enums/Mod.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.trace.enums;
+
+public enum Mod {
+ tran,
+ proto,
+ mar,
+ rpc,
+ app,
+ proxy;
+
+ public static Mod valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}; \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java b/base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
new file mode 100644
index 000000000..57237d0bc
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.transport.enums.TransportType;
+
+/**
+ * Defines base abstract class for transport configurations.
+ */
+public abstract class BaseTransportConfig {
+
+ protected boolean shareConnection = true;
+ protected int iHeartBeatTimeout = Integer.MAX_VALUE;
+ /**
+ * Gets transport type for this transport configuration.
+ *
+ * @return One of {@link TransportType} enumeration values that represents type of this transport configuration.
+ */
+ public abstract TransportType getTransportType();
+
+ /**
+ * @deprecated
+ * Indicate whether the application want to share connection with others.
+ *
+ * @return a boolean if this conneciton should be shared
+ */
+ @Deprecated
+ public boolean shareConnection() {
+ return shareConnection;
+ }
+
+ public int getHeartBeatTimeout() {
+ return iHeartBeatTimeout;
+ }
+
+ public void setHeartBeatTimeout(int iTimeout) {
+ iHeartBeatTimeout = iTimeout;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/CustomTransport.java b/base/src/main/java/com/smartdevicelink/transport/CustomTransport.java
new file mode 100644
index 000000000..4e604ecf9
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/CustomTransport.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+import com.smartdevicelink.util.DebugTool;
+
+import java.nio.ByteBuffer;
+
+public abstract class CustomTransport implements TransportInterface{
+ private static final String TAG = "CustomTransport";
+
+ final TransportRecord transportRecord;
+ final SdlPsm psm;
+ TransportCallback transportCallback;
+
+
+
+ public CustomTransport(String address) {
+ //Creates a callback for when packets
+ psm = new SdlPsm();
+ transportRecord = new TransportRecord(TransportType.CUSTOM,address);
+ }
+
+ public TransportRecord getTransportRecord(){
+ return this.transportRecord;
+ }
+
+
+ /**
+ * Call this method when reading a byte array off the transport
+ * @param bytes the bytes read off the transport
+ */
+ public synchronized void onByteArrayReceived (byte[] bytes, int offset, int length) {
+
+ if(bytes != null && bytes.length > 0){
+ boolean stateProgress;
+ for(int i = 0; i < length; i++){
+ stateProgress = psm.handleByte(bytes[i]);
+ if (!stateProgress) {//We are trying to weed through the bad packet info until we get something
+ //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
+ psm.reset();
+ }
+
+ if (psm.getState() == SdlPsm.FINISHED_STATE) {
+ SdlPacket packet = psm.getFormedPacket();
+ if (transportCallback != null && packet != null) {
+ packet.setTransportRecord(transportRecord);
+ transportCallback.onPacketReceived(packet);
+ }
+ //We put a trace statement in the message read so we can avoid all the extra bytes
+ psm.reset();
+ }
+ }
+
+ }
+ }
+
+ /**
+ * Call this method when reading a ByteBuffer off the transport
+ * @param message the byte buffer that was read off the transport
+ */
+ public synchronized void onByteBufferReceived (ByteBuffer message) {
+ if(message != null){
+ boolean stateProgress;
+ while (message.hasRemaining()) {
+ stateProgress = psm.handleByte(message.get());
+ if (!stateProgress) {//We are trying to weed through the bad packet info until we get something
+
+ //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
+ psm.reset();
+ }
+
+ if (psm.getState() == SdlPsm.FINISHED_STATE) {
+ SdlPacket packet = psm.getFormedPacket();
+ if (transportCallback != null && packet != null) {
+ packet.setTransportRecord(transportRecord);
+ transportCallback.onPacketReceived(packet);
+ }
+ //We put a trace statement in the message read so we can avoid all the extra bytes
+ psm.reset();
+ }
+ }
+
+ }
+ }
+
+ @Override
+ public void start() {
+ if (transportCallback != null) {
+ transportCallback.onConnectionEstablished();
+ }
+ }
+
+ @Override
+ public void stop() {
+ if (transportCallback != null) {
+ transportCallback.onConnectionTerminated("Transport told to stop");
+ }
+ }
+
+ @Override
+ public void write(SdlPacket packet) {
+ byte[] bytes = packet.constructPacket();
+ if(bytes != null && bytes.length > 0) {
+ try {
+ onWrite(bytes, 0, bytes.length);
+ } catch (Exception exc) {
+ DebugTool.logError("Error attempting to write packet", exc);
+ }
+ }
+ }
+
+ @Override
+ public void setCallback(TransportCallback transportCallback) {
+ this.transportCallback = transportCallback;
+ }
+
+ public void onError(){
+ if (transportCallback != null) {
+ transportCallback.onError();
+ }
+ }
+
+
+ /**
+ * Integrator should write out these bytes to whatever actual transport there is. This will be called from the
+ * internals of the library.
+ * @param bytes a deconstructed packet into a byte array that needs to be written out
+ * @param offset in bytes
+ * @param length in bytes
+ */
+ public abstract void onWrite(byte[] bytes, int offset, int length);
+
+
+
+
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java b/base/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java
new file mode 100644
index 000000000..af0613aa1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.transport.enums.TransportType;
+
+public class CustomTransportConfig extends BaseTransportConfig {
+
+ final CustomTransport customTransport;
+
+ public CustomTransportConfig(CustomTransport customTransport){
+ this.customTransport = customTransport;
+ }
+
+ @Override
+ public TransportType getTransportType() {
+ return TransportType.CUSTOM;
+ }
+
+ public TransportInterface getTransportInterface(){
+ return this.customTransport;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/ITransportListener.java b/base/src/main/java/com/smartdevicelink/transport/ITransportListener.java
new file mode 100644
index 000000000..46baf5296
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/ITransportListener.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.protocol.SdlPacket;
+
+public interface ITransportListener {
+ // Called to indicate and deliver a packet received from transport
+ void onTransportPacketReceived(SdlPacket packet);
+
+ // Called to indicate that transport connection was established
+ void onTransportConnected();
+
+ // Called to indicate that transport was disconnected (by either side)
+ void onTransportDisconnected(String info);
+
+ // Called to indicate that some error occurred on the transport
+ void onTransportError(String info, Exception e);
+} // end-interface \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/transport/SdlPsm.java b/base/src/main/java/com/smartdevicelink/transport/SdlPsm.java
new file mode 100644
index 000000000..52d2512ee
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/SdlPsm.java
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.protocol.SdlPacket;
+
+import static com.smartdevicelink.protocol.SdlProtocol.V1_HEADER_SIZE;
+import static com.smartdevicelink.protocol.SdlProtocol.V1_V2_MTU_SIZE;
+
+
+public class SdlPsm{
+ //private static final String TAG = "Sdl PSM";
+ //Each state represents the byte that should be incomming
+
+ public static final int START_STATE = 0x0;
+ public static final int SERVICE_TYPE_STATE = 0x02;
+ public static final int CONTROL_FRAME_INFO_STATE = 0x03;
+ public static final int SESSION_ID_STATE = 0x04;
+ public static final int DATA_SIZE_1_STATE = 0x05;
+ public static final int DATA_SIZE_2_STATE = 0x06;
+ public static final int DATA_SIZE_3_STATE = 0x07;
+ public static final int DATA_SIZE_4_STATE = 0x08;
+ public static final int MESSAGE_1_STATE = 0x09;
+ public static final int MESSAGE_2_STATE = 0x0A;
+ public static final int MESSAGE_3_STATE = 0x0B;
+ public static final int MESSAGE_4_STATE = 0x0C;
+ public static final int DATA_PUMP_STATE = 0x0D;
+ public static final int FINISHED_STATE = 0xFF;
+ public static final int ERROR_STATE = -1;
+
+
+ private static final byte FIRST_FRAME_DATA_SIZE = 0x08;
+
+ private static final int VERSION_MASK = 0xF0; //4 highest bits
+ private static final int COMPRESSION_MASK = 0x08; //4th lowest bit
+ private static final int FRAME_TYPE_MASK = 0x07; //3 lowest bits
+
+
+
+ int state ;
+
+ int version;
+ boolean compression;
+ int frameType;
+ int serviceType;
+ int controlFrameInfo;
+ int sessionId;
+ int dumpSize, dataLength;
+ int messageId = 0;
+
+ byte[] payload;
+
+ public SdlPsm(){
+ reset();
+ }
+
+ public boolean handleByte(byte data) {
+ //Log.trace(TAG, data + " = incomming");
+ state = transitionOnInput(data,state);
+
+ if(state==ERROR_STATE){
+ return false;
+ }
+ return true;
+ }
+
+ private int transitionOnInput(byte rawByte, int state){
+ switch(state){
+ case START_STATE:
+ version = (rawByte&(byte)VERSION_MASK)>>4;
+ //Log.trace(TAG, "Version: " + version);
+ if(version==0){ //It should never be 0
+ return ERROR_STATE;
+ }
+ compression = (1 == ((rawByte&(byte)COMPRESSION_MASK)>>3));
+
+
+ frameType = rawByte&(byte)FRAME_TYPE_MASK;
+ //Log.trace(TAG, rawByte + " = Frame Type: " + frameType);
+
+ if((version < 1 || version > 5) //These are known versions supported by this library.
+ && frameType!=SdlPacket.FRAME_TYPE_CONTROL){
+ return ERROR_STATE;
+ }
+
+ if(frameType<SdlPacket.FRAME_TYPE_CONTROL || frameType > SdlPacket.FRAME_TYPE_CONSECUTIVE){
+ return ERROR_STATE;
+ }
+
+ return SERVICE_TYPE_STATE;
+
+ case SERVICE_TYPE_STATE:
+ serviceType = (int)(rawByte&0xFF);
+ return CONTROL_FRAME_INFO_STATE;
+
+ case CONTROL_FRAME_INFO_STATE:
+ controlFrameInfo = (int)(rawByte&0xFF);
+ //Log.trace(TAG,"Frame Info: " + controlFrameInfo);
+ switch(frameType){
+ case SdlPacket.FRAME_TYPE_CONTROL:
+ /*if(frameInfo<FRAME_INFO_HEART_BEAT
+ || (frameInfo>FRAME_INFO_END_SERVICE_ACK
+ && (frameInfo!=FRAME_INFO_SERVICE_DATA_ACK || frameInfo!=FRAME_INFO_HEART_BEAT_ACK))){
+ return ERROR_STATE;
+ }*/ //Although some bits are reserved...whatever
+ break;
+ case SdlPacket.FRAME_TYPE_SINGLE: //Fall through since they are both the same
+ case SdlPacket.FRAME_TYPE_FIRST:
+ if(controlFrameInfo!=0x00){
+ return ERROR_STATE;
+ }
+ break;
+ case SdlPacket.FRAME_TYPE_CONSECUTIVE:
+ //It might be a good idea to check packet sequence numbers here
+ break;
+
+ default:
+ return ERROR_STATE;
+ }
+ return SESSION_ID_STATE;
+
+ case SESSION_ID_STATE:
+ sessionId = (int)(rawByte&0xFF);
+ return DATA_SIZE_1_STATE;
+
+ case DATA_SIZE_1_STATE:
+ //First data size byte
+ //Log.d(TAG, "Data byte 1: " + rawByte);
+ dataLength += ((int)(rawByte& 0xFF))<<24; //3 bytes x 8 bits
+ //Log.d(TAG, "Data Size 1 : " + dataLength);
+ return DATA_SIZE_2_STATE;
+
+ case DATA_SIZE_2_STATE:
+ //Log.d(TAG, "Data byte 2: " + rawByte);
+ dataLength += ((int)(rawByte& 0xFF))<<16; //2 bytes x 8 bits
+ //Log.d(TAG, "Data Size 2 : " + dataLength);
+ return DATA_SIZE_3_STATE;
+
+ case DATA_SIZE_3_STATE:
+ //Log.d(TAG, "Data byte 3: " + rawByte);
+ dataLength += ((int)(rawByte& 0xFF))<<8; //1 byte x 8 bits
+ //Log.d(TAG, "Data Size 3 : " + dataLength);
+ return DATA_SIZE_4_STATE;
+
+ case DATA_SIZE_4_STATE:
+ //Log.d(TAG, "Data byte 4: " + rawByte);
+ dataLength+=((int)rawByte) & 0xFF;
+ //Log.trace(TAG, "Data Size: " + dataLength);
+ //We should have data length now for the pump state
+ switch(frameType){ //If all is correct we should break out of this switch statement
+ case SdlPacket.FRAME_TYPE_SINGLE:
+ case SdlPacket.FRAME_TYPE_CONSECUTIVE:
+ break;
+ case SdlPacket.FRAME_TYPE_CONTROL:
+ //Ok, well here's some interesting bit of knowledge. Because the start session request is from the phone with no knowledge of version it sends out
+ //a v1 packet. THEREFORE there is no message id field. **** Now you know and knowing is half the battle ****
+ if(version==1 && controlFrameInfo == SdlPacket.FRAME_INFO_START_SERVICE){
+ if(dataLength==0){
+ return FINISHED_STATE; //We are done if we don't have any payload
+ }
+ if(dataLength <= V1_V2_MTU_SIZE - V1_HEADER_SIZE){ // sizes from protocol/WiProProtocol.java
+ payload = new byte[dataLength];
+ }else{
+ return ERROR_STATE;
+ }
+ dumpSize = dataLength;
+ return DATA_PUMP_STATE;
+ }
+ break;
+
+ case SdlPacket.FRAME_TYPE_FIRST:
+ if(dataLength==FIRST_FRAME_DATA_SIZE){
+ break;
+ }
+ default:
+ return ERROR_STATE;
+ }
+ if(version==1){ //Version 1 packets will not have message id's
+ if(dataLength == 0){
+ return FINISHED_STATE; //We are done if we don't have any payload
+ }
+ if(dataLength <= V1_V2_MTU_SIZE - V1_HEADER_SIZE){ // sizes from protocol/WiProProtocol.java
+ payload = new byte[dataLength];
+ }else{
+ return ERROR_STATE;
+ }
+ dumpSize = dataLength;
+ return DATA_PUMP_STATE;
+ }else{
+ return MESSAGE_1_STATE;
+ }
+
+ case MESSAGE_1_STATE:
+ messageId += ((int)(rawByte& 0xFF))<<24; //3 bytes x 8 bits
+ return MESSAGE_2_STATE;
+
+ case MESSAGE_2_STATE:
+ messageId += ((int)(rawByte& 0xFF))<<16; //2 bytes x 8 bits
+ return MESSAGE_3_STATE;
+
+ case MESSAGE_3_STATE:
+ messageId += ((int)(rawByte& 0xFF))<<8; //1 byte x 8 bits
+ return MESSAGE_4_STATE;
+
+ case MESSAGE_4_STATE:
+ messageId+=((int)rawByte) & 0xFF;
+
+ if(dataLength==0){
+ return FINISHED_STATE; //We are done if we don't have any payload
+ }
+ try{
+ payload = new byte[dataLength];
+ }catch(OutOfMemoryError oom){
+ return ERROR_STATE;
+ }
+ dumpSize = dataLength;
+ return DATA_PUMP_STATE;
+
+ case DATA_PUMP_STATE:
+ payload[dataLength-dumpSize] = rawByte;
+ dumpSize--;
+ //Do we have any more bytes to read in?
+ if(dumpSize>0){
+ return DATA_PUMP_STATE;
+ }
+ else if(dumpSize==0){
+ return FINISHED_STATE;
+ }else{
+ return ERROR_STATE;
+ }
+ case FINISHED_STATE: //We shouldn't be here...Should have been reset
+ default:
+ return ERROR_STATE;
+
+ }
+
+ }
+
+ public SdlPacket getFormedPacket(){
+ if(state==FINISHED_STATE){
+ //Log.trace(TAG, "Finished packet.");
+ return new SdlPacket(version, compression, frameType,
+ serviceType, controlFrameInfo, sessionId,
+ dataLength, messageId, payload);
+ }else{
+ return null;
+ }
+ }
+
+ public int getState() {
+ return state;
+ }
+
+ public void reset() {
+ version = 0;
+ state = START_STATE;
+ messageId = 0;
+ dataLength = 0;
+ frameType = 0x00; //Set it to null
+ payload = null;
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/SiphonServer.java b/base/src/main/java/com/smartdevicelink/transport/SiphonServer.java
new file mode 100644
index 000000000..c7c749cb2
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/SiphonServer.java
@@ -0,0 +1,416 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.util.BitConverter;
+import com.smartdevicelink.util.DebugTool;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.BindException;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+public class SiphonServer {
+ // Prohibit use of no-arg ctor
+ private SiphonServer() {}
+
+ enum SiphonDataType {
+ fromSdl,
+ fromApp,
+ appLog,
+ formattedTrace,
+ baselineTimeStamp,
+ traceSettings
+ }
+
+ // Boolean to enable/disable the siphon
+ private static Boolean m_siphonEnabled = false;
+
+ // Boolean to determine if the siphon has been initialized
+ private static Boolean m_siphonInitialized = false;
+ private static Boolean m_foundOpenSocket = false;
+ private static Socket m_siphonSocket = null;
+ private static Object m_siphonLock = new Object();
+ private static ServerSocket m_listeningSocket = null;
+ private static short m_listenPort = -1;
+ private static OutputStream m_siphonSocketOutputStream = null;
+ private static SiphonServerThread m_siphonClientThread = null;
+
+ // Initial timestamp in MS
+ private static long m_startTimeStamp = 0;
+
+ // SDL Trace Message Version
+ private static byte m_sdlTraceMsgVersionNumber = 1;
+
+ // Max number of ports to attempt a connection on
+ private final static Integer MAX_NUMBER_OF_PORT_ATTEMPTS = 20;
+
+ // Starting port for future port attempts
+ private final static short FIRST_PORT_TO_ATTEMPT_CONNECTION = 7474;
+
+ // Boolean to determine if formatted trace is being sent
+ private static Boolean m_sendingFormattedTrace = false;
+
+ public static short enableSiphonServer() {
+ m_siphonEnabled = true;
+ SiphonServer.init();
+ return m_listenPort;
+ }
+
+ public static Boolean getSiphonEnabledStatus() {
+ return m_siphonEnabled;
+ }
+
+ public static short disableSiphonServer() {
+ if (!m_siphonEnabled) {
+ m_listenPort = -1;
+ } else {
+ m_siphonEnabled = false;
+ }
+
+ m_siphonInitialized = false;
+
+ try {
+ SiphonServer.closeServer();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return m_listenPort;
+ }
+
+ public static boolean init() {
+ // Only initialize if the siphon has not been initialized previously
+
+ // Check here to be lean. If true, no need to sdlhronize
+ if (m_siphonInitialized) {
+ return true;
+ }
+
+ synchronized (m_siphonLock) {
+ // To prevent a race condition, re-check m_siphonInitialized inside of sdlhronize block
+ if (!m_siphonInitialized) {
+ if (m_siphonClientThread == null) {
+ // Set current time stamp
+ m_startTimeStamp = System.currentTimeMillis();
+
+ // Start Siphon Thread
+ m_siphonClientThread = new SiphonServerThread();
+ m_siphonClientThread.setName("Siphon");
+ m_siphonClientThread.setDaemon(true);
+ m_foundOpenSocket = m_siphonClientThread.findOpenSocket(FIRST_PORT_TO_ATTEMPT_CONNECTION);
+ m_siphonClientThread.start();
+
+ m_siphonInitialized = true;
+ } // end-if
+ } // end-lock
+ }
+
+ return m_siphonInitialized;
+ } // end-method
+
+ public static void closeServer() throws IOException {
+
+ if (m_siphonClientThread != null) {
+ m_siphonClientThread.halt();
+ m_siphonClientThread = null;
+ }
+
+ if (m_listeningSocket != null) {
+ m_listeningSocket.close();
+ m_listeningSocket = null;
+ }
+
+ if (m_siphonSocket != null) {
+ m_siphonSocket.close();
+ m_siphonSocket = null;
+ }
+
+ if (m_siphonSocketOutputStream != null) {
+ m_siphonSocketOutputStream.close();
+ m_siphonSocketOutputStream = null;
+ }
+ }
+
+ public static Boolean sendBytesFromAPP(byte[] msgBytes, int offset, int length) {
+
+ if (m_sendingFormattedTrace) {
+ return false;
+ }
+
+ return sendSiphonData(SiphonDataType.fromApp, msgBytes, offset, length);
+ } // end-method
+
+ public static Boolean sendBytesFromSDL(byte[] msgBytes, int offset, int length) {
+
+ if (m_sendingFormattedTrace) {
+ return false;
+ }
+
+ return sendSiphonData(SiphonDataType.fromSdl, msgBytes, offset, length);
+ } // end-method
+
+ public static Boolean sendSiphonLogData(String message) {
+
+ if (m_sendingFormattedTrace) {
+ return false;
+ }
+
+ if (message == null || message.length() == 0) {
+ return false;
+ }
+
+ byte messageBytes[] = null;
+ int messageLength = 0;
+
+ try {
+ messageBytes = message.getBytes("UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ return false;
+ }
+
+ messageLength = messageBytes.length;
+ return sendSiphonData(SiphonDataType.appLog, messageBytes, 0, messageLength);
+
+ }
+
+ public static Boolean sendFormattedTraceMessage(String message) {
+
+ if (message == null || message.length() == 0) {
+ return false;
+ }
+
+ byte messageBytes[] = null;
+ int messageLength = 0;
+
+ try {
+ messageBytes = message.getBytes("UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ return false;
+ }
+
+ messageLength = messageBytes.length;
+ if (sendSiphonData(SiphonDataType.formattedTrace, messageBytes, 0, messageLength)) {
+ m_sendingFormattedTrace = true;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private static Boolean sendSiphonData(SiphonDataType direction, byte[] msgBytes, int offset, int length) {
+ byte siphonDataTypeIndicator = 0x00;
+
+ long currentDateTime = System.currentTimeMillis();
+ Integer deltaTimeMills = null;
+
+ deltaTimeMills = (int)(currentDateTime - m_startTimeStamp);
+
+ switch(direction) {
+ case fromSdl:
+ siphonDataTypeIndicator = 0x00;
+ break;
+ case fromApp:
+ siphonDataTypeIndicator = 0x01;
+ break;
+ case appLog:
+ siphonDataTypeIndicator = 0x02;
+ break;
+ case formattedTrace:
+ siphonDataTypeIndicator = 0x03;
+ break;
+ case baselineTimeStamp:
+ siphonDataTypeIndicator = 0x04;
+ break;
+ case traceSettings:
+ siphonDataTypeIndicator = 0x05;
+ break;
+ default:
+ siphonDataTypeIndicator = 0x00;
+ break;
+ }
+
+ // Set high bit to indicate new format
+ siphonDataTypeIndicator = (byte)((byte)0x80 | siphonDataTypeIndicator);
+
+ return sendDataToSiphonSocket(siphonDataTypeIndicator, deltaTimeMills, msgBytes, offset, length);
+ }
+
+ private synchronized static Boolean sendDataToSiphonSocket(byte directionIndicator, Integer timeStamp,
+ byte[] msgBytes, int offset, int length) {
+ if (!m_siphonEnabled) {
+ return false;
+ }
+
+ if (msgBytes == null || length == 0) {
+ return false;
+ }
+
+ OutputStream siphonOutputStream = null;
+
+ synchronized (m_siphonLock) {
+ siphonOutputStream = m_siphonSocketOutputStream;
+ } // end-lock
+
+ if (siphonOutputStream == null) {
+ return false;
+ }
+
+ try {
+ // blobSize = length(of message) + 1(size of direction indicator)
+ // + 1 (size of msgVersionNumber) + 4 (size of timeStamp)
+ int blobSize = length + 1 + 1 + 4;
+
+ siphonOutputStream.write(BitConverter.intToByteArray(blobSize));
+ siphonOutputStream.write(new byte[] {directionIndicator});
+ siphonOutputStream.write(new byte[] {m_sdlTraceMsgVersionNumber});
+ siphonOutputStream.write(intToByteArray(timeStamp));
+ siphonOutputStream.write(msgBytes, offset, length);
+ } catch (Exception ex) {
+ return false;
+ } // end-catch
+
+ return true;
+ } // end-method
+
+ private static class SiphonServerThread extends Thread {
+
+ private Boolean isHalted = false;
+ short listenPort;
+
+ public void halt() {
+ isHalted = true;
+ }
+
+ private boolean findOpenSocket(short port) {
+ // Accept incoming sihpon connection from trace utility.
+ Boolean foundOpenPort = false;
+ listenPort = port;
+
+ // Listen to accept incoming connection from SDL
+ while (!foundOpenPort) {
+ try {
+ m_listeningSocket = new ServerSocket(listenPort);
+ foundOpenPort = true;
+ m_listenPort = listenPort;
+ } catch (BindException ex) {
+ listenPort++;
+ if(listenPort > port + MAX_NUMBER_OF_PORT_ATTEMPTS) {
+ return false;
+ }
+ } catch (IOException e) {
+ return false;
+ }
+ }
+
+ return foundOpenPort;
+ }
+
+ private void startServerOnPort() throws IOException {
+ Socket newSocket = null;
+
+ // Wait for a connection
+ newSocket = m_listeningSocket.accept();
+
+ // If isHalted after accept() delay, return
+ if (isHalted) {
+ return;
+ }
+
+ synchronized (m_siphonLock) {
+ // Reset siphonSocketOutputStream
+ if (m_siphonSocketOutputStream != null) {
+ try {
+ m_siphonSocketOutputStream.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ m_siphonSocketOutputStream = null;
+ }
+
+ // Reset siphonSocket
+ if (m_siphonSocket != null) {
+ try {
+ m_siphonSocket.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ m_siphonSocket = null;
+ }
+
+ // Store the new socket
+ m_siphonSocket = newSocket;
+
+ // Set Socket Options
+ m_siphonSocket.setKeepAlive(true);
+
+ // Get the output stream of the connection
+ m_siphonSocketOutputStream = m_siphonSocket.getOutputStream();
+
+ // Output version number to the Siphon upon connection (version number prepending to logInfo)
+ DebugTool.logInfo("Siphon connected.");
+ } // end-lock
+ } // end-method
+
+ @Override
+ public void run() {
+ try {
+ if (m_foundOpenSocket){
+ while (!isHalted) {
+ startServerOnPort();
+ }
+ }
+ } catch (Exception ex) {
+ // Do nothing
+ } finally {
+ if (m_listeningSocket != null) {
+ try {
+ m_listeningSocket.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ m_listeningSocket = null;
+ }
+ }
+ }
+ }
+
+ private static final byte[] intToByteArray(int value) {
+ return new byte[] {
+ (byte)(value >>> 24),
+ (byte)(value >>> 16),
+ (byte)(value >>> 8),
+ (byte)value};
+ }
+} // end-class \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportCallback.java b/base/src/main/java/com/smartdevicelink/transport/TransportCallback.java
new file mode 100644
index 000000000..551ed9d29
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/TransportCallback.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.protocol.SdlPacket;
+
+/**
+ * This interface is used to receive callbacks from a transport class
+ */
+public interface TransportCallback {
+ void onConnectionEstablished();
+ void onError();
+ void onConnectionTerminated(String reason);
+ void onPacketReceived(SdlPacket packet);
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportConstants.java b/base/src/main/java/com/smartdevicelink/transport/TransportConstants.java
new file mode 100644
index 000000000..016da6e07
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/TransportConstants.java
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+
+/**
+ * These constants are shared between the router service and the SDL base service.
+ * They are defined as strings/actions/values that both of them can understand.
+ * Attempting to use standard HTTP error codes as definitions.
+ * @author Joey Grover
+ *
+ */
+public class TransportConstants {
+ public static final String START_ROUTER_SERVICE_ACTION ="sdl.router.startservice";
+ public static final String ROUTER_SERVICE_ACTION = "com.smartdevicelink.router.service";
+ public static final String FOREGROUND_EXTRA = "foreground";
+
+ public static final String BIND_LOCATION_PACKAGE_NAME_EXTRA = "BIND_LOCATION_PACKAGE_NAME_EXTRA";
+ public static final String BIND_LOCATION_CLASS_NAME_EXTRA = "BIND_LOCATION_CLASS_NAME_EXTRA";
+
+ public static final String ALT_TRANSPORT_RECEIVER = "com.sdl.android.alttransport";
+ public static final String ALT_TRANSPORT_CONNECTION_STATUS_EXTRA = "connection_status";
+ public static final int ALT_TRANSPORT_DISCONNECTED = 0;
+ public static final int ALT_TRANSPORT_CONNECTED = 1;
+ public static final String ALT_TRANSPORT_READ = "read";//Read from the alt transport, goes to the app
+ public static final String ALT_TRANSPORT_WRITE = "write";//Write to the alt transport, comes from the app
+ public static final String ALT_TRANSPORT_ADDRESS_EXTRA = "altTransportAddress";
+
+ public static final String START_ROUTER_SERVICE_SDL_ENABLED_EXTRA = "sdl_enabled";
+ public static final String START_ROUTER_SERVICE_SDL_ENABLED_APP_PACKAGE = "package_name";
+ public static final String START_ROUTER_SERVICE_SDL_ENABLED_CMP_NAME = "component_name";
+ public static final String START_ROUTER_SERVICE_TRANSPORT_CONNECTED = "transport_connected"; //Extra for the transport that just connected
+ public static final String START_ROUTER_SERVICE_SDL_ENABLED_PING = "ping";
+ @Deprecated
+ public static final String FORCE_TRANSPORT_CONNECTED = "force_connect"; //This is legacy, do not refactor this.
+ public static final String ROUTER_SERVICE_VALIDATED = "router_service_validated";
+
+ @Deprecated
+ public static final String REPLY_TO_INTENT_EXTRA = "ReplyAddress";
+ public static final String CONNECT_AS_CLIENT_BOOLEAN_EXTRA = "connectAsClient";
+ public static final String PACKAGE_NAME_STRING = "package.name";
+ public static final String APP_ID_EXTRA = "app.id";//Sent as a Long. This is no longer used
+ public static final String APP_ID_EXTRA_STRING = "app.id.string";
+ public static final String ROUTER_MESSAGING_VERSION = "router.messaging.version";
+
+ public static final String SESSION_ID_EXTRA = "session.id";
+
+ public static final String ENABLE_LEGACY_MODE_EXTRA = "ENABLE_LEGACY_MODE_EXTRA";
+
+ @Deprecated
+ public static final String HARDWARE_DISCONNECTED = "hardware.disconect";
+ public static final String TRANSPORT_DISCONNECTED = "transport.disconect";
+ public static final String HARDWARE_CONNECTED = "hardware.connected";
+ public static final String CURRENT_HARDWARE_CONNECTED = "current.hardware.connected";
+
+ public static final String SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME = "senderintent";
+ public static final String SEND_PACKET_TO_ROUTER_LOCATION_EXTRA_NAME = "routerintent";
+
+
+ public static final String BIND_REQUEST_TYPE_CLIENT = "BIND_REQUEST_TYPE_CLIENT";
+ public static final String BIND_REQUEST_TYPE_ALT_TRANSPORT = "BIND_REQUEST_TYPE_ALT_TRANSPORT";
+ public static final String BIND_REQUEST_TYPE_STATUS = "BIND_REQUEST_TYPE_STATUS";
+ public static final String BIND_REQUEST_TYPE_USB_PROVIDER = "BIND_REQUEST_TYPE_USB_PROVIDER";
+
+
+ public static final String PING_ROUTER_SERVICE_EXTRA = "ping.router.service";
+
+ public static final String SDL_NOTIFICATION_CHANNEL_ID = "sdl_notification_channel";
+ public static final String SDL_NOTIFICATION_CHANNEL_NAME = "SmartDeviceLink";
+
+
+
+
+ /**
+ * This class houses all important router service versions
+ */
+ public class RouterServiceVersions{
+ /**
+ * This version of the router service is when app IDs went from Longs to Strings
+ */
+ public static final int APPID_STRING = 4;
+ }
+
+
+ /*
+ * Alt transport
+ *
+ */
+
+ /**
+ * This will be the response when a hardware connect event comes through from an alt transport.
+ * This is because it only makes sense to register an alt transport when a connection is established with that
+ * transport, not waiting for one.
+ */
+ public static final int ROUTER_REGISTER_ALT_TRANSPORT_RESPONSE = 0x02;
+ public static final int ROUTER_REGISTER_ALT_TRANSPORT_RESPONSE_SUCESS = 0x00;
+ /**
+ * There is already another alt transport connected, so we are unable to register this one
+ */
+ public static final int ROUTER_REGISTER_ALT_TRANSPORT_ALREADY_CONNECTED = 0x01;
+
+ /**
+ * This means the router service is shutting down for some reason. Most likely
+ */
+ public static final int ROUTER_SHUTTING_DOWN_NOTIFICATION = 0x0F;
+
+ /**
+ * There is a newer service to start up, so this one is shutting down
+ */
+ public static final int ROUTER_SHUTTING_DOWN_REASON_NEWER_SERVICE = 0x00;
+
+ /*
+ * Router to Client binding service
+ *
+ */
+
+ //WHATS
+ /**
+ * Command to the service to register a client, receiving callbacks
+ * from the service. The Message's replyTo field must be a Messenger of
+ * the client where callbacks should be sent.
+ */
+ public static final int ROUTER_REGISTER_CLIENT = 0x01;
+ /**
+ * This response message will contain if the registration request was successful or not. If not, the reason will be
+ * great or equal to 1 and be descriptive of why it was denied.
+ */
+ public static final int ROUTER_REGISTER_CLIENT_RESPONSE = 0x02;
+ //Response arguments
+ public static final int REGISTRATION_RESPONSE_SUCESS = 0x00;
+ public static final int REGISTRATION_RESPONSE_DENIED_AUTHENTICATION_FAILED = 0x01;
+ public static final int REGISTRATION_RESPONSE_DENIED_NO_CONNECTION = 0x02;
+ public static final int REGISTRATION_RESPONSE_DENIED_APP_ID_NOT_INCLUDED = 0x03;
+ public static final int REGISTRATION_RESPONSE_DENIED_LEGACY_MODE_ENABLED = 0x04;
+ public static final int REGISTRATION_RESPONSE_DENIED_UNKNOWN = 0xFF;
+
+ /**
+ * Command to the service to unregister a client, to stop receiving callbacks
+ * from the service. The Message's replyTo field must be a Messenger of
+ * the client as previously given with MSG_REGISTER_CLIENT. Also include the app id as arg1.
+ */
+ public static final int ROUTER_UNREGISTER_CLIENT = 0x03;
+ public static final int ROUTER_UNREGISTER_CLIENT_RESPONSE = 0x04;
+ //Response arguments
+ public static final int UNREGISTRATION_RESPONSE_SUCESS = 0x00;
+ public static final int UNREGISTRATION_RESPONSE_FAILED_APP_ID_NOT_FOUND = 0x01;
+
+
+ /**
+ * what message type to notify apps of a hardware connection event. The connection event will be placed in the bundle
+ * attached to the message
+ */
+ public static final int HARDWARE_CONNECTION_EVENT = 0x05;
+ public static final int HARDWARE_CONNECTION_EVENT_CONNECTED = 0x10;
+ public static final int HARDWARE_CONNECTION_EVENT_DISCONNECTED = 0x30;
+
+
+ public static final int ROUTER_REQUEST_BT_CLIENT_CONNECT = 0x10;
+ public static final int ROUTER_REQUEST_BT_CLIENT_CONNECT_RESPONSE = 0x11;
+
+ /**
+ * This provides the app with an ability to request another session within the router service.
+ * A replyTo must be provided or else there won't be a response
+ */
+ public static final int ROUTER_REQUEST_NEW_SESSION = 0x12;
+ //Request arguments
+ //See TRANSPORT_TYPE & TRANSPORT_ADDRESS
+
+
+ public static final int ROUTER_REQUEST_NEW_SESSION_RESPONSE = 0x13;
+ //Response arguments
+ public static final int ROUTER_REQUEST_NEW_SESSION_RESPONSE_SUCESS = 0x00;
+ public static final int ROUTER_REQUEST_NEW_SESSION_RESPONSE_FAILED_APP_NOT_FOUND = 0x01;
+ public static final int ROUTER_REQUEST_NEW_SESSION_RESPONSE_FAILED_APP_ID_NOT_INCL = 0x02;
+
+ /**
+ * This provides the app with an ability to request another session within the router service.
+ * A replyTo must be provided or else there won't be a response
+ */
+ public static final int ROUTER_REMOVE_SESSION = 0x14;
+ public static final int ROUTER_REMOVE_SESSION_RESPONSE = 0x15;
+ //Response arguments
+ public static final int ROUTER_REMOVE_SESSION_RESPONSE_SUCESS = 0x00;
+ public static final int ROUTER_REMOVE_SESSION_RESPONSE_FAILED_APP_NOT_FOUND = 0x01;
+ public static final int ROUTER_REMOVE_SESSION_RESPONSE_FAILED_APP_ID_NOT_INCL = 0x02;
+ public static final int ROUTER_REMOVE_SESSION_RESPONSE_FAILED_SESSION_NOT_FOUND = 0x03;
+ public static final int ROUTER_REMOVE_SESSION_RESPONSE_FAILED_SESSION_ID_NOT_INCL = 0x04;
+ /**
+ * Command to have router service to send a packet
+ */
+ public static final int ROUTER_SEND_PACKET = 0x20;
+
+ //response
+ /**
+ * Router has received a packet and sent it to the client
+ */
+ public static final int ROUTER_RECEIVED_PACKET = 0x26;
+ //response
+
+ /**
+ * Command to tell router service details of secondary transport
+ */
+ public static final int ROUTER_REQUEST_SECONDARY_TRANSPORT_CONNECTION = 0x30;
+
+ //BUNDLE EXTRAS
+
+ public static final String FORMED_PACKET_EXTRA_NAME = "packet";
+
+ public static final String BYTES_TO_SEND_EXTRA_NAME = "bytes";
+ public static final String BYTES_TO_SEND_EXTRA_OFFSET = "offset";
+ public static final String BYTES_TO_SEND_EXTRA_COUNT = "count";
+ public static final String BYTES_TO_SEND_FLAGS = "flags";
+
+ public static final String PACKET_PRIORITY_COEFFICIENT = "priority_coefficient";
+
+ public static final String TRANSPORT_TYPE = "transport_type";
+ public static final String TRANSPORT_ADDRESS = "transport_address";
+
+ public static final int BYTES_TO_SEND_FLAG_NONE = 0x00;
+ public static final int BYTES_TO_SEND_FLAG_SDL_PACKET_INCLUDED = 0x01;
+ public static final int BYTES_TO_SEND_FLAG_LARGE_PACKET_START = 0x02;
+ public static final int BYTES_TO_SEND_FLAG_LARGE_PACKET_CONT = 0x04;
+ public static final int BYTES_TO_SEND_FLAG_LARGE_PACKET_END = 0x08;
+
+ public static final String CONNECTED_DEVICE_STRING_EXTRA_NAME = "devicestring";
+
+ public static final int PACKET_SENDING_ERROR_NOT_REGISTERED_APP = 0x00;
+ public static final int PACKET_SENDING_ERROR_NOT_CONNECTED = 0x01;
+ public static final int PACKET_SENDING_ERROR_UKNOWN = 0xFF;
+
+ public static final String ROUTER_SERVICE_VERSION = "router_service_version";
+
+ /**
+ * Status binder
+ */
+
+ public static final int ROUTER_STATUS_CONNECTED_STATE_REQUEST = 0x01;
+ public static final int ROUTER_STATUS_CONNECTED_STATE_RESPONSE = 0x02;
+ /**
+ * This flag when used to check router status will trigger the router service in sending out a ping that if it is connected to a device
+ */
+ public static final int ROUTER_STATUS_FLAG_TRIGGER_PING = 0x02;
+
+
+ /**
+ * Usb Transfer binder
+ */
+
+ public static final int USB_CONNECTED_WITH_DEVICE = 0x55;
+ public static final int ROUTER_USB_ACC_RECEIVED = 0x56;
+
+
+ /**
+ * Multiple-transports related constants
+ *
+ */
+ public static final String IAP_BLUETOOTH = "IAP_BLUETOOTH";
+ public static final String IAP_USB = "IAP_USB";
+ public static final String IAP_USB_HOST_MODE = "TCP_WIFI";
+ public static final String IAP_CARPLAY = "IAP_CARPLAY";
+ public static final String SPP_BLUETOOTH = "SPP_BLUETOOTH";
+ public static final String AOA_USB = "AOA_USB";
+ public static final String TCP_WIFI = "TCP_WIFI";
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportInterface.java b/base/src/main/java/com/smartdevicelink/transport/TransportInterface.java
new file mode 100644
index 000000000..989b2df33
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/TransportInterface.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+/**
+ * This interface defines the basic methods that a transport must implement
+ */
+public interface TransportInterface {
+ void start();
+ void stop();
+ void write(SdlPacket packet);
+ void setCallback(TransportCallback callback);
+ TransportRecord getTransportRecord();
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportManager.java b/base/src/main/java/com/smartdevicelink/transport/TransportManager.java
new file mode 100644
index 000000000..377266e4b
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/TransportManager.java
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2018 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+
+import android.util.Log;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import java.util.Collections;
+import java.util.List;
+
+@SuppressWarnings("unused")
+public class TransportManager extends TransportManagerBase{
+ private static final String TAG = "TransportManager";
+
+ TransportInterface transport;
+
+ /**
+ * Managing transports
+ * List for status of all transports
+ * If transport is not connected. Request Router service connect to it. Get connected message
+ */
+
+ public TransportManager(BaseTransportConfig config, TransportEventListener listener){
+ super(config, listener);
+
+ //Start the new transport
+ switch (config.getTransportType()){
+ case WEB_SOCKET_SERVER:
+ transport = new WebSocketServer((WebSocketServerConfig)config, new SingleTransportCallbackImpl(new TransportRecord(TransportType.WEB_SOCKET_SERVER,"127.0.0.1:"+((WebSocketServerConfig)config).port)));
+ break;
+ case CUSTOM:
+ transport = ((CustomTransportConfig) config).getTransportInterface();
+ transport.setCallback(new SingleTransportCallbackImpl(transport.getTransportRecord()));
+ break;
+ }
+
+ }
+
+ @Override
+ public void start(){
+ if(transport != null){
+ transport.start();
+ }else{
+ System.out.print("Unable to start transport.");
+ }
+ }
+
+ @Override
+ public void close(long sessionId){
+ if(transport != null) {
+ transport.stop();
+ }
+ }
+
+ @Deprecated
+ @Override
+ public void resetSession(){
+
+ }
+
+ /**
+ * Check to see if a transport is connected.
+ * @param transportType the transport to have its connection status returned. If `null` is
+ * passed in, all transports will be checked and if any are connected a
+ * true value will be returned.
+ * @param address the address associated with the transport type. If null, the first transport
+ * of supplied type will be used to return if connected.
+ * @return if a transport is connected based on included variables
+ */
+ @Override
+ public boolean isConnected(TransportType transportType, String address){
+ synchronized (TRANSPORT_STATUS_LOCK) {
+ if (transportType == null) {
+ return !transportStatus.isEmpty();
+ }
+ for (TransportRecord record : transportStatus) {
+ if (record.getType().equals(transportType)) {
+ if (address != null) {
+ if (address.equals(record.getAddress())) {
+ return true;
+ } // Address doesn't match, move forward
+ } else {
+ //If no address is included, assume any transport of correct type is acceptable
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ }
+ /**
+ * Retrieve a transport record with the supplied params
+ * @param transportType the transport to have its connection status returned.
+ * @param address the address associated with the transport type. If null, the first transport
+ * of supplied type will be returned.
+ * @return the transport record for the transport type and address if supplied
+ */
+ @Override
+ public TransportRecord getTransportRecord(TransportType transportType, String address){
+ synchronized (TRANSPORT_STATUS_LOCK) {
+ if (transportType == null) {
+ return null;
+ }
+ for (TransportRecord record : transportStatus) {
+ if (record.getType().equals(transportType)) {
+ if (address != null) {
+ if (address.equals(record.getAddress())) {
+ return record;
+ } // Address doesn't match, move forward
+ } else {
+ //If no address is included, assume any transport of correct type is acceptable
+ return record;
+ }
+ }
+ }
+ return null;
+ }
+ }
+
+
+ @Override
+ public void sendPacket(SdlPacket packet){
+ if(transport !=null){
+ transport.write(packet);
+ }else {
+
+ }
+ }
+
+ class SingleTransportCallbackImpl implements TransportCallback {
+
+ final List<TransportRecord> finalList;
+ final TransportRecord record;
+ protected SingleTransportCallbackImpl(TransportRecord transportRecord){
+ record = transportRecord;
+ finalList = Collections.singletonList(record);
+ }
+
+ @Override
+ public void onConnectionEstablished() {
+ synchronized (TRANSPORT_STATUS_LOCK){
+ transportStatus.clear();
+ transportStatus.addAll(finalList);
+ }
+ transportListener.onTransportConnected(finalList);
+ }
+
+ @Override
+ public void onError() {
+ Log.e(TAG, "Error in the transport manager from the web socket server");
+ if(transportListener != null){
+ transportListener.onError("");
+ }
+ }
+
+ @Override
+ public void onConnectionTerminated(String reason) {
+ if(record != null){
+ Log.d(TAG, "Transport disconnected - " + record);
+ }else{
+ Log.d(TAG, "Transport disconnected");
+
+ }
+
+ synchronized (TRANSPORT_STATUS_LOCK){
+ TransportManager.this.transportStatus.remove(record);
+ //Might check connectedTransports vs transportStatus to ensure they are equal
+ }
+ //Inform the transport listener that a transport has disconnected
+ transportListener.onTransportDisconnected(reason, record, Collections.EMPTY_LIST);
+ }
+
+ @Override
+ public void onPacketReceived(SdlPacket packet) {
+ if(packet!=null){
+ transportListener.onPacketReceived(packet);
+ }
+ }
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java b/base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java
new file mode 100644
index 000000000..bcab4ff58
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.TransportRecord;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public abstract class TransportManagerBase {
+ private static final String TAG = "TransportManagerBase";
+
+ final Object TRANSPORT_STATUS_LOCK;
+
+ final List<TransportRecord> transportStatus;
+ final TransportEventListener transportListener;
+
+ public TransportManagerBase(BaseTransportConfig config,TransportEventListener listener){
+ transportListener = listener;
+ this.TRANSPORT_STATUS_LOCK = new Object();
+ synchronized (TRANSPORT_STATUS_LOCK){
+ this.transportStatus = new ArrayList<>();
+ }
+ }
+
+ public abstract void start();
+
+ public abstract void close(long sessionId);
+
+ @Deprecated
+ public abstract void resetSession();
+
+ /**
+ * Check to see if a transport is connected.
+ * @param transportType the transport to have its connection status returned. If `null` is
+ * passed in, all transports will be checked and if any are connected a
+ * true value will be returned.
+ * @param address the address associated with the transport type. If null, the first transport
+ * of supplied type will be used to return if connected.
+ * @return if a transport is connected based on included variables
+ */
+ public abstract boolean isConnected(TransportType transportType, String address);
+ /**
+ * Retrieve a transport record with the supplied params
+ * @param transportType the transport to have its connection status returned.
+ * @param address the address associated with the transport type. If null, the first transport
+ * of supplied type will be returned.
+ * @return the transport record for the transport type and address if supplied
+ */
+ public abstract TransportRecord getTransportRecord(TransportType transportType, String address);
+
+
+ /**
+ * Retrieves the currently connected transports
+ * @return the currently connected transports
+ */
+ public List<TransportRecord> getConnectedTransports(){
+ return this.transportStatus;
+ }
+
+
+ public boolean isHighBandwidthAvailable(){
+ synchronized (TRANSPORT_STATUS_LOCK) {
+ for (TransportRecord record : transportStatus) {
+ if (record.getType().equals(TransportType.USB)
+ || record.getType().equals(TransportType.TCP)
+ || record.getType().equals(TransportType.WEB_SOCKET_SERVER)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ public BaseTransportConfig updateTransportConfig(BaseTransportConfig config){
+ return config;
+ }
+
+ public abstract void sendPacket(SdlPacket packet);
+
+ /**
+ * Base implementation does nothing and assumes it is not necssary. This method should be
+ * overridden in children classes that need to add a prerequest to their transports to make
+ * space ready for a new session.
+ * @param transportRecord the transport that the new session should be assigned to
+ */
+ public void requestNewSession(TransportRecord transportRecord){
+ //Base implementation does nothing
+ }
+
+ public void requestSecondaryTransportConnection(byte sessionId, TransportRecord transportRecord){
+ //Base implementation does nothing
+ }
+
+ synchronized void enterLegacyMode(final String info){
+ //Base implementation does nothing
+ }
+
+ synchronized void exitLegacyMode(String info ){
+ //Base implementation does nothing
+ }
+
+ public interface TransportEventListener{
+ /** Called to indicate and deliver a packet received from transport */
+ void onPacketReceived(SdlPacket packet);
+
+ /** Called to indicate that transport connection was established */
+ void onTransportConnected(List<TransportRecord> transports);
+
+ /** Called to indicate that transport was disconnected (by either side) */
+ void onTransportDisconnected(String info, TransportRecord type, List<TransportRecord> connectedTransports);
+
+ // Called when the transport manager experiences an unrecoverable failure
+ void onError(String info);
+ /**
+ * Called when the transport manager has determined it needs to move towards a legacy style
+ * transport connection. It will always be bluetooth.
+ * @param info simple info string about the situation
+ * @return if the listener is ok with entering legacy mode
+ */
+ boolean onLegacyModeEnabled(String info);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/WebSocketServer.java b/base/src/main/java/com/smartdevicelink/transport/WebSocketServer.java
new file mode 100644
index 000000000..884afaa9c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/WebSocketServer.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.transport;
+
+import android.util.Log;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.SSLWebSocketFactoryGenerator;
+import com.smartdevicelink.transport.utl.TransportRecord;
+import com.smartdevicelink.util.DebugTool;
+import org.java_websocket.WebSocket;
+import org.java_websocket.WebSocketServerFactory;
+import org.java_websocket.handshake.ClientHandshake;
+
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+
+public class WebSocketServer extends org.java_websocket.server.WebSocketServer implements TransportInterface{
+ private static final String TAG = "WebSocketServer";
+ TransportCallback callback;
+ WebSocketServerConfig config;
+ WebSocket webSocket;
+ SdlPsm psm;
+
+ final TransportRecord transportRecord;
+
+ public WebSocketServer(WebSocketServerConfig config, TransportCallback callback){
+ super((new InetSocketAddress(config.port)));
+
+ this.config = config;
+ this.callback = callback;
+ transportRecord = new TransportRecord(TransportType.WEB_SOCKET_SERVER,"127.0.0.1:" + config.port); //If changed, change in transport manager as well
+ //This will set the connection lost timeout to not occur. So we might ping, but not pong
+ this.setConnectionLostTimeout(config.connectionLostTimeout);
+ if(config.getSslConfig() != null){
+ WebSocketServerFactory factory = SSLWebSocketFactoryGenerator.generateWebSocketServer(config.getSslConfig());
+ if(factory!=null){
+ this.setWebSocketFactory(factory);
+ }else{
+ DebugTool.logError("WebSocketServer: Unable to generate SSL Web Socket Server Factory");
+ }
+ }
+
+ }
+
+ public TransportRecord getTransportRecord(){
+ return this.transportRecord;
+ }
+
+ @Override
+ public void stop(){
+ try {
+ this.stop(500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void write(SdlPacket packet){
+ //Log.i(TAG, "Atttempt to write packet " + packet);
+ if(packet != null
+ && this.webSocket != null
+ && this.webSocket.isOpen()) {
+ this.webSocket.send(packet.constructPacket());
+ }
+
+ }
+
+ @Override
+ public void setCallback(TransportCallback callback) {
+
+ }
+
+ @Override
+ public void onOpen(WebSocket webSocket, ClientHandshake clientHandshake) {
+ Log.i(TAG, "onOpen");
+ this.webSocket = webSocket;
+
+ if(callback!=null){
+ callback.onConnectionEstablished();
+ }
+ }
+
+ @Override
+ public void onClose(WebSocket webSocket, int i, String s, boolean b) {
+ Log.i(TAG, "onClose");
+ try{
+ DebugTool.logInfo("Closing id - " + i);
+ DebugTool.logInfo("Closing string - " + s);
+ DebugTool.logInfo("Closing from remote? " + b);
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+
+ if(callback!=null) {
+ callback.onConnectionTerminated(s);
+ }
+ }
+
+
+ @Override
+ public void onWebsocketCloseInitiated(WebSocket conn, int code, String reason) {
+ super.onWebsocketCloseInitiated(conn, code, reason);
+ try{
+ DebugTool.logInfo("Code - " + code + " Reason - " + reason);
+ }catch (Exception e){}
+ }
+
+ @Override
+ public void onMessage(WebSocket webSocket, String s) {
+ DebugTool.logError("Incorrect message type received, dropping. - String: " + s);
+ }
+
+ @Override
+ public void onMessage(WebSocket conn, ByteBuffer message) {
+ super.onMessage(conn, message);
+ //Log.i(TAG, "on Message - ByteBuffer");
+ byte input;
+
+ if(message != null){
+ synchronized (WebSocketServer.this) {
+ boolean stateProgress;
+ while (message.hasRemaining()) {
+ input = message.get();
+ stateProgress = psm.handleByte(input);
+ if (!stateProgress) {//We are trying to weed through the bad packet info until we get something
+
+ //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
+ psm.reset();
+ }
+
+ if (psm.getState() == SdlPsm.FINISHED_STATE) {
+ synchronized (WebSocketServer.this) {
+ SdlPacket packet = psm.getFormedPacket();
+ if (callback != null && packet != null) {
+ /// Log.i(TAG, "Read a packet: " + packet);
+ packet.setTransportRecord(transportRecord);
+ callback.onPacketReceived(packet);
+ }
+ }
+ //We put a trace statement in the message read so we can avoid all the extra bytes
+ psm.reset();
+ }
+ }
+ }
+
+ }
+
+ }
+
+
+
+ @Override
+ public void onError(WebSocket webSocket, Exception e) {
+ Log.e(TAG, "bad", e);
+ if(callback!=null) {
+ callback.onError();
+ }
+ }
+
+ @Override
+ public void onStart() {
+ Log.i(TAG, "onStart");
+ psm = new SdlPsm();
+
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java b/base/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java
new file mode 100644
index 000000000..6add5ae71
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport;
+
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.transport.utl.SSLConfig;
+
+public class WebSocketServerConfig extends BaseTransportConfig{
+
+ final int port, connectionLostTimeout;
+ SSLConfig sslConfig;
+ /**
+ * Default constructor for WebsocketConfig
+ * @param port the port this web socket should listen on
+ * @param connectionLostTimeout the timeout for a connection lost, default would be 60 seconds. If a value less than
+ * 0 is used, then the websocket will wait indefinitely.
+ */
+ public WebSocketServerConfig(int port, int connectionLostTimeout){
+ this.port = port;
+ this.shareConnection = false;
+ this.connectionLostTimeout = connectionLostTimeout;
+ }
+
+ public SSLConfig getSslConfig() {
+ return sslConfig;
+ }
+
+ public void setSslConfig(SSLConfig sslConfig) {
+ this.sslConfig = sslConfig;
+ }
+
+ @Override
+ public TransportType getTransportType() {
+ return TransportType.WEB_SOCKET_SERVER;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/enums/TransportType.java b/base/src/main/java/com/smartdevicelink/transport/enums/TransportType.java
new file mode 100644
index 000000000..04ae0c033
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/enums/TransportType.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport.enums;
+
+/**
+ * Defines available types of the transports.
+ */
+public enum TransportType {
+ /**
+ * Transport type will be anything the multiplexing service connects to.
+ */
+ MULTIPLEX,
+ /**
+ * Transport type is Bluetooth.
+ */
+ BLUETOOTH,
+
+ /**
+ * Transport type is TCP.
+ */
+ TCP,
+ USB,
+ /**
+ * Used for cloud and embedded
+ */
+ WEB_SOCKET_SERVER,
+
+ /**
+ * This transport is setup to be essentially a proxy to a different transport. It allows a developer to create a
+ * custom transport without much effort.
+ */
+ CUSTOM,
+
+ ;
+
+ public static TransportType valueForString(String value) {
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java b/base/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java
new file mode 100644
index 000000000..ec40dcade
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport.utl;
+
+import android.support.annotation.IntDef;
+import android.support.annotation.NonNull;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.io.File;
+
+public class SSLConfig {
+
+ @IntDef({JKS, PEM})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface SSLCertificateType {}
+ public static final int JKS = 0;
+ public static final int PEM = 1;
+
+
+ final @SSLCertificateType int sslCertificateType;
+ String pemCertificate, privateKey, password;
+ String storePassword, keyPassword;
+ File jksFile;
+
+
+ /**
+ * This creates an SSLConfig using a PEM type certificate.
+ * @param pemCertificate string representation of a PEM file that should be used for the SSL session
+ * @param privateKey the private key used with the PEM file
+ * @param password the password used with the PEN file
+ */
+ public SSLConfig(@NonNull String pemCertificate, @NonNull String privateKey, @NonNull String password){
+ this.sslCertificateType = PEM;
+ this.pemCertificate = pemCertificate;
+ this.privateKey = privateKey;
+ this.password = password;
+ }
+
+
+ /**
+ * This creates an SSLConfig using a JKS file.
+ * @param jksFile File that contains the JKS that should be used for the SSL session
+ * @param storePassword the password associated with the JKS
+ * @param keyPassword the key password used with the JKS
+ */
+ public SSLConfig(@NonNull File jksFile, @NonNull String storePassword, @NonNull String keyPassword){
+ this.sslCertificateType = JKS;
+ this.jksFile = jksFile;
+ this.storePassword = storePassword;
+ this.keyPassword = keyPassword;
+ }
+
+ public @SSLCertificateType int getSslCertificateType() {
+ return sslCertificateType;
+ }
+
+ public String getPemCertificate() {
+ return pemCertificate;
+ }
+
+ public String getPrivateKey() {
+ return privateKey;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+
+ public File getJksFile() {
+ return jksFile;
+ }
+
+ public String getStorePassword() {
+ return storePassword;
+ }
+
+ public String getKeyPassword() {
+ return keyPassword;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java b/base/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java
new file mode 100644
index 000000000..a0bc592f6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.transport.utl;
+
+import com.smartdevicelink.util.DebugTool;
+import org.java_websocket.WebSocketServerFactory;
+import org.java_websocket.server.DefaultSSLWebSocketServerFactory;
+
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+import javax.xml.bind.DatatypeConverter;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.security.KeyFactory;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.PKCS8EncodedKeySpec;
+
+public class SSLWebSocketFactoryGenerator {
+
+ private static final String JAVA_KEY_STORE = "JKS";
+ private static final String TLS = "TLS";
+ private static final String SUNX509 = "SunX509";
+
+ public static WebSocketServerFactory generateWebSocketServer(SSLConfig config){
+ SSLContext context = null;
+ switch (config.getSslCertificateType()){
+ case SSLConfig.JKS:
+ context = getSSLContextFromJKS(config);
+ break;
+ case SSLConfig.PEM:
+ context = getSSLContextFromPem(config);
+ break;
+ default:
+ DebugTool.logError("Unable to generateWebSocketServer. Unsupported cert type.");
+ return null;
+ }
+ if(context != null) {
+ return new DefaultSSLWebSocketServerFactory(context);
+ }else{
+ DebugTool.logError("SSLWebSocketFactoryGenerator: Unable to create SSL Context");
+ return null;
+ }
+ }
+
+/* ******************************************* JKS ********************************************/
+
+ private static SSLContext getSSLContextFromJKS(SSLConfig config){
+
+ try {
+ KeyStore ks = KeyStore.getInstance(JAVA_KEY_STORE);
+ File kf = config.getJksFile();//= new File(PATHNAME + File.separator + KEYSTORE);
+ ks.load(new FileInputStream(kf), config.getStorePassword().toCharArray());
+
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance(SUNX509);
+ kmf.init(ks, config.getKeyPassword().toCharArray());
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance(SUNX509);
+ tmf.init(ks);
+
+ SSLContext sslContext = null;
+ sslContext = SSLContext.getInstance(TLS);
+ sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+ return sslContext;
+ }
+ catch(Exception e){
+ DebugTool.logError("Issue creating SSLContext with JKS : " , e);
+ }
+ return null;
+ }
+
+ /* ******************************************* PEM ********************************************/
+
+ private static SSLContext getSSLContextFromPem(SSLConfig config) {
+ SSLContext context;
+
+ try {
+ context = SSLContext.getInstance( TLS );
+
+ byte[] certBytes = parseDERFromPEM( config.getPemCertificate().getBytes(), "-----BEGIN CERTIFICATE-----", "-----END CERTIFICATE-----" );
+ byte[] keyBytes = parseDERFromPEM( config.getPrivateKey().getBytes(), "-----BEGIN PRIVATE KEY-----", "-----END PRIVATE KEY-----" );
+
+ X509Certificate cert = generateCertificateFromDER( certBytes );
+ RSAPrivateKey key = generatePrivateKeyFromDER( keyBytes );
+
+ KeyStore keystore = KeyStore.getInstance( JAVA_KEY_STORE );
+ keystore.load( null );
+ keystore.setCertificateEntry( "cert-alias", cert );
+ keystore.setKeyEntry( "key-alias", key, config.getPassword().toCharArray(), new Certificate[]{ cert } );
+
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance( SUNX509 );
+ kmf.init( keystore, config.getPassword().toCharArray() );
+
+ KeyManager[] km = kmf.getKeyManagers();
+
+ context.init( km, null, null );
+ } catch ( Exception e ) {
+ context = null;
+ DebugTool.logError("Issue creating SSLContext with PEM Cert : " , e);
+ }
+ return context;
+ }
+
+ private static byte[] parseDERFromPEM( byte[] pem, String beginDelimiter, String endDelimiter ) {
+ String data = new String( pem );
+ String[] tokens = data.split( beginDelimiter );
+ tokens = tokens[1].split( endDelimiter );
+ return DatatypeConverter.parseBase64Binary( tokens[0] );
+ }
+
+ private static RSAPrivateKey generatePrivateKeyFromDER( byte[] keyBytes ) throws InvalidKeySpecException, NoSuchAlgorithmException {
+ PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec( keyBytes );
+
+ KeyFactory factory = KeyFactory.getInstance( "RSA" );
+
+ return ( RSAPrivateKey ) factory.generatePrivate( spec );
+ }
+
+ private static X509Certificate generateCertificateFromDER( byte[] certBytes ) throws CertificateException {
+ CertificateFactory factory = CertificateFactory.getInstance( "X.509" );
+
+ return ( X509Certificate ) factory.generateCertificate( new ByteArrayInputStream( certBytes ) );
+ }
+
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java b/base/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
index bcfc2e373..bcfc2e373 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
+++ b/base/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
diff --git a/base/src/main/java/com/smartdevicelink/util/BitConverter.java b/base/src/main/java/com/smartdevicelink/util/BitConverter.java
new file mode 100644
index 000000000..e300d53ad
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/BitConverter.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+public class BitConverter {
+ /**
+ * @param bytes byte array that will be converted to hex
+ * @return the String containing converted hex values or null if byte array is null
+ */
+ public static String bytesToHex(byte [] bytes) {
+ if (bytes == null) { return null; }
+ return bytesToHex(bytes, 0, bytes.length);
+ } // end-method
+
+ /**
+ * @param bytes byte array that will be converted to hex
+ * @param offset int representing the offset to begin conversion at
+ * @param length int representing number of bytes in array to convert
+ * @return the String containing converted hex values or null if byte array is null
+ */
+ public static String bytesToHex(byte[] bytes, int offset, int length) {
+ if (bytes == null) { return null; }
+ final char[] HexDigits = new char[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+ byte b;
+ char[] hexChars = new char[2 * length];
+ //StringBuffer sb = new StringBuffer();
+ int upperBound = Math.min(bytes.length, (offset + length));
+ int baidx = 0;
+ int sidx = 0;
+ for (baidx = offset; baidx < upperBound; baidx++) {
+ // Get the byte from the array
+ b = bytes[baidx];
+ // Use nibbles as index into hex digit array (left nibble, then right)
+ hexChars[sidx++] = HexDigits[(b & 0xf0) >> 4];
+ hexChars[sidx++] = HexDigits[(b & 0x0f)];
+ } // end-for
+ return new String(hexChars);
+ } // end-method
+
+ /**
+ * @param hexString the String containing converted hex values
+ * @return byte array converted from input String or null if String is null
+ */
+ public static byte [] hexToBytes(String hexString) {
+ if (hexString == null) { return null; }
+ if (hexString.length() % 2 != 0) {
+ hexString = "0" + hexString;
+ }
+ byte [] theBytes = new byte[hexString.length() / 2];
+ for (int i = 0; i < hexString.length(); i += 2) {
+ String byteString = hexString.substring(i, i + 2);
+ byte theByte = (byte)Integer.parseInt(byteString, 16);
+ theBytes[i/2] = theByte;
+ }
+ return theBytes;
+ } // end-method
+
+ public static final byte[] intToByteArray(int value) {
+ return new byte[] {
+ (byte)(value >>> 24),
+ (byte)(value >>> 16),
+ (byte)(value >>> 8),
+ (byte)value};
+ }
+
+ /**
+ * @param sizeBuf byte array that will be converted to int
+ * @return int converted from byte array or -1 if byte array is null
+ */
+ public static int intFromByteArray(byte[] sizeBuf, int offset) {
+ if (sizeBuf == null) { return -1; }
+ int ret = 0;
+ for (int i = offset; i < offset + 4; i++) {
+ ret <<= 8;
+ ret |= 0xFF & sizeBuf[i];
+ }
+ return ret;
+ }
+
+ public static final byte[] shortToByteArray(short value) {
+ return new byte[] {
+ (byte)(value >>> 8),
+ (byte)value};
+ }
+
+ /**
+ * @param sizeBuf byte array that will be converted to short
+ * @return short converted from byte array or -1 if byte array is null
+ */
+ public static short shortFromByteArray(byte[] sizeBuf, int offset) {
+ if (sizeBuf == null) { return -1; }
+ short ret = 0;
+ for (int i = offset; i < offset + 2; i++) {
+ ret <<= 8;
+ ret |= 0xFF & sizeBuf[i];
+ }
+ return ret;
+ }
+
+ /**
+ * Converts the byte array into a string of hex values.
+ * @param bytes byte array that will be converted to hex
+ * @param end EXCLUSIVE so if it it receives 10 it will print 0-9
+ * @return the String containing converted hex values or null if byte array is null
+ */
+ public static String bytesToHex(byte[] bytes,int end){
+ if (bytes == null) { return null; }
+ if(bytes.length<end){
+ end = bytes.length;
+ }
+ StringBuilder sb = new StringBuilder();
+ for(int i=0;i<end;i++){
+ sb.append(" ");
+ sb.append(String.format("%02X ", bytes[i]));
+ }
+ return sb.toString();
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/util/ByteEnumer.java b/base/src/main/java/com/smartdevicelink/util/ByteEnumer.java
new file mode 100644
index 000000000..fe699f7a6
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/ByteEnumer.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+public abstract class ByteEnumer {
+
+ protected ByteEnumer(byte value, String name) {
+ this.value = value;
+ this.name = name;
+ }
+
+ private byte value;
+ private String name;
+
+ public byte getValue() { return value; }
+ public String getName() { return name; }
+
+ public boolean equals(ByteEnumer other) {
+ return name == other.getName();
+ }
+
+ public boolean eq(ByteEnumer other) {
+ return equals(other);
+ }
+
+ public byte value() {
+ return value;
+ }
+
+ public static ByteEnumer get(Vector<?> theList, byte value) {
+ Enumeration<?> enumer = theList.elements();
+ while (enumer.hasMoreElements()) {
+ try {
+ ByteEnumer current = (ByteEnumer)enumer.nextElement();
+ if (current.getValue() == value) {
+ return current;
+ }
+ } catch (ClassCastException e) {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ public static ByteEnumer get(Vector<?> theList, String name) {
+ Enumeration<?> enumer = theList.elements();
+ while (enumer.hasMoreElements()) {
+ try {
+ ByteEnumer current = (ByteEnumer)enumer.nextElement();
+ if (current.getName().equals(name)) {
+ return current;
+ }
+ } catch (ClassCastException e) {
+ return null;
+ }
+ }
+ return null;
+ }
+} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java b/base/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java
new file mode 100644
index 000000000..6c26b046c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class CorrelationIdGenerator {
+
+ private static final int CORRELATION_ID_START = 0;
+
+ private static final AtomicInteger sNextCorrelationId = new AtomicInteger(CORRELATION_ID_START);
+
+ public static int generateId() {
+ for (;;) {
+ final int result = sNextCorrelationId.get();
+ // aapt-generated IDs have the high byte nonzero; clamp to the range under that.
+ int newValue = result + 1;
+
+ if (newValue > 0x00FFFFFF){
+ newValue = CORRELATION_ID_START; // Roll over to 0.
+ }
+ if (sNextCorrelationId.compareAndSet(result, newValue)) {
+ return result;
+ }
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/util/DebugTool.java b/base/src/main/java/com/smartdevicelink/util/DebugTool.java
new file mode 100644
index 000000000..f683c25af
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/DebugTool.java
@@ -0,0 +1,386 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+import android.util.Log;
+
+import com.smartdevicelink.BuildConfig;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.BinaryFrameHeader;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.SdlPacket;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.transport.SiphonServer;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class DebugTool {
+
+
+ public static final String TAG = "SdlProxy";
+
+ private static boolean isErrorEnabled = false;
+ private static boolean isWarningEnabled = false;
+ private static boolean isInfoEnabled = false;
+
+ public static void enableDebugTool() {
+ isErrorEnabled = true;
+ isWarningEnabled = true;
+ isInfoEnabled = true;
+ }
+
+ public static void disableDebugTool() {
+ isErrorEnabled = true;
+ isWarningEnabled = false;
+ isInfoEnabled = false;
+ }
+
+ public static boolean isDebugEnabled()
+ {
+ if (isWarningEnabled && isInfoEnabled) return true;
+
+ return false;
+ }
+
+ private static String prependProxyVersionNumberToString(String string) {
+ if (BuildConfig.VERSION_NAME != null && string != null) {
+ string = BuildConfig.VERSION_NAME + ": " + string;
+ }
+
+ return string;
+ }
+
+ public static void logError(String msg) {
+
+ Boolean wasWritten = false;
+
+ msg = prependProxyVersionNumberToString(msg);
+
+ wasWritten = logToSiphon(msg);
+
+ if (isErrorEnabled && !wasWritten) {
+ NativeLogTool.logError(TAG, msg);
+ }
+ }
+
+ public static void logError(String msg, Throwable ex) {
+ Boolean wasWritten = false;
+
+ msg = prependProxyVersionNumberToString(msg);
+
+ if (ex != null) {
+ wasWritten = logToSiphon(msg + " Exception String: " + ex.toString());
+ } else {
+ wasWritten = logToSiphon(msg);
+ }
+
+ if (isErrorEnabled && !wasWritten) {
+ NativeLogTool.logError(TAG, msg, ex);
+ }
+ }
+
+ public static void logWarning(String msg) {
+ Boolean wasWritten = false;
+
+ msg = prependProxyVersionNumberToString(msg);
+
+ wasWritten = logToSiphon(msg);
+
+ if (isWarningEnabled && !wasWritten) {
+ NativeLogTool.logWarning(TAG, msg);
+ }
+ }
+
+ public static void logInfo(String msg) {
+ Boolean wasWritten = false;
+
+ msg = prependProxyVersionNumberToString(msg);
+
+ wasWritten = logToSiphon(msg);
+
+ if (isInfoEnabled && !wasWritten) {
+ NativeLogTool.logInfo(TAG, msg);
+ }
+ }
+
+ public static void logInfo(String msg, boolean bPrependVersion) {
+ Boolean wasWritten = false;
+
+ if (bPrependVersion) msg = prependProxyVersionNumberToString(msg);
+
+ wasWritten = logToSiphon(msg);
+
+ if (isInfoEnabled && !wasWritten) {
+ NativeLogTool.logInfo(TAG, msg);
+ }
+ }
+
+ protected static Boolean logToSiphon(String msg) {
+ if (SiphonServer.getSiphonEnabledStatus()) {
+ // Initialize the SiphonServer, will be ignored if already initialized
+ SiphonServer.init();
+
+ // Write to the SiphonServer
+ return SiphonServer.sendSiphonLogData(msg);
+ }
+ return false;
+ }
+
+ protected static String getLine(Throwable ex) {
+ if (ex == null) { return null; }
+ String toPrint = ex.toString() + " :" + ex.getMessage();
+ for (int i=0; i<ex.getStackTrace().length; i++) {
+ StackTraceElement elem = ex.getStackTrace()[i];
+ toPrint += "\n " + elem.toString();
+ }
+
+ if (ex instanceof SdlException) {
+ SdlException sdlEx = (SdlException) ex;
+ if (sdlEx.getInnerException() != null && sdlEx != sdlEx.getInnerException()) {
+ toPrint += "\n nested:\n";
+ toPrint += getLine(sdlEx.getInnerException());
+ }
+ }
+
+ return toPrint;
+ }
+
+
+ protected static Vector<IConsole> consoleListenerList = new Vector<IConsole>();
+
+ protected final static boolean isTransportEnabled = false;
+ protected final static boolean isRPCEnabled = false;
+
+ public static void addConsole(IConsole console) {
+ synchronized(consoleListenerList) {
+ consoleListenerList.addElement(console);
+ }
+ }
+
+ public static void removeConsole(IConsole console) {
+ synchronized(consoleListenerList) {
+ consoleListenerList.removeElement(console);
+ }
+ }
+
+ public static void clearConsoles() {
+ synchronized(consoleListenerList) {
+ consoleListenerList.removeAllElements();
+ }
+ }
+
+ public static void logTransport(String msg) {
+ if (isTransportEnabled) {
+ Log.d(TAG, msg);
+ logInfoToConsole(msg);
+ }
+ }
+
+ public static void logRPCSend(String rpcMsg) {
+ if (isRPCEnabled) {
+ Log.d(TAG, "Sending RPC message: " + rpcMsg);
+ logRPCSendToConsole(rpcMsg);
+ }
+ }
+
+ public static void logRPCReceive(String rpcMsg) {
+ if (isRPCEnabled) {
+ Log.d(TAG, "Received RPC message: " + rpcMsg);
+ logRPCSendToConsole(rpcMsg);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected static void logInfoToConsole(String msg) {
+ Vector<IConsole> localList;
+ synchronized(consoleListenerList) {
+ localList = (Vector<IConsole>) consoleListenerList.clone();
+ }
+
+ for (int i = 0; i < localList.size(); i++) {
+ IConsole consoleListener = (IConsole) localList.elementAt(i);
+ try {
+ consoleListener.logInfo(msg);
+ } catch (Exception ex) {
+ Log.e(TAG, "Failure propagating logInfo: " + ex.toString(), ex);
+ } // end-catch
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected static void logErrorToConsole(String msg) {
+ Vector<IConsole> localList;
+ synchronized(consoleListenerList) {
+ localList = (Vector<IConsole>) consoleListenerList.clone();
+ }
+ for (int i = 0; i < localList.size(); i++) {
+ IConsole consoleListener = (IConsole) localList.elementAt(i);
+ try {
+ consoleListener.logError(msg);
+ } catch (Exception ex) {
+ Log.e(TAG, "Failure propagating logError: " + ex.toString(), ex);
+ } // end-catch
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected static void logErrorToConsole(String msg, Throwable e) {
+ Vector<IConsole> localList;
+ synchronized(consoleListenerList) {
+ localList = (Vector<IConsole>) consoleListenerList.clone();
+ }
+
+ for (int i = 0; i < localList.size(); i++) {
+ IConsole consoleListener = (IConsole) localList.elementAt(i);
+ try {
+ consoleListener.logError(msg, e);
+ } catch (Exception ex) {
+ Log.e(TAG, "Failure propagating logError: " + ex.toString(), ex);
+ } // end-catch
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected static void logRPCSendToConsole(String msg) {
+ Vector<IConsole> localList;
+ synchronized(consoleListenerList) {
+ localList = (Vector<IConsole>) consoleListenerList.clone();
+ }
+
+ for (int i = 0; i < localList.size(); i++) {
+ IConsole consoleListener = (IConsole) localList.elementAt(i);
+ try {
+ consoleListener.logRPCSend(msg);
+ } catch (Exception ex) {
+ Log.e(TAG, "Failure propagating logRPCSend: " + ex.toString(), ex);
+ } // end-catch
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected static void logRPCReceiveToConsole(String msg) {
+ Vector<IConsole> localList;
+ synchronized(consoleListenerList) {
+ localList = (Vector<IConsole>) consoleListenerList.clone();
+ }
+
+ for (int i = 0; i < localList.size(); i++) {
+ IConsole consoleListener = (IConsole) localList.elementAt(i);
+ try {
+ consoleListener.logRPCReceive(msg);
+ } catch (Exception ex) {
+ Log.e(TAG, "Failure propagating logRPCReceive: " + ex.toString(), ex);
+ } // end-catch
+ }
+ }
+
+ /**
+ * Debug method to try to extract the RPC hash from the packet payload. Should only be used while debugging, not in production.
+ * Currently it will only handle single frame RPCs
+ * @param packet to inspect
+ * @return The Hashtable to be used to construct an RPC
+ */
+ public static Hashtable<String, Object> getRPCHash(SdlPacket packet){
+ if(packet == null ||
+ packet.getFrameType().getValue() != SdlPacket.FRAME_TYPE_SINGLE ||
+ packet.getServiceType()!=SdlPacket.SERVICE_TYPE_RPC){
+ Log.w("Debug", "Unable to get hash");
+ return null;
+ }
+ int version = packet.getVersion();
+
+ ProtocolMessage message = new ProtocolMessage();
+ SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
+ if (serviceType == SessionType.RPC) {
+ message.setMessageType(MessageType.RPC);
+ } else if (serviceType == SessionType.BULK_DATA) {
+ message.setMessageType(MessageType.BULK);
+ } // end-if
+ message.setSessionType(serviceType);
+ message.setSessionID((byte)packet.getSessionId());
+ //If it is WiPro 2.0 it must have binary header
+ if (version > 1) {
+ BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
+ parseBinaryHeader(packet.getPayload());
+ if(binFrameHeader == null) {
+ return null;
+ }
+ message.setVersion((byte) version);
+ message.setRPCType(binFrameHeader.getRPCType());
+ message.setFunctionID(binFrameHeader.getFunctionID());
+ message.setCorrID(binFrameHeader.getCorrID());
+ if (binFrameHeader.getJsonSize() > 0){
+ message.setData(binFrameHeader.getJsonData());
+ }
+ if (binFrameHeader.getBulkData() != null){
+ message.setBulkData(binFrameHeader.getBulkData());
+ }
+ } else {
+ message.setData(packet.getPayload());
+ }
+ Hashtable<String, Object> hash = new Hashtable<String, Object>();
+ if (packet.getVersion() > 1) {
+ Hashtable<String, Object> hashTemp = new Hashtable<String, Object>();
+
+ hashTemp.put(RPCMessage.KEY_CORRELATION_ID, message.getCorrID());
+ if (message.getJsonSize() > 0) {
+ final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());
+ hashTemp.put(RPCMessage.KEY_PARAMETERS, mhash);
+ }
+
+ String functionName = FunctionID.getFunctionName(message.getFunctionID());
+ if (functionName != null) {
+ hashTemp.put(RPCMessage.KEY_FUNCTION_NAME, functionName);
+ } else {
+ return null;
+ }
+ if (message.getRPCType() == 0x00) {
+ hash.put(RPCMessage.KEY_REQUEST, hashTemp);
+ } else if (message.getRPCType() == 0x01) {
+ hash.put(RPCMessage.KEY_RESPONSE, hashTemp);
+ } else if (message.getRPCType() == 0x02) {
+ hash.put(RPCMessage.KEY_NOTIFICATION, hashTemp);
+ }
+ if (message.getBulkData() != null) hash.put(RPCStruct.KEY_BULK_DATA, message.getBulkData());
+ } else {
+ final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());
+ hash = mhash;
+ }
+ return hash;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/util/FileUtls.java b/base/src/main/java/com/smartdevicelink/util/FileUtls.java
new file mode 100644
index 000000000..b422cbbb4
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/FileUtls.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+import android.support.annotation.NonNull;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.file.Files;
+
+public class FileUtls {
+
+
+
+ public static byte[] getFileData(String file){
+ return getFileData(file,null);
+ }
+
+ public static byte[] getFileData(String filePath, String fileName){
+ if(filePath != null && filePath.length() > 0) {
+ File file;
+ if(fileName != null && fileName.length() > 0 ){
+ file = new File(filePath, fileName);
+ }else{
+ file = new File(filePath);
+ }
+ if (file.exists() && file.isFile() && file.canRead()) {
+ try {
+ return Files.readAllBytes(file.toPath());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public static byte[] downloadFile(@NonNull String urlStr){
+ try {
+ URL url = new URL(urlStr);
+ URLConnection connection = url.openConnection();
+ InputStream inputStream = connection.getInputStream();
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+
+ int nRead;
+ byte[] data = new byte[4096];
+
+ while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
+ buffer.write(data, 0, nRead);
+ }
+ return buffer.toByteArray();
+ }catch (Exception e){
+ DebugTool.logError("Unable to download file - " + urlStr, e);
+ return null;
+ }
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/util/HttpRequestTask.java b/base/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
new file mode 100644
index 000000000..09014f954
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+import android.os.AsyncTask;
+import android.util.Log;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+public class HttpRequestTask extends AsyncTask<String, String, String> {
+ private static final String TAG = "Http Request Task";
+
+ public static final String REQUEST_TYPE_POST = "POST";
+ public static final String REQUEST_TYPE_GET = "GET";
+ public static final String REQUEST_TYPE_DELETE = "DELETE";
+
+ HttpRequestTaskCallback cb;
+
+ /**
+ * @param hcb callback for when this task finishes
+ * <br><br><b> - When calling execute, params as followed: </b><br>
+ * 1. Url String<br>
+ * 2. Request type (Defined in this class) REQUEST_TYPE_POST, REQUEST_TYPE_GET, REQUEST_TYPE_DELETE<br>
+ * 3. (Optional) Data to be sent. <br>
+ * 4. (Optional) Content Type Default will be application/json<br>
+ * 5. (Optional) Accept Type default will be application/json
+ *
+ */
+ public HttpRequestTask( HttpRequestTaskCallback hcb){
+ this.cb = hcb;
+ }
+
+ @Override
+ protected String doInBackground(String... params) {
+ int length = params.length;
+ String urlString = params[0];
+ String request_type = params[1];
+
+ //Grab and set data to be written if included
+ String data;
+ if(length>2){
+ data = params[2];
+ }else{
+ data = null;
+ }
+
+ //Grab and set content type for the header if included
+ String contentType;
+ if(length>3){
+ contentType = params[3];
+ }else{
+ contentType = "application/json";
+ }
+ //Grab and set accept type for the header if included
+ String acceptType;
+ if(length>4){
+ acceptType = params[4];
+ }else{
+ acceptType = "application/json";
+ }
+
+ if(urlString == null || request_type == null){
+ Log.e(TAG, "Can't process request, param error");
+ if(cb!=null){
+ cb.httpFailure(-1);
+ cb = null;
+ }
+ return "Error";
+ }
+
+ HttpURLConnection urlConnection = null;
+ BufferedReader reader = null;
+ try {
+ URL url = new URL(urlString);
+ urlConnection = (HttpURLConnection) url.openConnection();
+ urlConnection.setDoOutput(true);
+ urlConnection.setRequestMethod(request_type);
+ urlConnection.setRequestProperty("Content-Type", contentType);
+ urlConnection.setRequestProperty("Accept", acceptType);
+ //If we have data, we should write it out
+ if(data !=null){
+ Writer writer = new BufferedWriter(new OutputStreamWriter(urlConnection.getOutputStream(), "UTF-8"));
+ writer.write(data);
+ writer.close();
+ }
+ InputStream inputStream = urlConnection.getInputStream();
+
+ int responseCode = urlConnection.getResponseCode();
+ if (responseCode == 200) { //Success
+ //input stream
+ StringBuffer buffer = new StringBuffer();
+ if (inputStream == null) {
+ // Nothing to do.
+ if(cb!=null){
+ cb.httpCallComplete(null);
+ cb = null;
+ }
+ return null;
+ }
+ reader = new BufferedReader(new InputStreamReader(inputStream));
+
+ String inputLine;
+ while ((inputLine = reader.readLine()) != null)
+ buffer.append(inputLine + "\n");
+ if (buffer.length() == 0) {
+ // Stream was empty. No point in parsing.
+ if(cb!=null){
+ cb.httpCallComplete(null);
+ cb = null;
+ }
+ return null;
+ }
+ String response = null;
+
+ response = buffer.toString();
+ //send to post execute
+ if(cb!=null){
+ cb.httpCallComplete(response);
+ cb = null;
+ }
+ return response;
+ }else{
+ if(cb!=null){
+ cb.httpFailure(responseCode);
+ cb = null;
+ }
+ Log.e(TAG, "Failed to download file - " + responseCode);
+ return null;
+ }
+
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (NullPointerException e){ // Only to catch error in urlConnection.getOutputStream() - when servers are down
+ e.printStackTrace();
+ urlConnection = null;
+ }
+ finally {
+ if (urlConnection != null) {
+ urlConnection.disconnect();
+ }
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (final IOException e) {
+ Log.e(TAG, "Error closing stream", e);
+ }
+ }
+ if(cb!=null){
+ cb.httpFailure(-1);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Callback interface for HTTP requests.
+ * @author Joey Grover
+ *
+ */
+ public interface HttpRequestTaskCallback{
+ /**
+ * Called when HTTP request is successfully completed.
+ * @param response The response to the HTTP request.
+ */
+ public abstract void httpCallComplete(String response);
+ /**
+ * Called when HTTP request failed.
+ * @param statusCode The HTTP failure code.
+ */
+ public abstract void httpFailure(int statusCode);
+ }
+
+}
diff --git a/base/src/main/java/com/smartdevicelink/util/IConsole.java b/base/src/main/java/com/smartdevicelink/util/IConsole.java
new file mode 100644
index 000000000..de03c57b5
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/IConsole.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+
+public interface IConsole {
+ void logInfo(String msg);
+ void logError(String msg);
+ void logError(String msg, Throwable ex);
+ void logRPCSend(String rpcMsg);
+ void logRPCReceive(String rpcMsg);
+}
diff --git a/base/src/main/java/com/smartdevicelink/util/NativeLogTool.java b/base/src/main/java/com/smartdevicelink/util/NativeLogTool.java
new file mode 100644
index 000000000..3ee00b387
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/NativeLogTool.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+import android.util.Log;
+
+public class NativeLogTool {
+ private static String TAG = "NativeLogTool";
+ static private boolean logToSystemEnabled = true;
+ private static final int ChunkSize = 4000;
+
+ public enum LogTarget {
+ Info
+ ,Warning
+ ,Error;
+
+ public static LogTarget valueForString (String value) {
+ try{
+ return valueOf(value);
+ } catch(Exception e) {
+ return null;
+ }
+ }
+ }
+
+ public static void setEnableState(boolean en) {
+ logToSystemEnabled = en;
+ } // end-method
+
+ public static boolean isEnabled() {
+ return logToSystemEnabled;
+ } // end-method
+
+ public static boolean logInfo(String message) {
+ return logInfo(TAG, message);
+ }
+
+ public static boolean logInfo(String tag, String message) {
+ if (logToSystemEnabled) {
+ return log(LogTarget.Info, tag, message);
+ }
+ return false;
+ }
+
+ public static boolean logWarning(String message) {
+ return logWarning(TAG, message);
+ }
+
+ public static boolean logWarning(String tag, String message) {
+ if (logToSystemEnabled) {
+ return log(LogTarget.Warning, tag, message);
+ }
+ return false;
+ }
+
+ public static boolean logError(String message) {
+ return logError(TAG, message);
+ }
+
+ public static boolean logError(String tag, String message) {
+ if (logToSystemEnabled) {
+ return log(LogTarget.Error, tag, message);
+ }
+ return false;
+ }
+
+ public static boolean logError(String message, Throwable t) {
+ return logError(TAG, message, t);
+ }
+
+ public static boolean logError(String tag, String message, Throwable t) {
+ // If the call to logError is passed a throwable, write directly to the system log
+ if (logToSystemEnabled) {
+ Log.e(tag, message, t);
+ }
+ return logToSystemEnabled;
+ }
+
+ private static boolean log(LogTarget ltarg, String source, String logMsg) {
+ // Don't log empty messages
+ if (logMsg == null || logMsg.length() == 0) {
+ return false;
+ }
+
+ int bytesWritten = 0;
+ int substrSize = 0;
+ String tag = source;
+ String chunk = null;
+ try {
+ for (int idx=0;idx < logMsg.length();idx += substrSize) {
+ substrSize = Math.min(ChunkSize, logMsg.length() - idx);
+ chunk = logMsg.substring(idx, idx + substrSize);
+ switch (ltarg) {
+ case Info:
+ bytesWritten = Log.i(tag, chunk);
+ break;
+ case Warning:
+ bytesWritten = Log.w(tag, chunk);
+ break;
+ case Error:
+ bytesWritten = Log.e(tag, chunk);
+ break;
+ }
+ if (bytesWritten < chunk.length()) {
+ Log.e(TAG, "Calling Log.e: msg length=" + chunk.length() + ", bytesWritten=" + bytesWritten);
+ }
+ }
+ } catch (Exception ex) {
+ Log.e(TAG, "Failure writing " + ltarg.name() + " fragments to android log:" + ex.toString());
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java b/base/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java
new file mode 100644
index 000000000..b2fe1d2c1
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+/**
+ * This is a utility class to aid in handling values stored in the RPC classes.
+ */
+public class SdlDataTypeConverter {
+
+ /**
+ * Converts values that are retrieved from an RPC parameters Hashtable as an
+ * Object into the standard number value of the mobile API, Double.
+ *
+ * @param originalValue The value retrieved from an RPC parameters Hashtable.
+ * @return The Double representation of an integer or double value stored in
+ * the Object, or null if the value could not be converted.
+ */
+ public static Double objectToDouble(Object originalValue) {
+
+ if (originalValue == null) {
+ return null;
+ }
+
+ Double result = null;
+
+ // Uses reflection to determine if the object is a valid type.
+ if (originalValue instanceof Integer) {
+ result = ((Integer) originalValue).doubleValue();
+ } else if (originalValue instanceof Float){
+ result = ((Float) originalValue).doubleValue();
+ } else if (originalValue instanceof Double){
+ result = (Double) originalValue;
+ }
+
+ return result;
+ }
+
+ /**
+ * Converts values that are retrieved from an RPC parameters Hashtable as an
+ * Object into the standard number value of the mobile API, Float.
+ *
+ * @param originalValue The value retrieved from an RPC parameters Hashtable.
+ * @return The Float representation of an integer or float value stored in
+ * the Object, or null if the value could not be converted.
+ */
+ public static Float objectToFloat(Object originalValue) {
+
+ if (originalValue == null) {
+ return null;
+ }
+
+ Float result = null;
+
+ // Uses reflection to determine if the object is a valid type.
+ if (originalValue instanceof Integer) {
+ result = ((Integer) originalValue).floatValue();
+ } else if (originalValue instanceof Double){
+ result = ((Double) originalValue).floatValue();
+ } else if (originalValue instanceof Float){
+ result = (Float) originalValue;
+ }
+
+ return result;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/util/Version.java b/base/src/main/java/com/smartdevicelink/util/Version.java
new file mode 100644
index 000000000..7ba0e026c
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/util/Version.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2019, Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.util;
+
+
+public class Version {
+
+ final int major,minor,patch;
+
+ public Version(){
+ major = 0;
+ minor = 0;
+ 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){
+ throw new IllegalArgumentException("Incorrect version string format");
+ }
+ major = Integer.valueOf(versions[0]);
+ minor = Integer.valueOf(versions[1]);
+ patch = Integer.valueOf(versions[2]);
+
+ }
+
+ public int getMajor() {
+ return major;
+ }
+
+ public int getMinor() {
+ return minor;
+ }
+
+ public int getPatch() {
+ return patch;
+ }
+
+ /**
+ * Method to test if this instance of Version is newer than the supplied one.
+ * @param version the version to check against
+ * @return 1 if this instance is newer, -1 if supplied version is newer, and 0 if they are equal
+ */
+ public int isNewerThan(Version version){
+ if(this.major > version.major){
+ return 1;
+ }else if(this.major == version.major){
+ if(this.minor > version.minor){
+ return 1;
+ } else if(this.minor == version.minor){
+ if(this.patch > version.patch){
+ return 1;
+ }else if(this.patch == version.patch){
+ return 0;
+ }
+ }
+ }
+ return -1;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append(major);
+ builder.append(".");
+ builder.append(minor);
+ builder.append(".");
+ builder.append(patch);
+ return builder.toString();
+ }
+}
diff --git a/base/src/main/java/org/json/JSON.java b/base/src/main/java/org/json/JSON.java
new file mode 100644
index 000000000..1b32e698d
--- /dev/null
+++ b/base/src/main/java/org/json/JSON.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.json;
+
+class JSON {
+ /**
+ * Returns the input if it is a JSON-permissible value; throws otherwise.
+ */
+ static double checkDouble(double d) throws JSONException {
+ if (Double.isInfinite(d) || Double.isNaN(d)) {
+ throw new JSONException("Forbidden numeric value: " + d);
+ }
+ return d;
+ }
+
+ static Boolean toBoolean(Object value) {
+ if (value instanceof Boolean) {
+ return (Boolean) value;
+ } else if (value instanceof String) {
+ String stringValue = (String) value;
+ if ("true".equalsIgnoreCase(stringValue)) {
+ return true;
+ } else if ("false".equalsIgnoreCase(stringValue)) {
+ return false;
+ }
+ }
+ return null;
+ }
+
+ static Double toDouble(Object value) {
+ if (value instanceof Double) {
+ return (Double) value;
+ } else if (value instanceof Number) {
+ return ((Number) value).doubleValue();
+ } else if (value instanceof String) {
+ try {
+ return Double.valueOf((String) value);
+ } catch (NumberFormatException ignored) {
+ }
+ }
+ return null;
+ }
+
+ static Integer toInteger(Object value) {
+ if (value instanceof Integer) {
+ return (Integer) value;
+ } else if (value instanceof Number) {
+ return ((Number) value).intValue();
+ } else if (value instanceof String) {
+ try {
+ return (int) Double.parseDouble((String) value);
+ } catch (NumberFormatException ignored) {
+ }
+ }
+ return null;
+ }
+
+ static Long toLong(Object value) {
+ if (value instanceof Long) {
+ return (Long) value;
+ } else if (value instanceof Number) {
+ return ((Number) value).longValue();
+ } else if (value instanceof String) {
+ try {
+ return (long) Double.parseDouble((String) value);
+ } catch (NumberFormatException ignored) {
+ }
+ }
+ return null;
+ }
+
+ static String toString(Object value) {
+ if (value instanceof String) {
+ return (String) value;
+ } else if (value != null) {
+ return String.valueOf(value);
+ }
+ return null;
+ }
+
+ public static JSONException typeMismatch(Object indexOrName, Object actual,
+ String requiredType) throws JSONException {
+ if (actual == null) {
+ throw new JSONException("Value at " + indexOrName + " is null.");
+ } else {
+ throw new JSONException("Value " + actual + " at " + indexOrName
+ + " of type " + actual.getClass().getName()
+ + " cannot be converted to " + requiredType);
+ }
+ }
+
+ public static JSONException typeMismatch(Object actual, String requiredType)
+ throws JSONException {
+ if (actual == null) {
+ throw new JSONException("Value is null.");
+ } else {
+ throw new JSONException("Value " + actual
+ + " of type " + actual.getClass().getName()
+ + " cannot be converted to " + requiredType);
+ }
+ }
+}
diff --git a/base/src/main/java/org/json/JSONArray.java b/base/src/main/java/org/json/JSONArray.java
new file mode 100644
index 000000000..996f44909
--- /dev/null
+++ b/base/src/main/java/org/json/JSONArray.java
@@ -0,0 +1,626 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.json;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+// Note: this class was written without inspecting the non-free org.json sourcecode.
+
+/**
+ * A dense indexed sequence of values. Values may be any mix of
+ * {@link JSONObject JSONObjects}, other {@link JSONArray JSONArrays}, Strings,
+ * Booleans, Integers, Longs, Doubles, {@code null} or {@link JSONObject#NULL}.
+ * Values may not be {@link Double#isNaN() NaNs}, {@link Double#isInfinite()
+ * infinities}, or of any type not listed here.
+ *
+ * <p>{@code JSONArray} has the same type coercion behavior and
+ * optional/mandatory accessors as {@link JSONObject}. See that class'
+ * documentation for details.
+ *
+ * <p><strong>Warning:</strong> this class represents null in two incompatible
+ * ways: the standard Java {@code null} reference, and the sentinel value {@link
+ * JSONObject#NULL}. In particular, {@code get} fails if the requested index
+ * holds the null reference, but succeeds if it holds {@code JSONObject.NULL}.
+ *
+ * <p>Instances of this class are not thread safe. Although this class is
+ * nonfinal, it was not designed for inheritance and should not be subclassed.
+ * In particular, self-use by overridable methods is not specified. See
+ * <i>Effective Java</i> Item 17, "Design and Document or inheritance or else
+ * prohibit it" for further information.
+ */
+public class JSONArray {
+
+ private final List<Object> values;
+
+ /**
+ * Creates a {@code JSONArray} with no values.
+ */
+ public JSONArray() {
+ values = new ArrayList<Object>();
+ }
+
+ /**
+ * Creates a new {@code JSONArray} by copying all values from the given
+ * collection.
+ *
+ * @param copyFrom a collection whose values are of supported types.
+ * Unsupported values are not permitted and will yield an array in an
+ * inconsistent state.
+ */
+ /* Accept a raw type for API compatibility */
+ public JSONArray(Collection copyFrom) {
+ this();
+ if (copyFrom != null) {
+ for (Iterator it = copyFrom.iterator(); it.hasNext();) {
+ put(JSONObject.wrap(it.next()));
+ }
+ }
+ }
+
+ /**
+ * Creates a new {@code JSONArray} with values from the next array in the
+ * tokener.
+ *
+ * @param readFrom a tokener whose nextValue() method will yield a
+ * {@code JSONArray}.
+ * @throws JSONException if the parse fails or doesn't yield a
+ * {@code JSONArray}.
+ */
+ public JSONArray(JSONTokener readFrom) throws JSONException {
+ /*
+ * Getting the parser to populate this could get tricky. Instead, just
+ * parse to temporary JSONArray and then steal the data from that.
+ */
+ Object object = readFrom.nextValue();
+ if (object instanceof JSONArray) {
+ values = ((JSONArray) object).values;
+ } else {
+ throw JSON.typeMismatch(object, "JSONArray");
+ }
+ }
+
+ /**
+ * Creates a new {@code JSONArray} with values from the JSON string.
+ *
+ * @param json a JSON-encoded string containing an array.
+ * @throws JSONException if the parse fails or doesn't yield a {@code
+ * JSONArray}.
+ */
+ public JSONArray(String json) throws JSONException {
+ this(new JSONTokener(json));
+ }
+
+ /**
+ * Creates a new {@code JSONArray} with values from the given primitive array.
+ */
+ public JSONArray(Object array) throws JSONException {
+ if (!array.getClass().isArray()) {
+ throw new JSONException("Not a primitive array: " + array.getClass());
+ }
+ final int length = Array.getLength(array);
+ values = new ArrayList<Object>(length);
+ for (int i = 0; i < length; ++i) {
+ put(JSONObject.wrap(Array.get(array, i)));
+ }
+ }
+
+ /**
+ * Returns the number of values in this array.
+ */
+ public int length() {
+ return values.size();
+ }
+
+ /**
+ * Appends {@code value} to the end of this array.
+ *
+ * @return this array.
+ */
+ public JSONArray put(boolean value) {
+ values.add(value);
+ return this;
+ }
+
+ /**
+ * Appends {@code value} to the end of this array.
+ *
+ * @param value a finite value. May not be {@link Double#isNaN() NaNs} or
+ * {@link Double#isInfinite() infinities}.
+ * @return this array.
+ */
+ public JSONArray put(double value) throws JSONException {
+ values.add(JSON.checkDouble(value));
+ return this;
+ }
+
+ /**
+ * Appends {@code value} to the end of this array.
+ *
+ * @return this array.
+ */
+ public JSONArray put(int value) {
+ values.add(value);
+ return this;
+ }
+
+ /**
+ * Appends {@code value} to the end of this array.
+ *
+ * @return this array.
+ */
+ public JSONArray put(long value) {
+ values.add(value);
+ return this;
+ }
+
+ /**
+ * Appends {@code value} to the end of this array.
+ *
+ * @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean,
+ * Integer, Long, Double, {@link JSONObject#NULL}, or {@code null}. May
+ * not be {@link Double#isNaN() NaNs} or {@link Double#isInfinite()
+ * infinities}. Unsupported values are not permitted and will cause the
+ * array to be in an inconsistent state.
+ * @return this array.
+ */
+ public JSONArray put(Object value) {
+ values.add(value);
+ return this;
+ }
+
+ /**
+ * Same as {@link #put}, with added validity checks.
+ */
+ void checkedPut(Object value) throws JSONException {
+ if (value instanceof Number) {
+ JSON.checkDouble(((Number) value).doubleValue());
+ }
+
+ put(value);
+ }
+
+ /**
+ * Sets the value at {@code index} to {@code value}, null padding this array
+ * to the required length if necessary. If a value already exists at {@code
+ * index}, it will be replaced.
+ *
+ * @return this array.
+ */
+ public JSONArray put(int index, boolean value) throws JSONException {
+ return put(index, (Boolean) value);
+ }
+
+ /**
+ * Sets the value at {@code index} to {@code value}, null padding this array
+ * to the required length if necessary. If a value already exists at {@code
+ * index}, it will be replaced.
+ *
+ * @param value a finite value. May not be {@link Double#isNaN() NaNs} or
+ * {@link Double#isInfinite() infinities}.
+ * @return this array.
+ */
+ public JSONArray put(int index, double value) throws JSONException {
+ return put(index, (Double) value);
+ }
+
+ /**
+ * Sets the value at {@code index} to {@code value}, null padding this array
+ * to the required length if necessary. If a value already exists at {@code
+ * index}, it will be replaced.
+ *
+ * @return this array.
+ */
+ public JSONArray put(int index, int value) throws JSONException {
+ return put(index, (Integer) value);
+ }
+
+ /**
+ * Sets the value at {@code index} to {@code value}, null padding this array
+ * to the required length if necessary. If a value already exists at {@code
+ * index}, it will be replaced.
+ *
+ * @return this array.
+ */
+ public JSONArray put(int index, long value) throws JSONException {
+ return put(index, (Long) value);
+ }
+
+ /**
+ * Sets the value at {@code index} to {@code value}, null padding this array
+ * to the required length if necessary. If a value already exists at {@code
+ * index}, it will be replaced.
+ *
+ * @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean,
+ * Integer, Long, Double, {@link JSONObject#NULL}, or {@code null}. May
+ * not be {@link Double#isNaN() NaNs} or {@link Double#isInfinite()
+ * infinities}.
+ * @return this array.
+ */
+ public JSONArray put(int index, Object value) throws JSONException {
+ if (value instanceof Number) {
+ // deviate from the original by checking all Numbers, not just floats & doubles
+ JSON.checkDouble(((Number) value).doubleValue());
+ }
+ while (values.size() <= index) {
+ values.add(null);
+ }
+ values.set(index, value);
+ return this;
+ }
+
+ /**
+ * Returns true if this array has no value at {@code index}, or if its value
+ * is the {@code null} reference or {@link JSONObject#NULL}.
+ */
+ public boolean isNull(int index) {
+ Object value = opt(index);
+ return value == null || value == JSONObject.NULL;
+ }
+
+ /**
+ * Returns the value at {@code index}.
+ *
+ * @throws JSONException if this array has no value at {@code index}, or if
+ * that value is the {@code null} reference. This method returns
+ * normally if the value is {@code JSONObject#NULL}.
+ */
+ public Object get(int index) throws JSONException {
+ try {
+ Object value = values.get(index);
+ if (value == null) {
+ throw new JSONException("Value at " + index + " is null.");
+ }
+ return value;
+ } catch (IndexOutOfBoundsException e) {
+ throw new JSONException("Index " + index + " out of range [0.." + values.size() + ")", e);
+ }
+ }
+
+ /**
+ * Returns the value at {@code index}, or null if the array has no value
+ * at {@code index}.
+ */
+ public Object opt(int index) {
+ if (index < 0 || index >= values.size()) {
+ return null;
+ }
+ return values.get(index);
+ }
+
+ /**
+ * Removes and returns the value at {@code index}, or null if the array has no value
+ * at {@code index}.
+ */
+ public Object remove(int index) {
+ if (index < 0 || index >= values.size()) {
+ return null;
+ }
+ return values.remove(index);
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a boolean or can
+ * be coerced to a boolean.
+ *
+ * @throws JSONException if the value at {@code index} doesn't exist or
+ * cannot be coerced to a boolean.
+ */
+ public boolean getBoolean(int index) throws JSONException {
+ Object object = get(index);
+ Boolean result = JSON.toBoolean(object);
+ if (result == null) {
+ throw JSON.typeMismatch(index, object, "boolean");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a boolean or can
+ * be coerced to a boolean. Returns false otherwise.
+ */
+ public boolean optBoolean(int index) {
+ return optBoolean(index, false);
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a boolean or can
+ * be coerced to a boolean. Returns {@code fallback} otherwise.
+ */
+ public boolean optBoolean(int index, boolean fallback) {
+ Object object = opt(index);
+ Boolean result = JSON.toBoolean(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a double or can
+ * be coerced to a double.
+ *
+ * @throws JSONException if the value at {@code index} doesn't exist or
+ * cannot be coerced to a double.
+ */
+ public double getDouble(int index) throws JSONException {
+ Object object = get(index);
+ Double result = JSON.toDouble(object);
+ if (result == null) {
+ throw JSON.typeMismatch(index, object, "double");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a double or can
+ * be coerced to a double. Returns {@code NaN} otherwise.
+ */
+ public double optDouble(int index) {
+ return optDouble(index, Double.NaN);
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a double or can
+ * be coerced to a double. Returns {@code fallback} otherwise.
+ */
+ public double optDouble(int index, double fallback) {
+ Object object = opt(index);
+ Double result = JSON.toDouble(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is an int or
+ * can be coerced to an int.
+ *
+ * @throws JSONException if the value at {@code index} doesn't exist or
+ * cannot be coerced to a int.
+ */
+ public int getInt(int index) throws JSONException {
+ Object object = get(index);
+ Integer result = JSON.toInteger(object);
+ if (result == null) {
+ throw JSON.typeMismatch(index, object, "int");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is an int or
+ * can be coerced to an int. Returns 0 otherwise.
+ */
+ public int optInt(int index) {
+ return optInt(index, 0);
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is an int or
+ * can be coerced to an int. Returns {@code fallback} otherwise.
+ */
+ public int optInt(int index, int fallback) {
+ Object object = opt(index);
+ Integer result = JSON.toInteger(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a long or
+ * can be coerced to a long.
+ *
+ * @throws JSONException if the value at {@code index} doesn't exist or
+ * cannot be coerced to a long.
+ */
+ public long getLong(int index) throws JSONException {
+ Object object = get(index);
+ Long result = JSON.toLong(object);
+ if (result == null) {
+ throw JSON.typeMismatch(index, object, "long");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a long or
+ * can be coerced to a long. Returns 0 otherwise.
+ */
+ public long optLong(int index) {
+ return optLong(index, 0L);
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a long or
+ * can be coerced to a long. Returns {@code fallback} otherwise.
+ */
+ public long optLong(int index, long fallback) {
+ Object object = opt(index);
+ Long result = JSON.toLong(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists, coercing it if
+ * necessary.
+ *
+ * @throws JSONException if no such value exists.
+ */
+ public String getString(int index) throws JSONException {
+ Object object = get(index);
+ String result = JSON.toString(object);
+ if (result == null) {
+ throw JSON.typeMismatch(index, object, "String");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists, coercing it if
+ * necessary. Returns the empty string if no such value exists.
+ */
+ public String optString(int index) {
+ return optString(index, "");
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists, coercing it if
+ * necessary. Returns {@code fallback} if no such value exists.
+ */
+ public String optString(int index, String fallback) {
+ Object object = opt(index);
+ String result = JSON.toString(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a {@code
+ * JSONArray}.
+ *
+ * @throws JSONException if the value doesn't exist or is not a {@code
+ * JSONArray}.
+ */
+ public JSONArray getJSONArray(int index) throws JSONException {
+ Object object = get(index);
+ if (object instanceof JSONArray) {
+ return (JSONArray) object;
+ } else {
+ throw JSON.typeMismatch(index, object, "JSONArray");
+ }
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a {@code
+ * JSONArray}. Returns null otherwise.
+ */
+ public JSONArray optJSONArray(int index) {
+ Object object = opt(index);
+ return object instanceof JSONArray ? (JSONArray) object : null;
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a {@code
+ * JSONObject}.
+ *
+ * @throws JSONException if the value doesn't exist or is not a {@code
+ * JSONObject}.
+ */
+ public JSONObject getJSONObject(int index) throws JSONException {
+ Object object = get(index);
+ if (object instanceof JSONObject) {
+ return (JSONObject) object;
+ } else {
+ throw JSON.typeMismatch(index, object, "JSONObject");
+ }
+ }
+
+ /**
+ * Returns the value at {@code index} if it exists and is a {@code
+ * JSONObject}. Returns null otherwise.
+ */
+ public JSONObject optJSONObject(int index) {
+ Object object = opt(index);
+ return object instanceof JSONObject ? (JSONObject) object : null;
+ }
+
+ /**
+ * Returns a new object whose values are the values in this array, and whose
+ * names are the values in {@code names}. Names and values are paired up by
+ * index from 0 through to the shorter array's length. Names that are not
+ * strings will be coerced to strings. This method returns null if either
+ * array is empty.
+ */
+ public JSONObject toJSONObject(JSONArray names) throws JSONException {
+ JSONObject result = new JSONObject();
+ int length = Math.min(names.length(), values.size());
+ if (length == 0) {
+ return null;
+ }
+ for (int i = 0; i < length; i++) {
+ String name = JSON.toString(names.opt(i));
+ result.put(name, opt(i));
+ }
+ return result;
+ }
+
+ /**
+ * Returns a new string by alternating this array's values with {@code
+ * separator}. This array's string values are quoted and have their special
+ * characters escaped. For example, the array containing the strings '12"
+ * pizza', 'taco' and 'soda' joined on '+' returns this:
+ * <pre>"12\" pizza"+"taco"+"soda"</pre>
+ */
+ public String join(String separator) throws JSONException {
+ JSONStringer stringer = new JSONStringer();
+ stringer.open(JSONStringer.Scope.NULL, "");
+ for (int i = 0, size = values.size(); i < size; i++) {
+ if (i > 0) {
+ stringer.out.append(separator);
+ }
+ stringer.value(values.get(i));
+ }
+ stringer.close(JSONStringer.Scope.NULL, JSONStringer.Scope.NULL, "");
+ return stringer.out.toString();
+ }
+
+ /**
+ * Encodes this array as a compact JSON string, such as:
+ * <pre>[94043,90210]</pre>
+ */
+ @Override public String toString() {
+ try {
+ JSONStringer stringer = new JSONStringer();
+ writeTo(stringer);
+ return stringer.toString();
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Encodes this array as a human readable JSON string for debugging, such
+ * as:
+ * <pre>
+ * [
+ * 94043,
+ * 90210
+ * ]</pre>
+ *
+ * @param indentSpaces the number of spaces to indent for each level of
+ * nesting.
+ */
+ public String toString(int indentSpaces) throws JSONException {
+ JSONStringer stringer = new JSONStringer(indentSpaces);
+ writeTo(stringer);
+ return stringer.toString();
+ }
+
+ void writeTo(JSONStringer stringer) throws JSONException {
+ stringer.array();
+ for (Object value : values) {
+ stringer.value(value);
+ }
+ stringer.endArray();
+ }
+
+ @Override public boolean equals(Object o) {
+ return o instanceof JSONArray && ((JSONArray) o).values.equals(values);
+ }
+
+ @Override public int hashCode() {
+ // diverge from the original, which doesn't implement hashCode
+ return values.hashCode();
+ }
+}
diff --git a/base/src/main/java/org/json/JSONException.java b/base/src/main/java/org/json/JSONException.java
new file mode 100644
index 000000000..05e1dddc9
--- /dev/null
+++ b/base/src/main/java/org/json/JSONException.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.json;
+
+// Note: this class was written without inspecting the non-free org.json sourcecode.
+
+/**
+ * Thrown to indicate a problem with the JSON API. Such problems include:
+ * <ul>
+ * <li>Attempts to parse or construct malformed documents
+ * <li>Use of null as a name
+ * <li>Use of numeric types not available to JSON, such as {@link
+ * Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}.
+ * <li>Lookups using an out of range index or nonexistent name
+ * <li>Type mismatches on lookups
+ * </ul>
+ *
+ * <p>Although this is a checked exception, it is rarely recoverable. Most
+ * callers should simply wrap this exception in an unchecked exception and
+ * rethrow:
+ * <pre> public JSONArray toJSONObject() {
+ * try {
+ * JSONObject result = new JSONObject();
+ * ...
+ * } catch (JSONException e) {
+ * throw new RuntimeException(e);
+ * }
+ * }</pre>
+ */
+public class JSONException extends Exception {
+
+ public JSONException(String s) {
+ super(s);
+ }
+
+ public JSONException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public JSONException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/base/src/main/java/org/json/JSONObject.java b/base/src/main/java/org/json/JSONObject.java
new file mode 100644
index 000000000..cebe2fece
--- /dev/null
+++ b/base/src/main/java/org/json/JSONObject.java
@@ -0,0 +1,829 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.json;
+
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+// Note: this class was written without inspecting the non-free org.json sourcecode.
+
+/**
+ * A modifiable set of name/value mappings. Names are unique, non-null strings.
+ * Values may be any mix of {@link JSONObject JSONObjects}, {@link JSONArray
+ * JSONArrays}, Strings, Booleans, Integers, Longs, Doubles or {@link #NULL}.
+ * Values may not be {@code null}, {@link Double#isNaN() NaNs}, {@link
+ * Double#isInfinite() infinities}, or of any type not listed here.
+ *
+ * <p>This class can coerce values to another type when requested.
+ * <ul>
+ * <li>When the requested type is a boolean, strings will be coerced using a
+ * case-insensitive comparison to "true" and "false".
+ * <li>When the requested type is a double, other {@link Number} types will
+ * be coerced using {@link Number#doubleValue() doubleValue}. Strings
+ * that can be coerced using {@link Double#valueOf(String)} will be.
+ * <li>When the requested type is an int, other {@link Number} types will
+ * be coerced using {@link Number#intValue() intValue}. Strings
+ * that can be coerced using {@link Double#valueOf(String)} will be,
+ * and then cast to int.
+ * <li><a name="lossy">When the requested type is a long, other {@link Number} types will
+ * be coerced using {@link Number#longValue() longValue}. Strings
+ * that can be coerced using {@link Double#valueOf(String)} will be,
+ * and then cast to long. This two-step conversion is lossy for very
+ * large values. For example, the string "9223372036854775806" yields the
+ * long 9223372036854775807.</a>
+ * <li>When the requested type is a String, other non-null values will be
+ * coerced using {@link String#valueOf(Object)}. Although null cannot be
+ * coerced, the sentinel value {@link JSONObject#NULL} is coerced to the
+ * string "null".
+ * </ul>
+ *
+ * <p>This class can look up both mandatory and optional values:
+ * <ul>
+ * <li>Use <code>get<i>Type</i>()</code> to retrieve a mandatory value. This
+ * fails with a {@code JSONException} if the requested name has no value
+ * or if the value cannot be coerced to the requested type.
+ * <li>Use <code>opt<i>Type</i>()</code> to retrieve an optional value. This
+ * returns a system- or user-supplied default if the requested name has no
+ * value or if the value cannot be coerced to the requested type.
+ * </ul>
+ *
+ * <p><strong>Warning:</strong> this class represents null in two incompatible
+ * ways: the standard Java {@code null} reference, and the sentinel value {@link
+ * JSONObject#NULL}. In particular, calling {@code put(name, null)} removes the
+ * named entry from the object but {@code put(name, JSONObject.NULL)} stores an
+ * entry whose value is {@code JSONObject.NULL}.
+ *
+ * <p>Instances of this class are not thread safe. Although this class is
+ * nonfinal, it was not designed for inheritance and should not be subclassed.
+ * In particular, self-use by overrideable methods is not specified. See
+ * <i>Effective Java</i> Item 17, "Design and Document or inheritance or else
+ * prohibit it" for further information.
+ */
+public class JSONObject {
+
+ private static final Double NEGATIVE_ZERO = -0d;
+
+ /**
+ * A sentinel value used to explicitly define a name with no value. Unlike
+ * {@code null}, names with this value:
+ * <ul>
+ * <li>show up in the {@link #names} array
+ * <li>show up in the {@link #keys} iterator
+ * <li>return {@code true} for {@link #has(String)}
+ * <li>do not throw on {@link #get(String)}
+ * <li>are included in the encoded JSON string.
+ * </ul>
+ *
+ * <p>This value violates the general contract of {@link Object#equals} by
+ * returning true when compared to {@code null}. Its {@link #toString}
+ * method returns "null".
+ */
+ @NonNull
+ public static final Object NULL = new Object() {
+ @Override public boolean equals(Object o) {
+ return o == this || o == null; // API specifies this broken equals implementation
+ }
+ // at least make the broken equals(null) consistent with Objects.hashCode(null).
+ @Override public int hashCode() { return Objects.hashCode(null); }
+ @Override public String toString() {
+ return "null";
+ }
+ };
+
+
+ private final LinkedHashMap<String, Object> nameValuePairs;
+
+ /**
+ * Creates a {@code JSONObject} with no name/value mappings.
+ */
+ public JSONObject() {
+ nameValuePairs = new LinkedHashMap<String, Object>();
+ }
+
+ /**
+ * Creates a new {@code JSONObject} by copying all name/value mappings from
+ * the given map.
+ *
+ * @param copyFrom a map whose keys are of type {@link String} and whose
+ * values are of supported types.
+ * @throws NullPointerException if any of the map's keys are null.
+ */
+ /* (accept a raw type for API compatibility) */
+ public JSONObject(@NonNull Map copyFrom) {
+ this();
+ Map<?, ?> contentsTyped = (Map<?, ?>) copyFrom;
+ for (Map.Entry<?, ?> entry : contentsTyped.entrySet()) {
+ /*
+ * Deviate from the original by checking that keys are non-null and
+ * of the proper type. (We still defer validating the values).
+ */
+ String key = (String) entry.getKey();
+ if (key == null) {
+ throw new NullPointerException("key == null");
+ }
+ nameValuePairs.put(key, wrap(entry.getValue()));
+ }
+ }
+
+ /**
+ * Creates a new {@code JSONObject} with name/value mappings from the next
+ * object in the tokener.
+ *
+ * @param readFrom a tokener whose nextValue() method will yield a
+ * {@code JSONObject}.
+ * @throws JSONException if the parse fails or doesn't yield a
+ * {@code JSONObject}.
+ */
+ public JSONObject(@NonNull JSONTokener readFrom) throws JSONException {
+ /*
+ * Getting the parser to populate this could get tricky. Instead, just
+ * parse to temporary JSONObject and then steal the data from that.
+ */
+ Object object = readFrom.nextValue();
+ if (object instanceof JSONObject) {
+ this.nameValuePairs = ((JSONObject) object).nameValuePairs;
+ } else {
+ throw JSON.typeMismatch(object, "JSONObject");
+ }
+ }
+
+ /**
+ * Creates a new {@code JSONObject} with name/value mappings from the JSON
+ * string.
+ *
+ * @param json a JSON-encoded string containing an object.
+ * @throws JSONException if the parse fails or doesn't yield a {@code
+ * JSONObject}.
+ */
+ public JSONObject(@NonNull String json) throws JSONException {
+ this(new JSONTokener(json));
+ }
+
+ /**
+ * Creates a new {@code JSONObject} by copying mappings for the listed names
+ * from the given object. Names that aren't present in {@code copyFrom} will
+ * be skipped.
+ */
+ public JSONObject(@NonNull JSONObject copyFrom, @NonNull String [] names) throws JSONException {
+ this();
+ for (String name : names) {
+ Object value = copyFrom.opt(name);
+ if (value != null) {
+ nameValuePairs.put(name, value);
+ }
+ }
+ }
+
+ /**
+ * Returns the number of name/value mappings in this object.
+ */
+ public int length() {
+ return nameValuePairs.size();
+ }
+
+ /**
+ * Maps {@code name} to {@code value}, clobbering any existing name/value
+ * mapping with the same name.
+ *
+ * @return this object.
+ */
+ @NonNull public JSONObject put(@NonNull String name, boolean value) throws JSONException {
+ nameValuePairs.put(checkName(name), value);
+ return this;
+ }
+
+ /**
+ * Maps {@code name} to {@code value}, clobbering any existing name/value
+ * mapping with the same name.
+ *
+ * @param value a finite value. May not be {@link Double#isNaN() NaNs} or
+ * {@link Double#isInfinite() infinities}.
+ * @return this object.
+ */
+ @NonNull public JSONObject put(@NonNull String name, double value) throws JSONException {
+ nameValuePairs.put(checkName(name), JSON.checkDouble(value));
+ return this;
+ }
+
+ /**
+ * Maps {@code name} to {@code value}, clobbering any existing name/value
+ * mapping with the same name.
+ *
+ * @return this object.
+ */
+ @NonNull public JSONObject put(@NonNull String name, int value) throws JSONException {
+ nameValuePairs.put(checkName(name), value);
+ return this;
+ }
+
+ /**
+ * Maps {@code name} to {@code value}, clobbering any existing name/value
+ * mapping with the same name.
+ *
+ * @return this object.
+ */
+ @NonNull public JSONObject put(@NonNull String name, long value) throws JSONException {
+ nameValuePairs.put(checkName(name), value);
+ return this;
+ }
+
+ /**
+ * Maps {@code name} to {@code value}, clobbering any existing name/value
+ * mapping with the same name. If the value is {@code null}, any existing
+ * mapping for {@code name} is removed.
+ *
+ * @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean,
+ * Integer, Long, Double, {@link #NULL}, or {@code null}. May not be
+ * {@link Double#isNaN() NaNs} or {@link Double#isInfinite()
+ * infinities}.
+ * @return this object.
+ */
+ @NonNull public JSONObject put(@NonNull String name, @Nullable Object value) throws JSONException {
+ if (value == null) {
+ nameValuePairs.remove(name);
+ return this;
+ }
+ if (value instanceof Number) {
+ // deviate from the original by checking all Numbers, not just floats & doubles
+ JSON.checkDouble(((Number) value).doubleValue());
+ }
+ nameValuePairs.put(checkName(name), value);
+ return this;
+ }
+
+ /**
+ * Equivalent to {@code put(name, value)} when both parameters are non-null;
+ * does nothing otherwise.
+ */
+ @NonNull public JSONObject putOpt(@Nullable String name, @Nullable Object value) throws JSONException {
+ if (name == null || value == null) {
+ return this;
+ }
+ return put(name, value);
+ }
+
+ /**
+ * Appends {@code value} to the array already mapped to {@code name}. If
+ * this object has no mapping for {@code name}, this inserts a new mapping.
+ * If the mapping exists but its value is not an array, the existing
+ * and new values are inserted in order into a new array which is itself
+ * mapped to {@code name}. In aggregate, this allows values to be added to a
+ * mapping one at a time.
+ *
+ * <p> Note that {@code append(String, Object)} provides better semantics.
+ * In particular, the mapping for {@code name} will <b>always</b> be a
+ * {@link JSONArray}. Using {@code accumulate} will result in either a
+ * {@link JSONArray} or a mapping whose type is the type of {@code value}
+ * depending on the number of calls to it.
+ *
+ * @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean,
+ * Integer, Long, Double, {@link #NULL} or null. May not be {@link
+ * Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}.
+ */
+ // TODO: Change {@code append) to {@link #append} when append is
+ // unhidden.
+ @NonNull public JSONObject accumulate(@NonNull String name, @Nullable Object value) throws JSONException {
+ Object current = nameValuePairs.get(checkName(name));
+ if (current == null) {
+ return put(name, value);
+ }
+
+ if (current instanceof JSONArray) {
+ JSONArray array = (JSONArray) current;
+ array.checkedPut(value);
+ } else {
+ JSONArray array = new JSONArray();
+ array.checkedPut(current);
+ array.checkedPut(value);
+ nameValuePairs.put(name, array);
+ }
+ return this;
+ }
+
+ /**
+ * Appends values to the array mapped to {@code name}. A new {@link JSONArray}
+ * mapping for {@code name} will be inserted if no mapping exists. If the existing
+ * mapping for {@code name} is not a {@link JSONArray}, a {@link JSONException}
+ * will be thrown.
+ *
+ * @throws JSONException if {@code name} is {@code null} or if the mapping for
+ * {@code name} is non-null and is not a {@link JSONArray}.
+ *
+ */
+ public JSONObject append(String name, Object value) throws JSONException {
+ Object current = nameValuePairs.get(checkName(name));
+
+ final JSONArray array;
+ if (current instanceof JSONArray) {
+ array = (JSONArray) current;
+ } else if (current == null) {
+ JSONArray newArray = new JSONArray();
+ nameValuePairs.put(name, newArray);
+ array = newArray;
+ } else {
+ throw new JSONException("Key " + name + " is not a JSONArray");
+ }
+
+ array.checkedPut(value);
+
+ return this;
+ }
+
+ String checkName(String name) throws JSONException {
+ if (name == null) {
+ throw new JSONException("Names must be non-null");
+ }
+ return name;
+ }
+
+ /**
+ * Removes the named mapping if it exists; does nothing otherwise.
+ *
+ * @return the value previously mapped by {@code name}, or null if there was
+ * no such mapping.
+ */
+ @Nullable public Object remove(@Nullable String name) {
+ return nameValuePairs.remove(name);
+ }
+
+ /**
+ * Returns true if this object has no mapping for {@code name} or if it has
+ * a mapping whose value is {@link #NULL}.
+ */
+ public boolean isNull(@Nullable String name) {
+ Object value = nameValuePairs.get(name);
+ return value == null || value == NULL;
+ }
+
+ /**
+ * Returns true if this object has a mapping for {@code name}. The mapping
+ * may be {@link #NULL}.
+ */
+ public boolean has(@Nullable String name) {
+ return nameValuePairs.containsKey(name);
+ }
+
+ /**
+ * Returns the value mapped by {@code name}, or throws if no such mapping exists.
+ *
+ * @throws JSONException if no such mapping exists.
+ */
+ @NonNull public Object get(@NonNull String name) throws JSONException {
+ Object result = nameValuePairs.get(name);
+ if (result == null) {
+ throw new JSONException("No value for " + name);
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value mapped by {@code name}, or null if no such mapping
+ * exists.
+ */
+ @Nullable public Object opt(@Nullable String name) {
+ return nameValuePairs.get(name);
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a boolean or
+ * can be coerced to a boolean, or throws otherwise.
+ *
+ * @throws JSONException if the mapping doesn't exist or cannot be coerced
+ * to a boolean.
+ */
+ public boolean getBoolean(@NonNull String name) throws JSONException {
+ Object object = get(name);
+ Boolean result = JSON.toBoolean(object);
+ if (result == null) {
+ throw JSON.typeMismatch(name, object, "boolean");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a boolean or
+ * can be coerced to a boolean, or false otherwise.
+ */
+ public boolean optBoolean(@Nullable String name) {
+ return optBoolean(name, false);
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a boolean or
+ * can be coerced to a boolean, or {@code fallback} otherwise.
+ */
+ public boolean optBoolean(@Nullable String name, boolean fallback) {
+ Object object = opt(name);
+ Boolean result = JSON.toBoolean(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a double or
+ * can be coerced to a double, or throws otherwise.
+ *
+ * @throws JSONException if the mapping doesn't exist or cannot be coerced
+ * to a double.
+ */
+ public double getDouble(@NonNull String name) throws JSONException {
+ Object object = get(name);
+ Double result = JSON.toDouble(object);
+ if (result == null) {
+ throw JSON.typeMismatch(name, object, "double");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a double or
+ * can be coerced to a double, or {@code NaN} otherwise.
+ */
+ public double optDouble(@Nullable String name) {
+ return optDouble(name, Double.NaN);
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a double or
+ * can be coerced to a double, or {@code fallback} otherwise.
+ */
+ public double optDouble(@Nullable String name, double fallback) {
+ Object object = opt(name);
+ Double result = JSON.toDouble(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is an int or
+ * can be coerced to an int, or throws otherwise.
+ *
+ * @throws JSONException if the mapping doesn't exist or cannot be coerced
+ * to an int.
+ */
+ public int getInt(@NonNull String name) throws JSONException {
+ Object object = get(name);
+ Integer result = JSON.toInteger(object);
+ if (result == null) {
+ throw JSON.typeMismatch(name, object, "int");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is an int or
+ * can be coerced to an int, or 0 otherwise.
+ */
+ public int optInt(@Nullable String name) {
+ return optInt(name, 0);
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is an int or
+ * can be coerced to an int, or {@code fallback} otherwise.
+ */
+ public int optInt(@Nullable String name, int fallback) {
+ Object object = opt(name);
+ Integer result = JSON.toInteger(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a long or
+ * can be coerced to a long, or throws otherwise.
+ * Note that JSON represents numbers as doubles,
+ * so this is <a href="#lossy">lossy</a>; use strings to transfer numbers via JSON.
+ *
+ * @throws JSONException if the mapping doesn't exist or cannot be coerced
+ * to a long.
+ */
+ public long getLong(@NonNull String name) throws JSONException {
+ Object object = get(name);
+ Long result = JSON.toLong(object);
+ if (result == null) {
+ throw JSON.typeMismatch(name, object, "long");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a long or
+ * can be coerced to a long, or 0 otherwise. Note that JSON represents numbers as doubles,
+ * so this is <a href="#lossy">lossy</a>; use strings to transfer numbers via JSON.
+ */
+ public long optLong(@Nullable String name) {
+ return optLong(name, 0L);
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a long or
+ * can be coerced to a long, or {@code fallback} otherwise. Note that JSON represents
+ * numbers as doubles, so this is <a href="#lossy">lossy</a>; use strings to transfer
+ * numbers via JSON.
+ */
+ public long optLong(@Nullable String name, long fallback) {
+ Object object = opt(name);
+ Long result = JSON.toLong(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists, coercing it if
+ * necessary, or throws if no such mapping exists.
+ *
+ * @throws JSONException if no such mapping exists.
+ */
+ @NonNull public String getString(@NonNull String name) throws JSONException {
+ Object object = get(name);
+ String result = JSON.toString(object);
+ if (result == null) {
+ throw JSON.typeMismatch(name, object, "String");
+ }
+ return result;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists, coercing it if
+ * necessary, or the empty string if no such mapping exists.
+ */
+ @NonNull public String optString(@Nullable String name) {
+ return optString(name, "");
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists, coercing it if
+ * necessary, or {@code fallback} if no such mapping exists.
+ */
+ @NonNull public String optString(@Nullable String name, @NonNull String fallback) {
+ Object object = opt(name);
+ String result = JSON.toString(object);
+ return result != null ? result : fallback;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a {@code
+ * JSONArray}, or throws otherwise.
+ *
+ * @throws JSONException if the mapping doesn't exist or is not a {@code
+ * JSONArray}.
+ */
+ @NonNull public JSONArray getJSONArray(@NonNull String name) throws JSONException {
+ Object object = get(name);
+ if (object instanceof JSONArray) {
+ return (JSONArray) object;
+ } else {
+ throw JSON.typeMismatch(name, object, "JSONArray");
+ }
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a {@code
+ * JSONArray}, or null otherwise.
+ */
+ @Nullable public JSONArray optJSONArray(@Nullable String name) {
+ Object object = opt(name);
+ return object instanceof JSONArray ? (JSONArray) object : null;
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a {@code
+ * JSONObject}, or throws otherwise.
+ *
+ * @throws JSONException if the mapping doesn't exist or is not a {@code
+ * JSONObject}.
+ */
+ @NonNull public JSONObject getJSONObject(@NonNull String name) throws JSONException {
+ Object object = get(name);
+ if (object instanceof JSONObject) {
+ return (JSONObject) object;
+ } else {
+ throw JSON.typeMismatch(name, object, "JSONObject");
+ }
+ }
+
+ /**
+ * Returns the value mapped by {@code name} if it exists and is a {@code
+ * JSONObject}, or null otherwise.
+ */
+ @Nullable public JSONObject optJSONObject(@Nullable String name) {
+ Object object = opt(name);
+ return object instanceof JSONObject ? (JSONObject) object : null;
+ }
+
+ /**
+ * Returns an array with the values corresponding to {@code names}. The
+ * array contains null for names that aren't mapped. This method returns
+ * null if {@code names} is either null or empty.
+ */
+ @Nullable public JSONArray toJSONArray(@Nullable JSONArray names) throws JSONException {
+ JSONArray result = new JSONArray();
+ if (names == null) {
+ return null;
+ }
+ int length = names.length();
+ if (length == 0) {
+ return null;
+ }
+ for (int i = 0; i < length; i++) {
+ String name = JSON.toString(names.opt(i));
+ result.put(opt(name));
+ }
+ return result;
+ }
+
+ /**
+ * Returns an iterator of the {@code String} names in this object. The
+ * returned iterator supports {@link Iterator#remove() remove}, which will
+ * remove the corresponding mapping from this object. If this object is
+ * modified after the iterator is returned, the iterator's behavior is
+ * undefined. The order of the keys is undefined.
+ */
+ @NonNull public Iterator<String> keys() {
+ return nameValuePairs.keySet().iterator();
+ }
+
+ /**
+ * Returns the set of {@code String} names in this object. The returned set
+ * is a view of the keys in this object. {@link Set#remove(Object)} will remove
+ * the corresponding mapping from this object and set iterator behaviour
+ * is undefined if this object is modified after it is returned.
+ *
+ * See {@link #keys()}.
+ *
+ */
+ public Set<String> keySet() {
+ return nameValuePairs.keySet();
+ }
+
+ /**
+ * Returns an array containing the string names in this object. This method
+ * returns null if this object contains no mappings.
+ */
+ @Nullable public JSONArray names() {
+ return nameValuePairs.isEmpty()
+ ? null
+ : new JSONArray(new ArrayList<String>(nameValuePairs.keySet()));
+ }
+
+ /**
+ * Encodes this object as a compact JSON string, such as:
+ * <pre>{"query":"Pizza","locations":[94043,90210]}</pre>
+ */
+ @Override @NonNull public String toString() {
+ try {
+ JSONStringer stringer = new JSONStringer();
+ writeTo(stringer);
+ return stringer.toString();
+ } catch (JSONException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Encodes this object as a human readable JSON string for debugging, such
+ * as:
+ * <pre>
+ * {
+ * "query": "Pizza",
+ * "locations": [
+ * 94043,
+ * 90210
+ * ]
+ * }</pre>
+ *
+ * @param indentSpaces the number of spaces to indent for each level of
+ * nesting.
+ */
+ @NonNull public String toString(int indentSpaces) throws JSONException {
+ JSONStringer stringer = new JSONStringer(indentSpaces);
+ writeTo(stringer);
+ return stringer.toString();
+ }
+
+
+ void writeTo(JSONStringer stringer) throws JSONException {
+ stringer.object();
+ for (Map.Entry<String, Object> entry : nameValuePairs.entrySet()) {
+ stringer.key(entry.getKey()).value(entry.getValue());
+ }
+ stringer.endObject();
+ }
+
+ /**
+ * Encodes the number as a JSON string.
+ *
+ * @param number a finite value. May not be {@link Double#isNaN() NaNs} or
+ * {@link Double#isInfinite() infinities}.
+ */
+ @NonNull public static String numberToString(@NonNull Number number) throws JSONException {
+ if (number == null) {
+ throw new JSONException("Number must be non-null");
+ }
+
+ double doubleValue = number.doubleValue();
+ JSON.checkDouble(doubleValue);
+
+ // the original returns "-0" instead of "-0.0" for negative zero
+ if (number.equals(NEGATIVE_ZERO)) {
+ return "-0";
+ }
+
+ long longValue = number.longValue();
+ if (doubleValue == (double) longValue) {
+ return Long.toString(longValue);
+ }
+
+ return number.toString();
+ }
+
+ /**
+ * Encodes {@code data} as a JSON string. This applies quotes and any
+ * necessary character escaping.
+ *
+ * @param data the string to encode. Null will be interpreted as an empty
+ * string.
+ */
+ @NonNull public static String quote(@Nullable String data) {
+ if (data == null) {
+ return "\"\"";
+ }
+ try {
+ JSONStringer stringer = new JSONStringer();
+ stringer.open(JSONStringer.Scope.NULL, "");
+ stringer.value(data);
+ stringer.close(JSONStringer.Scope.NULL, JSONStringer.Scope.NULL, "");
+ return stringer.toString();
+ } catch (JSONException e) {
+ throw new AssertionError();
+ }
+ }
+
+ /**
+ * Wraps the given object if necessary.
+ *
+ * <p>If the object is null or , returns {@link #NULL}.
+ * If the object is a {@code JSONArray} or {@code JSONObject}, no wrapping is necessary.
+ * If the object is {@code NULL}, no wrapping is necessary.
+ * If the object is an array or {@code Collection}, returns an equivalent {@code JSONArray}.
+ * If the object is a {@code Map}, returns an equivalent {@code JSONObject}.
+ * If the object is a primitive wrapper type or {@code String}, returns the object.
+ * Otherwise if the object is from a {@code java} package, returns the result of {@code toString}.
+ * If wrapping fails, returns null.
+ */
+ @Nullable public static Object wrap(@Nullable Object o) {
+ if (o == null) {
+ return NULL;
+ }
+ if (o instanceof JSONArray || o instanceof JSONObject) {
+ return o;
+ }
+ if (o.equals(NULL)) {
+ return o;
+ }
+ try {
+ if (o instanceof Collection) {
+ return new JSONArray((Collection) o);
+ } else if (o.getClass().isArray()) {
+ return new JSONArray(o);
+ }
+ if (o instanceof Map) {
+ return new JSONObject((Map) o);
+ }
+ if (o instanceof Boolean ||
+ o instanceof Byte ||
+ o instanceof Character ||
+ o instanceof Double ||
+ o instanceof Float ||
+ o instanceof Integer ||
+ o instanceof Long ||
+ o instanceof Short ||
+ o instanceof String) {
+ return o;
+ }
+ if (o.getClass().getPackage().getName().startsWith("java.")) {
+ return o.toString();
+ }
+ } catch (Exception ignored) {
+ }
+ return null;
+ }
+}
diff --git a/base/src/main/java/org/json/JSONStringer.java b/base/src/main/java/org/json/JSONStringer.java
new file mode 100644
index 000000000..dd3b2a7d8
--- /dev/null
+++ b/base/src/main/java/org/json/JSONStringer.java
@@ -0,0 +1,432 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.json;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+// Note: this class was written without inspecting the non-free org.json sourcecode.
+
+/**
+ * Implements {@link JSONObject#toString} and {@link JSONArray#toString}. Most
+ * application developers should use those methods directly and disregard this
+ * API. For example:<pre>
+ * JSONObject object = ...
+ * String json = object.toString();</pre>
+ *
+ * <p>Stringers only encode well-formed JSON strings. In particular:
+ * <ul>
+ * <li>The stringer must have exactly one top-level array or object.
+ * <li>Lexical scopes must be balanced: every call to {@link #array} must
+ * have a matching call to {@link #endArray} and every call to {@link
+ * #object} must have a matching call to {@link #endObject}.
+ * <li>Arrays may not contain keys (property names).
+ * <li>Objects must alternate keys (property names) and values.
+ * <li>Values are inserted with either literal {@link #value(Object) value}
+ * calls, or by nesting arrays or objects.
+ * </ul>
+ * Calls that would result in a malformed JSON string will fail with a
+ * {@link JSONException}.
+ *
+ * <p>This class provides no facility for pretty-printing (ie. indenting)
+ * output. To encode indented output, use {@link JSONObject#toString(int)} or
+ * {@link JSONArray#toString(int)}.
+ *
+ * <p>Some implementations of the API support at most 20 levels of nesting.
+ * Attempts to create more than 20 levels of nesting may fail with a {@link
+ * JSONException}.
+ *
+ * <p>Each stringer may be used to encode a single top level value. Instances of
+ * this class are not thread safe. Although this class is nonfinal, it was not
+ * designed for inheritance and should not be subclassed. In particular,
+ * self-use by overrideable methods is not specified. See <i>Effective Java</i>
+ * Item 17, "Design and Document or inheritance or else prohibit it" for further
+ * information.
+ */
+public class JSONStringer {
+
+ /** The output data, containing at most one top-level array or object. */
+ final StringBuilder out = new StringBuilder();
+
+ /**
+ * Lexical scoping elements within this stringer, necessary to insert the
+ * appropriate separator characters (ie. commas and colons) and to detect
+ * nesting errors.
+ */
+ enum Scope {
+
+ /**
+ * An array with no elements requires no separators or newlines before
+ * it is closed.
+ */
+ EMPTY_ARRAY,
+
+ /**
+ * A array with at least one value requires a comma and newline before
+ * the next element.
+ */
+ NONEMPTY_ARRAY,
+
+ /**
+ * An object with no keys or values requires no separators or newlines
+ * before it is closed.
+ */
+ EMPTY_OBJECT,
+
+ /**
+ * An object whose most recent element is a key. The next element must
+ * be a value.
+ */
+ DANGLING_KEY,
+
+ /**
+ * An object with at least one name/value pair requires a comma and
+ * newline before the next element.
+ */
+ NONEMPTY_OBJECT,
+
+ /**
+ * A special bracketless array needed by JSONStringer.join() and
+ * JSONObject.quote() only. Not used for JSON encoding.
+ */
+ NULL,
+ }
+
+ /**
+ * Unlike the original implementation, this stack isn't limited to 20
+ * levels of nesting.
+ */
+ private final List<Scope> stack = new ArrayList<Scope>();
+
+ /**
+ * A string containing a full set of spaces for a single level of
+ * indentation, or null for no pretty printing.
+ */
+ private final String indent;
+
+ public JSONStringer() {
+ indent = null;
+ }
+
+ JSONStringer(int indentSpaces) {
+ char[] indentChars = new char[indentSpaces];
+ Arrays.fill(indentChars, ' ');
+ indent = new String(indentChars);
+ }
+
+ /**
+ * Begins encoding a new array. Each call to this method must be paired with
+ * a call to {@link #endArray}.
+ *
+ * @return this stringer.
+ */
+ public JSONStringer array() throws JSONException {
+ return open(Scope.EMPTY_ARRAY, "[");
+ }
+
+ /**
+ * Ends encoding the current array.
+ *
+ * @return this stringer.
+ */
+ public JSONStringer endArray() throws JSONException {
+ return close(Scope.EMPTY_ARRAY, Scope.NONEMPTY_ARRAY, "]");
+ }
+
+ /**
+ * Begins encoding a new object. Each call to this method must be paired
+ * with a call to {@link #endObject}.
+ *
+ * @return this stringer.
+ */
+ public JSONStringer object() throws JSONException {
+ return open(Scope.EMPTY_OBJECT, "{");
+ }
+
+ /**
+ * Ends encoding the current object.
+ *
+ * @return this stringer.
+ */
+ public JSONStringer endObject() throws JSONException {
+ return close(Scope.EMPTY_OBJECT, Scope.NONEMPTY_OBJECT, "}");
+ }
+
+ /**
+ * Enters a new scope by appending any necessary whitespace and the given
+ * bracket.
+ */
+ JSONStringer open(Scope empty, String openBracket) throws JSONException {
+ if (stack.isEmpty() && out.length() > 0) {
+ throw new JSONException("Nesting problem: multiple top-level roots");
+ }
+ beforeValue();
+ stack.add(empty);
+ out.append(openBracket);
+ return this;
+ }
+
+ /**
+ * Closes the current scope by appending any necessary whitespace and the
+ * given bracket.
+ */
+ JSONStringer close(Scope empty, Scope nonempty, String closeBracket) throws JSONException {
+ Scope context = peek();
+ if (context != nonempty && context != empty) {
+ throw new JSONException("Nesting problem");
+ }
+
+ stack.remove(stack.size() - 1);
+ if (context == nonempty) {
+ newline();
+ }
+ out.append(closeBracket);
+ return this;
+ }
+
+ /**
+ * Returns the value on the top of the stack.
+ */
+ private Scope peek() throws JSONException {
+ if (stack.isEmpty()) {
+ throw new JSONException("Nesting problem");
+ }
+ return stack.get(stack.size() - 1);
+ }
+
+ /**
+ * Replace the value on the top of the stack with the given value.
+ */
+ private void replaceTop(Scope topOfStack) {
+ stack.set(stack.size() - 1, topOfStack);
+ }
+
+ /**
+ * Encodes {@code value}.
+ *
+ * @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean,
+ * Integer, Long, Double or null. May not be {@link Double#isNaN() NaNs}
+ * or {@link Double#isInfinite() infinities}.
+ * @return this stringer.
+ */
+ public JSONStringer value(Object value) throws JSONException {
+ if (stack.isEmpty()) {
+ throw new JSONException("Nesting problem");
+ }
+
+ if (value instanceof JSONArray) {
+ ((JSONArray) value).writeTo(this);
+ return this;
+
+ } else if (value instanceof JSONObject) {
+ ((JSONObject) value).writeTo(this);
+ return this;
+ }
+
+ beforeValue();
+
+ if (value == null
+ || value instanceof Boolean
+ || value == JSONObject.NULL) {
+ out.append(value);
+
+ } else if (value instanceof Number) {
+ out.append(JSONObject.numberToString((Number) value));
+
+ } else {
+ string(value.toString());
+ }
+
+ return this;
+ }
+
+ /**
+ * Encodes {@code value} to this stringer.
+ *
+ * @return this stringer.
+ */
+ public JSONStringer value(boolean value) throws JSONException {
+ if (stack.isEmpty()) {
+ throw new JSONException("Nesting problem");
+ }
+ beforeValue();
+ out.append(value);
+ return this;
+ }
+
+ /**
+ * Encodes {@code value} to this stringer.
+ *
+ * @param value a finite value. May not be {@link Double#isNaN() NaNs} or
+ * {@link Double#isInfinite() infinities}.
+ * @return this stringer.
+ */
+ public JSONStringer value(double value) throws JSONException {
+ if (stack.isEmpty()) {
+ throw new JSONException("Nesting problem");
+ }
+ beforeValue();
+ out.append(JSONObject.numberToString(value));
+ return this;
+ }
+
+ /**
+ * Encodes {@code value} to this stringer.
+ *
+ * @return this stringer.
+ */
+ public JSONStringer value(long value) throws JSONException {
+ if (stack.isEmpty()) {
+ throw new JSONException("Nesting problem");
+ }
+ beforeValue();
+ out.append(value);
+ return this;
+ }
+
+ private void string(String value) {
+ out.append("\"");
+ for (int i = 0, length = value.length(); i < length; i++) {
+ char c = value.charAt(i);
+
+ /*
+ * From RFC 4627, "All Unicode characters may be placed within the
+ * quotation marks except for the characters that must be escaped:
+ * quotation mark, reverse solidus, and the control characters
+ * (U+0000 through U+001F)."
+ */
+ switch (c) {
+ case '"':
+ case '\\':
+ case '/':
+ out.append('\\').append(c);
+ break;
+
+ case '\t':
+ out.append("\\t");
+ break;
+
+ case '\b':
+ out.append("\\b");
+ break;
+
+ case '\n':
+ out.append("\\n");
+ break;
+
+ case '\r':
+ out.append("\\r");
+ break;
+
+ case '\f':
+ out.append("\\f");
+ break;
+
+ default:
+ if (c <= 0x1F) {
+ out.append(String.format("\\u%04x", (int) c));
+ } else {
+ out.append(c);
+ }
+ break;
+ }
+
+ }
+ out.append("\"");
+ }
+
+ private void newline() {
+ if (indent == null) {
+ return;
+ }
+
+ out.append("\n");
+ for (int i = 0; i < stack.size(); i++) {
+ out.append(indent);
+ }
+ }
+
+ /**
+ * Encodes the key (property name) to this stringer.
+ *
+ * @param name the name of the forthcoming value. May not be null.
+ * @return this stringer.
+ */
+ public JSONStringer key(String name) throws JSONException {
+ if (name == null) {
+ throw new JSONException("Names must be non-null");
+ }
+ beforeKey();
+ string(name);
+ return this;
+ }
+
+ /**
+ * Inserts any necessary separators and whitespace before a name. Also
+ * adjusts the stack to expect the key's value.
+ */
+ private void beforeKey() throws JSONException {
+ Scope context = peek();
+ if (context == Scope.NONEMPTY_OBJECT) { // first in object
+ out.append(',');
+ } else if (context != Scope.EMPTY_OBJECT) { // not in an object!
+ throw new JSONException("Nesting problem");
+ }
+ newline();
+ replaceTop(Scope.DANGLING_KEY);
+ }
+
+ /**
+ * Inserts any necessary separators and whitespace before a literal value,
+ * inline array, or inline object. Also adjusts the stack to expect either a
+ * closing bracket or another element.
+ */
+ private void beforeValue() throws JSONException {
+ if (stack.isEmpty()) {
+ return;
+ }
+
+ Scope context = peek();
+ if (context == Scope.EMPTY_ARRAY) { // first in array
+ replaceTop(Scope.NONEMPTY_ARRAY);
+ newline();
+ } else if (context == Scope.NONEMPTY_ARRAY) { // another in array
+ out.append(',');
+ newline();
+ } else if (context == Scope.DANGLING_KEY) { // value for key
+ out.append(indent == null ? ":" : ": ");
+ replaceTop(Scope.NONEMPTY_OBJECT);
+ } else if (context != Scope.NULL) {
+ throw new JSONException("Nesting problem");
+ }
+ }
+
+ /**
+ * Returns the encoded JSON string.
+ *
+ * <p>If invoked with unterminated arrays or unclosed objects, this method's
+ * return value is undefined.
+ *
+ * <p><strong>Warning:</strong> although it contradicts the general contract
+ * of {@link Object#toString}, this method returns null if the stringer
+ * contains no data.
+ */
+ @Override public String toString() {
+ return out.length() == 0 ? null : out.toString();
+ }
+}
diff --git a/base/src/main/java/org/json/JSONTokener.java b/base/src/main/java/org/json/JSONTokener.java
new file mode 100644
index 000000000..4bdd9ad37
--- /dev/null
+++ b/base/src/main/java/org/json/JSONTokener.java
@@ -0,0 +1,611 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.json;
+
+
+// Note: this class was written without inspecting the non-free org.json sourcecode.
+
+/**
+ * Parses a JSON (<a href="http://www.ietf.org/rfc/rfc4627.txt">RFC 4627</a>)
+ * encoded string into the corresponding object. Most clients of
+ * this class will use only need the {@link #JSONTokener(String) constructor}
+ * and {@link #nextValue} method. Example usage: <pre>
+ * String json = "{"
+ * + " \"query\": \"Pizza\", "
+ * + " \"locations\": [ 94043, 90210 ] "
+ * + "}";
+ *
+ * JSONObject object = (JSONObject) new JSONTokener(json).nextValue();
+ * String query = object.getString("query");
+ * JSONArray locations = object.getJSONArray("locations");</pre>
+ *
+ * <p>For best interoperability and performance use JSON that complies with
+ * RFC 4627, such as that generated by {@link JSONStringer}. For legacy reasons
+ * this parser is lenient, so a successful parse does not indicate that the
+ * input string was valid JSON. All of the following syntax errors will be
+ * ignored:
+ * <ul>
+ * <li>End of line comments starting with {@code //} or {@code #} and ending
+ * with a newline character.
+ * <li>C-style comments starting with {@code /*} and ending with
+ * {@code *}{@code /}. Such comments may not be nested.
+ * <li>Strings that are unquoted or {@code 'single quoted'}.
+ * <li>Hexadecimal integers prefixed with {@code 0x} or {@code 0X}.
+ * <li>Octal integers prefixed with {@code 0}.
+ * <li>Array elements separated by {@code ;}.
+ * <li>Unnecessary array separators. These are interpreted as if null was the
+ * omitted value.
+ * <li>Key-value pairs separated by {@code =} or {@code =>}.
+ * <li>Key-value pairs separated by {@code ;}.
+ * </ul>
+ *
+ * <p>Each tokener may be used to parse a single JSON string. Instances of this
+ * class are not thread safe. Although this class is nonfinal, it was not
+ * designed for inheritance and should not be subclassed. In particular,
+ * self-use by overrideable methods is not specified. See <i>Effective Java</i>
+ * Item 17, "Design and Document or inheritance or else prohibit it" for further
+ * information.
+ */
+public class JSONTokener {
+
+ /** The input JSON. */
+ private final String in;
+
+ /**
+ * The index of the next character to be returned by {@link #next}. When
+ * the input is exhausted, this equals the input's length.
+ */
+ private int pos;
+
+ /**
+ * @param in JSON encoded string. Null is not permitted and will yield a
+ * tokener that throws {@code NullPointerExceptions} when methods are
+ * called.
+ */
+ public JSONTokener(String in) {
+ // consume an optional byte order mark (BOM) if it exists
+ if (in != null && in.startsWith("\ufeff")) {
+ in = in.substring(1);
+ }
+ this.in = in;
+ }
+
+ /**
+ * Returns the next value from the input.
+ *
+ * @return a {@link JSONObject}, {@link JSONArray}, String, Boolean,
+ * Integer, Long, Double or {@link JSONObject#NULL}.
+ * @throws JSONException if the input is malformed.
+ */
+ public Object nextValue() throws JSONException {
+ int c = nextCleanInternal();
+ switch (c) {
+ case -1:
+ throw syntaxError("End of input");
+
+ case '{':
+ return readObject();
+
+ case '[':
+ return readArray();
+
+ case '\'':
+ case '"':
+ return nextString((char) c);
+
+ default:
+ pos--;
+ return readLiteral();
+ }
+ }
+
+ private int nextCleanInternal() throws JSONException {
+ while (pos < in.length()) {
+ int c = in.charAt(pos++);
+ switch (c) {
+ case '\t':
+ case ' ':
+ case '\n':
+ case '\r':
+ continue;
+
+ case '/':
+ if (pos == in.length()) {
+ return c;
+ }
+
+ char peek = in.charAt(pos);
+ switch (peek) {
+ case '*':
+ // skip a /* c-style comment */
+ pos++;
+ int commentEnd = in.indexOf("*/", pos);
+ if (commentEnd == -1) {
+ throw syntaxError("Unterminated comment");
+ }
+ pos = commentEnd + 2;
+ continue;
+
+ case '/':
+ // skip a // end-of-line comment
+ pos++;
+ skipToEndOfLine();
+ continue;
+
+ default:
+ return c;
+ }
+
+ case '#':
+ /*
+ * Skip a # hash end-of-line comment. The JSON RFC doesn't
+ * specify this behavior, but it's required to parse
+ * existing documents. See http://b/2571423.
+ */
+ skipToEndOfLine();
+ continue;
+
+ default:
+ return c;
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * Advances the position until after the next newline character. If the line
+ * is terminated by "\r\n", the '\n' must be consumed as whitespace by the
+ * caller.
+ */
+ private void skipToEndOfLine() {
+ for (; pos < in.length(); pos++) {
+ char c = in.charAt(pos);
+ if (c == '\r' || c == '\n') {
+ pos++;
+ break;
+ }
+ }
+ }
+
+ /**
+ * Returns the string up to but not including {@code quote}, unescaping any
+ * character escape sequences encountered along the way. The opening quote
+ * should have already been read. This consumes the closing quote, but does
+ * not include it in the returned string.
+ *
+ * @param quote either ' or ".
+ */
+ public String nextString(char quote) throws JSONException {
+ /*
+ * For strings that are free of escape sequences, we can just extract
+ * the result as a substring of the input. But if we encounter an escape
+ * sequence, we need to use a StringBuilder to compose the result.
+ */
+ StringBuilder builder = null;
+
+ /* the index of the first character not yet appended to the builder. */
+ int start = pos;
+
+ while (pos < in.length()) {
+ int c = in.charAt(pos++);
+ if (c == quote) {
+ if (builder == null) {
+ // a new string avoids leaking memory
+ return new String(in.substring(start, pos - 1));
+ } else {
+ builder.append(in, start, pos - 1);
+ return builder.toString();
+ }
+ }
+
+ if (c == '\\') {
+ if (pos == in.length()) {
+ throw syntaxError("Unterminated escape sequence");
+ }
+ if (builder == null) {
+ builder = new StringBuilder();
+ }
+ builder.append(in, start, pos - 1);
+ builder.append(readEscapeCharacter());
+ start = pos;
+ }
+ }
+
+ throw syntaxError("Unterminated string");
+ }
+
+ /**
+ * Unescapes the character identified by the character or characters that
+ * immediately follow a backslash. The backslash '\' should have already
+ * been read. This supports both unicode escapes "u000A" and two-character
+ * escapes "\n".
+ */
+ private char readEscapeCharacter() throws JSONException {
+ char escaped = in.charAt(pos++);
+ switch (escaped) {
+ case 'u':
+ if (pos + 4 > in.length()) {
+ throw syntaxError("Unterminated escape sequence");
+ }
+ String hex = in.substring(pos, pos + 4);
+ pos += 4;
+ try {
+ return (char) Integer.parseInt(hex, 16);
+ } catch (NumberFormatException nfe) {
+ throw syntaxError("Invalid escape sequence: " + hex);
+ }
+
+ case 't':
+ return '\t';
+
+ case 'b':
+ return '\b';
+
+ case 'n':
+ return '\n';
+
+ case 'r':
+ return '\r';
+
+ case 'f':
+ return '\f';
+
+ case '\'':
+ case '"':
+ case '\\':
+ default:
+ return escaped;
+ }
+ }
+
+ /**
+ * Reads a null, boolean, numeric or unquoted string literal value. Numeric
+ * values will be returned as an Integer, Long, or Double, in that order of
+ * preference.
+ */
+ private Object readLiteral() throws JSONException {
+ String literal = nextToInternal("{}[]/\\:,=;# \t\f");
+
+ if (literal.length() == 0) {
+ throw syntaxError("Expected literal value");
+ } else if ("null".equalsIgnoreCase(literal)) {
+ return JSONObject.NULL;
+ } else if ("true".equalsIgnoreCase(literal)) {
+ return Boolean.TRUE;
+ } else if ("false".equalsIgnoreCase(literal)) {
+ return Boolean.FALSE;
+ }
+
+ /* try to parse as an integral type... */
+ if (literal.indexOf('.') == -1) {
+ int base = 10;
+ String number = literal;
+ if (number.startsWith("0x") || number.startsWith("0X")) {
+ number = number.substring(2);
+ base = 16;
+ } else if (number.startsWith("0") && number.length() > 1) {
+ number = number.substring(1);
+ base = 8;
+ }
+ try {
+ long longValue = Long.parseLong(number, base);
+ if (longValue <= Integer.MAX_VALUE && longValue >= Integer.MIN_VALUE) {
+ return (int) longValue;
+ } else {
+ return longValue;
+ }
+ } catch (NumberFormatException e) {
+ /*
+ * This only happens for integral numbers greater than
+ * Long.MAX_VALUE, numbers in exponential form (5e-10) and
+ * unquoted strings. Fall through to try floating point.
+ */
+ }
+ }
+
+ /* ...next try to parse as a floating point... */
+ try {
+ return Double.valueOf(literal);
+ } catch (NumberFormatException ignored) {
+ }
+
+ /* ... finally give up. We have an unquoted string */
+ return new String(literal); // a new string avoids leaking memory
+ }
+
+ /**
+ * Returns the string up to but not including any of the given characters or
+ * a newline character. This does not consume the excluded character.
+ */
+ private String nextToInternal(String excluded) {
+ int start = pos;
+ for (; pos < in.length(); pos++) {
+ char c = in.charAt(pos);
+ if (c == '\r' || c == '\n' || excluded.indexOf(c) != -1) {
+ return in.substring(start, pos);
+ }
+ }
+ return in.substring(start);
+ }
+
+ /**
+ * Reads a sequence of key/value pairs and the trailing closing brace '}' of
+ * an object. The opening brace '{' should have already been read.
+ */
+ private JSONObject readObject() throws JSONException {
+ JSONObject result = new JSONObject();
+
+ /* Peek to see if this is the empty object. */
+ int first = nextCleanInternal();
+ if (first == '}') {
+ return result;
+ } else if (first != -1) {
+ pos--;
+ }
+
+ while (true) {
+ Object name = nextValue();
+ if (!(name instanceof String)) {
+ if (name == null) {
+ throw syntaxError("Names cannot be null");
+ } else {
+ throw syntaxError("Names must be strings, but " + name
+ + " is of type " + name.getClass().getName());
+ }
+ }
+
+ /*
+ * Expect the name/value separator to be either a colon ':', an
+ * equals sign '=', or an arrow "=>". The last two are bogus but we
+ * include them because that's what the original implementation did.
+ */
+ int separator = nextCleanInternal();
+ if (separator != ':' && separator != '=') {
+ throw syntaxError("Expected ':' after " + name);
+ }
+ if (pos < in.length() && in.charAt(pos) == '>') {
+ pos++;
+ }
+
+ result.put((String) name, nextValue());
+
+ switch (nextCleanInternal()) {
+ case '}':
+ return result;
+ case ';':
+ case ',':
+ continue;
+ default:
+ throw syntaxError("Unterminated object");
+ }
+ }
+ }
+
+ /**
+ * Reads a sequence of values and the trailing closing brace ']' of an
+ * array. The opening brace '[' should have already been read. Note that
+ * "[]" yields an empty array, but "[,]" returns a two-element array
+ * equivalent to "[null,null]".
+ */
+ private JSONArray readArray() throws JSONException {
+ JSONArray result = new JSONArray();
+
+ /* to cover input that ends with ",]". */
+ boolean hasTrailingSeparator = false;
+
+ while (true) {
+ switch (nextCleanInternal()) {
+ case -1:
+ throw syntaxError("Unterminated array");
+ case ']':
+ if (hasTrailingSeparator) {
+ result.put(null);
+ }
+ return result;
+ case ',':
+ case ';':
+ /* A separator without a value first means "null". */
+ result.put(null);
+ hasTrailingSeparator = true;
+ continue;
+ default:
+ pos--;
+ }
+
+ result.put(nextValue());
+
+ switch (nextCleanInternal()) {
+ case ']':
+ return result;
+ case ',':
+ case ';':
+ hasTrailingSeparator = true;
+ continue;
+ default:
+ throw syntaxError("Unterminated array");
+ }
+ }
+ }
+
+ /**
+ * Returns an exception containing the given message plus the current
+ * position and the entire input string.
+ */
+ public JSONException syntaxError(String message) {
+ return new JSONException(message + this);
+ }
+
+ /**
+ * Returns the current position and the entire input string.
+ */
+ @Override public String toString() {
+ // consistent with the original implementation
+ return " at character " + pos + " of " + in;
+ }
+
+ /*
+ * Legacy APIs.
+ *
+ * None of the methods below are on the critical path of parsing JSON
+ * documents. They exist only because they were exposed by the original
+ * implementation and may be used by some clients.
+ */
+
+ /**
+ * Returns true until the input has been exhausted.
+ */
+ public boolean more() {
+ return pos < in.length();
+ }
+
+ /**
+ * Returns the next available character, or the null character '\0' if all
+ * input has been exhausted. The return value of this method is ambiguous
+ * for JSON strings that contain the character '\0'.
+ */
+ public char next() {
+ return pos < in.length() ? in.charAt(pos++) : '\0';
+ }
+
+ /**
+ * Returns the next available character if it equals {@code c}. Otherwise an
+ * exception is thrown.
+ */
+ public char next(char c) throws JSONException {
+ char result = next();
+ if (result != c) {
+ throw syntaxError("Expected " + c + " but was " + result);
+ }
+ return result;
+ }
+
+ /**
+ * Returns the next character that is not whitespace and does not belong to
+ * a comment. If the input is exhausted before such a character can be
+ * found, the null character '\0' is returned. The return value of this
+ * method is ambiguous for JSON strings that contain the character '\0'.
+ */
+ public char nextClean() throws JSONException {
+ int nextCleanInt = nextCleanInternal();
+ return nextCleanInt == -1 ? '\0' : (char) nextCleanInt;
+ }
+
+ /**
+ * Returns the next {@code length} characters of the input.
+ *
+ * <p>The returned string shares its backing character array with this
+ * tokener's input string. If a reference to the returned string may be held
+ * indefinitely, you should use {@code new String(result)} to copy it first
+ * to avoid memory leaks.
+ *
+ * @throws JSONException if the remaining input is not long enough to
+ * satisfy this request.
+ */
+ public String next(int length) throws JSONException {
+ if (pos + length > in.length()) {
+ throw syntaxError(length + " is out of bounds");
+ }
+ String result = in.substring(pos, pos + length);
+ pos += length;
+ return result;
+ }
+
+ /**
+ * Returns the {@link String#trim trimmed} string holding the characters up
+ * to but not including the first of:
+ * <ul>
+ * <li>any character in {@code excluded}
+ * <li>a newline character '\n'
+ * <li>a carriage return '\r'
+ * </ul>
+ *
+ * <p>The returned string shares its backing character array with this
+ * tokener's input string. If a reference to the returned string may be held
+ * indefinitely, you should use {@code new String(result)} to copy it first
+ * to avoid memory leaks.
+ *
+ * @return a possibly-empty string
+ */
+ public String nextTo(String excluded) {
+ if (excluded == null) {
+ throw new NullPointerException("excluded == null");
+ }
+ return nextToInternal(excluded).trim();
+ }
+
+ /**
+ * Equivalent to {@code nextTo(String.valueOf(excluded))}.
+ */
+ public String nextTo(char excluded) {
+ return nextToInternal(String.valueOf(excluded)).trim();
+ }
+
+ /**
+ * Advances past all input up to and including the next occurrence of
+ * {@code thru}. If the remaining input doesn't contain {@code thru}, the
+ * input is exhausted.
+ */
+ public void skipPast(String thru) {
+ int thruStart = in.indexOf(thru, pos);
+ pos = thruStart == -1 ? in.length() : (thruStart + thru.length());
+ }
+
+ /**
+ * Advances past all input up to but not including the next occurrence of
+ * {@code to}. If the remaining input doesn't contain {@code to}, the input
+ * is unchanged.
+ */
+ public char skipTo(char to) {
+ int index = in.indexOf(to, pos);
+ if (index != -1) {
+ pos = index;
+ return to;
+ } else {
+ return '\0';
+ }
+ }
+
+ /**
+ * Unreads the most recent character of input. If no input characters have
+ * been read, the input is unchanged.
+ */
+ public void back() {
+ if (--pos == -1) {
+ pos = 0;
+ }
+ }
+
+ /**
+ * Returns the integer [0..15] value for the given hex character, or -1
+ * for non-hex input.
+ *
+ * @param hex a character in the ranges [0-9], [A-F] or [a-f]. Any other
+ * character will yield a -1 result.
+ */
+ public static int dehexchar(char hex) {
+ if (hex >= '0' && hex <= '9') {
+ return hex - '0';
+ } else if (hex >= 'A' && hex <= 'F') {
+ return hex - 'A' + 10;
+ } else if (hex >= 'a' && hex <= 'f') {
+ return hex - 'a' + 10;
+ } else {
+ return -1;
+ }
+ }
+}
diff --git a/baseAndroid/README.md b/baseAndroid/README.md
new file mode 100644
index 000000000..6ad99fef3
--- /dev/null
+++ b/baseAndroid/README.md
@@ -0,0 +1,6 @@
+## SmartDeviceLink BaseAndroid
+
+The Base Android folder symbolically links files used by the Android project that are in the Base folder.
+
+This folder does not need to be imported. Please refer to the installation instructions in the Android, JavaSE, or JavaEE readme's.
+
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/Dispatcher b/baseAndroid/src/main/java/com/smartdevicelink/Dispatcher
new file mode 120000
index 000000000..2af882be4
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/Dispatcher
@@ -0,0 +1 @@
+../../../../../../base/src/main/java/com/smartdevicelink/Dispatcher/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java b/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java
new file mode 120000
index 000000000..0e22d9dc9
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/exception b/baseAndroid/src/main/java/com/smartdevicelink/exception
new file mode 120000
index 000000000..d5d048354
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/exception
@@ -0,0 +1 @@
+../../../../../../base/src/main/java/com/smartdevicelink/exception/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java
new file mode 120000
index 000000000..bf45a3bf6
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java
new file mode 120000
index 000000000..568044bfd
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/BaseSdlManagerListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSubManager.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
new file mode 120000
index 000000000..f1f35fe92
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/CompletionListener.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/CompletionListener.java
new file mode 120000
index 000000000..1bd4fd70e
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/CompletionListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/CompletionListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java
new file mode 120000
index 000000000..2d817807f
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/audio b/baseAndroid/src/main/java/com/smartdevicelink/managers/audio
new file mode 120000
index 000000000..7d71d50ed
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/audio
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/audio/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/file b/baseAndroid/src/main/java/com/smartdevicelink/managers/file
new file mode 120000
index 000000000..177a5823e
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/file
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/file \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java b/baseAndroid/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java
new file mode 120000
index 000000000..88f7feccc
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/permission b/baseAndroid/src/main/java/com/smartdevicelink/managers/permission
new file mode 120000
index 000000000..d18186971
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/permission
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/permission \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/screen b/baseAndroid/src/main/java/com/smartdevicelink/managers/screen
new file mode 120000
index 000000000..fbf226f8e
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/screen
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/screen \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/managers/video b/baseAndroid/src/main/java/com/smartdevicelink/managers/video
new file mode 120000
index 000000000..de58416c9
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/managers/video
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/managers/video/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/marshal b/baseAndroid/src/main/java/com/smartdevicelink/marshal
new file mode 120000
index 000000000..c86064e2f
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/marshal
@@ -0,0 +1 @@
+../../../../../../base/src/main/java/com/smartdevicelink/marshal/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
new file mode 120000
index 000000000..c2b9f5a5d
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
new file mode 120000
index 000000000..05acb054b
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java
new file mode 120000
index 000000000..37bba1630
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
new file mode 120000
index 000000000..92bbe53bf
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
new file mode 120000
index 000000000..530ee50b1
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacket.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
new file mode 120000
index 000000000..8408c2728
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/SdlPacket.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
new file mode 120000
index 000000000..aded79f74
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java b/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
new file mode 120000
index 000000000..12d9192e9
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/protocol/enums b/baseAndroid/src/main/java/com/smartdevicelink/protocol/enums
new file mode 120000
index 000000000..e4adb738b
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/protocol/enums
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/protocol/enums \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/IProxyListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
new file mode 120000
index 000000000..e79a51ef6
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCMessage.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
new file mode 120000
index 000000000..97e44408d
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCNotification.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
new file mode 120000
index 000000000..8713d52e3
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCRequest.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
new file mode 120000
index 000000000..c1e2f4a27
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCResponse.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
new file mode 120000
index 000000000..afcfd9e15
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCStruct.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
new file mode 120000
index 000000000..683ec16a9
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
new file mode 120000
index 000000000..3d03c008f
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
new file mode 120000
index 000000000..ba944a202
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/callbacks b/baseAndroid/src/main/java/com/smartdevicelink/proxy/callbacks
new file mode 120000
index 000000000..74653ae9f
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/callbacks
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/callbacks/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/constants b/baseAndroid/src/main/java/com/smartdevicelink/proxy/constants
new file mode 120000
index 000000000..ced1d41aa
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/constants
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/constants/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java
new file mode 120000
index 000000000..02570d2f8
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
new file mode 120000
index 000000000..cede25df1
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java
new file mode 120000
index 000000000..32895d7fe
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
new file mode 120000
index 000000000..41112b9e7
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
new file mode 120000
index 000000000..9b79b4afc
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java
new file mode 120000
index 000000000..87f717597
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java
new file mode 120000
index 000000000..c817900a3
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java
new file mode 120000
index 000000000..ea2302aa4
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/proxy/rpc b/baseAndroid/src/main/java/com/smartdevicelink/proxy/rpc
new file mode 120000
index 000000000..7f7d97664
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/proxy/rpc
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/proxy/rpc \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/security b/baseAndroid/src/main/java/com/smartdevicelink/security
new file mode 120000
index 000000000..09e7051a4
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/security
@@ -0,0 +1 @@
+../../../../../../base/src/main/java/com/smartdevicelink/security \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java b/baseAndroid/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
new file mode 120000
index 000000000..ce7fd47d9
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/IStreamListener.java b/baseAndroid/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
new file mode 120000
index 000000000..f703ac149
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/audio b/baseAndroid/src/main/java/com/smartdevicelink/streaming/audio
new file mode 120000
index 000000000..b91099bd1
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/streaming/audio
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/streaming/audio/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java b/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
new file mode 120000
index 000000000..1eec0a104
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java b/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
new file mode 120000
index 000000000..8b18e72b2
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/DiagLevel.java b/baseAndroid/src/main/java/com/smartdevicelink/trace/DiagLevel.java
new file mode 120000
index 000000000..1bc9b65d1
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/trace/DiagLevel.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/trace/DiagLevel.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/ISTListener.java b/baseAndroid/src/main/java/com/smartdevicelink/trace/ISTListener.java
new file mode 120000
index 000000000..2ac262989
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/trace/ISTListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/trace/ISTListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/Mime.java b/baseAndroid/src/main/java/com/smartdevicelink/trace/Mime.java
new file mode 120000
index 000000000..8dc93a328
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/trace/Mime.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/trace/Mime.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java b/baseAndroid/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
new file mode 120000
index 000000000..8d7260eb5
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/trace/enums b/baseAndroid/src/main/java/com/smartdevicelink/trace/enums
new file mode 120000
index 000000000..6c0343907
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/trace/enums
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/trace/enums/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
new file mode 120000
index 000000000..92effaf36
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/ITransportListener.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/ITransportListener.java
new file mode 120000
index 000000000..587a7a3de
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/transport/ITransportListener.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/transport/ITransportListener.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/SdlPsm.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/SdlPsm.java
new file mode 120000
index 000000000..22d69d1cd
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/transport/SdlPsm.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/transport/SdlPsm.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/SiphonServer.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/SiphonServer.java
new file mode 120000
index 000000000..b28f2965d
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/transport/SiphonServer.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/transport/SiphonServer.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportConstants.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportConstants.java
new file mode 120000
index 000000000..61f953de2
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportConstants.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/transport/TransportConstants.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java
new file mode 120000
index 000000000..f89613939
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/enums b/baseAndroid/src/main/java/com/smartdevicelink/transport/enums
new file mode 120000
index 000000000..c5b0467f6
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/transport/enums
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/transport/enums/ \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java b/baseAndroid/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
new file mode 120000
index 000000000..6fec751ec
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
@@ -0,0 +1 @@
+../../../../../../../../base/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/BitConverter.java b/baseAndroid/src/main/java/com/smartdevicelink/util/BitConverter.java
new file mode 120000
index 000000000..ace3985f9
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/BitConverter.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/BitConverter.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/ByteEnumer.java b/baseAndroid/src/main/java/com/smartdevicelink/util/ByteEnumer.java
new file mode 120000
index 000000000..8cc7d9ac8
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/ByteEnumer.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/ByteEnumer.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java b/baseAndroid/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java
new file mode 120000
index 000000000..4d9cfea49
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/DebugTool.java b/baseAndroid/src/main/java/com/smartdevicelink/util/DebugTool.java
new file mode 120000
index 000000000..2c9f91906
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/DebugTool.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/DebugTool.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/FileUtls.java b/baseAndroid/src/main/java/com/smartdevicelink/util/FileUtls.java
new file mode 120000
index 000000000..8eb2f22c2
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/FileUtls.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/FileUtls.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/HttpRequestTask.java b/baseAndroid/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
new file mode 120000
index 000000000..1733992ae
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/HttpRequestTask.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/IConsole.java b/baseAndroid/src/main/java/com/smartdevicelink/util/IConsole.java
new file mode 120000
index 000000000..2cf061029
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/IConsole.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/IConsole.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/NativeLogTool.java b/baseAndroid/src/main/java/com/smartdevicelink/util/NativeLogTool.java
new file mode 120000
index 000000000..3e1645508
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/NativeLogTool.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/NativeLogTool.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java b/baseAndroid/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java
new file mode 120000
index 000000000..d44a2b6e0
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java \ No newline at end of file
diff --git a/baseAndroid/src/main/java/com/smartdevicelink/util/Version.java b/baseAndroid/src/main/java/com/smartdevicelink/util/Version.java
new file mode 120000
index 000000000..e21ea0440
--- /dev/null
+++ b/baseAndroid/src/main/java/com/smartdevicelink/util/Version.java
@@ -0,0 +1 @@
+../../../../../../../base/src/main/java/com/smartdevicelink/util/Version.java \ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 9fe523a5c..000000000
--- a/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Sun Apr 8 12:14:33 EDT 2018
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
diff --git a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java b/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java
deleted file mode 100755
index ea98cbf7f..000000000
--- a/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java
+++ /dev/null
@@ -1,259 +0,0 @@
-package com.sdl.hellosdlandroid;
-
-import android.annotation.SuppressLint;
-import android.app.Notification;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import android.app.Service;
-import android.content.Context;
-import android.content.Intent;
-import android.hardware.usb.UsbAccessory;
-import android.hardware.usb.UsbManager;
-import android.os.Build;
-import android.os.IBinder;
-import android.util.Log;
-
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.SdlManager;
-import com.smartdevicelink.managers.SdlManagerListener;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.TTSChunkFactory;
-import com.smartdevicelink.proxy.rpc.AddCommand;
-import com.smartdevicelink.proxy.rpc.MenuParams;
-import com.smartdevicelink.proxy.rpc.OnCommand;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.Speak;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.TCPTransportConfig;
-
-import java.util.Collections;
-import java.util.Vector;
-
-public class SdlService extends Service {
-
- private static final String TAG = "SDL Service";
-
- private static final String APP_NAME = "Hello Sdl";
- private static final String APP_ID = "8678309";
-
- private static final String ICON_FILENAME = "hello_sdl_icon.png";
- private static final String SDL_IMAGE_FILENAME = "sdl_full_image.png";
-
- private static final String WELCOME_SHOW = "Welcome to HelloSDL";
- private static final String WELCOME_SPEAK = "Welcome to Hello S D L";
-
- private static final String TEST_COMMAND_NAME = "Test Command";
- private static final int TEST_COMMAND_ID = 1;
-
- private static final int FOREGROUND_SERVICE_ID = 111;
-
- // TCP/IP transport config
- // The default port is 12345
- // The IP is of the machine that is running SDL Core
- private static final int TCP_PORT = 12345;
- private static final String DEV_MACHINE_IP_ADDRESS = "192.168.1.78";
-
- // variable to create and call functions of the SyncProxy
- private SdlManager sdlManager = null;
-
- @Override
- public IBinder onBind(Intent intent) {
- return null;
- }
-
- @Override
- public void onCreate() {
- Log.d(TAG, "onCreate");
- super.onCreate();
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- enterForeground();
- }
- }
-
- // Helper method to let the service enter foreground mode
- @SuppressLint("NewApi")
- public void enterForeground() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- NotificationChannel channel = new NotificationChannel(APP_ID, "SdlService", NotificationManager.IMPORTANCE_DEFAULT);
- NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- if (notificationManager != null) {
- notificationManager.createNotificationChannel(channel);
- Notification serviceNotification = new Notification.Builder(this, channel.getId())
- .setContentTitle("Connected through SDL")
- .setSmallIcon(R.drawable.ic_sdl)
- .build();
- startForeground(FOREGROUND_SERVICE_ID, serviceNotification);
- }
- }
- }
-
- @Override
- public int onStartCommand(Intent intent, int flags, int startId) {
- startProxy();
- return START_STICKY;
- }
-
- @Override
- public void onDestroy() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- stopForeground(true);
- }
-
- if (sdlManager != null) {
- sdlManager.dispose();
- }
-
- super.onDestroy();
- }
-
- private void startProxy() {
- // This logic is to select the correct transport and security levels defined in the selected build flavor
- // Build flavors are selected by the "build variants" tab typically located in the bottom left of Android Studio
- // Typically in your app, you will only set one of these.
- if (sdlManager == null) {
- Log.i(TAG, "Starting SDL Proxy");
- BaseTransportConfig transport = null;
- if (BuildConfig.TRANSPORT.equals("MULTI")) {
- int securityLevel;
- if (BuildConfig.SECURITY.equals("HIGH")) {
- securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH;
- } else if (BuildConfig.SECURITY.equals("MED")) {
- securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED;
- } else if (BuildConfig.SECURITY.equals("LOW")) {
- securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_LOW;
- } else {
- securityLevel = MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF;
- }
- transport = new MultiplexTransportConfig(this, APP_ID, securityLevel);
- } else if (BuildConfig.TRANSPORT.equals("TCP")) {
- transport = new TCPTransportConfig(TCP_PORT, DEV_MACHINE_IP_ADDRESS, true);
- } else if (BuildConfig.TRANSPORT.equals("MULTI_HB")) {
- MultiplexTransportConfig mtc = new MultiplexTransportConfig(this, APP_ID, MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF);
- mtc.setRequiresHighBandwidth(true);
- transport = mtc;
- }
-
- // The app type to be used
- Vector<AppHMIType> appType = new Vector<>();
- appType.add(AppHMIType.MEDIA);
-
- // The manager listener helps you know when certain events that pertain to the SDL Manager happen
- // Here we will listen for ON_HMI_STATUS and ON_COMMAND notifications
- SdlManagerListener listener = new SdlManagerListener() {
- @Override
- public void onStart() {
- // HMI Status Listener
- sdlManager.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- OnHMIStatus status = (OnHMIStatus) notification;
- if (status.getHmiLevel() == HMILevel.HMI_FULL && ((OnHMIStatus) notification).getFirstRun()) {
- sendCommands();
- performWelcomeSpeak();
- performWelcomeShow();
- }
- }
- });
-
- // Menu Selected Listener
- sdlManager.addOnRPCNotificationListener(FunctionID.ON_COMMAND, new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- OnCommand command = (OnCommand) notification;
- Integer id = command.getCmdID();
- if(id != null){
- switch(id){
- case TEST_COMMAND_ID:
- showTest();
- break;
- }
- }
- }
- });
- }
-
- @Override
- public void onDestroy() {
- SdlService.this.stopSelf();
- }
-
- @Override
- public void onError(String info, Exception e) {
- }
- };
-
- // Create App Icon, this is set in the SdlManager builder
- SdlArtwork appIcon = new SdlArtwork(ICON_FILENAME, FileType.GRAPHIC_PNG, R.mipmap.ic_launcher, true);
-
- // The manager builder sets options for your session
- SdlManager.Builder builder = new SdlManager.Builder(this, APP_ID, APP_NAME, listener);
- builder.setAppTypes(appType);
- builder.setTransportType(transport);
- builder.setAppIcon(appIcon);
- sdlManager = builder.build();
- sdlManager.start();
- }
- }
-
- /**
- * Add commands for the app on SDL.
- */
- private void sendCommands(){
- AddCommand command = new AddCommand();
- MenuParams params = new MenuParams();
- params.setMenuName(TEST_COMMAND_NAME);
- command.setCmdID(TEST_COMMAND_ID);
- command.setMenuParams(params);
- command.setVrCommands(Collections.singletonList(TEST_COMMAND_NAME));
- sdlManager.sendRPC(command);
- }
-
- /**
- * Will speak a sample welcome message
- */
- private void performWelcomeSpeak(){
- sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(WELCOME_SPEAK)));
- }
-
- /**
- * Use the Screen Manager to set the initial screen text and set the image.
- * Because we are setting multiple items, we will call beginTransaction() first,
- * and finish with commit() when we are done.
- */
- private void performWelcomeShow() {
- sdlManager.getScreenManager().beginTransaction();
- sdlManager.getScreenManager().setTextField1(APP_NAME);
- sdlManager.getScreenManager().setTextField2(WELCOME_SHOW);
- sdlManager.getScreenManager().setPrimaryGraphic(new SdlArtwork(SDL_IMAGE_FILENAME, FileType.GRAPHIC_PNG, R.drawable.sdl, true));
- sdlManager.getScreenManager().commit(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- if (success){
- Log.i(TAG, "welcome show successful");
- }
- }
- });
- }
-
- /**
- * Will show a sample test message on screen as well as speak a sample test message
- */
- private void showTest(){
- sdlManager.getScreenManager().beginTransaction();
- sdlManager.getScreenManager().setTextField1("Command has been selected");
- sdlManager.getScreenManager().setTextField2("");
- sdlManager.getScreenManager().commit(null);
-
- sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(TEST_COMMAND_NAME)));
- }
-
-
-}
diff --git a/hello_sdl_java/assets/images/sdl.png b/hello_sdl_java/assets/images/sdl.png
new file mode 100755
index 000000000..5cfc0f84a
--- /dev/null
+++ b/hello_sdl_java/assets/images/sdl.png
Binary files differ
diff --git a/hello_sdl_java/assets/images/sdl_s_green.png b/hello_sdl_java/assets/images/sdl_s_green.png
new file mode 100755
index 000000000..c43021775
--- /dev/null
+++ b/hello_sdl_java/assets/images/sdl_s_green.png
Binary files differ
diff --git a/hello_sdl_java/build.gradle b/hello_sdl_java/build.gradle
new file mode 100644
index 000000000..b4f834b43
--- /dev/null
+++ b/hello_sdl_java/build.gradle
@@ -0,0 +1,35 @@
+plugins {
+ id 'java'
+}
+
+version '1.0'
+
+sourceCompatibility = 1.7
+
+repositories {
+ mavenCentral()
+ mavenLocal()
+ google()
+ jcenter()
+}
+// This extraLibs solution is explained here: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5
+configurations {
+ // configuration that holds jars to include in the jar
+ extraLibs
+}
+dependencies {
+ extraLibs fileTree(dir: 'libs', include: ['*.jar'])
+ //testCompile group: 'junit', name: 'junit', version: '4.12'
+ extraLibs project(path: ':sdl_java_se')
+ configurations.implementation.extendsFrom(configurations.extraLibs)
+
+}
+jar {
+ from {
+ configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+ manifest {
+ attributes 'Class-Path': configurations.compile.collect { it.getName() }.join(' ')
+ attributes 'Main-Class': 'com.smartdevicelink.java.Main'
+ }
+} \ No newline at end of file
diff --git a/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar b/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..28861d273
--- /dev/null
+++ b/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties b/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..fd6d42bd6
--- /dev/null
+++ b/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Mar 18 12:47:09 EDT 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
diff --git a/hello_sdl_java/gradlew b/hello_sdl_java/gradlew
new file mode 100755
index 000000000..cccdd3d51
--- /dev/null
+++ b/hello_sdl_java/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/hello_sdl_java/gradlew.bat b/hello_sdl_java/gradlew.bat
new file mode 100644
index 000000000..f9553162f
--- /dev/null
+++ b/hello_sdl_java/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/hello_sdl_java/settings.gradle b/hello_sdl_java/settings.gradle
new file mode 100644
index 000000000..fd254fa69
--- /dev/null
+++ b/hello_sdl_java/settings.gradle
@@ -0,0 +1,4 @@
+rootProject.name = 'hello_sdl_java'
+include ":sdl_java_se"
+project (":sdl_java_se").projectDir = new File("../javaSE/")
+
diff --git a/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java b/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java
new file mode 100644
index 000000000..446c267ee
--- /dev/null
+++ b/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2019. Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.java;
+
+import com.smartdevicelink.transport.WebSocketServerConfig;
+import com.smartdevicelink.util.DebugTool;
+
+public class Main {
+
+ static Thread thread = null, mainThread;
+ static Object LOCK;
+
+ static SdlService sdlService;
+
+ public static void main(String[] args) {
+ mainThread = Thread.currentThread();
+ LOCK = new Object();
+ startSdlService();
+
+ while(!mainThread.isInterrupted()) {
+ try {
+ synchronized (LOCK) {
+ LOCK.wait();
+ }
+ System.gc();
+ Thread.sleep(500);
+ DebugTool.logInfo( "Attempting to start SDL Service again");
+ startSdlService();
+ DebugTool.logInfo("SdlService started");
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ break;
+ }
+ }
+ }
+
+ static SdlService.SdlServiceCallback serviceCallback = new SdlService.SdlServiceCallback() {
+ @Override
+ public void onEnd() {
+ thread.interrupt();
+ thread = null;
+ synchronized (LOCK) {
+ LOCK.notify();
+ }
+
+ }
+ };
+
+ private static void startSdlService() {
+
+ thread = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ DebugTool.logInfo("Starting SDL Service");
+ sdlService = new SdlService(new WebSocketServerConfig(5432, -1), serviceCallback);
+ sdlService.start();
+
+ System.gc();
+
+ }
+ });
+ thread.start();
+ }
+}
diff --git a/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java b/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java
new file mode 100644
index 000000000..0330ce192
--- /dev/null
+++ b/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2019. Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.java;
+
+import android.util.Log;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.SdlManager;
+import com.smartdevicelink.managers.SdlManagerListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.TTSChunkFactory;
+import com.smartdevicelink.proxy.rpc.*;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.util.DebugTool;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Vector;
+
+public class SdlService {
+
+
+ private static final String TAG = "SDL Service";
+
+ private static final String APP_NAME = "Hello Sdl";
+ private static final String APP_ID = "8678309";
+
+ private static final String ICON_FILENAME = "hello_sdl_icon.png";
+ private static final String SDL_IMAGE_FILENAME = "sdl_full_image.png";
+
+ private static final String WELCOME_SHOW = "Welcome to HelloSDL";
+ private static final String WELCOME_SPEAK = "Welcome to Hello S D L";
+
+ private static final String TEST_COMMAND_NAME = "Test Command";
+ private static final int TEST_COMMAND_ID = 1;
+
+ private static final String IMAGE_DIR = "assets/images/";
+
+
+
+ // variable to create and call functions of the SyncProxy
+ private SdlManager sdlManager = null;
+
+ private SdlServiceCallback callback;
+
+
+ public SdlService(BaseTransportConfig config, SdlServiceCallback callback){
+ this.callback = callback;
+ buildSdlManager(config);
+ }
+
+
+
+ public void start() {
+ DebugTool.logInfo("SdlService start() ");
+ if(sdlManager != null){
+ sdlManager.start();
+ }
+ }
+
+ public void stop() {
+ if (sdlManager != null) {
+ sdlManager.dispose();
+ sdlManager = null;
+ }
+ }
+
+ private void buildSdlManager(BaseTransportConfig transport) {
+ // This logic is to select the correct transport and security levels defined in the selected build flavor
+ // Build flavors are selected by the "build variants" tab typically located in the bottom left of Android Studio
+ // Typically in your app, you will only set one of these.
+ if (sdlManager == null) {
+ DebugTool.logInfo("Creating SDL Manager");
+
+ //FIXME add the transport type
+ // The app type to be used
+ Vector<AppHMIType> appType = new Vector<>();
+ appType.add(AppHMIType.MEDIA);
+
+ // The manager listener helps you know when certain events that pertain to the SDL Manager happen
+ // Here we will listen for ON_HMI_STATUS and ON_COMMAND notifications
+ SdlManagerListener listener = new SdlManagerListener() {
+ @Override
+ public void onStart(SdlManager sdlManager) {
+ DebugTool.logInfo("SdlManager onStart");
+ }
+
+ @Override
+ public void onDestroy(SdlManager sdlManager) {
+ DebugTool.logInfo("SdlManager onDestroy ");
+ SdlService.this.sdlManager = null;
+ if(SdlService.this.callback != null){
+ SdlService.this.callback.onEnd();
+ }
+ }
+
+ @Override
+ public void onError(SdlManager sdlManager, String info, Exception e) {
+ }
+ };
+
+
+ HashMap<FunctionID,OnRPCNotificationListener> notificationListenerHashMap = new HashMap<FunctionID,OnRPCNotificationListener>();
+ notificationListenerHashMap.put(FunctionID.ON_HMI_STATUS, new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnHMIStatus status = (OnHMIStatus) notification;
+ if (status.getHmiLevel() == HMILevel.HMI_FULL && ((OnHMIStatus) notification).getFirstRun()) {
+ sendCommands();
+ performWelcomeSpeak();
+ performWelcomeShow();
+ }
+ }
+ });
+
+ notificationListenerHashMap.put(FunctionID.ON_COMMAND, new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnCommand command = (OnCommand) notification;
+ Integer id = command.getCmdID();
+ if(id != null){
+ switch(id){
+ case TEST_COMMAND_ID:
+ showTest();
+ break;
+ }
+ }
+ }
+ });
+
+
+ // Create App Icon, this is set in the SdlManager builder
+ SdlArtwork appIcon = new SdlArtwork(ICON_FILENAME, FileType.GRAPHIC_PNG, IMAGE_DIR+"sdl_s_green.png", true);
+
+ // The manager builder sets options for your session
+ SdlManager.Builder builder = new SdlManager.Builder(APP_ID, APP_NAME, listener);
+ builder.setAppTypes(appType);
+ builder.setTransportType(transport);
+ builder.setAppIcon(appIcon);
+ builder.setRPCNotificationListeners(notificationListenerHashMap);
+ sdlManager = builder.build();
+ }
+ }
+
+ /**
+ * Add commands for the app on SDL.
+ */
+ private void sendCommands(){
+ AddCommand command = new AddCommand();
+ MenuParams params = new MenuParams();
+ params.setMenuName(TEST_COMMAND_NAME);
+ command.setCmdID(TEST_COMMAND_ID);
+ command.setMenuParams(params);
+ command.setVrCommands(Collections.singletonList(TEST_COMMAND_NAME));
+ sdlManager.sendRPC(command);
+ }
+
+ /**
+ * Will speak a sample welcome message
+ */
+ private void performWelcomeSpeak(){
+ sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(WELCOME_SPEAK)));
+ }
+
+ /**
+ * Use the Screen Manager to set the initial screen text and set the image.
+ * Because we are setting multiple items, we will call beginTransaction() first,
+ * and finish with commit() when we are done.
+ */
+ private void performWelcomeShow() {
+ sdlManager.getScreenManager().beginTransaction();
+ sdlManager.getScreenManager().setTextField1(APP_NAME);
+ sdlManager.getScreenManager().setTextField2(WELCOME_SHOW);
+ sdlManager.getScreenManager().setPrimaryGraphic(new SdlArtwork(SDL_IMAGE_FILENAME, FileType.GRAPHIC_PNG, IMAGE_DIR+"sdl.png", true));
+ sdlManager.getScreenManager().commit(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ if (success){
+ Log.i(TAG, "welcome show successful");
+ }
+ }
+ });
+ }
+
+ /**
+ * Will show a sample test message on screen as well as speak a sample test message
+ */
+ private void showTest(){
+ sdlManager.getScreenManager().beginTransaction();
+ sdlManager.getScreenManager().setTextField1("Command has been selected");
+ sdlManager.getScreenManager().setTextField2("");
+ sdlManager.getScreenManager().commit(null);
+
+ sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(TEST_COMMAND_NAME)));
+ }
+
+
+ public interface SdlServiceCallback{
+ void onEnd();
+ }
+
+
+
+}
diff --git a/hello_sdl_java_ee/assets b/hello_sdl_java_ee/assets
new file mode 120000
index 000000000..386a9bd31
--- /dev/null
+++ b/hello_sdl_java_ee/assets
@@ -0,0 +1 @@
+../hello_sdl_java/assets \ No newline at end of file
diff --git a/hello_sdl_java_ee/build.gradle b/hello_sdl_java_ee/build.gradle
new file mode 100644
index 000000000..5c1b1eb70
--- /dev/null
+++ b/hello_sdl_java_ee/build.gradle
@@ -0,0 +1,26 @@
+plugins {
+ id 'java'
+}
+
+version '1.0-SNAPSHOT'
+
+sourceCompatibility = 1.8
+
+repositories {
+ mavenCentral()
+ mavenLocal()
+ google()
+ jcenter()
+}
+// This extraLibs solution is explained here: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5
+configurations {
+ // configuration that holds jars to include in the jar
+ extraLibs
+}
+dependencies {
+ extraLibs fileTree(dir: 'libs', include: ['*.jar'])
+ //testCompile group: 'junit', name: 'junit', version: '4.12'
+ extraLibs project(path: ':sdl_java_ee')
+ configurations.implementation.extendsFrom(configurations.extraLibs)
+
+}
diff --git a/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.jar b/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..28861d273
--- /dev/null
+++ b/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.properties b/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..16f7ff6d1
--- /dev/null
+++ b/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Mar 18 15:56:54 EDT 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
diff --git a/hello_sdl_java_ee/gradlew b/hello_sdl_java_ee/gradlew
new file mode 100755
index 000000000..cccdd3d51
--- /dev/null
+++ b/hello_sdl_java_ee/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/hello_sdl_java_ee/gradlew.bat b/hello_sdl_java_ee/gradlew.bat
new file mode 100644
index 000000000..f9553162f
--- /dev/null
+++ b/hello_sdl_java_ee/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/hello_sdl_java_ee/settings.gradle b/hello_sdl_java_ee/settings.gradle
new file mode 100644
index 000000000..8a8a05513
--- /dev/null
+++ b/hello_sdl_java_ee/settings.gradle
@@ -0,0 +1,3 @@
+rootProject.name = 'hello_sdl_java_ee'
+include ":sdl_java_ee"
+project (":sdl_java_ee").projectDir = new File(rootProject.projectDir, "../javaEE/") \ No newline at end of file
diff --git a/hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java b/hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java
new file mode 100644
index 000000000..05d2d3dbe
--- /dev/null
+++ b/hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java
@@ -0,0 +1,51 @@
+package com.smartdevicelink;
+
+/**
+ * This is a sample of how to get Java EE Bean to work with an SDL application
+ * The code can be uncommented out with the proper gradle dependencies added
+ */
+
+
+// @ServerEndpoint("/")
+ // @Stateful(name = "SDLSessionEJB")
+ public class Main {
+
+ /* Session session;
+ static Thread thread = null, mainThread;
+ static Object LOCK;
+
+ static com.smartdevicelink.SdlService sdlService;
+ CustomTransport websocket;
+
+ @OnOpen
+ public void onOpen (Session session, EndpointConfig config) {
+ websocket = new CustomTransport("http://localhost") {
+ @Override
+ public void onWrite(byte[] bytes, int offset, int length) {
+ try {
+ session.getBasicRemote().sendBinary(ByteBuffer.wrap(bytes));
+ }
+ catch (IOException e) {
+
+ }
+ }
+ };
+ this.session = session;
+ sdlService = new com.smartdevicelink.SdlService(websocket, sdlServiceCallback);
+ sdlService.start();
+ }
+
+ @OnMessage
+ public void onMessage (ByteBuffer message, Session session) {
+ websocket.onByteBufferReceived(message);
+ }
+
+
+ static final com.smartdevicelink.SdlService.SdlServiceCallback sdlServiceCallback = new com.smartdevicelink.SdlService.SdlServiceCallback() {
+ @Override
+ public void onEnd() {
+
+ }
+ };
+ */
+ }
diff --git a/hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java b/hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java
new file mode 100644
index 000000000..58d98cf8d
--- /dev/null
+++ b/hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java
@@ -0,0 +1,207 @@
+package com.smartdevicelink;
+
+import android.util.Log;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.SdlManager;
+import com.smartdevicelink.managers.SdlManagerListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.TTSChunkFactory;
+import com.smartdevicelink.proxy.rpc.*;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.util.DebugTool;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Vector;
+
+public class SdlService {
+
+
+ private static final String TAG = "SDL Service";
+
+ private static final String APP_NAME = "Hello Sdl";
+ private static final String APP_ID = "8678309";
+
+ private static final String ICON_FILENAME = "hello_sdl_icon.png";
+ private static final String SDL_IMAGE_FILENAME = "sdl_full_image.png";
+
+ private static final String WELCOME_SHOW = "Welcome to HelloSDL";
+ private static final String WELCOME_SPEAK = "Welcome to Hello S D L";
+
+ private static final String TEST_COMMAND_NAME = "Test Command";
+ private static final int TEST_COMMAND_ID = 1;
+
+ private static final String IMAGE_DIR = "assets/images/";
+
+
+
+ // variable to create and call functions of the SyncProxy
+ private SdlManager sdlManager = null;
+
+ private SdlServiceCallback callback;
+
+
+ public SdlService(BaseTransportConfig config, SdlServiceCallback callback){
+ this.callback = callback;
+ buildSdlManager(config);
+ }
+
+
+
+ public void start() {
+ DebugTool.logInfo("SdlService start() ");
+ if(sdlManager != null){
+ sdlManager.start();
+ }
+ }
+
+ public void stop() {
+ if (sdlManager != null) {
+ sdlManager.dispose();
+ sdlManager = null;
+ }
+ }
+
+ private void buildSdlManager(BaseTransportConfig transport) {
+ // This logic is to select the correct transport and security levels defined in the selected build flavor
+ // Build flavors are selected by the "build variants" tab typically located in the bottom left of Android Studio
+ // Typically in your app, you will only set one of these.
+ if (sdlManager == null) {
+ DebugTool.logInfo("Creating SDL Manager");
+
+ //FIXME add the transport type
+ // The app type to be used
+ Vector<AppHMIType> appType = new Vector<>();
+ appType.add(AppHMIType.MEDIA);
+
+ // The manager listener helps you know when certain events that pertain to the SDL Manager happen
+ // Here we will listen for ON_HMI_STATUS and ON_COMMAND notifications
+ SdlManagerListener listener = new SdlManagerListener() {
+ @Override
+ public void onStart(SdlManager sdlManager) {
+ DebugTool.logInfo("SdlManager onStart");
+ }
+
+ @Override
+ public void onDestroy(SdlManager sdlManager) {
+ DebugTool.logInfo("SdlManager onDestroy ");
+ SdlService.this.sdlManager = null;
+ if(SdlService.this.callback != null){
+ SdlService.this.callback.onEnd();
+ }
+ }
+
+ @Override
+ public void onError(SdlManager sdlManager, String info, Exception e) {
+ }
+ };
+
+
+ HashMap<FunctionID,OnRPCNotificationListener> notificationListenerHashMap = new HashMap<FunctionID,OnRPCNotificationListener>();
+ notificationListenerHashMap.put(FunctionID.ON_HMI_STATUS, new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnHMIStatus status = (OnHMIStatus) notification;
+ if (status.getHmiLevel() == HMILevel.HMI_FULL && ((OnHMIStatus) notification).getFirstRun()) {
+ sendCommands();
+ performWelcomeSpeak();
+ performWelcomeShow();
+ }
+ }
+ });
+
+ notificationListenerHashMap.put(FunctionID.ON_COMMAND, new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnCommand command = (OnCommand) notification;
+ Integer id = command.getCmdID();
+ if(id != null){
+ switch(id){
+ case TEST_COMMAND_ID:
+ showTest();
+ break;
+ }
+ }
+ }
+ });
+
+
+ // Create App Icon, this is set in the SdlManager builder
+ SdlArtwork appIcon = new SdlArtwork(ICON_FILENAME, FileType.GRAPHIC_PNG, IMAGE_DIR+"sdl_s_green.png", true);
+
+ // The manager builder sets options for your session
+ SdlManager.Builder builder = new SdlManager.Builder(APP_ID, APP_NAME, listener);
+ builder.setAppTypes(appType);
+ builder.setTransportType(transport);
+ builder.setAppIcon(appIcon);
+ builder.setRPCNotificationListeners(notificationListenerHashMap);
+ sdlManager = builder.build();
+ }
+ }
+
+ /**
+ * Add commands for the app on SDL.
+ */
+ private void sendCommands(){
+ AddCommand command = new AddCommand();
+ MenuParams params = new MenuParams();
+ params.setMenuName(TEST_COMMAND_NAME);
+ command.setCmdID(TEST_COMMAND_ID);
+ command.setMenuParams(params);
+ command.setVrCommands(Collections.singletonList(TEST_COMMAND_NAME));
+ sdlManager.sendRPC(command);
+ }
+
+ /**
+ * Will speak a sample welcome message
+ */
+ private void performWelcomeSpeak(){
+ sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(WELCOME_SPEAK)));
+ }
+
+ /**
+ * Use the Screen Manager to set the initial screen text and set the image.
+ * Because we are setting multiple items, we will call beginTransaction() first,
+ * and finish with commit() when we are done.
+ */
+ private void performWelcomeShow() {
+ sdlManager.getScreenManager().beginTransaction();
+ sdlManager.getScreenManager().setTextField1(APP_NAME);
+ sdlManager.getScreenManager().setTextField2(WELCOME_SHOW);
+ sdlManager.getScreenManager().setPrimaryGraphic(new SdlArtwork(SDL_IMAGE_FILENAME, FileType.GRAPHIC_PNG, IMAGE_DIR+"sdl.png", true));
+ sdlManager.getScreenManager().commit(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ if (success){
+ Log.i(TAG, "welcome show successful");
+ }
+ }
+ });
+ }
+
+ /**
+ * Will show a sample test message on screen as well as speak a sample test message
+ */
+ private void showTest(){
+ sdlManager.getScreenManager().beginTransaction();
+ sdlManager.getScreenManager().setTextField1("Command has been selected");
+ sdlManager.getScreenManager().setTextField2("");
+ sdlManager.getScreenManager().commit(null);
+
+ sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(TEST_COMMAND_NAME)));
+ }
+
+
+ public interface SdlServiceCallback{
+ void onEnd();
+ }
+
+
+
+}
diff --git a/javaEE/README.md b/javaEE/README.md
new file mode 100644
index 000000000..8e7c3699d
--- /dev/null
+++ b/javaEE/README.md
@@ -0,0 +1,25 @@
+## SmartDeviceLink JavaEE
+
+The JavaEE project is meant to allow SDL compatibility for web applications.
+
+#### Dependency Managers
+
+To compile with the latest release of SDL JavaSE, include the following in your app's `build.gradle` file,
+
+```sh
+repositories {
+ jcenter()
+}
+dependencies {
+ implementation 'com.smartdevicelink:sdl_java_se:4.+'
+}
+```
+
+#### Manually building a JAR
+
+If you prefer making a JAR, simply call:
+
+```sh
+gradle build
+```
+from within the project and a JAR should be generated in the `build/libs` folder \ No newline at end of file
diff --git a/javaEE/bintray.gradle b/javaEE/bintray.gradle
new file mode 100644
index 000000000..f38754b20
--- /dev/null
+++ b/javaEE/bintray.gradle
@@ -0,0 +1,97 @@
+apply plugin: "com.jfrog.bintray"
+apply plugin: 'maven-publish'
+apply plugin: 'maven'
+
+def siteUrl = 'https://github.com/smartdevicelink/sdl_java_suite' // Homepage URL of the library
+def gitUrl = 'https://github.com/smartdevicelink/sdl_java_suite.git' // Git repository URL
+group = "com.smartdevicelink" // Maven Group ID for the artifact
+def libDescription = 'SmartDeviceLink mobile library'
+def libVersion = new File(projectDir.path, ('/../VERSION')).text.trim()
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+}
+
+javadoc.failOnError = false
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+}
+
+artifacts {
+ archives sourcesJar
+ archives javadocJar
+}
+
+bintray {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ // Authorization
+ user = props.getProperty("bintray.user")
+ key = props.getProperty("bintray.key")
+ version = libVersion
+ publications = ['mavenPublication']
+
+
+ pkg {
+ repo = props.getProperty("bintray.repo")
+ name = props.getProperty("bintray.artifact")
+ websiteUrl = siteUrl
+ vcsUrl = gitUrl
+ userOrg = props.getProperty("bintray.userorg")
+ licenses = ["BSD 3-Clause"]
+ publish = props.getProperty("bintray.publish") // Will upload to jCenter
+ version {
+ name = libVersion // Change to release version
+ desc = libDescription
+ released = new Date() // Will be the current date & time
+ vcsTag = libVersion // Should match git tag
+ }
+ }
+}
+
+def pomConfig = {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ licenses {
+ license {
+ name 'BSD 3-Clause'
+ url 'https://opensource.org/licenses/BSD-3-Clause'
+ distribution "repo"
+ }
+ }
+
+ scm {
+ url siteUrl
+ }
+}
+
+publishing {
+ publications {
+ mavenPublication(MavenPublication) {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ from components.java
+ artifact sourcesJar {
+ classifier "sources"
+ }
+ artifact javadocJar {
+ classifier "javadoc"
+ }
+ groupId props.getProperty("bintray.userorg")
+ artifactId props.getProperty("bintray.artifact")
+ version libVersion
+ pom.withXml {
+ def root = asNode()
+ root.appendNode('description', libDescription)
+ root.appendNode('name', props.getProperty("bintray.artifact"))
+ root.appendNode('url', siteUrl)
+ root.children().last() + pomConfig
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/javaEE/bintray.properties b/javaEE/bintray.properties
new file mode 100644
index 000000000..b1d2ca117
--- /dev/null
+++ b/javaEE/bintray.properties
@@ -0,0 +1,6 @@
+bintray.user=username
+bintray.key=apikey
+bintray.repo=sdl_java_ee
+bintray.artifact=sdl_java_ee
+bintray.userorg=smartdevicelink
+bintray.publish=true \ No newline at end of file
diff --git a/javaEE/build.gradle b/javaEE/build.gradle
new file mode 100644
index 000000000..08a6bcf1e
--- /dev/null
+++ b/javaEE/build.gradle
@@ -0,0 +1,79 @@
+apply plugin: 'java-library'
+
+group 'com.smartdevicelink'
+version new File(projectDir.path, ('/../VERSION')).text.trim()
+
+sourceCompatibility = 1.7
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ }
+}
+
+repositories {
+ google()
+ jcenter()
+}
+
+// This extraLibs solution is explained here: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5
+configurations {
+ // configuration that holds jars to include in the jar
+ extraLibs
+}
+
+dependencies {
+ extraLibs fileTree(dir: 'libs', include: ['*.jar'])
+ extraLibs 'org.mongodb:bson:3.10.1'
+ extraLibs 'com.android.support:support-annotations:28.0.0'
+ extraLibs 'org.java-websocket:Java-WebSocket:1.3.9'
+ configurations.api.extendsFrom(configurations.extraLibs)
+}
+
+sourceSets {
+ main.java.srcDirs += '../base/src/main/java'
+ main.java.srcDirs += '../javaSE/src/main/java'
+}
+
+jar {
+ dependsOn 'generateSources'
+ from {
+ configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+}
+
+task generateSources {
+ outputs.upToDateWhen { false }
+ File outputDir = file("$buildDir/../../javaSE/src/main/java/com/smartdevicelink/")
+ outputs.dir outputDir
+ doFirst {
+ println "Generating BuildConfig.java ..."
+ def srcFile = new File(outputDir, "BuildConfig.java")
+ srcFile.parentFile.mkdirs()
+ File license = new File("$buildDir/../../LICENSE")
+ if (license.exists()) {
+ srcFile.write("/*\n")
+ def lines = license.readLines()
+ for (line in lines) {
+ srcFile.append("* ")
+ srcFile.append(line)
+ srcFile.append("\n")
+ }
+ srcFile.append("*/\n")
+ }else{
+ srcFile.write("\n")
+ }
+ srcFile.append(
+ """package com.smartdevicelink;
+
+// THIS FILE IS AUTO GENERATED, DO NOT MODIFY!!
+public final class BuildConfig {
+ public static final String VERSION_NAME = "$project.version";
+}""")
+ }
+}
+
+apply from: 'bintray.gradle' \ No newline at end of file
diff --git a/javaEE/gradle/wrapper/gradle-wrapper.jar b/javaEE/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..87b738cbd
--- /dev/null
+++ b/javaEE/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/javaEE/gradle/wrapper/gradle-wrapper.properties b/javaEE/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..df8be2c19
--- /dev/null
+++ b/javaEE/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jan 25 11:10:08 EST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
diff --git a/javaEE/gradlew b/javaEE/gradlew
new file mode 100755
index 000000000..af6708ff2
--- /dev/null
+++ b/javaEE/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/javaEE/gradlew.bat b/javaEE/gradlew.bat
new file mode 100644
index 000000000..0f8d5937c
--- /dev/null
+++ b/javaEE/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/javaEE/settings.gradle b/javaEE/settings.gradle
new file mode 100644
index 000000000..4da4ab327
--- /dev/null
+++ b/javaEE/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'javaEE'
diff --git a/javaSE/README.md b/javaSE/README.md
new file mode 100644
index 000000000..e40e9ca4a
--- /dev/null
+++ b/javaSE/README.md
@@ -0,0 +1,25 @@
+## SmartDeviceLink JavaSE
+
+The JavaSE project is meant to allow SDL compatibility for embedded applications.
+
+#### Dependency Managers
+
+To compile with the latest release of SDL JavaSE, include the following in your app's `build.gradle` file,
+
+```sh
+repositories {
+ jcenter()
+}
+dependencies {
+ implementation 'com.smartdevicelink:sdl_java_se:4.+'
+}
+```
+
+#### Manually building a JAR
+
+If you prefer making a JAR, simply call:
+
+```sh
+gradle build
+```
+from within the project and a JAR should be generated in the `build/libs` folder \ No newline at end of file
diff --git a/javaSE/bintray.gradle b/javaSE/bintray.gradle
new file mode 100644
index 000000000..019d6dfe2
--- /dev/null
+++ b/javaSE/bintray.gradle
@@ -0,0 +1,97 @@
+apply plugin: "com.jfrog.bintray"
+apply plugin: 'maven-publish'
+apply plugin: 'maven'
+
+def siteUrl = 'https://github.com/smartdevicelink/sdl_java_suite' // Homepage URL of the library
+def gitUrl = 'https://github.com/smartdevicelink/sdl_java_suite.git' // Git repository URL
+group = "com.smartdevicelink" // Maven Group ID for the artifact
+def libDescription = 'SmartDeviceLink mobile library'
+def libVersion = new File(projectDir.path, ('/../VERSION')).text.trim()
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+}
+
+javadoc.failOnError = false
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+}
+
+artifacts {
+ archives sourcesJar
+ archives javadocJar
+}
+
+bintray {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ // Authorization
+ user = props.getProperty("bintray.user")
+ key = props.getProperty("bintray.key")
+ version = libVersion
+ publications = ['mavenPublication']
+
+
+ pkg {
+ repo = props.getProperty("bintray.repo")
+ name = props.getProperty("bintray.artifact")
+ websiteUrl = siteUrl
+ vcsUrl = gitUrl
+ userOrg = props.getProperty("bintray.userorg")
+ licenses = ["BSD 3-Clause"]
+ publish = props.getProperty("bintray.publish") // Will upload to jCenter
+ version {
+ name = libVersion // Change to release version
+ desc = libDescription
+ released = new Date() // Will be the current date & time
+ vcsTag = libVersion // Should match git tag
+ }
+ }
+}
+
+def pomConfig = {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ licenses {
+ license {
+ name 'BSD 3-Clause'
+ url 'https://opensource.org/licenses/BSD-3-Clause'
+ distribution "repo"
+ }
+ }
+
+ scm {
+ url siteUrl
+ }
+}
+
+publishing {
+ publications {
+ mavenPublication(MavenPublication) {
+ Properties props = new Properties()
+ props.load(new FileInputStream("$projectDir/bintray.properties"))
+
+ from components.java
+ artifact sourcesJar {
+ classifier "sources"
+ }
+ artifact javadocJar {
+ classifier "javadoc"
+ }
+ groupId props.getProperty("bintray.userorg")
+ artifactId props.getProperty("bintray.artifact")
+ version libVersion
+ pom.withXml {
+ def root = asNode()
+ root.appendNode('description', libDescription)
+ root.appendNode('name', props.getProperty("bintray.artifact"))
+ root.appendNode('url', siteUrl)
+ root.children().last() + pomConfig
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/javaSE/bintray.properties b/javaSE/bintray.properties
new file mode 100644
index 000000000..af97cacdc
--- /dev/null
+++ b/javaSE/bintray.properties
@@ -0,0 +1,6 @@
+bintray.user=username
+bintray.key=apikey
+bintray.repo=sdl_java_se
+bintray.artifact=sdl_java_se
+bintray.userorg=smartdevicelink
+bintray.publish=true \ No newline at end of file
diff --git a/javaSE/build.gradle b/javaSE/build.gradle
new file mode 100644
index 000000000..c6a393e8a
--- /dev/null
+++ b/javaSE/build.gradle
@@ -0,0 +1,79 @@
+apply plugin: 'java-library'
+
+group 'com.smartdevicelink'
+version new File(projectDir.path, ('/../VERSION')).text.trim()
+
+sourceCompatibility = 1.7
+
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ }
+}
+
+repositories {
+ google()
+ jcenter()
+}
+
+// This extraLibs solution is explained here: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5
+configurations {
+ // configuration that holds jars to include in the jar
+ extraLibs
+}
+
+dependencies {
+ extraLibs fileTree(dir: 'libs', include: ['*.jar'])
+ extraLibs 'org.mongodb:bson:3.10.1'
+ extraLibs 'com.android.support:support-annotations:28.0.0'
+ extraLibs 'org.java-websocket:Java-WebSocket:1.3.9'
+ configurations.api.extendsFrom(configurations.extraLibs)
+}
+
+sourceSets {
+ main.java.srcDirs += '../base/src/main/java'
+}
+
+jar {
+ dependsOn 'generateSources'
+ from {
+ configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+}
+
+task generateSources {
+ outputs.upToDateWhen { false }
+ File outputDir = file("$buildDir/../src/main/java/com/smartdevicelink/")
+ outputs.dir outputDir
+ doFirst {
+ println "Generating BuildConfig.java ..."
+ def srcFile = new File(outputDir, "BuildConfig.java")
+ srcFile.parentFile.mkdirs()
+ File license = new File("$buildDir/../../LICENSE")
+ if (license.exists()) {
+ srcFile.write("/*\n")
+ def lines = license.readLines()
+ for (line in lines) {
+ srcFile.append("* ")
+ srcFile.append(line)
+ srcFile.append("\n")
+ }
+ srcFile.append("*/\n")
+ }else{
+ srcFile.write("\n")
+ }
+ srcFile.append(
+"""package com.smartdevicelink;
+
+// THIS FILE IS AUTO GENERATED, DO NOT MODIFY!!
+public final class BuildConfig {
+ public static final String VERSION_NAME = "$project.version";
+}""")
+ }
+}
+
+apply from: 'bintray.gradle'
diff --git a/javaSE/gradle/wrapper/gradle-wrapper.jar b/javaSE/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..87b738cbd
--- /dev/null
+++ b/javaSE/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/javaSE/gradle/wrapper/gradle-wrapper.properties b/javaSE/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..ca21d83d3
--- /dev/null
+++ b/javaSE/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jan 25 17:44:56 EST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
diff --git a/javaSE/gradlew b/javaSE/gradlew
new file mode 100755
index 000000000..af6708ff2
--- /dev/null
+++ b/javaSE/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/javaSE/gradlew.bat b/javaSE/gradlew.bat
new file mode 100644
index 000000000..0f8d5937c
--- /dev/null
+++ b/javaSE/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/javaSE/settings.gradle b/javaSE/settings.gradle
new file mode 100644
index 000000000..f7ac48020
--- /dev/null
+++ b/javaSE/settings.gradle
@@ -0,0 +1,2 @@
+rootProject.name = 'javaSE'
+
diff --git a/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java b/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java
new file mode 100644
index 000000000..f7944d846
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* * Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* * Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* * Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
+* contributors may be used to endorse or promote products derived from
+* this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+package com.smartdevicelink;
+
+// THIS FILE IS AUTO GENERATED, DO NOT MODIFY!!
+public final class BuildConfig {
+ public static final String VERSION_NAME = "4.8.0";
+} \ No newline at end of file
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java
new file mode 100644
index 000000000..4c1b15398
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers;
+
+import android.support.annotation.NonNull;
+import android.util.Log;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.lifecycle.LifecycleManager;
+import com.smartdevicelink.managers.permission.PermissionManager;
+import com.smartdevicelink.managers.screen.ScreenManager;
+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.SystemCapabilityManager;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.*;
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
+import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
+import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCRequestListener;
+import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.transport.enums.TransportType;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.Version;
+
+import java.util.*;
+
+
+/**
+ * <strong>SDLManager</strong> <br>
+ *
+ * This is the main point of contact between an application and SDL <br>
+ *
+ * It is broken down to these areas: <br>
+ *
+ * 1. SDLManagerBuilder <br>
+ * 2. ISdl Interface along with its overridden methods - This can be passed into attached managers <br>
+ * 3. Sending Requests <br>
+ * 4. Helper methods
+ */
+public class SdlManager extends BaseSdlManager{
+
+ private static final String TAG = "SdlManager";
+
+ private SdlArtwork appIcon;
+ private SdlManagerListener managerListener;
+ private List<Class<? extends SdlSecurityBase>> sdlSecList;
+
+
+ // Managers
+ private LifecycleManager lifecycleManager;
+ private PermissionManager permissionManager;
+ private FileManager fileManager;
+ private ScreenManager screenManager;
+
+
+ // INTERNAL INTERFACE
+ /**
+ * This is from the LifeCycleManager directly. In the future if there is a reason to be a man in the middle
+ * the SdlManager could create it's own, however right now it was only a duplication of logic tied to the LCM.
+ */
+ private ISdl _internalInterface;
+
+
+ // Initialize proxyBridge with anonymous lifecycleListener
+ private final LifecycleManager.LifecycleListener lifecycleListener = new LifecycleManager.LifecycleListener() {
+ boolean initStarted = false;
+ @Override
+ public void onProxyConnected(LifecycleManager lifeCycleManager) {
+ Log.i(TAG,"Proxy is connected. Now initializing.");
+ synchronized (this){
+ if(!initStarted){
+ initialize();
+ initStarted = true;
+ }
+ }
+ }
+ @Override
+ public void onServiceStarted(SessionType sessionType){
+
+ }
+
+ @Override
+ public void onServiceEnded(SessionType sessionType){
+
+ }
+
+ @Override
+ public void onProxyClosed(LifecycleManager lifeCycleManager, String info, Exception e, SdlDisconnectedReason reason) {
+ Log.i(TAG,"Proxy is closed.");
+ if(managerListener != null){
+ managerListener.onDestroy(SdlManager.this);
+ }
+
+ }
+
+
+ @Override
+ public void onError(LifecycleManager lifeCycleManager, String info, Exception e) {
+
+ }
+ };
+
+ // Sub manager listener
+ private final CompletionListener subManagerListener = new CompletionListener() {
+ @Override
+ public synchronized void onComplete(boolean success) {
+ if(!success){
+ Log.e(TAG, "Sub manager failed to initialize");
+ }
+ checkState();
+ }
+ };
+
+ @Override
+ void checkState() {
+ if (permissionManager != null && fileManager != null && screenManager != null ){
+ if (permissionManager.getState() == BaseSubManager.READY && fileManager.getState() == BaseSubManager.READY && screenManager.getState() == BaseSubManager.READY){
+ DebugTool.logInfo("Starting sdl manager, all sub managers are in ready state");
+ transitionToState(BaseSubManager.READY);
+ handleQueuedNotifications();
+ notifyDevListener(null);
+ onReady();
+ } else if (permissionManager.getState() == BaseSubManager.ERROR && fileManager.getState() == BaseSubManager.ERROR && screenManager.getState() == BaseSubManager.ERROR){
+ String info = "ERROR starting sdl manager, all sub managers are in error state";
+ Log.e(TAG, info);
+ transitionToState(BaseSubManager.ERROR);
+ notifyDevListener(info);
+ } else if (permissionManager.getState() == BaseSubManager.SETTING_UP || fileManager.getState() == BaseSubManager.SETTING_UP || screenManager.getState() == BaseSubManager.SETTING_UP) {
+ DebugTool.logInfo("SETTING UP sdl manager, some sub managers are still setting up");
+ transitionToState(BaseSubManager.SETTING_UP);
+ // No need to notify developer here!
+ } else {
+ Log.w(TAG, "LIMITED starting sdl manager, some sub managers are in error or limited state and the others finished setting up");
+ transitionToState(BaseSubManager.LIMITED);
+ handleQueuedNotifications();
+ notifyDevListener(null);
+ onReady();
+ }
+ } else {
+ // We should never be here, but somehow one of the sub-sub managers is null
+ String info = "ERROR one of the sdl sub managers is null";
+ Log.e(TAG, info);
+ transitionToState(BaseSubManager.ERROR);
+ notifyDevListener(info);
+ }
+ }
+
+ private void notifyDevListener(String info) {
+ if (managerListener != null) {
+ if (getState() == BaseSubManager.ERROR){
+ managerListener.onError(this,info, null);
+ } else {
+ managerListener.onStart(this);
+ }
+ }
+ }
+
+ private void onReady(){
+ // Set the app icon
+ if (SdlManager.this.appIcon != null && SdlManager.this.appIcon.getName() != null) {
+ if (fileManager != null && fileManager.getState() == BaseSubManager.READY && !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);
+ }
+ }
+ }
+
+ @Override
+ protected void initialize(){
+ // Instantiate sub managers
+ this.permissionManager = new PermissionManager(_internalInterface);
+ this.fileManager = new FileManager(_internalInterface);
+ this.screenManager = new ScreenManager(_internalInterface, this.fileManager);
+
+ // Start sub managers
+ this.permissionManager.start(subManagerListener);
+ this.fileManager.start(subManagerListener);
+ this.screenManager.start(subManagerListener);
+ }
+
+ @Override
+ public void dispose() {
+ if (this.permissionManager != null) {
+ this.permissionManager.dispose();
+ }
+
+ if (this.fileManager != null) {
+ this.fileManager.dispose();
+ }
+
+ if (this.screenManager != null) {
+ this.screenManager.dispose();
+ }
+
+ if(managerListener != null){
+ managerListener.onDestroy(this);
+ managerListener = null;
+ }
+ }
+
+
+ // MANAGER GETTERS
+
+ /**
+ * Gets the PermissionManager. <br>
+ * <strong>Note: PermissionManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a PermissionManager object
+ */
+ public PermissionManager getPermissionManager() {
+ if (permissionManager.getState() != BaseSubManager.READY && permissionManager.getState() != BaseSubManager.LIMITED){
+ Log.e(TAG,"PermissionManager should not be accessed because it is not in READY/LIMITED state");
+ }
+ checkSdlManagerState();
+ return permissionManager;
+ }
+
+ /**
+ * Gets the FileManager. <br>
+ * <strong>Note: FileManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a FileManager object
+ */
+ public FileManager getFileManager() {
+ if (fileManager.getState() != BaseSubManager.READY && fileManager.getState() != BaseSubManager.LIMITED){
+ Log.e(TAG, "FileManager should not be accessed because it is not in READY/LIMITED state");
+ }
+ checkSdlManagerState();
+ return fileManager;
+ }
+
+ /**
+ * 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() {
+ if (screenManager.getState() != BaseSubManager.READY && screenManager.getState() != BaseSubManager.LIMITED){
+ Log.e(TAG, "ScreenManager should not be accessed because it is not in READY/LIMITED state");
+ }
+ checkSdlManagerState();
+ return screenManager;
+ }
+
+ /**
+ * 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 lifecycleManager.getSystemCapabilityManager(this);
+ }
+
+ /**
+ * Method to retrieve the RegisterAppInterface Response message that was sent back from the
+ * module. It contains various attributes about the connected module and can be used to adapt
+ * to different module types and their supported features.
+ *
+ * @return RegisterAppInterfaceResponse received from the module or null if the app has not yet
+ * registered with the module.
+ */
+ @Override
+ public RegisterAppInterfaceResponse getRegisterAppInterfaceResponse(){
+ if(lifecycleManager != null){
+ return lifecycleManager.getRegisterAppInterfaceResponse();
+ }
+ return null;
+ }
+
+ /**
+ * Get the current OnHMIStatus
+ * @return OnHMIStatus object represents the current OnHMIStatus
+ */
+ @Override
+ public OnHMIStatus getCurrentHMIStatus(){
+ if(this.lifecycleManager !=null ){
+ return lifecycleManager.getCurrentHMIStatus();
+ }
+ return null;
+ }
+
+ // PROTECTED GETTERS
+
+ /**
+ * Retrieves the auth token, if any, that was attached to the StartServiceACK for the RPC
+ * service from the module. For example, this should be used to login to a user account.
+ * @return the string representation of the auth token
+ */
+ @Override
+ public String getAuthToken(){
+ return this.lifecycleManager.getAuthToken();
+ }
+
+ // SENDING REQUESTS
+
+ /**
+ * Send RPC Message <br>
+ * @param message RPCMessage
+ */
+ @Override
+ public void sendRPC(RPCMessage message) {
+ _internalInterface.sendRPC(message);
+ }
+
+ /**
+ * Takes a list of RPCMessages and sends it to SDL in a synchronous fashion. Responses are captured through callback on OnMultipleRequestListener.
+ * For sending requests asynchronously, use sendRequests <br>
+ *
+ * <strong>NOTE: This will override any listeners on individual RPCs</strong><br>
+ *
+ * <strong>ADDITIONAL NOTE: This only takes the type of RPCRequest for now, notifications and responses will be thrown out</strong>
+ *
+ * @param rpcs is the list of RPCMessages being sent
+ * @param listener listener for updates and completions
+ */
+ @Override
+ public void sendSequentialRPCs(final List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener){
+
+ List<RPCRequest> rpcRequestList = new ArrayList<>();
+ for (int i = 0; i < rpcs.size(); i++) {
+ if (rpcs.get(i) instanceof RPCRequest){
+ rpcRequestList.add((RPCRequest)rpcs.get(i));
+ }
+ }
+
+ if (rpcRequestList.size() > 0) {
+ _internalInterface.sendSequentialRPCs(rpcRequestList, listener);
+ }
+ }
+
+ /**
+ * Takes a list of RPCMessages and sends it to SDL. Responses are captured through callback on OnMultipleRequestListener.
+ * For sending requests synchronously, use sendSequentialRPCs <br>
+ *
+ * <strong>NOTE: This will override any listeners on individual RPCs</strong> <br>
+ *
+ * <strong>ADDITIONAL NOTE: This only takes the type of RPCRequest for now, notifications and responses will be thrown out</strong>
+ *
+ * @param rpcs is the list of RPCMessages being sent
+ * @param listener listener for updates and completions
+ */
+ @Override
+ public void sendRPCs(List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener) {
+
+ List<RPCRequest> rpcRequestList = new ArrayList<>();
+ for (int i = 0; i < rpcs.size(); i++) {
+ if (rpcs.get(i) instanceof RPCRequest){
+ rpcRequestList.add((RPCRequest)rpcs.get(i));
+ }
+ }
+
+ if (rpcRequestList.size() > 0) {
+ _internalInterface.sendRequests(rpcRequestList,listener);
+ }
+ }
+
+ /**
+ * Add an OnRPCNotificationListener
+ * @param listener listener that will be called when a notification is received
+ */
+ @Override
+ public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ _internalInterface.addOnRPCNotificationListener(notificationId,listener);
+ }
+
+ /**
+ * Remove an OnRPCNotificationListener
+ * @param listener listener that was previously added
+ */
+ @Override
+ public void removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ _internalInterface.removeOnRPCNotificationListener(notificationId, listener);
+ }
+
+ /**
+ * Add an OnRPCRequestListener
+ * @param listener listener that will be called when a request is received
+ */
+ @Override
+ public void addOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener){
+ _internalInterface.addOnRPCRequestListener(requestId,listener);
+ }
+
+ /**
+ * Remove an OnRPCRequestListener
+ * @param listener listener that was previously added
+ */
+ @Override
+ public void removeOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener){
+ _internalInterface.removeOnRPCRequestListener(requestId, listener);
+ }
+
+ // LIFECYCLE / OTHER
+
+ // STARTUP
+
+ /**
+ * Starts up a SdlManager, and calls provided callback called once all BaseSubManagers are done setting up
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void start(){
+ Log.i(TAG, "start");
+ if (lifecycleManager == null) {
+ if (transport != null
+ && (transport.getTransportType().equals(TransportType.WEB_SOCKET_SERVER) || transport.getTransportType().equals(TransportType.CUSTOM))) {
+ //Do the thing
+
+ LifecycleManager.AppConfig appConfig = new LifecycleManager.AppConfig();
+ appConfig.setAppName(appName);
+ //short app name
+ appConfig.setMediaApp(isMediaApp);
+ appConfig.setHmiDisplayLanguageDesired(hmiLanguage);
+ appConfig.setLanguageDesired(hmiLanguage);
+ appConfig.setAppType(hmiTypes);
+ appConfig.setVrSynonyms(vrSynonyms);
+ appConfig.setTtsName(ttsChunks);
+ appConfig.setDayColorScheme(dayColorScheme);
+ appConfig.setNightColorScheme(nightColorScheme);
+ appConfig.setAppID(appId);
+ appConfig.setMinimumProtocolVersion(minimumProtocolVersion);
+ appConfig.setMinimumRPCVersion(minimumRPCVersion);
+
+ lifecycleManager = new LifecycleManager(appConfig, transport, lifecycleListener);
+ _internalInterface = lifecycleManager.getInternalInterface(SdlManager.this);
+
+ if (sdlSecList != null && !sdlSecList.isEmpty()) {
+ lifecycleManager.setSdlSecurityClassList(sdlSecList);
+ }
+
+ //Setup the notification queue
+ initNotificationQueue();
+
+ lifecycleManager.start();
+
+
+ }else{
+ throw new RuntimeException("No transport provided");
+ }
+ }
+ }
+
+
+ // BUILDER
+ public static class Builder {
+ SdlManager sdlManager;
+
+ /**
+ * Builder for the SdlManager. Parameters in the constructor are required.
+ * @param appId the app's ID
+ * @param appName the app's name
+ * @param listener a SdlManagerListener object
+ */
+ public Builder(@NonNull final String appId, @NonNull final String appName, @NonNull final SdlManagerListener listener){
+ sdlManager = new SdlManager();
+ setAppId(appId);
+ setAppName(appName);
+ setManagerListener(listener);
+ }
+
+ /**
+ * Sets the App ID
+ * @param appId String representation of the App ID retreived from the SDL Developer Portal
+ */
+ public Builder setAppId(@NonNull final String appId){
+ sdlManager.appId = appId;
+ return this;
+ }
+
+ /**
+ * Sets the Application Name
+ * @param appName String that will be associated as the app's name
+ */
+ public Builder setAppName(@NonNull final String appName){
+ sdlManager.appName = appName;
+ return this;
+ }
+
+ /**
+ * Sets the Short Application Name
+ * @param shortAppName a shorter representation of the app's name for smaller displays
+ */
+ public Builder setShortAppName(final String shortAppName) {
+ sdlManager.shortAppName = shortAppName;
+ return this;
+ }
+
+ /**
+ * Sets the minimum protocol version that will be permitted to connect.
+ * If the protocol version of the head unit connected is below this version,
+ * the app will disconnect with an EndService protocol message and will not register.
+ * @param minimumProtocolVersion the minimum Protocol spec version that should be accepted
+ */
+ public Builder setMinimumProtocolVersion(final Version minimumProtocolVersion) {
+ sdlManager.minimumProtocolVersion = minimumProtocolVersion;
+ return this;
+ }
+
+ /**
+ * The minimum RPC version that will be permitted to connect.
+ * If the RPC version of the head unit connected is below this version, an UnregisterAppInterface will be sent.
+ * @param minimumRPCVersion the minimum RPC spec version that should be accepted
+ */
+ public Builder setMinimumRPCVersion(final Version minimumRPCVersion) {
+ sdlManager.minimumRPCVersion = minimumRPCVersion;
+ return this;
+ }
+
+ /**
+ * Sets the Language of the App
+ * @param hmiLanguage the desired language to be used on the display/HMI of the connected module
+ */
+ public Builder setLanguage(final Language hmiLanguage){
+ sdlManager.hmiLanguage = hmiLanguage;
+ return this;
+ }
+
+ /**
+ * Sets the TemplateColorScheme for daytime
+ * @param dayColorScheme color scheme that will be used (if supported) when the display is in a "Day Mode" or
+ * similar. Should comprise of colors that contrast well during the day under sunlight.
+ */
+ public Builder setDayColorScheme(final TemplateColorScheme dayColorScheme){
+ sdlManager.dayColorScheme = dayColorScheme;
+ return this;
+ }
+
+ /**
+ * Sets the TemplateColorScheme for nighttime
+ * @param nightColorScheme color scheme that will be used (if supported) when the display is in a "Night Mode"
+ * or similar. Should comprise of colors that contrast well during the night and are not
+ * brighter than average.
+ */
+ public Builder setNightColorScheme(final TemplateColorScheme nightColorScheme){
+ sdlManager.nightColorScheme = nightColorScheme;
+ return this;
+ }
+
+ /**
+ * Sets the icon for the app on head unit / In-Vehicle-Infotainment system <br>
+ * @param sdlArtwork the icon that will be used to represent this application on the connected module
+ */
+ public Builder setAppIcon(final SdlArtwork sdlArtwork){
+ sdlManager.appIcon = sdlArtwork;
+ return this;
+ }
+
+ /**
+ * Sets the vector of AppHMIType <br>
+ * <strong>Note: This should be an ordered list from most -> least relevant</strong>
+ * @param hmiTypes HMI types that represent this application. For example, if the app is a music player, the
+ * MEDIA HMIType should be included.
+ */
+ public Builder setAppTypes(final Vector<AppHMIType> hmiTypes){
+
+ sdlManager.hmiTypes = hmiTypes;
+
+ if (hmiTypes != null) {
+ sdlManager.isMediaApp = hmiTypes.contains(AppHMIType.MEDIA);
+ }
+
+ return this;
+ }
+
+ /**
+ * Sets the voice recognition synonyms that can be used to identify this application.
+ * @param vrSynonyms a vector of Strings that can be associated with this app. For example the app's name should
+ * be included as well as any phonetic spellings of the app name that might help the on-board
+ * VR system associated a users spoken word with the supplied synonyms.
+ */
+ public Builder setVrSynonyms(final Vector<String> vrSynonyms) {
+ sdlManager.vrSynonyms = vrSynonyms;
+ return this;
+ }
+
+ /**
+ * Sets the Text-To-Speech Name of the application. These TTSChunks might be used by the module as an audio
+ * representation of the app's name.
+ * @param ttsChunks the TTS chunks that can represent this app's name
+ */
+ public Builder setTtsName(final Vector<TTSChunk> ttsChunks) {
+ sdlManager.ttsChunks = ttsChunks;
+ return this;
+ }
+
+ /**
+ * This Object type may change with the transport refactor
+ * Sets the BaseTransportConfig
+ * @param transport the type of transport that should be used for this SdlManager instance.
+ */
+ public Builder setTransportType(BaseTransportConfig transport){
+ sdlManager.transport = transport;
+ return this;
+ }
+
+ /**
+ * Sets the Security libraries
+ * @param secList The list of security class(es)
+ */
+ public Builder setSdlSecurity(List<Class<? extends SdlSecurityBase>> secList) {
+ sdlManager.sdlSecList = secList;
+ return this;
+ }
+
+ /**
+ * Set the SdlManager Listener
+ * @param listener the listener
+ */
+ public Builder setManagerListener(@NonNull final SdlManagerListener listener){
+ sdlManager.managerListener = listener;
+ return this;
+ }
+
+ /**
+ * Set RPCNotification listeners. SdlManager will preload these listeners before any RPCs are sent/received.
+ * @param listeners a map of listeners that will be called when a notification is received.
+ * Key represents the FunctionID of the notification and value represents the listener
+ */
+ public Builder setRPCNotificationListeners(Map<FunctionID, OnRPCNotificationListener> listeners){
+ sdlManager.onRPCNotificationListeners = listeners;
+ return this;
+ }
+
+ public SdlManager build() {
+
+ if (sdlManager.appName == null) {
+ throw new IllegalArgumentException("You must specify an app name by calling setAppName");
+ }
+
+ if (sdlManager.appId == null) {
+ 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);
+ sdlManager.hmiTypes = hmiTypesDefault;
+ sdlManager.isMediaApp = false;
+ }
+
+ if (sdlManager.hmiLanguage == null){
+ sdlManager.hmiLanguage = Language.EN_US;
+ }
+
+ if (sdlManager.minimumProtocolVersion == null){
+ sdlManager.minimumProtocolVersion = new Version("1.0.0");
+ }
+
+ if (sdlManager.minimumRPCVersion == null){
+ sdlManager.minimumRPCVersion = new Version("1.0.0");
+ }
+
+ sdlManager.transitionToState(BaseSubManager.SETTING_UP);
+
+ return sdlManager;
+ }
+ }
+
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java b/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
new file mode 100644
index 000000000..ee44f0d54
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers;
+
+public interface SdlManagerListener extends BaseSdlManagerListener {
+
+ /**
+ * Called when a manager is ready for use
+ */
+ void onStart(SdlManager manager);
+
+ /**
+ * Called when the manager is destroyed
+ */
+ void onDestroy(SdlManager manager);
+
+ /**
+ * Called when the manager encounters an error
+ * @param info info regarding the error
+ * @param e the exception
+ */
+ void onError(SdlManager manager, String info, Exception e);
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java
new file mode 100644
index 000000000..01787f7b7
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.file;
+
+
+import android.support.annotation.NonNull;
+import com.smartdevicelink.managers.file.filetypes.SdlFile;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.util.FileUtls;
+
+/**
+ * <strong>FileManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+ *
+ * The SDLFileManager uploads files and keeps track of all the uploaded files names during a session. <br>
+ *
+ * We need to add the following struct: SDLFile<br>
+ *
+ * It is broken down to these areas: <br>
+ *
+ * 1. Getters <br>
+ * 2. Deletion methods <br>
+ * 3. Uploading Files / Artwork
+ */
+public class FileManager extends BaseFileManager {
+
+ public FileManager(ISdl internalInterface) {
+
+ // setup
+ super(internalInterface);
+ }
+
+ /**
+ * Creates and returns a PutFile request that would upload a given SdlFile
+ * @param file SdlFile with fileName and one of A) fileData, B) Uri, or C) resourceID set
+ * @return a valid PutFile request if SdlFile contained a fileName and sufficient data
+ */
+ @Override
+ PutFile createPutFile(@NonNull final SdlFile file){
+ PutFile putFile = new PutFile();
+ if(file.getName() == null){
+ throw new IllegalArgumentException("You must specify an file name in the SdlFile");
+ }else{
+ putFile.setSdlFileName(file.getName());
+ }
+
+ if(file.getFilePath() != null){
+ //Attempt to access the file via a path
+ byte[] data = FileUtls.getFileData(file.getFilePath());
+ if(data != null ){
+ putFile.setFileData(data);
+ }else{
+ throw new IllegalArgumentException("File at path was empty");
+ }
+ }else if(file.getFileData() != null){
+ // Use file data (raw bytes) to upload file
+ putFile.setFileData(file.getFileData());
+ }else{
+ throw new IllegalArgumentException("The SdlFile to upload does " +
+ "not specify its resourceId, Uri, or file data");
+ }
+
+ if(file.getType() != null){
+ putFile.setFileType(file.getType());
+ }
+ putFile.setPersistentFile(file.isPersistent());
+
+ return putFile;
+ }
+
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java b/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
new file mode 100644
index 000000000..6e8085e0a
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.file.filetypes;
+
+import android.support.annotation.NonNull;
+import com.smartdevicelink.proxy.rpc.Image;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.ImageType;
+import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+
+/**
+ * A class that extends SdlFile, representing artwork (JPEG, PNG, or BMP) to be uploaded to core
+ */
+public class SdlArtwork extends SdlFile {
+ private boolean isTemplate;
+ private Image imageRPC;
+
+ /**
+ * Creates a new instance of SdlArtwork
+ */
+ public SdlArtwork(){}
+
+ /**
+ * Creates a new instance of SdlArtwork
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param filePath a String value representing the the location of the file
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, String filePath, boolean persistentFile) {
+ super(fileName, fileType, filePath, persistentFile);
+ }
+
+ /**
+ * Creates a new instance of SdlArtwork
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param data a byte array representing the data of the file
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile) {
+ super(fileName, fileType, data, persistentFile);
+ }
+
+ /**
+ * Creates a new instance of SdlArtwork
+ * @param staticIconName a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
+ */
+ public SdlArtwork(@NonNull StaticIconName staticIconName) {
+ super(staticIconName);
+ }
+
+ /**
+ * Sets whether this SdlArtwork is a template image whose coloring should be decided by the HMI
+ * @param isTemplate boolean that tells whether this SdlArtwork is a template image
+ */
+ public void setTemplateImage(boolean isTemplate){
+ this.isTemplate = isTemplate;
+ }
+
+ /**
+ * Gets whether this SdlArtwork is a template image whose coloring should be decided by the HMI
+ * @return boolean that tells whether this SdlArtwork is a template image
+ */
+ public boolean isTemplateImage(){
+ return isTemplate;
+ }
+
+
+ @Override
+ public void setType(@NonNull FileType fileType) {
+ if(fileType.equals(FileType.GRAPHIC_JPEG) || fileType.equals(FileType.GRAPHIC_PNG)
+ || fileType.equals(FileType.GRAPHIC_BMP)){
+ super.setType(fileType);
+ }else{
+ throw new IllegalArgumentException("Only JPEG, PNG, and BMP image types are supported.");
+ }
+ }
+
+ /**
+ * Gets the Image RPC representing this artwork. Generally for use internally, you should instead pass an artwork to a Screen Manager method
+ * @return The Image RPC representing this artwork.
+ */
+ public Image getImageRPC() {
+ if (imageRPC == null) {
+ if (isStaticIcon()) {
+ imageRPC = new Image(getName(), ImageType.STATIC);
+ imageRPC.setIsTemplate(true);
+ } else {
+ imageRPC = new Image(getName(), ImageType.DYNAMIC);
+ imageRPC.setIsTemplate(isTemplate);
+ }
+ }
+ return imageRPC;
+ }
+} \ No newline at end of file
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
new file mode 100644
index 000000000..40bc08b74
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.file.filetypes;
+
+import android.support.annotation.NonNull;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+
+/**
+ * A class representing data to be uploaded to core
+ */
+public class SdlFile{
+ private String fileName;
+ private String filePath;
+ private byte[] fileData;
+ private FileType fileType;
+ private boolean persistentFile;
+ private boolean isStaticIcon;
+
+ /**
+ * Creates a new instance of SdlFile
+ */
+ public SdlFile(){}
+
+ /**
+ * Creates a new instance of SdlFile
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param filePath a String value representing the the location of the file
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlFile(@NonNull String fileName, @NonNull FileType fileType, String filePath, boolean persistentFile){
+ this.fileName = fileName;
+ this.fileType = fileType;
+ this.filePath = filePath;
+ this.persistentFile = persistentFile;
+ }
+
+ /**
+ * Creates a new instance of SdlFile
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ * @param fileType a FileType enum value representing the type of the file
+ * @param data a byte array representing the data of the file
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public SdlFile(@NonNull String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile){
+ this.fileName = fileName;
+ this.fileType = fileType;
+ this.fileData = data;
+ this.persistentFile = persistentFile;
+ }
+
+ /**
+ * Creates a new instance of SdlFile
+ * @param staticIconName a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
+ */
+ public SdlFile(@NonNull StaticIconName staticIconName){
+ this.fileName = staticIconName.toString();
+ this.fileData = staticIconName.toString().getBytes();
+ this.persistentFile = false;
+ this.isStaticIcon = true;
+ }
+
+ /**
+ * Sets the name of the file
+ * @param fileName a String value representing the name that will be used to store the file in the head unit
+ */
+ public void setName(@NonNull String fileName){
+ this.fileName = fileName;
+ }
+
+ /**
+ * Gets the name of the file
+ * @return a String value representing the name that will be used to store the file in the head unit
+ */
+ public String getName(){
+ return fileName;
+ }
+
+ /**
+ * Sets the location of the file
+ * @param filePath a String value representing the the location of the file
+ */
+ public void setFilePath(String filePath){
+ this.filePath = filePath;
+ }
+
+ /**
+ * Gets the location of the file
+ * @return
+ */
+ public String getFilePath(){
+ return this.filePath;
+ }
+
+ /**
+ * Sets the byte array that represents the content of the file
+ * @param data a byte array representing the data of the file
+ */
+ public void setFileData(byte[] data){
+ this.fileData = data;
+ }
+
+ /**
+ * Gets the byte array that represents the content of the file
+ * @return a byte array representing the data of the file
+ */
+ public byte[] getFileData(){
+ return fileData;
+ }
+
+ /**
+ * Sets the type of the file
+ * @param fileType a FileType enum value representing the type of the file
+ */
+ public void setType(@NonNull FileType fileType){
+ this.fileType = fileType;
+ }
+
+ /**
+ * Gets the type of the file
+ * @return a FileType enum value representing the type of the file
+ */
+ public FileType getType(){
+ return fileType;
+ }
+
+ /**
+ * Sets whether the file should persist between sessions / ignition cycles
+ * @param persistentFile a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public void setPersistent(boolean persistentFile){
+ this.persistentFile = persistentFile;
+ }
+
+ /**
+ * Gets whether the file should persist between sessions / ignition cycles
+ * @return a boolean value that indicates if the file is meant to persist between sessions / ignition cycles
+ */
+ public boolean isPersistent(){
+ return this.persistentFile;
+ }
+
+ /**
+ * Sets the the name of the static file. Static files comes pre-shipped with the head unit
+ * @param staticIcon a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
+ */
+ public void setStaticIcon(boolean staticIcon) {
+ isStaticIcon = staticIcon;
+ }
+
+ /**
+ * Gets the the name of the static file. Static files comes pre-shipped with the head unit
+ * @return a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit
+ */
+ public boolean isStaticIcon() {
+ return isStaticIcon;
+ }
+} \ No newline at end of file
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
new file mode 100644
index 000000000..9c7b1d092
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
@@ -0,0 +1,1329 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.smartdevicelink.managers.lifecycle;
+
+import android.support.annotation.RestrictTo;
+import android.util.Log;
+import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.managers.SdlManager;
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.MessageType;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.*;
+import com.smartdevicelink.proxy.interfaces.*;
+import com.smartdevicelink.proxy.rpc.*;
+import com.smartdevicelink.proxy.rpc.enums.*;
+import com.smartdevicelink.proxy.rpc.listeners.*;
+import com.smartdevicelink.security.SdlSecurityBase;
+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.CorrelationIdGenerator;
+import com.smartdevicelink.util.DebugTool;
+import com.smartdevicelink.util.FileUtls;
+import com.smartdevicelink.util.Version;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Vector;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * The lifecycle manager creates a centeral point for all SDL session logic to converge. It should only be used by
+ * the library itself. Usage outside the library is not permitted and will not be protected for in the future.
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY)
+public class LifecycleManager extends BaseLifecycleManager {
+
+ private static final String TAG = "Lifecycle Manager";
+
+ public static final Version MAX_SUPPORTED_RPC_VERSION = new Version(5, 1, 0);
+
+ // Protected Correlation IDs
+ private final int REGISTER_APP_INTERFACE_CORRELATION_ID = 65529,
+ UNREGISTER_APP_INTERFACE_CORRELATION_ID = 65530;
+
+
+ // Sdl Synchronization Objects
+ private static final Object RPC_LISTENER_LOCK = new Object(),
+ ON_UPDATE_LISTENER_LOCK = new Object(),
+ ON_REQUEST_LISTENER_LOCK = new Object(),
+ ON_NOTIFICATION_LISTENER_LOCK = new Object();
+
+
+
+ SdlSession session;
+ AppConfig appConfig;
+
+ //protected Version protocolVersion = new Version(1,0,0);
+ protected Version rpcSpecVersion = MAX_SUPPORTED_RPC_VERSION;
+
+
+ private final HashMap<Integer,CopyOnWriteArrayList<OnRPCListener>> rpcListeners;
+ private final HashMap<Integer, OnRPCResponseListener> rpcResponseListeners;
+ private final HashMap<Integer, CopyOnWriteArrayList<OnRPCNotificationListener>> rpcNotificationListeners;
+ private final HashMap<Integer, CopyOnWriteArrayList<OnRPCRequestListener>> rpcRequestListeners;
+
+ protected final SystemCapabilityManager systemCapabilityManager;
+
+ protected RegisterAppInterfaceResponse raiResponse = null;
+
+ private OnHMIStatus currentHMIStatus;
+ protected boolean firstTimeFull = true;
+
+ final LifecycleListener lifecycleListener;
+
+ private List<Class<? extends SdlSecurityBase>> _secList = null;
+ private String authToken;
+ private Version minimumProtocolVersion;
+ private Version minimumRPCVersion;
+
+ public LifecycleManager(AppConfig appConfig, BaseTransportConfig config, LifecycleListener listener){
+
+ this.lifecycleListener = listener;
+
+ this.rpcListeners = new HashMap<>();
+ this.rpcResponseListeners = new HashMap<>();
+ this.rpcNotificationListeners = new HashMap<>();
+ this.rpcRequestListeners = new HashMap<>();
+
+ this.appConfig = appConfig;
+ this.minimumProtocolVersion = appConfig.minimumProtocolVersion;
+ this.minimumRPCVersion = appConfig.minimumRPCVersion;
+ this.session = new SdlSession(sdlConnectionListener, config);
+
+ this.systemCapabilityManager = new SystemCapabilityManager(internalInterface);
+
+ }
+
+ public void start(){
+ try {
+ setupInternalRpcListeners();
+ session.startSession();
+ } catch (SdlException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public void stop(){
+ session.close();
+ }
+
+ private Version getProtocolVersion(){
+ if (session != null){
+ return session.getProtocolVersion();
+ }
+ return new Version(1,0,0);
+ }
+
+ private void sendRPCs(List<? extends RPCMessage> messages, OnMultipleRequestListener listener){
+ if(messages != null ){
+ for(RPCMessage message : messages){
+ if(message instanceof RPCRequest){
+ RPCRequest request = ((RPCRequest) message);
+ request.setCorrelationID(CorrelationIdGenerator.generateId());
+ if(listener != null){
+ listener.addCorrelationId(request.getCorrelationID());
+ request.setOnRPCResponseListener(listener.getSingleRpcResponseListener());
+ }
+ this.sendRPCMessagePrivate(request);
+
+ }else{
+ this.sendRPCMessagePrivate(message);
+ }
+ }
+ }
+ }
+
+ private void sendSequentialRPCs(final List<? extends RPCMessage> messages, final OnMultipleRequestListener listener){
+ if (messages != null){
+ int requestCount = messages.size();
+
+ // Break out of recursion, we have finished the requests
+ if (requestCount == 0) {
+ if(listener != null){
+ listener.onFinished();
+ }
+ return;
+ }
+
+ RPCMessage rpc = messages.remove(0);
+
+ // Request Specifics
+ if (rpc.getMessageType().equals(RPCMessage.KEY_REQUEST)) {
+ RPCRequest request = (RPCRequest) rpc;
+ request.setCorrelationID(CorrelationIdGenerator.generateId());
+
+ request.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ if (response.getSuccess()) {
+ // success
+ if (listener != null) {
+ listener.onUpdate(messages.size());
+ }
+ // recurse after successful response of RPC
+ sendSequentialRPCs(messages, listener);
+ }
+ }
+
+ @Override
+ public void onError(int correlationId, Result resultCode, String info) {
+ if (listener != null) {
+ listener.onError(correlationId, resultCode, info);
+ }
+ }
+ });
+ sendRPCMessagePrivate(request);
+ } else {
+ // Notifications and Responses
+ sendRPCMessagePrivate(rpc);
+ if (listener != null) {
+ listener.onUpdate(messages.size());
+ }
+ // recurse after sending a notification or response as there is no response.
+ sendSequentialRPCs(messages, listener);
+ }
+ }
+ }
+
+ /**
+ * This method is used to ensure all of the methods in this class can remain private and no grantees can be made
+ * to the developer what methods are available or not.
+ *
+ * <b>NOTE: THERE IS NO GURANTEE THIS WILL BE A VALID SYSTEM CAPABILITY MANAGER</b>
+ *
+ * @param sdlManager this must be a working manager instance
+ * @return the system capability manager.
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
+ public SystemCapabilityManager getSystemCapabilityManager(SdlManager sdlManager){
+ if(sdlManager != null){
+ return systemCapabilityManager;
+ }
+ return null;
+ }
+
+ private boolean isConnected(){
+ if(session != null){
+ return session.getIsConnected();
+ }else{
+ return false;
+ }
+ }
+
+ /**
+ * Method to retrieve the RegisterAppInterface Response message that was sent back from the
+ * module. It contains various attributes about the connected module and can be used to adapt
+ * to different module types and their supported features.
+ *
+ * @return RegisterAppInterfaceResponse received from the module or null if the app has not yet
+ * registered with the module.
+ */
+ public RegisterAppInterfaceResponse getRegisterAppInterfaceResponse(){
+ return this.raiResponse;
+ }
+
+
+ /**
+ * Get the current OnHMIStatus
+ * @return OnHMIStatus object represents the current OnHMIStatus
+ */
+ public OnHMIStatus getCurrentHMIStatus() {
+ return currentHMIStatus;
+ }
+
+ private void onClose(String info, Exception e){
+ Log.i(TAG, "onClose");
+ if(lifecycleListener != null){
+ lifecycleListener.onProxyClosed(this, info,e,null);
+ }
+ }
+
+ /**
+ * This method is used to ensure all of the methods in this class can remain private and no grantees can be made
+ * to the developer what methods are available or not.
+ *
+ * @param sdlManager this must be a working manager instance
+ * @return the internal interface that hooks into this manager
+ */
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
+ public ISdl getInternalInterface(SdlManager sdlManager) {
+ if (sdlManager != null) {
+ return internalInterface;
+ }
+ return null;
+ }
+
+
+ /* *******************************************************************************************************
+ ********************************** INTERNAL - RPC LISTENERS !! START !! *********************************
+ *********************************************************************************************************/
+
+ private void setupInternalRpcListeners(){
+ addRpcListener(FunctionID.REGISTER_APP_INTERFACE, rpcListener);
+ addRpcListener(FunctionID.ON_HMI_STATUS, rpcListener);
+ addRpcListener(FunctionID.ON_HASH_CHANGE, rpcListener);
+ addRpcListener(FunctionID.ON_SYSTEM_REQUEST, rpcListener);
+ addRpcListener(FunctionID.ON_APP_INTERFACE_UNREGISTERED, rpcListener);
+ addRpcListener(FunctionID.UNREGISTER_APP_INTERFACE, rpcListener);
+ }
+
+
+ private OnRPCListener rpcListener = new OnRPCListener() {
+ @Override
+ public void onReceived(RPCMessage message) {
+ //Make sure this is a response as expected
+ FunctionID functionID = message.getFunctionID();
+ if (functionID != null) {
+ switch (functionID) {
+ case REGISTER_APP_INTERFACE:
+ //We have begun
+ Log.i(TAG, "RAI Response");
+ raiResponse = (RegisterAppInterfaceResponse) message;
+ SdlMsgVersion rpcVersion = ((RegisterAppInterfaceResponse) message).getSdlMsgVersion();
+ if (rpcVersion != null) {
+ LifecycleManager.this.rpcSpecVersion = new Version(rpcVersion.getMajorVersion(), rpcVersion.getMinorVersion(), rpcVersion.getPatchVersion());
+ } else {
+ LifecycleManager.this.rpcSpecVersion = MAX_SUPPORTED_RPC_VERSION;
+ }
+ if (minimumRPCVersion != null && minimumRPCVersion.isNewerThan(rpcSpecVersion) == 1) {
+ Log.w(TAG, String.format("Disconnecting from head unit, the configured minimum RPC version %s is greater than the supported RPC version %s", minimumRPCVersion, rpcSpecVersion));
+ UnregisterAppInterface msg = new UnregisterAppInterface();
+ msg.setCorrelationID(UNREGISTER_APP_INTERFACE_CORRELATION_ID);
+ sendRPCMessagePrivate(msg);
+ cleanProxy();
+ return;
+ }
+ processRaiResponse(raiResponse);
+ systemCapabilityManager.parseRAIResponse(raiResponse);
+ break;
+ case ON_HMI_STATUS:
+ Log.i(TAG, "on hmi status");
+ boolean shouldInit = currentHMIStatus == null;
+ currentHMIStatus = (OnHMIStatus) message;
+ if (lifecycleListener != null && shouldInit) {
+ lifecycleListener.onProxyConnected(LifecycleManager.this);
+ }
+ break;
+ case ON_HASH_CHANGE:
+ break;
+ case ON_SYSTEM_REQUEST:
+ final OnSystemRequest onSystemRequest = (OnSystemRequest) message;
+ if ((onSystemRequest.getUrl() != null) &&
+ (((onSystemRequest.getRequestType() == RequestType.PROPRIETARY) && (onSystemRequest.getFileType() == FileType.JSON))
+ || ((onSystemRequest.getRequestType() == RequestType.HTTP) && (onSystemRequest.getFileType() == FileType.BINARY)))) {
+ Thread handleOffboardTransmissionThread = new Thread() {
+ @Override
+ public void run() {
+ RPCRequest request = PoliciesFetcher.fetchPolicies(onSystemRequest);
+ if (request != null && isConnected()) {
+ sendRPCMessagePrivate(request);
+ }
+ }
+ };
+ handleOffboardTransmissionThread.start();
+ }else if (onSystemRequest.getRequestType() == RequestType.ICON_URL) {
+ //Download the icon file and send SystemRequest RPC
+ Thread handleOffBoardTransmissionThread = new Thread() {
+ @Override
+ public void run() {
+ byte[] file = FileUtls.downloadFile(onSystemRequest.getUrl());
+ if (file != null) {
+ SystemRequest systemRequest = new SystemRequest();
+ systemRequest.setFileName(onSystemRequest.getUrl());
+ systemRequest.setBulkData(file);
+ systemRequest.setRequestType(RequestType.ICON_URL);
+ if (isConnected()) {
+ sendRPCMessagePrivate(systemRequest);
+ }
+ } else {
+ DebugTool.logError("File was null at: " + onSystemRequest.getUrl());
+ }
+ }
+ };
+ handleOffBoardTransmissionThread.start();
+ }
+ break;
+ case ON_APP_INTERFACE_UNREGISTERED:
+ Log.v(TAG, "on app interface unregistered");
+ cleanProxy();
+ break;
+ case UNREGISTER_APP_INTERFACE:
+ Log.v(TAG, "unregister app interface");
+ cleanProxy();
+ break;
+ }
+ }
+ }
+
+
+
+ };
+
+ /* *******************************************************************************************************
+ ********************************** INTERNAL - RPC LISTENERS !! END !! *********************************
+ *********************************************************************************************************/
+
+
+ /* *******************************************************************************************************
+ ********************************** METHODS - RPC LISTENERS !! START !! **********************************
+ *********************************************************************************************************/
+
+ private boolean onRPCReceived(final RPCMessage message){
+ synchronized(RPC_LISTENER_LOCK){
+ if(message == null || message.getFunctionID() == null){
+ return false;
+ }
+
+ final int id = message.getFunctionID().getId();
+ CopyOnWriteArrayList<OnRPCListener> listeners = rpcListeners.get(id);
+ if(listeners!=null && listeners.size()>0) {
+ for (OnRPCListener listener : listeners) {
+ listener.onReceived(message);
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ private void addRpcListener(FunctionID id, OnRPCListener listener){
+ synchronized(RPC_LISTENER_LOCK){
+ if (id != null && listener != null) {
+ if (!rpcListeners.containsKey(id.getId())) {
+ rpcListeners.put(id.getId(), new CopyOnWriteArrayList<OnRPCListener>());
+ }
+
+ rpcListeners.get(id.getId()).add(listener);
+ }
+ }
+ }
+
+ private boolean removeOnRPCListener(FunctionID id, OnRPCListener listener){
+ synchronized(RPC_LISTENER_LOCK){
+ if(rpcListeners!= null
+ && id != null
+ && listener != null
+ && rpcListeners.containsKey(id.getId())){
+ return rpcListeners.get(id.getId()).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Only call this method for a PutFile response. It will cause a class cast exception if not.
+ * @param correlationId correlation id of the packet being updated
+ * @param bytesWritten how many bytes were written
+ * @param totalSize the total size in bytes
+ */
+ @SuppressWarnings("unused")
+ private void onPacketProgress(int correlationId, long bytesWritten, long totalSize){
+ synchronized(ON_UPDATE_LISTENER_LOCK){
+ if(rpcResponseListeners !=null
+ && rpcResponseListeners.containsKey(correlationId)){
+ ((OnPutFileUpdateListener)rpcResponseListeners.get(correlationId)).onUpdate(correlationId, bytesWritten, totalSize);
+ }
+ }
+
+ }
+
+ /**
+ * Will provide callback to the listener either onFinish or onError depending on the RPCResponses result code,
+ * <p>Will automatically remove the listener for the list of listeners on completion.
+ * @param msg The RPCResponse message that was received
+ * @return if a listener was called or not
+ */
+ @SuppressWarnings("UnusedReturnValue")
+ private boolean onRPCResponseReceived(RPCResponse msg){
+ synchronized(ON_UPDATE_LISTENER_LOCK){
+ int correlationId = msg.getCorrelationID();
+ if(rpcResponseListeners !=null
+ && rpcResponseListeners.containsKey(correlationId)){
+ OnRPCResponseListener listener = rpcResponseListeners.get(correlationId);
+ if(msg.getSuccess()){
+ listener.onResponse(correlationId, msg);
+ }else{
+ listener.onError(correlationId, msg.getResultCode(), msg.getInfo());
+ }
+ rpcResponseListeners.remove(correlationId);
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Add a listener that will receive the response to the specific RPCRequest sent with the corresponding correlation id
+ * @param listener that will get called back when a response is received
+ * @param correlationId of the RPCRequest that was sent
+ * @param totalSize only include if this is an OnPutFileUpdateListener. Otherwise it will be ignored.
+ */
+ private void addOnRPCResponseListener(OnRPCResponseListener listener,int correlationId, int totalSize){
+ synchronized(ON_UPDATE_LISTENER_LOCK){
+ if(rpcResponseListeners!=null
+ && listener !=null){
+ if(listener.getListenerType() == OnRPCResponseListener.UPDATE_LISTENER_TYPE_PUT_FILE){
+ ((OnPutFileUpdateListener)listener).setTotalSize(totalSize);
+ }
+ listener.onStart(correlationId);
+ rpcResponseListeners.put(correlationId, listener);
+ }
+ }
+ }
+
+ @SuppressWarnings("unused")
+ private HashMap<Integer, OnRPCResponseListener> getResponseListeners(){
+ synchronized(ON_UPDATE_LISTENER_LOCK){
+ return this.rpcResponseListeners;
+ }
+ }
+
+ /**
+ * Retrieves the auth token, if any, that was attached to the StartServiceACK for the RPC
+ * service from the module. For example, this should be used to login to a user account.
+ * @return the string representation of the auth token
+ */
+ public String getAuthToken(){
+ return this.authToken;
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ private boolean onRPCNotificationReceived(RPCNotification notification){
+ if(notification == null){
+ DebugTool.logError("onRPCNotificationReceived - Notification was null");
+ return false;
+ }
+ DebugTool.logInfo("onRPCNotificationReceived - " + notification.getFunctionName() );
+
+ //Before updating any listeners, make sure to do any final updates to the notification RPC now
+ if(FunctionID.ON_HMI_STATUS.toString().equals(notification.getFunctionName())){
+ OnHMIStatus onHMIStatus = (OnHMIStatus) notification;
+ onHMIStatus.setFirstRun(firstTimeFull);
+ if (onHMIStatus.getHmiLevel() == HMILevel.HMI_FULL) {
+ firstTimeFull = false;
+ }
+ }
+
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ CopyOnWriteArrayList<OnRPCNotificationListener> listeners = rpcNotificationListeners.get(FunctionID.getFunctionId(notification.getFunctionName()));
+ if(listeners!=null && listeners.size()>0) {
+ for (OnRPCNotificationListener listener : listeners) {
+ listener.onNotified(notification);
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * This will add a listener for the specific type of notification. As of now it will only allow
+ * a single listener per notification function id
+ * @param notificationId The notification type that this listener is designated for
+ * @param listener The listener that will be called when a notification of the provided type is received
+ */
+ @SuppressWarnings("unused")
+ private void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ if(notificationId != null && listener != null){
+ if(!rpcNotificationListeners.containsKey(notificationId.getId())){
+ rpcNotificationListeners.put(notificationId.getId(),new CopyOnWriteArrayList<OnRPCNotificationListener>());
+ }
+ rpcNotificationListeners.get(notificationId.getId()).add(listener);
+ }
+ }
+ }
+
+ private boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ synchronized(ON_NOTIFICATION_LISTENER_LOCK){
+ if(rpcNotificationListeners!= null
+ && notificationId != null
+ && listener != null
+ && rpcNotificationListeners.containsKey(notificationId.getId())){
+ return rpcNotificationListeners.get(notificationId.getId()).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ private boolean onRPCRequestReceived(RPCRequest request){
+ if(request == null){
+ DebugTool.logError("onRPCRequestReceived - request was null");
+ return false;
+ }
+ DebugTool.logInfo("onRPCRequestReceived - " + request.getFunctionName() );
+
+ synchronized(ON_REQUEST_LISTENER_LOCK){
+ CopyOnWriteArrayList<OnRPCRequestListener> listeners = rpcRequestListeners.get(FunctionID.getFunctionId(request.getFunctionName()));
+ if(listeners!=null && listeners.size()>0) {
+ for (OnRPCRequestListener listener : listeners) {
+ listener.onRequest(request);
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * This will add a listener for the specific type of request. As of now it will only allow
+ * a single listener per request function id
+ * @param requestId The request type that this listener is designated for
+ * @param listener The listener that will be called when a request of the provided type is received
+ */
+ @SuppressWarnings("unused")
+ private void addOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener){
+ synchronized(ON_REQUEST_LISTENER_LOCK){
+ if(requestId != null && listener != null){
+ if(!rpcRequestListeners.containsKey(requestId.getId())){
+ rpcRequestListeners.put(requestId.getId(),new CopyOnWriteArrayList<OnRPCRequestListener>());
+ }
+ rpcRequestListeners.get(requestId.getId()).add(listener);
+ }
+ }
+ }
+
+ @SuppressWarnings("UnusedReturnValue")
+ private boolean removeOnRPCRequestListener(FunctionID requestId, OnRPCRequestListener listener){
+ synchronized(ON_REQUEST_LISTENER_LOCK){
+ if(rpcRequestListeners!= null
+ && requestId != null
+ && listener != null
+ && rpcRequestListeners.containsKey(requestId.getId())){
+ return rpcRequestListeners.get(requestId.getId()).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ /* *******************************************************************************************************
+ **************************************** RPC LISTENERS !! END !! ****************************************
+ *********************************************************************************************************/
+
+
+
+ private void sendRPCMessagePrivate(RPCMessage message){
+ try {
+ //FIXME this is temporary until the next major release of the library where OK is removed
+ if (message.getMessageType().equals(RPCMessage.KEY_REQUEST)) {
+ RPCRequest request = (RPCRequest) message;
+ if(FunctionID.SUBSCRIBE_BUTTON.toString().equals(request.getFunctionName())
+ || FunctionID.UNSUBSCRIBE_BUTTON.toString().equals(request.getFunctionName())
+ || FunctionID.BUTTON_PRESS.toString().equals(request.getFunctionName())) {
+
+ ButtonName buttonName = (ButtonName) request.getObject(ButtonName.class, SubscribeButton.KEY_BUTTON_NAME);
+
+
+ if (rpcSpecVersion != null) {
+ if (rpcSpecVersion.getMajor() < 5) {
+
+ if (ButtonName.PLAY_PAUSE.equals(buttonName)) {
+ request.setParameters(SubscribeButton.KEY_BUTTON_NAME, ButtonName.OK);
+ }
+ } else { //Newer than version 5.0.0
+ if (ButtonName.OK.equals(buttonName)) {
+ RPCRequest request2 = new RPCRequest(request);
+ request2.setParameters(SubscribeButton.KEY_BUTTON_NAME, ButtonName.PLAY_PAUSE);
+ request2.setOnRPCResponseListener(request.getOnRPCResponseListener());
+ sendRPCMessagePrivate(request2);
+ return;
+ }
+ }
+ }
+
+ }
+ }
+
+
+ message.format(rpcSpecVersion,true);
+ byte[] msgBytes = JsonRPCMarshaller.marshall(message, (byte)getProtocolVersion().getMajor());
+
+ ProtocolMessage pm = new ProtocolMessage();
+ pm.setData(msgBytes);
+ if (session != null){
+ pm.setSessionID(session.getSessionId());
+ }
+
+ pm.setMessageType(MessageType.RPC);
+ pm.setSessionType(SessionType.RPC);
+ pm.setFunctionID(FunctionID.getFunctionId(message.getFunctionName()));
+ pm.setPayloadProtected(message.isPayloadProtected());
+
+ if(RPCMessage.KEY_REQUEST.equals(message.getMessageType())){ // Request Specifics
+ pm.setRPCType((byte)0x00);
+ Integer corrId = ((RPCRequest)message).getCorrelationID();
+ if( corrId== null) {
+ Log.e(TAG, "No correlation ID attached to request. Not sending");
+ return;
+ }else{
+ pm.setCorrID(corrId);
+
+ OnRPCResponseListener listener = ((RPCRequest)message).getOnRPCResponseListener();
+ if(listener != null){
+ addOnRPCResponseListener(listener, corrId, msgBytes.length);
+ }
+ }
+ }else if (RPCMessage.KEY_RESPONSE.equals(message.getMessageType())){ // Response Specifics
+ RPCResponse response = (RPCResponse) message;
+ pm.setRPCType((byte)0x01);
+ if (response.getCorrelationID() == null) {
+ //Log error here
+ //throw new SdlException("CorrelationID cannot be null. RPC: " + response.getFunctionName(), SdlExceptionCause.INVALID_ARGUMENT);
+ Log.e(TAG, "No correlation ID attached to response. Not sending");
+ return;
+ } else {
+ pm.setCorrID(response.getCorrelationID());
+ }
+ }else if (message.getMessageType().equals(RPCMessage.KEY_NOTIFICATION)) { // Notification Specifics
+ pm.setRPCType((byte)0x02);
+ }
+
+ if (message.getBulkData() != null){
+ pm.setBulkData(message.getBulkData());
+ }
+
+ if(message.getFunctionName().equalsIgnoreCase(FunctionID.PUT_FILE.name())){
+ pm.setPriorityCoefficient(1);
+ }
+
+ session.sendMessage(pm);
+
+ } catch (OutOfMemoryError e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /* *******************************************************************************************************
+ *************************************** ISdlConnectionListener START ************************************
+ *********************************************************************************************************/
+
+ final ISdlConnectionListener sdlConnectionListener = new ISdlConnectionListener() {
+ @Override
+ public void onTransportDisconnected(String info) {
+ onClose(info, null);
+
+ }
+
+ @Override
+ public void onTransportDisconnected(String info, boolean availablePrimary, BaseTransportConfig transportConfig) {
+ if (!availablePrimary) {
+ onClose(info, null);
+ }
+
+ }
+
+ @Override
+ public void onTransportError(String info, Exception e) {
+ onClose(info, e);
+
+ }
+
+ @Override
+ public void onProtocolMessageReceived(ProtocolMessage msg) {
+ //Incoming message
+ if (SessionType.RPC.equals(msg.getSessionType())
+ || SessionType.BULK_DATA.equals(msg.getSessionType())) {
+
+ RPCMessage rpc = RpcConverter.extractRpc(msg, session.getProtocolVersion());
+ if (rpc != null) {
+ String messageType = rpc.getMessageType();
+ Log.v(TAG, "RPC received - " + messageType);
+
+ rpc.format(rpcSpecVersion, true);
+
+ onRPCReceived(rpc);
+
+ if (RPCMessage.KEY_RESPONSE.equals(messageType)) {
+
+ onRPCResponseReceived((RPCResponse) rpc);
+
+ } else if (RPCMessage.KEY_NOTIFICATION.equals(messageType)) {
+ FunctionID functionID = rpc.getFunctionID();
+ if (functionID != null && (functionID.equals(FunctionID.ON_BUTTON_PRESS)) || functionID.equals(FunctionID.ON_BUTTON_EVENT)) {
+ RPCNotification notificationCompat = handleButtonNotificationFormatting(rpc);
+ if(notificationCompat != null){
+ onRPCNotificationReceived((notificationCompat));
+ }
+ }
+
+ onRPCNotificationReceived((RPCNotification) rpc);
+
+ } else if (RPCMessage.KEY_REQUEST.equals(messageType)) {
+
+ onRPCRequestReceived((RPCRequest) rpc);
+
+ }
+ } else {
+ Log.w(TAG, "Shouldn't be here");
+ }
+ }
+
+ }
+
+ @Override
+ public void onProtocolSessionStartedNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
+ Log.w(TAG, "onProtocolSessionStartedNACKed " + sessionID);
+ }
+
+ @Override
+ public void onProtocolSessionStarted(SessionType sessionType, byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
+
+ Log.i(TAG, "on protocol session started");
+ if (sessionType != null) {
+ if (minimumProtocolVersion != null && minimumProtocolVersion.isNewerThan(getProtocolVersion()) == 1) {
+ Log.w(TAG, String.format("Disconnecting from head unit, the configured minimum protocol version %s is greater than the supported protocol version %s", minimumProtocolVersion, getProtocolVersion()));
+ session.endService(sessionType, session.getSessionId());
+ cleanProxy();
+ return;
+ }
+
+ if (sessionType.equals(SessionType.RPC)) {
+ if (appConfig != null) {
+
+ appConfig.prepare();
+
+ SdlMsgVersion sdlMsgVersion = new SdlMsgVersion();
+ sdlMsgVersion.setMajorVersion(MAX_SUPPORTED_RPC_VERSION.getMajor());
+ sdlMsgVersion.setMinorVersion(MAX_SUPPORTED_RPC_VERSION.getMinor());
+ sdlMsgVersion.setPatchVersion(MAX_SUPPORTED_RPC_VERSION.getPatch());
+
+ RegisterAppInterface rai = new RegisterAppInterface(sdlMsgVersion,
+ appConfig.getAppName(), appConfig.isMediaApp(), appConfig.getLanguageDesired(),
+ appConfig.getHmiDisplayLanguageDesired(), appConfig.getAppID());
+ rai.setCorrelationID(REGISTER_APP_INTERFACE_CORRELATION_ID);
+
+ rai.setTtsName(appConfig.getTtsName());
+ rai.setNgnMediaScreenAppName(appConfig.getNgnMediaScreenAppName());
+ rai.setVrSynonyms(appConfig.getVrSynonyms());
+ rai.setAppHMIType(appConfig.getAppType());
+ rai.setDayColorScheme(appConfig.getDayColorScheme());
+ rai.setNightColorScheme(appConfig.getNightColorScheme());
+
+ //Add device/system info in the future
+ //TODO attach previous hash id
+
+ sendRPCMessagePrivate(rai);
+ } else {
+ Log.e(TAG, "App config was null, soo...");
+ }
+
+
+ } else {
+ lifecycleListener.onServiceStarted(sessionType);
+ }
+ }
+ }
+
+ @Override
+ public void onProtocolSessionEnded(SessionType sessionType, byte sessionID, String correlationID) {
+
+ }
+
+ @Override
+ public void onProtocolSessionEndedNACKed(SessionType sessionType, byte sessionID, String correlationID) {
+
+ }
+
+ @Override
+ public void onProtocolError(String info, Exception e) {
+ DebugTool.logError("Protocol Error - " + info, e);
+ }
+
+ @Override
+ public void onHeartbeatTimedOut(byte sessionID) { /* Deprecated */ }
+
+ @Override
+ public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID) {/* Unused */ }
+
+
+ @Override
+ public void onAuthTokenReceived(String token, byte sessionID) {
+ LifecycleManager.this.authToken = token;
+ }
+
+ };
+ /* *******************************************************************************************************
+ *************************************** ISdlConnectionListener END ************************************
+ *********************************************************************************************************/
+
+
+ /* *******************************************************************************************************
+ ******************************************** ISdl - START ***********************************************
+ *********************************************************************************************************/
+
+ final ISdl internalInterface = new ISdl() {
+ @Override
+ public void start() {
+ LifecycleManager.this.start();
+ }
+
+ @Override
+ public void stop() {
+ LifecycleManager.this.stop();
+ }
+
+ @Override
+ public boolean isConnected() {
+ return LifecycleManager.this.session.getIsConnected();
+ }
+
+ @Override
+ public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
+ LifecycleManager.this.session.addServiceListener(serviceType,sdlServiceListener);
+ }
+
+ @Override
+ public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
+ LifecycleManager.this.session.removeServiceListener(serviceType,sdlServiceListener);
+
+ }
+
+ @Override
+ public void startVideoService(VideoStreamingParameters parameters, boolean encrypted) {
+ DebugTool.logWarning("startVideoService is not currently implemented");
+
+ }
+
+ @Override
+ public void stopVideoService() {
+ DebugTool.logWarning("stopVideoService is not currently implemented");
+
+ }
+
+ @Override
+ public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters) {
+ DebugTool.logWarning("startVideoStream is not currently implemented");
+ return null;
+ }
+
+ @Override
+ public void startAudioService(boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params) {
+ DebugTool.logWarning("startAudioService is not currently implemented");
+ }
+
+ @Override
+ public void startAudioService(boolean encrypted) {
+ DebugTool.logWarning("startAudioService is not currently implemented");
+
+ }
+
+ @Override
+ public void stopAudioService() {
+ DebugTool.logWarning("stopAudioService is not currently implemented");
+ }
+
+ @Override
+ public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec, AudioStreamingParams params) {
+ DebugTool.logWarning("startAudioStream is not currently implemented");
+ return null;
+ }
+
+ @Override
+ public void sendRPCRequest(RPCRequest message) {
+ LifecycleManager.this.sendRPCMessagePrivate(message);
+
+ }
+
+ @Override
+ public void sendRPC(RPCMessage message) {
+ if(isConnected()) {
+ LifecycleManager.this.sendRPCMessagePrivate(message);
+ }
+ }
+
+ @Override
+ public void sendRequests(List<? extends RPCRequest> rpcs, OnMultipleRequestListener listener) {
+ LifecycleManager.this.sendRPCs(rpcs,listener);
+ }
+
+ @Override
+ public void sendSequentialRPCs(List<? extends RPCMessage> rpcs, OnMultipleRequestListener listener) {
+ LifecycleManager.this.sendSequentialRPCs(rpcs,listener);
+ }
+
+ @Override
+ public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
+ LifecycleManager.this.addOnRPCNotificationListener(notificationId,listener);
+ }
+
+ @Override
+ public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
+ return LifecycleManager.this.removeOnRPCNotificationListener(notificationId,listener);
+ }
+
+ @Override
+ public void addOnRPCRequestListener(FunctionID notificationId, OnRPCRequestListener listener) {
+ LifecycleManager.this.addOnRPCRequestListener(notificationId, listener);
+ }
+
+ @Override
+ public boolean removeOnRPCRequestListener(FunctionID notificationId, OnRPCRequestListener listener) {
+ return LifecycleManager.this.removeOnRPCRequestListener(notificationId, listener);
+ }
+
+ @Override
+ public void addOnRPCListener(FunctionID responseId, OnRPCListener listener) {
+ LifecycleManager.this.addRpcListener(responseId,listener);
+ }
+
+ @Override
+ public boolean removeOnRPCListener(FunctionID responseId, OnRPCListener listener) {
+ return LifecycleManager.this.removeOnRPCListener(responseId,listener);
+ }
+
+ @Override
+ public Object getCapability(SystemCapabilityType systemCapabilityType) {
+ return LifecycleManager.this.systemCapabilityManager.getCapability(systemCapabilityType);
+ }
+
+ @Override
+ public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) {
+ LifecycleManager.this.systemCapabilityManager.getCapability(systemCapabilityType,scListener);
+
+ }
+
+ @Override
+ public boolean isCapabilitySupported(SystemCapabilityType systemCapabilityType) {
+ return LifecycleManager.this.systemCapabilityManager.isCapabilitySupported(systemCapabilityType);
+ }
+
+ @Override
+ public void addOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) {
+ LifecycleManager.this.systemCapabilityManager.addOnSystemCapabilityListener(systemCapabilityType,listener);
+
+ }
+
+ @Override
+ public boolean removeOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) {
+ return LifecycleManager.this.systemCapabilityManager.removeOnSystemCapabilityListener(systemCapabilityType,listener);
+ }
+
+ @Override
+ public boolean isTransportForServiceAvailable(SessionType serviceType) {
+ return LifecycleManager.this.session.isTransportForServiceAvailable(serviceType);
+ }
+
+ @Override
+ public SdlMsgVersion getSdlMsgVersion() {
+ SdlMsgVersion msgVersion = new SdlMsgVersion(rpcSpecVersion.getMajor(), rpcSpecVersion.getMinor());
+ msgVersion.setPatchVersion(rpcSpecVersion.getPatch());
+ return msgVersion;
+ }
+
+ @Override
+ public Version getProtocolVersion() {
+ return LifecycleManager.this.getProtocolVersion();
+ }
+ };
+
+ /* *******************************************************************************************************
+ ********************************************* ISdl - END ************************************************
+ *********************************************************************************************************/
+
+ public interface LifecycleListener{
+ void onProxyConnected(LifecycleManager lifeCycleManager);
+ void onProxyClosed(LifecycleManager lifeCycleManager, String info, Exception e, SdlDisconnectedReason reason);
+ void onServiceStarted(SessionType sessionType);
+ void onServiceEnded(SessionType sessionType);
+ void onError(LifecycleManager lifeCycleManager, String info, Exception e);
+ }
+
+ public static class AppConfig{
+ private String appID, appName, ngnMediaScreenAppName;
+ private Vector<TTSChunk> ttsName;
+ private Vector<String> vrSynonyms;
+ private boolean isMediaApp = false;
+ private Language languageDesired, hmiDisplayLanguageDesired;
+ private Vector<AppHMIType> appType;
+ private TemplateColorScheme dayColorScheme, nightColorScheme;
+ private Version minimumProtocolVersion;
+ private Version minimumRPCVersion;
+
+ private void prepare(){
+ if (getNgnMediaScreenAppName() == null) {
+ setNgnMediaScreenAppName(getAppName());
+ }
+
+ if (getLanguageDesired() == null) {
+ setLanguageDesired(Language.EN_US);
+ }
+
+ if (getHmiDisplayLanguageDesired() == null) {
+ setHmiDisplayLanguageDesired(Language.EN_US);
+ }
+
+ if (getVrSynonyms() == null) {
+ setVrSynonyms(new Vector<String>());
+ getVrSynonyms().add(getAppName());
+ }
+ }
+
+ public String getAppID() {
+ return appID;
+ }
+
+ public void setAppID(String appID) {
+ this.appID = appID;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getNgnMediaScreenAppName() {
+ return ngnMediaScreenAppName;
+ }
+
+ public void setNgnMediaScreenAppName(String ngnMediaScreenAppName) {
+ this.ngnMediaScreenAppName = ngnMediaScreenAppName;
+ }
+
+ public Vector<TTSChunk> getTtsName() {
+ return ttsName;
+ }
+
+ public void setTtsName(Vector<TTSChunk> ttsName) {
+ this.ttsName = ttsName;
+ }
+
+ public Vector<String> getVrSynonyms() {
+ return vrSynonyms;
+ }
+
+ public void setVrSynonyms(Vector<String> vrSynonyms) {
+ this.vrSynonyms = vrSynonyms;
+ }
+
+ public boolean isMediaApp() {
+ return isMediaApp;
+ }
+
+ public void setMediaApp(boolean mediaApp) {
+ isMediaApp = mediaApp;
+ }
+
+ public Language getLanguageDesired() {
+ return languageDesired;
+ }
+
+ public void setLanguageDesired(Language languageDesired) {
+ this.languageDesired = languageDesired;
+ }
+
+ public Language getHmiDisplayLanguageDesired() {
+ return hmiDisplayLanguageDesired;
+ }
+
+ public void setHmiDisplayLanguageDesired(Language hmiDisplayLanguageDesired) {
+ this.hmiDisplayLanguageDesired = hmiDisplayLanguageDesired;
+ }
+
+ public Vector<AppHMIType> getAppType() {
+ return appType;
+ }
+
+ public void setAppType(Vector<AppHMIType> appType) {
+ this.appType = appType;
+ }
+
+ public TemplateColorScheme getDayColorScheme() {
+ return dayColorScheme;
+ }
+
+ public void setDayColorScheme(TemplateColorScheme dayColorScheme) {
+ this.dayColorScheme = dayColorScheme;
+ }
+
+ public TemplateColorScheme getNightColorScheme() {
+ return nightColorScheme;
+ }
+
+ public void setNightColorScheme(TemplateColorScheme nightColorScheme) {
+ this.nightColorScheme = nightColorScheme;
+ }
+
+ public Version getMinimumProtocolVersion() {
+ return minimumProtocolVersion;
+ }
+
+ /**
+ * Sets the minimum protocol version that will be permitted to connect.
+ * If the protocol version of the head unit connected is below this version,
+ * the app will disconnect with an EndService protocol message and will not register.
+ *
+ * @param minimumProtocolVersion a Version object with the minimally accepted Protocol version
+ */
+ public void setMinimumProtocolVersion(Version minimumProtocolVersion) {
+ this.minimumProtocolVersion = minimumProtocolVersion;
+ }
+
+ public Version getMinimumRPCVersion() {
+ return minimumRPCVersion;
+ }
+
+ /**
+ * The minimum RPC version that will be permitted to connect.
+ * If the RPC version of the head unit connected is below this version, an UnregisterAppInterface will be sent.
+ *
+ * @param minimumRPCVersion a Version object with the minimally accepted RPC spec version
+ */
+ public void setMinimumRPCVersion(Version minimumRPCVersion) {
+ this.minimumRPCVersion = minimumRPCVersion;
+ }
+ }
+
+
+ /**
+ * Temporary method to bridge the new PLAY_PAUSE and OKAY button functionality with the old
+ * OK button name. This should be removed during the next major release
+ * @param notification an RPC message object that should be either an ON_BUTTON_EVENT or ON_BUTTON_PRESS otherwise
+ * it will be ignored
+ */
+ private RPCNotification handleButtonNotificationFormatting(RPCMessage notification){
+ if(FunctionID.ON_BUTTON_EVENT.toString().equals(notification.getFunctionName())
+ || FunctionID.ON_BUTTON_PRESS.toString().equals(notification.getFunctionName())){
+
+ ButtonName buttonName = (ButtonName)notification.getObject(ButtonName.class, OnButtonEvent.KEY_BUTTON_NAME);
+ ButtonName compatBtnName = null;
+
+ if(rpcSpecVersion != null && rpcSpecVersion.getMajor() >= 5){
+ if(ButtonName.PLAY_PAUSE.equals(buttonName)){
+ compatBtnName = ButtonName.OK;
+ }
+ }else{ // rpc spec version is either null or less than 5
+ if(ButtonName.OK.equals(buttonName)){
+ compatBtnName = ButtonName.PLAY_PAUSE;
+ }
+ }
+
+ try {
+ if (compatBtnName != null) { //There is a button name that needs to be swapped out
+ RPCNotification notification2;
+ //The following is done because there is currently no way to make a deep copy
+ //of an RPC. Since this code will be removed, it's ugliness is borderline acceptable.
+ if (notification instanceof OnButtonEvent) {
+ OnButtonEvent onButtonEvent = new OnButtonEvent();
+ onButtonEvent.setButtonEventMode(((OnButtonEvent) notification).getButtonEventMode());
+ onButtonEvent.setCustomButtonID(((OnButtonEvent) notification).getCustomButtonID());
+ notification2 = onButtonEvent;
+ } else if (notification instanceof OnButtonPress) {
+ OnButtonPress onButtonPress = new OnButtonPress();
+ onButtonPress.setButtonPressMode(((OnButtonPress) notification).getButtonPressMode());
+ onButtonPress.setCustomButtonName(((OnButtonPress) notification).getCustomButtonName());
+ notification2 = onButtonPress;
+ } else {
+ return null;
+ }
+
+ notification2.setParameters(OnButtonEvent.KEY_BUTTON_NAME, compatBtnName);
+ return notification2;
+ }
+ }catch (Exception e){
+ //Should never get here
+ }
+ }
+ return null;
+ }
+
+ private void cleanProxy(){
+ if (rpcListeners != null) {
+ rpcListeners.clear();
+ }
+ if (rpcResponseListeners != null) {
+ rpcResponseListeners.clear();
+ }
+ if (rpcNotificationListeners != null) {
+ rpcNotificationListeners.clear();
+ }
+ if (rpcRequestListeners != null) {
+ rpcRequestListeners.clear();
+ }
+ if (session != null && session.getIsConnected()) {
+ session.close();
+ }
+ }
+
+ public void setSdlSecurityClassList(List<Class<? extends SdlSecurityBase>> list) {
+ _secList = list;
+ }
+
+ private void processRaiResponse(RegisterAppInterfaceResponse rai) {
+ if (rai == null) return;
+
+ this.raiResponse = rai;
+
+ VehicleType vt = rai.getVehicleType();
+ if (vt == null) return;
+
+ String make = vt.getMake();
+ if (make == null) return;
+
+ if (_secList == null) return;
+
+ SdlSecurityBase sec;
+
+ for (Class<? extends SdlSecurityBase> cls : _secList) {
+ try {
+ sec = cls.newInstance();
+ } catch (Exception e) {
+ continue;
+ }
+
+ if ((sec != null) && (sec.getMakeList() != null)) {
+ if (sec.getMakeList().contains(make)) {
+ sec.setAppId(appConfig.getAppID());
+ if (session != null) {
+ session.setSdlSecurity(sec);
+ sec.handleSdlSession(session);
+ }
+ return;
+ }
+ }
+ }
+ }
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
new file mode 100644
index 000000000..c580cc359
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.permission;
+
+import android.support.annotation.NonNull;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+
+/**
+ PermissionManager gives the developer information about what permissions are permitted in specific HMI level
+ and helps developers setup listeners to be called when specific permissions become allowed.<br>
+
+ This should be used through the {@link com.smartdevicelink.managers.SdlManager} and not be instantiated by itself
+**/
+
+ public class PermissionManager extends BasePermissionManager{
+
+
+ /**
+ * Creates a new instance of the PermissionManager
+ *
+ * @param internalInterface an instance of the FileManager so that button graphics can be sent
+ */
+ public PermissionManager(@NonNull ISdl internalInterface) {
+ super(internalInterface);
+ }
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
new file mode 100644
index 000000000..b9828f4c3
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+
+/**
+ * <strong>ScreenManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+*/
+public class ScreenManager extends BaseScreenManager {
+
+ public ScreenManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) {
+ super(internalInterface, fileManager);
+ }
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
new file mode 100644
index 000000000..e29c6ed49
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+
+/**
+ * <strong>SoftButtonManager</strong> <br>
+ * SoftButtonManager gives the developer the ability to control how soft buttons are displayed on the head unit.<br>
+ * Note: This class must be accessed through the SdlManager->ScreenManager. Do not instantiate it by itself.<br>
+ */
+class SoftButtonManager extends BaseSoftButtonManager {
+
+ /**
+ * Creates a new instance of the SoftButtonManager
+ *
+ * @param internalInterface an instance of the ISdl interface that can be used for common SDL operations (sendRpc, addRpcListener, etc)
+ * @param fileManager an instance of the FileManager so that button graphics can be sent
+ */
+ SoftButtonManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) {
+ super(internalInterface, fileManager);
+ }
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
new file mode 100644
index 000000000..9c680446c
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2019 Livio, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Livio Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.managers.screen;
+
+import android.support.annotation.NonNull;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+
+/**
+ * <strong>TextAndGraphicManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+ *
+ */
+class TextAndGraphicManager extends BaseTextAndGraphicManager {
+
+ TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
+ super(internalInterface, fileManager, softButtonManager);
+ }
+
+ @Override
+ SdlArtwork getBlankArtwork(){
+ if (blankArtwork == null){
+ blankArtwork = new SdlArtwork();
+ blankArtwork.setType(FileType.GRAPHIC_PNG);
+ blankArtwork.setName("blankArtwork");
+ blankArtwork.setFileData(new byte[50]);
+ }
+ return blankArtwork;
+ }
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java b/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
new file mode 100644
index 000000000..f65f98720
--- /dev/null
+++ b/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.smartdevicelink.security;
+
+public abstract class SdlSecurityBase extends AbstractSdlSecurityBase {
+
+}
diff --git a/sdl_android/bintray.gradle b/sdl_android/bintray.gradle
deleted file mode 100644
index f4969df2c..000000000
--- a/sdl_android/bintray.gradle
+++ /dev/null
@@ -1,71 +0,0 @@
-apply plugin: "com.jfrog.bintray"
-apply plugin: 'com.github.dcendents.android-maven'
-apply plugin: 'maven-publish'
-
-def siteUrl = 'https://github.com/smartdevicelink/sdl_android' // Homepage URL of the library
-def gitUrl = 'https://github.com/smartdevicelink/sdl_android.git' // Git repository URL
-group = "com.smartdevicelink" // Maven Group ID for the artifact
-def libDescription = 'SmartDeviceLink mobile library for Android'
-
-install {
- repositories.mavenInstaller {
- pom {
- project {
- packaging 'aar'
-
- // Add your description here
- name 'com.smartdevicelink:sdl_android'
- description = libDescription
- url siteUrl
-
- // Set your license
- licenses {
- license {
- name 'BSD 3-Clause'
- url 'https://opensource.org/licenses/BSD-3-Clause'
- }
- }
- scm {
- connection gitUrl
- developerConnection gitUrl
- url siteUrl
- }
- }
- }
- }
-}
-
-task sourcesJar(type: Jar) {
- from android.sourceSets.main.java.srcDirs
- classifier = 'sources'
-}
-
-artifacts {
- archives sourcesJar
-}
-
-bintray {
- Properties props = new Properties()
- props.load(new FileInputStream("$projectDir/bintray.properties"))
-
- // Authorization
- user = props.getProperty("bintray.user")
- key = props.getProperty("bintray.key")
- version = props.getProperty("bintray.version")
- configurations = ['archives']
- pkg {
- repo = props.getProperty("bintray.repo")
- name = props.getProperty("bintray.artifact")
- websiteUrl = siteUrl
- vcsUrl = gitUrl
- userOrg = props.getProperty("bintray.userorg")
- licenses = ["BSD 3-Clause"]
- publish = props.getProperty("bintray.publish") // Will upload to jCenter
- version {
- name = props.getProperty("bintray.version") // Change to release version
- desc = libDescription
- released = new Date() // Will be the current date & time
- vcsTag = props.getProperty("bintray.vcs") // Should match git tag
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/bintray.properties b/sdl_android/bintray.properties
deleted file mode 100644
index 760f99904..000000000
--- a/sdl_android/bintray.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-bintray.user=username
-bintray.key=apikey
-bintray.repo=sdl_android
-bintray.artifact=sdl_android
-bintray.userorg=smartdevicelink
-bintray.publish=true
-bintray.version=X.X.X
-bintray.vcs=X.X.X \ No newline at end of file
diff --git a/sdl_android/build.gradle b/sdl_android/build.gradle
deleted file mode 100644
index da605fe69..000000000
--- a/sdl_android/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.library'
-
-android {
- compileSdkVersion 28
- defaultConfig {
- minSdkVersion 8
- targetSdkVersion 26
- versionCode 10
- versionName "4.7.2"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"'
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- debug {
- testCoverageEnabled = true
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_7
- targetCompatibility JavaVersion.VERSION_1_7
- }
- lintOptions {
- abortOnError false
- }
-
- testOptions {
- unitTests.returnDefaultValues = true
- }
-}
-
-dependencies {
- api fileTree(dir: 'libs', include: ['*.jar'])
- api 'com.smartdevicelink:bson_java_port:1.1.1'
- androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
- testImplementation 'junit:junit:4.12'
- testImplementation 'org.mockito:mockito-core:2.9.0'
- androidTestImplementation 'org.mockito:mockito-android:2.9.0'
- api 'com.android.support:support-annotations:28.0.0'
- api "android.arch.lifecycle:extensions:1.1.1"
- annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
-}
-
-buildscript {
- repositories {
- jcenter()
- mavenCentral()
- }
- dependencies {
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
- }
-}
-
-apply from: 'bintray.gradle'
diff --git a/sdl_android/src/androidTest/assets/json/GetSystemCapability.json b/sdl_android/src/androidTest/assets/json/GetSystemCapability.json
deleted file mode 100644
index c96bf6013..000000000
--- a/sdl_android/src/androidTest/assets/json/GetSystemCapability.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "request":{
- "name":"GetSystemCapability",
- "correlationID":203,
- "parameters":{
- "systemCapabilityType":"NAVIGATION"
- }
- },
- "response":{
- "name":"GetSystemCapabilityResponse",
- "correlationID":204,
- "parameters":{
- "systemCapability":{
- "systemCapabilityType":"NAVIGATION"
- }
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml b/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml
deleted file mode 100644
index 769e87d3c..000000000
--- a/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml
+++ /dev/null
@@ -1,7015 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-
-<interface name="SmartDeviceLink RAPI" version="5.0.0" minVersion="1.0" date="2018-10-03">
- <enum name="Result" internal_scope="base" since="1.0">
- <element name="SUCCESS">
- <description>The request succeeded</description>
- </element>
- <element name="UNSUPPORTED_REQUEST">
- <description>The request is not supported by the headunit</description>
- </element>
- <element name="UNSUPPORTED_RESOURCE">
- <description>
- A button that was requested for subscription is not supported under the current system.
- </description>
- </element>
- <element name="DISALLOWED">
- <description>RPC is not authorized in local policy table.</description>
- </element>
- <element name="REJECTED">
- <description>
- The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
- Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
- </description>
- </element>
- <element name="ABORTED">
- <description>
- A command was aborted, for example due to user interaction (e.g. user pressed button).
- Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
- </description>
- </element>
- <element name="IGNORED">
- <description>
- A command was ignored, because the intended result is already in effect.
- For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
- NOTE: potentially replaces SUBSCRIBED_ALREADY
- </description>
- </element>
- <element name="RETRY">
- <description>The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.</description>
- </element>
- <element name="IN_USE">
- <description>
- The data may not be changed, because it is currently in use.
- For example when trying to delete a command set that is currently involved in an interaction.
- </description>
- </element>
- <element name="VEHICLE_DATA_NOT_AVAILABLE" since="2.0">
- <description>The requested vehicle data is not available on this vehicle or is not published.</description>
- </element>
- <element name="TIMED_OUT">
- <description>Overlay reached the maximum timeout and closed.</description>
- </element>
- <element name="INVALID_DATA">
- <description>
- The data sent is invalid. For example:
- Invalid Json syntax
- Parameters out of bounds (number or enum range)
- Mandatory parameters not provided
- Parameter provided with wrong type
- Invalid characters
- Empty string
- </description>
- </element>
- <element name="CHAR_LIMIT_EXCEEDED"></element>
- <element name="INVALID_ID">
- <description>
- One of the provided IDs is not valid. For example
- This applies to CorrelationID, SubscriptionID, CommandID, MenuID, etc.
- </description>
- </element>
- <element name="DUPLICATE_NAME">
- <description>There was a conflict with an registered name (application or menu item) or vr command</description>
- </element>
- <element name="APPLICATION_NOT_REGISTERED">
- <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
- </element>
- <element name="WRONG_LANGUAGE">
- <description>
- The requested language is currently not supported.
- Might be because of a mismatch of the currently active language on the headunit and the requested language
- </description>
- </element>
- <element name="OUT_OF_MEMORY">
- <description>The system could not process the request because the necessary memory couldn't be allocated</description>
- </element>
- <element name="TOO_MANY_PENDING_REQUESTS">
- <description>There are too many requests pending (means, that the response has not been delivered, yet).There may be a maximum of 1000 pending requests at a time.</description>
- </element>
- <element name="TOO_MANY_APPLICATIONS">
- <description>There are already too many registered applications</description>
- </element>
- <element name="APPLICATION_REGISTERED_ALREADY">
- <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
- </element>
- <element name="WARNINGS">
- <description>The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.</description>
- </element>
- <element name="GENERIC_ERROR">
- <description>Provided data is valid but something went wrong in the lower layers.</description>
- </element>
- <element name="USER_DISALLOWED" since="2.0">
- <description>RPC is included in a functional group explicitly blocked by the user.</description>
- </element>
- <element name="TRUNCATED_DATA">
- <description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
- </element>
- <element name="UNSUPPORTED_VERSION" since="2.0">
- <description>Sync doesn't support the protocol that is requested by the mobile application</description>
- </element>
- <element name="VEHICLE_DATA_NOT_ALLOWED" since="2.0">
- <description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
- </element>
- <element name="FILE_NOT_FOUND" since="3.0">
- <description>A specified file could not be found on the headunit.</description>
- </element>
- <element name="CANCEL_ROUTE">
- <description>User selected to Cancel Route.</description>
- </element>
- <element name="SAVED" since="2.0">
- <description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
- </element>
- <element name="INVALID_CERT" since="3.0">
- <description>The certificate provided during authentication is invalid.</description>
- </element>
- <element name="EXPIRED_CERT" since="3.0">
- <description>The certificate provided during authentication is expired.</description>
- </element>
- <element name="RESUME_FAILED" since="3.0">
- <description>The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.</description>
- </element>
- <element name="DATA_NOT_AVAILABLE" since="4.5">
- <description>The requested information is currently not available. This is different than UNSUPPORTED_RESOURCE because it implies the data is at some point available. </description>
- </element>
- <element name="READ_ONLY" since="4.5">
- <description>The value being set is read only</description>
- </element>
- <element name="CORRUPTED_DATA" since="5.0">
- <description>The data sent failed to pass CRC check in receiver end</description>
- </element>
- </enum>
-
- <enum name="ButtonPressMode" since="1.0">
- <element name="LONG">
- <description>
- A button was released, after it was pressed for a long time
- Actual timing is defined by the headunit and may vary
- </description>
- </element>
- <element name="SHORT">
- <description>
- A button was released, after it was pressed for a short time
- Actual timing is defined by the headunit and may vary
- </description>
- </element>
- </enum>
-
- <enum name="ButtonEventMode" since="1.0">
- <element name="BUTTONUP">
- <description>A button has been released up</description>
- </element>
- <element name="BUTTONDOWN">
- <description>A button has been pressed down</description>
- </element>
- </enum>
-
- <enum name="Language" since="1.0">
- <element name="EN-US" internal_name="EN_US">
- <description>English - US</description>
- </element>
- <element name="ES-MX" internal_name="ES_MX">
- <description>Spanish - Mexico</description>
- </element>
- <element name="FR-CA" internal_name="FR_CA">
- <description>French - Canada</description>
- </element>
- <element name="DE-DE" internal_name="DE_DE" since="2.0">
- <description>German - Germany</description>
- </element>
- <element name="ES-ES" internal_name="ES_ES" since="2.0">
- <description>Spanish - Spain</description>
- </element>
- <element name="EN-GB" internal_name="EN_GB" since="2.0">
- <description>English - GB</description>
- </element>
- <element name="RU-RU" internal_name="RU_RU" since="2.0">
- <description>Russian - Russia</description>
- </element>
- <element name="TR-TR" internal_name="TR_TR" since="2.0">
- <description>Turkish - Turkey</description>
- </element>
- <element name="PL-PL" internal_name="PL_PL" since="2.0">
- <description>Polish - Poland</description>
- </element>
- <element name="FR-FR" internal_name="FR_FR" since="2.0">
- <description>French - France</description>
- </element>
- <element name="IT-IT" internal_name="IT_IT" since="2.0">
- <description>Italian - Italy</description>
- </element>
- <element name="SV-SE" internal_name="SV_SE" since="2.0">
- <description>Swedish - Sweden</description>
- </element>
- <element name="PT-PT" internal_name="PT_PT" since="2.0">
- <description>Portuguese - Portugal</description>
- </element>
- <element name="NL-NL" internal_name="NL_NL" since="2.0">
- <description>Dutch (Standard) - Netherlands</description>
- </element>
- <element name="EN-AU" internal_name="EN_AU" since="2.0">
- <description>English - Australia</description>
- </element>
- <element name="ZH-CN" internal_name="ZH_CN" since="2.0">
- <description>Mandarin - China</description>
- </element>
- <element name="ZH-TW" internal_name="ZH_TW" since="2.0">
- <description>Mandarin - Taiwan</description>
- </element>
- <element name="JA-JP" internal_name="JA_JP" since="2.0">
- <description>Japanese - Japan</description>
- </element>
- <element name="AR-SA" internal_name="AR_SA" since="2.0">
- <description>Arabic - Saudi Arabia</description>
- </element>
- <element name="KO-KR" internal_name="KO_KR" since="2.0">
- <description>Korean - South Korea</description>
- </element>
- <element name="PT-BR" internal_name="PT_BR" since="2.0">
- <description>Portuguese - Brazil</description>
- </element>
- <element name="CS-CZ" internal_name="CS_CZ" since="2.0">
- <description>Czech - Czech Republic</description>
- </element>
- <element name="DA-DK" internal_name="DA_DK" since="2.0">
- <description>Danish - Denmark</description>
- </element>
- <element name="NO-NO" internal_name="NO_NO" since="2.0">
- <description>Norwegian - Norway</description>
- </element>
- <element name="NL-BE" internal_name="NL_BE" since="2.0">
- <description>Dutch (Flemish) - Belgium</description>
- </element>
- <element name="EL-GR" internal_name="EL_GR" since="2.0">
- <description>Greek - Greece</description>
- </element>
- <element name="HU-HU" internal_name="HU_HU" since="2.0">
- <description>Hungarian - Hungary</description>
- </element>
- <element name="FI-FI" internal_name="FI_FI" since="2.0">
- <description>Finnish - Finland</description>
- </element>
- <element name="SK-SK" internal_name="SK_SK" since="2.0">
- <description>Slovak - Slovakia</description>
- </element>
- <element name="EN-IN" internal_name="EN_IN" since="4.5">
- <description>English - India</description>
- </element>
- <element name="TH-TH" internal_name="TH_TH" since="4.5">
- <description>Thai - Thailand</description>
- </element>
- <element name="EN-SA" internal_name="EN_SA" since="4.5">
- <description>English - Middle East</description>
- </element>
- <element name="HE-IL" internal_name="HE_IL" since="4.5">
- <description>Hebrew - Israel</description>
- </element>
- <element name="RO-RO" internal_name="RO_RO" since="4.5">
- <description>Romanian - Romania</description>
- </element>
- <element name="UK-UA" internal_name="UK_UA" since="4.5">
- <description>Ukrainian - Ukraine</description>
- </element>
- <element name="ID-ID" internal_name="ID_ID" since="4.5">
- <description>Indonesian - Indonesia</description>
- </element>
- <element name="VI-VN" internal_name="VI_VN" since="4.5">
- <description>Vietnamese - Vietnam</description>
- </element>
- <element name="MS-MY" internal_name="MS_MY" since="4.5">
- <description>Malay - Malaysia</description>
- </element>
- <element name="HI-IN" internal_name="HI_IN" since="4.5">
- <description>Hindi - India</description>
- </element>
- </enum>
-
- <enum name="UpdateMode" since="1.0">
- <description>Describes how the media clock timer should behave on the platform</description>
- <element name="COUNTUP" >
- <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
- </element>
- <element name="COUNTDOWN" >
- <description>Starts the media clock timer counting downwards, as in time remaining.</description>
- </element>
- <element name="PAUSE" >
- <description>Pauses the media clock timer</description>
- </element>
- <element name="RESUME" >
- <description>Resume the media clock timer</description>
- </element>
- <element name="CLEAR" >
- <description>Clears the media clock timer (previously done through Show->mediaClock)</description>
- </element>
- </enum>
-
- <enum name="TimerMode" since="1.0">
- <element name="UP" >
- <description>Causes the media clock timer to update from 0:00 to a specified time</description>
- </element>
- <element name="DOWN" >
- <description>Causes the media clock timer to update from a specified time to 0:00</description>
- </element>
- <element name="NONE" >
- <description>Indicates to not use the media clock timer</description>
- </element>
- </enum>
-
- <enum name="InteractionMode" since="1.0">
- <description>For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction.</description>
- <element name="MANUAL_ONLY" >
- <description>This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display. No Voice Interaction.</description>
- </element>
- <element name="VR_ONLY" >
- <description>This mode causes the interaction to only occur using the headunits VR system. Selections are made by saying the command.</description>
- </element>
- <element name="BOTH" >
- <description>This mode causes both a VR and display selection option for an interaction. The user will first be asked via Voice Interaction (if available). If this is unsuccessful, the system will switch to manual input.</description>
- </element>
- </enum>
-
- <enum name="LayoutMode" since="3.0">
- <description>For touchscreen interactions, the mode of how the choices are presented.</description>
- <element name="ICON_ONLY" >
- <description>This mode causes the interaction to display the previous set of choices as icons.</description>
- </element>
- <element name="ICON_WITH_SEARCH" >
- <description>This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.</description>
- </element>
- <element name="LIST_ONLY" >
- <description>This mode causes the interaction to display the previous set of choices as a list.</description>
- </element>
- <element name="LIST_WITH_SEARCH" >
- <description>This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.</description>
- </element>
- <element name="KEYBOARD" >
- <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
- </element>
- </enum>
-
- <enum name="HMILevel" since="1.0">
- <description>Enumeration that describes current levels of HMI.</description>
- <element name="FULL" internal_name="HMI_FULL" />
- <element name="LIMITED" internal_name="HMI_LIMITED" />
- <element name="BACKGROUND" internal_name="HMI_BACKGROUND" />
- <element name="NONE" internal_name="HMI_NONE" />
- </enum>
-
- <enum name="AudioStreamingState" since="1.0">
- <description>Enumeration that describes possible states of audio streaming.</description>
- <element name="AUDIBLE" />
- <element name="ATTENUATED" />
- <element name="NOT_AUDIBLE" />
- </enum>
-
- <enum name="SystemAction" since="1.0">
- <description>Enumeration that describes system actions that can be triggered.</description>
- <element name="DEFAULT_ACTION">
- <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
- </element>
- <element name="STEAL_FOCUS">
- <description>App is brought into HMI_FULL.</description>
- </element>
- <element name="KEEP_CONTEXT">
- <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
- </element>
- </enum>
-
- <enum name="SystemContext" since="1.0">
- <description>Enumeration that describes possible contexts an app's HMI might be in. Communicated to whichever app is in HMI FULL, except Alert.</description>
- <element name="MAIN" internal_name="SYSCTXT_MAIN">
- <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
- </element>
- <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
- <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
- </element>
- <element name="MENU" internal_name="SYSCTXT_MENU">
- <description>The system is currently displaying an in-App menu onscreen.</description>
- </element>
- <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
- <description>The app's display HMI is currently being obscured by either a system or other app's overlay.</description>
- </element>
- <element name="ALERT" internal_name="SYSCTXT_ALERT">
- <description>Broadcast only to whichever app has an alert currently being displayed.</description>
- </element>
- </enum>
-
- <enum name="VideoStreamingState" since="5.0">
- <description>Enumeration that describes possible states of video streaming. </description>
- <element name="STREAMABLE" />
- <element name="NOT_STREAMABLE" />
- </enum>
-
- <enum name="SoftButtonType" since="2.0">
- <description>Contains information about the SoftButton capabilities.</description>
- <element name="TEXT" internal_name="SBT_TEXT"/>
- <element name="IMAGE" internal_name="SBT_IMAGE"/>
- <element name="BOTH" internal_name="SBT_BOTH"/>
- </enum>
-
- <enum name="AppInterfaceUnregisteredReason" since="1.0">
- <description>Error code, which comes from the module side.</description>
- <!-- Deprecate
- <element name="USER_EXIT" />
- -->
- <element name="IGNITION_OFF" />
- <element name="BLUETOOTH_OFF" />
- <element name="USB_DISCONNECTED" />
- <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL" />
- <element name="TOO_MANY_REQUESTS" />
- <element name="DRIVER_DISTRACTION_VIOLATION" />
- <element name="LANGUAGE_CHANGE" />
- <element name="MASTER_RESET" />
- <element name="FACTORY_DEFAULTS" />
- <element name="APP_UNAUTHORIZED" since="2.0" />
- <element name="PROTOCOL_VIOLATION" since="4.0" />
- <element name="UNSUPPORTED_HMI_RESOURCE" since="4.1" />
- </enum>
-
- <enum name="TriggerSource" since="1.0">
- <description>Indicates the source from where the command was triggered.</description>
- <element name="MENU" internal_name="TS_MENU" />
- <element name="VR" internal_name="TS_VR" />
- <element name="KEYBOARD" internal_name="TS_KEYBOARD" since="3.0" />
- </enum>
-
- <enum name="HmiZoneCapabilities" since="1.0">
- <description>Contains information about the HMI zone capabilities.</description>
- <description>For future use.</description>
- <element name="FRONT" />
- <element name="BACK" />
- </enum>
-
- <enum name="SpeechCapabilities" since="1.0">
- <description>Contains information about the TTS capabilities.</description>
- <element name="TEXT" internal_name="SC_TEXT"/>
- <element name="SAPI_PHONEMES" />
- <element name="LHPLUS_PHONEMES" />
- <element name="PRE_RECORDED" />
- <element name="SILENCE" />
- <element name="FILE" since="5.0" />
- </enum>
-
- <enum name="VrCapabilities" since="1.0">
- <description>Contains information about the VR capabilities.</description>
- <element name="TEXT" internal_name="VR_TEXT"/>
- </enum>
-
- <enum name="PrerecordedSpeech" since="1.0">
- <description>Contains a list of prerecorded speech items present on the platform.</description>
- <element name="HELP_JINGLE" />
- <element name="INITIAL_JINGLE" />
- <element name="LISTEN_JINGLE" />
- <element name="POSITIVE_JINGLE" />
- <element name="NEGATIVE_JINGLE" />
- </enum>
-
- <enum name="SamplingRate" since="2.0">
- <description>Describes different sampling options for PerformAudioPassThru.</description>
- <element name="8KHZ" internal_name="SamplingRate_8KHZ">
- <description>Sampling rate of 8000 Hz.</description>
- </element>
- <element name="16KHZ" internal_name="SamplingRate_16KHZ">
- <description>Sampling rate of 16000 Hz.</description>
- </element>
- <element name="22KHZ" internal_name="SamplingRate_22KHZ">
- <description>Sampling rate of 22050 Hz.</description>
- </element>
- <element name="44KHZ" internal_name="SamplingRate_44KHZ">
- <description>Sampling rate of 44100 Hz.</description>
- </element>
- </enum>
-
- <enum name="BitsPerSample" since="2.0">
- <description>Describes different quality options for PerformAudioPassThru.</description>
- <element name="8_BIT" internal_name="BitsPerSample_8_BIT">
- <description>Audio sample is 8 bits wide, unsigned.</description>
- </element>
- <element name="16_BIT" internal_name="BitsPerSample_16_BIT">
- <description>Audio sample is 16 bits wide, signed, and in little endian.</description>
- </element>
- </enum>
-
- <enum name="AudioType" since="2.0">
- <description>Describes different audio type options for PerformAudioPassThru.</description>
- <element name="PCM">
- <description>Linear PCM.</description>
- </element>
- </enum>
-
- <struct name="AudioPassThruCapabilities" since="2.0">
- <description>
- Describes different audio type configurations for PerformAudioPassThru.
- e.g. {8kHz,8-bit,PCM}
- The audio is recorded in monaural.
- </description>
- <param name="samplingRate" type="SamplingRate" mandatory="true"/>
- <param name="bitsPerSample" type="BitsPerSample" mandatory="true"/>
- <param name="audioType" type="AudioType" mandatory="true"/>
- </struct>
-
- <enum name="VehicleDataType" since="2.0">
- <description>Defines the data types that can be published and subscribed to.</description>
- <element name="VEHICLEDATA_GPS">
- <description>Notifies GPSData may be subscribed</description>
- </element>
- <element name="VEHICLEDATA_SPEED" />
- <element name="VEHICLEDATA_RPM" />
- <element name="VEHICLEDATA_FUELLEVEL" />
- <element name="VEHICLEDATA_FUELLEVEL_STATE" />
- <element name="VEHICLEDATA_FUELCONSUMPTION" />
- <element name="VEHICLEDATA_EXTERNTEMP" />
- <element name="VEHICLEDATA_VIN" />
- <element name="VEHICLEDATA_PRNDL" />
- <element name="VEHICLEDATA_TIREPRESSURE" />
- <element name="VEHICLEDATA_ODOMETER" />
- <element name="VEHICLEDATA_BELTSTATUS" />
- <element name="VEHICLEDATA_BODYINFO" />
- <element name="VEHICLEDATA_DEVICESTATUS" />
- <element name="VEHICLEDATA_ECALLINFO" />
- <element name="VEHICLEDATA_AIRBAGSTATUS" />
- <element name="VEHICLEDATA_EMERGENCYEVENT" />
- <element name="VEHICLEDATA_CLUSTERMODESTATUS" />
- <element name="VEHICLEDATA_MYKEY" />
- <element name="VEHICLEDATA_BRAKING" />
- <element name="VEHICLEDATA_WIPERSTATUS" />
- <element name="VEHICLEDATA_HEADLAMPSTATUS" />
- <element name="VEHICLEDATA_BATTVOLTAGE" />
- <element name="VEHICLEDATA_ENGINETORQUE" />
- <element name="VEHICLEDATA_ACCPEDAL" />
- <element name="VEHICLEDATA_STEERINGWHEEL" />
- <element name="VEHICLEDATA_TURNSIGNAL" since="5.0" />
- <element name="VEHICLEDATA_FUELRANGE" since="5.0" />
- <element name="VEHICLEDATA_ENGINEOILLIFE" since="5.0" />
- <element name="VEHICLEDATA_ELECTRONICPARKBRAKESTATUS" since="5.0" />
- </enum>
-
- <enum name="ButtonName" since="1.0">
- <description>Defines the hard (physical) and soft (touchscreen) buttons available from the module</description>
- <element name="OK" />
- <element name="PLAY_PAUSE" since="5.0">
- <description>
- The button name for the physical Play/Pause
- toggle that can be used by media apps.
- </description>
- <warning>
- Please use the physical OK button in order to
- use a Play/Pause toggle for versions &lt; 4.5.0.
- </warning>
- </element>
- <element name="SEEKLEFT" />
- <element name="SEEKRIGHT" />
- <element name="TUNEUP" />
- <element name="TUNEDOWN" />
- <element name="PRESET_0" />
- <element name="PRESET_1" />
- <element name="PRESET_2" />
- <element name="PRESET_3" />
- <element name="PRESET_4" />
- <element name="PRESET_5" />
- <element name="PRESET_6" />
- <element name="PRESET_7" />
- <element name="PRESET_8" />
- <element name="PRESET_9" />
- <element name="CUSTOM_BUTTON" />
- <element name="SEARCH" />
- <!-- Climate Buttons -->
- <element name="AC_MAX" since="4.5" />
- <element name="AC" since="4.5" />
- <element name="RECIRCULATE" since="4.5" />
- <element name="FAN_UP" since="4.5" />
- <element name="FAN_DOWN" since="4.5" />
- <element name="TEMP_UP" since="4.5" />
- <element name="TEMP_DOWN" since="4.5" />
- <element name="DEFROST_MAX" since="4.5" />
- <element name="DEFROST" since="4.5" />
- <element name="DEFROST_REAR" since="4.5" />
- <element name="UPPER_VENT" since="4.5" />
- <element name="LOWER_VENT" since="4.5" />
- <!-- Radio Buttons -->
- <element name="VOLUME_UP" since="4.5" />
- <element name="VOLUME_DOWN" since="4.5" />
- <element name="EJECT" since="4.5" />
- <element name="SOURCE" since="4.5" />
- <element name="SHUFFLE" since="4.5" />
- <element name="REPEAT" since="4.5" />
- </enum>
-
- <enum name="MediaClockFormat" since="1.0">
- <element name="CLOCK1">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
- used for Type II and CID headunits
- </description>
- </element>
- <element name="CLOCK2">
- <description>
- minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
- used for Type V headunit
- </description>
- </element>
- <element name="CLOCK3" since="2.0">
- <description>
- minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
- used for GEN1.1 MFD3/4/5 headunits
- </description>
- </element>
- <element name="CLOCKTEXT1">
- <description>
- 5 characters possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see TypeII column in XLS. See [@TODO: create file ref]]
- :|sp : colon or space
- used for Type II headunit
- </description>
- </element>
- <element name="CLOCKTEXT2">
- <description>
- 5 chars possible
- Format: 1|sp c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see CID column in XLS. See [@TODO: create file ref]]
- :|sp : colon or space
- used for CID headunit
- NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set
- </description>
- </element>
- <element name="CLOCKTEXT3">
- <description>
- 6 chars possible
- Format: 1|sp c c :|sp c c
- 1|sp : digit "1" or space
- c : character out of following character set: sp|0-9|[letters, see Type 5 column in XLS]. See [@TODO: create file ref]
- :|sp : colon or space
- used for Type V headunit
- </description>
- </element>
- <element name="CLOCKTEXT4" since="2.0">
- <description>
- 6 chars possible
- Format: c :|sp c c : c c
- :|sp : colon or space
- c : character out of following character set: sp|0-9|[letters].
- used for GEN1.1 MFD3/4/5 headunits
- </description>
- </element>
- </enum>
-
- <enum name="DisplayType" deprecated="true" since="5.0">
- <description>See DAES for further infos regarding the displays</description>
- <element name="CID"/>
- <element name="TYPE2" />
- <element name="TYPE5" />
- <element name="NGN" />
- <element name="GEN2_8_DMA" since="3.0" />
- <element name="GEN2_6_DMA" since="3.0" />
- <element name="MFD3" since="2.0" />
- <element name="MFD4" since="2.0" />
- <element name="MFD5" since="2.0" />
- <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" since="3.0" />
- <element name="SDL_GENERIC" since="4.0" />
- <history>
- <enum name="DisplayType" since="1.0" until="5.0"/>
- </history>
- </enum>
-
- <enum name="TextFieldName" since="1.0">
- <element name="mainField1">
- <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField2">
- <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField3">
- <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
- </element>
-
- <element name="mainField4">
- <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
- </element>
-
- <element name="statusBar">
- <description>The status bar on NGN; applies to "Show"</description>
- </element>
-
- <element name="mediaClock">
- <description>Text value for MediaClock field; applies to "Show"</description>
- </element>
-
- <element name="mediaTrack">
- <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
- </element>
-
- <element name="alertText1">
- <description>The first line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="alertText2" since="2.0">
- <description>The second line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="alertText3" since="2.0">
- <description>The third line of the alert text field; applies to "Alert"</description>
- </element>
-
- <element name="scrollableMessageBody" since="2.0">
- <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
- </element>
-
- <element name="initialInteractionText" since="2.0">
- <description> First line suggestion for a user response (in the case of VR enabled interaction)</description>
- </element>
-
- <element name="navigationText1" since="2.0">
- <description> First line of navigation text</description>
- </element>
-
- <element name="navigationText2" since="2.0">
- <description> Second line of navigation text</description>
- </element>
-
- <element name="ETA" since="2.0">
- <description> Estimated Time of Arrival time for navigation</description>
- </element>
-
- <element name="totalDistance" since="2.0">
- <description> Total distance to destination for navigation</description>
- </element>
-
- <element name="audioPassThruDisplayText1" since="2.0">
- <description> First line of text for audio pass thru</description>
- </element>
-
- <element name="audioPassThruDisplayText2" since="2.0">
- <description> Second line of text for audio pass thru</description>
- </element>
-
- <element name="sliderHeader" since="2.0">
- <description> Header text for slider</description>
- </element>
-
- <element name="sliderFooter" since="2.0">
- <description> Footer text for slider</description>
- </element>
-
- <element name="menuName">
- <description> Primary text for Choice</description>
- </element>
-
- <element name="secondaryText">
- <description> Secondary text for Choice</description>
- </element>
-
- <element name="tertiaryText">
- <description> Tertiary text for Choice</description>
- </element>
-
- <element name="menuTitle">
- <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </element>
-
- <element name="locationName" since="4.0">
- <description> Optional name / title of intended location for SendLocation.</description>
- </element>
-
- <element name="locationDescription" since="4.0">
- <description> Optional description of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
-
- <element name="addressLines" since="4.0">
- <description> Optional location address (if applicable) for SendLocation.</description>
- </element>
-
- <element name="phoneNumber" since="4.0">
- <description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
- </element>
-
- </enum>
-
- <enum name="ImageFieldName" since="3.0">
- <element name="softButtonImage">
- <description>The image field for SoftButton</description>
- </element>
-
- <element name="choiceImage">
- <description>The first image field for Choice</description>
- </element>
-
- <element name="choiceSecondaryImage">
- <description>The secondary image field for Choice</description>
- </element>
-
- <element name="vrHelpItem">
- <description>The image field for vrHelpItem</description>
- </element>
-
- <element name="turnIcon">
- <description>The image field for Turn</description>
- </element>
-
- <element name="menuIcon">
- <description>The image field for the menu icon in SetGlobalProperties</description>
- </element>
-
- <element name="cmdIcon">
- <description>The image field for AddCommand</description>
- </element>
-
- <element name="appIcon">
- <description>The image field for the app icon (set by setAppIcon)</description>
- </element>
-
- <element name="graphic">
- <description>The primary image field for Show</description>
- </element>
-
- <element name="secondaryGraphic" since="5.0">
- <description>The secondary image field for Show</description>
- </element>
-
- <element name="showConstantTBTIcon">
- <description>The primary image field for ShowConstantTBT</description>
- </element>
-
- <element name="showConstantTBTNextTurnIcon">
- <description>The secondary image field for ShowConstantTBT</description>
- </element>
-
- <element name="locationImage" since="4.0">
- <description>The optional image of a destination / location</description>
- </element>
-
- </enum>
-
- <enum name="CharacterSet" since="1.0">
- <description>The list of potential character sets</description>
- <element name="TYPE2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="TYPE5SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID1SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- <element name="CID2SET">
- <description>See [@TODO: create file ref]</description>
- </element>
- </enum>
-
- <enum name="TextAlignment" since="1.0">
- <description>The list of possible alignments, left, right, or centered</description>
- <element name="LEFT_ALIGNED" />
- <element name="RIGHT_ALIGNED" />
- <element name="CENTERED" />
- </enum>
-
- <enum name="TBTState" since="2.0">
- <description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
- <element name="ROUTE_UPDATE_REQUEST" />
- <element name="ROUTE_ACCEPTED" />
- <element name="ROUTE_REFUSED" />
- <element name="ROUTE_CANCELLED" />
- <element name="ETA_REQUEST" />
- <element name="NEXT_TURN_REQUEST" />
- <element name="ROUTE_STATUS_REQUEST" />
- <element name="ROUTE_SUMMARY_REQUEST" />
- <element name="TRIP_STATUS_REQUEST" />
- <element name="ROUTE_UPDATE_REQUEST_TIMEOUT" />
- </enum>
-
- <enum name="DriverDistractionState" since="2.0">
- <description>Enumeration that describes possible states of driver distraction.</description>
- <element name="DD_ON" />
- <element name="DD_OFF" />
- </enum>
-
- <enum name="ImageType" since="2.0">
- <description>Contains information about the type of image.</description>
- <element name="STATIC" />
- <element name="DYNAMIC" />
- </enum>
-
- <enum name="DeliveryMode" since="4.1">
- <description>The mode in which the SendLocation request is sent</description>
- <element name="PROMPT" />
- <element name="DESTINATION" />
- <element name="QUEUE" />
- </enum>
-
- <enum name="VideoStreamingProtocol" since="4.5">
- <description>Enum for each type of video streaming protocol type.</description>
- <element name="RAW">
- <description>Raw stream bytes that contains no timestamp data and is the lowest supported video streaming</description>
- </element>
- <element name="RTP">
- <description>RTP facilitates the transfer of real-time data. Information provided by this protocol include timestamps (for synchronization), sequence numbers (for packet loss and reordering detection) and the payload format which indicates the encoded format of the data.</description>
- </element>
- <element name="RTSP">
- <description>The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for media stream delivery. However, some vendors implement proprietary transport protocols. </description>
- </element>
- <element name="RTMP">
- <description> Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by Macromedia for streaming audio, video and data over the Internet, between a Flash player and a server. Macromedia is now owned by Adobe, which has released an incomplete version of the specification of the protocol for public use.</description>
- </element>
- <element name="WEBM">
- <description>The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.</description>
- </element>
- </enum>
-
- <enum name="VideoStreamingCodec" since="4.5">
- <description>Enum for each type of video streaming codec.</description>
- <element name="H264">
- <description>A block-oriented motion-compensation-based video compression standard. As of 2014 it is one of the most commonly used formats for the recording, compression, and distribution of video content.</description>
- </element>
- <element name="H265">
- <description>High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard, one of several potential successors to the widely used AVC (H.264 or MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio at the same level of video quality, or substantially improved video quality at the same bit rate. It supports resolutions up to 8192x4320, including 8K UHD.</description>
- </element>
- <element name="Theora">
- <description>Theora is derived from the formerly proprietary VP3 codec, released into the public domain by On2 Technologies. It is broadly comparable in design and bitrate efficiency to MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of the features present in some of these other codecs. It is comparable in open standards philosophy to the BBC's Dirac codec.</description>
- </element>
- <element name="VP8">
- <description>VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for Open Media (AOMedia) are based on VP8.</description>
- </element>
- <element name="VP9">
- <description>Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) and also enables lossless compression.</description>
- </element>
- </enum>
-
- <enum name="AudioStreamingIndicator" since="5.0">
- <element name="PLAY_PAUSE">
- <description>
- Default playback indicator.
- By default the playback indicator should be PLAY_PAUSE when:
- - the media app is newly registered on the head unit (after RegisterAppInterface)
- - the media app was closed by the user (App enters HMI_NONE)
- - the app sends SetMediaClockTimer with audioStreamingIndicator not set to any value
- </description>
- </element>
- <element name="PLAY">
- <description>Indicates that a button press of the Play/Pause button starts the audio playback.</description>
- </element>
- <element name="PAUSE">
- <description>Indicates that a button press of the Play/Pause button pauses the current audio playback.</description>
- </element>
- <element name="STOP">
- <description>Indicates that a button press of the Play/Pause button stops the current audio playback.</description>
- </element>
- </enum>
-
- <struct name="Image" since="2.0">
- <param name="value" minlength="0" maxlength="65535" type="String" mandatory="true">
- <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
- </param>
- <param name="imageType" type="ImageType" mandatory="true">
- <description>Describes, whether it is a static or dynamic image.</description>
- </param>
- <param name="isTemplate" type="Boolean" mandatory="false" since="5.0">
- <description>If true, the image is a template image and can be recolored by the HMI</description>
- </param>
- </struct>
-
- <struct name="SoftButton" since="2.0">
- <param name="type" type="SoftButtonType" mandatory="true">
- <description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
- </param>
- <param name="text" minlength="0" maxlength="500" type="String" mandatory="false">
- <description>Optional text to display (if defined as TEXT or BOTH)</description>
- </param>
- <param name="image" type="Image" mandatory="false">
- <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
- </param>
- <param name="isHighlighted" type="Boolean" defvalue="false" mandatory="false">
- <description>
- True, if highlighted
- False, if not highlighted
- </description>
- </param>
- <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Value which is returned via OnButtonPress / OnButtonEvent</description>
- </param>
- <param name="systemAction" type="SystemAction" defvalue="DEFAULT_ACTION" mandatory="false">
- <description>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</description>
- </param>
- </struct>
-
- <struct name="Choice" since="1.0">
- <description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true"/>
- <param name="menuName" type="String" maxlength="500" mandatory="true"/>
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false" since="5.0">
- <history>
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true" since="1.0" until="5.0"/>
- </history>
- </param>
- <param name="image" type="Image" mandatory="false" since="2.0" />
- <param name="secondaryText" maxlength="500" type="String" mandatory="false" since="3.0">
- <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
- </param>
- <param name="tertiaryText" maxlength="500" type="String" mandatory="false" since="3.0">
- <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
- </param>
- <param name="secondaryImage" type="Image" mandatory="false" since="3.0">
- <description>Optional secondary image struct for choice</description>
- </param>
- </struct>
-
- <struct name="VrHelpItem" since="2.0">
- <param name="text" maxlength="500" type="String" mandatory="true">
- <description>Text to display for VR Help item</description>
- </param>
- <param name="image" type="Image" mandatory="false">
- <description>Image struct for VR Help item</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
- <description>Position to display item in VR Help list</description>
- </param>
- </struct>
-
- <struct name="SyncMsgVersion" since="1.0">
- <description>Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application</description>
-
- <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10" mandatory="true">
- <description>The major version indicates versions that is not-compatible to previous versions.</description>
- </param>
- <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
- <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
- </param>
- <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false" since="4.3">
- <description>The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version </description>
- </param>
- </struct>
-
- <enum name="GlobalProperty" since="1.0">
- <description>The different global properties.</description>
- <element name="HELPPROMPT" since="1.0">
- <description>The property helpPrompt of setGlobalProperties</description>
- </element>
- <element name="TIMEOUTPROMPT" since="1.0">
- <description>The property timeoutPrompt of setGlobalProperties</description>
- </element>
- <element name="VRHELPTITLE" since="2.0">
- <description>The property vrHelpTitle of setGlobalProperties</description>
- </element>
- <element name="VRHELPITEMS" since="2.0">
- <description>The property array of vrHelp of setGlobalProperties</description>
- </element>
- <element name="MENUNAME" since="3.0">
- <description>The property in-app menu name of setGlobalProperties</description>
- </element>
- <element name="MENUICON" since="3.0">
- <description>The property in-app menu icon of setGlobalProperties</description>
- </element>
- <element name="KEYBOARDPROPERTIES" since="3.0">
- <description>The on-screen keyboard configuration of setGlobalProperties</description>
- </element>
- </enum>
-
- <enum name="CompassDirection" since="2.0">
- <description>The list of potential compass directions</description>
- <element name="NORTH">
- </element>
- <element name="NORTHWEST">
- </element>
- <element name="WEST">
- </element>
- <element name="SOUTHWEST">
- </element>
- <element name="SOUTH">
- </element>
- <element name="SOUTHEAST">
- </element>
- <element name="EAST">
- </element>
- <element name="NORTHEAST">
- </element>
- </enum>
-
- <enum name="Dimension" since="2.0">
- <description>The supported dimensions of the GPS</description>
- <element name="NO_FIX" internal_name="Dimension_NO_FIX">
- <description>No GPS at all</description>
- </element>
- <element name="2D" internal_name="Dimension_2D">
- <description>Longitude and latitude</description>
- </element>
- <element name="3D" internal_name="Dimension_3D">
- <description>Longitude and latitude and altitude</description>
- </element>
- </enum>
-
- <enum name="PRNDL" since="2.0">
- <description>The selected gear.</description>
- <element name="PARK">
- <description>Parking</description>
- </element>
- <element name="REVERSE">
- <description>Reverse gear</description>
- </element>
- <element name="NEUTRAL">
- <description>No gear</description>
- </element>
- <element name="DRIVE">
- </element>
- <element name="SPORT">
- <description>Drive Sport mode</description>
- </element>
- <element name="LOWGEAR">
- <description>1st gear hold</description>
- </element>
- <element name="FIRST">
- </element>
- <element name="SECOND">
- </element>
- <element name="THIRD">
- </element>
- <element name="FOURTH">
- </element>
- <element name="FIFTH">
- </element>
- <element name="SIXTH">
- </element>
- <element name="SEVENTH">
- </element>
- <element name="EIGHTH">
- </element>
- <element name="UNKNOWN">
- </element>
- <element name="FAULT">
- </element>
- </enum>
-
- <enum name="ComponentVolumeStatus" since="2.0">
- <description>The volume status of a vehicle component.</description>
- <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
- </element>
- <element name="NORMAL" internal_name="CVS_NORMAL">
- </element>
- <element name="LOW" internal_name="CVS_LOW">
- </element>
- <element name="FAULT" internal_name="CVS_FAULT">
- </element>
- <element name="ALERT" internal_name="CVS_ALERT">
- </element>
- <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
- </element>
- </enum>
-
- <enum name="TPMS" since="5.0">
- <element name="UNKNOWN">
- <description>If set the status of the tire is not known.</description>
- </element>
- <element name="SYSTEM_FAULT">
- <description>TPMS does not function.</description>
- </element>
- <element name="SENSOR_FAULT">
- <description>The sensor of the tire does not function.</description>
- </element>
- <element name="LOW">
- <description>TPMS is reporting a low tire pressure for the tire.</description>
- </element>
- <element name="SYSTEM_ACTIVE">
- <description>TPMS is active and the tire pressure is monitored.</description>
- </element>
- <element name="TRAIN">
- <description>TPMS is reporting that the tire must be trained.</description>
- </element>
- <element name="TRAINING_COMPLETE">
- <description>TPMS reports the training for the tire is completed.</description>
- </element>
- <element name="NOT_TRAINED">
- <description>TPMS reports the tire is not trained.</description>
- </element>
- </enum>
-
- <enum name="FuelType" since="5.0">
- <element name="GASOLINE" />
- <element name="DIESEL" />
- <element name="CNG">
- <description>
- For vehicles using compressed natural gas.
- </description>
- </element>
- <element name="LPG">
- <description>
- For vehicles using liquefied petroleum gas.
- </description>
- </element>
- <element name="HYDROGEN">
- <description>For FCEV (fuel cell electric vehicle).</description>
- </element>
- <element name="BATTERY">
- <description>For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery.</description>
- </element>
- </enum>
-
- <struct name="FuelRange" since="5.0">
- <param name="type" type="FuelType" mandatory="false"/>
- <param name="range" type="Float" minvalue="0" maxvalue="10000" mandatory="false">
- <description>
- The estimate range in KM the vehicle can travel based on fuel level and consumption.
- </description>
- </param>
- </struct>
-
- <enum name="ElectronicParkBrakeStatus" since="5.0">
- <element name="CLOSED">
- <description>
- Park brake actuators have been fully applied.
- </description>
- </element>
- <element name="TRANSITION">
- <description>
- Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
- </description>
- </element>
- <element name="OPEN">
- <description>
- Park brake actuators are released.
- </description>
- </element>
- <element name="DRIVE_ACTIVE">
- <description>
- When driver pulls the Electronic Park Brake switch while driving "at speed".
- </description>
- </element>
- <element name="FAULT">
- <description>
- When system has a fault or is under maintenance.
- </description>
- </element>
- </enum>
-
- <struct name="SingleTireStatus" since="2.0">
- <param name="status" type="ComponentVolumeStatus" mandatory="true">
- <description>See ComponentVolumeStatus.</description>
- </param>
- <param name="tpms" type="TPMS" mandatory="false" since="5.0">
- <description>
- The status of TPMS according to the particular tire.
- </description>
- </param>
- <param name="pressure" type="Float" mandatory="false" minvalue="0" maxvalue="2000" since="5.0">
- <description>The pressure value of the particular tire in kilo pascal.</description>
- </param>
- </struct>
-
- <enum name="WarningLightStatus" since="2.0">
- <description>Reflects the status of a cluster instrument warning light.</description>
- <element name="OFF" internal_name="WLS_OFF">
- </element>
- <element name="ON" internal_name="WLS_ON">
- </element>
- <element name="FLASH" internal_name="WLS_FLASH">
- </element>
- <element name="NOT_USED" internal_name="WLS_NOT_USED">
- </element>
- </enum>
-
- <enum name="VehicleDataNotificationStatus" since="2.0">
- <description>Reflects the status of a vehicle data notification.</description>
- <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
- </element>
- <element name="NORMAL" internal_name="VDNS_NORMAL">
- </element>
- <element name="ACTIVE" internal_name="VDNS_ACTIVE">
- </element>
- <element name="NOT_USED" internal_name="VDNS_NOT_USED">
- </element>
- </enum>
-
- <enum name="IgnitionStableStatus" since="2.0">
- <description>Reflects the ignition switch stability.</description>
- <element name="IGNITION_SWITCH_NOT_STABLE">
- </element>
- <element name="IGNITION_SWITCH_STABLE">
- </element>
- <element name="MISSING_FROM_TRANSMITTER">
- </element>
- </enum>
-
- <enum name="IgnitionStatus" since="2.0">
- <description>Reflects the status of ignition.</description>
- <element name="UNKNOWN" internal_name="IS_UNKNOWN">
- </element>
- <element name="OFF" internal_name="IS_OFF">
- </element>
- <element name="ACCESSORY" internal_name="IS_ACCESSORY">
- </element>
- <element name="RUN" internal_name="IS_RUN">
- </element>
- <element name="START" internal_name="IS_START">
- </element>
- <element name="INVALID" internal_name="IS_INVALID">
- </element>
- </enum>
-
- <enum name="VehicleDataEventStatus" since="2.0">
- <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
- <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
- </element>
- <element name="NO" internal_name="VDES_NO">
- </element>
- <element name="YES" internal_name="VDES_YES">
- </element>
- <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="VDES_FAULT">
- </element>
- </enum>
-
- <enum name="DeviceLevelStatus" since="2.0">
- <description>Reflects the reported battery status of the connected device, if reported.</description>
- <element name="ZERO_LEVEL_BARS">
- </element>
- <element name="ONE_LEVEL_BARS">
- </element>
- <element name="TWO_LEVEL_BARS">
- </element>
- <element name="THREE_LEVEL_BARS">
- </element>
- <element name="FOUR_LEVEL_BARS">
- </element>
- <element name="NOT_PROVIDED">
- </element>
- </enum>
-
- <enum name="PrimaryAudioSource" since="2.0">
- <description>Reflects the current primary audio source (if selected).</description>
- <element name="NO_SOURCE_SELECTED">
- </element>
- <element name="CD" since="5.0">
- </element>
- <element name="USB">
- </element>
- <element name="USB2">
- </element>
- <element name="BLUETOOTH_STEREO_BTST">
- </element>
- <element name="LINE_IN">
- </element>
- <element name="IPOD">
- </element>
- <element name="MOBILE_APP">
- </element>
- <element name="AM" since="5.0">
- </element>
- <element name="FM" since="5.0">
- </element>
- <element name="XM" since="5.0">
- </element>
- <element name="DAB" since="5.0">
- </element>
- </enum>
-
- <enum name="WiperStatus" since="2.0">
- <description>Reflects the status of the wipers.</description>
- <element name="OFF" />
- <element name="AUTO_OFF" />
- <element name="OFF_MOVING" />
- <element name="MAN_INT_OFF" />
- <element name="MAN_INT_ON" />
- <element name="MAN_LOW" />
- <element name="MAN_HIGH" />
- <element name="MAN_FLICK" />
- <element name="WASH" />
- <element name="AUTO_LOW" />
- <element name="AUTO_HIGH" />
- <element name="COURTESYWIPE" />
- <element name="AUTO_ADJUST" />
- <element name="STALLED" />
- <element name="NO_DATA_EXISTS" />
- </enum>
-
- <enum name="VehicleDataStatus" since="2.0">
- <description>Reflects the status of a binary vehicle data item.</description>
- <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
- </element>
- <element name="OFF" internal_name="VDS_OFF">
- </element>
- <element name="ON" internal_name="VDS_ON">
- </element>
- </enum>
-
- <enum name="MaintenanceModeStatus" since="2.0">
- <description>Reflects the status of a vehicle maintenance mode.</description>
- <element name="NORMAL" internal_name="MMS_NORMAL">
- </element>
- <element name="NEAR" internal_name="MMS_NEAR">
- </element>
- <element name="ACTIVE" internal_name="MMS_ACTIVE">
- </element>
- <element name="FEATURE_NOT_PRESENT" internal_name="MMS_FEATURE_NOT_PRESENT">
- </element>
- </enum>
-
- <enum name="VehicleDataActiveStatus" since="2.0">
- <description>Reflects the status of given vehicle component.</description>
- <element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
- </element>
- <element name="INACTIVE_CONFIRMED" internal_name="VDAS_INACTIVE_CONFIRMED">
- </element>
- <element name="ACTIVE_NOT_CONFIRMED" internal_name="VDAS_ACTIVE_NOT_CONFIRMED">
- </element>
- <element name="ACTIVE_CONFIRMED" internal_name="VDAS_ACTIVE_CONFIRMED">
- </element>
- <element name="FAULT" internal_name="VDAS_FAULT">
- </element>
- </enum>
-
- <enum name="AmbientLightStatus" since="2.0">
- <description>Reflects the status of the ambient light sensor.</description>
- <element name="NIGHT" />
- <element name="TWILIGHT_1" />
- <element name="TWILIGHT_2" />
- <element name="TWILIGHT_3" />
- <element name="TWILIGHT_4" />
- <element name="DAY" />
- <element name="UNKNOWN" internal_name="ALS_UNKNOWN" />
- <element name="INVALID" />
- </enum>
-
- <enum name="ModuleType" since="4.5">
- <element name="CLIMATE"/>
- <element name="RADIO"/>
- <element name="SEAT" since="5.0"/>
- <element name="AUDIO" since="5.0"/>
- <element name="LIGHT" since="5.0"/>
- <element name="HMI_SETTINGS" since="5.0"/>
- </enum>
-
- <enum name="DefrostZone" since="4.5">
- <element name="FRONT"/>
- <element name="REAR"/>
- <element name="ALL"/>
- <element name="NONE"/>
- </enum>
-
- <enum name="VentilationMode" since="4.5">
- <element name="UPPER"/>
- <element name="LOWER"/>
- <element name="BOTH"/>
- <element name="NONE"/>
- </enum>
-
- <enum name="RadioBand" since="4.5">
- <element name="AM"/>
- <element name="FM"/>
- <element name="XM"/>
- </enum>
-
- <enum name="RadioState" since="4.5">
- <element name="ACQUIRING"/>
- <element name="ACQUIRED"/>
- <element name="MULTICAST"/>
- <element name="NOT_FOUND"/>
- </enum>
-
- <enum name="TemperatureUnit" since="4.5">
- <element name="FAHRENHEIT"/>
- <element name="CELSIUS"/>
- </enum>
-
- <struct name="BeltStatus" since="2.0">
- <param name="driverBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerBuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverBuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerChildDetected" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="leftRearInflatableBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="rightRearInflatableBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="BodyInformation" since="2.0">
- <param name="parkBrakeActive" type="Boolean" mandatory="true">
- <description>References signal "PrkBrkActv_B_Actl".</description>
- </param>
- <param name="ignitionStableStatus" type="IgnitionStableStatus" mandatory="true">
- <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
- </param>
- <param name="ignitionStatus" type="IgnitionStatus" mandatory="true">
- <description>References signal "Ignition_status". See IgnitionStatus.</description>
- </param>
- <param name="driverDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatDrv_B_Actl".</description>
- </param>
- <param name="passengerDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatPsngr_B_Actl".</description>
- </param>
- <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRl_B_Actl".</description>
- </param>
- <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
- <description>References signal "DrStatRr_B_Actl".</description>
- </param>
- </struct>
-
- <struct name="DeviceStatus" since="2.0">
- <param name="voiceRecOn" type="Boolean" mandatory="true">
- <description>References signal "CPM_VoiceRec_STAT".</description>
- </param>
- <param name="btIconOn" type="Boolean" mandatory="true">
- <description>References signal "BT_ICON".</description>
- </param>
- <param name="callActive" type="Boolean" mandatory="true">
- <description>References signal "CPM_Call_Active_STAT".</description>
- </param>
- <param name="phoneRoaming" type="Boolean" mandatory="true">
- <description>References signal "CPM_Phone_Roaming_STAT".</description>
- </param>
- <param name="textMsgAvailable" type="Boolean" mandatory="true">
- <description>References signal "CPM_TextMsg_AVAL".</description>
- </param>
- <param name="battLevelStatus" type="DeviceLevelStatus" mandatory="true">
- <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
- </param>
- <param name="stereoAudioOutputMuted" type="Boolean" mandatory="true">
- <description>References signal "CPM_Stereo_Audio_Output".</description>
- </param>
- <param name="monoAudioOutputMuted" type="Boolean" mandatory="true">
- <description>References signal "CPM_Mono_Audio_Output".</description>
- </param>
- <param name="signalLevelStatus" type="DeviceLevelStatus" mandatory="true">
- <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
- </param>
- <param name="primaryAudioSource" type="PrimaryAudioSource" mandatory="true">
- <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
- </param>
- <param name="eCallEventActive" type="Boolean" mandatory="true">
- <description>References signal "eCall_Event".</description>
- </param>
- </struct>
-
- <struct name="HeadLampStatus" since="2.0">
- <param name="lowBeamsOn" type="Boolean" mandatory="true">
- <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
- </param>
- <param name="highBeamsOn" type="Boolean" mandatory="true">
- <description>Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat".</description>
- </param>
- <param name="ambientLightSensorStatus" type="AmbientLightStatus" mandatory="false">
- <description>Status of the ambient light sensor.</description>
- </param>
- </struct>
-
- <struct name="AppInfo" since="4.2">
- <description>Contains detailed information about the registered application.</description>
-
- <param name="appDisplayName" type="String" maxlength="100" mandatory="true">
- <description>The name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request).</description>
- </param>
-
- <param name="appBundleID" type="String" maxlength="256" mandatory="true">
- <description>The AppBundleID of an iOS application or package name of the Android application. This supports App Launch strategies for each platform.</description>
- </param>
-
- <param name="appVersion" type="String" maxlength="256" mandatory="true">
- <description>Represents the build version number of this particular mobile app.</description>
- </param>
-
- <param name="appIcon" type="String" maxlength="500" mandatory="false">
- <description>A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration).</description>
- </param>
- </struct>
-
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- Ford Specific Data Items -->
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <enum name="FileType" since="2.0">
- <description>Enumeration listing possible file types.</description>
- <element name="GRAPHIC_BMP" />
- <element name="GRAPHIC_JPEG" />
- <element name="GRAPHIC_PNG" />
- <element name="AUDIO_WAVE" />
- <element name="AUDIO_MP3" />
- <element name="AUDIO_AAC" />
- <element name="BINARY" />
- <element name="JSON" />
- </enum>
-
- <enum name="FuelCutoffStatus" since="2.0">
- <description>Reflects the status of the RCM fuel cutoff.</description>
- <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
- </element>
- <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
- </element>
- <element name="FAULT" internal_name="FCS_FAULT">
- </element>
- </enum>
-
- <enum name="EmergencyEventType" since="2.0">
- <description>Reflects the emergency event status of the vehicle.</description>
- <element name="NO_EVENT" internal_name="EET_NO_EVENT">
- </element>
- <element name="FRONTAL" internal_name="EET_FRONTAL">
- </element>
- <element name="SIDE" internal_name="EET_SIDE">
- </element>
- <element name="REAR" internal_name="EET_REAR">
- </element>
- <element name="ROLLOVER" internal_name="EET_ROLLOVER">
- </element>
- <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
- </element>
- <element name="FAULT" internal_name="EET_FAULT">
- </element>
- </enum>
-
- <enum name="ECallConfirmationStatus" since="2.0">
- <description>Reflects the status of the eCall Notification.</description>
- <element name="NORMAL" internal_name="ECCS_NORMAL">
- </element>
- <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
- </element>
- <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
- </element>
- <element name="CALL_COMPLETED">
- </element>
- <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
- </element>
- <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
- </element>
- <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
- </element>
- </enum>
-
- <enum name="PowerModeQualificationStatus" since="2.0">
- <description>Reflects the status of the current power mode qualification.</description>
- <element name="POWER_MODE_UNDEFINED">
- </element>
- <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
- </element>
- <element name="NOT_DEFINED">
- </element>
- <element name="POWER_MODE_OK">
- </element>
- </enum>
-
- <enum name="PowerModeStatus" since="2.0">
- <description>Reflects the status of the current power mode.</description>
- <element name="KEY_OUT">
- </element>
- <element name="KEY_RECENTLY_OUT">
- </element>
- <element name="KEY_APPROVED_0">
- </element>
- <element name="POST_ACCESORY_0">
- </element>
- <element name="ACCESORY_1">
- </element>
- <element name="POST_IGNITION_1">
- </element>
- <element name="IGNITION_ON_2">
- </element>
- <element name="RUNNING_2">
- </element>
- <element name="CRANK_3">
- </element>
- </enum>
-
- <enum name="CarModeStatus" since="2.0">
- <description>Reflects the status of the current car mode.</description>
- <element name="NORMAL" internal_name="CMS_NORMAL">
- </element>
- <element name="FACTORY" internal_name="CMS_FACTORY">
- </element>
- <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
- </element>
- <element name="CRASH" internal_name="CMS_CRASH">
- </element>
- </enum>
-
- <struct name="ECallInfo" since="2.0">
- <param name="eCallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
- <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
- <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
- </param>
- <param name="eCallConfirmationStatus" type="ECallConfirmationStatus" mandatory="true">
- <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
- </param>
- </struct>
-
- <struct name="AirbagStatus" since="2.0">
- <param name="driverAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="EmergencyEvent" since="2.0">
- <param name="emergencyEventType" type="EmergencyEventType" mandatory="true">
- <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
- </param>
- <param name="fuelCutoffStatus" type="FuelCutoffStatus" mandatory="true">
- <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
- </param>
- <param name="rolloverEvent" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
-
- <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255" mandatory="true">
- <description>References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values:
- 0x00 No event
- 0xFE Not supported
- 0xFF Fault
- </description>
- </param>
- <param name="multipleEvents" type="VehicleDataEventStatus" mandatory="true">
- <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
- </param>
- </struct>
-
- <struct name="ClusterModeStatus" since="2.0">
- <param name="powerModeActive" type="Boolean" mandatory="true">
- <description>References signal "PowerMode_UB".</description>
- </param>
- <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus" mandatory="true">
- <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
- </param>
- <param name="carModeStatus" type="CarModeStatus" mandatory="true">
- <description>References signal "CarMode". See CarMode.</description>
- </param>
- <param name="powerModeStatus" type="PowerModeStatus" mandatory="true">
- <description>References signal "PowerMode". See PowerMode.</description>
- </param>
- </struct>
-
- <struct name="MyKey" since="2.0">
- <param name="e911Override" type="VehicleDataStatus" mandatory="true">
- <description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
- </param>
- </struct>
-
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- / Ford Specific Data Items -->
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
- <enum name="VehicleDataResultCode" since="2.0">
- <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
- <element name="SUCCESS" internal_name="VDRC_SUCCESS">
- <description>Individual vehicle data item / DTC / DID request or subscription successful</description>
- </element>
- <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA">
- <description>DTC / DID request successful, however, not all active DTCs or full contents of DID location available</description>
- </element>
- <element name="DISALLOWED" internal_name="VDRC_DISALLOWED">
- <description>This vehicle data item is not allowed for this app by Ford.</description>
- </element>
- <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED">
- <description>The user has not granted access to this type of vehicle data item at this time.</description>
- </element>
- <element name="INVALID_ID" internal_name="VDRC_INVALID_ID">
- <description>The ECU ID referenced is not a valid ID on the bus / system.</description>
- </element>
- <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE">
- <description>The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system.</description>
- </element>
- <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED">
- <description>The vehicle data item is already subscribed.</description>
- </element>
- <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED">
- <description>The vehicle data item cannot be unsubscribed because it is not currently subscribed.</description>
- </element>
- <element name="IGNORED" internal_name="VDRC_IGNORED">
- <description>The request for this item is ignored because it is already in progress.</description>
- </element>
- </enum>
-
- <struct name="TireStatus" since="2.0">
- <description>The status and pressure of the tires.</description>
-
- <param name="pressureTelltale" type="WarningLightStatus" mandatory="true">
- <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
- </param>
- <param name="leftFront" type="SingleTireStatus" mandatory="true">
- <description>The status of the left front tire.</description>
- </param>
- <param name="rightFront" type="SingleTireStatus" mandatory="true">
- <description>The status of the right front tire.</description>
- </param>
- <param name="leftRear" type="SingleTireStatus" mandatory="true">
- <description>The status of the left rear tire.</description>
- </param>
- <param name="rightRear" type="SingleTireStatus" mandatory="true">
- <description>The status of the right rear tire.</description>
- </param>
- <param name="innerLeftRear" type="SingleTireStatus" mandatory="true">
- <description>The status of the inner left rear.</description>
- </param>
- <param name="innerRightRear" type="SingleTireStatus" mandatory="true">
- <description>The status of the inner right rear.</description>
- </param>
- </struct>
-
- <enum name="TurnSignal" since="5.0">
- <description>Enumeration that describes the status of the turn light indicator.</description>
- <element name="OFF">
- <description>Turn signal is OFF</description>
- </element>
- <element name="LEFT">
- <description>Left turn signal is on</description>
- </element>
- <element name="RIGHT">
- <description>Right turn signal is on</description>
- </element>
- <element name="BOTH">
- <description>Both signals (left and right) are on.</description>
- </element>
- </enum>
-
- <struct name="GPSData" since="2.0">
- <description>Struct with the GPS data.</description>
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
- </param>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false" since="5.0">
- <description>The current UTC year.</description>
- <history>
- <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="5.0">
- <description>The current UTC month.</description>
- <history>
- <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="5.0">
- <description>The current UTC day.</description>
- <history>
- <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="5.0">
- <description>The current UTC hour.</description>
- <history>
- <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
- <description>The current UTC minute.</description>
- <history>
- <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="5.0">
- <description>The current UTC second.</description>
- <history>
- <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="compassDirection" type="CompassDirection" mandatory="false" since="5.0">
- <description>See CompassDirection.</description>
- <history>
- <param name="compassDirection" type="CompassDirection" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="pdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
- <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
- <history>
- <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="hdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
- <description>HDOP. If value is unknown, value shall be set to 0.</description>
- <history>
- <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="vdop" type="Float" minvalue="0" maxvalue="1000" defvalue="0" mandatory="false" since="5.0">
- <description>VDOP. If value is unknown, value shall be set to 0.</description>
- <history>
- <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="actual" type="Boolean" mandatory="false" since="5.0">
- <description>
- True, if actual.
- False, if inferred.
- </description>
- <history>
- <param name="actual" type="Boolean" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false" since="5.0">
- <description>Number of satellites in view</description>
- <history>
- <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="dimension" type="Dimension" mandatory="false" since="5.0">
- <description>See Dimension</description>
- <history>
- <param name="dimension" type="Dimension" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false" since="5.0">
- <description>Altitude in meters</description>
- <history>
- <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false" since="5.0">
- <description>The heading. North is 0. Resolution is 0.01</description>
- <history>
- <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false" since="5.0">
- <description>The speed in KPH</description>
- <history>
- <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true" since="2.0" until="5.0"/>
- </history>
- </param>
- </struct>
-
- <struct name="VehicleDataResult" since="2.0">
- <description>Individual published data request result</description>
- <param name="dataType" type="VehicleDataType" mandatory="true">
- <description>Defined published data element type.</description>
- </param>
- <param name="resultCode" type="VehicleDataResultCode" mandatory="true">
- <description>Published data result code.</description>
- </param>
- </struct>
-
- <struct name="DIDResult" since="2.0">
- <description>Individual requested DID result and data</description>
- <param name="resultCode" type="VehicleDataResultCode" mandatory="true">
- <description>Individual DID result code.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Location of raw data from vehicle data DID</description>
- </param>
- <param name="data" type="String" maxlength="5000" mandatory="false">
- <description>Raw DID-based data returned for requested element.</description>
- </param>
- </struct>
-
- <struct name="StartTime" since="1.0">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
- <description>
- The hour of the media clock.
- Some radios only support a max of 19 hours. If out of range, it will be rejected.
- </description>
- </param>
- <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
- <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
- </struct>
-
- <struct name="TextField" since="1.0">
- <param name="name" type="TextFieldName" mandatory="true">
- <description>The name that identifies the field. See TextFieldName.</description>
- </param>
- <param name="characterSet" type="CharacterSet" mandatory="true">
- <description>The character set that is supported in this field. See CharacterSet.</description>
- </param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
- <description>The number of characters in one row of this field.</description>
- </param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
- <description>The number of rows of this field.</description>
- </param>
- </struct>
-
- <struct name="ImageResolution" since="3.0">
- <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
- <description>The image resolution width.</description>
- </param>
- <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
- <description>The image resolution height.</description>
- </param>
- </struct>
-
- <struct name="ImageField" since="3.0">
- <param name="name" type="ImageFieldName" mandatory="true">
- <description>The name that identifies the field. See ImageFieldName.</description>
- </param>
- <param name="imageTypeSupported" type="FileType" minsize="1" maxsize="100" array="true" mandatory="true">
- <description>The image types that are supported in this field. See FileType.</description>
- </param>
- <param name="imageResolution" type="ImageResolution" mandatory="false">
- <description>The image resolution of this field.</description>
- </param>
- </struct>
-
- <struct name="TouchCoord" since="3.0">
- <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The x coordinate of the touch.</description>
- </param>
- <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
- <description>The y coordinate of the touch.</description>
- </param>
- </struct>
-
- <enum name="TouchType" since="3.0">
- <element name="BEGIN"/>
- <element name="MOVE"/>
- <element name="END"/>
- <element name="CANCEL" since="4.5"/>
- </enum>
-
- <struct name="TouchEvent" since="3.0">
- <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
- <description>
- A touch's unique identifier. The application can track the current touch events by id.
- If a touch event has type begin, the id should be added to the set of touches.
- If a touch event has type end, the id should be removed from the set of touches.
- </description>
- </param>
- <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="1000">
- <description>
- The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
- The timestamp is used to determined the rate of change of position of a touch.
- The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
- If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
- </description>
- </param>
- <param name="c" type="TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
- </param>
- </struct>
-
- <struct name="TouchEventCapabilities" since="3.0">
- <param name="pressAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="multiTouchAvailable" type="Boolean" mandatory="true">
- </param>
- <param name="doublePressAvailable" type="Boolean" mandatory="true">
- </param>
- </struct>
-
- <struct name="ScreenParams" since="3.0">
- <param name="resolution" type="ImageResolution" mandatory="true">
- <description>The resolution of the prescribed screen area.</description>
- </param>
- <param name="touchEventAvailable" type="TouchEventCapabilities" mandatory="false">
- <description>Types of screen touch events available in screen area.</description>
- </param>
- </struct>
-
- <enum name="PermissionStatus" since="2.0">
- <description>Enumeration that describes possible permission states of a policy table entry.</description>
- <element name="ALLOWED" internal_name="PS_ALLOWED"/>
- <element name="DISALLOWED" internal_name="PS_DISALLOWED"/>
- <element name="USER_DISALLOWED" internal_name="PS_USER_DISALLOWED"/>
- <element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
- </enum>
-
- <struct name="HMIPermissions" since="2.0">
- <param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>A set of all HMI levels that are permitted for this given RPC.</description>
- </param>
- <param name="userDisallowed" type="HMILevel" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>A set of all HMI levels that are prohibited for this given RPC.</description>
- </param>
- </struct>
-
- <struct name="ParameterPermissions" since="2.0">
- <param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true" mandatory="true">
- <description>A set of all parameters that are permitted for this given RPC.</description>
- </param>
- <param name="userDisallowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true" mandatory="true">
- <description>A set of all parameters that are prohibited for this given RPC.</description>
- </param>
- </struct>
-
- <struct name="PermissionItem" since="2.0">
- <param name="rpcName" type="String" maxlength="100" mandatory="true">
- <description>Name of the individual RPC in the policy table.</description>
- </param>
- <param name="hmiPermissions" type="HMIPermissions" mandatory="true"/>
- <param name="parameterPermissions" type="ParameterPermissions" mandatory="true"/>
- </struct>
-
- <struct name="DisplayCapabilities" since="1.0">
- <description>Contains information about the display capabilities.</description>
- <param name="displayType" type="DisplayType" mandatory="true" deprecated="true" since="5.0">
- <description>The type of the display. See DisplayType</description>
- <history>
- <param name="displayType" type="DisplayType" mandatory="true" since="1.0" until="5.0"/>
- </history>
- </param>
- <param name="displayName" type="String" mandatory="false" since="5.0">
- <description>The name of the display the app is connected to.</description>
- </param>
- <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="true">
- <description>A set of all fields that support text data. See TextField</description>
- </param>
- <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>A set of all fields that support images. See ImageField</description>
- </param>
- <param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
- </param>
- <param name="graphicSupported" type="Boolean" mandatory="true" since="2.0">
- <description>The display's persistent screen supports referencing a static or dynamic image.</description>
- </param>
- <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false" since="3.0">
- <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
- </param>
- <param name="screenParams" type="ScreenParams" mandatory="false" since="3.0">
- <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
- </param>
- <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false" since="3.0">
- <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
- </param>
-
- <!-- TODO: Add pixel density? -->
- </struct>
-
- <struct name="ButtonCapabilities" since="1.0">
- <description>Contains information about a button's capabilities.</description>
- <param name="name" type="ButtonName" mandatory="true">
- <description>The name of the button. See ButtonName.</description>
- </param>
- <param name="shortPressAvailable" type="Boolean" mandatory="true">
- <description>
- The button supports a short press.
- Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- </description>
- </param>
- <param name="longPressAvailable" type="Boolean" mandatory="true">
- <description>
- The button supports a LONG press.
- Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- </description>
- </param>
- <param name="upDownAvailable" type="Boolean" mandatory="true">
- <description>
- The button supports "button down" and "button up".
- Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- Whenever the button is released, onButtonEvent( UP) will be invoked.
- </description>
- </param>
- </struct>
-
- <struct name="SoftButtonCapabilities" since="2.0">
- <description>Contains information about a SoftButton's capabilities.</description>
- <param name="shortPressAvailable" type="Boolean" mandatory="true">
- <description>
- The button supports a short press.
- Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- </description>
- </param>
- <param name="longPressAvailable" type="Boolean" mandatory="true">
- <description>
- The button supports a LONG press.
- Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- </description>
- </param>
- <param name="upDownAvailable" type="Boolean" mandatory="true">
- <description>
- The button supports "button down" and "button up".
- Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- Whenever the button is released, onButtonEvent( UP) will be invoked.
- </description>
- </param>
- <param name="imageSupported" type="Boolean" mandatory="true">
- <description>The button supports referencing a static or dynamic image.</description>
- </param>
- </struct>
-
- <struct name="PresetBankCapabilities" since="2.0">
- <description>Contains information about on-screen preset capabilities.</description>
- <param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
- <description>Onscreen custom presets are available.</description>
- </param>
- </struct>
-
- <struct name="HMICapabilities" since="3.0">
- <param name="navigation" type="Boolean" mandatory="false">
- <description>Availability of build in Nav. True: Available, False: Not Available</description>
- </param>
- <param name="phoneCall" type="Boolean" mandatory="false">
- <description>Availability of build in phone. True: Available, False: Not Available </description>
- </param>
- <param name="videoStreaming" type="Boolean" mandatory="false" since="4.5">
- <description>Availability of video streaming. </description>
- </param>
- <param name="remoteControl" type="Boolean" mandatory="false" since="4.5">
- <description>Availability of remote control feature. True: Available, False: Not Available</description>
- </param>
- </struct>
-
- <struct name="MenuParams" since="1.0">
- <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" defvalue="0" mandatory="false">
- <description>
- unique ID of the sub menu, the command will be added to.
- If not provided, it will be provided to the top level of the in application menu.
- </description>
- </param>
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
- <description>
- Position within the items that are are at top level of the in application menu.
- 0 will insert at the front.
- 1 will insert at the second position.
- if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
- If this param was omitted the entry will be added at the end.
- </description>
- </param>
- <param name="menuName" type="String" maxlength="500" mandatory="true">
- <description>Text to show in the menu for this sub menu.</description>
- </param>
- </struct>
-
- <struct name="TTSChunk" since="1.0">
- <description>A TTS chunk, that consists of text/phonemes to speak or the name of a file to play, and a TTS type (like text or SAPI)</description>
- <param name="text" minlength="0" maxlength="500" type="String" mandatory="true">
- <description>
- The text or phonemes to speak, or the name of the audio file to play.
- May not be empty.
- </description>
- </param>
-
- <param name="type" type="SpeechCapabilities" mandatory="true">
- <description>Describes whether the TTS chunk is plain text, a specific phoneme set, or an audio file. See SpeechCapabilities</description>
- </param>
- </struct>
-
- <struct name="Turn" since="2.0">
- <param name="navigationText" type="String" maxlength="500" mandatory="false">
- <description>Individual turn text. Must provide at least text or icon for a given turn.</description>
- </param>
- <param name="turnIcon" type="Image" mandatory="false">
- <description>Individual turn icon. Must provide at least text or icon for a given turn.</description>
- </param>
- </struct>
-
- <struct name="VehicleType" since="2.0">
- <param name="make" type="String" maxlength="500" mandatory="false">
- <description>Make of the vehicle, e.g. Ford</description>
- </param>
- <param name="model" type="String" maxlength="500" mandatory="false">
- <description>Model of the vehicle, e.g. Fiesta</description>
- </param>
- <param name="modelYear" type="String" maxlength="500" mandatory="false">
- <description>Model Year of the vehicle, e.g. 2013</description>
- </param>
- <param name="trim" type="String" maxlength="500" mandatory="false">
- <description>Trim of the vehicle, e.g. SE</description>
- </param>
- </struct>
-
- <enum name="KeyboardLayout" since="3.0">
- <description>Enumeration listing possible keyboard layouts.</description>
- <element name="QWERTY" />
- <element name="QWERTZ" />
- <element name="AZERTY" />
- </enum>
-
- <enum name="KeyboardEvent" since="3.0">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="KEYPRESS" />
- <element name="ENTRY_SUBMITTED" />
- <element name="ENTRY_VOICE" />
- <element name="ENTRY_CANCELLED" />
- <element name="ENTRY_ABORTED" />
- </enum>
-
- <enum name="KeypressMode" since="3.0">
- <description>Enumeration listing possible keyboard events.</description>
- <element name="SINGLE_KEYPRESS">
- <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
- </element>
- <element name="QUEUE_KEYPRESSES">
- <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
- </element>
- <element name="RESEND_CURRENT_ENTRY">
- <description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
- </element>
- </enum>
-
- <struct name="KeyboardProperties" since="3.0">
- <description>Configuration of on-screen keyboard (if available).</description>
- <param name="language" type="Language" mandatory="false">
- <description>The keyboard language.</description>
- </param>
- <param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
- <description>Desired keyboard layout.</description>
- </param>
- <param name="keypressMode" type="KeypressMode" mandatory="false" >
- <description>
- Desired keypress mode.
- If omitted, this value will be set to RESEND_CURRENT_ENTRY.
- </description>
- </param>
- <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>Array of keyboard characters to enable.</description>
- <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
- <description>If omitted, the entire keyboard will be enabled.</description>
- </param>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
- <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
- </param>
- </struct>
-
- <struct name="DeviceInfo" since="3.0">
- <description>Various information about connecting device.</description>
- <param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device model</description>
- </param>
- <param name="firmwareRev" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device firmware revision</description>
- </param>
- <param name="os" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device OS</description>
- </param>
- <param name="osVersion" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device OS version</description>
- </param>
- <param name="carrier" type="String" minlength="0" maxlength="500" mandatory="false">
- <description>Device mobile carrier (if applicable)</description>
- </param>
- <param name="maxNumberRFCOMMPorts" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- <description>Omitted if connected not via BT.</description>
- </param>
- </struct>
-
- <enum name="RequestType" since="3.0">
- <description>Enumeration listing possible asynchronous requests.</description>
- <element name="HTTP" />
- <element name="FILE_RESUME" />
- <element name="AUTH_REQUEST" />
- <element name="AUTH_CHALLENGE" />
- <element name="AUTH_ACK" />
- <element name="PROPRIETARY" />
- <element name="QUERY_APPS" />
- <element name="LAUNCH_APP" />
- <element name="LOCK_SCREEN_ICON_URL" />
- <element name="TRAFFIC_MESSAGE_CHANNEL" />
- <element name="DRIVER_PROFILE" />
- <element name="VOICE_SEARCH" />
- <element name="NAVIGATION" />
- <element name="PHONE" />
- <element name="CLIMATE" />
- <element name="SETTINGS" />
- <element name="VEHICLE_DIAGNOSTICS" />
- <element name="EMERGENCY" />
- <element name="MEDIA" />
- <element name="FOTA" />
- <element name="OEM_SPECIFIC" since="5.0" />
- </enum>
-
- <enum name="AppHMIType" since="2.0">
- <description>Enumeration listing possible app types.</description>
- <element name="DEFAULT" />
- <element name="COMMUNICATION" />
- <element name="MEDIA" />
- <element name="MESSAGING" />
- <element name="NAVIGATION" />
- <element name="INFORMATION" />
- <element name="SOCIAL" />
- <element name="BACKGROUND_PROCESS" />
- <element name="TESTING" />
- <element name="SYSTEM" />
- <element name="PROJECTION" since="4.5" />
- <element name="REMOTE_CONTROL" since="4.5" />
- </enum>
-
- <enum name="PredefinedLayout" platform="documentation" since="3.0">
- <description>Predefined screen layout.</description>
- <element name="DEFAULT" rootscreen="true">
- <description>
- Default media / non-media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="MEDIA" rootscreen="true">
- <description>
- Default Media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NON-MEDIA" internal_name="NON_MEDIA" rootscreen="true">
- <description>
- Default Non-media screen.
- Can be set as a root screen.
- </description>
- </element>
- <element name="ONSCREEN_PRESETS" rootscreen="true">
- <description>
- Custom root media screen containing app-defined onscreen presets.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_FULLSCREEN_MAP" rootscreen="true" >
- <description>
- Custom root template screen containing full screen map with navigation controls.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_LIST" rootscreen="true" >
- <description>
- Custom root template screen containing video represented list.
- Can be set as a root screen.
- </description>
- </element>
- <element name="NAV_KEYBOARD" rootscreen="true" >
- <description>
- Custom root template screen containing video represented keyboard.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXT" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with lines of text.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXT_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing lines of text with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TILES_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only tiled SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXTBUTTONS_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only text SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TILES" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with tiled SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TILES_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing tiled SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with text and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing text and SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="GRAPHIC_WITH_TEXTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing half-screen graphic with text only SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="TEXTBUTTONS_WITH_GRAPHIC" rootscreen="true">
- <description>
- Custom root template screen containing text only SoftButtons with half-screen graphic.
- Can be set as a root screen.
- </description>
- </element>
- <element name="LARGE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing a large graphic and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="DOUBLE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
- <description>
- Custom root template screen containing two graphics and SoftButtons.
- Can be set as a root screen.
- </description>
- </element>
- <element name="LARGE_GRAPHIC_ONLY" rootscreen="true">
- <description>
- Custom root template screen containing only a large graphic.
- Can be set as a root screen.
- </description>
- </element>
- </enum>
-
- <enum name="FunctionID" internal_scope="base" since="1.0">
- <description>Enumeration linking function names with function IDs in AppLink protocol. Assumes enumeration starts at value 0.</description>
- <element name="RESERVED" value="0" since="1.0" />
- <!--
- Base Request / Response RPCs
- Range = 0x 0000 0001 - 0x 0000 7FFF
- -->
- <element name="RegisterAppInterfaceID" value="1" hexvalue="1" since="1.0" />
- <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" since="1.0" />
- <element name="SetGlobalPropertiesID" value="3" hexvalue="3" since="1.0" />
- <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" since="1.0" />
- <element name="AddCommandID" value="5" hexvalue="5" since="1.0" />
- <element name="DeleteCommandID" value="6" hexvalue="6" since="1.0" />
- <element name="AddSubMenuID" value="7" hexvalue="7" since="1.0" />
- <element name="DeleteSubMenuID" value="8" hexvalue="8" since="1.0" />
- <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" since="1.0" />
- <element name="PerformInteractionID" value="10" hexvalue="A" since="1.0" />
- <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" since="1.0" />
- <element name="AlertID" value="12" hexvalue="C" since="1.0" />
- <element name="ShowID" value="13" hexvalue="D" since="1.0" />
- <element name="SpeakID" value="14" hexvalue="E" since="1.0" />
- <element name="SetMediaClockTimerID" value="15" hexvalue="F" since="1.0" />
- <element name="PerformAudioPassThruID" value="16" hexvalue="10" since="2.0" />
- <element name="EndAudioPassThruID" value="17" hexvalue="11" since="2.0" />
- <element name="SubscribeButtonID" value="18" hexvalue="12" since="1.0" />
- <element name="UnsubscribeButtonID" value="19" hexvalue="13" since="1.0" />
- <element name="SubscribeVehicleDataID" value="20" hexvalue="14" since="2.0" />
- <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" since="2.0" />
- <element name="GetVehicleDataID" value="22" hexvalue="16" since="2.0" />
- <element name="ReadDIDID" value="23" hexvalue="17" since="2.0" />
- <element name="GetDTCsID" value="24" hexvalue="18" since="2.0" />
- <element name="ScrollableMessageID" value="25" hexvalue="19" since="2.0" />
- <element name="SliderID" value="26" hexvalue="1A" since="2.0" />
- <element name="ShowConstantTBTID" value="27" hexvalue="1B" since="2.0" />
- <element name="AlertManeuverID" value="28" hexvalue="1C" since="2.0" />
- <element name="UpdateTurnListID" value="29" hexvalue="1D" since="2.0" />
- <element name="ChangeRegistrationID" value="30" hexvalue="1E" since="2.0" />
- <element name="GenericResponseID" value="31" hexvalue="1F" since="1.0" />
- <element name="PutFileID" value="32" hexvalue="20" since="3.0" />
- <element name="DeleteFileID" value="33" hexvalue="21" since="3.0" />
- <element name="ListFilesID" value="34" hexvalue="22" since="3.0" />
- <element name="SetAppIconID" value="35" hexvalue="23" since="3.0" />
- <element name="SetDisplayLayoutID" value="36" hexvalue="24" since="3.0" />
- <element name="DiagnosticMessageID" value="37" hexvalue="25" since="3.0" />
- <element name="SystemRequestID" value="38" hexvalue="26" since="3.0" />
- <element name="SendLocationID" value="39" hexvalue="27" since="3.0" />
- <element name="DialNumberID" value="40" hexvalue="28" since="3.0" />
- <element name="ButtonPressID" value="41" hexvalue="29" since="4.5" />
- <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" since="4.5" />
- <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" since="4.5" />
- <element name="GetWayPointsID" value="45" hexvalue="2D" since="4.1" />
- <element name="SubscribeWayPointsID" value="46" hexvalue="2E" since="4.1" />
- <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" since="4.1" />
- <element name="GetSystemCapabilityID" value="48" hexvalue="30" since="4.5" />
- <element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" />
-
- <!--
- Base Notifications
- Range = 0x 0000 8000 - 0x 0000 FFFF
- -->
-
- <element name="OnHMIStatusID" value="32768" hexvalue="8000" since="1.0" />
- <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" since="1.0" />
- <element name="OnButtonEventID" value="32770" hexvalue="8002" since="1.0" />
- <element name="OnButtonPressID" value="32771" hexvalue="8003" since="1.0" />
- <element name="OnVehicleDataID" value="32772" hexvalue="8004" since="2.0" />
- <element name="OnCommandID" value="32773" hexvalue="8005" since="1.0" />
- <element name="OnTBTClientStateID" value="32774" hexvalue="8006" since="1.0" />
- <element name="OnDriverDistractionID" value="32775" hexvalue="8007" since="1.0" />
- <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" since="2.0" />
- <element name="OnAudioPassThruID" value="32777" hexvalue="8009" since="2.0" />
- <element name="OnLanguageChangeID" value="32778" hexvalue="800A" since="2.0" />
- <element name="OnKeyboardInputID" value="32779" hexvalue="800B" since="3.0" />
- <element name="OnTouchEventID" value="32780" hexvalue="800C" since="3.0" />
- <element name="OnSystemRequestID" value="32781" hexvalue="800D" since="3.0" />
- <element name="OnHashChangeID" value="32782" hexvalue="800E" since="3.0" />
- <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" since="4.5" />
- <element name="OnWayPointChangeID" value="32784" hexvalue="8010" since="4.1" />
- <element name="OnRCStatusID" value="32785" hexvalue="8011" since="5.0" />
-
- <!--
- Ford Specific Request / Response RPCs
- Range = 0x 0001 0000 - 0x 0001 7FFF
- -->
-
- <element name="EncodedSyncPDataID" value="65536" hexvalue="10000" since="1.0" />
- <element name="SyncPDataID" value="65537" hexvalue="10001" since="1.0" />
-
- <!--
- Ford Specific Notifications
- Range = 0x 0001 8000 - 0x 0001 FFFF
- -->
-
- <element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" since="1.0" />
- <element name="OnSyncPDataID" value="98305" hexvalue="18001" since="1.0" />
- </enum>
-
- <enum name="messageType" since="1.0">
- <description>
- Enumeration linking message types with function types in WiPro protocol.
- Assumes enumeration starts at value 0.
- </description>
- <element name="request" value="0" />
- <element name="response" value="1" />
- <element name="notification" value="2" />
- </enum>
-
- <struct name="DateTime" since="4.1">
- <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false" since="4.2.2">
- <description>Milliseconds </description>
- </param>
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false" since="4.2.2">
- <description>Seconds part of time</description>
- <history>
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="true" since="4.1" until="4.2.1" />
- </history>
- </param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false" since="4.2.2">
- <description>Minutes part of time</description>
- <history>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="true" since="4.1" until="4.2.1" />
- </history>
- </param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false" since="4.2.2">
- <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
- <history>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="true" since="4.1" until="4.2.1" />
- </history>
- </param>
- <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false" since="4.2.2">
- <description>Day of the month</description>
- <history>
- <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="true" since="4.1" until="4.2.1" />
- </history>
- </param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false" since="4.2.2">
- <description>Month of the year</description>
- <history>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="true" since="4.1" until="4.2.1" />
- </history>
- </param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="false" since="4.2.2">
- <description>The year in YYYY format</description>
- <history>
- <param name="year" type="Integer" maxvalue="4095" mandatory="true" since="4.1" until="4.2.1" />
- </history>
- </param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false" since="4.2.2">
- <description>Time zone offset in Hours wrt UTC.</description>
- <history>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
- </history>
- </param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false" since="4.2.2">
- <description>Time zone offset in Min wrt UTC.</description>
- <history>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="true" since="4.1" until="4.2.1" />
- </history>
- </param>
- </struct>
-
- <enum name="WayPointType" since="4.1">
- <description>Describes what kind of waypoint is requested/provided.</description>
- <element name="ALL" />
- <element name="DESTINATION" />
- </enum>
-
- <struct name="Coordinate" since="4.1">
- <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
- <description>Latitude of the location.</description>
- </param>
- <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
- <description>Longitude of the location.</description>
- </param>
- </struct>
-
- <struct name="OASISAddress" since="4.1">
- <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Name of the country (localized)</description>
- </param>
- <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
- <description>Name of country (ISO 3166-2)</description>
- </param>
- <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
- <description>(PLZ, ZIP, PIN, CAP etc.)</description>
- </param>
- <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of country (e.g. state)</description>
- </param>
- <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of e.g. state (e.g. county)</description>
- </param>
- <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. city/village</description>
- </param>
- <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. district</description>
- </param>
- <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for street, road etc.</description>
- </param>
- <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of thoroughfare e.g. house number</description>
- </param>
- </struct>
-
- <struct name="LocationDetails" since="4.1">
- <param name="coordinate" type="Coordinate" mandatory="false">
- <description>Latitude/Longitude of the location.</description>
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description>Name of location.</description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>Location address for display purposes only</description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description>Description intended location / establishment (if applicable)</description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description>Phone number of location / establishment.</description>
- </param>
- <param name="locationImage" type="Image" mandatory="false">
- <description>Image / icon of intended location.</description>
- </param>
- <param name="searchAddress" type="OASISAddress" mandatory="false">
- <description>Address to be used by navigation engines for search</description>
- </param>
- </struct>
-
- <enum name="SystemCapabilityType" since="4.5">
- <description>Enumerations of all available system capability types</description>
- <element name="NAVIGATION"/>
- <element name="PHONE_CALL"/>
- <element name="VIDEO_STREAMING"/>
- <element name="REMOTE_CONTROL"/>
- </enum>
-
- <struct name="NavigationCapability" since="4.5">
- <description>Extended capabilities for an onboard navigation system</description>
- <param name="sendLocationEnabled" type="Boolean" mandatory="false">
- <description>If the module has the ability to add locations to the onboard nav</description>
- </param>
- <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
- <description>If the module has the ability to return way points from onboard nav</description>
- </param>
- </struct>
-
- <struct name="PhoneCapability" since="4.5">
- <description>Extended capabilities of the module's phone feature</description>
- <param name="dialNumberEnabled" type="Boolean" mandatory="false">
- <description>If the module has the ability to perform dial number</description>
- </param>
- </struct>
-
- <struct name="VideoStreamingFormat" since="4.5">
- <description>Video streaming formats and their specifications.</description>
- <param name="protocol" type="VideoStreamingProtocol" mandatory="true">
- <description>Protocol type, see VideoStreamingProtocol</description>
- </param>
- <param name="codec" type="VideoStreamingCodec" mandatory="true">
- <description>Codec type, see VideoStreamingCodec</description>
- </param>
- </struct>
-
- <struct name="VideoStreamingCapability" since="4.5">
- <description>Contains information about this system's video streaming capabilities.</description>
- <param name="preferredResolution" type="ImageResolution" mandatory="false">
- <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
- </param>
- <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
- <description>The maximum bitrate of video stream that is supported, in kbps.</description>
- </param>
- <param name="supportedFormats" type="VideoStreamingFormat" array="true" mandatory="false">
- <description>Detailed information on each format supported by this system, in its preferred order (i.e. the first element in the array is most preferable to the system). Each object will contain a VideoStreamingFormat that describes what can be expected.</description>
- </param>
- <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
- <description>True if the system can utilize the haptic spatial data from the source being streamed. If not included, it can be assumed the module doesn't support haptic spatial data'. </description>
- </param>
- </struct>
-
- <struct name="RGBColor" since="5.0">
- <param name="red" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
- <param name="green" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
- <param name="blue" type="Integer" minvalue="0" maxvalue="255" mandatory="true" />
- </struct>
-
- <struct name="TemplateColorScheme" since="5.0">
- <description>
- A color scheme for all display layout templates.
- </description>
- <param name="primaryColor" type="RGBColor" mandatory="false">
- <description>The primary "accent" color</description>
- </param>
- <param name="secondaryColor" type="RGBColor" mandatory="false">
- <description>The secondary "accent" color</description>
- </param>
- <param name="backgroundColor" type="RGBColor" mandatory="false">
- <description>The color of the background</description>
- </param>
- </struct>
-
- <!---Remote control -->
-
- <enum name="MassageZone" since="5.0">
- <description>List possible zones of a multi-contour massage seat.</description>
- <element name="LUMBAR">
- <description>The back of a multi-contour massage seat. or SEAT_BACK</description>
- </element>
- <element name="SEAT_CUSHION">
- <description>The bottom a multi-contour massage seat. or SEAT_BOTTOM </description>
- </element>
- </enum>
-
- <enum name="MassageMode" since="5.0">
- <description>List possible modes of a massage zone.</description>
- <element name="OFF"/>
- <element name="LOW"/>
- <element name="HIGH"/>
- </enum>
-
- <struct name="MassageModeData" since="5.0">
- <description>Specify the mode of a massage zone.</description>
- <param name="massageZone" type="MassageZone" mandatory="true"></param>
- <param name="massageMode" type="MassageMode" mandatory="true"></param>
- </struct>
-
- <enum name="MassageCushion" since="5.0">
- <description>List possible cushions of a multi-contour massage seat.</description>
- <element name="TOP_LUMBAR"/>
- <element name="MIDDLE_LUMBAR"/>
- <element name="BOTTOM_LUMBAR"/>
- <element name="BACK_BOLSTERS"/>
- <element name="SEAT_BOLSTERS"/>
- </enum>
-
- <struct name="MassageCushionFirmness" since="5.0">
- <description>The intensity or firmness of a cushion.</description>
- <param name="cushion" type="MassageCushion" mandatory="true"></param>
- <param name="firmness" type="Integer" minvalue="0" maxvalue="100" mandatory="true"></param>
- </struct>
-
- <enum name="SeatMemoryActionType" since="5.0">
- <element name="SAVE">
- <description>Save current seat postions and settings to seat memory.</description>
- </element>
- <element name="RESTORE">
- <description>Restore / apply the seat memory settings to the current seat. </description>
- </element>
- <element name="NONE">
- <description>No action to be performed.</description>
- </element>
- </enum>
-
- <struct name="SeatMemoryAction" since="5.0">
- <param name="id" type="Integer" minvalue="1" maxvalue="10" mandatory="true"/>
- <param name="label" type="String" maxlength="100" mandatory="false"/>
- <param name="action" type="SeatMemoryActionType" mandatory="true"/>
- </struct>
-
- <enum name="SupportedSeat" since="5.0">
- <description>List possible seats that is a remote controllable seat.</description>
- <element name="DRIVER"/>
- <element name="FRONT_PASSENGER"/>
- </enum>
-
- <struct name="SeatControlData" since="5.0">
- <description>Seat control data corresponds to "SEAT" ModuleType. </description>
- <param name="id" type="SupportedSeat" mandatory="true"></param>
-
- <param name="heatingEnabled" type="Boolean" mandatory="false"></param>
- <param name="coolingEnabled" type="Boolean" mandatory="false"></param>
- <param name="heatingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
- <param name="coolingLevel" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
-
- <param name="horizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
- <param name="verticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
- <param name="frontVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
- <param name="backVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
- <param name="backTiltAngle" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
-
- <param name="headSupportHorizontalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
- <param name="headSupportVerticalPosition" type="Integer" minvalue="0" maxvalue="100" mandatory="false"></param>
-
- <param name="massageEnabled" type="Boolean" mandatory="false"></param>
- <param name="massageMode" type="MassageModeData" minsize="1" maxsize="2" array="true" mandatory="false"></param>
- <param name="massageCushionFirmness" type="MassageCushionFirmness" minsize="1" maxsize="5" array="true" mandatory="false"></param>
-
- <param name="memory" type="SeatMemoryAction" mandatory="false"></param>
- </struct>
-
- <struct name="SeatControlCapabilities" since="5.0">
- <param name="moduleName" type="String" maxlength="100" mandatory="true">
- <description>
- The short friendly name of the light control module.
- It should not be used to identify a module by mobile application.
- </description>
- </param>
- <param name="heatingEnabledAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="coolingEnabledAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="heatingLevelAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="coolingLevelAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="horizontalPositionAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="verticalPositionAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="frontVerticalPositionAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="backVerticalPositionAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="backTiltAngleAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="headSupportHorizontalPositionAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="headSupportVerticalPositionAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="massageEnabledAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="massageModeAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="massageCushionFirmnessAvailable" type="Boolean" mandatory="false">
- </param>
- <param name="memoryAvailable" type="Boolean" mandatory="false">
- </param>
- </struct>
-
- <struct name="Temperature" since="4.5">
- <param name="unit" type="TemperatureUnit" mandatory="true">
- <description>Temperature Unit</description>
- </param>
- <param name="value" type="Float" mandatory="true">
- <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
- </param>
- </struct>
-
- <struct name="RdsData" since="4.5">
- <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
- <description>Program Service Name</description>
- </param>
- <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
- <description>Radio Text</description>
- </param>
- <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
- <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
- </param>
- <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
- <description>Program Identification - the call sign for the radio station</description>
- </param>
- <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
- <description>The program type - The region should be used to differentiate between EU and North America program types</description>
- </param>
- <param name="TP" type="Boolean" mandatory="false">
- <description>Traffic Program Identification - Identifies a station that offers traffic</description>
- </param>
- <param name="TA" type="Boolean" mandatory="false">
- <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
- </param>
- <param name="REG" type="String" mandatory="false">
- <description>Region</description>
- </param>
- </struct>
-
- <struct name="StationIDNumber" since="5.0">
- <param name="countryCode" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
- <description>Binary Representation of ITU Country Code. USA Code is 001.</description>
- </param>
- <param name="fccFacilityId" type="Integer" minvalue="0" maxvalue="999999" mandatory="false">
- <description>Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory</description>
- </param>
- </struct>
-
- <struct name="SisData" since="5.0">
- <param name="stationShortName" type="String" minlength="4" maxlength="7" mandatory="false">
- <description>Identifies the 4-alpha-character station call sign plus an optional (-FM) extension</description>
- </param>
- <param name="stationIDNumber" type="StationIDNumber" mandatory="false">
- <description>Used for network Application. Consists of Country Code and FCC Facility ID.</description>
- </param>
- <param name="stationLongName" type="String" minlength="0" maxlength="56" mandatory="false">
- <description>Identifies the station call sign or other identifying information in the long format.</description>
- </param>
- <param name="stationLocation" type="GPSData" mandatory="false">
- <description>Provides the 3-dimensional geographic station location.</description>
- </param>
- <param name="stationMessage" type="String" minlength="0" maxlength="56" mandatory="false">
- <description>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.</description>
- </param>
- </struct>
-
- <struct name="RadioControlData" since="4.5">
- <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
- <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
- </param>
- <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
- <description>The fractional part of the frequency for 101.7 is 7</description>
- </param>
- <param name="band" type="RadioBand" mandatory="false">
- </param>
- <param name="rdsData" type="RdsData" mandatory="false">
- </param>
- <param name="hdRadioEnable" type="Boolean" mandatory="false" since="5.0">
- <description> True if the hd radio is on, false if the radio is off</description>
- </param>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
- <description>number of HD sub-channels if available</description>
- <history>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
- </history>
- </param>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0">
- <description>Current HD sub-channel if available</description>
- <history>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false" since="4.5" until="5.0"/>
- </history>
- </param>
- <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- </param>
- <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
- </param>
- <param name="radioEnable" type="Boolean" mandatory="false">
- <description> True if the radio is on, false if the radio is off. If set to false, no other data will be included.</description>
- </param>
- <param name="state" type="RadioState" mandatory="false">
- </param>
- <param name="sisData" type="SisData" mandatory="false" since="5.0">
- <description>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</description>
- </param>
- </struct>
-
- <struct name="ClimateControlData" since="4.5">
- <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
- </param>
- <param name="currentTemperature" type="Temperature" mandatory="false">
- </param>
- <param name="desiredTemperature" type="Temperature" mandatory="false">
- </param>
- <param name="acEnable" type="Boolean" mandatory="false">
- </param>
- <param name="circulateAirEnable" type="Boolean" mandatory="false">
- </param>
- <param name="autoModeEnable" type="Boolean" mandatory="false">
- </param>
- <param name="defrostZone" type="DefrostZone" mandatory="false">
- </param>
- <param name="dualModeEnable" type="Boolean" mandatory="false">
- </param>
- <param name="acMaxEnable" type="Boolean" mandatory="false">
- </param>
- <param name="ventilationMode" type="VentilationMode" mandatory="false">
- </param>
- <param name="heatedSteeringWheelEnable" type="Boolean" mandatory="false" since="5.0">
- <description>value false means disabled/turn off, value true means enabled/turn on.</description>
- </param>
- <param name="heatedWindshieldEnable" type="Boolean" mandatory="false" since="5.0">
- <description>value false means disabled, value true means enabled.</description>
- </param>
- <param name="heatedRearWindowEnable" type="Boolean" mandatory="false" since="5.0">
- <description>value false means disabled, value true means enabled.</description>
- </param>
- <param name="heatedMirrorsEnable" type="Boolean" mandatory="false" since="5.0">
- <description>value false means disabled, value true means enabled.</description>
- </param>
- </struct>
-
- <struct name="RadioControlCapabilities" since="4.5">
- <description>Contains information about a radio control module's capabilities.</description>
- <!-- need an ID in the future -->
- <param name="moduleName" type="String" maxlength="100" mandatory="true">
- <description>
- The short friendly name of the climate control module.
- It should not be used to identify a module by mobile application.
- </description>
- </param>
- <param name="radioEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable radio.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="radioBandAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of radio band.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="radioFrequencyAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of radio frequency.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="hdChannelAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of HD radio channel.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="rdsDataAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the getting Radio Data System (RDS) data.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="availableHDsAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the getting the number of available HD channels.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="stateAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the getting the Radio state.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="signalStrengthAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the getting the signal strength.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the getting the signal Change Threshold.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="sisDataAvailable" type="Boolean" mandatory="false" since="5.0">
- <description>
- Availability of the getting HD radio Station Information Service (SIS) data.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="hdRadioEnableAvailable" type="Boolean" mandatory="false" since="5.0">
- <description>
- Availability of the control of enable/disable HD radio.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="siriusxmRadioAvailable" type="Boolean" mandatory="false" since="5.0">
- <description>
- Availability of sirius XM radio.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- </struct>
-
- <struct name="ClimateControlCapabilities" since="4.5">
- <description>Contains information about a climate control module's capabilities.</description>
- <!-- need an ID in the future -->
- <param name="moduleName" type="String" maxlength="100" mandatory="true">
- <description>The short friendly name of the climate control module.
- It should not be used to identify a module by mobile application.</description>
- </param>
- <param name="currentTemperatureAvailable" type="Boolean" mandatory="false" since="5.0">
- <description>
- Availability of the reading of current temperature.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of fan speed.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of desired temperature.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="acEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of turn on/off AC.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable air conditioning is ON on the maximum level.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable circulate Air mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable auto mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of enable/disable dual mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of defrost zones.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="defrostZone" type="DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- A set of all defrost zones that are controllable.
- </description>
- </param>
- <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
- <description>
- Availability of the control of air ventilation mode.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="ventilationMode" type="VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- A set of all ventilation modes that are controllable.
- </description>
- </param>
- <param name="heatedSteeringWheelAvailable" type="Boolean" mandatory="false" since="5.0">
- <description>
- Availability of the control (enable/disable) of heated Steering Wheel.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="heatedWindshieldAvailable" type="Boolean" mandatory="false" since="5.0">
- <description>
- Availability of the control (enable/disable) of heated Windshield.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="heatedRearWindowAvailable" type="Boolean" mandatory="false" since="5.0">
- <description>
- Availability of the control (enable/disable) of heated Rear Window.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- <param name="heatedMirrorsAvailable" type="Boolean" mandatory="false" since="5.0">
- <description>
- Availability of the control (enable/disable) of heated Mirrors.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- </param>
- </struct>
-
- <struct name="EqualizerSettings" since="5.0">
- <description>Defines the each Equalizer channel settings.</description>
- <param name="channelId" type="Integer" minvalue="1" maxvalue="100" mandatory="true"></param>
- <param name="channelName" type="String" mandatory="false" maxlength="50">
- <description>read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz")</description>
- </param>
- <param name="channelSetting" type="Integer" minvalue="0" maxvalue="100" mandatory="true">
- <description>Reflects the setting, from 0%-100%.</description>
- </param>
- </struct>
-
- <struct name="AudioControlData" since="5.0">
- <param name="source" type="PrimaryAudioSource" mandatory="false">
- <description>
- 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.
- </description>
- </param>
- <param name="keepContext" type="Boolean" mandatory="false">
- <description>
- 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 not included.
- If it is false, the system not only changes the audio source but also brings the default application or
- system UI associated with the audio source to foreground.
- If it is true, the system only changes the audio source, but keeps the current application in foreground.
- </description>
- </param>
- <param name="volume" type="Integer" mandatory="false" minvalue="0" maxvalue="100">
- <description>Reflects the volume of audio, from 0%-100%.</description>
- </param>
- <param name="equalizerSettings" type="EqualizerSettings" minsize="1" maxsize="100" mandatory="false" array="true">
- <description>Defines the list of supported channels (band) and their current/desired settings on HMI</description>
- </param>
- </struct>
-
- <struct name="AudioControlCapabilities" since="5.0">
- <param name="moduleName" type="String" maxlength="100" mandatory="true">
- <description>
- The short friendly name of the light control module.
- It should not be used to identify a module by mobile application.
- </description>
- </param>
- <param name="sourceAvailable" type="Boolean" mandatory="false">
- <description>Availability of the control of audio source. </description>
- </param>
- <param name="keepContextAvailable" type="Boolean" mandatory="false">
- <description>Availability of the keepContext parameter. </description>
- </param>
- <param name="volumeAvailable" type="Boolean" mandatory="false">
- <description>Availability of the control of audio volume.</description>
- </param>
- <param name="equalizerAvailable" type="Boolean" mandatory="false">
- <description>Availability of the control of Equalizer Settings.</description>
- </param>
- <param name="equalizerMaxChannelId" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
- <description>Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid</description>
- </param>
- </struct>
-
- <enum name="LightName" since="5.0">
- <!-- Common Single Light 0~500 -->
- <element name="FRONT_LEFT_HIGH_BEAM" value="0"/>
- <element name="FRONT_RIGHT_HIGH_BEAM" value="1"/>
- <element name="FRONT_LEFT_LOW_BEAM" value="2"/>
- <element name="FRONT_RIGHT_LOW_BEAM" value="3"/>
- <element name="FRONT_LEFT_PARKING_LIGHT" value="4"/>
- <element name="FRONT_RIGHT_PARKING_LIGHT" value="5"/>
- <element name="FRONT_LEFT_FOG_LIGHT" value="6"/>
- <element name="FRONT_RIGHT_FOG_LIGHT" value="7"/>
- <element name="FRONT_LEFT_DAYTIME_RUNNING_LIGHT" value="8"/>
- <element name="FRONT_RIGHT_DAYTIME_RUNNING_LIGHT" value="9"/>
- <element name="FRONT_LEFT_TURN_LIGHT" value="10"/>
- <element name="FRONT_RIGHT_TURN_LIGHT" value="11"/>
- <element name="REAR_LEFT_FOG_LIGHT" value="12"/>
- <element name="REAR_RIGHT_FOG_LIGHT" value="13"/>
- <element name="REAR_LEFT_TAIL_LIGHT" value="14"/>
- <element name="REAR_RIGHT_TAIL_LIGHT" value="15"/>
- <element name="REAR_LEFT_BRAKE_LIGHT" value="16"/>
- <element name="REAR_RIGHT_BRAKE_LIGHT" value="17"/>
- <element name="REAR_LEFT_TURN_LIGHT" value="18"/>
- <element name="REAR_RIGHT_TURN_LIGHT" value="19"/>
- <element name="REAR_REGISTRATION_PLATE_LIGHT" value="20"/>
-
- <!-- Exterior Lights by common function groups 501~800 -->
- <element name="HIGH_BEAMS" value="501">
- <description>Include all high beam lights: front_left and front_right.</description>
- </element>
- <element name="LOW_BEAMS" value="502">
- <description>Include all low beam lights: front_left and front_right.</description>
- </element>
- <element name="FOG_LIGHTS" value="503">
- <description>Include all fog lights: front_left, front_right, rear_left and rear_right.</description>
- </element>
- <element name="RUNNING_LIGHTS" value="504">
- <description>Include all daytime running lights: front_left and front_right.</description>
- </element>
- <element name="PARKING_LIGHTS" value="505">
- <description>Include all parking lights: front_left and front_right.</description>
- </element>
- <element name="BRAKE_LIGHTS" value="506">
- <description>Include all brake lights: rear_left and rear_right.</description>
- </element>
- <element name="REAR_REVERSING_LIGHTS" value="507"/>
- <element name="SIDE_MARKER_LIGHTS" value="508"/>
- <element name="LEFT_TURN_LIGHTS" value="509">
- <description>Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.</description>
- </element>
- <element name="RIGHT_TURN_LIGHTS" value="510">
- <description>Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.</description>
- </element>
- <element name="HAZARD_LIGHTS" value="511">
- <description>Include all hazard lights: front_left, front_right, rear_left and rear_right.</description>
- </element>
- <element name="REAR_CARGO_LIGHTS" value="512">
- <description>Cargo lamps illuminate the cargo area.</description>
- </element>
- <element name="REAR_TRUCK_BED_LIGHTS" value="513">
- <description>Truck bed lamps light up the bed of the truck.</description>
- </element>
- <element name="REAR_TRAILER_LIGHTS" value="514">
- <description>Trailer lights are lamps mounted on a trailer hitch.</description>
- </element>
- <element name="LEFT_SPOT_LIGHTS" value="515">
- <description>It is the spotlights mounted on the left side of a vehicle.</description>
- </element>
- <element name="RIGHT_SPOT_LIGHTS" value="516">
- <description>It is the spotlights mounted on the right side of a vehicle.</description>
- </element>
- <element name="LEFT_PUDDLE_LIGHTS" value="517">
- <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
- </element>
- <element name="RIGHT_PUDDLE_LIGHTS" value="518">
- <description>Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.</description>
- </element>
-
- <!-- Interior Lights by common function groups 801~900 -->
- <element name="AMBIENT_LIGHTS" value="801"/>
- <element name="OVERHEAD_LIGHTS" value="802"/>
- <element name="READING_LIGHTS" value="803"/>
- <element name="TRUNK_LIGHTS" value="804"/>
-
- <!-- Lights by location 901~1000-->
- <element name="EXTERIOR_FRONT_LIGHTS" value="901">
- <description>Include exterior lights located in front of the vehicle. For example, fog lights and low beams.</description>
- </element>
- <element name="EXTERIOR_REAR_LIGHTS" value="902">
- <description>Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights and trailer assist lights.</description>
- </element>
- <element name="EXTERIOR_LEFT_LIGHTS" value="903">
- <description>Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.</description>
- </element>
- <element name="EXTERIOR_RIGHT_LIGHTS" value="904">
- <description>Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.</description>
- </element>
- <element name="EXTERIOR_ALL_LIGHTS" value="905">
- <description> Include all exterior lights around the vehicle.</description>
- </element>
- </enum>
-
- <enum name="LightStatus" since="5.0">
- <element name="ON"/>
- <element name="OFF"/>
- <element name="RAMP_UP"/>
- <element name="RAMP_DOWN"/>
- <element name="UNKNOWN"/>
- <element name="INVALID"/>
- </enum>
-
- <struct name="LightCapabilities" since="5.0">
- <param name="name" type="LightName" mandatory="true" />
- <param name="statusAvailable" type="Boolean" mandatory="false">
- <description>
- 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.
- </description>
- </param>
- <param name="densityAvailable" type="Boolean" mandatory="false">
- <description>
- Indicates if the light's density can be set remotely (similar to a dimmer).
- </description>
- </param>
- <param name="rgbColorSpaceAvailable" type="Boolean" mandatory="false">
- <description>
- Indicates if the light's color can be set remotely by using the sRGB color space.
- </description>
- </param>
- </struct>
-
- <struct name="LightControlCapabilities" since="5.0">
- <param name="moduleName" type="String" maxlength="100" mandatory="true">
- <description>
- The short friendly name of the light control module.
- It should not be used to identify a module by mobile application.
- </description>
- </param>
- <param name="supportedLights" type="LightCapabilities" minsize="1" maxsize="100" array="true" mandatory="true">
- <description> An array of available LightCapabilities that are controllable. </description>
- </param>
- </struct>
-
- <struct name="LightState" since="5.0">
- <param name="id" type="LightName" mandatory="true">
- <description>The name of a light or a group of lights. </description>
- </param>
- <param name="status" type="LightStatus" mandatory="true"/>
- <param name="density" type="Float" minvalue="0" maxvalue="1" mandatory="false" />
- <param name="color" type="RGBColor" mandatory="false" />
- </struct>
-
- <struct name="LightControlData" since="5.0">
- <param name="lightState" type="LightState" mandatory="true" minsize="1" maxsize="100" array="true">
- <description>An array of LightNames and their current or desired status. No change to the status of the LightNames that are not listed in the array.</description>
- </param>
- </struct>
-
- <enum name="DisplayMode" since="5.0">
- <element name="DAY"/>
- <element name="NIGHT"/>
- <element name="AUTO"/>
- </enum>
-
- <enum name="DistanceUnit" since="5.0">
- <element name="MILES"/>
- <element name="KILOMETERS"/>
- </enum>
-
- <struct name="HMISettingsControlData" since="5.0">
- <description>Corresponds to "HMI_SETTINGS" ModuleType</description>
- <param name="displayMode" type="DisplayMode" mandatory="false"></param>
- <param name="temperatureUnit" type="TemperatureUnit" mandatory="false"></param>
- <param name="distanceUnit" type="DistanceUnit" mandatory="false"></param>
- </struct>
-
- <struct name="HMISettingsControlCapabilities" since="5.0">
- <param name="moduleName" type="String" maxlength="100" mandatory="true">
- <description>
- The short friendly name of the hmi setting module.
- It should not be used to identify a module by mobile application.
- </description>
- </param>
- <param name="distanceUnitAvailable" type="Boolean" mandatory="false">
- <description>Availability of the control of distance unit. </description>
- </param>
- <param name="temperatureUnitAvailable" type="Boolean" mandatory="false">
- <description>Availability of the control of temperature unit. </description>
- </param>
- <param name="displayModeUnitAvailable" type="Boolean" mandatory="false">
- <description>Availability of the control of HMI display mode. </description>
- </param>
- </struct>
-
- <struct name="ModuleData" since="4.5">
- <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
- <param name="moduleType" type="ModuleType" mandatory="true">
- </param>
- <param name="radioControlData" type="RadioControlData" mandatory="false">
- </param>
- <param name="climateControlData" type="ClimateControlData" mandatory="false">
- </param>
- <param name="seatControlData" type="SeatControlData" mandatory="false" since="5.0">
- </param>
- <param name="audioControlData" type="AudioControlData" mandatory="false" since="5.0">
- </param>
- <param name="lightControlData" type="LightControlData" mandatory="false" since="5.0">
- </param>
- <param name="hmiSettingsControlData" type="HMISettingsControlData" mandatory="false" since="5.0">
- </param>
- </struct>
-
- <struct name="RemoteControlCapabilities" since="4.5">
- <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
- <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description>
- </param>
- <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
- <description>If included, the platform supports RC radio controls.For this baseline version, maxsize=1. i.e. only one radio control module is supported.</description>
- </param>
- <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
- <description>If included, the platform supports RC button controls with the included button names.</description>
- </param>
- <param name="audioControlCapabilities" type="AudioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
- <description>If included, the platform supports audio controls.</description>
- </param>
- <param name="hmiSettingsControlCapabilities" type="HMISettingsControlCapabilities" mandatory="false" since="5.0">
- <description>If included, the platform supports hmi setting controls.</description>
- </param>
- <param name="lightControlCapabilities" type="LightControlCapabilities" mandatory="false" since="5.0">
- <description>If included, the platform supports light controls.</description>
- </param>
- <param name="seatControlCapabilities" type="SeatControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" since="5.0">
- <description>If included, the platform supports seat controls.</description>
- </param>
- </struct>
-
- <!-- End of RC -->
- <struct name="SystemCapability" since="4.5">
- <description>The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
- <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
- <description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other para included.</description>
- </param>
- <param name="navigationCapability" type="NavigationCapability" mandatory="false">
- <description>Describes extended capabilities for onboard navigation system </description>
- </param>
- <param name="phoneCapability" type="PhoneCapability" mandatory="false">
- <description>Describes extended capabilities of the module's phone feature</description>
- </param>
- <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
- <description>Describes extended capabilities of the module's phone feature</description>
- </param>
- <param name="remoteControlCapability" type="RemoteControlCapabilities" mandatory="false">
- <description>Describes extended capabilities of the module's phone feature</description>
- </param>
- </struct>
-
- <enum name="MetadataType" since="4.5">
- <element name="mediaTitle">
- <description>The data in this field contains the title of the currently playing audio track.</description>
- </element>
- <element name="mediaArtist">
- <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
- </element>
- <element name="mediaAlbum">
- <description>The data in this field contains the album title of the currently playing audio track.</description>
- </element>
- <element name="mediaYear">
- <description>The data in this field contains the creation year of the currently playing audio track.</description>
- </element>
- <element name="mediaGenre">
- <description>The data in this field contains the genre of the currently playing audio track.</description>
- </element>
- <element name="mediaStation">
- <description>The data in this field contains the name of the current source for the media.</description>
- </element>
- <element name="rating">
- <description>The data in this field is a rating.</description>
- </element>
- <element name="currentTemperature">
- <description>The data in this field is the current temperature.</description>
- </element>
- <element name="maximumTemperature">
- <description>The data in this field is the maximum temperature for the day.</description>
- </element>
- <element name="minimumTemperature">
- <description>The data in this field is the minimum temperature for the day.</description>
- </element>
- <element name="weatherTerm">
- <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
- </element>
- <element name="humidity">
- <description>The data in this field describes the current humidity value.</description>
- </element>
- </enum>
-
- <struct name="MetadataTags" since="4.5">
- <param name="mainField1" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
- <description>The type of data contained in the "mainField1" text field.</description>
- </param>
- <param name="mainField2" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
- <description>The type of data contained in the "mainField2" text field.</description>
- </param>
- <param name="mainField3" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
- <description>The type of data contained in the "mainField3" text field.</description>
- </param>
- <param name="mainField4" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
- <description>The type of data contained in the "mainField4" text field.</description>
- </param>
- </struct>
-
- <struct name="Rectangle" since="4.5">
- <param name="x" type="Float" mandatory="true">
- <description>The upper left X-coordinate of the rectangle</description>
- </param>
- <param name="y" type="Float" mandatory="true">
- <description>The upper left Y-coordinate of the rectangle</description>
- </param>
- <param name="width" type="Float" mandatory="true">
- <description>The width of the rectangle</description>
- </param>
- <param name="height" type="Float" mandatory="true">
- <description>The height of the rectangle</description>
- </param>
- </struct>
-
- <struct name="HapticRect" since="4.5">
- <description>Defines haptic data for each user control object for video streaming application</description>
- <param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>A user control spatial identifier</description>
- </param>
- <param name="rect" type="Rectangle" mandatory="true">
- <description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
- </param>
- </struct>
-
- <!-- Requests/Responses -->
-
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request" since="1.0">
- <description>
- Establishes an interface with a mobile application.
- Before registerAppInterface no other commands will be accepted/executed.
- </description>
-
- <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true" since="1.0">
- <description>See SyncMsgVersion</description>
- </param>
-
- <param name="appName" type="String" maxlength="100" mandatory="true" since="1.0">
- <description>
- The mobile application name, e.g. "Ford Drive Green".
- Needs to be unique over all applications.
- May not be empty.
- May not start with a new line character.
- May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands)
- Needs to be unique over all applications. Applications with the same name will be rejected.
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
- <description>
- TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- Needs to be unique over all applications.
- May not be empty.
- May not start with a new line character.
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="1.0">
- <description>
- Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.
- If not provided, the appName is used instead (and will be truncated if too long)
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
- <description>
- Defines an additional voice recognition command.
- May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands)
- Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
- </description>
- </param>
-
- <param name="isMediaApplication" type="Boolean" mandatory="true" since="1.0">
- <description>
- Indicates if the application is a media or a non-media application.
- Only media applications will be able to stream audio to the module that is audible outside of the BT media source.
- </description>
- </param>
- <param name="languageDesired" type="Language" mandatory="true" since="1.0">
- <description>
- See Language
- Current app's expected VR+TTS language
- If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
- </description>
- </param>
- <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true" since="2.0">
- <description>
- See Language
- Current app's expected display language
- If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
- </description>
- </param>
-
- <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
- <description>
- See AppHMIType
- List of all applicable app HMI types stating which HMI classifications to be given to the app.
- </description>
- </param>
-
- <param name="hashID" type="String" maxlength="100" mandatory="false" since="3.0">
- <description>
- ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).
- This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece.
- If omitted, then the previous state of an app's commands, etc. will not be restored.
- When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.).
- </description>
- </param>
- <param name="deviceInfo" type="DeviceInfo" mandatory="false" since="3.0">
- <description>
- See DeviceInfo.
- </description>
- </param>
- <param name="appID" type="String" maxlength="100" mandatory="true" since="2.0">
- <description>ID used to validate app with policy table entries</description>
- </param>
- <param name="fullAppID" type="String" maxlength="100" mandatory="false" since="5.0">
- <description>ID used to validate app with policy table entries</description>
- </param>
- <param name="appInfo" type="AppInfo" mandatory="false" since="2.0">
- <description>
- See AppInfo.
- </description>
- </param>
- <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
- <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
- </function>
-
- <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response" since="1.0">
- <description>The response to registerAppInterface</description>
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="GENERIC_ERROR"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TOO_MANY_APPLICATIONS"/>
- <element name="APPLICATION_REGISTERED_ALREADY"/>
- <element name="UNSUPPORTED_VERSION"/>
- <element name="WRONG_LANGUAGE"/>
- <element name="DISALLOWED"/>
- <element name="WARNINGS"/>
- <element name="RESUME_FAILED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
- <description>See SyncMsgVersion</description>
- </param>
-
- <param name="language" type="Language" mandatory="false">
- <description>The currently active VR+TTS language on the module. See "Language" for options.</description>
- </param>
-
- <param name="hmiDisplayLanguage" type="Language" mandatory="false" since="2.0">
- <description>The currently active display language on the module. See "Language" for options.</description>
- </param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </param>
-
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" since="2.0">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
- </param>
- <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
- <description>See HmiZoneCapabilities</description>
- </param>
- <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
- <description>See SpeechCapabilities</description>
- </param>
-
- <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
- <description>See PrerecordedSpeech</description>
- </param>
-
- <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
- <description>See VrCapabilities</description>
- </param>
-
- <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
- <description>See AudioPassThruCapability</description>
- </param>
-
- <param name="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" mandatory="false" since="4.1">
- <description>See AudioPassThruCapability</description>
- </param>
-
- <param name="vehicleType" type="VehicleType" mandatory="false" since="2.0">
- <description>Specifies the vehicle's type. See VehicleType.</description>
- </param>
-
- <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false" since="3.0">
- <description>
- Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests.
- If a mode outside this list is requested, it will be rejected.
- </description>
- </param>
-
- <param name="hmiCapabilities" type="HMICapabilities" mandatory="false" since="3.0">
- <description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
- </param>
-
- <param name="sdlVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
- <description>The SmartDeviceLink version.</description>
- </param>
-
- <param name="systemSoftwareVersion" type="String" maxlength="100" mandatory="false" platform="documentation" since="3.0">
- <description>The software version of the system that implements the SmartDeviceLink core.</description>
- </param>
-
- <param name="iconResumed" type="Boolean" mandatory="false" since="5.0">
- <description>
- Existence of apps icon at system. If true, apps icon
- was resumed at system. If false, apps icon is not resumed at system
- </description>
- </param>
- </function>
-
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request" since="1.0">
- <description>
- Closes an interface from a mobile application.
- After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.
- Will fail, if no registerAppInterface was completed successfully before.
- </description>
- </function>
-
- <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response" since="1.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request" since="1.0">
- <description>Allows setting global properties.</description>
-
- <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
- <description>
- The help prompt.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="1.0">
- <description>
- Help text for a wait timeout.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false" since="2.0">
- <description>
- VR Help Title text.
- If omitted on supported displays, the default module help title shall be used.
- If omitted and one or more vrHelp items are provided, the request will be rejected.
- </description>
- </param>
-
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
- <description>
- VR Help Items.
- If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
- If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected.
- If omitted and a vrHelpTitle is provided, the request will be rejected.
- </description>
- </param>
- <param name="menuTitle" maxlength="500" type="String" mandatory="false" since="3.0">
- <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
- </param>
-
- <param name="menuIcon" type="Image" mandatory="false" since="3.0">
- <description>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
- </param>
-
- <param name="keyboardProperties" type="KeyboardProperties" mandatory="false" since="3.0">
- <description>On-screen keyboard configuration (if available).</description>
- </param>
- </function>
-
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response" since="1.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request" since="1.0">
- <description>Allows resetting global properties.</description>
-
- <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" mandatory="true">
- <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
- </param>
- </function>
-
- <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response" since="1.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="AddCommand" functionID="AddCommandID" messagetype="request" since="1.0">
- <description>
- Adds a command to the in application menu.
- Either menuParams or vrCommands must be provided.
- </description>
-
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>unique ID of the command to add.</description>
- </param>
-
- <param name="menuParams" type="MenuParams" mandatory="false">
- <description>Optional sub value containing menu parameters</description>
- </param>
-
- <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false">
- <description>
- An array of strings to be used as VR synonyms for this command.
- If this array is provided, it may not be empty.
- </description>
- </param>
-
- <param name="cmdIcon" type="Image" mandatory="false" since="2.0">
- <description>
- Image struct determining whether static or dynamic icon.
- If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
- </description>
- </param>
-
- </function>
-
- <function name="AddCommand" functionID="AddCommandID" messagetype="response" since="1.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request" since="1.0">
- <description>Deletes all commands from the in-application menu with the specified command id.</description>
-
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of the command(s) to delete.</description>
- </param>
-
- </function>
-
- <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request" since="1.0">
- <description>Adds a sub menu to the in-application menu.</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
- <description>unique ID of the sub menu to add.</description>
- </param>
-
- <param name="position" type="Integer" minvalue="0" maxvalue="1000" defvalue="1000" mandatory="false">
- <description>
- Position within the items that are are at top level of the in application menu.
- 0 will insert at the front.
- 1 will insert at the second position.
- If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
- Position of any submenu will always be located before the return and exit options
- If this param was omitted the entry will be added at the end.
- </description>
- </param>
-
- <param name="menuName" maxlength="500" type="String" mandatory="true">
- <description>Text to show in the menu for this sub menu.</description>
- </param>
-
- <param name="menuIcon" type="Image" mandatory="false" since="5.0">
- <description>The image field for AddSubMenu</description>
- </param>
- </function>
-
- <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request" since="1.0">
- <description>Deletes a submenu from the in-application menu.</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
- <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
- </param>
-
- </function>
-
- <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response" since="1.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request" since="1.0">
- <description>creates interaction choice set to be used later by performInteraction</description>
-
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>Unique ID used for this interaction choice set.</description>
- </param>
-
- <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" mandatory="true"/>
- </function>
-
- <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request" since="1.0">
- <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
-
- <param name="initialText" type="String" maxlength="500" mandatory="true">
- <description>
- Text to be displayed first.
- </description>
- </param>
-
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- This is the initial prompt spoken to the user at the start of an interaction.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="interactionMode" type="InteractionMode" mandatory="true">
- <description>See InteractionMode.</description>
- </param>
-
- <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true" mandatory="true">
- <description>List of interaction choice set IDs to use with an interaction.</description>
- </param>
-
- <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Help text. This is the spoken string when a user speaks "help" when the interaction is occurring.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- Timeout text. This text is spoken when a VR interaction times out.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="false">
- <description>
- Timeout in milliseconds.
- If omitted a standard value of 10000 milliseconds is used.
- Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform.
- </description>
- </param>
-
- <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0">
- <description>
- Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
- If omitted on supported displays, the default generated list of suggested choices shall be displayed.
- </description>
- </param>
-
- <param name="interactionLayout" type="LayoutMode" mandatory="false" since="3.0">
- <description>See LayoutMode.</description>
- </param>
-
- </function>
-
- <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="TIMED_OUT"/>
- <element name="ABORTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- ID of the choice that was selected in response to PerformInteraction.
- Only is valid if general result is "success:true".
- </description>
- </param>
-
- <param name="manualTextEntry" type="String" maxlength="500" mandatory="false" since="3.0">
- <description>
- Manually entered text selection, e.g. through keyboard
- Can be returned in lieu of choiceID, depending on trigger source
- </description>
- </param>
-
- <param name="triggerSource" type="TriggerSource" mandatory="false">
- <description>
- See TriggerSource
- Only is valid if resultCode is SUCCESS.
- </description>
- </param>
-
- </function>
-
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request" since="1.0">
- <description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
- <description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
-
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>ID of the interaction choice set to delete.</description>
- </param>
- </function>
-
- <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_ID"/>
- <element name="IN_USE"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="Alert" functionID="AlertID" messagetype="request" since="1.0">
- <description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
-
- <param name="alertText1" type="String" maxlength="500" mandatory="false">
- <description>The first line of the alert text field</description>
- </param>
-
- <param name="alertText2" type="String" maxlength="500" mandatory="false">
- <description>The second line of the alert text field</description>
- </param>
-
- <param name="alertText3" type="String" maxlength="500" mandatory="false" since="2.0">
- <description>The optional third line of the alert text field</description>
- </param>
-
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- <param name="duration" type="Integer" minvalue="3000" maxvalue="10000" defvalue="5000" mandatory="false">
- <description>
- Timeout in milliseconds.
- Typical timeouts are 3-5 seconds.
- If omitted, timeout is set to 5s.
- </description>
- </param>
-
- <param name="playTone" type="Boolean" mandatory="false">
- <description>
- Defines if tone should be played. Tone is played before TTS.
- If omitted, no tone is played.
- </description>
- </param>
-
- <param name="progressIndicator" type="Boolean" mandatory="false" since="3.0">
- <description>
- If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.
- </description>
- </param>
-
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false" since="2.0">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, the displayed alert shall not have any SoftButtons.
- </description>
- </param>
-
- </function>
-
- <function name="Alert" functionID="AlertID" messagetype="response" since="1.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="2.0">
- <description>
- Amount of time (in seconds) that an app must wait before resending an alert.
- If provided, another system event or overlay currently has a higher priority than this alert.
- An app must not send an alert without waiting at least the amount of time dictated.
- </description>
- </param>
-
- </function>
-
- <function name="Show" functionID="ShowID" messagetype="request" since="1.0">
- <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
-
- <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
- <description>
- The text that should be displayed in a single or upper display line.
- If this text is not set, the text of mainField1 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
- <description>
- The text that should be displayed on the second display line.
- If this text is not set, the text of mainField2 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
- <description>
- The text that should be displayed on the second "page" first display line.
- If this text is not set, the text of mainField3 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
- <description>
- The text that should be displayed on the second "page" second display line.
- If this text is not set, the text of mainField4 stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="alignment" type="TextAlignment" mandatory="false" since="1.0">
- <description>
- Specifies how mainField1 and mainField2 texts should be aligned on display.
- If omitted, texts will be centered.
- </description>
- </param>
-
- <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
- <description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
- </param>
-
- <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
- <description>
- Text value for MediaClock field. Has to be properly formatted by Mobile App according to the module's capabilities.
- If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
- </description>
- </param>
-
- <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false" since="1.0">
- <description>
- The text that should be displayed in the track field.
- If this text is not set, the text of mediaTrack stays unchanged.
- If this text is empty "", the field will be cleared.
- </description>
- </param>
-
- <param name="graphic" type="Image" mandatory="false" since="3.0">
- <description>
- Image struct determining whether static or dynamic image to display in app.
- If omitted on supported displays, the displayed graphic shall not change.
- </description>
- </param>
-
- <param name="secondaryGraphic" type="Image" mandatory="false" since="3.0">
- <description>
- Image struct determining whether static or dynamic secondary image to display in app.
- If omitted on supported displays, the displayed secondary graphic shall not change.
- </description>
- </param>
-
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false" since="2.0">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, the currently displayed SoftButton values will not change.
- </description>
- </param>
-
- <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false" since="3.0">
- <description>
- App labeled on-screen presets (i.e. on-screen media presets or dynamic search suggestions).
- If omitted on supported displays, the presets will be shown as not defined.
- </description>
- </param>
-
- <param name="metadataTags" type="MetadataTags" mandatory="false" since="4.5">
- <description>App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4.
- If omitted on supported displays, the currently set metadata tags will not change.
- If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.</description>
- </param>
- </function>
-
- <function name="Show" functionID="ShowID" messagetype="response" since="1.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="WARNINGS"/>
- <element name="ABORTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="Speak" functionID="SpeakID" messagetype="request" since="1.0">
- <description>Speaks a text.</description>
-
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
- <description>
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- </description>
- </param>
-
- </function>
-
- <function name="Speak" functionID="SpeakID" messagetype="response" since="1.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request" since="1.0">
- <description>Sets the initial media clock value and automatic update method.</description>
-
- <param name="startTime" type="StartTime" mandatory="false">
- <description>
- See StartTime.
- startTime must be provided for "COUNTUP" and "COUNTDOWN".
- startTime will be ignored for "RESUME", and "CLEAR"
- startTime can be sent for "PAUSE", in which case it will update the paused startTime
- </description>
- </param>
-
- <param name="endTime" type="StartTime" mandatory="false" since="3.0">
- <description>
- See StartTime.
- endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
- If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
- endTime will be ignored for "RESUME", and "CLEAR"
- endTime can be sent for "PAUSE", in which case it will update the paused endTime
- </description>
- </param>
-
- <param name="updateMode" type="UpdateMode" mandatory="true">
- <description>
- Enumeration to control the media clock.
- In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.
- </description>
- </param>
-
- <param name="audioStreamingIndicator" type="AudioStreamingIndicator" mandatory="false" since="5.0">
- <description>
- Enumeration for the indicator icon on a play/pause button. see AudioStreamingIndicator.
- </description>
- </param>
- </function>
-
- <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request" since="2.0">
- <description>Starts audio pass thru session </description>
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>
- The module will speak this prompt before opening the audio pass thru session.
- An array of text chunks of type TTSChunk. See TTSChunk.
- The array must have at least one item.
- If omitted, then no initial prompt is spoken.
- </description>
- </param>
- <param name="audioPassThruDisplayText1" type="String" mandatory="false" maxlength="500">
- <description>First line of text displayed during audio capture.</description>
- </param>
- <param name="audioPassThruDisplayText2" type="String" mandatory="false" maxlength="500">
- <description>Second line of text displayed during audio capture.</description>
- </param>
- <param name="samplingRate" type="SamplingRate" mandatory="true">
- <description> This value shall be allowed at 8 kHz or 16 or 22 or 44 kHz.</description>
- </param>
- <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
- <description>The maximum duration of audio recording in milliseconds. </description>
- </param>
- <param name="bitsPerSample" type="BitsPerSample" mandatory="true">
- <description>Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.</description>
- </param>
- <param name="audioType" type="AudioType" mandatory="true">
- <description>Specifies the type of audio data being requested.</description>
- </param>
- <param name="muteAudio" type="Boolean" mandatory="false">
- <description>
- Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
- If omitted, the value is set to true.
- </description>
- </param>
- </function>
-
- <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="RETRY"/>
- <element name="WARNINGS"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request" since="2.0">
- <description>When this request is invoked, the audio capture stops.</description>
- </function>
-
- <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request" since="1.0">
- <description>
- Subscribes to built-in HMI buttons.
- The application will be notified by the OnButtonEvent and OnButtonPress.
- To unsubscribe the notifications, use unsubscribeButton.
- </description>
-
- <param name="buttonName" type="ButtonName" mandatory="true">
- <description>Name of the button to subscribe.</description>
- </param>
- </function>
-
- <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="UNSUPPORTED_RESOURCE" />
- <element name="IGNORED" />
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request" since="1.0">
- <description>Unsubscribes from built-in HMI buttons.</description>
-
- <param name="buttonName" type="ButtonName" mandatory="true">
- <description>Name of the button to unsubscribe.</description>
- </param>
- </function>
-
- <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="UNSUPPORTED_RESOURCE" />
- <element name="IGNORED" />
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request" since="2.0">
- <description>
- Subscribes for specific published data items.
- The data will be only sent if it has changed.
- The application will be notified by the onVehicleData notification whenever new data is available.
- To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
- </description>
-
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
- <description>See TurnSignal</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
- <description>The estimated percentage of remaining oil life of the engine.</description>
- </param>
- <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
- <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
-
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="WARNINGS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED" />
- <element name="IGNORED" />
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
- </param>
- <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
- <description>See TurnSignal</description>
- </param>
- <param name="prndl" type="VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
- <description>The estimated percentage of remaining oil life of the engine.</description>
- </param>
- <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
- <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request" since="2.0">
- <description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</description>
-
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius.</description>
- </param>
- <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
- <description>See TurnSignal</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
- <description>The estimated percentage of remaining oil life of the engine.</description>
- </param>
- <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
- <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="WARNINGS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED" />
- <element name="IGNORED" />
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="VehicleDataResult" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="VehicleDataResult" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="VehicleDataResult" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="fuelRange" type="VehicleDataResult" mandatory="false" since="5.0">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
- </param>
- <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="turnSignal" type="VehicleDataResult" mandatory="false" since="5.0">
- <description>See TurnSignal</description>
- </param>
- <param name="prndl" type="VehicleDataResult" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="VehicleDataResult" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="VehicleDataResult" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataResult" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="VehicleDataResult" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="engineOilLife" type="VehicleDataResult" mandatory="false" since="5.0">
- <description>The estimated percentage of remaining oil life of the engine.</description>
- </param>
- <param name="electronicParkBrakeStatus" type="VehicleDataResult" mandatory="false" since="5.0">
- <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="VehicleDataResult" mandatory="false" >
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModes" type="VehicleDataResult" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="VehicleDataResult" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="request" since="2.0">
- <description>Non periodic vehicle data read request.</description>
-
- <param name="gps" type="Boolean" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Boolean" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Boolean" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Boolean" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="Boolean" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Boolean" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="fuelRange" type="Boolean" mandatory="false" since="5.0">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
- </param>
- <param name="externalTemperature" type="Boolean" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="turnSignal" type="Boolean" mandatory="false" since="5.0">
- <description>See TurnSignal</description>
- </param>
- <param name="vin" type="Boolean" mandatory="false">
- <description>Vehicle identification number</description>
- </param>
- <param name="prndl" type="Boolean" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="Boolean" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Boolean" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="Boolean" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="Boolean" mandatory="false">
- <description>The body information including ignition status and internal temp</description>
- </param>
- <param name="deviceStatus" type="Boolean" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="Boolean" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="Boolean" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="Boolean" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Boolean" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Boolean" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Boolean" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="engineOilLife" type="Boolean" mandatory="false" since="5.0">
- <description>The estimated percentage of remaining oil life of the engine.</description>
- </param>
- <param name="electronicParkBrakeStatus" type="Boolean" mandatory="false" since="5.0">
- <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="Boolean" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="Boolean" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="Boolean" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="Boolean" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="Boolean" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="response" since="2.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="VEHICLE_DATA_NOT_ALLOWED"/>
- <element name="VEHICLE_DATA_NOT_AVAILABLE"/>
- <element name="USER_DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="gps" type="GPSData" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
- </param>
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
- <description>See TurnSignal</description>
- </param>
- <param name="vin" type="String" maxlength="17" mandatory="false">
- <description>Vehicle identification number</description>
- </param>
- <param name="prndl" type="PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="TireStatus" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="HeadLampStatus" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
- <description>The estimated percentage of remaining oil life of the engine.</description>
- </param>
- <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
- <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
- </param>
-
- <!-- Ford Specific Data Items -->
- <param name="eCallInfo" type="ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Data Items -->
-
- </function>
-
- <function name="ReadDID" functionID="ReadDIDID" messagetype="request" since="2.0">
- <description>Non periodic vehicle data read request</description>
-
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
- <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
- <description>Get raw data from vehicle data DID location(s)</description>
- </param>
- </function>
-
- <function name="ReadDID" functionID="ReadDIDID" messagetype="response" since="2.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="didResult" type="DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>Array of requested DID results (with data if available).</description>
- </param>
-
- </function>
-
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="request" since="2.0">
- <description>Vehicle module diagnostic trouble code request.</description>
-
- <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of ECU.</description>
- </param>
-
- <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
- <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
- </param>
-
- </function>
-
- <function name="GetDTCs" functionID="GetDTCsID" messagetype="response" since="2.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
- </param>
-
- <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
- <description>
- Array of all reported DTCs on module (ecuHeader contains information if list is truncated).
- Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf).
- </description>
- </param>
-
- </function>
-
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request" since="3.0">
- <description>Non periodic vehicle diagnostic request</description>
-
- <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Name of target ECU.</description>
- </param>
-
- <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
- <description>Length of message (in bytes).</description>
- </param>
-
- <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message.
- </description>
- </param>
- </function>
-
- <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response" since="3.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="TRUNCATED_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
- <description>
- Array of bytes comprising CAN message result.
- </description>
- </param>
-
- </function>
-
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request" since="2.0">
- <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
- <param name="scrollableMessageBody" type="String" maxlength="500" mandatory="true">
- <description>Body of text that can include newlines and tabs.</description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="30000" mandatory="false">
- <description>App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout).</description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
- <description>
- App defined SoftButtons.
- If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.
- </description>
- </param>
- </function>
-
- <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="CHAR_LIMIT_EXCEEDED"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="Slider" functionID="SliderID" messagetype="request" since="2.0">
- <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
- <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
- <description>Number of selectable items on a horizontal axis</description>
- </param>
- <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
- <description>Initial position of slider control (cannot exceed numTicks)</description>
- </param>
- <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
- <description>Text header to display</description>
- </param>
- <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
- <description>
- Text footer to display (meant to display min/max threshold descriptors).
- For a static text footer, only one footer string shall be provided in the array.
- For a dynamic text footer, the number of footer text string in the array must match the numTicks value.
- For a dynamic text footer, text array string should correlate with potential slider position index.
- If omitted on supported displays, no footer text shall be displayed.
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="10000" mandatory="false">
- <description>
- App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout).
- If omitted, the value is set to 10000.
- </description>
- </param>
- </function>
-
- <function name="Slider" functionID="SliderID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="SAVED"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="REJECTED"/>
- <element name="ABORTED"/>
- <element name="TIMED_OUT"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
- <description>
- Current slider value returned when saved or canceled (aborted)
- This value is only returned for resultCodes "SAVED" or "ABORTED"
- </description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request" since="2.0">
- <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
- </param>
- <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
- </param>
- <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
- </param>
- <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false" since="3.0">
- </param>
- <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false" since="2.0">
- </param>
- <param name="turnIcon" type="Image" mandatory="false" since="2.0">
- </param>
- <param name="nextTurnIcon" type="Image" mandatory="false" since="3.0">
- </param>
- <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
- <description>
- Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).
- Used to calculate progress bar.
- </description>
- </param>
- <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false" since="2.0">
- <description>
- Distance till next maneuver (starting from) from previous maneuver.
- Used to calculate progress bar.
- </description>
- </param>
- <param name="maneuverComplete" type="Boolean" mandatory="false" since="2.0">
- <description>
- If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay.
- If omitted the value will be assumed as FALSE.
- </description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false" since="2.0">
- <description>
- Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
- If omitted on supported displays, the currently displayed SoftButton values will not change.
- </description>
- </param>
- </function>
-
- <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request" since="2.0">
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
- <description>If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed.</description>
- </param>
- </function>
-
- <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request" since="2.0">
- <param name="turnList" type="Turn" minsize="1" maxsize="100" array="true" mandatory="false">
- </param>
- <param name="softButtons" type="SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
- <description>If omitted on supported displays, app-defined SoftButton will be left blank.</description>
- </param>
- </function>
-
- <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request" since="2.0">
- <param name="language" type="Language" mandatory="true">
- <description>Requested voice engine (VR+TTS) language registration</description>
- </param>
- <param name="hmiDisplayLanguage" type="Language" mandatory="true">
- <description>Request display language registration</description>
- </param>
- <param name="appName" type="String" maxlength="100" mandatory="false" since="3.0">
- <description>Request new app name registration</description>
- </param>
- <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
- <description>Request new ttsName registration</description>
- </param>
- <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false" since="3.0">
- <description>Request new app short name registration</description>
- </param>
- <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false" since="3.0">
- <description>Request new VR synonyms registration</description>
- </param>
-
- </function>
-
- <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response" since="2.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description>
- true, if successful
- false, if failed
- </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="GenericResponse" functionID="GenericResponseID" messagetype="response" since="1.0">
- <description>
- Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.
- Currently, only resultCode INVALID_DATA is used.
- </description>
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="INVALID_DATA"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="PutFile" functionID="PutFileID" messagetype="request" since="3.0">
- <description>
- Used to push a binary data onto the module from a mobile device, such as icons and album art
- Not supported on first generation of SDL enabled modules.
- Binary data is in binary part of hybrid msg.
- </description>
-
- <param name="syncFileName" type="String" maxlength="255" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- <param name="fileType" type="FileType" mandatory="true">
- <description>Selected file type.</description>
- </param>
-
- <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
- <description>
- Indicates if the file is meant to persist between sessions / ignition cycles.
- If set to TRUE, then the system will aim to persist this file through session / cycles.
- While files with this designation will have priority over others, they are subject to deletion by the system at any time.
- In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
- If omitted, the value will be set to false.
- </description>
- </param>
-
- <param name="systemFile" type="Boolean" defvalue="false" mandatory="false" >
- <description>
- Indicates if the file is meant to be passed thru core to elsewhere on the system.
- If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core.
- If omitted, the value will be set to false.
- </description>
- </param>
-
- <param name="offset" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- Optional length in bytes for resuming partial data chunks
- If offset is set to 0, then length is the total length of the file to be downloaded
- </description>
- </param>
- <param name="crc" type="Integer" minvalue="0" maxvalue="4294967295" mandatory="false" since="5.0">
- <description> Additional CRC32 checksum to protect data integrity up to 512 Mbits </description>
- </param>
- </function>
-
- <function name="PutFile" functionID="PutFileID" messagetype="response" since="3.0">
- <description>Response is sent, when the file data was copied (success case). Or when an error occurred.</description>
- <description>Not supported on first generation SDL enabled vehicles. </description>
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="CORRUPTED_DATA"/>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
- <description>
- Provides the total local space available in SDL Core for the registered app.
- If the transfer has systemFile enabled, then the value will be set to 0 automatically.
- </description>
- <history>
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
- </history>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="request" since="3.0">
- <description>
- Used to delete a file resident on the module in the app's local cache.
- Not supported on first generation SDL enabled vehicles.
- </description>
-
- <param name="syncFileName" type="String" maxlength="500" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- </function>
-
- <function name="DeleteFile" functionID="DeleteFileID" messagetype="response" since="3.0">
- <description>
- Response is sent, when the file data was deleted (success case). Or when an error occurred.
- Not supported on First generation SDL enabled vehicles.
- </description>
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
- <description>Provides the total local space available on the module for the registered app.</description>
- <history>
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
- </history>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ListFiles" functionID="ListFilesID" messagetype="request" since="3.0">
- <description>
- Requests the current list of resident filenames for the registered app.
- Not supported on first generation SDL enabled vehicles.
- </description>
- </function>
-
- <function name="ListFiles" functionID="ListFilesID" messagetype="response" since="3.0">
- <description>
- Returns the current list of resident filenames for the registered app along with the current space available
- Not supported on First generation SDL enabled vehicles.
- </description>
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="filenames" type="String" maxlength="500" minsize="0" maxsize="1000" array="true" mandatory="false">
- <description>
- An array of all filenames resident on the module for the given registered app.
- If omitted, then no files currently reside on the system.
- </description>
- </param>
-
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false" since="5.0">
- <description>Provides the total local space available on the module for the registered app.</description>
- <history>
- <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true" since="3.0" until="5.0"/>
- </history>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request" since="3.0">
- <description>
- Used to set existing local file on the module as the app's icon
- Not supported on first generation SDL enabled vehicles.
- </description>
-
- <param name="syncFileName" type="String" maxlength="500" mandatory="true">
- <description>File reference name.</description>
- </param>
-
- </function>
-
- <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response" since="3.0">
- <description>
- Response is sent, when the file data was copied (success case). Or when an error occurred.
- Not supported on First generation SDL enabled vehicles.
- </description>
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request" since="3.0">
- <description>
- Used to set an alternate display layout.
- If not sent, default screen for given platform will be shown
- </description>
-
- <param name="displayLayout" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created screen layout.
- Currently only predefined screen layouts are defined.
- </description>
- </param>
-
- <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
-
- <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" since="5.0"/>
- </function>
-
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response" since="3.0">
-
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_REQUEST"/>
- </param>
-
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
- <description>See DisplayCapabilities</description>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>See ButtonCapabilities</description >
- </param>
-
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
- <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
-
- </function>
-
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="request" since="3.0">
- <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests)</description>
- <param name="requestType" type="RequestType" mandatory="true">
- <description>
- The type of system request.
- Note that Proprietary requests should forward the binary data to the known proprietary module on the system.
- </description>
- </param>
- <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
- <description>
- This parameter is filled for supporting OEM proprietary data exchanges.
- </description>
- </param>
- <param name="fileName" type="String" maxlength="255" mandatory="false">
- <description>
- Filename of HTTP data to store in predefined system staging area.
- Mandatory if requestType is HTTP.
- PROPRIETARY requestType should ignore this parameter.
- </description>
- </param>
- </function>
-
- <function name="SystemRequest" functionID="SystemRequestID" messagetype="response" since="3.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="INVALID_CERT"/>
- <element name="EXPIRED_CERT"/>
- <element name="UNSUPPORTED_REQUEST"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- <element name="ABORTED"/>
- <element name="WARNINGS"/>
- <element name="TIMED_OUT"/>
- <element name="IGNORED"/>
- </param>
- </function>
-
- <function name="SendLocation" functionID="SendLocationID" messagetype="request" since="3.0">
- <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description>
- Name / title of intended location
- </description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description>
- Description intended location / establishment (if applicable)
- </description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>
- Location address (if applicable)
- </description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description>
- Phone number of intended location / establishment (if applicable)
- </description>
- </param>
- <param name="locationImage" type="Image" mandatory="false">
- <description>
- Image / icon of intended location (if applicable and supported)
- </description>
- </param>
-
- <param name="timeStamp" type="DateTime" mandatory="false" since="4.1">
- <description>
- timestamp in ISO 8601 format
- </description>
- </param>
-
- <param name="address" type="OASISAddress" mandatory="false" since="4.1">
- <description>Address to be used for setting destination</description>
- </param>
- <param name="deliveryMode" type="DeliveryMode" mandatory="false" since="4.1">
- <description>Defines the mode of prompt for user</description>
- </param>
- </function>
-
- <function name="SendLocation" functionID="SendLocationID" messagetype="response" since="3.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="DISALLOWED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="request" since="3.0">
- <description>Dials a phone number and switches to phone application.</description>
-
- <param name="number" type="String" maxlength="40" mandatory="true">
- <description>
- Phone number is a string, which can be up to 40 chars.
- All characters shall be stripped from string except digits 0-9 and * # , ; +
- </description>
- </param>
- </function>
-
- <function name="DialNumber" functionID="DialNumberID" messagetype="response" since="3.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description>true, if successful</description>
- <description>false, if failed</description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="ButtonPress" functionID="ButtonPressID" messagetype="request" since="4.5">
- <param name="moduleType" type="ModuleType" mandatory="true">
- <description>The module where the button should be pressed</description>
- </param>
- <param name="buttonName" type="ButtonName" mandatory="true">
- <description>The name of supported RC climate or radio button.</description>
- </param>
- <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
- <description>Indicates whether this is a LONG or SHORT button press event.</description>
- </param>
- </function>
-
- <function name="ButtonPress" functionID="ButtonPressID" messagetype="response" since="4.5">
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="IN_USE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false">
- </param>
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
- </function>
-
- <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request" since="4.5">
- <param name="moduleType" type="ModuleType" mandatory="true">
- <description>
- The type of a RC module to retrieve module data from the vehicle.
- In the future, this should be the Identification of a module.
- </description>
- </param>
- <param name="subscribe" type="Boolean" mandatory="false" since="4.5.1">
- <description>
- If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduleType.
- If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduleType.
- If subscribe is not included, the subscription status of the app for the requested moduleType will remain unchanged.
- </description>
- <history>
- <param name="subscribe" type="Boolean" mandatory="false" defvalue="false" since="4.5" until="4.5.1"/>
- </history>
- </param>
- </function>
-
- <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response" since="4.5">
- <param name="moduleData" type="ModuleData" mandatory="true">
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false">
- </param>
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
- <param name="isSubscribed" type="Boolean" mandatory="false" >
- <description>
- It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
- if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType.
- if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.
- </description>
- </param>
- </function>
-
- <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request" since="4.5">
- <param name="moduleData" type="ModuleData" mandatory="true">
- <description>The module data to set for the requested RC module.</description>
- </param>
- </function>
-
- <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response" since="4.5">
- <description>Used to set the values of one remote control module </description>
- <param name="moduleData" type="ModuleData" mandatory="true">
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="READ_ONLY"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="IN_USE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false">
- </param>
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
- </function>
-
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request" since="4.1">
- <description>To subscribe in getting changes for Waypoints/destinations</description>
- </function>
-
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response" since="4.1">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request" since="4.1">
- <description>Request for getting waypoint/destination data.</description>
- <param name="wayPointType" type="WayPointType" mandatory="true">
- <description>To request for either the destination only or for all waypoints including destination</description>
- </param>
- </function>
-
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response" since="4.1">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="TIMED_OUT"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="IGNORED"/>
- <element name="IN_USE"/>
- <element name="DISALLOWED"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- <param name="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</description>
- </param>
- </function>
-
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request" since="4.1">
- <description>Request to unsubscribe from WayPoints and Destination</description>
- </function>
-
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response" since="4.1">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- <param name="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</description>
- </param>
- </function>
-
- <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="request" since="4.5">
- <description>Request for expanded information about a supported system/HMI capability</description>
- <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
- <description>The type of system capability to get more information on</description>
- </param>
- </function>
-
- <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response" since="4.5">
- <param name="systemCapability" type="SystemCapability" mandatory="true">
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="IGNORED"/>
- <element name="DISALLOWED"/>
- <element name="USER_DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE">
- <description>The capability does not exist on the module</description>
- </element>
- <element name="DATA_NOT_AVAILABLE">
- <description>The capability should exist on the module but there was an error retrieving the data.</description>
- </element>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false, if failed </description>
- </param>
- </function>
-
- <function name="SendHapticData" functionID="SendHapticDataID" messagetype="request" since="4.5">
- <description>Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
- <param name="hapticRectData" type="HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
- <description>Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared</description>
- </param>
- </function>
-
- <function name="SendHapticData" functionID="SendHapticDataID" messagetype="response" since="4.5">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true if successful; false if failed </description>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="GENERIC_ERROR"/>
- </param>
- </function>
-
- <!-- Notifications -->
-
- <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0">
- <param name="hmiLevel" type="HMILevel" mandatory="true">
- <description>See HMILevel</description>
- </param>
-
- <param name="audioStreamingState" type="AudioStreamingState" mandatory="true">
- <description>See AudioStreamingState</description>
- </param>
-
- <param name="systemContext" type="SystemContext" mandatory="true">
- <description>See SystemContext</description>
- </param>
-
- <param name="videoStreamingState" type="VideoStreamingState" mandatory="false" defvalue="STREAMABLE" since="5.0">
- <description>
- See VideoStreamingState.
- If it is NOT_STREAMABLE, the app must stop streaming video to SDL Core(stop service).
- </description>
- </param>
- </function>
-
- <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification" since="1.0">
- <param name="reason" type="AppInterfaceUnregisteredReason" mandatory="true">
- <description>See AppInterfaceUnregisteredReason</description>
- </param>
- </function>
-
- <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification" since="1.0">
- <description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
- <param name="buttonName" type="ButtonName" mandatory="true"/>
- <param name="buttonEventMode" type="ButtonEventMode" mandatory="true">
- <description>Indicates whether this is an UP or DOWN event.</description>
- </param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
- <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
- </param>
- </function>
-
- <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification" since="1.0">
- <description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
- <param name="buttonName" type="ButtonName" mandatory="true"/>
- <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
- <description>Indicates whether this is a LONG or SHORT button press event.</description>
- </param>
- <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false" since="2.0">
- <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
- </param>
- </function>
-
- <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification" since="2.0">
- <description>Callback for the periodic and non periodic vehicle data read function.</description>
- <param name="gps" type="GPSData" mandatory="false">
- <description>See GPSData</description>
- </param>
- <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
- <description>The vehicle speed in kilometers per hour</description>
- </param>
- <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
- <description>The number of revolutions per minute of the engine</description>
- </param>
- <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
- <description>The fuel level in the tank (percentage)</description>
- </param>
- <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
- <description>The fuel level state</description>
- </param>
- <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
- <description>The instantaneous fuel consumption in microlitres</description>
- </param>
- <param name="fuelRange" type="FuelRange" minsize="0" maxsize="100" array="true" mandatory="false" since="5.0">
- <description>The estimate range in KM the vehicle can travel based on fuel level and consumption</description>
- </param>
- <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
- <description>The external temperature in degrees celsius</description>
- </param>
- <param name="turnSignal" type="TurnSignal" mandatory="false" since="5.0">
- <description>See TurnSignal</description>
- </param>
- <param name="vin" type="String" maxlength="17" mandatory="false">
- <description>Vehicle identification number.</description>
- </param>
- <param name="prndl" type="PRNDL" mandatory="false">
- <description>See PRNDL</description>
- </param>
- <param name="tirePressure" type="TireStatus" mandatory="false">
- <description>See TireStatus</description>
- </param>
- <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
- <description>Odometer in km</description>
- </param>
- <param name="beltStatus" type="BeltStatus" mandatory="false">
- <description>The status of the seat belts</description>
- </param>
- <param name="bodyInformation" type="BodyInformation" mandatory="false">
- <description>The body information including power modes</description>
- </param>
- <param name="deviceStatus" type="DeviceStatus" mandatory="false">
- <description>The device status including signal and battery strength</description>
- </param>
- <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
- <description>The status of the brake pedal</description>
- </param>
- <param name="wiperStatus" type="WiperStatus" mandatory="false">
- <description>The status of the wipers</description>
- </param>
- <param name="headLampStatus" type="HeadLampStatus" mandatory="false">
- <description>Status of the head lamps</description>
- </param>
- <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
- <description>Torque value for engine (in Nm) on non-diesel variants</description>
- </param>
- <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
- <description>Accelerator pedal position (percentage depressed)</description>
- </param>
- <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
- <description>Current angle of the steering wheel (in deg)</description>
- </param>
- <param name="engineOilLife" type="Float" minvalue="0" maxvalue="100" mandatory="false" since="5.0">
- <description>The estimated percentage of remaining oil life of the engine.</description>
- </param>
- <param name="electronicParkBrakeStatus" type="ElectronicParkBrakeStatus" mandatory="false" since="5.0">
- <description>The status of the park brake as provided by Electric Park Brake (EPB) system.</description>
- </param>
-
- <!-- Ford Specific Vehicle Data -->
- <param name="eCallInfo" type="ECallInfo" mandatory="false">
- <description>Emergency Call notification and confirmation data</description>
- </param>
- <param name="airbagStatus" type="AirbagStatus" mandatory="false">
- <description>The status of the air bags</description>
- </param>
- <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
- <description>Information related to an emergency event (and if it occurred)</description>
- </param>
- <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
- <description>The status modes of the cluster</description>
- </param>
- <param name="myKey" type="MyKey" mandatory="false">
- <description>Information related to the MyKey feature</description>
- </param>
- <!-- / Ford Specific Vehicle Data -->
-
- </function>
-
- <function name="OnCommand" functionID="OnCommandID" messagetype="notification" since="1.0">
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
- <description>Command ID, which is related to a specific menu entry</description>
- </param>
-
- <param name="triggerSource" type="TriggerSource" mandatory="true">
- <description>See TriggerSource</description>
- </param>
- </function>
-
- <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" since="1.0">
- <description>Provides applications with notifications specific to the current TBT client status on the module</description>
- <param name="state" type="TBTState" mandatory="true">
- <description>Current State of TBT client</description>
- </param>
- </function>
-
- <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" since="1.0">
- <description>Provides driver distraction state to mobile applications</description>
- <param name="state" type="DriverDistractionState" mandatory="true">
- <description>Current State of Driver Distraction</description>
- </param>
- </function>
-
- <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" since="2.0">
- <description>Provides update to app of which policy-table-enabled functions are available</description>
- <param name="permissionItem" type="PermissionItem" minsize="0" maxsize="500" array="true" mandatory="true">
- <description>Change in permissions for a given set of RPCs</description>
- </param>
- </function>
-
- <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification" since="2.0">
- <description>Binary data is in binary part of hybrid msg</description>
- </function>
-
- <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification" since="2.0">
- <param name="language" type="Language" mandatory="true">
- <description>Current SDL voice engine (VR+TTS) language</description>
- </param>
- <param name="hmiDisplayLanguage" type="Language" mandatory="true">
- <description>Current display language</description>
- </param>
- </function>
-
- <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" since="3.0">
-
- <description>On-screen keyboard event.</description>
- <description>Can be full string or individual keypresses depending on keyboard mode.</description>
-
- <param name="event" type="KeyboardEvent" mandatory="true">
- <description>On-screen keyboard input data.</description>
- </param>
-
- <param name="data" type="String" maxlength="500" mandatory="false">
- <description>On-screen keyboard input data.</description>
- <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
- <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
- <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
- </param>
-
- </function>
-
- <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" since="3.0">
- <description>Notifies about touch events on the screen's prescribed area</description>
- <param name="type" type="TouchType" mandatory="true">
- <description>The type of touch event.</description>
- </param>
- <param name="event" type="TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
- <description>List of all individual touches involved in this event.</description>
- </param>
- </function>
-
- <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification" since="3.0">
- <description>
- An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
- Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
- </description>
- <param name="requestType" type="RequestType" mandatory="true">
- <description>The type of system request.</description>
- </param>
- <param name="requestSubType" type="String" maxlength="255" mandatory="false" since="5.0">
- <description>
- This parameter is filled for supporting OEM proprietary data exchanges.
- </description>
- </param>
- <param name="url" type="String" maxlength="1000" mandatory="false">
- <description>
- Optional URL for HTTP requests.
- If blank, the binary data shall be forwarded to the app.
- If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds.
- </description>
- </param>
- <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- Optional timeout for HTTP requests
- Required if a URL is provided
- </description>
- </param>
- <param name="fileType" type="FileType" mandatory="false">
- <description>Optional file type (meant for HTTP file requests).</description>
- </param>
- <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional offset in bytes for resuming partial data chunks</description>
- </param>
- <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
- <description>Optional length in bytes for resuming partial data chunks</description>
- </param>
- </function>
-
- <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification" since="3.0">
- <description>
- Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
- Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
- </description>
- <param name="hashID" type="String" maxlength="100" mandatory="true">
- <description>Calculated hash ID to be referenced during RegisterAppInterface.</description>
- </param>
- </function>
-
- <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification" since="4.1">
- <description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
- <param name="wayPoints" type="LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</description>
- </param>
- </function>
-
- <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification" since="4.5">
- <param name="moduleData" type="ModuleData" mandatory="true">
- </param>
- </function>
-
- <function name="OnRCStatus" functionID="OnRCStatusID" messagetype="notification" since="5.0">
- <description>Issued by SDL to notify the application about remote control status change on SDL</description>
- <param name="allowed" type="Boolean" mandatory="false">
- <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
- </param>
- <param name="allocatedModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>Contains a list (zero or more) of module types that are allocated to the application.</description>
- </param>
- <param name="freeModules" type="ModuleData" minsize="0" maxsize="100" array="true" mandatory="true">
- <description>Contains a list (zero or more) of module types that are free to access for the application.</description>
- </param>
- </function>
-
- <!-- ~~~~~~~~~~~~~~~~~~ -->
- <!-- Ford Specific APIs -->
- <!-- ~~~~~~~~~~~~~~~~~~ -->
-
- <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="request" since="1.0">
- <description>
- Allows encoded data in the form of SyncP packets to be sent to the SYNC module.
- Legacy / v1 Protocol implementation; use SyncPData instead.
- *** DEPRECATED ***
- </description>
-
- <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" array="true" mandatory="true">
- <description>Contains base64 encoded string of SyncP packets.</description>
- <todo>What is the maxlength?</todo>
- </param>
- </function>
-
- <function name="EncodedSyncPData" functionID="EncodedSyncPDataID" messagetype="response" since="1.0">
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
-
- <!-- Deprecating - covered by SystemRequest
- <function name="SyncPData" functionID="SyncPDataID" messagetype="request" >
- <description>
- Allows binary data in the form of SyncP packets to be sent to the SYNC module.
- Binary data is in binary part of hybrid msg.
- </description>
- </function>
-
- <function name="SyncPData" functionID="SyncPDataID" messagetype="response" >
- <param name="success" type="Boolean" platform="documentation" mandatory="true">
- <description> true, if successful; false, if failed </description>
- </param>
-
- <param name="resultCode" type="Result" platform="documentation" mandatory="true">
- <description>See Result</description>
- <element name="SUCCESS"/>
- <element name="INVALID_DATA"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- </param>
-
- <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
- <description>Provides additional human readable info regarding the result.</description>
- </param>
- </function>
- -->
-
- <function name="OnEncodedSyncPData" functionID="OnEncodedSyncPDataID" messagetype="notification" since="1.0">
- <description>
- Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device.
- Legacy / v1 Protocol implementation; responds to EncodedSyncPData.
- *** DEPRECATED ***
- </description>
- <param name="data" type="String" maxlength="1000000" minsize="1" maxsize="100" mandatory="true" array="true">
- <description>Contains base64 encoded string of SyncP packets.</description>
- </param>
- <param name="URL" type="String" maxlength="1000" mandatory="false">
- <description>
- If blank, the SyncP data shall be forwarded to the app.
- If not blank, the SyncP data shall be forwarded to the provided URL.
- </description>
- </param>
- <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- If blank, the SyncP data shall be forwarded to the app.
- If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
- </description>
- </param>
- </function>
-
-
- <!-- Deprecating - covered by OnSystemRequest
- <function name="OnSyncPData" functionID="OnSyncPDataID" messagetype="notification" >
- <description>
- Callback including binary data of any SyncP packets that SYNC needs to send back to the mobile device.
- Responds to SyncPData.
- Binary data is in binary part of hybrid msg.
- </description>
-
- <param name="URL" type="String" maxlength="1000" mandatory="false">
- <description>
- If blank, the SyncP data shall be forwarded to the app.
- If not blank, the SyncP data shall be forwarded to the provided URL.
- </description>
- </param>
- <param name="Timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
- <description>
- If blank, the SyncP data shall be forwarded to the app.
- If not blank, the SyncP data shall be forwarded with the provided timeout in seconds.
- </description>
- </param>
-
- </function>
- -->
-</interface> \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java
deleted file mode 100644
index e22e397d2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java
+++ /dev/null
@@ -1,386 +0,0 @@
-package com.smartdevicelink.managers;
-
-import android.content.Context;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.managers.lockscreen.LockScreenConfig;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.SdlProxyBase;
-import com.smartdevicelink.proxy.rpc.GetVehicleData;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.TCPTransportConfig;
-
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Vector;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-
-/**
- * This is a unit test class for the SmartDeviceLink library manager class :
- * {@link com.smartdevicelink.managers.SdlManager}
- */
-public class SdlManagerTests extends AndroidTestCase2 {
-
- public static BaseTransportConfig transport = null;
- private Context mTestContext;
- private Vector<AppHMIType> appType;
- private TemplateColorScheme templateColorScheme;
- private int listenerCalledCounter;
- private SdlManager sdlManager;
- private SdlProxyBase sdlProxyBase;
-
- // transport related
- @SuppressWarnings("FieldCanBeLocal")
- private int TCP_PORT = 12345;
- @SuppressWarnings("FieldCanBeLocal")
- private String DEV_MACHINE_IP_ADDRESS = "0.0.0.0";
-
- @Override
- public void setUp() throws Exception{
- super.setUp();
-
- // set transport
- transport = new TCPTransportConfig(TCP_PORT, DEV_MACHINE_IP_ADDRESS, true);
-
- // add AppTypes
- appType = new Vector<>();
- appType.add(AppHMIType.DEFAULT);
-
- // Color Scheme
- templateColorScheme = new TemplateColorScheme();
- templateColorScheme.setBackgroundColor(Test.GENERAL_RGBCOLOR);
- templateColorScheme.setPrimaryColor(Test.GENERAL_RGBCOLOR);
- templateColorScheme.setSecondaryColor(Test.GENERAL_RGBCOLOR);
-
- sdlManager = createSampleManager("heyApp", "123456", Test.GENERAL_LOCKSCREENCONFIG);
- }
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- // SETUP / HELPERS
-
- private Context getTestContext() {
- return mTestContext;
- }
-
- private SdlManager createSampleManager(String appName, String appId, LockScreenConfig lockScreenConfig){
- 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(getTestContext(),appId,appName,listener);
- builder.setShortAppName(appName);
- builder.setAppTypes(appType);
- builder.setTransportType(transport);
- 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(lockScreenConfig);
- manager = builder.build();
-
- // mock SdlProxyBase and set it manually
- sdlProxyBase = mock(SdlProxyBase.class);
- manager.setProxy(sdlProxyBase);
-
- return manager;
- }
-
- // TESTS
-
- public void testNotNull(){
- assertNotNull(createSampleManager("app","123456", Test.GENERAL_LOCKSCREENCONFIG));
- }
-
- public void testMissingAppName() {
- try {
- createSampleManager(null,"123456", Test.GENERAL_LOCKSCREENCONFIG);
- } catch (IllegalArgumentException ex) {
- assertSame(ex.getMessage(), "You must specify an app name by calling setAppName");
- }
- }
-
- public void testMissingAppId() {
- try {
- createSampleManager("app",null, Test.GENERAL_LOCKSCREENCONFIG);
- } catch (IllegalArgumentException ex) {
- assertSame(ex.getMessage(), "You must specify an app ID by calling setAppId");
- }
- }
-
- public void testManagerSetters() {
- assertEquals("123456", sdlManager.getAppId());
- assertEquals("heyApp", sdlManager.getAppName());
- assertEquals("heyApp", sdlManager.getShortAppName());
- assertEquals(appType, sdlManager.getAppTypes());
- assertEquals(Language.EN_US, sdlManager.getHmiLanguage());
- assertEquals(transport, sdlManager.getTransport());
- assertEquals(templateColorScheme, sdlManager.getDayColorScheme());
- 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();
-
- // 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
- sdlManager.initialize();
-
- // Set all sub managers' states to ready
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
- sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
-
- // Make sure the listener is called exactly once
- assertEquals("Listener was not called or called more/less frequently than expected", listenerCalledCounter, 1);
- }
-
- public void testManagerStates() {
- SdlManager sdlManager = createSampleManager("test", "00000", new LockScreenConfig());
- sdlManager.initialize();
-
-
- // Case 1-A:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
- sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenConfig().setEnabled(true);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.checkState();
- assertEquals(BaseSubManager.READY, sdlManager.getState());
-
-
- // Case 1-B:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
- sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenConfig().setEnabled(false);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.checkState();
- assertEquals(BaseSubManager.READY, sdlManager.getState());
-
-
- // Case 2-A:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getLockScreenConfig().setEnabled(true);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.checkState();
- assertEquals(BaseSubManager.ERROR, sdlManager.getState());
-
-
- // Case 1-B:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getLockScreenConfig().setEnabled(false);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.checkState();
- assertEquals(BaseSubManager.ERROR, sdlManager.getState());
-
-
- // Case 3-A:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.getLockScreenConfig().setEnabled(true);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.LIMITED);
- sdlManager.checkState();
- assertEquals(BaseSubManager.SETTING_UP, sdlManager.getState());
-
-
- // Case 3-B:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.getLockScreenConfig().setEnabled(false);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.checkState();
- assertEquals(BaseSubManager.SETTING_UP, sdlManager.getState());
-
-
- // Case 4-A:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
- sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenConfig().setEnabled(true);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.checkState();
- assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
-
-
- // Case 4-B:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
- sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenConfig().setEnabled(false);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.checkState();
- assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
-
-
- // Case 5-A:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
- sdlManager.getFileManager().transitionToState(BaseSubManager.LIMITED);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getLockScreenConfig().setEnabled(true);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.checkState();
- assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
-
-
- // Case 5-B:
- sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
- sdlManager.getFileManager().transitionToState(BaseSubManager.LIMITED);
- sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getLockScreenConfig().setEnabled(false);
- sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.checkState();
- assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
- }
-
- public void testSendRPC(){
- listenerCalledCounter = 0;
-
- // When sdlProxyBase.sendRPCRequest() is called, create a fake success response
- Answer<Void> answer = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- RPCRequest request = (RPCRequest) args[0];
- RPCResponse response = new RPCResponse(FunctionID.GET_VEHICLE_DATA.toString());
- response.setSuccess(true);
- request.getOnRPCResponseListener().onResponse(0, response);
- return null;
- }
- };
- try {
- doAnswer(answer).when(sdlProxyBase).sendRPCRequest(any(RPCRequest.class));
- } catch (SdlException e) {
- e.printStackTrace();
- }
-
-
- // Test send RPC request
- final GetVehicleData request = new GetVehicleData();
- request.setGps(true);
- request.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- assertTrue(response.getSuccess());
- listenerCalledCounter++;
- }
- });
-
- sdlManager.sendRPC(request);
-
- // Make sure the listener is called exactly once
- assertEquals("Listener was not called or called more/less frequently than expected", listenerCalledCounter, 1);
- }
-
- public void testSendRPCs(){
- testSendMultipleRPCs(false);
- }
-
- public void testSendSequentialRPCs(){
- testSendMultipleRPCs(true);
- }
-
- private void testSendMultipleRPCs(boolean sequentialSend){
- listenerCalledCounter = 0;
-
- // When sdlProxyBase.sendRPCRequests() is called, call listener.onFinished() to fake the response
- final Answer<Void> answer = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
- listener.onFinished();
- return null;
- }
- };
- try {
- if (sequentialSend){
- doAnswer(answer).when(sdlProxyBase).sendSequentialRequests(any(List.class), any(OnMultipleRequestListener.class));
-
- } else {
- doAnswer(answer).when(sdlProxyBase).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
- }
- } catch (SdlException e) {
- e.printStackTrace();
- }
-
-
- // Test send RPC requests
- List<RPCRequest> rpcsList = Arrays.asList(new GetVehicleData(), new Show());
- OnMultipleRequestListener onMultipleRequestListener = new OnMultipleRequestListener() {
- @Override
- public void onUpdate(int remainingRequests) { }
-
- @Override
- public void onFinished() {
- listenerCalledCounter++;
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {}
-
- @Override
- public void onResponse(int correlationId, RPCResponse response) {}
- };
- if (sequentialSend) {
- sdlManager.sendSequentialRPCs(rpcsList, onMultipleRequestListener);
- } else {
- sdlManager.sendRPCs(rpcsList, onMultipleRequestListener);
- }
-
-
- // Make sure the listener is called exactly once
- assertEquals("Listener was not called or called more/less frequently than expected", listenerCalledCounter, 1);
- }
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java
deleted file mode 100644
index 35c57a4c3..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java
+++ /dev/null
@@ -1,681 +0,0 @@
-package com.smartdevicelink.managers.audio;
-
-import android.content.Context;
-import android.media.AudioFormat;
-import android.media.MediaFormat;
-import android.media.MediaPlayer;
-import android.os.Build;
-import android.support.test.InstrumentationRegistry;
-import android.util.Log;
-
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
-import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-
-import junit.framework.TestCase;
-
-import org.mockito.Mockito;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.RandomAccessFile;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.timeout;
-import static org.mockito.Mockito.verify;
-
-public class AudioStreamManagerTest extends TestCase {
- public static final String TAG = AudioStreamManagerTest.class.getSimpleName();
- private Context mContext;
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- mContext = InstrumentationRegistry.getContext();
- }
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- mContext = null;
- }
-
- public void testCreatingAudioStreamManager() {
- ISdl internalInterface = mock(ISdl.class);
- AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(SystemCapabilityType.PCM_STREAMING);
-
- new AudioStreamManager(internalInterface, mContext);
- }
-
- public void testStartAudioStreamManager() {
- final SdlSession mockSession = mock(SdlSession.class);
-
- Answer<Void> audioServiceAnswer = new Answer<Void>() {
- ISdlServiceListener serviceListener = null;
- @Override
- public Void answer(InvocationOnMock invocation) {
- Method method = invocation.getMethod();
- Object[] args = invocation.getArguments();
-
- switch (method.getName()) {
- case "addServiceListener":
- // parameters (SessionType serviceType, ISdlServiceListener sdlServiceListener);
- SessionType sessionType = (SessionType) args[0];
- assertEquals(sessionType, SessionType.PCM);
- serviceListener = (ISdlServiceListener) args[1];
- break;
- case "startAudioService":
- // parameters (boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params);
- Boolean encrypted = (Boolean) args[0];
- serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
- break;
- case "stopAudioService":
- // parameters ()
- serviceListener.onServiceEnded(mockSession, SessionType.PCM);
- break;
- }
-
- return null;
- }
- };
-
- ISdl internalInterface = mock(ISdl.class);
- AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(SystemCapabilityType.PCM_STREAMING);
- doAnswer(audioServiceAnswer).when(internalInterface).addServiceListener(any(SessionType.class), any(ISdlServiceListener.class));
- doAnswer(audioServiceAnswer).when(internalInterface).startAudioService(any(Boolean.class));
- doAnswer(audioServiceAnswer).when(internalInterface).stopAudioService();
-
- CompletionListener completionListener = new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertEquals(true, success);
- }
- };
-
- CompletionListener mockListener = spy(completionListener);
- AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext);
-
- manager.startAudioStream(false, mockListener);
- manager.stopAudioStream(mockListener);
- verify(mockListener, timeout(10000).times(2)).onComplete(any(Boolean.class));
- }
-
- public void testWithSquareSampleAudio16BitAnd8KhzApi16() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio16BitAnd16KhzApi16() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio16BitAnd22KhzApi16() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio16BitAnd44KhzApi16() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio8BitAnd8KhzApi16() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._8_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio8BitAnd16KhzApi16() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._8_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio8BitAnd22KhzApi16() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._8_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio8BitAnd44KhzApi16() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 16);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._8_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio16BitAnd8KhzApi21() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio16BitAnd16KhzApi21() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio16BitAnd22KhzApi21() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio16BitAnd44KhzApi21() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.SIGNED_16_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio8BitAnd8KhzApi21() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._8KHZ, BitsPerSample._8_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(8000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio8BitAnd16KhzApi21() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._8_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(16000, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio8BitAnd22KhzApi21() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._22KHZ, BitsPerSample._8_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(22050, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
- }
-
- public void testWithSquareSampleAudio8BitAnd44KhzApi21() throws Exception {
- setFinalStatic(Build.VERSION.class.getField("SDK_INT"), 21);
- AudioPassThruCapabilities audioPassThruCapabilities = new AudioPassThruCapabilities(SamplingRate._44KHZ, BitsPerSample._8_BIT, AudioType.PCM);
- runFullAudioManagerDecodeFlowWithSquareSampleAudio(44100, SampleType.UNSIGNED_8_BIT, audioPassThruCapabilities);
- }
-
- private int testFullAudioManagerDecodeFlowCorrectCounter = 0;
- private int testFullAudioManagerDecodeFlowWrongCounter = 0;
- private void runFullAudioManagerDecodeFlowWithSquareSampleAudio(final int sampleRate, final @SampleType int sampleType, final AudioPassThruCapabilities audioCapabilities) {
- testFullAudioManagerDecodeFlowCorrectCounter = 0;
- testFullAudioManagerDecodeFlowWrongCounter = 0;
-
- IAudioStreamListener audioStreamListener = new IAudioStreamListener() {
- @Override
- public void sendAudio(byte[] data, int offset, int length, long presentationTimeUs) throws ArrayIndexOutOfBoundsException {
- ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
- this.sendAudio(buffer, presentationTimeUs);
- }
-
- @Override
- public void sendAudio(ByteBuffer data, long presentationTimeUs) {
- SampleBuffer samples = SampleBuffer.wrap(data, sampleType, presentationTimeUs);
- double timeUs = presentationTimeUs;
- double sampleDurationUs = 1000000.0 / sampleRate;
-
- for (int i = 0; i < samples.limit(); ++i) {
- double sample = samples.get(i);
- double edge = timeUs % 4000.0;
-
- if (edge > 2000.0) {
- // swap sample as it's negative expected
- sample = sample * -1.0;
- }
-
- edge = edge % 2000.0;
-
- // at the edge of a wave the sample can be lower than 0.7
- if ((sample > 0.7 && sample < 0.95) || (edge < sampleDurationUs || (2000.0 - sampleDurationUs) < edge)) {
- testFullAudioManagerDecodeFlowCorrectCounter++;
- } else {
- testFullAudioManagerDecodeFlowWrongCounter++;
- }
-
- timeUs += sampleDurationUs;
- }
- }
- };
-
- final SdlSession mockSession = mock(SdlSession.class);
- doReturn(audioStreamListener).when(mockSession).startAudioStream();
-
- Answer<Void> audioServiceAnswer = new Answer<Void>() {
- ISdlServiceListener serviceListener = null;
- @Override
- public Void answer(InvocationOnMock invocation) {
- Method method = invocation.getMethod();
- Object[] args = invocation.getArguments();
-
- switch (method.getName()) {
- case "addServiceListener":
- // (SessionType serviceType, ISdlServiceListener sdlServiceListener);
- SessionType sessionType = (SessionType) args[0];
- assertEquals(sessionType, SessionType.PCM);
-
- serviceListener = (ISdlServiceListener) args[1];
- break;
- case "startAudioService":
- //(boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params);
- Boolean encrypted = (Boolean) args[0];
- serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
- break;
- case "stopAudioService":
- // parameters ()
- serviceListener.onServiceEnded(mockSession, SessionType.PCM);
- break;
- }
-
- return null;
- }
- };
-
- ISdl internalInterface = mock(ISdl.class);
- doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(any(SystemCapabilityType.class));
- doAnswer(audioServiceAnswer).when(internalInterface).addServiceListener(any(SessionType.class), any(ISdlServiceListener.class));
- doAnswer(audioServiceAnswer).when(internalInterface).startAudioService(any(Boolean.class));
- doAnswer(audioServiceAnswer).when(internalInterface).stopAudioService();
-
- CompletionListener fileCompletionListener = new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertEquals(true, success);
-
- // not more than 2.5 percent samples must be wrong
- double relation = 100.0 * (double)testFullAudioManagerDecodeFlowWrongCounter / (double)testFullAudioManagerDecodeFlowCorrectCounter;
- Log.v(TAG, "Validating number of correct samples (" + Math.round(relation) + "%)");
- if (relation > 2.5) {
- fail("Validating raw audio failed. " + Math.round(relation) + " % wrong samples detected. Correct: " + testFullAudioManagerDecodeFlowCorrectCounter + ", Wrong: " + testFullAudioManagerDecodeFlowWrongCounter);
- }
- }
- };
-
- final CompletionListener mockFileListener = spy(fileCompletionListener);
-
- final AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext);
- manager.startAudioStream(false, new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertEquals(true, success);
-
- manager.pushResource(com.smartdevicelink.test.R.raw.test_audio_square_250hz_80amp_1s, mockFileListener);
- }
- });
-
- verify(mockFileListener, timeout(10000)).onComplete(any(Boolean.class));
- }
-
- public void testSampleAtTargetTimeReturnNull() {
- BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
- Method sampleAtTargetMethod = getSampleAtTargetMethod();
- SampleBuffer sample = SampleBuffer.allocate(1, SampleType.SIGNED_16_BIT, ByteOrder.LITTLE_ENDIAN, 1);
- Double result;
- try {
- result = (Double) sampleAtTargetMethod.invoke(mockDecoder, 1.0, sample, 1, 3, 2);
- assertNull(result);
- result = (Double) sampleAtTargetMethod.invoke(mockDecoder, 1.0, sample, 5, 3, 1);
- assertNull(result);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- public void testSampleAtTargetTimeReturnLastOutputSample() {
- BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
- Method sampleAtTargetMethod = getSampleAtTargetMethod();
- SampleBuffer sample = SampleBuffer.allocate(1, SampleType.SIGNED_16_BIT, ByteOrder.LITTLE_ENDIAN, 1);
- Double result;
- Double lastOutputSample = 15.0;
- try {
- result = (Double) sampleAtTargetMethod.invoke(mockDecoder, lastOutputSample, sample, 6, 1, 5);
- assertTrue(result.doubleValue() == lastOutputSample);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- public void testSampleAtTargetTimeReturnOutputSampleGet() {
- BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
- Method sampleAtTargetMethod = getSampleAtTargetMethod();
- SampleBuffer sample = SampleBuffer.allocate(10, SampleType.SIGNED_16_BIT, ByteOrder.LITTLE_ENDIAN, 1);
- Double result;
- try {
- result = (Double) sampleAtTargetMethod.invoke(mockDecoder, 1.0, sample, 1, 1, 2);
- assertTrue(result == sample.get(1));
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- public void testSampleAtTargetTime() {
- BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
- Method sampleAtTargetMethod = getSampleAtTargetMethod();
- SampleBuffer sample = SampleBuffer.allocate(10, SampleType.SIGNED_16_BIT, ByteOrder.LITTLE_ENDIAN, 1);
- Double result;
- try {
- result = (Double) sampleAtTargetMethod.invoke(mockDecoder, 1.0, sample, 1, 3, 2);
- assertNotNull(result);
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- public void testOutputFormatChanged() {
- BaseAudioDecoder mockDecoder = mock(BaseAudioDecoder.class, Mockito.CALLS_REAL_METHODS);
-
- try {
- Field outputChannelCountField = BaseAudioDecoder.class.getDeclaredField("outputChannelCount");
- Field outputSampleRateField = BaseAudioDecoder.class.getDeclaredField("outputSampleRate");
- Field outputSampleTypeField = BaseAudioDecoder.class.getDeclaredField("outputSampleType");
-
- outputChannelCountField.setAccessible(true);
- outputSampleRateField.setAccessible(true);
- outputSampleTypeField.setAccessible(true);
-
- // channel count, sample rate, sample type
- int key_channel_count = 0, key_sample_rate = 1, key_sample_type = 2, key_sample_type_result = 3;
- int[][] tests = new int[][] {
- { 47, 42000, AudioFormat.ENCODING_PCM_8BIT, SampleType.UNSIGNED_8_BIT },
- { 2, 16000, AudioFormat.ENCODING_PCM_16BIT, SampleType.SIGNED_16_BIT },
- { 1, 22050, AudioFormat.ENCODING_PCM_FLOAT, SampleType.FLOAT },
- { 3, 48000, AudioFormat.ENCODING_INVALID, SampleType.SIGNED_16_BIT },
- };
-
- for (int[] test : tests) {
- int channel_count = test[key_channel_count];
- int sample_rate = test[key_sample_rate];
- int sample_type = test[key_sample_type];
- int sample_type_result = test[key_sample_type_result];
-
- MediaFormat format = new MediaFormat();
-
- format.setInteger(MediaFormat.KEY_CHANNEL_COUNT, channel_count);
- format.setInteger(MediaFormat.KEY_SAMPLE_RATE, sample_rate);
- format.setInteger(MediaFormat.KEY_PCM_ENCODING, sample_type);
-
- // in case the phone version is old the method does not take sample type into account but
- // always expected 16 bit. See https://developer.android.com/reference/android/media/MediaFormat.html#KEY_PCM_ENCODING
- if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N) {
- sample_type_result = SampleType.SIGNED_16_BIT;
- }
-
- mockDecoder.onOutputFormatChanged(format);
-
- int output_channel_count = outputChannelCountField.getInt(mockDecoder);
- int output_sample_rate = outputSampleRateField.getInt(mockDecoder);
- int output_sample_type = outputSampleTypeField.getInt(mockDecoder);
-
- // changing from assertEquals to if and fail so travis gives better results
-
- if (channel_count != output_channel_count) {
- fail("AssertEqualsFailed: channel_count == output_channel_count (" + channel_count + " == " + output_channel_count + ")");
- }
-
- if (sample_rate != output_sample_rate) {
- fail("AssertEqualsFailed: sample_rate == output_sample_rate (" + sample_rate + " == " + output_sample_rate + ")");
- }
-
- if (sample_type_result != output_sample_type) {
- fail("Assert: sample_type_result == output_sample_type (" + sample_type_result + " == " + output_sample_type + ")");
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- fail();
- }
- }
-
- public void testPlayAudioFileForManualTest() throws IOException {
- AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- final int sampleType = SampleType.SIGNED_16_BIT;
- final int sampleRate = 16000;
-
- final File outputFile = new File(mContext.getCacheDir(), "test_audio_file.wav");
- assertNotNull((outputFile));
- final FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
- assertNotNull(fileOutputStream);
- writeWaveHeader(fileOutputStream, sampleRate, sampleType << 3);
-
- IAudioStreamListener audioStreamListener = new IAudioStreamListener() {
- long audioLength = 0;
-
- @Override
- public void sendAudio(byte[] data, int offset, int length, long presentationTimeUs) throws ArrayIndexOutOfBoundsException {
- ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
- this.sendAudio(buffer, presentationTimeUs);
- }
-
- @Override
- public void sendAudio(ByteBuffer data, long presentationTimeUs) {
- try {
- long length = data.limit();
- byte[] d = data.array();
- fileOutputStream.write(d, 0, (int) length);
-
- audioLength += length;
- RandomAccessFile raf = new RandomAccessFile(outputFile, "rw");
- updateWaveHeaderLength(raf, audioLength);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- };
-
- final SdlSession mockSession = mock(SdlSession.class);
- doReturn(audioStreamListener).when(mockSession).startAudioStream();
-
- Answer<Void> audioServiceAnswer = new Answer<Void>() {
- ISdlServiceListener serviceListener = null;
- @Override
- public Void answer(InvocationOnMock invocation) {
- Method method = invocation.getMethod();
- Object[] args = invocation.getArguments();
-
- switch (method.getName()) {
- case "addServiceListener":
- // (SessionType serviceType, ISdlServiceListener sdlServiceListener);
- SessionType sessionType = (SessionType) args[0];
- assertEquals(sessionType, SessionType.PCM);
-
- serviceListener = (ISdlServiceListener) args[1];
- break;
- case "startAudioService":
- //(boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params);
- Boolean encrypted = (Boolean) args[0];
- serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
- break;
- case "stopAudioService":
- // parameters ()
- serviceListener.onServiceEnded(mockSession, SessionType.PCM);
- break;
- }
-
- return null;
- }
- };
-
- ISdl internalInterface = mock(ISdl.class);
- doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(any(SystemCapabilityType.class));
- doAnswer(audioServiceAnswer).when(internalInterface).addServiceListener(any(SessionType.class), any(ISdlServiceListener.class));
- doAnswer(audioServiceAnswer).when(internalInterface).startAudioService(any(Boolean.class));
- doAnswer(audioServiceAnswer).when(internalInterface).stopAudioService();
-
- final MediaPlayer.OnCompletionListener mockPlayerCompletionListener = mock(MediaPlayer.OnCompletionListener.class);
- final MediaPlayer player = new MediaPlayer();
- player.setOnCompletionListener(mockPlayerCompletionListener);
-
- CompletionListener fileCompletionListener = new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- try {
- fileOutputStream.flush();
- fileOutputStream.close();
-
- player.setDataSource(outputFile.getPath());
- player.prepare();
- player.start();
-
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- };
-
- final CompletionListener mockFileListener = spy(fileCompletionListener);
-
- final AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext);
- manager.startAudioStream(false, new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertEquals(true, success);
-
- manager.pushResource(com.smartdevicelink.test.R.raw.test_audio_square_250hz_80amp_1s, mockFileListener);
- }
- });
-
- verify(mockFileListener, timeout(10000)).onComplete(any(Boolean.class));
- verify(mockPlayerCompletionListener, timeout(10000)).onCompletion(any(MediaPlayer.class));
- }
-
- private Method getSampleAtTargetMethod() {
- Method method = null;
- try {
- method = BaseAudioDecoder.class.getDeclaredMethod("sampleAtTargetTime",
- double.class, SampleBuffer.class, double.class, double.class, double.class);
- method.setAccessible(true);
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- fail();
- }
- return method;
- }
-
- private void setFinalStatic(Field field, Object newValue) throws Exception {
- field.setAccessible(true);
- field.set(null, newValue);
- }
-
- private void writeWaveHeader(OutputStream stream, long samplerate, long bitspersample) throws IOException {
- byte[] header = new byte[44];
- // the data header is 36 bytes large
- long datalength = 36;
- long audiolength = 0;
- long format = 1; // 1 = PCM
- long channels = 1;
- long blockalign = (channels * bitspersample) >> 3;
- long byterate = (samplerate * channels * bitspersample) >> 3;
-
- // RIFF header.
- header[0] = 'R';
- header[1] = 'I';
- header[2] = 'F';
- header[3] = 'F';
- // Total data length (UInt32).
- header[4] = (byte)((datalength) & 0xff);
- header[5] = (byte)((datalength >> 8) & 0xff);
- header[6] = (byte)((datalength >> 16) & 0xff);
- header[7] = (byte)((datalength >> 24) & 0xff);
- // WAVE header.
- header[8] = 'W';
- header[9] = 'A';
- header[10] = 'V';
- header[11] = 'E';
- // Format (fmt) header.
- header[12] = 'f';
- header[13] = 'm';
- header[14] = 't';
- header[15] = ' ';
- // Format header size (UInt32).
- header[16] = 16;
- header[17] = 0;
- header[18] = 0;
- header[19] = 0;
- // Format type (UInt16). Set 1 for PCM.
- header[20] = (byte)((format) & 0xff);
- header[21] = (byte)((format >> 8) & 0xff);
- // Channels
- header[22] = (byte)((channels) & 0xff);
- header[23] = (byte)((channels >> 8) & 0xff);
- // Sample rate (UInt32).
- header[24] = (byte)((samplerate) & 0xff);
- header[25] = (byte)((samplerate >> 8) & 0xff);
- header[26] = (byte)((samplerate >> 16) & 0xff);
- header[27] = (byte)((samplerate >> 24) & 0xff);
- // Byte rate (UInt32).
- header[28] = (byte)((byterate) & 0xff);
- header[29] = (byte)((byterate >> 8) & 0xff);
- header[30] = (byte)((byterate >> 16) & 0xff);
- header[31] = (byte)((byterate >> 24) & 0xff);
- // Block alignment (UInt16).
- header[32] = (byte)((blockalign) & 0xff);
- header[33] = (byte)((blockalign >> 8) & 0xff);
- // Bits per sample (UInt16).
- header[34] = (byte)((bitspersample) & 0xff);
- header[35] = (byte)((bitspersample >> 8) & 0xff);
- // Data header
- header[36] = 'd';
- header[37] = 'a';
- header[38] = 't';
- header[39] = 'a';
- // Total audio length (UInt32).
- header[40] = (byte)((audiolength) & 0xff);
- header[41] = (byte)((audiolength >> 8) & 0xff);
- header[42] = (byte)((audiolength >> 16) & 0xff);
- header[43] = (byte)((audiolength >> 24) & 0xff);
-
- stream.write(header, 0, header.length);
- }
-
- /** Updates the data length and audio length of an existing RIFF/WAVE header in the file pointed by the RandomAccessFile object. */
- private void updateWaveHeaderLength(RandomAccessFile stream, long audiolength) throws IOException {
- // the data header is 36 bytes large
- long datalength = 36 + audiolength;
-
- // Seek from the beginning to data length
- stream.seek(4);
- // Overwrite total data length
- stream.write((int)((datalength) & 0xff));
- stream.write((int)((datalength >> 8) & 0xff));
- stream.write((int)((datalength >> 16) & 0xff));
- stream.write((int)((datalength >> 24) & 0xff));
- // Seek from the end of data length to audio length
- stream.seek(40);
- // overwrite total audio length
- stream.write((int)((audiolength) & 0xff));
- stream.write((int)((audiolength >> 8) & 0xff));
- stream.write((int)((audiolength >> 16) & 0xff));
- stream.write((int)((audiolength >> 24) & 0xff));
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java
deleted file mode 100644
index 05838d727..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java
+++ /dev/null
@@ -1,485 +0,0 @@
-package com.smartdevicelink.managers.file;
-
-import android.content.Context;
-import android.net.Uri;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.managers.file.filetypes.SdlFile;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.ListFiles;
-import com.smartdevicelink.proxy.rpc.ListFilesResponse;
-import com.smartdevicelink.proxy.rpc.PutFile;
-import com.smartdevicelink.proxy.rpc.PutFileResponse;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
-import com.smartdevicelink.test.Test;
-
-import junit.framework.Assert;
-
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-
-/**
- * This is a unit test class for the SmartDeviceLink library manager class :
- * {@link FileManager}
- */
-public class FileManagerTests extends AndroidTestCase2 {
- public static final String TAG = "FileManagerTests";
- private FileManager fileManager;
- private Context mTestContext;
- private SdlFile validFile;
-
- // SETUP / HELPERS
-
- @Override
- public void setUp() throws Exception{
- super.setUp();
- mTestContext = this.getContext();
- validFile = new SdlFile();
- validFile.setName(Test.GENERAL_STRING);
- validFile.setFileData(Test.GENERAL_BYTE_ARRAY);
- validFile.setPersistent(false);
- }
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- private Answer<Void> onListFilesSuccess = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- RPCRequest message = (RPCRequest) args[0];
- if(message instanceof ListFiles){
- int correlationId = message.getCorrelationID();
- ListFilesResponse listFilesResponse = new ListFilesResponse();
- listFilesResponse.setFilenames(Test.GENERAL_STRING_LIST);
- listFilesResponse.setSpaceAvailable(Test.GENERAL_INT);
- listFilesResponse.setSuccess(true);
- message.getOnRPCResponseListener().onResponse(correlationId, listFilesResponse);
- }
- return null;
- }
- };
-
- private Answer<Void> onListFilesFailure = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- RPCRequest message = (RPCRequest) args[0];
- if(message instanceof ListFiles){
- int correlationId = message.getCorrelationID();
- ListFilesResponse listFilesResponse = new ListFilesResponse();
- listFilesResponse.setSuccess(false);
- message.getOnRPCResponseListener().onResponse(correlationId, listFilesResponse);
- }
- return null;
- }
- };
-
- private Answer<Void> onPutFileSuccess = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- RPCRequest message = (RPCRequest) args[0];
- if(message instanceof PutFile){
- int correlationId = message.getCorrelationID();
- PutFileResponse putFileResponse = new PutFileResponse();
- putFileResponse.setSuccess(true);
- message.getOnRPCResponseListener().onResponse(correlationId, putFileResponse);
- }
- return null;
- }
- };
-
- private Answer<Void> onPutFileFailure = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- RPCRequest message = (RPCRequest) args[0];
- if(message instanceof PutFile){
- int correlationId = message.getCorrelationID();
- PutFileResponse putFileResponse = new PutFileResponse();
- putFileResponse.setSuccess(false);
- message.getOnRPCResponseListener().onResponse(correlationId, putFileResponse);
- }
- return null;
- }
- };
-
- private Answer<Void> onSendRequestsSuccess = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- List<RPCRequest> rpcs = (List<RPCRequest>) args[0];
- OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
- if(rpcs.get(0) instanceof PutFile){
- for(RPCRequest message : rpcs){
- int correlationId = message.getCorrelationID();
- listener.addCorrelationId(correlationId);
- PutFileResponse putFileResponse = new PutFileResponse();
- putFileResponse.setSuccess(true);
- listener.onResponse(correlationId, putFileResponse);
- }
- }
- return null;
- }
- };
-
- // TESTS
-
- public void testInitializationSuccess(){
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- Assert.assertEquals(fileManager.getState(), BaseSubManager.READY);
- assertEquals(fileManager.getRemoteFileNames(), Test.GENERAL_STRING_LIST);
- }
- });
- }
-
- public void testInitializationFailure(){
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesFailure).when(internalInterface).sendRPCRequest(any(ListFiles.class));
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertFalse(success);
- assertEquals(fileManager.getState(), BaseSubManager.ERROR);
- }
- });
- }
-
- public void testFileUploadSuccess(){
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
- doAnswer(onPutFileSuccess).when(internalInterface).sendRPCRequest(any(PutFile.class));
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- fileManager.uploadFile(validFile, new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- assertTrue(fileManager.getRemoteFileNames().contains(validFile.getName()));
- assertTrue(fileManager.hasUploadedFile(validFile));
- }
- });
- }
- });
- }
-
- public void testFileUploadFailure(){
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
- doAnswer(onPutFileFailure).when(internalInterface).sendRPCRequest(any(PutFile.class));
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- fileManager.uploadFile(validFile, new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertFalse(success);
- assertFalse(fileManager.getRemoteFileNames().contains(validFile.getName()));
- assertFalse(fileManager.hasUploadedFile(validFile));
- }
- });
- }
- });
- }
-
- public void testInvalidSdlFileInput(){
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- SdlFile sdlFile = new SdlFile();
- // Don't set name
- sdlFile.setFileData(Test.GENERAL_BYTE_ARRAY);
- checkForUploadFailure(fileManager, sdlFile);
-
- sdlFile = new SdlFile();
- sdlFile.setName(Test.GENERAL_STRING);
- // Don't set data
- checkForUploadFailure(fileManager, sdlFile);
-
- sdlFile = new SdlFile();
- sdlFile.setName(Test.GENERAL_STRING);
- // Give an invalid resource ID
- sdlFile.setResourceId(Test.GENERAL_INT);
- checkForUploadFailure(fileManager, sdlFile);
-
- sdlFile = new SdlFile();
- sdlFile.setName(Test.GENERAL_STRING);
- // Set invalid Uri
- Uri testUri = Uri.parse("http://www.google.com");
- sdlFile.setUri(testUri);
- checkForUploadFailure(fileManager, sdlFile);
- }
- });
- }
-
- private void checkForUploadFailure(FileManager fileManager, SdlFile sdlFile){
- boolean error = false;
-
- try {
- fileManager.uploadFile(sdlFile, new CompletionListener() {
- @Override
- public void onComplete(boolean success) {}
- });
- }catch (IllegalArgumentException e){
- error = true;
- }
-
- assertTrue(error);
- }
-
- public void testInvalidSdlArtworkInput(){
- SdlArtwork sdlArtwork = new SdlArtwork();
- // Set invalid type
- for(FileType fileType : FileType.values()){
- boolean shouldError = true, didError = false;
- if(fileType.equals(FileType.GRAPHIC_BMP) || fileType.equals(FileType.GRAPHIC_PNG)
- || fileType.equals(FileType.GRAPHIC_JPEG)){
- shouldError = false;
- }
- try{
- sdlArtwork.setType(fileType);
- }catch(IllegalArgumentException e){
- didError = true;
- }
- assertEquals(shouldError, didError);
- }
- }
-
- public void testMultipleFileUploadThenDeleteSuccess(){
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
- doAnswer(onSendRequestsSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- int fileNum = 1;
- final List<SdlFile> filesToUpload = new ArrayList<>();
- SdlFile sdlFile = new SdlFile();
- sdlFile.setName("file" + fileNum++);
- Uri uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
- sdlFile.setUri(uri);
- filesToUpload.add(sdlFile);
-
- sdlFile = new SdlFile();
- sdlFile.setName("file" + fileNum++);
- sdlFile.setResourceId(com.smartdevicelink.test.R.drawable.ic_sdl);
- filesToUpload.add(sdlFile);
-
- fileManager.uploadFiles(filesToUpload,
- new MultipleFileCompletionListener() {
- @Override
- public void onComplete(Map<String, String> errors) {
- assertNull(errors);
- List <String> uploadedFileNames = fileManager.getRemoteFileNames();
- for(SdlFile file : filesToUpload){
- assertTrue(uploadedFileNames.contains(file.getName()));
- }
- fileManager.deleteRemoteFilesWithNames(uploadedFileNames, new MultipleFileCompletionListener() {
- @Override
- public void onComplete(Map<String, String> errors) {
- assertNull(errors);
- List <String> uploadedFileNames = fileManager.getRemoteFileNames();
- for(SdlFile file : filesToUpload){
- assertFalse(uploadedFileNames.contains(file.getName()));
- }
- }
- });
- }
- });
- }
- });
- }
-
- public void testMultipleFileUploadPartialFailure(){
- final String failureReason = "No space available";
-
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
-
- Answer<Void> onSendRequestsFailure = new Answer<Void>() {
- private int responseNum = 0;
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- List<RPCRequest> rpcs = (List<RPCRequest>) args[0];
- OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
- if(rpcs.get(0) instanceof PutFile){
- for(RPCRequest message : rpcs){
- int correlationId = message.getCorrelationID();
- listener.addCorrelationId(correlationId);
- PutFileResponse putFileResponse = new PutFileResponse();
- if(responseNum++ % 2 == 0){
- listener.onError(correlationId, Result.OUT_OF_MEMORY, failureReason);
- }else{
- putFileResponse.setSuccess(true);
- listener.onResponse(correlationId, putFileResponse);
- }
- }
- }
- return null;
- }
- };
- doAnswer(onSendRequestsFailure).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- final String baseFileName = "file";
- int fileNum = 0;
- final List<SdlFile> filesToUpload = new ArrayList<>();
- SdlFile sdlFile = new SdlFile();
- sdlFile.setName(baseFileName + fileNum++);
- Uri uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
- sdlFile.setUri(uri);
- filesToUpload.add(sdlFile);
-
- sdlFile = new SdlFile();
- sdlFile.setName(baseFileName + fileNum++);
- sdlFile.setResourceId(com.smartdevicelink.test.R.drawable.ic_sdl);
- filesToUpload.add(sdlFile);
-
- sdlFile = new SdlFile();
- sdlFile.setName(baseFileName + fileNum++);
- sdlFile.setFileData(Test.GENERAL_BYTE_ARRAY);
- sdlFile.setPersistent(true);
- sdlFile.setType(FileType.BINARY);
- filesToUpload.add(sdlFile);
-
- fileManager.uploadFiles(filesToUpload,
- new MultipleFileCompletionListener() {
- @Override
- public void onComplete(Map<String, String> errors) {
- assertNotNull(errors);
- for(int i = 0; i < filesToUpload.size(); i++){
- if(i % 2 == 0){
- assertTrue(errors.containsKey(filesToUpload.get(i).getName()));
- assertEquals(FileManager.buildErrorString(Result.OUT_OF_MEMORY,
- failureReason), errors.get(filesToUpload.get(i).getName()));
- }else{
- assertFalse(errors.containsKey(filesToUpload.get(i).getName()));
- }
- }
- List <String> uploadedFileNames = fileManager.getRemoteFileNames();
- for(int i = 0; i < filesToUpload.size(); i++){
- if(i % 2 == 0){
- assertFalse(uploadedFileNames.contains(filesToUpload.get(i).getName()));
- }else{
- assertTrue(uploadedFileNames.contains(filesToUpload.get(i).getName()));
- }
- }
- }
- });
- }
- });
- }
-
- public void testMultipleArtworkUploadSuccess(){
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
- doAnswer(onSendRequestsSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- int fileNum = 1;
- final List<SdlArtwork> artworkToUpload = new ArrayList<>();
- SdlArtwork sdlArtwork = new SdlArtwork();
- sdlArtwork.setName("art" + fileNum++);
- Uri uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
- sdlArtwork.setUri(uri);
- sdlArtwork.setType(FileType.GRAPHIC_PNG);
- artworkToUpload.add(sdlArtwork);
-
- sdlArtwork = new SdlArtwork();
- sdlArtwork.setName("art" + fileNum++);
- uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/sdl_tray_icon");
- sdlArtwork.setUri(uri);
- sdlArtwork.setType(FileType.GRAPHIC_PNG);
- artworkToUpload.add(sdlArtwork);
-
- fileManager.uploadFiles(artworkToUpload,
- new MultipleFileCompletionListener() {
- @Override
- public void onComplete(Map<String, String> errors) {
- assertNull(errors);
- List < String > uploadedFileNames = fileManager.getRemoteFileNames();
- for(SdlArtwork artwork : artworkToUpload){
- assertTrue(uploadedFileNames.contains(artwork.getName()));
- }
- }
- });
- }
- });
- }
-
- public void testPersistentFileUploaded(){
- ISdl internalInterface = mock(ISdl.class);
-
- doAnswer(onListFilesSuccess).when(internalInterface).sendRPCRequest(any(ListFiles.class));
-
- final SdlFile file = new SdlFile();
- file.setName(Test.GENERAL_STRING_LIST.get(0));
- file.setPersistent(true);
-
- final FileManager fileManager = new FileManager(internalInterface, mTestContext);
- fileManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(fileManager.hasUploadedFile(file));
- }
- });
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java
deleted file mode 100644
index 8c0c1e9c0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.MetadataType;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static org.mockito.Mockito.mock;
-
-/**
- * This is a unit test class for the SmartDeviceLink library manager class :
- * {@link ScreenManager}
- */
-public class ScreenManagerTests extends AndroidTestCase2 {
- private ScreenManager screenManager;
- private SdlArtwork testArtwork;
-
- @Override
- public void setUp() throws Exception{
- super.setUp();
-
- ISdl internalInterface = mock(ISdl.class);
- FileManager fileManager = mock(FileManager.class);
- screenManager = new ScreenManager(internalInterface, fileManager);
-
-
- testArtwork = new SdlArtwork("testFile", FileType.GRAPHIC_PNG, 1, false);
- }
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testInstantiation(){
- assertNull(screenManager.getTextField1());
- assertNull(screenManager.getTextField2());
- assertNull(screenManager.getTextField3());
- assertNull(screenManager.getTextField4());
- assertNull(screenManager.getMediaTrackTextField());
- assertNull(screenManager.getPrimaryGraphic());
- assertNull(screenManager.getSecondaryGraphic());
- assertEquals(screenManager.getTextAlignment(), TextAlignment.CENTERED);
- assertNull(screenManager.getTextField1Type());
- assertNull(screenManager.getTextField2Type());
- assertNull(screenManager.getTextField3Type());
- assertNull(screenManager.getTextField4Type());
- assertTrue(screenManager.getSoftButtonObjects().isEmpty());
- assertNull(screenManager.getSoftButtonObjectByName("test"));
- assertNull(screenManager.getSoftButtonObjectById(1));
- assertEquals(screenManager.getState(), BaseSubManager.READY);
- }
-
- public void testSetTextField() {
- screenManager.setTextField1("It is");
- screenManager.setTextField2("Wednesday");
- screenManager.setTextField3("My");
- screenManager.setTextField4("Dudes");
- assertEquals(screenManager.getTextField1(), "It is");
- assertEquals(screenManager.getTextField2(), "Wednesday");
- assertEquals(screenManager.getTextField3(), "My");
- assertEquals(screenManager.getTextField4(), "Dudes");
- }
-
- public void testMediaTrackTextFields() {
- String songTitle = "Wild For The Night";
- screenManager.setMediaTrackTextField(songTitle);
- assertEquals(screenManager.getMediaTrackTextField(), songTitle);
- }
-
- public void testSetPrimaryGraphic() {
- screenManager.setPrimaryGraphic(testArtwork);
- assertEquals(screenManager.getPrimaryGraphic(), testArtwork);
- }
-
- public void testSetSecondaryGraphic() {
- screenManager.setSecondaryGraphic(testArtwork);
- assertEquals(screenManager.getSecondaryGraphic(), testArtwork);
- }
-
- public void testAlignment() {
- screenManager.setTextAlignment(TextAlignment.LEFT_ALIGNED);
- assertEquals(screenManager.getTextAlignment(), TextAlignment.LEFT_ALIGNED);
- }
-
- public void testSetTextFieldTypes() {
- screenManager.setTextField1Type(MetadataType.MEDIA_TITLE);
- screenManager.setTextField2Type(MetadataType.MEDIA_ALBUM);
- screenManager.setTextField3Type(MetadataType.MEDIA_ARTIST);
- screenManager.setTextField4Type(MetadataType.MEDIA_GENRE);
- assertEquals(screenManager.getTextField1Type(), MetadataType.MEDIA_TITLE);
- assertEquals(screenManager.getTextField2Type(), MetadataType.MEDIA_ALBUM);
- assertEquals(screenManager.getTextField3Type(), MetadataType.MEDIA_ARTIST);
- assertEquals(screenManager.getTextField4Type(), MetadataType.MEDIA_GENRE);
- }
-
- public void testSetSoftButtonObjects(){
- // Create softButtonObject1
- SoftButtonState softButtonState1 = new SoftButtonState("object1-state1", "it is", testArtwork);
- SoftButtonState softButtonState2 = new SoftButtonState("object1-state2", "Wed", testArtwork);
- SoftButtonObject softButtonObject1 = new SoftButtonObject("object1", Arrays.asList(softButtonState1, softButtonState2), softButtonState1.getName(),null);
-
- // Create softButtonObject2
- SoftButtonState softButtonState3 = new SoftButtonState("object2-state1", "my", testArtwork);
- SoftButtonState softButtonState4 = new SoftButtonState("object2-state2", "dudes!", null);
- SoftButtonObject softButtonObject2 = new SoftButtonObject("object2", Arrays.asList(softButtonState3, softButtonState4), softButtonState3.getName(), null);
-
- List<SoftButtonObject> softButtonObjects = Arrays.asList(softButtonObject1, softButtonObject2);
- screenManager.setSoftButtonObjects(Arrays.asList(softButtonObject1, softButtonObject2));
- assertEquals(screenManager.getSoftButtonObjects(), softButtonObjects);
- assertEquals(screenManager.getSoftButtonObjectByName("object2"), softButtonObject2);
- assertEquals(screenManager.getSoftButtonObjectById(100), softButtonObject2);
- }
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java
deleted file mode 100644
index 3198bc116..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java
+++ /dev/null
@@ -1,239 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
-import com.smartdevicelink.test.Validator;
-
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-
-/**
- * This is a unit test class for the SmartDeviceLink library manager class :
- * {@link SoftButtonManager}
- */
-public class SoftButtonManagerTests extends AndroidTestCase2 {
-
- private SoftButtonManager softButtonManager;
- private boolean fileManagerUploadArtworksGotCalled;
- private boolean internalInterfaceSendRPCRequestGotCalled;
- private boolean softButtonMangerUpdateCompleted;
- private SoftButtonObject softButtonObject1, softButtonObject2;
- private SoftButtonState softButtonState1, softButtonState2, softButtonState3, softButtonState4;
-
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
-
- // When internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, OnRPCNotificationListener) is called
- // inside SoftButtonManager, respond with a fake HMILevel.HMI_FULL response to let the SoftButtonManager continue working.
- ISdl internalInterface = mock(ISdl.class);
- Answer<Void> onHMIStatusAnswer = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- OnRPCNotificationListener onHMIStatusListener = (OnRPCNotificationListener) args[1];
- OnHMIStatus onHMIStatusFakeNotification = new OnHMIStatus();
- onHMIStatusFakeNotification.setHmiLevel(HMILevel.HMI_FULL);
- onHMIStatusListener.onNotified(onHMIStatusFakeNotification);
- return null;
- }
- };
- doAnswer(onHMIStatusAnswer).when(internalInterface).addOnRPCNotificationListener(eq(FunctionID.ON_HMI_STATUS), any(OnRPCNotificationListener.class));
-
-
- // When fileManager.uploadArtworks() is called inside the SoftButtonManager, respond with
- // a fake onComplete() callback to let the SoftButtonManager continue working.
- FileManager fileManager = mock(FileManager.class);
- Answer<Void> onFileManagerUploadAnswer = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- fileManagerUploadArtworksGotCalled = true;
- Object[] args = invocation.getArguments();
- MultipleFileCompletionListener multipleFileCompletionListener = (MultipleFileCompletionListener) args[1];
- multipleFileCompletionListener.onComplete(null);
- return null;
- }
- };
- doAnswer(onFileManagerUploadAnswer).when(fileManager).uploadArtworks(any(List.class), any(MultipleFileCompletionListener.class));
-
-
- // Create softButtonManager
- softButtonManager = new SoftButtonManager(internalInterface, fileManager);
-
-
- // When internalInterface.sendRPCRequest() is called inside SoftButtonManager:
- // 1) respond with a fake onResponse() callback to let the SoftButtonManager continue working
- // 2) assert that the Show RPC values (ie: MainField1 & SoftButtons) that are created by the SoftButtonManager, match the ones that are provided by the developer
- Answer<Void> onSendShowRPCAnswer = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- internalInterfaceSendRPCRequestGotCalled = true;
- Object[] args = invocation.getArguments();
- Show show = (Show) args[0];
-
- show.getOnRPCResponseListener().onResponse(0, null);
-
- assertEquals(show.getMainField1(), softButtonManager.getCurrentMainField1());
- assertEquals(show.getSoftButtons().size(), softButtonManager.createSoftButtonsForCurrentState().size());
-
- return null;
- }
- };
- doAnswer(onSendShowRPCAnswer).when(internalInterface).sendRPCRequest(any(Show.class));
-
-
- // Create soft button objects
- softButtonState1 = new SoftButtonState("object1-state1", "o1s1", new SdlArtwork("image1", FileType.GRAPHIC_PNG, 1, true));
- softButtonState2 = new SoftButtonState("object1-state2", "o1s2", new SdlArtwork("image2", FileType.GRAPHIC_PNG, 2, true));
- softButtonObject1 = new SoftButtonObject("object1", Arrays.asList(softButtonState1, softButtonState2), softButtonState1.getName(), null);
- softButtonState3 = new SoftButtonState("object2-state1", "o2s1", null);
- softButtonState4 = new SoftButtonState("object2-state2", "o2s2", new SdlArtwork("image3", FileType.GRAPHIC_PNG, 3, true));
- softButtonObject2 = new SoftButtonObject("object2", Arrays.asList(softButtonState3, softButtonState4), softButtonState3.getName(), null);
- }
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testSoftButtonManagerUpdate() {
- // Reset the boolean variables
- fileManagerUploadArtworksGotCalled = false;
- internalInterfaceSendRPCRequestGotCalled = false;
- softButtonMangerUpdateCompleted = false;
-
-
- // Test batch update
- softButtonManager.setBatchUpdates(true);
- List<SoftButtonObject> softButtonObjects = Arrays.asList(softButtonObject1, softButtonObject2);
- softButtonManager.setSoftButtonObjects(Arrays.asList(softButtonObject1, softButtonObject2));
- softButtonManager.setBatchUpdates(false);
- softButtonManager.update(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- softButtonMangerUpdateCompleted = true;
- }
- });
-
-
- // Test single update, setCurrentMainField1, and transitionToNextState
- softButtonManager.setCurrentMainField1("It is Wednesday my dudes!");
- softButtonObject1.transitionToNextState();
-
-
- // Check that everything got called as expected
- assertTrue("FileManager.uploadArtworks() did not get called", fileManagerUploadArtworksGotCalled);
- assertTrue("InternalInterface.sendRPCRequest() did not get called", internalInterfaceSendRPCRequestGotCalled);
- assertTrue("SoftButtonManger update onComplete() did not get called", softButtonMangerUpdateCompleted);
-
-
- // Test getSoftButtonObjects
- assertEquals("Returned softButtonObjects value doesn't match the expected value", softButtonObjects, softButtonManager.getSoftButtonObjects());
- }
-
- public void testSoftButtonManagerGetSoftButtonObject() {
- softButtonManager.setSoftButtonObjects(Arrays.asList(softButtonObject1, softButtonObject2));
-
-
- // Test get by valid name
- assertEquals("Returned SoftButtonObject doesn't match the expected value", softButtonObject2, softButtonManager.getSoftButtonObjectByName("object2"));
-
-
- // Test get by invalid name
- assertNull("Returned SoftButtonObject doesn't match the expected value", softButtonManager.getSoftButtonObjectByName("object300"));
-
-
- // Test get by valid id
- assertEquals("Returned SoftButtonObject doesn't match the expected value", softButtonObject2, softButtonManager.getSoftButtonObjectById(100));
-
-
- // Test get by invalid id
- assertNull("Returned SoftButtonObject doesn't match the expected value", softButtonManager.getSoftButtonObjectById(500));
- }
-
- public void testSoftButtonState(){
- // Test SoftButtonState.getName()
- String nameExpectedValue = "object1-state1";
- assertEquals("Returned state name doesn't match the expected value", nameExpectedValue, softButtonState1.getName());
-
-
- // Test SoftButtonState.getArtwork()
- SdlArtwork artworkExpectedValue = new SdlArtwork("image1", FileType.GRAPHIC_PNG, 1, true);
- assertTrue("Returned SdlArtwork doesn't match the expected value", Validator.validateSdlFile(artworkExpectedValue, softButtonState1.getArtwork()));
-
-
- // Test SoftButtonState.getSoftButton()
- SoftButton softButtonExpectedValue = new SoftButton(SoftButtonType.SBT_BOTH, 0);
- softButtonExpectedValue.setText("o1s1");
- softButtonExpectedValue.setImage(new Image(artworkExpectedValue.getName(), ImageType.DYNAMIC));
- assertTrue("Returned SoftButton doesn't match the expected value", Validator.validateSoftButton(softButtonExpectedValue, softButtonState1.getSoftButton()));
- }
-
- public void testSoftButtonObject(){
- // Test SoftButtonObject.getName()
- assertEquals("Returned object name doesn't match the expected value", "object1", softButtonObject1.getName());
-
-
- // Test SoftButtonObject.getCurrentState()
- assertEquals("Returned current state doesn't match the expected value", softButtonState1, softButtonObject1.getCurrentState());
-
-
- // Test SoftButtonObject.getCurrentStateName()
- assertEquals("Returned current state name doesn't match the expected value", softButtonState1.getName(), softButtonObject1.getCurrentStateName());
-
-
- // Test SoftButtonObject.getButtonId()
- assertEquals("Returned button Id doesn't match the expected value", 0, softButtonObject1.getButtonId());
-
-
- // Test SoftButtonObject.getCurrentStateSoftButton()
- SoftButton softButtonExpectedValue = new SoftButton(SoftButtonType.SBT_TEXT, 0);
- softButtonExpectedValue.setText("o2s1");
- assertTrue("Returned current state SoftButton doesn't match the expected value", Validator.validateSoftButton(softButtonExpectedValue, softButtonObject2.getCurrentStateSoftButton()));
-
-
- // Test SoftButtonObject.getStates()
- assertEquals("Returned object states doesn't match the expected value", Arrays.asList(softButtonState1, softButtonState2), softButtonObject1.getStates());
-
-
- // Test SoftButtonObject.transitionToNextState()
- assertEquals(softButtonState1, softButtonObject1.getCurrentState());
- softButtonObject1.transitionToNextState();
- assertEquals(softButtonState2, softButtonObject1.getCurrentState());
-
-
- // Test SoftButtonObject.transitionToStateByName() - transitioning to a none existing state
- boolean success = softButtonObject1.transitionToStateByName("none existing name");
- assertFalse(success);
-
-
- // Test SoftButtonObject.transitionToStateByName() - transitioning to an existing state
- success = softButtonObject1.transitionToStateByName("object1-state1");
- assertTrue(success);
- assertEquals(softButtonState1, softButtonObject1.getCurrentState());
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java
deleted file mode 100644
index aaad2df24..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java
+++ /dev/null
@@ -1,545 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-import android.content.Context;
-import android.net.Uri;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.MetadataTags;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.TextField;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.MetadataType;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
-
-import org.json.JSONException;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.mockito.Mockito.mock;
-
-/**
- * This is a unit test class for the SmartDeviceLink library manager class :
- * {@link com.smartdevicelink.managers.screen.TextAndGraphicManager}
- */
-public class TextAndGraphicManagerTests extends AndroidTestCase2 {
-
- // SETUP / HELPERS
- private TextAndGraphicManager textAndGraphicManager;
- private SdlArtwork testArtwork;
-
- @Override
- public void setUp() throws Exception{
- super.setUp();
- Context mTestContext = this.getContext();
- // mock things
- ISdl internalInterface = mock(ISdl.class);
- FileManager fileManager = mock(FileManager.class);
- SoftButtonManager softButtonManager = mock(SoftButtonManager.class);
-
- testArtwork = new SdlArtwork();
- testArtwork.setName("testFile");
- Uri uri = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
- testArtwork.setUri(uri);
- testArtwork.setType(FileType.GRAPHIC_PNG);
-
- textAndGraphicManager = new TextAndGraphicManager(internalInterface, fileManager, softButtonManager);
- }
-
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- private DisplayCapabilities getDisplayCapability(int numberOfMainFields){
-
- TextField mainField1 = new TextField();
- mainField1.setName(TextFieldName.mainField1);
- TextField mainField2 = new TextField();
- mainField2.setName(TextFieldName.mainField2);
- TextField mainField3 = new TextField();
- mainField3.setName(TextFieldName.mainField3);
- TextField mainField4 = new TextField();
- mainField4.setName(TextFieldName.mainField4);
-
- List<TextField> textFieldList = new ArrayList<>();
-
- textFieldList.add(mainField1);
- textFieldList.add(mainField2);
- textFieldList.add(mainField3);
- textFieldList.add(mainField4);
-
- List<TextField> returnList = new ArrayList<>();
-
- if (numberOfMainFields > 0){
- for (int i = 0; i < numberOfMainFields; i++) {
- returnList.add(textFieldList.get(i));
- }
- }
-
- DisplayCapabilities displayCapabilities = new DisplayCapabilities();
- displayCapabilities.setTextFields(returnList);
-
- return displayCapabilities;
- }
-
- public void testInstantiation(){
-
- assertNull(textAndGraphicManager.getTextField1());
- assertNull(textAndGraphicManager.getTextField2());
- assertNull(textAndGraphicManager.getTextField3());
- assertNull(textAndGraphicManager.getTextField4());
- assertNull(textAndGraphicManager.getMediaTrackTextField());
- assertNull(textAndGraphicManager.getPrimaryGraphic());
- assertNull(textAndGraphicManager.getSecondaryGraphic());
- assertEquals(textAndGraphicManager.getTextAlignment(), TextAlignment.CENTERED);
- assertNull(textAndGraphicManager.getTextField1Type());
- assertNull(textAndGraphicManager.getTextField2Type());
- assertNull(textAndGraphicManager.getTextField3Type());
- assertNull(textAndGraphicManager.getTextField4Type());
-
- assertNotNull(textAndGraphicManager.currentScreenData);
- assertNull(textAndGraphicManager.inProgressUpdate);
- assertNull(textAndGraphicManager.queuedImageUpdate);
- assertFalse(textAndGraphicManager.hasQueuedUpdate);
- assertNull(textAndGraphicManager.displayCapabilities);
- assertEquals(textAndGraphicManager.currentHMILevel, HMILevel.HMI_NONE);
- assertFalse(textAndGraphicManager.isDirty);
- assertEquals(textAndGraphicManager.getState(), BaseSubManager.SETTING_UP);
- }
-
- public void testGetMainLines(){
-
- // We want to test that the looping works. By default, it will return 4 if display cap is null
-
- // Null test
- assertEquals(textAndGraphicManager.getNumberOfLines(), 4);
-
- // The tests.java class has an example of this, but we must build it to do what
- // we need it to do. Build display cap w/ 3 main fields and test that it returns 3
- textAndGraphicManager.displayCapabilities = getDisplayCapability(3);
- assertEquals(textAndGraphicManager.getNumberOfLines(), 3);
- }
-
- public void testAssemble1Line(){
-
- Show inputShow = new Show();
-
- // Force it to return display with support for only 1 line of text
- textAndGraphicManager.displayCapabilities = getDisplayCapability(1);
-
- textAndGraphicManager.setTextField1("It is");
- textAndGraphicManager.setTextField1Type(MetadataType.HUMIDITY);
-
- Show assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
-
- // test tags (just 1)
- MetadataTags tags = assembledShow.getMetadataTags();
- List<MetadataType> tagsList = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- assertEquals(tags.getMainField1(), tagsList);
-
- textAndGraphicManager.setTextField2("Wednesday");
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is - Wednesday");
-
- textAndGraphicManager.setTextField3("My");
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is - Wednesday - My");
-
- textAndGraphicManager.setTextField4("Dudes");
- textAndGraphicManager.setTextField4Type(MetadataType.CURRENT_TEMPERATURE);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is - Wednesday - My - Dudes");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList.add(MetadataType.CURRENT_TEMPERATURE);
- assertEquals(tags.getMainField1(), tagsList);
-
- // For some obscurity, lets try setting just fields 2 and 4 for a 1 line display
- textAndGraphicManager.setTextField1(null);
- textAndGraphicManager.setTextField3(null);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "Wednesday - Dudes");
- }
-
- public void testAssemble2Lines() {
-
- Show inputShow = new Show();
-
- // Force it to return display with support for only 2 lines of text
- textAndGraphicManager.displayCapabilities = getDisplayCapability(2);
-
- textAndGraphicManager.setTextField1("It is");
- textAndGraphicManager.setTextField1Type(MetadataType.HUMIDITY);
-
- Show assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
-
- // test tags
- MetadataTags tags = assembledShow.getMetadataTags();
- List<MetadataType> tagsList = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- assertEquals(tags.getMainField1(), tagsList);
-
- textAndGraphicManager.setTextField2("Wednesday");
- textAndGraphicManager.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "Wednesday");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- List<MetadataType> tagsList2 = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
-
- textAndGraphicManager.setTextField3("My");
- textAndGraphicManager.setTextField3Type(MetadataType.MEDIA_ALBUM);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is - Wednesday");
- assertEquals(assembledShow.getMainField2(), "My");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList2 = new ArrayList<>();
- tagsList.add(MetadataType.CURRENT_TEMPERATURE);
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.MEDIA_ALBUM);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
-
- textAndGraphicManager.setTextField4("Dudes");
- textAndGraphicManager.setTextField4Type(MetadataType.MEDIA_STATION);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is - Wednesday");
- assertEquals(assembledShow.getMainField2(), "My - Dudes");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList2 = new ArrayList<>();
- tagsList.add(MetadataType.CURRENT_TEMPERATURE);
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.MEDIA_STATION);
- tagsList2.add(MetadataType.MEDIA_ALBUM);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
-
- // For some obscurity, lets try setting just fields 2 and 4 for a 2 line display
- textAndGraphicManager.setTextField1(null);
- textAndGraphicManager.setTextField3(null);
- textAndGraphicManager.setTextField1Type(null);
- textAndGraphicManager.setTextField3Type(null);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "Wednesday");
- assertEquals(assembledShow.getMainField2(), "Dudes");
-
- // And 3 fields without setting 1
- textAndGraphicManager.setTextField3("My");
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "Wednesday");
- assertEquals(assembledShow.getMainField2(), "My - Dudes");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList2 = new ArrayList<>();
- tagsList.add(MetadataType.CURRENT_TEMPERATURE);
- tagsList2.add(MetadataType.MEDIA_STATION);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
- }
-
- public void testAssemble3Lines() {
-
- Show inputShow = new Show();
-
- // Force it to return display with support for only 3 lines of text
- textAndGraphicManager.displayCapabilities = getDisplayCapability(3);
-
- textAndGraphicManager.setTextField1("It is");
- textAndGraphicManager.setTextField1Type(MetadataType.HUMIDITY);
-
- Show assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "");
- assertEquals(assembledShow.getMainField3(), "");
-
- // test tags
- MetadataTags tags = assembledShow.getMetadataTags();
- List<MetadataType> tagsList = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- assertEquals(tags.getMainField1(), tagsList);
-
- textAndGraphicManager.setTextField2("Wednesday");
- textAndGraphicManager.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "Wednesday");
- assertEquals(assembledShow.getMainField3(), "");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- List<MetadataType> tagsList2 = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
-
- textAndGraphicManager.setTextField3("My");
- textAndGraphicManager.setTextField3Type(MetadataType.MEDIA_ALBUM);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "Wednesday");
- assertEquals(assembledShow.getMainField3(), "My");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList2 = new ArrayList<>();
- List<MetadataType> tagsList3 = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
- tagsList3.add(MetadataType.MEDIA_ALBUM);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
- assertEquals(tags.getMainField3(), tagsList3);
-
- textAndGraphicManager.setTextField4("Dudes");
- textAndGraphicManager.setTextField4Type(MetadataType.MEDIA_STATION);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "Wednesday");
- assertEquals(assembledShow.getMainField3(), "My - Dudes");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList2 = new ArrayList<>();
- tagsList3 = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
- tagsList3.add(MetadataType.MEDIA_ALBUM);
- tagsList3.add(MetadataType.MEDIA_STATION);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
- assertEquals(tags.getMainField3(), tagsList3);
-
- // Someone might not want to set the fields in order? We should handle that
- textAndGraphicManager.setTextField1(null);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- try {
- System.out.println(assembledShow.serializeJSON().toString());
- } catch (JSONException e) {
- e.printStackTrace();
- }
-
- assertEquals(assembledShow.getMainField2(), "Wednesday");
- assertEquals(assembledShow.getMainField3(), "My - Dudes");
- }
-
- public void testAssemble4Lines() {
-
- Show inputShow = new Show();
-
- // Force it to return display with support for only 4 lines of text
- textAndGraphicManager.displayCapabilities = getDisplayCapability(4);
-
- textAndGraphicManager.setTextField1("It is");
- textAndGraphicManager.setTextField1Type(MetadataType.HUMIDITY);
-
- Show assembledShow = textAndGraphicManager.assembleShowText(inputShow);
-
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "");
- assertEquals(assembledShow.getMainField3(), "");
- assertEquals(assembledShow.getMainField4(), "");
-
- // test tags
- MetadataTags tags = assembledShow.getMetadataTags();
- List<MetadataType> tagsList = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- assertEquals(tags.getMainField1(), tagsList);
-
- textAndGraphicManager.setTextField2("Wednesday");
- textAndGraphicManager.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "Wednesday");
- assertEquals(assembledShow.getMainField3(), "");
- assertEquals(assembledShow.getMainField4(), "");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- List<MetadataType> tagsList2 = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
-
- textAndGraphicManager.setTextField3("My");
- textAndGraphicManager.setTextField3Type(MetadataType.MEDIA_ALBUM);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "Wednesday");
- assertEquals(assembledShow.getMainField3(), "My");
- assertEquals(assembledShow.getMainField4(), "");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList2 = new ArrayList<>();
- List<MetadataType> tagsList3 = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
- tagsList3.add(MetadataType.MEDIA_ALBUM);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
- assertEquals(tags.getMainField3(), tagsList3);
-
- textAndGraphicManager.setTextField4("Dudes");
- textAndGraphicManager.setTextField4Type(MetadataType.MEDIA_STATION);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "Wednesday");
- assertEquals(assembledShow.getMainField3(), "My");
- assertEquals(assembledShow.getMainField4(), "Dudes");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList2 = new ArrayList<>();
- tagsList3 = new ArrayList<>();
- List<MetadataType> tagsList4 = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList2.add(MetadataType.CURRENT_TEMPERATURE);
- tagsList3.add(MetadataType.MEDIA_ALBUM);
- tagsList4.add(MetadataType.MEDIA_STATION);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField2(), tagsList2);
- assertEquals(tags.getMainField3(), tagsList3);
- assertEquals(tags.getMainField4(), tagsList4);
-
- // try just setting line 1 and 4
- textAndGraphicManager.setTextField2(null);
- textAndGraphicManager.setTextField3(null);
- textAndGraphicManager.setTextField2Type(null);
- textAndGraphicManager.setTextField3Type(null);
-
- assembledShow = textAndGraphicManager.assembleShowText(inputShow);
- assertEquals(assembledShow.getMainField1(), "It is");
- assertEquals(assembledShow.getMainField2(), "");
- assertEquals(assembledShow.getMainField3(), "");
- assertEquals(assembledShow.getMainField4(), "Dudes");
-
- // test tags
- tags = assembledShow.getMetadataTags();
- tagsList = new ArrayList<>();
- tagsList4 = new ArrayList<>();
- tagsList.add(MetadataType.HUMIDITY);
- tagsList4.add(MetadataType.MEDIA_STATION);
- assertEquals(tags.getMainField1(), tagsList);
- assertEquals(tags.getMainField4(), tagsList4);
- }
-
- public void testMediaTrackTextField() {
-
- String songTitle = "Wild For The Night";
- textAndGraphicManager.setMediaTrackTextField(songTitle);
- assertEquals(textAndGraphicManager.getMediaTrackTextField(), songTitle);
- }
-
- public void testAlignment() {
-
- textAndGraphicManager.setTextAlignment(TextAlignment.LEFT_ALIGNED);
- assertEquals(textAndGraphicManager.getTextAlignment(), TextAlignment.LEFT_ALIGNED);
- }
-
- public void testExtractTextFromShow(){
-
- Show mainShow = new Show();
- mainShow.setMainField1("test");
- mainShow.setMainField3("Sauce");
- mainShow.setMainField4("");
-
- Show newShow = textAndGraphicManager.extractTextFromShow(mainShow);
-
- assertEquals(newShow.getMainField1(), "test");
- assertEquals(newShow.getMainField3(), "Sauce");
- assertEquals(newShow.getMainField4(), "");
- assertNull(newShow.getMainField2());
- }
-
- // TEST IMAGES
-
- public void testSetPrimaryGraphic() {
- textAndGraphicManager.setPrimaryGraphic(testArtwork);
- assertEquals(textAndGraphicManager.getPrimaryGraphic(), testArtwork);
- }
-
- public void testSetSecondaryGraphic() {
- textAndGraphicManager.setSecondaryGraphic(testArtwork);
- assertEquals(textAndGraphicManager.getSecondaryGraphic(), testArtwork);
- }
-
- // TEST DISPOSE
-
- public void testDispose() {
- textAndGraphicManager.dispose();
-
- assertNull(textAndGraphicManager.getTextField1());
- assertNull(textAndGraphicManager.getTextField2());
- assertNull(textAndGraphicManager.getTextField3());
- assertNull(textAndGraphicManager.getTextField4());
- assertNull(textAndGraphicManager.getMediaTrackTextField());
- assertNull(textAndGraphicManager.getPrimaryGraphic());
- assertNull(textAndGraphicManager.getSecondaryGraphic());
- assertNull(textAndGraphicManager.getTextAlignment());
- assertNull(textAndGraphicManager.getTextField1Type());
- assertNull(textAndGraphicManager.getTextField2Type());
- assertNull(textAndGraphicManager.getTextField3Type());
- assertNull(textAndGraphicManager.getTextField4Type());
- assertNull(textAndGraphicManager.getBlankArtwork());
- assertNull(textAndGraphicManager.currentScreenData);
- assertNull(textAndGraphicManager.inProgressUpdate);
- assertNull(textAndGraphicManager.queuedImageUpdate);
- assertFalse(textAndGraphicManager.hasQueuedUpdate);
- assertNull(textAndGraphicManager.displayCapabilities);
- assertFalse(textAndGraphicManager.isDirty);
- assertEquals(textAndGraphicManager.getState(), BaseSubManager.SHUTDOWN);
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java
deleted file mode 100644
index e0febdb51..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java
+++ /dev/null
@@ -1,282 +0,0 @@
-package com.smartdevicelink.managers.video;
-
-import android.content.Context;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.view.Display;
-import android.view.MotionEvent;
-import android.view.View;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.managers.CompletionListener;
-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.Collections;
-import java.util.HashSet;
-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 VideoStreamManager}
- */
-public class VideoStreamManagerTests extends AndroidTestCase2 {
- public static final String TAG = "VideoStreamManagerTests";
- 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);
- when(internalInterface.getProtocolVersion()).thenReturn(new Version(5,1,0));
-
- 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));
-
- VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
- videoStreamManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- }
- });
- }
-
- public void testHMILevelNotFull(){
- ISdl internalInterface = mock(ISdl.class);
-
- when(internalInterface.getProtocolVersion()).thenReturn((new Version(5,0,0)));
- when(internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
-
- final VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
- videoStreamManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertNull(videoStreamManager.startVideoService(
- new VideoStreamingParameters(), false));
- }
- });
- }
-
- public void testRemoteDisplayStream(){
- ISdl internalInterface = mock(ISdl.class);
-
- final Set<Object> listenerSet = new HashSet<>();
-
- when(internalInterface.getProtocolVersion()).thenReturn(new Version(5,0,0));
- 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 VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
- videoStreamManager.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);
-
- videoStreamManager.startRemoteDisplayStream(mTestContext, TestPresentation.class, null, false);
-
- //assertTrue(touchEventOccured);
-
- videoStreamManager.dispose();
- assertTrue(listenerSet.isEmpty());
- }
- });
-
- }
-
- public void testConvertTouchEvent(){
- ISdl internalInterface = mock(ISdl.class);
- when(internalInterface.getProtocolVersion()).thenReturn(new Version(5,1,0));
-
- final VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
- videoStreamManager.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 = videoStreamManager.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 = videoStreamManager.convertTouchEvent(testOnTouchEvent);
- assertEquals(motionEvent.getAction(), MotionEvent.ACTION_POINTER_DOWN);
-
- // Release one of the pointers (101)
- testOnTouchEvent.setType(TouchType.END);
- motionEvent = videoStreamManager.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 = videoStreamManager.convertTouchEvent(testOnTouchEvent);
- assertEquals(motionEvent.getAction(), MotionEvent.ACTION_UP);
- }
- });
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java
deleted file mode 100644
index a9bc03bb0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlPacketTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import com.livio.BSON.BsonEncoder;
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.protocol.enums.ControlFrameTags;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class SdlPacketTests extends AndroidTestCase2 {
- //TODO: Add tests to cover other parts of SdlPacket class
-
- // Test variables
- private final int TEST_HASH_ID = 65537;
- private final String TEST_PROTOCOL_VERSION = "5.0.0";
- private final Long TEST_MTU = (long) 131072;
-
- // Test payload from core representing hashId and mtu size
- private byte[] corePayload = hexStringToByteArray("39000000" +
- "10" +
- "68617368496400" +
- "01000100" +
- "126d747500" +
- "000002" + "0000000000" + "02" +
- "70726f746f636f6c56657273" +
- "696f6e0006000000352e302e300000");
-
- public void testNull(){
- byte[] testPayload = hexStringToByteArray(
- "16000000" +
- "02" +
- "68656c6c6f" +"00" + // hello
- "06000000" + "776f726c64" + "00" + //world
- "00");
- String tag = "hello";
-
- SdlPacket sdlPacket = new SdlPacket();
- assertNull(sdlPacket.getTag(tag));
- sdlPacket.setPayload(testPayload);
- assertEquals(sdlPacket.getTag("hello"),"world");
- }
-
- public void testBsonDecoding(){
- SdlPacket sdlPacket = new SdlPacket();
- sdlPacket.setPayload(corePayload);
- assertEquals(sdlPacket.getTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID), TEST_HASH_ID);
- assertEquals(sdlPacket.getTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION), TEST_PROTOCOL_VERSION);
- assertEquals(sdlPacket.getTag(ControlFrameTags.RPC.StartServiceACK.MTU), TEST_MTU);
- }
-
- public void testBsonEncoding(){
- HashMap<String, Object> testMap = new HashMap<>();
- testMap.put(ControlFrameTags.RPC.StartServiceACK.HASH_ID, TEST_HASH_ID);
- testMap.put(ControlFrameTags.RPC.StartServiceACK.MTU, TEST_MTU);
- testMap.put(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION, TEST_PROTOCOL_VERSION);
-
- byte[] observed = BsonEncoder.encodeToBytes(testMap);
- assertEquals(observed.length, corePayload.length);
- for(int i = 0; i < observed.length; i++){
- assertEquals(observed[i], corePayload[i]);
- }
- }
-
- // Helper method for converting String to Byte Array
- private static byte[] hexStringToByteArray(String s) {
- int len = s.length();
- byte[] data = new byte[len / 2];
- for (int i = 0; i < len; i += 2) {
- data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
- + Character.digit(s.charAt(i+1), 16));
- }
- return data;
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java
deleted file mode 100644
index 675ecb4f2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java
+++ /dev/null
@@ -1,372 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import android.util.Log;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.SdlConnection.SdlConnection;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.protocol.SdlProtocol.MessageFrameAssembler;
-import com.smartdevicelink.security.SdlSecurityBase;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-import com.smartdevicelink.test.SampleRpc;
-import com.smartdevicelink.test.SdlUnitTestContants;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.RouterServiceValidator;
-
-import junit.framework.Assert;
-
-import java.io.ByteArrayOutputStream;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import static org.mockito.Mockito.mock;
-
-public class SdlProtocolTests extends AndroidTestCase2 {
-
- int max_int = 2147483647;
- byte[] payload;
- MultiplexTransportConfig config;
- SdlProtocol protocol;
-
- ISdlProtocol defaultListener = mock(ISdlProtocol.class);
-
- public static class DidReceiveListener implements ISdlProtocol{
- boolean didReceive = false;
-
- public void reset(){
- didReceive = false;
- }
- public boolean didReceive(){
- return didReceive;
- }
- @Override
- public void onProtocolMessageBytesToSend(SdlPacket packet) {}
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
- didReceive = true;
- Log.d("DidReceiveListener", "RPC Type: " + msg.getRPCType());
- Log.d("DidReceiveListener", "Function Id: " + msg.getFunctionID());
- Log.d("DidReceiveListener", "JSON Size: " + msg.getJsonSize());
- }
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,byte sessionID, byte version, String correlationID, int hashID,boolean isEncrypted){}
- @Override
- public void onProtocolSessionNACKed(SessionType sessionType,byte sessionID, byte version, String correlationID, List<String> rejectedParams) {}
- @Override
- public void onProtocolSessionEnded(SessionType sessionType,byte sessionID, String correlationID) {}
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,byte sessionID, String correlationID) {}
- @Override
- public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {}
- @Override
- public void onProtocolHeartbeatACK(SessionType sessionType,byte sessionID) {}
- @Override
- public void onProtocolServiceDataACK(SessionType sessionType,int dataSize, byte sessionID) {}
- @Override
- public void onResetOutgoingHeartbeat(SessionType sessionType,byte sessionID) {}
- @Override
- public void onResetIncomingHeartbeat(SessionType sessionType,byte sessionID) {}
- @Override
- public void onProtocolError(String info, Exception e) {}
- @Override
- public byte getSessionId() {return 0;}
- @Override
- public void shutdown(String info) {}
- @Override
- public void onTransportDisconnected(String info, boolean altTransportAvailable, MultiplexTransportConfig transportConfig) {}
- @Override
- public SdlSecurityBase getSdlSecurity() {return null;}
- @Override
- public VideoStreamingParameters getDesiredVideoParams() {return null; }
- @Override
- public void setAcceptedVideoParams(VideoStreamingParameters acceptedVideoParams) {}
- @Override
- public void stopStream(SessionType serviceType) {}
- };
-
- DidReceiveListener onProtocolMessageReceivedListener = new DidReceiveListener();
-
-
- public void setUp(){
- config = new MultiplexTransportConfig(this.mContext, SdlUnitTestContants.TEST_APP_ID);
- protocol = new SdlProtocol(defaultListener,config);
- }
-
-
- public void testBase(){
- SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
-
- }
-
- public void testVersion(){
- SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
-
- sdlProtocol.setVersion((byte)0x01);
- assertEquals((byte)0x01,sdlProtocol.getProtocolVersion().getMajor());
-
- sdlProtocol = new SdlProtocol(defaultListener,config);
- sdlProtocol.setVersion((byte)0x02);
- assertEquals((byte)0x02,sdlProtocol.getProtocolVersion().getMajor());
-
- sdlProtocol = new SdlProtocol(defaultListener,config);
- sdlProtocol.setVersion((byte)0x03);
- assertEquals((byte)0x03,sdlProtocol.getProtocolVersion().getMajor());
-
- sdlProtocol = new SdlProtocol(defaultListener,config);
- sdlProtocol.setVersion((byte)0x04);
- assertEquals((byte)0x04,sdlProtocol.getProtocolVersion().getMajor());
-
- sdlProtocol = new SdlProtocol(defaultListener,config);
- sdlProtocol.setVersion((byte)0x05);
- assertEquals((byte)0x05,sdlProtocol.getProtocolVersion().getMajor());
-
- //If we get newer than 5, it should fall back to 5
- sdlProtocol = new SdlProtocol(defaultListener,config);
- sdlProtocol.setVersion((byte)0x06);
- assertEquals((byte)0x05,sdlProtocol.getProtocolVersion().getMajor());
-
- //Is this right?
- sdlProtocol = new SdlProtocol(defaultListener,config);
- sdlProtocol.setVersion((byte)0x00);
- assertEquals((byte)0x01,sdlProtocol.getProtocolVersion().getMajor());
- }
-
- public void testMtu(){
- SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
-
- sdlProtocol.setVersion((byte)0x01);
-
- try{
- assertEquals(sdlProtocol.getMtu(), 1500-8);
-
- //Version 2
- sdlProtocol.setVersion((byte)0x02);
- assertEquals(sdlProtocol.getMtu(), 1500-12);
-
- //Version 3
- sdlProtocol.setVersion((byte)0x03);
- assertEquals(sdlProtocol.getMtu(), 131072);
-
- //Version 4
- sdlProtocol.setVersion((byte)0x04);
- assertEquals(sdlProtocol.getMtu(), 131072);
-
- //Version 5
- sdlProtocol.setVersion((byte)0x05);
- assertEquals(sdlProtocol.getMtu(), 131072);
-
- //Version 5+
- sdlProtocol.setVersion((byte)0x06);
- assertEquals(sdlProtocol.getMtu(), 131072);
-
- }catch(Exception e){
- Assert.fail("Exceptin during reflection");
- }
-
- }
-
- public void testHandleFrame(){
- SampleRpc sampleRpc = new SampleRpc(4);
- SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
- MessageFrameAssembler assembler = sdlProtocol.new MessageFrameAssembler();
- try{
- assembler.handleFrame(sampleRpc.toSdlPacket());
- }catch(Exception e){
- Assert.fail("Exceptin during handleFrame - " + e.toString());
- }
- }
- public void testHandleFrameCorrupt(){
- SampleRpc sampleRpc = new SampleRpc(4);
- BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
- header.setJsonSize(Integer.MAX_VALUE);
- sampleRpc.setBinaryFrameHeader(header);
- SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
- MessageFrameAssembler assembler = sdlProtocol.new MessageFrameAssembler();
- try{
- assembler.handleFrame(sampleRpc.toSdlPacket());
- }catch(Exception e){
- Assert.fail("Exceptin during handleFrame - " + e.toString());
- }
- }
-
- public void testHandleSingleFrameMessageFrame(){
- SampleRpc sampleRpc = new SampleRpc(4);
- SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
- MessageFrameAssembler assembler = sdlProtocol.new MessageFrameAssembler();
-
-
- try{
- Method method = assembler.getClass().getDeclaredMethod ("handleSingleFrameMessageFrame", SdlPacket.class);
- method.setAccessible(true);
- method.invoke (assembler, sampleRpc.toSdlPacket());
- }catch(Exception e){
- Assert.fail("Exceptin during handleSingleFrameMessageFrame - " + e.toString());
- }
- }
-
- public void testHandleSingleFrameMessageFrameCorruptBfh(){
- SampleRpc sampleRpc = new SampleRpc(4);
-
- //Create a corrupted header
- BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
- header.setJsonSize(5);
- header.setJsonData(new byte[5]);
- header.setJsonSize(Integer.MAX_VALUE);
- sampleRpc.setBinaryFrameHeader(header);
-
- SdlPacket packet = sampleRpc.toSdlPacket();
-
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.parseBinaryHeader(packet.payload);
- assertNull(binFrameHeader);
-
- SdlProtocol sdlProtocol = new SdlProtocol(defaultListener,config);
-
-
- sdlProtocol.handlePacketReceived(packet);
- assertFalse(onProtocolMessageReceivedListener.didReceive());
-
- onProtocolMessageReceivedListener.reset();
- SdlProtocol.MessageFrameAssembler assembler =sdlProtocol.getFrameAssemblerForFrame(packet);// sdlProtocol.new MessageFrameAssembler();
- assertNotNull(assembler);
- assembler.handleFrame(packet);
- assertFalse(onProtocolMessageReceivedListener.didReceive());
-
- try{
- Method method = assembler.getClass().getDeclaredMethod("handleSingleFrameMessageFrame", SdlPacket.class);
- method.setAccessible(true);
- method.invoke (assembler, sampleRpc.toSdlPacket());
- }catch(Exception e){
- Assert.fail("Exceptin during handleSingleFrameMessageFrame - " + e.toString());
- }
- }
-
-
-
-
-
- public void testNormalCase(){
- setUp();
- payload = new byte[]{0x00,0x02,0x05,0x01,0x01,0x01,0x05,0x00};
- byte sessionID = 1, version = 1;
- int messageID = 1;
- boolean encrypted = false;
- SdlPacket sdlPacket = SdlPacketFactory.createMultiSendDataFirst(SessionType.RPC, sessionID, messageID, version, payload, encrypted);
- MessageFrameAssembler assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
-
- assertNotNull(assembler);
-
- OutOfMemoryError oom_error = null;
- NullPointerException np_exception = null;
- try{
- assembler.handleMultiFrameMessageFrame(sdlPacket);
- }catch(OutOfMemoryError e){
- oom_error = e;
- }catch(NullPointerException z){
- np_exception = z;
- }catch(Exception e){
- e.printStackTrace();
- assertNotNull(null);
- }
-
- assertNull(np_exception);
- assertNull(oom_error);
-
- payload = new byte[23534];
- sdlPacket = SdlPacketFactory.createMultiSendDataRest(SessionType.RPC, sessionID, payload.length, (byte) 3, messageID, version, payload, 0, 1500, encrypted);
- assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
- try{
- assembler.handleMultiFrameMessageFrame(sdlPacket);
- }catch(OutOfMemoryError e){
- oom_error = e;
- }catch(NullPointerException z){
- np_exception = z;
- }catch(Exception e){
- assertNotNull(null);
- }
-
- assertNull(np_exception);
- assertNull(oom_error);
- }
-
- public void testOverallocatingAccumulator(){
- setUp();
- ByteArrayOutputStream builder = new ByteArrayOutputStream();
- for(int i = 0; i < 8; i++){
- builder.write(0x0F);
- }
- payload = builder.toByteArray();
- byte sessionID = 1, version = 1;
- int messageID = 1;
- boolean encrypted = false;
- SdlPacket sdlPacket = SdlPacketFactory.createMultiSendDataFirst(SessionType.RPC, sessionID, messageID, version, payload, encrypted);
- MessageFrameAssembler assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
-
- OutOfMemoryError oom_error = null;
- NullPointerException np_exception = null;
- try{
- assembler.handleMultiFrameMessageFrame(sdlPacket);
- }catch(OutOfMemoryError e){
- oom_error = e;
- }catch(NullPointerException z){
- np_exception = z;
- }catch(Exception e){
- assertNotNull(null);
- }
-
- assertNull(np_exception);
- assertNull(oom_error);
-
- payload = new byte[23534];
- sdlPacket = SdlPacketFactory.createMultiSendDataRest(SessionType.RPC, sessionID, payload.length, (byte) 3, messageID, version, payload, 0, 1500, encrypted);
- assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
-
- try{
- assembler.handleMultiFrameMessageFrame(sdlPacket);
- }catch(OutOfMemoryError e){
- oom_error = e;
- }catch(NullPointerException z){
- np_exception = z;
- }catch(Exception e){
- assertNotNull(null);
- }
-
- assertNull(np_exception);
- assertNull(oom_error);
-
- }
-
- protected class SdlConnectionTestClass extends SdlConnection {
- protected boolean connected = false;
- public SdlConnectionTestClass(BaseTransportConfig transportConfig) {
- super(transportConfig);
- }
-
- protected SdlConnectionTestClass(BaseTransportConfig transportConfig,RouterServiceValidator rsvp){
- super(transportConfig,rsvp);
- }
-
- @Override
- public void onTransportConnected() {
- super.onTransportConnected();
- connected = true;
- }
-
- @Override
- public void onTransportDisconnected(String info) {
- connected = false;
- //Grab a currently running router service
- RouterServiceValidator rsvp2 = new RouterServiceValidator(mContext);
- rsvp2.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE);
- assertTrue(rsvp2.validate());
- assertNotNull(rsvp2.getService());
- super.onTransportDisconnected(info);
- }
-
- @Override
- public void onTransportError(String info, Exception e) {
- connected = false;
- super.onTransportError(info, e);
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/WiProProtocolTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/WiProProtocolTests.java
deleted file mode 100644
index bec4a6d92..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/WiProProtocolTests.java
+++ /dev/null
@@ -1,385 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import android.os.Bundle;
-import android.util.Log;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.SdlConnection.SdlConnection;
-import com.smartdevicelink.protocol.WiProProtocol.MessageFrameAssembler;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.test.SampleRpc;
-import com.smartdevicelink.test.SdlUnitTestContants;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.RouterServiceValidator;
-import com.smartdevicelink.transport.enums.TransportType;
-
-import junit.framework.Assert;
-
-import java.io.ByteArrayOutputStream;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.protocol.BinaryFrameHeader}
- */
-public class WiProProtocolTests extends AndroidTestCase2 {
-
- int max_int = 2147483647;
- byte[] payload;
- MultiplexTransportConfig config;
- SdlConnectionTestClass connection;
- WiProProtocol protocol;
-
- IProtocolListener defaultListener = new IProtocolListener(){
- @Override
- public void onProtocolMessageBytesToSend(SdlPacket packet) {}
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {}
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,byte sessionID, byte version, String correlationID, int hashID,boolean isEncrypted){}
- @Override
- public void onProtocolSessionNACKed(SessionType sessionType,byte sessionID, byte version, String correlationID, List<String> rejectedParams) {}
- @Override
- public void onProtocolSessionEnded(SessionType sessionType,byte sessionID, String correlationID) {}
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,byte sessionID, String correlationID) {}
- @Override
- public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {}
- @Override
- public void onProtocolHeartbeatACK(SessionType sessionType,byte sessionID) {}
- @Override
- public void onProtocolServiceDataACK(SessionType sessionType,int dataSize, byte sessionID) {}
- @Override
- public void onResetOutgoingHeartbeat(SessionType sessionType,byte sessionID) {}
- @Override
- public void onResetIncomingHeartbeat(SessionType sessionType,byte sessionID) {}
- @Override
- public void onProtocolError(String info, Exception e) {}
-
- };
- public static class DidReceiveListener implements IProtocolListener{
- boolean didReceive = false;
-
- public void reset(){
- didReceive = false;
- }
- public boolean didReceive(){
- return didReceive;
- }
- @Override
- public void onProtocolMessageBytesToSend(SdlPacket packet) {}
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
- didReceive = true;
- Log.d("DidReceiveListener", "RPC Type: " + msg.getRPCType());
- Log.d("DidReceiveListener", "Function Id: " + msg.getFunctionID());
- Log.d("DidReceiveListener", "JSON Size: " + msg.getJsonSize());
- }
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,byte sessionID, byte version, String correlationID, int hashID,boolean isEncrypted){}
- @Override
- public void onProtocolSessionNACKed(SessionType sessionType,byte sessionID, byte version, String correlationID, List<String> rejectedParams) {}
- @Override
- public void onProtocolSessionEnded(SessionType sessionType,byte sessionID, String correlationID) {}
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,byte sessionID, String correlationID) {}
- @Override
- public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {}
- @Override
- public void onProtocolHeartbeatACK(SessionType sessionType,byte sessionID) {}
- @Override
- public void onProtocolServiceDataACK(SessionType sessionType,int dataSize, byte sessionID) {}
- @Override
- public void onResetOutgoingHeartbeat(SessionType sessionType,byte sessionID) {}
- @Override
- public void onResetIncomingHeartbeat(SessionType sessionType,byte sessionID) {}
- @Override
- public void onProtocolError(String info, Exception e) {}
- };
- DidReceiveListener onProtocolMessageReceivedListener = new DidReceiveListener();
-
- public void testBase(){
- WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
-
- }
-
- public void testVersion(){
- WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
-
- wiProProtocol.setVersion((byte)0x01);
- assertEquals((byte)0x01,wiProProtocol.getVersion());
-
- wiProProtocol = new WiProProtocol(defaultListener);
- wiProProtocol.setVersion((byte)0x02);
- assertEquals((byte)0x02,wiProProtocol.getVersion());
-
- wiProProtocol = new WiProProtocol(defaultListener);
- wiProProtocol.setVersion((byte)0x03);
- assertEquals((byte)0x03,wiProProtocol.getVersion());
-
- wiProProtocol = new WiProProtocol(defaultListener);
- wiProProtocol.setVersion((byte)0x04);
- assertEquals((byte)0x04,wiProProtocol.getVersion());
-
- wiProProtocol = new WiProProtocol(defaultListener);
- wiProProtocol.setVersion((byte)0x05);
- assertEquals((byte)0x05,wiProProtocol.getVersion());
-
- //If we get newer than 5, it should fall back to 5
- wiProProtocol = new WiProProtocol(defaultListener);
- wiProProtocol.setVersion((byte)0x06);
- assertEquals((byte)0x05,wiProProtocol.getVersion());
-
- //Is this right?
- wiProProtocol = new WiProProtocol(defaultListener);
- wiProProtocol.setVersion((byte)0x00);
- assertEquals((byte)0x01,wiProProtocol.getVersion());
- }
-
- public void testMtu(){
- WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
-
- wiProProtocol.setVersion((byte)0x01);
-
- try{
- assertEquals(wiProProtocol.getMtu(), 1500-8);
-
- //Version 2
- wiProProtocol.setVersion((byte)0x02);
- assertEquals(wiProProtocol.getMtu(), 1500-12);
-
- //Version 3
- wiProProtocol.setVersion((byte)0x03);
- assertEquals(wiProProtocol.getMtu(), 131072);
-
- //Version 4
- wiProProtocol.setVersion((byte)0x04);
- assertEquals(wiProProtocol.getMtu(), 131072);
-
- //Version 5
- wiProProtocol.setVersion((byte)0x05);
- assertEquals(wiProProtocol.getMtu(), 131072);
-
- //Version 5+
- wiProProtocol.setVersion((byte)0x06);
- assertEquals(wiProProtocol.getMtu(), 131072);
-
- }catch(Exception e){
- Assert.fail("Exceptin during reflection");
- }
-
- }
-
- public void testHandleFrame(){
- SampleRpc sampleRpc = new SampleRpc(4);
- WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
- MessageFrameAssembler assembler = wiProProtocol.new MessageFrameAssembler();
- try{
- assembler.handleFrame(sampleRpc.toSdlPacket());
- }catch(Exception e){
- Assert.fail("Exceptin during handleFrame - " + e.toString());
- }
- }
- public void testHandleFrameCorrupt(){
- SampleRpc sampleRpc = new SampleRpc(4);
- BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
- header.setJsonSize(Integer.MAX_VALUE);
- sampleRpc.setBinaryFrameHeader(header);
- WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
- MessageFrameAssembler assembler = wiProProtocol.new MessageFrameAssembler();
- try{
- assembler.handleFrame(sampleRpc.toSdlPacket());
- }catch(Exception e){
- Assert.fail("Exceptin during handleFrame - " + e.toString());
- }
- }
-
- public void testHandleSingleFrameMessageFrame(){
- SampleRpc sampleRpc = new SampleRpc(4);
- WiProProtocol wiProProtocol = new WiProProtocol(defaultListener);
- MessageFrameAssembler assembler = wiProProtocol.new MessageFrameAssembler();
-
-
- try{
- Method method = assembler.getClass().getDeclaredMethod ("handleSingleFrameMessageFrame", SdlPacket.class);
- method.setAccessible(true);
- method.invoke (assembler, sampleRpc.toSdlPacket());
- }catch(Exception e){
- Assert.fail("Exceptin during handleSingleFrameMessageFrame - " + e.toString());
- }
- }
-
- public void testHandleSingleFrameMessageFrameCorruptBfh(){
- SampleRpc sampleRpc = new SampleRpc(4);
-
- //Create a corrupted header
- BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
- header.setJsonSize(5);
- header.setJsonData(new byte[5]);
- header.setJsonSize(Integer.MAX_VALUE);
- sampleRpc.setBinaryFrameHeader(header);
-
- SdlPacket packet = sampleRpc.toSdlPacket();
-
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.parseBinaryHeader(packet.payload);
- assertNull(binFrameHeader);
-
- WiProProtocol wiProProtocol = new WiProProtocol(onProtocolMessageReceivedListener);
-
-
- wiProProtocol.handlePacketReceived(packet);
- assertFalse(onProtocolMessageReceivedListener.didReceive());
-
- onProtocolMessageReceivedListener.reset();
- MessageFrameAssembler assembler =wiProProtocol.getFrameAssemblerForFrame(packet);// wiProProtocol.new MessageFrameAssembler();
- assertNotNull(assembler);
- assembler.handleFrame(packet);
- assertFalse(onProtocolMessageReceivedListener.didReceive());
-
- try{
- Method method = assembler.getClass().getDeclaredMethod("handleSingleFrameMessageFrame", SdlPacket.class);
- method.setAccessible(true);
- method.invoke (assembler, sampleRpc.toSdlPacket());
- }catch(Exception e){
- Assert.fail("Exceptin during handleSingleFrameMessageFrame - " + e.toString());
- }
- }
-
-
-
- public void setUp(){
- config = new MultiplexTransportConfig(this.mContext,SdlUnitTestContants.TEST_APP_ID);
- connection = new SdlConnectionTestClass(config, null);
- protocol = new WiProProtocol(connection);
- }
-
- public void testNormalCase(){
- setUp();
- payload = new byte[]{0x00,0x02,0x05,0x01,0x01,0x01,0x05,0x00};
- byte sessionID = 1, version = 1;
- int messageID = 1;
- boolean encrypted = false;
- SdlPacket sdlPacket = SdlPacketFactory.createMultiSendDataFirst(SessionType.RPC, sessionID, messageID, version, payload, encrypted);
- MessageFrameAssembler assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
-
- assertNotNull(assembler);
-
- OutOfMemoryError oom_error = null;
- NullPointerException np_exception = null;
- try{
- assembler.handleMultiFrameMessageFrame(sdlPacket);
- }catch(OutOfMemoryError e){
- oom_error = e;
- }catch(NullPointerException z){
- np_exception = z;
- }catch(Exception e){
- e.printStackTrace();
- assertNotNull(null);
- }
-
- assertNull(np_exception);
- assertNull(oom_error);
-
- payload = new byte[23534];
- sdlPacket = SdlPacketFactory.createMultiSendDataRest(SessionType.RPC, sessionID, payload.length, (byte) 3, messageID, version, payload, 0, 1500, encrypted);
- assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
- try{
- assembler.handleMultiFrameMessageFrame(sdlPacket);
- }catch(OutOfMemoryError e){
- oom_error = e;
- }catch(NullPointerException z){
- np_exception = z;
- }catch(Exception e){
- assertNotNull(null);
- }
-
- assertNull(np_exception);
- assertNull(oom_error);
- }
-
- public void testOverallocatingAccumulator(){
- setUp();
- ByteArrayOutputStream builder = new ByteArrayOutputStream();
- for(int i = 0; i < 8; i++){
- builder.write(0x0F);
- }
- payload = builder.toByteArray();
- byte sessionID = 1, version = 1;
- int messageID = 1;
- boolean encrypted = false;
- SdlPacket sdlPacket = SdlPacketFactory.createMultiSendDataFirst(SessionType.RPC, sessionID, messageID, version, payload, encrypted);
- MessageFrameAssembler assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
-
- OutOfMemoryError oom_error = null;
- NullPointerException np_exception = null;
- try{
- assembler.handleMultiFrameMessageFrame(sdlPacket);
- }catch(OutOfMemoryError e){
- oom_error = e;
- }catch(NullPointerException z){
- np_exception = z;
- }catch(Exception e){
- assertNotNull(null);
- }
-
- assertNull(np_exception);
- assertNull(oom_error);
-
- payload = new byte[23534];
- sdlPacket = SdlPacketFactory.createMultiSendDataRest(SessionType.RPC, sessionID, payload.length, (byte) 3, messageID, version, payload, 0, 1500, encrypted);
- assembler = protocol.getFrameAssemblerForFrame(sdlPacket);
-
- try{
- assembler.handleMultiFrameMessageFrame(sdlPacket);
- }catch(OutOfMemoryError e){
- oom_error = e;
- }catch(NullPointerException z){
- np_exception = z;
- }catch(Exception e){
- assertNotNull(null);
- }
-
- assertNull(np_exception);
- assertNull(oom_error);
-
- }
-
- protected class SdlConnectionTestClass extends SdlConnection{
- protected boolean connected = false;
- public SdlConnectionTestClass(BaseTransportConfig transportConfig) {
- super(transportConfig);
- }
-
- protected SdlConnectionTestClass(BaseTransportConfig transportConfig,RouterServiceValidator rsvp){
- super(transportConfig,rsvp);
- }
-
- @Override
- public void onTransportConnected() {
- super.onTransportConnected();
- connected = true;
- }
-
- @Override
- public void onTransportDisconnected(String info) {
- connected = false;
- //Grab a currently running router service
- RouterServiceValidator rsvp2 = new RouterServiceValidator(mContext);
- rsvp2.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE);
- assertTrue(rsvp2.validate());
- assertNotNull(rsvp2.getService());
- SdlConnectionTestClass.cachedMultiConfig.setService(rsvp2.getService());
- super.onTransportDisconnected(info);
- }
-
- @Override
- public void onTransportError(String info, Exception e) {
- connected = false;
- super.onTransportError(info, e);
- }
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java
deleted file mode 100644
index 8b9d5f3f7..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/BaseRpcTests.java
+++ /dev/null
@@ -1,194 +0,0 @@
-package com.smartdevicelink.test;
-
-import java.util.Iterator;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.RPCResponse;
-
-public abstract class BaseRpcTests extends AndroidTestCase2 {
-
- public static final int SDL_VERSION_UNDER_TEST = Config.SDL_VERSION_UNDER_TEST;
-
- private static final int CORR_ID = 402;
-
- protected RPCMessage msg;
-
- /**
- * Sets up the specific RPC message under testing.
- */
- protected abstract RPCMessage createMessage();
-
- /**
- * Retrieves the RPC message type under testing.
- */
- protected abstract String getMessageType();
-
- /**
- * Retrieves the RPC command type under testing.
- */
- protected abstract String getCommandType();
-
- /**
- * Retrieves the JSON translated RPC message under testing.
- */
- protected abstract JSONObject getExpectedParameters(int sdlVersion);
-
- @Override
- public void setUp(){
- this.msg = createMessage();
- if (msg instanceof RPCRequest) {
- ((RPCRequest) msg).setCorrelationID(CORR_ID);
- }
- else if (msg instanceof RPCResponse) {
- ((RPCResponse) msg).setCorrelationID(CORR_ID);
- }
-
- }
-
- public void testCreation(){
- assertNotNull("Object creation failed.", msg);
- }
-
- public void testCorrelationId(){
- int correlationId;
- if (msg instanceof RPCRequest) {
- correlationId = ((RPCRequest) msg).getCorrelationID();
- assertEquals("Correlation ID doesn't match expected ID.", CORR_ID, correlationId);
- }
- else if (msg instanceof RPCResponse) {
- correlationId = ((RPCResponse) msg).getCorrelationID();
- assertEquals("Correlation ID doesn't match expected ID.", CORR_ID, correlationId);
- }
-
- }
-
- public void testMessageType(){
- String messageType = msg.getMessageType();
-
- assertNotNull("Message type was null.", messageType);
- assertEquals("Message type was not REQUEST.", getMessageType(), messageType);
- }
-
- public void testCommandType(){
- String command = msg.getFunctionName();
-
- assertNotNull("Command was null.", command);
- assertEquals("Command type was not ADD_COMMAND", getCommandType(), command);
- }
-
-
- public void testFunctionName(){
- String funcName = msg.getFunctionName();
-
- assertNotNull("Function name was null.", funcName);
- assertEquals("Function name did not match expected name.", getCommandType(), funcName);
- }
-
- public void testJson(){
- try{
- JSONObject reference = buildJsonStore();
- JSONObject underTest = msg.serializeJSON();
-
- assertEquals("Size of JSON under test didn't match expected size.", reference.length(), underTest.length());
-
- // loop through all values and verifies they match the RPCMessage parameters
- Iterator<?> iterator = reference.keys();
- while(iterator.hasNext()){
- String key = (String) iterator.next();
- Object referenceValue = JsonUtils.readObjectFromJsonObject(reference, key);
- testJsonParameters((JSONObject) referenceValue, (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key));
- }
- }catch(JSONException e){
- // do nothing
- }
- }
-
- private JSONObject buildJsonStore() throws JSONException{
- JSONObject result = new JSONObject(), command = new JSONObject();
-
- if (!getMessageType().equals(RPCMessage.KEY_NOTIFICATION)) {
- command.put(RPCMessage.KEY_CORRELATION_ID, CORR_ID);
- }
- command.put(RPCMessage.KEY_FUNCTION_NAME, msg.getFunctionName());
- command.put(RPCMessage.KEY_PARAMETERS, getExpectedParameters(SDL_VERSION_UNDER_TEST));
-
- result.put(getMessageType(), command);
-
- return result;
- }
-
- private void testJsonParameters(JSONObject reference, JSONObject underTest) throws JSONException{
- assertEquals("Size of JSON under test didn't match expected size.", reference.length(), underTest.length());
-
- Iterator<?> iterator = reference.keys();
- while(iterator.hasNext()){
- String key = (String) iterator.next();
- Object referenceValue = JsonUtils.readObjectFromJsonObject(reference, key);
- if(referenceValue instanceof JSONObject){
- testJsonParameters((JSONObject) referenceValue, (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key));
- }
- else if(referenceValue instanceof JSONArray){
- JSONArray array1 = (JSONArray) referenceValue, array2 = (JSONArray) JsonUtils.readObjectFromJsonObject(underTest, key);
- testJsonArray(array1, array2, key);
- }
- else{
- assertTrue("JSON object didn't match reference object for key \"" + key + "\".", referenceValue.equals(JsonUtils.readObjectFromJsonObject(underTest, key)));
- }
- }
- }
-
- private void testJsonArray(JSONArray reference, JSONArray underTest, String key) throws JSONException{
- assertEquals("Size of JSON array didn't match expected size.", reference.length(), underTest.length());
- int len = reference.length();
- for(int i=0; i<len; i++){
- Object array1Obj = reference.get(i), array2Obj = underTest.get(i);
- if(array1Obj instanceof JSONObject){
- testJsonParameters((JSONObject) array1Obj, (JSONObject) array2Obj);
- }
- else if(array1Obj instanceof JSONArray){
- testJsonArray((JSONArray) array1Obj, (JSONArray) array2Obj, key);
- }
- else{
- assertTrue("JSONArray object didn't match reference object for key \"" + key + "\".", array1Obj.equals(array2Obj));
- }
- }
- }
-
- // this method must be manually called from the subclass
- protected void testNullBase(RPCMessage msg){
- assertNotNull("RPCMessage was null.", msg);
-
- Integer correlationId;
- if (msg instanceof RPCRequest) {
- correlationId = ((RPCRequest) msg).getCorrelationID();
- assertNotNull("Correlation ID of the RPC message was null.", correlationId);
- //assertEquals("Correlation ID didn't match expected correlation ID.", CORR_ID, (int) correlationId);
- }
- else if (msg instanceof RPCResponse) {
- correlationId = ((RPCResponse) msg).getCorrelationID();
- assertNull("Correlation ID of the RPC message was not null.", correlationId);
- //assertEquals("Correlation ID didn't match expected correlation ID.", CORR_ID, (int) correlationId);
- }
-
- assertNotNull("Message type of the RPC message was null.", msg.getMessageType());
-
- assertEquals("Message type didn't match expected message type.", getMessageType(), msg.getMessageType());
-
- assertNotNull("Command type of the RPC message was null.", msg.getMessageType());
- assertEquals("Command type didn't match expected command type.", getCommandType(), msg.getFunctionName());
-
-
- try{
- assertTrue("Parameters weren't initialized, but the JSON contained 2 or more objects.", (msg.serializeJSON().length() == 1));
- } catch(JSONException e) {
- //do nothing
- }
-
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/JsonUtils.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/JsonUtils.java
deleted file mode 100644
index 35ce94192..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/JsonUtils.java
+++ /dev/null
@@ -1,214 +0,0 @@
-package com.smartdevicelink.test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-
-public final class JsonUtils {
-
- private JsonUtils(){}
-
- public static JSONObject createJsonObject(byte[] data){
- JSONObject result = null;
- try {
- String jsonStr = new String(data);
- result = new JSONObject(jsonStr);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- return result;
- }
-
- public static JSONArray createJsonArrayOfJsonObjects(List<? extends RPCStruct> parameterList, int sdlVersion) throws JSONException{
- JSONArray result = new JSONArray();
-
- for(RPCStruct parameter : parameterList){
- //result.put(parameter.getJsonParameters(sdlVersion));
- result.put(parameter.serializeJSON());
- }
-
- return result;
- }
-
- public static JSONArray createJsonArrayOfJsonNames(List<? extends Enum<?>> parameterList, int sdlVersion) throws JSONException{
- JSONArray result = new JSONArray();
-
- for(Enum<?> name : parameterList){
- result.put(name);
- }
-
- return result;
- }
-
- public static <T> JSONArray createJsonArray(List<T> list) throws JSONException{
- JSONArray result = new JSONArray();
-
- for(T str : list){
- result.put(str);
- }
-
- return result;
- }
-
- // this method is basically to get around the annoying JSONException that is thrown when a key doesn't exist
- // in the JSON object. this method returns null instead of throwing an exception.
- public static Object readObjectFromJsonObject(JSONObject json, String key){
- try {
- return json.get(key);
- } catch (JSONException e) {
- return null;
- }
- }
-
- public static Boolean readBooleanFromJsonObject(JSONObject json, String key){
- try {
- return json.getBoolean(key);
- } catch (JSONException e) {
- return null;
- }
- }
-
- public static Double readDoubleFromJsonObject(JSONObject json, String key){
- try {
- return json.getDouble(key);
- } catch (JSONException e) {
- return null;
- }
- }
-
- public static Integer readIntegerFromJsonObject(JSONObject json, String key){
- try {
- return json.getInt(key);
- } catch (JSONException e) {
- return null;
- }
- }
-
- public static JSONArray readJsonArrayFromJsonObject(JSONObject json, String key){
- try {
- return json.getJSONArray(key);
- } catch (JSONException e) {
- return null;
- }
- }
-
- public static List<String> readStringListFromJsonObject(JSONObject json, String key){
- JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
-
- if(jsonArray != null){
- int len = jsonArray.length();
- List<String> result = new ArrayList<String>(len);
- for(int i=0; i<len; i++){
- try {
- String str = jsonArray.getString(i);
- result.add(str);
- } catch (JSONException e) {}
- }
- return result;
- }
-
- return null;
- }
-
- public static List<Integer> readIntegerListFromJsonObject(JSONObject json, String key){
- JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
-
- if(jsonArray != null){
- int len = jsonArray.length();
- List<Integer> result = new ArrayList<Integer>(len);
- for(int i=0; i<len; i++){
- try {
- Integer str = jsonArray.getInt(i);
- result.add(str);
- } catch (JSONException e) {}
- }
- return result;
- }
-
- return null;
- }
-
- public static List<Double> readDoubleListFromJsonObject(JSONObject json, String key){
- JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
-
- if(jsonArray != null){
- int len = jsonArray.length();
- List<Double> result = new ArrayList<Double>(len);
- for(int i=0; i<len; i++){
- try {
- Double str = jsonArray.getDouble(i);
- result.add(str);
- } catch (JSONException e) {}
- }
- return result;
- }
-
- return null;
- }
-
- public static List<Long> readLongListFromJsonObject(JSONObject json, String key){
- JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
-
- if(jsonArray != null){
- int len = jsonArray.length();
- List<Long> result = new ArrayList<Long>(len);
- for(int i=0; i<len; i++){
- try {
- Long str = jsonArray.getLong(i);
- result.add(str);
- } catch (JSONException e) {}
- }
- return result;
- }
-
- return null;
- }
-
- public static List<JSONObject> readJsonObjectListFromJsonObject(JSONObject json, String key){
- JSONArray jsonArray = readJsonArrayFromJsonObject(json, key);
-
- if(jsonArray != null){
- int len = jsonArray.length();
- List<JSONObject> result = new ArrayList<JSONObject>(len);
- for(int i=0; i<len; i++){
- try{
- JSONObject jsonObject = jsonArray.getJSONObject(i);
- result.add(jsonObject);
- } catch(JSONException e) {}
- }
- return result;
- }
-
- return null;
- }
-
- public static JSONObject readJsonObjectFromJsonObject(JSONObject json, String key){
- try {
- return json.getJSONObject(key);
- } catch (JSONException e) {
- return null;
- }
- }
-
- public static Long readLongFromJsonObject(JSONObject json, String key){
- try {
- return json.getLong(key);
- } catch (JSONException e) {
- return null;
- }
- }
-
- public static String readStringFromJsonObject(JSONObject json, String key){
- try {
- return json.getString(key);
- } catch (JSONException e) {
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java
deleted file mode 100644
index ec7bf710a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.smartdevicelink.test.SdlConnection;
-
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.TTSChunkFactory;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.TCPTransportConfig;
-
-import junit.framework.TestCase;
-
-import java.util.Vector;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.SdlConnection.SdlSession}
- */
-public class SdlSessionTests extends TestCase {
-
- public void testServiceListeners(){
- SdlSession session = SdlSession.createSession((byte)5,null, new TCPTransportConfig(8080,"",false));
- ISdlServiceListener test = new ISdlServiceListener() {
- @Override
- public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
-
- }
-
- @Override
- public void onServiceEnded(SdlSession session, SessionType type) {
-
- }
-
- @Override
- public void onServiceError(SdlSession session, SessionType type, String reason) {
-
- }
- };
-
- session.addServiceListener(SessionType.RPC, test);
-
- assertTrue(session.removeServiceListener(SessionType.RPC, test));
-
- assertFalse(session.removeServiceListener(SessionType.RPC, test));
-
- }
-
-
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java
deleted file mode 100644
index eaa7bf4c9..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java
+++ /dev/null
@@ -1,1053 +0,0 @@
-package com.smartdevicelink.test;
-
-import android.graphics.Color;
-import android.util.Log;
-
-import com.smartdevicelink.managers.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;
-import com.smartdevicelink.proxy.rpc.ClimateControlCapabilities;
-import com.smartdevicelink.proxy.rpc.ClimateControlData;
-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;
-import com.smartdevicelink.proxy.rpc.MenuParams;
-import com.smartdevicelink.proxy.rpc.MetadataTags;
-import com.smartdevicelink.proxy.rpc.ModuleData;
-import com.smartdevicelink.proxy.rpc.NavigationCapability;
-import com.smartdevicelink.proxy.rpc.OasisAddress;
-import com.smartdevicelink.proxy.rpc.ParameterPermissions;
-import com.smartdevicelink.proxy.rpc.PermissionItem;
-import com.smartdevicelink.proxy.rpc.PhoneCapability;
-import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
-import com.smartdevicelink.proxy.rpc.RGBColor;
-import com.smartdevicelink.proxy.rpc.RadioControlCapabilities;
-import com.smartdevicelink.proxy.rpc.RadioControlData;
-import com.smartdevicelink.proxy.rpc.RdsData;
-import com.smartdevicelink.proxy.rpc.Rectangle;
-import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities;
-import com.smartdevicelink.proxy.rpc.ScreenParams;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-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;
-import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
-import com.smartdevicelink.proxy.rpc.TextField;
-import com.smartdevicelink.proxy.rpc.TouchCoord;
-import com.smartdevicelink.proxy.rpc.TouchEvent;
-import com.smartdevicelink.proxy.rpc.TouchEventCapabilities;
-import com.smartdevicelink.proxy.rpc.Turn;
-import com.smartdevicelink.proxy.rpc.VehicleDataResult;
-import com.smartdevicelink.proxy.rpc.VehicleType;
-import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
-import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
-import com.smartdevicelink.proxy.rpc.VrHelpItem;
-import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator;
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
-import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
-import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
-import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
-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;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
-import com.smartdevicelink.proxy.rpc.enums.FuelType;
-import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
-import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
-import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
-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;
-import com.smartdevicelink.proxy.rpc.enums.MassageZone;
-import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
-import com.smartdevicelink.proxy.rpc.enums.MetadataType;
-import com.smartdevicelink.proxy.rpc.enums.ModuleType;
-import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
-import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
-import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
-import com.smartdevicelink.proxy.rpc.enums.RadioBand;
-import com.smartdevicelink.proxy.rpc.enums.RadioState;
-import com.smartdevicelink.proxy.rpc.enums.RequestType;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType;
-import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.SupportedSeat;
-import com.smartdevicelink.proxy.rpc.enums.SystemAction;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-import com.smartdevicelink.proxy.rpc.enums.SystemContext;
-import com.smartdevicelink.proxy.rpc.enums.TBTState;
-import com.smartdevicelink.proxy.rpc.enums.TPMS;
-import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
-import com.smartdevicelink.proxy.rpc.enums.TouchType;
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
-import com.smartdevicelink.proxy.rpc.enums.VentilationMode;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingState;
-import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
-import com.smartdevicelink.proxy.rpc.enums.WayPointType;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Vector;
-
-public class Test {
-
- // Test Failure Messages
- public static final String NULL = "Value should be null.";
- public static final String MATCH = "Values should match.";
- public static final String ARRAY = "Array values should match.";
- public static final String TRUE = "Value should be true.";
- public static final String FALSE = "Value should be false.";
- public static final String NOT_NULL = "Value should not be null.";
- public static final String JSON_FAIL = "Json testing failed.";
-
- // RPC Request/Response/Notification/Datatype Test Values
- public static final int GENERAL_INT = 100;
- public static final Integer GENERAL_INTEGER = 100;
- public static final Long GENERAL_LONG = 100L;
- public static final Turn GENERAL_TURN = new Turn();
- public static final Float GENERAL_FLOAT = 100f;
- public static final Image GENERAL_IMAGE = new Image();
- public static final Choice GENERAL_CHOICE = new Choice();
- public static final String GENERAL_STRING = "test";
- public static final Double GENERAL_DOUBLE = 10.01;
- public static final boolean GENERAL_BOOLEAN = true;
- public static final byte[] GENERAL_BYTE_ARRAY = new byte[0];
- public static final TPMS GENERAL_TPMS = TPMS.UNKNOWN;
- public static final TBTState GENERAL_TBTSTATE = TBTState.NEXT_TURN_REQUEST;
- public static final FileType GENERAL_FILETYPE = FileType.BINARY;
- public static final Language GENERAL_LANGUAGE = Language.EN_US;
- public static final HMILevel GENERAL_HMILEVEL = HMILevel.HMI_FULL;
- public static final DIDResult GENERAL_DIDRESULT = new DIDResult();
- public static final TextField GENERAL_TEXTFIELD = new TextField();
- public static final OasisAddress GENERAL_OASISADDRESS = new OasisAddress();
- public static final Coordinate GENERAL_COORDINATE = new Coordinate();
- public static final LocationDetails GENERAL_LOCATIONDETAILS = new LocationDetails();
- public static final Dimension GENERAL_DIMENSION = Dimension._2D;
- public static final ImageType GENERAL_IMAGETYPE = ImageType.DYNAMIC;
- public static final AudioType GENERAL_AUDIOTYPE = AudioType.PCM;
- public static final StartTime GENERAL_STARTTIME = new StartTime();
- public static final TouchType GENERAL_TOUCHTYPE = TouchType.BEGIN;
- public static final TouchEvent GENERAL_TOUCHEVENT = new TouchEvent();
- public static final VrHelpItem GENERAL_VRHELPITEM = new VrHelpItem();
- public static final ImageField GENERAL_IMAGEFIELD = new ImageField();
- public static final DeviceInfo GENERAL_DEVICEINFO = new DeviceInfo();
- public static final LayoutMode GENERAL_LAYOUTMODE = LayoutMode.LIST_ONLY;
- public static final MenuParams GENERAL_MENUPARAMS = new MenuParams();
- public static final SoftButton GENERAL_SOFTBUTTON = new SoftButton();
- public static final ButtonName GENERAL_BUTTONNAME = ButtonName.OK;
- public static final UpdateMode GENERAL_UPDATEMODE = UpdateMode.RESUME;
- public static final TouchCoord GENERAL_TOUCHCOORD = new TouchCoord();
- public static final MassageModeData GENERAL_MASSAGEMODEDATA = new MassageModeData();
- public static final MassageCushionFirmness GENERAL_MASSAGECUSHIONFIRMNESS = new MassageCushionFirmness();
- public static final DisplayType GENERAL_DISPLAYTYPE = DisplayType.CID;
- public static final VehicleType GENERAL_VEHICLETYPE = new VehicleType();
- public static final RequestType GENERAL_REQUESTTYPE = RequestType.AUTH_REQUEST;
- public static final SystemAction GENERAL_SYSTEMACTION = SystemAction.DEFAULT_ACTION;
- public static final CharacterSet GENERAL_CHARACTERSET = CharacterSet.CID1SET;
- public static final SamplingRate GENERAL_SAMPLINGRATE = SamplingRate._8KHZ;
- public static final ScreenParams GENERAL_SCREENPARAMS = new ScreenParams();
- public static final KeypressMode GENERAL_KEYPRESSMODE = KeypressMode.QUEUE_KEYPRESSES;
- public static final SystemContext GENERAL_SYSTEMCONTEXT = SystemContext.SYSCTXT_MAIN;
- public static final KeyboardEvent GENERAL_KEYBOARDEVENT = KeyboardEvent.ENTRY_SUBMITTED;
- public static final CarModeStatus GENERAL_CARMODESTATUS = CarModeStatus.NORMAL;
- public static final TextFieldName GENERAL_TEXTFIELDNAME = TextFieldName.ETA;
- public static final TriggerSource GENERAL_TRIGGERSOURCE = TriggerSource.TS_VR;
- public static final BitsPerSample GENERAL_BITSPERSAMPLE = BitsPerSample._8_BIT;
- public static final TextAlignment GENERAL_TEXTALIGNMENT = TextAlignment.CENTERED;
- public static final SdlMsgVersion GENERAL_SDLMSGVERSION = new SdlMsgVersion();
- public static final PermissionItem GENERAL_PERMISSIONITEM = new PermissionItem();
- public static final SoftButtonType GENERAL_SOFTBUTTONTYPE = SoftButtonType.SBT_BOTH;
- public static final MassageZone GENERAL_MASSAGEZONE = MassageZone.LUMBAR;
- public static final MassageMode GENERAL_MASSAGEMODE = MassageMode.HIGH;
- public static final MassageCushion GENERAL_MASSAGECUSHION = MassageCushion.BACK_BOLSTERS;
- public static final SeatMemoryActionType GENERAL_SEATMEMORYACTIONTYPE = SeatMemoryActionType.SAVE;
- public static final SupportedSeat GENERAL_SUPPORTEDSEAT = SupportedSeat.DRIVER;
- public static final KeyboardLayout GENERAL_KEYBOARDLAYOUT = KeyboardLayout.QWERTY;
- public static final ImageFieldName GENERAL_IMAGEFIELDNAME = ImageFieldName.graphic;
- public static final HMIPermissions GENERAL_HMIPERMISSIONS = new HMIPermissions();
- public static final IgnitionStatus GENERAL_IGNITIONSTATUS = IgnitionStatus.RUN;
- public static final ButtonEventMode GENERAL_BUTTONEVENTMODE = ButtonEventMode.BUTTONUP;
- public static final ButtonPressMode GENERAL_BUTTONPRESSMODE = ButtonPressMode.SHORT;
- public static final PowerModeStatus GENERAL_POWERMODESTATUS = PowerModeStatus.RUNNING_2;
- public static final VehicleDataType GENERAL_VEHICLEDATATYPE = VehicleDataType.VEHICLEDATA_BRAKING;
- public static final InteractionMode GENERAL_INTERACTIONMODE = InteractionMode.BOTH;
- public static final ImageResolution GENERAL_IMAGERESOLUTION = new ImageResolution();
- public static final FuelCutoffStatus GENERAL_FUELCUTOFFSTATUS = FuelCutoffStatus.NORMAL_OPERATION;
- public static final CompassDirection GENERAL_COMPASSDIRECTION = CompassDirection.EAST;
- public static final LockScreenStatus GENERAL_LOCKSCREENSTATUS = LockScreenStatus.REQUIRED;
- public static final VehicleDataStatus GENERAL_VEHICLEDATASTATUS = VehicleDataStatus.ON;
- public static final DeviceLevelStatus GENERAL_DEVICELEVELSTATUS = DeviceLevelStatus.FOUR_LEVEL_BARS;
- public static final ButtonCapabilities GENERAL_BUTTONCAPABILITIES = new ButtonCapabilities();
- public static final EmergencyEventType GENERAL_EMERGENCYEVENTTYPE = EmergencyEventType.FAULT;
- public static final AmbientLightStatus GENERAL_AMBIENTLIGHTSTATUS = AmbientLightStatus.NIGHT;
- public static final SpeechCapabilities GENERAL_SPEECHCAPABILITIES = SpeechCapabilities.TEXT;
- public static final WarningLightStatus GENERAL_WARNINGLIGHTSTATUS = WarningLightStatus.OFF;
- public static final KeyboardProperties GENERAL_KEYBOARDPROPERTIES = new KeyboardProperties();
- public static final PrimaryAudioSource GENERAL_PRIMARYAUDIOSOURCE = PrimaryAudioSource.BLUETOOTH_STEREO_BTST;
- public static final AudioStreamingState GENERAL_AUDIOSTREAMINGSTATE = AudioStreamingState.AUDIBLE;
- public static final VideoStreamingState GENERAL_VIDEOSTREAMINGSTATE = VideoStreamingState.STREAMABLE;
- public static final DisplayCapabilities GENERAL_DISPLAYCAPABILITIES = new DisplayCapabilities();
- public static final ParameterPermissions GENERAL_PARAMETERPERMISSIONS = new ParameterPermissions();
- public static final IgnitionStableStatus GENERAL_IGNITIONSTABLESTATUS = IgnitionStableStatus.IGNITION_SWITCH_STABLE;
- public static final VehicleDataResultCode GENERAL_VEHICLEDATARESULTCODE = VehicleDataResultCode.IGNORED;
- public static final ComponentVolumeStatus GENERAL_COMPONENTVOLUMESTATUS = ComponentVolumeStatus.LOW;
- public static final PresetBankCapabilities GENERAL_PRESETBANKCAPABILITIES = new PresetBankCapabilities();
- public static final VehicleDataEventStatus GENERAL_VEHCILEDATAEVENTSTATUS = VehicleDataEventStatus.YES;
- public static final VehicleDataEventStatus GENERAL_VEHICLEDATAEVENTSTATUS = VehicleDataEventStatus.YES;
- public static final TouchEventCapabilities GENERAL_TOUCHEVENTCAPABILITIES = new TouchEventCapabilities();
- public static final SeatMemoryAction GENERAL_SEATMEMORYACTION = new SeatMemoryAction();
- public static final SoftButtonCapabilities GENERAL_SOFTBUTTONCAPABILITIES = new SoftButtonCapabilities();
- public static final ECallConfirmationStatus GENERAL_ECALLCONFIRMATIONSTATUS = ECallConfirmationStatus.CALL_IN_PROGRESS;
- public static final AudioPassThruCapabilities GENERAL_AUDIOPASSTHRUCAPABILITIES = new AudioPassThruCapabilities();
- public static final PowerModeQualificationStatus GENERAL_POWERMODEQUALIFICATIONSTATUS = PowerModeQualificationStatus.POWER_MODE_OK;
- public static final VehicleDataNotificationStatus GENERAL_VEHICLEDATANOTIFICATIONSTATUS = VehicleDataNotificationStatus.NORMAL;
- public static final AppInterfaceUnregisteredReason GENERAL_APPINTERFACEUNREGISTEREDREASON = AppInterfaceUnregisteredReason.BLUETOOTH_OFF;
- public static final SystemCapabilityType GENERAL_SYSTEMCAPABILITYTYPE = SystemCapabilityType.NAVIGATION;
- public static final NavigationCapability GENERAL_NAVIGATIONCAPABILITY = new NavigationCapability();
- public static final PhoneCapability GENERAL_PHONECAPABILITY = new PhoneCapability();
- public static final RemoteControlCapabilities GENERAL_REMOTECONTROLCAPABILITIES = new RemoteControlCapabilities();
- public static final SystemCapability GENERAL_SYSTEMCAPABILITY = new SystemCapability();
- public static final VideoStreamingProtocol GENERAL_VIDEOSTREAMINGPROTOCOL = VideoStreamingProtocol.RAW;
- public static final VideoStreamingCodec GENERAL_VIDEOSTREAMINGCODEC = VideoStreamingCodec.H264;
- public static final VideoStreamingCapability GENERAL_VIDEOSTREAMINGCAPABILITY = new VideoStreamingCapability();
- public static final VideoStreamingFormat GENERAL_VIDEOSTREAMINGFORMAT = new VideoStreamingFormat();
- public static final RGBColor GENERAL_RGBCOLOR = new RGBColor();
- public static final TemplateColorScheme GENERAL_DAYCOLORSCHEME = new TemplateColorScheme();
- public static final TemplateColorScheme GENERAL_NIGHTCOLORSCHEME = new TemplateColorScheme();
- public static final Result GENERAL_RESULT = Result.SUCCESS;
- public static final WayPointType GENERAL_WAYPOINTTYPE = WayPointType.DESTINATION;
- public static final SingleTireStatus GENERAL_SINGLETIRESTATUS = new SingleTireStatus();
- 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();
-
- public static final MetadataTags GENERAL_METADATASTRUCT = new MetadataTags();
- 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>();
- public static final List<Choice> GENERAL_CHOICE_LIST = new ArrayList<Choice>();
- public static final List<String> GENERAL_STRING_LIST = Arrays.asList(new String[] { "a", "b"});
- public static final List<Integer> GENERAL_INTEGER_LIST = Arrays.asList(new Integer[]{ -1, -2});
- public static final List<TTSChunk> GENERAL_TTSCHUNK_LIST = new ArrayList<TTSChunk>(2);
- public static final List<HMILevel> GENERAL_HMILEVEL_LIST = Arrays.asList(new HMILevel[]{HMILevel.HMI_FULL, HMILevel.HMI_BACKGROUND});
- public static final List<FileType> GENERAL_FILETYPE_LIST = new ArrayList<FileType>(1);
- public static final List<TextField> GENERAL_TEXTFIELD_LIST = new ArrayList<TextField>(1);
- public static final List<DIDResult> GENERAL_DIDRESULT_LIST = new ArrayList<DIDResult>(1);
- public static final List<TouchCoord> GENERAL_TOUCHCOORD_LIST = new ArrayList<TouchCoord>(1);
- public static final List<MassageModeData> GENERAL_MASSAGEMODEDATA_LIST = new ArrayList<MassageModeData>(1);
- public static final List<MassageCushionFirmness> GENERAL_MASSAGECUSHIONFIRMNESS_LIST = new ArrayList<MassageCushionFirmness>(1);
- public static final List<AppHMIType> GENERAL_APPHMITYPE_LIST = new ArrayList<AppHMIType>(2);
- public static final List<VrHelpItem> GENERAL_VRHELPITEM_LIST = new ArrayList<VrHelpItem>(2);
- public static final List<SoftButton> GENERAL_SOFTBUTTON_LIST = new ArrayList<SoftButton>(1);
- public static final List<ImageField> GENERAL_IMAGEFIELD_LIST = new ArrayList<ImageField>(1);
- public static final List<TouchEvent> GENERAL_TOUCHEVENT_LIST = new ArrayList<TouchEvent>(1);
- public static final List<PermissionItem> GENERAL_PERMISSIONITEM_LIST = new ArrayList<PermissionItem>(1);
- public static final List<GlobalProperty> GENERAL_GLOBALPROPERTY_LIST = new ArrayList<GlobalProperty>(2);
- public static final List<VrCapabilities> GENERAL_VRCAPABILITIES_LIST = new ArrayList<VrCapabilities>(1);
- public static final List<MediaClockFormat> GENERAL_MEDIACLOCKFORMAT_LIST = new ArrayList<MediaClockFormat>(2);
- public static final List<VehicleDataResult> GENERAL_VEHICLEDATARESULT_LIST = new ArrayList<VehicleDataResult>(VehicleDataType.values().length);
- public static final List<PrerecordedSpeech> GENERAL_PRERECORDEDSPEECH_LIST = new ArrayList<PrerecordedSpeech>(2);
- public static final List<SpeechCapabilities> GENERAL_SPEECHCAPABILITIES_LIST = new ArrayList<SpeechCapabilities>(2);
- public static final List<ButtonCapabilities> GENERAL_BUTTONCAPABILITIES_LIST = new ArrayList<ButtonCapabilities>(2);
- public static final List<HmiZoneCapabilities> GENERAL_HMIZONECAPABILITIES_LIST = new ArrayList<HmiZoneCapabilities>(2);
- public static final List<SoftButtonCapabilities> GENERAL_SOFTBUTTONCAPABILITIES_LIST = new ArrayList<SoftButtonCapabilities>(1);
- public static final List<AudioPassThruCapabilities> GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST = new ArrayList<AudioPassThruCapabilities>(1);
- public static final List<VideoStreamingFormat> GENERAL_VIDEOSTREAMINGFORMAT_LIST = new ArrayList<VideoStreamingFormat>(2);
- public static final List<DefrostZone> GENERAL_DEFROSTZONE_LIST = Arrays.asList(new DefrostZone[]{DefrostZone.FRONT, DefrostZone.REAR});
- public static final List<VentilationMode> GENERAL_VENTILATIONMODE_LIST = Arrays.asList(new VentilationMode[]{VentilationMode.LOWER, VentilationMode.UPPER});
- public static final List<ClimateControlCapabilities> GENERAL_CLIMATECONTROLCAPABILITIES_LIST = new ArrayList<ClimateControlCapabilities>(1);
- public static final List<RadioControlCapabilities> GENERAL_RADIOCONTROLCAPABILITIES_LIST = new ArrayList<RadioControlCapabilities>(1);
- 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 List<ModuleData> GENERAL_MODULEDATA_LIST = Collections.singletonList(GENERAL_MODULEDATA);
-
- public static final JSONArray JSON_TURNS = new JSONArray();
- public static final JSONArray JSON_CHOICES = new JSONArray();
- public static final JSONArray JSON_HMILEVELS = new JSONArray();
- public static final JSONArray JSON_TTSCHUNKS = new JSONArray();
- public static final JSONArray JSON_DIDRESULTS = new JSONArray();
- public static final JSONArray JSON_TEXTFIELDS = new JSONArray();
- public static final JSONArray JSON_TOUCHCOORDS = new JSONArray();
- public static final JSONArray JSON_VRHELPITEMS = new JSONArray();
- public static final JSONArray JSON_SOFTBUTTONS = new JSONArray();
- public static final JSONArray JSON_IMAGEFIELDS = new JSONArray();
- public static final JSONArray JSON_TOUCHEVENTS = new JSONArray();
- public static final JSONArray JSON_PERMISSIONITEMS = new JSONArray();
- public static final JSONArray JSON_BUTTONCAPABILITIES = new JSONArray();
- public static final JSONArray JSON_SOFTBUTTONCAPABILITIES = new JSONArray();
- public static final JSONArray JSON_AUDIOPASSTHRUCAPABILITIES = new JSONArray();
- public static final JSONArray JSON_RADIOCONTROLCAPABILITIES = new JSONArray();
- public static final JSONArray JSON_CLIMATECONTROLCAPABILITIES = new JSONArray();
- public static final JSONArray JSON_TEXTFIELDTYPES = new JSONArray();
- public static final JSONObject JSON_TURN = new JSONObject();
- public static final JSONObject JSON_IMAGE = new JSONObject();
- public static final JSONObject JSON_CHOICE = new JSONObject();
- public static final JSONObject JSON_DIDRESULT = new JSONObject();
- public static final JSONObject JSON_STARTTIME = new JSONObject();
- public static final JSONObject JSON_TEXTFIELD = new JSONObject();
- public static final JSONObject JSON_TOUCHCOORD = new JSONObject();
- public static final JSONObject JSON_TOUCHEVENT = new JSONObject();
- public static final JSONObject JSON_IMAGEFIELD = new JSONObject();
- public static final JSONObject JSON_SOFTBUTTON = new JSONObject();
- public static final JSONObject JSON_MENUPARAMS = new JSONObject();
- public static final JSONObject JSON_DEVICEINFO = new JSONObject();
- public static final JSONObject JSON_VRHELPITEM = new JSONObject();
- public static final JSONObject JSON_SCREENPARAMS = new JSONObject();
- public static final JSONObject JSON_SDLMSGVERSION = new JSONObject();
- public static final JSONObject JSON_PERMISSIONITEM = new JSONObject();
- public static final JSONObject JSON_HMIPERMISSIONS = new JSONObject();
- public static final JSONObject JSON_IMAGERESOLUTION = new JSONObject();
- public static final JSONObject JSON_KEYBOARDPROPERTIES = new JSONObject();
- public static final JSONObject JSON_DISPLAYCAPABILITIES = new JSONObject();
- public static final JSONObject JSON_PARAMETERPERMISSIONS = new JSONObject();
- public static final JSONObject JSON_PRESETBANKCAPABILITIES = new JSONObject();
- public static final JSONObject JSON_TOUCHEVENTCAPABILITIES = new JSONObject();
- public static final JSONObject JSON_PCMSTREAMCAPABILITIES = new JSONObject();
- public static final JSONObject JSON_RGBCOLOR = new JSONObject();
- public static final JSONObject JSON_DAYCOLORSCHEME = new JSONObject();
- public static final JSONObject JSON_NIGHTCOLORSCHEME = new JSONObject();
-
- static {
- GENERAL_TOUCHEVENTCAPABILITIES.setDoublePressAvailable(GENERAL_BOOLEAN);
- GENERAL_TOUCHEVENTCAPABILITIES.setMultiTouchAvailable(GENERAL_BOOLEAN);
- GENERAL_TOUCHEVENTCAPABILITIES.setPressAvailable(GENERAL_BOOLEAN);
-
- GENERAL_SEATMEMORYACTION.setAction(GENERAL_SEATMEMORYACTIONTYPE);
- GENERAL_SEATMEMORYACTION.setLabel(GENERAL_STRING);
- GENERAL_SEATMEMORYACTION.setId(GENERAL_INT);
-
- GENERAL_IMAGERESOLUTION.setResolutionHeight(GENERAL_INT);
- GENERAL_IMAGERESOLUTION.setResolutionWidth(GENERAL_INT);
-
- GENERAL_TEMPERATURE.setUnit(GENERAL_TEMPERATUREUNIT);
- GENERAL_TEMPERATURE.setValue(GENERAL_FLOAT);
-
- GENERAL_CLIMATECONTROLDATA.setFanSpeed(GENERAL_INT);
- GENERAL_CLIMATECONTROLDATA.setCurrentTemperature(GENERAL_TEMPERATURE);
- GENERAL_CLIMATECONTROLDATA.setDesiredTemperature(GENERAL_TEMPERATURE);
- GENERAL_CLIMATECONTROLDATA.setAcEnable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLDATA.setCirculateAirEnable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLDATA.setAutoModeEnable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLDATA.setDualModeEnable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLDATA.setAcMaxEnable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLDATA.setDefrostZone(GENERAL_DEFROSTZONE);
- GENERAL_CLIMATECONTROLDATA.setVentilationMode(GENERAL_VENTILATIONMODE);
-
- GENERAL_SEATCONTROLDATA.setMemory(GENERAL_SEATMEMORYACTION);
- GENERAL_SEATCONTROLDATA.setMassageCushionFirmness(GENERAL_MASSAGECUSHIONFIRMNESS_LIST);
- GENERAL_SEATCONTROLDATA.setMassageMode(GENERAL_MASSAGEMODEDATA_LIST);
- GENERAL_SEATCONTROLDATA.setMassageEnabled(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLDATA.setHeadSupportHorizontalPosition(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setHeadSupportVerticalPosition(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setBackTiltAngle(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setBackVerticalPosition(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setFrontVerticalPosition(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setVerticalPosition(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setHorizontalPosition(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setCoolingLevel(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setHeatingLevel(GENERAL_INT);
- GENERAL_SEATCONTROLDATA.setHeatingEnabled(GENERAL_BOOLEAN);
- 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);
- GENERAL_RDSDATA.setProgramIdentification(GENERAL_STRING);
- GENERAL_RDSDATA.setRegion(GENERAL_STRING);
- GENERAL_RDSDATA.setTrafficProgram(GENERAL_BOOLEAN);
- GENERAL_RDSDATA.setTrafficAnnouncement(GENERAL_BOOLEAN);
- GENERAL_RDSDATA.setProgramType(GENERAL_INT);
-
- GENERAL_RADIOCONTROLDATA.setFrequencyInteger(GENERAL_INT);
- GENERAL_RADIOCONTROLDATA.setFrequencyFraction(GENERAL_INT);
- GENERAL_RADIOCONTROLDATA.setBand(GENERAL_RADIOBAND);
- GENERAL_RADIOCONTROLDATA.setRdsData(GENERAL_RDSDATA);
- GENERAL_RADIOCONTROLDATA.setAvailableHDs(GENERAL_INT);
- GENERAL_RADIOCONTROLDATA.setHdChannel(GENERAL_INT);
- GENERAL_RADIOCONTROLDATA.setSignalStrength(GENERAL_INT);
- GENERAL_RADIOCONTROLDATA.setSignalChangeThreshold(GENERAL_INT);
- GENERAL_RADIOCONTROLDATA.setRadioEnable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLDATA.setState(GENERAL_RADIOSTATE);
-
- GENERAL_MODULEDATA.setModuleType(GENERAL_MODULETYPE);
- GENERAL_MODULEDATA.setClimateControlData(GENERAL_CLIMATECONTROLDATA);
-
- GENERAL_CHOICE.setMenuName(GENERAL_STRING);
- GENERAL_CHOICE.setSecondaryText(GENERAL_STRING);
- GENERAL_CHOICE.setTertiaryText(GENERAL_STRING);
- GENERAL_CHOICE.setChoiceID(GENERAL_INT);
- GENERAL_CHOICE.setImage(GENERAL_IMAGE);
- GENERAL_CHOICE.setSecondaryImage(GENERAL_IMAGE);
- GENERAL_CHOICE.setVrCommands(GENERAL_STRING_LIST);
-
- GENERAL_MASSAGEMODEDATA.setMassageMode(GENERAL_MASSAGEMODE);
- GENERAL_MASSAGEMODEDATA.setMassageZone(GENERAL_MASSAGEZONE);
- GENERAL_MASSAGEMODEDATA_LIST.add(GENERAL_MASSAGEMODEDATA);
-
- GENERAL_MASSAGECUSHIONFIRMNESS.setCushion(GENERAL_MASSAGECUSHION);
- GENERAL_MASSAGECUSHIONFIRMNESS.setFirmness(GENERAL_INT);
- GENERAL_MASSAGECUSHIONFIRMNESS_LIST.add(GENERAL_MASSAGECUSHIONFIRMNESS);
-
- GENERAL_TOUCHCOORD.setX(GENERAL_INT);
- GENERAL_TOUCHCOORD.setY(GENERAL_INT);
- GENERAL_TOUCHCOORD_LIST.add(GENERAL_TOUCHCOORD);
-
- GENERAL_TOUCHEVENT.setId(GENERAL_INT);
- GENERAL_TOUCHEVENT.setTs(GENERAL_LONG_LIST);
- GENERAL_TOUCHEVENT.setC(GENERAL_TOUCHCOORD_LIST);
- GENERAL_TOUCHEVENT_LIST.add(GENERAL_TOUCHEVENT);
-
- GENERAL_TEXTFIELD.setName(GENERAL_TEXTFIELDNAME);
- GENERAL_TEXTFIELD.setRows(GENERAL_INT);
- GENERAL_TEXTFIELD.setWidth(GENERAL_INT);
- GENERAL_TEXTFIELD.setCharacterSet(GENERAL_CHARACTERSET);
- GENERAL_TEXTFIELD_LIST.add(GENERAL_TEXTFIELD);
-
- GENERAL_COORDINATE.setLongitudeDegrees(GENERAL_FLOAT);
- GENERAL_COORDINATE.setLatitudeDegrees(GENERAL_FLOAT);
-
- GENERAL_OASISADDRESS.setCountryName(GENERAL_STRING);
- GENERAL_OASISADDRESS.setThoroughfare(GENERAL_STRING);
- GENERAL_OASISADDRESS.setSubThoroughfare(GENERAL_STRING);
- GENERAL_OASISADDRESS.setCountryCode(GENERAL_STRING);
- GENERAL_OASISADDRESS.setPostalCode(GENERAL_STRING);
- GENERAL_OASISADDRESS.setLocality(GENERAL_STRING);
- GENERAL_OASISADDRESS.setSubLocality(GENERAL_STRING);
- GENERAL_OASISADDRESS.setAdministrativeArea(GENERAL_STRING);
- GENERAL_OASISADDRESS.setSubAdministrativeArea(GENERAL_STRING);
-
- GENERAL_LOCATIONDETAILS.setAddressLines(GENERAL_STRING_LIST);
- GENERAL_LOCATIONDETAILS.setCoordinate(GENERAL_COORDINATE);
- GENERAL_LOCATIONDETAILS.setLocationDescription(GENERAL_STRING);
- GENERAL_LOCATIONDETAILS.setLocationImage(GENERAL_IMAGE);
- GENERAL_LOCATIONDETAILS.setLocationName(GENERAL_STRING);
- GENERAL_LOCATIONDETAILS.setSearchAddress(GENERAL_OASISADDRESS);
- GENERAL_LOCATIONDETAILS.setPhoneNumber(GENERAL_STRING);
-
- GENERAL_FILETYPE_LIST.add(GENERAL_FILETYPE);
-
- GENERAL_IMAGEFIELD.setImageResolution(GENERAL_IMAGERESOLUTION);
- GENERAL_IMAGEFIELD.setName(GENERAL_IMAGEFIELDNAME);
- GENERAL_IMAGEFIELD.setImageTypeSupported(GENERAL_FILETYPE_LIST);
- GENERAL_IMAGEFIELD_LIST.add(GENERAL_IMAGEFIELD);
-
- GENERAL_SCREENPARAMS.setImageResolution(GENERAL_IMAGERESOLUTION);
- GENERAL_SCREENPARAMS.setTouchEventAvailable(GENERAL_TOUCHEVENTCAPABILITIES);
-
- GENERAL_MEDIACLOCKFORMAT_LIST.add(MediaClockFormat.CLOCK1);
- GENERAL_MEDIACLOCKFORMAT_LIST.add(MediaClockFormat.CLOCK2);
-
- GENERAL_IMAGE.setValue(GENERAL_STRING);
- GENERAL_IMAGE.setImageType(GENERAL_IMAGETYPE);
- GENERAL_IMAGE.setIsTemplate(GENERAL_BOOLEAN);
-
- GENERAL_SOFTBUTTON.setIsHighlighted(GENERAL_BOOLEAN);
- GENERAL_SOFTBUTTON.setSoftButtonID(GENERAL_INT);
- GENERAL_SOFTBUTTON.setSystemAction(SystemAction.STEAL_FOCUS);
- GENERAL_SOFTBUTTON.setText(GENERAL_STRING);
- GENERAL_SOFTBUTTON.setType(SoftButtonType.SBT_TEXT);
- GENERAL_SOFTBUTTON.setImage(GENERAL_IMAGE);
- GENERAL_SOFTBUTTON_LIST.add(GENERAL_SOFTBUTTON);
-
- GENERAL_TURN.setNavigationText(GENERAL_STRING);
- GENERAL_TURN.setTurnIcon(GENERAL_IMAGE);
- GENERAL_TURN_LIST.add(GENERAL_TURN);
-
- GENERAL_MENUPARAMS.setMenuName(GENERAL_STRING);
- GENERAL_MENUPARAMS.setParentID(GENERAL_INT);
- GENERAL_MENUPARAMS.setPosition(GENERAL_INT);
-
- GENERAL_VRHELPITEM.setText(GENERAL_STRING);
- GENERAL_VRHELPITEM.setImage(GENERAL_IMAGE);
- GENERAL_VRHELPITEM.setPosition(100);
- GENERAL_VRHELPITEM_LIST.add(GENERAL_VRHELPITEM);
-
- GENERAL_TTSCHUNK_LIST.add(TTSChunkFactory.createChunk(SpeechCapabilities.TEXT, "Welcome to the jungle"));
- GENERAL_TTSCHUNK_LIST.add(TTSChunkFactory.createChunk(SpeechCapabilities.TEXT, "Say a command"));
-
- GENERAL_KEYBOARDPROPERTIES.setAutoCompleteText(GENERAL_STRING);
- GENERAL_KEYBOARDPROPERTIES.setKeypressMode(KeypressMode.SINGLE_KEYPRESS);
- GENERAL_KEYBOARDPROPERTIES.setKeyboardLayout(KeyboardLayout.QWERTY);
- GENERAL_KEYBOARDPROPERTIES.setLanguage(Language.EN_US);
- GENERAL_KEYBOARDPROPERTIES.setLimitedCharacterList(Test.GENERAL_STRING_LIST);
-
- GENERAL_STARTTIME.setHours(GENERAL_INT);
- GENERAL_STARTTIME.setMinutes(GENERAL_INT);
- GENERAL_STARTTIME.setSeconds(GENERAL_INT);
-
- GENERAL_CHOICE_LIST.add(GENERAL_CHOICE);
-
- GENERAL_DEVICEINFO.setCarrier(GENERAL_STRING);
- GENERAL_DEVICEINFO.setFirmwareRev(GENERAL_STRING);
- GENERAL_DEVICEINFO.setHardware(GENERAL_STRING);
- GENERAL_DEVICEINFO.setMaxNumberRFCOMMPorts(GENERAL_INT);
- GENERAL_DEVICEINFO.setOs(GENERAL_STRING);
- GENERAL_DEVICEINFO.setOsVersion(GENERAL_STRING);
-
- GENERAL_SDLMSGVERSION.setMajorVersion(GENERAL_INT);
- GENERAL_SDLMSGVERSION.setMinorVersion(GENERAL_INT);
-
- GENERAL_APPHMITYPE_LIST.add(AppHMIType.BACKGROUND_PROCESS);
- GENERAL_APPHMITYPE_LIST.add(AppHMIType.COMMUNICATION);
-
- GENERAL_GLOBALPROPERTY_LIST.add(GlobalProperty.HELPPROMPT);
- GENERAL_GLOBALPROPERTY_LIST.add(GlobalProperty.MENUICON);
-
- for (VehicleDataType data : VehicleDataType.values()) {
- VehicleDataResult result = new VehicleDataResult();
- result.setResultCode(VehicleDataResultCode.SUCCESS);
- result.setDataType(data);
- GENERAL_VEHICLEDATARESULT_LIST.add(result);
- }
-
- GENERAL_DIDRESULT.setData(GENERAL_STRING);
- GENERAL_DIDRESULT.setDidLocation(GENERAL_INT);
- GENERAL_DIDRESULT.setResultCode(VehicleDataResultCode.SUCCESS);
- GENERAL_DIDRESULT_LIST.add(GENERAL_DIDRESULT);
-
- GENERAL_DISPLAYCAPABILITIES.setDisplayType(GENERAL_DISPLAYTYPE);
- GENERAL_DISPLAYCAPABILITIES.setDisplayName(GENERAL_STRING);
- GENERAL_DISPLAYCAPABILITIES.setGraphicSupported(GENERAL_BOOLEAN);
- GENERAL_DISPLAYCAPABILITIES.setImageFields(GENERAL_IMAGEFIELD_LIST);
- GENERAL_DISPLAYCAPABILITIES.setMediaClockFormats(GENERAL_MEDIACLOCKFORMAT_LIST);
- GENERAL_DISPLAYCAPABILITIES.setNumCustomPresetsAvailable(GENERAL_INT);
- GENERAL_DISPLAYCAPABILITIES.setScreenParams(GENERAL_SCREENPARAMS);
- GENERAL_DISPLAYCAPABILITIES.setTemplatesAvailable(GENERAL_STRING_LIST);
- GENERAL_DISPLAYCAPABILITIES.setTextFields(GENERAL_TEXTFIELD_LIST);
-
- GENERAL_PRESETBANKCAPABILITIES.setOnScreenPresetsAvailable(GENERAL_BOOLEAN);
-
- GENERAL_BUTTONCAPABILITIES.setLongPressAvailable(false);
- GENERAL_BUTTONCAPABILITIES.setShortPressAvailable(true);
- GENERAL_BUTTONCAPABILITIES.setUpDownAvailable(true);
- GENERAL_BUTTONCAPABILITIES.setName(ButtonName.SEEKRIGHT);
- GENERAL_BUTTONCAPABILITIES_LIST.add(GENERAL_BUTTONCAPABILITIES);
-
- GENERAL_SOFTBUTTONCAPABILITIES.setLongPressAvailable(GENERAL_BOOLEAN);
- GENERAL_SOFTBUTTONCAPABILITIES.setShortPressAvailable(GENERAL_BOOLEAN);
- GENERAL_SOFTBUTTONCAPABILITIES.setUpDownAvailable(GENERAL_BOOLEAN);
- GENERAL_SOFTBUTTONCAPABILITIES.setImageSupported(GENERAL_BOOLEAN);
- GENERAL_SOFTBUTTONCAPABILITIES_LIST.add(GENERAL_SOFTBUTTONCAPABILITIES);
-
- GENERAL_VEHICLETYPE.setMake(GENERAL_STRING);
- GENERAL_VEHICLETYPE.setModel(GENERAL_STRING);
- GENERAL_VEHICLETYPE.setModelYear(GENERAL_STRING);
- GENERAL_VEHICLETYPE.setTrim(GENERAL_STRING);
-
- GENERAL_AUDIOPASSTHRUCAPABILITIES.setAudioType(GENERAL_AUDIOTYPE);
- GENERAL_AUDIOPASSTHRUCAPABILITIES.setBitsPerSample(GENERAL_BITSPERSAMPLE);
- GENERAL_AUDIOPASSTHRUCAPABILITIES.setSamplingRate(GENERAL_SAMPLINGRATE);
- GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST.add(GENERAL_AUDIOPASSTHRUCAPABILITIES);
-
- GENERAL_PRERECORDEDSPEECH_LIST.add(PrerecordedSpeech.HELP_JINGLE);
- GENERAL_PRERECORDEDSPEECH_LIST.add(PrerecordedSpeech.INITIAL_JINGLE);
-
- GENERAL_HMIZONECAPABILITIES_LIST.add(HmiZoneCapabilities.BACK);
- GENERAL_HMIZONECAPABILITIES_LIST.add(HmiZoneCapabilities.FRONT);
-
- GENERAL_SPEECHCAPABILITIES_LIST.add(SpeechCapabilities.SILENCE);
- GENERAL_SPEECHCAPABILITIES_LIST.add(SpeechCapabilities.TEXT);
-
- GENERAL_VRCAPABILITIES_LIST.add(VrCapabilities.TEXT);
-
- GENERAL_HMIPERMISSIONS.setAllowed(GENERAL_HMILEVEL_LIST);
- GENERAL_HMIPERMISSIONS.setUserDisallowed(GENERAL_HMILEVEL_LIST);
-
- GENERAL_PARAMETERPERMISSIONS.setAllowed(GENERAL_STRING_LIST);
- GENERAL_PARAMETERPERMISSIONS.setUserDisallowed(GENERAL_STRING_LIST);
-
- GENERAL_PERMISSIONITEM.setRpcName(GENERAL_STRING);
- GENERAL_PERMISSIONITEM.setHMIPermissions(GENERAL_HMIPERMISSIONS);
- GENERAL_PERMISSIONITEM.setParameterPermissions(GENERAL_PARAMETERPERMISSIONS);
- GENERAL_PERMISSIONITEM_LIST.add(GENERAL_PERMISSIONITEM);
-
- GENERAL_SYSTEMCAPABILITY.setSystemCapabilityType(GENERAL_SYSTEMCAPABILITYTYPE);
-
- GENERAL_NAVIGATIONCAPABILITY.setSendLocationEnabled(GENERAL_BOOLEAN);
- GENERAL_NAVIGATIONCAPABILITY.setWayPointsEnabled(GENERAL_BOOLEAN);
-
- GENERAL_PHONECAPABILITY.setDialNumberEnabled(GENERAL_BOOLEAN);
-
- GENERAL_VIDEOSTREAMINGFORMAT.setProtocol(GENERAL_VIDEOSTREAMINGPROTOCOL);
- GENERAL_VIDEOSTREAMINGFORMAT.setCodec(GENERAL_VIDEOSTREAMINGCODEC);
-
- GENERAL_VIDEOSTREAMINGFORMAT_LIST.add(GENERAL_VIDEOSTREAMINGFORMAT);
- GENERAL_VIDEOSTREAMINGFORMAT_LIST.add(GENERAL_VIDEOSTREAMINGFORMAT);
-
- 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);
- GENERAL_CLIMATECONTROLCAPABILITIES.setDesiredTemperatureAvailable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLCAPABILITIES.setAcEnableAvailable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLCAPABILITIES.setAcMaxEnableAvailable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLCAPABILITIES.setCirculateAirEnableAvailable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLCAPABILITIES.setAutoModeEnableAvailable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLCAPABILITIES.setDualModeEnableAvailable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLCAPABILITIES.setDefrostZoneAvailable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLCAPABILITIES.setDefrostZone(GENERAL_DEFROSTZONE_LIST);
- GENERAL_CLIMATECONTROLCAPABILITIES.setVentilationModeAvailable(GENERAL_BOOLEAN);
- GENERAL_CLIMATECONTROLCAPABILITIES.setVentilationMode(GENERAL_VENTILATIONMODE_LIST);
- GENERAL_CLIMATECONTROLCAPABILITIES_LIST.add(GENERAL_CLIMATECONTROLCAPABILITIES);
-
- GENERAL_RADIOCONTROLCAPABILITIES.setModuleName(GENERAL_STRING);
- GENERAL_RADIOCONTROLCAPABILITIES.setRadioEnableAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES.setRadioBandAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES.setRadioFrequencyAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES.setHdChannelAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES.setRdsDataAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES.setAvailableHDsAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES.setStateAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES.setSignalStrengthAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES.setSignalChangeThresholdAvailable(GENERAL_BOOLEAN);
- GENERAL_RADIOCONTROLCAPABILITIES_LIST.add(GENERAL_RADIOCONTROLCAPABILITIES);
-
- GENERAL_SEATCONTROLCAPABILITIES.setMemoryAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setMassageCushionFirmnessAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setMassageModeAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setMassageEnabledAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setHeadSupportVerticalPositionAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setHeadSupportHorizontalPositionAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setBackTiltAngleAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setBackVerticalPositionAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setFrontVerticalPositionAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setVerticalPositionAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setHorizontalPositionAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setCoolingLevelAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setHeatingLevelAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setCoolingEnabledAvailable(GENERAL_BOOLEAN);
- GENERAL_SEATCONTROLCAPABILITIES.setHeatingEnabledAvailable(GENERAL_BOOLEAN);
- 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.setKeepContextAvailable(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);
-
- GENERAL_HMICAPABILITIES.setNavigationAvilable(GENERAL_BOOLEAN);
- GENERAL_HMICAPABILITIES.setVideoStreamingAvailable(GENERAL_BOOLEAN);
- GENERAL_HMICAPABILITIES.setPhoneCallAvilable(GENERAL_BOOLEAN);
-
- List<MetadataType> exampleList = new ArrayList<>();
- exampleList.add(0, MetadataType.CURRENT_TEMPERATURE);
- exampleList.add(1, MetadataType.MEDIA_ALBUM);
- exampleList.add(2, MetadataType.MEDIA_ARTIST);
-
- GENERAL_METADATASTRUCT.setMainField1(exampleList);
- GENERAL_METADATASTRUCT.setMainField2(exampleList);
- GENERAL_METADATASTRUCT.setMainField3(exampleList);
- GENERAL_METADATASTRUCT.setMainField4(exampleList);
-
- GENERAL_RECTANGLE.setX(GENERAL_FLOAT);
- GENERAL_RECTANGLE.setY(GENERAL_FLOAT);
- GENERAL_RECTANGLE.setWidth(GENERAL_FLOAT);
- GENERAL_RECTANGLE.setHeight(GENERAL_FLOAT);
-
- GENERAL_HAPTIC_RECT.setId(GENERAL_INTEGER);
- GENERAL_HAPTIC_RECT.setRect(GENERAL_RECTANGLE);
-
- GENERAL_RGBCOLOR.setRed(GENERAL_INTEGER);
- GENERAL_RGBCOLOR.setGreen(GENERAL_INTEGER);
- GENERAL_RGBCOLOR.setBlue(GENERAL_INTEGER);
-
- GENERAL_NIGHTCOLORSCHEME.setPrimaryColor(GENERAL_RGBCOLOR);
- GENERAL_NIGHTCOLORSCHEME.setSecondaryColor(GENERAL_RGBCOLOR);
- GENERAL_NIGHTCOLORSCHEME.setBackgroundColor(GENERAL_RGBCOLOR);
-
- GENERAL_DAYCOLORSCHEME.setPrimaryColor(GENERAL_RGBCOLOR);
- 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);
- JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_USER_DISALLOWED, GENERAL_HMILEVEL_LIST);
-
- JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, GENERAL_AUDIOTYPE);
- JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, GENERAL_BITSPERSAMPLE);
- JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, GENERAL_SAMPLINGRATE);
-
- JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE, GENERAL_BOOLEAN);
- JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, GENERAL_BOOLEAN);
- JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, GENERAL_BOOLEAN);
-
- JSON_IMAGERESOLUTION.put(ImageResolution.KEY_RESOLUTION_HEIGHT, GENERAL_INT);
- JSON_IMAGERESOLUTION.put(ImageResolution.KEY_RESOLUTION_WIDTH, GENERAL_INT);
-
- JSON_CHOICE.put(Choice.KEY_MENU_NAME, GENERAL_STRING);
- JSON_CHOICE.put(Choice.KEY_SECONDARY_TEXT, GENERAL_STRING);
- JSON_CHOICE.put(Choice.KEY_TERTIARY_TEXT, GENERAL_STRING);
- JSON_CHOICE.put(Choice.KEY_CHOICE_ID, GENERAL_INT);
- JSON_CHOICE.put(Choice.KEY_IMAGE, JSON_IMAGE);
- JSON_CHOICE.put(Choice.KEY_SECONDARY_IMAGE, JSON_IMAGE);
- JSON_CHOICE.put(Choice.KEY_VR_COMMANDS, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
-
- JSON_HMILEVELS.put(HMILevel.HMI_FULL);
- JSON_HMILEVELS.put(HMILevel.HMI_BACKGROUND);
-
- JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, JSON_HMILEVELS);
- JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_USER_DISALLOWED, JSON_HMILEVELS);
-
- JSON_PARAMETERPERMISSIONS.put(ParameterPermissions.KEY_ALLOWED, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
- JSON_PARAMETERPERMISSIONS.put(ParameterPermissions.KEY_USER_DISALLOWED, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
-
- JSON_PERMISSIONITEM.put(PermissionItem.KEY_HMI_PERMISSIONS, JSON_HMIPERMISSIONS);
- JSON_PERMISSIONITEM.put(PermissionItem.KEY_PARAMETER_PERMISSIONS, JSON_PARAMETERPERMISSIONS);
- JSON_PERMISSIONITEM.put(PermissionItem.KEY_RPC_NAME, GENERAL_STRING);
- JSON_PERMISSIONITEMS.put(JSON_PERMISSIONITEM);
-
- JSON_IMAGE.put(Image.KEY_IMAGE_TYPE, GENERAL_IMAGETYPE);
- JSON_IMAGE.put(Image.KEY_VALUE, GENERAL_STRING);
- JSON_IMAGE.put(Image.KEY_IS_TEMPLATE, GENERAL_BOOLEAN);
-
- JSON_SOFTBUTTON.put(SoftButton.KEY_IS_HIGHLIGHTED , GENERAL_BOOLEAN);
- JSON_SOFTBUTTON.put(SoftButton.KEY_SOFT_BUTTON_ID, GENERAL_INT);
- JSON_SOFTBUTTON.put(SoftButton.KEY_SYSTEM_ACTION, SystemAction.STEAL_FOCUS);
- JSON_SOFTBUTTON.put(SoftButton.KEY_TEXT, GENERAL_STRING);
- JSON_SOFTBUTTON.put(SoftButton.KEY_TYPE, SoftButtonType.SBT_TEXT);
- JSON_SOFTBUTTON.put(SoftButton.KEY_IMAGE, GENERAL_IMAGE.serializeJSON());
- JSON_SOFTBUTTONS.put(JSON_SOFTBUTTON);
-
- JSON_TURN.put(Turn.KEY_NAVIGATION_TEXT, GENERAL_STRING);
- JSON_TURN.put(Turn.KEY_TURN_IMAGE, GENERAL_IMAGE.serializeJSON());
- JSON_TURNS.put(JSON_TURN);
-
- JSON_MENUPARAMS.put(MenuParams.KEY_MENU_NAME, GENERAL_STRING);
- JSON_MENUPARAMS.put(MenuParams.KEY_PARENT_ID, GENERAL_INT);
- JSON_MENUPARAMS.put(MenuParams.KEY_POSITION, GENERAL_INT);
-
- JSON_VRHELPITEM.put(VrHelpItem.KEY_TEXT, GENERAL_STRING);
- JSON_VRHELPITEM.put(VrHelpItem.KEY_IMAGE, JSON_IMAGE);
- JSON_VRHELPITEM.put(VrHelpItem.KEY_POSITION, GENERAL_INT);
- JSON_VRHELPITEMS.put(JSON_VRHELPITEM);
-
- JSONObject jsonTtsChunk = new JSONObject();
- jsonTtsChunk.put(TTSChunk.KEY_TEXT, "Welcome to the jungle");
- jsonTtsChunk.put(TTSChunk.KEY_TYPE, SpeechCapabilities.TEXT);
- JSON_TTSCHUNKS.put(jsonTtsChunk);
- jsonTtsChunk = new JSONObject();
- jsonTtsChunk.put(TTSChunk.KEY_TEXT, "Say a command");
- jsonTtsChunk.put(TTSChunk.KEY_TYPE, SpeechCapabilities.TEXT);
- JSON_TTSCHUNKS.put(jsonTtsChunk);
-
- JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_AUTO_COMPLETE_TEXT, GENERAL_STRING);
- JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_KEYPRESS_MODE, KeypressMode.SINGLE_KEYPRESS);
- JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_KEYBOARD_LAYOUT, KeyboardLayout.QWERTY);
- JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_LANGUAGE, Language.EN_US);
- JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
-
- JSON_STARTTIME.put(StartTime.KEY_HOURS, GENERAL_STARTTIME.getHours());
- JSON_STARTTIME.put(StartTime.KEY_MINUTES, GENERAL_STARTTIME.getMinutes());
- JSON_STARTTIME.put(StartTime.KEY_SECONDS, GENERAL_STARTTIME.getSeconds());
-
- JSON_CHOICES.put(JSON_CHOICE);
-
- JSON_DEVICEINFO.put(DeviceInfo.KEY_CARRIER, GENERAL_STRING);
- JSON_DEVICEINFO.put(DeviceInfo.KEY_FIRMWARE_REV, GENERAL_STRING);
- JSON_DEVICEINFO.put(DeviceInfo.KEY_HARDWARE, GENERAL_STRING);
- JSON_DEVICEINFO.put(DeviceInfo.KEY_MAX_NUMBER_RFCOMM_PORTS, GENERAL_INT);
- JSON_DEVICEINFO.put(DeviceInfo.KEY_OS, GENERAL_STRING);
- JSON_DEVICEINFO.put(DeviceInfo.KEY_OS_VERSION, GENERAL_STRING);
-
- JSON_RGBCOLOR.put(RGBColor.KEY_RED, GENERAL_INT);
- JSON_RGBCOLOR.put(RGBColor.KEY_GREEN, GENERAL_INT);
- JSON_RGBCOLOR.put(RGBColor.KEY_BLUE, GENERAL_INT);
-
- JSON_DAYCOLORSCHEME.put(TemplateColorScheme.KEY_PRIMARY_COLOR, JSON_RGBCOLOR);
- JSON_DAYCOLORSCHEME.put(TemplateColorScheme.KEY_SECONDARY_COLOR, JSON_RGBCOLOR);
- JSON_DAYCOLORSCHEME.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, JSON_RGBCOLOR);
-
- JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_PRIMARY_COLOR, JSON_RGBCOLOR);
- JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_SECONDARY_COLOR, JSON_RGBCOLOR);
- JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, JSON_RGBCOLOR);
-
- JSON_SDLMSGVERSION.put(SdlMsgVersion.KEY_MAJOR_VERSION, GENERAL_INT);
- JSON_SDLMSGVERSION.put(SdlMsgVersion.KEY_MINOR_VERSION, GENERAL_INT);
-
- JSON_DIDRESULT.put(DIDResult.KEY_DATA, GENERAL_STRING);
- JSON_DIDRESULT.put(DIDResult.KEY_DID_LOCATION, GENERAL_INT);
- JSON_DIDRESULT.put(DIDResult.KEY_RESULT_CODE, VehicleDataResultCode.SUCCESS);
- JSON_DIDRESULTS.put(JSON_DIDRESULT);
-
- JSON_PRESETBANKCAPABILITIES.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE, GENERAL_BOOLEAN);
-
- JSONObject jsonButton = new JSONObject();
- jsonButton.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, false);
- jsonButton.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, GENERAL_BOOLEAN);
- jsonButton.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE, GENERAL_BOOLEAN);
- jsonButton.put(ButtonCapabilities.KEY_NAME, ButtonName.SEEKRIGHT);
- JSON_BUTTONCAPABILITIES.put(jsonButton);
-
- JSONObject jsonRadioControlCapabilities = new JSONObject();
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_MODULE_NAME, GENERAL_STRING);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_RADIO_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_RADIO_BAND_AVAILABLE, GENERAL_BOOLEAN);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_RADIO_FREQUENCY_AVAILABLE, GENERAL_BOOLEAN);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_HD_CHANNEL_AVAILABLE, GENERAL_BOOLEAN);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_RDS_DATA_AVAILABLE, GENERAL_BOOLEAN);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_AVAILABLE_HDS_AVAILABLE, GENERAL_BOOLEAN);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_STATE_AVAILABLE, GENERAL_BOOLEAN);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_SIGNAL_STRENGTH_AVAILABLE, GENERAL_BOOLEAN);
- jsonRadioControlCapabilities.put(RadioControlCapabilities.KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, GENERAL_BOOLEAN);
- JSON_RADIOCONTROLCAPABILITIES.put(jsonRadioControlCapabilities);
-
- JSONObject jsonClimateControlCapabilities = new JSONObject();
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_MODULE_NAME, GENERAL_STRING);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_FAN_SPEED_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_DESIRED_TEMPERATURE_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_AC_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_AC_MAX_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_CIRCULATE_AIR_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_AUTO_MODE_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_DUAL_MODE_ENABLE_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_DEFROST_ZONE_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_DEFROST_ZONE, GENERAL_DEFROSTZONE_LIST);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_VENTILATION_MODE_AVAILABLE, GENERAL_BOOLEAN);
- jsonClimateControlCapabilities.put(ClimateControlCapabilities.KEY_VENTILATION_MODE, GENERAL_VENTILATIONMODE_LIST);
- JSON_CLIMATECONTROLCAPABILITIES.put(jsonClimateControlCapabilities);
-
- jsonButton = new JSONObject();
- jsonButton.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, GENERAL_BOOLEAN);
- jsonButton.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, GENERAL_BOOLEAN);
- jsonButton.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE, GENERAL_BOOLEAN);
- jsonButton.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED, GENERAL_BOOLEAN);
- JSON_SOFTBUTTONCAPABILITIES.put(jsonButton);
-
- jsonButton = new JSONObject();
- jsonButton.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, GENERAL_AUDIOTYPE);
- jsonButton.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, GENERAL_BITSPERSAMPLE);
- jsonButton.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, GENERAL_SAMPLINGRATE);
- JSON_AUDIOPASSTHRUCAPABILITIES.put(jsonButton);
-
- JSON_TEXTFIELD.put(TextField.KEY_CHARACTER_SET, CharacterSet.CID1SET);
- JSON_TEXTFIELD.put(TextField.KEY_NAME, TextFieldName.ETA);
- JSON_TEXTFIELD.put(TextField.KEY_ROWS, GENERAL_INT);
- JSON_TEXTFIELD.put(TextField.KEY_WIDTH, GENERAL_INT);
- JSON_TEXTFIELDS.put(JSON_TEXTFIELD);
-
- JSON_IMAGEFIELD.put(ImageField.KEY_IMAGE_RESOLUTION, JSON_IMAGERESOLUTION);
- JSON_IMAGEFIELD.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED, JsonUtils.createJsonArray(Test.GENERAL_FILETYPE_LIST));
- JSON_IMAGEFIELD.put(ImageField.KEY_NAME, ImageFieldName.graphic);
- JSON_IMAGEFIELDS.put(JSON_IMAGEFIELD);
-
- JSONObject jsonTEC = new JSONObject();
- jsonTEC.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE, GENERAL_BOOLEAN);
- jsonTEC.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, GENERAL_BOOLEAN);
- jsonTEC.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, GENERAL_BOOLEAN);
-
- JSON_SCREENPARAMS.put(ScreenParams.KEY_RESOLUTION, JSON_IMAGERESOLUTION);
- JSON_SCREENPARAMS.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE, jsonTEC);
-
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_DISPLAY_TYPE, GENERAL_DISPLAYTYPE);
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_DISPLAY_NAME, GENERAL_STRING);
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED, GENERAL_BOOLEAN);
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_IMAGE_FIELDS, JSON_IMAGEFIELDS);
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS, JsonUtils.createJsonArray(GENERAL_MEDIACLOCKFORMAT_LIST));
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_NUM_CUSTOM_PRESETS_AVAILABLE, GENERAL_INT);
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_SCREEN_PARAMS, JSON_SCREENPARAMS);
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(GENERAL_STRING_LIST));
- JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_TEXT_FIELDS, JSON_TEXTFIELDS);
-
- JSON_TOUCHCOORD.put(TouchCoord.KEY_X, GENERAL_INT);
- JSON_TOUCHCOORD.put(TouchCoord.KEY_Y, GENERAL_INT);
- JSON_TOUCHCOORDS.put(JSON_TOUCHCOORD);
-
- JSON_TOUCHEVENT.put(TouchEvent.KEY_C, JSON_TOUCHCOORDS);
- JSON_TOUCHEVENT.put(TouchEvent.KEY_ID, GENERAL_INT);
- JSON_TOUCHEVENT.put(TouchEvent.KEY_TS, JsonUtils.createJsonArray(GENERAL_LONG_LIST));
- JSON_TOUCHEVENTS.put(JSON_TOUCHEVENT);
-
- JSON_TEXTFIELDTYPES.put(MetadataType.CURRENT_TEMPERATURE);
- JSON_TEXTFIELDTYPES.put(MetadataType.MEDIA_ALBUM);
- JSON_TEXTFIELDTYPES.put(MetadataType.MEDIA_ARTIST);
-
- } catch (JSONException e) {
- Log.e("Test", "Static Json Construction Failed.", e);
- }
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java
deleted file mode 100644
index 66112be33..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java
+++ /dev/null
@@ -1,2919 +0,0 @@
-package com.smartdevicelink.test;
-
-import java.util.Iterator;
-import java.util.List;
-
-import com.smartdevicelink.managers.file.filetypes.SdlFile;
-import com.smartdevicelink.protocol.enums.FrameData;
-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;
-import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.Choice;
-import com.smartdevicelink.proxy.rpc.ClimateControlCapabilities;
-import com.smartdevicelink.proxy.rpc.ClimateControlData;
-import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
-import com.smartdevicelink.proxy.rpc.Coordinate;
-import com.smartdevicelink.proxy.rpc.DIDResult;
-import com.smartdevicelink.proxy.rpc.DeviceInfo;
-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;
-import com.smartdevicelink.proxy.rpc.ModuleData;
-import com.smartdevicelink.proxy.rpc.MyKey;
-import com.smartdevicelink.proxy.rpc.NavigationCapability;
-import com.smartdevicelink.proxy.rpc.OasisAddress;
-import com.smartdevicelink.proxy.rpc.ParameterPermissions;
-import com.smartdevicelink.proxy.rpc.PermissionItem;
-import com.smartdevicelink.proxy.rpc.PhoneCapability;
-import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
-import com.smartdevicelink.proxy.rpc.RGBColor;
-import com.smartdevicelink.proxy.rpc.RadioControlCapabilities;
-import com.smartdevicelink.proxy.rpc.RadioControlData;
-import com.smartdevicelink.proxy.rpc.RdsData;
-import com.smartdevicelink.proxy.rpc.Rectangle;
-import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities;
-import com.smartdevicelink.proxy.rpc.ScreenParams;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-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;
-import com.smartdevicelink.proxy.rpc.TextField;
-import com.smartdevicelink.proxy.rpc.TireStatus;
-import com.smartdevicelink.proxy.rpc.TouchCoord;
-import com.smartdevicelink.proxy.rpc.TouchEvent;
-import com.smartdevicelink.proxy.rpc.TouchEventCapabilities;
-import com.smartdevicelink.proxy.rpc.Turn;
-import com.smartdevicelink.proxy.rpc.VehicleDataResult;
-import com.smartdevicelink.proxy.rpc.VehicleType;
-import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
-import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
-import com.smartdevicelink.proxy.rpc.VrHelpItem;
-import com.smartdevicelink.proxy.rpc.enums.DefrostZone;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.VentilationMode;
-
-public class Validator{
-
- // TODO: This class could be (mostly) eliminated if all RPC classes implement their own .equals() and .hashCode() methods.
- // Some special methods do exist for pseudo-enums (FrameType, SessionType, FrameData, FrameDataControlFrame)
-
- private Validator(){}
-
- public static boolean validateMenuParams(MenuParams menuParams1, MenuParams menuParams2){
- if(menuParams1 == null){
- return ( menuParams2 == null );
- }
- if(menuParams2 == null){
- return ( menuParams1 == null );
- }
-
- return ( menuParams1.getMenuName().equals(menuParams2.getMenuName())
- && menuParams1.getParentID() == menuParams2.getParentID() && menuParams1.getPosition() == menuParams2
- .getPosition() );
- }
-
- public static boolean validateVehicleDataResult(VehicleDataResult result1, VehicleDataResult result2){
- if(result1 == null){
- return ( result2 == null );
- }
- if(result2 == null){
- return ( result1 == null );
- }
-
- return ( result1.getDataType().equals(result2.getDataType())
- && result1.getResultCode().equals(result2.getResultCode()) );
- }
-
- public static boolean validateBulkData(byte[] array1, byte[] array2){
- if(array1 == null){
- return ( array2 == null );
- }
- if(array2 == null){
- return ( array1 == null );
- }
-
- if(array1.length != array2.length){
- return false;
- }
-
- for(int i = 0; i < array1.length; i++){
- if(array1[i] != array2[i]){
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateFrameTypeArray (FrameType[] array1, FrameType[] array2) {
-
- if (array1 == null) {
- return (array2 == null);
- }
-
- if (array2 == null) {
- return (array1 == null);
- }
-
- if (array1.length != array2.length) {
- return false;
- }
-
- for (int i = 0; i < array1.length; i++) {
- if (array1[i] != array2[i]) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateSessionTypeArray (SessionType[] array1, SessionType[] array2) {
-
- if (array1 == null) {
- return (array2 == null);
- }
-
- if (array2 == null) {
- return (array1 == null);
- }
-
- if (array1.length != array2.length) {
- return false;
- }
-
- for (int i = 0; i < array1.length; i++) {
- if (array1[i] != array2[i]) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateFrameDataControlFrameTypeArray (FrameDataControlFrameType[] array1, FrameDataControlFrameType[] array2) {
-
- if (array1 == null) {
- return (array2 == null);
- }
-
- if (array2 == null) {
- return (array1 == null);
- }
-
- if (array1.length != array2.length) {
- return false;
- }
-
- for (int i = 0; i < array1.length; i++) {
- if (array1[i] != array2[i]) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateFrameDataArray (FrameData[] array1, FrameData[] array2) {
- if (array1 == null) {
- return (array2 == null);
- }
-
- if (array2 == null) {
- return (array1 == null);
- }
-
- if (array1.length != array2.length) {
- return false;
- }
-
- for (int i = 0; i < array1.length; i++) {
- if (array1[i] != array2[i]) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateImage(Image image1, Image image2){
- if(image1 == null){
- return ( image2 == null );
- }
- if(image2 == null){
- return ( image1 == null );
- }
-
- if(!( image1.getValue().equals(image2.getValue()) )){
- log("validateImage",
- "image1 name \"" + image1.getValue() + "\" didn't match image2 name \"" + image2.getValue() + "\".");
- return false;
- }
-
- if(image1.getImageType() != image2.getImageType()){
- log("validateImage",
- "image1 type \"" + image1.getImageType() + "\" didn't match image2 type \"" + image2.getImageType()
- + "\".");
- return false;
- }
-
- return true;
- }
-
- public static boolean validateSdlFile(SdlFile sdlFile1, SdlFile sdlFile2){
- if(sdlFile1 == null){
- return ( sdlFile2 == null );
- }
- if(sdlFile2 == null){
- return ( sdlFile1 == null );
- }
-
- if(!( sdlFile1.getName().equals(sdlFile2.getName()) )){
- log("validateSdlFile",
- "sdlFile1 name \"" + sdlFile1.getName() + "\" didn't match sdlFile2 name \"" + sdlFile2.getName() + "\".");
- return false;
- }
-
- if(sdlFile1.getResourceId() != sdlFile2.getResourceId() ){
- log("validateSdlFile",
- "sdlFile1 resourceId \"" + sdlFile1.getName() + "\" didn't match sdlFile2 resourceId \"" + sdlFile2.getName() + "\".");
- return false;
- }
-
- if(!( sdlFile1.getType().equals(sdlFile2.getType()) )){
- log("validateSdlFile",
- "sdlFile1 type \"" + sdlFile1.getType() + "\" didn't match sdlFile2 type \"" + sdlFile2.getType() + "\".");
- return false;
- }
-
- if( (sdlFile1.getUri() != sdlFile2.getUri()) && !( sdlFile1.getUri().equals(sdlFile2.getUri()) )){
- log("validateSdlFile",
- "sdlFile1 uri \"" + sdlFile1.getUri() + "\" didn't match sdlFile2 uri \"" + sdlFile2.getUri() + "\".");
- return false;
- }
-
-
- return true;
- }
-
- public static boolean validateStringList(List<String> vrCommands1, List<String> vrCommands2){
- if(vrCommands1 == null){
- return ( vrCommands2 == null );
- }
- if(vrCommands2 == null){
- return ( vrCommands1 == null );
- }
-
- for(int i = 0; i < vrCommands1.size(); i++){
- if(!vrCommands1.get(i).equals(vrCommands2.get(i))){
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateIntegerList(List<Integer> intList1, List<Integer> intList2){
- if(intList1 == null){
- return ( intList2 == null );
- }
- if(intList2 == null){
- return ( intList1 == null );
- }
-
- for(int i = 0; i < intList1.size(); i++){
- if(!intList1.get(i).equals(intList2.get(i))){
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateLongList(List<Long> intList1, List<Long> intList2){
- if(intList1 == null){
- return ( intList2 == null );
- }
- if(intList2 == null){
- return ( intList1 == null );
- }
-
- for(int i = 0; i < intList1.size(); i++){
- if(!intList1.get(i).equals(intList2.get(i))){
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateSoftButton(SoftButton button1, SoftButton button2){
- return validateImage(button1.getImage(), button2.getImage())
- && validateText(button1.getText(), button2.getText())
- && button1.getIsHighlighted() == button2.getIsHighlighted()
- && button1.getSoftButtonID() == button2.getSoftButtonID()
- && button1.getSystemAction() == button2.getSystemAction()
- && button1.getType() == button2.getType();
- }
-
- public static boolean validateSoftButtons(List<SoftButton> list1, List<SoftButton> list2){
- if(list1 == null){
- return ( list2 == null );
- }
- if(list2 == null){
- return ( list1 == null );
- }
-
- Iterator<SoftButton> iterator1 = list1.iterator();
- Iterator<SoftButton> iterator2 = list2.iterator();
-
- while(iterator1.hasNext() && iterator2.hasNext()){
- SoftButton button1 = iterator1.next();
- SoftButton button2 = iterator2.next();
-
- if(!validateSoftButton(button1, button2)){
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateCoordinate(Coordinate c1, Coordinate c2){
- if(c1 == null){
- return ( c2 == null );
- }
- if(c2 == null){
- return ( c1 == null );
- }
-
- if(c1.getLatitudeDegrees() != c2.getLatitudeDegrees()){
- return false;
- }
-
- if(c1.getLongitudeDegrees() != c2.getLongitudeDegrees()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateRectangle(Rectangle c1, Rectangle c2){
- if(c1 == null){
- return ( c2 == null );
- }
- if(c2 == null){
- return ( c1 == null );
- }
-
- if(c1.getX() != c2.getX()){
- return false;
- }
-
- if(c1.getY() != c2.getY()){
- return false;
- }
-
- if(c1.getWidth() != c2.getWidth()){
- return false;
- }
-
- if(c1.getHeight() != c2.getHeight()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateOasisAddress(OasisAddress a1, OasisAddress a2){
- if(a1 == null){
- return ( a2 == null );
- }
- if(a2 == null){
- return ( a1 == null );
- }
-
- if(!a1.getAdministrativeArea().equals(a2.getAdministrativeArea())){
- return false;
- }
-
- if(!a1.getCountryCode().equals(a2.getCountryCode())){
- return false;
- }
-
- if(!a1.getCountryName().equals(a2.getCountryName())){
- return false;
- }
-
- if(!a1.getLocality().equals(a2.getLocality())){
- return false;
- }
-
- if(!a1.getSubLocality().equals(a2.getSubLocality())){
- return false;
- }
-
- if(!a1.getSubAdministrativeArea().equals(a2.getSubAdministrativeArea())){
- return false;
- }
-
- if(!a1.getPostalCode().equals(a2.getPostalCode())){
- return false;
- }
-
- if(!a1.getThoroughfare().equals(a2.getThoroughfare())){
- return false;
- }
-
- if(!a1.getSubThoroughfare().equals(a2.getSubThoroughfare())){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateTtsChunks(List<TTSChunk> list1, List<TTSChunk> list2){
- if(list1 == null){
- return ( list2 == null );
- }
- if(list2 == null){
- return ( list1 == null );
- }
-
- Iterator<TTSChunk> iterator1 = list1.iterator();
- Iterator<TTSChunk> iterator2 = list2.iterator();
-
- while(iterator1.hasNext() && iterator2.hasNext()){
- TTSChunk chunk1 = iterator1.next();
- TTSChunk chunk2 = iterator2.next();
-
- if(!validateText(chunk1.getText(), chunk2.getText()) || chunk1.getType() != chunk2.getType()){
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateChoice(Choice choice1, Choice choice2){
- if(choice1 == null){
- return ( choice2 == null );
- }
- if(choice2 == null){
- return ( choice1 == null );
- }
-
- if(!( validateImage(choice1.getImage(), choice2.getImage()) )){
- log("validateChoice", "choice1 image \"" + choice1.getImage() + "\" didn't match choice2 image \""
- + choice2.getImage() + "\"");
- return false;
- }
- if(!( validateImage(choice1.getSecondaryImage(), choice2.getSecondaryImage()) )){
- log("validateChoice", "choice1 secondary image \"" + choice1.getSecondaryImage()
- + "\" didn't match choice2 image \"" + choice2.getSecondaryImage() + "\"");
- return false;
- }
- if(choice1.getChoiceID() != choice2.getChoiceID()){
- log("validateChoice",
- "choice1 ID \"" + choice1.getChoiceID() + "\" didn't match choice2 ID \"" + choice2.getChoiceID()
- + "\"");
- return false;
- }
- if(!( validateText(choice1.getMenuName(), choice2.getMenuName()) )){
- log("validateChoice", "choice1 menu name \"" + choice1.getMenuName()
- + "\" didn't match choice2 menu name \"" + choice2.getMenuName() + "\"");
- return false;
- }
- if(!( validateText(choice1.getSecondaryText(), choice2.getSecondaryText()) )){
- log("validateChoice", "choice1 secondary text \"" + choice1.getSecondaryText()
- + "\" didn't match choice2 secondary text \"" + choice2.getSecondaryText() + "\"");
- return false;
- }
- if(!( validateText(choice1.getTertiaryText(), choice2.getTertiaryText()) )){
- log("validateChoice", "choice1 tertiary text \"" + choice1.getTertiaryText()
- + "\" didn't match choice2 tertiary text \"" + choice2.getTertiaryText() + "\"");
- return false;
- }
- if(!( validateStringList(choice1.getVrCommands(), choice2.getVrCommands()) )){
- log("validateChoice", "choice1 VR commands \"" + choice1.getVrCommands()
- + "\" didn't match choice2 VR commands \"" + choice2.getVrCommands() + "\"");
- return false;
- }
-
- return true;
- }
-
- public static boolean validateText(String text1, String text2){
- if(text1 == null){
- return ( text2 == null );
- }
- if(text2 == null){
- return ( text1 == null );
- }
-
- return text1.equals(text2);
- }
-
- public static boolean validateScreenParams(ScreenParams params1, ScreenParams params2){
- if(params1 == null){
- return ( params2 == null );
- }
- if(params2 == null){
- return ( params1 == null );
- }
-
- if(!( validateImageResolution(params1.getImageResolution(), params2.getImageResolution()) )){
- log("validateScreenParams", "Image resolutions didn't match!");
- return false;
- }
-
- if(!( validateTouchEventCapabilities(params1.getTouchEventAvailable(), params2.getTouchEventAvailable()) )){
- log("validateScreenParams", "Touch event capabilities didn't match!");
- return false;
- }
-
- return true;
- }
-
- public static boolean validateImageResolution(ImageResolution image1, ImageResolution image2){
- if(image1 == null){
- return ( image2 == null );
- }
- if(image2 == null){
- return ( image1 == null );
- }
-
- if((int) image1.getResolutionHeight() != (int) image2.getResolutionHeight()){
- log("validateImageResolution",
- "Height " + image1.getResolutionHeight() + " didn't match height " + image2.getResolutionHeight()
- + ".");
- return false;
- }
-
- if((int) image1.getResolutionWidth() != (int) image2.getResolutionWidth()){
- log("validateImageResolution",
- "Width " + image1.getResolutionWidth() + " didn't match width " + image2.getResolutionWidth() + ".");
- return false;
- }
-
- return true;
- }
-
- public static boolean validateTemperature(Temperature temperature1, Temperature temperature2){
- if(temperature1 == null){
- return ( temperature2 == null );
- }
- if(temperature2 == null){
- return ( temperature1 == null );
- }
-
- if((float) temperature1.getValue() != (float) temperature2.getValue()){
- log("validateTemperature",
- "Value " + temperature1.getValue() + " didn't match value " + temperature2.getValue()
- + ".");
- return false;
- }
-
- if(temperature1.getUnit() != temperature2.getUnit()){
- log("validateTemperature",
- "Unit " + temperature1.getUnit() + " didn't match unit " + temperature2.getUnit() + ".");
- return false;
- }
-
- return true;
- }
-
- public static boolean validateRdsData(RdsData rdsData1, RdsData rdsData2){
- if(rdsData1 == null){
- return ( rdsData2 == null );
- }
- if(rdsData2 == null){
- return ( rdsData1 == null );
- }
-
- if(rdsData1.getProgramService() != rdsData2.getProgramService()){
- log("validateRdsData",
- "Ps " + rdsData1.getProgramService() + " didn't match Ps " + rdsData2.getProgramService()
- + ".");
- return false;
- }
-
- if(rdsData1.getRadioText() != rdsData2.getRadioText()){
- log("validateRdsData",
- "Rt " + rdsData1.getRadioText() + " didn't match Rt " + rdsData2.getRadioText()
- + ".");
- return false;
- }
-
- if(rdsData1.getClockText() != rdsData2.getClockText()){
- log("validateRdsData",
- "Ct " + rdsData1.getClockText() + " didn't match Ct " + rdsData2.getClockText()
- + ".");
- return false;
- }
-
- if(rdsData1.getProgramIdentification() != rdsData2.getProgramIdentification()){
- log("validateRdsData",
- "Pi " + rdsData1.getProgramIdentification() + " didn't match Pi " + rdsData2.getProgramIdentification()
- + ".");
- return false;
- }
-
- if(rdsData1.getRegion() != rdsData2.getRegion()){
- log("validateRdsData",
- "Reg " + rdsData1.getRegion() + " didn't match Reg " + rdsData2.getRegion()
- + ".");
- return false;
- }
-
- if(rdsData1.getTrafficProgram() != rdsData2.getTrafficProgram()){
- log("validateRdsData",
- "Tp " + rdsData1.getTrafficProgram() + " didn't match Tp " + rdsData2.getTrafficProgram()
- + ".");
- return false;
- }
-
- if(rdsData1.getTrafficAnnouncement() != rdsData2.getTrafficAnnouncement()){
- log("validateRdsData",
- "Ta " + rdsData1.getTrafficAnnouncement() + " didn't match Ta " + rdsData2.getTrafficAnnouncement()
- + ".");
- return false;
- }
-
- if(rdsData1.getProgramType() != rdsData2.getProgramType()){
- log("validateRdsData",
- "Pty " + rdsData1.getProgramType() + " didn't match Pty " + rdsData2.getProgramType()
- + ".");
- return false;
- }
-
- 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 );
- }
- if(climateControlData2 == null){
- return ( climateControlData1 == null );
- }
-
- if(climateControlData1.getFanSpeed() != climateControlData2.getFanSpeed()){
- log("validateClimateControlData",
- "FanSpeed " + climateControlData1.getFanSpeed() + " didn't match fanSpeed " + climateControlData2.getFanSpeed()
- + ".");
- return false;
- }
-
- if(!( validateTemperature(climateControlData1.getCurrentTemperature(), climateControlData2.getCurrentTemperature()) )){
- return false;
- }
-
- if(!( validateTemperature(climateControlData1.getDesiredTemperature(), climateControlData2.getDesiredTemperature()) )){
- return false;
- }
-
- if(climateControlData1.getAcEnable() != climateControlData2.getAcEnable()){
- log("validateClimateControlData",
- "AcEnable " + climateControlData1.getAcEnable() + " didn't match AcEnable " + climateControlData2.getAcEnable()
- + ".");
- return false;
- }
-
- if(climateControlData1.getCirculateAirEnable() != climateControlData2.getCirculateAirEnable()){
- log("validateClimateControlData",
- "CirculateAirEnable " + climateControlData1.getCirculateAirEnable() + " didn't match CirculateAirEnable " + climateControlData2.getCirculateAirEnable()
- + ".");
- return false;
- }
-
- if(climateControlData1.getAutoModeEnable() != climateControlData2.getAutoModeEnable()){
- log("validateClimateControlData",
- "AutoModeEnable " + climateControlData1.getAutoModeEnable() + " didn't match AutoModeEnable " + climateControlData2.getAutoModeEnable()
- + ".");
- return false;
- }
-
- if(climateControlData1.getDefrostZone() != climateControlData2.getDefrostZone()){
- log("validateClimateControlData",
- "DefrostZone " + climateControlData1.getDefrostZone() + " didn't match DefrostZone " + climateControlData2.getDefrostZone()
- + ".");
- return false;
- }
-
- if(climateControlData1.getDualModeEnable() != climateControlData2.getDualModeEnable()){
- log("validateClimateControlData",
- "DualModeEnable " + climateControlData1.getDualModeEnable() + " didn't match DualModeEnable " + climateControlData2.getDualModeEnable()
- + ".");
- return false;
- }
-
- if(climateControlData1.getAcMaxEnable() != climateControlData2.getAcMaxEnable()){
- log("validateClimateControlData",
- "AcMaxEnable " + climateControlData1.getAcMaxEnable() + " didn't match AcMaxEnable " + climateControlData2.getAcMaxEnable()
- + ".");
- return false;
- }
-
- if(climateControlData1.getVentilationMode() != climateControlData2.getVentilationMode()){
- log("validateClimateControlData",
- "VentilationMode " + climateControlData1.getVentilationMode() + " didn't match VentilationMode " + climateControlData2.getVentilationMode()
- + ".");
- return false;
- }
-
-
- return true;
- }
-
- public static boolean validateSeatControlData(SeatControlData seatControlData1, SeatControlData seatControlData2) {
- if (seatControlData1 == null) {
- return (seatControlData2 == null);
- }
- if (seatControlData2 == null) {
- return (seatControlData1 == null);
- }
-
- if (seatControlData1.getCoolingEnabled() != seatControlData2.getCoolingEnabled()) {
- return false;
- }
- if (seatControlData1.getHeatingEnabled() != seatControlData2.getHeatingEnabled()) {
- return false;
- }
- if (seatControlData1.getMassageEnabled() != seatControlData2.getMassageEnabled()) {
- return false;
- }
- if (seatControlData1.getBackTiltAngle() != seatControlData2.getBackTiltAngle()) {
- return false;
- }
- if (seatControlData1.getBackVerticalPosition() != seatControlData2.getBackVerticalPosition()) {
- return false;
- }
- if (seatControlData1.getCoolingLevel() != seatControlData2.getCoolingLevel()) {
- return false;
- }
- if (seatControlData1.getFrontVerticalPosition() != seatControlData2.getFrontVerticalPosition()) {
- return false;
- }
- if (seatControlData1.getHeadSupportHorizontalPosition() != seatControlData2.getHeadSupportHorizontalPosition()) {
- return false;
- }
- if (seatControlData1.getHeadSupportVerticalPosition() != seatControlData2.getHeadSupportVerticalPosition()) {
- return false;
- }
- if (seatControlData1.getHeatingLevel() != seatControlData2.getHeatingLevel()) {
- return false;
- }
- if (seatControlData1.getHorizontalPosition() != seatControlData2.getHorizontalPosition()) {
- return false;
- }
- if (seatControlData1.getId() != seatControlData2.getId()) {
- return false;
- }
-
- if (!(validateSeatMemoryAction(seatControlData1.getMemory(), seatControlData2.getMemory()))) {
- return false;
- }
-
- if (!(validateSeatMemoryAction(seatControlData1.getMemory(), seatControlData2.getMemory()))) {
- return false;
- }
-
- 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 );
- }
- if(moduleData2 == null){
- return ( moduleData1 == null );
- }
-
- if(moduleData1.getModuleType() != moduleData2.getModuleType()){
- log("validateModuleData",
- "ModuleType " + moduleData1.getModuleType() + " didn't match ModuleType " + moduleData2.getModuleType()
- + ".");
- return false;
- }
-
- if(!( validateRadioControlData(moduleData1.getRadioControlData(), moduleData2.getRadioControlData()) )){
- return false;
- }
-
- if(!( validateClimateControlData(moduleData1.getClimateControlData(), moduleData2.getClimateControlData()) )){
- return false;
- }
-
- 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 );
- }
- if(remoteControlCapabilities2 == null){
- return ( remoteControlCapabilities1 == null );
- }
-
- if(!( validateButtonCapabilities(remoteControlCapabilities1.getButtonCapabilities(), remoteControlCapabilities2.getButtonCapabilities()) )){
- return false;
- }
-
- if(!( validateRadioControlCapabilities(remoteControlCapabilities1.getRadioControlCapabilities(), remoteControlCapabilities2.getRadioControlCapabilities()) )){
- return false;
- }
-
- if(!( validateClimateControlCapabilities(remoteControlCapabilities1.getClimateControlCapabilities(), remoteControlCapabilities2.getClimateControlCapabilities()) )){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateRadioControlData(RadioControlData radioControlData1, RadioControlData radioControlData2){
- if(radioControlData1 == null){
- return ( radioControlData2 == null );
- }
- if(radioControlData2 == null){
- return ( radioControlData1 == null );
- }
-
- if(radioControlData1.getFrequencyInteger() != radioControlData2.getFrequencyInteger()){
- log("validateRadioControlData",
- "FrequencyInteger " + radioControlData1.getFrequencyInteger() + " didn't match FrequencyInteger " + radioControlData2.getFrequencyInteger()
- + ".");
- return false;
- }
-
- if(radioControlData1.getFrequencyFraction() != radioControlData2.getFrequencyFraction()){
- log("validateRadioControlData",
- "FrequencyFraction " + radioControlData1.getFrequencyFraction() + " didn't match FrequencyFraction " + radioControlData2.getFrequencyFraction()
- + ".");
- return false;
- }
-
- if(radioControlData1.getBand() != radioControlData2.getBand()){
- log("validateRadioControlData",
- "Band " + radioControlData1.getBand() + " didn't match Band " + radioControlData2.getBand()
- + ".");
- return false;
- }
-
- if(!( validateRdsData(radioControlData1.getRdsData(), radioControlData2.getRdsData()) )){
- return false;
- }
-
- if(radioControlData1.getAvailableHDs() != radioControlData2.getAvailableHDs()){
- log("validateRadioControlData",
- "AvailableHDs " + radioControlData1.getAvailableHDs() + " didn't match AvailableHDs " + radioControlData2.getAvailableHDs()
- + ".");
- return false;
- }
-
- if(radioControlData1.getHdChannel() != radioControlData2.getHdChannel()){
- log("validateRadioControlData",
- "HdChannel " + radioControlData1.getHdChannel() + " didn't match HdChannel " + radioControlData2.getHdChannel()
- + ".");
- return false;
- }
-
- if(radioControlData1.getSignalStrength() != radioControlData2.getSignalStrength()){
- log("validateRadioControlData",
- "SignalStrength " + radioControlData1.getSignalStrength() + " didn't match SignalStrength " + radioControlData2.getSignalStrength()
- + ".");
- return false;
- }
-
- if(radioControlData1.getSignalChangeThreshold() != radioControlData2.getSignalChangeThreshold()){
- log("validateRadioControlData",
- "SignalChangeThreshold " + radioControlData1.getSignalChangeThreshold() + " didn't match SignalChangeThreshold " + radioControlData2.getSignalChangeThreshold()
- + ".");
- return false;
- }
-
- if(radioControlData1.getRadioEnable() != radioControlData2.getRadioEnable()){
- log("validateRadioControlData",
- "RadioEnable " + radioControlData1.getRadioEnable() + " didn't match RadioEnable " + radioControlData2.getRadioEnable()
- + ".");
- return false;
- }
-
- if(radioControlData1.getState() != radioControlData2.getState()){
- log("validateRadioControlData",
- "State " + radioControlData1.getState() + " didn't match State " + radioControlData2.getState()
- + ".");
- return false;
- }
-
- return true;
- }
-
- public static boolean validateNavigationCapability(NavigationCapability navigationCapability1, NavigationCapability navigationCapability2){
- if(navigationCapability1 == null){
- return ( navigationCapability2 == null );
- }
- if(navigationCapability2 == null){
- return ( navigationCapability1 == null );
- }
-
- if(navigationCapability1.getSendLocationEnabled() != navigationCapability2.getSendLocationEnabled()){
- log("validateNavigationCapability",
- "SendLocationEnabled " + navigationCapability1.getSendLocationEnabled() + " didn't match SendLocationEnabled " + navigationCapability2.getSendLocationEnabled()
- + ".");
- return false;
- }
-
- if(navigationCapability1.getWayPointsEnabled() != navigationCapability2.getWayPointsEnabled()){
- log("validateNavigationCapability",
- "WayPointsEnabled " + navigationCapability1.getWayPointsEnabled() + " didn't match WayPointsEnabled " + navigationCapability2.getWayPointsEnabled() + ".");
- return false;
- }
-
- return true;
- }
-
- public static boolean validatePhoneCapability(PhoneCapability phoneCapability1, PhoneCapability phoneCapability2){
- if(phoneCapability1 == null){
- return ( phoneCapability2 == null );
- }
- if(phoneCapability2 == null){
- return ( phoneCapability1 == null );
- }
-
- if(phoneCapability1.getDialNumberEnabled() != phoneCapability2.getDialNumberEnabled()){
- log("validatePhoneCapability",
- "DialNumberEnabled " + phoneCapability1.getDialNumberEnabled() + " didn't match DialNumberEnabled " + phoneCapability1.getDialNumberEnabled()
- + ".");
- return false;
- }
-
- return true;
- }
-
- public static boolean validateTouchEventCapabilities(TouchEventCapabilities item1, TouchEventCapabilities item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getPressAvailable() != item2.getPressAvailable()){
- log("validateTouchEventCapabilities", "Press available \"" + item1.getPressAvailable()
- + "\" didn't match press available \"" + item1.getPressAvailable() + "\".");
- return false;
- }
-
- if(item1.getDoublePressAvailable() != item2.getDoublePressAvailable()){
- log("validateTouchEventCapabilities", "Double press available \"" + item1.getDoublePressAvailable()
- + "\" didn't match double press available \"" + item1.getDoublePressAvailable() + "\".");
- return false;
- }
-
- if(item1.getMultiTouchAvailable() != item2.getMultiTouchAvailable()){
- log("validateTouchEventCapabilities", "Multi-touch available \"" + item1.getMultiTouchAvailable()
- + "\" didn't match multi-touch available \"" + item1.getMultiTouchAvailable() + "\".");
- return false;
- }
-
- return true;
- }
-
- public static boolean validateSeatMemoryAction(SeatMemoryAction item1, SeatMemoryAction item2) {
- if (item1 == null) {
- return (item2 == null);
- }
- if (item2 == null) {
- return (item1 == null);
- }
-
- if (item1.getAction() == null) {
- return (item2.getAction() == null);
- }
-
- if (item1.getAction() != item2.getAction()) {
- return false;
- }
-
- if (item1.getId() != item2.getId()) {
- return false;
- }
-
- if (item1.getLabel() != item2.getLabel()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateTextFields(TextField item1, TextField item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getCharacterSet() != item2.getCharacterSet()){
- return false;
- }
- if(item1.getName() != item2.getName()){
- return false;
- }
- if(item1.getRows() != item2.getRows()){
- return false;
- }
- if(item1.getWidth() != item2.getWidth()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateImageFields(ImageField item1, ImageField item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
- if(! (validateFileTypes(item1.getImageTypeSupported(), item2.getImageTypeSupported()) )){
- return false;
- }
- if(item1.getName() != item2.getName()){
- return false;
- }
- if(!( validateImageResolution(item1.getImageResolution(), item2.getImageResolution()) )){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateFileTypes (List<FileType> item1, List<FileType> 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 (item1.get(i) != item2.get(i)) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateGpsData(GPSData item1, GPSData item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getActual() != item2.getActual()){
- return false;
- }
- if(item1.getAltitude() != item2.getAltitude()){
- return false;
- }
- if(item1.getCompassDirection() != item2.getCompassDirection()){
- return false;
- }
- if(item1.getDimension() != item2.getDimension()){
- return false;
- }
- if(item1.getHdop() != item2.getHdop()){
- return false;
- }
- if(item1.getHeading() != item2.getHeading()){
- return false;
- }
- if(item1.getLatitudeDegrees() != item2.getLatitudeDegrees()){
- return false;
- }
- if(item1.getLongitudeDegrees() != item2.getLongitudeDegrees()){
- return false;
- }
- if(item1.getPdop() != item2.getPdop()){
- return false;
- }
- if(item1.getSatellites() != item2.getSatellites()){
- return false;
- }
- if(item1.getSpeed() != item2.getSpeed()){
- return false;
- }
- if(item1.getUtcDay() != item2.getUtcDay()){
- return false;
- }
- if(item1.getUtcHours() != item2.getUtcHours()){
- return false;
- }
- if(item1.getUtcMinutes() != item1.getUtcMinutes()){
- return false;
- }
- if(item1.getUtcMonth() != item2.getUtcMonth()){
- return false;
- }
- if(item1.getUtcSeconds() != item2.getUtcSeconds()){
- return false;
- }
- if(item1.getUtcYear() != item2.getUtcYear()){
- return false;
- }
- if(item1.getVdop() != item2.getVdop()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateTireStatus(TireStatus item1, TireStatus item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getPressureTellTale() != item2.getPressureTellTale()){
- return false;
- }
-
- SingleTireStatus item1Status = item1.getLeftFront();
- SingleTireStatus item2Status = item2.getLeftFront();
- boolean isEqual = validateSingleTireStatus(item1Status, item2Status);
- if(!isEqual) return false;
- item1Status = item1.getRightFront();
- item2Status = item2.getRightFront();
- isEqual = validateSingleTireStatus(item1Status, item2Status);
- if(!isEqual) return false;
- item1Status = item1.getLeftRear();
- item2Status = item2.getLeftRear();
- isEqual = validateSingleTireStatus(item1Status, item2Status);
- if(!isEqual) return false;
- item1Status = item1.getRightRear();
- item2Status = item2.getRightRear();
- isEqual = validateSingleTireStatus(item1Status, item2Status);
- if(!isEqual) return false;
- item1Status = item1.getInnerLeftRear();
- item2Status = item2.getInnerLeftRear();
- isEqual = validateSingleTireStatus(item1Status, item2Status);
- if(!isEqual) return false;
- item1Status = item1.getInnerRightRear();
- item2Status = item2.getInnerRightRear();
- isEqual = validateSingleTireStatus(item1Status, item2Status);
- if(!isEqual) return false;
-
- return true;
- }
-
- public static boolean validateSingleTireStatus(SingleTireStatus item1, SingleTireStatus item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getStatus() != item2.getStatus()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateBeltStatus(BeltStatus item1, BeltStatus item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getLeftRearInflatableBelted() != item2.getLeftRearInflatableBelted()){
- return false;
- }
- if(item1.getRightRearInflatableBelted() != item2.getRightRearInflatableBelted()){
- return false;
- }
- if(item1.getPassengerChildDetected() != item2.getPassengerChildDetected()){
- return false;
- }
- if(item1.getDriverBuckleBelted() != item2.getDriverBuckleBelted()){
- return false;
- }
- if(item1.getPassengerBuckleBelted() != item2.getPassengerBuckleBelted()){
- return false;
- }
- if(item1.getRightRow2BuckleBelted() != item2.getRightRow2BuckleBelted()){
- return false;
- }
- if(item1.getMiddleRow1BuckleBelted() != item2.getMiddleRow1BuckleBelted()){
- return false;
- }
- if(item1.getLeftRow2BuckleBelted() != item2.getLeftRow2BuckleBelted()){
- return false;
- }
- if(item1.getMiddleRow2BuckleBelted() != item2.getMiddleRow2BuckleBelted()){
- return false;
- }
- if(item1.getMiddleRow3BuckleBelted() != item2.getMiddleRow3BuckleBelted()){
- return false;
- }
- if(item1.getLeftRow3BuckleBelted() != item2.getLeftRow3BuckleBelted()){
- return false;
- }
- if(item1.getRightRow3BuckleBelted() != item2.getRightRow3BuckleBelted()){
- return false;
- }
- if(item1.getPassengerBeltDeployed() != item2.getPassengerBeltDeployed()){
- return false;
- }
- if(item1.getMiddleRow1BeltDeployed() != item2.getMiddleRow1BeltDeployed()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateBodyInformation(BodyInformation item1, BodyInformation item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getIgnitionStatus() != item2.getIgnitionStatus()){
- return false;
- }
- if(item1.getIgnitionStableStatus() != item2.getIgnitionStableStatus()){
- return false;
- }
- if(item1.getParkBrakeActive() != item2.getParkBrakeActive()){
- return false;
- }
- if(item1.getDriverDoorAjar() != item2.getDriverDoorAjar()){
- return false;
- }
- if(item1.getPassengerDoorAjar() != item2.getPassengerDoorAjar()){
- return false;
- }
- if(item1.getRearLeftDoorAjar() != item2.getRearLeftDoorAjar()){
- return false;
- }
- if(item1.getRearRightDoorAjar() != item2.getRearRightDoorAjar()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateDeviceStatus(DeviceStatus item1, DeviceStatus item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getBtIconOn() != item2.getBtIconOn()){
- return false;
- }
- if(item1.getCallActive() != item2.getCallActive()){
- return false;
- }
- if(item1.getECallEventActive() != item2.getECallEventActive()){
- return false;
- }
- if(item1.getMonoAudioOutputMuted() != item2.getMonoAudioOutputMuted()){
- return false;
- }
- if(item1.getPhoneRoaming() != item2.getPhoneRoaming()){
- return false;
- }
- if(item1.getStereoAudioOutputMuted() != item2.getStereoAudioOutputMuted()){
- return false;
- }
- if(item1.getTextMsgAvailable() != item2.getTextMsgAvailable()){
- return false;
- }
- if(item1.getVoiceRecOn() != item2.getVoiceRecOn()){
- return false;
- }
- if(item1.getBattLevelStatus() != item2.getBattLevelStatus()){
- return false;
- }
- if(item1.getPrimaryAudioSource() != item2.getPrimaryAudioSource()){
- return false;
- }
- if(item1.getSignalLevelStatus() != item2.getSignalLevelStatus()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateHeadLampStatus(HeadLampStatus item1, HeadLampStatus item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getHighBeamsOn() != item2.getHighBeamsOn()){
- return false;
- }
- if(item1.getLowBeamsOn() != item2.getLowBeamsOn()){
- return false;
- }
- if(item1.getAmbientLightStatus() != item2.getAmbientLightStatus()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateECallInfo(ECallInfo item1, ECallInfo item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getAuxECallNotificationStatus() != item2.getAuxECallNotificationStatus()){
- return false;
- }
- if(item1.getECallConfirmationStatus() != item2.getECallConfirmationStatus()){
- return false;
- }
- if(item1.getECallNotificationStatus() != item2.getECallNotificationStatus()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateAirbagStatus(AirbagStatus item1, AirbagStatus item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
- if(item1.getDriverAirbagDeployed() != item2.getDriverAirbagDeployed()){
- return false;
- }
- if(item1.getDriverSideAirbagDeployed() != item2.getDriverSideAirbagDeployed()){
- return false;
- }
- if(item1.getDriverCurtainAirbagDeployed() != item2.getDriverCurtainAirbagDeployed()){
- return false;
- }
- if(item1.getPassengerAirbagDeployed() != item2.getPassengerAirbagDeployed()){
- return false;
- }
- if(item1.getPassengerCurtainAirbagDeployed() != item2.getPassengerCurtainAirbagDeployed()){
- return false;
- }
- if(item1.getDriverKneeAirbagDeployed() != item2.getDriverKneeAirbagDeployed()){
- return false;
- }
- if(item1.getPassengerSideAirbagDeployed() != item2.getPassengerSideAirbagDeployed()){
- return false;
- }
- if(item1.getPassengerKneeAirbagDeployed() != item2.getPassengerKneeAirbagDeployed()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateEmergencyEvent(EmergencyEvent item1, EmergencyEvent item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getEmergencyEventType() != item2.getEmergencyEventType()){
- return false;
- }
- if(item1.getFuelCutoffStatus() != item2.getFuelCutoffStatus()){
- return false;
- }
- if(item1.getMaximumChangeVelocity() != item2.getMaximumChangeVelocity()){
- return false;
- }
- if(item1.getMultipleEvents() != item2.getMultipleEvents()){
- return false;
- }
- if(item1.getRolloverEvent() != item2.getRolloverEvent()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateClusterModeStatus(ClusterModeStatus item1, ClusterModeStatus item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getPowerModeActive() != item2.getPowerModeActive()){
- return false;
- }
- if(item1.getPowerModeQualificationStatus() != item2.getPowerModeQualificationStatus()){
- return false;
- }
- if(item1.getPowerModeStatus() != item2.getPowerModeStatus()){
- return false;
- }
- if(item1.getCarModeStatus() != item2.getCarModeStatus()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateMyKey(MyKey item1, MyKey item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getE911Override() != item2.getE911Override()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateFuelRange (List<FuelRange> item1, List<FuelRange> 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 (item1.get(i).getType() != item2.get(i).getType()) {
- return false;
- }
- if (item1.get(i).getRange() != item2.get(i).getRange()) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validatePermissionItem(PermissionItem item1, PermissionItem item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
- /*
- if(item1 == item2){
- log("validatePermissionItem", "Items are the same object. No defensive copy took place.");
- return false;
- }
- */
- if(!item1.getRpcName().equals(item2.getRpcName())){
- return false;
- }
-
- if(!validateHmiPermissions(item1.getHMIPermissions(), item2.getHMIPermissions())){
- return false;
- }
-
- if(!validateParameterPermissions(item1.getParameterPermissions(), item2.getParameterPermissions())){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateHmiPermissions(HMIPermissions item1, HMIPermissions item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
- /*
- if(item1 == item2){
- log("validateHmiPermissions", "Items are the same object. No defensive copy took place.");
- return false;
- }
- */
- if(!validateHmiLevelLists(item1.getAllowed(), item2.getAllowed())){
- return false;
- }
-
- List<HMILevel> item1Array = item1.getUserDisallowed();
- List<HMILevel> item2Array = item2.getUserDisallowed();
-
- if(item1Array.size() != item2Array.size()){
- return false;
- }
-
- for(int i = 0; i < item1Array.size(); i++){
- if(item1Array.get(i) != item2Array.get(i)){
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateHmiLevelLists(List<HMILevel> item1Array, List<HMILevel> item2Array) {
- if(item1Array.size() != item2Array.size()){
- return false;
- }
-
- for(int i = 0; i < item1Array.size(); i++){
- if(item1Array.get(i) != item2Array.get(i)){
- return false;
- }
- }
- return true;
- }
-
- public static boolean validateParameterPermissions(ParameterPermissions item1, ParameterPermissions item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
- /*
- if(item1 == item2){
- log("validateParameterPermissions", "Items are the same object. No defensive copy took place.");
- return false;
- }
- */
- if(!validateStringList(item1.getAllowed(), item2.getAllowed())){
- return false;
- }
-
- if(!validateStringList(item1.getUserDisallowed(), item2.getUserDisallowed())){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateTouchEvent(TouchEvent item1, TouchEvent item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1 == item2){
- return true;
- }
-
- List<TouchCoord> tc1 = item1.getC();
- List<TouchCoord> tc2 = item2.getC();
- List<Long> ts1 = item1.getTs();
- List<Long> ts2 = item2.getTs();
-
- for(int i=0; i<tc1.size(); i++){
- if( ! validateTouchCoord(tc1.get(i), tc2.get(i)) ){
- return false;
- }
- if(ts1.get(i) != ts2.get(i)){
- return false;
- }
- }
-
- if(item1.getId() != item2.getId()){
- return false;
- }
-
-
- return true;
- }
-
- public static boolean validateTouchCoord(TouchCoord item1, TouchCoord item2){
- if(item1 == null){
- return ( item2 == null );
- }
- if(item2 == null){
- return ( item1 == null );
- }
-
- if(item1.getX() != item2.getX()){
- return false;
- }
- if(item1.getY() != item2.getY()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateMassageModeData(MassageModeData item1, MassageModeData item2) {
- if (item1 == null) {
- return (item2 == null);
- }
- if (item2 == null) {
- return (item1 == null);
- }
-
- if (item1.getMassageMode() != item2.getMassageMode()) {
- return false;
- }
-
- if (item1.getMassageZone() != item2.getMassageZone()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateMassageModeDataList(List<MassageModeData> item1, List<MassageModeData> 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 (!validateMassageModeData(item1.get(i), item2.get(i))) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateMassageCushionFirmness(MassageCushionFirmness item1, MassageCushionFirmness item2) {
- if (item1 == null) {
- return (item2 == null);
- }
- if (item2 == null) {
- return (item1 == null);
- }
-
- if (item1.getCushion() != item2.getCushion()) {
- return false;
- }
-
- if (item1.getFirmness() != item2.getFirmness()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateMassageCushionFirmnessList(List<MassageCushionFirmness> item1, List<MassageCushionFirmness> 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 (!validateMassageCushionFirmness(item1.get(i), item2.get(i))) {
- return false;
- }
- }
-
- return true;
- }
-
- public static void log(String tag, String msg){
- Logger.log(tag, msg);
- }
-
- public static boolean validateSdlMsgVersion (SdlMsgVersion item1, SdlMsgVersion item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.getMajorVersion() != item2.getMajorVersion() ||
- item1.getMinorVersion() != item2.getMinorVersion()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateDeviceInfo (DeviceInfo item1, DeviceInfo item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.getOs() != item2.getOs() ||
- item1.getCarrier() != item2.getCarrier() ||
- item1.getHardware() != item2.getHardware() ||
- item1.getOsVersion() != item2.getOsVersion() ||
- item1.getFirmwareRev() != item2.getFirmwareRev() ||
- item1.getMaxNumberRFCOMMPorts() != item2.getMaxNumberRFCOMMPorts()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateTemplateColorScheme (TemplateColorScheme item1, TemplateColorScheme item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.getPrimaryColor().getRed() != item2.getPrimaryColor().getRed()
- || item1.getPrimaryColor().getGreen() != item2.getPrimaryColor().getGreen()
- || item1.getPrimaryColor().getBlue() != item2.getPrimaryColor().getBlue()
- || item1.getSecondaryColor().getRed() != item2.getSecondaryColor().getRed()
- || item1.getSecondaryColor().getGreen() != item2.getSecondaryColor().getGreen()
- || item1.getSecondaryColor().getBlue() != item2.getSecondaryColor().getBlue()
- || item1.getBackgroundColor().getRed() != item2.getBackgroundColor().getRed()
- || item1.getBackgroundColor().getGreen() != item2.getBackgroundColor().getGreen()
- || item1.getBackgroundColor().getBlue() != item2.getBackgroundColor().getBlue()
-
- ) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateRGBColor(RGBColor item1, RGBColor item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.getRed() != item2.getRed()
- || item1.getGreen() != item2.getGreen()
- || item1.getBlue() != item2.getBlue() ) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateSupportedFormats (VideoStreamingFormat vsf1, VideoStreamingFormat vsf2) {
- if(vsf1.getProtocol() != vsf2.getProtocol()){
- return false;
- }
-
- if(vsf1.getCodec() != vsf2.getCodec()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateDisplayCapabilities (DisplayCapabilities item1, DisplayCapabilities item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.getDisplayType() == null) {
- return ( item2.getDisplayType() == null );
- }
-
- if (item1.getDisplayType() != item2.getDisplayType()) {
- return false;
- }
-
- if (!item1.getDisplayName().equals(item2.getDisplayName())) {
- return false;
- }
-
- if (item1.getGraphicSupported() != item2.getGraphicSupported()) {
- return false;
- }
- // Failing past here:
- // log("GS", item1.getGraphicSupported() + " : " + item2.getGraphicSupported());
-
- if (!validateStringList(item1.getTemplatesAvailable(),item2.getTemplatesAvailable())) {
- log("TA", item1.getTemplatesAvailable() + " | " + item2.getTemplatesAvailable());
- return false;
- }
-
- if (item1.getNumCustomPresetsAvailable() != item2.getNumCustomPresetsAvailable()) {
- return false;
- }
-
- if (item1.getMediaClockFormats() == null) {
- return ( item2.getMediaClockFormats() == null );
- }
-
- if (item1.getMediaClockFormats().size() != item2.getMediaClockFormats().size()) {
- return false;
- }
-
- for (int i = 0; i < item1.getMediaClockFormats().size(); i++) {
- if (item1.getMediaClockFormats().get(i) == null && item2.getMediaClockFormats().get(i) != null) {
- return false;
- }
-
- if (item1.getMediaClockFormats().get(i) != item2.getMediaClockFormats().get(i)) {
- return false;
- }
- }
-
- if (item1.getTextFields() == null) {
- return ( item2.getTextFields() == null );
- }
-
- if (item1.getTextFields().size() != item2.getTextFields().size()) {
- return false;
- }
-
- for (int i = 0; i < item1.getTextFields().size(); i++) {
- if (item1.getTextFields().get(i) == null && item2.getTextFields().get(i) != null) {
- return false;
- }
-
- if (!validateTextFields(item1.getTextFields().get(i), item2.getTextFields().get(i))) {
- return false;
- }
- }
-
- if (item1.getImageFields() == null) {
- return ( item2.getImageFields() == null );
- }
-
- if (item1.getImageFields().size() != item2.getImageFields().size()) {
- return false;
- }
-
- for (int i = 0; i < item1.getImageFields().size(); i++) {
- if (item1.getImageFields().get(i) == null && item2.getImageFields().get(i) != null) {
- return false;
- }
-
- if (!validateImageFields(item1.getImageFields().get(i), item2.getImageFields().get(i))) {
- return false;
- }
- }
-
- if (!validateScreenParams(item1.getScreenParams(), item2.getScreenParams())) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateButtonCapabilities (List<ButtonCapabilities> item1, List<ButtonCapabilities> 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 (item1.get(i).getName() != item2.get(i).getName()) {
- return false;
- }
- if (item1.get(i).getUpDownAvailable() != item2.get(i).getUpDownAvailable()) {
- return false;
- }
- if (item1.get(i).getLongPressAvailable() != item2.get(i).getLongPressAvailable()) {
- return false;
- }
- if (item1.get(i).getShortPressAvailable() != item2.get(i).getShortPressAvailable()) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateSoftButtonCapabilities (List<SoftButtonCapabilities> item1, List<SoftButtonCapabilities> 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 (item1.get(i).getImageSupported() != item2.get(i).getImageSupported()) {
- return false;
- }
- if (item1.get(i).getUpDownAvailable() != item2.get(i).getUpDownAvailable()) {
- return false;
- }
- if (item1.get(i).getLongPressAvailable() != item2.get(i).getLongPressAvailable()) {
- return false;
- }
- if (item1.get(i).getShortPressAvailable() != item2.get(i).getShortPressAvailable()) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateRadioControlCapabilities (List<RadioControlCapabilities> item1, List<RadioControlCapabilities> 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 (item1.get(i).getModuleName() != item2.get(i).getModuleName()) {
- return false;
- }
- if (item1.get(i).getRadioEnableAvailable() != item2.get(i).getRadioEnableAvailable()) {
- return false;
- }
- if (item1.get(i).getRadioBandAvailable() != item2.get(i).getRadioBandAvailable()) {
- return false;
- }
- if (item1.get(i).getRadioFrequencyAvailable() != item2.get(i).getRadioFrequencyAvailable()) {
- return false;
- }
- if (item1.get(i).getHdChannelAvailable() != item2.get(i).getHdChannelAvailable()) {
- return false;
- }
- if (item1.get(i).getRdsDataAvailable() != item2.get(i).getRdsDataAvailable()) {
- return false;
- }
- if (item1.get(i).getAvailableHDsAvailable() != item2.get(i).getAvailableHDsAvailable()) {
- return false;
- }
- if (item1.get(i).getStateAvailable() != item2.get(i).getStateAvailable()) {
- return false;
- }
- if (item1.get(i).getSignalStrengthAvailable() != item2.get(i).getSignalStrengthAvailable()) {
- return false;
- }
- if (item1.get(i).getSignalChangeThresholdAvailable() != item2.get(i).getSignalChangeThresholdAvailable()) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateClimateControlCapabilities (List<ClimateControlCapabilities> item1, List<ClimateControlCapabilities> 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 (item1.get(i).getModuleName() != item2.get(i).getModuleName()) {
- return false;
- }
- if (item1.get(i).getFanSpeedAvailable() != item2.get(i).getFanSpeedAvailable()) {
- return false;
- }
- if (item1.get(i).getDesiredTemperatureAvailable() != item2.get(i).getDesiredTemperatureAvailable()) {
- return false;
- }
- if (item1.get(i).getAcEnableAvailable() != item2.get(i).getAcEnableAvailable()) {
- return false;
- }
- if (item1.get(i).getAcMaxEnableAvailable() != item2.get(i).getAcMaxEnableAvailable()) {
- return false;
- }
- if (item1.get(i).getCirculateAirEnableAvailable() != item2.get(i).getCirculateAirEnableAvailable()) {
- return false;
- }
- if (item1.get(i).getAutoModeEnableAvailable() != item2.get(i).getAutoModeEnableAvailable()) {
- return false;
- }
- if (item1.get(i).getDualModeEnableAvailable() != item2.get(i).getDualModeEnableAvailable()) {
- return false;
- }
- if (item1.get(i).getDefrostZoneAvailable() != item2.get(i).getDefrostZoneAvailable()) {
- return false;
- }
-
- if(! (validateDefrostZones(item1.get(i).getDefrostZone(), item2.get(i).getDefrostZone()) )){
- return false;
- }
-
- if (item1.get(i).getVentilationModeAvailable() != item2.get(i).getVentilationModeAvailable()) {
- return false;
- }
-
- if(! (validateVentilationModes(item1.get(i).getVentilationMode(), item2.get(i).getVentilationMode()) )){
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateSeatControlCapabilities(SeatControlCapabilities item1, SeatControlCapabilities item2) {
- if (item1 == null) {
- return (item2 == null);
- }
- if (item2 == null) {
- return (item1 == null);
- }
-
- if (item1.getModuleName() != item2.getModuleName()) {
- return false;
- }
- if (item1.getHeatingEnabledAvailable() != item2.getHeatingEnabledAvailable()) {
- return false;
- }
- if (item1.getCoolingEnabledAvailable() != item2.getCoolingEnabledAvailable()) {
- return false;
- }
- if (item1.getHeatingLevelAvailable() != item2.getHeatingLevelAvailable()) {
- return false;
- }
- if (item1.getCoolingLevelAvailable() != item2.getCoolingLevelAvailable()) {
- return false;
- }
- if (item1.getHorizontalPositionAvailable() != item2.getHorizontalPositionAvailable()) {
- return false;
- }
- if (item1.getVerticalPositionAvailable() != item2.getVerticalPositionAvailable()) {
- return false;
- }
- if (item1.getFrontVerticalPositionAvailable() != item2.getFrontVerticalPositionAvailable()) {
- return false;
- }
- if (item1.getBackVerticalPositionAvailable() != item2.getBackVerticalPositionAvailable()) {
- return false;
- }
- if (item1.getBackTiltAngleAvailable() != item2.getBackTiltAngleAvailable()) {
- return false;
- }
- if (item1.getHeadSupportVerticalPositionAvailable() != item2.getHeadSupportVerticalPositionAvailable()) {
- return false;
- }
- if (item1.getHeadSupportHorizontalPositionAvailable() != item2.getHeadSupportHorizontalPositionAvailable()) {
- return false;
- }
- if (item1.getMassageEnabledAvailable() != item2.getMassageEnabledAvailable()) {
- return false;
- }
- if (item1.getMassageModeAvailable() != item2.getMassageModeAvailable()) {
- return false;
- }
- if (item1.getMassageCushionFirmnessAvailable() != item2.getMassageCushionFirmnessAvailable()) {
- return false;
- }
- if (item1.getMemoryAvailable() != item2.getMemoryAvailable()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateSeatControlCapabilitiesList(List<SeatControlCapabilities> item1, List<SeatControlCapabilities> 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 (!validateSeatControlCapabilities(item1.get(i), item2.get(i))) {
- return false;
- }
- }
-
- 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.getKeepContextAvailable() != item2.getKeepContextAvailable()) {
- 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 );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.size() != item2.size()) {
- return false;
- }
-
- for (int i = 0; i < item1.size(); i++) {
- if (item1.get(i) != item2.get(i)) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateVentilationModes (List<VentilationMode> item1, List<VentilationMode> 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 (item1.get(i) != item2.get(i)) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateTurnList (List<Turn> item1, List<Turn> 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 (!item1.get(i).getNavigationText().equals(item2.get(i).getNavigationText())) {
- return false;
- }
- if (!validateImage(item1.get(i).getTurnIcon(), item2.get(i).getTurnIcon())) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateAudioPassThruCapabilities (List<AudioPassThruCapabilities> item1, List<AudioPassThruCapabilities> 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 (item1.get(i).getAudioType() != item2.get(i).getAudioType()) {
- return false;
- }
- if (item1.get(i).getBitsPerSample() != item2.get(i).getBitsPerSample()) {
- return false;
- }
- if (item1.get(i).getSamplingRate() != item2.get(i).getSamplingRate()) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validatePcmStreamCapabilities (AudioPassThruCapabilities item1, AudioPassThruCapabilities item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.getAudioType() != item2.getAudioType()) {
- return false;
- }
-
- if (item1.getBitsPerSample() != item2.getBitsPerSample()) {
- return false;
- }
-
- if (item1.getSamplingRate() != item2.getSamplingRate()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validatePresetBankCapabilities (PresetBankCapabilities item1, PresetBankCapabilities item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.onScreenPresetsAvailable() != item2.onScreenPresetsAvailable()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateVehicleType (VehicleType item1, VehicleType item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.getMake() != item2.getMake() ||
- item1.getModel() != item2.getModel() ||
- item1.getTrim() != item2.getTrim() ||
- item1.getModelYear() != item2.getModelYear()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateKeyboardProperties (KeyboardProperties item1, KeyboardProperties item2) {
- if (item1 == null) {
- log("1", item2.toString());
- return ( item2 == null );
- }
- if (item2 == null) {
- log("2", item1.toString());
- return ( item1 == null );
- }
-
- if (!item1.getAutoCompleteText().equals(item2.getAutoCompleteText())) {
- log("ACT", item1.getAutoCompleteText().toString() + " | " + item2.getAutoCompleteText().toString());
- return false;
- }
- if (item1.getKeyboardLayout() != item2.getKeyboardLayout()) {
- log("KL", item1.getKeyboardLayout().toString() + " | " + item2.getKeyboardLayout().toString());
- return false;
- }
- if (item1.getKeypressMode() != item2.getKeypressMode()) {
- log("KM", item1.getKeypressMode() + " | " + item2.getKeypressMode());
- return false;
- }
- if (item1.getLanguage() != item2.getLanguage()) {
- log("L", item1.getLanguage().toString() + " | " + item2.getLanguage().toString());
- return false;
- }
- if (!validateStringList(item1.getLimitedCharacterList(), item2.getLimitedCharacterList())) {
- log("List",item1.getLimitedCharacterList().toString() + " | " + item2.getLimitedCharacterList().toString());
- return false;
- }
-
- return true;
- }
-
- public static boolean validateStartTime (StartTime item1, StartTime item2) {
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if (item1.getHours() != item2.getHours()) {
- return false;
- }
- if (item1.getMinutes() != item2.getMinutes()) {
- return false;
- }
- if (item1.getSeconds() != item2.getSeconds()) {
- return false;
- }
-
- return true;
- }
-
- public static boolean validateVrHelpItems (List<VrHelpItem> item1, List<VrHelpItem> 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 (!item1.get(i).getText().equals(item2.get(i).getText())) {
- return false;
- }
- if (!validateImage(item1.get(i).getImage(), item2.get(i).getImage())) {
- return false;
- }
- if ((int) item1.get(i).getPosition() != (int) item2.get(i).getPosition()) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateDIDResults (List<DIDResult> item1, List<DIDResult> 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 (!item1.get(i).getData().equals(item2.get(i).getData())) {
- return false;
- }
- if (item1.get(i).getResultCode() != item2.get(i).getResultCode()) {
- return false;
- }
- }
-
- return true;
- }
-
- public static boolean validateHeaders(Headers item1, Headers item2){
- if (item1 == null) {
- return ( item2 == null );
- }
- if (item2 == null) {
- return ( item1 == null );
- }
-
- if( ! item1.getDoInput().equals(item2.getDoInput()) ){
- return false;
- }
-
- if( ! item1.getDoOutput().equals(item2.getDoOutput()) ){
- return false;
- }
-
- if( ! item1.getInstanceFollowRedirects().equals(item2.getInstanceFollowRedirects()) ){
- return false;
- }
-
- if( ! item1.getUseCaches().equals(item2.getUseCaches()) ){
- return false;
- }
-
- if( ! item1.getCharset().equals(item2.getCharset()) ){
- return false;
- }
-
- if( ! item1.getConnectTimeout().equals(item2.getConnectTimeout()) ){
- return false;
- }
-
- if( ! item1.getContentLength().equals(item2.getContentLength()) ){
- return false;
- }
-
- if( ! item1.getContentType().equals(item2.getContentType()) ){
- return false;
- }
-
- if( ! item1.getReadTimeout().equals(item2.getReadTimeout()) ){
- return false;
- }
-
- if( ! item1.getRequestMethod().equals(item2.getRequestMethod()) ){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateHMICapabilities(HMICapabilities hmiA, HMICapabilities hmiB){
- if(hmiA.isPhoneCallAvailable() != hmiB.isPhoneCallAvailable()){
- return false;
- }
-
- if(hmiA.isVideoStreamingAvailable() != hmiB.isVideoStreamingAvailable()){
- return false;
- }
-
- if(hmiA.isNavigationAvailable() != hmiB.isNavigationAvailable()){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateHMIZoneCapabilities(List<HmiZoneCapabilities> hmizA, List<HmiZoneCapabilities> hmizB){
- for(int i = 0; i < hmizA.size(); i++){
- if(!hmizA.get(i).equals(hmizB.get(i))){
- return false;
- }
- }
- return true;
- }
-
- public static boolean validateSpeechCapabilities(List<SpeechCapabilities> spA, List<SpeechCapabilities> spB){
- for(int i = 0; i < spA.size(); i++){
- if(!spA.get(i).equals(spB.get(i))){
- return false;
- }
- }
- return true;
- }
-
- public static boolean validateVideoStreamingFormat(VideoStreamingFormat a, VideoStreamingFormat b){
- if(!a.getCodec().equals(b.getCodec())){
- return false;
- }
-
- if(!a.getProtocol().equals(b.getProtocol())){
- return false;
- }
-
- return true;
- }
-
- public static boolean validateVideoStreamingCapability(VideoStreamingCapability a, VideoStreamingCapability b){
- if(!validateImageResolution(a.getPreferredResolution(), b.getPreferredResolution())){
- return false;
- }
-
- if(!a.getMaxBitrate().equals(b.getMaxBitrate())){
- return false;
- }
-
- for(int i = 0; i < a.getSupportedFormats().size(); i++){
- if(!validateVideoStreamingFormat(a.getSupportedFormats().get(i), b.getSupportedFormats().get(i))){
- return false;
- }
- }
-
- return true;
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java
deleted file mode 100644
index 22ce7a15b..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package com.smartdevicelink.test;
-
-import com.smartdevicelink.proxy.rpc.AirbagStatus;
-import com.smartdevicelink.proxy.rpc.BeltStatus;
-import com.smartdevicelink.proxy.rpc.BodyInformation;
-import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
-import com.smartdevicelink.proxy.rpc.DeviceStatus;
-import com.smartdevicelink.proxy.rpc.ECallInfo;
-import com.smartdevicelink.proxy.rpc.EmergencyEvent;
-import com.smartdevicelink.proxy.rpc.FuelRange;
-import com.smartdevicelink.proxy.rpc.GPSData;
-import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.HeadLampStatus;
-import com.smartdevicelink.proxy.rpc.MyKey;
-import com.smartdevicelink.proxy.rpc.OnVehicleData;
-import com.smartdevicelink.proxy.rpc.SingleTireStatus;
-import com.smartdevicelink.proxy.rpc.TireStatus;
-import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
-import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
-import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
-import com.smartdevicelink.proxy.rpc.enums.Dimension;
-import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
-import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
-import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
-import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
-import com.smartdevicelink.proxy.rpc.enums.FuelType;
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
-import com.smartdevicelink.proxy.rpc.enums.PRNDL;
-import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
-import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
-import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
-import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
-import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class VehicleDataHelper{
- //top level variables for OnVehicleData
- public static final double SPEED = 35.6;
- public static final int RPM = 2500;
- public static final double EXTERNAL_TEMPERATURE = 140.1;
- public static final double FUEL_LEVEL = 3.7;
- public static final String VIN = "FIUE4WHR3984579THIRU";
- public static final PRNDL PRNDL_FINAL = PRNDL.SECOND;
- public static final TireStatus TIRE_PRESSURE = new TireStatus();
- public static final double ENGINE_TORQUE = 518.3;
- public static final float ENGINE_OIL_LIFE = 19.3f;
- public static final int ODOMETER = 140000;
- public static final GPSData GPS = new GPSData();
- public static final ComponentVolumeStatus FUEL_LEVEL_STATE = ComponentVolumeStatus.ALERT;
- public static final double INSTANT_FUEL_CONSUMPTION = 2.76;
- public static final BeltStatus BELT_STATUS = new BeltStatus();
- public static final BodyInformation BODY_INFORMATION = new BodyInformation();
- public static final DeviceStatus DEVICE_STATUS = new DeviceStatus();
- public static final VehicleDataEventStatus DRIVER_BRAKING = VehicleDataEventStatus.NO;
- public static final WiperStatus WIPER_STATUS = WiperStatus.COURTESYWIPE;
- public static final HeadLampStatus HEAD_LAMP_STATUS = new HeadLampStatus();
- public static final double ACC_PEDAL_POSITION = 28.29;
- public static final double STEERING_WHEEL_ANGLE = 70.5;
- public static final ECallInfo E_CALL_INFO = new ECallInfo();
- public static final AirbagStatus AIRBAG_STATUS = new AirbagStatus();
- public static final EmergencyEvent EMERGENCY_EVENT = new EmergencyEvent();
- public static final ClusterModeStatus CLUSTER_MODE_STATUS = new ClusterModeStatus();
- public static final MyKey MY_KEY = new MyKey();
- public static final FuelRange FUEL_RANGE = new FuelRange();
- public static final List<FuelRange> FUEL_RANGE_LIST = new ArrayList<FuelRange>(1);
- public static final TurnSignal TURN_SIGNAL = TurnSignal.OFF;
- public static final ElectronicParkBrakeStatus ELECTRONIC_PARK_BRAKE_STATUS = ElectronicParkBrakeStatus.CLOSED;
-
- //other variables inside some of the above objects
- // tire status
- public static final WarningLightStatus TIRE_PRESSURE_TELL_TALE = WarningLightStatus.ON;
- public static final ComponentVolumeStatus TIRE_PRESSURE_LEFT_FRONT = ComponentVolumeStatus.NORMAL;
- public static final ComponentVolumeStatus TIRE_PRESSURE_RIGHT_FRONT = ComponentVolumeStatus.FAULT;
- public static final ComponentVolumeStatus TIRE_PRESSURE_LEFT_REAR = ComponentVolumeStatus.LOW;
- public static final ComponentVolumeStatus TIRE_PRESSURE_RIGHT_REAR = ComponentVolumeStatus.NORMAL;
- public static final ComponentVolumeStatus TIRE_PRESSURE_INNER_LEFT_REAR = ComponentVolumeStatus.LOW;
- public static final ComponentVolumeStatus TIRE_PRESSURE_INNER_RIGHT_REAR = ComponentVolumeStatus.ALERT;
-
- // GPS data
- public static final Double GPS_LONGITUDE = 104.2;
- public static final Double GPS_LATITUDE = 56.3;
- public static final Integer GPS_YEAR = 2015;
- public static final Integer GPS_MONTH = 7;
- public static final Integer GPS_DAY = 14;
- public static final Integer GPS_HOURS = 11;
- public static final Integer GPS_MINUTES = 38;
- public static final Integer GPS_SECONDS = 12;
- public static final CompassDirection GPS_DIRECTION = CompassDirection.NORTHWEST;
- public static final Double GPS_PDOP = 4.1;
- public static final Double GPS_HDOP = 2.4;
- public static final Double GPS_VDOP = 5.5;
- public static final Boolean GPS_ACTUAL = true;
- public static final Integer GPS_SATELLITES = 3;
- public static final Dimension GPS_DIMENSION = Dimension._2D;
- public static final Double GPS_ALTITUDE = 768.5;
- public static final Double GPS_HEADING = 315.0;
- public static final Double GPS_SPEED = 30.5;
-
- // belt status
- public static final VehicleDataEventStatus BELT_STATUS_DRIVER_DEPLOYED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus BELT_STATUS_PASSENGER_DEPLOYED = VehicleDataEventStatus.YES;
- public static final VehicleDataEventStatus BELT_STATUS_PASSENGER_BELTED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus BELT_STATUS_DRIVER_BELTED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus BELT_STATUS_LEFT_ROW_2_BELTED = VehicleDataEventStatus.NO_EVENT;
- public static final VehicleDataEventStatus BELT_STATUS_PASSENGER_CHILD = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus BELT_STATUS_RIGHT_ROW_2_BELTED = VehicleDataEventStatus.NO_EVENT;
- public static final VehicleDataEventStatus BELT_STATUS_MIDDLE_ROW_2_BELTED = VehicleDataEventStatus.YES;
- public static final VehicleDataEventStatus BELT_STATUS_MIDDLE_ROW_3_BELTED = VehicleDataEventStatus.NO_EVENT;
- public static final VehicleDataEventStatus BELT_STATUS_LEFT_ROW_3_BELTED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus BELT_STATUS_RIGHT_ROW_3_BELTED = VehicleDataEventStatus.NO_EVENT;
- public static final VehicleDataEventStatus BELT_STATUS_LEFT_REAR_INFLATABLE_BELTED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus BELT_STATUS_RIGHT_REAR_INFLATABLE_BELTED = VehicleDataEventStatus.NO_EVENT;
- public static final VehicleDataEventStatus BELT_STATUS_MIDDLE_ROW_1_DEPLOYED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus BELT_STATUS_MIDDLE_ROW_1_BELTED = VehicleDataEventStatus.YES;
-
- // body information
- public static final Boolean BODY_INFORMATION_PARK_BRAKE = false;
- public static final IgnitionStableStatus BODY_INFORMATION_IGNITION_STATUS = IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE;
- public static final IgnitionStatus BODY_INFORMATION_IGNITION_STABLE_STATUS = IgnitionStatus.ACCESSORY;
- public static final Boolean BODY_INFORMATION_DRIVER_AJAR = true;
- public static final Boolean BODY_INFORMATION_PASSENGER_AJAR = true;
- public static final Boolean BODY_INFORMATION_REAR_LEFT_AJAR = false;
- public static final Boolean BODY_INFORMATION_REAR_RIGHT_AJAR = true;
-
- // device status
- public static final Boolean DEVICE_STATUS_VOICE_REC = true;
- public static final Boolean DEVICE_STATUS_BT_ICON = true;
- public static final Boolean DEVICE_STATUS_CALL_ACTIVE = true;
- public static final Boolean DEVICE_STATUS_PHONE_ROAMING = false;
- public static final Boolean DEVICE_STATUS_TEXT_MSG_AVAILABLE = false;
- public static final DeviceLevelStatus DEVICE_STATUS_BATT_LEVEL_STATUS = DeviceLevelStatus.TWO_LEVEL_BARS;
- public static final Boolean DEVICE_STATUS_STEREO_MUTED = false;
- public static final Boolean DEVICE_STATUS_MONO_MUTED = true;
- public static final DeviceLevelStatus DEVICE_STATUS_SIGNAL_LEVEL_STATUS = DeviceLevelStatus.ONE_LEVEL_BARS;
- public static final PrimaryAudioSource DEVICE_STATUS_PRIMARY_AUDIO = PrimaryAudioSource.BLUETOOTH_STEREO_BTST;
- public static final Boolean DEVICE_STATUS_E_CALL_ACTIVE = false;
-
- // head lamp status
- public static final AmbientLightStatus HEAD_LAMP_STATUS_AMBIENT_STATUS = AmbientLightStatus.TWILIGHT_3;
- public static final Boolean HEAD_LAMP_HIGH_BEAMS = true;
- public static final Boolean HEAD_LAMP_LOW_BEAMS = false;
-
- // e call info
- public static final VehicleDataNotificationStatus E_CALL_INFO_E_CALL_NOTIFICATION_STATUS = VehicleDataNotificationStatus.NOT_SUPPORTED;
- public static final VehicleDataNotificationStatus E_CALL_INFO_AUX_E_CALL_NOTIFICATION_STATUS = VehicleDataNotificationStatus.NOT_USED;
- public static final ECallConfirmationStatus E_CALL_INFO_CONFIRMATION_STATUS = ECallConfirmationStatus.ECALL_CONFIGURED_OFF;
-
- // airbag status
- public static final VehicleDataEventStatus AIRBAG_STATUS_DRIVER_DEPLOYED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus AIRBAG_STATUS_DRIVER_SIDE_DEPLOYED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus AIRBAG_STATUS_DRIVER_CURTAIN_DEPLOYED = VehicleDataEventStatus.YES;
- public static final VehicleDataEventStatus AIRBAG_STATUS_PASSENGER_DEPLOYED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus AIRBAG_STATUS_PASSENGER_CURTAIN_DEPLOYED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus AIRBAG_STATUS_DRIVER_KNEE_DEPLOYED = VehicleDataEventStatus.NO;
- public static final VehicleDataEventStatus AIRBAG_STATUS_PASSENGER_SIDE_DEPLOYED = VehicleDataEventStatus.YES;
- public static final VehicleDataEventStatus AIRBAG_STATUS_PASSENGER_KNEE_DEPLOYED = VehicleDataEventStatus.NO;
-
- // emergency event
- public static final EmergencyEventType EMERGENCY_EVENT_TYPE = EmergencyEventType.FRONTAL;
- public static final FuelCutoffStatus EMERGENCY_EVENT_FUEL_CUTOFF_STATUS = FuelCutoffStatus.TERMINATE_FUEL;
- public static final VehicleDataEventStatus EMERGENCY_EVENT_ROLLOVER_EVENT = VehicleDataEventStatus.YES;
- public static final Integer EMERGENCY_EVENT_MAX_CHANGE_VELOCITY = 5;
- public static final VehicleDataEventStatus EMERGENCY_EVENT_MULTIPLE_EVENTS = VehicleDataEventStatus.NO;
-
- // cluster mode status
- public static final Boolean CLUSTER_MODE_STATUS_POWER_MODE_ACTIVE = true;
- public static final PowerModeQualificationStatus CLUSTER_MODE_STATUS_POWER_MODE_QUALIFICATION_STATUS =
- PowerModeQualificationStatus.POWER_MODE_EVALUATION_IN_PROGRESS;
- public static final CarModeStatus CLUSTER_MODE_STATUS_CAR_MODE_STATUS = CarModeStatus.TRANSPORT;
- public static final PowerModeStatus CLUSTER_MODE_STATUS_POWER_MODE_STATUS = PowerModeStatus.POST_ACCESORY_0;
-
- // my key
- public static final VehicleDataStatus MY_KEY_E_911_OVERRIDE = VehicleDataStatus.NO_DATA_EXISTS;
-
- // fuel range
- public static final FuelType FUEL_RANGE_TYPE = FuelType.GASOLINE;
- public static final Float FUEL_RANGE_RANGE = Test.GENERAL_FLOAT;
-
- public static final JSONArray JSON_FUEL_RANGE = new JSONArray();
-
- //the OnVehicleData which stores all the information above
- public static final OnVehicleData VEHICLE_DATA = new OnVehicleData();
- //GetVehicleDataResponse data which stores the same things
- public static final GetVehicleDataResponse VEHICLE_DATA_RESPONSE = new GetVehicleDataResponse();
-
- static {
- //TIRE_PRESSURE set up
- TIRE_PRESSURE.setPressureTellTale(TIRE_PRESSURE_TELL_TALE);
- SingleTireStatus tireLeftFront = new SingleTireStatus();
- tireLeftFront.setStatus(TIRE_PRESSURE_LEFT_FRONT);
- TIRE_PRESSURE.setLeftFront(tireLeftFront);
- SingleTireStatus tireRightFront = new SingleTireStatus();
- tireRightFront.setStatus(TIRE_PRESSURE_RIGHT_FRONT);
- TIRE_PRESSURE.setRightFront(tireRightFront);
- SingleTireStatus tireLeftRear = new SingleTireStatus();
- tireLeftRear.setStatus(TIRE_PRESSURE_LEFT_REAR);
- TIRE_PRESSURE.setLeftRear(tireLeftRear);
- SingleTireStatus tireRightRear = new SingleTireStatus();
- tireRightRear.setStatus(TIRE_PRESSURE_RIGHT_REAR);
- TIRE_PRESSURE.setRightRear(tireRightRear);
- SingleTireStatus tireInnerLeftRear = new SingleTireStatus();
- tireInnerLeftRear.setStatus(TIRE_PRESSURE_INNER_LEFT_REAR);
- TIRE_PRESSURE.setInnerLeftRear(tireInnerLeftRear);
- SingleTireStatus tireInnerRightRear = new SingleTireStatus();
- tireInnerRightRear.setStatus(TIRE_PRESSURE_INNER_RIGHT_REAR);
- TIRE_PRESSURE.setInnerRightRear(tireInnerRightRear);
-
- //GPS set up
- GPS.setLongitudeDegrees(GPS_LONGITUDE);
- GPS.setLatitudeDegrees(GPS_LATITUDE);
- GPS.setUtcYear(GPS_YEAR);
- GPS.setUtcMonth(GPS_MONTH);
- GPS.setUtcDay(GPS_DAY);
- GPS.setUtcHours(GPS_HOURS);
- GPS.setUtcMinutes(GPS_MINUTES);
- GPS.setUtcSeconds(GPS_SECONDS);
- GPS.setCompassDirection(GPS_DIRECTION);
- GPS.setPdop(GPS_PDOP);
- GPS.setHdop(GPS_HDOP);
- GPS.setVdop(GPS_VDOP);
- GPS.setActual(GPS_ACTUAL);
- GPS.setSatellites(GPS_SATELLITES);
- GPS.setDimension(GPS_DIMENSION);
- GPS.setAltitude(GPS_ALTITUDE);
- GPS.setHeading(GPS_HEADING);
- GPS.setSpeed(GPS_SPEED);
-
- //BELT_STATUS set up
- BELT_STATUS.setDriverBeltDeployed(BELT_STATUS_DRIVER_DEPLOYED);
- BELT_STATUS.setPassengerBeltDeployed(BELT_STATUS_PASSENGER_DEPLOYED);
- BELT_STATUS.setPassengerBuckleBelted(BELT_STATUS_PASSENGER_BELTED);
- BELT_STATUS.setDriverBuckleBelted(BELT_STATUS_DRIVER_BELTED);
- BELT_STATUS.setLeftRow2BuckleBelted(BELT_STATUS_LEFT_ROW_2_BELTED);
- BELT_STATUS.setPassengerChildDetected(BELT_STATUS_PASSENGER_CHILD);
- BELT_STATUS.setRightRow2BuckleBelted(BELT_STATUS_RIGHT_ROW_2_BELTED);
- BELT_STATUS.setMiddleRow2BuckleBelted(BELT_STATUS_MIDDLE_ROW_2_BELTED);
- BELT_STATUS.setMiddleRow3BuckleBelted(BELT_STATUS_MIDDLE_ROW_3_BELTED);
- BELT_STATUS.setLeftRow3BuckleBelted(BELT_STATUS_LEFT_ROW_3_BELTED);
- BELT_STATUS.setRightRow3BuckleBelted(BELT_STATUS_RIGHT_ROW_3_BELTED);
- BELT_STATUS.setLeftRearInflatableBelted(BELT_STATUS_LEFT_REAR_INFLATABLE_BELTED);
- BELT_STATUS.setRightRearInflatableBelted(BELT_STATUS_RIGHT_REAR_INFLATABLE_BELTED);
- BELT_STATUS.setMiddleRow1BeltDeployed(BELT_STATUS_MIDDLE_ROW_1_DEPLOYED);
- BELT_STATUS.setMiddleRow1BuckleBelted(BELT_STATUS_MIDDLE_ROW_1_BELTED);
-
- //BODY_INFORMATION set up
- BODY_INFORMATION.setParkBrakeActive(BODY_INFORMATION_PARK_BRAKE);
- BODY_INFORMATION.setIgnitionStableStatus(BODY_INFORMATION_IGNITION_STATUS);
- BODY_INFORMATION.setIgnitionStatus(BODY_INFORMATION_IGNITION_STABLE_STATUS);
- BODY_INFORMATION.setDriverDoorAjar(BODY_INFORMATION_DRIVER_AJAR);
- BODY_INFORMATION.setPassengerDoorAjar(BODY_INFORMATION_PASSENGER_AJAR);
- BODY_INFORMATION.setRearLeftDoorAjar(BODY_INFORMATION_REAR_LEFT_AJAR);
- BODY_INFORMATION.setRearRightDoorAjar(BODY_INFORMATION_REAR_RIGHT_AJAR);
-
- //DEVICE_STATUS set up
- DEVICE_STATUS.setVoiceRecOn(DEVICE_STATUS_VOICE_REC);
- DEVICE_STATUS.setBtIconOn(DEVICE_STATUS_BT_ICON);
- DEVICE_STATUS.setCallActive(DEVICE_STATUS_CALL_ACTIVE);
- DEVICE_STATUS.setPhoneRoaming(DEVICE_STATUS_PHONE_ROAMING);
- DEVICE_STATUS.setTextMsgAvailable(DEVICE_STATUS_TEXT_MSG_AVAILABLE);
- DEVICE_STATUS.setBattLevelStatus(DEVICE_STATUS_BATT_LEVEL_STATUS);
- DEVICE_STATUS.setStereoAudioOutputMuted(DEVICE_STATUS_STEREO_MUTED);
- DEVICE_STATUS.setMonoAudioOutputMuted(DEVICE_STATUS_MONO_MUTED);
- DEVICE_STATUS.setSignalLevelStatus(DEVICE_STATUS_SIGNAL_LEVEL_STATUS);
- DEVICE_STATUS.setPrimaryAudioSource(DEVICE_STATUS_PRIMARY_AUDIO);
- DEVICE_STATUS.setECallEventActive(DEVICE_STATUS_E_CALL_ACTIVE);
-
- //HEAD_LAMP_STATUS set up
- HEAD_LAMP_STATUS.setAmbientLightStatus(HEAD_LAMP_STATUS_AMBIENT_STATUS);
- HEAD_LAMP_STATUS.setHighBeamsOn(HEAD_LAMP_HIGH_BEAMS);
- HEAD_LAMP_STATUS.setLowBeamsOn(HEAD_LAMP_LOW_BEAMS);
-
- //E_CALL_INFO set up
- E_CALL_INFO.setECallNotificationStatus(E_CALL_INFO_E_CALL_NOTIFICATION_STATUS);
- E_CALL_INFO.setAuxECallNotificationStatus(E_CALL_INFO_AUX_E_CALL_NOTIFICATION_STATUS);
- E_CALL_INFO.setECallConfirmationStatus(E_CALL_INFO_CONFIRMATION_STATUS);
-
- //AIRBAG_STATUS set up
- AIRBAG_STATUS.setDriverAirbagDeployed(AIRBAG_STATUS_DRIVER_DEPLOYED);
- AIRBAG_STATUS.setDriverSideAirbagDeployed(AIRBAG_STATUS_DRIVER_SIDE_DEPLOYED);
- AIRBAG_STATUS.setDriverCurtainAirbagDeployed(AIRBAG_STATUS_DRIVER_CURTAIN_DEPLOYED);
- AIRBAG_STATUS.setPassengerAirbagDeployed(AIRBAG_STATUS_PASSENGER_DEPLOYED);
- AIRBAG_STATUS.setPassengerCurtainAirbagDeployed(AIRBAG_STATUS_PASSENGER_CURTAIN_DEPLOYED);
- AIRBAG_STATUS.setDriverKneeAirbagDeployed(AIRBAG_STATUS_DRIVER_KNEE_DEPLOYED);
- AIRBAG_STATUS.setPassengerSideAirbagDeployed(AIRBAG_STATUS_PASSENGER_SIDE_DEPLOYED);
- AIRBAG_STATUS.setPassengerKneeAirbagDeployed(AIRBAG_STATUS_PASSENGER_KNEE_DEPLOYED);
-
- //EMERGENCY_EVENT set up
- EMERGENCY_EVENT.setEmergencyEventType(EMERGENCY_EVENT_TYPE);
- EMERGENCY_EVENT.setFuelCutoffStatus(EMERGENCY_EVENT_FUEL_CUTOFF_STATUS);
- EMERGENCY_EVENT.setRolloverEvent(EMERGENCY_EVENT_ROLLOVER_EVENT);
- EMERGENCY_EVENT.setMaximumChangeVelocity(EMERGENCY_EVENT_MAX_CHANGE_VELOCITY);
- EMERGENCY_EVENT.setMultipleEvents(EMERGENCY_EVENT_MULTIPLE_EVENTS);
-
- //CLUSTER_MODE_STATUS set up
- CLUSTER_MODE_STATUS.setPowerModeActive(CLUSTER_MODE_STATUS_POWER_MODE_ACTIVE);
- CLUSTER_MODE_STATUS.setPowerModeQualificationStatus(CLUSTER_MODE_STATUS_POWER_MODE_QUALIFICATION_STATUS);
- CLUSTER_MODE_STATUS.setCarModeStatus(CLUSTER_MODE_STATUS_CAR_MODE_STATUS);
- CLUSTER_MODE_STATUS.setPowerModeStatus(CLUSTER_MODE_STATUS_POWER_MODE_STATUS);
-
- //MY_KEY set up
- MY_KEY.setE911Override(MY_KEY_E_911_OVERRIDE);
-
- // FUEL_RANGE and FUEL_RANGE_LIST set up
- FUEL_RANGE.setType(FUEL_RANGE_TYPE);
- FUEL_RANGE.setRange(FUEL_RANGE_RANGE);
- FUEL_RANGE_LIST.add(FUEL_RANGE);
-
- // FUEL_RANGE json array set up
- try {
- JSON_FUEL_RANGE.put(FUEL_RANGE.serializeJSON());
- } catch (JSONException e) {
- e.printStackTrace();
- }
-
- //set up the OnVehicleData object
- VEHICLE_DATA.setSpeed(SPEED);
- VEHICLE_DATA.setRpm(RPM);
- VEHICLE_DATA.setExternalTemperature(EXTERNAL_TEMPERATURE);
- VEHICLE_DATA.setFuelLevel(FUEL_LEVEL);
- VEHICLE_DATA.setVin(VIN);
- VEHICLE_DATA.setPrndl(PRNDL_FINAL);
- VEHICLE_DATA.setTirePressure(TIRE_PRESSURE);
- VEHICLE_DATA.setEngineTorque(ENGINE_TORQUE);
- VEHICLE_DATA.setEngineOilLife(ENGINE_OIL_LIFE);
- VEHICLE_DATA.setOdometer(ODOMETER);
- VEHICLE_DATA.setGps(GPS);
- VEHICLE_DATA.setFuelLevelState(FUEL_LEVEL_STATE);
- VEHICLE_DATA.setInstantFuelConsumption(INSTANT_FUEL_CONSUMPTION);
- VEHICLE_DATA.setBeltStatus(BELT_STATUS);
- VEHICLE_DATA.setBodyInformation(BODY_INFORMATION);
- VEHICLE_DATA.setDeviceStatus(DEVICE_STATUS);
- VEHICLE_DATA.setDriverBraking(DRIVER_BRAKING);
- VEHICLE_DATA.setWiperStatus(WIPER_STATUS);
- VEHICLE_DATA.setHeadLampStatus(HEAD_LAMP_STATUS);
- VEHICLE_DATA.setAccPedalPosition(ACC_PEDAL_POSITION);
- VEHICLE_DATA.setSteeringWheelAngle(STEERING_WHEEL_ANGLE);
- VEHICLE_DATA.setECallInfo(E_CALL_INFO);
- VEHICLE_DATA.setAirbagStatus(AIRBAG_STATUS);
- VEHICLE_DATA.setEmergencyEvent(EMERGENCY_EVENT);
- VEHICLE_DATA.setClusterModeStatus(CLUSTER_MODE_STATUS);
- VEHICLE_DATA.setMyKey(MY_KEY);
- VEHICLE_DATA.setFuelRange(FUEL_RANGE_LIST);
- VEHICLE_DATA.setTurnSignal(TURN_SIGNAL);
- VEHICLE_DATA.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS);
-
- //set up the GetVehicleDataResponse object
- VEHICLE_DATA_RESPONSE.setSpeed(SPEED);
- VEHICLE_DATA_RESPONSE.setRpm(RPM);
- VEHICLE_DATA_RESPONSE.setExternalTemperature(EXTERNAL_TEMPERATURE);
- VEHICLE_DATA_RESPONSE.setFuelLevel(FUEL_LEVEL);
- VEHICLE_DATA_RESPONSE.setVin(VIN);
- VEHICLE_DATA_RESPONSE.setPrndl(PRNDL_FINAL);
- VEHICLE_DATA_RESPONSE.setTirePressure(TIRE_PRESSURE);
- VEHICLE_DATA_RESPONSE.setEngineTorque(ENGINE_TORQUE);
- VEHICLE_DATA_RESPONSE.setEngineOilLife(ENGINE_OIL_LIFE);
- VEHICLE_DATA_RESPONSE.setOdometer(ODOMETER);
- VEHICLE_DATA_RESPONSE.setGps(GPS);
- VEHICLE_DATA_RESPONSE.setFuelLevelState(FUEL_LEVEL_STATE);
- VEHICLE_DATA_RESPONSE.setInstantFuelConsumption(INSTANT_FUEL_CONSUMPTION);
- VEHICLE_DATA_RESPONSE.setBeltStatus(BELT_STATUS);
- VEHICLE_DATA_RESPONSE.setBodyInformation(BODY_INFORMATION);
- VEHICLE_DATA_RESPONSE.setDeviceStatus(DEVICE_STATUS);
- VEHICLE_DATA_RESPONSE.setDriverBraking(DRIVER_BRAKING);
- VEHICLE_DATA_RESPONSE.setWiperStatus(WIPER_STATUS);
- VEHICLE_DATA_RESPONSE.setHeadLampStatus(HEAD_LAMP_STATUS);
- VEHICLE_DATA_RESPONSE.setAccPedalPosition(ACC_PEDAL_POSITION);
- VEHICLE_DATA_RESPONSE.setSteeringWheelAngle(STEERING_WHEEL_ANGLE);
- VEHICLE_DATA_RESPONSE.setECallInfo(E_CALL_INFO);
- VEHICLE_DATA_RESPONSE.setAirbagStatus(AIRBAG_STATUS);
- VEHICLE_DATA_RESPONSE.setEmergencyEvent(EMERGENCY_EVENT);
- VEHICLE_DATA_RESPONSE.setClusterModeStatus(CLUSTER_MODE_STATUS);
- VEHICLE_DATA_RESPONSE.setMyKey(MY_KEY);
- VEHICLE_DATA_RESPONSE.setFuelRange(FUEL_RANGE_LIST);
- VEHICLE_DATA_RESPONSE.setTurnSignal(TURN_SIGNAL);
- VEHICLE_DATA_RESPONSE.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS);
- }
-
- private VehicleDataHelper(){}
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/json/rpc/JsonFileReader.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/json/rpc/JsonFileReader.java
deleted file mode 100644
index e60b35d2e..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/json/rpc/JsonFileReader.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.smartdevicelink.test.json.rpc;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.content.Context;
-
-import com.smartdevicelink.test.JsonUtils;
-
-public class JsonFileReader {
- private static final String PATH = "json/";
- private static final String EXT = ".json";
-
- public static JSONObject readId (Context context, String id, String type) {
- if(context == null){
- return null;
- }
- String fileName = PATH + id + EXT;
-
- JSONObject commandJsonWithType = null;
-
- try {
- JSONObject commandJson = null;
- //get the file which holds the desired object
- InputStream fileStream = context.getAssets().open(fileName);
- BufferedInputStream bufferStream = new BufferedInputStream(fileStream);
- byte[] buffer = new byte[(int)fileStream.available()];
- bufferStream.read(buffer);
- fileStream.close();
- commandJson = JsonUtils.createJsonObject(buffer);
-
- //now use the type parameter to get the specific message type
- //it also makes sure to return it with the message type in the top level because that's needed to eventually make this into a class object
- commandJson = JsonUtils.readJsonObjectFromJsonObject(commandJson, type);
- commandJsonWithType = new JSONObject();
- commandJsonWithType = commandJsonWithType.put(type, commandJson);
- }
- catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- catch (JSONException e) {
- e.printStackTrace();
- }
-
- return commandJsonWithType;
-
- }
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java
deleted file mode 100644
index a1b108fea..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/BinaryFrameHeaderTests.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package com.smartdevicelink.test.protocol;
-
-import junit.framework.Assert;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.protocol.BinaryFrameHeader;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.test.SampleRpc;
-
-public class BinaryFrameHeaderTests extends AndroidTestCase2 {
-
- public static final byte RPC_TYPE_REQUEST = 0x00;
- public static final byte RPC_TYPE_RESPONSE = 0x01;
- public static final byte RPC_TYPE_NOTIFICAITON = 0x02;
-
-
- public static BinaryFrameHeader createDummyBfh(){
- BinaryFrameHeader bfh = new BinaryFrameHeader();
- bfh.setCorrID(123);
- bfh.setFunctionID(FunctionID.ON_HMI_STATUS.getId());
- bfh.setRPCType(RPC_TYPE_NOTIFICAITON);
- bfh.setBulkData(null);
- //There is no check for null bfh.setJsonData(null);
- bfh.setJsonSize(0);
- return bfh;
- }
-
- public BinaryFrameHeader safeParse(byte[] array){
- try{
- return BinaryFrameHeader.parseBinaryHeader(array);
- }catch(Exception e){
- return null;
- }
- }
-
- public void testAssemblyAndParse(){
- BinaryFrameHeader bfh = createDummyBfh();
-
- byte[] bfhBytes = bfh.assembleHeaderBytes();
- assertNotNull(bfhBytes);
-
- BinaryFrameHeader parsedBfh = BinaryFrameHeader.parseBinaryHeader(bfhBytes);
- assertNotNull(parsedBfh);
-
- assertTrue(bfh.getCorrID() == parsedBfh.getCorrID());
-
- assertTrue(bfh.getFunctionID() == parsedBfh.getFunctionID());
-
- assertTrue(bfh.getRPCType() == parsedBfh.getRPCType());
-
- assertTrue(bfh.getBulkData() == parsedBfh.getBulkData());
-
- assertTrue(bfh.getJsonData() == parsedBfh.getJsonData());
-
- assertTrue(bfh.getJsonSize() == parsedBfh.getJsonSize());
-
- }
-
- public void testCorruptHeader(){
- BinaryFrameHeader bfh = createDummyBfh();
- bfh.setJsonSize(5);
- bfh.setJsonData(new byte[5]);
- bfh.setJsonSize(Integer.MAX_VALUE);
-
- assertFalse(bfh.getJsonData().length == bfh.getJsonSize());
-
- byte[] bfhBytes = bfh.assembleHeaderBytes();
-
- assertNull(safeParse(bfhBytes));
-
- //Change bytes in the array manually
- int size = bfhBytes.length;
- for(int i =0; i<size;i++){
- bfhBytes[i] = (byte) 0x99;
- }
-
- assertNull(safeParse(bfhBytes));
- BinaryFrameHeader head = BinaryFrameHeader.parseBinaryHeader(bfhBytes);
- assertNull(head);
- }
-
- public void testJsonSetException(){
- try{
- BinaryFrameHeader bfh = createDummyBfh();
- bfh.setJsonData(null);
- Assert.fail("Setting JSON data to null should have thrown an exception.");
- }catch(Exception e){
- //Pass
- }
- }
-
- public void testAlteredDataInSampleRpc(){
- SampleRpc sampleRpc = new SampleRpc(4);
- //Create a corrupted header
- BinaryFrameHeader header = sampleRpc.getBinaryFrameHeader(true);
- header.setJsonSize(Integer.MAX_VALUE);
- assertEquals(Integer.MAX_VALUE, header.getJsonSize());
- sampleRpc.setBinaryFrameHeader(header);
-
- assertEquals(Integer.MAX_VALUE,sampleRpc.getBinaryFrameHeader(false).getJsonSize());
-
-
- }
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataControlFrameTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataControlFrameTypeTests.java
deleted file mode 100644
index 76090277a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataControlFrameTypeTests.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package com.smartdevicelink.test.protocol.enums;
-
-import java.util.Vector;
-
-import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
-import com.smartdevicelink.test.Validator;
-
-import junit.framework.TestCase;
-
-
-public class FrameDataControlFrameTypeTests extends TestCase {
-
- private Vector<FrameDataControlFrameType> list = FrameDataControlFrameType.getList();
-
- // Verifies the values are not null upon valid assignment.
- // These are not actual enums for packeting reasons so testing is different.
- public void testValidEnums () {
-
- final byte START_SESSION_BYTE = (byte) 0x01;
- final String START_SESSION_STRING = "StartSession";
-
- final byte START_SESSION_ACK_BYTE = (byte) 0x02;
- final String START_SESSION_ACK_STRING = "StartSessionACK";
-
- final byte START_SESSION_NACK_BYTE = (byte) 0x03;
- final String START_SESSION_NACK_STRING = "StartSessionNACK";
-
- final byte END_SESSION_BYTE = (byte) 0x04;
- final String END_SESSION_STRING = "EndSession";
-
- final byte END_SESSION_ACK_BYTE = (byte) 0x05;
- final String END_SESSION_ACK_STRING = "EndSessionACK";
-
- final byte END_SESSION_NACK_BYTE = (byte) 0x06;
- final String END_SESSION_NACK_STRING = "EndSessionNACK";
-
- final byte HEARTBEAT_BYTE = (byte) 0x00;
- final String HEARTBEAT_STRING = "Heartbeat";
-
- final byte HEARTBEAT_ACK_BYTE = (byte) 0xFF;
- final String HEARTBEAT_ACK_STRING = "HeartbeatACK";
-
- try {
-
- assertNotNull("FrameDataControlFrameType list returned null", list);
-
- // Check the byte values
- FrameDataControlFrameType enumSS = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_BYTE);
- FrameDataControlFrameType enumSSACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_ACK_BYTE);
- FrameDataControlFrameType enumSSNACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_NACK_BYTE);
- FrameDataControlFrameType enumES = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_BYTE);
- FrameDataControlFrameType enumESACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_ACK_BYTE);
- FrameDataControlFrameType enumESNACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_NACK_BYTE);
- FrameDataControlFrameType enumH = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, HEARTBEAT_BYTE);
- FrameDataControlFrameType enumHACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, HEARTBEAT_ACK_BYTE);
-
- assertNotNull("Start session byte match returned null", enumSS);
- assertNotNull("Start session ack byte match returned null", enumSSACK);
- assertNotNull("Start session nack byte match returned null", enumSSNACK);
- assertNotNull("End session byte match returned null", enumES);
- assertNotNull("End session ack byte match returned null", enumESACK);
- assertNotNull("End session nack byte match returned null", enumESNACK);
- assertNotNull("Heartbeat byte match returned null", enumH);
- assertNotNull("Heartbeat ack byte match returned null", enumHACK);
-
- // Check the string values
- enumSS = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_STRING);
- enumSSACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_ACK_STRING);
- enumSSNACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, START_SESSION_NACK_STRING);
- enumES = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_STRING);
- enumESACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_ACK_STRING);
- enumESNACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, END_SESSION_NACK_STRING);
- enumH = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, HEARTBEAT_STRING);
- enumHACK = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, HEARTBEAT_ACK_STRING);
-
- assertNotNull("Start session string match returned null", enumSS);
- assertNotNull("Start session ack string match returned null", enumSSACK);
- assertNotNull("Start session nack string match returned null", enumSSNACK);
- assertNotNull("End session string match returned null", enumES);
- assertNotNull("End session ack string match returned null", enumESACK);
- assertNotNull("End session nack string match returned null", enumESNACK);
- assertNotNull("Heartbeat string match returned null", enumH);
- assertNotNull("Heartbeat ack string match returned null", enumHACK);
-
- } catch (NullPointerException exception) {
- fail("Null enum list throws NullPointerException.");
- }
- }
-
- // Verifies that an invalid assignment is null.
- public void testInvalidEnum () {
-
- final byte INVALID_BYTE = (byte) 0xAB;
- final String INVALID_STRING = "Invalid";
-
- try {
-
- // Check the byte value
- FrameDataControlFrameType enumInvalid = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, INVALID_BYTE);
- assertNull("Invalid byte match didn't return null", enumInvalid);
-
- // Check the string value
- enumInvalid = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, INVALID_STRING);
- assertNull("Invalid string match didn't return null", enumInvalid);
-
- } catch (IllegalArgumentException exception) {
- fail("Invalid enum throws IllegalArgumentException.");
- }
- }
-
- // Verifies that a null assignment is invalid.
- public void testNullEnum () {
- try {
-
- // Check null string lookup
- FrameDataControlFrameType enumNull = (FrameDataControlFrameType) FrameDataControlFrameType.get(list, null);
- assertNull("Null lookup returns a value", enumNull);
-
- } catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- // Verifies the possible enum values of FrameType.
- public void testListEnum () {
- // Test Vector
- Vector<FrameDataControlFrameType> enumTestList = new Vector<FrameDataControlFrameType>();
- enumTestList.add(FrameDataControlFrameType.Heartbeat);
- enumTestList.add(FrameDataControlFrameType.StartSession);
- enumTestList.add(FrameDataControlFrameType.StartSessionACK);
- enumTestList.add(FrameDataControlFrameType.StartSessionNACK);
- enumTestList.add(FrameDataControlFrameType.EndSession);
- enumTestList.add(FrameDataControlFrameType.EndSessionACK);
- enumTestList.add(FrameDataControlFrameType.EndSessionNACK);
- enumTestList.add(FrameDataControlFrameType.ServiceDataACK);
- enumTestList.add(FrameDataControlFrameType.HeartbeatACK);
- enumTestList.add(FrameDataControlFrameType.RegisterSecondaryTransport);
- enumTestList.add(FrameDataControlFrameType.RegisterSecondaryTransportACK);
- enumTestList.add(FrameDataControlFrameType.RegisterSecondaryTransportNACK);
- enumTestList.add(FrameDataControlFrameType.TransportEventUpdate);
-
- assertTrue("List does not match enum test list.",
- list.containsAll(enumTestList) &&
- enumTestList.containsAll(list));
-
- // Test Array
- FrameDataControlFrameType[] enumValueArray = FrameDataControlFrameType.values();
- FrameDataControlFrameType[] enumTestArray = {
- FrameDataControlFrameType.Heartbeat, FrameDataControlFrameType.StartSession,
- FrameDataControlFrameType.StartSessionACK, FrameDataControlFrameType.StartSessionNACK,
- FrameDataControlFrameType.EndSession, FrameDataControlFrameType.EndSessionACK,
- FrameDataControlFrameType.EndSessionNACK, FrameDataControlFrameType.RegisterSecondaryTransport,
- FrameDataControlFrameType.RegisterSecondaryTransportACK, FrameDataControlFrameType.RegisterSecondaryTransportNACK,
- FrameDataControlFrameType.TransportEventUpdate, FrameDataControlFrameType.ServiceDataACK,
- FrameDataControlFrameType.HeartbeatACK,
- };
-
- assertTrue("Array does not match enum values array.",
- Validator.validateFrameDataControlFrameTypeArray(enumValueArray, enumTestArray));
- }
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataTests.java
deleted file mode 100644
index 07563248e..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameDataTests.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package com.smartdevicelink.test.protocol.enums;
-
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.protocol.enums.FrameData;
-import com.smartdevicelink.test.Validator;
-
-public class FrameDataTests extends TestCase {
-
- private Vector<FrameData> list = FrameData.getList();
-
- // Verifies the values are not null upon valid assignment.
- // These are not actual enums for packeting reasons so testing is different.
- public void testValidEnums () {
-
- final byte START_SESSION_BYTE = (byte) 0x01;
- final String START_SESSION_STRING = "StartSession";
-
- final byte START_SESSION_ACK_BYTE = (byte) 0x02;
- final String START_SESSION_ACK_STRING = "StartSessionACK";
-
- final byte START_SESSION_NACK_BYTE = (byte) 0x03;
- final String START_SESSION_NACK_STRING = "StartSessionNACK";
-
- final byte END_SESSION_BYTE = (byte) 0x04;
- final String END_SESSION_STRING = "EndSession";
-
- try {
-
- assertNotNull("FrameData list returned null", list);
-
- // Check the byte values
- FrameData enumSS = (FrameData) FrameData.get(list, START_SESSION_BYTE);
- FrameData enumSSACK = (FrameData) FrameData.get(list, START_SESSION_ACK_BYTE);
- FrameData enumSSNACK = (FrameData) FrameData.get(list, START_SESSION_NACK_BYTE);
- FrameData enumES = (FrameData) FrameData.get(list, END_SESSION_BYTE);
-
- assertNotNull("Start session byte match returned null", enumSS);
- assertNotNull("Single byte match returned null", enumSSACK);
- assertNotNull("First byte match returned null", enumSSNACK);
- assertNotNull("Consecutive byte match returned null", enumES);
-
- // Check the string values
- enumSS = (FrameData) FrameData.get(list, START_SESSION_STRING);
- enumSSACK = (FrameData) FrameData.get(list, START_SESSION_ACK_STRING);
- enumSSNACK = (FrameData) FrameData.get(list, START_SESSION_NACK_STRING);
- enumES = (FrameData) FrameData.get(list, END_SESSION_STRING);
-
- assertNotNull("Start session string match returned null", enumSS);
- assertNotNull("Single string match returned null", enumSSACK);
- assertNotNull("First string match returned null", enumSSNACK);
- assertNotNull("Consecutive string match returned null", enumES);
-
- } catch (NullPointerException exception) {
- fail("Null enum list throws NullPointerException.");
- }
- }
-
- // Verifies that an invalid assignment is null.
- public void testInvalidEnum () {
-
- final byte INVALID_BYTE = (byte) 0xAB;
- final String INVALID_STRING = "Invalid";
-
- try {
-
- // Check the byte value
- FrameData enumInvalid = (FrameData) FrameData.get(list, INVALID_BYTE);
- assertNull("Invalid byte match didn't return null", enumInvalid);
-
- // Check the string value
- enumInvalid = (FrameData) FrameData.get(list, INVALID_STRING);
- assertNull("Invalid string match didn't return null", enumInvalid);
-
- } catch (IllegalArgumentException exception) {
- fail("Invalid enum throws IllegalArgumentException.");
- }
- }
-
- // Verifies that a null assignment is invalid.
- public void testNullEnum () {
- try {
-
- // Check null string lookup
- FrameData enumNull = (FrameData) FrameData.get(list, null);
- assertNull("Null lookup returns a value", enumNull);
-
- } catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- // Verifies the possible enum values of FrameType.
- public void testListEnum () {
- // Test Vector
- Vector<FrameData> enumTestList = new Vector<FrameData>();
- enumTestList.add(FrameData.StartSession);
- enumTestList.add(FrameData.StartSessionACK);
- enumTestList.add(FrameData.StartSessionNACK);
- enumTestList.add(FrameData.EndSession);
-
- assertTrue("List does not match enum test list.",
- list.containsAll(enumTestList) &&
- enumTestList.containsAll(list));
-
- // Test Array
- FrameData[] enumValueArray = FrameData.values();
- FrameData[] enumTestArray = { FrameData.StartSession, FrameData.StartSessionACK,
- FrameData.StartSessionNACK, FrameData.EndSession };
-
- assertTrue("Array does not match enum values array.",
- Validator.validateFrameDataArray(enumValueArray, enumTestArray));
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameTypeTests.java
deleted file mode 100644
index 241872b7a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/FrameTypeTests.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package com.smartdevicelink.test.protocol.enums;
-
-import java.util.Vector;
-
-import com.smartdevicelink.protocol.enums.FrameType;
-import com.smartdevicelink.test.Validator;
-
-import junit.framework.TestCase;
-
-public class FrameTypeTests extends TestCase {
-
- private Vector<FrameType> list = FrameType.getList();
-
- // Verifies the values are not null upon valid assignment.
- // These are not actual enums for packeting reasons so testing is different.
- public void testValidEnums () {
-
- final byte CONTROL_BYTE = (byte) 0x00;
- final String CONTROL_STRING = "Control";
-
- final byte SINGLE_BYTE = (byte) 0x01;
- final String SINGLE_STRING = "Single";
-
- final byte FIRST_BYTE = (byte) 0x02;
- final String FIRST_STRING = "First";
-
- final byte CONSECUTIVE_BYTE = (byte) 0x03;
- final String CONSECUTIVE_STRING = "Consecutive";
-
- try {
-
- assertNotNull("FrameType list returned null", list);
-
- // Check the byte values
- FrameType enumControl = (FrameType) FrameType.get(list, CONTROL_BYTE);
- FrameType enumSingle = (FrameType) FrameType.get(list, SINGLE_BYTE);
- FrameType enumFirst = (FrameType) FrameType.get(list, FIRST_BYTE);
- FrameType enumConsecutive = (FrameType) FrameType.get(list, CONSECUTIVE_BYTE);
-
- assertNotNull("Control byte match returned null", enumControl);
- assertNotNull("Single byte match returned null", enumSingle);
- assertNotNull("First byte match returned null", enumFirst);
- assertNotNull("Consecutive byte match returned null", enumConsecutive);
-
- // Check the string values
- enumControl = (FrameType) FrameType.get(list, CONTROL_STRING);
- enumSingle = (FrameType) FrameType.get(list, SINGLE_STRING);
- enumFirst = (FrameType) FrameType.get(list, FIRST_STRING);
- enumConsecutive = (FrameType) FrameType.get(list, CONSECUTIVE_STRING);
-
- assertNotNull("Control string match returned null", enumControl);
- assertNotNull("Single string match returned null", enumSingle);
- assertNotNull("First string match returned null", enumFirst);
- assertNotNull("Consecutive string match returned null", enumConsecutive);
-
- } catch (NullPointerException exception) {
- fail("Null enum list throws NullPointerException.");
- }
- }
-
- // Verifies that an invalid assignment is null.
- public void testInvalidEnum () {
-
- final byte INVALID_BYTE = (byte) 0xAB;
- final String INVALID_STRING = "Invalid";
-
- try {
-
- // Check the byte value
- FrameType enumInvalid = (FrameType) FrameType.get(list, INVALID_BYTE);
- assertNull("Invalid byte match didn't return null", enumInvalid);
-
- // Check the string value
- enumInvalid = (FrameType) FrameType.get(list, INVALID_STRING);
- assertNull("Invalid string match didn't return null", enumInvalid);
-
- } catch (IllegalArgumentException exception) {
- fail("Invalid enum throws IllegalArgumentException.");
- }
- }
-
- // Verifies that a null assignment is invalid.
- public void testNullEnum () {
- try {
-
- // Check null string lookup
- FrameType enumNull = (FrameType) FrameType.get(list, null);
- assertNull("Null lookup returns a value", enumNull);
-
- } catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- // Verifies the possible enum values of FrameType.
- public void testListEnum () {
-
- // Test Vector
- Vector<FrameType> enumTestList = new Vector<FrameType>();
- enumTestList.add(FrameType.Control);
- enumTestList.add(FrameType.Single);
- enumTestList.add(FrameType.First);
- enumTestList.add(FrameType.Consecutive);
-
- assertTrue("List does not match enum test list.",
- list.containsAll(enumTestList) &&
- enumTestList.containsAll(list));
-
- // Test Array
- FrameType[] enumValueArray = FrameType.values();
- FrameType[] enumTestArray = { FrameType.Control, FrameType.Single,
- FrameType.First, FrameType.Consecutive };
-
- assertTrue("Array does not match enum values array.",
- Validator.validateFrameTypeArray(enumValueArray, enumTestArray));
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/MessageTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/MessageTypeTests.java
deleted file mode 100644
index d0cb7cc30..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/MessageTypeTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.smartdevicelink.test.protocol.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import com.smartdevicelink.protocol.enums.MessageType;
-
-import junit.framework.TestCase;
-
-public class MessageTypeTests extends TestCase {
-
- public void testValidEnums () {
- String example = "UNDEFINED";
- MessageType enumUndefined = MessageType.valueForString(example);
- example = "BULK";
- MessageType enumBulk = MessageType.valueForString(example);
- example = "RPC";
- MessageType enumRpc = MessageType.valueForString(example);
-
- assertNotNull("UNDEFINED returned null", enumUndefined);
- assertNotNull("BULK returned null", enumBulk);
- assertNotNull("RPC returned null", enumRpc);
- }
-
- public void testInvalidEnum () {
- String example = "RpC";
-
- try {
- MessageType temp = MessageType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- } catch (IllegalArgumentException exception) {
- fail("Invalid enum throws IllegalArgumentException");
- }
- }
-
- public void testNullEnum () {
- String example = null;
-
- try {
- MessageType temp = MessageType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- public void testListEnum() {
- List<MessageType> enumValueList = Arrays.asList(MessageType.values());
-
- List<MessageType> enumTestList = new ArrayList<MessageType>();
- enumTestList.add(MessageType.UNDEFINED);
- enumTestList.add(MessageType.BULK);
- enumTestList.add(MessageType.RPC);
-
- 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/protocol/enums/SessionTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/SessionTypeTests.java
deleted file mode 100644
index 8a8634cc4..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/enums/SessionTypeTests.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package com.smartdevicelink.test.protocol.enums;
-
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.test.Validator;
-
-public class SessionTypeTests extends TestCase {
-
- private Vector<SessionType> list = SessionType.getList();
-
- // Verifies the values are not null upon valid assignment.
- // These are not actual enums for packeting reasons so testing is different.
- public void testValidEnums () {
-
- final byte HEARTBEAT_BYTE = (byte) 0x00;
- final String HEARTBEAT_STRING = "CONTROL";
-
- final byte RPC_BYTE = (byte) 0x07;
- final String RPC_STRING = "RPC";
-
- final byte PCM_BYTE = (byte) 0x0A;
- final String PCM_STRING = "PCM";
-
- final byte NAV_BYTE = (byte) 0x0B;
- final String NAV_STRING = "NAV";
-
- final byte BULK_DATA_BYTE = (byte) 0x0F;
- final String BULK_DATA_STRING = "BULK_DATA";
-
- try {
-
- assertNotNull("SessionType list returned null", list);
-
- // Check the byte values
- SessionType enumHeartbeat = (SessionType) SessionType.get(list, HEARTBEAT_BYTE);
- SessionType enumRPC = (SessionType) SessionType.get(list, RPC_BYTE);
- SessionType enumPCM = (SessionType) SessionType.get(list, PCM_BYTE);
- SessionType enumNAV = (SessionType) SessionType.get(list, NAV_BYTE);
- SessionType enumBulkData = (SessionType) SessionType.get(list, BULK_DATA_BYTE);
-
- assertNotNull("Start session byte match returned null", enumHeartbeat);
- assertNotNull("Single byte match returned null", enumRPC);
- assertNotNull("First byte match returned null", enumPCM);
- assertNotNull("Consecutive byte match returned null", enumNAV);
- assertNotNull("Consecutive byte match returned null", enumBulkData);
-
- // Check the string values
- enumHeartbeat = (SessionType) SessionType.get(list, HEARTBEAT_STRING);
- enumRPC = (SessionType) SessionType.get(list, RPC_STRING);
- enumPCM = (SessionType) SessionType.get(list, PCM_STRING);
- enumNAV = (SessionType) SessionType.get(list, NAV_STRING);
- enumBulkData = (SessionType) SessionType.get(list, BULK_DATA_STRING);
-
- assertNotNull("Start session string match returned null", enumHeartbeat);
- assertNotNull("Single string match returned null", enumRPC);
- assertNotNull("First string match returned null", enumPCM);
- assertNotNull("Consecutive string match returned null", enumNAV);
- assertNotNull("Consecutive string match returned null", enumBulkData);
-
- } catch (NullPointerException exception) {
- fail("Null enum list throws NullPointerException.");
- }
- }
-
- // Verifies that an invalid assignment is null.
- public void testInvalidEnum () {
-
- final byte INVALID_BYTE = (byte) 0xAB;
- final String INVALID_STRING = "Invalid";
-
- try {
-
- // Check the byte value
- SessionType enumInvalid = (SessionType) SessionType.get(list, INVALID_BYTE);
- assertNull("Invalid byte match didn't return null", enumInvalid);
-
- // Check the string value
- enumInvalid = (SessionType) SessionType.get(list, INVALID_STRING);
- assertNull("Invalid string match didn't return null", enumInvalid);
-
- } catch (IllegalArgumentException exception) {
- fail("Invalid enum throws IllegalArgumentException.");
- }
- }
-
- // Verifies that a null assignment is invalid.
- public void testNullEnum () {
- try {
-
- // Check null string lookup
- SessionType enumNull = (SessionType) SessionType.get(list, null);
- assertNull("Null lookup returns a value", enumNull);
-
- } catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- // Verifies the possible enum values of SessionType.
- public void testListEnum () {
- // Test Vector
- Vector<SessionType> enumTestList = new Vector<SessionType>();
- enumTestList.add(SessionType.RPC);
- enumTestList.add(SessionType.PCM);
- enumTestList.add(SessionType.NAV);
- enumTestList.add(SessionType.BULK_DATA);
- enumTestList.add(SessionType.CONTROL);
-
- assertTrue("List does not match enum test list.",
- list.containsAll(enumTestList) &&
- enumTestList.containsAll(list));
-
- // Test Array
- SessionType[] enumValueArray = SessionType.values();
- SessionType[] enumTestArray = { SessionType.RPC, SessionType.PCM,
- SessionType.NAV, SessionType.BULK_DATA,
- SessionType.CONTROL };
-
- assertTrue("Array does not match enum values array.",
- Validator.validateSessionTypeArray(enumValueArray, enumTestArray));
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java
deleted file mode 100644
index 0b5524786..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.smartdevicelink.test.protocol.heartbeat;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import com.smartdevicelink.protocol.heartbeat.HeartbeatMonitor;
-import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitorListener;
-import com.smartdevicelink.test.Test;
-
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.protocol.heartbeat.HeartbeatMonitor}
- */
-public class HeartbeatMonitorTests extends TestCase {
-
- // TODO : Proper thread testing.
-
- private HeartbeatMonitor monitor = new HeartbeatMonitor();
- private Runnable testRunnable;
- private Timer timer;
-
- public void testValues () {
- assertNotNull(Test.NOT_NULL, monitor);
-
- testRunnable = monitor.getHeartbeatRunnable();
- assertNotNull(Test.NOT_NULL, testRunnable);
-
- int testInterval = 100;
- monitor.setInterval(testInterval);
- assertEquals("Interval did not match expected value", monitor.getInterval(), testInterval);
- }
-
- public void testThread () {
- try {
- Thread testThread = new Thread(testRunnable);
- assertNotNull(Test.NOT_NULL, testThread);
- setTimeout(5000, testThread); // Cannot leave thread hanging
-
- testThread.start();
- testThread.join();
- } catch (Exception e) {
- fail("Thread exception was thrown");
- }
- }
-
- private void setTimeout(int duration, final Thread thread) {
- timer = new Timer();
- timer.schedule(new TimerTask() {
- @Override
- public void run() {
- thread.interrupt();
- }
- }, duration);
- }
-
- public void testNull () {
- // Testing a null value for listener instead of implementing and overriding
- // IHeartbeatMonitorListener methods to test the getter/setter methods of HeartbeatMonitor.
- monitor.setListener(null);
- IHeartbeatMonitorListener testListener = monitor.getListener();
- assertNull("Listener returned a value", testListener);
-
- // Interface testing issue >>
- // monitor.heartbeatACKReceived(); // Sets the ack boolean flag
- // assertTrue("ACK value was not true", monitor.getACKReceived());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java
deleted file mode 100644
index 1d02875b1..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package com.smartdevicelink.test.proxy;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.LockScreenManager;
-import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.LockScreenManager}
- */
-public class LockScreenManagerTest extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.LockScreenManager#setDriverDistStatus(boolean)}
- */
- public void testDriverDistStatus(){
- LockScreenManager lockMan = new LockScreenManager();
- lockMan.setDriverDistStatus(true);
- assertEquals(Test.MATCH, true, (boolean) lockMan.getLockObj().getDriverDistractionStatus());
-
- lockMan.setDriverDistStatus(false);
- assertEquals(Test.MATCH, false, (boolean) lockMan.getLockObj().getDriverDistractionStatus());
- }
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.LockScreenManager#setHMILevel(HMILevel)}
- */
- public void testHmiLevelStatus(){
- LockScreenManager lockMan = new LockScreenManager();
- lockMan.setHMILevel(HMILevel.HMI_BACKGROUND);
- assertEquals(Test.MATCH, HMILevel.HMI_BACKGROUND, lockMan.getLockObj().getHMILevel());
-
- lockMan.setHMILevel(HMILevel.HMI_FULL);
- assertEquals(Test.MATCH, HMILevel.HMI_FULL, lockMan.getLockObj().getHMILevel());
-
- lockMan.setHMILevel(HMILevel.HMI_LIMITED);
- assertEquals(Test.MATCH, HMILevel.HMI_LIMITED, lockMan.getLockObj().getHMILevel());
-
- lockMan.setHMILevel(HMILevel.HMI_NONE);
- assertEquals(Test.MATCH, HMILevel.HMI_NONE, lockMan.getLockObj().getHMILevel());
-
- lockMan.setHMILevel(null);
- assertNull(Test.NULL, lockMan.getLockObj().getHMILevel());
- }
-
- /**
- * Test the lock screen status when no setter methods are called.
- */
- public void testLockScreenStatusNull(){
- LockScreenManager lockMan = new LockScreenManager();
- OnLockScreenStatus result = lockMan.getLockObj();
- assertNotNull(Test.NOT_NULL, result);
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
- }
-
- /**
- * Test the invalid settings of lock screen status.
- */
- public void testLockScreenStatusDriverDistNull(){
- LockScreenManager lockMan = new LockScreenManager();
-
- OnLockScreenStatus result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_NONE);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_BACKGROUND);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_FULL);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_LIMITED);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen());
- }
-
- /**
- * Test the enabled settings of lock screen status.
- */
- public void testLockScreenStatusDriverDistEnabled(){
- LockScreenManager lockMan = new LockScreenManager();
- lockMan.setDriverDistStatus(true);
-
- // HMI level is null
- OnLockScreenStatus result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_NONE);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_BACKGROUND);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_FULL);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_LIMITED);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen());
- }
-
- /**
- * Test the disabled settings of lock screen status.
- */
- public void testLockScreenStatusDriverDistDisabled(){
- LockScreenManager lockMan = new LockScreenManager();
- lockMan.setDriverDistStatus(false);
-
- OnLockScreenStatus result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_NONE);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_BACKGROUND);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_FULL);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OPTIONAL, result.getShowLockScreen());
-
- lockMan.setHMILevel(HMILevel.HMI_LIMITED);
- result = lockMan.getLockObj();
- assertEquals(Test.MATCH, LockScreenStatus.OPTIONAL, result.getShowLockScreen());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java
deleted file mode 100644
index e31aedbe7..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java
+++ /dev/null
@@ -1,1103 +0,0 @@
-package com.smartdevicelink.test.proxy;
-
-import java.util.Vector;
-
-import junit.framework.TestCase;
-import android.telephony.TelephonyManager;
-
-import com.smartdevicelink.proxy.RPCRequestFactory;
-import com.smartdevicelink.proxy.TTSChunkFactory;
-import com.smartdevicelink.proxy.rpc.AddCommand;
-import com.smartdevicelink.proxy.rpc.AddSubMenu;
-import com.smartdevicelink.proxy.rpc.Alert;
-import com.smartdevicelink.proxy.rpc.ChangeRegistration;
-import com.smartdevicelink.proxy.rpc.Choice;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
-import com.smartdevicelink.proxy.rpc.DeleteCommand;
-import com.smartdevicelink.proxy.rpc.DeleteFile;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenu;
-import com.smartdevicelink.proxy.rpc.DeviceInfo;
-import com.smartdevicelink.proxy.rpc.EndAudioPassThru;
-import com.smartdevicelink.proxy.rpc.GetVehicleData;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.ListFiles;
-import com.smartdevicelink.proxy.rpc.PerformAudioPassThru;
-import com.smartdevicelink.proxy.rpc.PerformInteraction;
-import com.smartdevicelink.proxy.rpc.PutFile;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
-import com.smartdevicelink.proxy.rpc.ScrollableMessage;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.proxy.rpc.SetAppIcon;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayout;
-import com.smartdevicelink.proxy.rpc.SetGlobalProperties;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimer;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.Slider;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.Speak;
-import com.smartdevicelink.proxy.rpc.SubscribeButton;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleData;
-import com.smartdevicelink.proxy.rpc.SystemRequest;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButton;
-import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData;
-import com.smartdevicelink.proxy.rpc.VrHelpItem;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
-import com.smartdevicelink.test.NullValues;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.RPCRequestFactory}
- */
-public class RPCRequestFactoryTests extends TestCase {
-
- public void testBuildSystemRequest () {
-
- String testData;
- Integer testInt;
- SystemRequest testBSR;
- Vector<String> testVData;
-
- // Test -- buildSystemRequest(String data, Integer correlationID)
- testData = "test";
- testInt = 0;
- testBSR = RPCRequestFactory.buildSystemRequest(testData, testInt);
- assertNotNull(Test.NOT_NULL, testBSR.getBulkData());
- assertEquals(Test.MATCH, testInt, testBSR.getCorrelationID());
-
- testBSR = RPCRequestFactory.buildSystemRequest(testData, null);
- assertNotNull(Test.NULL, testBSR.getCorrelationID());
-
- testBSR = RPCRequestFactory.buildSystemRequest(null, testInt);
- assertNull(Test.NULL, testBSR);
-
- // Test -- buildSystemRequestLegacy(Vector<String> data, Integer correlationID)
- testVData = new Vector<String>();
- testVData.add("Test A");
- testVData.add("Test B");
- testVData.add("Test C");
- testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, testInt);
- assertEquals(Test.MATCH, testVData, new Vector<String>(testBSR.getLegacyData()));
- assertEquals(Test.MATCH, testInt, testBSR.getCorrelationID());
-
- testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, null);
- assertNotNull(Test.NOT_NULL, testBSR.getCorrelationID());
-
- testBSR = RPCRequestFactory.buildSystemRequestLegacy(null, testInt);
- assertNull(Test.NULL, testBSR);
-
- // Issue #166 -- Null values within the Vector<String> parameter.
- // TODO: Once resolved, add the following test.
- //testVData = new Vector<String>();
- //testVData.add("Test A");
- //testVData.add("Test B");
- //testVData.add(null);
- //testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, testInt);
- //assertNull(Test.NULL, testBSR);
- }
-
- public void testBuildAddCommand () {
-
- Image testImage;
- String testMenuText, testIconValue;
- Integer testCommandID, testParentID, testPosition, testCorrelationID;
- ImageType testIconType;
- AddCommand testBAC;
- Vector<String> testVrCommands;
-
- // Test -- buildAddCommand(Integer commandID, String menuText, Integer parentID, Integer position,Vector<String> vrCommands, Image cmdIcon, Integer correlationID)
- testImage = new Image();
- testMenuText = "menu";
- testPosition = 1;
- testParentID = 2;
- testCommandID = 3;
- testCorrelationID = 4;
- testVrCommands = new Vector<String>();
- testImage.setImageType(ImageType.STATIC);
- testImage.setValue("image");
- testVrCommands.add("Test A");
- testVrCommands.add("Test B");
- testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testImage, testCorrelationID);
- assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
- assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID());
- assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition());
- assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
- assertTrue(Test.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon()));
- assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null, null);
- assertNull(Test.NULL, testBAC.getCmdID());
- assertNull(Test.NULL, testBAC.getMenuParams());
- assertNull(Test.NULL, testBAC.getVrCommands());
- assertNull(Test.NULL, testBAC.getCmdIcon());
- assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
-
- // Test -- buildAddCommand(Integer commandID, String menuText, Integer parentID, Integer position, Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
- testIconValue = "icon";
- testIconType = ImageType.STATIC;
- testImage = new Image();
- testImage.setValue(testIconValue);
- testImage.setImageType(testIconType);
- testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testIconValue, testIconType, testCorrelationID);
- assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
- assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID());
- assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition());
- assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
- assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
- assertTrue(Test.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon()));
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null, null, null);
- assertNull(Test.NULL, testBAC.getCmdID());
- assertNull(Test.NULL, testBAC.getMenuParams());
- assertNull(Test.NULL, testBAC.getVrCommands());
- assertNull(Test.NULL, testBAC.getCmdIcon());
- assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
-
- // Test -- buildAddCommand(Integer commandID, String menuText, Integer parentID, Integer position, Vector<String> vrCommands, Integer correlationID)
- testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testCorrelationID);
- assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
- assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID());
- assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition());
- assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
- assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null);
- assertNull(Test.NULL, testBAC.getCmdID());
- assertNull(Test.NULL, testBAC.getMenuParams());
- assertNull(Test.NULL, testBAC.getVrCommands());
- assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
-
- // Test -- buildAddCommand(Integer commandID, String menuText, Vector<String> vrCommands, Integer correlationID)
- testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testVrCommands, testCorrelationID);
- assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
- assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
- assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null);
- assertNull(Test.NULL, testBAC.getCmdID());
- assertNull(Test.NULL, testBAC.getMenuParams());
- assertNull(Test.NULL, testBAC.getVrCommands());
- assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
-
- // Test -- buildAddCommand(Integer commandID, Vector<String> vrCommands, Integer correlationID)
- testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testVrCommands, testCorrelationID);
- assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands());
- assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID());
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null);
- assertNull(Test.NULL, testBAC.getCmdID());
- assertNull(Test.NULL, testBAC.getVrCommands());
- assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID());
- }
-
- public void testBuildAddSubMenu () {
-
- Integer testMenuID, testCorrelationID, testPosition;
- String testMenuName;
- AddSubMenu testBASM;
-
- // Test -- buildAddSubMenu(Integer menuID, String menuName, Integer correlationID)
- // ^ Calls another build method.
- // Test -- buildAddSubMenu(Integer menuID, String menuName, Integer position, Integer correlationID)
- testMenuID = 0;
- testMenuName = "name";
- testPosition = 1;
- testCorrelationID = 2;
- testBASM = RPCRequestFactory.buildAddSubMenu(testMenuID, testMenuName, testPosition, testCorrelationID);
- assertEquals(Test.MATCH, testMenuID, testBASM.getMenuID());
- assertEquals(Test.MATCH, testMenuName, testBASM.getMenuName());
- assertEquals(Test.MATCH, testPosition, testBASM.getPosition());
- assertEquals(Test.MATCH, testCorrelationID, testBASM.getCorrelationID());
-
- testBASM = RPCRequestFactory.buildAddSubMenu(null, null, null, null);
- assertNull(Test.NULL, testBASM.getMenuID());
- assertNull(Test.NULL, testBASM.getMenuName());
- assertNull(Test.NULL, testBASM.getPosition());
- assertNotNull(Test.NOT_NULL, testBASM.getCorrelationID());
- }
-
- public void testBuildAlert () {
-
- Alert testAlert;
- String testTTSText, testAlertText1, testAlertText2, testAlertText3;
- Integer testCorrelationID, testDuration;
- Boolean testPlayTone;
- Vector<SoftButton> testSoftButtons;
- Vector<TTSChunk> testTtsChunks;
-
- // Test -- buildAlert(String ttsText, Boolean playTone, Vector<SoftButton> softButtons, Integer correlationID)
- testTTSText = "simple test";
- testCorrelationID = 0;
- testPlayTone = true;
- testSoftButtons = new Vector<SoftButton>();
- SoftButton test1 = new SoftButton();
- test1.setText("test 1");
- SoftButton test2 = new SoftButton();
- test2.setText("test 2");
- testSoftButtons.add(test1);
- testSoftButtons.add(test2);
- testAlert = RPCRequestFactory.buildAlert(testTTSText, testPlayTone, testSoftButtons, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(TTSChunkFactory.createSimpleTTSChunks(testTTSText), testAlert.getTtsChunks()));
- // ^ Calls another build method.
-
- // Test -- buildAlert(String alertText1, String alertText2, String alertText3, Integer duration, Vector<SoftButton> softButtons, Integer correlationID)
- testAlertText1 = "test 1";
- testAlertText2 = "test 2";
- testAlertText3 = "test 3";
- testDuration = 1;
- // ^ Calls another build method.
-
- // Test -- buildAlert(String ttsText, String alertText1, String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID)
- testAlert = RPCRequestFactory.buildAlert(testTTSText, testAlertText1, testAlertText2, testAlertText3, testPlayTone, testDuration, testSoftButtons, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(TTSChunkFactory.createSimpleTTSChunks(testTTSText), testAlert.getTtsChunks()));
- // ^ Calls another build method.
-
- // Test -- buildAlert(Vector<TTSChunk> chunks, Boolean playTone, Vector<SoftButton> softButtons, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildAlert(Vector<TTSChunk> ttsChunks, String alertText1, String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID)
- testTtsChunks = TTSChunkFactory.createSimpleTTSChunks(testTTSText);
- testAlert = RPCRequestFactory.buildAlert(testTtsChunks, testAlertText1, testAlertText2, testAlertText3, testPlayTone, testDuration, testSoftButtons, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks()));
- assertEquals(Test.MATCH, testAlertText1, testAlert.getAlertText1());
- assertEquals(Test.MATCH, testAlertText2, testAlert.getAlertText2());
- assertEquals(Test.MATCH, testAlertText3, testAlert.getAlertText3());
- assertEquals(Test.MATCH, testPlayTone, testAlert.getPlayTone());
- assertEquals(Test.MATCH, testDuration, testAlert.getDuration());
- assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testAlert.getSoftButtons()));
- assertEquals(Test.MATCH, testCorrelationID, testAlert.getCorrelationID());
-
- testAlert = RPCRequestFactory.buildAlert((Vector<TTSChunk>) null, null, null, null, null, null, null, null);
- assertNull(Test.NULL, testAlert.getTtsChunks());
- assertNull(Test.NULL, testAlert.getAlertText1());
- assertNull(Test.NULL, testAlert.getAlertText2());
- assertNull(Test.NULL, testAlert.getAlertText3());
- assertNull(Test.NULL, testAlert.getPlayTone());
- assertNull(Test.NULL, testAlert.getDuration());
- assertNull(Test.NULL, testAlert.getSoftButtons());
- assertNotNull(Test.NOT_NULL, testAlert.getCorrelationID());
-
- // Test -- buildAlert(String ttsText, Boolean playTone, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildAlert(String alertText1, String alertText2, Integer duration, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildAlert(String ttsText, String alertText1, String alertText2, Boolean playTone, Integer duration, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildAlert(Vector<TTSChunk> chunks, Boolean playTone, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildAlert(Vector<TTSChunk> ttsChunks, String alertText1, String alertText2, Boolean playTone, Integer duration, Integer correlationID)
- testAlert = RPCRequestFactory.buildAlert(testTtsChunks, testAlertText1, testAlertText2, testPlayTone, testDuration, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks()));
- assertEquals(Test.MATCH, testAlertText1, testAlert.getAlertText1());
- assertEquals(Test.MATCH, testAlertText2, testAlert.getAlertText2());
- assertEquals(Test.MATCH, testPlayTone, testAlert.getPlayTone());
- assertEquals(Test.MATCH, testDuration, testAlert.getDuration());
- assertEquals(Test.MATCH, testCorrelationID, testAlert.getCorrelationID());
-
- testAlert = RPCRequestFactory.buildAlert((Vector<TTSChunk>) null, null, null, null, null, null);
- assertNull(Test.NULL, testAlert.getTtsChunks());
- assertNull(Test.NULL, testAlert.getAlertText1());
- assertNull(Test.NULL, testAlert.getAlertText2());
- assertNull(Test.NULL, testAlert.getPlayTone());
- assertNull(Test.NULL, testAlert.getDuration());
- assertNotNull(Test.NOT_NULL, testAlert.getCorrelationID());
- }
-
- public void testBuildCreateInteractionChoiceSet () {
-
- Integer testICSID, testCorrelationID;
- Vector<Choice> testChoiceSet;
- CreateInteractionChoiceSet testBCICS;
-
- // Test --buildCreateInteractionChoiceSet(Vector<Choice> choiceSet, Integer interactionChoiceSetID, Integer correlationID)
- testICSID = 0;
- testCorrelationID = 1;
- testChoiceSet = new Vector<Choice>();
- Choice testChoice = new Choice();
- testChoiceSet.add(testChoice);
- testBCICS = RPCRequestFactory.buildCreateInteractionChoiceSet(testChoiceSet, testICSID, testCorrelationID);
- assertEquals(Test.MATCH, testChoiceSet, testBCICS.getChoiceSet());
- assertEquals(Test.MATCH, testICSID, testBCICS.getInteractionChoiceSetID());
- assertEquals(Test.MATCH, testCorrelationID, testBCICS.getCorrelationID());
-
- testBCICS = RPCRequestFactory.buildCreateInteractionChoiceSet(null, null, null);
- assertNull(Test.NULL, testBCICS.getChoiceSet());
- assertNull(Test.NULL, testBCICS.getInteractionChoiceSetID());
- assertNotNull(Test.NOT_NULL, testBCICS.getCorrelationID());
- }
-
- public void testBuildDeleteCommand () {
-
- Integer testCID, testCorrelationID;
- DeleteCommand testDC;
-
- // Test -- buildDeleteCommand(Integer commandID, Integer correlationID)
- testCID = 0;
- testCorrelationID = 1;
- testDC = RPCRequestFactory.buildDeleteCommand(testCID, testCorrelationID);
- assertEquals(Test.MATCH, testCID, testDC.getCmdID());
- assertEquals(Test.MATCH, testCorrelationID, testDC.getCorrelationID());
-
- testDC = RPCRequestFactory.buildDeleteCommand(null, null);
- assertNull(Test.NULL, testDC.getCmdID());
- assertNotNull(Test.NOT_NULL, testDC.getCorrelationID());
-
- }
-
- public void testBuildDeleteFile () {
-
- Integer testCorrelationID;
- String testFileName;
- DeleteFile testDF;
-
- // Test --buildDeleteFile(String sdlFileName, Integer correlationID)
- testCorrelationID = 0;
- testFileName = "test";
- testDF = RPCRequestFactory.buildDeleteFile(testFileName, testCorrelationID);
- assertEquals(Test.MATCH, testCorrelationID, testDF.getCorrelationID());
- assertEquals(Test.MATCH, testFileName, testDF.getSdlFileName());
-
- testDF = RPCRequestFactory.buildDeleteFile(null, null);
- assertNotNull(Test.NOT_NULL, testDF.getCorrelationID());
- assertNull(Test.NULL, testDF.getSdlFileName());
-
- }
-
- public void testBuildDeleteInteractionChoiceSet () {
-
- Integer testICSID, testCorrelationID;
- DeleteInteractionChoiceSet testDICS;
-
- // Test -- buildDeleteInteractionChoiceSet(Integer interactionChoiceSetID, Integer correlationID)
- testICSID = 0;
- testCorrelationID = 1;
- testDICS = RPCRequestFactory.buildDeleteInteractionChoiceSet(testICSID, testCorrelationID);
- assertEquals(Test.MATCH, testICSID, testDICS.getInteractionChoiceSetID());
- assertEquals(Test.MATCH, testCorrelationID, testDICS.getCorrelationID());
-
- testDICS = RPCRequestFactory.buildDeleteInteractionChoiceSet(null, null);
- assertNull(Test.NULL, testDICS.getInteractionChoiceSetID());
- assertNotNull(Test.NOT_NULL, testDICS.getCorrelationID());
- }
-
- public void testBuildDeleteSubMenu () {
-
- Integer testMenuID, testCorrelationID;
- DeleteSubMenu testDSM;
-
- // Test -- buildDeleteSubMenu(Integer menuID, Integer correlationID)
- testMenuID = 0;
- testCorrelationID = 1;
- testDSM = RPCRequestFactory.buildDeleteSubMenu(testMenuID, testCorrelationID);
- assertEquals(Test.MATCH, testMenuID, testDSM.getMenuID());
- assertEquals(Test.MATCH, testCorrelationID, testDSM.getCorrelationID());
-
- testDSM = RPCRequestFactory.buildDeleteSubMenu(null, null);
- assertNull(Test.NULL, testDSM.getMenuID());
- assertNotNull(Test.NOT_NULL, testDSM.getCorrelationID());
- }
-
- public void testBuildListFiles () {
-
- Integer testCorrelationID = 0;
- ListFiles testLF;
-
- // Test -- buildListFiles(Integer correlationID)
- testLF = RPCRequestFactory.buildListFiles(testCorrelationID);
- assertEquals(Test.MATCH, testCorrelationID, testLF.getCorrelationID());
-
- testLF = RPCRequestFactory.buildListFiles(null);
- assertNotNull(Test.NOT_NULL, testLF.getCorrelationID());
- }
-
- @SuppressWarnings("deprecation")
- public void testBuildPerformInteraction () {
-
- String testDisplayText = "test";
- Integer testTimeout = 1, testCorrelationID = 0;
- InteractionMode testIM = InteractionMode.BOTH;
- Vector<TTSChunk> testInitChunks, testHelpChunks, testTimeoutChunks;
- Vector<Integer> testCSIDs;
- Vector<VrHelpItem> testVrHelpItems;
- PerformInteraction testPI;
-
- // Test -- buildPerformInteraction(Vector<TTSChunk> initChunks, String displayText, Vector<Integer> interactionChoiceSetIDList, Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp, Integer correlationID)
- testInitChunks = TTSChunkFactory.createSimpleTTSChunks("init chunks");
- testHelpChunks = TTSChunkFactory.createSimpleTTSChunks("help items");
- testTimeoutChunks = TTSChunkFactory.createSimpleTTSChunks("timeout");
- testVrHelpItems = new Vector<VrHelpItem>();
- VrHelpItem testItem = new VrHelpItem();
- testItem.setPosition(0);
- testItem.setText("text");
- Image image = new Image();
- image.setValue("value");
- image.setImageType(ImageType.DYNAMIC);
- testItem.setImage(image);
- testVrHelpItems.add(testItem);
- testCSIDs = new Vector<Integer>();
- testCSIDs.add(0);
- testCSIDs.add(1);
- testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testTimeoutChunks, testIM, testTimeout, testVrHelpItems, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
- assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText());
- assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt()));
- assertEquals(Test.MATCH, testIM, testPI.getInteractionMode());
- assertEquals(Test.MATCH, testTimeout, testPI.getTimeout());
- assertTrue(Test.TRUE, Validator.validateVrHelpItems(testVrHelpItems, testPI.getVrHelp()));
- assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID());
-
- testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null, null, null);
- assertNull(Test.NULL, testPI.getInitialPrompt());
- assertNull(Test.NULL, testPI.getInitialText());
- assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList());
- assertNull(Test.NULL, testPI.getHelpPrompt());
- assertNull(Test.NULL, testPI.getTimeoutPrompt());
- assertNull(Test.NULL, testPI.getInteractionMode());
- assertNull(Test.NULL, testPI.getTimeout());
- assertNull(Test.NULL, testPI.getVrHelp());
- assertNotNull(Test.NOT_NULL, testPI.getCorrelationID());
-
- // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildPerformInteraction(String initPrompt, String displayText, Integer interactionChoiceSetID, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildPerformInteraction(String initPrompt, String displayText, Integer interactionChoiceSetID, Vector<VrHelpItem> vrHelp, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildPerformInteraction(Vector<TTSChunk> initChunks, String displayText, Vector<Integer> interactionChoiceSetIDList, Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, InteractionMode interactionMode, Integer timeout, Integer correlationID)
- testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testTimeoutChunks, testIM, testTimeout, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
- assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText());
- assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt()));
- assertEquals(Test.MATCH, testIM, testPI.getInteractionMode());
- assertEquals(Test.MATCH, testTimeout, testPI.getTimeout());
- assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID());
-
- testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null, null);
- assertNull(Test.NULL, testPI.getInitialPrompt());
- assertNull(Test.NULL, testPI.getInitialText());
- assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList());
- assertNull(Test.NULL, testPI.getHelpPrompt());
- assertNull(Test.NULL, testPI.getTimeoutPrompt());
- assertNull(Test.NULL, testPI.getInteractionMode());
- assertNull(Test.NULL, testPI.getTimeout());
- assertNotNull(Test.NOT_NULL, testPI.getCorrelationID());
-
- // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildPerformInteraction(String initPrompt, String displayText, Integer interactionChoiceSetID, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildPerformInteraction(String initPrompt, String displayText, Integer interactionChoiceSetID, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildPerformInteraction(Vector<TTSChunk> initChunks, String displayText, Vector<Integer> interactionChoiceSetIDList, Vector<TTSChunk> helpChunks, InteractionMode interactionMode, Integer timeout, Integer correlationID)
- testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testIM, testTimeout, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
- assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText());
- assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
- assertEquals(Test.MATCH, testIM, testPI.getInteractionMode());
- assertEquals(Test.MATCH, testTimeout, testPI.getTimeout());
- assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID());
-
- testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null);
- assertNull(Test.NULL, testPI.getInitialPrompt());
- assertNull(Test.NULL, testPI.getInitialText());
- assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList());
- assertNull(Test.NULL, testPI.getHelpPrompt());
- assertNull(Test.NULL, testPI.getInteractionMode());
- assertNull(Test.NULL, testPI.getTimeout());
- assertNotNull(Test.NOT_NULL, testPI.getCorrelationID());
-
- // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, InteractionMode interactionMode, Integer timeout, Integer correlationID)
- // ^ Calls another build method.
- }
-
- public void testBuildPutFiles () {
-
- String testFileName = "test";
- Boolean testPFile = true, testSystemFile = true;
- Integer testCorrelationID = 0;
- Long testOffset = 1L, testLength = 2L;
- FileType testFileType = FileType.BINARY;
- byte[] testFileData = {(byte) 0x00, (byte) 0x01, (byte) 0x02 };
- PutFile testPF;
-
- // Test -- buildPutFile(String sdlFileName, FileType fileType, Boolean persistentFile, byte[] fileData, Integer correlationID)
- testPF = RPCRequestFactory.buildPutFile(testFileName, testFileType, testPFile, testFileData, testCorrelationID);
- assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName());
- assertEquals(Test.MATCH, testFileType, testPF.getFileType());
- assertEquals(Test.MATCH, testPFile, testPF.getPersistentFile());
- assertTrue(Test.TRUE, Validator.validateBulkData(testFileData, testPF.getFileData()));
- assertEquals(Test.MATCH, testCorrelationID, testPF.getCorrelationID());
-
- testPF = RPCRequestFactory.buildPutFile(null, null, null, null, null);
- assertNull(Test.NULL, testPF.getSdlFileName());
- assertNull(Test.NULL, testPF.getFileType());
- assertNull(Test.NULL, testPF.getPersistentFile());
- assertNull(Test.NULL, testPF.getFileData());
- assertNotNull(Test.NOT_NULL, testPF.getCorrelationID());
-
- // Test -- buildPutFile(String sdlFileName, Integer iOffset, Integer iLength)
- testPF = RPCRequestFactory.buildPutFile(testFileName, testOffset, testLength);
- assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName());
- assertEquals(Test.MATCH, testOffset, testPF.getOffset());
- assertEquals(Test.MATCH, testLength, testPF.getLength());
-
- testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER);
- assertNull(Test.NULL, testPF.getSdlFileName());
- assertNull(Test.NULL, testPF.getOffset());
- assertNull(Test.NULL, testPF.getLength());
-
- // Test -- buildPutFile(String syncFileName, Integer iOffset, Integer iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile)
- testPF = RPCRequestFactory.buildPutFile(testFileName, testOffset, testLength, testFileType, testPFile, testSystemFile);
- assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName());
- assertEquals(Test.MATCH, testOffset, testPF.getOffset());
- assertEquals(Test.MATCH, testLength, testPF.getLength());
- assertTrue(Test.TRUE, testPF.getPersistentFile());
- assertEquals(Test.MATCH, testSystemFile, testPF.getSystemFile());
-
- testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER, null, NullValues.BOOLEAN, NullValues.BOOLEAN);
- assertNull(Test.NULL, testPF.getSdlFileName());
- assertNull(Test.NULL, testPF.getOffset());
- assertNull(Test.NULL, testPF.getLength());
- assertNull(Test.NULL, testPF.getFileType());
- assertNull(Test.NULL, testPF.getPersistentFile());
- assertNull(Test.NULL, testPF.getSystemFile());
- }
-
- public void testBuildRegisterAppInterface () {
-
- SdlMsgVersion testSMV = new SdlMsgVersion();
- testSMV.setMajorVersion(1);
- testSMV.setMinorVersion(0);
- String testAppName = "test", testNGN = "ngn", testAppID = "id";
- Vector<TTSChunk> testTTSName = TTSChunkFactory.createSimpleTTSChunks("name");
- Vector<String> testSynonyms = new Vector<String>();
- testSynonyms.add("examine");
- Boolean testIMA = false;
- Integer testCorrelationID = 0;
- Language testLang = Language.EN_US, testHMILang = Language.EN_GB;
- Vector<AppHMIType> testHMIType = new Vector<AppHMIType>();
- testHMIType.add(AppHMIType.DEFAULT);
- DeviceInfo testDI = RPCRequestFactory.BuildDeviceInfo(null);
- RegisterAppInterface testRAI;
-
- // Test -- buildRegisterAppInterface(String appName, String appID)
- // ^ Calls another build method.
-
- // Test -- buildRegisterAppInterface(String appName, Boolean isMediaApp, String appID)
- // ^ Calls another build method.
-
- // Test -- buildRegisterAppInterface(SdlMsgVersion sdlMsgVersion, String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID, Integer correlationID)
- testRAI = RPCRequestFactory.buildRegisterAppInterface(testSMV, testAppName, testTTSName, testNGN, testSynonyms, testIMA, testLang, testHMILang, testHMIType, testAppID, testCorrelationID,testDI);
- assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(testSMV, testRAI.getSdlMsgVersion()));
- assertEquals(Test.MATCH, testAppName, testRAI.getAppName());
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSName, testRAI.getTtsName()));
- assertEquals(Test.MATCH, testNGN, testRAI.getNgnMediaScreenAppName());
- assertTrue(Test.TRUE, Validator.validateStringList(testSynonyms, testRAI.getVrSynonyms()));
- assertEquals(Test.MATCH, testIMA, testRAI.getIsMediaApplication());
- assertEquals(Test.MATCH, testLang, testRAI.getLanguageDesired());
- assertEquals(Test.MATCH, testHMILang, testRAI.getHmiDisplayLanguageDesired());
- assertEquals(Test.MATCH, AppHMIType.DEFAULT, testRAI.getAppHMIType().get(0));
- assertEquals(Test.MATCH, testAppID, testRAI.getAppID());
- assertEquals(Test.MATCH, testCorrelationID, testRAI.getCorrelationID());
- assertEquals(Test.MATCH, testDI, testRAI.getDeviceInfo());
-
-
- testRAI = RPCRequestFactory.buildRegisterAppInterface(null, null, null, null, null, null, null, null, null, null, null,null);
- assertEquals(Test.MATCH, (Integer) 1, testRAI.getCorrelationID());
- assertEquals(Test.MATCH, testSMV.getMajorVersion(), testRAI.getSdlMsgVersion().getMajorVersion());
- assertEquals(Test.MATCH, testSMV.getMinorVersion(), testRAI.getSdlMsgVersion().getMinorVersion());
- assertNull(Test.NULL, testRAI.getAppName());
- assertNull(Test.NULL, testRAI.getTtsName());
- assertNull(Test.NULL, testRAI.getNgnMediaScreenAppName());
- assertNull(Test.NULL, testRAI.getVrSynonyms());
- assertNull(Test.NULL, testRAI.getIsMediaApplication());
- assertNotNull(Test.NOT_NULL, testRAI.getLanguageDesired());
- assertNotNull(Test.NOT_NULL, testRAI.getHmiDisplayLanguageDesired());
- assertNull(Test.NULL, testRAI.getAppHMIType());
- assertNull(Test.NULL, testRAI.getAppID());
- assertNull(Test.NULL, testRAI.getDeviceInfo());
- }
-
- public void testBuildSetAppIcon () {
-
- String testFileName = "test";
- Integer testCorrelationID = 0;
- SetAppIcon testSAI;
-
- // Test -- buildSetAppIcon(String sdlFileName, Integer correlationID)
- testSAI = RPCRequestFactory.buildSetAppIcon(testFileName, testCorrelationID);
- assertEquals(Test.MATCH, testFileName, testSAI.getSdlFileName());
- assertEquals(Test.MATCH, testCorrelationID, testSAI.getCorrelationID());
-
- testSAI = RPCRequestFactory.buildSetAppIcon(null, null);
- assertNull(Test.NULL, testSAI.getSdlFileName());
- assertNotNull(Test.NOT_NULL, testSAI.getCorrelationID());
-
- }
-
- public void testBuildSetGlobalProperties () {
-
- Vector<TTSChunk> testHelpChunks = TTSChunkFactory.createSimpleTTSChunks("test"),
- testTimeoutChunks = TTSChunkFactory.createSimpleTTSChunks("timeout");
- Vector<VrHelpItem> testVrHelp = new Vector<VrHelpItem>();
- VrHelpItem testItem = new VrHelpItem();
- testItem.setPosition(0);
- testItem.setText("text");
- Image image = new Image();
- image.setValue("value");
- image.setImageType(ImageType.DYNAMIC);
- testItem.setImage(image);
- testVrHelp.add(testItem);
- Integer testCorrelationID = 0;
- String testHelpTitle = "help";
- SetGlobalProperties testSBP;
-
- // Test -- buildSetGlobalProperties(String helpPrompt, String timeoutPrompt, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildSetGlobalProperties(Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, Integer correlationID)
- testSBP = RPCRequestFactory.buildSetGlobalProperties(testHelpChunks, testTimeoutChunks, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt()));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt()));
- assertEquals(Test.MATCH, testCorrelationID, testSBP.getCorrelationID());
-
- testSBP = RPCRequestFactory.buildSetGlobalProperties((Vector<TTSChunk>) null, null, null);
- assertNull(Test.NULL, testSBP.getHelpPrompt());
- assertNull(Test.NULL, testSBP.getTimeoutPrompt());
- assertNotNull(Test.NOT_NULL, testSBP.getCorrelationID());
-
- // Test -- buildSetGlobalProperties(String helpPrompt, String timeoutPrompt, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildSetGlobalProperties(Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID)
- testSBP = RPCRequestFactory.buildSetGlobalProperties(testHelpChunks, testTimeoutChunks, testHelpTitle, testVrHelp, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt()));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt()));
- assertEquals(Test.MATCH, testHelpTitle, testSBP.getVrHelpTitle());
- assertTrue(Test.TRUE, Validator.validateVrHelpItems(testVrHelp, testSBP.getVrHelp()));
- assertEquals(Test.MATCH, testCorrelationID, testSBP.getCorrelationID());
-
- testSBP = RPCRequestFactory.buildSetGlobalProperties((Vector<TTSChunk>) null, null, null, null, null);
- assertNull(Test.NULL, testSBP.getHelpPrompt());
- assertNull(Test.NULL, testSBP.getTimeoutPrompt());
- assertNull(Test.NULL, testSBP.getVrHelpTitle());
- assertNull(Test.NULL, testSBP.getVrHelp());
- assertNotNull(Test.NOT_NULL, testSBP.getCorrelationID());
- }
-
- public void testBuildSetMediaClockTimer () {
-
- Integer hours = 0, minutes = 0, seconds = 0, testCorrelationID = 0;
- UpdateMode testMode = UpdateMode.COUNTUP;
- SetMediaClockTimer testSMCT;
-
- // Test -- buildSetMediaClockTimer(Integer hours, Integer minutes, Integer seconds, UpdateMode updateMode, Integer correlationID)
- testSMCT = RPCRequestFactory.buildSetMediaClockTimer(hours, minutes, seconds, testMode, testCorrelationID);
- assertEquals(Test.MATCH, hours, testSMCT.getStartTime().getHours());
- assertEquals(Test.MATCH, minutes, testSMCT.getStartTime().getMinutes());
- assertEquals(Test.MATCH, seconds, testSMCT.getStartTime().getSeconds());
- assertEquals(Test.MATCH, testMode, testSMCT.getUpdateMode());
- assertEquals(Test.MATCH, testCorrelationID, testSMCT.getCorrelationID());
-
- testSMCT = RPCRequestFactory.buildSetMediaClockTimer(null, null, null, null, null);
- assertNull(Test.NULL, testSMCT.getStartTime());
- assertNull(Test.NULL, testSMCT.getUpdateMode());
- assertNotNull(Test.NOT_NULL, testSMCT.getCorrelationID());
-
- // Test -- buildSetMediaClockTimer(UpdateMode updateMode, Integer correlationID)
- // ^ Calls another build method.
- }
-
- @SuppressWarnings("deprecation")
- public void testBuildShow () {
-
- Image testGraphic = new Image();
- testGraphic.setImageType(ImageType.STATIC);
- testGraphic.setValue("test");
- String testText1 = "test1", testText2 = "test2", testText3 = "test3", testText4 = "test4", testStatusBar = "status", testMediaClock = "media", testMediaTrack = "track";
- Vector<SoftButton> testSoftButtons = new Vector<SoftButton>();
- testSoftButtons.add(new SoftButton());
- Vector<String> testCustomPresets = new Vector<String>();
- testCustomPresets.add("Test");
- TextAlignment testAlignment = TextAlignment.CENTERED;
- Integer testCorrelationID = 0;
- Show testShow;
-
- // Test -- buildShow(String mainText1, String mainText2, String mainText3, String mainText4, String statusBar, String mediaClock, String mediaTrack, Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets, TextAlignment alignment, Integer correlationID)
- testShow = RPCRequestFactory.buildShow(testText1, testText2, testText3, testText4, testStatusBar, testMediaClock, testMediaTrack, testGraphic, testSoftButtons, testCustomPresets, testAlignment, testCorrelationID);
- assertEquals(Test.MATCH, testText1, testShow.getMainField1());
- assertEquals(Test.MATCH, testText2, testShow.getMainField2());
- assertEquals(Test.MATCH, testText3, testShow.getMainField3());
- assertEquals(Test.MATCH, testText4, testShow.getMainField4());
- assertEquals(Test.MATCH, testStatusBar, testShow.getStatusBar());
- assertEquals(Test.MATCH, testMediaClock, testShow.getMediaClock());
- assertEquals(Test.MATCH, testMediaTrack, testShow.getMediaTrack());
- assertTrue(Test.TRUE, Validator.validateImage(testGraphic, testShow.getGraphic()));
- assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testShow.getSoftButtons()));
- assertTrue(Test.TRUE, Validator.validateStringList(testCustomPresets, testShow.getCustomPresets()));
- assertEquals(Test.MATCH, testAlignment, testShow.getAlignment());
- assertEquals(Test.MATCH, testCorrelationID, testShow.getCorrelationID());
-
- testShow = RPCRequestFactory.buildShow(null, null, null, null, null, null, null, null, null, null, null, null);
- assertNull(Test.NULL, testShow.getMainField1());
- assertNull(Test.NULL, testShow.getMainField2());
- assertNull(Test.NULL, testShow.getMainField3());
- assertNull(Test.NULL, testShow.getMainField4());
- assertNull(Test.NULL, testShow.getStatusBar());
- assertNull(Test.NULL, testShow.getMediaClock());
- assertNull(Test.NULL, testShow.getMediaTrack());
- assertNull(Test.NULL, testShow.getGraphic());
- assertNull(Test.NULL, testShow.getSoftButtons());
- assertNull(Test.NULL, testShow.getCustomPresets());
- assertNull(Test.NULL, testShow.getAlignment());
- assertNotNull(Test.NOT_NULL, testShow.getCorrelationID());
- // Test -- buildShow(String mainText1, String mainText2, String mainText3, String mainText4, TextAlignment alignment, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- buildShow(String mainText1, String mainText2, String statusBar, String mediaClock, String mediaTrack, TextAlignment alignment, Integer correlationID)
- testShow = RPCRequestFactory.buildShow(testText1, testText2, testStatusBar, testMediaClock, testMediaTrack, testAlignment, testCorrelationID);
- assertEquals(Test.MATCH, testText1, testShow.getMainField1());
- assertEquals(Test.MATCH, testText2, testShow.getMainField2());
- assertEquals(Test.MATCH, testStatusBar, testShow.getStatusBar());
- assertEquals(Test.MATCH, testMediaClock, testShow.getMediaClock());
- assertEquals(Test.MATCH, testMediaTrack, testShow.getMediaTrack());
- assertEquals(Test.MATCH, testAlignment, testShow.getAlignment());
- assertEquals(Test.MATCH, testCorrelationID, testShow.getCorrelationID());
-
- testShow = RPCRequestFactory.buildShow(null, null, null, null, null, null, null);
- assertNull(Test.NULL, testShow.getMainField1());
- assertNull(Test.NULL, testShow.getMainField2());
- assertNull(Test.NULL, testShow.getStatusBar());
- assertNull(Test.NULL, testShow.getMediaClock());
- assertNull(Test.NULL, testShow.getMediaTrack());
- assertNull(Test.NULL, testShow.getAlignment());
- assertNotNull(Test.NOT_NULL, testShow.getCorrelationID());
-
- // Test -- buildShow(String mainText1, String mainText2, TextAlignment alignment, Integer correlationID)
- // ^ Calls another build method.
- }
-
- public void testBuildSpeak () {
-
- String testTTSText = "test";
- Integer testCorrelationID = 0;
- Vector<TTSChunk> testTTSChunks = TTSChunkFactory.createSimpleTTSChunks(testTTSText);
- Speak testSpeak;
-
- // Test -- buildSpeak(String ttsText, Integer correlationID)
- testSpeak = RPCRequestFactory.buildSpeak(testTTSText, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks()));
- assertEquals(Test.MATCH, testCorrelationID, testSpeak.getCorrelationID());
-
- testSpeak = RPCRequestFactory.buildSpeak((String) null, null);
- assertNull(Test.NULL, testSpeak.getTtsChunks());
- assertNotNull(Test.NOT_NULL, testSpeak.getCorrelationID());
-
- // Test -- buildSpeak(Vector<TTSChunk> ttsChunks, Integer correlationID)
- testSpeak = RPCRequestFactory.buildSpeak(testTTSChunks, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks()));
- assertEquals(Test.MATCH, testCorrelationID, testSpeak.getCorrelationID());
-
- testSpeak = RPCRequestFactory.buildSpeak((Vector<TTSChunk>) null, null);
- assertNull(Test.NULL, testSpeak.getTtsChunks());
- assertNotNull(Test.NOT_NULL, testSpeak.getCorrelationID());
- }
-
- public void testBuildSubscribeButton () {
-
- ButtonName testButtonName = ButtonName.CUSTOM_BUTTON;
- Integer testCorrelationID = 0;
- SubscribeButton testSB;
-
- // Test -- buildSubscribeButton(ButtonName buttonName, Integer correlationID)
- testSB = RPCRequestFactory.buildSubscribeButton(testButtonName, testCorrelationID);
- assertEquals(Test.MATCH, testButtonName, testSB.getButtonName());
- assertEquals(Test.MATCH, testCorrelationID, testSB.getCorrelationID());
-
- testSB = RPCRequestFactory.buildSubscribeButton(null, null);
- assertNull(Test.NULL, testSB.getButtonName());
- assertNotNull(Test.NOT_NULL, testSB.getCorrelationID());
-
- }
-
- public void testBuildUnregisterAppInterface () {
-
- Integer testCorrelationID = 0;
- UnregisterAppInterface testUAI;
-
- // Test -- buildUnregisterAppInterface(Integer correlationID)
- testUAI = RPCRequestFactory.buildUnregisterAppInterface(testCorrelationID);
- assertEquals(Test.MATCH, testCorrelationID, testUAI.getCorrelationID());
-
- testUAI = RPCRequestFactory.buildUnregisterAppInterface(null);
- assertNotNull(Test.NOT_NULL, testUAI.getCorrelationID());
- }
-
- public void testBuildUnsubscribeButton () {
-
- ButtonName testButtonName = ButtonName.CUSTOM_BUTTON;
- Integer testCorrelationID = 0;
- UnsubscribeButton testUB;
-
- // Test -- buildUnsubscribeButton(ButtonName buttonName, Integer correlationID)
- testUB = RPCRequestFactory.buildUnsubscribeButton(testButtonName, testCorrelationID);
- assertEquals(Test.MATCH, testButtonName, testUB.getButtonName());
- assertEquals(Test.MATCH, testCorrelationID, testUB.getCorrelationID());
-
- testUB = RPCRequestFactory.buildUnsubscribeButton(null, null);
- assertNull(Test.NULL, testUB.getButtonName());
- assertNotNull(Test.NOT_NULL, testUB.getCorrelationID());
-
- }
-
- public void testBuildSubscribeVehicleData () {
-
- boolean testGPS = true, testSpeed = true, testRPM = true, testFuelLevel = true, testFuelLevelState = true, testInstantFuelConsumption = true, testExternalTemperature = true, testPRNDL = true, testTirePressure = true, testOdometer = true, testBeltStatus = true, testBodyInformation = true, testDeviceStatus = true, testDriverBraking = true;
- Integer testCorrelationID = 0;
- SubscribeVehicleData testSVD;
-
- // Test -- BuildSubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID)
- testSVD = RPCRequestFactory.BuildSubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID);
- assertTrue(Test.TRUE, testSVD.getGps());
- assertTrue(Test.TRUE, testSVD.getSpeed());
- assertTrue(Test.TRUE, testSVD.getRpm());
- assertTrue(Test.TRUE, testSVD.getFuelLevel());
- assertTrue(Test.TRUE, testSVD.getFuelLevelState());
- assertTrue(Test.TRUE, testSVD.getInstantFuelConsumption());
- assertTrue(Test.TRUE, testSVD.getExternalTemperature());
- assertTrue(Test.TRUE, testSVD.getPrndl());
- assertTrue(Test.TRUE, testSVD.getTirePressure());
- assertTrue(Test.TRUE, testSVD.getOdometer());
- assertTrue(Test.TRUE, testSVD.getBeltStatus());
- assertTrue(Test.TRUE, testSVD.getBodyInformation());
- assertTrue(Test.TRUE, testSVD.getDeviceStatus());
- assertTrue(Test.TRUE, testSVD.getDriverBraking());
- assertEquals(Test.MATCH, testCorrelationID, testSVD.getCorrelationID());
-
- testSVD = RPCRequestFactory.BuildSubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
- assertNotNull(Test.NULL, testSVD.getCorrelationID());
- }
-
- public void testBuildUnsubscribeVehicleData () {
-
- boolean testGPS = true, testSpeed = true, testRPM = true, testFuelLevel = true, testFuelLevelState = true, testInstantFuelConsumption = true, testExternalTemperature = true, testPRNDL = true, testTirePressure = true, testOdometer = true, testBeltStatus = true, testBodyInformation = true, testDeviceStatus = true, testDriverBraking = true;
- Integer testCorrelationID = 0;
- UnsubscribeVehicleData testUVD;
-
- // Test -- BuildUnsubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID)
- testUVD = RPCRequestFactory.BuildUnsubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID);
- assertTrue(Test.TRUE, testUVD.getGps());
- assertTrue(Test.TRUE, testUVD.getSpeed());
- assertTrue(Test.TRUE, testUVD.getRpm());
- assertTrue(Test.TRUE, testUVD.getFuelLevel());
- assertTrue(Test.TRUE, testUVD.getFuelLevelState());
- assertTrue(Test.TRUE, testUVD.getInstantFuelConsumption());
- assertTrue(Test.TRUE, testUVD.getExternalTemperature());
- assertTrue(Test.TRUE, testUVD.getPrndl());
- assertTrue(Test.TRUE, testUVD.getTirePressure());
- assertTrue(Test.TRUE, testUVD.getOdometer());
- assertTrue(Test.TRUE, testUVD.getBeltStatus());
- assertTrue(Test.TRUE, testUVD.getBodyInformation());
- assertTrue(Test.TRUE, testUVD.getDeviceStatus());
- assertTrue(Test.TRUE, testUVD.getDriverBraking());
- assertEquals(Test.MATCH, testCorrelationID, testUVD.getCorrelationID());
-
- testUVD = RPCRequestFactory.BuildUnsubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
- assertNotNull(Test.NULL, testUVD.getCorrelationID());
- }
-
- public void testBuildGetVehicleData () {
-
- boolean testGPS = true, testSpeed = true, testRPM = true, testFuelLevel = true, testFuelLevelState = true, testInstantFuelConsumption = true, testExternalTemperature = true, testVIN = true, testPRNDL = true, testTirePressure = true, testOdometer = true, testBeltStatus = true, testBodyInformation = true, testDeviceStatus = true, testDriverBraking = true;
- Integer testCorrelationID = 0;
- GetVehicleData testGVD;
-
- // Test -- BuildGetVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID)
- testGVD = RPCRequestFactory.BuildGetVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testVIN, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID);
- assertTrue(Test.TRUE, testGVD.getGps());
- assertTrue(Test.TRUE, testGVD.getSpeed());
- assertTrue(Test.TRUE, testGVD.getRpm());
- assertTrue(Test.TRUE, testGVD.getFuelLevel());
- assertTrue(Test.TRUE, testGVD.getFuelLevelState());
- assertTrue(Test.TRUE, testGVD.getInstantFuelConsumption());
- assertTrue(Test.TRUE, testGVD.getExternalTemperature());
- assertTrue(Test.TRUE, testGVD.getPrndl());
- assertTrue(Test.TRUE, testGVD.getTirePressure());
- assertTrue(Test.TRUE, testGVD.getOdometer());
- assertTrue(Test.TRUE, testGVD.getBeltStatus());
- assertTrue(Test.TRUE, testGVD.getBodyInformation());
- assertTrue(Test.TRUE, testGVD.getDeviceStatus());
- assertTrue(Test.TRUE, testGVD.getDriverBraking());
- assertTrue(Test.TRUE, testGVD.getVin());
- assertEquals(Test.MATCH, testCorrelationID, testGVD.getCorrelationID());
-
- testGVD = RPCRequestFactory.BuildGetVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testVIN, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
- assertNotNull(Test.NULL, testGVD.getCorrelationID());
- }
-
- public void testBuildScrollableMessage () {
-
- String testSMB = "test";
- Integer testTimeout = 1, testCorrelationID = 0;
- Vector<SoftButton> testSoftButtons = new Vector<SoftButton>();
- testSoftButtons.add(new SoftButton());
- ScrollableMessage testSM;
-
- // Test -- BuildScrollableMessage(String scrollableMessageBody, Integer timeout, Vector<SoftButton> softButtons, Integer correlationID)
- testSM = RPCRequestFactory.BuildScrollableMessage(testSMB, testTimeout, testSoftButtons, testCorrelationID);
- assertEquals(Test.MATCH, testSMB, testSM.getScrollableMessageBody());
- assertEquals(Test.MATCH, testTimeout, testSM.getTimeout());
- assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testSM.getSoftButtons()));
- assertEquals(Test.MATCH, testCorrelationID, testSM.getCorrelationID());
-
- testSM = RPCRequestFactory.BuildScrollableMessage(null, null, null, null);
- assertNull(Test.NULL, testSM.getScrollableMessageBody());
- assertNull(Test.NULL, testSM.getTimeout());
- assertNull(Test.NULL, testSM.getSoftButtons());
- assertNotNull(Test.NOT_NULL, testSM.getCorrelationID());
- }
-
- public void testBuildSlider () {
-
- Integer testTicks = 1, testPosition = 2, testTimeout = 3, testCorrelationID = 0;
- String testHeader = "header";
- Vector<String> testFooter = new Vector<String>();
- testFooter.add("footer");
- Slider testSlider;
-
- // Test -- BuildSlider(Integer numTicks, Integer position, String sliderHeader, Vector<String> sliderFooter, Integer timeout, Integer correlationID)
- testSlider = RPCRequestFactory.BuildSlider(testTicks, testPosition, testHeader, testFooter, testTimeout, testCorrelationID);
- assertEquals(Test.MATCH, testTicks, testSlider.getNumTicks());
- assertEquals(Test.MATCH, testPosition, testSlider.getPosition());
- assertEquals(Test.MATCH, testHeader, testSlider.getSliderHeader());
- assertTrue(Test.TRUE, Validator.validateStringList(testFooter, testSlider.getSliderFooter()));
- assertEquals(Test.MATCH, testCorrelationID, testSlider.getCorrelationID());
-
- testSlider = RPCRequestFactory.BuildSlider(null, null, null, null, null, null);
- assertNull(Test.NULL, testSlider.getNumTicks());
- assertNull(Test.NULL, testSlider.getPosition());
- assertNull(Test.NULL, testSlider.getSliderHeader());
- assertNull(Test.NULL, testSlider.getSliderFooter());
- assertNull(Test.NULL, testSlider.getTimeout());
- assertNotNull(Test.NOT_NULL, testSlider.getCorrelationID());
- }
-
- public void testBuildChangeRegistration () {
-
- Language testLang = Language.EN_US, testHMILang = Language.EN_AU;
- Integer testCorrelationID = 0;
- ChangeRegistration testCR;
-
- // Test -- BuildChangeRegistration(Language language, Language hmiDisplayLanguage, Integer correlationID)
- testCR = RPCRequestFactory.BuildChangeRegistration(testLang, testHMILang, testCorrelationID);
- assertEquals(Test.MATCH, testLang, testCR.getLanguage());
- assertEquals(Test.MATCH, testHMILang, testCR.getHmiDisplayLanguage());
- assertEquals(Test.MATCH, testCorrelationID, testCR.getCorrelationID());
-
- testCR = RPCRequestFactory.BuildChangeRegistration(null, null, null);
- assertNull(Test.NULL, testCR.getLanguage());
- assertNull(Test.NULL, testCR.getHmiDisplayLanguage());
- assertNotNull(Test.NOT_NULL, testCR.getCorrelationID());
- }
-
- public void testBuildSetDisplayLayout () {
-
- String testDL = "layout";
- Integer testCorrelationID = 0;
- SetDisplayLayout testSDL;
-
- // Test -- BuildSetDisplayLayout(String displayLayout, Integer correlationID)
- testSDL = RPCRequestFactory.BuildSetDisplayLayout(testDL, testCorrelationID);
- assertEquals(Test.MATCH, testDL, testSDL.getDisplayLayout());
- assertEquals(Test.MATCH, testCorrelationID, testSDL.getCorrelationID());
-
- testSDL = RPCRequestFactory.BuildSetDisplayLayout(null, null);
- assertNull(Test.NULL, testSDL.getDisplayLayout());
- assertNotNull(Test.NOT_NULL, testSDL.getCorrelationID());
- }
-
- public void testBuildPerformAudioPassThru () {
-
- Vector<TTSChunk> testInitialPrompt = TTSChunkFactory.createSimpleTTSChunks("test");
- String testAPTDT1 = "audio", testAPTDT2 = "pass";
- SamplingRate testSR = SamplingRate._16KHZ;
- Integer testMaxDuration = 1, testCorrelationID = 0;
- BitsPerSample testBits = BitsPerSample._16_BIT;
- AudioType testAT = AudioType.PCM;
- Boolean testMute = false;
- PerformAudioPassThru testPAPT;
-
- // Test -- BuildPerformAudioPassThru(String ttsText, String audioPassThruDisplayText1, String audioPassThruDisplayText2, SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample, AudioType audioType, Boolean muteAudio, Integer correlationID)
- // ^ Calls another build method.
-
- // Test -- BuildPerformAudioPassThru(Vector<TTSChunk> initialPrompt, String audioPassThruDisplayText1, String audioPassThruDisplayText2, SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample, AudioType audioType, Boolean muteAudio, Integer correlationID)
- testPAPT = RPCRequestFactory.BuildPerformAudioPassThru(testInitialPrompt, testAPTDT1, testAPTDT2, testSR, testMaxDuration, testBits, testAT, testMute, testCorrelationID);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitialPrompt, testPAPT.getInitialPrompt()));
- assertEquals(Test.MATCH, testAPTDT1, testPAPT.getAudioPassThruDisplayText1());
- assertEquals(Test.MATCH, testAPTDT2, testPAPT.getAudioPassThruDisplayText2());
- assertEquals(Test.MATCH, testSR, testPAPT.getSamplingRate());
- assertEquals(Test.MATCH, testMaxDuration, testPAPT.getMaxDuration());
- assertEquals(Test.MATCH, testBits, testPAPT.getBitsPerSample());
- assertEquals(Test.MATCH, testAT, testPAPT.getAudioType());
- assertEquals(Test.MATCH, testMute, testPAPT.getMuteAudio());
- assertEquals(Test.MATCH, testCorrelationID, testPAPT.getCorrelationID());
-
- testPAPT = RPCRequestFactory.BuildPerformAudioPassThru((Vector<TTSChunk>) null, null, null, null, null, null, null, null, null);
- assertNull(Test.NULL, testPAPT.getInitialPrompt());
- assertNull(Test.NULL, testPAPT.getAudioPassThruDisplayText1());
- assertNull(Test.NULL, testPAPT.getAudioPassThruDisplayText2());
- assertNull(Test.NULL, testPAPT.getSamplingRate());
- assertNull(Test.NULL, testPAPT.getMaxDuration());
- assertNull(Test.NULL, testPAPT.getBitsPerSample());
- assertNull(Test.NULL, testPAPT.getAudioType());
- assertNull(Test.NULL, testPAPT.getMuteAudio());
- assertNotNull(Test.NOT_NULL, testPAPT.getCorrelationID());
- }
-
- public void testBuildEndAudioPassThru () {
-
- Integer testCorrelationID = 0;
- EndAudioPassThru testEAPT;
-
- // Test -- BuildEndAudioPassThru(Integer correlationID)
- testEAPT = RPCRequestFactory.BuildEndAudioPassThru(testCorrelationID);
- assertEquals(Test.MATCH, testCorrelationID, testEAPT.getCorrelationID());
-
- testEAPT = RPCRequestFactory.BuildEndAudioPassThru(null);
- assertNotNull(Test.NOT_NULL, testEAPT.getCorrelationID());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java
deleted file mode 100644
index eea733631..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.smartdevicelink.test.proxy;
-
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.GetSystemCapability;
-import com.smartdevicelink.test.Config;
-
-import junit.framework.TestCase;
-
-
-public class RPCRequestTest extends AndroidTestCase2 {
-
- public static final int SDL_VERSION_UNDER_TEST = Config.SDL_VERSION_UNDER_TEST;
-
- private static final int CORR_ID = 402;
-
- protected RPCRequest msg;
-
- @Override
- public void setUp(){
- this.msg = new GetSystemCapability();
-
- }
-
- public void testCreation(){
- assertNotNull("Object creation failed.", msg);
- }
-
- public void testGetCorrelationId(){
- assertNotNull(this.msg.getCorrelationID());
- }
- public void testSettingCorrelationId(){
- assertNotNull(this.msg.getCorrelationID());
- msg.setCorrelationID(CORR_ID);
- assertEquals("Correlation ID doesn't match expected ID.", CORR_ID, (int)msg.getCorrelationID());
-
- }
-
-
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java
deleted file mode 100644
index aecbb44f0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java
+++ /dev/null
@@ -1,654 +0,0 @@
-package com.smartdevicelink.test.proxy;
-
-import android.content.Context;
-import android.telephony.TelephonyManager;
-import android.util.Log;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.SdlProxyALM;
-import com.smartdevicelink.proxy.SdlProxyBase;
-import com.smartdevicelink.proxy.SdlProxyBuilder;
-import com.smartdevicelink.proxy.SdlProxyConfigurationResources;
-import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
-import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
-import com.smartdevicelink.proxy.interfaces.IProxyListenerALM;
-import com.smartdevicelink.proxy.rpc.AddCommandResponse;
-import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
-import com.smartdevicelink.proxy.rpc.AlertResponse;
-import com.smartdevicelink.proxy.rpc.ButtonPressResponse;
-import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
-import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
-import com.smartdevicelink.proxy.rpc.DialNumberResponse;
-import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
-import com.smartdevicelink.proxy.rpc.GenericResponse;
-import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
-import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
-import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.GetWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.ListFilesResponse;
-import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
-import com.smartdevicelink.proxy.rpc.OnButtonEvent;
-import com.smartdevicelink.proxy.rpc.OnButtonPress;
-import com.smartdevicelink.proxy.rpc.OnCommand;
-import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.OnHashChange;
-import com.smartdevicelink.proxy.rpc.OnInteriorVehicleData;
-import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
-import com.smartdevicelink.proxy.rpc.OnLanguageChange;
-import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
-import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.OnRCStatus;
-import com.smartdevicelink.proxy.rpc.OnStreamRPC;
-import com.smartdevicelink.proxy.rpc.OnSystemRequest;
-import com.smartdevicelink.proxy.rpc.OnTBTClientState;
-import com.smartdevicelink.proxy.rpc.OnTouchEvent;
-import com.smartdevicelink.proxy.rpc.OnVehicleData;
-import com.smartdevicelink.proxy.rpc.OnWayPointChange;
-import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
-import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
-import com.smartdevicelink.proxy.rpc.PutFileResponse;
-import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
-import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
-import com.smartdevicelink.proxy.rpc.SendHapticDataResponse;
-import com.smartdevicelink.proxy.rpc.SendLocationResponse;
-import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
-import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.SetInteriorVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
-import com.smartdevicelink.proxy.rpc.ShowResponse;
-import com.smartdevicelink.proxy.rpc.SliderResponse;
-import com.smartdevicelink.proxy.rpc.SpeakResponse;
-import com.smartdevicelink.proxy.rpc.StreamRPCResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.UpdateTurnListResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
-import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
-import com.smartdevicelink.streaming.video.SdlRemoteDisplay;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-import com.smartdevicelink.test.streaming.video.SdlRemoteDisplayTest;
-
-import junit.framework.Assert;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-
-public class SdlProxyBaseTests extends AndroidTestCase2 {
- public static final String TAG = "SdlProxyBaseTests";
-
- @Override
- protected void setUp() throws Exception{
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- //Nothing here for now
- }
-
- /**
- * Test SdlProxyBase for handling null SdlProxyConfigurationResources
- */
- public void testNullSdlProxyConfigurationResources() {
- SdlProxyALM proxy = null;
- SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(new ProxyListenerTest(), "appId", "appName", true, getContext());
- SdlProxyConfigurationResources config = new SdlProxyConfigurationResources("path", (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE));
- //Construct with a non-null SdlProxyConfigurationResources
- builder.setSdlProxyConfigurationResources(config);
- try {
- proxy = builder.build();
- } catch (Exception e) {
- Log.v(TAG, "Exception in testNullSdlProxyConfigurationResources, testing non null SdlProxyConfigurationResources");
- if (!(e instanceof SdlException) || !((SdlException) e).getSdlExceptionCause().equals(SdlExceptionCause.BLUETOOTH_ADAPTER_NULL)) {
- e.printStackTrace();
- Assert.fail("Exception in testNullSdlProxyConfigurationResources - \n" + e.toString());
- }
- }
-
- if (proxy != null) {
- try {
- proxy.dispose();
- proxy = null;
- }catch(SdlException e){
- e.printStackTrace();
- }
- }
-
- //Construct with a null SdlProxyConfigurationResources
- builder.setSdlProxyConfigurationResources(null);
- try {
- proxy = builder.build();
- } catch (Exception e) {
- Log.v(TAG, "Exception in testNullSdlProxyConfigurationResources, testing null SdlProxyConfigurationResources");
- if (!(e instanceof SdlException) || !((SdlException) e).getSdlExceptionCause().equals(SdlExceptionCause.BLUETOOTH_ADAPTER_NULL)) {
- e.printStackTrace();
- Assert.fail("Exception in testNullSdlProxyConfigurationResources, testing null SdlProxyConfigurationResources");
- }
- }
- if (proxy != null) {
- try {
- proxy.dispose();
- proxy = null;
- }catch(SdlException e){
- e.printStackTrace();
- }
- }
-
- //Construct with a non-null SdlProxyConfigurationResources and a null TelephonyManager
- config.setTelephonyManager(null);
- builder.setSdlProxyConfigurationResources(config);
- try {
- proxy = builder.build();
- } catch (Exception e) {
- Log.v(TAG, "Exception in testNullSdlProxyConfigurationResources, testing null TelephonyManager");
- if (!(e instanceof SdlException) || !((SdlException) e).getSdlExceptionCause().equals(SdlExceptionCause.BLUETOOTH_ADAPTER_NULL)) {
- Assert.fail("Exception in testNullSdlProxyConfigurationResources, testing null TelephonyManager");
- }
- }
- if (proxy != null) {
- try {
- proxy.dispose();
- proxy = null;
- }catch(SdlException e){
- e.printStackTrace();
- }
- }
- }
-
- public void testRemoteDisplayStreaming(){
- SdlProxyALM proxy = null;
- SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(new ProxyListenerTest(), "appId", "appName", true, getContext());
- try{
- proxy = builder.build();
- // public void startRemoteDisplayStream(Context context, final Class<? extends SdlRemoteDisplay> remoteDisplay, final VideoStreamingParameters parameters, final boolean encrypted){
- Method m = SdlProxyALM.class.getDeclaredMethod("startRemoteDisplayStream", Context.class, SdlRemoteDisplay.class, VideoStreamingParameters.class, boolean.class);
- assertNotNull(m);
- m.setAccessible(true);
- m.invoke(proxy,getContext(), SdlRemoteDisplayTest.MockRemoteDisplay.class, (VideoStreamingParameters)null, false);
- assert true;
-
- }catch (Exception e){
- assert false;
- }
- }
-
- public void testMultipleRPCSendSynchronous() {
-
- List<RPCRequest> rpcs = new ArrayList<>();
-
- // rpc 1
- Show show = new Show();
- show.setMainField1("hey y'all");
- show.setMainField2("");
- show.setMainField3("");
- show.setMainField4("");
- rpcs.add(show);
-
- // rpc 2
- Show show2 = new Show();
- show2.setMainField1("");
- show2.setMainField2("It is Wednesday My Dudes");
- show2.setMainField3("");
- show2.setMainField4("");
- rpcs.add(show2);
-
- OnMultipleRequestListener mrl = new OnMultipleRequestListener() {
- @Override
- public void onUpdate(int remainingRequests) {
-
- }
-
- @Override
- public void onFinished() {
-
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- assert false;
- }
-
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
-
- }
- };
- try{
- // public void sendRequests(List<RPCRequest> rpcs, final OnMultipleRequestListener listener) throws SdlException {
- Method m = SdlProxyBase.class.getDeclaredMethod("sendRequests", SdlProxyBase.class);
- assertNotNull(m);
- m.setAccessible(true);
- m.invoke(rpcs,mrl);
- assert true;
-
- }catch (Exception e){
- assert false;
- }
- }
-
- public void testMultipleRPCSendAsynchronous() {
-
- List<RPCRequest> rpcs = new ArrayList<>();
-
- // rpc 1
- Show show = new Show();
- show.setMainField1("hey y'all");
- show.setMainField2("");
- show.setMainField3("");
- show.setMainField4("");
- rpcs.add(show);
-
- // rpc 2
- Show show2 = new Show();
- show2.setMainField1("");
- show2.setMainField2("It is Wednesday My Dudes");
- show2.setMainField3("");
- show2.setMainField4("");
- rpcs.add(show2);
-
- OnMultipleRequestListener mrl = new OnMultipleRequestListener() {
- @Override
- public void onUpdate(int remainingRequests) {
-
- }
-
- @Override
- public void onFinished() {
-
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- assert false;
- }
-
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
-
- }
- };
- try{
- // public void sendSequentialRequests(List<RPCRequest> rpcs, final OnMultipleRequestListener listener) throws SdlException {
- Method m = SdlProxyBase.class.getDeclaredMethod("sendSequentialRequests", SdlProxyBase.class);
- assertNotNull(m);
- m.setAccessible(true);
- m.invoke(rpcs,mrl);
- assert true;
-
- }catch (Exception e){
- assert false;
- }
- }
-
- public class ProxyListenerTest implements IProxyListenerALM {
-
- @Override
- public void onProxyClosed(String s, Exception e, SdlDisconnectedReason reason) {
-
- }
-
- @Override
- public void onOnHMIStatus(OnHMIStatus status) {
-
- }
-
- @Override
- public void onListFilesResponse(ListFilesResponse response) {
- }
-
- @Override
- public void onPutFileResponse(PutFileResponse response) {
- }
-
- @Override
- public void onOnLockScreenNotification(OnLockScreenStatus notification) {
- }
-
- @Override
- public void onOnCommand(OnCommand notification){
- }
-
- /**
- * Callback method that runs when the add command response is received from SDL.
- */
- @Override
- public void onAddCommandResponse(AddCommandResponse response) {
- }
-
- @Override
- public void onOnPermissionsChange(OnPermissionsChange notification) {
-
- }
-
- @Override
- public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response) {
- }
-
- @Override
- public void onOnVehicleData(OnVehicleData notification) {
- }
-
- /**
- * Rest of the SDL callbacks from the head unit
- */
-
- @Override
- public void onAddSubMenuResponse(AddSubMenuResponse response) {
- }
-
- @Override
- public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse response) {
- }
-
- @Override
- public void onAlertResponse(AlertResponse response) {
- }
-
- @Override
- public void onDeleteCommandResponse(DeleteCommandResponse response) {
- }
-
- @Override
- public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse response) {
- }
-
- @Override
- public void onDeleteSubMenuResponse(DeleteSubMenuResponse response) {
- }
-
- @Override
- public void onPerformInteractionResponse(PerformInteractionResponse response) {
- }
-
- @Override
- public void onResetGlobalPropertiesResponse(
- ResetGlobalPropertiesResponse response) {
- }
-
- @Override
- public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse response) {
- }
-
- @Override
- public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response) {
- }
-
- @Override
- public void onShowResponse(ShowResponse response) {
- }
-
- @Override
- public void onSpeakResponse(SpeakResponse response) {
- Log.i(TAG, "SpeakCommand response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
- }
-
- @Override
- public void onOnButtonEvent(OnButtonEvent notification) {
- }
-
- @Override
- public void onOnButtonPress(OnButtonPress notification) {
- }
-
- @Override
- public void onSubscribeButtonResponse(SubscribeButtonResponse response) {
- }
-
- @Override
- public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response) {
- }
-
-
- @Override
- public void onOnTBTClientState(OnTBTClientState notification) {
- }
-
- @Override
- public void onUnsubscribeVehicleDataResponse(
- UnsubscribeVehicleDataResponse response) {
-
- }
-
- @Override
- public void onGetVehicleDataResponse(GetVehicleDataResponse response) {
-
- }
-
- @Override
- public void onReadDIDResponse(ReadDIDResponse response) {
-
- }
-
- @Override
- public void onGetDTCsResponse(GetDTCsResponse response) {
-
- }
-
-
- @Override
- public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response) {
-
- }
-
- @Override
- public void onEndAudioPassThruResponse(EndAudioPassThruResponse response) {
-
- }
-
- @Override
- public void onOnAudioPassThru(OnAudioPassThru notification) {
-
- }
-
- @Override
- public void onDeleteFileResponse(DeleteFileResponse response) {
-
- }
-
- @Override
- public void onSetAppIconResponse(SetAppIconResponse response) {
-
- }
-
- @Override
- public void onScrollableMessageResponse(ScrollableMessageResponse response) {
-
- }
-
- @Override
- public void onChangeRegistrationResponse(ChangeRegistrationResponse response) {
-
- }
-
- @Override
- public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response) {
-
- }
-
- @Override
- public void onOnLanguageChange(OnLanguageChange notification) {
-
- }
-
- @Override
- public void onSliderResponse(SliderResponse response) {
-
- }
-
-
- @Override
- public void onOnHashChange(OnHashChange notification) {
-
- }
-
- @Override
- public void onOnSystemRequest(OnSystemRequest notification) {
- }
-
- @Override
- public void onSystemRequestResponse(SystemRequestResponse response) {
-
- }
-
- @Override
- public void onOnKeyboardInput(OnKeyboardInput notification) {
-
- }
-
- @Override
- public void onOnTouchEvent(OnTouchEvent notification) {
-
- }
-
- @Override
- public void onDiagnosticMessageResponse(DiagnosticMessageResponse response) {
-
- }
-
- @Override
- public void onOnStreamRPC(OnStreamRPC notification) {
-
- }
-
- @Override
- public void onStreamRPCResponse(StreamRPCResponse response) {
-
- }
-
- @Override
- public void onDialNumberResponse(DialNumberResponse response) {
-
- }
-
- @Override
- public void onSendLocationResponse(SendLocationResponse response) {
- Log.i(TAG, "SendLocation response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
-
- }
-
- @Override
- public void onServiceEnded(OnServiceEnded serviceEnded) {
-
- }
-
- @Override
- public void onServiceNACKed(OnServiceNACKed serviceNACKed) {
-
- }
-
- @Override
- public void onShowConstantTbtResponse(ShowConstantTbtResponse response) {
- Log.i(TAG, "ShowConstantTbt response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
-
- }
-
- @Override
- public void onAlertManeuverResponse(AlertManeuverResponse response) {
- Log.i(TAG, "AlertManeuver response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
-
- }
-
- @Override
- public void onUpdateTurnListResponse(UpdateTurnListResponse response) {
- Log.i(TAG, "UpdateTurnList response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
-
- }
-
- @Override
- public void onServiceDataACK(int dataSize) {
- }
-
- @Override
- public void onGetWayPointsResponse(GetWayPointsResponse response) {
- Log.i(TAG, "GetWayPoints response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
- }
-
- @Override
- public void onSubscribeWayPointsResponse(SubscribeWayPointsResponse response) {
- Log.i(TAG, "SubscribeWayPoints response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
- }
-
- @Override
- public void onUnsubscribeWayPointsResponse(UnsubscribeWayPointsResponse response) {
- Log.i(TAG, "UnsubscribeWayPoints response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
- }
-
- @Override
- public void onOnWayPointChange(OnWayPointChange notification) {
- Log.i(TAG, "OnWayPointChange notification from SDL: " + notification);
- }
-
- @Override
- public void onGetSystemCapabilityResponse(GetSystemCapabilityResponse response) {
- Log.i(TAG, "GetSystemCapability response from SDL: " + response);
- }
-
- @Override
- public void onGetInteriorVehicleDataResponse(GetInteriorVehicleDataResponse response) {
- Log.i(TAG, "GetInteriorVehicleData response from SDL: " + response);
- }
-
- @Override
- public void onButtonPressResponse(ButtonPressResponse response) {
- Log.i(TAG, "ButtonPress response from SDL: " + response);
- }
-
- @Override
- public void onSetInteriorVehicleDataResponse(SetInteriorVehicleDataResponse response) {
- Log.i(TAG, "SetInteriorVehicleData response from SDL: " + response);
- }
-
- @Override
- public void onOnInteriorVehicleData(OnInteriorVehicleData notification) {
-
- }
-
- @Override
- public void onOnDriverDistraction(OnDriverDistraction notification) {
- // Some RPCs (depending on region) cannot be sent when driver distraction is active.
- }
-
- @Override
- public void onError(String info, Exception e) {
- }
-
- @Override
- public void onGenericResponse(GenericResponse response) {
- Log.i(TAG, "Generic response from SDL: " + response.getResultCode().name() + " Info: " + response.getInfo());
- }
-
- @Override
- public void onSendHapticDataResponse(SendHapticDataResponse response) {
- Log.i(TAG, "SendHapticDataResponse response from SDL: " + response);
- }
-
- @Override
- public void onOnRCStatus(OnRCStatus notification) {
- }
- }
-}
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
deleted file mode 100644
index 91bd19d34..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java
+++ /dev/null
@@ -1,246 +0,0 @@
-package com.smartdevicelink.test.proxy;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.SystemCapabilityManager;
-import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
-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.AudioPassThruCapabilities;
-import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
-import com.smartdevicelink.proxy.rpc.HMICapabilities;
-import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.SystemCapability;
-import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
-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;
-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;
-
-public class SystemCapabilityManagerTests extends AndroidTestCase2 {
- public static final String TAG = "SystemCapabilityManagerTests";
- public static SystemCapabilityManager systemCapabilityManager;
-
- @Override
- protected void setUp() throws Exception{
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public SystemCapabilityManager createSampleManager(){
- SystemCapabilityManager systemCapabilityManager = new SystemCapabilityManager(new InternalSDLInterface());
-
- RegisterAppInterfaceResponse raiResponse = new RegisterAppInterfaceResponse();
-
- raiResponse.setHmiCapabilities(Test.GENERAL_HMICAPABILITIES);
- raiResponse.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES);
- raiResponse.setAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST);
- raiResponse.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST);
- raiResponse.setHmiZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST);
- raiResponse.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES);
- raiResponse.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST);
- raiResponse.setSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST);
- raiResponse.setSuccess(true);
-
- systemCapabilityManager.parseRAIResponse(raiResponse);
- return systemCapabilityManager;
- }
-
- public void testParseRAI() {
- systemCapabilityManager = createSampleManager();
-
- assertTrue(Test.TRUE,
- Validator.validateHMICapabilities(Test.GENERAL_HMICAPABILITIES, (HMICapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.HMI)));
- assertTrue(Test.TRUE,
- Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, (DisplayCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY)));
- assertTrue(Test.TRUE,
- Validator.validateAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, (List<AudioPassThruCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.AUDIO_PASSTHROUGH)));
- assertTrue(Test.TRUE,
- Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, (List<ButtonCapabilities> )systemCapabilityManager.getCapability(SystemCapabilityType.BUTTON)));
- assertTrue(Test.TRUE,
- Validator.validateHMIZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST, (List<HmiZoneCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.HMI_ZONE)));
- assertTrue(Test.TRUE,
- Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, (PresetBankCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.PRESET_BANK)));
- assertTrue(Test.TRUE,
- Validator.validateSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST, (List<SoftButtonCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON)));
- assertTrue(Test.TRUE,
- Validator.validateSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST, (List<SpeechCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SPEECH)));
- }
-
- public void testGetVSCapability(){
- VideoStreamingCapability vsCapability = new VideoStreamingCapability();
- vsCapability.setMaxBitrate(Test.GENERAL_INT);
- vsCapability.setPreferredResolution(Test.GENERAL_IMAGERESOLUTION);
- vsCapability.setSupportedFormats(Test.GENERAL_VIDEOSTREAMINGFORMAT_LIST);
-
- SystemCapability cap = new SystemCapability();
- cap.setSystemCapabilityType(SystemCapabilityType.VIDEO_STREAMING);
- cap.setCapabilityForType(SystemCapabilityType.VIDEO_STREAMING, vsCapability);
-
- final SystemCapability referenceCapability = cap;
-
- systemCapabilityManager = new SystemCapabilityManager(new InternalSDLInterface() {
- @Override
- public void sendRPCRequest(RPCRequest message) {
- GetSystemCapabilityResponse response = new GetSystemCapabilityResponse();
- response.setSystemCapability(referenceCapability);
- response.setSuccess(true);
- message.getOnRPCResponseListener().onResponse(CorrelationIdGenerator.generateId(), response);
- }
- });
-
- systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING, new OnSystemCapabilityListener() {
- @Override
- public void onCapabilityRetrieved(Object capability) {
- assertTrue(Test.TRUE,
- Validator.validateVideoStreamingCapability(
- (VideoStreamingCapability) referenceCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING),
- (VideoStreamingCapability) capability));
- }
-
- @Override
- public void onError(String info) {
- assertTrue(false);
- }
- });
- }
-
- public void testListConversion(){
- SystemCapabilityManager systemCapabilityManager = createSampleManager();
- Object capability = systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON);
- assertNotNull(capability);
- List<SoftButtonCapabilities> list = SystemCapabilityManager.convertToList(capability, SoftButtonCapabilities.class);
- assertNotNull(list);
-
- }
-
- 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(){}
-
- @Override
- public void stop() {}
-
- @Override
- public boolean isConnected() {return false; }
-
- @Override
- public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {}
-
- @Override
- public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {}
-
- @Override
- public void startVideoService(VideoStreamingParameters parameters, boolean encrypted) { }
-
- @Override
- public void stopVideoService() {}
-
- @Override
- public void stopAudioService() {}
-
- @Override
- public void sendRPCRequest(RPCRequest message) {}
-
- @Override
- public void sendRequests(List<? extends RPCRequest> rpcs, OnMultipleRequestListener listener) {
-
- }
-
- @Override
- public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {}
-
- @Override
- 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
- public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) { }
-
- @Override
- public SdlMsgVersion getSdlMsgVersion(){
- return null;
- }
-
- @Override
- public Version getProtocolVersion() {
- return new Version(1,0,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 boolean isTransportForServiceAvailable(SessionType serviceType) {
- return false;
- }
-
- @Override
- public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {}
-
- @Override
- public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters){
- return null;
- }
-
- @Override
- public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
- return null;
- }
-
- @Override
- public void startAudioService(boolean encrypted){}
-
- }
-
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java
deleted file mode 100644
index 222ab5bbc..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package com.smartdevicelink.test.proxy;
-
-import java.util.Vector;
-
-import com.smartdevicelink.proxy.TTSChunkFactory;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.test.Test;
-
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.TTSChunkFactory}
- */
-public class TTSChunkFactoryTests extends TestCase {
-
- private TTSChunk testChunk;
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.TTSChunkFactory#createChunk(SpeechCapabilities, String)}
- */
- public void testCreateChunk () {
- // Valid Tests
- SpeechCapabilities testType = SpeechCapabilities.TEXT;
- testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
- assertNotNull(Test.NOT_NULL, testChunk);
- assertEquals(Test.MATCH, testType, testChunk.getType());
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
-
- testType = SpeechCapabilities.SILENCE;
- testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
- assertNotNull(Test.NOT_NULL, testChunk);
- assertEquals(Test.MATCH, testType, testChunk.getType());
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
-
- testType = SpeechCapabilities.SAPI_PHONEMES;
- testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
- assertNotNull(Test.NOT_NULL, testChunk);
- assertEquals(Test.MATCH, testType, testChunk.getType());
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
-
- testType = SpeechCapabilities.PRE_RECORDED;
- testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
- assertNotNull(Test.NOT_NULL, testChunk);
- assertEquals(Test.MATCH, testType, testChunk.getType());
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
-
- testType = SpeechCapabilities.LHPLUS_PHONEMES;
- testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING);
- assertNotNull(Test.NOT_NULL, testChunk);
- assertEquals(Test.MATCH, testType, testChunk.getType());
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText());
-
- // Invalid/Null Tests
- testChunk = TTSChunkFactory.createChunk(null, null);
- assertNotNull(Test.NOT_NULL, testChunk);
- assertNull(Test.NULL, testChunk.getType());
- assertNull(Test.NULL, testChunk.getText());
- }
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.TTSChunkFactory#createSimpleTTSChunks(String)}
- */
- public void testCreateSimpleTTSChunks () {
- // Test Values
- Vector<TTSChunk> testChunks;
- testChunks = TTSChunkFactory.createSimpleTTSChunks(Test.GENERAL_STRING);
-
- // Valid Tests
- assertNotNull(Test.NOT_NULL, testChunks);
- assertEquals(Test.MATCH, SpeechCapabilities.TEXT, testChunks.get(0).getType());
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunks.get(0).getText());
-
- // Invalid/Null Tests
- testChunks = TTSChunkFactory.createSimpleTTSChunks(null);
- assertNull(Test.NULL, testChunks);
- }
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.TTSChunkFactory#createPrerecordedTTSChunks(String)}
- */
- public void testCreatePrerecordedTTSChunks () {
- // Test Values
- Vector<TTSChunk> testChunks;
- testChunks = TTSChunkFactory.createPrerecordedTTSChunks(Test.GENERAL_STRING);
-
- // Valid Tests
- assertNotNull(Test.NOT_NULL, testChunks);
- assertEquals(Test.MATCH, SpeechCapabilities.PRE_RECORDED, testChunks.get(0).getType());
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunks.get(0).getText());
-
- // Invalid/Null Tests
- testChunks = TTSChunkFactory.createPrerecordedTTSChunks(null);
- assertNull(Test.NULL, testChunks);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java
deleted file mode 100644
index d65e68760..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.AirbagStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.AirbagStatus}
- */
-public class AirbagStatusTests extends TestCase{
-
- private AirbagStatus msg;
-
- @Override
- public void setUp(){
- msg = new AirbagStatus();
- assertNotNull(Test.NOT_NULL, msg);
-
- msg.setDriverAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setDriverCurtainAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setDriverKneeAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setDriverSideAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setPassengerAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setPassengerCurtainAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setPassengerKneeAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setPassengerSideAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
-
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- VehicleDataEventStatus airbagStatus = msg.getDriverAirbagDeployed();
- VehicleDataEventStatus curtainStatus = msg.getDriverCurtainAirbagDeployed();
- VehicleDataEventStatus kneeStatus = msg.getDriverKneeAirbagDeployed();
- VehicleDataEventStatus sideStatus = msg.getDriverSideAirbagDeployed();
- VehicleDataEventStatus passengerStatus = msg.getPassengerAirbagDeployed();
- VehicleDataEventStatus passengerCurtainStatus = msg.getPassengerCurtainAirbagDeployed();
- VehicleDataEventStatus passengerKneeStatus = msg.getPassengerKneeAirbagDeployed();
- VehicleDataEventStatus passengerSideStatus = msg.getPassengerSideAirbagDeployed();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, airbagStatus);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, curtainStatus);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, kneeStatus);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, sideStatus);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerStatus);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerCurtainStatus);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerKneeStatus);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerSideStatus);
-
- // Invalid/Null Tests
- AirbagStatus msg = new AirbagStatus();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getDriverAirbagDeployed());
- assertNull(Test.NULL, msg.getDriverSideAirbagDeployed());
- assertNull(Test.NULL, msg.getDriverCurtainAirbagDeployed());
- assertNull(Test.NULL, msg.getPassengerAirbagDeployed());
- assertNull(Test.NULL, msg.getPassengerCurtainAirbagDeployed());
- assertNull(Test.NULL, msg.getDriverKneeAirbagDeployed());
- assertNull(Test.NULL, msg.getPassengerSideAirbagDeployed());
- assertNull(Test.NULL, msg.getPassengerKneeAirbagDeployed());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(AirbagStatus.KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(AirbagStatus.KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(AirbagStatus.KEY_PASSENGER_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(AirbagStatus.KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(AirbagStatus.KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(AirbagStatus.KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
-
- 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/AudioPassThruCapabilitiesTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java
deleted file mode 100644
index 476898685..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.AudioPassThruCapabilities}
- */
-public class AudioPassThruCapabilitiesTest extends TestCase{
-
- private AudioPassThruCapabilities msg;
-
- @Override
- public void setUp(){
- msg = new AudioPassThruCapabilities();
- assertNotNull(Test.NOT_NULL, msg);
-
- msg.setAudioType(Test.GENERAL_AUDIOTYPE);
- msg.setBitsPerSample(Test.GENERAL_BITSPERSAMPLE);
- msg.setSamplingRate(Test.GENERAL_SAMPLINGRATE);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- SamplingRate samplingRate = msg.getSamplingRate();
- BitsPerSample bitsPerSample = msg.getBitsPerSample();
- AudioType audioType = msg.getAudioType();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_SAMPLINGRATE, samplingRate);
- assertEquals(Test.MATCH, Test.GENERAL_BITSPERSAMPLE, bitsPerSample);
- assertEquals(Test.MATCH, Test.GENERAL_AUDIOTYPE, audioType);
-
- // Invalid/Null Tests
- AudioPassThruCapabilities msg = new AudioPassThruCapabilities();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getAudioType());
- assertNull(Test.NULL, msg.getBitsPerSample());
- assertNull(Test.NULL, msg.getSamplingRate());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, Test.GENERAL_AUDIOTYPE);
- reference.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, Test.GENERAL_BITSPERSAMPLE);
- reference.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, Test.GENERAL_SAMPLINGRATE);
-
- 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/BeltStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java
deleted file mode 100644
index 5fb53ef3d..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.BeltStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.BeltStatus}
- */
-public class BeltStatusTests extends TestCase{
-
- private BeltStatus msg;
-
- @Override
- protected void setUp() throws Exception{
- msg = new BeltStatus();
- assertNotNull(Test.NOT_NULL, msg);
-
- msg.setLeftRearInflatableBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setPassengerChildDetected(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setRightRearInflatableBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setDriverBuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setPassengerBuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setRightRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setDriverBeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setPassengerBeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setMiddleRow1BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setMiddleRow1BeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setLeftRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setMiddleRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setMiddleRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setLeftRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setRightRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Valid Tests
- VehicleDataEventStatus leftRearInflatable = msg.getLeftRearInflatableBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, leftRearInflatable);
-
- VehicleDataEventStatus rightRearInflatable = msg.getRightRearInflatableBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, rightRearInflatable);
-
- VehicleDataEventStatus passengerChild = msg.getPassengerChildDetected();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerChild);
-
- VehicleDataEventStatus driverBuckled = msg.getDriverBuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
- driverBuckled = msg.getPassengerBuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
- driverBuckled = msg.getRightRow2BuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
- driverBuckled = msg.getMiddleRow1BuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
- driverBuckled = msg.getLeftRow2BuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
- driverBuckled = msg.getMiddleRow2BuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
- driverBuckled = msg.getMiddleRow3BuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
- driverBuckled = msg.getLeftRow3BuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
- driverBuckled = msg.getRightRow3BuckleBelted();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled);
-
- VehicleDataEventStatus driverBeltDeployed = msg.getDriverBeltDeployed();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed);
- driverBeltDeployed = msg.getPassengerBeltDeployed();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed);
- driverBeltDeployed = msg.getMiddleRow1BeltDeployed();
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed);
-
- // Invalid/Null Tests
- BeltStatus msg = new BeltStatus();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getLeftRearInflatableBelted());
- assertNull(Test.NULL, msg.getRightRearInflatableBelted());
- assertNull(Test.NULL, msg.getPassengerChildDetected());
- assertNull(Test.NULL, msg.getDriverBuckleBelted());
- assertNull(Test.NULL, msg.getPassengerBuckleBelted());
- assertNull(Test.NULL, msg.getRightRow2BuckleBelted());
- assertNull(Test.NULL, msg.getMiddleRow1BuckleBelted());
- assertNull(Test.NULL, msg.getLeftRow2BuckleBelted());
- assertNull(Test.NULL, msg.getMiddleRow2BuckleBelted());
- assertNull(Test.NULL, msg.getMiddleRow3BuckleBelted());
- assertNull(Test.NULL, msg.getLeftRow3BuckleBelted());
- assertNull(Test.NULL, msg.getRightRow3BuckleBelted());
- assertNull(Test.NULL, msg.getPassengerBeltDeployed());
- assertNull(Test.NULL, msg.getMiddleRow1BeltDeployed());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(BeltStatus.KEY_PASSENGER_CHILD_DETECTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_REAR_INFLATABLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_RIGHT_REAR_INFLATABLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_DRIVER_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_DRIVER_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_PASSENGER_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_PASSENGER_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_LEFT_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_RIGHT_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_MIDDLE_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_MIDDLE_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_LEFT_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_RIGHT_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_MIDDLE_ROW_1_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(BeltStatus.KEY_MIDDLE_ROW_1_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
-
- 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/BodyInformationTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java
deleted file mode 100644
index 245ee7ec8..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.BodyInformation;
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.BodyInformation}
- */
-public class BodyInformationTests extends TestCase{
-
- private BodyInformation msg;
-
- @Override
- public void setUp(){
- msg = new BodyInformation();
- msg.setParkBrakeActive(Test.GENERAL_BOOLEAN);
- msg.setIgnitionStatus(Test.GENERAL_IGNITIONSTATUS);
- msg.setIgnitionStableStatus(Test.GENERAL_IGNITIONSTABLESTATUS);
-
- msg.setDriverDoorAjar(Test.GENERAL_BOOLEAN);
- msg.setPassengerDoorAjar(Test.GENERAL_BOOLEAN);
- msg.setRearLeftDoorAjar(Test.GENERAL_BOOLEAN);
- msg.setRearRightDoorAjar(Test.GENERAL_BOOLEAN);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- boolean parkBrake = msg.getParkBrakeActive();
- IgnitionStatus ignitionStatus = msg.getIgnitionStatus();
- IgnitionStableStatus ignitionStable = msg.getIgnitionStableStatus();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, parkBrake);
- assertEquals(Test.MATCH, Test.GENERAL_IGNITIONSTATUS, ignitionStatus);
- assertEquals(Test.MATCH, Test.GENERAL_IGNITIONSTABLESTATUS, ignitionStable);
-
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getDriverDoorAjar());
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getPassengerDoorAjar());
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getRearLeftDoorAjar());
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getRearRightDoorAjar());
-
- // Invalid/Null Tests
- BodyInformation msg = new BodyInformation();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getParkBrakeActive());
- assertNull(Test.NULL, msg.getIgnitionStatus());
- assertNull(Test.NULL, msg.getIgnitionStatus());
- assertNull(Test.NULL, msg.getDriverDoorAjar());
- assertNull(Test.NULL, msg.getPassengerDoorAjar());
- assertNull(Test.NULL, msg.getRearLeftDoorAjar());
- assertNull(Test.NULL, msg.getRearRightDoorAjar());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, Test.GENERAL_BOOLEAN);
- reference.put(BodyInformation.KEY_IGNITION_STATUS, Test.GENERAL_IGNITIONSTATUS);
- reference.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, Test.GENERAL_IGNITIONSTABLESTATUS);
- reference.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, Test.GENERAL_BOOLEAN);
- reference.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, Test.GENERAL_BOOLEAN);
- reference.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, Test.GENERAL_BOOLEAN);
- reference.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, 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/ButtonCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java
deleted file mode 100644
index b8001dc2c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ButtonCapabilities}
- */
-public class ButtonCapabilitiesTests extends TestCase{
-
- private ButtonCapabilities msg;
-
- @Override
- public void setUp(){
- msg = new ButtonCapabilities();
-
- msg.setLongPressAvailable(Test.GENERAL_BOOLEAN);
- msg.setName(Test.GENERAL_BUTTONNAME);
- msg.setShortPressAvailable(Test.GENERAL_BOOLEAN);
- msg.setUpDownAvailable(Test.GENERAL_BOOLEAN);
- }
-
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- boolean shortPress = msg.getShortPressAvailable();
- boolean longPress = msg.getLongPressAvailable();
- boolean upDown = msg.getUpDownAvailable();
- ButtonName buttonName = msg.getName();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, shortPress);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, longPress);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, upDown);
- assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, buttonName);
-
- // Invalid/Null Tests
- ButtonCapabilities msg = new ButtonCapabilities();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getShortPressAvailable());
- assertNull(Test.NULL, msg.getLongPressAvailable());
- assertNull(Test.NULL, msg.getUpDownAvailable());
- assertNull(Test.NULL, msg.getName());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN);
- reference.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN);
- reference.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE, Test.GENERAL_BOOLEAN);
- reference.put(ButtonCapabilities.KEY_NAME, Test.GENERAL_BUTTONNAME);
-
- 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/ChoiceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java
deleted file mode 100644
index 0df50f405..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.Choice;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.Choice}
- */
-public class ChoiceTests extends TestCase{
-
- private Choice msg;
-
- @Override
- public void setUp(){
- msg = new Choice();
-
- msg.setChoiceID(Test.GENERAL_INT);
- msg.setMenuName(Test.GENERAL_STRING);
- msg.setImage(Test.GENERAL_IMAGE);
- msg.setSecondaryImage(Test.GENERAL_IMAGE);
- msg.setSecondaryText(Test.GENERAL_STRING);
- msg.setTertiaryText(Test.GENERAL_STRING);
- msg.setVrCommands(Test.GENERAL_STRING_LIST);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String text3 = msg.getTertiaryText();
- String text2 = msg.getSecondaryText();
- String menuName = msg.getMenuName();
- int choiceId = msg.getChoiceID();
- List<String> vrCommands = msg.getVrCommands();
- Image image2 = msg.getSecondaryImage();
- Image image = msg.getImage();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, text3);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, text2);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, menuName);
- assertEquals(Test.MATCH, Test.GENERAL_INT, choiceId);
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, vrCommands));
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image2));
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image));
-
- // Invalid/Null Tests
- Choice msg = new Choice();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getChoiceID());
- assertNull(Test.NULL, msg.getImage());
- assertNull(Test.NULL, msg.getSecondaryImage());
- assertNull(Test.NULL, msg.getMenuName());
- assertNull(Test.NULL, msg.getSecondaryText());
- assertNull(Test.NULL, msg.getTertiaryText());
- assertNull(Test.NULL, msg.getVrCommands());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(Choice.KEY_CHOICE_ID, Test.GENERAL_INT);
- reference.put(Choice.KEY_MENU_NAME, Test.GENERAL_STRING);
- reference.put(Choice.KEY_SECONDARY_TEXT, Test.GENERAL_STRING);
- reference.put(Choice.KEY_TERTIARY_TEXT, Test.GENERAL_STRING);
- reference.put(Choice.KEY_IMAGE, Test.JSON_IMAGE);
- reference.put(Choice.KEY_SECONDARY_IMAGE, Test.JSON_IMAGE);
- reference.put(Choice.KEY_VR_COMMANDS, JsonUtils.createJsonArray(Test.GENERAL_STRING_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(Choice.KEY_VR_COMMANDS)){
- assertTrue(Test.TRUE,
- Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key),
- JsonUtils.readStringListFromJsonObject(underTest, key)));
- } else if(key.equals(Choice.KEY_IMAGE) || key.equals(Choice.KEY_SECONDARY_IMAGE)){
- JSONObject objectEquals = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject testEquals = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
- Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
- Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
-
- assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(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/ClusterModeStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java
deleted file mode 100644
index 883b456fa..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
-import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
-import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ClusterModeStatus}
- */
-public class ClusterModeStatusTests extends TestCase{
-
- private ClusterModeStatus msg;
-
- @Override
- public void setUp(){
- msg = new ClusterModeStatus();
-
- msg.setPowerModeActive(Test.GENERAL_BOOLEAN);
- msg.setCarModeStatus(Test.GENERAL_CARMODESTATUS);
- msg.setPowerModeQualificationStatus(Test.GENERAL_POWERMODEQUALIFICATIONSTATUS);
- msg.setPowerModeStatus(Test.GENERAL_POWERMODESTATUS);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- boolean powerMode = msg.getPowerModeActive();
- PowerModeQualificationStatus qualification = msg.getPowerModeQualificationStatus();
- PowerModeStatus status = msg.getPowerModeStatus();
- CarModeStatus carStatus = msg.getCarModeStatus();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, powerMode);
- assertEquals(Test.MATCH, Test.GENERAL_POWERMODEQUALIFICATIONSTATUS, qualification);
- assertEquals(Test.MATCH, Test.GENERAL_POWERMODESTATUS, status);
- assertEquals(Test.MATCH, Test.GENERAL_CARMODESTATUS, carStatus);
-
- // Invalid/Null Tests
- ClusterModeStatus msg = new ClusterModeStatus();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getPowerModeActive());
- assertNull(Test.NULL, msg.getPowerModeStatus());
- assertNull(Test.NULL, msg.getPowerModeQualificationStatus());
- assertNull(Test.NULL, msg.getCarModeStatus());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(ClusterModeStatus.KEY_POWER_MODE_ACTIVE, Test.GENERAL_BOOLEAN);
- reference.put(ClusterModeStatus.KEY_POWER_MODE_STATUS, Test.GENERAL_POWERMODESTATUS);
- reference.put(ClusterModeStatus.KEY_POWER_MODE_QUALIFICATION_STATUS, Test.GENERAL_POWERMODEQUALIFICATIONSTATUS);
- reference.put(ClusterModeStatus.KEY_CAR_MODE_STATUS, Test.GENERAL_CARMODESTATUS);
-
- 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/DIDResultTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java
deleted file mode 100644
index b929f2f80..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.DIDResult;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DIDResult}
- */
-public class DIDResultTests extends TestCase {
-
- private DIDResult msg;
-
- @Override
- public void setUp(){
- msg = new DIDResult();
-
- msg.setData(Test.GENERAL_STRING);
- msg.setResultCode(Test.GENERAL_VEHICLEDATARESULTCODE);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String data = msg.getData();
- VehicleDataResultCode resultCode = msg.getResultCode();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, data);
- assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATARESULTCODE, resultCode);
-
- // Invalid/Null Tests
- DIDResult msg = new DIDResult();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getData());
- assertNull(Test.NULL, msg.getResultCode());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(DIDResult.KEY_DATA, Test.GENERAL_STRING);
- reference.put(DIDResult.KEY_RESULT_CODE, Test.GENERAL_VEHICLEDATARESULTCODE);
-
- 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/DTCTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java
deleted file mode 100644
index 3079d2003..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.DTC;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DTC}
- */
-public class DTCTests extends TestCase{
-
- private DTC msg;
-
- @Override
- public void setUp(){
- msg = new DTC();
-
- msg.setIdentifier(Test.GENERAL_STRING);
- msg.setStatusByte(Test.GENERAL_STRING);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String identifier = msg.getIdentifier();
- String statusByte = msg.getStatusByte();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, identifier);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, statusByte);
-
- // Invalid/Null Tests
- DTC msg = new DTC();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getIdentifier());
- assertNull(Test.NULL, msg.getStatusByte());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(DTC.KEY_IDENTIFIER, Test.GENERAL_STRING);
- reference.put(DTC.KEY_STATUS_BYTE, 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();
- 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/DeviceInfoTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java
deleted file mode 100644
index cbd432cc2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.DeviceInfo;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeviceInfo}
- */
-public class DeviceInfoTests extends TestCase{
-
- private DeviceInfo msg;
-
- @Override
- public void setUp(){
- msg = new DeviceInfo();
-
- msg.setCarrier(Test.GENERAL_STRING);
- msg.setFirmwareRev(Test.GENERAL_STRING);
- msg.setHardware(Test.GENERAL_STRING);
- msg.setMaxNumberRFCOMMPorts(Test.GENERAL_INT);
- msg.setOs(Test.GENERAL_STRING);
- msg.setOsVersion(Test.GENERAL_STRING);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String carrier = msg.getCarrier();
- String hardware = msg.getHardware();
- String firmwareRev = msg.getFirmwareRev();
- String os = msg.getOs();
- String osVer = msg.getOsVersion();
- int maxNum = msg.getMaxNumberRFCOMMPorts();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, maxNum);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, osVer);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, os);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, firmwareRev);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, hardware);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, carrier);
-
- // Invalid/Null Tests
- DeviceInfo msg = new DeviceInfo();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getCarrier());
- assertNull(Test.NULL, msg.getHardware());
- assertNull(Test.NULL, msg.getFirmwareRev());
- assertNull(Test.NULL, msg.getOs());
- assertNull(Test.NULL, msg.getOsVersion());
- assertNull(Test.NULL, msg.getMaxNumberRFCOMMPorts());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(DeviceInfo.KEY_CARRIER, Test.GENERAL_STRING);
- reference.put(DeviceInfo.KEY_HARDWARE, Test.GENERAL_STRING);
- reference.put(DeviceInfo.KEY_FIRMWARE_REV, Test.GENERAL_STRING);
- reference.put(DeviceInfo.KEY_OS, Test.GENERAL_STRING);
- reference.put(DeviceInfo.KEY_OS_VERSION, Test.GENERAL_STRING);
- reference.put(DeviceInfo.KEY_MAX_NUMBER_RFCOMM_PORTS, 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/DeviceStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java
deleted file mode 100644
index 4c966f06e..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.DeviceStatus;
-import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
-import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeviceStatus}
- */
-public class DeviceStatusTests extends TestCase {
-
- private DeviceStatus msg;
-
- @Override
- public void setUp(){
- msg = new DeviceStatus();
-
- msg.setBattLevelStatus(Test.GENERAL_DEVICELEVELSTATUS);
- msg.setBtIconOn(Test.GENERAL_BOOLEAN);
- msg.setCallActive(Test.GENERAL_BOOLEAN);
- msg.setECallEventActive(Test.GENERAL_BOOLEAN);
- msg.setMonoAudioOutputMuted(Test.GENERAL_BOOLEAN);
- msg.setPhoneRoaming(Test.GENERAL_BOOLEAN);
- msg.setPrimaryAudioSource(Test.GENERAL_PRIMARYAUDIOSOURCE);
- msg.setSignalLevelStatus(Test.GENERAL_DEVICELEVELSTATUS);
- msg.setStereoAudioOutputMuted(Test.GENERAL_BOOLEAN);
- msg.setTextMsgAvailable(Test.GENERAL_BOOLEAN);
- msg.setVoiceRecOn(Test.GENERAL_BOOLEAN);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- DeviceLevelStatus battLevel = msg.getBattLevelStatus();
- boolean btIcon = msg.getBtIconOn();
- boolean callActive = msg.getCallActive();
- boolean ecall = msg.getECallEventActive();
- boolean monoAudio = msg.getMonoAudioOutputMuted();
- boolean phoneRoaming = msg.getPhoneRoaming();
- PrimaryAudioSource primaryAudio = msg.getPrimaryAudioSource();
- DeviceLevelStatus signalLevel = msg.getSignalLevelStatus();
- boolean stereoAudio = msg.getStereoAudioOutputMuted();
- boolean textAvailable = msg.getTextMsgAvailable();
- boolean voiceRec = msg.getVoiceRecOn();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_DEVICELEVELSTATUS, battLevel);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, btIcon);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, callActive);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, ecall);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, monoAudio);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, phoneRoaming);
- assertEquals(Test.MATCH, Test.GENERAL_PRIMARYAUDIOSOURCE, primaryAudio);
- assertEquals(Test.MATCH, Test.GENERAL_DEVICELEVELSTATUS, signalLevel);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, stereoAudio);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, textAvailable);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, voiceRec);
-
- // Invalid/Null Tests
- DeviceStatus msg = new DeviceStatus();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getBattLevelStatus());
- assertNull(Test.NULL, msg.getBtIconOn());
- assertNull(Test.NULL, msg.getCallActive());
- assertNull(Test.NULL, msg.getECallEventActive());
- assertNull(Test.NULL, msg.getMonoAudioOutputMuted());
- assertNull(Test.NULL, msg.getPhoneRoaming());
- assertNull(Test.NULL, msg.getPrimaryAudioSource());
- assertNull(Test.NULL, msg.getSignalLevelStatus());
- assertNull(Test.NULL, msg.getStereoAudioOutputMuted());
- assertNull(Test.NULL, msg.getTextMsgAvailable());
- assertNull(Test.NULL, msg.getVoiceRecOn());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, Test.GENERAL_DEVICELEVELSTATUS);
- reference.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, Test.GENERAL_DEVICELEVELSTATUS);
- reference.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, Test.GENERAL_PRIMARYAUDIOSOURCE);
- reference.put(DeviceStatus.KEY_BT_ICON_ON, Test.GENERAL_BOOLEAN);
- reference.put(DeviceStatus.KEY_CALL_ACTIVE, Test.GENERAL_BOOLEAN);
- reference.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, Test.GENERAL_BOOLEAN);
- reference.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, Test.GENERAL_BOOLEAN);
- reference.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, Test.GENERAL_BOOLEAN);
- reference.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, Test.GENERAL_BOOLEAN);
- reference.put(DeviceStatus.KEY_PHONE_ROAMING, Test.GENERAL_BOOLEAN);
- reference.put(DeviceStatus.KEY_VOICE_REC_ON, 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/DisplayCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java
deleted file mode 100644
index 9e627c217..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.ImageField;
-import com.smartdevicelink.proxy.rpc.ScreenParams;
-import com.smartdevicelink.proxy.rpc.TextField;
-import com.smartdevicelink.proxy.rpc.enums.DisplayType;
-import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DisplayCapabilities}
- */
-public class DisplayCapabilitiesTests extends TestCase{
-
- private DisplayCapabilities msg;
-
- @Override
- public void setUp(){
- msg = new DisplayCapabilities();
-
- msg.setGraphicSupported(Test.GENERAL_BOOLEAN);
- msg.setNumCustomPresetsAvailable(Test.GENERAL_INT);
- msg.setDisplayType(Test.GENERAL_DISPLAYTYPE);
- msg.setDisplayName(Test.GENERAL_STRING);
- msg.setImageFields(Test.GENERAL_IMAGEFIELD_LIST);
- msg.setTextFields(Test.GENERAL_TEXTFIELD_LIST);
- msg.setMediaClockFormats(Test.GENERAL_MEDIACLOCKFORMAT_LIST);
- msg.setScreenParams(Test.GENERAL_SCREENPARAMS);
- msg.setTemplatesAvailable(Test.GENERAL_STRING_LIST);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- boolean graphicSupported = msg.getGraphicSupported();
- int numPresets = msg.getNumCustomPresetsAvailable();
- DisplayType displayType = msg.getDisplayType();
- String displayName = msg.getDisplayName();
- ScreenParams screenParams = msg.getScreenParams();
- List<String> templatesAvailable = msg.getTemplatesAvailable();
- List<MediaClockFormat> mediaClock = msg.getMediaClockFormats();
- List<TextField> textFields = msg.getTextFields();
- List<ImageField> imageFields = msg.getImageFields();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, graphicSupported);
- assertEquals(Test.MATCH, Test.GENERAL_INT, numPresets);
- assertEquals(Test.MATCH, Test.GENERAL_DISPLAYTYPE, displayType);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, displayName);
- assertTrue(Test.TRUE, Validator.validateScreenParams(Test.GENERAL_SCREENPARAMS, screenParams));
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), templatesAvailable.size());
- assertEquals(Test.MATCH, Test.GENERAL_MEDIACLOCKFORMAT_LIST.size(), mediaClock.size());
- assertEquals(Test.MATCH, Test.GENERAL_TEXTFIELD_LIST.size(), textFields.size());
- assertEquals(Test.MATCH, Test.GENERAL_IMAGEFIELD_LIST.size(), imageFields.size());
-
- for(int i = 0; i < Test.GENERAL_STRING_LIST.size(); i++){
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.get(i), templatesAvailable.get(i));
- }
-
- for(int i = 0; i < Test.GENERAL_MEDIACLOCKFORMAT_LIST.size(); i++){
- assertEquals(Test.MATCH, Test.GENERAL_MEDIACLOCKFORMAT_LIST.get(i), mediaClock.get(i));
- }
-
- for(int i = 0; i < Test.GENERAL_TEXTFIELD_LIST.size(); i++){
- assertTrue(Test.TRUE, Validator.validateTextFields(Test.GENERAL_TEXTFIELD_LIST.get(i), textFields.get(i)));
- }
-
- for(int i = 0; i < Test.GENERAL_IMAGEFIELD_LIST.size(); i++){
- assertTrue(Test.TRUE, Validator.validateImageFields(Test.GENERAL_IMAGEFIELD_LIST.get(i), imageFields.get(i)));
- }
-
- // Invalid/Null Tests
- DisplayCapabilities msg = new DisplayCapabilities();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getDisplayType());
- assertNull(Test.NULL, msg.getDisplayName());
- assertNull(Test.NULL, msg.getGraphicSupported());
- assertNull(Test.NULL, msg.getImageFields());
- assertNull(Test.NULL, msg.getMediaClockFormats());
- assertNull(Test.NULL, msg.getNumCustomPresetsAvailable());
- assertNull(Test.NULL, msg.getScreenParams());
- assertNull(Test.NULL, msg.getTemplatesAvailable());
- assertNull(Test.NULL, msg.getTextFields());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(DisplayCapabilities.KEY_NUM_CUSTOM_PRESETS_AVAILABLE, Test.GENERAL_INT);
- reference.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED, Test.GENERAL_BOOLEAN);
- reference.put(DisplayCapabilities.KEY_DISPLAY_TYPE, Test.GENERAL_DISPLAYTYPE);
- reference.put(DisplayCapabilities.KEY_DISPLAY_NAME, Test.GENERAL_STRING);
- reference.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- reference.put(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS, JsonUtils.createJsonArray(Test.GENERAL_MEDIACLOCKFORMAT_LIST));
- reference.put(DisplayCapabilities.KEY_TEXT_FIELDS, Test.JSON_TEXTFIELDS);
- reference.put(DisplayCapabilities.KEY_IMAGE_FIELDS, Test.JSON_IMAGEFIELDS);
- reference.put(DisplayCapabilities.KEY_SCREEN_PARAMS, Test.JSON_SCREENPARAMS);
-
- 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(DisplayCapabilities.KEY_IMAGE_FIELDS)){
- JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
- JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
- assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
-
- for(int i = 0; i < referenceArray.length(); i++){
- Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i));
- Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i));
- assertTrue(Test.TRUE, Validator.validateImageFields(new ImageField(hashReference), new ImageField(hashTest)));
- }
- } else if(key.equals(DisplayCapabilities.KEY_TEXT_FIELDS)){
- JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
- JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
- assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
-
- for(int i = 0; i < referenceArray.length(); i++){
- Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i));
- Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i));
- assertTrue(Test.TRUE, Validator.validateTextFields(new TextField(hashReference), new TextField(hashTest)));
- }
- } else if(key.equals(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE)){
- JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
- JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
- assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
- assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
- } else if(key.equals(DisplayCapabilities.KEY_SCREEN_PARAMS)){
- JSONObject referenceArray = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject underTestArray = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
- Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray);
- Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray);
-
- assertTrue(Test.TRUE, Validator.validateScreenParams(new ScreenParams(hashReference), new ScreenParams(hashTest)));
- } else if(key.equals(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS)){
- JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
- JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
- assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
-
- for(int i = 0; i < referenceArray.length(); i++){
- assertTrue(Test.TRUE, Validator.validateText(referenceArray.getString(i), underTestArray.getString(i)));// not a string?
- }
- } 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/ECallInfoTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java
deleted file mode 100644
index 82a57869a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.ECallInfo;
-import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ECallInfo}
- */
-public class ECallInfoTests extends TestCase{
-
- private ECallInfo msg;
-
- @Override
- public void setUp(){
- msg = new ECallInfo();
-
- msg.setAuxECallNotificationStatus(Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS);
- msg.setECallConfirmationStatus(Test.GENERAL_ECALLCONFIRMATIONSTATUS);
- msg.setECallNotificationStatus(Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- VehicleDataNotificationStatus auxEcall = msg.getAuxECallNotificationStatus();
- VehicleDataNotificationStatus ecallNotify = msg.getECallNotificationStatus();
- ECallConfirmationStatus ecallConfirm = msg.getECallConfirmationStatus();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS, auxEcall);
- assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS, ecallNotify);
- assertEquals(Test.MATCH, Test.GENERAL_ECALLCONFIRMATIONSTATUS, ecallConfirm);
-
- // Invalid/Null Tests
- ECallInfo msg = new ECallInfo();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getECallConfirmationStatus());
- assertNull(Test.NULL, msg.getECallNotificationStatus());
- assertNull(Test.NULL, msg.getAuxECallNotificationStatus());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(ECallInfo.KEY_AUX_E_CALL_NOTIFICATION_STATUS, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS);
- reference.put(ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS);
- reference.put(ECallInfo.KEY_E_CALL_CONFIRMATION_STATUS, Test.GENERAL_ECALLCONFIRMATIONSTATUS);
-
- 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/EmergencyEventTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java
deleted file mode 100644
index 6d72e440f..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.EmergencyEvent;
-import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
-import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.EmergencyEvent}
- */
-public class EmergencyEventTests extends TestCase{
-
- private EmergencyEvent msg;
-
- @Override
- public void setUp(){
- msg = new EmergencyEvent();
-
- msg.setEmergencyEventType(Test.GENERAL_EMERGENCYEVENTTYPE);
- msg.setFuelCutoffStatus(Test.GENERAL_FUELCUTOFFSTATUS);
- msg.setMaximumChangeVelocity(Test.GENERAL_INT);
- msg.setMultipleEvents(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- msg.setRolloverEvent(Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- EmergencyEventType type = msg.getEmergencyEventType();
- FuelCutoffStatus cutoffStatus = msg.getFuelCutoffStatus();
- VehicleDataEventStatus multipleEvents = msg.getMultipleEvents();
- int changeVelocity = msg.getMaximumChangeVelocity();
- VehicleDataEventStatus rollover = msg.getRolloverEvent();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_EMERGENCYEVENTTYPE, type);
- assertEquals(Test.MATCH, Test.GENERAL_FUELCUTOFFSTATUS, cutoffStatus);
- assertEquals(Test.MATCH, Test.GENERAL_INT, changeVelocity);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, multipleEvents);
- assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, rollover);
-
- // Invalid/Null Tests
- EmergencyEvent msg = new EmergencyEvent();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getEmergencyEventType());
- assertNull(Test.NULL, msg.getFuelCutoffStatus());
- assertNull(Test.NULL, msg.getMaximumChangeVelocity());
- assertNull(Test.NULL, msg.getMultipleEvents());
- assertNull(Test.NULL, msg.getRolloverEvent());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(EmergencyEvent.KEY_FUEL_CUTOFF_STATUS, Test.GENERAL_FUELCUTOFFSTATUS);
- reference.put(EmergencyEvent.KEY_MULTIPLE_EVENTS, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(EmergencyEvent.KEY_ROLLOVER_EVENT, Test.GENERAL_VEHCILEDATAEVENTSTATUS);
- reference.put(EmergencyEvent.KEY_EMERGENCY_EVENT_TYPE, Test.GENERAL_EMERGENCYEVENTTYPE);
- reference.put(EmergencyEvent.KEY_MAXIMUM_CHANGE_VELOCITY, 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/GPSDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java
deleted file mode 100644
index 0c6800ea5..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.GPSData;
-import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
-import com.smartdevicelink.proxy.rpc.enums.Dimension;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.GPSData}
- */
-public class GPSDataTests extends TestCase{
-
- private GPSData msg;
-
- @Override
- public void setUp(){
- msg = new GPSData();
-
- msg.setActual(Test.GENERAL_BOOLEAN);
- msg.setAltitude(Test.GENERAL_DOUBLE);
- msg.setCompassDirection(Test.GENERAL_COMPASSDIRECTION);
- msg.setDimension(Test.GENERAL_DIMENSION);
- msg.setHdop(Test.GENERAL_DOUBLE);
- msg.setHeading(Test.GENERAL_DOUBLE);
- msg.setLatitudeDegrees(Test.GENERAL_DOUBLE);
- msg.setLongitudeDegrees(Test.GENERAL_DOUBLE);
- msg.setPdop(Test.GENERAL_DOUBLE);
- msg.setSatellites(Test.GENERAL_INT);
- msg.setSpeed(Test.GENERAL_DOUBLE);
- msg.setUtcDay(Test.GENERAL_INT);
- msg.setUtcHours(Test.GENERAL_INT);
- msg.setUtcMinutes(Test.GENERAL_INT);
- msg.setUtcMonth(Test.GENERAL_INT);
- msg.setUtcSeconds(Test.GENERAL_INT);
- msg.setUtcYear(Test.GENERAL_INT);
- msg.setVdop(Test.GENERAL_DOUBLE);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- boolean actual = msg.getActual();
- double latitude = msg.getLatitudeDegrees();
- double longitude = msg.getLongitudeDegrees();
- double altitude = msg.getAltitude();
- double heading = msg.getHeading();
- double speed = msg.getSpeed();
- double pdop = msg.getPdop();
- double hdop = msg.getHdop();
- double vdop = msg.getVdop();
- int utcYear = msg.getUtcYear();
- int utcMin = msg.getUtcMinutes();
- int utcMonths = msg.getUtcMonth();
- int utcDay = msg.getUtcDay();
- int utcHours = msg.getUtcHours();
- int utcSec = msg.getUtcSeconds();
- int satellites = msg.getSatellites();
- Dimension dimension = msg.getDimension();
- CompassDirection direction = msg.getCompassDirection();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, actual);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, latitude);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, longitude);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, altitude);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, heading);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, speed);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, pdop);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, hdop);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, vdop);
- assertEquals(Test.MATCH, Test.GENERAL_INT, utcYear);
- assertEquals(Test.MATCH, Test.GENERAL_INT, utcMin);
- assertEquals(Test.MATCH, Test.GENERAL_INT, utcMonths);
- assertEquals(Test.MATCH, Test.GENERAL_INT, utcDay);
- assertEquals(Test.MATCH, Test.GENERAL_INT, utcHours);
- assertEquals(Test.MATCH, Test.GENERAL_INT, utcSec);
- assertEquals(Test.MATCH, Test.GENERAL_INT, satellites);
- assertEquals(Test.MATCH, Test.GENERAL_DIMENSION, dimension);
- assertEquals(Test.MATCH, Test.GENERAL_COMPASSDIRECTION, direction);
-
- // Invalid/Null Tests
- GPSData msg = new GPSData();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getActual());
- assertNull(Test.NULL, msg.getAltitude());
- assertNull(Test.NULL, msg.getCompassDirection());
- assertNull(Test.NULL, msg.getDimension());
- assertNull(Test.NULL, msg.getHdop());
- assertNull(Test.NULL, msg.getHeading());
- assertNull(Test.NULL, msg.getLatitudeDegrees());
- assertNull(Test.NULL, msg.getLongitudeDegrees());
- assertNull(Test.NULL, msg.getPdop());
- assertNull(Test.NULL, msg.getSatellites());
- assertNull(Test.NULL, msg.getSpeed());
- assertNull(Test.NULL, msg.getUtcDay());
- assertNull(Test.NULL, msg.getUtcHours());
- assertNull(Test.NULL, msg.getUtcMinutes());
- assertNull(Test.NULL, msg.getUtcMonth());
- assertNull(Test.NULL, msg.getUtcSeconds());
- assertNull(Test.NULL, msg.getUtcYear());
- assertNull(Test.NULL, msg.getVdop());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(GPSData.KEY_ACTUAL, Test.GENERAL_BOOLEAN);
- reference.put(GPSData.KEY_LATITUDE_DEGREES, Test.GENERAL_DOUBLE);
- reference.put(GPSData.KEY_LONGITUDE_DEGREES, Test.GENERAL_DOUBLE);
- reference.put(GPSData.KEY_ALTITUDE, Test.GENERAL_DOUBLE);
- reference.put(GPSData.KEY_HEADING, Test.GENERAL_DOUBLE);
- reference.put(GPSData.KEY_SPEED, Test.GENERAL_DOUBLE);
- reference.put(GPSData.KEY_PDOP, Test.GENERAL_DOUBLE);
- reference.put(GPSData.KEY_HDOP, Test.GENERAL_DOUBLE);
- reference.put(GPSData.KEY_VDOP, Test.GENERAL_DOUBLE);
- reference.put(GPSData.KEY_UTC_YEAR, Test.GENERAL_INT);
- reference.put(GPSData.KEY_UTC_MONTH, Test.GENERAL_INT);
- reference.put(GPSData.KEY_UTC_HOURS, Test.GENERAL_INT);
- reference.put(GPSData.KEY_UTC_DAY, Test.GENERAL_INT);
- reference.put(GPSData.KEY_UTC_MINUTES, Test.GENERAL_INT);
- reference.put(GPSData.KEY_UTC_SECONDS, Test.GENERAL_INT);
- reference.put(GPSData.KEY_SATELLITES, Test.GENERAL_INT);
- reference.put(GPSData.KEY_DIMENSION, Test.GENERAL_DIMENSION);
- reference.put(GPSData.KEY_COMPASS_DIRECTION, Test.GENERAL_COMPASSDIRECTION);
-
- 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/HMIPermissionsTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java
deleted file mode 100644
index fd82505f2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.HMIPermissions;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.HMIPermissions}
- */
-public class HMIPermissionsTests extends TestCase{
-
- private HMIPermissions msg;
-
- @Override
- public void setUp(){
- msg = new HMIPermissions();
-
- msg.setAllowed(Test.GENERAL_HMILEVEL_LIST);
- msg.setUserDisallowed(Test.GENERAL_HMILEVEL_LIST);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<HMILevel> allowed = msg.getAllowed();
- List<HMILevel> disallowed = msg.getUserDisallowed();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.size(), allowed.size());
- assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.size(), disallowed.size());
-
- for(int i = 0; i < Test.GENERAL_HMILEVEL_LIST.size(); i++){
- assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.get(i), allowed.get(i));
- }
- for(int i = 0; i < Test.GENERAL_HMILEVEL_LIST.size(); i++){
- assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.get(i), disallowed.get(i));
- }
-
- // Invalid/Null Tests
- HMIPermissions msg = new HMIPermissions();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getAllowed());
- assertNull(Test.NULL, msg.getUserDisallowed());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(HMIPermissions.KEY_ALLOWED, Test.JSON_HMILEVELS);
- reference.put(HMIPermissions.KEY_USER_DISALLOWED, Test.JSON_HMILEVELS);
-
- JSONObject underTest = msg.serializeJSON();
- assertEquals(Test.MATCH, reference.length(), underTest.length());
-
- Iterator<?> iterator = reference.keys();
- while(iterator.hasNext()){
- String key = (String) iterator.next();
- List<String> referenceList = JsonUtils.readStringListFromJsonObject(reference, key);
- List<String> underTestList = JsonUtils.readStringListFromJsonObject(underTest, key);
-
- assertEquals(Test.MATCH, referenceList.size(), underTestList.size());
- for(int i = 0; i < referenceList.size(); i++){
- assertEquals(Test.MATCH, referenceList.get(i), underTestList.get(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/HeadLampStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java
deleted file mode 100644
index 277786344..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.HeadLampStatus;
-import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.HeadLampStatus}
- */
-public class HeadLampStatusTests extends TestCase{
-
- private HeadLampStatus msg;
-
- @Override
- public void setUp(){
- msg = new HeadLampStatus();
-
- msg.setAmbientLightStatus(Test.GENERAL_AMBIENTLIGHTSTATUS);
- msg.setLowBeamsOn(Test.GENERAL_BOOLEAN);
- msg.setHighBeamsOn(Test.GENERAL_BOOLEAN);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- boolean lowBeams = msg.getLowBeamsOn();
- boolean highBeams = msg.getHighBeamsOn();
- AmbientLightStatus ambientLights = msg.getAmbientLightStatus();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_AMBIENTLIGHTSTATUS, ambientLights);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, highBeams);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, lowBeams);
-
- // Invalid/Null Tests
- HeadLampStatus msg = new HeadLampStatus();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getLowBeamsOn());
- assertNull(Test.NULL, msg.getHighBeamsOn());
- assertNull(Test.NULL, msg.getAmbientLightStatus());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(HeadLampStatus.KEY_HIGH_BEAMS_ON, Test.GENERAL_BOOLEAN);
- reference.put(HeadLampStatus.KEY_LOW_BEAMS_ON, Test.GENERAL_BOOLEAN);
- reference.put(HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS, Test.GENERAL_AMBIENTLIGHTSTATUS);
-
- 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/HeadersTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java
deleted file mode 100644
index 09c69022f..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.Headers;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.Headers}
- */
-public class HeadersTests extends TestCase{
-
- private Headers msg;
-
- @Override
- public void setUp(){
- msg = new Headers();
-
- msg.setCharset(Test.GENERAL_STRING);
- msg.setConnectTimeout(Test.GENERAL_INT);
- msg.setContentLength(Test.GENERAL_INT);
- msg.setContentType(Test.GENERAL_STRING);
- msg.setDoInput(Test.GENERAL_BOOLEAN);
- msg.setDoOutput(Test.GENERAL_BOOLEAN);
- msg.setInstanceFollowRedirects(Test.GENERAL_BOOLEAN);
- msg.setReadTimeout(Test.GENERAL_INT);
- msg.setRequestMethod(Test.GENERAL_STRING);
- msg.setUseCaches(Test.GENERAL_BOOLEAN);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String charset = msg.getCharset();
- String contentType = msg.getContentType();
- String requestMode = msg.getRequestMethod();
- int connectTimeout = msg.getConnectTimeout();
- int readTimeout = msg.getReadTimeout();
- int contentLength = msg.getContentLength();
- boolean doOutput = msg.getDoOutput();
- boolean doInput = msg.getDoInput();
- boolean useCache = msg.getUseCaches();
- boolean instanceFollow = msg.getInstanceFollowRedirects();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, charset);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, contentType);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, requestMode);
- assertEquals(Test.MATCH, Test.GENERAL_INT, connectTimeout);
- assertEquals(Test.MATCH, Test.GENERAL_INT, readTimeout);
- assertEquals(Test.MATCH, Test.GENERAL_INT, contentLength);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, doOutput);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, doInput);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, useCache);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, instanceFollow);
-
- // Invalid/Null Tests
- Headers msg = new Headers();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getCharset());
- assertNull(Test.NULL, msg.getConnectTimeout());
- assertNull(Test.NULL, msg.getContentLength());
- assertNull(Test.NULL, msg.getContentType());
- assertNull(Test.NULL, msg.getDoInput());
- assertNull(Test.NULL, msg.getDoOutput());
- assertNull(Test.NULL, msg.getInstanceFollowRedirects());
- assertNull(Test.NULL, msg.getReadTimeout());
- assertNull(Test.NULL, msg.getRequestMethod());
- assertNull(Test.NULL, msg.getUseCaches());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(Headers.KEY_CHARSET, Test.GENERAL_STRING);
- reference.put(Headers.KEY_CONTENT_TYPE, Test.GENERAL_STRING);
- reference.put(Headers.KEY_REQUEST_METHOD, Test.GENERAL_STRING);
- reference.put(Headers.KEY_CONNECT_TIMEOUT, Test.GENERAL_INT);
- reference.put(Headers.KEY_READ_TIMEOUT, Test.GENERAL_INT);
- reference.put(Headers.KEY_CONTENT_LENGTH, Test.GENERAL_INT);
- reference.put(Headers.KEY_DO_OUTPUT, Test.GENERAL_BOOLEAN);
- reference.put(Headers.KEY_DO_INPUT, Test.GENERAL_BOOLEAN);
- reference.put(Headers.KEY_USE_CACHES, Test.GENERAL_BOOLEAN);
- reference.put(Headers.KEY_INSTANCE_FOLLOW_REDIRECTS, 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/ImageFieldTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java
deleted file mode 100644
index 4291621df..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.ImageField;
-import com.smartdevicelink.proxy.rpc.ImageResolution;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ImageField}
- */
-public class ImageFieldTests extends TestCase{
-
- private ImageField msg;
-
- @Override
- public void setUp(){
- msg = new ImageField();
-
- msg.setImageResolution(Test.GENERAL_IMAGERESOLUTION);
- msg.setImageTypeSupported(Test.GENERAL_FILETYPE_LIST);
- msg.setName(Test.GENERAL_IMAGEFIELDNAME);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- ImageResolution imageRes = msg.getImageResolution();
- List<FileType> imageTypes = msg.getImageTypeSupported();
- ImageFieldName name = msg.getName();
-
- // Valid Tests
- assertTrue(Test.TRUE, Validator.validateImageResolution(Test.GENERAL_IMAGERESOLUTION, imageRes));
- assertEquals(Test.MATCH, Test.GENERAL_IMAGEFIELDNAME, name);
- assertTrue(Test.TRUE, Validator.validateFileTypes(Test.GENERAL_FILETYPE_LIST, imageTypes));
-
- // Invalid/Null Tests
- ImageField msg = new ImageField();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getImageResolution());
- assertNull(Test.NULL, msg.getImageTypeSupported());
- assertNull(Test.NULL, msg.getName());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(ImageField.KEY_IMAGE_RESOLUTION, Test.JSON_IMAGERESOLUTION);
- reference.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED, JsonUtils.createJsonArray(Test.GENERAL_FILETYPE_LIST));
- reference.put(ImageField.KEY_NAME, Test.GENERAL_IMAGEFIELDNAME);
-
- 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(ImageField.KEY_IMAGE_RESOLUTION)){
- JSONObject objectEquals = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject testEquals = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
- Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
- Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
- assertTrue(Test.TRUE, Validator.validateImageResolution( new ImageResolution(hashReference), new ImageResolution(hashTest)));
- } else if(key.equals(ImageField.KEY_IMAGE_TYPE_SUPPORTED)) {
- JSONArray imageTypeArrayReference = JsonUtils.readJsonArrayFromJsonObject(reference, key);
- JSONArray imageTypeArrayTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
- List<FileType> imageTypeListReference = new ArrayList<FileType>();
- List<FileType> imageTypeListTest = new ArrayList<FileType>();
-
- assertEquals(Test.MATCH, imageTypeArrayReference.length(), imageTypeArrayTest.length());
-
- for (int index = 0 ; index < imageTypeArrayReference.length(); index++) {
- imageTypeListReference.add( (FileType)imageTypeArrayReference.get(index) );
- imageTypeListTest.add( (FileType)imageTypeArrayTest.get(index) );
- }
- assertTrue(Test.TRUE, imageTypeListReference.containsAll(imageTypeListTest) && imageTypeListTest.containsAll(imageTypeListReference));
- } 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/ImageResolutionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java
deleted file mode 100644
index 83f3126cf..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.ImageResolution;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ImageResolution}
- */
-public class ImageResolutionTests extends TestCase{
-
- private ImageResolution msg;
-
- @Override
- public void setUp(){
- msg = new ImageResolution();
-
- msg.setResolutionHeight(Test.GENERAL_INT);
- msg.setResolutionWidth(Test.GENERAL_INT);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int height = msg.getResolutionHeight();
- int width = msg.getResolutionWidth();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, height);
- assertEquals(Test.MATCH, Test.GENERAL_INT, width);
-
- // Invalid/Null Tests
- ImageResolution msg = new ImageResolution();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getResolutionHeight());
- assertNull(Test.NULL, msg.getResolutionWidth());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(ImageResolution.KEY_RESOLUTION_HEIGHT, Test.GENERAL_INT);
- reference.put(ImageResolution.KEY_RESOLUTION_WIDTH, 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/ImageTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java
deleted file mode 100644
index 53f5bf435..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.Image}
- */
-public class ImageTests extends TestCase{
-
- private Image msg;
-
- @Override
- public void setUp(){
- msg = new Image();
-
- msg.setImageType(Test.GENERAL_IMAGETYPE);
- msg.setValue(Test.GENERAL_STRING);
- msg.setIsTemplate(Test.GENERAL_BOOLEAN);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- ImageType imageType = msg.getImageType();
- String value = msg.getValue();
- Boolean isTemplate = msg.getIsTemplate();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_IMAGETYPE, imageType);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, value);
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, isTemplate);
-
- // Invalid/Null Tests
- Image msg = new Image();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getImageType());
- assertNull(Test.NULL, msg.getValue());
- assertNull(Test.NULL, msg.getBulkData());
- assertNull(Test.NULL, msg.getIsTemplate());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(Image.KEY_IMAGE_TYPE, Test.GENERAL_IMAGETYPE);
- reference.put(Image.KEY_VALUE, Test.GENERAL_STRING);
- reference.put(Image.KEY_IS_TEMPLATE, 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/KeyboardPropertiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java
deleted file mode 100644
index 3eaf88e28..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.KeyboardProperties;
-import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
-import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.KeyboardProperties}
- */
-public class KeyboardPropertiesTests extends TestCase{
-
- private KeyboardProperties msg;
-
- @Override
- public void setUp(){
- msg = new KeyboardProperties();
-
- msg.setAutoCompleteText(Test.GENERAL_STRING);
- msg.setKeyboardLayout(Test.GENERAL_KEYBOARDLAYOUT);
- msg.setKeypressMode(Test.GENERAL_KEYPRESSMODE);
- msg.setLanguage(Test.GENERAL_LANGUAGE);
- msg.setLimitedCharacterList(Test.GENERAL_STRING_LIST);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String autoComplete = msg.getAutoCompleteText();
- KeyboardLayout keyboardLayout = msg.getKeyboardLayout();
- KeypressMode keypressMode = msg.getKeypressMode();
- Language language = msg.getLanguage();
- List<String> limitedChars = msg.getLimitedCharacterList();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, autoComplete);
- assertEquals(Test.MATCH, Test.GENERAL_KEYBOARDLAYOUT, keyboardLayout);
- assertEquals(Test.MATCH, Test.GENERAL_KEYPRESSMODE, keypressMode);
- assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, language);
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), limitedChars.size());
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, limitedChars));
-
- // Invalid/Null Tests
- KeyboardProperties msg = new KeyboardProperties();
- assertNotNull(Test.NOT_NULL, msg);
-
- // Keypress mode is created in the object constructor
- assertNotNull(Test.NOT_NULL, msg.getKeypressMode());
-
- assertNull(Test.NULL, msg.getAutoCompleteText());
- assertNull(Test.NULL, msg.getLanguage());
- assertNull(Test.NULL, msg.getKeyboardLayout());
- assertNull(Test.NULL, msg.getLimitedCharacterList());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(KeyboardProperties.KEY_AUTO_COMPLETE_TEXT, Test.GENERAL_STRING);
- reference.put(KeyboardProperties.KEY_KEYBOARD_LAYOUT, Test.GENERAL_KEYBOARDLAYOUT);
- reference.put(KeyboardProperties.KEY_KEYPRESS_MODE, Test.GENERAL_KEYPRESSMODE);
- reference.put(KeyboardProperties.KEY_LANGUAGE, Test.GENERAL_LANGUAGE);
- reference.put(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST, JsonUtils.createJsonArray(Test.GENERAL_STRING_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(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST)){
- assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
- } 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/MenuParamsTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java
deleted file mode 100644
index ea823f619..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.MenuParams;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.MenuParams}
- */
-public class MenuParamsTests extends TestCase{
-
- private MenuParams msg;
-
- @Override
- public void setUp(){
- msg = new MenuParams();
-
- msg.setMenuName(Test.GENERAL_STRING);
- msg.setParentID(Test.GENERAL_INT);
- msg.setPosition(Test.GENERAL_INT);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String menuName = msg.getMenuName();
- int parentId = msg.getParentID();
- int position = msg.getPosition();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, menuName);
- assertEquals(Test.MATCH, Test.GENERAL_INT, parentId);
- assertEquals(Test.MATCH, Test.GENERAL_INT, position);
-
- // Invalid/Null Tests
- MenuParams msg = new MenuParams();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getMenuName());
- assertNull(Test.NULL, msg.getParentID());
- assertNull(Test.NULL, msg.getPosition());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(MenuParams.KEY_MENU_NAME, Test.GENERAL_STRING);
- reference.put(MenuParams.KEY_PARENT_ID, Test.GENERAL_INT);
- reference.put(MenuParams.KEY_POSITION, 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/MyKeyTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java
deleted file mode 100644
index 48b0f33ab..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.MyKey;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.MyKey}
- */
-public class MyKeyTests extends TestCase{
-
- private MyKey msg;
-
- @Override
- public void setUp(){
- msg = new MyKey();
- msg.setE911Override(Test.GENERAL_VEHICLEDATASTATUS);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- VehicleDataStatus override = msg.getE911Override();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATASTATUS, override);
-
- // Invalid/Null Tests
- MyKey msg = new MyKey();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getE911Override());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(MyKey.KEY_E_911_OVERRIDE, Test.GENERAL_VEHICLEDATASTATUS);
-
- 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/ParameterPermissionsTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java
deleted file mode 100644
index a40f6a1b0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.ParameterPermissions;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ParameterPermissions}
- */
-public class ParameterPermissionsTests extends TestCase{
-
- private ParameterPermissions msg;
-
- @Override
- public void setUp(){
- msg = new ParameterPermissions();
-
- msg.setAllowed(Test.GENERAL_STRING_LIST);
- msg.setUserDisallowed(Test.GENERAL_STRING_LIST);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<String> allowed = msg.getAllowed();
- List<String> disallowed = msg.getUserDisallowed();
-
- // Valid Tests
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, allowed));
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, disallowed));
-
- // Invalid/Null Tests
- ParameterPermissions msg = new ParameterPermissions();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getAllowed());
- assertNull(Test.NULL, msg.getUserDisallowed());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(ParameterPermissions.KEY_ALLOWED, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- reference.put(ParameterPermissions.KEY_USER_DISALLOWED, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
-
- JSONObject underTest = msg.serializeJSON();
- assertEquals(Test.MATCH, reference.length(), underTest.length());
-
- Iterator<?> iterator = reference.keys();
- while(iterator.hasNext()){
- String key = (String) iterator.next();
- assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(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/PermissionItemTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java
deleted file mode 100644
index 465783ba2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.HMIPermissions;
-import com.smartdevicelink.proxy.rpc.ParameterPermissions;
-import com.smartdevicelink.proxy.rpc.PermissionItem;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.PermissionItem}
- */
-public class PermissionItemTest extends TestCase {
-
- private PermissionItem msg;
-
- @Override
- public void setUp() {
- msg = new PermissionItem();
-
- msg.setRpcName(Test.GENERAL_STRING);
- msg.setHMIPermissions(Test.GENERAL_HMIPERMISSIONS);
- msg.setParameterPermissions(Test.GENERAL_PARAMETERPERMISSIONS);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String rpcName = msg.getRpcName();
- HMIPermissions hmiPermissions = msg.getHMIPermissions();
- ParameterPermissions parameterPermissions = msg.getParameterPermissions();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, rpcName);
- assertTrue(Test.TRUE, Validator.validateHmiPermissions(Test.GENERAL_HMIPERMISSIONS, hmiPermissions));
- assertTrue(Test.TRUE, Validator.validateParameterPermissions(Test.GENERAL_PARAMETERPERMISSIONS, parameterPermissions));
-
- // Invalid/Null Tests
- PermissionItem msg = new PermissionItem();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getRpcName());
- assertNull(Test.NULL, msg.getHMIPermissions());
- assertNull(Test.NULL, msg.getParameterPermissions());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(PermissionItem.KEY_RPC_NAME, Test.GENERAL_STRING);
- reference.put(PermissionItem.KEY_HMI_PERMISSIONS, Test.JSON_HMIPERMISSIONS);
- reference.put(PermissionItem.KEY_PARAMETER_PERMISSIONS, Test.JSON_PARAMETERPERMISSIONS);
-
- 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(PermissionItem.KEY_HMI_PERMISSIONS)) {
- assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
- } else if (key.equals(PermissionItem.KEY_PARAMETER_PERMISSIONS)) {
- assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
- } 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/PresetBankCapabilitiesTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java
deleted file mode 100644
index f56d2a212..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.PresetBankCapabilities}
- */
-public class PresetBankCapabilitiesTest extends TestCase {
-
- private PresetBankCapabilities msg;
-
- @Override
- public void setUp() {
- msg = new PresetBankCapabilities();
-
- msg.setOnScreenPresetsAvailable(Test.GENERAL_BOOLEAN);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- boolean presets = msg.onScreenPresetsAvailable();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, presets);
-
- // Invalid/Null Tests
- PresetBankCapabilities msg = new PresetBankCapabilities();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.onScreenPresetsAvailable());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_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/ScreenParamsTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java
deleted file mode 100644
index 4621f8950..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.ImageResolution;
-import com.smartdevicelink.proxy.rpc.ScreenParams;
-import com.smartdevicelink.proxy.rpc.TouchEventCapabilities;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ScreenParams}
- */
-public class ScreenParamsTest extends TestCase {
-
- private ScreenParams msg;
-
- @Override
- public void setUp() {
- msg = new ScreenParams();
-
- msg.setImageResolution(Test.GENERAL_IMAGERESOLUTION);
- msg.setTouchEventAvailable(Test.GENERAL_TOUCHEVENTCAPABILITIES);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- ImageResolution imageRes = msg.getImageResolution();
- TouchEventCapabilities touchEvent = msg.getTouchEventAvailable();
-
- // Valid Tests
- assertTrue(Test.TRUE, Validator.validateImageResolution(Test.GENERAL_IMAGERESOLUTION, imageRes));
- assertTrue(Test.TRUE, Validator.validateTouchEventCapabilities(Test.GENERAL_TOUCHEVENTCAPABILITIES, touchEvent));
-
- // Invalid/Null Tests
- ScreenParams msg = new ScreenParams();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getImageResolution());
- assertNull(Test.NULL, msg.getTouchEventAvailable());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(ScreenParams.KEY_RESOLUTION, Test.JSON_IMAGERESOLUTION);
- reference.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE, Test.JSON_TOUCHEVENTCAPABILITIES);
-
- 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(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE)) {
- JSONObject touchEventObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject touchEventObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateTouchEventCapabilities(
- new TouchEventCapabilities(JsonRPCMarshaller.deserializeJSONObject(touchEventObjReference)),
- new TouchEventCapabilities(JsonRPCMarshaller.deserializeJSONObject(touchEventObjTest))));
- } else if (key.equals(ScreenParams.KEY_RESOLUTION)) {
- JSONObject resolutionObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject resolutionObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateImageResolution(
- new ImageResolution(JsonRPCMarshaller.deserializeJSONObject(resolutionObjReference)),
- new ImageResolution(JsonRPCMarshaller.deserializeJSONObject(resolutionObjTest))));
- } 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/SdlMsgVersionTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java
deleted file mode 100644
index 645652ea0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SdlMsgVersion}
- */
-public class SdlMsgVersionTest extends TestCase {
-
- private SdlMsgVersion msg;
-
- @Override
- public void setUp() {
- msg = new SdlMsgVersion();
-
- msg.setMajorVersion(Test.GENERAL_INT);
- msg.setMinorVersion(Test.GENERAL_INT);
- msg.setPatchVersion(Test.GENERAL_INT);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Integer major = msg.getMajorVersion();
- Integer minor = msg.getMinorVersion();
- Integer patch = msg.getPatchVersion();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, major);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, minor);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, patch);
-
- // Invalid/Null Tests
- SdlMsgVersion msg = new SdlMsgVersion();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getMajorVersion());
- assertNull(Test.NULL, msg.getMinorVersion());
- assertNull(Test.NULL, msg.getPatchVersion());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(SdlMsgVersion.KEY_MAJOR_VERSION, Test.GENERAL_INT);
- reference.put(SdlMsgVersion.KEY_MINOR_VERSION, Test.GENERAL_INT);
- reference.put(SdlMsgVersion.KEY_PATCH_VERSION, 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/SingleTireStatusTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java
deleted file mode 100644
index 9f1d3342a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.SingleTireStatus;
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-import com.smartdevicelink.proxy.rpc.enums.TPMS;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.SingleTireStatus}
- */
-public class SingleTireStatusTest extends TestCase {
-
- private SingleTireStatus msg;
-
- @Override
- public void setUp() {
- msg = new SingleTireStatus();
-
- msg.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
- msg.setTPMS(Test.GENERAL_TPMS);
- msg.setPressure(Test.GENERAL_FLOAT);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- ComponentVolumeStatus status = msg.getStatus();
- TPMS tpms = msg.getTPMS();
- Float pressure = msg.getPressure();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, status);
- assertEquals(Test.MATCH, Test.GENERAL_TPMS, tpms);
- assertEquals(Test.MATCH, Test.GENERAL_FLOAT, pressure);
-
- // Invalid/Null Tests
- SingleTireStatus msg = new SingleTireStatus();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getStatus());
- assertNull(Test.NULL, msg.getTPMS());
- assertNull(Test.NULL, msg.getPressure());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
- reference.put(SingleTireStatus.KEY_TPMS, Test.GENERAL_TPMS);
- reference.put(SingleTireStatus.KEY_PRESSURE, Test.GENERAL_FLOAT);
-
- 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/SoftButtonCapabilitiesTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java
deleted file mode 100644
index 125aa5e41..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SoftButtonCapabilities}
- */
-public class SoftButtonCapabilitiesTest extends TestCase {
-
- private SoftButtonCapabilities msg;
-
- @Override
- public void setUp() {
- msg = new SoftButtonCapabilities();
-
- msg.setImageSupported(Test.GENERAL_BOOLEAN);
- msg.setShortPressAvailable(Test.GENERAL_BOOLEAN);
- msg.setLongPressAvailable(Test.GENERAL_BOOLEAN);
- msg.setUpDownAvailable(Test.GENERAL_BOOLEAN);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Boolean imageSupp = msg.getImageSupported();
- Boolean updown = msg.getUpDownAvailable();
- Boolean longPress = msg.getLongPressAvailable();
- Boolean shortPress = msg.getShortPressAvailable();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, imageSupp);
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, updown);
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, longPress);
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, shortPress);
-
- // Invalid/Null Tests
- SoftButtonCapabilities msg = new SoftButtonCapabilities();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getImageSupported());
- assertNull(Test.NULL, msg.getLongPressAvailable());
- assertNull(Test.NULL, msg.getShortPressAvailable());
- assertNull(Test.NULL, msg.getUpDownAvailable());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED, Test.GENERAL_BOOLEAN);
- reference.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE, Test.GENERAL_BOOLEAN);
- reference.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN);
- reference.put(SoftButtonCapabilities.KEY_SHORT_PRESS_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/SoftButtonTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java
deleted file mode 100644
index b2dfb54fc..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
-import com.smartdevicelink.proxy.rpc.enums.SystemAction;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SoftButton}
- */
-public class SoftButtonTest extends TestCase {
-
- private SoftButton msg;
-
- @Override
- public void setUp() {
- msg = new SoftButton();
-
- msg.setType(Test.GENERAL_SOFTBUTTONTYPE);
- msg.setText(Test.GENERAL_STRING);
- msg.setSystemAction(Test.GENERAL_SYSTEMACTION);
- msg.setImage(Test.GENERAL_IMAGE);
- msg.setIsHighlighted(Test.GENERAL_BOOLEAN);
- msg.setSoftButtonID(Test.GENERAL_INT);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- SoftButtonType type = msg.getType();
- String text = msg.getText();
- SystemAction sysAction = msg.getSystemAction();
- Image image = msg.getImage();
- Boolean isHighlighted = msg.getIsHighlighted();
- Integer id = msg.getSoftButtonID();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONTYPE, type);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, text);
- assertEquals(Test.MATCH, Test.GENERAL_SYSTEMACTION, sysAction);
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image));
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, isHighlighted);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, id);
-
- // Invalid/Null Tests
- SoftButton msg = new SoftButton();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getSoftButtonID());
- assertNull(Test.NULL, msg.getImage());
- assertNull(Test.NULL, msg.getIsHighlighted());
- assertNull(Test.NULL, msg.getSystemAction());
- assertNull(Test.NULL, msg.getText());
- assertNull(Test.NULL, msg.getType());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(SoftButton.KEY_SOFT_BUTTON_ID, Test.GENERAL_INT);
- reference.put(SoftButton.KEY_TYPE, Test.GENERAL_SOFTBUTTONTYPE);
- reference.put(SoftButton.KEY_TEXT, Test.GENERAL_STRING);
- reference.put(SoftButton.KEY_IMAGE, Test.JSON_IMAGE);
- reference.put(SoftButton.KEY_SYSTEM_ACTION, Test.GENERAL_SYSTEMACTION);
- reference.put(SoftButton.KEY_IS_HIGHLIGHTED, 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();
-
- if(key.equals(SoftButton.KEY_IMAGE)){
- JSONObject referenceArray = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject underTestArray = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
- Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray);
- Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray);
- assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(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/StartTimeTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java
deleted file mode 100644
index f84ca3ec3..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.StartTime;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.StartTime}
- */
-public class StartTimeTest extends TestCase {
-
- private StartTime msg;
-
- @Override
- public void setUp() {
- msg = new StartTime();
-
- msg.setHours(Test.GENERAL_INT);
- msg.setMinutes(Test.GENERAL_INT);
- msg.setSeconds(Test.GENERAL_INT);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Integer hours = msg.getHours();
- Integer minutes = msg.getMinutes();
- Integer seconds = msg.getSeconds();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, hours);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, minutes);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, seconds);
-
- // Invalid/Null Tests
- StartTime msg = new StartTime();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getHours());
- assertNull(Test.NULL, msg.getMinutes());
- assertNull(Test.NULL, msg.getSeconds());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(StartTime.KEY_HOURS, Test.GENERAL_INT);
- reference.put(StartTime.KEY_MINUTES, Test.GENERAL_INT);
- reference.put(StartTime.KEY_SECONDS, 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/SystemCapabilityTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java
deleted file mode 100644
index aa0d75c07..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.NavigationCapability;
-import com.smartdevicelink.proxy.rpc.PhoneCapability;
-import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities;
-import com.smartdevicelink.proxy.rpc.SystemCapability;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-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.SystemCapability}
- */
-public class SystemCapabilityTests extends TestCase {
-
- private SystemCapability msg;
-
- @Override
- public void setUp() {
- msg = new SystemCapability();
-
- msg.setSystemCapabilityType(Test.GENERAL_SYSTEMCAPABILITYTYPE);
- msg.setCapabilityForType(SystemCapabilityType.NAVIGATION, Test.GENERAL_NAVIGATIONCAPABILITY);
- msg.setCapabilityForType(SystemCapabilityType.PHONE_CALL, Test.GENERAL_PHONECAPABILITY);
- msg.setCapabilityForType(SystemCapabilityType.REMOTE_CONTROL, Test.GENERAL_REMOTECONTROLCAPABILITIES);
-
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- SystemCapabilityType testType = msg.getSystemCapabilityType();
- NavigationCapability testNavigationCapability = (NavigationCapability) msg.getCapabilityForType(SystemCapabilityType.NAVIGATION);
- PhoneCapability testPhoneCapability = (PhoneCapability) msg.getCapabilityForType(SystemCapabilityType.PHONE_CALL);
- RemoteControlCapabilities testRemoteControlCapabilities = (RemoteControlCapabilities) msg.getCapabilityForType(SystemCapabilityType.REMOTE_CONTROL);
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITYTYPE, testType);
- assertTrue(Test.TRUE, Validator.validateNavigationCapability(Test.GENERAL_NAVIGATIONCAPABILITY, testNavigationCapability));
- assertTrue(Test.TRUE, Validator.validatePhoneCapability(Test.GENERAL_PHONECAPABILITY, testPhoneCapability));
- assertTrue(Test.TRUE, Validator.validateRemoteControlCapabilities(Test.GENERAL_REMOTECONTROLCAPABILITIES, testRemoteControlCapabilities));
-
- // Invalid/Null Tests
- SystemCapability msg = new SystemCapability();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getSystemCapabilityType());
- assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.NAVIGATION));
- assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.PHONE_CALL));
- assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.REMOTE_CONTROL));
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(SystemCapability.KEY_SYSTEM_CAPABILITY_TYPE, Test.GENERAL_SYSTEMCAPABILITYTYPE);
- reference.put(SystemCapability.KEY_NAVIGATION_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_NAVIGATIONCAPABILITY.getStore()));
- reference.put(SystemCapability.KEY_PHONE_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_PHONECAPABILITY.getStore()));
- reference.put(SystemCapability.KEY_REMOTE_CONTROL_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_REMOTECONTROLCAPABILITIES.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(SystemCapability.KEY_NAVIGATION_CAPABILITY)){
- 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.validateNavigationCapability( new NavigationCapability(hashReference), new NavigationCapability(hashTest)));
- } else if(key.equals(SystemCapability.KEY_PHONE_CAPABILITY)){
- 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.validatePhoneCapability( new PhoneCapability(hashReference), new PhoneCapability(hashTest)));
- } else if(key.equals(SystemCapability.KEY_REMOTE_CONTROL_CAPABILITY)){
- 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.validateRemoteControlCapabilities( new RemoteControlCapabilities(hashReference), new RemoteControlCapabilities(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/TTSChunkTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java
deleted file mode 100644
index 598993771..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-public class TTSChunkTest extends TestCase {
-
- private TTSChunk msg;
-
- @Override
- public void setUp() {
- msg = new TTSChunk();
-
- msg.setText(Test.GENERAL_STRING);
- msg.setType(Test.GENERAL_SPEECHCAPABILITIES);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String text = msg.getText();
- SpeechCapabilities speechType = msg.getType();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, text);
- assertEquals(Test.MATCH, Test.GENERAL_SPEECHCAPABILITIES, speechType);
-
- // Invalid/Null Tests
- TTSChunk msg = new TTSChunk();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getText());
- assertNull(Test.NULL, msg.getType());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(TTSChunk.KEY_TEXT, Test.GENERAL_STRING);
- reference.put(TTSChunk.KEY_TYPE, Test.GENERAL_SPEECHCAPABILITIES);
-
- 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/TemplateColorSchemeTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java
deleted file mode 100644
index 0ac90fc86..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.RGBColor;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
-import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
-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.Iterator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.TemplateColorScheme}
- */
-public class TemplateColorSchemeTest extends TestCase {
-
- private TemplateColorScheme msg;
-
- @Override
- public void setUp() {
- msg = new TemplateColorScheme();
- msg.setPrimaryColor(Test.GENERAL_RGBCOLOR);
- msg.setSecondaryColor(Test.GENERAL_RGBCOLOR);
- msg.setBackgroundColor(Test.GENERAL_RGBCOLOR);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- RGBColor primaryColor = msg.getPrimaryColor();
- RGBColor secondaryColor = msg.getSecondaryColor();
- RGBColor backgroundColor = msg.getBackgroundColor();
-
- // Valid Tests
- assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, primaryColor));
- assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, secondaryColor));
- assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, backgroundColor));
-
- // Invalid/Null Tests
- TemplateColorScheme msg = new TemplateColorScheme();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getPrimaryColor());
- assertNull(Test.NULL, msg.getSecondaryColor());
- assertNull(Test.NULL, msg.getBackgroundColor());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(TemplateColorScheme.KEY_PRIMARY_COLOR, Test.JSON_RGBCOLOR);
- reference.put(TemplateColorScheme.KEY_SECONDARY_COLOR, Test.JSON_RGBCOLOR);
- reference.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, Test.JSON_RGBCOLOR);
-
- JSONObject underTest = msg.serializeJSON();
- assertEquals(Test.MATCH, reference.length(), underTest.length());
-
- Iterator<?> iterator = reference.keys();
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
- JSONObject referenceColorObj = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- RGBColor referenceColor = new RGBColor(JsonRPCMarshaller.deserializeJSONObject(referenceColorObj));
- JSONObject underTestColorObj = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
- RGBColor underTestColor = new RGBColor(JsonRPCMarshaller.deserializeJSONObject(underTestColorObj));
- assertTrue(Test.TRUE, Validator.validateRGBColor(referenceColor, underTestColor));
- }
- } 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/TextFieldTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java
deleted file mode 100644
index 6b5d4d3e2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.TextField;
-import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
-import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.TextField}
- */
-public class TextFieldTest extends TestCase {
-
- private TextField msg;
-
- @Override
- public void setUp() {
- msg = new TextField();
-
- msg.setName(Test.GENERAL_TEXTFIELDNAME);
- msg.setCharacterSet(Test.GENERAL_CHARACTERSET);
- msg.setWidth(Test.GENERAL_INT);
- msg.setRows(Test.GENERAL_INT);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- TextFieldName name = msg.getName();
- CharacterSet charSet = msg.getCharacterSet();
- Integer width = msg.getWidth();
- Integer rows = msg.getRows();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_TEXTFIELDNAME, name);
- assertEquals(Test.MATCH, Test.GENERAL_CHARACTERSET, charSet);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, width);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, rows);
-
- // Invalid/Null Tests
- TextField msg = new TextField();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getName());
- assertNull(Test.NULL, msg.getWidth());
- assertNull(Test.NULL, msg.getRows());
- assertNull(Test.NULL, msg.getCharacterSet());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(TextField.KEY_CHARACTER_SET, Test.GENERAL_CHARACTERSET);
- reference.put(TextField.KEY_WIDTH, Test.GENERAL_INT);
- reference.put(TextField.KEY_ROWS, Test.GENERAL_INT);
- reference.put(TextField.KEY_NAME, Test.GENERAL_TEXTFIELDNAME);
-
- 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/TireStatusTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java
deleted file mode 100644
index 5552a5c29..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.SingleTireStatus;
-import com.smartdevicelink.proxy.rpc.TireStatus;
-import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.TireStatus}
- */
-public class TireStatusTest extends TestCase {
-
- private TireStatus msg;
-
- @Override
- public void setUp() {
- msg = new TireStatus();
- msg.setPressureTellTale(Test.GENERAL_WARNINGLIGHTSTATUS);
- SingleTireStatus tireLeftFront = new SingleTireStatus();
- tireLeftFront.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
- msg.setLeftFront(tireLeftFront);
- SingleTireStatus tireRightFront = new SingleTireStatus();
- tireRightFront.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
- msg.setRightFront(tireRightFront);
- SingleTireStatus tireLeftRear = new SingleTireStatus();
- tireLeftRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
- msg.setLeftRear(tireLeftRear);
- SingleTireStatus tireRightRear = new SingleTireStatus();
- tireRightRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
- msg.setRightRear(tireRightRear);
- SingleTireStatus tireInnerLeftRear = new SingleTireStatus();
- tireInnerLeftRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
- msg.setInnerLeftRear(tireInnerLeftRear);
- SingleTireStatus tireInnerRightRear = new SingleTireStatus();
- tireInnerRightRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS);
- msg.setInnerRightRear(tireInnerRightRear);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- WarningLightStatus pressure = msg.getPressureTellTale();
- SingleTireStatus leftFront = msg.getLeftFront();
- SingleTireStatus rightFront = msg.getRightFront();
- SingleTireStatus leftRear = msg.getLeftRear();
- SingleTireStatus rightRear = msg.getRightRear();
- SingleTireStatus innerLeftRear = msg.getInnerLeftRear();
- SingleTireStatus innerRightRear = msg.getInnerRightRear();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_WARNINGLIGHTSTATUS, pressure);
- assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, leftFront.getStatus());
- assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, rightFront.getStatus());
- assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, leftRear.getStatus());
- assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, rightRear.getStatus());
- assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, innerLeftRear.getStatus());
- assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, innerRightRear.getStatus());
-
- // Invalid/Null Tests
- TireStatus msg = new TireStatus();
- assertNotNull(Test.NOT_NULL, msg);
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(TireStatus.KEY_PRESSURE_TELL_TALE, Test.GENERAL_WARNINGLIGHTSTATUS);
- JSONObject tireLeftFront = new JSONObject();
- tireLeftFront.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
- reference.put(TireStatus.KEY_LEFT_FRONT, tireLeftFront);
- JSONObject tireRightFront = new JSONObject();
- tireRightFront.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
- reference.put(TireStatus.KEY_RIGHT_FRONT, tireRightFront);
- JSONObject tireLeftRear = new JSONObject();
- tireLeftRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
- reference.put(TireStatus.KEY_LEFT_REAR, tireLeftRear);
- JSONObject tireRightRear = new JSONObject();
- tireRightRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
- reference.put(TireStatus.KEY_RIGHT_REAR, tireRightRear);
- JSONObject tireInnerLeftRear = new JSONObject();
- tireInnerLeftRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
- reference.put(TireStatus.KEY_INNER_LEFT_REAR, tireInnerLeftRear);
- JSONObject tireInnerRightRear = new JSONObject();
- tireInnerRightRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS);
- reference.put(TireStatus.KEY_INNER_RIGHT_REAR, tireInnerRightRear);
-
- JSONObject underTest = msg.serializeJSON();
- assertEquals(Test.MATCH, reference.length(), underTest.length());
-
- assertTrue(Test.TRUE, Validator.validateTireStatus(
- new TireStatus(JsonRPCMarshaller.deserializeJSONObject(reference)),
- new TireStatus(JsonRPCMarshaller.deserializeJSONObject(underTest))));
- } 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/TouchCoordTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java
deleted file mode 100644
index cfa4a4f33..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.TouchCoord;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.TouchCoord}
- */
-public class TouchCoordTest extends TestCase {
-
- private TouchCoord msg;
-
- @Override
- public void setUp() {
- msg = new TouchCoord();
-
- msg.setX(Test.GENERAL_INT);
- msg.setY(Test.GENERAL_INT);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Integer x = msg.getX();
- Integer y = msg.getY();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, x);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, y);
-
- // Invalid/Null Tests
- TouchCoord msg = new TouchCoord();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getX());
- assertNull(Test.NULL, msg.getY());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(TouchCoord.KEY_X, Test.GENERAL_INT);
- reference.put(TouchCoord.KEY_Y, 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/TouchEventCapabilitiesTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java
deleted file mode 100644
index b488d4cb7..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.TouchEventCapabilities;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.TouchEventCapabilties}
- */
-public class TouchEventCapabilitiesTest extends TestCase {
-
- private TouchEventCapabilities msg;
-
- @Override
- public void setUp() {
- msg = new TouchEventCapabilities();
-
- msg.setPressAvailable(Test.GENERAL_BOOLEAN);
- msg.setDoublePressAvailable(Test.GENERAL_BOOLEAN);
- msg.setMultiTouchAvailable(Test.GENERAL_BOOLEAN);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Boolean press = msg.getPressAvailable();
- Boolean multiTouch = msg.getMultiTouchAvailable();
- Boolean doublePress = msg.getDoublePressAvailable();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, press);
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, multiTouch);
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, doublePress);
-
- // Invalid/Null Tests
- TouchEventCapabilities msg = new TouchEventCapabilities();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getPressAvailable());
- assertNull(Test.NULL, msg.getMultiTouchAvailable());
- assertNull(Test.NULL, msg.getDoublePressAvailable());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN);
- reference.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, Test.GENERAL_BOOLEAN);
- reference.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_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/TouchEventTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java
deleted file mode 100644
index e3207f704..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.TouchCoord;
-import com.smartdevicelink.proxy.rpc.TouchEvent;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.TouchEvent}
- */
-public class TouchEventTest extends TestCase {
-
- private TouchEvent msg;
-
- @Override
- public void setUp() {
- msg = new TouchEvent();
- msg.setId(Test.GENERAL_INT);
- msg.setTs(Test.GENERAL_LONG_LIST);
- msg.setC(Test.GENERAL_TOUCHCOORD_LIST);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Integer id = msg.getId();
- List<Long> timestamp = msg.getTs();
- List<TouchCoord> coordTest = msg.getC();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, id);
- assertTrue(Test.TRUE, Validator.validateLongList(Test.GENERAL_LONG_LIST, timestamp));
- assertEquals(Test.MATCH, Test.GENERAL_TOUCHCOORD_LIST.size(), coordTest.size());
-
- for (int index = 0; index < Test.GENERAL_TOUCHCOORD_LIST.size(); index++) {
- assertTrue(Test.TRUE, Validator.validateTouchCoord(Test.GENERAL_TOUCHCOORD_LIST.get(index), coordTest.get(index)));
- }
-
- // Invalid/Null Tests
- TouchEvent msg = new TouchEvent();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getId());
- assertNull(Test.NULL, msg.getTs());
- assertNull(Test.NULL, msg.getC());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(TouchEvent.KEY_ID, Test.GENERAL_INT);
- reference.put(TouchEvent.KEY_TS, JsonUtils.createJsonArray(Test.GENERAL_LONG_LIST));
- reference.put(TouchEvent.KEY_C, Test.JSON_TOUCHCOORDS);
-
- 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(TouchEvent.KEY_C)) {
- assertTrue(Test.TRUE, JsonUtils.readIntegerFromJsonObject(reference, key) == JsonUtils.readIntegerFromJsonObject(underTest, key));
- } else if (key.equals(TouchEvent.KEY_TS)) {
- List<Long> tsListReference = JsonUtils.readLongListFromJsonObject(reference, key);
- List<Long> tsListTest = JsonUtils.readLongListFromJsonObject(underTest, key);
- assertTrue(Test.TRUE, tsListReference.containsAll(tsListTest) && tsListTest.containsAll(tsListReference));
- } 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/TurnTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java
deleted file mode 100644
index 8986fd4a9..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.Turn;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-public class TurnTests extends TestCase {
-
- private Turn msg;
-
- @Override
- public void setUp(){
- msg = new Turn();
- assertNotNull(Test.NOT_NULL, msg);
-
- msg.setTurnIcon(Test.GENERAL_IMAGE);
- msg.setNavigationText(Test.GENERAL_STRING);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Image icon = msg.getTurnIcon();
- String text = msg.getNavigationText();
-
- // Valid Tests
- assertTrue(Test.MATCH, Validator.validateImage(Test.GENERAL_IMAGE, icon));
- assertEquals(Test.MATCH, Test.GENERAL_STRING, text);
-
- // Invalid/Null Tests
- Turn msg = new Turn();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getNavigationText());
- assertNull(Test.NULL, msg.getTurnIcon());
- }
-
- public void testJson(){
- JSONObject reference = new JSONObject();
-
- try{
- reference.put(Turn.KEY_NAVIGATION_TEXT, Test.GENERAL_STRING);
- reference.put(Turn.KEY_TURN_IMAGE, Test.JSON_IMAGE);
- } 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/VehicleDataResultTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java
deleted file mode 100644
index 8d5d1e861..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.VehicleDataResult;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-public class VehicleDataResultTest extends TestCase {
-
- private VehicleDataResult msg;
-
- @Override
- public void setUp() {
- msg = new VehicleDataResult();
-
- msg.setDataType(Test.GENERAL_VEHICLEDATATYPE);
- msg.setResultCode(Test.GENERAL_VEHICLEDATARESULTCODE);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- VehicleDataResultCode result = msg.getResultCode();
- VehicleDataType type = msg.getDataType();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATARESULTCODE, result);
- assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATATYPE, type);
-
- // Invalid/Null Tests
- VehicleDataResult msg = new VehicleDataResult();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getDataType());
- assertNull(Test.NULL, msg.getResultCode());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(VehicleDataResult.KEY_RESULT_CODE, Test.GENERAL_VEHICLEDATARESULTCODE);
- reference.put(VehicleDataResult.KEY_DATA_TYPE, Test.GENERAL_VEHICLEDATATYPE);
-
- 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/VehicleTypeTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java
deleted file mode 100644
index 17f663ae6..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.rpc.VehicleType;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-
-public class VehicleTypeTest extends TestCase {
-
- private VehicleType msg;
-
- @Override
- public void setUp() {
- msg = new VehicleType();
-
- msg.setModel(Test.GENERAL_STRING);
- msg.setMake(Test.GENERAL_STRING);
- msg.setTrim(Test.GENERAL_STRING);
- msg.setModelYear(Test.GENERAL_STRING);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String year = msg.getModelYear();
- String trim = msg.getTrim();
- String make = msg.getMake();
- String model = msg.getModel();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, year);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, model);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, make);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, trim);
-
- // Invalid/Null Tests
- VehicleType msg = new VehicleType();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getModel());
- assertNull(Test.NULL, msg.getMake());
- assertNull(Test.NULL, msg.getModelYear());
- assertNull(Test.NULL, msg.getTrim());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(VehicleType.KEY_MODEL, Test.GENERAL_STRING);
- reference.put(VehicleType.KEY_MAKE, Test.GENERAL_STRING);
- reference.put(VehicleType.KEY_MODEL_YEAR, Test.GENERAL_STRING);
- reference.put(VehicleType.KEY_TRIM, 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();
- 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/VideoStreamingFormatTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java
deleted file mode 100644
index ff7cb2719..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import com.smartdevicelink.proxy.rpc.ImageResolution;
-import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
-import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-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;
-
-public class VideoStreamingFormatTests extends TestCase {
-
- private VideoStreamingFormat msg;
-
- @Override
- public void setUp() {
- msg = new VideoStreamingFormat();
- msg.setProtocol(Test.GENERAL_VIDEOSTREAMINGPROTOCOL);
- msg.setCodec(Test.GENERAL_VIDEOSTREAMINGCODEC);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- VideoStreamingProtocol protocol = msg.getProtocol();
- VideoStreamingCodec codec = msg.getCodec();
-
- // Valid Tests
- assertEquals(Test.MATCH, (VideoStreamingProtocol) Test.GENERAL_VIDEOSTREAMINGPROTOCOL, protocol);
- assertEquals(Test.MATCH, (VideoStreamingCodec) Test.GENERAL_VIDEOSTREAMINGCODEC, codec);
-
- // Invalid/Null Tests
- VideoStreamingFormat msg = new VideoStreamingFormat();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getProtocol());
- assertNull(Test.NULL, msg.getCodec());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(VideoStreamingFormat.KEY_PROTOCOL, Test.GENERAL_VIDEOSTREAMINGPROTOCOL);
- reference.put(VideoStreamingFormat.KEY_CODEC, Test.GENERAL_VIDEOSTREAMINGCODEC);
-
- 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);
- }
- }
-}
-
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java
deleted file mode 100644
index 55f00dd1c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.smartdevicelink.test.rpc.datatypes;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.VrHelpItem;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-public class VrHelpItemTest extends TestCase {
-
- private VrHelpItem msg;
-
- @Override
- public void setUp() {
- msg = new VrHelpItem();
-
- msg.setText(Test.GENERAL_STRING);
- msg.setImage(Test.GENERAL_IMAGE);
- msg.setPosition(Test.GENERAL_INT);
-
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String text = msg.getText();
- Image image = msg.getImage();
- Integer position = msg.getPosition();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, text);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, position);
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image));
-
- // Invalid/Null Tests
- VrHelpItem msg = new VrHelpItem();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getImage());
- assertNull(Test.NULL, msg.getText());
- assertNull(Test.NULL, msg.getPosition());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- try {
- reference.put(VrHelpItem.KEY_IMAGE, Test.JSON_IMAGE);
- reference.put(VrHelpItem.KEY_TEXT, Test.GENERAL_STRING);
- reference.put(VrHelpItem.KEY_POSITION, 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();
-
- if(key.equals(VrHelpItem.KEY_IMAGE)){
- JSONObject objectEquals = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject testEquals = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
- Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
- Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
-
- assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(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/enums/AmbientLightStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AmbientLightStatusTests.java
deleted file mode 100644
index 859eafba0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AmbientLightStatusTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.AmbientLightStatus}
- */
-public class AmbientLightStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
-
- String example = "DAY";
- AmbientLightStatus enumDay = AmbientLightStatus.valueForString(example);
- example = "NIGHT";
- AmbientLightStatus enumNight = AmbientLightStatus.valueForString(example);
- example = "UNKNOWN";
- AmbientLightStatus enumUnknown = AmbientLightStatus.valueForString(example);
- example = "INVALID";
- AmbientLightStatus enumInvalid = AmbientLightStatus.valueForString(example);
- example = "TWILIGHT_1";
- AmbientLightStatus enumTwilight1 = AmbientLightStatus.valueForString(example);
- example = "TWILIGHT_2";
- AmbientLightStatus enumTwilight2 = AmbientLightStatus.valueForString(example);
- example = "TWILIGHT_3";
- AmbientLightStatus enumTwilight3 = AmbientLightStatus.valueForString(example);
- example = "TWILIGHT_4";
- AmbientLightStatus enumTwilight4 = AmbientLightStatus.valueForString(example);
-
- assertNotNull("DAY returned null", enumDay);
- assertNotNull("NIGHT returned null", enumNight);
- assertNotNull("UNKNOWN returned null", enumUnknown);
- assertNotNull("INVALID returned null", enumInvalid);
- assertNotNull("TWILIGHT_1 returned null", enumTwilight1);
- assertNotNull("TWILIGHT_2 returned null", enumTwilight2);
- assertNotNull("TWILIGHT_3 returned null", enumTwilight3);
- assertNotNull("TWILIGHT_4 returned null", enumTwilight4);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "niGHt";
- try {
- AmbientLightStatus temp = AmbientLightStatus.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 {
- AmbientLightStatus temp = AmbientLightStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of AmbientLightStatus.
- */
- public void testListEnum() {
- List<AmbientLightStatus> enumValueList = Arrays.asList(AmbientLightStatus.values());
- List<AmbientLightStatus> enumTestList = new ArrayList<AmbientLightStatus>();
-
- enumTestList.add(AmbientLightStatus.DAY);
- enumTestList.add(AmbientLightStatus.NIGHT);
- enumTestList.add(AmbientLightStatus.UNKNOWN);
- enumTestList.add(AmbientLightStatus.INVALID);
- enumTestList.add(AmbientLightStatus.TWILIGHT_1);
- enumTestList.add(AmbientLightStatus.TWILIGHT_2);
- enumTestList.add(AmbientLightStatus.TWILIGHT_3);
- enumTestList.add(AmbientLightStatus.TWILIGHT_4);
-
- 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/AppHmiTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java
deleted file mode 100644
index 6446cb914..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppHmiTypeTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.enums.AppHMIType}
- */
-public class AppHmiTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "DEFAULT";
- AppHMIType enumDefault = AppHMIType.valueForString(example);
- example = "COMMUNICATION";
- AppHMIType enumCommunication = AppHMIType.valueForString(example);
- example = "MEDIA";
- AppHMIType enumMedia = AppHMIType.valueForString(example);
- example = "MESSAGING";
- AppHMIType enumMessaging = AppHMIType.valueForString(example);
- example = "NAVIGATION";
- AppHMIType enumNavigation = AppHMIType.valueForString(example);
- example = "INFORMATION";
- AppHMIType enumInformation = AppHMIType.valueForString(example);
- example = "SOCIAL";
- AppHMIType enumSocial = AppHMIType.valueForString(example);
- example = "BACKGROUND_PROCESS";
- AppHMIType enumBackgroundProcess = AppHMIType.valueForString(example);
- example = "PROJECTION";
- AppHMIType enumProjection = AppHMIType.valueForString(example);
- example = "TESTING";
- AppHMIType enumTesting = AppHMIType.valueForString(example);
- example = "SYSTEM";
- AppHMIType enumSystem = AppHMIType.valueForString(example);
- example = "REMOTE_CONTROL";
- AppHMIType enumRemoteControl = AppHMIType.valueForString(example);
-
- assertNotNull("DEFAULT returned null", enumDefault);
- assertNotNull("COMMUNICATION returned null", enumCommunication);
- assertNotNull("MEDIA returned null", enumMedia);
- assertNotNull("MESSAGING returned null", enumMessaging);
- assertNotNull("NAVIGATION returned null", enumNavigation);
- assertNotNull("INFORMATION returned null", enumInformation);
- assertNotNull("SOCIAL returned null", enumSocial);
- assertNotNull("BACKGROUND_PROCESS returned null", enumBackgroundProcess);
- assertNotNull("PROJECTION returned null", enumProjection);
- assertNotNull("TESTING returned null", enumTesting);
- assertNotNull("SYSTEM returned null", enumSystem);
- assertNotNull("REMOTE_CONTROL returned null", enumRemoteControl);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "deFaUlt";
- try {
- AppHMIType temp = AppHMIType.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 {
- AppHMIType temp = AppHMIType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of AmbientLightStatus.
- */
- public void testListEnum() {
- List<AppHMIType> enumValueList = Arrays.asList(AppHMIType.values());
-
- List<AppHMIType> enumTestList = new ArrayList<AppHMIType>();
- enumTestList.add(AppHMIType.DEFAULT);
- enumTestList.add(AppHMIType.COMMUNICATION);
- enumTestList.add(AppHMIType.MEDIA);
- enumTestList.add(AppHMIType.MESSAGING);
- enumTestList.add(AppHMIType.NAVIGATION);
- enumTestList.add(AppHMIType.INFORMATION);
- enumTestList.add(AppHMIType.SOCIAL);
- enumTestList.add(AppHMIType.BACKGROUND_PROCESS);
- enumTestList.add(AppHMIType.PROJECTION);
- enumTestList.add(AppHMIType.TESTING);
- enumTestList.add(AppHMIType.SYSTEM);
- enumTestList.add(AppHMIType.REMOTE_CONTROL);
-
- 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/AppInterfaceUnregisteredReasonTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java
deleted file mode 100644
index 8896d13e7..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AppInterfaceUnregisteredReasonTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.AppInterfaceUregisteredReason}
- */
-public class AppInterfaceUnregisteredReasonTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "USER_EXIT";
- AppInterfaceUnregisteredReason enumUserExit = AppInterfaceUnregisteredReason.valueForString(example);
- example = "IGNITION_OFF";
- AppInterfaceUnregisteredReason enumIgnitionOff = AppInterfaceUnregisteredReason.valueForString(example);
- example = "BLUETOOTH_OFF";
- AppInterfaceUnregisteredReason enumBluetoothOff = AppInterfaceUnregisteredReason.valueForString(example);
- example = "USB_DISCONNECTED";
- AppInterfaceUnregisteredReason enumUsbDisconnected = AppInterfaceUnregisteredReason.valueForString(example);
- example = "REQUEST_WHILE_IN_NONE_HMI_LEVEL";
- AppInterfaceUnregisteredReason enumRequestWhileInNoneHmiLevel = AppInterfaceUnregisteredReason.valueForString(example);
- example = "TOO_MANY_REQUESTS";
- AppInterfaceUnregisteredReason enumTooManyRequests = AppInterfaceUnregisteredReason.valueForString(example);
- example = "DRIVER_DISTRACTION_VIOLATION";
- AppInterfaceUnregisteredReason enumDriverDistractionViolation = AppInterfaceUnregisteredReason.valueForString(example);
- example = "LANGUAGE_CHANGE";
- AppInterfaceUnregisteredReason enumLanguageChange = AppInterfaceUnregisteredReason.valueForString(example);
- example = "MASTER_RESET";
- AppInterfaceUnregisteredReason enumMasterReset = AppInterfaceUnregisteredReason.valueForString(example);
- example = "FACTORY_DEFAULTS";
- AppInterfaceUnregisteredReason enumFactoryDefaults = AppInterfaceUnregisteredReason.valueForString(example);
- example = "APP_UNAUTHORIZED";
- AppInterfaceUnregisteredReason enumAppAuthorized = AppInterfaceUnregisteredReason.valueForString(example);
- example = "PROTOCOL_VIOLATION";
- AppInterfaceUnregisteredReason enumProtocolViolation = AppInterfaceUnregisteredReason.valueForString(example);
-
- assertNotNull("USER_EXIT returned null", enumUserExit);
- assertNotNull("IGNITION_OFF returned null", enumIgnitionOff);
- assertNotNull("BLUETOOTH_OFF returned null", enumBluetoothOff);
- assertNotNull("USB_DISCONNECTED returned null", enumUsbDisconnected);
- assertNotNull("REQUEST_WHILE_IN_NONE_HMI_LEVEL returned null", enumRequestWhileInNoneHmiLevel);
- assertNotNull("TOO_MANY_REQUESTS returned null", enumTooManyRequests);
- assertNotNull("DRIVER_DISTRACTION_VIOLATION returned null", enumDriverDistractionViolation);
- assertNotNull("LANGUAGE_CHANGE returned null", enumLanguageChange);
- assertNotNull("MASTER_RESET returned null", enumMasterReset);
- assertNotNull("FACTORY_DEFAULTS returned null", enumFactoryDefaults);
- assertNotNull("APP_UNAUTHORIZED returned null", enumAppAuthorized);
- assertNotNull("PROTOCOL_VIOLATION returned null", enumProtocolViolation);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "uSer_ExiT";
- try {
- AppInterfaceUnregisteredReason temp = AppInterfaceUnregisteredReason.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 {
- AppInterfaceUnregisteredReason temp = AppInterfaceUnregisteredReason.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of AppInterfaceUnregisteredReason.
- */
- public void testListEnum() {
- List<AppInterfaceUnregisteredReason> enumValueList = Arrays.asList(AppInterfaceUnregisteredReason.values());
-
- List<AppInterfaceUnregisteredReason> enumTestList = new ArrayList<AppInterfaceUnregisteredReason>();
- enumTestList.add(AppInterfaceUnregisteredReason.USER_EXIT);
- enumTestList.add(AppInterfaceUnregisteredReason.IGNITION_OFF);
- enumTestList.add(AppInterfaceUnregisteredReason.BLUETOOTH_OFF);
- enumTestList.add(AppInterfaceUnregisteredReason.USB_DISCONNECTED);
- enumTestList.add(AppInterfaceUnregisteredReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL);
- enumTestList.add(AppInterfaceUnregisteredReason.TOO_MANY_REQUESTS);
- enumTestList.add(AppInterfaceUnregisteredReason.DRIVER_DISTRACTION_VIOLATION);
- enumTestList.add(AppInterfaceUnregisteredReason.LANGUAGE_CHANGE);
- enumTestList.add(AppInterfaceUnregisteredReason.MASTER_RESET);
- enumTestList.add(AppInterfaceUnregisteredReason.FACTORY_DEFAULTS);
- enumTestList.add(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED);
- enumTestList.add(AppInterfaceUnregisteredReason.PROTOCOL_VIOLATION);
-
- 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/AudioStreamingIndicatorTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingIndicatorTests.java
deleted file mode 100644
index 85312ecde..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingIndicatorTests.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator}
- */
-public class AudioStreamingIndicatorTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "PLAY_PAUSE";
- AudioStreamingIndicator enumPlayPause = AudioStreamingIndicator.valueForString(example);
- example = "PLAY";
- AudioStreamingIndicator enumPlay = AudioStreamingIndicator.valueForString(example);
- example = "PAUSE";
- AudioStreamingIndicator enumPause = AudioStreamingIndicator.valueForString(example);
- example = "STOP";
- AudioStreamingIndicator enumStop = AudioStreamingIndicator.valueForString(example);
-
-
- assertNotNull("PLAY_PAUSE returned null", enumPlayPause);
- assertNotNull("PLAY returned null", enumPlay);
- assertNotNull("PAUSE returned null", enumPause);
- assertNotNull("STOP returned null", enumStop);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "pLayPauZe";
- try {
- AudioStreamingIndicator temp = AudioStreamingIndicator.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 {
- AudioStreamingIndicator temp = AudioStreamingIndicator.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of AudioStreamingIndicator.
- */
- public void testListEnum() {
- List<AudioStreamingIndicator> enumValueList = Arrays.asList(AudioStreamingIndicator.values());
-
- List<AudioStreamingIndicator> enumTestList = new ArrayList<>();
- enumTestList.add(AudioStreamingIndicator.PLAY_PAUSE);
- enumTestList.add(AudioStreamingIndicator.PLAY);
- enumTestList.add(AudioStreamingIndicator.PAUSE);
- enumTestList.add(AudioStreamingIndicator.STOP);
-
- 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/AudioStreamingStateTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingStateTests.java
deleted file mode 100644
index 178613e53..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioStreamingStateTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.enums.AudioStreamingState}
- */
-public class AudioStreamingStateTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "AUDIBLE";
- AudioStreamingState enumAudible = AudioStreamingState.valueForString(example);
- example = "ATTENUATED";
- AudioStreamingState enumAttentuated = AudioStreamingState.valueForString(example);
- example = "NOT_AUDIBLE";
- AudioStreamingState enumNotAudible = AudioStreamingState.valueForString(example);
-
-
- assertNotNull("AUDIBLE returned null", enumAudible);
- assertNotNull("ATTENUATED returned null", enumAttentuated);
- assertNotNull("NOT_AUDIBLE returned null", enumNotAudible);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "aUDibLE";
- try {
- AudioStreamingState temp = AudioStreamingState.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 {
- AudioStreamingState temp = AudioStreamingState.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of AudioStreamingState.
- */
- public void testListEnum() {
- List<AudioStreamingState> enumValueList = Arrays.asList(AudioStreamingState.values());
-
- List<AudioStreamingState> enumTestList = new ArrayList<AudioStreamingState>();
- enumTestList.add(AudioStreamingState.AUDIBLE);
- enumTestList.add(AudioStreamingState.ATTENUATED);
- enumTestList.add(AudioStreamingState.NOT_AUDIBLE);
-
- 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/AudioTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioTypeTests.java
deleted file mode 100644
index 6cbecf09a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioTypeTests.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.AudioType}
- */
-public class AudioTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "PCM";
- AudioType enumPcm = AudioType.valueForString(example);
-
- assertNotNull("PCM returned null", enumPcm);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "pCM";
- try {
- AudioType temp = AudioType.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 {
- AudioType temp = AudioType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
-
- /**
- * Verifies the possible enum values of AudioType.
- */
- public void testListEnum() {
- List<AudioType> enumValueList = Arrays.asList(AudioType.values());
-
- List<AudioType> enumTestList = new ArrayList<AudioType>();
- enumTestList.add(AudioType.PCM);
-
- 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/BitsPerSampleTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/BitsPerSampleTests.java
deleted file mode 100644
index 65b4766e8..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/BitsPerSampleTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.BitsPerSample}
- */
-public class BitsPerSampleTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "8_BIT";
- BitsPerSample enum8Bit = BitsPerSample.valueForString(example);
- example = "16_BIT";
- BitsPerSample enum16Bit = BitsPerSample.valueForString(example);
-
- assertNotNull("8_BIT returned null", enum8Bit);
- assertNotNull("16_BIT returned null", enum16Bit);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "8_biT";
- try {
- BitsPerSample temp = BitsPerSample.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 {
- BitsPerSample temp = BitsPerSample.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of BitsPerSample.
- */
- public void testListEnum() {
- List<BitsPerSample> enumValueList = Arrays.asList(BitsPerSample.values());
-
- List<BitsPerSample> enumTestList = new ArrayList<BitsPerSample>();
- enumTestList.add(BitsPerSample._8_BIT);
- enumTestList.add(BitsPerSample._16_BIT);
-
- 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/ButtonEventModeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonEventModeTests.java
deleted file mode 100644
index 4145844ee..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonEventModeTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.ButtonEventMode}
- */
-public class ButtonEventModeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "BUTTONUP";
- ButtonEventMode enumButtonUp = ButtonEventMode.valueForString(example);
- example = "BUTTONDOWN";
- ButtonEventMode enumButtonDown = ButtonEventMode.valueForString(example);
-
- assertNotNull("BUTTONUP returned null", enumButtonUp);
- assertNotNull("BUTTONDOWN returned null", enumButtonDown);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "buTTonUp";
- try {
- ButtonEventMode temp = ButtonEventMode.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 {
- ButtonEventMode temp = ButtonEventMode.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Invalid enum throws IllegalArgumentException.");
- }
- }
-
- /**
- * Verifies the possible enum values of ButtonEventMode.
- */
- public void testListEnum() {
- List<ButtonEventMode> enumValueList = Arrays.asList(ButtonEventMode.values());
-
- List<ButtonEventMode> enumTestList = new ArrayList<ButtonEventMode>();
- enumTestList.add(ButtonEventMode.BUTTONUP);
- enumTestList.add(ButtonEventMode.BUTTONDOWN);
-
- 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/ButtonNameTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonNameTests.java
deleted file mode 100644
index e823e7593..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonNameTests.java
+++ /dev/null
@@ -1,242 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.enums.ButtonName}
- */
-public class ButtonNameTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "OK";
- ButtonName enumOk = ButtonName.valueForString(example);
- example = "SEEKLEFT";
- ButtonName enumSeekLeft = ButtonName.valueForString(example);
- example = "SEEKRIGHT";
- ButtonName enumSeekRight = ButtonName.valueForString(example);
- example = "TUNEUP";
- ButtonName enumTuneUp = ButtonName.valueForString(example);
- example = "TUNEDOWN";
- ButtonName enumTuneDown = ButtonName.valueForString(example);
- example = "PRESET_0";
- ButtonName enumPreset0 = ButtonName.valueForString(example);
- example = "PRESET_1";
- ButtonName enumPreset1 = ButtonName.valueForString(example);
- example = "PRESET_2";
- ButtonName enumPreset2 = ButtonName.valueForString(example);
- example = "PRESET_3";
- ButtonName enumPreset3 = ButtonName.valueForString(example);
- example = "PRESET_4";
- ButtonName enumPreset4 = ButtonName.valueForString(example);
- example = "PRESET_5";
- ButtonName enumPreset5 = ButtonName.valueForString(example);
- example = "PRESET_6";
- ButtonName enumPreset6 = ButtonName.valueForString(example);
- example = "PRESET_7";
- ButtonName enumPreset7 = ButtonName.valueForString(example);
- example = "PRESET_8";
- ButtonName enumPreset8 = ButtonName.valueForString(example);
- example = "PRESET_9";
- ButtonName enumPreset9 = ButtonName.valueForString(example);
- example = "CUSTOM_BUTTON";
- ButtonName enumCustomButton = ButtonName.valueForString(example);
- example = "SEARCH";
- ButtonName enumSearch = ButtonName.valueForString(example);
- example = "AC_MAX";
- ButtonName enumAcMax = ButtonName.valueForString(example);
- example = "AC";
- ButtonName enumAc = ButtonName.valueForString(example);
- example = "RECIRCULATE";
- ButtonName enumRecirculate = ButtonName.valueForString(example);
- example = "FAN_UP";
- ButtonName enumFanUp = ButtonName.valueForString(example);
- example = "FAN_DOWN";
- ButtonName enumFanDown = ButtonName.valueForString(example);
- example = "TEMP_UP";
- ButtonName enumTempUp = ButtonName.valueForString(example);
- example = "TEMP_DOWN";
- ButtonName enumTempDown = ButtonName.valueForString(example);
- example = "DEFROST_MAX";
- ButtonName enumDefrostMax = ButtonName.valueForString(example);
- example = "DEFROST";
- ButtonName enumDefrost = ButtonName.valueForString(example);
- example = "DEFROST_REAR";
- ButtonName enumDefrostRear = ButtonName.valueForString(example);
- example = "UPPER_VENT";
- ButtonName enumUpperVent = ButtonName.valueForString(example);
- example = "LOWER_VENT";
- ButtonName enumLowerVent = ButtonName.valueForString(example);
- example = "VOLUME_UP";
- ButtonName enumVolumeUp = ButtonName.valueForString(example);
- example = "VOLUME_DOWN";
- ButtonName enumVolumeDown = ButtonName.valueForString(example);
- example = "EJECT";
- ButtonName enumEject = ButtonName.valueForString(example);
- example = "SOURCE";
- ButtonName enumSource = ButtonName.valueForString(example);
- example = "SHUFFLE";
- ButtonName enumShuffle = ButtonName.valueForString(example);
- example = "REPEAT";
- ButtonName enumRepeat = ButtonName.valueForString(example);
-
-
-
- assertNotNull("OK returned null", enumOk);
- assertNotNull("SEEKLEFT returned null", enumSeekLeft);
- assertNotNull("SEEKRIGHT returned null", enumSeekRight);
- assertNotNull("TUNEUP returned null", enumTuneUp);
- assertNotNull("TUNEDOWN returned null", enumTuneDown);
- assertNotNull("PRESET_0 returned null", enumPreset0);
- assertNotNull("PRESET_1 returned null", enumPreset1);
- assertNotNull("PRESET_2 returned null", enumPreset2);
- assertNotNull("PRESET_3 returned null", enumPreset3);
- assertNotNull("PRESET_4 returned null", enumPreset4);
- assertNotNull("PRESET_5 returned null", enumPreset5);
- assertNotNull("PRESET_6 returned null", enumPreset6);
- assertNotNull("PRESET_7 returned null", enumPreset7);
- assertNotNull("PRESET_8 returned null", enumPreset8);
- assertNotNull("PRESET_9 returned null", enumPreset9);
- assertNotNull("CUSTOM_BUTTON returned null", enumCustomButton);
- assertNotNull("SEARCH returned null", enumSearch);
- assertNotNull("AC_MAX returned null", enumAcMax);
- assertNotNull("AC returned null", enumAc);
- assertNotNull("RECIRCULATE returned null", enumRecirculate);
- assertNotNull("FAN_UP returned null", enumFanUp);
- assertNotNull("FAN_DOWN returned null", enumFanDown);
- assertNotNull("TEMP_UP returned null", enumTempUp);
- assertNotNull("TEMP_DOWN returned null", enumTempDown);
- assertNotNull("DEFROST_MAX returned null", enumDefrostMax);
- assertNotNull("DEFROST returned null", enumDefrost);
- assertNotNull("DEFROST_REAR returned null", enumDefrostRear);
- assertNotNull("UPPER_VENT returned null", enumUpperVent);
- assertNotNull("LOWER_VENT returned null", enumLowerVent);
- assertNotNull("VOLUME_UP returned null", enumVolumeUp);
- assertNotNull("VOLUME_DOWN returned null", enumVolumeDown);
- assertNotNull("EJECT returned null", enumEject);
- assertNotNull("SOURCE returned null", enumSource);
- assertNotNull("SHUFFLE returned null", enumShuffle);
- assertNotNull("REPEAT returned null", enumRepeat);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "oK";
- try {
- ButtonName temp = ButtonName.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 {
- ButtonName temp = ButtonName.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of ButtonName.
- */
- public void testListEnum() {
- List<ButtonName> enumValueList = Arrays.asList(ButtonName.values());
-
- List<ButtonName> enumTestList = new ArrayList<ButtonName>();
-
- enumTestList.add(ButtonName.OK);
- enumTestList.add(ButtonName.SEEKLEFT);
- enumTestList.add(ButtonName.SEEKRIGHT);
- enumTestList.add(ButtonName.TUNEUP);
- enumTestList.add(ButtonName.TUNEDOWN);
- enumTestList.add(ButtonName.PRESET_0);
- enumTestList.add(ButtonName.PRESET_1);
- enumTestList.add(ButtonName.PRESET_2);
- enumTestList.add(ButtonName.PRESET_3);
- enumTestList.add(ButtonName.PRESET_4);
- enumTestList.add(ButtonName.PRESET_5);
- enumTestList.add(ButtonName.PRESET_6);
- enumTestList.add(ButtonName.PRESET_7);
- enumTestList.add(ButtonName.PRESET_8);
- enumTestList.add(ButtonName.PRESET_9);
- enumTestList.add(ButtonName.CUSTOM_BUTTON);
- enumTestList.add(ButtonName.SEARCH);
- enumTestList.add(ButtonName.AC_MAX);
- enumTestList.add(ButtonName.AC);
- enumTestList.add(ButtonName.RECIRCULATE);
- enumTestList.add(ButtonName.FAN_UP);
- enumTestList.add(ButtonName.FAN_DOWN);
- enumTestList.add(ButtonName.TEMP_UP);
- enumTestList.add(ButtonName.TEMP_DOWN);
- enumTestList.add(ButtonName.DEFROST_MAX);
- enumTestList.add(ButtonName.DEFROST);
- enumTestList.add(ButtonName.DEFROST_REAR);
- enumTestList.add(ButtonName.UPPER_VENT);
- enumTestList.add(ButtonName.LOWER_VENT);
- enumTestList.add(ButtonName.VOLUME_UP);
- enumTestList.add(ButtonName.VOLUME_DOWN);
- enumTestList.add(ButtonName.EJECT);
- enumTestList.add(ButtonName.SOURCE);
- enumTestList.add(ButtonName.SHUFFLE);
- enumTestList.add(ButtonName.REPEAT);
- enumTestList.add(ButtonName.PLAY_PAUSE);
-
- assertTrue("Enum value list does not match enum class list",
- enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
- }
-
-
- /**
- * Tests the preset numeric order.
- */
- public void testPresetIndeces () {
- ButtonName[] inputPresetArray = new ButtonName[] {
- ButtonName.PRESET_0, ButtonName.PRESET_1, ButtonName.PRESET_2, ButtonName.PRESET_3, ButtonName.PRESET_4,
- ButtonName.PRESET_5, ButtonName.PRESET_6, ButtonName.PRESET_7, ButtonName.PRESET_8, ButtonName.PRESET_9,
- ButtonName.OK};
-
- Integer[] expectedValuesArray = new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, null};
-
- for (int index = 0; index < inputPresetArray.length; index++) {
- ButtonName input = inputPresetArray[index];
- Integer expect = expectedValuesArray[index];
-
- Integer result = ButtonName.indexForPresetButton(input);
- assertSame("Enum input " + result + " does not match expected value " + expect, result, expect);
- }
- }
-
- /**
- * Verifies that a null preset lookup is invalid.
- */
- public void testPresetNull () {
- try {
- assertNull("Passing null as a parameter does not return null", ButtonName.indexForPresetButton(null));
- }
- catch (NullPointerException exc){
- fail("Passing null as a parameter throws a NullPointerException");
- }
-
- }
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonPressModeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonPressModeTests.java
deleted file mode 100644
index cbfe16a73..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ButtonPressModeTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.ButtonPressMode}
- */
-public class ButtonPressModeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "LONG";
- ButtonPressMode enumLong = ButtonPressMode.valueForString(example);
- example = "SHORT";
- ButtonPressMode enumShort = ButtonPressMode.valueForString(example);
-
- assertNotNull("LONG returned null", enumLong);
- assertNotNull("SHORT returned null", enumShort);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "lONg";
- try {
- ButtonPressMode temp = ButtonPressMode.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 {
- ButtonPressMode temp = ButtonPressMode.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of ButtonPressMode.
- */
- public void testListEnum() {
- List<ButtonPressMode> enumValueList = Arrays.asList(ButtonPressMode.values());
-
- List<ButtonPressMode> enumTestList = new ArrayList<ButtonPressMode>();
- enumTestList.add(ButtonPressMode.LONG);
- enumTestList.add(ButtonPressMode.SHORT);
-
- 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/CarModeStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CarModeStatusTests.java
deleted file mode 100644
index d66760d9a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CarModeStatusTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.CarModeStatus}
- */
-public class CarModeStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NORMAL";
- CarModeStatus enumNormal = CarModeStatus.valueForString(example);
- example = "FACTORY";
- CarModeStatus enumFactory = CarModeStatus.valueForString(example);
- example = "TRANSPORT";
- CarModeStatus enumTransport = CarModeStatus.valueForString(example);
- example = "CRASH";
- CarModeStatus enumCrash = CarModeStatus.valueForString(example);
-
- assertNotNull("NORMAL returned null", enumNormal);
- assertNotNull("FACTORY returned null", enumFactory);
- assertNotNull("TRANSPORT returned null", enumTransport);
- assertNotNull("CRASH returned null", enumCrash);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "noRmaL";
- try {
- CarModeStatus temp = CarModeStatus.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 {
- CarModeStatus temp = CarModeStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of CarModeStatus.
- */
- public void testListEnum() {
- List<CarModeStatus> enumValueList = Arrays.asList(CarModeStatus.values());
-
- List<CarModeStatus> enumTestList = new ArrayList<CarModeStatus>();
- enumTestList.add(CarModeStatus.NORMAL);
- enumTestList.add(CarModeStatus.FACTORY);
- enumTestList.add(CarModeStatus.TRANSPORT);
- enumTestList.add(CarModeStatus.CRASH);
-
- 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/CharacterSetTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CharacterSetTests.java
deleted file mode 100644
index 99bc37265..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CharacterSetTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.CharacterSet}
- */
-public class CharacterSetTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "TYPE2SET";
- CharacterSet enumType2Set = CharacterSet.valueForString(example);
- example = "TYPE5SET";
- CharacterSet enumType5Set = CharacterSet.valueForString(example);
- example = "CID1SET";
- CharacterSet enumCid1Set = CharacterSet.valueForString(example);
- example = "CID2SET";
- CharacterSet enumCid2Set = CharacterSet.valueForString(example);
-
- assertNotNull("TYPE2SET returned null", enumType2Set);
- assertNotNull("TYPE5SET returned null", enumType5Set);
- assertNotNull("CID1SET returned null", enumCid1Set);
- assertNotNull("CID2SET returned null", enumCid2Set);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "tyPe2SeT";
- try {
- CharacterSet temp = CharacterSet.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 {
- CharacterSet temp = CharacterSet.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of CharacterSet.
- */
- public void testListEnum() {
- List<CharacterSet> enumValueList = Arrays.asList(CharacterSet.values());
-
- List<CharacterSet> enumTestList = new ArrayList<CharacterSet>();
- enumTestList.add(CharacterSet.TYPE2SET);
- enumTestList.add(CharacterSet.TYPE5SET);
- enumTestList.add(CharacterSet.CID1SET);
- enumTestList.add(CharacterSet.CID2SET);
-
- 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/CompassDirectionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CompassDirectionTests.java
deleted file mode 100644
index 7eb7d31a0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CompassDirectionTests.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.CompassDirection}
- */
-public class CompassDirectionTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NORTH";
- CompassDirection enumNorth = CompassDirection.valueForString(example);
- example = "NORTHWEST";
- CompassDirection enumNorthWest = CompassDirection.valueForString(example);
- example = "WEST";
- CompassDirection enumWest = CompassDirection.valueForString(example);
- example = "SOUTHWEST";
- CompassDirection enumSouthWest = CompassDirection.valueForString(example);
- example = "SOUTH";
- CompassDirection enumSouth = CompassDirection.valueForString(example);
- example = "SOUTHEAST";
- CompassDirection enumSouthEast = CompassDirection.valueForString(example);
- example = "EAST";
- CompassDirection enumEast = CompassDirection.valueForString(example);
- example = "NORTHEAST";
- CompassDirection enumNorthEast = CompassDirection.valueForString(example);
-
- assertNotNull("NORTH returned null", enumNorth);
- assertNotNull("NORTHWEST returned null", enumNorthWest);
- assertNotNull("WEST returned null", enumWest);
- assertNotNull("SOUTHWEST returned null", enumSouthWest);
- assertNotNull("SOUTH returned null", enumSouth);
- assertNotNull("SOUTHEAST returned null", enumSouthEast);
- assertNotNull("EAST returned null", enumEast);
- assertNotNull("NORTHEAST returned null", enumNorthEast);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "noRTh";
- try {
- CompassDirection temp = CompassDirection.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 {
- CompassDirection temp = CompassDirection.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of CompassDirection.
- */
- public void testListEnum() {
- List<CompassDirection> enumValueList = Arrays.asList(CompassDirection.values());
-
- List<CompassDirection> enumTestList = new ArrayList<CompassDirection>();
- enumTestList.add(CompassDirection.NORTH);
- enumTestList.add(CompassDirection.NORTHWEST);
- enumTestList.add(CompassDirection.WEST);
- enumTestList.add(CompassDirection.SOUTHWEST);
- enumTestList.add(CompassDirection.SOUTH);
- enumTestList.add(CompassDirection.SOUTHEAST);
- enumTestList.add(CompassDirection.EAST);
- enumTestList.add(CompassDirection.NORTHEAST);
-
- 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/ComponentVolumeStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ComponentVolumeStatusTests.java
deleted file mode 100644
index 20946252c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ComponentVolumeStatusTests.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.ComponentVolumeStatus}
- */
-public class ComponentVolumeStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "UNKNOWN";
- ComponentVolumeStatus enumUnknown = ComponentVolumeStatus.valueForString(example);
- example = "NORMAL";
- ComponentVolumeStatus enumNormal = ComponentVolumeStatus.valueForString(example);
- example = "LOW";
- ComponentVolumeStatus enumLow = ComponentVolumeStatus.valueForString(example);
- example = "FAULT";
- ComponentVolumeStatus enumFault = ComponentVolumeStatus.valueForString(example);
- example = "ALERT";
- ComponentVolumeStatus enumAlert = ComponentVolumeStatus.valueForString(example);
- example = "NOT_SUPPORTED";
- ComponentVolumeStatus enumNotSupported = ComponentVolumeStatus.valueForString(example);
-
- assertNotNull("UNKNOWN returned null", enumUnknown);
- assertNotNull("NORMAL returned null", enumNormal);
- assertNotNull("LOW returned null", enumLow);
- assertNotNull("FAULT returned null", enumFault);
- assertNotNull("ALERT returned null", enumAlert);
- assertNotNull("NOT_SUPPORTED returned null", enumNotSupported);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "unKNowN";
- try {
- ComponentVolumeStatus temp = ComponentVolumeStatus.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 {
- ComponentVolumeStatus temp = ComponentVolumeStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of ComponentVolumeStatus.
- */
- public void testListEnum() {
- List<ComponentVolumeStatus> enumValueList = Arrays.asList(ComponentVolumeStatus.values());
-
- List<ComponentVolumeStatus> enumTestList = new ArrayList<ComponentVolumeStatus>();
- enumTestList.add(ComponentVolumeStatus.UNKNOWN);
- enumTestList.add(ComponentVolumeStatus.NORMAL);
- enumTestList.add(ComponentVolumeStatus.LOW);
- enumTestList.add(ComponentVolumeStatus.FAULT);
- enumTestList.add(ComponentVolumeStatus.ALERT);
- enumTestList.add(ComponentVolumeStatus.NOT_SUPPORTED);
-
- 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/DeviceLevelStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DeviceLevelStatusTests.java
deleted file mode 100644
index 71c15d0fb..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DeviceLevelStatusTests.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.DeviceLevelStatus}
- */
-public class DeviceLevelStatusTests extends TestCase{
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "ZERO_LEVEL_BARS";
- DeviceLevelStatus enumZeroLevel = DeviceLevelStatus.valueForString(example);
- example = "ONE_LEVEL_BARS";
- DeviceLevelStatus enumOneLevel = DeviceLevelStatus.valueForString(example);
- example = "TWO_LEVEL_BARS";
- DeviceLevelStatus enumTwoLevel = DeviceLevelStatus.valueForString(example);
- example = "THREE_LEVEL_BARS";
- DeviceLevelStatus enumThreeLevel = DeviceLevelStatus.valueForString(example);
- example = "FOUR_LEVEL_BARS";
- DeviceLevelStatus enumFourLevel = DeviceLevelStatus.valueForString(example);
- example = "NOT_PROVIDED";
- DeviceLevelStatus enumNotProvided = DeviceLevelStatus.valueForString(example);
-
- assertNotNull("ZERO_LEVEL_BARS returned null", enumZeroLevel);
- assertNotNull("ONE_LEVEL_BARS returned null", enumOneLevel);
- assertNotNull("TWO_LEVEL_BARS returned null", enumTwoLevel);
- assertNotNull("THREE_LEVEL_BARS returned null", enumThreeLevel);
- assertNotNull("FOUR_LEVEL_BARS returned null", enumFourLevel);
- assertNotNull("NOT_PROVIDED returned null", enumNotProvided);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "onE_LeVeL_barS";
- try {
- DeviceLevelStatus temp = DeviceLevelStatus.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 {
- DeviceLevelStatus temp = DeviceLevelStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of DeviceLevelStatus.
- */
- public void testListEnum() {
- List<DeviceLevelStatus> enumValueList = Arrays.asList(DeviceLevelStatus.values());
-
- List<DeviceLevelStatus> enumTestList = new ArrayList<DeviceLevelStatus>();
- enumTestList.add(DeviceLevelStatus.ZERO_LEVEL_BARS);
- enumTestList.add(DeviceLevelStatus.ONE_LEVEL_BARS);
- enumTestList.add(DeviceLevelStatus.TWO_LEVEL_BARS);
- enumTestList.add(DeviceLevelStatus.THREE_LEVEL_BARS);
- enumTestList.add(DeviceLevelStatus.FOUR_LEVEL_BARS);
- enumTestList.add(DeviceLevelStatus.NOT_PROVIDED);
-
- 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/DimensionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DimensionTests.java
deleted file mode 100644
index 035ac202a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DimensionTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.Dimension;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.Dimension}
- */
-public class DimensionTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NO_FIX";
- Dimension enumNoFix = Dimension.valueForString(example);
- example = "2D";
- Dimension enum2D = Dimension.valueForString(example);
- example = "3D";
- Dimension enum3D = Dimension.valueForString(example);
-
- assertNotNull("NO_FIX returned null", enumNoFix);
- assertNotNull("2D returned null", enum2D);
- assertNotNull("3D returned null", enum3D);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "no_FiX";
- try {
- Dimension temp = Dimension.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 {
- Dimension temp = Dimension.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of Dimension.
- */
- public void testListEnum() {
- List<Dimension> enumValueList = Arrays.asList(Dimension.values());
-
- List<Dimension> enumTestList = new ArrayList<Dimension>();
- enumTestList.add(Dimension.NO_FIX);
- enumTestList.add(Dimension._2D);
- enumTestList.add(Dimension._3D);
-
- 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/DisplayTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java
deleted file mode 100644
index 560bdf025..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayTypeTests.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.DisplayType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.enums.DisplayType}
- */
-public class DisplayTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "CID";
- DisplayType enumCid = DisplayType.valueForString(example);
- example = "TYPE2";
- DisplayType enumType2 = DisplayType.valueForString(example);
- example = "TYPE5";
- DisplayType enumType5 = DisplayType.valueForString(example);
- example = "NGN";
- DisplayType enumNgn = DisplayType.valueForString(example);
- example = "GEN2_8_DMA";
- DisplayType enumGen2_8Dma = DisplayType.valueForString(example);
- example = "GEN2_6_DMA";
- DisplayType enumGen2_6Dma = DisplayType.valueForString(example);
- example = "MFD3";
- DisplayType enumMfd3 = DisplayType.valueForString(example);
- example = "MFD4";
- DisplayType enumMfd4 = DisplayType.valueForString(example);
- example = "MFD5";
- DisplayType enumMfd5 = DisplayType.valueForString(example);
- example = "GEN3_8-INCH";
- DisplayType enumGen3_8Inch = DisplayType.valueForString(example);
- example = "SDL_GENERIC";
- DisplayType enumGeneric = DisplayType.valueForString(example);
-
- assertNotNull("CID returned null", enumCid);
- assertNotNull("TYPE2 returned null", enumType2);
- assertNotNull("TYPE5 returned null", enumType5);
- assertNotNull("NGN returned null", enumNgn);
- assertNotNull("GEN2_8_DMA returned null", enumGen2_8Dma);
- assertNotNull("GEN2_6_DMA returned null", enumGen2_6Dma);
- assertNotNull("MFD3 returned null", enumMfd3);
- assertNotNull("MFD4 returned null", enumMfd4);
- assertNotNull("MFD5 returned null", enumMfd5);
- assertNotNull("GEN3_8-INCH returned null", enumGen3_8Inch);
- assertNotNull("SDL_GENERIC returned null", enumGeneric);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "cId";
- try {
- DisplayType temp = DisplayType.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 {
- DisplayType temp = DisplayType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of DisplayType.
- */
- public void testListEnum() {
- List<DisplayType> enumValueList = Arrays.asList(DisplayType.values());
-
- List<DisplayType> enumTestList = new ArrayList<DisplayType>();
- enumTestList.add(DisplayType.CID);
- enumTestList.add(DisplayType.TYPE2);
- enumTestList.add(DisplayType.TYPE5);
- enumTestList.add(DisplayType.NGN);
- enumTestList.add(DisplayType.GEN2_8_DMA);
- enumTestList.add(DisplayType.GEN2_6_DMA);
- enumTestList.add(DisplayType.MFD3);
- enumTestList.add(DisplayType.MFD4);
- enumTestList.add(DisplayType.MFD5);
- enumTestList.add(DisplayType.GEN3_8_INCH);
- enumTestList.add(DisplayType.SDL_GENERIC);
-
- 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/DriverDistractionStateTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DriverDistractionStateTests.java
deleted file mode 100644
index 2d85caa21..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DriverDistractionStateTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.DriverDistractionState}
- */
-public class DriverDistractionStateTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "DD_ON";
- DriverDistractionState enumDdOn = DriverDistractionState.valueForString(example);
- example = "DD_OFF";
- DriverDistractionState enumDdOff = DriverDistractionState.valueForString(example);
-
- assertNotNull("DD_ON returned null", enumDdOn);
- assertNotNull("DD_OFF returned null", enumDdOff);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "dD_oN";
- try {
- DriverDistractionState temp = DriverDistractionState.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 {
- DriverDistractionState temp = DriverDistractionState.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of DriverDistractionState.
- */
- public void testListEnum() {
- List<DriverDistractionState> enumValueList = Arrays.asList(DriverDistractionState.values());
-
- List<DriverDistractionState> enumTestList = new ArrayList<DriverDistractionState>();
- enumTestList.add(DriverDistractionState.DD_ON);
- enumTestList.add(DriverDistractionState.DD_OFF);
-
- 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/ECallConfirmationStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ECallConfirmationStatusTests.java
deleted file mode 100644
index 9ce602ee1..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ECallConfirmationStatusTests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.ECallConfirmationStatus}
- */
-public class ECallConfirmationStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NORMAL";
- ECallConfirmationStatus enumNormal = ECallConfirmationStatus.valueForString(example);
- example = "CALL_IN_PROGRESS";
- ECallConfirmationStatus enumCallInProgress = ECallConfirmationStatus.valueForString(example);
- example = "CALL_CANCELLED";
- ECallConfirmationStatus enumCancelled = ECallConfirmationStatus.valueForString(example);
- example = "CALL_COMPLETED";
- ECallConfirmationStatus enumCompleted = ECallConfirmationStatus.valueForString(example);
- example = "CALL_UNSUCCESSFUL";
- ECallConfirmationStatus enumUnsuccessful = ECallConfirmationStatus.valueForString(example);
- example = "ECALL_CONFIGURED_OFF";
- ECallConfirmationStatus enumConfiguredOff = ECallConfirmationStatus.valueForString(example);
- example = "CALL_COMPLETE_DTMF_TIMEOUT";
- ECallConfirmationStatus enumCompleteDtmfTimeout = ECallConfirmationStatus.valueForString(example);
-
- assertNotNull("NORMAL returned null", enumNormal);
- assertNotNull("CALL_IN_PROGRESS returned null", enumCallInProgress);
- assertNotNull("CALL_CANCELLED returned null", enumCancelled);
- assertNotNull("CALL_COMPLETED returned null", enumCompleted);
- assertNotNull("CALL_UNSUCCESSFUL returned null", enumUnsuccessful);
- assertNotNull("ECALL_CONFIGURED_OFF returned null", enumConfiguredOff);
- assertNotNull("CALL_COMPLETE_DTMF_TIMEOUT returned null", enumCompleteDtmfTimeout);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "noRMal";
- try {
- ECallConfirmationStatus temp = ECallConfirmationStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (IllegalArgumentException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies that a null assignment is invalid.
- */
- public void testNullEnum () {
- String example = null;
- try {
- ECallConfirmationStatus temp = ECallConfirmationStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of ECallConfirmationStatus.
- */
- public void testListEnum() {
- List<ECallConfirmationStatus> enumValueList = Arrays.asList(ECallConfirmationStatus.values());
-
- List<ECallConfirmationStatus> enumTestList = new ArrayList<ECallConfirmationStatus>();
- enumTestList.add(ECallConfirmationStatus.NORMAL);
- enumTestList.add(ECallConfirmationStatus.CALL_IN_PROGRESS);
- enumTestList.add(ECallConfirmationStatus.CALL_CANCELLED);
- enumTestList.add(ECallConfirmationStatus.CALL_COMPLETED);
- enumTestList.add(ECallConfirmationStatus.CALL_UNSUCCESSFUL);
- enumTestList.add(ECallConfirmationStatus.ECALL_CONFIGURED_OFF);
- enumTestList.add(ECallConfirmationStatus.CALL_COMPLETE_DTMF_TIMEOUT);
-
- 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/EmergencyEventTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/EmergencyEventTypeTests.java
deleted file mode 100644
index 21823e4bd..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/EmergencyEventTypeTests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.EmergencyEventType}
- */
-public class EmergencyEventTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NO_EVENT";
- EmergencyEventType enumEventType = EmergencyEventType.valueForString(example);
- example = "FRONTAL";
- EmergencyEventType enumFrontal = EmergencyEventType.valueForString(example);
- example = "SIDE";
- EmergencyEventType enumSide = EmergencyEventType.valueForString(example);
- example = "REAR";
- EmergencyEventType enumRear = EmergencyEventType.valueForString(example);
- example = "ROLLOVER";
- EmergencyEventType enumRollover = EmergencyEventType.valueForString(example);
- example = "NOT_SUPPORTED";
- EmergencyEventType enumNotSupported = EmergencyEventType.valueForString(example);
- example = "FAULT";
- EmergencyEventType enumFault = EmergencyEventType.valueForString(example);
-
- assertNotNull("NO_EVENT returned null", enumEventType);
- assertNotNull("FRONTAL returned null", enumFrontal);
- assertNotNull("SIDE returned null", enumSide);
- assertNotNull("REAR returned null", enumRear);
- assertNotNull("ROLLOVER returned null", enumRollover);
- assertNotNull("NOT_SUPPORTED returned null", enumNotSupported);
- assertNotNull("FAULT returned null", enumFault);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "nO_EvenT";
- try {
- EmergencyEventType temp = EmergencyEventType.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 {
- EmergencyEventType temp = EmergencyEventType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of EmergencyEvent.
- */
- public void testListEnum() {
- List<EmergencyEventType> enumValueList = Arrays.asList(EmergencyEventType.values());
-
- List<EmergencyEventType> enumTestList = new ArrayList<EmergencyEventType>();
- enumTestList.add(EmergencyEventType.NO_EVENT);
- enumTestList.add(EmergencyEventType.FRONTAL);
- enumTestList.add(EmergencyEventType.SIDE);
- enumTestList.add(EmergencyEventType.REAR);
- enumTestList.add(EmergencyEventType.ROLLOVER);
- enumTestList.add(EmergencyEventType.NOT_SUPPORTED);
- enumTestList.add(EmergencyEventType.FAULT);
-
- 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/FileTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FileTypeTests.java
deleted file mode 100644
index 4db206cad..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FileTypeTests.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.FileType}
- */
-public class FileTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "GRAPHIC_BMP";
- FileType enumGraphicBmp = FileType.valueForString(example);
- example = "GRAPHIC_JPEG";
- FileType enumGraphicJpeg = FileType.valueForString(example);
- example = "GRAPHIC_PNG";
- FileType enumGraphicPng = FileType.valueForString(example);
- example = "AUDIO_WAVE";
- FileType enumAudioWave = FileType.valueForString(example);
- example = "AUDIO_AAC";
- FileType enumAudioAac = FileType.valueForString(example);
- example = "AUDIO_MP3";
- FileType enumAudioMp3 = FileType.valueForString(example);
- example = "BINARY";
- FileType enumBinary = FileType.valueForString(example);
- example = "JSON";
- FileType enumJson = FileType.valueForString(example);
-
- assertNotNull("GRAPHIC_BMP returned null", enumGraphicBmp);
- assertNotNull("GRAPHIC_JPEG returned null", enumGraphicJpeg);
- assertNotNull("GRAPHIC_PNG returned null", enumGraphicPng);
- assertNotNull("AUDIO_WAVE returned null", enumAudioWave);
- assertNotNull("AUDIO_AAC returned null", enumAudioAac);
- assertNotNull("AUDIO_MP3 returned null", enumAudioMp3);
- assertNotNull("BINARY returned null", enumBinary);
- assertNotNull("JSON returned null", enumJson);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "uSer_ExiT";
- try {
- FileType temp = FileType.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 {
- FileType temp = FileType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of FileType.
- */
- public void testListEnum() {
- List<FileType> enumValueList = Arrays.asList(FileType.values());
-
- List<FileType> enumTestList = new ArrayList<FileType>();
- enumTestList.add(FileType.GRAPHIC_BMP);
- enumTestList.add(FileType.GRAPHIC_JPEG);
- enumTestList.add(FileType.GRAPHIC_PNG);
- enumTestList.add(FileType.AUDIO_WAVE);
- enumTestList.add(FileType.AUDIO_AAC);
- enumTestList.add(FileType.AUDIO_MP3);
- enumTestList.add(FileType.BINARY);
- enumTestList.add(FileType.JSON);
-
- 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/FuelCutoffStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelCutoffStatusTests.java
deleted file mode 100644
index 4900203f2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/FuelCutoffStatusTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.FuelCutoffStatus}
- */
-public class FuelCutoffStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "TERMINATE_FUEL";
- FuelCutoffStatus enumTerminateFuel = FuelCutoffStatus.valueForString(example);
- example = "NORMAL_OPERATION";
- FuelCutoffStatus enumNormalOperation = FuelCutoffStatus.valueForString(example);
- example = "FAULT";
- FuelCutoffStatus enumFault = FuelCutoffStatus.valueForString(example);
-
- assertNotNull("TERMINATE_FUEL returned null", enumTerminateFuel);
- assertNotNull("NORMAL_OPERATION returned null", enumNormalOperation);
- assertNotNull("FAULT returned null", enumFault);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "tErmINAte_FueL";
- try {
- FuelCutoffStatus temp = FuelCutoffStatus.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 {
- FuelCutoffStatus temp = FuelCutoffStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of FuelCutoffStatus.
- */
- public void testListEnum() {
- List<FuelCutoffStatus> enumValueList = Arrays.asList(FuelCutoffStatus.values());
-
- List<FuelCutoffStatus> enumTestList = new ArrayList<FuelCutoffStatus>();
- enumTestList.add(FuelCutoffStatus.TERMINATE_FUEL);
- enumTestList.add(FuelCutoffStatus.NORMAL_OPERATION);
- enumTestList.add(FuelCutoffStatus.FAULT);
-
- 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/GlobalPropertyTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/GlobalPropertyTests.java
deleted file mode 100644
index fd7388a6c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/GlobalPropertyTests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.GlobalProperty}
- */
-public class GlobalPropertyTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "HELPPROMPT";
- GlobalProperty enumHelpPrompt = GlobalProperty.valueForString(example);
- example = "TIMEOUTPROMPT";
- GlobalProperty enumTimeoutPrompt = GlobalProperty.valueForString(example);
- example = "VRHELPTITLE";
- GlobalProperty enumVrHelpTitle = GlobalProperty.valueForString(example);
- example = "VRHELPITEMS";
- GlobalProperty enumVrHelpItems = GlobalProperty.valueForString(example);
- example = "MENUNAME";
- GlobalProperty enumMenuName = GlobalProperty.valueForString(example);
- example = "MENUICON";
- GlobalProperty enumMenuIcon = GlobalProperty.valueForString(example);
- example = "KEYBOARDPROPERTIES";
- GlobalProperty enumKeyboardProperties = GlobalProperty.valueForString(example);
-
- assertNotNull("HELPPROMPT returned null", enumHelpPrompt);
- assertNotNull("TIMEOUTPROMPT returned null", enumTimeoutPrompt);
- assertNotNull("VRHELPTITLE returned null", enumVrHelpTitle);
- assertNotNull("VRHELPITEMS returned null", enumVrHelpItems);
- assertNotNull("MENUNAME returned null", enumMenuName);
- assertNotNull("MENUICON returned null", enumMenuIcon);
- assertNotNull("KEYBOARDPROPERTIES returned null", enumKeyboardProperties);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "heLp_ProMPt";
- try {
- GlobalProperty temp = GlobalProperty.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 {
- GlobalProperty temp = GlobalProperty.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of GlobalProperty.
- */
- public void testListEnum() {
- List<GlobalProperty> enumValueList = Arrays.asList(GlobalProperty.values());
-
- List<GlobalProperty> enumTestList = new ArrayList<GlobalProperty>();
- enumTestList.add(GlobalProperty.HELPPROMPT);
- enumTestList.add(GlobalProperty.TIMEOUTPROMPT);
- enumTestList.add(GlobalProperty.VRHELPTITLE);
- enumTestList.add(GlobalProperty.VRHELPITEMS);
- enumTestList.add(GlobalProperty.MENUNAME);
- enumTestList.add(GlobalProperty.MENUICON);
- enumTestList.add(GlobalProperty.KEYBOARDPROPERTIES);
-
- 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/HmiLevelTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiLevelTests.java
deleted file mode 100644
index b64f9e42b..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiLevelTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.HmiLevel}
- */
-public class HmiLevelTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "FULL";
- HMILevel enumFull = HMILevel.valueForString(example);
- example = "LIMITED";
- HMILevel enumLimited = HMILevel.valueForString(example);
- example = "BACKGROUND";
- HMILevel enumBackground = HMILevel.valueForString(example);
- example = "NONE";
- HMILevel enumNone = HMILevel.valueForString(example);
-
- assertNotNull("FULL returned null", enumFull);
- assertNotNull("LIMITED returned null", enumLimited);
- assertNotNull("BACKGROUND returned null", enumBackground);
- assertNotNull("NONE returned null", enumNone);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "fUlL";
- try {
- HMILevel temp = HMILevel.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 {
- HMILevel temp = HMILevel.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of HMILevel.
- */
- public void testListEnum() {
- List<HMILevel> enumValueList = Arrays.asList(HMILevel.values());
-
- List<HMILevel> enumTestList = new ArrayList<HMILevel>();
- enumTestList.add(HMILevel.HMI_FULL);
- enumTestList.add(HMILevel.HMI_LIMITED);
- enumTestList.add(HMILevel.HMI_BACKGROUND);
- enumTestList.add(HMILevel.HMI_NONE);
-
- 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/HmiZoneCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiZoneCapabilitiesTests.java
deleted file mode 100644
index ebe8227c2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/HmiZoneCapabilitiesTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.HmiZoneCapabilities}
- */
-public class HmiZoneCapabilitiesTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "FRONT";
- HmiZoneCapabilities enumFront = HmiZoneCapabilities.valueForString(example);
- example = "BACK";
- HmiZoneCapabilities enumBack = HmiZoneCapabilities.valueForString(example);
-
- assertNotNull("FRONT returned null", enumFront);
- assertNotNull("BACK returned null", enumBack);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "fROnT";
- try {
- HmiZoneCapabilities temp = HmiZoneCapabilities.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 {
- HmiZoneCapabilities temp = HmiZoneCapabilities.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of HmiZoneCapabilities.
- */
- public void testListEnum() {
- List<HmiZoneCapabilities> enumValueList = Arrays.asList(HmiZoneCapabilities.values());
-
- List<HmiZoneCapabilities> enumTestList = new ArrayList<HmiZoneCapabilities>();
- enumTestList.add(HmiZoneCapabilities.FRONT);
- enumTestList.add(HmiZoneCapabilities.BACK);
-
- 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/IgnitionStableStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStableStatusTests.java
deleted file mode 100644
index fc9a8658a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStableStatusTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.IgnitionStableStatus}
- */
-public class IgnitionStableStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "IGNITION_SWITCH_NOT_STABLE";
- IgnitionStableStatus enumIgnitionSwitchNotStable = IgnitionStableStatus.valueForString(example);
- example = "IGNITION_SWITCH_STABLE";
- IgnitionStableStatus enumIgnitionSwitchStable = IgnitionStableStatus.valueForString(example);
- example = "MISSING_FROM_TRANSMITTER";
- IgnitionStableStatus enumMissingFromTransmitter = IgnitionStableStatus.valueForString(example);
-
- assertNotNull("IGNITION_SWITCH_NOT_STABLE returned null", enumIgnitionSwitchNotStable);
- assertNotNull("IGNITION_SWITCH_STABLE returned null", enumIgnitionSwitchStable);
- assertNotNull("MISSING_FROM_TRANSMITTER returned null", enumMissingFromTransmitter);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "iGnitIoN_SwiTch_NoT_StablE";
- try {
- IgnitionStableStatus temp = IgnitionStableStatus.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 {
- IgnitionStableStatus temp = IgnitionStableStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of IgnitionStableStatus.
- */
- public void testListEnum() {
- List<IgnitionStableStatus> enumValueList = Arrays.asList(IgnitionStableStatus.values());
-
- List<IgnitionStableStatus> enumTestList = new ArrayList<IgnitionStableStatus>();
- enumTestList.add(IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE);
- enumTestList.add(IgnitionStableStatus.IGNITION_SWITCH_STABLE);
- enumTestList.add(IgnitionStableStatus.MISSING_FROM_TRANSMITTER);
-
- 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/IgnitionStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStatusTests.java
deleted file mode 100644
index 8fc1992ab..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/IgnitionStatusTests.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.IgnitionStatus}
- */
-public class IgnitionStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "UNKNOWN";
- IgnitionStatus enumUnknown = IgnitionStatus.valueForString(example);
- example = "OFF";
- IgnitionStatus enumOff = IgnitionStatus.valueForString(example);
- example = "ACCESSORY";
- IgnitionStatus enumAccessory = IgnitionStatus.valueForString(example);
- example = "RUN";
- IgnitionStatus enumRun = IgnitionStatus.valueForString(example);
- example = "START";
- IgnitionStatus enumStart = IgnitionStatus.valueForString(example);
- example = "INVALID";
- IgnitionStatus enumInvalid = IgnitionStatus.valueForString(example);
-
- assertNotNull("UNKNOWN returned null", enumUnknown);
- assertNotNull("OFF returned null", enumOff);
- assertNotNull("ACCESSORY returned null", enumAccessory);
- assertNotNull("RUN returned null", enumRun);
- assertNotNull("START returned null", enumStart);
- assertNotNull("INVALID returned null", enumInvalid);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "uNKnowN";
- try {
- IgnitionStatus temp = IgnitionStatus.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 {
- IgnitionStatus temp = IgnitionStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of IgnitionStatus.
- */
- public void testListEnum() {
- List<IgnitionStatus> enumValueList = Arrays.asList(IgnitionStatus.values());
-
- List<IgnitionStatus> enumTestList = new ArrayList<IgnitionStatus>();
- enumTestList.add(IgnitionStatus.UNKNOWN);
- enumTestList.add(IgnitionStatus.OFF);
- enumTestList.add(IgnitionStatus.ACCESSORY);
- enumTestList.add(IgnitionStatus.RUN);
- enumTestList.add(IgnitionStatus.START);
- enumTestList.add(IgnitionStatus.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/ImageFieldNameTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java
deleted file mode 100644
index aa2c1cbf1..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.ImageFieldName}
- */
-public class ImageFieldNameTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "softButtonImage";
- ImageFieldName enumSoftButtonImage = ImageFieldName.valueForString(example);
- example = "choiceImage";
- ImageFieldName enumChoiceImage = ImageFieldName.valueForString(example);
- example = "choiceSecondaryImage";
- ImageFieldName enumSecondaryImage = ImageFieldName.valueForString(example);
- example = "vrHelpItem";
- ImageFieldName enumVrHelpItem = ImageFieldName.valueForString(example);
- example = "turnIcon";
- ImageFieldName enumTurnIcon = ImageFieldName.valueForString(example);
- example = "menuIcon";
- ImageFieldName enumMenuIcon = ImageFieldName.valueForString(example);
- example = "cmdIcon";
- ImageFieldName enumCmdIcon = ImageFieldName.valueForString(example);
- example = "appIcon";
- ImageFieldName enumAppIcon = ImageFieldName.valueForString(example);
- example = "graphic";
- ImageFieldName enumGraphicIcon = ImageFieldName.valueForString(example);
- example = "showConstantTBTIcon";
- ImageFieldName enumShowConstantTbtIcon = ImageFieldName.valueForString(example);
- example = "showConstantTBTNextTurnIcon";
- ImageFieldName enumShowConstantTbtNextTurnIcon = ImageFieldName.valueForString(example);
- example = "locationImage";
- ImageFieldName enumLocationImage = ImageFieldName.valueForString(example);
- example = "secondaryGraphic";
- ImageFieldName enumSecondaryGraphic = ImageFieldName.valueForString(example);
-
- assertNotNull("softButtonImage returned null", enumSoftButtonImage);
- assertNotNull("choiceImage returned null", enumChoiceImage);
- assertNotNull("choiceSecondaryImage returned null", enumSecondaryImage);
- assertNotNull("vrHelpItem returned null", enumVrHelpItem);
- assertNotNull("turnIcon returned null", enumTurnIcon);
- assertNotNull("menuIcon returned null", enumMenuIcon);
- assertNotNull("cmdIcon returned null", enumCmdIcon);
- assertNotNull("appIcon returned null", enumAppIcon);
- assertNotNull("graphic returned null", enumGraphicIcon);
- assertNotNull("showConstantTBTIcon returned null", enumShowConstantTbtIcon);
- assertNotNull("showConstantTBTNextTurnIcon returned null", enumShowConstantTbtNextTurnIcon);
- assertNotNull("location image returned null", enumLocationImage);
- assertNotNull("secondary graphic returned null", enumSecondaryGraphic);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "sofTbUtTOnImagE";
- try {
- ImageFieldName temp = ImageFieldName.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 {
- ImageFieldName temp = ImageFieldName.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of ImageFieldName.
- */
- public void testListEnum() {
- List<ImageFieldName> enumValueList = Arrays.asList(ImageFieldName.values());
-
- List<ImageFieldName> enumTestList = new ArrayList<ImageFieldName>();
- enumTestList.add(ImageFieldName.softButtonImage);
- enumTestList.add(ImageFieldName.choiceImage);
- enumTestList.add(ImageFieldName.choiceSecondaryImage);
- enumTestList.add(ImageFieldName.vrHelpItem);
- enumTestList.add(ImageFieldName.turnIcon);
- enumTestList.add(ImageFieldName.menuIcon);
- enumTestList.add(ImageFieldName.cmdIcon);
- enumTestList.add(ImageFieldName.appIcon);
- enumTestList.add(ImageFieldName.graphic);
- enumTestList.add(ImageFieldName.showConstantTBTIcon);
- enumTestList.add(ImageFieldName.showConstantTBTNextTurnIcon);
- enumTestList.add(ImageFieldName.locationImage);
- enumTestList.add(ImageFieldName.secondaryGraphic);
-
- 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/ImageTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageTypeTests.java
deleted file mode 100644
index fb3f609f3..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageTypeTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.ImageType}
- */
-public class ImageTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "STATIC";
- ImageType enumStatic = ImageType.valueForString(example);
- example = "DYNAMIC";
- ImageType enumDynamic = ImageType.valueForString(example);
-
- assertNotNull("STATIC returned null", enumStatic);
- assertNotNull("DYNAMIC returned null", enumDynamic);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "sTatIc";
- try {
- ImageType temp = ImageType.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 {
- ImageType temp = ImageType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of ImageType.
- */
- public void testListEnum() {
- List<ImageType> enumValueList = Arrays.asList(ImageType.values());
-
- List<ImageType> enumTestList = new ArrayList<ImageType>();
- enumTestList.add(ImageType.STATIC);
- enumTestList.add(ImageType.DYNAMIC);
-
- 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/InteractionModeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/InteractionModeTests.java
deleted file mode 100644
index ab6490cea..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/InteractionModeTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.InteractionMode}
- */
-public class InteractionModeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "MANUAL_ONLY";
- InteractionMode enumManualOnly = InteractionMode.valueForString(example);
- example = "VR_ONLY";
- InteractionMode enumVrOnly = InteractionMode.valueForString(example);
- example = "BOTH";
- InteractionMode enumBoth = InteractionMode.valueForString(example);
-
- assertNotNull("MANUAL_ONLY returned null", enumManualOnly);
- assertNotNull("VR_ONLY returned null", enumVrOnly);
- assertNotNull("BOTH returned null", enumBoth);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "maNuAL_OnlY";
- try {
- InteractionMode temp = InteractionMode.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 {
- InteractionMode temp = InteractionMode.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of InteractionMode.
- */
- public void testListEnum() {
- List<InteractionMode> enumValueList = Arrays.asList(InteractionMode.values());
-
- List<InteractionMode> enumTestList = new ArrayList<InteractionMode>();
- enumTestList.add(InteractionMode.MANUAL_ONLY);
- enumTestList.add(InteractionMode.VR_ONLY);
- enumTestList.add(InteractionMode.BOTH);
-
- 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/JingleTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/JingleTests.java
deleted file mode 100644
index da5ea2836..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/JingleTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.Jingle;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.Jingle}
- */
-public class JingleTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
-
- String example = "POSITIVE_JINGLE";
- Jingle enumPositiveJingle = Jingle.valueForString(example);
- example = "NEGATIVE_JINGLE";
- Jingle enumNegativeJingle = Jingle.valueForString(example);
- example = "INITIAL_JINGLE";
- Jingle enumInitialJingle = Jingle.valueForString(example);
- example = "LISTEN_JINGLE";
- Jingle enumListenJingle = Jingle.valueForString(example);
- example = "HELP_JINGLE";
- Jingle enumHelpJingle = Jingle.valueForString(example);
-
- assertNotNull("POSITIVE_JINGLE returned null", enumPositiveJingle);
- assertNotNull("NEGATIVE_JINGLE returned null", enumNegativeJingle);
- assertNotNull("INITIAL_JINGLE returned null", enumInitialJingle);
- assertNotNull("LISTEN_JINGLE returned null", enumListenJingle);
- assertNotNull("HELP_JINGLE returned null", enumHelpJingle);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "posITive_JiGLE";
- try {
- Jingle temp = Jingle.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 {
- Jingle temp = Jingle.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- } catch (IllegalArgumentException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of Jingle.
- */
- public void testListEnums () {
- List<Jingle> enumValueList = Arrays.asList(Jingle.values());
- List<Jingle> enumTestList = new ArrayList<Jingle>();
-
- enumTestList.add(Jingle.HELP);
- enumTestList.add(Jingle.INITIAL);
- enumTestList.add(Jingle.LISTEN);
- enumTestList.add(Jingle.NEGATIVE);
- enumTestList.add(Jingle.POSITIVE);
-
- assertTrue("Enum value list does not match neum 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/KeyboardEventTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardEventTests.java
deleted file mode 100644
index 71448acf6..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardEventTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.KeyboardEvent}
- */
-public class KeyboardEventTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "KEYPRESS";
- KeyboardEvent enumKeypress = KeyboardEvent.valueForString(example);
- example = "ENTRY_SUBMITTED";
- KeyboardEvent enumEntrySubmitted = KeyboardEvent.valueForString(example);
- example = "ENTRY_CANCELLED";
- KeyboardEvent enumEntryCancelled = KeyboardEvent.valueForString(example);
- example = "ENTRY_ABORTED";
- KeyboardEvent enumEntryAborted = KeyboardEvent.valueForString(example);
- example = "ENTRY_VOICE";
- KeyboardEvent enumEntryVoice = KeyboardEvent.valueForString(example);
-
- assertNotNull("KEYPRESS returned null", enumKeypress);
- assertNotNull("ENTRY_SUBMITTED returned null", enumEntrySubmitted);
- assertNotNull("ENTRY_CANCELLED returned null", enumEntryCancelled);
- assertNotNull("ENTRY_ABORTED returned null", enumEntryAborted);
- assertNotNull("ENTRY_VOICE returned null", enumEntryVoice);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "keyPreSS";
- try {
- KeyboardEvent temp = KeyboardEvent.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 {
- KeyboardEvent temp = KeyboardEvent.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of KeyboardEvent.
- */
- public void testListEnum() {
- List<KeyboardEvent> enumValueList = Arrays.asList(KeyboardEvent.values());
-
- List<KeyboardEvent> enumTestList = new ArrayList<KeyboardEvent>();
- enumTestList.add(KeyboardEvent.KEYPRESS);
- enumTestList.add(KeyboardEvent.ENTRY_SUBMITTED);
- enumTestList.add(KeyboardEvent.ENTRY_CANCELLED);
- enumTestList.add(KeyboardEvent.ENTRY_ABORTED);
- enumTestList.add(KeyboardEvent.ENTRY_VOICE);
-
- 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/KeyboardLayoutTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardLayoutTests.java
deleted file mode 100644
index 14d61aa51..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeyboardLayoutTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.KeyboardLayout}
- */
-public class KeyboardLayoutTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "QWERTY";
- KeyboardLayout enumQwerty = KeyboardLayout.valueForString(example);
- example = "QWERTZ";
- KeyboardLayout enumQwertz = KeyboardLayout.valueForString(example);
- example = "AZERTY";
- KeyboardLayout enumAzerty = KeyboardLayout.valueForString(example);
-
- assertNotNull("QWERTY returned null", enumQwerty);
- assertNotNull("QWERTZ returned null", enumQwertz);
- assertNotNull("AZERTY returned null", enumAzerty);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "qWerTY";
- try {
- KeyboardLayout temp = KeyboardLayout.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 {
- KeyboardLayout temp = KeyboardLayout.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of KeyboardLayout.
- */
- public void testListEnum() {
- List<KeyboardLayout> enumValueList = Arrays.asList(KeyboardLayout.values());
-
- List<KeyboardLayout> enumTestList = new ArrayList<KeyboardLayout>();
- enumTestList.add(KeyboardLayout.QWERTY);
- enumTestList.add(KeyboardLayout.QWERTZ);
- enumTestList.add(KeyboardLayout.AZERTY);
-
- 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/KeypressModeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeypressModeTests.java
deleted file mode 100644
index 8bd652969..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/KeypressModeTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.KeypressMode}
- */
-public class KeypressModeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "SINGLE_KEYPRESS";
- KeypressMode enumSingleKeypress = KeypressMode.valueForString(example);
- example = "QUEUE_KEYPRESSES";
- KeypressMode enumQueueKeypresses = KeypressMode.valueForString(example);
- example = "RESEND_CURRENT_ENTRY";
- KeypressMode enumResendCurrentEntry = KeypressMode.valueForString(example);
-
- assertNotNull("SINGLE_KEYPRESS returned null", enumSingleKeypress);
- assertNotNull("QUEUE_KEYPRESSES returned null", enumQueueKeypresses);
- assertNotNull("RESEND_CURRENT_ENTRY returned null", enumResendCurrentEntry);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "sIngLe_KeyPrESs";
- try {
- KeypressMode temp = KeypressMode.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 {
- KeypressMode temp = KeypressMode.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of KeypressMode.
- */
- public void testListEnum() {
- List<KeypressMode> enumValueList = Arrays.asList(KeypressMode.values());
-
- List<KeypressMode> enumTestList = new ArrayList<KeypressMode>();
- enumTestList.add(KeypressMode.SINGLE_KEYPRESS);
- enumTestList.add(KeypressMode.QUEUE_KEYPRESSES);
- enumTestList.add(KeypressMode.RESEND_CURRENT_ENTRY);
-
- 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/LanguageTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LanguageTests.java
deleted file mode 100644
index 6b87c5d26..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LanguageTests.java
+++ /dev/null
@@ -1,220 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.Language;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.enums.Language}
- */
-public class LanguageTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "EN-US";
- Language enumEnUs = Language.valueForString(example);
- example = "EN-SA";
- Language enumEnSa = Language.valueForString(example);
- example = "HE-IL";
- Language enumHeIl = Language.valueForString(example);
- example = "RO-RO";
- Language enumRoRo = Language.valueForString(example);
- example = "UK-UA";
- Language enumUkUa = Language.valueForString(example);
- example = "ID-ID";
- Language enumIdId = Language.valueForString(example);
- example = "VI-VN";
- Language enumViVn = Language.valueForString(example);
- example = "MS-MY";
- Language enumMsMy = Language.valueForString(example);
- example = "HI-IN";
- Language enumHiIn = Language.valueForString(example);
- example = "NL-BE";
- Language enumNlBe = Language.valueForString(example);
- example = "EL-GR";
- Language enumElGr = Language.valueForString(example);
- example = "HU-HU";
- Language enumHuHu = Language.valueForString(example);
- example = "FI-FI";
- Language enumFiFi = Language.valueForString(example);
- example = "SK-SK";
- Language enumSkSk = Language.valueForString(example);
- example = "ES-MX";
- Language enumEsMx = Language.valueForString(example);
- example = "FR-CA";
- Language enumFrCa = Language.valueForString(example);
- example = "DE-DE";
- Language enumDeDe = Language.valueForString(example);
- example = "ES-ES";
- Language enumEsEs = Language.valueForString(example);
- example = "EN-GB";
- Language enumEnGb = Language.valueForString(example);
- example = "RU-RU";
- Language enumRuRu = Language.valueForString(example);
- example = "TR-TR";
- Language enumTrTr = Language.valueForString(example);
- example = "PL-PL";
- Language enumPlPl = Language.valueForString(example);
- example = "FR-FR";
- Language enumFrFr = Language.valueForString(example);
- example = "IT-IT";
- Language enumItIt = Language.valueForString(example);
- example = "SV-SE";
- Language enumSvSe = Language.valueForString(example);
- example = "PT-PT";
- Language enumPtPt = Language.valueForString(example);
- example = "NL-NL";
- Language enumNlNl = Language.valueForString(example);
- example = "EN-AU";
- Language enumEnAu = Language.valueForString(example);
- example = "ZH-CN";
- Language enumZhCn = Language.valueForString(example);
- example = "ZH-TW";
- Language enumZhTw = Language.valueForString(example);
- example = "JA-JP";
- Language enumJaJp = Language.valueForString(example);
- example = "AR-SA";
- Language enumArSa = Language.valueForString(example);
- example = "KO-KR";
- Language enumKoKr = Language.valueForString(example);
- example = "PT-BR";
- Language enumPtBr = Language.valueForString(example);
- example = "CS-CZ";
- Language enumCsCz = Language.valueForString(example);
- example = "DA-DK";
- Language enumDaDk = Language.valueForString(example);
- example = "NO-NO";
- Language enumNoNo = Language.valueForString(example);
- example = "EN-IN";
- Language enumEnIn = Language.valueForString(example);
- example = "TH-TH";
- Language enumThTh = Language.valueForString(example);
-
- assertNotNull("EN-US returned null", enumEnUs);
- assertNotNull("EN-SA returned null", enumEnSa);
- assertNotNull("HE-IL returned null", enumHeIl);
- assertNotNull("RO-RO returned null", enumRoRo);
- assertNotNull("UK-UA returned null", enumUkUa);
- assertNotNull("ID-ID returned null", enumIdId);
- assertNotNull("VI-VN returned null", enumViVn);
- assertNotNull("MS-MY returned null", enumMsMy);
- assertNotNull("HI-IN returned null", enumHiIn);
- assertNotNull("NL-BE returned null", enumNlBe);
- assertNotNull("EL-GR returned null", enumElGr);
- assertNotNull("HU-HU returned null", enumHuHu);
- assertNotNull("FI-FI returned null", enumFiFi);
- assertNotNull("SK-SK returned null", enumSkSk);
- assertNotNull("ES-MX returned null", enumEsMx);
- assertNotNull("FR-CA returned null", enumFrCa);
- assertNotNull("DE-DE returned null", enumDeDe);
- assertNotNull("ES-ES returned null", enumEsEs);
- assertNotNull("EN-GB returned null", enumEnGb);
- assertNotNull("RU-RU returned null", enumRuRu);
- assertNotNull("TR-TR returned null", enumTrTr);
- assertNotNull("PL-PL returned null", enumPlPl);
- assertNotNull("FR-FR returned null", enumFrFr);
- assertNotNull("IT-IT returned null", enumItIt);
- assertNotNull("SV-SE returned null", enumSvSe);
- assertNotNull("PT-PT returned null", enumPtPt);
- assertNotNull("NL-NL returned null", enumNlNl);
- assertNotNull("EN-AU returned null", enumEnAu);
- assertNotNull("ZH-CN returned null", enumZhCn);
- assertNotNull("ZH-TW returned null", enumZhTw);
- assertNotNull("JA-JP returned null", enumJaJp);
- assertNotNull("AR-SA returned null", enumArSa);
- assertNotNull("KO-KR returned null", enumKoKr);
- assertNotNull("PT-BR returned null", enumPtBr);
- assertNotNull("CS-CZ returned null", enumCsCz);
- assertNotNull("DA-DK returned null", enumDaDk);
- assertNotNull("NO-NO returned null", enumNoNo);
- assertNotNull("EN-IN returned null", enumEnIn);
- assertNotNull("TH-TH returned null", enumThTh);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "eN-Us";
- try {
- Language temp = Language.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 {
- Language temp = Language.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of Language.
- */
- public void testListEnum() {
- List<Language> enumValueList = Arrays.asList(Language.values());
-
- List<Language> enumTestList = new ArrayList<Language>();
-
- enumTestList.add(Language.EN_US);
- enumTestList.add(Language.EN_SA);
- enumTestList.add(Language.HE_IL);
- enumTestList.add(Language.RO_RO);
- enumTestList.add(Language.UK_UA);
- enumTestList.add(Language.ID_ID);
- enumTestList.add(Language.VI_VN);
- enumTestList.add(Language.MS_MY);
- enumTestList.add(Language.HI_IN);
- enumTestList.add(Language.NL_BE);
- enumTestList.add(Language.EL_GR);
- enumTestList.add(Language.HU_HU);
- enumTestList.add(Language.FI_FI);
- enumTestList.add(Language.SK_SK);
- enumTestList.add(Language.ES_MX);
- enumTestList.add(Language.FR_CA);
- enumTestList.add(Language.DE_DE);
- enumTestList.add(Language.ES_ES);
- enumTestList.add(Language.EN_GB);
- enumTestList.add(Language.RU_RU);
- enumTestList.add(Language.TR_TR);
- enumTestList.add(Language.PL_PL);
- enumTestList.add(Language.FR_FR);
- enumTestList.add(Language.IT_IT);
- enumTestList.add(Language.SV_SE);
- enumTestList.add(Language.PT_PT);
- enumTestList.add(Language.NL_NL);
- enumTestList.add(Language.EN_AU);
- enumTestList.add(Language.ZH_CN);
- enumTestList.add(Language.ZH_TW);
- enumTestList.add(Language.JA_JP);
- enumTestList.add(Language.AR_SA);
- enumTestList.add(Language.KO_KR);
- enumTestList.add(Language.PT_BR);
- enumTestList.add(Language.CS_CZ);
- enumTestList.add(Language.DA_DK);
- enumTestList.add(Language.NO_NO);
- enumTestList.add(Language.EN_IN);
- enumTestList.add(Language.TH_TH);
-
- 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/LayoutModeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LayoutModeTests.java
deleted file mode 100644
index 904a39520..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LayoutModeTests.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.LayoutMode;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.LayoutMode}
- */
-public class LayoutModeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "ICON_ONLY";
- LayoutMode enumIconOnly = LayoutMode.valueForString(example);
- example = "ICON_WITH_SEARCH";
- LayoutMode enumIconWithSearch = LayoutMode.valueForString(example);
- example = "LIST_ONLY";
- LayoutMode enumListOnly = LayoutMode.valueForString(example);
- example = "LIST_WITH_SEARCH";
- LayoutMode enumListWithSearch = LayoutMode.valueForString(example);
- example = "KEYBOARD";
- LayoutMode enumKeyboard = LayoutMode.valueForString(example);
-
- assertNotNull("ICON_ONLY returned null", enumIconOnly);
- assertNotNull("ICON_WITH_SEARCH returned null", enumIconWithSearch);
- assertNotNull("LIST_ONLY returned null", enumListOnly);
- assertNotNull("LIST_WITH_SEARCH returned null", enumListWithSearch);
- assertNotNull("KEYBOARD returned null", enumKeyboard);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "icOn_OnlY";
- try {
- LayoutMode temp = LayoutMode.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 {
- LayoutMode temp = LayoutMode.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
-
- /**
- * Verifies the possible enum values of LayoutMode.
- */
- public void testListEnum() {
- List<LayoutMode> enumValueList = Arrays.asList(LayoutMode.values());
-
- List<LayoutMode> enumTestList = new ArrayList<LayoutMode>();
- enumTestList.add(LayoutMode.ICON_ONLY);
- enumTestList.add(LayoutMode.ICON_WITH_SEARCH);
- enumTestList.add(LayoutMode.LIST_ONLY);
- enumTestList.add(LayoutMode.LIST_WITH_SEARCH);
- enumTestList.add(LayoutMode.KEYBOARD);
-
- 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/LockScreenStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LockScreenStatusTests.java
deleted file mode 100644
index ed380d607..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LockScreenStatusTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.LockScreenStatus}
- */
-public class LockScreenStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "REQUIRED";
- LockScreenStatus enumRequired = LockScreenStatus.valueForString(example);
- example = "OPTIONAL";
- LockScreenStatus enumOptional = LockScreenStatus.valueForString(example);
- example = "OFF";
- LockScreenStatus enumOff = LockScreenStatus.valueForString(example);
-
- assertNotNull("REQUIRED returned null", enumRequired);
- assertNotNull("OPTIONAL returned null", enumOptional);
- assertNotNull("OFF returned null", enumOff);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "ReqUireD";
- try {
- LockScreenStatus temp = LockScreenStatus.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 {
- LockScreenStatus temp = LockScreenStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of LockScreenStatus.
- */
- public void testListEnum() {
- List<LockScreenStatus> enumValueList = Arrays.asList(LockScreenStatus.values());
-
- List<LockScreenStatus> enumTestList = new ArrayList<LockScreenStatus>();
- enumTestList.add(LockScreenStatus.REQUIRED);
- enumTestList.add(LockScreenStatus.OPTIONAL);
- enumTestList.add(LockScreenStatus.OFF);
-
- 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/MediaClockFormatTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaClockFormatTests.java
deleted file mode 100644
index 1895430e5..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MediaClockFormatTests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.MediaClockFormat}
- */
-public class MediaClockFormatTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "CLOCK1";
- MediaClockFormat enumClock1 = MediaClockFormat.valueForString(example);
- example = "CLOCK2";
- MediaClockFormat enumClock2 = MediaClockFormat.valueForString(example);
- example = "CLOCK3";
- MediaClockFormat enumClock3 = MediaClockFormat.valueForString(example);
- example = "CLOCKTEXT1";
- MediaClockFormat enumClockText1 = MediaClockFormat.valueForString(example);
- example = "CLOCKTEXT2";
- MediaClockFormat enumClockText2 = MediaClockFormat.valueForString(example);
- example = "CLOCKTEXT3";
- MediaClockFormat enumClockText3 = MediaClockFormat.valueForString(example);
- example = "CLOCKTEXT4";
- MediaClockFormat enumClockText4 = MediaClockFormat.valueForString(example);
-
- assertNotNull("CLOCK1 returned null", enumClock1);
- assertNotNull("CLOCK2 returned null", enumClock2);
- assertNotNull("CLOCK3 returned null", enumClock3);
- assertNotNull("CLOCKTEXT1 returned null", enumClockText1);
- assertNotNull("CLOCKTEXT2 returned null", enumClockText2);
- assertNotNull("CLOCKTEXT3 returned null", enumClockText3);
- assertNotNull("CLOCKTEXT4 returned null", enumClockText4);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "cloCK1";
- try {
- MediaClockFormat temp = MediaClockFormat.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 {
- MediaClockFormat temp = MediaClockFormat.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of MediaClockFormat.
- */
- public void testListEnum() {
- List<MediaClockFormat> enumValueList = Arrays.asList(MediaClockFormat.values());
-
- List<MediaClockFormat> enumTestList = new ArrayList<MediaClockFormat>();
- enumTestList.add(MediaClockFormat.CLOCK1);
- enumTestList.add(MediaClockFormat.CLOCK2);
- enumTestList.add(MediaClockFormat.CLOCK3);
- enumTestList.add(MediaClockFormat.CLOCKTEXT1);
- enumTestList.add(MediaClockFormat.CLOCKTEXT2);
- enumTestList.add(MediaClockFormat.CLOCKTEXT3);
- enumTestList.add(MediaClockFormat.CLOCKTEXT4);
-
- 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/PowerModeQualificationStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeQualificationStatusTests.java
deleted file mode 100644
index f3a2a3540..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeQualificationStatusTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.PowerModeQualificationStatus}
- */
-public class PowerModeQualificationStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "POWER_MODE_UNDEFINED";
- PowerModeQualificationStatus enumPowerModeUndefined = PowerModeQualificationStatus.valueForString(example);
- example = "POWER_MODE_EVALUATION_IN_PROGRESS";
- PowerModeQualificationStatus enumPowerModeEvaluationInProgress = PowerModeQualificationStatus.valueForString(example);
- example = "NOT_DEFINED";
- PowerModeQualificationStatus enumNotDefined = PowerModeQualificationStatus.valueForString(example);
- example = "POWER_MODE_OK";
- PowerModeQualificationStatus enumPowerModeOk = PowerModeQualificationStatus.valueForString(example);
-
- assertNotNull("POWER_MODE_UNDEFINED returned null", enumPowerModeUndefined);
- assertNotNull("POWER_MODE_EVALUATION_IN_PROGRESS returned null", enumPowerModeEvaluationInProgress);
- assertNotNull("NOT_DEFINED returned null", enumNotDefined);
- assertNotNull("POWER_MODE_OK returned null", enumPowerModeOk);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "poweR_moDE_UndEfiNEd";
- try {
- PowerModeQualificationStatus temp = PowerModeQualificationStatus.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 {
- PowerModeQualificationStatus temp = PowerModeQualificationStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of PowerModeQualificationStatus.
- */
- public void testListEnum() {
- List<PowerModeQualificationStatus> enumValueList = Arrays.asList(PowerModeQualificationStatus.values());
-
- List<PowerModeQualificationStatus> enumTestList = new ArrayList<PowerModeQualificationStatus>();
- enumTestList.add(PowerModeQualificationStatus.POWER_MODE_UNDEFINED);
- enumTestList.add(PowerModeQualificationStatus.POWER_MODE_EVALUATION_IN_PROGRESS);
- enumTestList.add(PowerModeQualificationStatus.NOT_DEFINED);
- enumTestList.add(PowerModeQualificationStatus.POWER_MODE_OK);
-
- 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/PowerModeStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeStatusTests.java
deleted file mode 100644
index 9154a06f0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PowerModeStatusTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.PowerModeStatus}
- */
-public class PowerModeStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "KEY_OUT";
- PowerModeStatus enumKeyOut = PowerModeStatus.valueForString(example);
- example = "KEY_RECENTLY_OUT";
- PowerModeStatus enumKeyRecentlyOut = PowerModeStatus.valueForString(example);
- example = "KEY_APPROVED_0";
- PowerModeStatus enumKeyApproved0 = PowerModeStatus.valueForString(example);
- example = "POST_ACCESORY_0";
- PowerModeStatus enumPostAccessory0 = PowerModeStatus.valueForString(example);
- example = "ACCESORY_1";
- PowerModeStatus enumAccessory1 = PowerModeStatus.valueForString(example);
- example = "POST_IGNITION_1";
- PowerModeStatus enumPostIgnition1 = PowerModeStatus.valueForString(example);
- example = "IGNITION_ON_2";
- PowerModeStatus enumIgnitionOn2 = PowerModeStatus.valueForString(example);
- example = "RUNNING_2";
- PowerModeStatus enumRunning2 = PowerModeStatus.valueForString(example);
- example = "CRANK_3";
- PowerModeStatus enumCrank3 = PowerModeStatus.valueForString(example);
-
- assertNotNull("KEY_OUT returned null", enumKeyOut);
- assertNotNull("KEY_RECENTLY_OUT returned null", enumKeyRecentlyOut);
- assertNotNull("KEY_APPROVED_0 returned null", enumKeyApproved0);
- assertNotNull("POST_ACCESORY_0 returned null", enumPostAccessory0);
- assertNotNull("ACCESORY_1 returned null", enumAccessory1);
- assertNotNull("POST_IGNITION_1 returned null", enumPostIgnition1);
- assertNotNull("IGNITION_ON_2 returned null", enumIgnitionOn2);
- assertNotNull("RUNNING_2 returned null", enumRunning2);
- assertNotNull("CRANK_3 returned null", enumCrank3);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "key_Out";
- try {
- PowerModeStatus temp = PowerModeStatus.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 {
- PowerModeStatus temp = PowerModeStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of PowerModeStatus.
- */
- public void testListEnum() {
- List<PowerModeStatus> enumValueList = Arrays.asList(PowerModeStatus.values());
-
- List<PowerModeStatus> enumTestList = new ArrayList<PowerModeStatus>();
- enumTestList.add(PowerModeStatus.KEY_OUT);
- enumTestList.add(PowerModeStatus.KEY_RECENTLY_OUT);
- enumTestList.add(PowerModeStatus.KEY_APPROVED_0);
- enumTestList.add(PowerModeStatus.POST_ACCESORY_0);
- enumTestList.add(PowerModeStatus.ACCESORY_1);
- enumTestList.add(PowerModeStatus.POST_IGNITION_1);
- enumTestList.add(PowerModeStatus.IGNITION_ON_2);
- enumTestList.add(PowerModeStatus.RUNNING_2);
- enumTestList.add(PowerModeStatus.CRANK_3);
-
- 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/PrerecordedSpeechTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrerecordedSpeechTests.java
deleted file mode 100644
index 9ab3c9db8..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrerecordedSpeechTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.PrerecordedSpeech}
- */
-public class PrerecordedSpeechTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "HELP_JINGLE";
- PrerecordedSpeech enumHelpJingle = PrerecordedSpeech.valueForString(example);
- example = "INITIAL_JINGLE";
- PrerecordedSpeech enumInitialJingle = PrerecordedSpeech.valueForString(example);
- example = "LISTEN_JINGLE";
- PrerecordedSpeech enumListenJingle = PrerecordedSpeech.valueForString(example);
- example = "POSITIVE_JINGLE";
- PrerecordedSpeech enumPositiveJingle = PrerecordedSpeech.valueForString(example);
- example = "NEGATIVE_JINGLE";
- PrerecordedSpeech enumNegativeJingle = PrerecordedSpeech.valueForString(example);
-
- assertNotNull("HELP_JINGLE returned null", enumHelpJingle);
- assertNotNull("INITIAL_JINGLE returned null", enumInitialJingle);
- assertNotNull("LISTEN_JINGLE returned null", enumListenJingle);
- assertNotNull("POSITIVE_JINGLE returned null", enumPositiveJingle);
- assertNotNull("NEGATIVE_JINGLE returned null", enumNegativeJingle);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "heLP_JingLE";
- try {
- PrerecordedSpeech temp = PrerecordedSpeech.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 {
- PrerecordedSpeech temp = PrerecordedSpeech.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of PrerecordedSpeech.
- */
- public void testListEnum() {
- List<PrerecordedSpeech> enumValueList = Arrays.asList(PrerecordedSpeech.values());
-
- List<PrerecordedSpeech> enumTestList = new ArrayList<PrerecordedSpeech>();
- enumTestList.add(PrerecordedSpeech.HELP_JINGLE);
- enumTestList.add(PrerecordedSpeech.INITIAL_JINGLE);
- enumTestList.add(PrerecordedSpeech.LISTEN_JINGLE);
- enumTestList.add(PrerecordedSpeech.POSITIVE_JINGLE);
- enumTestList.add(PrerecordedSpeech.NEGATIVE_JINGLE);
-
- 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/PrndlTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrndlTests.java
deleted file mode 100644
index fabf94177..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrndlTests.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.PRNDL;
-
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.Prndl}
- */
-public class PrndlTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "PARK";
- PRNDL enumPark = PRNDL.valueForString(example);
- example = "REVERSE";
- PRNDL enumReverse = PRNDL.valueForString(example);
- example = "NEUTRAL";
- PRNDL enumNeutral = PRNDL.valueForString(example);
- example = "DRIVE";
- PRNDL enumDrive = PRNDL.valueForString(example);
- example = "SPORT";
- PRNDL enumSport = PRNDL.valueForString(example);
- example = "LOWGEAR";
- PRNDL enumLowGear = PRNDL.valueForString(example);
- example = "FIRST";
- PRNDL enumFirst = PRNDL.valueForString(example);
- example = "SECOND";
- PRNDL enumSecond = PRNDL.valueForString(example);
- example = "THIRD";
- PRNDL enumThird = PRNDL.valueForString(example);
- example = "FOURTH";
- PRNDL enumFourth = PRNDL.valueForString(example);
- example = "FIFTH";
- PRNDL enumFifth = PRNDL.valueForString(example);
- example = "SIXTH";
- PRNDL enumSixth = PRNDL.valueForString(example);
- example = "SEVENTH";
- PRNDL enumSeventh = PRNDL.valueForString(example);
- example = "EIGHTH";
- PRNDL enumEighth = PRNDL.valueForString(example);
- example = "UNKNOWN";
- PRNDL enumUnknown = PRNDL.valueForString(example);
- example = "FAULT";
- PRNDL enumFault = PRNDL.valueForString(example);
-
- assertNotNull("PARK returned null", enumPark);
- assertNotNull("REVERSE returned null", enumReverse);
- assertNotNull("NEUTRAL returned null", enumNeutral);
- assertNotNull("DRIVE returned null", enumDrive);
- assertNotNull("SPORT returned null", enumSport);
- assertNotNull("LOWGEAR returned null", enumLowGear);
- assertNotNull("FIRST returned null", enumFirst);
- assertNotNull("SECOND returned null", enumSecond);
- assertNotNull("THIRD returned null", enumThird);
- assertNotNull("FOURTH returned null", enumFourth);
- assertNotNull("FIFTH returned null", enumFifth);
- assertNotNull("SIXTH returned null", enumSixth);
- assertNotNull("SEVENTH returned null", enumSeventh);
- assertNotNull("EIGHTH returned null", enumEighth);
- assertNotNull("UNKNOWN returned null", enumUnknown);
- assertNotNull("FAULT returned null", enumFault);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "pARk";
- try {
- PRNDL temp = PRNDL.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 {
- PRNDL temp = PRNDL.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of PRNDL.
- */
- public void testListEnum() {
- List<PRNDL> enumValueList = Arrays.asList(PRNDL.values());
-
- List<PRNDL> enumTestList = new ArrayList<PRNDL>();
- enumTestList.add(PRNDL.PARK);
- enumTestList.add(PRNDL.REVERSE);
- enumTestList.add(PRNDL.NEUTRAL);
- enumTestList.add(PRNDL.DRIVE);
- enumTestList.add(PRNDL.SPORT);
- enumTestList.add(PRNDL.LOWGEAR);
- enumTestList.add(PRNDL.FIRST);
- enumTestList.add(PRNDL.SECOND);
- enumTestList.add(PRNDL.THIRD);
- enumTestList.add(PRNDL.FOURTH);
- enumTestList.add(PRNDL.FIFTH);
- enumTestList.add(PRNDL.SIXTH);
- enumTestList.add(PRNDL.SEVENTH);
- enumTestList.add(PRNDL.EIGHTH);
- enumTestList.add(PRNDL.UNKNOWN);
- enumTestList.add(PRNDL.FAULT);
-
- 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/RequestTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java
deleted file mode 100644
index 4ae23815f..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.RequestType;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.RequestType}
- */
-public class RequestTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "HTTP";
- RequestType enumHttp = RequestType.valueForString(example);
- example = "FILE_RESUME";
- RequestType enumFileResume = RequestType.valueForString(example);
- example = "AUTH_REQUEST";
- RequestType enumAuthRequest = RequestType.valueForString(example);
- example = "AUTH_CHALLENGE";
- RequestType enumAuthChallenge = RequestType.valueForString(example);
- example = "AUTH_ACK";
- RequestType enumAuthAck = RequestType.valueForString(example);
- example = "PROPRIETARY";
- RequestType enumProprietary = RequestType.valueForString(example);
-
- example = "QUERY_APPS";
- RequestType enumQueryApps = RequestType.valueForString(example);
- example = "LAUNCH_APP";
- RequestType enumLaunchApp = RequestType.valueForString(example);
- example = "LOCK_SCREEN_ICON_URL";
- RequestType enumLockScreen = RequestType.valueForString(example);
- example = "TRAFFIC_MESSAGE_CHANNEL";
- RequestType enumTrafficMessage = RequestType.valueForString(example);
- example = "DRIVER_PROFILE";
- RequestType enumDriverProfile = RequestType.valueForString(example);
- example = "VOICE_SEARCH";
- RequestType enumVoiceSearch = RequestType.valueForString(example);
- example = "NAVIGATION";
- RequestType enumNavigation = RequestType.valueForString(example);
- example = "PHONE";
- RequestType enumPhone = RequestType.valueForString(example);
- example = "CLIMATE";
- RequestType enumClimate = RequestType.valueForString(example);
- example = "SETTINGS";
- RequestType enumSettings = RequestType.valueForString(example);
- example = "VEHICLE_DIAGNOSTICS";
- RequestType enumDiagnostics = RequestType.valueForString(example);
- example = "EMERGENCY";
- RequestType enumEmergency = RequestType.valueForString(example);
- example = "MEDIA";
- RequestType enumMedia = RequestType.valueForString(example);
- example = "FOTA";
- RequestType enumFota = RequestType.valueForString(example);
-
- assertNotNull("HTTP returned null", enumHttp);
- assertNotNull("FILE_RESUME returned null", enumFileResume);
- assertNotNull("AUTH_REQUEST returned null", enumAuthRequest);
- assertNotNull("AUTH_CHALLENGE returned null", enumAuthChallenge);
- assertNotNull("AUTH_ACK returned null", enumAuthAck);
- assertNotNull("PROPRIETARY returned null", enumProprietary);
-
- assertNotNull(Test.NOT_NULL, enumQueryApps);
- assertNotNull(Test.NOT_NULL, enumLaunchApp);
- assertNotNull(Test.NOT_NULL, enumLockScreen);
- assertNotNull(Test.NOT_NULL, enumTrafficMessage);
- assertNotNull(Test.NOT_NULL, enumDriverProfile);
- assertNotNull(Test.NOT_NULL, enumVoiceSearch);
- assertNotNull(Test.NOT_NULL, enumNavigation);
- assertNotNull(Test.NOT_NULL, enumPhone);
- assertNotNull(Test.NOT_NULL, enumClimate);
- assertNotNull(Test.NOT_NULL, enumSettings);
- assertNotNull(Test.NOT_NULL, enumDiagnostics);
- assertNotNull(Test.NOT_NULL, enumEmergency);
- assertNotNull(Test.NOT_NULL, enumMedia);
- assertNotNull(Test.NOT_NULL, enumFota);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "hTTp";
- try {
- RequestType temp = RequestType.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 {
- RequestType temp = RequestType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of RequestType.
- */
- public void testListEnum() {
- List<RequestType> enumValueList = Arrays.asList(RequestType.values());
-
- List<RequestType> enumTestList = new ArrayList<RequestType>();
- enumTestList.add(RequestType.HTTP);
- enumTestList.add(RequestType.FILE_RESUME);
- enumTestList.add(RequestType.AUTH_REQUEST);
- enumTestList.add(RequestType.AUTH_CHALLENGE);
- enumTestList.add(RequestType.AUTH_ACK);
- enumTestList.add(RequestType.PROPRIETARY);
-
- enumTestList.add(RequestType.QUERY_APPS);
- enumTestList.add(RequestType.LAUNCH_APP);
- enumTestList.add(RequestType.LOCK_SCREEN_ICON_URL);
- enumTestList.add(RequestType.TRAFFIC_MESSAGE_CHANNEL);
- enumTestList.add(RequestType.DRIVER_PROFILE);
- enumTestList.add(RequestType.VOICE_SEARCH);
- enumTestList.add(RequestType.NAVIGATION);
- enumTestList.add(RequestType.PHONE);
- enumTestList.add(RequestType.CLIMATE);
- enumTestList.add(RequestType.SETTINGS);
- enumTestList.add(RequestType.VEHICLE_DIAGNOSTICS);
- enumTestList.add(RequestType.EMERGENCY);
- enumTestList.add(RequestType.MEDIA);
- enumTestList.add(RequestType.FOTA);
- enumTestList.add(RequestType.OEM_SPECIFIC);
-
- 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/ResultTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ResultTests.java
deleted file mode 100644
index 4cea3acbe..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ResultTests.java
+++ /dev/null
@@ -1,203 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.enums.Result}
- */
-public class ResultTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "SUCCESS";
- Result enumSuccess = Result.valueForString(example);
- example = "INVALID_DATA";
- Result enumInvalidData = Result.valueForString(example);
- example = "UNSUPPORTED_REQUEST";
- Result enumUnsupportedRequest = Result.valueForString(example);
- example = "OUT_OF_MEMORY";
- Result enumOutOfMemory = Result.valueForString(example);
- example = "TOO_MANY_PENDING_REQUESTS";
- Result enumTooManyPendingRequests = Result.valueForString(example);
- example = "INVALID_ID";
- Result enumInvalidId = Result.valueForString(example);
- example = "DUPLICATE_NAME";
- Result enumDuplicateName = Result.valueForString(example);
- example = "TOO_MANY_APPLICATIONS";
- Result enumTooManyApplications = Result.valueForString(example);
- example = "APPLICATION_REGISTERED_ALREADY";
- Result enumApplicationRegisteredAlready = Result.valueForString(example);
- example = "UNSUPPORTED_VERSION";
- Result enumUnsupportedVersion = Result.valueForString(example);
- example = "WRONG_LANGUAGE";
- Result enumWrongLanguage = Result.valueForString(example);
- example = "APPLICATION_NOT_REGISTERED";
- Result enumApplicationNotRegistered = Result.valueForString(example);
- example = "IN_USE";
- Result enumInUse = Result.valueForString(example);
- example = "VEHICLE_DATA_NOT_ALLOWED";
- Result enumVehicleDataNotAllowed = Result.valueForString(example);
- example = "VEHICLE_DATA_NOT_AVAILABLE";
- Result enumVehicleDataNotAvailable = Result.valueForString(example);
- example = "REJECTED";
- Result enumRejected = Result.valueForString(example);
- example = "ABORTED";
- Result enumAborted = Result.valueForString(example);
- example = "IGNORED";
- Result enumIgnored = Result.valueForString(example);
- example = "UNSUPPORTED_RESOURCE";
- Result enumUnsupportedResource = Result.valueForString(example);
- example = "FILE_NOT_FOUND";
- Result enumFileNotFound = Result.valueForString(example);
- example = "GENERIC_ERROR";
- Result enumGenericError = Result.valueForString(example);
- example = "DISALLOWED";
- Result enumDisallowed = Result.valueForString(example);
- example = "USER_DISALLOWED";
- Result enumUserDisallowed = Result.valueForString(example);
- example = "TIMED_OUT";
- Result enumTimedOut = Result.valueForString(example);
- example = "CANCEL_ROUTE";
- Result enumCancelRoute = Result.valueForString(example);
- example = "TRUNCATED_DATA";
- Result enumTruncatedData = Result.valueForString(example);
- example = "RETRY";
- Result enumRetry = Result.valueForString(example);
- example = "WARNINGS";
- Result enumWarnings = Result.valueForString(example);
- example = "SAVED";
- Result enumSaved = Result.valueForString(example);
- example = "INVALID_CERT";
- Result enumInvalidCert = Result.valueForString(example);
- example = "EXPIRED_CERT";
- Result enumExpiredCert = Result.valueForString(example);
- example = "RESUME_FAILED";
- Result enumResumeFailed = Result.valueForString(example);
- example = "DATA_NOT_AVAILABLE";
- Result enumDataNotAvailable = Result.valueForString(example);
- example = "READ_ONLY";
- Result enumReadOnly = Result.valueForString(example);
- example = "CORRUPTED_DATA";
- Result enumCorruptData = Result.valueForString(example);
-
- assertNotNull("SUCCESS returned null", enumSuccess);
- assertNotNull("INVALID_DATA returned null", enumInvalidData);
- assertNotNull("UNSUPPORTED_REQUEST returned null", enumUnsupportedRequest);
- assertNotNull("OUT_OF_MEMORY returned null", enumOutOfMemory);
- assertNotNull("TOO_MANY_PENDING_REQUESTS returned null", enumTooManyPendingRequests);
- assertNotNull("INVALID_ID returned null", enumInvalidId);
- assertNotNull("DUPLICATE_NAME returned null", enumDuplicateName);
- assertNotNull("TOO_MANY_APPLICATIONS returned null", enumTooManyApplications);
- assertNotNull("APPLICATION_REGISTERED_ALREADY returned null", enumApplicationRegisteredAlready);
- assertNotNull("UNSUPPORTED_VERSION returned null", enumUnsupportedVersion);
- assertNotNull("WRONG_LANGUAGE returned null", enumWrongLanguage);
- assertNotNull("APPLICATION_NOT_REGISTERED returned null", enumApplicationNotRegistered);
- assertNotNull("IN_USE returned null", enumInUse);
- assertNotNull("VEHICLE_DATA_NOT_ALLOWED returned null", enumVehicleDataNotAllowed);
- assertNotNull("VEHICLE_DATA_NOT_AVAILABLE returned null", enumVehicleDataNotAvailable);
- assertNotNull("REJECTED returned null", enumRejected);
- assertNotNull("ABORTED returned null", enumAborted);
- assertNotNull("IGNORED returned null", enumIgnored);
- assertNotNull("UNSUPPORTED_RESOURCE returned null", enumUnsupportedResource);
- assertNotNull("FILE_NOT_FOUND returned null", enumFileNotFound);
- assertNotNull("GENERIC_ERROR returned null", enumGenericError);
- assertNotNull("DISALLOWED returned null", enumDisallowed);
- assertNotNull("USER_DISALLOWED returned null", enumUserDisallowed);
- assertNotNull("TIMED_OUT returned null", enumTimedOut);
- assertNotNull("CANCEL_ROUTE returned null", enumCancelRoute);
- assertNotNull("TRUNCATED_DATA returned null", enumTruncatedData);
- assertNotNull("RETRY returned null", enumRetry);
- assertNotNull("WARNINGS returned null", enumWarnings);
- assertNotNull("SAVED returned null", enumSaved);
- assertNotNull("INVALID_CERT returned null", enumInvalidCert);
- assertNotNull("EXPIRED_CERT returned null", enumExpiredCert);
- assertNotNull("RESUME_FAILED returned null", enumResumeFailed);
- assertNotNull("DATA_NOT_AVAILABLE returned null", enumDataNotAvailable);
- assertNotNull("READ_ONLY returned null", enumReadOnly);
- assertNotNull("CORRUPTED_DATA", enumCorruptData);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "suCcesS";
- try {
- Result temp = Result.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 {
- Result temp = Result.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of Result.
- */
- public void testListEnum() {
- List<Result> enumValueList = Arrays.asList(Result.values());
-
- List<Result> enumTestList = new ArrayList<Result>();
- enumTestList.add(Result.SUCCESS);
- enumTestList.add(Result.INVALID_DATA);
- enumTestList.add(Result.UNSUPPORTED_REQUEST);
- enumTestList.add(Result.OUT_OF_MEMORY);
- enumTestList.add(Result.TOO_MANY_PENDING_REQUESTS);
- enumTestList.add(Result.INVALID_ID);
- enumTestList.add(Result.DUPLICATE_NAME);
- enumTestList.add(Result.TOO_MANY_APPLICATIONS);
- enumTestList.add(Result.APPLICATION_REGISTERED_ALREADY);
- enumTestList.add(Result.UNSUPPORTED_VERSION);
- enumTestList.add(Result.WRONG_LANGUAGE);
- enumTestList.add(Result.APPLICATION_NOT_REGISTERED);
- enumTestList.add(Result.IN_USE);
- enumTestList.add(Result.VEHICLE_DATA_NOT_ALLOWED);
- enumTestList.add(Result.VEHICLE_DATA_NOT_AVAILABLE);
- enumTestList.add(Result.REJECTED);
- enumTestList.add(Result.ABORTED);
- enumTestList.add(Result.IGNORED);
- enumTestList.add(Result.UNSUPPORTED_RESOURCE);
- enumTestList.add(Result.FILE_NOT_FOUND);
- enumTestList.add(Result.GENERIC_ERROR);
- enumTestList.add(Result.DISALLOWED);
- enumTestList.add(Result.USER_DISALLOWED);
- enumTestList.add(Result.TIMED_OUT);
- enumTestList.add(Result.CANCEL_ROUTE);
- enumTestList.add(Result.TRUNCATED_DATA);
- enumTestList.add(Result.RETRY);
- enumTestList.add(Result.WARNINGS);
- enumTestList.add(Result.SAVED);
- enumTestList.add(Result.INVALID_CERT);
- enumTestList.add(Result.EXPIRED_CERT);
- enumTestList.add(Result.RESUME_FAILED);
- enumTestList.add(Result.DATA_NOT_AVAILABLE);
- enumTestList.add(Result.READ_ONLY);
- enumTestList.add(Result.CORRUPTED_DATA);
-
- 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/SamplingRateTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SamplingRateTests.java
deleted file mode 100644
index 062ce7df3..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SamplingRateTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.SamplingRate}
- */
-public class SamplingRateTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "8KHZ";
- SamplingRate enum8Khz = SamplingRate.valueForString(example);
- example = "16KHZ";
- SamplingRate enum16Khz = SamplingRate.valueForString(example);
- example = "22KHZ";
- SamplingRate enum22Khz = SamplingRate.valueForString(example);
- example = "44KHZ";
- SamplingRate enum44Khz = SamplingRate.valueForString(example);
-
- assertNotNull("8KHZ returned null", enum8Khz);
- assertNotNull("16KHZ returned null", enum16Khz);
- assertNotNull("22KHZ returned null", enum22Khz);
- assertNotNull("44KHZ returned null", enum44Khz);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "8kHz";
- try {
- SamplingRate temp = SamplingRate.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 {
- SamplingRate temp = SamplingRate.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of SamplingRate.
- */
- public void testListEnum() {
- List<SamplingRate> enumValueList = Arrays.asList(SamplingRate.values());
-
- List<SamplingRate> enumTestList = new ArrayList<SamplingRate>();
- enumTestList.add(SamplingRate._8KHZ);
- enumTestList.add(SamplingRate._16KHZ);
- enumTestList.add(SamplingRate._22KHZ);
- enumTestList.add(SamplingRate._44KHZ);
-
- 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/SdlDisconnectedReasonTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java
deleted file mode 100644
index 1b32c9544..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java
+++ /dev/null
@@ -1,174 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.SdlDisconnectedReason}
- */
-public class SdlDisconnectedReasonTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "USER_EXIT";
- SdlDisconnectedReason enumUserExit = SdlDisconnectedReason.valueForString(example);
- example = "IGNITION_OFF";
- SdlDisconnectedReason enumIgnitionOff = SdlDisconnectedReason.valueForString(example);
- example = "BLUETOOTH_OFF";
- SdlDisconnectedReason enumBluetoothOff = SdlDisconnectedReason.valueForString(example);
- example = "USB_DISCONNECTED";
- SdlDisconnectedReason enumUsbDisconnected = SdlDisconnectedReason.valueForString(example);
- example = "REQUEST_WHILE_IN_NONE_HMI_LEVEL";
- SdlDisconnectedReason enumRequestWhileInNoneHmiLevel = SdlDisconnectedReason.valueForString(example);
- example = "TOO_MANY_REQUESTS";
- SdlDisconnectedReason enumTooManyRequests = SdlDisconnectedReason.valueForString(example);
- example = "DRIVER_DISTRACTION_VIOLATION";
- SdlDisconnectedReason enumDriverDistractionViolation = SdlDisconnectedReason.valueForString(example);
- example = "LANGUAGE_CHANGE";
- SdlDisconnectedReason enumLanuguageChange = SdlDisconnectedReason.valueForString(example);
- example = "MASTER_RESET";
- SdlDisconnectedReason enumMasterReset = SdlDisconnectedReason.valueForString(example);
- example = "FACTORY_DEFAULTS";
- SdlDisconnectedReason enumFactoryDefaults = SdlDisconnectedReason.valueForString(example);
- example = "TRANSPORT_ERROR";
- SdlDisconnectedReason enumTransportError = SdlDisconnectedReason.valueForString(example);
- example = "APPLICATION_REQUESTED_DISCONNECT";
- SdlDisconnectedReason enumApplicationRequestedDisconnect = SdlDisconnectedReason.valueForString(example);
- example = "DEFAULT";
- SdlDisconnectedReason enumDefault = SdlDisconnectedReason.valueForString(example);
- example = "TRANSPORT_DISCONNECT";
- SdlDisconnectedReason enumTransportDisconnect = SdlDisconnectedReason.valueForString(example);
- example = "HB_TIMEOUT";
- SdlDisconnectedReason enumHbTimeout = SdlDisconnectedReason.valueForString(example);
- example = "BLUETOOTH_DISABLED";
- SdlDisconnectedReason enumBluetoothDisabled = SdlDisconnectedReason.valueForString(example);
- example = "BLUETOOTH_ADAPTER_ERROR";
- SdlDisconnectedReason enumBluetoothAdapterError = SdlDisconnectedReason.valueForString(example);
- example = "SDL_REGISTRATION_ERROR";
- SdlDisconnectedReason enumSdlRegistrationError = SdlDisconnectedReason.valueForString(example);
- example = "APP_INTERFACE_UNREG";
- SdlDisconnectedReason enumAppInterfaceUnreg = SdlDisconnectedReason.valueForString(example);
- example = "GENERIC_ERROR";
- SdlDisconnectedReason enumGenericError = SdlDisconnectedReason.valueForString(example);
- example = "LEGACY_BLUETOOTH_MODE_ENABLED";
- SdlDisconnectedReason enumLegacyMode = SdlDisconnectedReason.valueForString(example);
- example = "RPC_SESSION_ENDED";
- SdlDisconnectedReason enumRpcSessionEnded = SdlDisconnectedReason.valueForString(example);
-
- assertNotNull("USER_EXIT returned null", enumUserExit);
- assertNotNull("IGNITION_OFF returned null", enumIgnitionOff);
- assertNotNull("BLUETOOTH_OFF returned null", enumBluetoothOff);
- assertNotNull("USB_DISCONNECTED returned null", enumUsbDisconnected);
- assertNotNull("REQUEST_WHILE_IN_NONE_HMI_LEVEL returned null", enumRequestWhileInNoneHmiLevel);
- assertNotNull("TOO_MANY_REQUESTS returned null", enumTooManyRequests);
- assertNotNull("DRIVER_DISTRACTION_VIOLATION returned null", enumDriverDistractionViolation);
- assertNotNull("LANGUAGE_CHANGE returned null", enumLanuguageChange);
- assertNotNull("MASTER_RESET returned null", enumMasterReset);
- assertNotNull("FACTORY_DEFAULTS returned null", enumFactoryDefaults);
- assertNotNull("TRANSPORT_ERROR returned null", enumTransportError);
- assertNotNull("APPLICATION_REQUESTED_DISCONNECT returned null", enumApplicationRequestedDisconnect);
- assertNotNull("DEFAULT returned null", enumDefault);
- assertNotNull("TRANSPORT_DISCONNECT returned null", enumTransportDisconnect);
- assertNotNull("HB_TIMEOUT returned null", enumHbTimeout);
- assertNotNull("BLUETOOTH_DISABLED returned null", enumBluetoothDisabled);
- assertNotNull("BLUETOOTH_ADAPTER_ERROR returned null", enumBluetoothAdapterError);
- assertNotNull("SDL_REGISTRATION_ERROR returned null", enumSdlRegistrationError);
- assertNotNull("APP_INTERFACE_UNREG returned null", enumAppInterfaceUnreg);
- assertNotNull("GENERIC_ERROR returned null", enumGenericError);
- assertNotNull("LEGACY_BLUETOOTH_MODE_ENABLED returned null", enumLegacyMode);
- assertNotNull("RPC_SESSION_ENDED returned null", enumRpcSessionEnded);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "uSer_ExiT";
- try {
- SdlDisconnectedReason temp = SdlDisconnectedReason.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 {
- SdlDisconnectedReason temp = SdlDisconnectedReason.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of SdlDisconnectedReason.
- */
- public void testListEnum() {
- List<SdlDisconnectedReason> enumValueList = Arrays.asList(SdlDisconnectedReason.values());
-
- List<SdlDisconnectedReason> enumTestList = new ArrayList<SdlDisconnectedReason>();
- enumTestList.add(SdlDisconnectedReason.USER_EXIT);
- enumTestList.add(SdlDisconnectedReason.IGNITION_OFF);
- enumTestList.add(SdlDisconnectedReason.BLUETOOTH_OFF);
- enumTestList.add(SdlDisconnectedReason.USB_DISCONNECTED);
- enumTestList.add(SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL);
- enumTestList.add(SdlDisconnectedReason.TOO_MANY_REQUESTS);
- enumTestList.add(SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION);
- enumTestList.add(SdlDisconnectedReason.LANGUAGE_CHANGE);
- enumTestList.add(SdlDisconnectedReason.MASTER_RESET);
- enumTestList.add(SdlDisconnectedReason.FACTORY_DEFAULTS);
- enumTestList.add(SdlDisconnectedReason.TRANSPORT_ERROR);
- enumTestList.add(SdlDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);
- enumTestList.add(SdlDisconnectedReason.DEFAULT);
- enumTestList.add(SdlDisconnectedReason.TRANSPORT_DISCONNECT);
- enumTestList.add(SdlDisconnectedReason.HB_TIMEOUT);
- enumTestList.add(SdlDisconnectedReason.BLUETOOTH_DISABLED);
- enumTestList.add(SdlDisconnectedReason.BLUETOOTH_ADAPTER_ERROR);
- enumTestList.add(SdlDisconnectedReason.SDL_REGISTRATION_ERROR);
- enumTestList.add(SdlDisconnectedReason.APP_INTERFACE_UNREG);
- enumTestList.add(SdlDisconnectedReason.GENERIC_ERROR);
- enumTestList.add(SdlDisconnectedReason.LEGACY_BLUETOOTH_MODE_ENABLED);
- enumTestList.add(SdlDisconnectedReason.RPC_SESSION_ENDED);
- enumTestList.add(SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST);
-
- assertTrue("Enum value list does not match enum class list",
- enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
- }
-
- /**
- * Verifies the valid returns of the conversion method,
- * {@link com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason#convertAppInterfaceunregisteredReason(AppInterfaceUnregisteredReason)}
- */
- public void testConvertMethod () {
- assertEquals(Test.MATCH, SdlDisconnectedReason.DEFAULT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED));
- assertEquals(Test.MATCH, SdlDisconnectedReason.BLUETOOTH_OFF, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.BLUETOOTH_OFF));
- assertEquals(Test.MATCH, SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.DRIVER_DISTRACTION_VIOLATION));
- assertEquals(Test.MATCH, SdlDisconnectedReason.FACTORY_DEFAULTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.FACTORY_DEFAULTS));
- assertEquals(Test.MATCH, SdlDisconnectedReason.IGNITION_OFF, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.IGNITION_OFF));
- assertEquals(Test.MATCH, SdlDisconnectedReason.LANGUAGE_CHANGE, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.LANGUAGE_CHANGE));
- assertEquals(Test.MATCH, SdlDisconnectedReason.MASTER_RESET, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.MASTER_RESET));
- assertEquals(Test.MATCH, SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL));
- assertEquals(Test.MATCH, SdlDisconnectedReason.TOO_MANY_REQUESTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.TOO_MANY_REQUESTS));
- assertEquals(Test.MATCH, SdlDisconnectedReason.USB_DISCONNECTED, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USB_DISCONNECTED));
- assertEquals(Test.MATCH, SdlDisconnectedReason.USER_EXIT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USER_EXIT));
- assertNull(Test.MATCH, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(null));
- }
-
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SoftButtonTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SoftButtonTypeTests.java
deleted file mode 100644
index d4ef5c0ff..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SoftButtonTypeTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.SoftButtonType}
- */
-public class SoftButtonTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "TEXT";
- SoftButtonType enumText = SoftButtonType.valueForString(example);
- example = "IMAGE";
- SoftButtonType enumImage = SoftButtonType.valueForString(example);
- example = "BOTH";
- SoftButtonType enumBoth = SoftButtonType.valueForString(example);
-
- assertNotNull("TEXT returned null", enumText);
- assertNotNull("IMAGE returned null", enumImage);
- assertNotNull("BOTH returned null", enumBoth);
- }
-
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "teXT";
- try {
- SoftButtonType temp = SoftButtonType.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 {
- SoftButtonType temp = SoftButtonType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of SoftButtonType.
- */
- public void testListEnum() {
- List<SoftButtonType> enumValueList = Arrays.asList(SoftButtonType.values());
-
- List<SoftButtonType> enumTestList = new ArrayList<SoftButtonType>();
- enumTestList.add(SoftButtonType.SBT_TEXT);
- enumTestList.add(SoftButtonType.SBT_IMAGE);
- enumTestList.add(SoftButtonType.SBT_BOTH);
-
- 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/SpeechCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SpeechCapabilitiesTests.java
deleted file mode 100644
index 364f7c896..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SpeechCapabilitiesTests.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.SpeechCapabilities}
- */
-public class SpeechCapabilitiesTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "TEXT";
- SpeechCapabilities enumText = SpeechCapabilities.valueForString(example);
- example = "SAPI_PHONEMES";
- SpeechCapabilities enumSapiPhonemes = SpeechCapabilities.valueForString(example);
- example = "LHPLUS_PHONEMES";
- SpeechCapabilities enumLhplusPhonemes = SpeechCapabilities.valueForString(example);
- example = "PRE_RECORDED";
- SpeechCapabilities enumPreRecorded = SpeechCapabilities.valueForString(example);
- example = "SILENCE";
- SpeechCapabilities enumSilence = SpeechCapabilities.valueForString(example);
-
- assertNotNull("TEXT returned null", enumText);
- assertNotNull("SAPI_PHONEMES returned null", enumSapiPhonemes);
- assertNotNull("LHPLUS_PHONEMES returned null", enumLhplusPhonemes);
- assertNotNull("PRE_RECORDED returned null", enumPreRecorded);
- assertNotNull("SILENCE returned null", enumSilence);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "teXT";
- try {
- SpeechCapabilities temp = SpeechCapabilities.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 {
- SpeechCapabilities temp = SpeechCapabilities.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of SpeechCapabilities.
- */
- public void testListEnum() {
- List<SpeechCapabilities> enumValueList = Arrays.asList(SpeechCapabilities.values());
-
- List<SpeechCapabilities> enumTestList = new ArrayList<SpeechCapabilities>();
- enumTestList.add(SpeechCapabilities.TEXT);
- enumTestList.add(SpeechCapabilities.SAPI_PHONEMES);
- enumTestList.add(SpeechCapabilities.LHPLUS_PHONEMES);
- enumTestList.add(SpeechCapabilities.PRE_RECORDED);
- enumTestList.add(SpeechCapabilities.SILENCE);
- enumTestList.add(SpeechCapabilities.FILE);
-
- 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/SystemActionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemActionTests.java
deleted file mode 100644
index 807da0b8a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemActionTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.SystemAction;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.SystemAction}
- */
-public class SystemActionTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "DEFAULT_ACTION";
- SystemAction enumDefaultAction = SystemAction.valueForString(example);
- example = "STEAL_FOCUS";
- SystemAction enumStealFocus = SystemAction.valueForString(example);
- example = "KEEP_CONTEXT";
- SystemAction enumKeepContext = SystemAction.valueForString(example);
-
- assertNotNull("DEFAULT_ACTION returned null", enumDefaultAction);
- assertNotNull("STEAL_FOCUS returned null", enumStealFocus);
- assertNotNull("KEEP_CONTEXT returned null", enumKeepContext);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "deFaulT_ActiON";
- try {
- SystemAction temp = SystemAction.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 {
- SystemAction temp = SystemAction.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of SystemAction.
- */
- public void testListEnum() {
- List<SystemAction> enumValueList = Arrays.asList(SystemAction.values());
-
- List<SystemAction> enumTestList = new ArrayList<SystemAction>();
- enumTestList.add(SystemAction.DEFAULT_ACTION);
- enumTestList.add(SystemAction.STEAL_FOCUS);
- enumTestList.add(SystemAction.KEEP_CONTEXT);
-
- 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/SystemCapabilityTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemCapabilityTypeTests.java
deleted file mode 100644
index 9bd68a2ad..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemCapabilityTypeTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-
-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.SystemCapabilityType}
- */
-public class SystemCapabilityTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NAVIGATION";
- SystemCapabilityType enumNavigation = SystemCapabilityType.valueForString(example);
- example = "PHONE_CALL";
- SystemCapabilityType enumPhoneCall = SystemCapabilityType.valueForString(example);
- example = "VIDEO_STREAMING";
- SystemCapabilityType enumVideoStreaming = SystemCapabilityType.valueForString(example);
- example = "REMOTE_CONTROL";
- SystemCapabilityType enumRemoteControl = SystemCapabilityType.valueForString(example);
- example = "HMI";
- SystemCapabilityType enumHmi = SystemCapabilityType.valueForString(example);
- example = "DISPLAY";
- SystemCapabilityType enumDisplay = SystemCapabilityType.valueForString(example);
- example = "AUDIO_PASSTHROUGH";
- SystemCapabilityType enumAudioPassThrough = SystemCapabilityType.valueForString(example);
- example = "BUTTON";
- SystemCapabilityType enumButton = SystemCapabilityType.valueForString(example);
- example = "HMI_ZONE";
- SystemCapabilityType enumHmiZone = SystemCapabilityType.valueForString(example);
- example = "PRESET_BANK";
- SystemCapabilityType enumPresetBank = SystemCapabilityType.valueForString(example);
- example = "SOFTBUTTON";
- SystemCapabilityType enumSoftButton = SystemCapabilityType.valueForString(example);
- example = "SPEECH";
- SystemCapabilityType enumSpeech = SystemCapabilityType.valueForString(example);
- example = "VOICE_RECOGNITION";
- SystemCapabilityType enumVoiceRecognition = SystemCapabilityType.valueForString(example);
- example = "PCM_STREAMING";
- SystemCapabilityType enumPCM = SystemCapabilityType.valueForString(example);
-
- assertNotNull("NAVIGATION returned null", enumNavigation);
- assertNotNull("PHONE_CALL returned null", enumPhoneCall);
- assertNotNull("VIDEO_STREAMING returned null", enumVideoStreaming);
- assertNotNull("REMOTE_CONTROL returned null", enumRemoteControl);
- assertNotNull("HMI returned null", enumHmi);
- assertNotNull("DISPLAY returned null", enumDisplay);
- assertNotNull("AUDIO_PASSTHROUGH returned null", enumAudioPassThrough);
- assertNotNull("BUTTON returned null", enumButton);
- assertNotNull("HMI_ZONE returned null", enumHmiZone);
- assertNotNull("PRESET_BANK returned null", enumPresetBank);
- assertNotNull("SOFTBUTTON returned null", enumSoftButton);
- assertNotNull("SPEECH returned null", enumSpeech);
- assertNotNull("VOICE_RECOGNITION returned null", enumVoiceRecognition);
- assertNotNull("PCM_STREAMING", enumPCM);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "nAVIGATION";
- try {
- SystemCapabilityType temp = SystemCapabilityType.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 {
- SystemCapabilityType temp = SystemCapabilityType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of SystemCapabilityType.
- */
- public void testListEnum() {
- List<SystemCapabilityType> enumValueList = Arrays.asList(SystemCapabilityType.values());
-
- List<SystemCapabilityType> enumTestList = new ArrayList<SystemCapabilityType>();
- enumTestList.add(SystemCapabilityType.NAVIGATION);
- enumTestList.add(SystemCapabilityType.PHONE_CALL);
- enumTestList.add(SystemCapabilityType.VIDEO_STREAMING);
- enumTestList.add(SystemCapabilityType.REMOTE_CONTROL);
- enumTestList.add(SystemCapabilityType.HMI);
- enumTestList.add(SystemCapabilityType.DISPLAY);
- enumTestList.add(SystemCapabilityType.AUDIO_PASSTHROUGH);
- enumTestList.add(SystemCapabilityType.BUTTON);
- enumTestList.add(SystemCapabilityType.HMI_ZONE);
- enumTestList.add(SystemCapabilityType.PRESET_BANK);
- enumTestList.add(SystemCapabilityType.SOFTBUTTON);
- enumTestList.add(SystemCapabilityType.SPEECH);
- enumTestList.add(SystemCapabilityType.VOICE_RECOGNITION);
- enumTestList.add(SystemCapabilityType.PCM_STREAMING);
-
- 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/SystemContextTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemContextTests.java
deleted file mode 100644
index 9b325492e..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SystemContextTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.SystemContext;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.SystemContext}
- */
-public class SystemContextTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "MAIN";
- SystemContext enumMain = SystemContext.valueForString(example);
- example = "VRSESSION";
- SystemContext enumVrSession = SystemContext.valueForString(example);
- example = "MENU";
- SystemContext enumMenu = SystemContext.valueForString(example);
- example = "HMI_OBSCURED";
- SystemContext enumHmiObscured = SystemContext.valueForString(example);
- example = "ALERT";
- SystemContext enumAlert = SystemContext.valueForString(example);
-
- assertNotNull("MAIN returned null", enumMain);
- assertNotNull("VRSESSION returned null", enumVrSession);
- assertNotNull("MENU returned null", enumMenu);
- assertNotNull("HMI_OBSCURED returned null", enumHmiObscured);
- assertNotNull("ALERT returned null", enumAlert);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "mAIn";
- try {
- SystemContext temp = SystemContext.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 {
- SystemContext temp = SystemContext.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of SystemContext.
- */
- public void testListEnum() {
- List<SystemContext> enumValueList = Arrays.asList(SystemContext.values());
-
- List<SystemContext> enumTestList = new ArrayList<SystemContext>();
- enumTestList.add(SystemContext.SYSCTXT_MAIN);
- enumTestList.add(SystemContext.SYSCTXT_VRSESSION);
- enumTestList.add(SystemContext.SYSCTXT_MENU);
- enumTestList.add(SystemContext.SYSCTXT_HMI_OBSCURED);
- enumTestList.add(SystemContext.SYSCTXT_ALERT);
-
- 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/TbtStateTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TbtStateTests.java
deleted file mode 100644
index 1fbf8055a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TbtStateTests.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.TBTState;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.TbtState}
- */
-public class TbtStateTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "ROUTE_UPDATE_REQUEST";
- TBTState enumRouteUpdateRequest = TBTState.valueForString(example);
- example = "ROUTE_ACCEPTED";
- TBTState enumRouteAccepted = TBTState.valueForString(example);
- example = "ROUTE_REFUSED";
- TBTState enumRouteRefused = TBTState.valueForString(example);
- example = "ROUTE_CANCELLED";
- TBTState enumRouteCancelled = TBTState.valueForString(example);
- example = "ETA_REQUEST";
- TBTState enumEtaEquest = TBTState.valueForString(example);
- example = "NEXT_TURN_REQUEST";
- TBTState enumNextTurnRequest = TBTState.valueForString(example);
- example = "ROUTE_STATUS_REQUEST";
- TBTState enumRouteStatusRequest = TBTState.valueForString(example);
- example = "ROUTE_SUMMARY_REQUEST";
- TBTState enumRouteSummaryRequest = TBTState.valueForString(example);
- example = "TRIP_STATUS_REQUEST";
- TBTState enumTripStatusRequest = TBTState.valueForString(example);
- example = "ROUTE_UPDATE_REQUEST_TIMEOUT";
- TBTState enumRouteUpdateRequestTimeout = TBTState.valueForString(example);
-
- assertNotNull("ROUTE_UPDATE_REQUEST returned null", enumRouteUpdateRequest);
- assertNotNull("ROUTE_ACCEPTED returned null", enumRouteAccepted);
- assertNotNull("ROUTE_REFUSED returned null", enumRouteRefused);
- assertNotNull("ROUTE_CANCELLED returned null", enumRouteCancelled);
- assertNotNull("ETA_REQUEST returned null", enumEtaEquest);
- assertNotNull("NEXT_TURN_REQUEST returned null", enumNextTurnRequest);
- assertNotNull("ROUTE_STATUS_REQUEST returned null", enumRouteStatusRequest);
- assertNotNull("ROUTE_SUMMARY_REQUEST returned null", enumRouteSummaryRequest);
- assertNotNull("TRIP_STATUS_REQUEST returned null", enumTripStatusRequest);
- assertNotNull("ROUTE_UPDATE_REQUEST_TIMEOUT returned null", enumRouteUpdateRequestTimeout);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "rOUte_UpDAte_reQuesT";
- try {
- TBTState temp = TBTState.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 {
- TBTState temp = TBTState.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of TBTState.
- */
- public void testListEnum() {
- List<TBTState> enumValueList = Arrays.asList(TBTState.values());
-
- List<TBTState> enumTestList = new ArrayList<TBTState>();
- enumTestList.add(TBTState.ROUTE_UPDATE_REQUEST);
- enumTestList.add(TBTState.ROUTE_ACCEPTED);
- enumTestList.add(TBTState.ROUTE_REFUSED);
- enumTestList.add(TBTState.ROUTE_CANCELLED);
- enumTestList.add(TBTState.ETA_REQUEST);
- enumTestList.add(TBTState.NEXT_TURN_REQUEST);
- enumTestList.add(TBTState.ROUTE_STATUS_REQUEST);
- enumTestList.add(TBTState.ROUTE_SUMMARY_REQUEST);
- enumTestList.add(TBTState.TRIP_STATUS_REQUEST);
- enumTestList.add(TBTState.ROUTE_UPDATE_REQUEST_TIMEOUT);
-
- 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/TextAlignmentTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextAlignmentTests.java
deleted file mode 100644
index 1b1130806..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextAlignmentTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.TextAlignment}
- */
-public class TextAlignmentTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "LEFT_ALIGNED";
- TextAlignment enumLeftAligned = TextAlignment.valueForString(example);
- example = "RIGHT_ALIGNED";
- TextAlignment enumRightAligned = TextAlignment.valueForString(example);
- example = "CENTERED";
- TextAlignment enumCentered = TextAlignment.valueForString(example);
-
- assertNotNull("LEFT_ALIGNED returned null", enumLeftAligned);
- assertNotNull("RIGHT_ALIGNED returned null", enumRightAligned);
- assertNotNull("CENTERED returned null", enumCentered);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "leFT_AliGned";
- try {
- TextAlignment temp = TextAlignment.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 {
- TextAlignment temp = TextAlignment.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of TextAlignment.
- */
- public void testListEnum() {
- List<TextAlignment> enumValueList = Arrays.asList(TextAlignment.values());
-
- List<TextAlignment> enumTestList = new ArrayList<TextAlignment>();
- enumTestList.add(TextAlignment.LEFT_ALIGNED);
- enumTestList.add(TextAlignment.RIGHT_ALIGNED);
- enumTestList.add(TextAlignment.CENTERED);
-
- 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/TextFieldNameTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java
deleted file mode 100644
index 7d0050e66..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java
+++ /dev/null
@@ -1,178 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.TextFieldName}
- */
-public class TextFieldNameTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "mainField1";
- TextFieldName enumMainField1 = TextFieldName.valueForString(example);
- example = "mainField2";
- TextFieldName enumMainField2 = TextFieldName.valueForString(example);
- example = "mainField3";
- TextFieldName enumMainField3 = TextFieldName.valueForString(example);
- example = "mainField4";
- TextFieldName enumMainField4 = TextFieldName.valueForString(example);
- example = "statusBar";
- TextFieldName enumStatusBar = TextFieldName.valueForString(example);
- example = "mediaClock";
- TextFieldName enumMediaClock = TextFieldName.valueForString(example);
- example = "mediaTrack";
- TextFieldName enumMediaTrack = TextFieldName.valueForString(example);
- example = "alertText1";
- TextFieldName enumAlertText1 = TextFieldName.valueForString(example);
- example = "alertText2";
- TextFieldName enumAlertText2 = TextFieldName.valueForString(example);
- example = "alertText3";
- TextFieldName enumAlertText3 = TextFieldName.valueForString(example);
- example = "scrollableMessageBody";
- TextFieldName enumScrollableMessageBody = TextFieldName.valueForString(example);
- example = "initialInteractionText";
- TextFieldName enumInitialInteractionText = TextFieldName.valueForString(example);
- example = "navigationText1";
- TextFieldName enumNavigationText1 = TextFieldName.valueForString(example);
- example = "navigationText2";
- TextFieldName enumNavigationText2 = TextFieldName.valueForString(example);
- example = "ETA";
- TextFieldName enumEta = TextFieldName.valueForString(example);
- example = "totalDistance";
- TextFieldName enumTotalDistance = TextFieldName.valueForString(example);
- example = "audioPassThruDisplayText1";
- TextFieldName enumAudioPassThruDisplayText1 = TextFieldName.valueForString(example);
- example = "audioPassThruDisplayText2";
- TextFieldName enumAudioPassThruDisplayText2 = TextFieldName.valueForString(example);
- example = "sliderHeader";
- TextFieldName enumSliderHeader = TextFieldName.valueForString(example);
- example = "sliderFooter";
- TextFieldName enumSliderFooter = TextFieldName.valueForString(example);
- example = "menuName";
- TextFieldName enumMenuName = TextFieldName.valueForString(example);
- example = "secondaryText";
- TextFieldName enumSecondaryText = TextFieldName.valueForString(example);
- example = "tertiaryText";
- TextFieldName enumTertiaryText = TextFieldName.valueForString(example);
- example = "menuTitle";
- TextFieldName enumMenuTitle = TextFieldName.valueForString(example);
- example = "locationName";
- TextFieldName enumLocName = TextFieldName.valueForString(example);
- example = "locationDescription";
- TextFieldName enumLocDesc = TextFieldName.valueForString(example);
- example = "addressLines";
- TextFieldName enumAddLines = TextFieldName.valueForString(example);
- example = "phoneNumber";
- TextFieldName enumPhone = TextFieldName.valueForString(example);
-
- assertNotNull("mainField1 returned null", enumMainField1);
- assertNotNull("mainField2 returned null", enumMainField2);
- assertNotNull("mainField3 returned null", enumMainField3);
- assertNotNull("mainField4 returned null", enumMainField4);
- assertNotNull("statusBar returned null", enumStatusBar);
- assertNotNull("mediaClock returned null", enumMediaClock);
- assertNotNull("mediaTrack returned null", enumMediaTrack);
- assertNotNull("alertText1 returned null", enumAlertText1);
- assertNotNull("alertText2 returned null", enumAlertText2);
- assertNotNull("alertText3 returned null", enumAlertText3);
- assertNotNull("scrollableMessageBody returned null", enumScrollableMessageBody);
- assertNotNull("initialInteractionText returned null", enumInitialInteractionText);
- assertNotNull("navigationText1 returned null", enumNavigationText1);
- assertNotNull("navigationText2 returned null", enumNavigationText2);
- assertNotNull("ETA returned null", enumEta);
- assertNotNull("totalDistance returned null", enumTotalDistance);
- assertNotNull("audioPassThruDisplayText1 returned null", enumAudioPassThruDisplayText1);
- assertNotNull("audioPassThruDisplayText2 returned null", enumAudioPassThruDisplayText2);
- assertNotNull("sliderHeader returned null", enumSliderHeader);
- assertNotNull("sliderFooter returned null", enumSliderFooter);
- assertNotNull("menuName returned null", enumMenuName);
- assertNotNull("secondaryText returned null", enumSecondaryText);
- assertNotNull("tertiaryText returned null", enumTertiaryText);
- assertNotNull("menuTitle returned null", enumMenuTitle);
-
- assertNotNull(Test.NOT_NULL, enumLocName);
- assertNotNull(Test.NOT_NULL, enumLocDesc);
- assertNotNull(Test.NOT_NULL, enumAddLines);
- assertNotNull(Test.NOT_NULL, enumPhone);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "mAinField1";
- try {
- TextFieldName temp = TextFieldName.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 {
- TextFieldName temp = TextFieldName.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of TextFieldName.
- */
- public void testListEnum() {
- List<TextFieldName> enumValueList = Arrays.asList(TextFieldName.values());
-
- List<TextFieldName> enumTestList = new ArrayList<TextFieldName>();
- enumTestList.add(TextFieldName.mainField1);
- enumTestList.add(TextFieldName.mainField2);
- enumTestList.add(TextFieldName.mainField3);
- enumTestList.add(TextFieldName.mainField4);
- enumTestList.add(TextFieldName.statusBar);
- enumTestList.add(TextFieldName.mediaClock);
- enumTestList.add(TextFieldName.mediaTrack);
- enumTestList.add(TextFieldName.alertText1);
- enumTestList.add(TextFieldName.alertText2);
- enumTestList.add(TextFieldName.alertText3);
- enumTestList.add(TextFieldName.scrollableMessageBody);
- enumTestList.add(TextFieldName.initialInteractionText);
- enumTestList.add(TextFieldName.navigationText1);
- enumTestList.add(TextFieldName.navigationText2);
- enumTestList.add(TextFieldName.ETA);
- enumTestList.add(TextFieldName.totalDistance);
- enumTestList.add(TextFieldName.audioPassThruDisplayText1);
- enumTestList.add(TextFieldName.audioPassThruDisplayText2);
- enumTestList.add(TextFieldName.sliderHeader);
- enumTestList.add(TextFieldName.sliderFooter);
- enumTestList.add(TextFieldName.menuName);
- enumTestList.add(TextFieldName.secondaryText);
- enumTestList.add(TextFieldName.tertiaryText);
- enumTestList.add(TextFieldName.menuTitle);
-
- enumTestList.add(TextFieldName.locationName);
- enumTestList.add(TextFieldName.locationDescription);
- enumTestList.add(TextFieldName.addressLines);
- enumTestList.add(TextFieldName.phoneNumber);
-
- 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/TriggerSourceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TriggerSourceTests.java
deleted file mode 100644
index 5197dec64..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TriggerSourceTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.TriggerSource}
- */
-public class TriggerSourceTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "MENU";
- TriggerSource enumMenu = TriggerSource.valueForString(example);
- example = "VR";
- TriggerSource enumVr = TriggerSource.valueForString(example);
- example = "KEYBOARD";
- TriggerSource enumKeyboard = TriggerSource.valueForString(example);
-
- assertNotNull("MENU returned null", enumMenu);
- assertNotNull("VR returned null", enumVr);
- assertNotNull("KEYBOARD returned null", enumKeyboard);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "meNU";
- try {
- TriggerSource temp = TriggerSource.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 {
- TriggerSource temp = TriggerSource.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
-
- /**
- * Verifies the possible enum values of TriggerSource.
- */
- public void testListEnum() {
- List<TriggerSource> enumValueList = Arrays.asList(TriggerSource.values());
-
- List<TriggerSource> enumTestList = new ArrayList<TriggerSource>();
- enumTestList.add(TriggerSource.TS_MENU);
- enumTestList.add(TriggerSource.TS_VR);
- enumTestList.add(TriggerSource.TS_KEYBOARD);
-
- 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/UpdateModeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/UpdateModeTests.java
deleted file mode 100644
index 2c808ef03..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/UpdateModeTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.UpdateMode}
- */
-public class UpdateModeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "COUNTUP";
- UpdateMode enumCountUp = UpdateMode.valueForString(example);
- example = "COUNTDOWN";
- UpdateMode enumCountDown = UpdateMode.valueForString(example);
- example = "PAUSE";
- UpdateMode enumPause = UpdateMode.valueForString(example);
- example = "RESUME";
- UpdateMode enumResume = UpdateMode.valueForString(example);
- example = "CLEAR";
- UpdateMode enumClear = UpdateMode.valueForString(example);
-
- assertNotNull("COUNTUP returned null", enumCountUp);
- assertNotNull("COUNTDOWN returned null", enumCountDown);
- assertNotNull("PAUSE returned null", enumPause);
- assertNotNull("RESUME returned null", enumResume);
- assertNotNull("CLEAR returned null", enumClear);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "coUnTUp";
- try {
- UpdateMode temp = UpdateMode.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 {
- UpdateMode temp = UpdateMode.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of UpdateMode.
- */
- public void testListEnum() {
- List<UpdateMode> enumValueList = Arrays.asList(UpdateMode.values());
-
- List<UpdateMode> enumTestList = new ArrayList<UpdateMode>();
- enumTestList.add(UpdateMode.COUNTUP);
- enumTestList.add(UpdateMode.COUNTDOWN);
- enumTestList.add(UpdateMode.PAUSE);
- enumTestList.add(UpdateMode.RESUME);
- enumTestList.add(UpdateMode.CLEAR);
-
- 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/VehicleDataEventStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataEventStatusTests.java
deleted file mode 100644
index bcee65b19..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataEventStatusTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.VehicleDataEventStatus}
- */
-public class VehicleDataEventStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NO_EVENT";
- VehicleDataEventStatus enumNoEvent = VehicleDataEventStatus.valueForString(example);
- example = "NO";
- VehicleDataEventStatus enumNo = VehicleDataEventStatus.valueForString(example);
- example = "YES";
- VehicleDataEventStatus enumYes = VehicleDataEventStatus.valueForString(example);
- example = "NOT_SUPPORTED";
- VehicleDataEventStatus enumNotSupported = VehicleDataEventStatus.valueForString(example);
- example = "FAULT";
- VehicleDataEventStatus enumFault = VehicleDataEventStatus.valueForString(example);
-
- assertNotNull("NO_EVENT returned null", enumNoEvent);
- assertNotNull("NO returned null", enumNo);
- assertNotNull("YES returned null", enumYes);
- assertNotNull("NOT_SUPPORTED returned null", enumNotSupported);
- assertNotNull("FAULT returned null", enumFault);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "no_EveNT";
- try {
- VehicleDataEventStatus temp = VehicleDataEventStatus.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 {
- VehicleDataEventStatus temp = VehicleDataEventStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of AmbientLightStatus.
- */
- public void testListEnum() {
- List<VehicleDataEventStatus> enumValueList = Arrays.asList(VehicleDataEventStatus.values());
-
- List<VehicleDataEventStatus> enumTestList = new ArrayList<VehicleDataEventStatus>();
- enumTestList.add(VehicleDataEventStatus.NO_EVENT);
- enumTestList.add(VehicleDataEventStatus.NO);
- enumTestList.add(VehicleDataEventStatus.YES);
- enumTestList.add(VehicleDataEventStatus.NOT_SUPPORTED);
- enumTestList.add(VehicleDataEventStatus.FAULT);
-
- 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/VehicleDataNotificationStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataNotificationStatusTests.java
deleted file mode 100644
index af2f45714..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataNotificationStatusTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.VehicleDataNotificationStatus}
- */
-public class VehicleDataNotificationStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NOT_SUPPORTED";
- VehicleDataNotificationStatus enumNotSupported = VehicleDataNotificationStatus.valueForString(example);
- example = "NORMAL";
- VehicleDataNotificationStatus enumNormal = VehicleDataNotificationStatus.valueForString(example);
- example = "ACTIVE";
- VehicleDataNotificationStatus enumActive = VehicleDataNotificationStatus.valueForString(example);
- example = "NOT_USED";
- VehicleDataNotificationStatus enumNotUsed = VehicleDataNotificationStatus.valueForString(example);
-
- assertNotNull("NOT_SUPPORTED returned null", enumNotSupported);
- assertNotNull("NORMAL returned null", enumNormal);
- assertNotNull("ACTIVE returned null", enumActive);
- assertNotNull("NOT_USED returned null", enumNotUsed);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "nOT_SuppOrTEd";
- try {
- VehicleDataNotificationStatus temp = VehicleDataNotificationStatus.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 {
- VehicleDataNotificationStatus temp = VehicleDataNotificationStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of VehicleDataNotification.
- */
- public void testListEnum() {
- List<VehicleDataNotificationStatus> enumValueList = Arrays.asList(VehicleDataNotificationStatus.values());
-
- List<VehicleDataNotificationStatus> enumTestList = new ArrayList<VehicleDataNotificationStatus>();
- enumTestList.add(VehicleDataNotificationStatus.NOT_SUPPORTED);
- enumTestList.add(VehicleDataNotificationStatus.NORMAL);
- enumTestList.add(VehicleDataNotificationStatus.ACTIVE);
- enumTestList.add(VehicleDataNotificationStatus.NOT_USED);
-
- 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/VehicleDataResultCodeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataResultCodeTests.java
deleted file mode 100644
index e2161474a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataResultCodeTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.VehicleDataResultCode}
- */
-public class VehicleDataResultCodeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "SUCCESS";
- VehicleDataResultCode enumSuccess = VehicleDataResultCode.valueForString(example);
- example = "TRUNCATED_DATA";
- VehicleDataResultCode enumTruncData = VehicleDataResultCode.valueForString(example);
- example = "DISALLOWED";
- VehicleDataResultCode enumDisallowed = VehicleDataResultCode.valueForString(example);
- example = "USER_DISALLOWED";
- VehicleDataResultCode enumUserDisallowed = VehicleDataResultCode.valueForString(example);
- example = "INVALID_ID";
- VehicleDataResultCode enumInvalidId = VehicleDataResultCode.valueForString(example);
- example = "VEHICLE_DATA_NOT_AVAILABLE";
- VehicleDataResultCode enumVehicleDataNotAvailable = VehicleDataResultCode.valueForString(example);
- example = "DATA_ALREADY_SUBSCRIBED";
- VehicleDataResultCode enumDataAlreadySubscribed = VehicleDataResultCode.valueForString(example);
- example = "DATA_NOT_SUBSCRIBED";
- VehicleDataResultCode enumDataNotSubscribed = VehicleDataResultCode.valueForString(example);
- example = "IGNORED";
- VehicleDataResultCode enumIgnored = VehicleDataResultCode.valueForString(example);
-
- assertNotNull("SUCCESS returned null", enumSuccess);
- assertNotNull("TRUNCATED_DATA returned null", enumTruncData);
- assertNotNull("DISALLOWED returned null", enumDisallowed);
- assertNotNull("USER_DISALLOWED returned null", enumUserDisallowed);
- assertNotNull("INVALID_ID returned null", enumInvalidId);
- assertNotNull("VEHICLE_DATA_NOT_AVAILABLE returned null", enumVehicleDataNotAvailable);
- assertNotNull("DATA_ALREADY_SUBSCRIBED returned null", enumDataAlreadySubscribed);
- assertNotNull("DATA_NOT_SUBSCRIBED returned null", enumDataNotSubscribed);
- assertNotNull("IGNORED returned null", enumIgnored);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "suCcesS";
- try {
- VehicleDataResultCode temp = VehicleDataResultCode.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 {
- VehicleDataResultCode temp = VehicleDataResultCode.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of VehicleDataResultCode.
- */
- public void testListEnum() {
- List<VehicleDataResultCode> enumValueList = Arrays.asList(VehicleDataResultCode.values());
-
- List<VehicleDataResultCode> enumTestList = new ArrayList<VehicleDataResultCode>();
- enumTestList.add(VehicleDataResultCode.SUCCESS);
- enumTestList.add(VehicleDataResultCode.TRUNCATED_DATA);
- enumTestList.add(VehicleDataResultCode.DISALLOWED);
- enumTestList.add(VehicleDataResultCode.USER_DISALLOWED);
- enumTestList.add(VehicleDataResultCode.INVALID_ID);
- enumTestList.add(VehicleDataResultCode.VEHICLE_DATA_NOT_AVAILABLE);
- enumTestList.add(VehicleDataResultCode.DATA_ALREADY_SUBSCRIBED);
- enumTestList.add(VehicleDataResultCode.DATA_NOT_SUBSCRIBED);
- enumTestList.add(VehicleDataResultCode.IGNORED);
-
- 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/VehicleDataStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataStatusTests.java
deleted file mode 100644
index d35780ff4..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataStatusTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.VehicleDataStatus}
- */
-public class VehicleDataStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "NO_DATA_EXISTS";
- VehicleDataStatus enumNoDataExists = VehicleDataStatus.valueForString(example);
- example = "OFF";
- VehicleDataStatus enumOff = VehicleDataStatus.valueForString(example);
- example = "ON";
- VehicleDataStatus enumOn = VehicleDataStatus.valueForString(example);
-
- assertNotNull("NO_DATA_EXISTS returned null", enumNoDataExists);
- assertNotNull("OFF returned null", enumOff);
- assertNotNull("ON returned null", enumOn);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "No_DatA_ExiSTs";
- try {
- VehicleDataStatus temp = VehicleDataStatus.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 {
- VehicleDataStatus temp = VehicleDataStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of VehicleDataStatus.
- */
- public void testListEnum() {
- List<VehicleDataStatus> enumValueList = Arrays.asList(VehicleDataStatus.values());
-
- List<VehicleDataStatus> enumTestList = new ArrayList<VehicleDataStatus>();
- enumTestList.add(VehicleDataStatus.NO_DATA_EXISTS);
- enumTestList.add(VehicleDataStatus.OFF);
- enumTestList.add(VehicleDataStatus.ON);
-
- 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/VehicleDataTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java
deleted file mode 100644
index 9f9ff3449..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.enums.VehicleDataType}
- */
-public class VehicleDataTypeTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "VEHICLEDATA_GPS";
- VehicleDataType enumVehicleDataGps = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_SPEED";
- VehicleDataType enumVehicleDataSpeed = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_RPM";
- VehicleDataType enumVehicleDataRpm = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_FUELLEVEL";
- VehicleDataType enumVehicleDataFuelLevel = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_FUELLEVEL_STATE";
- VehicleDataType enumVehicleDataFuelLevelState = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_FUELCONSUMPTION";
- VehicleDataType enumVehicleDataFuelConsumption = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_EXTERNTEMP";
- VehicleDataType enumVehicleDataExternTemp = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_VIN";
- VehicleDataType enumVehicleDataVin = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_PRNDL";
- VehicleDataType enumVehicleDataPrndl = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_TIREPRESSURE";
- VehicleDataType enumVehicleDataTirePressure = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_ODOMETER";
- VehicleDataType enumVehicleDataOdometer = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_BELTSTATUS";
- VehicleDataType enumVehicleDataBeltStatus = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_BODYINFO";
- VehicleDataType enumVehicleDataBodyInfo = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_DEVICESTATUS";
- VehicleDataType enumVehicleDataDeviceStatus = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_BRAKING";
- VehicleDataType enumVehicleDataBraking = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_WIPERSTATUS";
- VehicleDataType enumVehicleDataWiperStatus = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_HEADLAMPSTATUS";
- VehicleDataType enumVehicleDataHeadlampStatus = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_BATTVOLTAGE";
- VehicleDataType enumVehicleDataBattVoltage = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_ENGINETORQUE";
- VehicleDataType enumVehicleDataEngineTorque = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_ENGINEOILLIFE";
- VehicleDataType enumVehicleDataEngineOilLife = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_ACCPEDAL";
- VehicleDataType enumVehicleDataAccPedal = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_STEERINGWHEEL";
- VehicleDataType enumVehicleDataSteeringWheel = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_ECALLINFO";
- VehicleDataType enumVehicleDataECallInfo = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_AIRBAGSTATUS";
- VehicleDataType enumVehicleDataAirbagStatus = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_EMERGENCYEVENT";
- VehicleDataType enumVehicleDataEmergencyEvent = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_CLUSTERMODESTATUS";
- VehicleDataType enumVehicleDataClusterModeStatus = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_MYKEY";
- VehicleDataType enumVehicleDataMyKey = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_FUELRANGE";
- VehicleDataType enumVehicleDataFuelRange = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_TURNSIGNAL";
- VehicleDataType enumVehicleDataTurnSignal = VehicleDataType.valueForString(example);
- example = "VEHICLEDATA_ELECTRONICPARKBRAKESTATUS";
- VehicleDataType enumVehicleDataElectronicParkBrakeStatus = VehicleDataType.valueForString(example);
-
- assertNotNull("VEHICLEDATA_GPS returned null", enumVehicleDataGps);
- assertNotNull("VEHICLEDATA_SPEED returned null", enumVehicleDataSpeed);
- assertNotNull("VEHICLEDATA_RPM returned null", enumVehicleDataRpm);
- assertNotNull("VEHICLEDATA_FUELLEVEL returned null", enumVehicleDataFuelLevel);
- assertNotNull("VEHICLEDATA_FUELLEVEL_STATE returned null", enumVehicleDataFuelLevelState);
- assertNotNull("VEHICLEDATA_FUELCONSUMPTION returned null", enumVehicleDataFuelConsumption);
- assertNotNull("VEHICLEDATA_EXTERNTEMP returned null", enumVehicleDataExternTemp);
- assertNotNull("VEHICLEDATA_VIN returned null", enumVehicleDataVin);
- assertNotNull("VEHICLEDATA_PRNDL returned null", enumVehicleDataPrndl);
- assertNotNull("VEHICLEDATA_TIREPRESSURE returned null", enumVehicleDataTirePressure);
- assertNotNull("VEHICLEDATA_ODOMETER returned null", enumVehicleDataOdometer);
- assertNotNull("VEHICLEDATA_BELTSTATUS returned null", enumVehicleDataBeltStatus);
- assertNotNull("VEHICLEDATA_BODYINFO returned null", enumVehicleDataBodyInfo);
- assertNotNull("VEHICLEDATA_DEVICESTATUS returned null", enumVehicleDataDeviceStatus);
- assertNotNull("VEHICLEDATA_BRAKING returned null", enumVehicleDataBraking);
- assertNotNull("VEHICLEDATA_WIPERSTATUS returned null", enumVehicleDataWiperStatus);
- assertNotNull("VEHICLEDATA_HEADLAMPSTATUS returned null", enumVehicleDataHeadlampStatus);
- assertNotNull("VEHICLEDATA_BATTVOLTAGE returned null", enumVehicleDataBattVoltage);
- assertNotNull("VEHICLEDATA_ENGINETORQUE returned null", enumVehicleDataEngineTorque);
- assertNotNull("VEHICLEDATA_ENGINEOILLIFE returned null", enumVehicleDataEngineOilLife);
- assertNotNull("VEHICLEDATA_ACCPEDAL returned null", enumVehicleDataAccPedal);
- assertNotNull("VEHICLEDATA_STEERINGWHEEL returned null", enumVehicleDataSteeringWheel);
- assertNotNull("VEHICLEDATA_ECALLINFO returned null", enumVehicleDataECallInfo);
- assertNotNull("VEHICLEDATA_AIRBAGSTATUS returned null", enumVehicleDataAirbagStatus);
- assertNotNull("VEHICLEDATA_EMERGENCYEVENT returned null", enumVehicleDataEmergencyEvent);
- assertNotNull("VEHICLEDATA_CLUSTERMODESTATUS returned null", enumVehicleDataClusterModeStatus);
- assertNotNull("VEHICLEDATA_MYKEY returned null", enumVehicleDataMyKey);
- assertNotNull("VEHICLEDATA_FUELRANGE returned null", enumVehicleDataFuelRange);
- assertNotNull("VEHICLEDATA_TURNSIGNAL returned null", enumVehicleDataTurnSignal);
- assertNotNull("VEHICLEDATA_ELECTRONICPARKBRAKESTATUS returned null", enumVehicleDataElectronicParkBrakeStatus);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "VeHIcLEDatA_GPs";
- try {
- VehicleDataType temp = VehicleDataType.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 {
- VehicleDataType temp = VehicleDataType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of VehicleDataType.
- */
- public void testListEnum() {
- List<VehicleDataType> enumValueList = Arrays.asList(VehicleDataType.values());
-
- List<VehicleDataType> enumTestList = new ArrayList<VehicleDataType>();
- enumTestList.add(VehicleDataType.VEHICLEDATA_GPS);
- enumTestList.add(VehicleDataType.VEHICLEDATA_SPEED);
- enumTestList.add(VehicleDataType.VEHICLEDATA_RPM);
- enumTestList.add(VehicleDataType.VEHICLEDATA_FUELLEVEL);
- enumTestList.add(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE);
- enumTestList.add(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION);
- enumTestList.add(VehicleDataType.VEHICLEDATA_EXTERNTEMP);
- enumTestList.add(VehicleDataType.VEHICLEDATA_VIN);
- enumTestList.add(VehicleDataType.VEHICLEDATA_PRNDL);
- enumTestList.add(VehicleDataType.VEHICLEDATA_TIREPRESSURE);
- enumTestList.add(VehicleDataType.VEHICLEDATA_ODOMETER);
- enumTestList.add(VehicleDataType.VEHICLEDATA_BELTSTATUS);
- enumTestList.add(VehicleDataType.VEHICLEDATA_BODYINFO);
- enumTestList.add(VehicleDataType.VEHICLEDATA_DEVICESTATUS);
- enumTestList.add(VehicleDataType.VEHICLEDATA_BRAKING);
- enumTestList.add(VehicleDataType.VEHICLEDATA_WIPERSTATUS);
- enumTestList.add(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS);
- enumTestList.add(VehicleDataType.VEHICLEDATA_BATTVOLTAGE);
- enumTestList.add(VehicleDataType.VEHICLEDATA_ENGINETORQUE);
- enumTestList.add(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE);
- enumTestList.add(VehicleDataType.VEHICLEDATA_ACCPEDAL);
- enumTestList.add(VehicleDataType.VEHICLEDATA_STEERINGWHEEL);
- enumTestList.add(VehicleDataType.VEHICLEDATA_ECALLINFO);
- enumTestList.add(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS);
- enumTestList.add(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT);
- enumTestList.add(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS);
- enumTestList.add(VehicleDataType.VEHICLEDATA_MYKEY);
- enumTestList.add(VehicleDataType.VEHICLEDATA_FUELRANGE);
- enumTestList.add(VehicleDataType.VEHICLEDATA_TURNSIGNAL);
- enumTestList.add(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS);
-
- 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/VideoStreamingProtocolTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingProtocolTests.java
deleted file mode 100644
index be50d2c30..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VideoStreamingProtocolTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-
-import junit.framework.TestCase;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-public class VideoStreamingProtocolTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "RAW";
- VideoStreamingProtocol enumRAW = VideoStreamingProtocol.valueForString(example);
- example = "RTP";
- VideoStreamingProtocol enumRTP = VideoStreamingProtocol.valueForString(example);
- example = "RTSP";
- VideoStreamingProtocol enumRTSP = VideoStreamingProtocol.valueForString(example);
- example = "RTMP";
- VideoStreamingProtocol enumRTMP = VideoStreamingProtocol.valueForString(example);
- example = "WEBM";
- VideoStreamingProtocol enumWEBM = VideoStreamingProtocol.valueForString(example);
-
- assertNotNull("RAW returned null", enumRAW);
- assertNotNull("RTP returned null", enumRTP);
- assertNotNull("RTSP returned null", enumRTSP);
- assertNotNull("RTMP returned null", enumRTMP);
- assertNotNull("WEBM returned null", enumWEBM);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "RAAW";
- try {
- VideoStreamingProtocol temp = VideoStreamingProtocol.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 {
- VideoStreamingProtocol temp = VideoStreamingProtocol.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
-
- /**
- * Verifies the possible enum values of TouchType.
- */
- public void testListEnum() {
- List<VideoStreamingProtocol> enumValueList = Arrays.asList(VideoStreamingProtocol.values());
-
- List<VideoStreamingProtocol> enumTestList = new ArrayList<VideoStreamingProtocol>();
- enumTestList.add(VideoStreamingProtocol.RAW);
- enumTestList.add(VideoStreamingProtocol.RTP);
- enumTestList.add(VideoStreamingProtocol.RTSP);
- enumTestList.add(VideoStreamingProtocol.RTMP);
- enumTestList.add(VideoStreamingProtocol.WEBM);
-
- 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/enums/VrCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VrCapabilitiesTests.java
deleted file mode 100644
index 33da334b8..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VrCapabilitiesTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.VrCapabilities}
- */
-public class VrCapabilitiesTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "Text";
- VrCapabilities enumText = VrCapabilities.valueForString(example);
-
- assertNotNull("Text returned null", enumText);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "tExTx";
- try {
- VrCapabilities temp = VrCapabilities.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 {
- VrCapabilities temp = VrCapabilities.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of VrCapabilities.
- */
- @SuppressWarnings("deprecation")
- public void testListEnum() {
- List<VrCapabilities> enumValueList = Arrays.asList(VrCapabilities.values());
-
- List<VrCapabilities> enumTestList = new ArrayList<VrCapabilities>();
- enumTestList.add(VrCapabilities.TEXT);
- enumTestList.add(VrCapabilities.Text);
-
- 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/WarningLightStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WarningLightStatusTests.java
deleted file mode 100644
index 18c6cc046..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WarningLightStatusTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.WarningListStatus}
- */
-public class WarningLightStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "OFF";
- WarningLightStatus enumOff = WarningLightStatus.valueForString(example);
- example = "ON";
- WarningLightStatus enumOn = WarningLightStatus.valueForString(example);
- example = "FLASH";
- WarningLightStatus enumFlash = WarningLightStatus.valueForString(example);
- example = "NOT_USED";
- WarningLightStatus enumNotUsed = WarningLightStatus.valueForString(example);
-
- assertNotNull("OFF returned null", enumOff);
- assertNotNull("ON returned null", enumOn);
- assertNotNull("FLASH returned null", enumFlash);
- assertNotNull("NOT_USED returned null", enumNotUsed);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "OfF";
- try {
- WarningLightStatus temp = WarningLightStatus.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 {
- WarningLightStatus temp = WarningLightStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of WarningLightStatus.
- */
- public void testListEnum() {
- List<WarningLightStatus> enumValueList = Arrays.asList(WarningLightStatus.values());
-
- List<WarningLightStatus> enumTestList = new ArrayList<WarningLightStatus>();
- enumTestList.add(WarningLightStatus.OFF);
- enumTestList.add(WarningLightStatus.ON);
- enumTestList.add(WarningLightStatus.FLASH);
- enumTestList.add(WarningLightStatus.NOT_USED);
-
- 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/WiperStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WiperStatusTests.java
deleted file mode 100644
index 1ab3370fa..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/WiperStatusTests.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package com.smartdevicelink.test.rpc.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.enums.WiperStatis}
- */
-public class WiperStatusTests extends TestCase {
-
- /**
- * Verifies that the enum values are not null upon valid assignment.
- */
- public void testValidEnums () {
- String example = "OFF";
- WiperStatus enumOff = WiperStatus.valueForString(example);
- example = "AUTO_OFF";
- WiperStatus enumAutoOff = WiperStatus.valueForString(example);
- example = "OFF_MOVING";
- WiperStatus enumOffMoving = WiperStatus.valueForString(example);
- example = "MAN_INT_OFF";
- WiperStatus enumManIntOff = WiperStatus.valueForString(example);
- example = "MAN_INT_ON";
- WiperStatus enumManIntOn = WiperStatus.valueForString(example);
- example = "MAN_LOW";
- WiperStatus enumManLow = WiperStatus.valueForString(example);
- example = "MAN_HIGH";
- WiperStatus enumManHigh = WiperStatus.valueForString(example);
- example = "MAN_FLICK";
- WiperStatus enumManFlick = WiperStatus.valueForString(example);
- example = "WASH";
- WiperStatus enumWash = WiperStatus.valueForString(example);
- example = "AUTO_LOW";
- WiperStatus enumAutoLow = WiperStatus.valueForString(example);
- example = "AUTO_HIGH";
- WiperStatus enumAutoHigh = WiperStatus.valueForString(example);
- example = "COURTESYWIPE";
- WiperStatus enumCourtesyWipe = WiperStatus.valueForString(example);
- example = "AUTO_ADJUST";
- WiperStatus enumAutoAdjust = WiperStatus.valueForString(example);
- example = "STALLED";
- WiperStatus enumStalled = WiperStatus.valueForString(example);
- example = "NO_DATA_EXISTS";
- WiperStatus enumNoDataExists = WiperStatus.valueForString(example);
-
- assertNotNull("OFF returned null", enumOff);
- assertNotNull("AUTO_OFF returned null", enumAutoOff);
- assertNotNull("OFF_MOVING returned null", enumOffMoving);
- assertNotNull("MAN_INT_OFF returned null", enumManIntOff);
- assertNotNull("MAN_INT_ON returned null", enumManIntOn);
- assertNotNull("MAN_LOW returned null", enumManLow);
- assertNotNull("MAN_HIGH returned null", enumManHigh);
- assertNotNull("MAN_FLICK returned null", enumManFlick);
- assertNotNull("WASH returned null", enumWash);
- assertNotNull("AUTO_LOW returned null", enumAutoLow);
- assertNotNull("AUTO_HIGH returned null", enumAutoHigh);
- assertNotNull("COURTESYWIPE returned null", enumCourtesyWipe);
- assertNotNull("AUTO_ADJUST returned null", enumAutoAdjust);
- assertNotNull("STALLED returned null", enumStalled);
- assertNotNull("NO_DATA_EXISTS returned null", enumNoDataExists);
- }
-
- /**
- * Verifies that an invalid assignment is null.
- */
- public void testInvalidEnum () {
- String example = "OFf";
- try {
- WiperStatus temp = WiperStatus.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 {
- WiperStatus temp = WiperStatus.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
- }
- }
-
- /**
- * Verifies the possible enum values of WiperStatus.
- */
- public void testListEnum() {
- List<WiperStatus> enumValueList = Arrays.asList(WiperStatus.values());
-
- List<WiperStatus> enumTestList = new ArrayList<WiperStatus>();
- enumTestList.add(WiperStatus.OFF);
- enumTestList.add(WiperStatus.AUTO_OFF);
- enumTestList.add(WiperStatus.OFF_MOVING);
- enumTestList.add(WiperStatus.MAN_INT_OFF);
- enumTestList.add(WiperStatus.MAN_INT_ON);
- enumTestList.add(WiperStatus.MAN_LOW);
- enumTestList.add(WiperStatus.MAN_HIGH);
- enumTestList.add(WiperStatus.MAN_FLICK);
- enumTestList.add(WiperStatus.WASH);
- enumTestList.add(WiperStatus.AUTO_LOW);
- enumTestList.add(WiperStatus.AUTO_HIGH);
- enumTestList.add(WiperStatus.COURTESYWIPE);
- enumTestList.add(WiperStatus.AUTO_ADJUST);
- enumTestList.add(WiperStatus.STALLED);
- enumTestList.add(WiperStatus.NO_DATA_EXISTS);
-
- 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/notifications/OnAppInterfaceUnregisteredTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java
deleted file mode 100644
index e3c1ee32c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered;
-import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnAppInterfaceUnregistered}
- */
-public class OnAppInterfaceUnregisteredTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered();
-
- msg.setReason(Test.GENERAL_APPINTERFACEUNREGISTEREDREASON);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnAppInterfaceUnregistered.KEY_REASON, Test.GENERAL_APPINTERFACEUNREGISTEREDREASON);
- } catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- AppInterfaceUnregisteredReason reason = ( (OnAppInterfaceUnregistered) msg ).getReason();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_APPINTERFACEUNREGISTEREDREASON, reason);
-
- // Invalid/Null tests
- OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getReason());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java
deleted file mode 100644
index b2add2f34..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnAudioPassThru}
- */
-public class OnAudioPassThruTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new OnAudioPassThru();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_AUDIO_PASS_THRU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- OnAudioPassThru msg = new OnAudioPassThru();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java
deleted file mode 100644
index 5f6e2e8e3..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnButtonEvent;
-import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnButtonEvent}
- */
-public class OnButtonEventTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnButtonEvent msg = new OnButtonEvent();
-
- msg.setButtonEventMode(Test.GENERAL_BUTTONEVENTMODE);
- msg.setButtonName(Test.GENERAL_BUTTONNAME);
- msg.setCustomButtonID(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_BUTTON_EVENT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnButtonEvent.KEY_BUTTON_EVENT_MODE, Test.GENERAL_BUTTONEVENTMODE);
- result.put(OnButtonEvent.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME);
- result.put(OnButtonEvent.KEY_CUSTOM_BUTTON_ID, Test.GENERAL_INT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int cmdId = ( (OnButtonEvent) msg ).getCustomButtonID();
- ButtonEventMode mode = ( (OnButtonEvent) msg ).getButtonEventMode();
- ButtonName name = ( (OnButtonEvent) msg ).getButtonName();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, cmdId);
- assertEquals(Test.MATCH, Test.GENERAL_BUTTONEVENTMODE, mode);
- assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, name);
-
- // Invalid/Null Tests
- OnButtonEvent msg = new OnButtonEvent();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getButtonEventMode());
- assertNull(Test.NULL, msg.getButtonName());
- assertNull(Test.NULL, msg.getCustomButtonID());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java
deleted file mode 100644
index be3c63be2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnButtonPress;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnButtonPress}
- */
-public class OnButtonPressTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnButtonPress msg = new OnButtonPress();
-
- msg.setButtonName(Test.GENERAL_BUTTONNAME);
- msg.setButtonPressMode(Test.GENERAL_BUTTONPRESSMODE);
- msg.setCustomButtonName(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_BUTTON_PRESS.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnButtonPress.KEY_CUSTOM_BUTTON_ID, Test.GENERAL_INT);
- result.put(OnButtonPress.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME);
- result.put(OnButtonPress.KEY_BUTTON_PRESS_MODE, Test.GENERAL_BUTTONPRESSMODE);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int customName = ( (OnButtonPress) msg ).getCustomButtonName();
- ButtonName buttonName = ( (OnButtonPress) msg ).getButtonName();
- ButtonPressMode buttonPressMode = ( (OnButtonPress) msg ).getButtonPressMode();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, customName);
- assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, buttonName);
- assertEquals(Test.MATCH, Test.GENERAL_BUTTONPRESSMODE, buttonPressMode);
-
- // Invalid/Null Tests
- OnButtonPress msg = new OnButtonPress();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getCustomButtonName());
- assertNull(Test.NULL, msg.getButtonName());
- assertNull(Test.NULL, msg.getButtonPressMode());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java
deleted file mode 100644
index 46026f007..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnCommand;
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnCommand}
- */
-public class OnCommandTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnCommand msg = new OnCommand();
-
- msg.setCmdID(Test.GENERAL_INT);
- msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_COMMAND.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnCommand.KEY_CMD_ID, Test.GENERAL_INT);
- result.put(OnCommand.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int cmdId = ( (OnCommand) msg ).getCmdID();
- TriggerSource triggerSource = ( (OnCommand) msg ).getTriggerSource();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, cmdId);
- assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, triggerSource);
-
- // Invalid/Null Tests
- OnCommand msg = new OnCommand();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getTriggerSource());
- assertNull(Test.NULL, msg.getCmdID());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java
deleted file mode 100644
index 090582586..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
-import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnDriverDistraction}
- */
-public class OnDriverDistractionTests extends BaseRpcTests{
-
- private static final DriverDistractionState STATUS = DriverDistractionState.DD_ON;
-
- @Override
- protected RPCMessage createMessage(){
- OnDriverDistraction msg = new OnDriverDistraction();
-
- msg.setState(STATUS);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_DRIVER_DISTRACTION.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnDriverDistraction.KEY_STATE, STATUS);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- DriverDistractionState cmdId = ( (OnDriverDistraction) msg ).getState();
-
- // Valid Tests
- assertEquals(Test.MATCH, STATUS, cmdId);
-
- // Invalid/Null Tests
- OnDriverDistraction msg = new OnDriverDistraction();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getState());
- }
-} \ No newline at end of file
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
deleted file mode 100644
index 6f38fdfa0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-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 :
- * {@link com.smartdevicelink.proxy.rpc.OnHMIStatus}
- */
-public class OnHMIStatusTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnHMIStatus msg = new OnHMIStatus();
-
- msg.setAudioStreamingState(Test.GENERAL_AUDIOSTREAMINGSTATE);
- msg.setVideoStreamingState(Test.GENERAL_VIDEOSTREAMINGSTATE);
- msg.setFirstRun(Test.GENERAL_BOOLEAN);
- msg.setHmiLevel(Test.GENERAL_HMILEVEL);
- msg.setSystemContext(Test.GENERAL_SYSTEMCONTEXT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_HMI_STATUS.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnHMIStatus.KEY_AUDIO_STREAMING_STATE, Test.GENERAL_AUDIOSTREAMINGSTATE);
- result.put(OnHMIStatus.KEY_VIDEO_STREAMING_STATE, Test.GENERAL_VIDEOSTREAMINGSTATE);
- result.put(OnHMIStatus.KEY_HMI_LEVEL, Test.GENERAL_HMILEVEL);
- result.put(OnHMIStatus.KEY_SYSTEM_CONTEXT, Test.GENERAL_SYSTEMCONTEXT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- AudioStreamingState audioStreamingState = ( (OnHMIStatus) msg ).getAudioStreamingState();
- VideoStreamingState videoStreamingState = ( (OnHMIStatus) msg ).getVideoStreamingState();
- HMILevel hmiLevel = ( (OnHMIStatus) msg ).getHmiLevel();
- SystemContext context = ( (OnHMIStatus) msg ).getSystemContext();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_AUDIOSTREAMINGSTATE, audioStreamingState);
- assertEquals(Test.MATCH, Test.GENERAL_VIDEOSTREAMINGSTATE, videoStreamingState);
- assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL, hmiLevel);
- assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCONTEXT, context);
-
- // Invalid/Null Tests
- OnHMIStatus msg = new OnHMIStatus();
- assertNotNull(Test.NOT_NULL, msg);
- 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());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java
deleted file mode 100644
index 16e101860..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnHashChange;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnHashChange}
- */
-public class OnHashChangeTests extends BaseRpcTests{
-
- private static final String HASH_ID = "agh4lg2hb1g9gq3";
-
- @Override
- protected RPCMessage createMessage(){
- OnHashChange msg = new OnHashChange();
-
- msg.setHashID(HASH_ID);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_HASH_CHANGE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnHashChange.KEY_HASH_ID, HASH_ID);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String hashId = ( (OnHashChange) msg ).getHashID();
-
- // Valid Tests
- assertEquals(Test.MATCH, HASH_ID, hashId);
-
- // Invalid/Null Tests
- OnHashChange msg = new OnHashChange();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getHashID());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java
deleted file mode 100644
index e950d85fa..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
-import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnKeyboardInput}
- */
-public class OnKeyboardInputTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnKeyboardInput msg = new OnKeyboardInput();
-
- msg.setData(Test.GENERAL_STRING);
- msg.setEvent(Test.GENERAL_KEYBOARDEVENT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_KEYBOARD_INPUT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnKeyboardInput.KEY_DATA, Test.GENERAL_STRING);
- result.put(OnKeyboardInput.KEY_EVENT, Test.GENERAL_KEYBOARDEVENT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- KeyboardEvent event = ( (OnKeyboardInput) msg ).getEvent();
- String data = ( (OnKeyboardInput) msg ).getData();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_KEYBOARDEVENT, event);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, data);
-
- // Invalid/Null Tests
- OnKeyboardInput msg = new OnKeyboardInput();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getData());
- assertNull(Test.NULL, msg.getEvent());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java
deleted file mode 100644
index 382ef074c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnLanguageChange;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnLanguageChange}
- */
-public class OnLanguageChangeTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnLanguageChange msg = new OnLanguageChange();
-
- msg.setLanguage(Test.GENERAL_LANGUAGE);
- msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_LANGUAGE_CHANGE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnLanguageChange.KEY_LANGUAGE, Test.GENERAL_LANGUAGE);
- result.put(OnLanguageChange.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Language lang = ( (OnLanguageChange) msg ).getLanguage();
- Language hmiLang = ( (OnLanguageChange) msg ).getHmiDisplayLanguage();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, lang);
- assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, hmiLang);
-
- // Invalid/Null Tests
- OnLanguageChange msg = new OnLanguageChange();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getLanguage());
- assertNull(Test.NULL, msg.getHmiDisplayLanguage());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java
deleted file mode 100644
index 8df1cb641..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnLockScreenStatus}
- */
-public class OnLockScreenStatusTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnLockScreenStatus msg = new OnLockScreenStatus();
-
- msg.setDriverDistractionStatus(Test.GENERAL_BOOLEAN);
- msg.setHMILevel(Test.GENERAL_HMILEVEL);
- msg.setShowLockScreen(Test.GENERAL_LOCKSCREENSTATUS);
- msg.setUserSelected(Test.GENERAL_BOOLEAN);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_LOCK_SCREEN_STATUS.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnLockScreenStatus.KEY_DRIVER_DISTRACTION, Test.GENERAL_BOOLEAN);
- result.put(OnHMIStatus.KEY_HMI_LEVEL, Test.GENERAL_HMILEVEL);
- result.put(OnLockScreenStatus.KEY_SHOW_LOCK_SCREEN, Test.GENERAL_LOCKSCREENSTATUS);
- result.put(OnLockScreenStatus.KEY_USER_SELECTED, Test.GENERAL_BOOLEAN);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Boolean status = ( (OnLockScreenStatus) msg ).getDriverDistractionStatus();
- HMILevel hmiLevel = ( (OnLockScreenStatus) msg ).getHMILevel();
- LockScreenStatus lockScreen = ( (OnLockScreenStatus) msg ).getShowLockScreen();
- boolean userSelected = ( (OnLockScreenStatus) msg ).getUserSelected();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, status);
- assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL, hmiLevel);
- assertEquals(Test.MATCH, Test.GENERAL_LOCKSCREENSTATUS, lockScreen);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, userSelected);
-
- // Invalid/Null Tests
- OnLockScreenStatus msg = new OnLockScreenStatus();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getDriverDistractionStatus());
- assertNull(Test.NULL, msg.getHMILevel());
- assertNull(Test.NULL, msg.getShowLockScreen());
- assertNull(Test.NULL, msg.getUserSelected());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java
deleted file mode 100644
index c3d4c4f46..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.PermissionItem;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnPermissionsChange}
- */
-public class OnPermissionsChangeTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnPermissionsChange msg = new OnPermissionsChange();
-
- msg.setPermissionItem(Test.GENERAL_PERMISSIONITEM_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_PERMISSIONS_CHANGE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnPermissionsChange.KEY_PERMISSION_ITEM, Test.JSON_PERMISSIONITEMS);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<PermissionItem> data = ( (OnPermissionsChange) msg ).getPermissionItem();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_PERMISSIONITEM_LIST.size(), data.size());
- for(int i=0; i<data.size(); i++){
- assertTrue(Test.TRUE, Validator.validatePermissionItem(Test.GENERAL_PERMISSIONITEM_LIST.get(i), data.get(i)));
- }
-
- // Invalid/Null Tests
- OnPermissionsChange msg = new OnPermissionsChange();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getPermissionItem());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java
deleted file mode 100644
index d186098c3..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
-import com.smartdevicelink.proxy.callbacks.OnProxyOpened;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.callbacks.OnProxyOpened}
- */
-public class OnProxyOpenedTests extends TestCase {
-
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.callbacks.OnProxyOpened#OnProxyOpened()}
- * {@link com.smartdevicelink.proxy.callbacks.OnProxyOpened#getFunctionName()}
- */
- public void testMethods () {
- OnProxyOpened testOnProxyOpened = new OnProxyOpened();
- assertNotNull(Test.NOT_NULL, testOnProxyOpened);
- assertEquals(Test.MATCH, InternalProxyMessage.OnProxyOpened, testOnProxyOpened.getFunctionName());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java
deleted file mode 100644
index 77d2cdb21..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnSdlChoiceChosen;
-import com.smartdevicelink.proxy.rpc.OnSdlChoiceChosen.SdlChoice;
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.OnSdlChoiceChosen}
- */
-public class OnSdlChoiceChosenTests extends BaseRpcTests{
-
- SdlChoice sdlChoice;
-
- @Override
- protected RPCMessage createMessage(){
- OnSdlChoiceChosen msg = new OnSdlChoiceChosen();
- sdlChoice = msg.new SdlChoice(Test.GENERAL_CHOICE);
-
- msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE);
- msg.setSdlChoice(sdlChoice);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_SDL_CHOICE_CHOSEN.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnSdlChoiceChosen.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE);
- result.put(OnSdlChoiceChosen.KEY_SDL_CHOICE, sdlChoice);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- SdlChoice data = ( (OnSdlChoiceChosen) msg ).getSdlChoice();
- TriggerSource source = ( (OnSdlChoiceChosen) msg ).getTriggerSource();
-
- // Valid Tests
- assertTrue(Test.MATCH, Validator.validateChoice(Test.GENERAL_CHOICE, data.getChoice()));
- assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, source);
-
- // Invalid/Null Tests
- OnSdlChoiceChosen msg = new OnSdlChoiceChosen();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getTriggerSource());
- assertNull(Test.NULL, msg.getSdlChoice());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java
deleted file mode 100644
index a4bb53e71..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Headers;
-import com.smartdevicelink.proxy.rpc.OnSystemRequest;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.RequestType;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.OnSystemRequest}
- */
-public class OnSystemRequestTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnSystemRequest msg = new OnSystemRequest();
-
- msg.setFileType(Test.GENERAL_FILETYPE);
- msg.setLength(Test.GENERAL_LONG);
- msg.setOffset(Test.GENERAL_LONG);
- msg.setRequestType(Test.GENERAL_REQUESTTYPE);
- msg.setRequestSubType(Test.GENERAL_STRING);
- msg.setTimeout(Test.GENERAL_INT);
- msg.setUrl(Test.GENERAL_STRING);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_SYSTEM_REQUEST.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnSystemRequest.KEY_FILE_TYPE, Test.GENERAL_FILETYPE);
- result.put(OnSystemRequest.KEY_LENGTH, Test.GENERAL_LONG);
- result.put(OnSystemRequest.KEY_TIMEOUT, Test.GENERAL_INT);
- result.put(OnSystemRequest.KEY_OFFSET, Test.GENERAL_LONG);
- result.put(OnSystemRequest.KEY_URL, Test.GENERAL_STRING);
- result.put(OnSystemRequest.KEY_REQUEST_TYPE, Test.GENERAL_REQUESTTYPE);
- result.put(OnSystemRequest.KEY_REQUEST_SUB_TYPE, Test.GENERAL_STRING);
- } catch(JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- FileType fileType = ( (OnSystemRequest) msg ).getFileType();
- Long length = ( (OnSystemRequest) msg ).getLength();
- int timeout = ( (OnSystemRequest) msg ).getTimeout();
- Long offset = ( (OnSystemRequest) msg ).getOffset();
- String url = ( (OnSystemRequest) msg ).getUrl();
- RequestType requestType = ( (OnSystemRequest) msg ).getRequestType();
- String requestSubType = ( (OnSystemRequest) msg ).getRequestSubType();
-
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, fileType);
- assertEquals(Test.MATCH, Test.GENERAL_LONG, length);
- assertEquals(Test.MATCH, Test.GENERAL_INT, timeout);
- assertEquals(Test.MATCH, Test.GENERAL_LONG, offset);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, url);
- assertEquals(Test.MATCH, Test.GENERAL_REQUESTTYPE, requestType);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, requestSubType);
-
- // Test Body
- OnSystemRequest osr = (OnSystemRequest) msg;
- String body = osr.getBody();
- assertNull(Test.NULL, body);
-
- String testBody = "123ABC";
- osr.setBody(testBody);
-
- String readBody = osr.getBody();
- assertEquals(Test.MATCH, testBody, readBody);
-
- // Test Headers
- Headers headers = osr.getHeader();
- assertNull(Test.NULL, headers);
-
- Headers testHeaders = new Headers();
- testHeaders.setCharset("ASCII");
- testHeaders.setConnectTimeout(1000);
- testHeaders.setContentLength(1024);
- testHeaders.setContentType("application/json");
- testHeaders.setDoInput(false);
- testHeaders.setDoOutput(true);
- testHeaders.setInstanceFollowRedirects(true);
- testHeaders.setReadTimeout(800);
- testHeaders.setRequestMethod("POST");
- testHeaders.setUseCaches(false);
- osr.setHeaders(testHeaders);
-
- Headers readHeaders = osr.getHeader();
- assertTrue(Test.TRUE, Validator.validateHeaders(testHeaders, readHeaders));
-
- // Invalid/Null Tests
- OnSystemRequest msg = new OnSystemRequest();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getFileType());
- assertNull(Test.NULL, msg.getLength());
- assertNull(Test.NULL, msg.getOffset());
- assertNull(Test.NULL, msg.getTimeout());
- assertNull(Test.NULL, msg.getUrl());
- assertNull(Test.NULL, msg.getRequestType());
- assertNull(Test.NULL, msg.getRequestSubType());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java
deleted file mode 100644
index 47352f6f5..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnTBTClientState;
-import com.smartdevicelink.proxy.rpc.enums.TBTState;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnTBTClientState}
- */
-public class OnTBTClientStateTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnTBTClientState msg = new OnTBTClientState();
-
- msg.setState(Test.GENERAL_TBTSTATE);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_TBT_CLIENT_STATE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnTBTClientState.KEY_STATE, Test.GENERAL_TBTSTATE);
- } catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- TBTState data = ( (OnTBTClientState) msg ).getState();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_TBTSTATE, data);
-
- // Invalid/Null Tests
- OnTBTClientState msg = new OnTBTClientState();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getState());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java
deleted file mode 100644
index 613afa55b..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.OnTouchEvent;
-import com.smartdevicelink.proxy.rpc.TouchEvent;
-import com.smartdevicelink.proxy.rpc.enums.TouchType;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.OnTouchEvent}
- */
-public class OnTouchEventTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- OnTouchEvent msg = new OnTouchEvent();
- msg.setType(Test.GENERAL_TOUCHTYPE);
- msg.setEvent(Test.GENERAL_TOUCHEVENT_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_TOUCH_EVENT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnTouchEvent.KEY_TYPE,Test.GENERAL_TOUCHTYPE);
- result.put(OnTouchEvent.KEY_EVENT, Test.JSON_TOUCHEVENTS);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- TouchType type = ( (OnTouchEvent) msg ).getType();
- List<TouchEvent> event = ( (OnTouchEvent) msg ).getEvent();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_TOUCHTYPE, type);
- assertEquals(Test.MATCH, Test.GENERAL_TOUCHEVENT_LIST.size(), event.size());
- for(int i=0; i< Test.GENERAL_TOUCHEVENT_LIST.size(); i++){
- TouchEvent referenceEvent = Test.GENERAL_TOUCHEVENT_LIST.get(i);
- TouchEvent dataEvent = event.get(i);
- assertTrue(Test.TRUE, Validator.validateTouchEvent(referenceEvent, dataEvent));
- }
-
- // Invalid/Null Tests
- OnTouchEvent msg = new OnTouchEvent();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getType());
- assertNull(Test.NULL, msg.getEvent());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java
deleted file mode 100644
index c530c1278..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java
+++ /dev/null
@@ -1,499 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AirbagStatus;
-import com.smartdevicelink.proxy.rpc.BeltStatus;
-import com.smartdevicelink.proxy.rpc.BodyInformation;
-import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
-import com.smartdevicelink.proxy.rpc.DeviceStatus;
-import com.smartdevicelink.proxy.rpc.ECallInfo;
-import com.smartdevicelink.proxy.rpc.EmergencyEvent;
-import com.smartdevicelink.proxy.rpc.FuelRange;
-import com.smartdevicelink.proxy.rpc.GPSData;
-import com.smartdevicelink.proxy.rpc.HeadLampStatus;
-import com.smartdevicelink.proxy.rpc.MyKey;
-import com.smartdevicelink.proxy.rpc.OnVehicleData;
-import com.smartdevicelink.proxy.rpc.SingleTireStatus;
-import com.smartdevicelink.proxy.rpc.TireStatus;
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PRNDL;
-import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.VehicleDataHelper;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.OnVehicleData}
- */
-public class OnVehicleDataTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return VehicleDataHelper.VEHICLE_DATA;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_NOTIFICATION;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ON_VEHICLE_DATA.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(OnVehicleData.KEY_SPEED, VehicleDataHelper.SPEED);
- result.put(OnVehicleData.KEY_RPM, VehicleDataHelper.RPM);
- result.put(OnVehicleData.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE);
- result.put(OnVehicleData.KEY_FUEL_LEVEL, VehicleDataHelper.FUEL_LEVEL);
- result.put(OnVehicleData.KEY_VIN, VehicleDataHelper.VIN);
- result.put(OnVehicleData.KEY_PRNDL, VehicleDataHelper.PRNDL_FINAL);
- result.put(OnVehicleData.KEY_TIRE_PRESSURE, VehicleDataHelper.TIRE_PRESSURE.serializeJSON());
- result.put(OnVehicleData.KEY_ENGINE_TORQUE, VehicleDataHelper.ENGINE_TORQUE);
- result.put(OnVehicleData.KEY_ENGINE_OIL_LIFE, VehicleDataHelper.ENGINE_OIL_LIFE);
- result.put(OnVehicleData.KEY_ODOMETER, VehicleDataHelper.ODOMETER);
- result.put(OnVehicleData.KEY_GPS, VehicleDataHelper.GPS.serializeJSON());
- result.put(OnVehicleData.KEY_FUEL_LEVEL_STATE, VehicleDataHelper.FUEL_LEVEL_STATE);
- result.put(OnVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION);
- result.put(OnVehicleData.KEY_BELT_STATUS, VehicleDataHelper.BELT_STATUS.serializeJSON());
- result.put(OnVehicleData.KEY_BODY_INFORMATION, VehicleDataHelper.BODY_INFORMATION.serializeJSON());
- result.put(OnVehicleData.KEY_DEVICE_STATUS, VehicleDataHelper.DEVICE_STATUS.serializeJSON());
- result.put(OnVehicleData.KEY_DRIVER_BRAKING, VehicleDataHelper.DRIVER_BRAKING);
- result.put(OnVehicleData.KEY_WIPER_STATUS, VehicleDataHelper.WIPER_STATUS);
- result.put(OnVehicleData.KEY_HEAD_LAMP_STATUS, VehicleDataHelper.HEAD_LAMP_STATUS.serializeJSON());
- result.put(OnVehicleData.KEY_ACC_PEDAL_POSITION, VehicleDataHelper.ACC_PEDAL_POSITION);
- result.put(OnVehicleData.KEY_STEERING_WHEEL_ANGLE, VehicleDataHelper.STEERING_WHEEL_ANGLE);
- result.put(OnVehicleData.KEY_E_CALL_INFO, VehicleDataHelper.E_CALL_INFO.serializeJSON());
- result.put(OnVehicleData.KEY_AIRBAG_STATUS, VehicleDataHelper.AIRBAG_STATUS.serializeJSON());
- result.put(OnVehicleData.KEY_EMERGENCY_EVENT, VehicleDataHelper.EMERGENCY_EVENT.serializeJSON());
- result.put(OnVehicleData.KEY_CLUSTER_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS.serializeJSON());
- result.put(OnVehicleData.KEY_MY_KEY, VehicleDataHelper.MY_KEY.serializeJSON());
- result.put(OnVehicleData.KEY_FUEL_RANGE, VehicleDataHelper.JSON_FUEL_RANGE);
- result.put(OnVehicleData.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL);
- result.put(OnVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
- } catch(JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Double speed = ( (OnVehicleData) msg).getSpeed();
- int rpm = ( (OnVehicleData) msg).getRpm();
- Double external = ( (OnVehicleData) msg).getExternalTemperature();
- Double fuelLevel = ( (OnVehicleData) msg).getFuelLevel();
- String vin = ( (OnVehicleData) msg).getVin();
- PRNDL prndl = ( (OnVehicleData) msg).getPrndl();
- TireStatus pressure = ( (OnVehicleData) msg).getTirePressure();
- Double torque = ( (OnVehicleData) msg).getEngineTorque();
- Float engineOilLife = ( (OnVehicleData) msg).getEngineOilLife();
- int odometer = ( (OnVehicleData) msg).getOdometer();
- GPSData gps = ( (OnVehicleData) msg).getGps();
- ComponentVolumeStatus state = ( (OnVehicleData) msg).getFuelLevelState();
- Double consumption = ( (OnVehicleData) msg).getInstantFuelConsumption();
- BeltStatus belt = ( (OnVehicleData) msg).getBeltStatus();
- BodyInformation body = ( (OnVehicleData) msg).getBodyInformation();
- DeviceStatus device = ( (OnVehicleData) msg).getDeviceStatus();
- VehicleDataEventStatus brake = ( (OnVehicleData) msg).getDriverBraking();
- WiperStatus wiper = ( (OnVehicleData) msg).getWiperStatus();
- HeadLampStatus lamp = ( (OnVehicleData) msg).getHeadLampStatus();
- Double pedal = ( (OnVehicleData) msg).getAccPedalPosition();
- Double wheel = ( (OnVehicleData) msg).getSteeringWheelAngle();
- ECallInfo ecall = ( (OnVehicleData) msg).getECallInfo();
- AirbagStatus airbag = ( (OnVehicleData) msg).getAirbagStatus();
- EmergencyEvent event = ( (OnVehicleData) msg).getEmergencyEvent();
- ClusterModeStatus cluster = ( (OnVehicleData) msg).getClusterModeStatus();
- MyKey key = ( (OnVehicleData) msg).getMyKey();
- List<FuelRange> fuelRangeList = ( (OnVehicleData) msg).getFuelRange();
- TurnSignal turnSignal = ( (OnVehicleData) msg).getTurnSignal();
- ElectronicParkBrakeStatus electronicParkBrakeStatus = ( (OnVehicleData) msg).getElectronicParkBrakeStatus();
-
- // Valid Tests
- assertEquals(Test.MATCH, VehicleDataHelper.SPEED, speed);
- assertEquals(Test.MATCH, VehicleDataHelper.RPM, rpm);
- assertEquals(Test.MATCH, VehicleDataHelper.EXTERNAL_TEMPERATURE, external);
- assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL, fuelLevel);
- assertEquals(Test.MATCH, VehicleDataHelper.VIN, vin);
- assertEquals(Test.MATCH, VehicleDataHelper.PRNDL_FINAL, prndl);
- assertTrue(Test.MATCH, Validator.validateTireStatus(VehicleDataHelper.TIRE_PRESSURE, pressure));
- assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_TORQUE, torque);
- assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_OIL_LIFE, engineOilLife);
- assertEquals(Test.MATCH, VehicleDataHelper.ODOMETER, odometer);
- assertTrue(Test.MATCH, Validator.validateGpsData(VehicleDataHelper.GPS, gps));
- assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL_STATE, state);
- assertEquals(Test.MATCH, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION, consumption);
- assertTrue(Test.TRUE, Validator.validateBeltStatus(VehicleDataHelper.BELT_STATUS, belt));
- assertTrue(Test.TRUE, Validator.validateBodyInformation(VehicleDataHelper.BODY_INFORMATION, body));
- assertTrue(Test.TRUE, Validator.validateDeviceStatus(VehicleDataHelper.DEVICE_STATUS, device));
- assertEquals(Test.MATCH, VehicleDataHelper.DRIVER_BRAKING, brake);
- assertEquals(Test.MATCH, VehicleDataHelper.WIPER_STATUS, wiper);
- assertTrue(Test.TRUE, Validator.validateHeadLampStatus(VehicleDataHelper.HEAD_LAMP_STATUS, lamp));
- assertEquals(Test.MATCH, VehicleDataHelper.ACC_PEDAL_POSITION, pedal);
- assertEquals(Test.MATCH, VehicleDataHelper.STEERING_WHEEL_ANGLE, wheel);
- assertTrue(Test.TRUE, Validator.validateECallInfo(VehicleDataHelper.E_CALL_INFO, ecall));
- assertTrue(Test.TRUE, Validator.validateAirbagStatus(VehicleDataHelper.AIRBAG_STATUS, airbag));
- assertTrue(Test.TRUE, Validator.validateEmergencyEvent(VehicleDataHelper.EMERGENCY_EVENT, event));
- assertTrue(Test.TRUE, Validator.validateClusterModeStatus(VehicleDataHelper.CLUSTER_MODE_STATUS, cluster));
- assertTrue(Test.TRUE, Validator.validateMyKey(VehicleDataHelper.MY_KEY, key));
- assertTrue(Test.TRUE, Validator.validateFuelRange(VehicleDataHelper.FUEL_RANGE_LIST, fuelRangeList));
- assertEquals(Test.MATCH, VehicleDataHelper.TURN_SIGNAL, turnSignal);
- assertEquals(Test.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
-
- // Invalid/Null Tests
- OnVehicleData msg = new OnVehicleData();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSpeed());
- assertNull(Test.NULL, msg.getRpm());
- assertNull(Test.NULL, msg.getExternalTemperature());
- assertNull(Test.NULL, msg.getFuelLevel());
- assertNull(Test.NULL, msg.getVin());
- assertNull(Test.NULL, msg.getPrndl());
- assertNull(Test.NULL, msg.getTirePressure());
- assertNull(Test.NULL, msg.getEngineTorque());
- assertNull(Test.NULL, msg.getEngineOilLife());
- assertNull(Test.NULL, msg.getOdometer());
- assertNull(Test.NULL, msg.getGps());
- assertNull(Test.NULL, msg.getFuelLevelState());
- assertNull(Test.NULL, msg.getInstantFuelConsumption());
- assertNull(Test.NULL, msg.getBeltStatus());
- assertNull(Test.NULL, msg.getBodyInformation());
- assertNull(Test.NULL, msg.getDeviceStatus());
- assertNull(Test.NULL, msg.getDriverBraking());
- assertNull(Test.NULL, msg.getWiperStatus());
- assertNull(Test.NULL, msg.getHeadLampStatus());
- assertNull(Test.NULL, msg.getAccPedalPosition());
- assertNull(Test.NULL, msg.getSteeringWheelAngle());
- assertNull(Test.NULL, msg.getECallInfo());
- assertNull(Test.NULL, msg.getAirbagStatus());
- assertNull(Test.NULL, msg.getEmergencyEvent());
- assertNull(Test.NULL, msg.getClusterModeStatus());
- assertNull(Test.NULL, msg.getMyKey());
- assertNull(Test.NULL, msg.getFuelRange());
- assertNull(Test.NULL, msg.getTurnSignal());
- assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- //Objects needed on the first level.
- JSONObject tireStatusObj = new JSONObject();
- JSONObject GPSDataObj = new JSONObject();
- JSONObject beltStatusObj = new JSONObject();
- JSONObject bodyInformationObj = new JSONObject();
- JSONObject deviceStatusObj = new JSONObject();
- JSONObject headLampStatusObj = new JSONObject();
- JSONObject ECallInfoObj = new JSONObject();
- JSONObject airbagStatusObj = new JSONObject();
- JSONObject emergencyEventObj = new JSONObject();
- JSONObject clusterModeStatusObj = new JSONObject();
- JSONObject myKeyObj = new JSONObject();
- JSONObject fuelRangeObj = new JSONObject();
- JSONArray fuelRangeArrayObj = new JSONArray();
-
- try {
- //Set up the JSONObject to represent OnVehicleData:
-
- //TIRE_PRESSURE
- tireStatusObj.put(TireStatus.KEY_PRESSURE_TELL_TALE, VehicleDataHelper.TIRE_PRESSURE_TELL_TALE);
- JSONObject tireLeftFront = new JSONObject();
- tireLeftFront.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_LEFT_FRONT);
- tireStatusObj.put(TireStatus.KEY_LEFT_FRONT, tireLeftFront);
- JSONObject tireRightFront = new JSONObject();
- tireRightFront.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_RIGHT_FRONT);
- tireStatusObj.put(TireStatus.KEY_RIGHT_FRONT, tireRightFront);
- JSONObject tireLeftRear = new JSONObject();
- tireLeftRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_LEFT_REAR);
- tireStatusObj.put(TireStatus.KEY_LEFT_REAR, tireLeftRear);
- JSONObject tireRightRear = new JSONObject();
- tireRightRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_RIGHT_REAR);
- tireStatusObj.put(TireStatus.KEY_RIGHT_REAR, tireRightRear);
- JSONObject tireInnerLeftRear = new JSONObject();
- tireInnerLeftRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_INNER_LEFT_REAR);
- tireStatusObj.put(TireStatus.KEY_INNER_LEFT_REAR, tireInnerLeftRear);
- JSONObject tireInnerRightRear = new JSONObject();
- tireInnerRightRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_INNER_RIGHT_REAR);
- tireStatusObj.put(TireStatus.KEY_INNER_RIGHT_REAR, tireInnerRightRear);
-
- //GPS
- GPSDataObj.put(GPSData.KEY_LONGITUDE_DEGREES, VehicleDataHelper.GPS_LONGITUDE);
- GPSDataObj.put(GPSData.KEY_LATITUDE_DEGREES, VehicleDataHelper.GPS_LATITUDE);
- GPSDataObj.put(GPSData.KEY_UTC_YEAR, VehicleDataHelper.GPS_YEAR);
- GPSDataObj.put(GPSData.KEY_UTC_MONTH, VehicleDataHelper.GPS_MONTH);
- GPSDataObj.put(GPSData.KEY_UTC_DAY, VehicleDataHelper.GPS_DAY);
- GPSDataObj.put(GPSData.KEY_UTC_HOURS, VehicleDataHelper.GPS_HOURS);
- GPSDataObj.put(GPSData.KEY_UTC_MINUTES, VehicleDataHelper.GPS_MINUTES);
- GPSDataObj.put(GPSData.KEY_UTC_SECONDS, VehicleDataHelper.GPS_SECONDS);
- GPSDataObj.put(GPSData.KEY_COMPASS_DIRECTION, VehicleDataHelper.GPS_DIRECTION);
- GPSDataObj.put(GPSData.KEY_PDOP, VehicleDataHelper.GPS_PDOP);
- GPSDataObj.put(GPSData.KEY_VDOP, VehicleDataHelper.GPS_VDOP);
- GPSDataObj.put(GPSData.KEY_HDOP, VehicleDataHelper.GPS_HDOP);
- GPSDataObj.put(GPSData.KEY_ACTUAL, VehicleDataHelper.GPS_ACTUAL);
- GPSDataObj.put(GPSData.KEY_SATELLITES, VehicleDataHelper.GPS_SATELLITES);
- GPSDataObj.put(GPSData.KEY_DIMENSION, VehicleDataHelper.GPS_DIMENSION);
- GPSDataObj.put(GPSData.KEY_ALTITUDE, VehicleDataHelper.GPS_ALTITUDE);
- GPSDataObj.put(GPSData.KEY_HEADING, VehicleDataHelper.GPS_HEADING);
- GPSDataObj.put(GPSData.KEY_SPEED, VehicleDataHelper.GPS_SPEED);
-
- //BELT_STATUS
- beltStatusObj.put(BeltStatus.KEY_DRIVER_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_DRIVER_DEPLOYED);
- beltStatusObj.put(BeltStatus.KEY_PASSENGER_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_PASSENGER_DEPLOYED);
- beltStatusObj.put(BeltStatus.KEY_PASSENGER_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_PASSENGER_BELTED);
- beltStatusObj.put(BeltStatus.KEY_DRIVER_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_DRIVER_BELTED);
- beltStatusObj.put(BeltStatus.KEY_LEFT_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_ROW_2_BELTED);
- beltStatusObj.put(BeltStatus.KEY_PASSENGER_CHILD_DETECTED, VehicleDataHelper.BELT_STATUS_PASSENGER_CHILD);
- beltStatusObj.put(BeltStatus.KEY_RIGHT_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_ROW_2_BELTED);
- beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_2_BELTED);
- beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_3_BELTED);
- beltStatusObj.put(BeltStatus.KEY_LEFT_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_ROW_3_BELTED);
- beltStatusObj.put(BeltStatus.KEY_RIGHT_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_ROW_3_BELTED);
- beltStatusObj.put(BeltStatus.KEY_REAR_INFLATABLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_REAR_INFLATABLE_BELTED);
- beltStatusObj.put(BeltStatus.KEY_RIGHT_REAR_INFLATABLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_REAR_INFLATABLE_BELTED);
- beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_1_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_1_DEPLOYED);
- beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_1_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_1_BELTED);
-
- //BODY_INFORMATION
- bodyInformationObj.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, VehicleDataHelper.BODY_INFORMATION_PARK_BRAKE);
- bodyInformationObj.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STATUS);
- bodyInformationObj.put(BodyInformation.KEY_IGNITION_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STABLE_STATUS);
- bodyInformationObj.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_DRIVER_AJAR);
- bodyInformationObj.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_PASSENGER_AJAR);
- bodyInformationObj.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_LEFT_AJAR);
- bodyInformationObj.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_RIGHT_AJAR);
-
- //DEVICE_STATUS
- deviceStatusObj.put(DeviceStatus.KEY_VOICE_REC_ON, VehicleDataHelper.DEVICE_STATUS_VOICE_REC);
- deviceStatusObj.put(DeviceStatus.KEY_BT_ICON_ON, VehicleDataHelper.DEVICE_STATUS_BT_ICON);
- deviceStatusObj.put(DeviceStatus.KEY_CALL_ACTIVE, VehicleDataHelper.DEVICE_STATUS_CALL_ACTIVE);
- deviceStatusObj.put(DeviceStatus.KEY_PHONE_ROAMING, VehicleDataHelper.DEVICE_STATUS_PHONE_ROAMING);
- deviceStatusObj.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, VehicleDataHelper.DEVICE_STATUS_TEXT_MSG_AVAILABLE);
- deviceStatusObj.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, VehicleDataHelper.DEVICE_STATUS_BATT_LEVEL_STATUS);
- deviceStatusObj.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, VehicleDataHelper.DEVICE_STATUS_STEREO_MUTED);
- deviceStatusObj.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, VehicleDataHelper.DEVICE_STATUS_MONO_MUTED);
- deviceStatusObj.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, VehicleDataHelper.DEVICE_STATUS_SIGNAL_LEVEL_STATUS);
- deviceStatusObj.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, VehicleDataHelper.DEVICE_STATUS_PRIMARY_AUDIO);
- deviceStatusObj.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, VehicleDataHelper.DEVICE_STATUS_E_CALL_ACTIVE);
-
- //HEAD_LAMP_STATUS
- headLampStatusObj.put(HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS, VehicleDataHelper.HEAD_LAMP_STATUS_AMBIENT_STATUS);
- headLampStatusObj.put(HeadLampStatus.KEY_HIGH_BEAMS_ON, VehicleDataHelper.HEAD_LAMP_HIGH_BEAMS);
- headLampStatusObj.put(HeadLampStatus.KEY_LOW_BEAMS_ON, VehicleDataHelper.HEAD_LAMP_LOW_BEAMS);
-
- //E_CALL_INFO
- ECallInfoObj.put(ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS, VehicleDataHelper.E_CALL_INFO_E_CALL_NOTIFICATION_STATUS);
- ECallInfoObj.put(ECallInfo.KEY_AUX_E_CALL_NOTIFICATION_STATUS, VehicleDataHelper.E_CALL_INFO_AUX_E_CALL_NOTIFICATION_STATUS);
- ECallInfoObj.put(ECallInfo.KEY_E_CALL_CONFIRMATION_STATUS, VehicleDataHelper.E_CALL_INFO_CONFIRMATION_STATUS);
-
- //AIRBAG_STATUS
- airbagStatusObj.put(AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_SIDE_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_CURTAIN_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_KNEE_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_SIDE_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_CURTAIN_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_KNEE_DEPLOYED);
-
- //EMERGENCY_EVENT
- emergencyEventObj.put(EmergencyEvent.KEY_EMERGENCY_EVENT_TYPE, VehicleDataHelper.EMERGENCY_EVENT_TYPE);
- emergencyEventObj.put(EmergencyEvent.KEY_FUEL_CUTOFF_STATUS, VehicleDataHelper.EMERGENCY_EVENT_FUEL_CUTOFF_STATUS);
- emergencyEventObj.put(EmergencyEvent.KEY_ROLLOVER_EVENT, VehicleDataHelper.EMERGENCY_EVENT_ROLLOVER_EVENT);
- emergencyEventObj.put(EmergencyEvent.KEY_MAXIMUM_CHANGE_VELOCITY, VehicleDataHelper.EMERGENCY_EVENT_MAX_CHANGE_VELOCITY);
- emergencyEventObj.put(EmergencyEvent.KEY_MULTIPLE_EVENTS, VehicleDataHelper.EMERGENCY_EVENT_MULTIPLE_EVENTS);
-
- //CLUSTER_MODE_STATUS
- clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_ACTIVE, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_ACTIVE);
- clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_QUALIFICATION_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_QUALIFICATION_STATUS);
- clusterModeStatusObj.put(ClusterModeStatus.KEY_CAR_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_CAR_MODE_STATUS);
- clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_STATUS);
-
- //MY_KEY
- myKeyObj.put(MyKey.KEY_E_911_OVERRIDE, VehicleDataHelper.MY_KEY_E_911_OVERRIDE);
-
- // FUEL_RANGE
- fuelRangeObj.put(FuelRange.KEY_TYPE, VehicleDataHelper.FUEL_RANGE_TYPE);
- fuelRangeObj.put(FuelRange.KEY_RANGE, VehicleDataHelper.FUEL_RANGE_RANGE);
- fuelRangeArrayObj.put(fuelRangeObj);
-
- reference.put(OnVehicleData.KEY_SPEED, VehicleDataHelper.SPEED);
- reference.put(OnVehicleData.KEY_RPM, VehicleDataHelper.RPM);
- reference.put(OnVehicleData.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE);
- reference.put(OnVehicleData.KEY_FUEL_LEVEL, VehicleDataHelper.FUEL_LEVEL);
- reference.put(OnVehicleData.KEY_VIN, VehicleDataHelper.VIN);
- reference.put(OnVehicleData.KEY_PRNDL, VehicleDataHelper.PRNDL_FINAL);
- reference.put(OnVehicleData.KEY_TIRE_PRESSURE, tireStatusObj);
- reference.put(OnVehicleData.KEY_ENGINE_TORQUE, VehicleDataHelper.ENGINE_TORQUE);
- reference.put(OnVehicleData.KEY_ENGINE_OIL_LIFE, VehicleDataHelper.ENGINE_OIL_LIFE);
- reference.put(OnVehicleData.KEY_ODOMETER, VehicleDataHelper.ODOMETER);
- reference.put(OnVehicleData.KEY_GPS, GPSDataObj);
- reference.put(OnVehicleData.KEY_FUEL_LEVEL_STATE, VehicleDataHelper.FUEL_LEVEL_STATE);
- reference.put(OnVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION);
- reference.put(OnVehicleData.KEY_BELT_STATUS, beltStatusObj);
- reference.put(OnVehicleData.KEY_BODY_INFORMATION, bodyInformationObj);
- reference.put(OnVehicleData.KEY_DEVICE_STATUS, deviceStatusObj);
- reference.put(OnVehicleData.KEY_DRIVER_BRAKING, VehicleDataHelper.DRIVER_BRAKING);
- reference.put(OnVehicleData.KEY_WIPER_STATUS, VehicleDataHelper.WIPER_STATUS);
- reference.put(OnVehicleData.KEY_HEAD_LAMP_STATUS, headLampStatusObj);
- reference.put(OnVehicleData.KEY_ACC_PEDAL_POSITION, VehicleDataHelper.ACC_PEDAL_POSITION);
- reference.put(OnVehicleData.KEY_STEERING_WHEEL_ANGLE, VehicleDataHelper.STEERING_WHEEL_ANGLE);
- reference.put(OnVehicleData.KEY_E_CALL_INFO, ECallInfoObj);
- reference.put(OnVehicleData.KEY_AIRBAG_STATUS, airbagStatusObj);
- reference.put(OnVehicleData.KEY_EMERGENCY_EVENT, emergencyEventObj);
- reference.put(OnVehicleData.KEY_CLUSTER_MODE_STATUS, clusterModeStatusObj);
- reference.put(OnVehicleData.KEY_MY_KEY, myKeyObj);
- reference.put(OnVehicleData.KEY_FUEL_RANGE, fuelRangeArrayObj);
- reference.put(OnVehicleData.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL);
- reference.put(OnVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
-
- JSONObject underTest = msg.serializeJSON();
- //go inside underTest and only return the JSONObject inside the parameters key inside the notification key
- underTest = underTest.getJSONObject("notification").getJSONObject("parameters");
-
- assertEquals(Test.MATCH, reference.length(), underTest.length());
-
- Iterator<?> iterator = reference.keys();
-
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
-
- if (key.equals(OnVehicleData.KEY_TIRE_PRESSURE)) {
- JSONObject tirePressureReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject tirePressureTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateTireStatus(
- new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureReference)),
- new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureTest))));
-
- } else if (key.equals(OnVehicleData.KEY_GPS)) {
- JSONObject GPSObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject GPSObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateGpsData(
- new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjReference)),
- new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjTest))));
- } else if (key.equals(OnVehicleData.KEY_BELT_STATUS)) {
- JSONObject beltObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject beltObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateBeltStatus(
- new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjReference)),
- new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjTest))));
- } else if (key.equals(OnVehicleData.KEY_BODY_INFORMATION)) {
- JSONObject bodyInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject bodyInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateBodyInformation(
- new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjReference)),
- new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjTest))));
- } else if (key.equals(OnVehicleData.KEY_DEVICE_STATUS)) {
- JSONObject deviceObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject deviceObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateDeviceStatus(
- new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjReference)),
- new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjTest))));
- } else if (key.equals(OnVehicleData.KEY_HEAD_LAMP_STATUS)) {
- JSONObject headLampObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject headLampObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateHeadLampStatus(
- new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjReference)),
- new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjTest))));
- } else if (key.equals(OnVehicleData.KEY_E_CALL_INFO)) {
- JSONObject callInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject callInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateECallInfo(
- new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjReference)),
- new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjTest))));
- } else if (key.equals(OnVehicleData.KEY_AIRBAG_STATUS)) {
- JSONObject airbagObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject airbagObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateAirbagStatus(
- new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjReference)),
- new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjTest))));
- }
- else if (key.equals(OnVehicleData.KEY_EMERGENCY_EVENT)) {
- JSONObject emergencyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject emergencyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateEmergencyEvent(
- new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjReference)),
- new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjTest))));
- }
- else if (key.equals(OnVehicleData.KEY_CLUSTER_MODE_STATUS)) {
- JSONObject clusterModeObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject clusterModeObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateClusterModeStatus(
- new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjReference)),
- new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjTest))));
- }
- else if (key.equals(OnVehicleData.KEY_MY_KEY)) {
- JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue(Test.TRUE, Validator.validateMyKey(
- new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)),
- new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest))));
- }
- else if (key.equals(OnVehicleData.KEY_ENGINE_OIL_LIFE)) {
- assertEquals(JsonUtils.readDoubleFromJsonObject(reference, key), JsonUtils.readDoubleFromJsonObject(underTest, key));
- }
- else if (key.equals(OnVehicleData.KEY_FUEL_RANGE)) {
- JSONArray fuelRangeArrayObjReference = JsonUtils.readJsonArrayFromJsonObject(reference, key);
- List<FuelRange> fuelRangeRefereceList = new ArrayList<FuelRange>();
- for (int index = 0; index < fuelRangeArrayObjReference.length(); index++) {
- FuelRange fuelRange = new FuelRange(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)fuelRangeArrayObjReference.get(index) ));
- fuelRangeRefereceList.add(fuelRange);
- }
-
- JSONArray fuelRangeArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
- List<FuelRange> fuelRangeUnderTestList = new ArrayList<FuelRange>();
- for (int index = 0; index < fuelRangeArrayObjTest.length(); index++) {
- FuelRange fuelRange = new FuelRange(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)fuelRangeArrayObjTest.get(index) ));
- fuelRangeUnderTestList.add(fuelRange);
- }
-
- assertTrue(Test.TRUE, Validator.validateFuelRange(
- fuelRangeRefereceList,
- fuelRangeUnderTestList));
- }
- else {
- assertEquals(Test.TRUE, 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/requests/AddCommandTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java
deleted file mode 100644
index f4864a52d..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AddCommand;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.MenuParams;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.AddCommand}
- */
-public class AddCommandTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- AddCommand msg = new AddCommand();
-
- msg.setCmdIcon(Test.GENERAL_IMAGE);
- msg.setMenuParams(Test.GENERAL_MENUPARAMS);
- msg.setVrCommands(Test.GENERAL_STRING_LIST);
- msg.setCmdID(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ADD_COMMAND.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(AddCommand.KEY_CMD_ICON, Test.JSON_IMAGE);
- result.put(AddCommand.KEY_MENU_PARAMS, Test.JSON_MENUPARAMS);
- result.put(AddCommand.KEY_VR_COMMANDS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- result.put(AddCommand.KEY_CMD_ID, Test.GENERAL_INT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int testCmdId = ( (AddCommand) msg ).getCmdID();
- Image testImage = ( (AddCommand) msg ).getCmdIcon();
- MenuParams testMenuParams = ( (AddCommand) msg ).getMenuParams();
- List<String> testVrCommands = ( (AddCommand) msg ).getVrCommands();
-
- // Valid Tests
- assertNotNull(Test.NOT_NULL, testMenuParams);
- assertNotNull(Test.NOT_NULL, testImage);
- assertNotNull(Test.NOT_NULL, testVrCommands);
-
- assertEquals(Test.MATCH, Test.GENERAL_INT, testCmdId);
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), testVrCommands.size());
-
- assertTrue(Test.TRUE, Validator.validateMenuParams(Test.GENERAL_MENUPARAMS, testMenuParams));
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testImage));
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testVrCommands));
-
- // Invalid/Null Tests
- AddCommand msg = new AddCommand();
- assertNotNull(Test.NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getCmdIcon());
- assertNull(Test.NULL, msg.getCmdID());
- assertNull(Test.NULL, msg.getMenuParams());
- assertNull(Test.NULL, msg.getVrCommands());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- AddCommand cmd = new AddCommand(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- List<String> vrCommandsList = JsonUtils.readStringListFromJsonObject(parameters, AddCommand.KEY_VR_COMMANDS);
- List<String> testCommandsList = cmd.getVrCommands();
- assertEquals(Test.MATCH, vrCommandsList.size(), testCommandsList.size());
- assertTrue(Test.TRUE, Validator.validateStringList(vrCommandsList, testCommandsList));
-
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddCommand.KEY_CMD_ID), cmd.getCmdID());
-
- JSONObject menuParams = JsonUtils.readJsonObjectFromJsonObject(parameters, AddCommand.KEY_MENU_PARAMS);
- MenuParams referenceMenuParams = new MenuParams(JsonRPCMarshaller.deserializeJSONObject(menuParams));
- assertTrue(Test.TRUE, Validator.validateMenuParams(referenceMenuParams, cmd.getMenuParams()));
-
- JSONObject cmdIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddCommand.KEY_CMD_ICON);
- Image referenceCmdIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(cmdIcon));
- assertTrue(Test.TRUE, Validator.validateImage(referenceCmdIcon, cmd.getCmdIcon()));
-
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java
deleted file mode 100644
index 6e73121f1..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AddSubMenu;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.AddSubMenu}
- */
-public class AddSubmenuTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- AddSubMenu msg = new AddSubMenu();
-
- msg.setMenuID(Test.GENERAL_INT);
- msg.setMenuName(Test.GENERAL_STRING);
- msg.setPosition(Test.GENERAL_INT);
- msg.setMenuIcon(Test.GENERAL_IMAGE);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ADD_SUB_MENU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(AddSubMenu.KEY_MENU_ID, Test.GENERAL_INT);
- result.put(AddSubMenu.KEY_MENU_NAME, Test.GENERAL_STRING);
- result.put(AddSubMenu.KEY_POSITION, Test.GENERAL_INT);
- result.put(AddSubMenu.KEY_MENU_ICON, Test.JSON_IMAGE);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int testMenuId = ( (AddSubMenu) msg ).getMenuID();
- int testPosition = ( (AddSubMenu) msg ).getPosition();
- String testMenuName = ( (AddSubMenu) msg ).getMenuName();
- Image testMenuIcon = ( (AddSubMenu) msg ).getMenuIcon();
-
- // Valid Tests
- assertEquals("Menu ID didn't match input menu ID.", Test.GENERAL_INT, testMenuId);
- assertEquals("Menu name didn't match input menu name.", Test.GENERAL_STRING, testMenuName);
- assertEquals("Position didn't match input position.", Test.GENERAL_INT, testPosition);
- assertTrue("Menu icon didn't match input icon.", Validator.validateImage(Test.GENERAL_IMAGE, testMenuIcon));
-
-
- // Invalid/Null Tests
- AddSubMenu msg = new AddSubMenu();
- assertNotNull("Null object creation failed.", msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getMenuID());
- assertNull(Test.NULL, msg.getMenuName());
- assertNull(Test.NULL, msg.getPosition());
- assertNull(Test.NULL, msg.getMenuIcon());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- AddSubMenu cmd = new AddSubMenu(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_MENU_ID), cmd.getMenuID());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_POSITION), cmd.getPosition());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, AddSubMenu.KEY_MENU_NAME), cmd.getMenuName());
-
- JSONObject menuIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddSubMenu.KEY_MENU_ICON);
- Image referenceMenuIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(menuIcon));
- assertTrue(Test.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon()));
- } 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/requests/AlertManeuverTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java
deleted file mode 100644
index 83d8e1835..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AlertManeuver;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.AlertManeuver}
- */
-public class AlertManeuverTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- AlertManeuver msg = new AlertManeuver();
-
- msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST);
- msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.ALERT_MANEUVER.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(AlertManeuver.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS);
- result.put(AlertManeuver.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
- } catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<TTSChunk> testTtsChunks = ( (AlertManeuver) msg ).getTtsChunks();
- List<SoftButton> testSoftButtons = ( (AlertManeuver) msg ).getSoftButtons();
-
- // Valid Tests
- assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTtsChunks));
-
- // Invalid/Null Tests
- AlertManeuver msg = new AlertManeuver();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getTtsChunks());
- assertNull(Test.NULL, msg.getSoftButtons());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- AlertManeuver cmd = new AlertManeuver(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, AlertManeuver.KEY_TTS_CHUNKS);
-
- List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>();
- for (int index = 0; index < ttsChunkArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)));
- ttsChunkList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks()));
-
- JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, AlertManeuver.KEY_SOFT_BUTTONS);
- List<SoftButton> softButtonList = new ArrayList<SoftButton>();
- for (int index = 0; index < softButtonArray.length(); index++) {
- SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject((JSONObject)softButtonArray.get(index)));
- softButtonList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
- } 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/requests/AlertTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java
deleted file mode 100644
index 21a33aac0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Alert;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.Alert}
- */
-public class AlertTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- Alert msg = new Alert();
-
- msg.setDuration(Test.GENERAL_INT);
- msg.setAlertText1(Test.GENERAL_STRING);
- msg.setAlertText2(Test.GENERAL_STRING);
- msg.setAlertText3(Test.GENERAL_STRING);
- msg.setPlayTone(Test.GENERAL_BOOLEAN);
- msg.setProgressIndicator(Test.GENERAL_BOOLEAN);
- msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST);
- msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ALERT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(Alert.KEY_DURATION, Test.GENERAL_INT);
- result.put(Alert.KEY_ALERT_TEXT_1, Test.GENERAL_STRING);
- result.put(Alert.KEY_ALERT_TEXT_2, Test.GENERAL_STRING);
- result.put(Alert.KEY_ALERT_TEXT_3, Test.GENERAL_STRING);
- result.put(Alert.KEY_PLAY_TONE, Test.GENERAL_BOOLEAN);
- result.put(Alert.KEY_PROGRESS_INDICATOR, Test.GENERAL_BOOLEAN);
- result.put(Alert.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS);
- result.put(Alert.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int testDuration = ( (Alert) msg ).getDuration();
- String testAlertText1 = ( (Alert) msg ).getAlertText1();
- String testAlertText2 = ( (Alert) msg ).getAlertText2();
- String testAlertText3 = ( (Alert) msg ).getAlertText3();
- boolean testPlayTone = ( (Alert) msg ).getPlayTone();
- boolean testProgressIndicator = ( (Alert) msg ).getProgressIndicator();
- List<TTSChunk> testTtsChunks = ( (Alert) msg ).getTtsChunks();
- List<SoftButton> testSoftButtons = ( (Alert) msg ).getSoftButtons();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, testDuration);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText1);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText2);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText3);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testPlayTone);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testProgressIndicator);
- assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTtsChunks));
-
- // Invalid/Null Tests
- Alert msg = new Alert();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getAlertText1());
- assertNull(Test.NULL, msg.getAlertText2());
- assertNull(Test.NULL, msg.getAlertText3());
- assertNull(Test.NULL, msg.getDuration());
- assertNull(Test.NULL, msg.getPlayTone());
- assertNull(Test.NULL, msg.getProgressIndicator());
- assertNull(Test.NULL, msg.getTtsChunks());
- assertNull(Test.NULL, msg.getSoftButtons());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- Alert cmd = new Alert(hash);
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Alert.KEY_PLAY_TONE), cmd.getPlayTone());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Alert.KEY_DURATION), cmd.getDuration());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_1), cmd.getAlertText1());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_2), cmd.getAlertText2());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_3), cmd.getAlertText3());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Alert.KEY_PROGRESS_INDICATOR), cmd.getProgressIndicator());
-
- JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Alert.KEY_TTS_CHUNKS);
- List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>();
- for (int index = 0; index < ttsChunkArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) );
- ttsChunkList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks()));
-
- JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Alert.KEY_SOFT_BUTTONS);
- List<SoftButton> softButtonList = new ArrayList<SoftButton>();
- for (int index = 0; index < softButtonArray.length(); index++) {
- SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
- softButtonList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
- } 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/requests/ChangeRegistrationTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java
deleted file mode 100644
index 37ae9e6f9..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ChangeRegistration;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ChangeRegistration}
- */
-public class ChangeRegistrationTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- ChangeRegistration msg = new ChangeRegistration();
-
- msg.setLanguage(Test.GENERAL_LANGUAGE);
- msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.CHANGE_REGISTRATION.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(ChangeRegistration.KEY_LANGUAGE, Test.GENERAL_LANGUAGE);
- result.put(ChangeRegistration.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Language testLanguage = ( (ChangeRegistration) msg ).getLanguage();
- Language testHmiLanguage = ( (ChangeRegistration) msg ).getHmiDisplayLanguage();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testLanguage);
- assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testHmiLanguage);
-
- // Invalid/Null Tests
- ChangeRegistration msg = new ChangeRegistration();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getLanguage());
- assertNull(Test.NULL, msg.getHmiDisplayLanguage());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ChangeRegistration cmd = new ChangeRegistration(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ChangeRegistration.KEY_LANGUAGE), cmd.getLanguage().toString());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ChangeRegistration.KEY_HMI_DISPLAY_LANGUAGE), cmd.getHmiDisplayLanguage().toString());
- } 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/requests/CreateInteractionChoiceSetTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java
deleted file mode 100644
index 168666dcb..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Choice;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.CreateInteractionChoiceSet}
- */
-public class CreateInteractionChoiceSetTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet();
-
- msg.setInteractionChoiceSetID(Test.GENERAL_INT);
- msg.setChoiceSet(Test.GENERAL_CHOICE_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.CREATE_INTERACTION_CHOICE_SET.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(CreateInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID, Test.GENERAL_INT);
- result.put(CreateInteractionChoiceSet.KEY_CHOICE_SET, Test.JSON_CHOICES);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int testCmdId = ( (CreateInteractionChoiceSet) msg ).getInteractionChoiceSetID();
- List<Choice> testChoices = ( (CreateInteractionChoiceSet) msg ).getChoiceSet();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, testCmdId);
- assertEquals(Test.MATCH, Test.GENERAL_CHOICE_LIST.size(), testChoices.size());
- for(int i = 0; i < testChoices.size(); i++){
- assertTrue(Test.TRUE, Validator.validateChoice(Test.GENERAL_CHOICE_LIST.get(i), testChoices.get(i)));
- }
-
- // Invalid/Null Tests
- CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getChoiceSet());
- assertNull(Test.NULL, msg.getInteractionChoiceSetID());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- CreateInteractionChoiceSet cmd = new CreateInteractionChoiceSet(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CreateInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID), cmd.getInteractionChoiceSetID());
-
- JSONArray choiceSetArray = JsonUtils.readJsonArrayFromJsonObject(parameters, CreateInteractionChoiceSet.KEY_CHOICE_SET);
- for (int index = 0; index < choiceSetArray.length(); index++) {
- Choice chunk = new Choice(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)choiceSetArray.get(index)) );
- assertTrue(Test.TRUE, Validator.validateChoice(chunk, cmd.getChoiceSet().get(index)) );
- }
- } 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/requests/DeleteCommandTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java
deleted file mode 100644
index 43af829e4..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeleteCommand;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeleteCommand}
- */
-public class DeleteCommandTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- DeleteCommand msg = new DeleteCommand();
-
- msg.setCmdID(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DELETE_COMMAND.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(DeleteCommand.KEY_CMD_ID, Test.GENERAL_INT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int cmdId = ( (DeleteCommand) msg ).getCmdID();
-
- // Valid Tests
- assertEquals("Command ID didn't match input command ID.", Test.GENERAL_INT, cmdId);
-
- // Invalid/Null Tests
- DeleteCommand msg = new DeleteCommand();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.MATCH, msg.getCmdID());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DeleteCommand cmd = new DeleteCommand(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteCommand.KEY_CMD_ID), cmd.getCmdID());
- }
- 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/requests/DeleteFileTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java
deleted file mode 100644
index 8d8300e0c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeleteFile;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeleteFile}
- */
-public class DeleteFileTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- DeleteFile msg = new DeleteFile();
-
- msg.setSdlFileName(Test.GENERAL_STRING);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DELETE_FILE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(DeleteFile.KEY_SDL_FILE_NAME, Test.GENERAL_STRING);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String testFilename = ( (DeleteFile) msg ).getSdlFileName();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testFilename);
-
- // Invalid/Null Tests
- DeleteFile msg = new DeleteFile();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSdlFileName());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DeleteFile cmd = new DeleteFile(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, DeleteFile.KEY_SDL_FILE_NAME), cmd.getSdlFileName());
- } 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/requests/DeleteInteractionChoiceSetTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java
deleted file mode 100644
index b9b1bbc15..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeleteInteractionChoiceSet}
- */
-public class DeleteInteractionChoiceSetTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet();
-
- msg.setInteractionChoiceSetID(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DELETE_INTERACTION_CHOICE_SET.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(DeleteInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID, Test.GENERAL_INT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int testChoiceSetId = ( (DeleteInteractionChoiceSet) msg ).getInteractionChoiceSetID();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, testChoiceSetId);
-
- // Invalid/Null Tests
- DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getInteractionChoiceSetID());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DeleteInteractionChoiceSet cmd = new DeleteInteractionChoiceSet(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID), cmd.getInteractionChoiceSetID());
- } 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/requests/DeleteSubMenuTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java
deleted file mode 100644
index db9e06e12..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenu;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeleteSubMenu}
- */
-public class DeleteSubMenuTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- DeleteSubMenu msg = new DeleteSubMenu();
-
- msg.setMenuID(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DELETE_SUB_MENU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(DeleteSubMenu.KEY_MENU_ID, Test.GENERAL_INT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int testMenuId = ( (DeleteSubMenu) msg ).getMenuID();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, testMenuId);
-
- // Invalid/Null Tests
- DeleteSubMenu msg = new DeleteSubMenu();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getMenuID());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DeleteSubMenu cmd = new DeleteSubMenu(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteSubMenu.KEY_MENU_ID), cmd.getMenuID());
- } 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/requests/DiagnosticMessageTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java
deleted file mode 100644
index 4ee758c3d..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DiagnosticMessage;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DiagnosticMessage}
- */
-public class DiagnosticMessageTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- DiagnosticMessage msg = new DiagnosticMessage();
-
- msg.setMessageLength(Test.GENERAL_INT);
- msg.setTargetID(Test.GENERAL_INT);
- msg.setMessageData(Test.GENERAL_INTEGER_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DIAGNOSTIC_MESSAGE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(DiagnosticMessage.KEY_TARGET_ID, Test.GENERAL_INT);
- result.put(DiagnosticMessage.KEY_MESSAGE_LENGTH, Test.GENERAL_INT);
- result.put(DiagnosticMessage.KEY_MESSAGE_DATA, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int testTargetId = ( (DiagnosticMessage) msg ).getTargetID();
- int testMessageLength = ( (DiagnosticMessage) msg ).getMessageLength();
- List<Integer> testMessageData = ( (DiagnosticMessage) msg ).getMessageData();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, testTargetId);
- assertEquals(Test.MATCH, Test.GENERAL_INT, testMessageLength);
- assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.size(), testMessageData.size());
-
- for(int i = 0; i < testMessageData.size(); i++){
- assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.get(i), testMessageData.get(i));
- }
-
- // Invalid/Null Tests
- DiagnosticMessage msg = new DiagnosticMessage();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getTargetID());
- assertNull(Test.NULL, msg.getMessageLength());
- assertNull(Test.NULL, msg.getMessageData());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DiagnosticMessage cmd = new DiagnosticMessage(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DiagnosticMessage.KEY_TARGET_ID), cmd.getTargetID());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DiagnosticMessage.KEY_MESSAGE_LENGTH), cmd.getMessageLength());
-
- List<Integer> messageDataList = JsonUtils.readIntegerListFromJsonObject(parameters, DiagnosticMessage.KEY_MESSAGE_DATA);
- List<Integer> testDataList = cmd.getMessageData();
- assertEquals(Test.MATCH, messageDataList.size(), testDataList.size());
- assertTrue(Test.TRUE, Validator.validateIntegerList(messageDataList, testDataList));
- } 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/requests/EndAudioPassThruTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java
deleted file mode 100644
index 448f592ed..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.EndAudioPassThru;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.EndAudioPassThru}
- */
-public class EndAudioPassThruTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new EndAudioPassThru();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.END_AUDIO_PASS_THRU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- EndAudioPassThru msg = new EndAudioPassThru();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- EndAudioPassThru cmd = new EndAudioPassThru(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } 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/requests/GetDTCsTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java
deleted file mode 100644
index 1d5cbcad1..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.GetDTCs;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.GetDTCs}
- */
-public class GetDTCsTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- GetDTCs msg = new GetDTCs();
-
- msg.setEcuName(Test.GENERAL_INT);
- msg.setDtcMask(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.GET_DTCS.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(GetDTCs.KEY_ECU_NAME, Test.GENERAL_INT);
- result.put(GetDTCs.KEY_DTC_MASK, Test.GENERAL_INT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int testDtcMask = ( (GetDTCs) msg ).getDtcMask();
- int testEcuName = ( (GetDTCs) msg ).getEcuName();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, testDtcMask);
- assertEquals(Test.MATCH, Test.GENERAL_INT, testEcuName);
-
- // Invalid/Null Tests
- GetDTCs msg = new GetDTCs();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getEcuName());
- assertNull(Test.NULL, msg.getDtcMask());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- GetDTCs cmd = new GetDTCs(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetDTCs.KEY_DTC_MASK), cmd.getDtcMask());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetDTCs.KEY_ECU_NAME), cmd.getEcuName());
- }
- 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/requests/GetSystemCapabilityTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java
deleted file mode 100644
index 78d4507da..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.GetSystemCapability;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.Hashtable;
-
-public class GetSystemCapabilityTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- GetSystemCapability msg = new GetSystemCapability();
-
- msg.setSystemCapabilityType(Test.GENERAL_SYSTEMCAPABILITYTYPE);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.GET_SYSTEM_CAPABILITY.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(GetSystemCapability.KEY_SYSTEM_CAPABILITY_TYPE, Test.GENERAL_SYSTEMCAPABILITYTYPE);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- SystemCapabilityType testType = ( (GetSystemCapability) msg ).getSystemCapabilityType();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITYTYPE, testType);
-
- // Invalid/Null Tests
- GetSystemCapability msg = new GetSystemCapability();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSystemCapabilityType());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- GetSystemCapability cmd = new GetSystemCapability(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetSystemCapability.KEY_SYSTEM_CAPABILITY_TYPE).toString(), cmd.getSystemCapabilityType().toString());
- }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/requests/GetVehicleDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java
deleted file mode 100644
index 54f299fdf..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java
+++ /dev/null
@@ -1,235 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.GetVehicleData;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.GetVehicleData}
- */
-public class GetVehicleDataTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- GetVehicleData msg = new GetVehicleData();
-
- msg.setSpeed(Test.GENERAL_BOOLEAN);
- msg.setRpm(Test.GENERAL_BOOLEAN);
- msg.setExternalTemperature(Test.GENERAL_BOOLEAN);
- msg.setFuelLevel(Test.GENERAL_BOOLEAN);
- msg.setPrndl(Test.GENERAL_BOOLEAN);
- msg.setTirePressure(Test.GENERAL_BOOLEAN);
- msg.setEngineTorque(Test.GENERAL_BOOLEAN);
- msg.setEngineOilLife(Test.GENERAL_BOOLEAN);
- msg.setOdometer(Test.GENERAL_BOOLEAN);
- msg.setGps(Test.GENERAL_BOOLEAN);
- msg.setFuelLevelState(Test.GENERAL_BOOLEAN);
- msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN);
- msg.setVin(Test.GENERAL_BOOLEAN);
- msg.setBeltStatus(Test.GENERAL_BOOLEAN);
- msg.setBodyInformation(Test.GENERAL_BOOLEAN);
- msg.setDeviceStatus(Test.GENERAL_BOOLEAN);
- msg.setDriverBraking(Test.GENERAL_BOOLEAN);
- msg.setWiperStatus(Test.GENERAL_BOOLEAN);
- msg.setHeadLampStatus(Test.GENERAL_BOOLEAN);
- msg.setAccPedalPosition(Test.GENERAL_BOOLEAN);
- msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN);
- msg.setECallInfo(Test.GENERAL_BOOLEAN);
- msg.setAirbagStatus(Test.GENERAL_BOOLEAN);
- msg.setEmergencyEvent(Test.GENERAL_BOOLEAN);
- msg.setClusterModeStatus(Test.GENERAL_BOOLEAN);
- msg.setMyKey(Test.GENERAL_BOOLEAN);
- msg.setFuelRange(Test.GENERAL_BOOLEAN);
- msg.setTurnSignal(Test.GENERAL_BOOLEAN);
- msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.GET_VEHICLE_DATA.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(GetVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_VIN, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN);
- result.put(GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Valid Tests
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getSpeed());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getRpm());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getExternalTemperature());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelLevel());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getPrndl());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getTirePressure());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEngineTorque());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEngineOilLife());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getOdometer());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getGps());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelLevelState());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getInstantFuelConsumption());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getVin());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getBeltStatus());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getBodyInformation());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getVin());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getDeviceStatus());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getDriverBraking());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getWiperStatus());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getHeadLampStatus());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getAccPedalPosition());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getSteeringWheelAngle());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getECallInfo());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getAirbagStatus());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEmergencyEvent());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getClusterModeStatus());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getMyKey());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelRange());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getTurnSignal());
- assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getElectronicParkBrakeStatus());
-
- // Invalid/Null Tests
- GetVehicleData msg = new GetVehicleData();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getAccPedalPosition());
- assertNull(Test.NULL, msg.getAirbagStatus());
- assertNull(Test.NULL, msg.getBeltStatus());
- assertNull(Test.NULL, msg.getDriverBraking());
- assertNull(Test.NULL, msg.getFuelLevel());
- assertNull(Test.NULL, msg.getTirePressure());
- assertNull(Test.NULL, msg.getWiperStatus());
- assertNull(Test.NULL, msg.getGps());
- assertNull(Test.NULL, msg.getSpeed());
- assertNull(Test.NULL, msg.getRpm());
- assertNull(Test.NULL, msg.getFuelLevelState());
- assertNull(Test.NULL, msg.getInstantFuelConsumption());
- assertNull(Test.NULL, msg.getExternalTemperature());
- assertNull(Test.NULL, msg.getVin());
- assertNull(Test.NULL, msg.getPrndl());
- assertNull(Test.NULL, msg.getOdometer());
- assertNull(Test.NULL, msg.getBodyInformation());
- assertNull(Test.NULL, msg.getDeviceStatus());
- assertNull(Test.NULL, msg.getHeadLampStatus());
- assertNull(Test.NULL, msg.getEngineTorque());
- assertNull(Test.NULL, msg.getEngineOilLife());
- assertNull(Test.NULL, msg.getSteeringWheelAngle());
- assertNull(Test.NULL, msg.getECallInfo());
- assertNull(Test.NULL, msg.getEmergencyEvent());
- assertNull(Test.NULL, msg.getClusterModeStatus());
- assertNull(Test.NULL, msg.getMyKey());
- assertNull(Test.NULL, msg.getFuelRange());
- assertNull(Test.NULL, msg.getTurnSignal());
- assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- GetVehicleData cmd = new GetVehicleData(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals("Command name doesn't match input name", JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals("Correlation ID doesn't match input ID", JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_SPEED), cmd.getSpeed());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_RPM), cmd.getRpm());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_VIN), cmd.getVin());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_PRNDL), cmd.getPrndl());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ODOMETER), cmd.getOdometer());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_GPS), cmd.getGps());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_MY_KEY), cmd.getMyKey());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus());
- } 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/requests/ListFilesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java
deleted file mode 100644
index 31d20bacf..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ListFiles;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ListFiles}
- */
-public class ListFilesTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new ListFiles();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.LIST_FILES.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- ListFiles msg = new ListFiles();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ListFiles cmd = new ListFiles(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } 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/requests/PerformAudioPassThruTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java
deleted file mode 100644
index d3ecbdfeb..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.PerformAudioPassThru;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.PerformAudioPassThru}
- */
-public class PerformAudioPassThruTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- PerformAudioPassThru msg = new PerformAudioPassThru();
-
- msg.setInitialPrompt(Test.GENERAL_TTSCHUNK_LIST);
- msg.setAudioPassThruDisplayText1(Test.GENERAL_STRING);
- msg.setAudioPassThruDisplayText2(Test.GENERAL_STRING);
- msg.setSamplingRate(Test.GENERAL_SAMPLINGRATE);
- msg.setAudioType(Test.GENERAL_AUDIOTYPE);
- msg.setBitsPerSample(Test.GENERAL_BITSPERSAMPLE);
- msg.setMaxDuration(Test.GENERAL_INT);
- msg.setMuteAudio(Test.GENERAL_BOOLEAN);
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.PERFORM_AUDIO_PASS_THRU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1, Test.GENERAL_STRING);
- result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2, Test.GENERAL_STRING);
- result.put(PerformAudioPassThru.KEY_MUTE_AUDIO, Test.GENERAL_BOOLEAN);
- result.put(PerformAudioPassThru.KEY_MAX_DURATION, Test.GENERAL_INT);
- result.put(PerformAudioPassThru.KEY_AUDIO_TYPE, Test.GENERAL_AUDIOTYPE);
- result.put(PerformAudioPassThru.KEY_SAMPLING_RATE, Test.GENERAL_SAMPLINGRATE);
- result.put(PerformAudioPassThru.KEY_BITS_PER_SAMPLE, Test.GENERAL_BITSPERSAMPLE);
- result.put(PerformAudioPassThru.KEY_INITIAL_PROMPT, Test.JSON_TTSCHUNKS);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- boolean testMuteAudio = ( (PerformAudioPassThru) msg ).getMuteAudio();
- int testMaxDuration = ( (PerformAudioPassThru) msg ).getMaxDuration();
- String testText2 = ( (PerformAudioPassThru) msg ).getAudioPassThruDisplayText2();
- String testText1 = ( (PerformAudioPassThru) msg ).getAudioPassThruDisplayText1();
- SamplingRate testSamplingRate = ( (PerformAudioPassThru) msg ).getSamplingRate();
- AudioType testAudioType = ( (PerformAudioPassThru) msg ).getAudioType();
- BitsPerSample testBitsPerSample = ( (PerformAudioPassThru) msg ).getBitsPerSample();
- List<TTSChunk> testInitialPrompt = ( (PerformAudioPassThru) msg ).getInitialPrompt();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_TTSCHUNK_LIST.size(), testInitialPrompt.size());
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testText1);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testText2);
- assertEquals(Test.MATCH, Test.GENERAL_SAMPLINGRATE, testSamplingRate);
- assertEquals(Test.MATCH, Test.GENERAL_BITSPERSAMPLE, testBitsPerSample);
- assertEquals(Test.MATCH, Test.GENERAL_AUDIOTYPE, testAudioType);
- assertEquals(Test.MATCH, Test.GENERAL_INT, testMaxDuration);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testMuteAudio);
- for (int i = 0; i < Test.GENERAL_TTSCHUNK_LIST.size(); i++) {
- assertEquals(Test.MATCH, Test.GENERAL_TTSCHUNK_LIST.get(i), testInitialPrompt.get(i));
- }
-
- // Invalid/Null Tests
- PerformAudioPassThru msg = new PerformAudioPassThru();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getInitialPrompt());
- assertNull(Test.NULL, msg.getAudioPassThruDisplayText1());
- assertNull(Test.NULL, msg.getAudioPassThruDisplayText2());
- assertNull(Test.NULL, msg.getSamplingRate());
- assertNull(Test.NULL, msg.getBitsPerSample());
- assertNull(Test.NULL, msg.getAudioType());
- assertNull(Test.NULL, msg.getMaxDuration());
- assertNull(Test.NULL, msg.getMuteAudio());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- PerformAudioPassThru cmd = new PerformAudioPassThru(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformAudioPassThru.KEY_MAX_DURATION), (Integer)cmd.getMaxDuration());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1), cmd.getAudioPassThruDisplayText1());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2), cmd.getAudioPassThruDisplayText2());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PerformAudioPassThru.KEY_MUTE_AUDIO), cmd.getMuteAudio());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_SAMPLING_RATE), cmd.getSamplingRate().toString());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_TYPE), cmd.getAudioType().toString());
-
- JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformAudioPassThru.KEY_INITIAL_PROMPT);
- List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>();
- for (int index = 0; index < ttsChunkArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) );
- ttsChunkList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getInitialPrompt()));
-
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_BITS_PER_SAMPLE), cmd.getBitsPerSample().toString());
- } 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/requests/PerformInteractionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java
deleted file mode 100644
index 9ea36f43f..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.PerformInteraction;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.VrHelpItem;
-import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
-import com.smartdevicelink.proxy.rpc.enums.LayoutMode;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.PerformInteraction}
- */
-public class PerformInteractionTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- PerformInteraction msg = new PerformInteraction();
-
- msg.setInitialPrompt(Test.GENERAL_TTSCHUNK_LIST);
- msg.setHelpPrompt(Test.GENERAL_TTSCHUNK_LIST);
- msg.setTimeoutPrompt(Test.GENERAL_TTSCHUNK_LIST);
- msg.setVrHelp(Test.GENERAL_VRHELPITEM_LIST);
- msg.setInteractionChoiceSetIDList(Test.GENERAL_INTEGER_LIST);
- msg.setInteractionLayout(Test.GENERAL_LAYOUTMODE);
- msg.setInitialText(Test.GENERAL_STRING);
- msg.setInteractionMode(Test.GENERAL_INTERACTIONMODE);
- msg.setTimeout(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.PERFORM_INTERACTION.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(PerformInteraction.KEY_INITIAL_PROMPT, Test.JSON_TTSCHUNKS);
- result.put(PerformInteraction.KEY_HELP_PROMPT, Test.JSON_TTSCHUNKS);
- result.put(PerformInteraction.KEY_TIMEOUT_PROMPT, Test.JSON_TTSCHUNKS);
- result.put(PerformInteraction.KEY_VR_HELP, Test.JSON_VRHELPITEMS);
- result.put(PerformInteraction.KEY_INTERACTION_CHOICE_SET_ID_LIST, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
- result.put(PerformInteraction.KEY_INTERACTION_LAYOUT, Test.GENERAL_LAYOUTMODE);
- result.put(PerformInteraction.KEY_INITIAL_TEXT, Test.GENERAL_STRING);
- result.put(PerformInteraction.KEY_INTERACTION_MODE, Test.GENERAL_INTERACTIONMODE);
- result.put(PerformInteraction.KEY_TIMEOUT, Test.GENERAL_INT);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<TTSChunk> testInitialPrompt = ( (PerformInteraction) msg).getInitialPrompt();
- List<TTSChunk> testHelpPrompt = ( (PerformInteraction) msg).getHelpPrompt();
- List<TTSChunk> testTimeoutPrompt = ( (PerformInteraction) msg).getTimeoutPrompt();
- List<VrHelpItem> testVrHelpItems = ( (PerformInteraction) msg).getVrHelp();
- List<Integer> testChoiceSetIds = ( (PerformInteraction) msg).getInteractionChoiceSetIDList();
- LayoutMode testLayout = ( (PerformInteraction) msg).getInteractionLayout();
- String testInitialText = ( (PerformInteraction) msg).getInitialText();
- InteractionMode testMode = ( (PerformInteraction) msg).getInteractionMode();
- Integer testTimeout = ( (PerformInteraction) msg).getTimeout();
-
- // Valid Tests
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testInitialPrompt));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testHelpPrompt));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTimeoutPrompt));
- assertTrue(Test.TRUE, Validator.validateVrHelpItems(Test.GENERAL_VRHELPITEM_LIST, testVrHelpItems));
- assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testChoiceSetIds);
- assertEquals(Test.MATCH, Test.GENERAL_LAYOUTMODE, testLayout);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testInitialText);
- assertEquals(Test.MATCH, Test.GENERAL_INTERACTIONMODE, testMode);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout);
-
- // Invald/Null Tests
- PerformInteraction msg = new PerformInteraction();
- assertNotNull(Test.NOT_NULL, msg);
-
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getInitialPrompt());
- assertNull(Test.NULL, msg.getHelpPrompt());
- assertNull(Test.NULL, msg.getTimeoutPrompt());
- assertNull(Test.NULL, msg.getVrHelp());
- assertNull(Test.NULL, msg.getInteractionChoiceSetIDList());
- assertNull(Test.NULL, msg.getInteractionLayout());
- assertNull(Test.NULL, msg.getInitialText());
- assertNull(Test.NULL, msg.getInteractionMode());
- assertNull(Test.NULL, msg.getTimeout());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- PerformInteraction cmd = new PerformInteraction(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INITIAL_TEXT), cmd.getInitialText());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_MODE), cmd.getInteractionMode().toString());
-
- List<Integer> interactionIDList = JsonUtils.readIntegerListFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_CHOICE_SET_ID_LIST);
- List<Integer> testIDList = cmd.getInteractionChoiceSetIDList();
- assertEquals(Test.MATCH, interactionIDList.size(), testIDList.size());
- assertTrue(Test.TRUE, Validator.validateIntegerList(interactionIDList, testIDList));
-
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_LAYOUT), cmd.getInteractionLayout().toString());
-
- JSONArray initalPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_INITIAL_PROMPT);
- List<TTSChunk> initalPromptList = new ArrayList<TTSChunk>();
- for (int index = 0; index < initalPromptArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)initalPromptArray.get(index)) );
- initalPromptList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(initalPromptList, cmd.getInitialPrompt()));
-
- JSONArray helpPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_HELP_PROMPT);
- List<TTSChunk> helpPromptList = new ArrayList<TTSChunk>();
- for (int index = 0; index < helpPromptArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)helpPromptArray.get(index)) );
- helpPromptList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(helpPromptList, cmd.getHelpPrompt()));
-
- JSONArray timeoutPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_TIMEOUT_PROMPT);
- List<TTSChunk> timeoutPromptList = new ArrayList<TTSChunk>();
- for (int index = 0; index < timeoutPromptArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)timeoutPromptArray.get(index)) );
- timeoutPromptList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(timeoutPromptList, cmd.getTimeoutPrompt()));
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteraction.KEY_TIMEOUT), cmd.getTimeout());
-
- JSONArray vrHelpArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_VR_HELP);
- List<VrHelpItem> vrHelpList= new ArrayList<VrHelpItem>();
- for (int index = 0; index < vrHelpArray.length(); index++) {
- VrHelpItem vrHelpItem = new VrHelpItem(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)vrHelpArray.get(index)) );
- vrHelpList.add(vrHelpItem);
- }
- assertTrue(Test.TRUE, Validator.validateVrHelpItems(vrHelpList, cmd.getVrHelp()) );
- } 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/requests/PutFileTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java
deleted file mode 100644
index 7b6ce75e5..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.zip.CRC32;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.PutFile;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.PutFile}
- */
-public class PutFileTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- PutFile msg = new PutFile();
-
- msg.setFileType(Test.GENERAL_FILETYPE);
- msg.setPersistentFile(Test.GENERAL_BOOLEAN);
- msg.setSystemFile(Test.GENERAL_BOOLEAN);
- msg.setOffset(Test.GENERAL_LONG);
- msg.setLength(Test.GENERAL_LONG);
- msg.setCRC(Test.GENERAL_BYTE_ARRAY);
- msg.setCRC(Test.GENERAL_LONG);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.PUT_FILE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(PutFile.KEY_FILE_TYPE, Test.GENERAL_FILETYPE);
- result.put(PutFile.KEY_PERSISTENT_FILE, Test.GENERAL_BOOLEAN);
- result.put(PutFile.KEY_SYSTEM_FILE, Test.GENERAL_BOOLEAN);
- result.put(PutFile.KEY_OFFSET, Test.GENERAL_LONG);
- result.put(PutFile.KEY_LENGTH, Test.GENERAL_LONG);
- result.put(PutFile.KEY_CRC, Test.GENERAL_LONG);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- FileType testFileType = ( (PutFile) msg ).getFileType();
- boolean testPersistentFile = ( (PutFile) msg ).getPersistentFile();
- boolean testSystemFile = ( (PutFile) msg ).getSystemFile();
- Long testOffset = ( (PutFile) msg ).getOffset();
- Long testLength = ( (PutFile) msg ).getLength();
- Long testCRC = ( (PutFile) msg ).getCRC();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, testFileType);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testPersistentFile);
- assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testSystemFile);
- assertEquals(Test.MATCH, Test.GENERAL_LONG, testOffset);
- assertEquals(Test.MATCH, Test.GENERAL_LONG, testLength);
- assertEquals(Test.MATCH, Test.GENERAL_LONG, testCRC);
-
- // Invalid/Null Tests
- PutFile msg = new PutFile();
- assertNotNull("Null object creation failed.", msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getFileType());
- assertNull(Test.NULL, msg.getPersistentFile());
- assertNull(Test.NULL, msg.getSystemFile());
- assertNull(Test.NULL, msg.getOffset());
- assertNull(Test.NULL, msg.getLength());
- assertNull(Test.NULL, msg.getCRC());
- }
-
- /**
- * Tests the expected values of the CRC checksum.
- */
- public void testByteArrayCheckSum () {
- // Test Values
- PutFile msgCRC = new PutFile();
- msgCRC.setCRC(Test.GENERAL_BYTE_ARRAY);
- Long testCRCByteArray = msgCRC.getCRC();
-
- CRC32 crc = new CRC32();
- crc.update(Test.GENERAL_BYTE_ARRAY);
- Long crcValue = crc.getValue();
-
- assertEquals(Test.MATCH, crcValue, testCRCByteArray);
- }
-
-
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- PutFile cmd = new PutFile(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PutFile.KEY_PERSISTENT_FILE), cmd.getPersistentFile());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PutFile.KEY_SYSTEM_FILE), cmd.getSystemFile());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PutFile.KEY_FILE_TYPE), cmd.getFileType().toString());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PutFile.KEY_SDL_FILE_NAME), cmd.getSdlFileName());
- assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_OFFSET).longValue(), cmd.getOffset());
- assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_LENGTH).longValue(), cmd.getLength());
- assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_CRC).longValue(), cmd.getCRC());
- } 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/requests/ReadDidTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java
deleted file mode 100644
index 477acc1aa..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ReadDID;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ReadDID}
- */
-public class ReadDidTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- ReadDID msg = new ReadDID();
-
- msg.setEcuName(Test.GENERAL_INT);
- msg.setDidLocation(Test.GENERAL_INTEGER_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.READ_DID.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(ReadDID.KEY_ECU_NAME, Test.GENERAL_INT);
- result.put(ReadDID.KEY_DID_LOCATION, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Integer testEcuName = ( (ReadDID) msg ).getEcuName();
- List<Integer> testDidLocation = ( (ReadDID) msg ).getDidLocation();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testEcuName);
- assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testDidLocation);
-
- // Invalid/Null Tests
- ReadDID msg = new ReadDID();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getEcuName());
- assertNull(Test.NULL, msg.getDidLocation());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ReadDID cmd = new ReadDID(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ReadDID.KEY_ECU_NAME), cmd.getEcuName());
-
- List<Integer> didLocationList = JsonUtils.readIntegerListFromJsonObject(parameters, ReadDID.KEY_DID_LOCATION);
- List<Integer> testLocationList = cmd.getDidLocation();
- assertEquals(Test.MATCH, didLocationList.size(), testLocationList.size());
- assertTrue(Test.TRUE, Validator.validateIntegerList(didLocationList, testLocationList));
- } 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/requests/RegisterAppInterfaceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
deleted file mode 100644
index 85b6f28ea..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
+++ /dev/null
@@ -1,218 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeviceInfo;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.RegisterAppInterface}
- */
-public class RegisterAppInterfaceTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- RegisterAppInterface msg = new RegisterAppInterface();
-
- msg.setSdlMsgVersion(Test.GENERAL_SDLMSGVERSION);
- msg.setAppName(Test.GENERAL_STRING);
- msg.setNgnMediaScreenAppName(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);
- msg.setTtsName(Test.GENERAL_TTSCHUNK_LIST);
- msg.setVrSynonyms(Test.GENERAL_STRING_LIST);
- msg.setAppHMIType(Test.GENERAL_APPHMITYPE_LIST);
- msg.setIsMediaApplication(Test.GENERAL_BOOLEAN);
- msg.setDeviceInfo(Test.GENERAL_DEVICEINFO);
- msg.setDayColorScheme(Test.GENERAL_DAYCOLORSCHEME);
- msg.setNightColorScheme(Test.GENERAL_NIGHTCOLORSCHEME);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.REGISTER_APP_INTERFACE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- 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_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);
- result.put(RegisterAppInterface.KEY_TTS_NAME, Test.JSON_TTSCHUNKS);
- result.put(RegisterAppInterface.KEY_VR_SYNONYMS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- result.put(RegisterAppInterface.KEY_APP_HMI_TYPE, JsonUtils.createJsonArrayOfJsonNames(Test.GENERAL_APPHMITYPE_LIST, SDL_VERSION_UNDER_TEST));
- result.put(RegisterAppInterface.KEY_IS_MEDIA_APPLICATION, Test.GENERAL_BOOLEAN);
- result.put(RegisterAppInterface.KEY_DEVICE_INFO, Test.JSON_DEVICEINFO);
- result.put(RegisterAppInterface.KEY_DAY_COLOR_SCHEME, Test.JSON_DAYCOLORSCHEME);
- result.put(RegisterAppInterface.KEY_NIGHT_COLOR_SCHEME, Test.JSON_NIGHTCOLORSCHEME);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- SdlMsgVersion testVersion = ( (RegisterAppInterface) msg).getSdlMsgVersion();
- 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();
- List<TTSChunk> testTts = ( (RegisterAppInterface) msg).getTtsName();
- List<String> testSynonyms = ( (RegisterAppInterface) msg).getVrSynonyms();
- List<AppHMIType> testApps = ( (RegisterAppInterface) msg).getAppHMIType();
- Boolean testMedia = ( (RegisterAppInterface) msg).getIsMediaApplication();
- DeviceInfo testDeviceInfo = ( (RegisterAppInterface) msg).getDeviceInfo();
- TemplateColorScheme testDayColorScheme = ( (RegisterAppInterface) msg).getDayColorScheme();
- TemplateColorScheme testNightColorScheme = ( (RegisterAppInterface) msg).getNightColorScheme();
-
- // Valid Tests
- 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_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);
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTts));
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST, testSynonyms);
- assertEquals(Test.MATCH, Test.GENERAL_APPHMITYPE_LIST, testApps);
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, testMedia);
- assertTrue(Test.TRUE, Validator.validateDeviceInfo(Test.GENERAL_DEVICEINFO, testDeviceInfo));
- assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_DAYCOLORSCHEME, testDayColorScheme));
- assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme));
-
- // Invalid/Null Tests
- RegisterAppInterface msg = new RegisterAppInterface();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSdlMsgVersion());
- 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());
- assertNull(Test.NULL, msg.getTtsName());
- assertNull(Test.NULL, msg.getVrSynonyms());
- assertNull(Test.NULL, msg.getAppHMIType());
- assertNull(Test.NULL, msg.getIsMediaApplication());
- assertNull(Test.NULL, msg.getDeviceInfo());
- assertNull(Test.NULL, msg.getDayColorScheme());
- assertNull(Test.NULL, msg.getNightColorScheme());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- RegisterAppInterface cmd = new RegisterAppInterface(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- JSONArray ttsNameArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterface.KEY_TTS_NAME);
- List<TTSChunk> ttsNameList = new ArrayList<TTSChunk>();
- for (int index = 0; index < ttsNameArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsNameArray.get(index)) );
- ttsNameList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsNameList, cmd.getTtsName()));
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HMI_DISPLAY_LANGUAGE_DESIRED), cmd.getHmiDisplayLanguageDesired().toString());
-
- JSONArray appHmiTypeArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterface.KEY_APP_HMI_TYPE);
- for (int index = 0; index < appHmiTypeArray.length(); index++) {
- AppHMIType appHmiTypeItem = AppHMIType.valueForString( appHmiTypeArray.get(index).toString() );
- 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);
- DeviceInfo deviceInfo = new DeviceInfo(JsonRPCMarshaller.deserializeJSONObject(deviceInfoObj));
- assertTrue(Test.TRUE, Validator.validateDeviceInfo(deviceInfo, cmd.getDeviceInfo()) );
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_NAME), cmd.getAppName());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_NGN_MEDIA_SCREEN_APP_NAME), cmd.getNgnMediaScreenAppName());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, RegisterAppInterface.KEY_IS_MEDIA_APPLICATION), cmd.getIsMediaApplication());
-
- List<String> vrSynonymsList = JsonUtils.readStringListFromJsonObject(parameters, RegisterAppInterface.KEY_VR_SYNONYMS);
- List<String> testSynonymsList = cmd.getVrSynonyms();
- assertEquals(Test.MATCH, vrSynonymsList.size(), testSynonymsList.size());
- assertTrue(Test.TRUE, Validator.validateStringList(vrSynonymsList, testSynonymsList));
-
- JSONObject sdlMsgVersionObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_SDL_MSG_VERSION);
- SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(JsonRPCMarshaller.deserializeJSONObject(sdlMsgVersionObj));
- assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) );
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HASH_ID), cmd.getHashID());
-
- JSONObject dayColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DAY_COLOR_SCHEME);
- TemplateColorScheme dayColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(dayColorSchemeObj));
- assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(dayColorScheme, cmd.getDayColorScheme()) );
-
- JSONObject nightColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DAY_COLOR_SCHEME);
- TemplateColorScheme nightColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(nightColorSchemeObj));
- assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(nightColorScheme, cmd.getDayColorScheme()) );
-
- } 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/requests/ResetGlobalPropertiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java
deleted file mode 100644
index dc4fda730..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ResetGlobalProperties;
-import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ResetGlobalProperties}
- */
-public class ResetGlobalPropertiesTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- ResetGlobalProperties msg = new ResetGlobalProperties();
-
- msg.setProperties(Test.GENERAL_GLOBALPROPERTY_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.RESET_GLOBAL_PROPERTIES.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(ResetGlobalProperties.KEY_PROPERTIES, JsonUtils.createJsonArray(Test.GENERAL_GLOBALPROPERTY_LIST));
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<GlobalProperty> copy = ( (ResetGlobalProperties) msg ).getProperties();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_GLOBALPROPERTY_LIST.size(), copy.size());
- for(int i = 0; i < Test.GENERAL_GLOBALPROPERTY_LIST.size(); i++){
- assertEquals(Test.MATCH, Test.GENERAL_GLOBALPROPERTY_LIST.get(i), copy.get(i));
- }
-
- // Invalid/Null Tests
- ResetGlobalProperties msg = new ResetGlobalProperties();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getProperties());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ResetGlobalProperties cmd = new ResetGlobalProperties(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- JSONArray propertiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ResetGlobalProperties.KEY_PROPERTIES);
- for (int index = 0; index < propertiesArray.length(); index++) {
- GlobalProperty property = GlobalProperty.valueOf(propertiesArray.get(index).toString());
- assertEquals(Test.MATCH, property, cmd.getProperties().get(index));
- }
- } 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/requests/ScrollableMessageTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java
deleted file mode 100644
index f7bca8e78..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ScrollableMessage;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ScrollableMessage}
- */
-public class ScrollableMessageTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- ScrollableMessage msg = new ScrollableMessage();
-
- msg.setTimeout(Test.GENERAL_INT);
- msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
- msg.setScrollableMessageBody(Test.GENERAL_STRING);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SCROLLABLE_MESSAGE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY, Test.GENERAL_STRING);
- result.put(ScrollableMessage.KEY_TIMEOUT, Test.GENERAL_INT);
- result.put(ScrollableMessage.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String testBody = ( (ScrollableMessage) msg ).getScrollableMessageBody();
- Integer testTimeout = ( (ScrollableMessage) msg ).getTimeout();
- List<SoftButton> testSoftButtons = ( (ScrollableMessage) msg ).getSoftButtons();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testBody);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout);
- assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTON_LIST.size(), testSoftButtons.size());
- for (int i = 0; i < Test.GENERAL_SOFTBUTTON_LIST.size(); i++) {
- assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTON_LIST.get(i), testSoftButtons.get(i));
- }
-
- // Invalid/Null Tests
- ScrollableMessage msg = new ScrollableMessage();
- assertNotNull(Test.NOT_NULL, msg);
-
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getScrollableMessageBody());
- assertNull(Test.NULL, msg.getTimeout());
- assertNull(Test.NULL, msg.getSoftButtons());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ScrollableMessage cmd = new ScrollableMessage(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY), cmd.getScrollableMessageBody());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ScrollableMessage.KEY_TIMEOUT), cmd.getTimeout());
-
- JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ScrollableMessage.KEY_SOFT_BUTTONS);
- List<SoftButton> softButtonList = new ArrayList<SoftButton>();
- for (int index = 0; index < softButtonArray.length(); index++) {
- SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
- softButtonList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
- } 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/requests/SendLocationTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java
deleted file mode 100644
index ee9a93750..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.SendLocation;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SendLocation}
- */
-public class SendLocationTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- SendLocation msg = new SendLocation();
-
- msg.setLatitudeDegrees(Test.GENERAL_DOUBLE);
- msg.setLongitudeDegrees(Test.GENERAL_DOUBLE);
- msg.setLocationName(Test.GENERAL_STRING);
- msg.setLocationDescription(Test.GENERAL_STRING);
- msg.setPhoneNumber(Test.GENERAL_STRING);
- msg.setAddressLines(Test.GENERAL_STRING_LIST);
- msg.setLocationImage(Test.GENERAL_IMAGE);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SEND_LOCATION.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters (int sdlVersion){
- JSONObject result = new JSONObject();
-
- try {
- result.put(SendLocation.KEY_LAT_DEGREES, Test.GENERAL_DOUBLE);
- result.put(SendLocation.KEY_LON_DEGREES, Test.GENERAL_DOUBLE);
- result.put(SendLocation.KEY_LOCATION_NAME, Test.GENERAL_STRING);
- result.put(SendLocation.KEY_LOCATION_DESCRIPTION, Test.GENERAL_STRING);
- result.put(SendLocation.KEY_PHONE_NUMBER, Test.GENERAL_STRING);
- result.put(SendLocation.KEY_LOCATION_IMAGE, Test.GENERAL_IMAGE.serializeJSON());
- result.put(SendLocation.KEY_ADDRESS_LINES, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- } catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Double latitude = ((SendLocation) msg).getLatitudeDegrees();
- Double longitude = ((SendLocation) msg).getLongitudeDegrees();
- String locationName = ((SendLocation) msg).getLocationName();
- String locationDesc = ((SendLocation) msg).getLocationDescription();
- String phoneNumber = ((SendLocation) msg).getPhoneNumber();
- List<String> addressLines = ((SendLocation) msg).getAddressLines();
- Image locationImage = ((SendLocation) msg).getLocationImage();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, longitude);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, latitude);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, locationDesc);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, locationName);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, phoneNumber);
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, addressLines));
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, locationImage));
-
- // Invalid/Null Tests
- SendLocation msg = new SendLocation();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getLatitudeDegrees());
- assertNull(Test.NULL, msg.getLongitudeDegrees());
- assertNull(Test.NULL, msg.getLocationName());
- assertNull(Test.NULL, msg.getLocationDescription());
- assertNull(Test.NULL, msg.getPhoneNumber());
- assertNull(Test.NULL, msg.getAddressLines());
- assertNull(Test.NULL, msg.getLocationImage());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull("Command object is null", commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SendLocation cmd = new SendLocation(hash);
- assertNotNull(Test.NOT_NULL, cmd);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, SendLocation.KEY_LAT_DEGREES), cmd.getLatitudeDegrees());
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, SendLocation.KEY_LON_DEGREES), cmd.getLongitudeDegrees());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_LOCATION_NAME), cmd.getLocationName());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_LOCATION_DESCRIPTION), cmd.getLocationDescription());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_PHONE_NUMBER), cmd.getPhoneNumber());
-
- List<String> addressList = JsonUtils.readStringListFromJsonObject(parameters, SendLocation.KEY_ADDRESS_LINES);
- List<String> testList = cmd.getAddressLines();
- assertEquals(Test.MATCH, addressList.size(), testList.size());
- assertTrue(Test.TRUE, Validator.validateStringList(addressList, testList));
-
- JSONObject cmdIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, SendLocation.KEY_LOCATION_IMAGE);
- Image reference = new Image(JsonRPCMarshaller.deserializeJSONObject(cmdIcon));
- assertTrue(Test.TRUE, Validator.validateImage(reference, cmd.getLocationImage()));
-
- } 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/requests/SetAppIconTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java
deleted file mode 100644
index c9286b763..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SetAppIcon;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SetAppIcon}
- */
-public class SetAppIconTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SetAppIcon msg = new SetAppIcon();
-
- msg.setSdlFileName(Test.GENERAL_STRING);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SET_APP_ICON.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SetAppIcon.KEY_SDL_FILE_NAME, Test.GENERAL_STRING);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String copy = ( (SetAppIcon) msg ).getSdlFileName();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, copy);
-
- // Invalid/Null Tests
- SetAppIcon msg = new SetAppIcon();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSdlFileName());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SetAppIcon cmd = new SetAppIcon(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetAppIcon.KEY_SDL_FILE_NAME), cmd.getSdlFileName());
-
- } 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/requests/SetDisplayLayoutTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java
deleted file mode 100644
index d0ccc6fc7..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayout;
-import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SetDisplayLayout}
- */
-public class SetDisplayLayoutTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SetDisplayLayout msg = new SetDisplayLayout();
-
- msg.setDisplayLayout(Test.GENERAL_STRING);
- msg.setDayColorScheme(Test.GENERAL_DAYCOLORSCHEME);
- msg.setNightColorScheme(Test.GENERAL_NIGHTCOLORSCHEME);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SET_DISPLAY_LAYOUT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SetDisplayLayout.KEY_DISPLAY_LAYOUT, Test.GENERAL_STRING);
- result.put(SetDisplayLayout.KEY_DAY_COLOR_SCHEME, Test.JSON_DAYCOLORSCHEME);
- result.put(SetDisplayLayout.KEY_NIGHT_COLOR_SCHEME, Test.JSON_NIGHTCOLORSCHEME);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- String testDisplayLayout = ( (SetDisplayLayout) msg ).getDisplayLayout();
- TemplateColorScheme testDayColorScheme = ( (SetDisplayLayout) msg).getDayColorScheme();
- TemplateColorScheme testNightColorScheme = ( (SetDisplayLayout) msg).getNightColorScheme();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testDisplayLayout);
- assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_DAYCOLORSCHEME, testDayColorScheme));
- assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme));
-
- // Invalid/Null Tests
- SetDisplayLayout msg = new SetDisplayLayout();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getDisplayLayout());
- assertNull(Test.NULL, msg.getDayColorScheme());
- assertNull(Test.NULL, msg.getNightColorScheme());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SetDisplayLayout cmd = new SetDisplayLayout(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.MATCH, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetDisplayLayout.KEY_DISPLAY_LAYOUT), cmd.getDisplayLayout());
-
-
- JSONObject dayColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayout.KEY_DAY_COLOR_SCHEME);
- TemplateColorScheme dayColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(dayColorSchemeObj));
- assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(dayColorScheme, cmd.getDayColorScheme()) );
-
- JSONObject nightColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayout.KEY_DAY_COLOR_SCHEME);
- TemplateColorScheme nightColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(nightColorSchemeObj));
- assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(nightColorScheme, cmd.getDayColorScheme()) );
-
-
- } 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/requests/SetGlobalPropertiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java
deleted file mode 100644
index 5f791769b..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java
+++ /dev/null
@@ -1,168 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.KeyboardProperties;
-import com.smartdevicelink.proxy.rpc.SetGlobalProperties;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.VrHelpItem;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SetGlobalProperties}
- */
-public class SetGlobalPropertiesTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SetGlobalProperties msg = new SetGlobalProperties();
-
- msg.setVrHelpTitle(Test.GENERAL_STRING);
- msg.setMenuTitle(Test.GENERAL_STRING);
- msg.setMenuIcon(Test.GENERAL_IMAGE);
- msg.setVrHelp(Test.GENERAL_VRHELPITEM_LIST);
- msg.setHelpPrompt(Test.GENERAL_TTSCHUNK_LIST);
- msg.setTimeoutPrompt(Test.GENERAL_TTSCHUNK_LIST);
- msg.setKeyboardProperties(Test.GENERAL_KEYBOARDPROPERTIES);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SET_GLOBAL_PROPERTIES.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SetGlobalProperties.KEY_MENU_ICON, Test.JSON_IMAGE);
- result.put(SetGlobalProperties.KEY_VR_HELP, Test.JSON_VRHELPITEMS);
- result.put(SetGlobalProperties.KEY_HELP_PROMPT, Test.JSON_TTSCHUNKS);
- result.put(SetGlobalProperties.KEY_TIMEOUT_PROMPT, Test.JSON_TTSCHUNKS);
- result.put(SetGlobalProperties.KEY_MENU_TITLE, Test.GENERAL_STRING);
- result.put(SetGlobalProperties.KEY_VR_HELP_TITLE, Test.GENERAL_STRING);
- result.put(SetGlobalProperties.KEY_KEYBOARD_PROPERTIES, Test.JSON_KEYBOARDPROPERTIES);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Image testImage = ( (SetGlobalProperties) msg ).getMenuIcon();
- String testVrHelpTitle = ( (SetGlobalProperties) msg ).getVrHelpTitle();
- String testMenuTitle = ( (SetGlobalProperties) msg ).getMenuTitle();
- List<TTSChunk> testHelpPrompt = ( (SetGlobalProperties) msg ).getHelpPrompt();
- List<TTSChunk> testTimeout = ( (SetGlobalProperties) msg ).getTimeoutPrompt();
- List<VrHelpItem> testVrHelpItems = ( (SetGlobalProperties) msg ).getVrHelp();
- KeyboardProperties testKeyboardProperties = ( (SetGlobalProperties) msg ).getKeyboardProperties();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testMenuTitle);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testVrHelpTitle);
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testImage));
- assertTrue(Test.TRUE, Validator.validateVrHelpItems(Test.GENERAL_VRHELPITEM_LIST, testVrHelpItems));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testHelpPrompt));
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTimeout));
- assertTrue(Test.TRUE, Validator.validateKeyboardProperties(Test.GENERAL_KEYBOARDPROPERTIES, testKeyboardProperties));
-
- // Invalid/Null Tests
- SetGlobalProperties msg = new SetGlobalProperties();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getMenuIcon());
- assertNull(Test.NULL, msg.getMenuTitle());
- assertNull(Test.NULL, msg.getVrHelp());
- assertNull(Test.NULL, msg.getHelpPrompt());
- assertNull(Test.NULL, msg.getTimeoutPrompt());
- assertNull(Test.NULL, msg.getKeyboardProperties());
- assertNull(Test.NULL, msg.getVrHelpTitle());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SetGlobalProperties cmd = new SetGlobalProperties(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetGlobalProperties.KEY_VR_HELP_TITLE), cmd.getVrHelpTitle());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_TITLE), cmd.getMenuTitle());
-
- JSONObject menuIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_ICON);
- Image referenceMenuIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(menuIcon));
- assertTrue(Test.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon()));
-
- JSONObject keyboardProperties = JsonUtils.readJsonObjectFromJsonObject(parameters, SetGlobalProperties.KEY_KEYBOARD_PROPERTIES);
- KeyboardProperties referenceKeyboardProperties = new KeyboardProperties(JsonRPCMarshaller.deserializeJSONObject(keyboardProperties));
- assertTrue(Test.TRUE, Validator.validateKeyboardProperties(referenceKeyboardProperties, cmd.getKeyboardProperties()));
-
- JSONArray helpPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_HELP_PROMPT);
- List<TTSChunk> helpPromptList = new ArrayList<TTSChunk>();
- for (int index = 0; index < helpPromptArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)helpPromptArray.get(index)) );
- helpPromptList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(helpPromptList, cmd.getHelpPrompt()));
-
- JSONArray timeoutPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_TIMEOUT_PROMPT);
- List<TTSChunk> timeoutPromptList = new ArrayList<TTSChunk>();
- for (int index = 0; index < timeoutPromptArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)timeoutPromptArray.get(index)) );
- timeoutPromptList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(timeoutPromptList, cmd.getTimeoutPrompt()));
-
- JSONArray vrHelpArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_VR_HELP);
- List<VrHelpItem> vrHelpList = new ArrayList<VrHelpItem>();
- for (int index = 0; index < vrHelpArray.length(); index++) {
- VrHelpItem chunk = new VrHelpItem(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)vrHelpArray.get(index)) );
- vrHelpList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateVrHelpItems(vrHelpList, cmd.getVrHelp()));
- } 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/requests/SetMediaClockTimerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java
deleted file mode 100644
index a90bd31b9..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimer;
-import com.smartdevicelink.proxy.rpc.StartTime;
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator;
-import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.SetMediaClockTimer}
- */
-public class SetMediaClockTimerTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SetMediaClockTimer msg = new SetMediaClockTimer();
-
- msg.setStartTime(Test.GENERAL_STARTTIME);
- msg.setEndTime(Test.GENERAL_STARTTIME);
- msg.setUpdateMode(Test.GENERAL_UPDATEMODE);
- msg.setAudioStreamingIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SET_MEDIA_CLOCK_TIMER.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SetMediaClockTimer.KEY_START_TIME, Test.JSON_STARTTIME);
- result.put(SetMediaClockTimer.KEY_END_TIME, Test.JSON_STARTTIME);
- result.put(SetMediaClockTimer.KEY_UPDATE_MODE, Test.GENERAL_UPDATEMODE);
- result.put(SetMediaClockTimer.KEY_AUDIO_STREAMING_INDICATOR, Test.GENERAL_AUDIO_STREAMING_INDICATOR);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- StartTime testStartTime = ( (SetMediaClockTimer) msg ).getStartTime();
- StartTime testEndTime = ( (SetMediaClockTimer) msg ).getEndTime();
- UpdateMode testUpdateMode = ( (SetMediaClockTimer) msg ).getUpdateMode();
- AudioStreamingIndicator testAudioStreamingIndicator = ( (SetMediaClockTimer) msg ).getAudioStreamingIndicator();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_UPDATEMODE, testUpdateMode);
- assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, testAudioStreamingIndicator);
- assertTrue(Test.TRUE, Validator.validateStartTime(Test.GENERAL_STARTTIME, testStartTime));
- assertTrue(Test.TRUE, Validator.validateStartTime(Test.GENERAL_STARTTIME, testEndTime));
-
- // Invalid/Null Tests
- SetMediaClockTimer msg = new SetMediaClockTimer();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getStartTime());
- assertNull(Test.NULL, msg.getEndTime());
- assertNull(Test.NULL, msg.getUpdateMode());
- assertNull(Test.NULL, msg.getAudioStreamingIndicator());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SetMediaClockTimer cmd = new SetMediaClockTimer(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- JSONObject startTime = JsonUtils.readJsonObjectFromJsonObject(parameters, SetMediaClockTimer.KEY_START_TIME);
- StartTime referenceStartTime = new StartTime(JsonRPCMarshaller.deserializeJSONObject(startTime));
- assertTrue(Test.TRUE, Validator.validateStartTime(referenceStartTime, cmd.getStartTime()));
-
- JSONObject endTime = JsonUtils.readJsonObjectFromJsonObject(parameters, SetMediaClockTimer.KEY_END_TIME);
- StartTime referenceEndTime = new StartTime(JsonRPCMarshaller.deserializeJSONObject(endTime));
- assertTrue(Test.TRUE, Validator.validateStartTime(referenceEndTime, cmd.getEndTime()));
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetMediaClockTimer.KEY_UPDATE_MODE), cmd.getUpdateMode().toString());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetMediaClockTimer.KEY_AUDIO_STREAMING_INDICATOR), cmd.getAudioStreamingIndicator().toString());
- } 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/requests/ShowConstantTbtTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java
deleted file mode 100644
index a6be52608..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.ShowConstantTbt;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ShowConstantTbt}
- */
-public class ShowConstantTbtTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- ShowConstantTbt msg = new ShowConstantTbt();
-
- msg.setDistanceToManeuver(Test.GENERAL_DOUBLE);
- msg.setDistanceToManeuverScale(Test.GENERAL_DOUBLE);
- msg.setEta(Test.GENERAL_STRING);
- msg.setManeuverComplete(true);
- msg.setNavigationText1(Test.GENERAL_STRING);
- msg.setNavigationText2(Test.GENERAL_STRING);
- msg.setNextTurnIcon(Test.GENERAL_IMAGE);
- msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
- msg.setTimeToDestination(Test.GENERAL_STRING);
- msg.setTotalDistance(Test.GENERAL_STRING);
- msg.setTurnIcon(Test.GENERAL_IMAGE);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SHOW_CONSTANT_TBT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(ShowConstantTbt.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
- result.put(ShowConstantTbt.KEY_ETA, Test.GENERAL_STRING);
- result.put(ShowConstantTbt.KEY_MANEUVER_COMPLETE, true);
- result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE, Test.GENERAL_DOUBLE);
- result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE, Test.GENERAL_DOUBLE);
- result.put(ShowConstantTbt.KEY_TEXT1, Test.GENERAL_STRING);
- result.put(ShowConstantTbt.KEY_TEXT2, Test.GENERAL_STRING);
- result.put(ShowConstantTbt.KEY_TIME_TO_DESTINATION, Test.GENERAL_STRING);
- result.put(ShowConstantTbt.KEY_TOTAL_DISTANCE, Test.GENERAL_STRING);
- result.put(ShowConstantTbt.KEY_MANEUVER_IMAGE, Test.GENERAL_IMAGE.serializeJSON());
- result.put(ShowConstantTbt.KEY_NEXT_MANEUVER_IMAGE, Test.GENERAL_IMAGE.serializeJSON());
- } catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Double testScale = ((ShowConstantTbt) msg).getDistanceToManeuverScale();
- Double testDistance = ((ShowConstantTbt) msg).getDistanceToManeuver();
- String testEta = ((ShowConstantTbt) msg).getEta();
- String testTimeToDestination = ((ShowConstantTbt) msg).getTimeToDestination();
- String testTotalDistance = ((ShowConstantTbt) msg).getTotalDistance();
- String testNavText2 = ((ShowConstantTbt) msg).getNavigationText2();
- String testNavText1 = ((ShowConstantTbt) msg).getNavigationText1();
- Boolean testManeuverComplete = ((ShowConstantTbt) msg).getManeuverComplete();
- Image testTurnIcon = ((ShowConstantTbt) msg).getTurnIcon();
- Image testNextTurnIcon = ((ShowConstantTbt) msg).getNextTurnIcon();
- List<SoftButton> testSoftButtons = ((ShowConstantTbt) msg).getSoftButtons();
-
- // Valid Test
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testTimeToDestination);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, testScale);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testNavText1);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testNavText2);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testEta);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testTotalDistance);
- assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, testDistance);
- assertTrue(Test.TRUE, testManeuverComplete);
- assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons));
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testTurnIcon));
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testNextTurnIcon));
-
- // Invalid/Null Tests
- ShowConstantTbt msg = new ShowConstantTbt();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSoftButtons());
- assertNull(Test.NULL, msg.getNavigationText1());
- assertNull(Test.NULL, msg.getNavigationText2());
- assertNull(Test.NULL, msg.getDistanceToManeuver());
- assertNull(Test.NULL, msg.getDistanceToManeuverScale());
- assertNull(Test.NULL, msg.getEta());
- assertNull(Test.NULL, msg.getManeuverComplete());
- assertNull(Test.NULL, msg.getNextTurnIcon());
- assertNull(Test.NULL, msg.getTimeToDestination());
- assertNull(Test.NULL, msg.getTotalDistance());
- assertNull(Test.NULL, msg.getTurnIcon());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ShowConstantTbt cmd = new ShowConstantTbt(hash);
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_ETA), cmd.getEta());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_COMPLETE), cmd.getManeuverComplete());
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE), cmd.getDistanceToManeuver());
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE), cmd.getDistanceToManeuverScale());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT1), cmd.getNavigationText1());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT2), cmd.getNavigationText2());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TIME_TO_DESTINATION), cmd.getTimeToDestination());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TOTAL_DISTANCE), cmd.getTotalDistance());
-
- JSONObject icon1 = JsonUtils.readJsonObjectFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_IMAGE);
- Image refIcon1 = new Image(JsonRPCMarshaller.deserializeJSONObject(icon1));
- assertTrue(Test.TRUE, Validator.validateImage(refIcon1, cmd.getTurnIcon()));
-
- JSONObject icon2 = JsonUtils.readJsonObjectFromJsonObject(parameters, ShowConstantTbt.KEY_NEXT_MANEUVER_IMAGE);
- Image refIcon2 = new Image(JsonRPCMarshaller.deserializeJSONObject(icon2));
- assertTrue(Test.TRUE, Validator.validateImage(refIcon2, cmd.getNextTurnIcon()));
-
- JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ShowConstantTbt.KEY_SOFT_BUTTONS);
- List<SoftButton> softButtonList = new ArrayList<SoftButton>();
- for (int index = 0; index < softButtonArray.length(); index++) {
- SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
- softButtonList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
- } 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/requests/ShowTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java
deleted file mode 100644
index 9c7a681df..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.MetadataTags;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.Show}
- */
-public class ShowTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- Show msg = new Show();
-
- msg.setMainField1(Test.GENERAL_STRING);
- msg.setMainField2(Test.GENERAL_STRING);
- msg.setMainField3(Test.GENERAL_STRING);
- msg.setMainField4(Test.GENERAL_STRING);
- msg.setStatusBar(Test.GENERAL_STRING);
- msg.setMediaTrack(Test.GENERAL_STRING);
- msg.setAlignment(Test.GENERAL_TEXTALIGNMENT);
- msg.setGraphic(Test.GENERAL_IMAGE);
- msg.setSecondaryGraphic(Test.GENERAL_IMAGE);
- msg.setCustomPresets(Test.GENERAL_STRING_LIST);
- msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
- msg.setMetadataTags(Test.GENERAL_METADATASTRUCT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SHOW.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(Show.KEY_MAIN_FIELD_1, Test.GENERAL_STRING);
- result.put(Show.KEY_MAIN_FIELD_2, Test.GENERAL_STRING);
- result.put(Show.KEY_MAIN_FIELD_3, Test.GENERAL_STRING);
- result.put(Show.KEY_MAIN_FIELD_4, Test.GENERAL_STRING);
- result.put(Show.KEY_STATUS_BAR, Test.GENERAL_STRING);
- result.put(Show.KEY_MEDIA_TRACK, Test.GENERAL_STRING);
- result.put(Show.KEY_GRAPHIC, Test.JSON_IMAGE);
- result.put(Show.KEY_SECONDARY_GRAPHIC, Test.JSON_IMAGE);
- result.put(Show.KEY_ALIGNMENT, Test.GENERAL_TEXTALIGNMENT);
- result.put(Show.KEY_CUSTOM_PRESETS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- result.put(Show.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
- result.put(Show.KEY_METADATA_TAGS, Test.GENERAL_METADATASTRUCT.serializeJSON());
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- public void testSoftButtons () {
- // TestValues
- String testTrack = ( (Show) msg ).getMediaTrack();
- Image testGraphic2 = ( (Show) msg ).getSecondaryGraphic();
- Image testGraphic1 = ( (Show) msg ).getGraphic();
- String testStatusBar = ( (Show) msg ).getStatusBar();
- String testText1 = ( (Show) msg ).getMainField1();
- String testText2 = ( (Show) msg ).getMainField2();
- String testText3 = ( (Show) msg ).getMainField3();
- String testText4 = ( (Show) msg ).getMainField4();
- TextAlignment testAlignment = ( (Show) msg ).getAlignment();
- List<SoftButton> testSoftButtons = ( (Show) msg ).getSoftButtons();
- List<String> testCustomPresets = ( (Show) msg ).getCustomPresets();
- MetadataTags testMetadata = ( (Show) msg ).getMetadataTags();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testTrack);
- assertEquals(Test.MATCH, Test.GENERAL_TEXTALIGNMENT, testAlignment);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testStatusBar);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testText1);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testText2);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testText3);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testText4);
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), testCustomPresets.size());
- assertEquals(Test.MATCH, Test.GENERAL_METADATASTRUCT, testMetadata);
- assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons));
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testGraphic2));
- assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testGraphic1));
-
- // Invalid/Null Tests
- Show msg = new Show();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getMainField1());
- assertNull(Test.NULL, msg.getMainField2());
- assertNull(Test.NULL, msg.getMainField3());
- assertNull(Test.NULL, msg.getMainField4());
- assertNull(Test.NULL, msg.getStatusBar());
- assertNull(Test.NULL, msg.getAlignment());
- assertNull(Test.NULL, msg.getGraphic());
- assertNull(Test.NULL, msg.getSecondaryGraphic());
- assertNull(Test.NULL, msg.getCustomPresets());
- assertNull(Test.NULL, msg.getMediaTrack());
- assertNull(Test.NULL, msg.getSoftButtons());
- assertNull(Test.NULL, msg.getMetadataTags());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext,getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- Show cmd = new Show(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- JSONObject graphic = JsonUtils.readJsonObjectFromJsonObject(parameters, Show.KEY_GRAPHIC);
- Image referenceGraphic = new Image(JsonRPCMarshaller.deserializeJSONObject(graphic));
- assertTrue(Test.TRUE, Validator.validateImage(referenceGraphic, cmd.getGraphic()));
-
- List<String> customPresetsList = JsonUtils.readStringListFromJsonObject(parameters, Show.KEY_CUSTOM_PRESETS);
- List<String> testPresetsList = cmd.getCustomPresets();
- assertEquals(Test.MATCH, customPresetsList.size(), testPresetsList.size());
- assertTrue(Test.TRUE, Validator.validateStringList(customPresetsList, testPresetsList));
-
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_1), cmd.getMainField1());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_2), cmd.getMainField2());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_3), cmd.getMainField3());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_4), cmd.getMainField4());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_STATUS_BAR), cmd.getStatusBar());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_ALIGNMENT), cmd.getAlignment().toString());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MEDIA_TRACK), cmd.getMediaTrack());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_METADATA_TAGS), cmd.getMetadataTags());
-
- JSONObject secondaryGraphic = JsonUtils.readJsonObjectFromJsonObject(parameters, Show.KEY_SECONDARY_GRAPHIC);
- Image referenceSecondaryGraphic = new Image(JsonRPCMarshaller.deserializeJSONObject(secondaryGraphic));
- assertTrue(Test.TRUE, Validator.validateImage(referenceSecondaryGraphic, cmd.getSecondaryGraphic()));
-
- JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Show.KEY_SOFT_BUTTONS);
- List<SoftButton> softButtonList = new ArrayList<SoftButton>();
- for (int index = 0; index < softButtonArray.length(); index++) {
- SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
- softButtonList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
-
- } 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/requests/SliderTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java
deleted file mode 100644
index 7c53681b9..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Slider;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.Slider}
- */
-public class SliderTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- Slider msg = new Slider();
-
- msg.setNumTicks(Test.GENERAL_INT);
- msg.setPosition(Test.GENERAL_INT);
- msg.setTimeout(Test.GENERAL_INT);
- msg.setSliderHeader(Test.GENERAL_STRING);
- msg.setSliderFooter(Test.GENERAL_STRING_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SLIDER.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(Slider.KEY_SLIDER_HEADER, Test.GENERAL_STRING);
- result.put(Slider.KEY_SLIDER_FOOTER, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- result.put(Slider.KEY_POSITION, Test.GENERAL_INT);
- result.put(Slider.KEY_TIMEOUT, Test.GENERAL_INT);
- result.put(Slider.KEY_NUM_TICKS, Test.GENERAL_INT);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Integer testNumTicks = ( (Slider) msg ).getNumTicks();
- Integer testTimeout = ( (Slider) msg ).getTimeout();
- Integer testPosition = ( (Slider) msg ).getPosition();
- String testSlider = ( (Slider) msg ).getSliderHeader();
- List<String> testFooter = ( (Slider) msg ).getSliderFooter();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testNumTicks);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout);
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testPosition);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testSlider);
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testFooter));
-
- // Invalid/Null Tests
- Slider msg = new Slider();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSliderHeader());
- assertNull(Test.NULL, msg.getSliderFooter());
- assertNull(Test.NULL, msg.getPosition());
- assertNull(Test.NULL, msg.getTimeout());
- assertNull(Test.NULL, msg.getNumTicks());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- Slider cmd = new Slider(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_NUM_TICKS), cmd.getNumTicks());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Slider.KEY_SLIDER_HEADER), cmd.getSliderHeader());
-
- List<String> sliderFooterList = JsonUtils.readStringListFromJsonObject(parameters, Slider.KEY_SLIDER_FOOTER);
- List<String> testFooterList = cmd.getSliderFooter();
- assertEquals(Test.MATCH, sliderFooterList.size(), testFooterList.size());
- assertTrue(Test.TRUE, Validator.validateStringList(sliderFooterList, testFooterList));
-
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_POSITION), cmd.getPosition());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_TIMEOUT), cmd.getTimeout());
- }
- 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/requests/SpeakTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java
deleted file mode 100644
index 2051b99f2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.Speak;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-public class SpeakTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- Speak msg = new Speak();
-
- msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SPEAK.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(Speak.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<TTSChunk> copy = ( (Speak) msg ).getTtsChunks();
-
- // Valid Tests
- assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, copy));
-
- // Invalid/Null Tests
- Speak msg = new Speak();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.MATCH, msg.getTtsChunks());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- Speak cmd = new Speak(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Speak.KEY_TTS_CHUNKS);
- List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>();
- for (int index = 0; index < ttsChunkArray.length(); index++) {
- TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) );
- ttsChunkList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks()));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java
deleted file mode 100644
index 4cb3e4b53..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SubscribeButton;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SubscribeButton}
- */
-public class SubscribeButtonTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SubscribeButton msg = new SubscribeButton();
-
- msg.setButtonName(Test.GENERAL_BUTTONNAME);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SUBSCRIBE_BUTTON.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SubscribeButton.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- ButtonName testButtonName = ( (SubscribeButton) msg ).getButtonName();
-
- // Valid Tests
- assertEquals("Data didn't match input data.", Test.GENERAL_BUTTONNAME, testButtonName);
-
- // Invalid/Null Tests
- SubscribeButton msg = new SubscribeButton();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getButtonName());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SubscribeButton cmd = new SubscribeButton(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SubscribeButton.KEY_BUTTON_NAME), cmd.getButtonName().toString());
- } 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/requests/SubscribeVehicleDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java
deleted file mode 100644
index ce93c52ea..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java
+++ /dev/null
@@ -1,230 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleData;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.SubscribeVehicleData}
- */
-public class SubscribeVehicleDataTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SubscribeVehicleData msg = new SubscribeVehicleData();
-
- msg.setSpeed(Test.GENERAL_BOOLEAN);
- msg.setRpm(Test.GENERAL_BOOLEAN);
- msg.setExternalTemperature(Test.GENERAL_BOOLEAN);
- msg.setFuelLevel(Test.GENERAL_BOOLEAN);
- msg.setPrndl(Test.GENERAL_BOOLEAN);
- msg.setTirePressure(Test.GENERAL_BOOLEAN);
- msg.setEngineTorque(Test.GENERAL_BOOLEAN);
- msg.setEngineOilLife(Test.GENERAL_BOOLEAN);
- msg.setOdometer(Test.GENERAL_BOOLEAN);
- msg.setGps(Test.GENERAL_BOOLEAN);
- msg.setFuelLevelState(Test.GENERAL_BOOLEAN);
- msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN);
- msg.setBeltStatus(Test.GENERAL_BOOLEAN);
- msg.setBodyInformation(Test.GENERAL_BOOLEAN);
- msg.setDeviceStatus(Test.GENERAL_BOOLEAN);
- msg.setDriverBraking(Test.GENERAL_BOOLEAN);
- msg.setWiperStatus(Test.GENERAL_BOOLEAN);
- msg.setHeadLampStatus(Test.GENERAL_BOOLEAN);
- msg.setAccPedalPosition(Test.GENERAL_BOOLEAN);
- msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN);
- msg.setECallInfo(Test.GENERAL_BOOLEAN);
- msg.setAirbagStatus(Test.GENERAL_BOOLEAN);
- msg.setEmergencyEvent(Test.GENERAL_BOOLEAN);
- msg.setClusterModeStatus(Test.GENERAL_BOOLEAN);
- msg.setMyKey(Test.GENERAL_BOOLEAN);
- msg.setFuelRange(Test.GENERAL_BOOLEAN);
- msg.setTurnSignal(Test.GENERAL_BOOLEAN);
- msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SUBSCRIBE_VEHICLE_DATA.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SubscribeVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN);
- result.put(SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
-
- // Valid Tests
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getSpeed());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getRpm());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getExternalTemperature());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelLevel());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getPrndl());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getTirePressure());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEngineTorque());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEngineOilLife());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getOdometer());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getGps());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelLevelState());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getInstantFuelConsumption());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getBeltStatus());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getBodyInformation());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getDeviceStatus());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getDriverBraking());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getWiperStatus());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getHeadLampStatus());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getAccPedalPosition());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getSteeringWheelAngle());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getECallInfo());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getAirbagStatus());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEmergencyEvent());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getClusterModeStatus());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getMyKey());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelRange());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getTurnSignal());
- assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getElectronicParkBrakeStatus());
-
- // Invalid/Null Tests
- SubscribeVehicleData msg = new SubscribeVehicleData();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getAccPedalPosition());
- assertNull(Test.NULL, msg.getAirbagStatus());
- assertNull(Test.NULL, msg.getBeltStatus());
- assertNull(Test.NULL, msg.getDriverBraking());
- assertNull(Test.NULL, msg.getFuelLevel());
- assertNull(Test.NULL, msg.getTirePressure());
- assertNull(Test.NULL, msg.getWiperStatus());
- assertNull(Test.NULL, msg.getGps());
- assertNull(Test.NULL, msg.getSpeed());
- assertNull(Test.NULL, msg.getRpm());
- assertNull(Test.NULL, msg.getFuelLevelState());
- assertNull(Test.NULL, msg.getInstantFuelConsumption());
- assertNull(Test.NULL, msg.getExternalTemperature());
- assertNull(Test.NULL, msg.getPrndl());
- assertNull(Test.NULL, msg.getOdometer());
- assertNull(Test.NULL, msg.getBodyInformation());
- assertNull(Test.NULL, msg.getDeviceStatus());
- assertNull(Test.NULL, msg.getHeadLampStatus());
- assertNull(Test.NULL, msg.getEngineTorque());
- assertNull(Test.NULL, msg.getEngineOilLife());
- assertNull(Test.NULL, msg.getSteeringWheelAngle());
- assertNull(Test.NULL, msg.getECallInfo());
- assertNull(Test.NULL, msg.getEmergencyEvent());
- assertNull(Test.NULL, msg.getClusterModeStatus());
- assertNull(Test.NULL, msg.getMyKey());
- assertNull(Test.NULL, msg.getFuelRange());
- assertNull(Test.NULL, msg.getTurnSignal());
- assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SubscribeVehicleData cmd = new SubscribeVehicleData(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_SPEED), cmd.getSpeed());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_RPM), cmd.getRpm());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_PRNDL), cmd.getPrndl());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ODOMETER), cmd.getOdometer());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_GPS), cmd.getGps());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_MY_KEY), cmd.getMyKey());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus());
- } 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/requests/SystemRequestTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java
deleted file mode 100644
index 9ca720198..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SystemRequest;
-import com.smartdevicelink.proxy.rpc.enums.RequestType;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SystemRequest}
- */
-public class SystemRequestTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SystemRequest msg = new SystemRequest();
-
- msg.setLegacyData(Test.GENERAL_STRING_LIST);
- msg.setFileName(Test.GENERAL_STRING);
- msg.setRequestType(Test.GENERAL_REQUESTTYPE);
- msg.setRequestSubType(Test.GENERAL_STRING);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SYSTEM_REQUEST.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SystemRequest.KEY_DATA, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- result.put(SystemRequest.KEY_FILE_NAME, Test.GENERAL_STRING);
- result.put(SystemRequest.KEY_REQUEST_TYPE, Test.GENERAL_REQUESTTYPE);
- result.put(SystemRequest.KEY_REQUEST_SUB_TYPE, Test.GENERAL_STRING);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- RequestType testRequestType = ( (SystemRequest) msg ).getRequestType();
- String testRequestSubType = ( (SystemRequest) msg ).getRequestSubType();
- String testFileName = ( (SystemRequest) msg ).getFileName();
- List<String> testLegacyData = ( (SystemRequest) msg ).getLegacyData();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_REQUESTTYPE, testRequestType);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testRequestSubType);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testFileName);
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testLegacyData));
-
- // Invalid/Null Tests
- SystemRequest msg = new SystemRequest();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getLegacyData());
- assertNull(Test.NULL, msg.getFileName());
- assertNull(Test.NULL, msg.getRequestType());
- assertNull(Test.NULL, msg.getRequestSubType());
- assertNull(Test.NULL, msg.getBulkData());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SystemRequest cmd = new SystemRequest(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_FILE_NAME), cmd.getFileName());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_REQUEST_TYPE), cmd.getRequestType().toString());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_REQUEST_SUB_TYPE), cmd.getRequestSubType());
-
- List<String> dataList = JsonUtils.readStringListFromJsonObject(parameters, SystemRequest.KEY_DATA);
- List<String> testDataList = cmd.getLegacyData();
- assertEquals(Test.MATCH, dataList.size(), testDataList.size());
- assertTrue(Test.TRUE, Validator.validateStringList(dataList, testDataList));
- } 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/requests/UnregisterAppInterfaceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java
deleted file mode 100644
index 84607ee98..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.UnregisterAppInterface}
- */
-public class UnregisterAppInterfaceTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new UnregisterAppInterface();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.UNREGISTER_APP_INTERFACE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- UnregisterAppInterface msg = new UnregisterAppInterface();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- UnregisterAppInterface cmd = new UnregisterAppInterface(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- }
- 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/requests/UnsubscribeButtonTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java
deleted file mode 100644
index 789c8758a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButton;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.UnsubscribeButton}
- */
-public class UnsubscribeButtonTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- UnsubscribeButton msg = new UnsubscribeButton();
-
- msg.setButtonName(Test.GENERAL_BUTTONNAME);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.UNSUBSCRIBE_BUTTON.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(UnsubscribeButton.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME);
-
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- ButtonName testButtonName = ( (UnsubscribeButton) msg ).getButtonName();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, testButtonName);
-
- // Invalid/Null Tests
- UnsubscribeButton msg = new UnsubscribeButton();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getButtonName());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- UnsubscribeButton cmd = new UnsubscribeButton(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, UnsubscribeButton.KEY_BUTTON_NAME), cmd.getButtonName().toString());
- }
- catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java
deleted file mode 100644
index af8560410..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java
+++ /dev/null
@@ -1,231 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData}
- */
-public class UnsubscribeVehicleDataTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
-
- msg.setSpeed(Test.GENERAL_BOOLEAN);
- msg.setRpm(Test.GENERAL_BOOLEAN);
- msg.setExternalTemperature(Test.GENERAL_BOOLEAN);
- msg.setFuelLevel(Test.GENERAL_BOOLEAN);
- msg.setPrndl(Test.GENERAL_BOOLEAN);
- msg.setTirePressure(Test.GENERAL_BOOLEAN);
- msg.setEngineTorque(Test.GENERAL_BOOLEAN);
- msg.setEngineOilLife(Test.GENERAL_BOOLEAN);
- msg.setOdometer(Test.GENERAL_BOOLEAN);
- msg.setGps(Test.GENERAL_BOOLEAN);
- msg.setFuelLevelState(Test.GENERAL_BOOLEAN);
- msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN);
- msg.setBeltStatus(Test.GENERAL_BOOLEAN);
- msg.setBodyInformation(Test.GENERAL_BOOLEAN);
- msg.setDeviceStatus(Test.GENERAL_BOOLEAN);
- msg.setDriverBraking(Test.GENERAL_BOOLEAN);
- msg.setWiperStatus(Test.GENERAL_BOOLEAN);
- msg.setHeadLampStatus(Test.GENERAL_BOOLEAN);
- msg.setAccPedalPosition(Test.GENERAL_BOOLEAN);
- msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN);
- msg.setECallInfo(Test.GENERAL_BOOLEAN);
- msg.setAirbagStatus(Test.GENERAL_BOOLEAN);
- msg.setEmergencyEvent(Test.GENERAL_BOOLEAN);
- msg.setClusterModeStatus(Test.GENERAL_BOOLEAN);
- msg.setMyKey(Test.GENERAL_BOOLEAN);
- msg.setFuelRange(Test.GENERAL_BOOLEAN);
- msg.setTurnSignal(Test.GENERAL_BOOLEAN);
- msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(UnsubscribeVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN);
- result.put(UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues(){
- // Valid Tests
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getSpeed());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getRpm());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getExternalTemperature());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelLevel());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getPrndl());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getTirePressure());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEngineTorque());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEngineOilLife());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getOdometer());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getGps());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelLevelState());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getInstantFuelConsumption());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getBeltStatus());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getBodyInformation());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getDeviceStatus());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getDriverBraking());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getWiperStatus());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getHeadLampStatus());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getAccPedalPosition());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getSteeringWheelAngle());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getECallInfo());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getAirbagStatus());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEmergencyEvent());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getClusterModeStatus());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getMyKey());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelRange());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getTurnSignal());
- assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getElectronicParkBrakeStatus());
-
- // Invalid/Null Tests
- UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getAccPedalPosition());
- assertNull(Test.NULL, msg.getAirbagStatus());
- assertNull(Test.NULL, msg.getBeltStatus());
- assertNull(Test.NULL, msg.getDriverBraking());
- assertNull(Test.NULL, msg.getFuelLevel());
- assertNull(Test.NULL, msg.getTirePressure());
- assertNull(Test.NULL, msg.getWiperStatus());
- assertNull(Test.NULL, msg.getGps());
- assertNull(Test.NULL, msg.getSpeed());
- assertNull(Test.NULL, msg.getRpm());
- assertNull(Test.NULL, msg.getFuelLevelState());
- assertNull(Test.NULL, msg.getInstantFuelConsumption());
- assertNull(Test.NULL, msg.getExternalTemperature());
- assertNull(Test.NULL, msg.getPrndl());
- assertNull(Test.NULL, msg.getOdometer());
- assertNull(Test.NULL, msg.getBodyInformation());
- assertNull(Test.NULL, msg.getDeviceStatus());
- assertNull(Test.NULL, msg.getHeadLampStatus());
- assertNull(Test.NULL, msg.getEngineTorque());
- assertNull(Test.NULL, msg.getEngineOilLife());
- assertNull(Test.NULL, msg.getSteeringWheelAngle());
- assertNull(Test.NULL, msg.getECallInfo());
- assertNull(Test.NULL, msg.getEmergencyEvent());
- assertNull(Test.NULL, msg.getClusterModeStatus());
- assertNull(Test.NULL, msg.getMyKey());
- assertNull(Test.NULL, msg.getFuelRange());
- assertNull(Test.NULL, msg.getTurnSignal());
- assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- UnsubscribeVehicleData cmd = new UnsubscribeVehicleData(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_SPEED), cmd.getSpeed());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_RPM), cmd.getRpm());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_PRNDL), cmd.getPrndl());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ODOMETER), cmd.getOdometer());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_GPS), cmd.getGps());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_MY_KEY), cmd.getMyKey());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal());
- assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus());
- }
- 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/requests/UpdateTurnListTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java
deleted file mode 100644
index f600e559b..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package com.smartdevicelink.test.rpc.requests;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.Turn;
-import com.smartdevicelink.proxy.rpc.UpdateTurnList;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.UpdateTurnList}
- */
-public class UpdateTurnListTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- UpdateTurnList msg = new UpdateTurnList();
-
- msg.setTurnList(Test.GENERAL_TURN_LIST);
- msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_REQUEST;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.UPDATE_TURN_LIST.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(UpdateTurnList.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS);
- result.put(UpdateTurnList.KEY_TURN_LIST, Test.JSON_TURNS);
- } catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<SoftButton> testSoftButtonList = ( (UpdateTurnList) msg ).getSoftButtons();
- List<Turn> testTurnList = ( (UpdateTurnList) msg ).getTurnList();
-
- // Valid Tests
- assertNotNull(Test.NOT_NULL, testSoftButtonList);
- assertNotNull(Test.NOT_NULL, testTurnList);
-
- assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtonList));
- assertTrue(Test.TRUE, Validator.validateTurnList(Test.GENERAL_TURN_LIST, testTurnList));
-
- // Invalid/Null Tests
- UpdateTurnList msg = new UpdateTurnList();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getTurnList());
- assertNull(Test.NULL, msg.getSoftButtons());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- UpdateTurnList cmd = new UpdateTurnList(hash);
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_SOFT_BUTTONS);
- List<SoftButton> softButtonList = new ArrayList<SoftButton>();
- for (int index = 0; index < softButtonArray.length(); index++) {
- SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) );
- softButtonList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons()));
-
- JSONArray turnArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_TURN_LIST);
- List<Turn> turnList = new ArrayList<Turn>();
- for (int index = 0; index < turnArray.length(); index++) {
- Turn chunk = new Turn(JsonRPCMarshaller.deserializeJSONObject((JSONObject) turnArray.get(index)));
- if (chunk != null)
- turnList.add(chunk);
- }
- assertTrue(Test.TRUE, Validator.validateTurnList(turnList, cmd.getTurnList()));
- } 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/responses/AddCommandResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java
deleted file mode 100644
index efde2292d..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AddCommand;
-import com.smartdevicelink.proxy.rpc.AddCommandResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.AddCommandResponse}
- */
-public class AddCommandResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new AddCommandResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ADD_COMMAND.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- AddCommandResponse msg = new AddCommandResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- AddCommand cmd = new AddCommand(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java
deleted file mode 100644
index 2a3888de7..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.AddSubmenuResponse}
- */
-public class AddSubmenuResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new AddSubMenuResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ADD_SUB_MENU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- AddSubMenuResponse msg = new AddSubMenuResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- AddSubMenuResponse cmd = new AddSubMenuResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java
deleted file mode 100644
index 64b3ff5f3..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.AlertManeuverResponse}
- */
-public class AlertManeuverResponseTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- return new AlertManeuverResponse();
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.ALERT_MANEUVER.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- AlertManeuverResponse msg = new AlertManeuverResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- AlertManeuverResponse cmd = new AlertManeuverResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java
deleted file mode 100644
index a479da245..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AlertResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.AlertResponse}
- */
-public class AlertResponseTests extends BaseRpcTests{
-
- private static final int TRY_AGAIN_TIME = 400;
-
- @Override
- protected RPCMessage createMessage(){
- AlertResponse alert = new AlertResponse();
- alert.setTryAgainTime(TRY_AGAIN_TIME);
- return alert;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.ALERT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(AlertResponse.KEY_TRY_AGAIN_TIME, TRY_AGAIN_TIME);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int tryAgainTime = ( (AlertResponse) msg ).getTryAgainTime();
-
- // Valid Tests
- assertEquals(Test.MATCH, TRY_AGAIN_TIME, tryAgainTime);
-
- // Invalid/Null Tests
- AlertResponse msg = new AlertResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getTryAgainTime());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- AlertResponse cmd = new AlertResponse(hash);
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AlertResponse.KEY_TRY_AGAIN_TIME), cmd.getTryAgainTime());
-
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java
deleted file mode 100644
index 906533bfd..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ChangeRegistrationResponse}
- */
-public class ChangeRegistrationResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new ChangeRegistrationResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.CHANGE_REGISTRATION.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- ChangeRegistrationResponse msg = new ChangeRegistrationResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ChangeRegistrationResponse cmd = new ChangeRegistrationResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java
deleted file mode 100644
index f492d0458..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.CreateInteractionChoiceSetResponse}
- */
-public class CreateInteractionChoiceSetResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new CreateInteractionChoiceSetResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.CREATE_INTERACTION_CHOICE_SET.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- CreateInteractionChoiceSetResponse msg = new CreateInteractionChoiceSetResponse();
- assertNotNull(Test.NOT_NULL, msg);
-
- testNullBase(msg);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java
deleted file mode 100644
index f40dbc895..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeleteCommandResponse}
- */
-public class DeleteCommandResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new DeleteCommandResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DELETE_COMMAND.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- DeleteCommandResponse msg = new DeleteCommandResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DeleteCommandResponse cmd = new DeleteCommandResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java
deleted file mode 100644
index 2c4ecb01f..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.DeleteFileResponse}
- */
-public class DeleteFileResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- DeleteFileResponse msg = new DeleteFileResponse();
-
- msg.setSpaceAvailable(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DELETE_FILE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(DeleteFileResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- int spaceAvailable = ( (DeleteFileResponse) msg ).getSpaceAvailable();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INT, spaceAvailable);
-
- // Invalid/Null Tests
- DeleteFileResponse msg = new DeleteFileResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSpaceAvailable());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DeleteFileResponse cmd = new DeleteFileResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteFileResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java
deleted file mode 100644
index e1b6233c0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeleteInteractionChoiceSetResponse}
- */
-public class DeleteInteractionChoiceSetResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new DeleteInteractionChoiceSetResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DELETE_INTERACTION_CHOICE_SET.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- DeleteInteractionChoiceSetResponse msg = new DeleteInteractionChoiceSetResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DeleteInteractionChoiceSetResponse cmd = new DeleteInteractionChoiceSetResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java
deleted file mode 100644
index 46fea52e0..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DeleteSubMenuResponse}
- */
-public class DeleteSubMenuResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new DeleteSubMenuResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DELETE_SUB_MENU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- DeleteSubMenuResponse msg = new DeleteSubMenuResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DeleteSubMenuResponse cmd = new DeleteSubMenuResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java
deleted file mode 100644
index 2732d79b2..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.DiagnosticMessageResponse}
- */
-public class DiagnosticMessageResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- DiagnosticMessageResponse msg = new DiagnosticMessageResponse();
-
- msg.setMessageDataResult(Test.GENERAL_INTEGER_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.DIAGNOSTIC_MESSAGE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(DiagnosticMessageResponse.KEY_MESSAGE_DATA_RESULT,
- JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<Integer> cmdId = ( (DiagnosticMessageResponse) msg ).getMessageDataResult();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.size(), cmdId.size());
-
- for(int i = 0; i < Test.GENERAL_INTEGER_LIST.size(); i++){
- assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.get(i), cmdId.get(i));
- }
-
- // Invalid/Null Tests
- DiagnosticMessageResponse msg = new DiagnosticMessageResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getMessageDataResult());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- DiagnosticMessageResponse cmd = new DiagnosticMessageResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- List<Integer> dataResultList = JsonUtils.readIntegerListFromJsonObject(parameters, DiagnosticMessageResponse.KEY_MESSAGE_DATA_RESULT);
- List<Integer> testResultList = cmd.getMessageDataResult();
-
- assertEquals(Test.MATCH, dataResultList.size(), testResultList.size());
- assertTrue(Test.TRUE, Validator.validateIntegerList(dataResultList, testResultList));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java
deleted file mode 100644
index c50e39569..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.EndAudioPassThruResponse}
- */
-public class EndAudioPassThruResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new EndAudioPassThruResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.END_AUDIO_PASS_THRU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- EndAudioPassThruResponse msg = new EndAudioPassThruResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- EndAudioPassThruResponse cmd = new EndAudioPassThruResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java
deleted file mode 100644
index f80c6201b..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import org.json.JSONObject;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.GenericResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.GenericResponse}
- */
-public class GenericResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return new GenericResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.GENERIC_RESPONSE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- GenericResponse msg = new GenericResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java
deleted file mode 100644
index 0a82ccd75..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.GetDTCsResponse}
- */
-public class GetDTCsResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- GetDTCsResponse msg = new GetDTCsResponse();
-
- msg.setDtc(Test.GENERAL_STRING_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.GET_DTCS.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(GetDTCsResponse.KEY_DTC, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<String> cmdId = ( (GetDTCsResponse) msg ).getDtc();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), cmdId.size());
-
- for(int i = 0; i < Test.GENERAL_STRING_LIST.size(); i++){
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.get(i), cmdId.get(i));
- }
-
- // Invalid/Null Tests
- GetDTCsResponse msg = new GetDTCsResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getDtc());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- GetDTCsResponse cmd = new GetDTCsResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- List<String> dtcList = JsonUtils.readStringListFromJsonObject(parameters, GetDTCsResponse.KEY_DTC);
- List<String> testDtcList = cmd.getDtc();
- assertEquals(Test.MATCH, dtcList.size(), testDtcList.size());
- assertTrue(Test.TRUE, Validator.validateStringList(dtcList, testDtcList));
-
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java
deleted file mode 100644
index 2bcff82ee..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java
+++ /dev/null
@@ -1,577 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AirbagStatus;
-import com.smartdevicelink.proxy.rpc.BeltStatus;
-import com.smartdevicelink.proxy.rpc.BodyInformation;
-import com.smartdevicelink.proxy.rpc.ClusterModeStatus;
-import com.smartdevicelink.proxy.rpc.DeviceStatus;
-import com.smartdevicelink.proxy.rpc.ECallInfo;
-import com.smartdevicelink.proxy.rpc.EmergencyEvent;
-import com.smartdevicelink.proxy.rpc.FuelRange;
-import com.smartdevicelink.proxy.rpc.GPSData;
-import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.HeadLampStatus;
-import com.smartdevicelink.proxy.rpc.MyKey;
-import com.smartdevicelink.proxy.rpc.SingleTireStatus;
-import com.smartdevicelink.proxy.rpc.TireStatus;
-import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.VehicleDataHelper;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.GetVehicleDataResponse}
- */
-public class GetVehicleDataResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- return VehicleDataHelper.VEHICLE_DATA_RESPONSE;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.GET_VEHICLE_DATA.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(GetVehicleDataResponse.KEY_SPEED, VehicleDataHelper.SPEED);
- result.put(GetVehicleDataResponse.KEY_RPM, VehicleDataHelper.RPM);
- result.put(GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE);
- result.put(GetVehicleDataResponse.KEY_FUEL_LEVEL, VehicleDataHelper.FUEL_LEVEL);
- result.put(GetVehicleDataResponse.KEY_VIN, VehicleDataHelper.VIN);
- result.put(GetVehicleDataResponse.KEY_PRNDL, VehicleDataHelper.PRNDL_FINAL);
- result.put(GetVehicleDataResponse.KEY_TIRE_PRESSURE, VehicleDataHelper.TIRE_PRESSURE.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_ENGINE_TORQUE, VehicleDataHelper.ENGINE_TORQUE);
- result.put(GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE, VehicleDataHelper.ENGINE_OIL_LIFE);
- result.put(GetVehicleDataResponse.KEY_ODOMETER, VehicleDataHelper.ODOMETER);
- result.put(GetVehicleDataResponse.KEY_GPS, VehicleDataHelper.GPS.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_FUEL_LEVEL_STATE, VehicleDataHelper.FUEL_LEVEL_STATE);
- result.put(GetVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION);
- result.put(GetVehicleDataResponse.KEY_BELT_STATUS, VehicleDataHelper.BELT_STATUS.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_BODY_INFORMATION, VehicleDataHelper.BODY_INFORMATION.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_DEVICE_STATUS, VehicleDataHelper.DEVICE_STATUS.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_DRIVER_BRAKING, VehicleDataHelper.DRIVER_BRAKING);
- result.put(GetVehicleDataResponse.KEY_WIPER_STATUS, VehicleDataHelper.WIPER_STATUS);
- result.put(GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS, VehicleDataHelper.HEAD_LAMP_STATUS.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_ACC_PEDAL_POSITION, VehicleDataHelper.ACC_PEDAL_POSITION);
- result.put(GetVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, VehicleDataHelper.STEERING_WHEEL_ANGLE);
- result.put(GetVehicleDataResponse.KEY_E_CALL_INFO, VehicleDataHelper.E_CALL_INFO.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_AIRBAG_STATUS, VehicleDataHelper.AIRBAG_STATUS.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_EMERGENCY_EVENT, VehicleDataHelper.EMERGENCY_EVENT.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_MY_KEY, VehicleDataHelper.MY_KEY.serializeJSON());
- result.put(GetVehicleDataResponse.KEY_FUEL_RANGE, VehicleDataHelper.JSON_FUEL_RANGE);
- result.put(GetVehicleDataResponse.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL);
- result.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
- } catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- public void testJson() {
- JSONObject reference = new JSONObject();
-
- //objects needed on the first level
- JSONObject tireStatusObj = new JSONObject();
- JSONObject GPSDataObj = new JSONObject();
- JSONObject beltStatusObj = new JSONObject();
- JSONObject bodyInformationObj = new JSONObject();
- JSONObject deviceStatusObj = new JSONObject();
- JSONObject headLampStatusObj = new JSONObject();
- JSONObject ECallInfoObj = new JSONObject();
- JSONObject airbagStatusObj = new JSONObject();
- JSONObject emergencyEventObj = new JSONObject();
- JSONObject clusterModeStatusObj = new JSONObject();
- JSONObject myKeyObj = new JSONObject();
- JSONObject fuelRangeObj = new JSONObject();
- JSONArray fuelRangeArrayObj = new JSONArray();
-
- try {
- //set up the JSONObject to represent GetVehicleDataResponse
- //TIRE_PRESSURE
- tireStatusObj.put(TireStatus.KEY_PRESSURE_TELL_TALE, VehicleDataHelper.TIRE_PRESSURE_TELL_TALE);
- JSONObject tireLeftFront = new JSONObject();
- tireLeftFront.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_LEFT_FRONT);
- tireStatusObj.put(TireStatus.KEY_LEFT_FRONT, tireLeftFront);
- JSONObject tireRightFront = new JSONObject();
- tireRightFront.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_RIGHT_FRONT);
- tireStatusObj.put(TireStatus.KEY_RIGHT_FRONT, tireRightFront);
- JSONObject tireLeftRear = new JSONObject();
- tireLeftRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_LEFT_REAR);
- tireStatusObj.put(TireStatus.KEY_LEFT_REAR, tireLeftRear);
- JSONObject tireRightRear = new JSONObject();
- tireRightRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_RIGHT_REAR);
- tireStatusObj.put(TireStatus.KEY_RIGHT_REAR, tireRightRear);
- JSONObject tireInnerLeftRear = new JSONObject();
- tireInnerLeftRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_INNER_LEFT_REAR);
- tireStatusObj.put(TireStatus.KEY_INNER_LEFT_REAR, tireInnerLeftRear);
- JSONObject tireInnerRightRear = new JSONObject();
- tireInnerRightRear.put(SingleTireStatus.KEY_STATUS, VehicleDataHelper.TIRE_PRESSURE_INNER_RIGHT_REAR);
- tireStatusObj.put(TireStatus.KEY_INNER_RIGHT_REAR, tireInnerRightRear);
-
- //GPS
- GPSDataObj.put(GPSData.KEY_LONGITUDE_DEGREES, VehicleDataHelper.GPS_LONGITUDE);
- GPSDataObj.put(GPSData.KEY_LATITUDE_DEGREES, VehicleDataHelper.GPS_LATITUDE);
- GPSDataObj.put(GPSData.KEY_UTC_YEAR, VehicleDataHelper.GPS_YEAR);
- GPSDataObj.put(GPSData.KEY_UTC_MONTH, VehicleDataHelper.GPS_MONTH);
- GPSDataObj.put(GPSData.KEY_UTC_DAY, VehicleDataHelper.GPS_DAY);
- GPSDataObj.put(GPSData.KEY_UTC_HOURS, VehicleDataHelper.GPS_HOURS);
- GPSDataObj.put(GPSData.KEY_UTC_MINUTES, VehicleDataHelper.GPS_MINUTES);
- GPSDataObj.put(GPSData.KEY_UTC_SECONDS, VehicleDataHelper.GPS_SECONDS);
- GPSDataObj.put(GPSData.KEY_COMPASS_DIRECTION, VehicleDataHelper.GPS_DIRECTION);
- GPSDataObj.put(GPSData.KEY_PDOP, VehicleDataHelper.GPS_PDOP);
- GPSDataObj.put(GPSData.KEY_VDOP, VehicleDataHelper.GPS_VDOP);
- GPSDataObj.put(GPSData.KEY_HDOP, VehicleDataHelper.GPS_HDOP);
- GPSDataObj.put(GPSData.KEY_ACTUAL, VehicleDataHelper.GPS_ACTUAL);
- GPSDataObj.put(GPSData.KEY_SATELLITES, VehicleDataHelper.GPS_SATELLITES);
- GPSDataObj.put(GPSData.KEY_DIMENSION, VehicleDataHelper.GPS_DIMENSION);
- GPSDataObj.put(GPSData.KEY_ALTITUDE, VehicleDataHelper.GPS_ALTITUDE);
- GPSDataObj.put(GPSData.KEY_HEADING, VehicleDataHelper.GPS_HEADING);
- GPSDataObj.put(GPSData.KEY_SPEED, VehicleDataHelper.GPS_SPEED);
-
- //BELT_STATUS
- beltStatusObj.put(BeltStatus.KEY_DRIVER_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_DRIVER_DEPLOYED);
- beltStatusObj.put(BeltStatus.KEY_PASSENGER_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_PASSENGER_DEPLOYED);
- beltStatusObj.put(BeltStatus.KEY_PASSENGER_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_PASSENGER_BELTED);
- beltStatusObj.put(BeltStatus.KEY_DRIVER_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_DRIVER_BELTED);
- beltStatusObj.put(BeltStatus.KEY_LEFT_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_ROW_2_BELTED);
- beltStatusObj.put(BeltStatus.KEY_PASSENGER_CHILD_DETECTED, VehicleDataHelper.BELT_STATUS_PASSENGER_CHILD);
- beltStatusObj.put(BeltStatus.KEY_RIGHT_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_ROW_2_BELTED);
- beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_2_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_2_BELTED);
- beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_3_BELTED);
- beltStatusObj.put(BeltStatus.KEY_LEFT_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_ROW_3_BELTED);
- beltStatusObj.put(BeltStatus.KEY_RIGHT_ROW_3_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_ROW_3_BELTED);
- beltStatusObj.put(BeltStatus.KEY_REAR_INFLATABLE_BELTED, VehicleDataHelper.BELT_STATUS_LEFT_REAR_INFLATABLE_BELTED);
- beltStatusObj.put(BeltStatus.KEY_RIGHT_REAR_INFLATABLE_BELTED, VehicleDataHelper.BELT_STATUS_RIGHT_REAR_INFLATABLE_BELTED);
- beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_1_BELT_DEPLOYED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_1_DEPLOYED);
- beltStatusObj.put(BeltStatus.KEY_MIDDLE_ROW_1_BUCKLE_BELTED, VehicleDataHelper.BELT_STATUS_MIDDLE_ROW_1_BELTED);
-
- //BODY_INFORMATION
- bodyInformationObj.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, VehicleDataHelper.BODY_INFORMATION_PARK_BRAKE);
- bodyInformationObj.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STATUS);
- bodyInformationObj.put(BodyInformation.KEY_IGNITION_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STABLE_STATUS);
- bodyInformationObj.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_DRIVER_AJAR);
- bodyInformationObj.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_PASSENGER_AJAR);
- bodyInformationObj.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_LEFT_AJAR);
- bodyInformationObj.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_RIGHT_AJAR);
-
- //DEVICE_STATUS
- deviceStatusObj.put(DeviceStatus.KEY_VOICE_REC_ON, VehicleDataHelper.DEVICE_STATUS_VOICE_REC);
- deviceStatusObj.put(DeviceStatus.KEY_BT_ICON_ON, VehicleDataHelper.DEVICE_STATUS_BT_ICON);
- deviceStatusObj.put(DeviceStatus.KEY_CALL_ACTIVE, VehicleDataHelper.DEVICE_STATUS_CALL_ACTIVE);
- deviceStatusObj.put(DeviceStatus.KEY_PHONE_ROAMING, VehicleDataHelper.DEVICE_STATUS_PHONE_ROAMING);
- deviceStatusObj.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, VehicleDataHelper.DEVICE_STATUS_TEXT_MSG_AVAILABLE);
- deviceStatusObj.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, VehicleDataHelper.DEVICE_STATUS_BATT_LEVEL_STATUS);
- deviceStatusObj.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, VehicleDataHelper.DEVICE_STATUS_STEREO_MUTED);
- deviceStatusObj.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, VehicleDataHelper.DEVICE_STATUS_MONO_MUTED);
- deviceStatusObj.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, VehicleDataHelper.DEVICE_STATUS_SIGNAL_LEVEL_STATUS);
- deviceStatusObj.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, VehicleDataHelper.DEVICE_STATUS_PRIMARY_AUDIO);
- deviceStatusObj.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, VehicleDataHelper.DEVICE_STATUS_E_CALL_ACTIVE);
-
- //HEAD_LAMP_STATUS
- headLampStatusObj.put(HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS, VehicleDataHelper.HEAD_LAMP_STATUS_AMBIENT_STATUS);
- headLampStatusObj.put(HeadLampStatus.KEY_HIGH_BEAMS_ON, VehicleDataHelper.HEAD_LAMP_HIGH_BEAMS);
- headLampStatusObj.put(HeadLampStatus.KEY_LOW_BEAMS_ON, VehicleDataHelper.HEAD_LAMP_LOW_BEAMS);
-
- //E_CALL_INFO
- ECallInfoObj.put(ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS, VehicleDataHelper.E_CALL_INFO_E_CALL_NOTIFICATION_STATUS);
- ECallInfoObj.put(ECallInfo.KEY_AUX_E_CALL_NOTIFICATION_STATUS, VehicleDataHelper.E_CALL_INFO_AUX_E_CALL_NOTIFICATION_STATUS);
- ECallInfoObj.put(ECallInfo.KEY_E_CALL_CONFIRMATION_STATUS, VehicleDataHelper.E_CALL_INFO_CONFIRMATION_STATUS);
-
- //AIRBAG_STATUS
- airbagStatusObj.put(AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_SIDE_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_CURTAIN_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_DRIVER_KNEE_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_SIDE_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_CURTAIN_DEPLOYED);
- airbagStatusObj.put(AirbagStatus.KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, VehicleDataHelper.AIRBAG_STATUS_PASSENGER_KNEE_DEPLOYED);
-
- //EMERGENCY_EVENT
- emergencyEventObj.put(EmergencyEvent.KEY_EMERGENCY_EVENT_TYPE, VehicleDataHelper.EMERGENCY_EVENT_TYPE);
- emergencyEventObj.put(EmergencyEvent.KEY_FUEL_CUTOFF_STATUS, VehicleDataHelper.EMERGENCY_EVENT_FUEL_CUTOFF_STATUS);
- emergencyEventObj.put(EmergencyEvent.KEY_ROLLOVER_EVENT, VehicleDataHelper.EMERGENCY_EVENT_ROLLOVER_EVENT);
- emergencyEventObj.put(EmergencyEvent.KEY_MAXIMUM_CHANGE_VELOCITY, VehicleDataHelper.EMERGENCY_EVENT_MAX_CHANGE_VELOCITY);
- emergencyEventObj.put(EmergencyEvent.KEY_MULTIPLE_EVENTS, VehicleDataHelper.EMERGENCY_EVENT_MULTIPLE_EVENTS);
-
- //CLUSTER_MODE_STATUS
- clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_ACTIVE, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_ACTIVE);
- clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_QUALIFICATION_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_QUALIFICATION_STATUS);
- clusterModeStatusObj.put(ClusterModeStatus.KEY_CAR_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_CAR_MODE_STATUS);
- clusterModeStatusObj.put(ClusterModeStatus.KEY_POWER_MODE_STATUS, VehicleDataHelper.CLUSTER_MODE_STATUS_POWER_MODE_STATUS);
-
- //MY_KEY
- myKeyObj.put(MyKey.KEY_E_911_OVERRIDE, VehicleDataHelper.MY_KEY_E_911_OVERRIDE);
-
- // FUEL_RANGE
- fuelRangeObj.put(FuelRange.KEY_TYPE, VehicleDataHelper.FUEL_RANGE_TYPE);
- fuelRangeObj.put(FuelRange.KEY_RANGE, VehicleDataHelper.FUEL_RANGE_RANGE);
- fuelRangeArrayObj.put(fuelRangeObj);
-
- reference.put(GetVehicleDataResponse.KEY_SPEED, VehicleDataHelper.SPEED);
- reference.put(GetVehicleDataResponse.KEY_RPM, VehicleDataHelper.RPM);
- reference.put(GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE);
- reference.put(GetVehicleDataResponse.KEY_FUEL_LEVEL, VehicleDataHelper.FUEL_LEVEL);
- reference.put(GetVehicleDataResponse.KEY_VIN, VehicleDataHelper.VIN);
- reference.put(GetVehicleDataResponse.KEY_PRNDL, VehicleDataHelper.PRNDL_FINAL);
- reference.put(GetVehicleDataResponse.KEY_TIRE_PRESSURE, tireStatusObj);
- reference.put(GetVehicleDataResponse.KEY_ENGINE_TORQUE, VehicleDataHelper.ENGINE_TORQUE);
- reference.put(GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE, VehicleDataHelper.ENGINE_OIL_LIFE);
- reference.put(GetVehicleDataResponse.KEY_ODOMETER, VehicleDataHelper.ODOMETER);
- reference.put(GetVehicleDataResponse.KEY_GPS, GPSDataObj);
- reference.put(GetVehicleDataResponse.KEY_FUEL_LEVEL_STATE, VehicleDataHelper.FUEL_LEVEL_STATE);
- reference.put(GetVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION);
- reference.put(GetVehicleDataResponse.KEY_BELT_STATUS, beltStatusObj);
- reference.put(GetVehicleDataResponse.KEY_BODY_INFORMATION, bodyInformationObj);
- reference.put(GetVehicleDataResponse.KEY_DEVICE_STATUS, deviceStatusObj);
- reference.put(GetVehicleDataResponse.KEY_DRIVER_BRAKING, VehicleDataHelper.DRIVER_BRAKING);
- reference.put(GetVehicleDataResponse.KEY_WIPER_STATUS, VehicleDataHelper.WIPER_STATUS);
- reference.put(GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS, headLampStatusObj);
- reference.put(GetVehicleDataResponse.KEY_ACC_PEDAL_POSITION, VehicleDataHelper.ACC_PEDAL_POSITION);
- reference.put(GetVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, VehicleDataHelper.STEERING_WHEEL_ANGLE);
- reference.put(GetVehicleDataResponse.KEY_E_CALL_INFO, ECallInfoObj);
- reference.put(GetVehicleDataResponse.KEY_AIRBAG_STATUS, airbagStatusObj);
- reference.put(GetVehicleDataResponse.KEY_EMERGENCY_EVENT, emergencyEventObj);
- reference.put(GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, clusterModeStatusObj);
- reference.put(GetVehicleDataResponse.KEY_MY_KEY, myKeyObj);
- reference.put(GetVehicleDataResponse.KEY_FUEL_RANGE, fuelRangeArrayObj);
- reference.put(GetVehicleDataResponse.KEY_TURN_SIGNAL, TurnSignal.OFF);
- reference.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
-
- JSONObject underTest = msg.serializeJSON();
-
- //go inside underTest and only return the JSONObject inside the parameters key inside the response key
- underTest = underTest.getJSONObject("response").getJSONObject("parameters");
-
- assertEquals("JSON size didn't match expected size.", reference.length(), underTest.length());
-
- Iterator<?> iterator = reference.keys();
-
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
-
- if (key.equals(GetVehicleDataResponse.KEY_TIRE_PRESSURE)) {
- JSONObject tirePressureReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject tirePressureTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateTireStatus(
- new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureReference)),
- new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureTest))));
-
- }
- else if (key.equals(GetVehicleDataResponse.KEY_GPS)) {
- JSONObject GPSObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject GPSObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateGpsData(
- new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjReference)),
- new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_BELT_STATUS)) {
- JSONObject beltObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject beltObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateBeltStatus(
- new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjReference)),
- new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_BODY_INFORMATION)) {
- JSONObject bodyInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject bodyInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateBodyInformation(
- new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjReference)),
- new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_DEVICE_STATUS)) {
- JSONObject deviceObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject deviceObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateDeviceStatus(
- new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjReference)),
- new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS)) {
- JSONObject headLampObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject headLampObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateHeadLampStatus(
- new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjReference)),
- new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_E_CALL_INFO)) {
- JSONObject callInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject callInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateECallInfo(
- new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjReference)),
- new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_AIRBAG_STATUS)) {
- JSONObject airbagObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject airbagObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateAirbagStatus(
- new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjReference)),
- new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_EMERGENCY_EVENT)) {
- JSONObject emergencyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject emergencyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateEmergencyEvent(
- new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjReference)),
- new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS)) {
- JSONObject clusterModeObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject clusterModeObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateClusterModeStatus(
- new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjReference)),
- new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_MY_KEY)) {
- JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
- JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateMyKey(
- new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)),
- new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest))));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE)) {
- assertEquals("JSON value didn't match expected value for key \"" + key + "\".",
- JsonUtils.readDoubleFromJsonObject(reference, key), JsonUtils.readDoubleFromJsonObject(underTest, key));
- }
- else if (key.equals(GetVehicleDataResponse.KEY_FUEL_RANGE)) {
- JSONArray fuelRangeArrayObjReference = JsonUtils.readJsonArrayFromJsonObject(reference, key);
- List<FuelRange> fuelRangeRefereceList = new ArrayList<FuelRange>();
- for (int index = 0; index < fuelRangeArrayObjReference.length(); index++) {
- FuelRange fuelRange = new FuelRange(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)fuelRangeArrayObjReference.get(index) ));
- fuelRangeRefereceList.add(fuelRange);
- }
-
- JSONArray fuelRangeArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
- List<FuelRange> fuelRangeUnderTestList = new ArrayList<FuelRange>();
- for (int index = 0; index < fuelRangeArrayObjTest.length(); index++) {
- FuelRange fuelRange = new FuelRange(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)fuelRangeArrayObjTest.get(index) ));
- fuelRangeUnderTestList.add(fuelRange);
- }
-
- assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
- Validator.validateFuelRange(
- fuelRangeRefereceList,
- fuelRangeUnderTestList));
- }
- else {
- assertEquals("JSON value didn't match expected value for key \"" + key + "\".",
- JsonUtils.readObjectFromJsonObject(reference, key),
- JsonUtils.readObjectFromJsonObject(underTest, key));
- }
-
- }
-
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues(){
- // Valid Tests
- assertEquals(Test.MATCH, VehicleDataHelper.SPEED, ( (GetVehicleDataResponse) msg ).getSpeed());
- assertEquals(Test.MATCH, (Integer) VehicleDataHelper.RPM, ( (GetVehicleDataResponse) msg ).getRpm());
- assertEquals(Test.MATCH, VehicleDataHelper.EXTERNAL_TEMPERATURE, ( (GetVehicleDataResponse) msg ).getExternalTemperature());
- assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL, ( (GetVehicleDataResponse) msg ).getFuelLevel());
- assertEquals(Test.MATCH, VehicleDataHelper.PRNDL_FINAL, ( (GetVehicleDataResponse) msg ).getPrndl());
- assertEquals(Test.MATCH, VehicleDataHelper.TIRE_PRESSURE, ( (GetVehicleDataResponse) msg ).getTirePressure());
- assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_TORQUE, ( (GetVehicleDataResponse) msg ).getEngineTorque());
- assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_OIL_LIFE, ( (GetVehicleDataResponse) msg ).getEngineOilLife());
- assertEquals(Test.MATCH, (Integer) VehicleDataHelper.ODOMETER, ( (GetVehicleDataResponse) msg ).getOdometer());
- assertEquals(Test.MATCH, VehicleDataHelper.GPS, ( (GetVehicleDataResponse) msg ).getGps());
- assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL_STATE, ( (GetVehicleDataResponse) msg ).getFuelLevelState());
- assertEquals(Test.MATCH, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION, ( (GetVehicleDataResponse) msg ).getInstantFuelConsumption());
- assertEquals(Test.MATCH, VehicleDataHelper.BELT_STATUS, ( (GetVehicleDataResponse) msg ).getBeltStatus());
- assertEquals(Test.MATCH, VehicleDataHelper.BODY_INFORMATION, ( (GetVehicleDataResponse) msg ).getBodyInformation());
- assertEquals(Test.MATCH, VehicleDataHelper.DEVICE_STATUS, ( (GetVehicleDataResponse) msg ).getDeviceStatus());
- assertEquals(Test.MATCH, VehicleDataHelper.DRIVER_BRAKING, ( (GetVehicleDataResponse) msg ).getDriverBraking());
- assertEquals(Test.MATCH, VehicleDataHelper.WIPER_STATUS, ( (GetVehicleDataResponse) msg ).getWiperStatus());
- assertEquals(Test.MATCH, VehicleDataHelper.HEAD_LAMP_STATUS, ( (GetVehicleDataResponse) msg ).getHeadLampStatus());
- assertEquals(Test.MATCH, VehicleDataHelper.ACC_PEDAL_POSITION, ( (GetVehicleDataResponse) msg ).getAccPedalPosition());
- assertEquals(Test.MATCH, VehicleDataHelper.STEERING_WHEEL_ANGLE, ( (GetVehicleDataResponse) msg ).getSteeringWheelAngle());
- assertEquals(Test.MATCH, VehicleDataHelper.E_CALL_INFO, ( (GetVehicleDataResponse) msg ).getECallInfo());
- assertEquals(Test.MATCH, VehicleDataHelper.AIRBAG_STATUS, ( (GetVehicleDataResponse) msg ).getAirbagStatus());
- assertEquals(Test.MATCH, VehicleDataHelper.EMERGENCY_EVENT, ( (GetVehicleDataResponse) msg ).getEmergencyEvent());
- assertEquals(Test.MATCH, VehicleDataHelper.CLUSTER_MODE_STATUS, ( (GetVehicleDataResponse) msg ).getClusterModeStatus());
- assertEquals(Test.MATCH, VehicleDataHelper.MY_KEY, ( (GetVehicleDataResponse) msg ).getMyKey());
- assertEquals(Test.MATCH, VehicleDataHelper.TURN_SIGNAL, ( (GetVehicleDataResponse) msg ).getTurnSignal());
- assertEquals(Test.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, ( (GetVehicleDataResponse) msg ).getElectronicParkBrakeStatus());
-
- // Invalid/Null Tests
- GetVehicleDataResponse msg = new GetVehicleDataResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getAccPedalPosition());
- assertNull(Test.NULL, msg.getAirbagStatus());
- assertNull(Test.NULL, msg.getBeltStatus());
- assertNull(Test.NULL, msg.getDriverBraking());
- assertNull(Test.NULL, msg.getFuelLevel());
- assertNull(Test.NULL, msg.getTirePressure());
- assertNull(Test.NULL, msg.getWiperStatus());
- assertNull(Test.NULL, msg.getGps());
- assertNull(Test.NULL, msg.getSpeed());
- assertNull(Test.NULL, msg.getRpm());
- assertNull(Test.NULL, msg.getFuelLevelState());
- assertNull(Test.NULL, msg.getInstantFuelConsumption());
- assertNull(Test.NULL, msg.getExternalTemperature());
- assertNull(Test.NULL, msg.getPrndl());
- assertNull(Test.NULL, msg.getOdometer());
- assertNull(Test.NULL, msg.getBodyInformation());
- assertNull(Test.NULL, msg.getDeviceStatus());
- assertNull(Test.NULL, msg.getHeadLampStatus());
- assertNull(Test.NULL, msg.getEngineTorque());
- assertNull(Test.NULL, msg.getEngineOilLife());
- assertNull(Test.NULL, msg.getSteeringWheelAngle());
- assertNull(Test.NULL, msg.getECallInfo());
- assertNull(Test.NULL, msg.getEmergencyEvent());
- assertNull(Test.NULL, msg.getClusterModeStatus());
- assertNull(Test.NULL, msg.getMyKey());
- assertNull(Test.NULL, msg.getTurnSignal());
- assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
- }
-
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- GetVehicleDataResponse cmd = new GetVehicleDataResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_SPEED), cmd.getSpeed());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetVehicleDataResponse.KEY_RPM), cmd.getRpm());
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature());
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_FUEL_LEVEL), cmd.getFuelLevel());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_VIN), cmd.getVin());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_PRNDL), cmd.getPrndl().toString());
-
- JSONObject tireStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_TIRE_PRESSURE);
- TireStatus tireStatus = new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tireStatusObj));
- assertTrue(Test.TRUE, Validator.validateTireStatus(tireStatus, cmd.getTirePressure()) );
-
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ENGINE_TORQUE), cmd.getEngineTorque());
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife(), 0.0002);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetVehicleDataResponse.KEY_ODOMETER), cmd.getOdometer());
-
- JSONObject gpsDataObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_GPS);
- GPSData gpsData = new GPSData(JsonRPCMarshaller.deserializeJSONObject(gpsDataObj));
- assertTrue(Test.TRUE, Validator.validateGpsData(gpsData, cmd.getGps()) );
-
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState().toString());
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption());
-
- JSONObject beltStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_BELT_STATUS);
- BeltStatus beltStatus = new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltStatusObj));
- assertTrue(Test.TRUE, Validator.validateBeltStatus(beltStatus, cmd.getBeltStatus()) );
-
- JSONObject bodyInformationObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_BODY_INFORMATION);
- BodyInformation bodyInformation = new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInformationObj));
- assertTrue(Test.TRUE, Validator.validateBodyInformation(bodyInformation, cmd.getBodyInformation()) );
-
- JSONObject deviceStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_DEVICE_STATUS);
- DeviceStatus deviceStatus = new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceStatusObj));
- assertTrue(Test.TRUE, Validator.validateDeviceStatus(deviceStatus, cmd.getDeviceStatus()) );
-
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_DRIVER_BRAKING), cmd.getDriverBraking().toString());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_WIPER_STATUS), cmd.getWiperStatus().toString());
-
- JSONObject headLampStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS);
- HeadLampStatus headLampStatus = new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampStatusObj));
- assertTrue(Test.TRUE, Validator.validateHeadLampStatus(headLampStatus, cmd.getHeadLampStatus()) );
-
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition());
- assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle());
-
- JSONObject eCallInfoObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_E_CALL_INFO);
- ECallInfo eCallInfo = new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(eCallInfoObj));
- assertTrue(Test.TRUE, Validator.validateECallInfo(eCallInfo, cmd.getECallInfo()) );
-
- JSONObject airbagStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_AIRBAG_STATUS);
- AirbagStatus airbagStatus = new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagStatusObj));
- assertTrue(Test.TRUE, Validator.validateAirbagStatus(airbagStatus, cmd.getAirbagStatus()) );
-
- JSONObject emergencyEventObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_EMERGENCY_EVENT);
- EmergencyEvent emergencyEvent = new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyEventObj));
- assertTrue(Test.TRUE, Validator.validateEmergencyEvent(emergencyEvent, cmd.getEmergencyEvent()) );
-
- JSONObject clusterModeStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS);
- ClusterModeStatus clusterModeStatus = new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatusObj));
- assertTrue(Test.TRUE, Validator.validateClusterModeStatus(clusterModeStatus, cmd.getClusterModeStatus()) );
-
- JSONObject myKeyObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_MY_KEY);
- MyKey myKey = new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObj));
- assertTrue(Test.TRUE, Validator.validateMyKey(myKey, cmd.getMyKey()) );
-
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_TURN_SIGNAL), cmd.getTurnSignal().toString());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus().toString());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java
deleted file mode 100644
index 878a47776..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ListFilesResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.ListFilesResponse}
- */
-public class ListFilesResponseTests extends BaseRpcTests{
-
- @Override
- protected RPCMessage createMessage(){
- ListFilesResponse msg = new ListFilesResponse();
-
- msg.setFilenames(Test.GENERAL_STRING_LIST);
- msg.setSpaceAvailable(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.LIST_FILES.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- JSONObject result = new JSONObject();
-
- try{
- result.put(ListFilesResponse.KEY_FILENAMES, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- result.put(ListFilesResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT);
- }catch(JSONException e){
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<String> filenames = ( (ListFilesResponse) msg ).getFilenames();
- int spaceAvailable = ( (ListFilesResponse) msg ).getSpaceAvailable();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), filenames.size());
- assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, filenames));
- assertEquals(Test.MATCH, Test.GENERAL_INT, spaceAvailable);
-
- // Invalid/Null Tests
- ListFilesResponse msg = new ListFilesResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getFilenames());
- assertNull(Test.NULL, msg.getSpaceAvailable());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ListFilesResponse cmd = new ListFilesResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- List<String> fileNamesList = JsonUtils.readStringListFromJsonObject(parameters, ListFilesResponse.KEY_FILENAMES);
- List<String> testNamesList = cmd.getFilenames();
- assertEquals(Test.MATCH, fileNamesList.size(), testNamesList.size());
- assertTrue(Test.TRUE, Validator.validateStringList(fileNamesList, testNamesList));
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ListFilesResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java
deleted file mode 100644
index b330fed72..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.PerformAudioPassThruResponse}
- */
-public class PerformAudioPassThruResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new PerformAudioPassThruResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.PERFORM_AUDIO_PASS_THRU.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- PerformAudioPassThruResponse msg = new PerformAudioPassThruResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- PerformAudioPassThruResponse cmd = new PerformAudioPassThruResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java
deleted file mode 100644
index d3f1518af..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.PerformInteractionResponse}
- */
-public class PerformInteractionResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- PerformInteractionResponse msg = new PerformInteractionResponse();
-
- msg.setChoiceID(Test.GENERAL_INT);
- msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE);
- msg.setManualTextEntry(Test.GENERAL_STRING);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.PERFORM_INTERACTION.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(PerformInteractionResponse.KEY_CHOICE_ID, Test.GENERAL_INT);
- result.put(PerformInteractionResponse.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE);
- result.put(PerformInteractionResponse.KEY_MANUAL_TEXT_ENTRY, Test.GENERAL_STRING);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Integer testId = ( (PerformInteractionResponse) msg).getChoiceID();
- TriggerSource testSource = ( (PerformInteractionResponse) msg).getTriggerSource();
- String testText = ( (PerformInteractionResponse) msg).getManualTextEntry();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testId);
- assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, testSource);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testText);
-
- // Invalid/Null Tests
- PerformInteractionResponse msg = new PerformInteractionResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getChoiceID());
- assertNull(Test.NULL, msg.getTriggerSource());
- assertNull(Test.NULL, msg.getManualTextEntry());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- PerformInteractionResponse cmd = new PerformInteractionResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteractionResponse.KEY_MANUAL_TEXT_ENTRY), cmd.getManualTextEntry());
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteractionResponse.KEY_TRIGGER_SOURCE), cmd.getTriggerSource().toString());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteractionResponse.KEY_CHOICE_ID), cmd.getChoiceID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java
deleted file mode 100644
index 150994180..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.PutFileResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.PutFileResponse}
- */
-public class PutFileResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- PutFileResponse msg = new PutFileResponse();
-
- msg.setSpaceAvailable(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.PUT_FILE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(PutFileResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- Integer testSpace = ( (PutFileResponse) msg ).getSpaceAvailable();
-
- // Valid Tests
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testSpace);
-
- // Invalid/Null Tests
- PutFileResponse msg = new PutFileResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSpaceAvailable());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- PutFileResponse cmd = new PutFileResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PutFileResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java
deleted file mode 100644
index 3ffc857cc..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.DIDResult;
-import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ReadDIDResponse}
- */
-public class ReadDIDResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- ReadDIDResponse msg = new ReadDIDResponse();
-
- msg.setDidResult(Test.GENERAL_DIDRESULT_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.READ_DID.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(ReadDIDResponse.KEY_DID_RESULT, Test.JSON_DIDRESULTS);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<DIDResult> testResults = ( (ReadDIDResponse) msg ).getDidResult();
-
- // Valid Tests
- assertTrue("Did results didn't match input data.", Validator.validateDIDResults(Test.GENERAL_DIDRESULT_LIST, testResults));
-
- // Invalid/Null Tests
- ReadDIDResponse msg = new ReadDIDResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getDidResult());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ReadDIDResponse cmd = new ReadDIDResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- JSONArray didResultArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ReadDIDResponse.KEY_DID_RESULT);
- List<DIDResult> didResultList = new ArrayList<DIDResult>();
- for (int index = 0; index < didResultArray.length(); index++) {
- DIDResult chunk = new DIDResult(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)didResultArray.get(index)) );
- didResultList.add(chunk);
- }
- assertTrue(Test.MATCH, Validator.validateDIDResults(didResultList, cmd.getDidResult()));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java
deleted file mode 100644
index 55450898e..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java
+++ /dev/null
@@ -1,269 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
-import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.VehicleType;
-import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse}
- */
-public class RegisterAppInterfaceResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse();
-
- msg.setSdlMsgVersion(Test.GENERAL_SDLMSGVERSION);
- msg.setLanguage(Test.GENERAL_LANGUAGE);
- msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE);
- msg.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES);
- msg.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES);
- msg.setVehicleType(Test.GENERAL_VEHICLETYPE);
- msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST);
- msg.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST);
- msg.setAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST);
- msg.setPcmStreamingCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES);
- msg.setHmiZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST);
- msg.setSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST);
- msg.setVrCapabilities(Test.GENERAL_VRCAPABILITIES_LIST);
- msg.setPrerecordedSpeech(Test.GENERAL_PRERECORDEDSPEECH_LIST);
- msg.setSupportedDiagModes(Test.GENERAL_INTEGER_LIST);
- msg.setIconResumed(Test.GENERAL_BOOLEAN);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.REGISTER_APP_INTERFACE.toString();
- }
-
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(RegisterAppInterfaceResponse.KEY_LANGUAGE, Test.GENERAL_LANGUAGE);
- result.put(RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE);
- result.put(RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST));
- result.put(RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION, Test.JSON_SDLMSGVERSION);
- result.put(RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE, Test.GENERAL_VEHICLETYPE.serializeJSON());
- result.put(RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES, Test.JSON_PRESETBANKCAPABILITIES);
- result.put(RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES, Test.JSON_DISPLAYCAPABILITIES);
- result.put(RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES, Test.JSON_BUTTONCAPABILITIES);
- result.put(RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES, Test.JSON_SOFTBUTTONCAPABILITIES);
- result.put(RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES, Test.JSON_AUDIOPASSTHRUCAPABILITIES);
- result.put(RegisterAppInterfaceResponse.KEY_PCM_STREAM_CAPABILITIES, Test.JSON_PCMSTREAMCAPABILITIES);
- result.put(RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_SPEECHCAPABILITIES_LIST));
- result.put(RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_VRCAPABILITIES_LIST));
- result.put(RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_HMIZONECAPABILITIES_LIST));
- result.put(RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH, JsonUtils.createJsonArray(Test.GENERAL_PRERECORDEDSPEECH_LIST));
- result.put(RegisterAppInterfaceResponse.KEY_ICON_RESUMED, Test.GENERAL_BOOLEAN);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- List<Integer> testSupportedDiagModes = ( (RegisterAppInterfaceResponse) msg ).getSupportedDiagModes();
- List<PrerecordedSpeech> testPrerecordedSpeech = ( (RegisterAppInterfaceResponse) msg ).getPrerecordedSpeech();
- List<VrCapabilities> testVrCapabilities = ( (RegisterAppInterfaceResponse) msg ).getVrCapabilities();
- List<SpeechCapabilities> testSpeechCapabilities = ( (RegisterAppInterfaceResponse) msg ).getSpeechCapabilities();
- List<HmiZoneCapabilities> testHmiZoneCapabilities = ( (RegisterAppInterfaceResponse) msg ).getHmiZoneCapabilities();
- List<SoftButtonCapabilities> testSoftButtonCapabilities = ( (RegisterAppInterfaceResponse) msg ).getSoftButtonCapabilities();
- List<ButtonCapabilities> testButtonCapabilities = ( (RegisterAppInterfaceResponse) msg ).getButtonCapabilities();
- VehicleType testVehicleType = ( (RegisterAppInterfaceResponse) msg ).getVehicleType();
- PresetBankCapabilities testPbc = ( (RegisterAppInterfaceResponse) msg ).getPresetBankCapabilities();
- DisplayCapabilities testDc = ( (RegisterAppInterfaceResponse) msg ).getDisplayCapabilities();
- Language testHmiLang = ( (RegisterAppInterfaceResponse) msg ).getHmiDisplayLanguage();
- Language testLang = ( (RegisterAppInterfaceResponse) msg ).getLanguage();
- SdlMsgVersion testMsgVersion = ( (RegisterAppInterfaceResponse) msg ).getSdlMsgVersion();
- List<AudioPassThruCapabilities> testAptc = ( (RegisterAppInterfaceResponse) msg ).getAudioPassThruCapabilities();
- AudioPassThruCapabilities testPcmStream = ( (RegisterAppInterfaceResponse) msg ).getPcmStreamingCapabilities();
- Boolean testIconResumed = ( (RegisterAppInterfaceResponse) msg ).getIconResumed();
-
- // Valid Tests
- assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testSupportedDiagModes);
- assertEquals(Test.MATCH, Test.GENERAL_PRERECORDEDSPEECH_LIST, testPrerecordedSpeech);
- assertEquals(Test.MATCH, Test.GENERAL_VRCAPABILITIES_LIST, testVrCapabilities);
- assertEquals(Test.MATCH, Test.GENERAL_SPEECHCAPABILITIES_LIST, testSpeechCapabilities);
- assertEquals(Test.MATCH, Test.GENERAL_HMIZONECAPABILITIES_LIST, testHmiZoneCapabilities);
- assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST, testSoftButtonCapabilities));
- assertTrue(Test.TRUE, Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, testButtonCapabilities));
- assertTrue(Test.TRUE, Validator.validateVehicleType(Test.GENERAL_VEHICLETYPE, testVehicleType));
- assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, testPbc));
- assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, testDc));
- assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testHmiLang);
- assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testLang);
- assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(Test.GENERAL_SDLMSGVERSION, testMsgVersion));
- assertTrue(Test.TRUE, Validator.validateAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, testAptc));
- assertTrue(Test.TRUE, Validator.validatePcmStreamCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES, testPcmStream));
- assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, testIconResumed);
-
- // Invalid/Null Tests
- RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSdlMsgVersion());
- assertNull(Test.NULL, msg.getLanguage());
- assertNull(Test.NULL, msg.getHmiDisplayLanguage());
- assertNull(Test.NULL, msg.getDisplayCapabilities());
- assertNull(Test.NULL, msg.getPresetBankCapabilities());
- assertNull(Test.NULL, msg.getVehicleType());
- assertNull(Test.NULL, msg.getButtonCapabilities());
- assertNull(Test.NULL, msg.getSoftButtonCapabilities());
- assertNull(Test.NULL, msg.getAudioPassThruCapabilities());
- assertNull(Test.NULL, msg.getPcmStreamingCapabilities());
- assertNull(Test.NULL, msg.getHmiZoneCapabilities());
- assertNull(Test.NULL, msg.getSpeechCapabilities());
- assertNull(Test.NULL, msg.getVrCapabilities());
- assertNull(Test.NULL, msg.getPrerecordedSpeech());
- assertNull(Test.NULL, msg.getSupportedDiagModes());
- assertNull(Test.NULL, msg.getIconResumed());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- RegisterAppInterfaceResponse cmd = new RegisterAppInterfaceResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- JSONObject vehicleTypeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE);
- VehicleType vehicleType = new VehicleType(JsonRPCMarshaller.deserializeJSONObject(vehicleTypeObj));
- assertTrue(Test.TRUE, Validator.validateVehicleType(vehicleType, cmd.getVehicleType()));
-
- JSONObject pcmStreamObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PCM_STREAM_CAPABILITIES);
- AudioPassThruCapabilities pcmStreamCap = new AudioPassThruCapabilities(JsonRPCMarshaller.deserializeJSONObject(pcmStreamObj));
- assertTrue(Test.TRUE, Validator.validatePcmStreamCapabilities(pcmStreamCap, cmd.getPcmStreamingCapabilities()));
-
- JSONArray speechCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES);
- for (int index = 0; index < speechCapabilitiesArray.length(); index++) {
- SpeechCapabilities speechCapability = SpeechCapabilities.valueForString( speechCapabilitiesArray.get(index).toString() );
- assertEquals(Test.MATCH, speechCapability, cmd.getSpeechCapabilities().get(index));
- }
-
- JSONArray vrCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES);
- for (int index = 0; index < vrCapabilitiesArray.length(); index++) {
- VrCapabilities vrCapability = VrCapabilities.valueForString( vrCapabilitiesArray.get(index).toString() );
- assertEquals(Test.MATCH, vrCapability, cmd.getVrCapabilities().get(index));
- }
-
- JSONArray audioPassThruCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES);
- List<AudioPassThruCapabilities> audioPassThruCapabilitiesList = new ArrayList<AudioPassThruCapabilities>();
- for (int index = 0; index < audioPassThruCapabilitiesArray.length(); index++) {
- AudioPassThruCapabilities audioPassThruCapability =
- new AudioPassThruCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)audioPassThruCapabilitiesArray.get(index) ));
- audioPassThruCapabilitiesList.add(audioPassThruCapability);
- }
- assertTrue(Test.TRUE, Validator.validateAudioPassThruCapabilities(audioPassThruCapabilitiesList, cmd.getAudioPassThruCapabilities() ));
-
- JSONArray hmiZoneCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES);
- for (int index = 0; index < hmiZoneCapabilitiesArray.length(); index++) {
- HmiZoneCapabilities hmiZoneCapability = HmiZoneCapabilities.valueForString( hmiZoneCapabilitiesArray.get(index).toString() );
- assertEquals(Test.MATCH, hmiZoneCapability, cmd.getHmiZoneCapabilities().get(index));
- }
-
- JSONArray prerecordedSpeechArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH);
- for (int index = 0; index < prerecordedSpeechArray.length(); index++) {
- PrerecordedSpeech prerecordedSpeech = PrerecordedSpeech.valueForString( prerecordedSpeechArray.get(index).toString() );
- assertEquals(Test.MATCH, prerecordedSpeech, cmd.getPrerecordedSpeech().get(index));
- }
-
- List<Integer> supportedDiagnosticModesList = JsonUtils.readIntegerListFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES);
- List<Integer> testDiagnosticModesList = cmd.getSupportedDiagModes();
- assertEquals(Test.MATCH, supportedDiagnosticModesList.size(), testDiagnosticModesList.size());
- assertTrue(Test.TRUE, Validator.validateIntegerList(supportedDiagnosticModesList, testDiagnosticModesList));
-
- JSONObject sdlMsgVersionObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION);
- SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(JsonRPCMarshaller.deserializeJSONObject(sdlMsgVersionObj));
- assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) );
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_LANGUAGE), cmd.getLanguage().toString());
-
- JSONArray buttonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES);
- List<ButtonCapabilities> buttonCapabilitiesList = new ArrayList<ButtonCapabilities>();
- for (int index = 0; index < buttonCapabilitiesArray.length(); index++) {
- ButtonCapabilities buttonCapability = new ButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)buttonCapabilitiesArray.get(index) ));
- buttonCapabilitiesList.add(buttonCapability);
- }
- assertTrue(Test.TRUE, Validator.validateButtonCapabilities(buttonCapabilitiesList, cmd.getButtonCapabilities() ));
-
- JSONObject displayCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES);
- DisplayCapabilities displayCapabilities = new DisplayCapabilities(JsonRPCMarshaller.deserializeJSONObject(displayCapabilitiesObj));
- assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(displayCapabilities, cmd.getDisplayCapabilities()) );
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE), cmd.getHmiDisplayLanguage().toString());
-
- JSONArray softButtonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES);
- List<SoftButtonCapabilities> softButtonCapabilitiesList = new ArrayList<SoftButtonCapabilities>();
- for (int index = 0; index < softButtonCapabilitiesArray.length(); index++) {
- SoftButtonCapabilities softButtonCapability =
- new SoftButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonCapabilitiesArray.get(index) ));
- softButtonCapabilitiesList.add(softButtonCapability);
- }
- assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(softButtonCapabilitiesList, cmd.getSoftButtonCapabilities() ));
-
- JSONObject presetBankCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES);
- PresetBankCapabilities presetBankCapabilities = new PresetBankCapabilities(JsonRPCMarshaller.deserializeJSONObject(presetBankCapabilitiesObj));
- assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(presetBankCapabilities, cmd.getPresetBankCapabilities()) );
-
- Boolean iconResumed = JsonUtils.readBooleanFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_ICON_RESUMED);
- assertEquals(Test.MATCH, iconResumed, cmd.getIconResumed());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java
deleted file mode 100644
index 7e2faa3e4..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ResetGlobalPropertiesResponse}
- */
-public class ResetGlobalPropertiesResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new ResetGlobalPropertiesResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.RESET_GLOBAL_PROPERTIES.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- ResetGlobalPropertiesResponse msg = new ResetGlobalPropertiesResponse();
- assertNotNull(Test.NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ResetGlobalPropertiesResponse cmd = new ResetGlobalPropertiesResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java
deleted file mode 100644
index 7c7ad5edf..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ScrollableMessageResponse}
- */
-public class ScrollableMessageResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new ScrollableMessageResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SCROLLABLE_MESSAGE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- ScrollableMessageResponse msg = new ScrollableMessageResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ScrollableMessageResponse cmd = new ScrollableMessageResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java
deleted file mode 100644
index c15607cec..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SendLocationResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SendLocaitonResponse}
- */
-public class SendLocationResponseTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SendLocationResponse msg = new SendLocationResponse();
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SEND_LOCATION.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- SendLocationResponse msg = new SendLocationResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SendLocationResponse cmd = new SendLocationResponse(hash);
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java
deleted file mode 100644
index 977998047..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SetAppIconResponse}
- */
-public class SetAppIconResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new SetAppIconResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SET_APP_ICON.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- SetAppIconResponse msg = new SetAppIconResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SetAppIconResponse cmd = new SetAppIconResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java
deleted file mode 100644
index 2f188ff3b..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
-import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SetDisplayLayoutResponse}
- */
-public class SetDisplayLayoutResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse();
-
- msg.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES);
- msg.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES);
- msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST);
- msg.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SET_DISPLAY_LAYOUT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES, Test.GENERAL_DISPLAYCAPABILITIES.serializeJSON());
- result.put(SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES, Test.JSON_PRESETBANKCAPABILITIES);
- result.put(SetDisplayLayoutResponse.KEY_BUTTON_CAPABILITIES, Test.JSON_BUTTONCAPABILITIES);
- result.put(SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES, Test.JSON_SOFTBUTTONCAPABILITIES);
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- DisplayCapabilities testDisplay = ( (SetDisplayLayoutResponse) msg ).getDisplayCapabilities();
- PresetBankCapabilities testPbc = ( (SetDisplayLayoutResponse) msg ).getPresetBankCapabilities();
- List<ButtonCapabilities> testBc = ( (SetDisplayLayoutResponse) msg ).getButtonCapabilities();
- List<SoftButtonCapabilities> testSbc = ( (SetDisplayLayoutResponse) msg ).getSoftButtonCapabilities();
-
- // Valid Tests
- assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, testDisplay));
- assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, testPbc));
- assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.size(), testBc.size());
- assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(), testSbc.size());
- for (int i = 0; i < Test.GENERAL_BUTTONCAPABILITIES_LIST.size(); i++) {
- assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.get(i), testBc.get(i));
- }
- for (int i = 0; i < Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(); i++) {
- assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.get(i), testSbc.get(i));
- }
-
- // Invalid/Null Tests
- SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getDisplayCapabilities());
- assertNull(Test.NULL, msg.getPresetBankCapabilities());
- assertNull(Test.NULL, msg.getButtonCapabilities());
- assertNull(Test.NULL, msg.getSoftButtonCapabilities());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SetDisplayLayoutResponse cmd = new SetDisplayLayoutResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- JSONArray buttonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_BUTTON_CAPABILITIES);
- List<ButtonCapabilities> buttonCapabilitiesList = new ArrayList<ButtonCapabilities>();
- for (int index = 0; index < buttonCapabilitiesArray.length(); index++) {
- ButtonCapabilities buttonCapability = new ButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)buttonCapabilitiesArray.get(index) ));
- buttonCapabilitiesList.add(buttonCapability);
- }
- assertTrue(Test.TRUE, Validator.validateButtonCapabilities(buttonCapabilitiesList, cmd.getButtonCapabilities() ));
-
- JSONObject displayCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES);
- DisplayCapabilities displayCapabilities = new DisplayCapabilities(JsonRPCMarshaller.deserializeJSONObject(displayCapabilitiesObj));
- assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(displayCapabilities, cmd.getDisplayCapabilities()) );
-
- JSONArray softButtonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES);
- List<SoftButtonCapabilities> softButtonCapabilitiesList = new ArrayList<SoftButtonCapabilities>();
- for (int index = 0; index < softButtonCapabilitiesArray.length(); index++) {
- SoftButtonCapabilities softButtonCapability =
- new SoftButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonCapabilitiesArray.get(index) ));
- softButtonCapabilitiesList.add(softButtonCapability);
- }
- assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(softButtonCapabilitiesList, cmd.getSoftButtonCapabilities() ));
-
- JSONObject presetBankCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES);
- PresetBankCapabilities presetBankCapabilities = new PresetBankCapabilities(JsonRPCMarshaller.deserializeJSONObject(presetBankCapabilitiesObj));
- assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(presetBankCapabilities, cmd.getPresetBankCapabilities()) );
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java
deleted file mode 100644
index ed2c894c8..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SetGlobalPropertiesResponse}
- */
-public class SetGlobalPropertiesResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new SetGlobalPropertiesResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SET_GLOBAL_PROPERTIES.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- SetGlobalPropertiesResponse msg = new SetGlobalPropertiesResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SetGlobalPropertiesResponse cmd = new SetGlobalPropertiesResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java
deleted file mode 100644
index 6cf9d2977..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SetMediaClockTimerResponse}
- */
-public class SetMediaClockTimerResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new SetMediaClockTimerResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SET_MEDIA_CLOCK_TIMER.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- SetMediaClockTimerResponse msg = new SetMediaClockTimerResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SetMediaClockTimerResponse cmd = new SetMediaClockTimerResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java
deleted file mode 100644
index f51739ee9..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.ShowConstantTbtResponse}
- */
-public class ShowConstantTbtResponseTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- ShowConstantTbtResponse msg = new ShowConstantTbtResponse();
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SHOW_CONSTANT_TBT.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- ShowConstantTbtResponse msg = new ShowConstantTbtResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ShowConstantTbtResponse cmd = new ShowConstantTbtResponse(hash);
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java
deleted file mode 100644
index 301e330e7..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.ShowResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.ShowResponse}
- */
-public class ShowResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new ShowResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SHOW.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- ShowResponse msg = new ShowResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- ShowResponse cmd = new ShowResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java
deleted file mode 100644
index 4f9b5be98..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SliderResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SliderResponse}
- */
-public class SliderResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage() {
- SliderResponse msg = new SliderResponse();
-
- msg.setSliderPosition(Test.GENERAL_INT);
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SLIDER.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
- result.put(SliderResponse.KEY_SLIDER_POSITION, Test.GENERAL_INT);
-
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- public void testPosition() {
- Integer copy = ( (SliderResponse) msg ).getSliderPosition();
- assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, copy);
- }
-
- public void testNull() {
- SliderResponse msg = new SliderResponse();
- assertNotNull(Test.NOT_NULL, msg);
-
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getSliderPosition());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SliderResponse cmd = new SliderResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, SliderResponse.KEY_SLIDER_POSITION), cmd.getSliderPosition());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java
deleted file mode 100644
index 3488aeae6..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SpeakResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SpeakResponse}
- */
-public class SpeakResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new SpeakResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SPEAK.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- SpeakResponse msg = new SpeakResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SpeakResponse cmd = new SpeakResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java
deleted file mode 100644
index 6eaa9f397..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SubscribeButtonResponse}
- */
-public class SubscribeButtonResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new SubscribeButtonResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SUBSCRIBE_BUTTON.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- SubscribeButtonResponse msg = new SubscribeButtonResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SubscribeButtonResponse cmd = new SubscribeButtonResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals("Correlation ID doesn't match input ID", JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java
deleted file mode 100644
index e1dfc603c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java
+++ /dev/null
@@ -1,353 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.VehicleDataResult;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse}
- */
-public class SubscribeVehicleDataResponseTest extends BaseRpcTests {
-
- // TODO : Test different result codes.
-
- @Override
- protected RPCMessage createMessage() {
- SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse();
-
- msg.setSpeed(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()));
- msg.setRpm(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()));
- msg.setExternalTemperature(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()));
- msg.setFuelLevel(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()));
- msg.setPrndl(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()));
- msg.setTirePressure(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()));
- msg.setEngineTorque(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()));
- msg.setEngineOilLife(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()));
- msg.setOdometer(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()));
- msg.setGps(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()));
- msg.setFuelLevelState(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()));
- msg.setInstantFuelConsumption(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()));
- msg.setBeltStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()));
- msg.setBodyInformation(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()));
- msg.setDeviceStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()));
- msg.setDriverBraking(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()));
- msg.setWiperStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()));
- msg.setHeadLampStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()));
- msg.setAccPedalPosition(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()));
- msg.setSteeringWheelAngle(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()));
- msg.setECallInfo(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()));
- msg.setAirbagStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()));
- msg.setEmergencyEvent(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()));
- msg.setClusterModeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()));
- msg.setMyKey(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()));
- msg.setFuelRange(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()));
- msg.setTurnSignal(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()));
- msg.setElectronicParkBrakeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()));
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.SUBSCRIBE_VEHICLE_DATA.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
-
- // Note: If the key values stored in SubscribeVehicleDataResponse
- // were to be in a list then this could be easily looped through
- // instead of individually set.
-
- result.put(SubscribeVehicleDataResponse.KEY_SPEED, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_RPM, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_PRNDL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ODOMETER, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_GPS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_BELT_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_BODY_INFORMATION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_DEVICE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_WIPER_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_E_CALL_INFO, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON());
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- VehicleDataResult testGps = ( (SubscribeVehicleDataResponse) msg ).getGps();
- VehicleDataResult testOdometer = ( (SubscribeVehicleDataResponse) msg ).getOdometer();
- VehicleDataResult testTirePressure = ( (SubscribeVehicleDataResponse) msg ).getTirePressure();
- VehicleDataResult testBeltStatus = ( (SubscribeVehicleDataResponse) msg ).getBeltStatus();
- VehicleDataResult testBodyInfo = ( (SubscribeVehicleDataResponse) msg ).getBodyInformation();
- VehicleDataResult testDeviceStatus = ( (SubscribeVehicleDataResponse) msg ).getDeviceStatus();
- VehicleDataResult testHeadLampStatus = ( (SubscribeVehicleDataResponse) msg ).getHeadLampStatus();
- VehicleDataResult testECallInfo = ( (SubscribeVehicleDataResponse) msg ).getECallInfo();
- VehicleDataResult testAirbagStatus = ( (SubscribeVehicleDataResponse) msg ).getAirbagStatus();
- VehicleDataResult testEmergencyEvent = ( (SubscribeVehicleDataResponse) msg ).getEmergencyEvent();
- VehicleDataResult testClusterMode = ( (SubscribeVehicleDataResponse) msg ).getClusterModeStatus();
- VehicleDataResult testMyKey = ( (SubscribeVehicleDataResponse) msg ).getMyKey();
- VehicleDataResult testSpeed = ( (SubscribeVehicleDataResponse) msg ).getSpeed();
- VehicleDataResult testRpm = ( (SubscribeVehicleDataResponse) msg ).getRpm();
- VehicleDataResult testFuelLevel = ( (SubscribeVehicleDataResponse) msg ).getFuelLevel();
- VehicleDataResult testConsumption = ( (SubscribeVehicleDataResponse) msg ).getInstantFuelConsumption();
- VehicleDataResult testExternalTemp = ( (SubscribeVehicleDataResponse) msg ).getExternalTemperature();
- VehicleDataResult testEngineTorque = ( (SubscribeVehicleDataResponse) msg ).getEngineTorque();
- VehicleDataResult testEngineOilLife = ( (SubscribeVehicleDataResponse) msg ).getEngineOilLife();
- VehicleDataResult testAccPedal = ( (SubscribeVehicleDataResponse) msg ).getAccPedalPosition();
- VehicleDataResult testSteeringWheel = ( (SubscribeVehicleDataResponse) msg ).getSteeringWheelAngle();
- VehicleDataResult testFuelLevelState = ( (SubscribeVehicleDataResponse) msg ).getFuelLevelState();
- VehicleDataResult testPrndl = ( (SubscribeVehicleDataResponse) msg ).getPrndl();
- VehicleDataResult testBraking = ( (SubscribeVehicleDataResponse) msg ).getDriverBraking();
- VehicleDataResult testWiperStatus = ( (SubscribeVehicleDataResponse) msg ).getWiperStatus();
- VehicleDataResult testFuelRange = ( (SubscribeVehicleDataResponse) msg ).getFuelRange();
- VehicleDataResult testTurnSignal = ( (SubscribeVehicleDataResponse) msg ).getTurnSignal();
- VehicleDataResult testEBrakeStatus = ( (SubscribeVehicleDataResponse) msg ).getElectronicParkBrakeStatus();
-
- // Valid Tests
- assertTrue(Test.TRUE, testGps.getDataType().equals(VehicleDataType.VEHICLEDATA_GPS));
- assertTrue(Test.TRUE, testOdometer.getDataType().equals(VehicleDataType.VEHICLEDATA_ODOMETER));
- assertTrue(Test.TRUE, testTirePressure.getDataType().equals(VehicleDataType.VEHICLEDATA_TIREPRESSURE));
- assertTrue(Test.TRUE, testBeltStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_BELTSTATUS));
- assertTrue(Test.TRUE, testBodyInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_BODYINFO));
- assertTrue(Test.TRUE, testDeviceStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_DEVICESTATUS));
- assertTrue(Test.TRUE, testHeadLampStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS));
- assertTrue(Test.TRUE, testECallInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_ECALLINFO));
- assertTrue(Test.TRUE, testAirbagStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS));
- assertTrue(Test.TRUE, testEmergencyEvent.getDataType().equals(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT));
- assertTrue(Test.TRUE, testClusterMode.getDataType().equals(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS));
- assertTrue(Test.TRUE, testMyKey.getDataType().equals(VehicleDataType.VEHICLEDATA_MYKEY));
- assertTrue(Test.TRUE, testSpeed.getDataType().equals(VehicleDataType.VEHICLEDATA_SPEED));
- assertTrue(Test.TRUE, testRpm.getDataType().equals(VehicleDataType.VEHICLEDATA_RPM));
- assertTrue(Test.TRUE, testFuelLevel.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL));
- assertTrue(Test.TRUE, testConsumption.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION));
- assertTrue(Test.TRUE, testExternalTemp.getDataType().equals(VehicleDataType.VEHICLEDATA_EXTERNTEMP));
- assertTrue(Test.TRUE, testEngineTorque.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINETORQUE));
- assertTrue(Test.TRUE, testEngineOilLife.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE));
- assertTrue(Test.TRUE, testAccPedal.getDataType().equals(VehicleDataType.VEHICLEDATA_ACCPEDAL));
- assertTrue(Test.TRUE, testSteeringWheel.getDataType().equals(VehicleDataType.VEHICLEDATA_STEERINGWHEEL));
- assertTrue(Test.TRUE, testFuelLevelState.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE));
- assertTrue(Test.TRUE, testPrndl.getDataType().equals(VehicleDataType.VEHICLEDATA_PRNDL));
- assertTrue(Test.TRUE, testBraking.getDataType().equals(VehicleDataType.VEHICLEDATA_BRAKING));
- assertTrue(Test.TRUE, testWiperStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WIPERSTATUS));
- assertTrue(Test.TRUE, testFuelRange.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELRANGE));
- assertTrue(Test.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL));
- assertTrue(Test.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS));
-
- // Invalid/Null Tests
- SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse();
- assertNotNull("Null object creation failed.", msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getAccPedalPosition());
- assertNull(Test.NULL, msg.getAirbagStatus());
- assertNull(Test.NULL, msg.getBeltStatus());
- assertNull(Test.NULL, msg.getDriverBraking());
- assertNull(Test.NULL, msg.getFuelLevel());
- assertNull(Test.NULL, msg.getTirePressure());
- assertNull(Test.NULL, msg.getWiperStatus());
- assertNull(Test.NULL, msg.getGps());
- assertNull(Test.NULL, msg.getSpeed());
- assertNull(Test.NULL, msg.getRpm());
- assertNull(Test.NULL, msg.getFuelLevelState());
- assertNull(Test.NULL, msg.getInstantFuelConsumption());
- assertNull(Test.NULL, msg.getExternalTemperature());
- assertNull(Test.NULL, msg.getPrndl());
- assertNull(Test.NULL, msg.getOdometer());
- assertNull(Test.NULL, msg.getBodyInformation());
- assertNull(Test.NULL, msg.getDeviceStatus());
- assertNull(Test.NULL, msg.getHeadLampStatus());
- assertNull(Test.NULL, msg.getEngineTorque());
- assertNull(Test.NULL, msg.getEngineOilLife());
- assertNull(Test.NULL, msg.getSteeringWheelAngle());
- assertNull(Test.NULL, msg.getECallInfo());
- assertNull(Test.NULL, msg.getEmergencyEvent());
- assertNull(Test.NULL, msg.getClusterModeStatus());
- assertNull(Test.NULL, msg.getMyKey());
- assertNull(Test.NULL, msg.getFuelRange());
- assertNull(Test.NULL, msg.getTurnSignal());
- assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SubscribeVehicleDataResponse cmd = new SubscribeVehicleDataResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- JSONObject speed = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_SPEED);
- VehicleDataResult referenceSpeed = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(speed));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSpeed, cmd.getSpeed()));
-
- JSONObject rpm = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_RPM);
- VehicleDataResult referenceRpm = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(rpm));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceRpm, cmd.getRpm()));
-
- JSONObject fuelLevel = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_LEVEL);
- VehicleDataResult referenceFuelLevel = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevel));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevel, cmd.getFuelLevel()));
-
- JSONObject externalTemperature = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE);
- VehicleDataResult referenceExternalTemperature = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(externalTemperature));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceExternalTemperature, cmd.getExternalTemperature()));
-
- JSONObject prndl = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_PRNDL);
- VehicleDataResult referencePrndl = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(prndl));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referencePrndl, cmd.getPrndl()));
-
- JSONObject tirePressure = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE);
- VehicleDataResult referenceTirePressure = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(tirePressure));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTirePressure, cmd.getTirePressure()));
-
- JSONObject engineTorque = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE);
- VehicleDataResult referenceEngineTorque = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineTorque));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineTorque, cmd.getEngineTorque()));
-
- JSONObject engineOilLife = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE);
- VehicleDataResult referenceEngineOilLife = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineOilLife));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineOilLife, cmd.getEngineOilLife()));
-
- JSONObject odometer = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ODOMETER);
- VehicleDataResult referenceOdometer = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(odometer));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceOdometer, cmd.getOdometer()));
-
- JSONObject gps = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_GPS);
- VehicleDataResult referenceGps = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(gps));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceGps, cmd.getGps()));
-
- JSONObject fuelLevelState = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE);
- VehicleDataResult referenceFuelLevelState = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevelState));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevelState, cmd.getFuelLevelState()));
-
- JSONObject fuelConsumption = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION);
- VehicleDataResult referenceFuelConsumption = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelConsumption));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelConsumption, cmd.getInstantFuelConsumption()));
-
- JSONObject beltStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_BELT_STATUS);
- VehicleDataResult referenceBeltStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(beltStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBeltStatus, cmd.getBeltStatus()));
-
- JSONObject bodyInformation = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_BODY_INFORMATION);
- VehicleDataResult referenceBodyInformation = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(bodyInformation));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBodyInformation, cmd.getBodyInformation()));
-
- JSONObject deviceStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_DEVICE_STATUS);
- VehicleDataResult referenceDeviceStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(deviceStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDeviceStatus, cmd.getDeviceStatus()));
-
- JSONObject driverBraking = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING);
- VehicleDataResult referenceDriverBraking = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(driverBraking));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDriverBraking, cmd.getDriverBraking()));
-
- JSONObject wiperStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_WIPER_STATUS);
- VehicleDataResult referenceWiperStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(wiperStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceWiperStatus, cmd.getWiperStatus()));
-
- JSONObject headLampStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS);
- VehicleDataResult referenceHeadLampStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(headLampStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceHeadLampStatus, cmd.getHeadLampStatus()));
-
- JSONObject accPedalPosition = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION);
- VehicleDataResult referenceAccPedalPosition = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(accPedalPosition));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAccPedalPosition, cmd.getAccPedalPosition()));
-
- JSONObject steeringWheelAngle = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE);
- VehicleDataResult referenceSteeringWheelAngle = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(steeringWheelAngle));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSteeringWheelAngle, cmd.getSteeringWheelAngle()));
-
- JSONObject eCallInfo = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_E_CALL_INFO);
- VehicleDataResult referenceECallInfo = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eCallInfo));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceECallInfo, cmd.getECallInfo()));
-
- JSONObject airbagStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS);
- VehicleDataResult referenceAirbagStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(airbagStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAirbagStatus, cmd.getAirbagStatus()));
-
- JSONObject emergencyEvent = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT);
- VehicleDataResult referenceEmergencyEvent = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(emergencyEvent));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEmergencyEvent, cmd.getEmergencyEvent()));
-
- JSONObject clusterModeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS);
- VehicleDataResult referenceClusterModeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceClusterModeStatus, cmd.getClusterModeStatus()));
-
- JSONObject myKey = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_MY_KEY);
- VehicleDataResult referenceMyKey = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(myKey));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceMyKey, cmd.getMyKey()));
-
- JSONObject fuelRange = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_RANGE);
- VehicleDataResult referenceFuelRange = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelRange));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelRange, cmd.getFuelRange()));
-
- JSONObject turnSignal = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_TURN_SIGNAL);
- VehicleDataResult referenceTurnSignal = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(turnSignal));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTurnSignal, cmd.getTurnSignal()));
-
- JSONObject electronicParkBrakeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- VehicleDataResult referenceEBrakeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(electronicParkBrakeStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEBrakeStatus, cmd.getElectronicParkBrakeStatus()));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java
deleted file mode 100644
index 80684a04a..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.SystemRequestResponse}
- */
-public class SystemRequestResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new SystemRequestResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.SYSTEM_REQUEST.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- SystemRequestResponse msg = new SystemRequestResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- SystemRequestResponse cmd = new SystemRequestResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java
deleted file mode 100644
index 7d2fc1645..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterfaceResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.UnregisterAppInterfaceResponse}
- */
-public class UnregisterAppInterfaceResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new UnregisterAppInterfaceResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.UNREGISTER_APP_INTERFACE.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- UnregisterAppInterfaceResponse msg = new UnregisterAppInterfaceResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- UnregisterAppInterfaceResponse cmd = new UnregisterAppInterfaceResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java
deleted file mode 100644
index 384c5df57..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.UnsubscribeButtonResponse}
- */
-public class UnsubscribeButtonResponseTest extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new UnsubscribeButtonResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.UNSUBSCRIBE_BUTTON.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- UnsubscribeButtonResponse msg = new UnsubscribeButtonResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- UnsubscribeButtonResponse cmd = new UnsubscribeButtonResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java
deleted file mode 100644
index cba7fcf0d..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java
+++ /dev/null
@@ -1,355 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.VehicleDataResult;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.Validator;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse}
- */
-public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests {
-
- // TODO : Test different result codes.
-
- @Override
- protected RPCMessage createMessage() {
- UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse();
-
- msg.setSpeed(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()));
- msg.setRpm(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()));
- msg.setExternalTemperature(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()));
- msg.setFuelLevel(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()));
- msg.setPrndl(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()));
- msg.setTirePressure(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()));
- msg.setEngineTorque(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()));
- msg.setEngineOilLife(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()));
- msg.setOdometer(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()));
- msg.setGps(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()));
- msg.setFuelLevelState(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()));
- msg.setInstantFuelConsumption(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()));
- msg.setBeltStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()));
- msg.setBodyInformation(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()));
- msg.setDeviceStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()));
- msg.setDriverBraking(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()));
- msg.setWiperStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()));
- msg.setHeadLampStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()));
- msg.setAccPedalPosition(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()));
- msg.setSteeringWheelAngle(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()));
- msg.setECallInfo(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()));
- msg.setAirbagStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()));
- msg.setEmergencyEvent(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()));
- msg.setClusterModeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()));
- msg.setMyKey(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()));
- msg.setFuelRange(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()));
- msg.setTurnSignal(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()));
- msg.setElectronicParkBrakeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()));
-
- return msg;
- }
-
- @Override
- protected String getMessageType() {
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType() {
- return FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion) {
- JSONObject result = new JSONObject();
-
- try {
-
- // Note: If the key values stored in SubscribeVehicleDataResponse
- // were to be in a list then this could be easily looped through
- // instead of individually set.
-
- result.put(SubscribeVehicleDataResponse.KEY_SPEED, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_RPM, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_PRNDL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ODOMETER, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_GPS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_BELT_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_BODY_INFORMATION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_DEVICE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_WIPER_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_E_CALL_INFO, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON());
- result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON());
- } catch (JSONException e) {
- fail(Test.JSON_FAIL);
- }
-
- return result;
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Test Values
- VehicleDataResult testGps = ( (UnsubscribeVehicleDataResponse) msg ).getGps();
- VehicleDataResult testOdometer = ( (UnsubscribeVehicleDataResponse) msg ).getOdometer();
- VehicleDataResult testTirePressure = ( (UnsubscribeVehicleDataResponse) msg ).getTirePressure();
- VehicleDataResult testBeltStatus = ( (UnsubscribeVehicleDataResponse) msg ).getBeltStatus();
- VehicleDataResult testBodyInfo = ( (UnsubscribeVehicleDataResponse) msg ).getBodyInformation();
- VehicleDataResult testDeviceStatus = ( (UnsubscribeVehicleDataResponse) msg ).getDeviceStatus();
- VehicleDataResult testHeadLampStatus = ( (UnsubscribeVehicleDataResponse) msg ).getHeadLampStatus();
- VehicleDataResult testECallInfo = ( (UnsubscribeVehicleDataResponse) msg ).getECallInfo();
- VehicleDataResult testAirbagStatus = ( (UnsubscribeVehicleDataResponse) msg ).getAirbagStatus();
- VehicleDataResult testEmergencyEvent = ( (UnsubscribeVehicleDataResponse) msg ).getEmergencyEvent();
- VehicleDataResult testClusterMode = ( (UnsubscribeVehicleDataResponse) msg ).getClusterModeStatus();
- VehicleDataResult testMyKey = ( (UnsubscribeVehicleDataResponse) msg ).getMyKey();
- VehicleDataResult testSpeed = ( (UnsubscribeVehicleDataResponse) msg ).getSpeed();
- VehicleDataResult testRpm = ( (UnsubscribeVehicleDataResponse) msg ).getRpm();
- VehicleDataResult testFuelLevel = ( (UnsubscribeVehicleDataResponse) msg ).getFuelLevel();
- VehicleDataResult testConsumption = ( (UnsubscribeVehicleDataResponse) msg ).getInstantFuelConsumption();
- VehicleDataResult testExternalTemp = ( (UnsubscribeVehicleDataResponse) msg ).getExternalTemperature();
- VehicleDataResult testEngineTorque = ( (UnsubscribeVehicleDataResponse) msg ).getEngineTorque();
- VehicleDataResult testEngineOilLife = ( (UnsubscribeVehicleDataResponse) msg ).getEngineOilLife();
- VehicleDataResult testAccPedal = ( (UnsubscribeVehicleDataResponse) msg ).getAccPedalPosition();
- VehicleDataResult testSteeringWheel = ( (UnsubscribeVehicleDataResponse) msg ).getSteeringWheelAngle();
- VehicleDataResult testFuelLevelState = ( (UnsubscribeVehicleDataResponse) msg ).getFuelLevelState();
- VehicleDataResult testPrndl = ( (UnsubscribeVehicleDataResponse) msg ).getPrndl();
- VehicleDataResult testBraking = ( (UnsubscribeVehicleDataResponse) msg ).getDriverBraking();
- VehicleDataResult testWiperStatus = ( (UnsubscribeVehicleDataResponse) msg ).getWiperStatus();
- VehicleDataResult testFuelRange = ( (UnsubscribeVehicleDataResponse) msg ).getFuelRange();
- VehicleDataResult testTurnSignal = ( (UnsubscribeVehicleDataResponse) msg ).getTurnSignal();
- VehicleDataResult testEBrakeStatus = ( (UnsubscribeVehicleDataResponse) msg ).getElectronicParkBrakeStatus();
-
- // Valid Tests
- assertTrue(Test.TRUE, testGps.getDataType().equals(VehicleDataType.VEHICLEDATA_GPS));
- assertTrue(Test.TRUE, testOdometer.getDataType().equals(VehicleDataType.VEHICLEDATA_ODOMETER));
- assertTrue(Test.TRUE, testTirePressure.getDataType().equals(VehicleDataType.VEHICLEDATA_TIREPRESSURE));
- assertTrue(Test.TRUE, testBeltStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_BELTSTATUS));
- assertTrue(Test.TRUE, testBodyInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_BODYINFO));
- assertTrue(Test.TRUE, testDeviceStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_DEVICESTATUS));
- assertTrue(Test.TRUE, testHeadLampStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS));
- assertTrue(Test.TRUE, testECallInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_ECALLINFO));
- assertTrue(Test.TRUE, testAirbagStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS));
- assertTrue(Test.TRUE, testEmergencyEvent.getDataType().equals(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT));
- assertTrue(Test.TRUE, testClusterMode.getDataType().equals(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS));
- assertTrue(Test.TRUE, testMyKey.getDataType().equals(VehicleDataType.VEHICLEDATA_MYKEY));
- assertTrue(Test.TRUE, testSpeed.getDataType().equals(VehicleDataType.VEHICLEDATA_SPEED));
- assertTrue(Test.TRUE, testRpm.getDataType().equals(VehicleDataType.VEHICLEDATA_RPM));
- assertTrue(Test.TRUE, testFuelLevel.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL));
- assertTrue(Test.TRUE, testConsumption.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION));
- assertTrue(Test.TRUE, testExternalTemp.getDataType().equals(VehicleDataType.VEHICLEDATA_EXTERNTEMP));
- assertTrue(Test.TRUE, testEngineTorque.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINETORQUE));
- assertTrue(Test.TRUE, testEngineOilLife.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE));
- assertTrue(Test.TRUE, testAccPedal.getDataType().equals(VehicleDataType.VEHICLEDATA_ACCPEDAL));
- assertTrue(Test.TRUE, testSteeringWheel.getDataType().equals(VehicleDataType.VEHICLEDATA_STEERINGWHEEL));
- assertTrue(Test.TRUE, testFuelLevelState.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE));
- assertTrue(Test.TRUE, testPrndl.getDataType().equals(VehicleDataType.VEHICLEDATA_PRNDL));
- assertTrue(Test.TRUE, testBraking.getDataType().equals(VehicleDataType.VEHICLEDATA_BRAKING));
- assertTrue(Test.TRUE, testWiperStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WIPERSTATUS));
- assertTrue(Test.TRUE, testFuelRange.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELRANGE));
- assertTrue(Test.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL));
- assertTrue(Test.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS));
-
- // Invalid/Null Tests
- UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse();
- assertNotNull("Null object creation failed.", msg);
- testNullBase(msg);
-
- assertNull(Test.NULL, msg.getAccPedalPosition());
- assertNull(Test.NULL, msg.getAirbagStatus());
- assertNull(Test.NULL, msg.getBeltStatus());
- assertNull(Test.NULL, msg.getDriverBraking());
- assertNull(Test.NULL, msg.getFuelLevel());
- assertNull(Test.NULL, msg.getTirePressure());
- assertNull(Test.NULL, msg.getWiperStatus());
- assertNull(Test.NULL, msg.getGps());
- assertNull(Test.NULL, msg.getSpeed());
- assertNull(Test.NULL, msg.getRpm());
- assertNull(Test.NULL, msg.getFuelLevelState());
- assertNull(Test.NULL, msg.getInstantFuelConsumption());
- assertNull(Test.NULL, msg.getExternalTemperature());
- assertNull(Test.NULL, msg.getPrndl());
- assertNull(Test.NULL, msg.getOdometer());
- assertNull(Test.NULL, msg.getBodyInformation());
- assertNull(Test.NULL, msg.getDeviceStatus());
- assertNull(Test.NULL, msg.getHeadLampStatus());
- assertNull(Test.NULL, msg.getEngineTorque());
- assertNull(Test.NULL, msg.getEngineOilLife());
- assertNull(Test.NULL, msg.getSteeringWheelAngle());
- assertNull(Test.NULL, msg.getECallInfo());
- assertNull(Test.NULL, msg.getEmergencyEvent());
- assertNull(Test.NULL, msg.getClusterModeStatus());
- assertNull(Test.NULL, msg.getMyKey());
- assertNull(Test.NULL, msg.getFuelRange());
- assertNull(Test.NULL, msg.getTurnSignal());
- assertNull(Test.NULL, msg.getElectronicParkBrakeStatus());
- }
-
- /**
- * Tests a valid JSON construction of this RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- UnsubscribeVehicleDataResponse cmd = new UnsubscribeVehicleDataResponse(hash);
-
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
-
- JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
-
- JSONObject speed = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_SPEED);
- VehicleDataResult referenceSpeed = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(speed));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSpeed, cmd.getSpeed()));
-
- JSONObject rpm = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_RPM);
- VehicleDataResult referenceRpm = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(rpm));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceRpm, cmd.getRpm()));
-
- JSONObject fuelLevel = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_LEVEL);
- VehicleDataResult referenceFuelLevel = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevel));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevel, cmd.getFuelLevel()));
-
- JSONObject externalTemperature = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE);
- VehicleDataResult referenceExternalTemperature = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(externalTemperature));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceExternalTemperature, cmd.getExternalTemperature()));
-
- JSONObject prndl = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_PRNDL);
- VehicleDataResult referencePrndl = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(prndl));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referencePrndl, cmd.getPrndl()));
-
- JSONObject tirePressure = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_TIRE_PRESSURE);
- VehicleDataResult referenceTirePressure = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(tirePressure));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTirePressure, cmd.getTirePressure()));
-
- JSONObject engineTorque = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ENGINE_TORQUE);
- VehicleDataResult referenceEngineTorque = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineTorque));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineTorque, cmd.getEngineTorque()));
-
- JSONObject engineOilLife = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE);
- VehicleDataResult referenceEngineOilLife = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineOilLife));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineOilLife, cmd.getEngineOilLife()));
-
- JSONObject odometer = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ODOMETER);
- VehicleDataResult referenceOdometer = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(odometer));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceOdometer, cmd.getOdometer()));
-
- JSONObject gps = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_GPS);
- VehicleDataResult referenceGps = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(gps));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceGps, cmd.getGps()));
-
- JSONObject fuelLevelState = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE);
- VehicleDataResult referenceFuelLevelState = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevelState));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevelState, cmd.getFuelLevelState()));
-
- JSONObject fuelConsumption = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION);
- VehicleDataResult referenceFuelConsumption = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelConsumption));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelConsumption, cmd.getInstantFuelConsumption()));
-
- JSONObject beltStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_BELT_STATUS);
- VehicleDataResult referenceBeltStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(beltStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBeltStatus, cmd.getBeltStatus()));
-
- JSONObject bodyInformation = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_BODY_INFORMATION);
- VehicleDataResult referenceBodyInformation = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(bodyInformation));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBodyInformation, cmd.getBodyInformation()));
-
- JSONObject deviceStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_DEVICE_STATUS);
- VehicleDataResult referenceDeviceStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(deviceStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDeviceStatus, cmd.getDeviceStatus()));
-
- JSONObject driverBraking = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_DRIVER_BRAKING);
- VehicleDataResult referenceDriverBraking = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(driverBraking));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDriverBraking, cmd.getDriverBraking()));
-
- JSONObject wiperStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_WIPER_STATUS);
- VehicleDataResult referenceWiperStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(wiperStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceWiperStatus, cmd.getWiperStatus()));
-
- JSONObject headLampStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS);
- VehicleDataResult referenceHeadLampStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(headLampStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceHeadLampStatus, cmd.getHeadLampStatus()));
-
- JSONObject accPedalPosition = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION);
- VehicleDataResult referenceAccPedalPosition = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(accPedalPosition));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAccPedalPosition, cmd.getAccPedalPosition()));
-
- JSONObject steeringWheelAngle = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE);
- VehicleDataResult referenceSteeringWheelAngle = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(steeringWheelAngle));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSteeringWheelAngle, cmd.getSteeringWheelAngle()));
-
- JSONObject eCallInfo = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_E_CALL_INFO);
- VehicleDataResult referenceECallInfo = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eCallInfo));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceECallInfo, cmd.getECallInfo()));
-
- JSONObject airbagStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_AIRBAG_STATUS);
- VehicleDataResult referenceAirbagStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(airbagStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAirbagStatus, cmd.getAirbagStatus()));
-
- JSONObject emergencyEvent = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT);
- VehicleDataResult referenceEmergencyEvent = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(emergencyEvent));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEmergencyEvent, cmd.getEmergencyEvent()));
-
- JSONObject clusterModeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS);
- VehicleDataResult referenceClusterModeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceClusterModeStatus, cmd.getClusterModeStatus()));
-
- JSONObject myKey = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_MY_KEY);
- VehicleDataResult referenceMyKey = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(myKey));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceMyKey, cmd.getMyKey()));
-
- JSONObject fuelRange = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_RANGE);
- VehicleDataResult referenceFuelRange = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelRange));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelRange, cmd.getFuelRange()));
-
- JSONObject turnSignal = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_TURN_SIGNAL);
- VehicleDataResult referenceTurnSignal = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(turnSignal));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTurnSignal, cmd.getTurnSignal()));
-
- JSONObject eBrakeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- VehicleDataResult referenceEBrakeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eBrakeStatus));
- assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEBrakeStatus, cmd.getElectronicParkBrakeStatus()));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java
deleted file mode 100644
index 757f3b185..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.smartdevicelink.test.rpc.responses;
-
-import java.util.Hashtable;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.rpc.UpdateTurnListResponse;
-import com.smartdevicelink.test.BaseRpcTests;
-import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.test.json.rpc.JsonFileReader;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.UpdateTurnListResponse}
- */
-public class UpdateTurnListResponseTests extends BaseRpcTests {
-
- @Override
- protected RPCMessage createMessage(){
- return new UpdateTurnListResponse();
- }
-
- @Override
- protected String getMessageType(){
- return RPCMessage.KEY_RESPONSE;
- }
-
- @Override
- protected String getCommandType(){
- return FunctionID.UPDATE_TURN_LIST.toString();
- }
-
- @Override
- protected JSONObject getExpectedParameters(int sdlVersion){
- return new JSONObject();
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testRpcValues () {
- // Invalid/Null Tests
- UpdateTurnListResponse msg = new UpdateTurnListResponse();
- assertNotNull(Test.NOT_NULL, msg);
- testNullBase(msg);
- }
-
- /**
- * Tests the expected values of the RPC message.
- */
- public void testJsonConstructor () {
- JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
- assertNotNull(Test.NOT_NULL, commandJson);
-
- try {
- Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
- UpdateTurnListResponse cmd = new UpdateTurnListResponse(hash);
- JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
- assertNotNull(Test.NOT_NULL, body);
-
- // Test everything in the json body.
- assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
- assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java
deleted file mode 100644
index e91903e21..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package com.smartdevicelink.test.security;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.security.SdlSecurityBase;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-
-public class SdlSecurityBaseTest extends AndroidTestCase2 {
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- }
-
- private class MockSdlSecurityBase extends SdlSecurityBase {
-
- @Override
- public void initialize() {
-
- }
-
- @Override
- public Integer runHandshake(byte[] inputData, byte[] outputData) {
- return null;
- }
-
- @Override
- public Integer encryptData(byte[] inputData, byte[] outputData) {
- return null;
- }
-
- @Override
- public Integer decryptData(byte[] inputData, byte[] outputData) {
- return null;
- }
-
- @Override
- public void shutDown() {
-
- }
-
- public SdlSession getSdlSession() {
- return session;
- }
-
- public void setStartServiceList(List<SessionType> list) {
- startServiceList = list;
- }
- }
-
- class MockInterfaceBroker implements ISdlConnectionListener {
- public MockInterfaceBroker () { }
- @Override
- public void onTransportDisconnected(String info) {
-
- }
-
- @Override
- public void onTransportDisconnected(String info, boolean availablePrimary, MultiplexTransportConfig transportConfig) {
-
- }
-
- @Override
- public void onTransportError(String info, Exception e) {
-
- }
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
-
- }
- @Override
- public void onProtocolSessionStartedNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
-
- }
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID,
- boolean isEncrypted) {
-
- }
- @Override
- public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
- String correlationID) {
-
- }
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,
- byte sessionID, String correlationID) {
-
- }
- @Override
- public void onProtocolError(String info, Exception e) {
-
- }
- @Override
- public void onHeartbeatTimedOut(byte sessionID) {
-
- }
- @Override
- public void onProtocolServiceDataACK(SessionType sessionType, int dataSize,
- byte sessionID) {
-
- }
-
- }
-
- public void testMakeListSetAndGet(){
- List<String> makeList = new ArrayList<String>();
- MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase();
-
- String MAKE_1 = "SDL1";
- String MAKE_2 = "SDL2";
- makeList.add(MAKE_1);
- makeList.add(MAKE_2);
-
- mockSdlSecurityBase.setMakeList(makeList);
-
- assertNotNull(Test.NOT_NULL, makeList);
- assertEquals(Test.MATCH, makeList, mockSdlSecurityBase.getMakeList());
- }
-
- public void testHandleInitResult() {
- byte testWiproVersion = (byte) 0x0B;
- boolean testInitResult = true;
- MockInterfaceBroker interfaceBroker = new MockInterfaceBroker();
- BaseTransportConfig transportConfig = new BTTransportConfig(true);
- MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase();
-
- SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,interfaceBroker, transportConfig);
-
- assertNotNull(Test.NOT_NULL, mockSdlSecurityBase);
- assertNotNull(Test.NOT_NULL, testSdlSession);
-
- testSdlSession.setSdlSecurity(mockSdlSecurityBase);
-
- mockSdlSecurityBase.handleSdlSession(testSdlSession);
-
- assertEquals(Test.MATCH, mockSdlSecurityBase.getSdlSession(), testSdlSession);
- assertEquals(Test.MATCH, mockSdlSecurityBase.getSdlSession().getSessionId(), testSdlSession.getSessionId());
-
- mockSdlSecurityBase.handleInitResult(testInitResult);
-
- assertEquals(Test.MATCH, testInitResult, mockSdlSecurityBase.getInitSuccess());
- }
-
- public void testStartServiceListSetAndGet() {
- List<SessionType> startServiceList = new ArrayList<SessionType>();
- MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase();
-
- startServiceList.add(SessionType.RPC);
- startServiceList.add(SessionType.NAV);
- startServiceList.add(SessionType.PCM);
- startServiceList.add(SessionType.CONTROL);
-
- assertNotNull(Test.NOT_NULL, startServiceList);
-
- mockSdlSecurityBase.setStartServiceList(startServiceList);
-
- assertEquals(Test.MATCH, startServiceList, mockSdlSecurityBase.getServiceList());
- }
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java
deleted file mode 100644
index c74e8ab84..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package com.smartdevicelink.test.streaming;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.streaming.AbstractPacketizer;
-import com.smartdevicelink.streaming.IStreamListener;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.streaming.AbstractPacketizer}
- */
-public class AbstractPacketizerTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.streaming.AbstractPacketizer#AbstractPacketizer(IStreamListener, InputStream, SessionType, byte)}
- * {@link com.smartdevicelink.streaming.AbstractPacketizer#AbstractPacketizer(IStreamListener, InputStream, RPCRequest, SessionType, byte, byte)}
- */
- public void testConstructors () {
-
- // Test Values
- byte testSessionId = (byte) 0x0A;
- byte testWiproVersion = (byte) 0x0B;
- RPCRequest testRpcRequest = new RPCRequest("test");
- SessionType testSessionType = SessionType.RPC;
- SdlSession testSdlSession = null;
- InputStream testInputStream = null;
- MockPacketizer testPacketizer1 = null;
- MockPacketizer testPacketizer2 = null;
- MockPacketizer testPacketizer3 = null;
- IStreamListener testListener = new MockStreamListener();
- try {
- testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes()));
- MockInterfaceBroker _interfaceBroker = new MockInterfaceBroker();
- BaseTransportConfig _transportConfig = new BTTransportConfig(true);
- testSdlSession = SdlSession.createSession(testWiproVersion,_interfaceBroker, _transportConfig);
- testPacketizer1 = new MockPacketizer(testListener, testInputStream, testSessionType, testSessionId, testSdlSession);
- testPacketizer2 = new MockPacketizer(null, null, null, testSessionId, testSdlSession);
- testPacketizer3 = new MockPacketizer(testListener, testInputStream, testRpcRequest, testSessionType, testSessionId, testWiproVersion, testSdlSession);
- try {
- new MockPacketizer(null, null, null, null, testSessionId, testWiproVersion, null);
- fail("Exception should be thrown");
- }catch(Exception e) {
- assertTrue(e instanceof IllegalArgumentException);
- }
-
-
- // Valid Tests
- assertNotNull(Test.NOT_NULL, testPacketizer1);
- assertNotNull(Test.NOT_NULL, testPacketizer2);
- assertNotNull(Test.NOT_NULL, testPacketizer3);
-
- assertEquals(Test.MATCH, testListener, testPacketizer1.getListener());
- assertEquals(Test.MATCH, testInputStream, testPacketizer1.getInputStream());
- assertEquals(Test.MATCH, testSessionType, testPacketizer1.getSessionType());
- assertEquals(Test.MATCH, testSessionId, testPacketizer1.getSessionId());
- assertEquals(Test.MATCH, testListener, testPacketizer3.getListener());
- assertEquals(Test.MATCH, testInputStream, testPacketizer3.getInputStream());
- assertEquals(Test.MATCH, testSessionType, testPacketizer3.getSessionType());
- assertEquals(Test.MATCH, testSessionId, testPacketizer3.getSessionId());
- assertEquals(Test.MATCH, testWiproVersion, testPacketizer3.getWiproVersion());
- assertEquals(Test.MATCH, testRpcRequest.getFunctionName(), testPacketizer3.getRPCRequest().getFunctionName());
- assertEquals(Test.MATCH, testSdlSession, testPacketizer3.getSdlSession());
-
- // Invalid/Null Tests
- assertNull(Test.NULL, testPacketizer2.getListener());
- assertNull(Test.NULL, testPacketizer2.getInputStream());
- assertNull(Test.NULL, testPacketizer2.getSessionType());
-
- } catch (IOException e) {
- e.printStackTrace();
- fail("IOException was thrown.");
- }
- }
-}
-
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java
deleted file mode 100644
index 79fad2abb..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.smartdevicelink.test.streaming;
-
-import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This is a mock class for testing the following :
- * {@link com.smartdevicelink.streaming.AbstractPacketizer}
- */
-public class MockInterfaceBroker implements ISdlConnectionListener {
- public MockInterfaceBroker () { }
- @Override
- public void onTransportDisconnected(String info) {
-
- }
-
- @Override
- public void onTransportDisconnected(String info, boolean availablePrimary, MultiplexTransportConfig transportConfig) {
-
- }
-
- @Override
- public void onTransportError(String info, Exception e) {
-
- }
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
-
- }
- @Override
- public void onProtocolSessionStartedNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
-
- }
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID,
- boolean isEncrypted) {
-
- }
- @Override
- public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
- String correlationID) {
-
- }
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,
- byte sessionID, String correlationID) {
-
- }
- @Override
- public void onProtocolError(String info, Exception e) {
-
- }
- @Override
- public void onHeartbeatTimedOut(byte sessionID) {
-
- }
- @Override
- public void onProtocolServiceDataACK(SessionType sessionType, int dataSize,
- byte sessionID) {
-
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java
deleted file mode 100644
index 5f5bd6d2b..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java
+++ /dev/null
@@ -1,511 +0,0 @@
-package com.smartdevicelink.test.streaming;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
-import com.smartdevicelink.streaming.IStreamListener;
-import com.smartdevicelink.streaming.StreamPacketizer;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.streaming.StreamPacketizer}
- */
-public class StreamPacketizerTests extends TestCase {
-
- private static final byte WIPRO_VERSION = 0x0B;
- private static final byte SESSION_ID = 0x0A;
-
- private final byte[][] SAMPLE_H264_VIDEO_STREAM = {
- // one byte array represents a frame
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x67, 0x42, (byte)0xC0, 0x0A, (byte)0xA6, 0x11, 0x11, (byte)0xE8,
- 0x40, 0x00, 0x00, (byte)0xFA, 0x40, 0x00, 0x3A, (byte)0x98,
- 0x23, (byte)0xC4, (byte)0x89, (byte)0x84, 0x60,
- 0x00, 0x00, 0x00, 0x01,
- 0x68, (byte)0xC8, 0x42, 0x0F, 0x13, 0x20,
- 0x00, 0x00, 0x01,
- 0x65, (byte)0x88, (byte)0x82, 0x07, 0x67, 0x39, 0x31, 0x40,
- 0x00, 0x5E, 0x0A, (byte)0xFB, (byte)0xEF, (byte)0xAE, (byte)0xBA, (byte)0xEB,
- (byte)0xAE, (byte)0xBA, (byte)0xEB, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x1C, 0x0E, (byte)0xCE, 0x71, (byte)0xB0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x2A, 0x03, (byte)0xB3, (byte)0x9C, 0x6C},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x3B, 0x03, (byte)0xB3, (byte)0x9C, 0x6C},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x49, 0x00, (byte)0xEC, (byte)0xE7, 0x1B},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x59, 0x40, (byte)0xEC, (byte)0xE7, 0x1B},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x69, (byte)0x80, (byte)0xEC, (byte)0xE7, 0x1B},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x79, (byte)0xC0, (byte)0xEC, (byte)0xE7, 0x1B},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, (byte)0x88, (byte)0x80, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, (byte)0x98, (byte)0x90, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, (byte)0xA8, (byte)0xA0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, (byte)0xB8, (byte)0xB0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, (byte)0xC8, (byte)0xC0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, (byte)0xD8, (byte)0xD0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, (byte)0xE8, (byte)0xE0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, (byte)0xF8, (byte)0xF0, 0x3B, 0x39, (byte)0xC6, (byte)0xC0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, 0x00, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, 0x10, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, 0x20, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, 0x30, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, 0x40, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, 0x50, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, 0x60, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, 0x70, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, (byte)0x80, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, (byte)0x90, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, (byte)0xA0, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, (byte)0xB0, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, (byte)0xC0, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9B, (byte)0xD0, 0x1D, (byte)0x9C, (byte)0xE3, 0x60},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x67, 0x42, (byte)0xC0, 0x0A, (byte)0xA6, 0x11, 0x11, (byte)0xE8,
- 0x40, 0x00, 0x00, (byte)0xFA, 0x40, 0x00, 0x3A, (byte)0x98,
- 0x23, (byte)0xC4, (byte)0x89, (byte)0x84, 0x60,
- 0x00, 0x00, 0x00, 0x01,
- 0x68, (byte)0xC8, 0x42, 0x0F, 0x13, 0x20,
- 0x00, 0x00, 0x01,
- 0x65, (byte)0x88, (byte)0x81, 0x00, (byte)0x8E, 0x73, (byte)0x93, 0x14,
- 0x00, 0x06, (byte)0xA4, 0x2F, (byte)0xBE, (byte)0xFA, (byte)0xEB, (byte)0xAE,
- (byte)0xBA, (byte)0xEB, (byte)0xAE, (byte)0xBC},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x1C, 0x0D, (byte)0xCE, 0x71, (byte)0xB0},
- new byte[]{0x00, 0x00, 0x00, 0x01,
- 0x41, (byte)0x9A, 0x2A, 0x03, 0x33, (byte)0x9C, 0x6C},
- };
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.streaming.StreamPacketizer#StreamPacketizer(IStreamListener, InputStream, SessionType, byte)}
- */
- public void testConstructor () {
-
- // Test Values
- byte testSessionId = (byte) 0x0A;
- SessionType testSessionType = SessionType.RPC;
- InputStream testInputStream = null;
- byte testWiproVersion = (byte) 0x0B;
- IStreamListener testListener = new MockStreamListener();
- MockInterfaceBroker _interfaceBroker = new MockInterfaceBroker();
- BaseTransportConfig _transportConfig = new BTTransportConfig(true);
- SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,_interfaceBroker, _transportConfig);
- try {
- testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes()));
- StreamPacketizer testStreamPacketizer = new StreamPacketizer(testListener, testInputStream, testSessionType, testSessionId, testSdlSession);
- assertNotNull(Test.NOT_NULL, testStreamPacketizer);
-
- // NOTE: Cannot test thread handling methods currently.
-
- } catch (IOException e) {
- fail("IOException was thrown.");
- }
- }
-
- /**
- * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendFrame(byte[], int, int, long)}
- */
- public void testSendFrameInterfaceWithArray() {
- StreamReceiver mockReceiver = new StreamReceiver();
- SdlSession session = createTestSession();
- StreamPacketizer packetizer = null;
- try {
- packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
- } catch (IOException e) {
- fail();
- }
- MockVideoApp mockApp = new MockVideoApp(packetizer);
-
- try {
- packetizer.start();
- } catch (IOException e) {
- fail();
- }
-
- mockApp.inputByteStreamWithArray(SAMPLE_H264_VIDEO_STREAM);
- try {
- Thread.sleep(1000, 0);
- } catch (InterruptedException e) {}
-
- packetizer.stop();
- assertTrue(mockReceiver.verify(SAMPLE_H264_VIDEO_STREAM));
- }
-
- /**
- * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendFrame(byte[], int, int, long)}
- * with offset parameter
- */
- public void testSendFrameInterfaceWithArrayOffset() {
- StreamReceiver mockReceiver = new StreamReceiver();
- SdlSession session = createTestSession();
- StreamPacketizer packetizer = null;
- try {
- packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
- } catch (IOException e) {
- fail();
- }
- MockVideoApp mockApp = new MockVideoApp(packetizer);
-
- try {
- packetizer.start();
- } catch (IOException e) {
- fail();
- }
-
- mockApp.inputByteStreamWithArrayOffset(SAMPLE_H264_VIDEO_STREAM);
- try {
- Thread.sleep(1000, 0);
- } catch (InterruptedException e) {}
-
- packetizer.stop();
- assertTrue(mockReceiver.verify(SAMPLE_H264_VIDEO_STREAM));
- }
-
- /**
- * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendFrame(ByteBuffer, long)}
- */
- public void testSendFrameInterfaceWithByteBuffer() {
- StreamReceiver mockReceiver = new StreamReceiver();
- SdlSession session = createTestSession();
- StreamPacketizer packetizer = null;
- try {
- packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
- } catch (IOException e) {
- fail();
- }
- MockVideoApp mockApp = new MockVideoApp(packetizer);
-
- try {
- packetizer.start();
- } catch (IOException e) {
- fail();
- }
-
- mockApp.inputByteStreamWithByteBuffer(SAMPLE_H264_VIDEO_STREAM);
- try {
- Thread.sleep(1000, 0);
- } catch (InterruptedException e) {}
-
- packetizer.stop();
- assertTrue(mockReceiver.verify(SAMPLE_H264_VIDEO_STREAM));
- }
-
- /**
- * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendFrame(ByteBuffer, long)}
- * with direct ByteBuffer
- */
- public void testSendFrameInterfaceWithDirectByteBuffer() {
- StreamReceiver mockReceiver = new StreamReceiver();
- SdlSession session = createTestSession();
- StreamPacketizer packetizer = null;
- try {
- packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
- } catch (IOException e) {
- fail();
- }
- MockVideoApp mockApp = new MockVideoApp(packetizer);
-
- try {
- packetizer.start();
- } catch (IOException e) {
- fail();
- }
-
- mockApp.inputByteStreamWithDirectByteBuffer(SAMPLE_H264_VIDEO_STREAM);
- try {
- Thread.sleep(1000, 0);
- } catch (InterruptedException e) {}
-
- packetizer.stop();
- assertTrue(mockReceiver.verify(SAMPLE_H264_VIDEO_STREAM));
- }
-
- /**
- * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendAudio(byte[], int, int, long)}
- */
- public void testSendAudioInterfaceWithArray() {
- // assume 100 data of 16kHz / 16bits audio for 10 msecs
- int dataCount = 100;
- byte[][] sampleAudio = new byte[dataCount][];
- for (int i = 0; i < dataCount; i++) {
- sampleAudio[i] = new byte[4 * 160];
- Arrays.fill(sampleAudio[i], (byte)0);
- }
-
- StreamReceiver mockReceiver = new StreamReceiver();
- SdlSession session = createTestSession();
- StreamPacketizer packetizer = null;
- try {
- packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
- } catch (IOException e) {
- fail();
- }
- MockVideoApp mockApp = new MockVideoApp(packetizer);
-
- try {
- packetizer.start();
- } catch (IOException e) {
- fail();
- }
-
- mockApp.inputByteStreamWithArray(sampleAudio);
- try {
- Thread.sleep(1000, 0);
- } catch (InterruptedException e) {}
-
- packetizer.stop();
- assertTrue(mockReceiver.verify(sampleAudio));
- }
-
- /**
- * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendAudio(byte[], int, int, long)}
- */
- public void testSendAudioInterfaceWithArrayOffset() {
- // assume 100 data of 16kHz / 16bits audio for 10 msecs
- int dataCount = 100;
- byte[][] sampleAudio = new byte[dataCount][];
- for (int i = 0; i < dataCount; i++) {
- sampleAudio[i] = new byte[4 * 160];
- Arrays.fill(sampleAudio[i], (byte)0);
- }
-
- StreamReceiver mockReceiver = new StreamReceiver();
- SdlSession session = createTestSession();
- StreamPacketizer packetizer = null;
- try {
- packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
- } catch (IOException e) {
- fail();
- }
- MockVideoApp mockApp = new MockVideoApp(packetizer);
-
- try {
- packetizer.start();
- } catch (IOException e) {
- fail();
- }
-
- mockApp.inputByteStreamWithArrayOffset(sampleAudio);
- try {
- Thread.sleep(1000, 0);
- } catch (InterruptedException e) {}
-
- packetizer.stop();
- assertTrue(mockReceiver.verify(sampleAudio));
- }
-
- /**
- * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendAudio(ByteBuffer, long)}
- */
- public void testSendAudioInterfaceWithByteBuffer() {
- // assume 100 data of 16kHz / 16bits audio for 10 msecs
- int dataCount = 100;
- byte[][] sampleAudio = new byte[dataCount][];
- for (int i = 0; i < dataCount; i++) {
- sampleAudio[i] = new byte[4 * 160];
- Arrays.fill(sampleAudio[i], (byte)0);
- }
-
- StreamReceiver mockReceiver = new StreamReceiver();
- SdlSession session = createTestSession();
- StreamPacketizer packetizer = null;
- try {
- packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
- } catch (IOException e) {
- fail();
- }
- MockVideoApp mockApp = new MockVideoApp(packetizer);
-
- try {
- packetizer.start();
- } catch (IOException e) {
- fail();
- }
-
- mockApp.inputByteStreamWithByteBuffer(sampleAudio);
- try {
- Thread.sleep(1000, 0);
- } catch (InterruptedException e) {}
-
- packetizer.stop();
- assertTrue(mockReceiver.verify(sampleAudio));
- }
-
- /**
- * Test for {@link com.smartdevicelink.streaming.StreamPacketizer#sendAudio(ByteBuffer, long)}
- * with direct ByteBuffer
- */
- public void testSendAudioInterfaceWithDirectByteBuffer() {
- // assume 100 data of 16kHz / 16bits audio for 10 msecs
- int dataCount = 100;
- byte[][] sampleAudio = new byte[dataCount][];
- for (int i = 0; i < dataCount; i++) {
- sampleAudio[i] = new byte[4 * 160];
- Arrays.fill(sampleAudio[i], (byte)0);
- }
-
- StreamReceiver mockReceiver = new StreamReceiver();
- SdlSession session = createTestSession();
- StreamPacketizer packetizer = null;
- try {
- packetizer = new StreamPacketizer(mockReceiver, null, SessionType.NAV, SESSION_ID, session);
- } catch (IOException e) {
- fail();
- }
- MockVideoApp mockApp = new MockVideoApp(packetizer);
-
- try {
- packetizer.start();
- } catch (IOException e) {
- fail();
- }
-
- mockApp.inputByteStreamWithDirectByteBuffer(sampleAudio);
- try {
- Thread.sleep(1000, 0);
- } catch (InterruptedException e) {}
-
- packetizer.stop();
- assertTrue(mockReceiver.verify(sampleAudio));
- }
-
-
- private SdlSession createTestSession() {
- return SdlSession.createSession(WIPRO_VERSION, new MockInterfaceBroker(), new BTTransportConfig(true));
- }
-
- private class StreamReceiver implements IStreamListener {
- private ByteArrayOutputStream mReceiveBuffer;
-
- StreamReceiver() {
- mReceiveBuffer = new ByteArrayOutputStream();
- }
-
- @Override
- public void sendStreamPacket(ProtocolMessage pm) {
- try {
- mReceiveBuffer.write(pm.getData());
- } catch (IOException e) {
- fail();
- }
- }
-
- boolean verify(byte[][] expectedStream) {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- for (byte[] frame : expectedStream) {
- try {
- buffer.write(frame);
- } catch (IOException e) {
- fail();
- }
- }
- boolean result = Arrays.equals(buffer.toByteArray(), mReceiveBuffer.toByteArray());
- try {
- buffer.close();
- } catch (IOException e) {
- fail();
- }
- return result;
- }
- }
-
- private class MockVideoApp {
- private IVideoStreamListener mListener;
-
- MockVideoApp(IVideoStreamListener listener) {
- mListener = listener;
- }
-
- void inputByteStreamWithArray(byte[][] stream) {
- for (byte[] data : stream) {
- mListener.sendFrame(data, 0, data.length, -1);
- }
- }
-
- void inputByteStreamWithArrayOffset(byte[][] stream) {
- int dummyOffset = 0;
- for (byte[] data : stream) {
- // to test 'offset' param, create a buffer with a dummy offset
- byte[] buffer = new byte[dummyOffset + data.length];
- System.arraycopy(data, 0, buffer, dummyOffset, data.length);
-
- mListener.sendFrame(buffer, dummyOffset, data.length, -1);
- dummyOffset++;
- }
- }
-
- void inputByteStreamWithByteBuffer(byte[][] stream) {
- int dummyOffset = 0;
- for (byte[] data : stream) {
- // add a dummy offset inside byteBuffer for testing
- ByteBuffer byteBuffer = ByteBuffer.allocate(dummyOffset + data.length);
- byteBuffer.position(dummyOffset);
-
- byteBuffer.put(data);
- byteBuffer.flip();
- byteBuffer.position(dummyOffset);
-
- mListener.sendFrame(byteBuffer, -1);
- dummyOffset++;
- }
- }
-
- void inputByteStreamWithDirectByteBuffer(byte[][] stream) {
- int dummyOffset = 0;
- for (byte[] data : stream) {
- // add a dummy offset inside byteBuffer for testing
- ByteBuffer byteBuffer = ByteBuffer.allocateDirect(dummyOffset + data.length);
- byteBuffer.position(dummyOffset);
-
- byteBuffer.put(data);
- byteBuffer.flip();
- byteBuffer.position(dummyOffset);
-
- mListener.sendFrame(byteBuffer, -1);
- dummyOffset++;
- }
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java
deleted file mode 100644
index 0f72eec95..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.smartdevicelink.test.streaming;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.SdlProxyBase;
-import com.smartdevicelink.streaming.IStreamListener;
-import com.smartdevicelink.streaming.StreamRPCPacketizer;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.streaming.StreamRPCPacketizer}
- */
-public class StreamRPCPacketizerTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.streaming.StreamRPCPacketizer#StreamRPCPacketizer(SdlProxyBase, IStreamListener, InputStream, RPCRequest, SessionType, byte, byte, long, SdlSession)}
- */
- public void testConstructor () {
-
- // Test Values
- byte testSessionId = (byte) 0x0A;
- byte testWV = (byte) 0x0B;
- RPCRequest testRequest = new RPCRequest("test");
- SessionType testSessionType = SessionType.RPC;
- InputStream testInputStream = null;
- IStreamListener testListener = new MockStreamListener();
-
- byte testWiproVersion = (byte) 0x0B;
- MockInterfaceBroker _interfaceBroker = new MockInterfaceBroker();
- BaseTransportConfig _transportConfig = new BTTransportConfig(true);
- SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,_interfaceBroker, _transportConfig);
- try {
- testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes()));
- StreamRPCPacketizer testStreamRpcPacketizer = new StreamRPCPacketizer(null, testListener, testInputStream, testRequest, testSessionType, testSessionId, testWV, testWV, testSdlSession);
- assertNotNull(Test.NOT_NULL, testStreamRpcPacketizer);
-
- // NOTE: Cannot test thread handling methods currently.
-
- } catch (IOException e) {
- fail("IOException was thrown.");
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java
deleted file mode 100644
index a39e87393..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.smartdevicelink.test.trace;
-
-import java.io.UnsupportedEncodingException;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.trace.Mime;
-
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.trace.Mime}
- */
-public class MimeTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.trace.Mime#base64Encode(byte[])}
- * {@link com.smartdevicelink.trace.Mime#base64Encode(String)}
- * {@link com.smartdevicelink.trace.Mime#base64Encode(byte[], int, int)}
- */
- public void testEncoding () {
-
- try {
- // Test Values
- String testString = "test";
- byte[] testBytes = testString.getBytes("US-ASCII");
-
- // Comparison Values
- String expectedEncodedString = "dGVzdA==";
- String actualNullResult1 = Mime.base64Encode((byte[]) null);
- String actualNullResult2 = Mime.base64Encode((String) null);
- String actualNullResult3 = Mime.base64Encode(null, 0, 0);
- String actualInvalidResult = Mime.base64Encode(testBytes, 35, 2);
- String actualEncodedString1 = Mime.base64Encode(testString);
- String actualEncodedString2 = Mime.base64Encode(testBytes);
- String actualEncodedString3 = Mime.base64Encode(testBytes, 0, testBytes.length);
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString1);
- assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString2);
- assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString3);
-
- // Invalid/Null Tests
- assertNull(Test.NULL, actualNullResult1);
- assertNull(Test.NULL, actualNullResult2);
- assertNull(Test.NULL, actualNullResult3);
- assertNull(Test.NULL, actualInvalidResult);
-
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java
deleted file mode 100644
index 8cec7f332..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package com.smartdevicelink.test.trace;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.trace.DiagLevel;
-import com.smartdevicelink.trace.SdlTrace;
-import com.smartdevicelink.trace.enums.DetailLevel;
-import com.smartdevicelink.trace.enums.Mod;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.trace.SdlTrace}
- */
-public class SdlTraceTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.trace.SdlTrace#setAcceptAPITraceAdjustments(Boolean)}
- * {@link com.smartdevicelink.trace.SdlTrace#getAcceptAPITraceAdjustments()}
- */
- public void testAdjustmentFlags () {
-
- SdlTrace.setAcceptAPITraceAdjustments(true);
- assertTrue(Test.TRUE, SdlTrace.getAcceptAPITraceAdjustments());
-
- SdlTrace.setAcceptAPITraceAdjustments(false);
- assertFalse(Test.FALSE, SdlTrace.getAcceptAPITraceAdjustments());
-
- // This should not change the value from the previous setting.
- SdlTrace.setAcceptAPITraceAdjustments(null);
- assertFalse(Test.FALSE, SdlTrace.getAcceptAPITraceAdjustments());
- }
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.trace.SdlTrace#setAppTraceLevel(DetailLevel)}
- * {@link com.smartdevicelink.trace.SdlTrace#setProxyTraceLevel(DetailLevel)}
- * {@link com.smartdevicelink.trace.SdlTrace#setRpcTraceLevel(DetailLevel)}
- * {@link com.smartdevicelink.trace.SdlTrace#setMarshallingTraceLevel(DetailLevel)}
- * {@link com.smartdevicelink.trace.SdlTrace#setProtocolTraceLevel(DetailLevel)}
- * {@link com.smartdevicelink.trace.SdlTrace#setTransportTraceLevel(DetailLevel)}
- */
- public void testTraceLevelFlags () {
-
- SdlTrace.setAcceptAPITraceAdjustments(true);
-
- // App Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - - -
- SdlTrace.setAppTraceLevel(DetailLevel.VERBOSE);
- assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.app));
- SdlTrace.setAppTraceLevel(DetailLevel.TERSE);
- assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.app));
- SdlTrace.setAppTraceLevel(DetailLevel.OFF);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.app));
-
- // This should not change the value from the previous setting.
- SdlTrace.setAppTraceLevel(null);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.app));
-
- // Proxy Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - -
- SdlTrace.setProxyTraceLevel(DetailLevel.VERBOSE);
- assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.proxy));
- SdlTrace.setProxyTraceLevel(DetailLevel.TERSE);
- assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.proxy));
- SdlTrace.setProxyTraceLevel(DetailLevel.OFF);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proxy));
-
- // This should not change the value from the previous setting.
- SdlTrace.setProxyTraceLevel(null);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proxy));
-
- // Rpc Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - - -
- SdlTrace.setRpcTraceLevel(DetailLevel.VERBOSE);
- assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.rpc));
- SdlTrace.setRpcTraceLevel(DetailLevel.TERSE);
- assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.rpc));
- SdlTrace.setRpcTraceLevel(DetailLevel.OFF);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.rpc));
-
- // This should not change the value from the previous setting.
- SdlTrace.setRpcTraceLevel(null);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.rpc));
-
- // Marshalling Trace Level - - - - - - - - - - - - - - - - - - - - - - -
- SdlTrace.setMarshallingTraceLevel(DetailLevel.VERBOSE);
- assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.mar));
- SdlTrace.setMarshallingTraceLevel(DetailLevel.TERSE);
- assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.mar));
- SdlTrace.setMarshallingTraceLevel(DetailLevel.OFF);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.mar));
-
- // This should not change the value from the previous setting.
- SdlTrace.setMarshallingTraceLevel(null);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.mar));
-
- // Protocol Trace Level - - - - - - - - - - - - - - - - - - - - - - - -
- SdlTrace.setProtocolTraceLevel(DetailLevel.VERBOSE);
- assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.proto));
- SdlTrace.setProtocolTraceLevel(DetailLevel.TERSE);
- assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.proto));
- SdlTrace.setProtocolTraceLevel(DetailLevel.OFF);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proto));
-
- // This should not change the value from the previous setting.
- SdlTrace.setProtocolTraceLevel(null);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proto));
-
- // Transport Trace Level - - - - - - - - - - - - - - - - - - - - - - - -
- SdlTrace.setTransportTraceLevel(DetailLevel.VERBOSE);
- assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.tran));
- SdlTrace.setTransportTraceLevel(DetailLevel.TERSE);
- assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.tran));
- SdlTrace.setTransportTraceLevel(DetailLevel.OFF);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.tran));
-
- // This should not change the value from the previous setting.
- SdlTrace.setTransportTraceLevel(null);
- assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.tran));
- }
-
- // NOTE : No testing can currently be done for the logging methods.
-
- // NOTE : Cannot test for Bluetooth connected information currently.
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java
deleted file mode 100644
index 615f0af4c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.smartdevicelink.test.trace.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.trace.enums.DetailLevel;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.trace.enums.DetailLevel}
- */
-public class DetailLevelTests extends TestCase {
-
- /**
- * This is a unit test for the following enum :
- * {@link com.smartdevicelink.trace.enums.DetailLevel}
- */
- public void testDetailLevelEnum () {
-
- // Test Values
- String testOff = "OFF";
- String testTerse = "TERSE";
- String testInvalid = "INVALID";
- String testVerbose = "VERBOSE";
-
- try {
- // Comparison Values
- DetailLevel expectedOffEnum = DetailLevel.OFF;
- DetailLevel expectedTerseEnum = DetailLevel.TERSE;
- DetailLevel expectedVerboseEnum = DetailLevel.VERBOSE;
- List<DetailLevel> expectedEnumList = new ArrayList<DetailLevel>();
- expectedEnumList.add(DetailLevel.OFF);
- expectedEnumList.add(DetailLevel.TERSE);
- expectedEnumList.add(DetailLevel.VERBOSE);
-
- DetailLevel actualNullEnum = DetailLevel.valueForString(null);
- DetailLevel actualOffEnum = DetailLevel.valueForString(testOff);
- DetailLevel actualTerseEnum = DetailLevel.valueForString(testTerse);
- DetailLevel actualInvalidEnum = DetailLevel.valueForString(testInvalid);
- DetailLevel actualVerboseEnum = DetailLevel.valueForString(testVerbose);
- List<DetailLevel> actualEnumList = Arrays.asList(DetailLevel.values());
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedOffEnum, actualOffEnum);
- assertEquals(Test.MATCH, expectedTerseEnum, actualTerseEnum);
- assertEquals(Test.MATCH, expectedVerboseEnum, actualVerboseEnum);
- assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
-
- // Invalid/Null Tests
- assertNull(Test.NULL, actualInvalidEnum);
- assertNull(Test.NULL, actualNullEnum);
-
- }catch (NullPointerException e) {
- fail("Could not retrieve value for null string, should return null.");
- } catch (IllegalArgumentException e) {
- fail("Could not retrieve value for invalid string, should return null.");
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java
deleted file mode 100644
index 4086788e6..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.smartdevicelink.test.trace.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.trace.enums.InterfaceActivityDirection}
- */
-public class InterfaceActivityDirectionTests extends TestCase {
-
- /**
- * This is a unit test for the following enum :
- * {@link com.smartdevicelink.trace.enums.InterfaceActivityDirection}
- */
- public void testInterfaceActivityDirectionEnum () {
-
- // Test Values
- String testNone = "None";
- String testInvalid = "Invalid";
- String testReceive = "Receive";
- String testTransmit = "Transmit";
-
- try {
- // Comparison Values
- InterfaceActivityDirection expectedNoneEnum = InterfaceActivityDirection.None;
- InterfaceActivityDirection expectedReceiveEnum = InterfaceActivityDirection.Receive;
- InterfaceActivityDirection expectedTransmitEnum = InterfaceActivityDirection.Transmit;
- List<InterfaceActivityDirection> expectedEnumList = new ArrayList<InterfaceActivityDirection>();
- expectedEnumList.add(InterfaceActivityDirection.None);
- expectedEnumList.add(InterfaceActivityDirection.Receive);
- expectedEnumList.add(InterfaceActivityDirection.Transmit);
-
- InterfaceActivityDirection actualNullEnum = InterfaceActivityDirection.valueForString(null);
- InterfaceActivityDirection actualNoneEnum = InterfaceActivityDirection.valueForString(testNone);
- InterfaceActivityDirection actualInvalidEnum = InterfaceActivityDirection.valueForString(testInvalid);
- InterfaceActivityDirection actualReceiveEnum = InterfaceActivityDirection.valueForString(testReceive);
- InterfaceActivityDirection actualTransmitEnum = InterfaceActivityDirection.valueForString(testTransmit);
- List<InterfaceActivityDirection> actualEnumList = Arrays.asList(InterfaceActivityDirection.values());
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedNoneEnum, actualNoneEnum);
- assertEquals(Test.MATCH, expectedReceiveEnum, actualReceiveEnum);
- assertEquals(Test.MATCH, expectedTransmitEnum, actualTransmitEnum);
- assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
-
- // Invalid/Null
- assertNull(Test.NULL, actualInvalidEnum);
- assertNull(Test.NULL, actualNullEnum);
-
- } catch (NullPointerException e) {
- fail("Could not retrieve value for null string, should return null.");
- } catch (IllegalArgumentException e) {
- fail("Could not retrieve value for invalid string, should return null.");
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java
deleted file mode 100644
index 917960506..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.test.trace.enums;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.trace.enums.Mod;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.trace.enums.Mod}
- */
-public class ModTests extends TestCase {
-
- /**
- * This is a unit test for the following enum :
- * {@link com.smartdevicelink.trace.enums.Mod}
- */
- public void testModEnum () {
-
- // TestValues
- String testApp = "app";
- String testRpc = "rpc";
- String testMar = "mar";
- String testTran = "tran";
- String testProto = "proto";
- String testProxy = "proxy";
- String testInvalid = "invalid";
-
- try {
- // Comparison Values
- Mod expectedAppEnum = Mod.app;
- Mod expectedRpcEnum = Mod.rpc;
- Mod expectedMarEnum = Mod.mar;
- Mod expectedTranEnum = Mod.tran;
- Mod expectedProtoEnum = Mod.proto;
- Mod expectedProxyEnum = Mod.proxy;
- List<Mod> expectedEnumList = new ArrayList<Mod>();
- expectedEnumList.add(Mod.app);
- expectedEnumList.add(Mod.rpc);
- expectedEnumList.add(Mod.mar);
- expectedEnumList.add(Mod.tran);
- expectedEnumList.add(Mod.proto);
- expectedEnumList.add(Mod.proxy);
-
- Mod actualNullEnum = Mod.valueForString(null);
- Mod actualAppEnum = Mod.valueForString(testApp);
- Mod actualRpcEnum = Mod.valueForString(testRpc);
- Mod actualMarEnum = Mod.valueForString(testMar);
- Mod actualTranEnum = Mod.valueForString(testTran);
- Mod actualProtoEnum = Mod.valueForString(testProto);
- Mod actualProxyEnum = Mod.valueForString(testProxy);
- Mod actualInvalidEnum = Mod.valueForString(testInvalid);
- List<Mod> actualEnumList = Arrays.asList(Mod.values());
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedAppEnum, actualAppEnum);
- assertEquals(Test.MATCH, expectedRpcEnum, actualRpcEnum);
- assertEquals(Test.MATCH, expectedMarEnum, actualMarEnum);
- assertEquals(Test.MATCH, expectedTranEnum, actualTranEnum);
- assertEquals(Test.MATCH, expectedProtoEnum, actualProtoEnum);
- assertEquals(Test.MATCH, expectedProxyEnum, actualProxyEnum);
- assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
-
- // Invalid/Null Tests
- assertNull(Test.NULL, actualInvalidEnum);
- assertNull(Test.NULL, actualNullEnum);
-
- } catch (NullPointerException e) {
- fail("Could not retrieve value for null string, should return null.");
- } catch (IllegalArgumentException e) {
- fail("Could not retrieve value for invalid string, should return null.");
- }
-
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java
deleted file mode 100644
index 11b6ab39f..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.smartdevicelink.test.transport;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.transport.BtTransportConfig}
- */
-public class BTTransportConfigTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.transport.BtTransportConfig#getTransportType()}
- * {@link com.smartdevicelink.transport.BtTransportConfig#setKeepSocketActive(boolean)}
- * {@link com.smartdevicelink.transport.BtTransportConfig#getKeepSocketActive}
- */
- public void testConfigs () {
-
- // Test Values
- boolean testBoolean = true;
- BTTransportConfig testConfig1 = new BTTransportConfig();
- BTTransportConfig testConfig2 = new BTTransportConfig(testBoolean);
-
- // Comparison Values
- TransportType expectedTransportType = TransportType.BLUETOOTH;
- boolean actualShareConnection = testConfig2.shareConnection();
- TransportType actualTransportType = testConfig1.getTransportType();
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedTransportType, actualTransportType);
- assertTrue(Test.TRUE, actualShareConnection);
-
-
- testConfig1.setKeepSocketActive(true);
- assertTrue(Test.TRUE, testConfig1.getKeepSocketActive());
- testConfig1.setKeepSocketActive(false);
- assertFalse(Test.FALSE, testConfig1.getKeepSocketActive());
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java
deleted file mode 100644
index c23b820eb..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.smartdevicelink.test.transport;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.transport.BaseTransportConfig}
- */
-public class BaseTransportConfigTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.transport.BaseTransportConfig#getTransportType()}
- * {@link com.smartdevicelink.transport.BaseTransportConfig#shareConnection()}
- * {@link com.smartdevicelink.transport.BaseTransportConfig#getHeartBeatTimeout()}
- * {@link com.smartdevicelink.transport.BaseTransportConfig#setHeartBeatTimeout(int)}
- */
- public void testConfigs () {
-
- // Test Values
- int testInt = 10;
- MockBaseTransportConfig testBaseTransportConfig = new MockBaseTransportConfig();
-
- // Comparison Values
- int expectedMaxValue = Integer.MAX_VALUE;
- boolean actualShareConnection = testBaseTransportConfig.shareConnection();
- int actualMaxValue = testBaseTransportConfig.getHeartBeatTimeout();
-
- // Valid Tests
- assertNotNull(Test.NOT_NULL, testBaseTransportConfig);
- assertEquals(Test.MATCH, expectedMaxValue, actualMaxValue);
- assertTrue(Test.TRUE, actualShareConnection);
-
- testBaseTransportConfig.setHeartBeatTimeout(testInt);
- assertEquals(Test.MATCH, testInt, testBaseTransportConfig.getHeartBeatTimeout());
- }
-}
-
-/**
- * This is a mock class for testing the following :
- * {@link com.smartdevicelink.transport.BaseTransportConfig}
- */
-class MockBaseTransportConfig extends BaseTransportConfig {
- public MockBaseTransportConfig () { }
- @Override public TransportType getTransportType() { return null; }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java
deleted file mode 100644
index fe61af6f1..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.test.transport;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.SdlPsm;
-import com.smartdevicelink.protocol.WiProProtocol;
-
-import android.util.Log;
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.transport.SdlPsm}
- */
-public class SdlPsmTests extends TestCase {
- private static final String TAG = "SdlPsmTests";
- private static final int MAX_DATA_LENGTH = WiProProtocol.V1_V2_MTU_SIZE - WiProProtocol.V1_HEADER_SIZE;
- SdlPsm sdlPsm;
- Field frameType, dataLength, version, controlFrameInfo;
- Method transitionOnInput;
- byte rawByte = (byte) 0x0;
-
- protected void setUp() throws Exception{
- super.setUp();
- sdlPsm = new SdlPsm();
- transitionOnInput = SdlPsm.class.getDeclaredMethod("transitionOnInput", byte.class, int.class);
- transitionOnInput.setAccessible(true);
-
- frameType = SdlPsm.class.getDeclaredField("frameType");
- dataLength = SdlPsm.class.getDeclaredField("dataLength");
- version = SdlPsm.class.getDeclaredField("version");
- controlFrameInfo = SdlPsm.class.getDeclaredField("controlFrameInfo");
- frameType.setAccessible(true);
- dataLength.setAccessible(true);
- version.setAccessible(true);
- controlFrameInfo.setAccessible(true);
- }
-
- /**
- * These are unit tests for the following methods :
- * {@link com.smartdevicelink.transport.SdlPsm#transitionOnInput()}
- */
-
- public void testGarbledControlFrame() {
- try{
- rawByte = 0x0;
- version.set(sdlPsm, 1);
- controlFrameInfo.set(sdlPsm, SdlPacket.FRAME_INFO_START_SERVICE);
- frameType.set(sdlPsm, SdlPacket.FRAME_TYPE_CONTROL);
-
- dataLength.set(sdlPsm, MAX_DATA_LENGTH + 1);
- int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE);
-
- assertEquals(Test.MATCH, SdlPsm.ERROR_STATE, STATE);
- }catch (Exception e){
- Log.e(TAG, e.toString());
- }
- }
-
- public void testMaximumControlFrame(){
- try{
- rawByte = 0x0;
- version.set(sdlPsm, 1);
- controlFrameInfo.set(sdlPsm, SdlPacket.FRAME_INFO_START_SERVICE);
- frameType.set(sdlPsm, SdlPacket.FRAME_TYPE_CONTROL);
-
- dataLength.set(sdlPsm, MAX_DATA_LENGTH);
- int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE);
-
- assertEquals(Test.MATCH, SdlPsm.DATA_PUMP_STATE, STATE);
- }catch (Exception e){
- Log.e(TAG, e.toString());
- }
- }
-
- public void testOutOfMemoryDS4(){
- try{
- rawByte = 0x0;
- version.set(sdlPsm, 1);
- frameType.set(sdlPsm, SdlPacket.FRAME_TYPE_SINGLE);
-
- dataLength.set(sdlPsm, 2147483647);
- int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE);
-
- assertEquals(Test.MATCH, SdlPsm.ERROR_STATE, STATE);
- }catch (Exception e){
- Log.e(TAG, e.toString());
- }
- }
-
- protected void tearDown() throws Exception{
- super.tearDown();
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java
deleted file mode 100644
index 7e3b894e5..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.test.transport;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.transport.enums.TransportType;
-
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.transport.TransportType}
- */
-public class TransportTypeTests extends TestCase {
-
- /**
- * This is a unit test for the following enum :
- * {@link com.smartdevicelink.transport.TransportType}
- */
- public void testTransportTypeEnum () {
-
- // Test Values
- String testTcp = "TCP";
- String testUsb = "USB";
- String testInvalid = "INVALID";
- String testBluetooth = "BLUETOOTH";
- String testMultiplexing = "MULTIPLEX";
-
- try {
- // Comparison Values
- TransportType expectedTcpEnum = TransportType.TCP;
- TransportType expectedUsbEnum = TransportType.USB;
- TransportType expectedBluetoothEnum = TransportType.BLUETOOTH;
- TransportType expectedMultiplexingEnum = TransportType.MULTIPLEX;
-
- List<TransportType> expectedEnumList = new ArrayList<TransportType>();
- expectedEnumList.add(TransportType.BLUETOOTH);
- expectedEnumList.add(TransportType.TCP);
- expectedEnumList.add(TransportType.USB);
- expectedEnumList.add(TransportType.MULTIPLEX);
-
- TransportType actualNullEnum = TransportType.valueForString(null);
- TransportType actualTcpEnum = TransportType.valueForString(testTcp);
- TransportType actualUsbEnum = TransportType.valueForString(testUsb);
- TransportType actualInvalidEnum = TransportType.valueForString(testInvalid);
- TransportType actualBluetoothEnum = TransportType.valueForString(testBluetooth);
- TransportType actualMultiplexingEnum = TransportType.valueForString(testMultiplexing);
-
- List<TransportType> actualEnumList = Arrays.asList(TransportType.values());
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedTcpEnum, actualTcpEnum);
- assertEquals(Test.MATCH, expectedUsbEnum, actualUsbEnum);
- assertEquals(Test.MATCH, expectedBluetoothEnum, actualBluetoothEnum);
- assertEquals(Test.MATCH, expectedMultiplexingEnum, actualMultiplexingEnum);
- assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
-
- // Invalid/Null Tests
- assertNull(Test.NULL, actualInvalidEnum);
- assertNull(Test.NULL, actualNullEnum);
-
- } catch (NullPointerException e) {
- fail("Could not retrieve value for null string, should return null.");
- } catch (IllegalArgumentException e) {
- fail("Could not retrieve value for invalid string, should return null.");
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java
deleted file mode 100644
index 7dcb1b3e8..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package com.smartdevicelink.test.util;
-
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.util.ByteEnumer;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.util.ByteEnumer}
- */
-public class ByteEnumerTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.util.ByteEnumer#value()}
- * {@link com.smartdevicelink.util.ByteEnumer#getValue()}
- * {@link com.smartdevicelink.util.ByteEnumer#getName()}
- * {@link com.smartdevicelink.util.ByteEnumer#equals(ByteEnumer)}
- * {@link com.smartdevicelink.util.ByteEnumer#eq(ByteEnumer)}
- */
- public void testStoredValues () {
-
- // Test Values
- byte testByte = (byte) 0x01;
- String testString = "test";
- MockByteEnumer testObject = new MockByteEnumer(testByte, null);
-
- // Comparison Values
- MockByteEnumer expectedObject = new MockByteEnumer(testByte, testString);
- MockByteEnumer actualObject = new MockByteEnumer(testByte, testString);
- byte actualByte1 = expectedObject.getValue();
- byte actualByte2 = expectedObject.value();
- String actualString = expectedObject.getName();
- String actualNullString = testObject.getName();
-
- // Valid Tests
- assertNotNull(Test.NOT_NULL, expectedObject);
- assertEquals(Test.MATCH, testByte, actualByte1);
- assertEquals(Test.MATCH, testByte, actualByte2);
- assertEquals(Test.MATCH, testString, actualString);
- assertTrue(Test.TRUE, actualObject.equals(expectedObject));
- assertTrue(Test.TRUE, actualObject.eq(expectedObject));
-
- // Invalid/Null Tests
- assertNull(Test.NULL, actualNullString);
- }
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.util.ByteEnumer#get(Vector, byte)}
- * {@link com.smartdevicelink.util.ByteEnumer#get(Vector, String)}
- */
- public void testSearchMethods () {
-
- // Test Values
- byte testByte1 = (byte) 0x01;
- byte testByte2 = (byte) 0x02;
- String testString1 = "test_1";
- String testString2 = "test_2";
- Vector<ByteEnumer> testList = new Vector<ByteEnumer>();
- Vector<String> testInvalidList = new Vector<String>();
-
- // Comparison Values
- MockByteEnumer expectedObject1 = new MockByteEnumer(testByte1, testString1);
- MockByteEnumer expectedObject2 = new MockByteEnumer(testByte2, testString2);
-
- testList.add(expectedObject1);
- testList.add(expectedObject2);
- testInvalidList.add(testString1);
- testInvalidList.add(testString2);
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedObject1, ByteEnumer.get(testList, testByte1));
- assertEquals(Test.MATCH, expectedObject1, ByteEnumer.get(testList, testString1));
- assertEquals(Test.MATCH, expectedObject2, ByteEnumer.get(testList, testByte2));
- assertEquals(Test.MATCH, expectedObject2, ByteEnumer.get(testList, testString2));
-
- // Invalid/Null Tests
- assertNull(Test.NULL, ByteEnumer.get(testList, null));
- assertNull(Test.NULL, ByteEnumer.get(testInvalidList, testByte1));
- assertNull(Test.NULL, ByteEnumer.get(testInvalidList, testString1));
- }
-}
-
-/**
- * This is a mock class for testing the following :
- * {@link com.smartdevicelink.util.ByteEnumer}
- */
-class MockByteEnumer extends ByteEnumer {
- protected MockByteEnumer(byte value, String name) {
- super(value, name);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java
deleted file mode 100644
index e694a6747..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.smartdevicelink.test.util;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.util.DebugTool;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.util.DebugTool}
- */
-public class DebugToolTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.util.DebugTool#enableDebugTool()}
- * {@link com.smartdevicelink.util.DebugTool#disableDebugTool()}
- * {@link com.smartdevicelink.util.DebugTool#isDebugEnabled()}
- */
- public void testDebugEnableMethods () {
- DebugTool.enableDebugTool();
- assertTrue(Test.TRUE, DebugTool.isDebugEnabled());
- DebugTool.disableDebugTool();
- assertFalse(Test.FALSE, DebugTool.isDebugEnabled());
- }
-
- // NOTE : No testing can currently be done for the logging methods.
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java
deleted file mode 100644
index fd09c6d76..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.smartdevicelink.test.util;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.util.NativeLogTool;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.util.NativeLogTool}
- */
-public class NativeLogToolTests extends TestCase {
-
- /**
- * This is a unit test for the following enum :
- * {@link com.smartdevicelink.util.NativeLogTool.LogTarget}
- */
- public void testLogTargetEnum () {
-
- // Test Values
- String testInfo = "Info";
- String testError = "Error";
- String testInvalid = "Invalid";
- String testWarning = "Warning";
-
- try {
- // Comparison Values
- NativeLogTool.LogTarget expectedInfoEnum = NativeLogTool.LogTarget.Info;
- NativeLogTool.LogTarget expectedErrorEnum = NativeLogTool.LogTarget.Error;
- NativeLogTool.LogTarget expectedWarningEnum = NativeLogTool.LogTarget.Warning;
- List<NativeLogTool.LogTarget> expectedEnumList = new ArrayList<NativeLogTool.LogTarget>();
- expectedEnumList.add(NativeLogTool.LogTarget.Info);
- expectedEnumList.add(NativeLogTool.LogTarget.Error);
- expectedEnumList.add(NativeLogTool.LogTarget.Warning);
-
- NativeLogTool.LogTarget actualNullEnum = NativeLogTool.LogTarget.valueForString(null);
- NativeLogTool.LogTarget actualInfoEnum = NativeLogTool.LogTarget.valueForString(testInfo);
- NativeLogTool.LogTarget actualErrorEnum = NativeLogTool.LogTarget.valueForString(testError);
- NativeLogTool.LogTarget actualInvalidEnum = NativeLogTool.LogTarget.valueForString(testInvalid);
- NativeLogTool.LogTarget actualWarningEnum = NativeLogTool.LogTarget.valueForString(testWarning);
- List<NativeLogTool.LogTarget> actualEnumList = Arrays.asList(NativeLogTool.LogTarget.values());
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedInfoEnum, actualInfoEnum);
- assertEquals(Test.MATCH, expectedErrorEnum, actualErrorEnum);
- assertEquals(Test.MATCH, expectedWarningEnum, actualWarningEnum);
- assertTrue("Contents should match.", expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList));
-
- // Invalid/Null Tests
- assertNull(Test.NULL, actualInvalidEnum);
- assertNull(Test.NULL, actualNullEnum);
-
- } catch (NullPointerException e) {
- fail("Could not retrieve value for null string, should return null.");
- } catch (IllegalArgumentException e) {
- fail("Could not retrieve value for invalid string, should return null.");
- }
- }
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.util.NativeLogTool#setEnableState(boolean)}
- * {@link com.smartdevicelink.util.NativeLogTool#getEnableState()}
- */
- public void testEnabled () {
- NativeLogTool.setEnableState(false);
- assertFalse("Value should be false.", NativeLogTool.isEnabled());
- NativeLogTool.setEnableState(true);
- assertTrue("Valueshould be true.", NativeLogTool.isEnabled());
- }
-
- // NOTE : No testing can currently be done for the logging methods.
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java
deleted file mode 100644
index b39c405d5..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.test.util;
-
-import junit.framework.TestCase;
-
-import com.smartdevicelink.test.Test;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.util.SdlDataTypeConverter}
- */
-public class SdlDataTypeConverterTests extends TestCase {
-
- /**
- * This is a unit test for the following method :
- * {@link com.smartdevicelink.util.SdlDataTypeConverter#objectToDouble(Object)}
- */
- public void testObjectToDouble () {
-
- // Test Values
- Long testLong = Long.valueOf(1);
- Short testShort = 1;
- Float testFloat = 1f;
- Double testDouble = 1.0;
- Integer testInteger = 1;
-
- // Comparison Values
- Double expectedValue = 1.0;
- Double actualNullValue = SdlDataTypeConverter.objectToDouble(null);
- Double actualLongValue = SdlDataTypeConverter.objectToDouble(testLong);
- Double actualShortValue = SdlDataTypeConverter.objectToDouble(testShort);
- Double actualFloatValue = SdlDataTypeConverter.objectToDouble(testFloat);
- Double actualDoubleValue = SdlDataTypeConverter.objectToDouble(testDouble);
- Double actualIntegerValue = SdlDataTypeConverter.objectToDouble(testInteger);
-
- // Valid Tests
- assertEquals(Test.MATCH, expectedValue, actualDoubleValue);
- assertEquals(Test.MATCH, expectedValue, actualIntegerValue);
- assertEquals(Test.MATCH, expectedValue, actualFloatValue);
-
- // Null Tests
- assertNull(Test.NULL, actualNullValue);
- assertNull(Test.NULL, actualLongValue);
- assertNull(Test.NULL, actualShortValue);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java
deleted file mode 100644
index c715bb62c..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.smartdevicelink.test.utl;
-
-import junit.framework.Assert;
-import android.content.ComponentName;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.util.AndroidTools;
-
-public class AndroidToolsTests extends AndroidTestCase2 {
-
-
- public void testIsServiceExportedNormal(){
-
- try{
- AndroidTools.isServiceExported(mContext, new ComponentName(mContext, "test"));
- }catch(Exception e){
- Assert.fail("Exception during normal test: " + e.getMessage());
- }
-
- }
- public void testIsServiceExportedNull(){
-
- try{
- AndroidTools.isServiceExported(mContext, null);
- Assert.fail("Proccessed null data");
- }catch(Exception e){
-
- }
-
- }
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java b/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java
deleted file mode 100644
index b19a0c6ce..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java
+++ /dev/null
@@ -1,432 +0,0 @@
-package com.smartdevicelink.transport;
-
-import android.app.ActivityManager;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.util.Log;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.transport.RouterServiceValidator.TrustedAppStore;
-import com.smartdevicelink.util.HttpRequestTask.HttpRequestTaskCallback;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.concurrent.Semaphore;
-
-public class RSVTestCase extends AndroidTestCase2 {
- private static final String TAG = "RSVTestCase";
-
- private static final long REFRESH_TRUSTED_APP_LIST_TIME_DAY = 3600000 * 24; // A day in ms
- private static final long REFRESH_TRUSTED_APP_LIST_TIME_WEEK = REFRESH_TRUSTED_APP_LIST_TIME_DAY * 7; // A week in ms
- private static final long REFRESH_TRUSTED_APP_LIST_TIME_MONTH = REFRESH_TRUSTED_APP_LIST_TIME_DAY * 30; // A ~month in ms
- private static final String TEST = "{\"response\": {\"com.livio.sdl\" : { \"versionBlacklist\":[] }, \"com.lexus.tcapp\" : { \"versionBlacklist\":[] }, \"com.toyota.tcapp\" : { \"versionBlacklist\": [] } , \"com.sdl.router\":{\"versionBlacklist\": [] },\"com.ford.fordpass\" : { \"versionBlacklist\":[] } }}";
- RouterServiceValidator rsvp;
- /**
- * Set this boolean if you want to test the actual validation of router service
- */
- boolean liveTest = false;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- rsvp = new RouterServiceValidator(this.mContext);
-
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- private static final Semaphore TRUSTED_LIST_LOCK = new Semaphore(1);
-
- private void requestTListLock(){
- try {
- TRUSTED_LIST_LOCK.acquire();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- private void releaseTListLock(){
- TRUSTED_LIST_LOCK.release();
- }
-
- private RouterServiceValidator.TrustedListCallback trustedListCallback = new RouterServiceValidator.TrustedListCallback(){
- @Override
- public void onListObtained(boolean successful) {
- releaseTListLock();
- }
- };
-
-/*
- * These tests are a little strange because they don't test the logic behind the validation of each piece.
- * However, they allow us to test
- */
-
- public void testInstalledFrom(){
- if(liveTest){
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
- assertTrue(rsvp.validate());
- }
- }
-
- public void testPackageCheck(){
- if(liveTest){
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_PACKAGE_CHECK);
- assertTrue(rsvp.validate());
- }
- }
-
- public void testVersionCheck(){
- if(liveTest){
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
- assertTrue(rsvp.validate());
- }
- }
-
- public void testNoFlags(){
- if(liveTest){
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE);
- assertTrue(rsvp.validate());
- }
- }
-
- public void testAllFlags(){
- if(liveTest){
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_PERFORM_ALL_CHECKS);
- assertTrue(rsvp.validate());
- }
- }
-
- public void testSecuritySetting(){
-
- RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
- rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
-
- try{
- Field securityLevelField = RouterServiceValidator.class.getDeclaredField("securityLevel");
- securityLevelField.setAccessible(true);
- assertEquals(securityLevelField.get(rsvp),MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
- }catch(NoSuchFieldException e1){
- fail(e1.getMessage());
- }catch( IllegalAccessException e2){
- fail(e2.getMessage());
- }
- assertEquals(RouterServiceValidator.getSecurityLevel(mContext), MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
- }
-
- public void testHighSecurity(){
- requestTListLock();
-
- RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
- rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
-
- assertTrue(checkShouldOverrideInstalledFrom(rsvp,false));
-
- assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK);
-
- assertTrue(RouterServiceValidator.createTrustedListRequest(mContext, true, null, trustedListCallback));
-
- }
-
- public void testMediumSecurity(){
- requestTListLock();
-
- RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
- rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED);
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
-
- assertTrue(checkShouldOverrideInstalledFrom(rsvp,true));
-
- assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK);
-
- assertTrue(RouterServiceValidator.createTrustedListRequest(mContext, true, null, trustedListCallback));
-
- }
-
- public void testLowSecurity(){
- requestTListLock();
-
- RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
- rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_LOW);
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
-
- assertTrue(checkShouldOverrideInstalledFrom(rsvp,true));
-
- assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_MONTH);
-
- assertTrue(RouterServiceValidator.createTrustedListRequest(mContext, true, null, trustedListCallback));
-
- }
-
- public void testNoSecurity(){
- requestTListLock();
-
- RouterServiceValidator rsvp = new RouterServiceValidator(this.mContext); //Use a locally scoped instance
- rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF);
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
-
- assertTrue(checkShouldOverrideInstalledFrom(rsvp,true));
-
- assertEquals(RouterServiceValidator.getRefreshRate(), REFRESH_TRUSTED_APP_LIST_TIME_WEEK);
-
- assertFalse(RouterServiceValidator.createTrustedListRequest(mContext, true, null, trustedListCallback));
-
- //This should always return true
- assertTrue(rsvp.validate());
-
- }
-
- public boolean checkShouldOverrideInstalledFrom(RouterServiceValidator rsvp, boolean shouldOverride){
- try{
- Method shouldOverrideInstalledFrom = RouterServiceValidator.class.getDeclaredMethod("shouldOverrideInstalledFrom");
- shouldOverrideInstalledFrom.setAccessible(true);
- boolean should = (Boolean)shouldOverrideInstalledFrom.invoke(rsvp);
-
- return shouldOverride == should;
-
- }catch(NoSuchMethodException e1){
- fail(e1.getMessage());
- }catch( IllegalAccessException e2){
- fail(e2.getMessage());
- }catch( InvocationTargetException e3){
- fail(e3.getMessage());
- }
- return false;
- }
-
- public void testJsonRecovery(){
- assertNotNull(rsvp.stringToJson(null));
- assertNotNull(rsvp.stringToJson("asdf235vq32{]]"));
-
- }
-
- public void testInvalidateList(){
- requestTListLock();
-
- assertFalse(RouterServiceValidator.invalidateList(null));
- assertTrue(RouterServiceValidator.invalidateList(mContext));
-
- releaseTListLock();
- }
-
- public void testGetTrustedList(){
- requestTListLock();
-
- assertNull(RouterServiceValidator.getTrustedList(null));
- assertNotNull(RouterServiceValidator.getTrustedList(mContext));
-
- releaseTListLock();
- }
-
- public void testSetTrustedList(){
- requestTListLock();
-
- assertFalse(RouterServiceValidator.setTrustedList(null,null));
- assertFalse(RouterServiceValidator.setTrustedList(mContext,null));
- assertFalse(RouterServiceValidator.setTrustedList(null,"test"));
- assertTrue(RouterServiceValidator.setTrustedList(mContext,"test"));
- assertTrue(RouterServiceValidator.setTrustedList(mContext,TEST));
- assertTrue(RouterServiceValidator.setTrustedList(mContext,TEST+TEST+TEST+TEST+TEST));
- StringBuilder builder = new StringBuilder();
- for(int i = 0; i<1000; i++){
- builder.append(TEST);
- }
- assertTrue(RouterServiceValidator.setTrustedList(mContext,builder.toString()));
-
- releaseTListLock();
- }
-
- public void testTrustedListSetAndGet(){
- requestTListLock();
-
- assertTrue(RouterServiceValidator.setTrustedList(mContext,TEST));
- String retVal = RouterServiceValidator.getTrustedList(mContext);
- assertNotNull(retVal);
- assertTrue(TEST.equals(retVal));
-
- StringBuilder builder = new StringBuilder();
- for(int i = 0; i<1000; i++){
- builder.append(TEST);
- }
- assertTrue(RouterServiceValidator.setTrustedList(mContext,builder.toString()));
- retVal = RouterServiceValidator.getTrustedList(mContext);
- assertNotNull(retVal);
- assertTrue(builder.toString().equals(retVal));
-
- releaseTListLock();
- }
-
- public void testInvalidationSequence(){
- requestTListLock();
-
- assertTrue(RouterServiceValidator.invalidateList(mContext));
- assertTrue(RouterServiceValidator.createTrustedListRequest(mContext, false, null, trustedListCallback));
- }
-
- public void testAppStorePackages(){
- assertTrue(TrustedAppStore.isTrustedStore(TrustedAppStore.PLAY_STORE.packageString));
- assertTrue(TrustedAppStore.isTrustedStore("com.xiaomi.market"));
- assertFalse(TrustedAppStore.isTrustedStore("test"));
- assertFalse(TrustedAppStore.isTrustedStore(null));
-
- rsvp = new RouterServiceValidator(this.mContext);
- rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
- rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
-
- PackageManager packageManager = mContext.getPackageManager();
- List<PackageInfo> packages = packageManager.getInstalledPackages(0);
- String appStore;
- for(PackageInfo info: packages){
- appStore = packageManager.getInstallerPackageName(info.packageName);
- if(TrustedAppStore.isTrustedStore(appStore)){
- assertTrue(rsvp.wasInstalledByAppStore(info.packageName));
- }
- }
-
- assertFalse(rsvp.wasInstalledByAppStore(null));
- }
-
- public void testVersionBlackList(){
- rsvp = new RouterServiceValidator(this.mContext);
- JSONArray array = new JSONArray();
- for(int i=0; i<25; i++){
- if(i%3 == 0){
- array.put(i);
- }
- }
- assertTrue(rsvp.verifyVersion(1, null));
- assertTrue(rsvp.verifyVersion(1, array));
- assertTrue(rsvp.verifyVersion(100, array));
- assertFalse(rsvp.verifyVersion(3, array));
- assertFalse(rsvp.verifyVersion(-3, array));
-
- }
-
- static boolean didFinish = false;
- public void testGetAndCheckList(){
- requestTListLock();
-
- final Object REQUEST_LOCK = new Object();
- didFinish = false;
- HttpRequestTaskCallback cb = new HttpRequestTaskCallback(){
-
- @Override
- public void httpCallComplete(String response) {
- //Might want to check if this list is ok
- Log.d(TAG, "APPS! " + response);
- synchronized(REQUEST_LOCK){
- didFinish = true;
- REQUEST_LOCK.notify();
- }
- releaseTListLock();
- }
- @Override
- public void httpFailure(int statusCode) {
- Log.e(TAG, "Error while requesting trusted app list: " + statusCode);
- synchronized(REQUEST_LOCK){
- didFinish = true;
- REQUEST_LOCK.notify();
- }
- releaseTListLock();
- }
- };
-
- assertTrue(RouterServiceValidator.createTrustedListRequest(mContext,true, cb));
- //Now wait for call to finish
- synchronized(REQUEST_LOCK){
- try {
- REQUEST_LOCK.wait();
- assertTrue(didFinish);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
-
- }
-
- /**
- * Test to check that we can save our last request which actually houses all the previous known sdl enabled apps
- */
- public void testRequestChange(){
- requestTListLock();
-
- RouterServiceValidator.setLastRequest(mContext, null);
- assertNull(RouterServiceValidator.getLastRequest(mContext));
-
- JSONObject object = null;
- try {
- object = new JSONObject(TEST);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- assertNotNull(object);
- assertFalse(object.equals(RouterServiceValidator.getLastRequest(mContext)));
-
- assertTrue(RouterServiceValidator.setLastRequest(mContext, object.toString()));
-
- String oldRequest = RouterServiceValidator.getLastRequest(mContext);
- assertNotNull(oldRequest);
- assertTrue(object.toString().equals(oldRequest));
-
- //Now test a new list
- String test = "{\"response\": {\"com.livio.sdl\" : { \"versionBlacklist\":[] }, \"com.lexus.tcapp\" : { \"versionBlacklist\":[] }, \"com.test.test\" : { \"versionBlacklist\":[] },\"com.toyota.tcapp\" : { \"versionBlacklist\": [] } , \"com.sdl.router\":{\"versionBlacklist\": [] },\"com.ford.fordpass\" : { \"versionBlacklist\":[] } }}";
- object = null;
- try {
- object = new JSONObject(test);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- assertNotNull(object);
- assertFalse(object.equals(RouterServiceValidator.getLastRequest(mContext)));
- //Clear it for next test
- RouterServiceValidator.setLastRequest(mContext, null);
-
- releaseTListLock();
- }
-
- /**
- * Test app's router validation. Validation should fail when the given context and ComponentName object are from different packages and security setting is not OFF
- * and app is not on trusted list. Validation should pass when the given context and ComponentName object are from the same package.
- */
- public void testAppSelfValidation() {
-
- class RouterServiceValidatorTest extends RouterServiceValidator{
- public RouterServiceValidatorTest(Context context){
- super(context);
- }
-
- public RouterServiceValidatorTest(Context context, ComponentName service){
- super(context, service);
- }
-
- // Override this method and simply returning true for the purpose of this test
- protected boolean isServiceRunning(Context context, ComponentName service){
- return true;
- }
- }
-
- // Fail, different package name for context and service and app security setting is not OFF and app is not on trusted list
- RouterServiceValidatorTest rsvpFail = new RouterServiceValidatorTest(this.mContext, new ComponentName("anything", mContext.getClass().getSimpleName()));
- rsvpFail.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
- assertFalse(rsvpFail.validate());
-
- // Success, same package name for context and service
- RouterServiceValidatorTest rsvpPass = new RouterServiceValidatorTest(this.mContext, new ComponentName(mContext.getPackageName(), mContext.getClass().getSimpleName()));
- rsvpPass.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
- assertTrue(rsvpPass.validate());
- }
-
-
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java
deleted file mode 100644
index 1a0bc2458..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java
+++ /dev/null
@@ -1,335 +0,0 @@
-package com.smartdevicelink.transport;
-
-
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.util.Log;
-import android.util.SparseArray;
-import android.util.SparseIntArray;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.BinaryFrameHeader;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.protocol.SdlPacketFactory;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-import junit.framework.Assert;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-
-public class SdlRouterServiceTests extends AndroidTestCase2 {
-
- public static final String TAG = "SdlRouterServiceTests";
- private final int SAMPLE_RPC_CORRELATION_ID = 630;
- int version = 1;
- int sessionId = 1;
- ProtocolMessage pm = null;
- BinaryFrameHeader binFrameHeader = null;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- //Nothing here for now
- }
-
- /**
- * Test null bundle handling in AltTransportHandler when handling messages. Only test the case of
- * msg.what == TransportConstants.ROUTER_RECEIVED_PACKET
- */
- public void testAlTransportHandlerHandleNullBundle() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- class AltTransportHandler extends Handler {
- ClassLoader loader;
- final WeakReference<SdlRouterService> provider;
-
- public AltTransportHandler(SdlRouterService provider) {
- this.provider = new WeakReference<SdlRouterService>(provider);
- loader = getClass().getClassLoader();
- }
-
- @Override
- public void handleMessage(Message msg) {
- SdlRouterService service = this.provider.get();
- Bundle receivedBundle = msg.getData();
- switch (msg.what) {
- case TransportConstants.ROUTER_RECEIVED_PACKET:
- if (receivedBundle != null) {
- receivedBundle.setClassLoader(loader);//We do this because loading a custom parceable object isn't possible without it
- if (receivedBundle.containsKey(TransportConstants.FORMED_PACKET_EXTRA_NAME)) {
- SdlPacket packet = receivedBundle.getParcelable(TransportConstants.FORMED_PACKET_EXTRA_NAME);
- if (packet != null && service != null) {
- service.onPacketRead(packet);
- } else {
- Log.w(TAG, "Received null packet from alt transport service");
- }
- } else {
- Log.w(TAG, "Flase positive packet reception");
- }
- } else {
- Log.e(TAG, "Bundle was null while sending packet to router service from alt transport");
- }
- break;
- default:
- super.handleMessage(msg);
- }
-
- }
- }
- AltTransportHandler testHandler = new AltTransportHandler(null);
- Message msg = Message.obtain(null, TransportConstants.ROUTER_RECEIVED_PACKET);
- //Send a null bundle
- msg.setData(null);
- try {
- testHandler.handleMessage(msg);
- } catch (Exception e) {
- Assert.fail("Exception in testAlTransportHandlerHandleNullBundle, " + e);
- }
- }
-
- /**
- * Test writeBytesToTransport method for handling null byte array in bundle
- *
- * @see SdlRouterService#writeBytesToTransport(Bundle)
- */
- public void testWriteBytesToTransport() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- Method method;
- Field field = null;
- Object sdlRouterService = null;
- try {
- sdlRouterService = Class.forName("com.smartdevicelink.transport.SdlRouterService").newInstance();
- //Send a null bundle
- method = SdlRouterService.class.getDeclaredMethod("writeBytesToTransport", Bundle.class);
- Bundle bundle = null;
- method.invoke(sdlRouterService, bundle);
-
- //Send a non-null bundle with a null bytes array
- //First, set mSerialService to the correct state so we get to test packet being null
- MultiplexBluetoothTransport transport = new MultiplexBluetoothTransport(null);
- transport.setStateManually(MultiplexBluetoothTransport.STATE_CONNECTED);
- field = SdlRouterService.class.getDeclaredField("bluetoothTransport");
- field.setAccessible(true);
- field.set(sdlRouterService, transport);
- bundle = new Bundle();
- bundle.putByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME, null);
- method.invoke(sdlRouterService, bundle);
- } catch (Exception e) {
- Assert.fail("Exception in testWriteBytesToTransport, " + e);
- }
-
- //Return mSerialService to previous state
- if (field != null && sdlRouterService != null) {
- try {
- field.set(sdlRouterService, null);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Test sending UAI to an app whose session id is the same as a removed app
- * but is indeed a different app
- *
- * @see SdlRouterService#sendPacketToRegisteredApp(SdlPacket)
- */
- public void testRegisterAppExistingSessionIDDifferentApp() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- Method method;
- try {
- // create instance of router service
- SdlRouterService sdlRouterService = new SdlRouterService();
-
- // We need a registered app for this to work
- Message message = Message.obtain();
- SdlRouterService.RegisteredApp app1 = sdlRouterService.new RegisteredApp("12345",message.replyTo);
- SdlRouterService.RegisteredApp app2 = sdlRouterService.new RegisteredApp("12344",message.replyTo);
- HashMap<String,SdlRouterService.RegisteredApp> registeredApps = new HashMap<>();
- registeredApps.put(app1.getAppId(),app1);
- registeredApps.put(app2.getAppId(),app2);
-
- // set registered apps array
- Field raf = sdlRouterService.getClass().getDeclaredField("registeredApps");
- raf.setAccessible(true);
- raf.set(sdlRouterService, registeredApps);
-
- // need a session map too
- SparseArray<String> sessionMap = new SparseArray<String>();
- sessionMap.put(1, "12345");
- Field sessionMapField = sdlRouterService.getClass().getDeclaredField("bluetoothSessionMap");
- sessionMapField.setAccessible(true);
- sessionMapField.set(sdlRouterService, sessionMap);
-
- // set cleaned session map
- SparseIntArray testCleanedMap = new SparseIntArray();
- testCleanedMap.put(1, 12345);
- Field f = sdlRouterService.getClass().getDeclaredField("cleanedSessionMap");
- f.setAccessible(true);
- f.set(sdlRouterService, testCleanedMap);
-
- // set session hash id map
- SparseIntArray testHashIdMap = new SparseIntArray();
- testHashIdMap.put(1, 12344);
- Field f2 = sdlRouterService.getClass().getDeclaredField("sessionHashIdMap");
- f2.setAccessible(true);
- f2.set(sdlRouterService, testHashIdMap);
-
- // make sure maps are set and NOT the same
- Assert.assertNotNull(raf.get(sdlRouterService));
- Assert.assertNotNull(sessionMapField.get(sdlRouterService));
- Assert.assertNotNull(f.get(sdlRouterService));
- Assert.assertNotNull(f2.get(sdlRouterService));
-
- // make da RPC
- UnregisterAppInterface request = new UnregisterAppInterface();
- request.setCorrelationID(SAMPLE_RPC_CORRELATION_ID);
-
- // build protocol message
- byte[] msgBytes = JsonRPCMarshaller.marshall(request, (byte) version);
- pm = new ProtocolMessage();
- pm.setData(msgBytes);
- pm.setSessionID((byte) sessionId);
- pm.setMessageType(MessageType.RPC);
- pm.setSessionType(SessionType.RPC);
- pm.setFunctionID(FunctionID.getFunctionId(request.getFunctionName()));
- pm.setCorrID(request.getCorrelationID());
-
- if (request.getBulkData() != null) {
- pm.setBulkData(request.getBulkData());
- }
-
- // binary frame header
- byte[] data = new byte[12 + pm.getJsonSize()];
- binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(pm.getRPCType(), pm.getFunctionID(), pm.getCorrID(), pm.getJsonSize());
- System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
- System.arraycopy(pm.getData(), 0, data, 12, pm.getJsonSize());
-
- // create packet and invoke sendPacketToRegisteredApp
- SdlPacket packet = new SdlPacket(4, false, SdlPacket.FRAME_TYPE_SINGLE, SdlPacket.SERVICE_TYPE_RPC, 0, sessionId, data.length, 123, data);
- packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
- method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
- Boolean success = (Boolean) method.invoke(sdlRouterService, packet);
-
- // we do not want the UAI packet to be sent. make sure it is dropped
- Assert.assertFalse(success);
-
- } catch (Exception e) {
- Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
- }
- }
- /**
- * Test sending UAI to an app whose session id is the same as a removed app
- * but is indeed the SAME app
- *
- * @see SdlRouterService#sendPacketToRegisteredApp(SdlPacket)
- */
- public void testRegisterAppExistingSessionIDSameApp() {
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
- Method method;
- try {
- // create instance of router service
- SdlRouterService sdlRouterService = new SdlRouterService();
-
- // We need a registered app for this to work
- Message message = Message.obtain();
- SdlRouterService.RegisteredApp app1 = sdlRouterService.new RegisteredApp("12345",message.replyTo);
- SdlRouterService.RegisteredApp app2 = sdlRouterService.new RegisteredApp("12344",message.replyTo);
- HashMap<String,SdlRouterService.RegisteredApp> registeredApps = new HashMap<>();
- registeredApps.put(app1.getAppId(),app1);
- registeredApps.put(app2.getAppId(),app2);
-
- // set registered apps array
- Field raf = sdlRouterService.getClass().getDeclaredField("registeredApps");
- raf.setAccessible(true);
- raf.set(sdlRouterService, registeredApps);
-
- // need a session map too
- SparseArray<String> sessionMap = new SparseArray<String>();
- sessionMap.put(1, "12345");
- Field sessionMapField = sdlRouterService.getClass().getDeclaredField("bluetoothSessionMap");
- sessionMapField.setAccessible(true);
- sessionMapField.set(sdlRouterService, sessionMap);
-
- // set cleaned session map
- SparseIntArray testCleanedMap = new SparseIntArray();
- testCleanedMap.put(1, 12345);
- Field f = sdlRouterService.getClass().getDeclaredField("cleanedSessionMap");
- f.setAccessible(true);
- f.set(sdlRouterService, testCleanedMap);
-
- // set session hash id map
- SparseIntArray testHashIdMap = new SparseIntArray();
- testHashIdMap.put(1, 12345);
- Field f2 = sdlRouterService.getClass().getDeclaredField("sessionHashIdMap");
- f2.setAccessible(true);
- f2.set(sdlRouterService, testHashIdMap);
-
- // make sure maps are set and NOT the same
- Assert.assertNotNull(raf.get(sdlRouterService));
- Assert.assertNotNull(sessionMapField.get(sdlRouterService));
- Assert.assertNotNull(f.get(sdlRouterService));
- Assert.assertNotNull(f2.get(sdlRouterService));
-
- // make da RPC
- UnregisterAppInterface request = new UnregisterAppInterface();
- request.setCorrelationID(SAMPLE_RPC_CORRELATION_ID);
-
- // build protocol message
- byte[] msgBytes = JsonRPCMarshaller.marshall(request, (byte) version);
- pm = new ProtocolMessage();
- pm.setData(msgBytes);
- pm.setSessionID((byte) sessionId);
- pm.setMessageType(MessageType.RPC);
- pm.setSessionType(SessionType.RPC);
- pm.setFunctionID(FunctionID.getFunctionId(request.getFunctionName()));
- pm.setCorrID(request.getCorrelationID());
-
- if (request.getBulkData() != null) {
- pm.setBulkData(request.getBulkData());
- }
-
- // binary frame header
- byte[] data = new byte[12 + pm.getJsonSize()];
- binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(pm.getRPCType(), pm.getFunctionID(), pm.getCorrID(), pm.getJsonSize());
- System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
- System.arraycopy(pm.getData(), 0, data, 12, pm.getJsonSize());
-
- // create packet and invoke sendPacketToRegisteredApp
- SdlPacket packet = new SdlPacket(4, false, SdlPacket.FRAME_TYPE_SINGLE, SdlPacket.SERVICE_TYPE_RPC, 0, sessionId, data.length, 123, data);
- packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,null));
- method = sdlRouterService.getClass().getDeclaredMethod("sendPacketToRegisteredApp", SdlPacket.class);
- Boolean success = (Boolean) method.invoke(sdlRouterService, packet);
-
- // Since it is the same app, allow the packet to be sent
- Assert.assertTrue(success);
-
- } catch (Exception e) {
- Assert.fail("Exception in sendPacketToRegisteredApp, " + e);
- }
- }
-}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java
deleted file mode 100644
index bdb628e05..000000000
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.smartdevicelink.transport;
-
-import android.content.ComponentName;
-import android.os.Bundle;
-import android.os.Looper;
-import android.os.Message;
-import android.os.Parcelable;
-
-import com.smartdevicelink.AndroidTestCase2;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.protocol.SdlPacketFactory;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.test.SdlUnitTestContants;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-public class TransportManagerTests extends AndroidTestCase2 {
-
- MultiplexTransportConfig config;
- final TransportRecord defaultBtRecord = new TransportRecord(TransportType.BLUETOOTH, "12:34:56:78:90");
- final ComponentName routerServiceComponentName = new ComponentName("com.smartdevicelink.test","com.smartdevicelink.test.SdlRouterService");
- final SdlPacket defaultPacket = SdlPacketFactory.createStartSessionACK(SessionType.RPC,(byte)1,100,(byte)5);
-
-
- TransportManager.TransportEventListener defaultListener = new TransportManager.TransportEventListener() {
- @Override
- public void onPacketReceived(SdlPacket packet) { assertEquals(defaultPacket,packet);}
- @Override
- public void onTransportConnected(List<TransportRecord> transports) {}
- @Override
- public void onTransportDisconnected(String info, TransportRecord type, List<TransportRecord> connectedTransports) {}
- @Override
- public void onError(String info) {}
- @Override
- public boolean onLegacyModeEnabled(String info) {return false; }
- };
-
-
- @Override
- protected void setUp() throws Exception {
- config = new MultiplexTransportConfig(this.mContext, SdlUnitTestContants.TEST_APP_ID);
- config.setService(routerServiceComponentName);
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
-
-
- }
-
- public TransportManager createTransportManager(){
- TransportManager manager = new TransportManager(config,defaultListener);
-
- //The default listener returns false as legacy is unacceptable
- assertNull(manager.legacyBluetoothHandler);
-
- manager.exitLegacyMode("Test");
- manager.transport = manager.new TransportBrokerImpl(mContext, config.appId, routerServiceComponentName);
-
- manager.start();
- assert true;
- return manager;
- }
-
- public void testBase(){
- TransportManager manager = new TransportManager(config,defaultListener);
- assertNotNull(manager);
- }
-
- public void testConnectionStatus(){
- TransportManager manager = new TransportManager(config,defaultListener);
-
- manager.transportStatus.clear();
- manager.transportStatus.add(defaultBtRecord);
-
- assertTrue(manager.isConnected(null, null));
- assertTrue(manager.isConnected(TransportType.BLUETOOTH, null));
- assertTrue(manager.isConnected(TransportType.BLUETOOTH, defaultBtRecord.getAddress()));
-
- assertNull(manager.getTransportRecord(null, null));
- assertNull(manager.getTransportRecord(null, defaultBtRecord.getAddress()));
- assertNull(manager.getTransportRecord(TransportType.USB, null));
-
- assertEquals(defaultBtRecord, manager.getTransportRecord(defaultBtRecord.getType(), null));
- assertEquals(defaultBtRecord, manager.getTransportRecord(defaultBtRecord.getType(), defaultBtRecord.getAddress()));
-
- assertFalse(manager.isHighBandwidthAvailable());
-
- manager.transportStatus.add(new TransportRecord(TransportType.USB,"test"));
- assertTrue(manager.isHighBandwidthAvailable());
- assertNotNull(manager.getTransportRecord(TransportType.USB, null));
-
- }
-
- public void testOnTransportConnections(){
-
- TransportManager manager = createTransportManager();
-
- manager.transport.onHardwareConnected(Collections.singletonList(defaultBtRecord));
-
- assertTrue(manager.isConnected(null, null));
- assertTrue(manager.isConnected(TransportType.BLUETOOTH, null));
- assertTrue(manager.isConnected(TransportType.BLUETOOTH, defaultBtRecord.getAddress()));
-
- assertNull(manager.getTransportRecord(null, null));
- assertNull(manager.getTransportRecord(null, defaultBtRecord.getAddress()));
- assertNull(manager.getTransportRecord(TransportType.USB, null));
-
- assertEquals(defaultBtRecord, manager.getTransportRecord(defaultBtRecord.getType(), null));
- assertEquals(defaultBtRecord, manager.getTransportRecord(defaultBtRecord.getType(), defaultBtRecord.getAddress()));
-
- assertFalse(manager.isHighBandwidthAvailable());
-
- }
-
- public void testOnPacket(){
- TransportManager manager = createTransportManager();
- assertNotNull(manager.transportListener);
-
- manager.transport.onPacketReceived(defaultPacket);
-
- }
-
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java b/sdl_android/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java
deleted file mode 100644
index a4cfc150b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.smartdevicelink.Dispatcher;
-
-public interface IDispatchingStrategy<T> {
- public void dispatch(T message);
-
- public void handleDispatchingError(String info, Exception ex);
-
- public void handleQueueingError(String info, Exception ex);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java b/sdl_android/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java
deleted file mode 100644
index 8db6f51e7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.smartdevicelink.Dispatcher;
-
-import java.util.concurrent.LinkedBlockingQueue;
-
-import com.smartdevicelink.util.DebugTool;
-
-public class ProxyMessageDispatcher<T> {
- LinkedBlockingQueue<T> _queue = null;
- private Thread _messageDispatchingThread = null;
- IDispatchingStrategy<T> _strategy = null;
-
- // Boolean to track if disposed
- private Boolean dispatcherDisposed = false;
-
- public ProxyMessageDispatcher(String THREAD_NAME, IDispatchingStrategy<T> strategy) {
- _queue = new LinkedBlockingQueue<T>();
-
- _strategy = strategy;
-
- // Create dispatching thread
- _messageDispatchingThread = new Thread(new Runnable() {public void run(){handleMessages();}});
- _messageDispatchingThread.setName(THREAD_NAME);
- _messageDispatchingThread.setDaemon(true);
- _messageDispatchingThread.start();
- }
-
- public void dispose() {
- dispatcherDisposed = true;
-
- if(_messageDispatchingThread != null) {
- _messageDispatchingThread.interrupt();
- _messageDispatchingThread = null;
- }
- }
-
- private void handleMessages() {
-
- try {
- T thisMessage;
-
- while(dispatcherDisposed == false) {
- thisMessage = _queue.take();
- _strategy.dispatch(thisMessage);
- }
- } catch (InterruptedException e) {
- // Thread was interrupted by dispose() method, no action required
- return;
- } catch (Exception e) {
- DebugTool.logError("Error occurred dispating message.", e);
- _strategy.handleDispatchingError("Error occurred dispating message.", e);
- }
- }
-
- public void queueMessage(T message) {
- try {
- _queue.put(message);
- } catch(ClassCastException e) {
- _strategy.handleQueueingError("ClassCastException encountered when queueing message.", e);
- } catch(Exception e) {
- _strategy.handleQueueingError("Exception encountered when queueing message.", e);
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java b/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java
deleted file mode 100644
index 5035f5547..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/ISdlConnectionListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.smartdevicelink.SdlConnection;
-
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-
-public interface ISdlConnectionListener {
- @Deprecated
- public void onTransportDisconnected(String info);
-
- public void onTransportDisconnected(String info, boolean availablePrimary, MultiplexTransportConfig transportConfig);
-
-
- public void onTransportError(String info, Exception e);
-
- public void onProtocolMessageReceived(ProtocolMessage msg);
-
- public void onProtocolSessionStartedNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams);
-
- public void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted);
-
- public void onProtocolSessionEnded(SessionType sessionType,
- byte sessionID, String correlationID);
-
- public void onProtocolSessionEndedNACKed(SessionType sessionType,
- byte sessionID, String correlationID);
-
- public void onProtocolError(String info, Exception e);
-
- public void onHeartbeatTimedOut(byte sessionID);
-
- public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java b/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java
deleted file mode 100644
index 19b60abe2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlConnection.java
+++ /dev/null
@@ -1,619 +0,0 @@
-package com.smartdevicelink.SdlConnection;
-
-
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import android.content.ComponentName;
-import android.os.Bundle;
-import android.util.Log;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.protocol.AbstractProtocol;
-import com.smartdevicelink.protocol.IProtocolListener;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.protocol.WiProProtocol;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.transport.BTTransport;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.ITransportListener;
-import com.smartdevicelink.transport.MultiplexTransport;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.RouterServiceValidator;
-import com.smartdevicelink.transport.SdlBroadcastReceiver;
-import com.smartdevicelink.transport.SdlTransport;
-import com.smartdevicelink.transport.TCPTransport;
-import com.smartdevicelink.transport.TCPTransportConfig;
-import com.smartdevicelink.transport.USBTransport;
-import com.smartdevicelink.transport.USBTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-
-@Deprecated
-public class SdlConnection implements IProtocolListener, ITransportListener {
-
- private static final String TAG = "SdlConnection";
-
- SdlTransport _transport = null;
- AbstractProtocol _protocol = null;
- ISdlConnectionListener _connectionListener = null;
-
-
-
- // Thread safety locks
- static Object TRANSPORT_REFERENCE_LOCK = new Object();
- Object PROTOCOL_REFERENCE_LOCK = new Object();
-
- private Object SESSION_LOCK = new Object();
- private CopyOnWriteArrayList<SdlSession> listenerList = new CopyOnWriteArrayList<SdlSession>();
- private static TransportType legacyTransportRequest = null;
- private final static int BUFF_READ_SIZE = 1000000;
- protected static MultiplexTransportConfig cachedMultiConfig = null;
-
- /**
- * Constructor.
- *
- * @param listener Sdl connection listener.
- * @param transportConfig Transport configuration for this connection.
- */
- public SdlConnection(BaseTransportConfig transportConfig) {
- RouterServiceValidator vlad = null;
- //Let's check if we can even do multiplexing
- if(transportConfig.getTransportType() == TransportType.MULTIPLEX){
- ComponentName tempCompName = SdlBroadcastReceiver.consumeQueuedRouterService();
- MultiplexTransportConfig multiConfig = (MultiplexTransportConfig)transportConfig;
- if(tempCompName!=null){
- vlad =new RouterServiceValidator(multiConfig.getContext(),tempCompName);
- }else{
- vlad =new RouterServiceValidator(multiConfig.getContext());
- }
- //vlad.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
- vlad.setSecurityLevel(multiConfig.getSecurityLevel());
- }
- constructor(transportConfig,vlad);
- }
- //For unit tests
- protected SdlConnection(BaseTransportConfig transportConfig,RouterServiceValidator rsvp){
- constructor(transportConfig,rsvp);
- }
-
- private void constructor(BaseTransportConfig transportConfig,RouterServiceValidator rsvp){
- _connectionListener = new InternalMsgDispatcher();
-
- // Initialize the transport
- synchronized(TRANSPORT_REFERENCE_LOCK) {
- // Ensure transport is null
- if (_transport != null) {
- if (_transport.getIsConnected()) {
- _transport.disconnect();
- }
- _transport = null;
- }
-
- //Let's check if we can even do multiplexing
- if(!isLegacyModeEnabled() &&
- rsvp!= null &&
- transportConfig.getTransportType() == TransportType.MULTIPLEX){
- //rsvp = new RouterServiceValidator(((MultiplexTransportConfig)transportConfig).getContext());
- //vlad.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
- if(rsvp.validate()){
- Log.w(TAG, "SDL Router service is valid; attempting to connect");
- ((MultiplexTransportConfig)transportConfig).setService(rsvp.getService());//Let thes the transport broker know which service to connect to
- }else{
- Log.w(TAG, "SDL Router service isn't trusted. Enabling legacy bluetooth connection.");
- if(cachedMultiConfig == null){
- cachedMultiConfig = (MultiplexTransportConfig) transportConfig;
- cachedMultiConfig.setService(null);
- }
- enableLegacyMode(true,TransportType.BLUETOOTH); //We will use legacy bluetooth connection for this attempt
- }
- }
-
- if(!isLegacyModeEnabled() && //Make sure legacy mode is not enabled
- (transportConfig.getTransportType() == TransportType.MULTIPLEX)){
- _transport = new MultiplexTransport((MultiplexTransportConfig)transportConfig,this);
- }else if(isLegacyModeEnabled() && legacyTransportRequest == TransportType.BLUETOOTH){
- _transport = new BTTransport(this, true);
- }else if(transportConfig.getTransportType() == TransportType.BLUETOOTH){
- _transport = new BTTransport(this,((BTTransportConfig)transportConfig).getKeepSocketActive());
- }
- else if (transportConfig.getTransportType() == TransportType.TCP)
- {
- _transport = new TCPTransport((TCPTransportConfig) transportConfig, this);
- } else if (transportConfig.getTransportType() == TransportType.USB) {
- _transport = new USBTransport((USBTransportConfig) transportConfig, this);
- }
- }
-
- // Initialize the protocol
- synchronized(PROTOCOL_REFERENCE_LOCK) {
- // Ensure protocol is null
- if (_protocol != null) {
- _protocol = null;
- }
-
- _protocol = new WiProProtocol(this);
- }
- }
-
- public AbstractProtocol getWiProProtocol(){
- return _protocol;
- }
-
-
-
-
- private void closeConnection(boolean willRecycle, byte rpcSessionID, int sessionHashId) {
- synchronized(PROTOCOL_REFERENCE_LOCK) {
-
- if (_protocol != null) {
- // If transport is still connected, sent EndProtocolSessionMessage
- if (_transport != null && _transport.getIsConnected()) {
- _protocol.EndProtocolSession(SessionType.RPC, rpcSessionID, sessionHashId);
- }
- if (willRecycle) {
- _protocol = null;
- }
- } // end-if
- }
- synchronized (TRANSPORT_REFERENCE_LOCK) {
- if (willRecycle) {
- if (_transport != null) {
- _transport.disconnect();
- }
- _transport = null;
- }
- }
- }
-
-
- public void startTransport() throws SdlException {
- _transport.openConnection();
- }
-
- public Boolean getIsConnected() {
-
- // If _transport is null, then it can't be connected
- if (_transport == null) {
- return false;
- }
-
- return _transport.getIsConnected();
- }
-
- public String getBroadcastComment() {
-
- if (_transport == null) {
- return "";
- }
-
- return _transport.getBroadcastComment();
- }
-
- public void sendMessage(ProtocolMessage msg) {
- if(_protocol != null)
- _protocol.SendMessage(msg);
- }
-
- void startHandShake() {
- synchronized(PROTOCOL_REFERENCE_LOCK){
- if(_protocol != null){
- _protocol.StartProtocolSession(SessionType.RPC);
- }
- }
- }
-
- @Override
- public void onTransportPacketReceived(SdlPacket packet) {
- // Send bytes to protocol to be interpreted
- synchronized(PROTOCOL_REFERENCE_LOCK) {
- if (_protocol != null) {
- _protocol.handlePacketReceived(packet);
- }
- }
- }
-
- @Override
- public void onTransportConnected() {
- synchronized(PROTOCOL_REFERENCE_LOCK){
- if(_protocol != null){
- boolean shouldRequestSession = _transport !=null && _transport.getTransportType()== TransportType.MULTIPLEX;
- for (SdlSession s : listenerList) {
- if (s.getSessionId() == 0) {
- if(shouldRequestSession){
- ((MultiplexTransport)_transport).requestNewSession();
- }
- startHandShake();
- }
- }
- }
- }
- }
-
- @Override
- public void onTransportDisconnected(String info) {
- // Pass directly to connection listener
- _connectionListener.onTransportDisconnected(info);
- }
-
- @Override
- public void onTransportError(String info, Exception e) {
- // Pass directly to connection listener
- _connectionListener.onTransportError(info, e);
- }
-
- @Override
- public void onProtocolMessageBytesToSend(SdlPacket packet) {
- // Protocol has packaged bytes to send, pass to transport for transmission
- synchronized(TRANSPORT_REFERENCE_LOCK) {
- if (_transport != null) {
- _transport.sendBytes(packet);
- }
- }
- }
-
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
- _connectionListener.onProtocolMessageReceived(msg);
- }
-
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
- _connectionListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
- }
-
- @Override
- public void onProtocolSessionNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
- _connectionListener.onProtocolSessionStartedNACKed(sessionType,
- sessionID, version, correlationID, rejectedParams);
- }
-
- @Override
- public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
- String correlationID) {
- _connectionListener.onProtocolSessionEnded(sessionType, sessionID, correlationID);
- }
-
- @Override
- public void onProtocolError(String info, Exception e) {
- _connectionListener.onProtocolError(info, e);
- }
-
-
- /**
- * Gets type of transport currently used by this connection.
- *
- * @return One of TransportType enumeration values.
- *
- * @see TransportType
- */
- public TransportType getCurrentTransportType() {
- return _transport.getTransportType();
- }
-
- public void startService (SessionType sessionType, byte sessionID, boolean isEncrypted) {
- synchronized(PROTOCOL_REFERENCE_LOCK){
- if(_protocol != null){
- _protocol.StartProtocolService(sessionType, sessionID, isEncrypted);
- }
- }
- }
-
- public void endService (SessionType sessionType, byte sessionID) {
- synchronized(PROTOCOL_REFERENCE_LOCK){
- if(_protocol != null){
- _protocol.EndProtocolService(sessionType, sessionID);
- }
- }
- }
- void registerSession(SdlSession registerListener) throws SdlException {
- boolean didAdd = listenerList.addIfAbsent(registerListener);
- if (!this.getIsConnected()) {
- this.startTransport();
- } else {
- if(didAdd && _transport !=null && _transport.getTransportType()== TransportType.MULTIPLEX){ //If we're connected we can request the extra session now
- ((MultiplexTransport)_transport).requestNewSession();
- }
- this.startHandShake();
- }
- }
-
- public void sendHeartbeat(SdlSession mySession) {
- if(_protocol != null && mySession != null)
- _protocol.SendHeartBeat(mySession.getSessionId());
- }
-
- public void unregisterSession(SdlSession registerListener) {
- boolean didRemove = listenerList.remove(registerListener);
- if(didRemove && _transport !=null && _transport.getTransportType()== TransportType.MULTIPLEX){ //If we're connected we can request the extra session now
- ((MultiplexTransport)_transport).removeSession(registerListener.getSessionId());
- }
- closeConnection(listenerList.size() == 0, registerListener.getSessionId(), registerListener.getSessionHashId());
- }
-
-
- public SdlSession findSessionById(byte id) {
- for (SdlSession listener : listenerList) {
- if (listener.getSessionId() == id) {
- return listener;
- }
- }
- return null;
- }
-
- private class InternalMsgDispatcher implements ISdlConnectionListener {
-
- @Override
- public void onTransportDisconnected(String info) {
- for (SdlSession session : listenerList) {
- session.onTransportDisconnected(info);
- }
- if(cachedMultiConfig!=null ){
- if(cachedMultiConfig.getService()!=null){
- synchronized(TRANSPORT_REFERENCE_LOCK) {
- // Ensure transport is null
- if (_transport != null) {
- if (_transport.getIsConnected()) {
- _transport.disconnect();
- }
- _transport = null;
- }
- _transport = new MultiplexTransport(cachedMultiConfig, SdlConnection.this);
- try {
- startTransport();
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
- }else{ //The service must be null or already consumed. Let's see if we can find the connection that consumed it
- for (SdlSession session : listenerList) {
- session.checkForOpenMultiplexConnection(SdlConnection.this);;
- }
- }
- }
- }
-
- @Override
- public void onTransportDisconnected(String info, boolean availablePrimary, MultiplexTransportConfig transportConfig) {
- onTransportDisconnected(info);
- }
-
- @Override
- public void onTransportError(String info, Exception e) {
- //If there's an error with the transport we want to make sure we clear out any reference to it held by the static list in sessions
- SdlSession.removeConnection(SdlConnection.this);
- //If we are erroring out to go into legacy mode, lets cache our multiplexing
- if(isLegacyModeEnabled() && _transport!=null && TransportType.MULTIPLEX.equals(_transport.getTransportType())){
- MultiplexTransport multi = ((MultiplexTransport)_transport);
- cachedMultiConfig = multi.getConfig();
- cachedMultiConfig.setService(null); //Make sure we're clearning this out
- }else{
- cachedMultiConfig = null; //It should now be consumed
- }
- for (SdlSession session : listenerList) {
- session.onTransportError(info, e);
- }
-
- }
-
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
- SdlSession session = findSessionById(msg.getSessionID());
- if (session != null) {
- session.onProtocolMessageReceived(msg);
- }
- }
-
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
- for (SdlSession session : listenerList) {
- if (session.getSessionId() == 0) {
- session.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
- break;
- }
- }
-
- if (sessionType.equals(SessionType.NAV) || sessionType.equals(SessionType.PCM) || isEncrypted){
- SdlSession session = findSessionById(sessionID);
- if (session != null) {
- session.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
- }
- }
- }
-
- @Override
- public void onProtocolSessionEnded(SessionType sessionType,
- byte sessionID, String correlationID) {
- SdlSession session = findSessionById(sessionID);
- if (session != null) {
- session.onProtocolSessionEnded(sessionType, sessionID, correlationID);
- }
- }
-
- @Override
- public void onProtocolError(String info, Exception e) {
- for (SdlSession session : listenerList) {
- session.onProtocolError(info, e);
- }
- }
-
- @Override
- public void onProtocolSessionStartedNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
- SdlSession session = findSessionById(sessionID);
- if (session != null) {
- session.onProtocolSessionStartedNACKed(sessionType,
- sessionID, version, correlationID, rejectedParams);
- }
- }
-
- @Override
- public void onHeartbeatTimedOut(byte sessionID) {
- SdlSession session = findSessionById(sessionID);
- if (session != null) {
- session.onHeartbeatTimedOut(sessionID);
- }
- }
-
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType, byte sessionID, String correlationID) {
- SdlSession session = findSessionById(sessionID);
- if (session != null) {
- session.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
- }
- }
-
- @Override
- public void onProtocolServiceDataACK(SessionType serviceType, int dataSize, byte sessionID) {
- SdlSession session = findSessionById(sessionID);
- if (session != null) {
- session.onProtocolServiceDataACK(serviceType, dataSize, sessionID);
- }
- }
- }
-
- public int getRegisterCount() {
- return listenerList.size();
- }
-
- @Override
- public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) {
- SdlSession mySession = findSessionById(sessionID);
- if (mySession == null) return;
-
- if (mySession._outgoingHeartbeatMonitor != null) {
- mySession._outgoingHeartbeatMonitor.heartbeatReceived();
- }
- if (mySession._incomingHeartbeatMonitor != null) {
- mySession._incomingHeartbeatMonitor.heartbeatReceived();
- }
- }
-
- @Override
- public void onProtocolHeartbeatACK(SessionType sessionType, byte sessionID) {
- SdlSession mySession = findSessionById(sessionID);
- if (mySession == null) return;
-
- if (mySession._outgoingHeartbeatMonitor != null) {
- mySession._outgoingHeartbeatMonitor.heartbeatACKReceived();
- }
- if (mySession._incomingHeartbeatMonitor != null) {
- mySession._incomingHeartbeatMonitor.heartbeatACKReceived();
- }
- }
-
- @Override
- public void onResetOutgoingHeartbeat(SessionType sessionType, byte sessionID){
-
- SdlSession mySession = findSessionById(sessionID);
- if (mySession == null) return;
-
- if (mySession._outgoingHeartbeatMonitor != null) {
- mySession._outgoingHeartbeatMonitor.notifyTransportActivity();
- }
- }
-
- @Override
- public void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID){
-
- SdlSession mySession = findSessionById(sessionID);
- if (mySession == null) return;
-
- if (mySession._incomingHeartbeatMonitor != null) {
- mySession._incomingHeartbeatMonitor.notifyTransportActivity();
- }
- }
-
- public void forceHardwareConnectEvent(TransportType type){
- if(_transport == null){
- Log.w(TAG, "Unable to force connect, transport was null!");
- return;
- }
- if(isLegacyModeEnabled()){//We know we should no longer be in legacy mode for future connections, so lets clear out that flag
- enableLegacyMode(false,null);
- }
- if(_transport!=null && (_transport.getTransportType()==TransportType.MULTIPLEX)){ //This is only valid for the multiplex connection
- MultiplexTransport multi = ((MultiplexTransport)_transport);
- MultiplexTransportConfig config = multi.getConfig();
- ComponentName tempCompName = SdlBroadcastReceiver.consumeQueuedRouterService();
- if(config.getService() != null && config.getService().equals(tempCompName)){ //If this is the same service that just connected that we are already looking at. Attempt to reconnect
- if(!multi.getIsConnected() && multi.isDisconnecting() ){ //If we aren't able to force a connection it means the
- _transport = new MultiplexTransport(config,this);
- try {
- startTransport();
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
- }else if(tempCompName!=null){
- //We have a conflicting service request
- Log.w(TAG, "Conflicting services. Disconnecting from current and connecting to new");
- //Log.w(TAG, "Old service " + config.getService().toShortString());
- //Log.w(TAG, "New Serivce " + tempCompName.toString());
- multi.disconnect();
- config.setService(tempCompName);
- _transport = new MultiplexTransport(config,this);
- try {
- startTransport();
- } catch (SdlException e) {
- e.printStackTrace();
- }
-
- }
- }else if(_transport.getTransportType()==TransportType.BLUETOOTH
- && !_transport.getIsConnected()){
- if(cachedMultiConfig!=null){
- //We are in legacy mode, but just received a force connect. The router service should never be pointing us here if we are truely in legacy mode
- ComponentName tempCompName = SdlBroadcastReceiver.consumeQueuedRouterService();
- RouterServiceValidator vlad = new RouterServiceValidator(cachedMultiConfig.getContext(),tempCompName);
- if(vlad.validate()){
- cachedMultiConfig.setService(tempCompName);
- //We are not connected yet so we should be able to close down
- _transport.disconnect(); //This will force us into the
- }else{
- //Log.d(TAG, "Router service not trusted during force connect. Ignoring.");
- return;
- }
- }else{
- //Log.i(TAG, "No cached multiplexing config, ignoring");
- //_transport.disconnect();
- return;
- }
- Log.w(TAG, "Using own transport, but not connected. Attempting to join multiplexing");
- }else{
- Log.w(TAG, "Currently in legacy mode connected to own transport service. Nothing will take place on trnasport cycle");
- }
- }
-
- public static void enableLegacyMode(boolean enable, TransportType type){
- synchronized(TRANSPORT_REFERENCE_LOCK) {
- if(enable){
- legacyTransportRequest = type;
- }else{
- legacyTransportRequest = null;
- }
- }
- }
- public static boolean isLegacyModeEnabled(){
- synchronized(TRANSPORT_REFERENCE_LOCK) {
- return (legacyTransportRequest!=null);
- }
- }
-
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,
- byte sessionID, String correlationID) {
- _connectionListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
-
- }
-
- @Override
- public void onProtocolServiceDataACK(SessionType serviceType, int dataSize, byte sessionID) {
- _connectionListener.onProtocolServiceDataACK(serviceType, dataSize, sessionID);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
deleted file mode 100644
index c3e66fb06..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
+++ /dev/null
@@ -1,790 +0,0 @@
-package com.smartdevicelink.SdlConnection;
-
-import android.annotation.SuppressLint;
-import android.os.Build;
-import android.util.Log;
-import android.view.Surface;
-
-import com.smartdevicelink.encoder.SdlEncoder;
-import com.smartdevicelink.encoder.VirtualDisplayEncoder;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitor;
-import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitorListener;
-import com.smartdevicelink.proxy.LockScreenManager;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
-import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-import com.smartdevicelink.security.ISecurityInitializedListener;
-import com.smartdevicelink.security.SdlSecurityBase;
-import com.smartdevicelink.streaming.AbstractPacketizer;
-import com.smartdevicelink.streaming.IStreamListener;
-import com.smartdevicelink.streaming.StreamPacketizer;
-import com.smartdevicelink.streaming.StreamRPCPacketizer;
-import com.smartdevicelink.streaming.video.RTPH264Packetizer;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransport;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.util.Version;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-@Deprecated
-public class SdlSession implements ISdlConnectionListener, IHeartbeatMonitorListener, IStreamListener, ISecurityInitializedListener {
-
- private static final String TAG = "SdlSession";
-
- protected final static int BUFF_READ_SIZE = 1024;
-
- private static CopyOnWriteArrayList<SdlConnection> shareConnections = new CopyOnWriteArrayList<SdlConnection>();
-
- private byte wiproProcolVer;
-
- protected BaseTransportConfig transportConfig;
- protected ISdlConnectionListener sessionListener;
- protected LockScreenManager lockScreenMan = new LockScreenManager();
- protected SdlSecurityBase sdlSecurity = null;
- protected VideoStreamingParameters desiredVideoParams = null;
- protected VideoStreamingParameters acceptedVideoParams = null;
-
- protected byte sessionId;
- protected int sessionHashId = 0;
- protected HashMap<SessionType, CopyOnWriteArrayList<ISdlServiceListener>> serviceListeners;
- protected CopyOnWriteArrayList<SessionType> encryptedServices = new CopyOnWriteArrayList<SessionType>();
-
-
- SdlConnection _sdlConnection = null;
-
- IHeartbeatMonitor _outgoingHeartbeatMonitor = null;
- IHeartbeatMonitor _incomingHeartbeatMonitor = null;
-
- StreamRPCPacketizer mRPCPacketizer = null;
- AbstractPacketizer mVideoPacketizer = null;
- StreamPacketizer mAudioPacketizer = null;
- SdlEncoder mSdlEncoder = null;
- VirtualDisplayEncoder virtualDisplayEncoder = null;
-
- public static SdlSession createSession(byte wiproVersion, ISdlConnectionListener listener, BaseTransportConfig btConfig) {
-
- SdlSession session = new SdlSession();
- session.wiproProcolVer = wiproVersion;
- session.sessionListener = listener;
- session.transportConfig = btConfig;
-
- return session;
- }
-
- public BaseTransportConfig getTransportConfig() {
- return this.transportConfig;
- }
-
- public LockScreenManager getLockScreenMan() {
- return lockScreenMan;
- }
-
-
- public IHeartbeatMonitor getOutgoingHeartbeatMonitor() {
- return _outgoingHeartbeatMonitor;
- }
-
- public IHeartbeatMonitor getIncomingHeartbeatMonitor() {
- return _incomingHeartbeatMonitor;
- }
-
- public void setOutgoingHeartbeatMonitor(IHeartbeatMonitor outgoingHeartbeatMonitor) {
- this._outgoingHeartbeatMonitor = outgoingHeartbeatMonitor;
- _outgoingHeartbeatMonitor.setListener(this);
- }
-
- public void setIncomingHeartbeatMonitor(IHeartbeatMonitor incomingHeartbeatMonitor) {
- this._incomingHeartbeatMonitor = incomingHeartbeatMonitor;
- _incomingHeartbeatMonitor.setListener(this);
- }
-
- public int getSessionHashId() {
- return this.sessionHashId;
- }
-
- public byte getSessionId() {
- return this.sessionId;
- }
-
- public SdlConnection getSdlConnection() {
- return this._sdlConnection;
- }
-
- public int getMtu(){
- if(this._sdlConnection!=null){
- return this._sdlConnection.getWiProProtocol().getMtu();
- }else{
- return 0;
- }
- }
-
- public long getMtu(SessionType type) {
- if (this._sdlConnection != null) {
- return this._sdlConnection.getWiProProtocol().getMtu(type);
- } else {
- return 0;
- }
- }
-
- public void close() {
- if (sdlSecurity != null)
- {
- sdlSecurity.resetParams();
- sdlSecurity.shutDown();
- }
-
- if (_sdlConnection != null) { //sessionId == 0 means session is not started.
- //_sdlConnection.unregisterSession(this);
-
- if (_sdlConnection.getRegisterCount() == 0) {
- shareConnections.remove(_sdlConnection);
- }
-
- _sdlConnection = null;
- }
- }
-
- public void startStream(InputStream is, SessionType sType, byte rpcSessionID) throws IOException {
- if (sType.equals(SessionType.NAV))
- {
- // protocol is fixed to RAW
- StreamPacketizer packetizer = new StreamPacketizer(this, is, sType, rpcSessionID, this);
- packetizer.sdlConnection = this.getSdlConnection();
- mVideoPacketizer = packetizer;
- mVideoPacketizer.start();
- }
- else if (sType.equals(SessionType.PCM))
- {
- mAudioPacketizer = new StreamPacketizer(this, is, sType, rpcSessionID, this);
- mAudioPacketizer.sdlConnection = this.getSdlConnection();
- mAudioPacketizer.start();
- }
- }
-
- @SuppressLint("NewApi")
- public OutputStream startStream(SessionType sType, byte rpcSessionID) throws IOException {
- OutputStream os = new PipedOutputStream();
- InputStream is = null;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
- is = new PipedInputStream((PipedOutputStream) os, BUFF_READ_SIZE);
- } else {
- is = new PipedInputStream((PipedOutputStream) os);
- }
- if (sType.equals(SessionType.NAV))
- {
- // protocol is fixed to RAW
- StreamPacketizer packetizer = new StreamPacketizer(this, is, sType, rpcSessionID, this);
- packetizer.sdlConnection = this.getSdlConnection();
- mVideoPacketizer = packetizer;
- mVideoPacketizer.start();
- }
- else if (sType.equals(SessionType.PCM))
- {
- mAudioPacketizer = new StreamPacketizer(this, is, sType, rpcSessionID, this);
- mAudioPacketizer.sdlConnection = this.getSdlConnection();
- mAudioPacketizer.start();
- }
- else
- {
- os.close();
- is.close();
- return null;
- }
- return os;
- }
-
- public IVideoStreamListener startVideoStream() {
- byte rpcSessionID = getSessionId();
- VideoStreamingProtocol protocol = getAcceptedProtocol();
- try {
- switch (protocol) {
- case RAW: {
- StreamPacketizer packetizer = new StreamPacketizer(this, null, SessionType.NAV, rpcSessionID, this);
- packetizer.sdlConnection = this.getSdlConnection();
- mVideoPacketizer = packetizer;
- mVideoPacketizer.start();
- return packetizer;
- }
- case RTP: {
- RTPH264Packetizer packetizer = new RTPH264Packetizer(this, SessionType.NAV, rpcSessionID, this);
- mVideoPacketizer = packetizer;
- mVideoPacketizer.start();
- return packetizer;
- }
- default:
- Log.e(TAG, "Protocol " + protocol + " is not supported.");
- return null;
- }
- } catch (IOException e) {
- return null;
- }
- }
-
- public IAudioStreamListener startAudioStream() {
- byte rpcSessionID = getSessionId();
- try {
- StreamPacketizer packetizer = new StreamPacketizer(this, null, SessionType.PCM, rpcSessionID, this);
- packetizer.sdlConnection = this.getSdlConnection();
- mAudioPacketizer = packetizer;
- mAudioPacketizer.start();
- return packetizer;
- } catch (IOException e) {
- return null;
- }
- }
-
- public void startRPCStream(InputStream is, RPCRequest request, SessionType sType, byte rpcSessionID, byte wiproVersion) {
- try {
- mRPCPacketizer = new StreamRPCPacketizer(null, this, is, request, sType, rpcSessionID, wiproVersion, 0, this);
- mRPCPacketizer.start();
- } catch (Exception e) {
- Log.e(TAG, "Unable to start streaming:" + e.toString());
- }
- }
-
- public OutputStream startRPCStream(RPCRequest request, SessionType sType, byte rpcSessionID, byte wiproVersion) {
- try {
- OutputStream os = new PipedOutputStream();
- InputStream is = new PipedInputStream((PipedOutputStream) os);
- mRPCPacketizer = new StreamRPCPacketizer(null, this, is, request, sType, rpcSessionID, wiproVersion, 0, this);
- mRPCPacketizer.start();
- return os;
- } catch (Exception e) {
- Log.e(TAG, "Unable to start streaming:" + e.toString());
- }
- return null;
- }
-
- public void pauseRPCStream()
- {
- if (mRPCPacketizer != null)
- {
- mRPCPacketizer.pause();
- }
- }
-
- public void resumeRPCStream()
- {
- if (mRPCPacketizer != null)
- {
- mRPCPacketizer.resume();
- }
- }
-
- public void stopRPCStream()
- {
- if (mRPCPacketizer != null)
- {
- mRPCPacketizer.stop();
- }
- }
-
- public boolean stopAudioStream()
- {
- if (mAudioPacketizer != null)
- {
- mAudioPacketizer.stop();
- return true;
- }
- return false;
- }
-
- public boolean stopVideoStream()
- {
- if (mVideoPacketizer != null)
- {
- mVideoPacketizer.stop();
- return true;
- }
- return false;
- }
-
- public boolean pauseAudioStream()
- {
- if (mAudioPacketizer != null)
- {
- mAudioPacketizer.pause();
- return true;
- }
- return false;
- }
-
- public boolean pauseVideoStream()
- {
- if (mVideoPacketizer != null)
- {
- mVideoPacketizer.pause();
- return true;
- }
- return false;
- }
-
- public boolean resumeAudioStream()
- {
- if (mAudioPacketizer != null)
- {
- mAudioPacketizer.resume();
- return true;
- }
- return false;
- }
-
- public boolean resumeVideoStream()
- {
- if (mVideoPacketizer != null)
- {
- mVideoPacketizer.resume();
- return true;
- }
- return false;
- }
-
- public Surface createOpenGLInputSurface(int frameRate, int iFrameInterval, int width,
- int height, int bitrate, SessionType sType, byte rpcSessionID) {
- IVideoStreamListener encoderListener = startVideoStream();
- if (encoderListener == null) {
- return null;
- }
-
- mSdlEncoder = new SdlEncoder();
- mSdlEncoder.setFrameRate(frameRate);
- mSdlEncoder.setFrameInterval(iFrameInterval);
- mSdlEncoder.setFrameWidth(width);
- mSdlEncoder.setFrameHeight(height);
- mSdlEncoder.setBitrate(bitrate);
- mSdlEncoder.setOutputListener(encoderListener);
- return mSdlEncoder.prepareEncoder();
- }
-
- public void startEncoder () {
- if(mSdlEncoder != null) {
- mSdlEncoder.startEncoder();
- }
- }
-
- public void releaseEncoder() {
- if(mSdlEncoder != null) {
- mSdlEncoder.releaseEncoder();
- }
- }
-
- public void drainEncoder(boolean endOfStream) {
- if(mSdlEncoder != null) {
- mSdlEncoder.drainEncoder(endOfStream);
- }
- }
-
- @Override
- public void sendStreamPacket(ProtocolMessage pm) {
- sendMessage(pm);
- }
-
- public void setSdlSecurity(SdlSecurityBase sec) {
- sdlSecurity = sec;
- }
-
- public SdlSecurityBase getSdlSecurity() {
- return sdlSecurity;
- }
-
- public void startService (SessionType serviceType, byte sessionID, boolean isEncrypted) {
- if (_sdlConnection == null)
- return;
-
- if (isEncrypted)
- {
- if (sdlSecurity != null)
- {
- List<SessionType> serviceList = sdlSecurity.getServiceList();
- if (!serviceList.contains(serviceType))
- serviceList.add(serviceType);
-
- sdlSecurity.initialize();
- }
- return;
- }
- _sdlConnection.startService(serviceType, sessionID, isEncrypted);
- }
-
- public void endService (SessionType serviceType, byte sessionID) {
- if (_sdlConnection == null)
- return;
- _sdlConnection.endService(serviceType, sessionID);
- }
-
- protected void processControlService(ProtocolMessage msg) {
- if (sdlSecurity == null)
- return;
- int ilen = msg.getData().length - 12;
- byte[] data = new byte[ilen];
- System.arraycopy(msg.getData(), 12, data, 0, ilen);
-
- byte[] dataToRead = new byte[4096];
-
- Integer iNumBytes = sdlSecurity.runHandshake(data, dataToRead);
-
- if (iNumBytes == null || iNumBytes <= 0)
- return;
-
- byte[] returnBytes = new byte[iNumBytes];
- System.arraycopy(dataToRead, 0, returnBytes, 0, iNumBytes);
- ProtocolMessage protocolMessage = new ProtocolMessage();
- protocolMessage.setSessionType(SessionType.CONTROL);
- protocolMessage.setData(returnBytes);
- protocolMessage.setFunctionID(0x01);
- protocolMessage.setVersion(wiproProcolVer);
- protocolMessage.setSessionID(getSessionId());
-
- //sdlSecurity.hs();
-
- sendMessage(protocolMessage);
- }
-
- public String getBroadcastComment(BaseTransportConfig myTransport) {
- SdlConnection connection = null;
- if (myTransport.shareConnection()) {
- connection = findTheProperConnection(myTransport);
- } else {
- connection = this._sdlConnection;
- }
-
- if (connection != null)
- return connection.getBroadcastComment();
-
- return "";
- }
-
-
- public void startSession() throws SdlException {
- SdlConnection connection = null;
- if (this.transportConfig.shareConnection()) {
- connection = findTheProperConnection(this.transportConfig);
-
- if (connection == null) {
- connection = new SdlConnection(this.transportConfig);
- shareConnections.add(connection);
- }
- } else {
- connection = new SdlConnection(this.transportConfig);
- }
-
- this._sdlConnection = connection;
- connection.registerSession(this); //Handshake will start when register.
- }
-
- protected void initialiseSession() {
- if (_outgoingHeartbeatMonitor != null) {
- _outgoingHeartbeatMonitor.start();
- }
- if (_incomingHeartbeatMonitor != null) {
- _incomingHeartbeatMonitor.start();
- }
- }
-
- public void sendMessage(ProtocolMessage msg) {
- if (_sdlConnection == null)
- return;
- _sdlConnection.sendMessage(msg);
- }
-
- public TransportType getCurrentTransportType() {
- if (_sdlConnection == null)
- return null;
- return _sdlConnection.getCurrentTransportType();
- }
-
- public boolean getIsConnected() {
- if (_sdlConnection == null)
- return false;
- return _sdlConnection != null && _sdlConnection.getIsConnected();
- }
-
- public boolean isServiceProtected(SessionType sType) {
- return encryptedServices.contains(sType);
- }
-
- @Override
- public void onTransportDisconnected(String info) {
- this.sessionListener.onTransportDisconnected(info);
- }
-
- @Override
- public void onTransportDisconnected(String info, boolean availablePrimary, MultiplexTransportConfig transportConfig) {
- this.sessionListener.onTransportDisconnected(info);
- }
-
- @Override
- public void onTransportError(String info, Exception e) {
- this.sessionListener.onTransportError(info, e);
- }
-
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
- if (msg.getSessionType().equals(SessionType.CONTROL)) {
- processControlService(msg);
- return;
- }
-
- this.sessionListener.onProtocolMessageReceived(msg);
- }
-
- @Override
- public void onHeartbeatTimedOut(byte sessionID) {
- this.sessionListener.onHeartbeatTimedOut(sessionID);
-
- }
-
-
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
- this.sessionId = sessionID;
- lockScreenMan.setSessionID(sessionID);
- if (sessionType.eq(SessionType.RPC)){
- sessionHashId = hashID;
- wiproProcolVer = version;
- }
- if (isEncrypted)
- encryptedServices.addIfAbsent(sessionType);
- this.sessionListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
- if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
- CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
- for(ISdlServiceListener listener:listeners){
- listener.onServiceStarted(this, sessionType, isEncrypted);
- }
- }
- //if (version == 3)
- initialiseSession();
-
- }
-
- @Override
- public void onProtocolSessionEnded(SessionType sessionType, byte sessionID,
- String correlationID) {
- this.sessionListener.onProtocolSessionEnded(sessionType, sessionID, correlationID);
- if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
- CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
- for(ISdlServiceListener listener:listeners){
- listener.onServiceEnded(this, sessionType);
- }
- }
- encryptedServices.remove(sessionType);
- }
-
- @Override
- public void onProtocolError(String info, Exception e) {
- this.sessionListener.onProtocolError(info, e);
- }
-
- @Override
- public void sendHeartbeat(IHeartbeatMonitor monitor) {
- Log.d(TAG, "Asked to send heartbeat");
- if (_sdlConnection != null)
- _sdlConnection.sendHeartbeat(this);
- }
-
- @Override
- public void heartbeatTimedOut(IHeartbeatMonitor monitor) {
- if (_sdlConnection != null)
- _sdlConnection._connectionListener.onHeartbeatTimedOut(this.sessionId);
- close();
- }
-
- private static SdlConnection findTheProperConnection(BaseTransportConfig config) {
- SdlConnection connection = null;
-
- int minCount = 0;
- for (SdlConnection c : shareConnections) {
- if (c.getCurrentTransportType() == config.getTransportType()) {
- if (minCount == 0 || minCount >= c.getRegisterCount()) {
- connection = c;
- minCount = c.getRegisterCount();
- }
- }
- }
-
- return connection;
- }
-
- @Override
- public void onProtocolSessionStartedNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
- this.sessionListener.onProtocolSessionStartedNACKed(sessionType,
- sessionID, version, correlationID, rejectedParams);
- if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
- CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
- for(ISdlServiceListener listener:listeners){
- listener.onServiceError(this, sessionType, "Start "+ sessionType.toString() +" Service NACK'ed");
- }
- }
- }
-
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,
- byte sessionID, String correlationID) {
- this.sessionListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
- if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
- CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
- for(ISdlServiceListener listener:listeners){
- listener.onServiceError(this, sessionType, "End "+ sessionType.toString() +" Service NACK'ed");
- }
- }
- }
-
- @Override
- public void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID) {
- this.sessionListener.onProtocolServiceDataACK(sessionType, dataSize, sessionID);
- }
-
- @Override
- public void onSecurityInitialized() {
-
- if (_sdlConnection != null && sdlSecurity != null)
- {
- List<SessionType> list = sdlSecurity.getServiceList();
-
- SessionType service;
- ListIterator<SessionType> iter = list.listIterator();
-
- while (iter.hasNext()) {
- service = iter.next();
-
- if (service != null)
- _sdlConnection.startService(service, getSessionId(), true);
-
- iter.remove();
- }
- }
- }
-
- public void clearConnection(){
- _sdlConnection = null;
- }
-
- public void checkForOpenMultiplexConnection(SdlConnection connection){
- removeConnection(connection);
- connection.unregisterSession(this);
- _sdlConnection = null;
- for (SdlConnection c : shareConnections) {
- if (c.getCurrentTransportType() == TransportType.MULTIPLEX) {
- if(c.getIsConnected() || ((MultiplexTransport)c._transport).isPendingConnected()){
- _sdlConnection = c;
- try {
- _sdlConnection.registerSession(this);//Handshake will start when register.
- } catch (SdlException e) {
- e.printStackTrace();
- }
- return;
- }
-
- }
- }
- }
- public static boolean removeConnection(SdlConnection connection){
- return shareConnections.remove(connection);
- }
-
- public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
- if(serviceListeners == null){
- serviceListeners = new HashMap<>();
- }
- if(serviceType != null && sdlServiceListener != null){
- if(!serviceListeners.containsKey(serviceType)){
- serviceListeners.put(serviceType,new CopyOnWriteArrayList<ISdlServiceListener>());
- }
- serviceListeners.get(serviceType).add(sdlServiceListener);
- }
- }
-
- public boolean removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
- if(serviceListeners!= null && serviceType != null && sdlServiceListener != null && serviceListeners.containsKey(serviceType)){
- return serviceListeners.get(serviceType).remove(sdlServiceListener);
- }
- return false;
- }
-
-
- public HashMap<SessionType, CopyOnWriteArrayList<ISdlServiceListener>> getServiceListeners(){
- return serviceListeners;
- }
-
- public void setDesiredVideoParams(VideoStreamingParameters params){
- this.desiredVideoParams = params;
- }
-
- /**
- * Returns the currently set desired video streaming parameters. If there haven't been any set,
- * the default options will be returned and set for this instance.
- * @return
- */
- public VideoStreamingParameters getDesiredVideoParams(){
- if(desiredVideoParams == null){
- desiredVideoParams = new VideoStreamingParameters();
- }
- return desiredVideoParams;
- }
-
- public void setAcceptedVideoParams(VideoStreamingParameters params){
- this.acceptedVideoParams = params;
- }
-
- public VideoStreamingParameters getAcceptedVideoParams(){
- return acceptedVideoParams;
- }
-
- private VideoStreamingProtocol getAcceptedProtocol() {
- // acquire default protocol (RAW)
- VideoStreamingProtocol protocol = new VideoStreamingParameters().getFormat().getProtocol();
-
- if (acceptedVideoParams != null) {
- VideoStreamingFormat format = acceptedVideoParams.getFormat();
- if (format != null && format.getProtocol() != null) {
- protocol = format.getProtocol();
- }
- }
-
- return protocol;
- }
-
- public Version getProtocolVersion(){
- //Since this session version never supported a minor protocol version this should be fine
- return new Version(wiproProcolVer,0,0);
- }
-
- /**
- * Check to see if a transport is available to start/use the supplied service.
- * @param sessionType the session that should be checked for transport availability
- * @return true if there is either a supported
- * transport currently connected or a transport is
- * available to connect with for the supplied service type.
- * <br>false if there is no
- * transport connected to support the service type in question and
- * no possibility in the foreseeable future.
- */
- public boolean isTransportForServiceAvailable(SessionType sessionType){
- return _sdlConnection!= null
- && _sdlConnection._transport!= null
- && _sdlConnection._transport.getIsConnected()
- && ((sessionType == SessionType.RPC || sessionType == SessionType.CONTROL || sessionType == SessionType.BULK_DATA ) //If this is a service that can run on any transport just return true
- || (_sdlConnection._transport.getTransportType() == TransportType.USB || _sdlConnection._transport.getTransportType() == TransportType.TCP));
- }
-
-
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java b/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java
deleted file mode 100644
index 497e3da95..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession2.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.SdlConnection;
-
-import android.util.Log;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.protocol.ISdlProtocol;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.protocol.SdlProtocol;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitor;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.util.Version;
-
-import java.util.List;
-import java.util.ListIterator;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-@SuppressWarnings({"WeakerAccess", "deprecation"})
-public class SdlSession2 extends SdlSession implements ISdlProtocol{
- private static final String TAG = "SdlSession2";
-
-
- final protected SdlProtocol sdlProtocol;
-
- @SuppressWarnings("SameReturnValue")
- @Deprecated
- public static SdlSession2 createSession(byte protocolVersion, ISdlConnectionListener listener, BaseTransportConfig btConfig) {
- return null;
- }
-
- public SdlSession2(ISdlConnectionListener listener, MultiplexTransportConfig config){
- this.transportConfig = config;
- this.sessionListener = listener;
- this.sdlProtocol = new SdlProtocol(this,config);
-
- }
-
- @Deprecated
- @Override
- public SdlConnection getSdlConnection() {
- return null;
- }
-
- @Override
- public int getMtu(){
- if(this.sdlProtocol!=null){
- return this.sdlProtocol.getMtu();
- }else{
- return 0;
- }
- }
-
- @Override
- public long getMtu(SessionType type) {
- if (this.sdlProtocol != null) {
- return this.sdlProtocol.getMtu(type);
- } else {
- return 0;
- }
- }
-
- public void close() {
- if (sdlSecurity != null)
- {
- sdlSecurity.resetParams();
- sdlSecurity.shutDown();
- }
- if(sdlProtocol != null){
- sdlProtocol.endSession(sessionId, sessionHashId);
- }
- }
-
-
- @SuppressWarnings("ConstantConditions")
- @Override
- public void startService (SessionType serviceType, byte sessionID, boolean isEncrypted) {
- if (isEncrypted){
- if (sdlSecurity != null){
- List<SessionType> serviceList = sdlSecurity.getServiceList();
- if (!serviceList.contains(serviceType))
- serviceList.add(serviceType);
-
- sdlSecurity.initialize();
- }
- return;
- }
- sdlProtocol.startService(serviceType, sessionID, isEncrypted);
- }
-
- @Override
- public void endService (SessionType serviceType, byte sessionID) {
- if (sdlProtocol == null) {
- return;
- }
- sdlProtocol.endService(serviceType,sessionID);
- }
-
-
- public String getBroadcastComment(BaseTransportConfig myTransport) {
- return "Multiplexing";
- }
-
-
- @SuppressWarnings("RedundantThrows")
- @Override
- public void startSession() throws SdlException {
- sdlProtocol.start();
- }
-
-
- @Override
- public void sendMessage(ProtocolMessage msg) {
- if (sdlProtocol == null){
- return;
- }
- sdlProtocol.sendMessage(msg);
- }
-
- @Override
- public TransportType getCurrentTransportType() {
- return TransportType.MULTIPLEX;
- }
-
- @Override
- public boolean getIsConnected() {
- return sdlProtocol != null && sdlProtocol.isConnected();
- }
-
-
- public void shutdown(String info){
- Log.d(TAG, "Shutdown - " + info);
- this.sessionListener.onTransportDisconnected(info);
-
- }
-
- @Override
- public void onTransportDisconnected(String info, boolean altTransportAvailable, MultiplexTransportConfig transportConfig) {
- this.sessionListener.onTransportDisconnected(info, altTransportAvailable, (MultiplexTransportConfig)this.transportConfig);
- }
-
- /**
- * Get the current protocol version used by this session
- * @return Version that represents the Protocol version being used
- */
- @Override
- public Version getProtocolVersion(){
- if(sdlProtocol!=null){
- return sdlProtocol.getProtocolVersion();
- }
- return new Version(1,0,0);
- }
-
-
- /* ***********************************************************************************************************************************************************************
- * ***************************************************************** IProtocol Listener ********************************************************************************
- *************************************************************************************************************************************************************************/
-
- @Override
- public void onProtocolMessageBytesToSend(SdlPacket packet) {
- //Log.d(TAG, "onProtocolMessageBytesToSend - " + packet.getTransportType());
- sdlProtocol.sendPacket(packet);
- }
-
-
- public void onProtocolSessionStartedNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams){
- onProtocolSessionNACKed(sessionType,sessionID,version,correlationID,rejectedParams);
- }
-
- @Override
- public void onProtocolSessionNACKed(SessionType sessionType, byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
- this.sessionListener.onProtocolSessionStartedNACKed(sessionType,
- sessionID, version, correlationID, rejectedParams);
- if(serviceListeners != null && serviceListeners.containsKey(sessionType)){
- CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(sessionType);
- for(ISdlServiceListener listener:listeners){
- listener.onServiceError(this, sessionType, "Start "+ sessionType.toString() +" Service NAKed");
- }
- }
- }
-
- /* Not supported methods from IProtocolListener */
- @Override
- public void sendHeartbeat(IHeartbeatMonitor monitor) {/* Not supported */ }
- @Override
- public void heartbeatTimedOut(IHeartbeatMonitor monitor) {/* Not supported */}
- @Override
- public void onHeartbeatTimedOut(byte sessionId){ /* Not supported */}
- @Override
- public void onProtocolHeartbeat(SessionType sessionType, byte sessionID) { /* Not supported */}
- @Override
- public void onProtocolHeartbeatACK(SessionType sessionType, byte sessionID) {/* Not supported */}
- @Override
- public void onResetOutgoingHeartbeat(SessionType sessionType, byte sessionID) {/* Not supported */}
- @Override
- public void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID) {/* Not supported */}
-
- /* ***********************************************************************************************************************************************************************
- * ***************************************************************** Security Listener *********************************************************************************
- *************************************************************************************************************************************************************************/
-
-
- @Override
- public void onSecurityInitialized() {
-
- if (sdlProtocol != null && sdlSecurity != null)
- {
- List<SessionType> list = sdlSecurity.getServiceList();
-
- SessionType service;
- ListIterator<SessionType> iter = list.listIterator();
-
- while (iter.hasNext()) {
- service = iter.next();
-
- if (service != null)
- sdlProtocol.startService(service, getSessionId(), true);
-
- iter.remove();
- }
- }
- }
-
- @Override
- public void stopStream(SessionType serviceType) {
- if(SessionType.NAV.equals(serviceType)){
- stopVideoStream();
- }else if(SessionType.PCM.equals(serviceType)){
- stopAudioStream();
- }
-
- }
-
- /**
- * Check to see if a transport is available to start/use the supplied service.
- * @param sessionType the session that should be checked for transport availability
- * @return true if there is either a supported
- * transport currently connected or a transport is
- * available to connect with for the supplied service type.
- * <br>false if there is no
- * transport connected to support the service type in question and
- * no possibility in the foreseeable future.
- */
- @Override
- public boolean isTransportForServiceAvailable(SessionType sessionType){
- return sdlProtocol!=null && sdlProtocol.isTransportForServiceAvailable(sessionType);
- }
-
-
- @Override
- @Deprecated
- public void clearConnection(){/* Not supported */}
-
- @SuppressWarnings("SameReturnValue")
- @Deprecated
- public static boolean removeConnection(SdlConnection connection){/* Not supported */ return false;}
-
- @Deprecated
- @Override
- public void checkForOpenMultiplexConnection(SdlConnection connection){/* Not supported */}
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java b/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java
deleted file mode 100644
index 6c9198cb4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java
+++ /dev/null
@@ -1,241 +0,0 @@
-package com.smartdevicelink.encoder;
-
-import java.io.IOException;
-import java.io.PipedOutputStream;
-import java.nio.ByteBuffer;
-
-import android.annotation.TargetApi;
-import android.media.MediaCodec;
-import android.media.MediaCodecInfo;
-import android.media.MediaFormat;
-import android.os.Build;
-import android.util.Log;
-import android.view.Surface;
-
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
-
-@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
-public class SdlEncoder {
-
- private static final String TAG = "SdlEncoder";
-
- // parameters for the encoder
- private static final String _MIME_TYPE = "video/avc"; // H.264/AVC video
- private static final long KEEPALIVE_INTERVAL_MSEC = 100;
-
- // private static final String MIME_TYPE = "video/mp4v-es"; //MPEG4 video
- private int frameRate = 30;
- private int frameInterval = 5;
- private int frameWidth = 800;
- private int frameHeight = 480;
- private int bitrate = 6000000;
-
- // encoder state
- private MediaCodec mEncoder;
- private PipedOutputStream mOutputStream;
- private IVideoStreamListener mOutputListener;
- private long mLastEmittedFrameTimestamp;
-
- // allocate one of these up front so we don't need to do it every time
- private MediaCodec.BufferInfo mBufferInfo;
-
- // Codec-specific data (SPS and PPS)
- private byte[] mH264CodecSpecificData = null;
-
- public SdlEncoder () {
- }
- public void setFrameRate(int iVal){
- frameRate = iVal;
- }
- public void setFrameInterval(int iVal){
- frameInterval = iVal;
- }
- public void setFrameWidth(int iVal){
- frameWidth = iVal;
- }
- public void setFrameHeight(int iVal){
- frameHeight = iVal;
- }
- public void setBitrate(int iVal){
- bitrate = iVal;
- }
- public void setOutputStream(PipedOutputStream mStream){
- mOutputStream = mStream;
- }
- public void setOutputListener(IVideoStreamListener listener) {
- mOutputListener = listener;
- }
- public Surface prepareEncoder () {
-
- mBufferInfo = new MediaCodec.BufferInfo();
-
- MediaFormat format = MediaFormat.createVideoFormat(_MIME_TYPE, frameWidth,
- frameHeight);
-
- // Set some properties. Failing to specify some of these can cause the
- // MediaCodec
- // configure() call to throw an unhelpful exception.
- format.setInteger(MediaFormat.KEY_COLOR_FORMAT,
- MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
- format.setInteger(MediaFormat.KEY_BIT_RATE, bitrate);
- format.setInteger(MediaFormat.KEY_FRAME_RATE, frameRate);
- format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, frameInterval);
-
- // Create a MediaCodec encoder, and configure it with our format. Get a
- // Surface
- // we can use for input and wrap it with a class that handles the EGL
- // work.
- //
- // If you want to have two EGL contexts -- one for display, one for
- // recording --
- // you will likely want to defer instantiation of CodecInputSurface
- // until after the
- // "display" EGL context is created, then modify the eglCreateContext
- // call to
- // take eglGetCurrentContext() as the share_context argument.
- try {
- mEncoder = MediaCodec.createEncoderByType(_MIME_TYPE);
- } catch (Exception e) {e.printStackTrace();}
-
- if(mEncoder != null) {
- mEncoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
- return mEncoder.createInputSurface();
- } else {
- return null;
- }
- }
-
- public void startEncoder () {
- if(mEncoder != null) {
- mEncoder.start();
- }
- }
-
- /**
- * Releases encoder resources.
- */
- public void releaseEncoder() {
- if (mEncoder != null) {
- mEncoder.stop();
- mEncoder.release();
- mEncoder = null;
- }
- if (mOutputStream != null) {
- try {
- mOutputStream.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- mOutputStream = null;
- }
- mH264CodecSpecificData = null;
- }
-
- /**
- * Extracts all pending data from the encoder
- * <p>
- * If endOfStream is not set, this returns when there is no more data to
- * drain. If it is set, we send EOS to the encoder, and then iterate until
- * we see EOS on the output. Calling this with endOfStream set should be
- * done once, right before stopping the muxer.
- */
- public void drainEncoder(boolean endOfStream) {
- final int TIMEOUT_USEC = 10000;
-
- if(mEncoder == null || (mOutputStream == null && mOutputListener == null)) {
- return;
- }
- if (endOfStream) {
- mEncoder.signalEndOfInputStream();
- }
-
- ByteBuffer[] encoderOutputBuffers = mEncoder.getOutputBuffers();
- while (true) {
- int encoderStatus = mEncoder.dequeueOutputBuffer(mBufferInfo,
- TIMEOUT_USEC);
- if (encoderStatus == MediaCodec.INFO_TRY_AGAIN_LATER) {
- // no output available yet
- if (!endOfStream) {
- trySendVideoKeepalive();
- break; // out of while
- }
- } else if (encoderStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
- // not expected for an encoder
- encoderOutputBuffers = mEncoder.getOutputBuffers();
- } else if (encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
- if (mH264CodecSpecificData == null) {
- MediaFormat format = mEncoder.getOutputFormat();
- mH264CodecSpecificData = EncoderUtils.getCodecSpecificData(format);
- } else {
- Log.w(TAG, "Output format change notified more than once, ignoring.");
- }
- } else if (encoderStatus < 0) {
- } else {
- if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {
- // If we already retrieve codec specific data via OUTPUT_FORMAT_CHANGED event,
- // we do not need this data.
- if (mH264CodecSpecificData != null) {
- mBufferInfo.size = 0;
- } else {
- Log.i(TAG, "H264 codec specific data not retrieved yet.");
- }
- }
-
- if (mBufferInfo.size != 0) {
- ByteBuffer encoderOutputBuffer = encoderOutputBuffers[encoderStatus];
- byte[] dataToWrite = null;
- int dataOffset = 0;
-
- // append SPS and PPS in front of every IDR NAL unit
- if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0
- && mH264CodecSpecificData != null) {
- dataToWrite = new byte[mH264CodecSpecificData.length + mBufferInfo.size];
- System.arraycopy(mH264CodecSpecificData, 0,
- dataToWrite, 0, mH264CodecSpecificData.length);
- dataOffset = mH264CodecSpecificData.length;
- } else {
- dataToWrite = new byte[mBufferInfo.size];
- }
-
- try {
- encoderOutputBuffer.position(mBufferInfo.offset);
- encoderOutputBuffer.limit(mBufferInfo.offset + mBufferInfo.size);
-
- encoderOutputBuffer.get(dataToWrite, dataOffset, mBufferInfo.size);
-
- emitFrame(dataToWrite);
- } catch (Exception e) {}
- }
-
- mEncoder.releaseOutputBuffer(encoderStatus, false);
-
- if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
- break; // out of while
- }
- }
- }
- }
-
- private void trySendVideoKeepalive() {
- if (mH264CodecSpecificData == null) {
- return;
- }
-
- try {
- long timeSinceLastEmitted = System.currentTimeMillis() - mLastEmittedFrameTimestamp;
- if (timeSinceLastEmitted >= KEEPALIVE_INTERVAL_MSEC) {
- emitFrame(mH264CodecSpecificData);
- }
- } catch (IOException e) {}
- }
-
- private void emitFrame(final byte[] dataToWrite) throws IOException {
- if (mOutputStream != null) {
- mOutputStream.write(dataToWrite, 0, mBufferInfo.size);
- } else if (mOutputListener != null) {
- mOutputListener.sendFrame(
- dataToWrite, 0, dataToWrite.length, mBufferInfo.presentationTimeUs);
- }
- mLastEmittedFrameTimestamp = System.currentTimeMillis();
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java b/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java
deleted file mode 100644
index 0fe303c71..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * Copyright (c) 2017 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.encoder;
-
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.hardware.display.DisplayManager;
-import android.hardware.display.VirtualDisplay;
-import android.media.MediaCodec;
-import android.media.MediaCodecInfo;
-import android.media.MediaFormat;
-import android.os.Build;
-import android.util.Log;
-import android.view.Display;
-import android.view.Surface;
-
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
-import com.smartdevicelink.proxy.rpc.ImageResolution;
-import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-
-import java.nio.ByteBuffer;
-
-@TargetApi(19)
-@SuppressWarnings("NullableProblems")
-public class VirtualDisplayEncoder {
- private static final String TAG = "VirtualDisplayEncoder";
- private VideoStreamingParameters streamingParams = new VideoStreamingParameters();
- private DisplayManager mDisplayManager;
- private volatile MediaCodec mVideoEncoder = null;
- private volatile MediaCodec.BufferInfo mVideoBufferInfo = null;
- private volatile Surface inputSurface = null;
- private volatile VirtualDisplay virtualDisplay = null;
- private IVideoStreamListener mOutputListener;
- private Boolean initPassed = false;
- private final Object STREAMING_LOCK = new Object();
-
- // Codec-specific data (SPS and PPS)
- private byte[] mH264CodecSpecificData = null;
-
- //For older (<21) OS versions
- private Thread encoderThread;
-
-
- /**
- * Initialization method for VirtualDisplayEncoder object. MUST be called before start() or shutdown()
- * Will overwrite previously set videoWeight and videoHeight
- * @param context to create the virtual display
- * @param outputListener the listener that the video frames will be sent through
- * @param streamingParams parameters to create the virtual display and encoder
- * @throws Exception if the API level is <19 or supplied parameters were null
- */
- public void init(Context context, IVideoStreamListener outputListener, VideoStreamingParameters streamingParams) throws Exception {
- if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- Log.e(TAG, "API level of 19 required for VirtualDisplayEncoder");
- throw new Exception("API level of 19 required");
- }
-
- if (context == null || outputListener == null || streamingParams == null || streamingParams.getResolution() == null || streamingParams.getFormat() == null) {
- Log.e(TAG, "init parameters cannot be null for VirtualDisplayEncoder");
- throw new Exception("init parameters cannot be null");
- }
-
- this.mDisplayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
-
- this.streamingParams.update(streamingParams);
-
- mOutputListener = outputListener;
-
- initPassed = true;
- }
-
- @SuppressWarnings("unused")
- public VideoStreamingParameters getStreamingParams(){
- return this.streamingParams;
- }
-
- @SuppressWarnings("unused")
- public void setStreamingParams(int displayDensity, ImageResolution resolution, int frameRate, int bitrate, int interval, VideoStreamingFormat format) {
- this.streamingParams = new VideoStreamingParameters(displayDensity, frameRate, bitrate, interval, resolution, format);
- }
-
- @SuppressWarnings("unused")
- public void setStreamingParams(VideoStreamingParameters streamingParams) {
- this.streamingParams = streamingParams;
- }
-
- /**
- * NOTE: Must call init() without error before calling this method.
- * Prepares the encoder and virtual display.
- */
- public void start() throws Exception {
- if (!initPassed) {
- Log.e(TAG, "VirtualDisplayEncoder was not properly initialized with the init() method.");
- return;
- }
- if (streamingParams == null || streamingParams.getResolution() == null || streamingParams.getFormat() == null) {
- return;
- }
-
- synchronized (STREAMING_LOCK) {
-
- try {
- inputSurface = prepareVideoEncoder();
-
- // Create a virtual display that will output to our encoder.
- virtualDisplay = mDisplayManager.createVirtualDisplay(TAG,
- streamingParams.getResolution().getResolutionWidth(), streamingParams.getResolution().getResolutionHeight(),
- streamingParams.getDisplayDensity(), inputSurface, DisplayManager.VIRTUAL_DISPLAY_FLAG_PRESENTATION);
-
- startEncoder();
-
- } catch (Exception ex) {
- Log.e(TAG, "Unable to create Virtual Display.");
- throw new RuntimeException(ex);
- }
- }
- }
-
- public void shutDown() {
- if (!initPassed) {
- Log.e(TAG, "VirtualDisplayEncoder was not properly initialized with the init() method.");
- return;
- }
- try {
- if (encoderThread != null) {
- encoderThread.interrupt();
- encoderThread = null;
- }
-
- if (mVideoEncoder != null) {
- mVideoEncoder.stop();
- mVideoEncoder.release();
- mVideoEncoder = null;
- }
-
- if (virtualDisplay != null) {
- virtualDisplay.release();
- virtualDisplay = null;
- }
-
- if (inputSurface != null) {
- inputSurface.release();
- inputSurface = null;
- }
- } catch (Exception ex) {
- Log.e(TAG, "shutDown() failed");
- }
- }
-
- private Surface prepareVideoEncoder() {
-
- if (streamingParams == null || streamingParams.getResolution() == null || streamingParams.getFormat() == null) {
- return null;
- }
-
- if (mVideoBufferInfo == null) {
- mVideoBufferInfo = new MediaCodec.BufferInfo();
- }
-
- String videoMimeType = getMimeForFormat(streamingParams.getFormat());
-
- MediaFormat format = MediaFormat.createVideoFormat(videoMimeType, streamingParams.getResolution().getResolutionWidth(), streamingParams.getResolution().getResolutionHeight());
-
- // Set some required properties. The media codec may fail if these aren't defined.
- format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
- format.setInteger(MediaFormat.KEY_BIT_RATE, streamingParams.getBitrate());
- format.setInteger(MediaFormat.KEY_FRAME_RATE, streamingParams.getFrameRate());
- format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, streamingParams.getInterval()); // seconds between I-frames
-
-
- // Create a MediaCodec encoder and configure it. Get a Surface we can use for recording into.
- try {
- mVideoEncoder = MediaCodec.createEncoderByType(videoMimeType);
- mVideoEncoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
- Surface surface = mVideoEncoder.createInputSurface(); //prepared
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- mVideoEncoder.setCallback(new MediaCodec.Callback() {
- @Override
- public void onInputBufferAvailable(MediaCodec codec, int index) {
- // nothing to do here
- }
-
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
- @Override
- public void onOutputBufferAvailable(MediaCodec codec, int index, MediaCodec.BufferInfo info) {
- try {
- ByteBuffer encodedData = codec.getOutputBuffer(index);
- if (encodedData != null) {
- if (info.size != 0) {
- byte[] dataToWrite;// = new byte[info.size];
- int dataOffset = 0;
-
- // append SPS and PPS in front of every IDR NAL unit
- if ((info.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0 && mH264CodecSpecificData != null) {
- dataToWrite = new byte[mH264CodecSpecificData.length + info.size];
- System.arraycopy(mH264CodecSpecificData, 0, dataToWrite, 0, mH264CodecSpecificData.length);
- dataOffset = mH264CodecSpecificData.length;
- } else {
- dataToWrite = new byte[info.size];
- }
-
- encodedData.position(info.offset);
- encodedData.limit(info.offset + info.size);
-
- encodedData.get(dataToWrite, dataOffset, info.size);
- if (mOutputListener != null) {
- mOutputListener.sendFrame(dataToWrite, 0, dataToWrite.length, info.presentationTimeUs);
- }
- }
-
- codec.releaseOutputBuffer(index, false);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- @Override
- public void onError(MediaCodec codec, MediaCodec.CodecException e) {
- e.printStackTrace();
- }
-
- @Override
- public void onOutputFormatChanged(MediaCodec codec, MediaFormat format) {
- mH264CodecSpecificData = EncoderUtils.getCodecSpecificData(format);
- }
- });
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- //Implied from previous if check that this has to be older than Build.VERSION_CODES.LOLLIPOP
- encoderThread = new Thread(new EncoderCompat());
-
- } else {
- Log.e(TAG, "Unable to start encoder. Android OS version " + Build.VERSION.SDK_INT + "is not supported");
- }
-
- return surface;
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return null;
- }
-
- private void startEncoder() {
- if (mVideoEncoder != null) {
- mVideoEncoder.start();
- }
- if (encoderThread != null) {
- encoderThread.start();
- }
- }
-
- public Display getVirtualDisplay() {
- return virtualDisplay.getDisplay();
- }
-
- private String getMimeForFormat(VideoStreamingFormat format) {
- if (format != null) {
- VideoStreamingCodec codec = format.getCodec();
- if (codec != null) {
- switch (codec) { //MediaFormat constants are only available in Android 21+
- case VP8:
- return "video/x-vnd.on2.vp8"; //MediaFormat.MIMETYPE_VIDEO_VP8
- case VP9:
- return "video/x-vnd.on2.vp9"; //MediaFormat.MIMETYPE_VIDEO_VP9
- case H264: //Fall through
- default:
- return "video/avc"; // MediaFormat.MIMETYPE_VIDEO_AVC
- }
- }
- }
- return null;
- }
-
- private class EncoderCompat implements Runnable {
-
- @Override
- public void run() {
- try {
- drainEncoder(false);
- } catch (Exception e) {
- Log.w(TAG, "Error attempting to drain encoder");
- } finally {
- mVideoEncoder.release();
- }
- }
-
- @SuppressWarnings("deprecation")
- void drainEncoder(boolean endOfStream) {
- if (mVideoEncoder == null || mOutputListener == null) {
- return;
- }
-
- if (endOfStream) {
- mVideoEncoder.signalEndOfInputStream();
- }
-
- ByteBuffer[] encoderOutputBuffers = mVideoEncoder.getOutputBuffers();
- Thread currentThread = Thread.currentThread();
- while (!currentThread.isInterrupted()) {
- int encoderStatus = mVideoEncoder.dequeueOutputBuffer(mVideoBufferInfo, -1);
- if(encoderStatus < 0){
- if (encoderStatus == MediaCodec.INFO_TRY_AGAIN_LATER) {
- // no output available yet
- if (!endOfStream) {
- break; // out of while
- }
- } else if (encoderStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
- // not expected for an encoder
- encoderOutputBuffers = mVideoEncoder.getOutputBuffers();
- } else if (encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
- if (mH264CodecSpecificData == null) {
- MediaFormat format = mVideoEncoder.getOutputFormat();
- mH264CodecSpecificData = EncoderUtils.getCodecSpecificData(format);
- } else {
- Log.w(TAG, "Output format change notified more than once, ignoring.");
- }
- }
- } else {
- if ((mVideoBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {
- // If we already retrieve codec specific data via OUTPUT_FORMAT_CHANGED event,
- // we do not need this data.
- if (mH264CodecSpecificData != null) {
- mVideoBufferInfo.size = 0;
- } else {
- Log.i(TAG, "H264 codec specific data not retrieved yet.");
- }
- }
-
- if (mVideoBufferInfo.size != 0) {
- ByteBuffer encoderOutputBuffer = encoderOutputBuffers[encoderStatus];
- byte[] dataToWrite;
- int dataOffset = 0;
-
- // append SPS and PPS in front of every IDR NAL unit
- if ((mVideoBufferInfo.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0 && mH264CodecSpecificData != null) {
- dataToWrite = new byte[mH264CodecSpecificData.length + mVideoBufferInfo.size];
- System.arraycopy(mH264CodecSpecificData, 0, dataToWrite, 0, mH264CodecSpecificData.length);
- dataOffset = mH264CodecSpecificData.length;
- } else {
- dataToWrite = new byte[mVideoBufferInfo.size];
- }
-
- try {
- encoderOutputBuffer.position(mVideoBufferInfo.offset);
- encoderOutputBuffer.limit(mVideoBufferInfo.offset + mVideoBufferInfo.size);
-
- encoderOutputBuffer.get(dataToWrite, dataOffset, mVideoBufferInfo.size);
-
- if (mOutputListener != null) {
- mOutputListener.sendFrame(dataToWrite, 0, dataToWrite.length, mVideoBufferInfo.presentationTimeUs);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- mVideoEncoder.releaseOutputBuffer(encoderStatus, false);
-
- if ((mVideoBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {
- break; // out of while
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/exception/SdlException.java b/sdl_android/src/main/java/com/smartdevicelink/exception/SdlException.java
deleted file mode 100644
index a67549515..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/exception/SdlException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.exception;
-
-
-public class SdlException extends Exception {
-
- private static final long serialVersionUID = 5922492291870772815L;
-
- protected Throwable detail = null;
- private SdlExceptionCause _sdlExceptionCause = null;
-
- public SdlException(String msg, SdlExceptionCause exceptionCause) {
- super(msg);
- _sdlExceptionCause = exceptionCause;
- }
-
- public SdlException(String msg, Throwable ex, SdlExceptionCause exceptionCause) {
- super(msg + " --- Check inner exception for diagnostic details");
- detail = ex;
- _sdlExceptionCause = exceptionCause;
- }
-
- public SdlException(Throwable ex) {
- super(ex.getMessage());
- detail = ex;
- }
-
- public SdlExceptionCause getSdlExceptionCause() {
- return _sdlExceptionCause;
- }
-
- public Throwable getInnerException() {
- return detail;
- }
-
- public String toString() {
- String ret = this.getClass().getName();
- ret += ": " + this.getMessage();
- if(this.getSdlExceptionCause() != null){
- ret += "\nSdlExceptionCause: " + this.getSdlExceptionCause().name();
- }
- if (detail != null) {
- ret += "\nnested: " + detail.toString();
- detail.printStackTrace();
- }
- return ret;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/exception/SdlExceptionCause.java b/sdl_android/src/main/java/com/smartdevicelink/exception/SdlExceptionCause.java
deleted file mode 100644
index 4894ceca3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/exception/SdlExceptionCause.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.smartdevicelink.exception;
-
-public enum SdlExceptionCause {
- BLUETOOTH_ADAPTER_NULL,
- BLUETOOTH_DISABLED,
- BLUETOOTH_SOCKET_UNAVAILABLE,
- HEARTBEAT_PAST_DUE,
- INCORRECT_LIFECYCLE_MODEL,
- INVALID_ARGUMENT,
- INVALID_RPC_PARAMETER,
- PERMISSION_DENIED,
- RESERVED_CORRELATION_ID,
- SDL_CONNECTION_FAILED,
- SDL_PROXY_CYCLED,
- SDL_PROXY_DISPOSED,
- SDL_PROXY_OBSOLETE,
- SDL_REGISTRATION_ERROR,
- SDL_UNAVAILABLE,
- INVALID_HEADER,
- DATA_BUFFER_NULL,
- SDL_USB_DETACHED,
- SDL_USB_PERMISSION_DENIED,
- LOCK_SCREEN_ICON_NOT_SUPPORTED,
- ;
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/BaseSubManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
deleted file mode 100644
index 6475b481e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.managers;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-import java.util.List;
-
-/**
- * <strong>BaseSubManager</strong> <br>
- *
- * Note: This class is extended by SubManagers <br>
- *
- * It is broken down to these areas: <br>
- *
- * 1. <br>
- */
-public abstract class BaseSubManager {
-
- // states - if this gets more complicated we can move elsewhere
- private int state;
- private final Object STATE_LOCK = new Object();
- public static final int SETTING_UP = 0x00, READY = 0x30, LIMITED = 0x50, SHUTDOWN = 0x80, ERROR = 0xC0;
- protected final ISdl internalInterface;
- private CompletionListener completionListener;
-
- public BaseSubManager(@NonNull ISdl internalInterface){
- this.internalInterface = internalInterface;
- transitionToState(SETTING_UP);
- }
-
- /**
- * Starts up a BaseSubManager, and calls provided callback once BaseSubManager is done setting up or failed setup.
- * @param listener CompletionListener that is called once the BaseSubManager's state is READY, LIMITED, or ERROR
- */
- public void start(CompletionListener listener){
- this.completionListener = listener;
- int state = getState();
- if((state == READY || state == LIMITED || state == ERROR) && completionListener != null){
- completionListener.onComplete(state == READY || state == LIMITED);
- completionListener = null;
- }
- }
-
- /**
- * <p>Called when manager is being torn down</p>
- */
- public void dispose(){
- transitionToState(SHUTDOWN);
- }
-
- protected void transitionToState(int state) {
- synchronized (STATE_LOCK) {
- this.state = state;
- }
- if((state == READY || state == LIMITED || state == ERROR) && completionListener != null ){
- completionListener.onComplete(state == READY || state == LIMITED);
- completionListener = null;
- }
- }
-
- public int getState() {
- synchronized (STATE_LOCK) {
- return state;
- }
- }
-
- //This allows the method to not be exposed to developers
- protected void handleTransportUpdated(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail){
- this.onTransportUpdate(connectedTransports,audioStreamTransportAvail,videoStreamTransportAvail);
- }
-
- /**
- * Transport status has been updated
- * @param connectedTransports currently connected transports
- * @param audioStreamTransportAvail if there is a transport that could be used to carry the
- * audio service
- * @param videoStreamTransportAvail if there is a transport that could be used to carry the
- * video service
- */
- protected void onTransportUpdate(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail){}
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/CompletionListener.java b/sdl_android/src/main/java/com/smartdevicelink/managers/CompletionListener.java
deleted file mode 100644
index 93e618dae..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/CompletionListener.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.smartdevicelink.managers;
-
-public interface CompletionListener {
-
- /**
- * Returns whether a specific operation was successful or not
- * @param success - success or fail
- */
- void onComplete(boolean success);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java b/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java
deleted file mode 100644
index b8d97f39c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java
+++ /dev/null
@@ -1,560 +0,0 @@
-package com.smartdevicelink.managers;
-
-import android.util.SparseArray;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.IProxyListener;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
-import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
-import com.smartdevicelink.proxy.rpc.AddCommandResponse;
-import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
-import com.smartdevicelink.proxy.rpc.AlertResponse;
-import com.smartdevicelink.proxy.rpc.ButtonPressResponse;
-import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
-import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
-import com.smartdevicelink.proxy.rpc.DialNumberResponse;
-import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
-import com.smartdevicelink.proxy.rpc.GenericResponse;
-import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
-import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
-import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.GetWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.ListFilesResponse;
-import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered;
-import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
-import com.smartdevicelink.proxy.rpc.OnButtonEvent;
-import com.smartdevicelink.proxy.rpc.OnButtonPress;
-import com.smartdevicelink.proxy.rpc.OnCommand;
-import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.OnHashChange;
-import com.smartdevicelink.proxy.rpc.OnInteriorVehicleData;
-import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
-import com.smartdevicelink.proxy.rpc.OnLanguageChange;
-import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
-import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.OnRCStatus;
-import com.smartdevicelink.proxy.rpc.OnStreamRPC;
-import com.smartdevicelink.proxy.rpc.OnSystemRequest;
-import com.smartdevicelink.proxy.rpc.OnTBTClientState;
-import com.smartdevicelink.proxy.rpc.OnTouchEvent;
-import com.smartdevicelink.proxy.rpc.OnVehicleData;
-import com.smartdevicelink.proxy.rpc.OnWayPointChange;
-import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
-import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
-import com.smartdevicelink.proxy.rpc.PutFileResponse;
-import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
-import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
-import com.smartdevicelink.proxy.rpc.SendHapticDataResponse;
-import com.smartdevicelink.proxy.rpc.SendLocationResponse;
-import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
-import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.SetInteriorVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
-import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
-import com.smartdevicelink.proxy.rpc.ShowResponse;
-import com.smartdevicelink.proxy.rpc.SliderResponse;
-import com.smartdevicelink.proxy.rpc.SpeakResponse;
-import com.smartdevicelink.proxy.rpc.StreamRPCResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterfaceResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
-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();
- 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) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onUnregisterAppInterfaceResponse(UnregisterAppInterfaceResponse response) {
- onRPCReceived(response);
- }
-
- protected interface LifecycleListener{
- void onProxyConnected();
- void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason);
- void onServiceEnded(OnServiceEnded serviceEnded);
- void onServiceNACKed(OnServiceNACKed serviceNACKed);
- void onError(String info, Exception e);
- }
-
- public ProxyBridge( LifecycleListener lifecycleListener){
- this.lifecycleListener = lifecycleListener;
- rpcListeners = new SparseArray<>();
- }
-
- public boolean onRPCReceived(final RPCMessage message){
- synchronized(RPC_LISTENER_LOCK){
- final int id = FunctionID.getFunctionId(message.getFunctionName());
- CopyOnWriteArrayList<OnRPCListener> listeners = rpcListeners.get(id);
- if(listeners!=null && listeners.size()>0) {
- for (OnRPCListener listener : listeners) {
- listener.onReceived(message);
- }
- return true;
- }
- return false;
- }
- }
-
- protected void addRpcListener(FunctionID id, OnRPCListener listener){
- synchronized(RPC_LISTENER_LOCK){
- if (id != null && listener != null) {
- if (rpcListeners.indexOfKey(id.getId()) < 0) {
- rpcListeners.put(id.getId(), new CopyOnWriteArrayList<OnRPCListener>());
- }
- rpcListeners.get(id.getId()).add(listener);
- }
- }
- }
-
- public boolean removeOnRPCListener(FunctionID id, OnRPCListener listener){
- synchronized(RPC_LISTENER_LOCK){
- if(rpcListeners!= null
- && id != null
- && listener != null
- && rpcListeners.indexOfKey(id.getId()) >= 0){
- return rpcListeners.get(id.getId()).remove(listener);
- }
- }
- return false;
- }
-
- @Override
- public void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason) {
- lifecycleListener.onProxyClosed(info,e,reason);
- }
-
- @Override
- public void onServiceEnded(OnServiceEnded serviceEnded) {
- lifecycleListener.onServiceEnded(serviceEnded);
-
- }
-
- @Override
- public void onServiceNACKed(OnServiceNACKed serviceNACKed) {
- lifecycleListener.onServiceNACKed(serviceNACKed);
-
- }
- @Override
- public void onError(String info, Exception e) {
- lifecycleListener.onError(info, e);
- }
-
- @Override
- public void onOnStreamRPC(OnStreamRPC notification) {
- onRPCReceived(notification);
-
- }
-
- @Override
- public void onStreamRPCResponse(StreamRPCResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onOnHMIStatus(OnHMIStatus notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onGenericResponse(GenericResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnCommand(OnCommand notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onAddCommandResponse(AddCommandResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onAddSubMenuResponse(AddSubMenuResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onAlertResponse(AlertResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onDeleteCommandResponse(DeleteCommandResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onDeleteSubMenuResponse(DeleteSubMenuResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onPerformInteractionResponse(PerformInteractionResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onResetGlobalPropertiesResponse(ResetGlobalPropertiesResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onShowResponse(ShowResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onSpeakResponse(SpeakResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnButtonEvent(OnButtonEvent notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onOnButtonPress(OnButtonPress notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onSubscribeButtonResponse(SubscribeButtonResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnPermissionsChange(OnPermissionsChange notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onUnsubscribeVehicleDataResponse(UnsubscribeVehicleDataResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onGetVehicleDataResponse(GetVehicleDataResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnVehicleData(OnVehicleData notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onEndAudioPassThruResponse(EndAudioPassThruResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnAudioPassThru(OnAudioPassThru notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onPutFileResponse(PutFileResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onDeleteFileResponse(DeleteFileResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onListFilesResponse(ListFilesResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onSetAppIconResponse(SetAppIconResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onScrollableMessageResponse(ScrollableMessageResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onChangeRegistrationResponse(ChangeRegistrationResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnLanguageChange(OnLanguageChange notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onOnHashChange(OnHashChange notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onSliderResponse(SliderResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnDriverDistraction(OnDriverDistraction notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onOnTBTClientState(OnTBTClientState notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onOnSystemRequest(OnSystemRequest notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onSystemRequestResponse(SystemRequestResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnKeyboardInput(OnKeyboardInput notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onOnTouchEvent(OnTouchEvent notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onDiagnosticMessageResponse(DiagnosticMessageResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onReadDIDResponse(ReadDIDResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onGetDTCsResponse(GetDTCsResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnLockScreenNotification(OnLockScreenStatus notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onDialNumberResponse(DialNumberResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onSendLocationResponse(SendLocationResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onShowConstantTbtResponse(ShowConstantTbtResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onAlertManeuverResponse(AlertManeuverResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onUpdateTurnListResponse(UpdateTurnListResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onServiceDataACK(int dataSize) {
-
- }
-
- @Override
- public void onGetWayPointsResponse(GetWayPointsResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onSubscribeWayPointsResponse(SubscribeWayPointsResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onUnsubscribeWayPointsResponse(UnsubscribeWayPointsResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnWayPointChange(OnWayPointChange notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onGetSystemCapabilityResponse(GetSystemCapabilityResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onGetInteriorVehicleDataResponse(GetInteriorVehicleDataResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onButtonPressResponse(ButtonPressResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onSetInteriorVehicleDataResponse(SetInteriorVehicleDataResponse response) {
- onRPCReceived(response);
-
- }
-
- @Override
- public void onOnInteriorVehicleData(OnInteriorVehicleData notification) {
- onRPCReceived(notification);
- }
-
- @Override
- public void onSendHapticDataResponse(SendHapticDataResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onOnRCStatus(OnRCStatus notification) {
- onRPCReceived(notification);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java
deleted file mode 100644
index 0c98cab7e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java
+++ /dev/null
@@ -1,927 +0,0 @@
-package com.smartdevicelink.managers;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.util.Log;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.managers.audio.AudioStreamManager;
-import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.managers.lockscreen.LockScreenConfig;
-import com.smartdevicelink.managers.lockscreen.LockScreenManager;
-import com.smartdevicelink.managers.permission.PermissionManager;
-import com.smartdevicelink.managers.screen.ScreenManager;
-import com.smartdevicelink.managers.video.VideoStreamManager;
-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;
-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.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;
-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.security.SdlSecurityBase;
-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.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.TransportRecord;
-import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.Version;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-/**
- * <strong>SDLManager</strong> <br>
- *
- * This is the main point of contact between an application and SDL <br>
- *
- * It is broken down to these areas: <br>
- *
- * 1. SDLManagerBuilder <br>
- * 2. ISdl Interface along with its overridden methods - This can be passed into attached managers <br>
- * 3. Sending Requests <br>
- * 4. Helper methods
- */
-public class SdlManager{
- private static final String TAG = "SdlManager";
- private SdlProxyBase proxy;
- 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 SdlManagerListener managerListener;
- private int state = -1;
- private List<Class<? extends SdlSecurityBase>> sdlSecList;
- private LockScreenConfig lockScreenConfig;
- private final Object STATE_LOCK = new Object();
-
-
- // Managers
- private PermissionManager permissionManager;
- private FileManager fileManager;
- private LockScreenManager lockScreenManager;
- private ScreenManager screenManager;
- private VideoStreamManager videoStreamManager;
- private AudioStreamManager audioStreamManager;
-
-
- // Initialize proxyBridge with anonymous lifecycleListener
- private final ProxyBridge proxyBridge= new ProxyBridge(new ProxyBridge.LifecycleListener() {
- @Override
- public void onProxyConnected() {
- DebugTool.logInfo("Proxy is connected. Now initializing.");
- initialize();
- }
-
- @Override
- public void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason){
- dispose();
- }
-
- @Override
- public void onServiceEnded(OnServiceEnded serviceEnded){
-
- }
-
- @Override
- public void onServiceNACKed(OnServiceNACKed serviceNACKed){
-
- }
-
- @Override
- public void onError(String info, Exception e){
-
- }
- });
-
- // Sub manager listener
- private final CompletionListener subManagerListener = new CompletionListener() {
- @Override
- public synchronized void onComplete(boolean success) {
- if(!success){
- Log.e(TAG, "Sub manager failed to initialize");
- }
- checkState();
- }
- };
-
- void checkState() {
- if (permissionManager != null && fileManager != null && screenManager != null && (!lockScreenConfig.isEnabled() || lockScreenManager != null)) {
- if (permissionManager.getState() == BaseSubManager.READY && fileManager.getState() == BaseSubManager.READY && screenManager.getState() == BaseSubManager.READY && (!lockScreenConfig.isEnabled() || lockScreenManager.getState() == BaseSubManager.READY)) {
- DebugTool.logInfo("Starting sdl manager, all sub managers are in ready state");
- transitionToState(BaseSubManager.READY);
- notifyDevListener(null);
- onReady();
- } else if (permissionManager.getState() == BaseSubManager.ERROR && fileManager.getState() == BaseSubManager.ERROR && screenManager.getState() == BaseSubManager.ERROR && (!lockScreenConfig.isEnabled() || lockScreenManager.getState() == BaseSubManager.ERROR)) {
- String info = "ERROR starting sdl manager, all sub managers are in error state";
- Log.e(TAG, info);
- transitionToState(BaseSubManager.ERROR);
- notifyDevListener(info);
- } else if (permissionManager.getState() == BaseSubManager.SETTING_UP || fileManager.getState() == BaseSubManager.SETTING_UP || screenManager.getState() == BaseSubManager.SETTING_UP || (lockScreenConfig.isEnabled() && lockScreenManager != null && lockScreenManager.getState() == BaseSubManager.SETTING_UP)) {
- DebugTool.logInfo("SETTING UP sdl manager, some sub managers are still setting up");
- transitionToState(BaseSubManager.SETTING_UP);
- // No need to notify developer here!
- } else {
- Log.w(TAG, "LIMITED starting sdl manager, some sub managers are in error or limited state and the others finished setting up");
- transitionToState(BaseSubManager.LIMITED);
- notifyDevListener(null);
- onReady();
- }
- } else {
- // We should never be here, but somehow one of the sub-sub managers is null
- String info = "ERROR one of the sdl sub managers is null";
- Log.e(TAG, info);
- transitionToState(BaseSubManager.ERROR);
- notifyDevListener(info);
- }
- }
-
- private void notifyDevListener(String info) {
- if (managerListener != null) {
- if (getState() == BaseSubManager.ERROR){
- managerListener.onError(info, null);
- } else {
- managerListener.onStart();
- }
- }
- }
-
- private void onReady(){
- // Set the app icon
- if (SdlManager.this.appIcon != null && SdlManager.this.appIcon.getName() != null) {
- if (fileManager != null && fileManager.getState() == BaseSubManager.READY && !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);
- }
- }
- }
-
- protected void initialize(){
- // Instantiate sub managers
- this.permissionManager = new PermissionManager(_internalInterface);
- this.fileManager = new FileManager(_internalInterface, context);
- if (lockScreenConfig.isEnabled()) {
- this.lockScreenManager = new LockScreenManager(lockScreenConfig, context, _internalInterface);
- }
- this.screenManager = new ScreenManager(_internalInterface, this.fileManager);
- if(getAppTypes().contains(AppHMIType.NAVIGATION) || getAppTypes().contains(AppHMIType.PROJECTION)){
- this.videoStreamManager = new VideoStreamManager(_internalInterface);
- } else {
- this.videoStreamManager = null;
- }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN
- && (getAppTypes().contains(AppHMIType.NAVIGATION) || getAppTypes().contains(AppHMIType.PROJECTION)) ) {
- this.audioStreamManager = new AudioStreamManager(_internalInterface, context);
- } else {
- this.audioStreamManager = null;
- }
-
- // Start sub managers
- this.permissionManager.start(subManagerListener);
- this.fileManager.start(subManagerListener);
- if (lockScreenConfig.isEnabled()){
- this.lockScreenManager.start(subManagerListener);
- }
- this.screenManager.start(subManagerListener);
- }
-
- /**
- * Get the current state for the SdlManager
- * @return int value that represents the current state
- * @see BaseSubManager
- */
- public int getState() {
- synchronized (STATE_LOCK) {
- return state;
- }
- }
-
- protected void transitionToState(int state) {
- synchronized (STATE_LOCK) {
- this.state = state;
- }
- }
-
- @SuppressLint("NewApi")
- public void dispose() {
- if (this.permissionManager != null) {
- this.permissionManager.dispose();
- }
-
- if (this.fileManager != null) {
- this.fileManager.dispose();
- }
-
- if (this.lockScreenManager != null) {
- this.lockScreenManager.dispose();
- }
-
- if (this.screenManager != null) {
- this.screenManager.dispose();
- }
-
- if(this.videoStreamManager != null) {
- this.videoStreamManager.dispose();
- }
-
- // SuppressLint("NewApi") is used because audioStreamManager is only available on android >= jelly bean
- if (this.audioStreamManager != null) {
- this.audioStreamManager.dispose();
- }
-
- if(managerListener != null){
- managerListener.onDestroy();
- managerListener = null;
- }
- }
-
- // BUILDER
- public static class Builder {
- SdlManager sdlManager;
-
- /**
- * 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(@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);
- }
-
- /**
- * Sets the App ID
- * @param appId
- */
- public Builder setAppId(@NonNull final String appId){
- sdlManager.appId = appId;
- return this;
- }
-
- /**
- * Sets the Application Name
- * @param appName
- */
- public Builder setAppName(@NonNull final String appName){
- sdlManager.appName = appName;
- return this;
- }
-
- /**
- * Sets the Short Application Name
- * @param shortAppName
- */
- public Builder setShortAppName(final String shortAppName) {
- sdlManager.shortAppName = shortAppName;
- return this;
- }
-
- /**
- * Sets the Language of the App
- * @param hmiLanguage
- */
- public Builder setLanguage(final Language hmiLanguage){
- sdlManager.hmiLanguage = hmiLanguage;
- return this;
- }
-
- /**
- * Sets the TemplateColorScheme for daytime
- * @param dayColorScheme
- */
- public Builder setDayColorScheme(final TemplateColorScheme dayColorScheme){
- sdlManager.dayColorScheme = dayColorScheme;
- return this;
- }
-
- /**
- * Sets the TemplateColorScheme for nighttime
- * @param nightColorScheme
- */
- public Builder setNightColorScheme(final TemplateColorScheme nightColorScheme){
- sdlManager.nightColorScheme = nightColorScheme;
- 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>
- * <strong>Note: This should be an ordered list from most -> least relevant</strong>
- * @param hmiTypes
- */
- public Builder setAppTypes(final Vector<AppHMIType> hmiTypes){
-
- sdlManager.hmiTypes = hmiTypes;
-
- if (hmiTypes != null) {
- sdlManager.isMediaApp = hmiTypes.contains(AppHMIType.MEDIA);
- }
-
- return this;
- }
-
- /**
- * Sets the vector of vrSynonyms
- * @param vrSynonyms
- */
- public Builder setVrSynonyms(final Vector<String> vrSynonyms) {
- sdlManager.vrSynonyms = vrSynonyms;
- return this;
- }
-
- /**
- * Sets the TTS Name
- * @param ttsChunks
- */
- public Builder setTtsName(final Vector<TTSChunk> ttsChunks) {
- sdlManager.ttsChunks = ttsChunks;
- return this;
- }
-
- /**
- * This Object type may change with the transport refactor
- * Sets the BaseTransportConfig
- * @param transport
- */
- public Builder setTransportType(BaseTransportConfig transport){
- sdlManager.transport = transport;
- return this;
- }
-
- /**
- * Sets the Context
- * @param context
- */
- public Builder setContext(Context context){
- sdlManager.context = context;
- return this;
- }
-
- /**
- * Sets the Security library
- * @param secList The list of security class(es)
- */
- public Builder setSdlSecurity(List<Class<? extends SdlSecurityBase>> secList) {
- sdlManager.sdlSecList = secList;
- 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");
- }
-
- if (sdlManager.appId == null) {
- 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);
- sdlManager.hmiTypes = hmiTypesDefault;
- 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;
- }
-
- sdlManager.transitionToState(BaseSubManager.SETTING_UP);
-
- return sdlManager;
- }
- }
-
- private void checkSdlManagerState(){
- if (getState() != BaseSubManager.READY && getState() != BaseSubManager.LIMITED){
- Log.e(TAG, "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
-
- /**
- * Gets the PermissionManager. <br>
- * <strong>Note: PermissionManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
- * @return a PermissionManager object
- */
- public PermissionManager getPermissionManager() {
- if (permissionManager.getState() != BaseSubManager.READY && permissionManager.getState() != BaseSubManager.LIMITED){
- Log.e(TAG,"PermissionManager should not be accessed because it is not in READY/LIMITED state");
- }
- checkSdlManagerState();
- return permissionManager;
- }
-
- /**
- * Gets the FileManager. <br>
- * <strong>Note: FileManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
- * @return a FileManager object
- */
- public FileManager getFileManager() {
- if (fileManager.getState() != BaseSubManager.READY && fileManager.getState() != BaseSubManager.LIMITED){
- Log.e(TAG, "FileManager should not be accessed because it is not in READY/LIMITED state");
- }
- checkSdlManagerState();
- return fileManager;
- }
-
- /**
- * Gets the VideoStreamManager. <br>
- * The VideoStreamManager returned will only be not null if the registered app type is
- * either NAVIGATION or PROJECTION. Once the VideoStreamManager is retrieved, its start()
- * method will need to be called before use.
- * <br><br><strong>Note: VideoStreamManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
- * @return a VideoStreamManager object attached to shit SdlManager instance
- */
-
- public @Nullable
- VideoStreamManager getVideoStreamManager() {
- checkSdlManagerState();
- return videoStreamManager;
- }
-
- /**
- * Gets the AudioStreamManager. <br>
- * The AudioStreamManager returned will only be not null if the registered app type is
- * either NAVIGATION or PROJECTION. Once the AudioStreamManager is retrieved, its start()
- * method will need to be called before use.
- * <br><strong>Note: AudioStreamManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
- * @return a AudioStreamManager object
- */
- public @Nullable AudioStreamManager getAudioStreamManager() {
- checkSdlManagerState();
- 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
- */
- public ScreenManager getScreenManager() {
- if (screenManager.getState() != BaseSubManager.READY && screenManager.getState() != BaseSubManager.LIMITED){
- Log.e(TAG, "ScreenManager should not be accessed because it is not in READY/LIMITED state");
- }
- checkSdlManagerState();
- return screenManager;
- }
-
- /**
- * 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() {
- if (lockScreenManager.getState() != BaseSubManager.READY && lockScreenManager.getState() != BaseSubManager.LIMITED){
- Log.e(TAG, "LockScreenManager should not be accessed because it is not in READY/LIMITED state");
- }
- checkSdlManagerState();
- 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
- protected String getAppName() { return appName; }
-
- protected String getAppId() { return appId; }
-
- protected String getShortAppName() { return shortAppName; }
-
- protected Language getHmiLanguage() { return hmiLanguage; }
-
- protected TemplateColorScheme getDayColorScheme() { return dayColorScheme; }
-
- protected TemplateColorScheme getNightColorScheme() { return nightColorScheme; }
-
- protected Vector<AppHMIType> getAppTypes() { return hmiTypes; }
-
- protected Vector<String> getVrSynonyms() { return vrSynonyms; }
-
- protected Vector<TTSChunk> getTtsChunks() { return ttsChunks; }
-
- protected BaseTransportConfig getTransport() { return transport; }
-
- protected LockScreenConfig getLockScreenConfig() { return lockScreenConfig; }
-
- // SENDING REQUESTS
-
- /**
- * Send RPC Message <br>
- * <strong>Note: Only takes type of RPCRequest for now, notifications and responses will be thrown out</strong>
- * @param message RPCMessage
- */
- public void sendRPC(RPCMessage message) {
-
- if (message instanceof RPCRequest){
- try{
- proxy.sendRPCRequest((RPCRequest)message);
- }catch (SdlException exception){
- handleSdlException(exception);
- }
- }
- }
-
- /**
- * Takes a list of RPCMessages and sends it to SDL in a synchronous fashion. Responses are captured through callback on OnMultipleRequestListener.
- * For sending requests asynchronously, use sendRequests <br>
- *
- * <strong>NOTE: This will override any listeners on individual RPCs</strong><br>
- *
- * <strong>ADDITIONAL NOTE: This only takes the type of RPCRequest for now, notifications and responses will be thrown out</strong>
- *
- * @param rpcs is the list of RPCMessages being sent
- * @param listener listener for updates and completions
- */
- public void sendSequentialRPCs(final List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener){
-
- List<RPCRequest> rpcRequestList = new ArrayList<>();
- for (int i = 0; i < rpcs.size(); i++) {
- if (rpcs.get(i) instanceof RPCRequest){
- rpcRequestList.add((RPCRequest)rpcs.get(i));
- }
- }
-
- if (rpcRequestList.size() > 0) {
- try{
- proxy.sendSequentialRequests(rpcRequestList, listener);
- }catch (SdlException exception){
- handleSdlException(exception);
- }
- }
- }
-
- /**
- * Takes a list of RPCMessages and sends it to SDL. Responses are captured through callback on OnMultipleRequestListener.
- * For sending requests synchronously, use sendSequentialRPCs <br>
- *
- * <strong>NOTE: This will override any listeners on individual RPCs</strong> <br>
- *
- * <strong>ADDITIONAL NOTE: This only takes the type of RPCRequest for now, notifications and responses will be thrown out</strong>
- *
- * @param rpcs is the list of RPCMessages being sent
- * @param listener listener for updates and completions
- */
- public void sendRPCs(List<? extends RPCMessage> rpcs, final OnMultipleRequestListener listener) {
-
- List<RPCRequest> rpcRequestList = new ArrayList<>();
- for (int i = 0; i < rpcs.size(); i++) {
- if (rpcs.get(i) instanceof RPCRequest){
- rpcRequestList.add((RPCRequest)rpcs.get(i));
- }
- }
-
- if (rpcRequestList.size() > 0) {
- try{
- proxy.sendRequests(rpcRequestList, listener);
- }catch (SdlException exception){
- handleSdlException(exception);
- }
- }
- }
-
- private void handleSdlException(SdlException exception){
- if(exception != null){
- DebugTool.logError("Caught SdlException: " + exception.getSdlExceptionCause());
- // In the future this should handle logic to dispose the manager if it is an unrecoverable error
- }else{
- DebugTool.logError("Caught SdlException" );
- }
- }
-
- /**
- * 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
- */
- @SuppressWarnings("unchecked")
- public void start(){
- if (proxy == null) {
- try {
- if(transport!= null && transport.getTransportType() == TransportType.MULTIPLEX){
- //Do the thing
- MultiplexTransportConfig multiplexTransportConfig = (MultiplexTransportConfig)(transport);
- final MultiplexTransportConfig.TransportListener devListener = multiplexTransportConfig.getTransportListener();
- multiplexTransportConfig.setTransportListener(new MultiplexTransportConfig.TransportListener() {
- @Override
- public void onTransportEvent(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail) {
-
- //Pass to submanagers that need it
- if(videoStreamManager != null){
- videoStreamManager.handleTransportUpdated(connectedTransports, audioStreamTransportAvail, videoStreamTransportAvail);
- }
-
- if(audioStreamManager != null){
- audioStreamManager.handleTransportUpdated(connectedTransports, audioStreamTransportAvail, videoStreamTransportAvail);
- }
- //If the developer supplied a listener to start, it is time to call that
- if(devListener != null){
- devListener.onTransportEvent(connectedTransports,audioStreamTransportAvail,videoStreamTransportAvail);
- }
- }
- });
- }
-
- proxy = new SdlProxyBase(proxyBridge, context, appName, shortAppName, isMediaApp, hmiLanguage,
- hmiLanguage, hmiTypes, appId, transport, vrSynonyms, ttsChunks, dayColorScheme,
- nightColorScheme) {};
- if (sdlSecList != null && !sdlSecList.isEmpty()) {
- proxy.setSdlSecurityClassList(sdlSecList);
- }
- } catch (SdlException e) {
- if (managerListener != null) {
- managerListener.onError("Unable to start manager", e);
- }
- }
- }
- }
-
- protected void setProxy(SdlProxyBase proxy){
- this.proxy = proxy;
- }
-
- // INTERNAL INTERFACE
- private ISdl _internalInterface = new ISdl() {
- @Override
- public void start() {
- try{
- proxy.initializeProxy();
- }catch (SdlException e){
- e.printStackTrace();
- }
- }
-
- @Override
- public void stop() {
- try{
- proxy.dispose();
- }catch (SdlException e){
- e.printStackTrace();
- }
- }
-
- @Override
- public boolean isConnected() {
- return proxy.getIsConnected();
- }
-
- @Override
- public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
- proxy.addServiceListener(serviceType,sdlServiceListener);
- }
-
- @Override
- public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
- proxy.removeServiceListener(serviceType,sdlServiceListener);
- }
-
- @Override
- public void startVideoService(VideoStreamingParameters parameters, boolean encrypted) {
- if(proxy.getIsConnected()){
- proxy.startVideoStream(encrypted,parameters);
- }
- }
-
- @Override
- public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters){
- return proxy.startVideoStream(isEncrypted, parameters);
- }
-
- @Override
- public void stopVideoService() {
- if(proxy.getIsConnected()){
- proxy.endVideoStream();
- }
- }
-
- @Override
- public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
- if(proxy.getIsConnected()){
- proxy.startAudioStream(isEncrypted, codec, params);
- }
- }
-
- @Override
- public void startAudioService(boolean encrypted) {
- if(isConnected()){
- proxy.startService(SessionType.PCM, encrypted);
- }
- }
-
- @Override
- public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
- return proxy.startAudioStream(isEncrypted, codec, params);
- }
-
- @Override
- public void stopAudioService() {
- if(proxy.getIsConnected()){
- proxy.endAudioStream();
- }
- }
-
- @Override
- public void sendRPCRequest(RPCRequest message){
- try {
- proxy.sendRPCRequest(message);
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void sendRequests(List<? extends RPCRequest> rpcs, OnMultipleRequestListener listener) {
- try {
- proxy.sendRequests(rpcs, listener);
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
- proxy.addOnRPCNotificationListener(notificationId,listener);
- }
-
- @Override
- public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
- return proxy.removeOnRPCNotificationListener(notificationId,listener);
- }
-
- @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);
- }
-
- @Override
- public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) {
- proxy.getCapability(systemCapabilityType, scListener);
- }
-
- @Override
- public boolean isCapabilitySupported(SystemCapabilityType systemCapabilityType){
- return proxy.isCapabilitySupported(systemCapabilityType);
- }
-
- @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 boolean isTransportForServiceAvailable(SessionType serviceType) {
- if(SessionType.NAV.equals(serviceType)){
- return proxy.isVideoStreamTransportAvailable();
- }else if(SessionType.PCM.equals(serviceType)){
- return proxy.isAudioStreamTransportAvailable();
- }
- return false;
- }
-
- @Override
- public SdlMsgVersion getSdlMsgVersion(){
- try {
- return proxy.getSdlMsgVersion();
- } catch (SdlException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- public @NonNull Version getProtocolVersion() {
- if(proxy.getProtocolVersion() != null){
- return proxy.getProtocolVersion();
- }else{
- return new Version(1,0,0);
- }
- }
-
- };
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java b/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
deleted file mode 100644
index 22a3fcd58..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.smartdevicelink.managers;
-
-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/managers/StreamingStateMachine.java b/sdl_android/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java
deleted file mode 100644
index caabf67a2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/StreamingStateMachine.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.smartdevicelink.managers;
-
-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/managers/audio/AudioDecoder.java b/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java
deleted file mode 100644
index c80ebba39..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.smartdevicelink.managers.audio;
-
-import android.content.Context;
-import android.media.MediaCodec;
-import android.media.MediaFormat;
-import android.net.Uri;
-import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.annotation.RequiresApi;
-import android.util.Log;
-import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
-
-import java.nio.ByteBuffer;
-
-/**
- * The audio decoder to decode a single audio file to PCM.
- */
-@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
-public class AudioDecoder extends BaseAudioDecoder {
- private static final String TAG = AudioDecoder.class.getSimpleName();
-
- /**
- * Creates a new object of AudioDecoder.
- * @param audioSource The audio source to decode.
- * @param context The context object to use to open the audio source.
- * @param sampleRate The desired sample rate for decoded audio data.
- * @param sampleType The desired sample type (8bit, 16bit, float).
- * @param listener A listener who receives the decoded audio.
- */
- AudioDecoder(Uri audioSource, Context context, int sampleRate, @SampleType int sampleType, AudioDecoderListener listener) {
- super(audioSource, context, sampleRate, sampleType, listener);
- }
-
- /**
- * Starts the audio decoding asynchronously.
- */
- public void start() {
- try {
- initMediaComponents();
-
- decoder.setCallback(new MediaCodec.Callback() {
- @Override
- public void onInputBufferAvailable(@NonNull MediaCodec mediaCodec, int i) {
- ByteBuffer inputBuffer = mediaCodec.getInputBuffer(i);
- if (inputBuffer == null) return;
-
- MediaCodec.BufferInfo info = AudioDecoder.super.onInputBufferAvailable(extractor, inputBuffer);
- mediaCodec.queueInputBuffer(i, info.offset, info.size, info.presentationTimeUs, info.flags);
- }
-
- @Override
- public void onOutputBufferAvailable(@NonNull MediaCodec mediaCodec, int i, @NonNull MediaCodec.BufferInfo bufferInfo) {
- ByteBuffer outputBuffer = mediaCodec.getOutputBuffer(i);
- if (outputBuffer == null) return;
-
- if (outputBuffer.limit() > 0) {
- SampleBuffer targetSampleBuffer = AudioDecoder.super.onOutputBufferAvailable(outputBuffer);
- AudioDecoder.this.listener.onAudioDataAvailable(targetSampleBuffer);
- } else {
- Log.w(TAG, "output buffer empty. Chance that silence was detected");
- }
-
- mediaCodec.releaseOutputBuffer(i, false);
-
- if (bufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
- listener.onDecoderFinish(true);
- stop();
- }
- }
-
- @Override
- public void onOutputFormatChanged(@NonNull MediaCodec mediaCodec, @NonNull MediaFormat mediaFormat) {
- AudioDecoder.super.onOutputFormatChanged(mediaFormat);
- }
-
- @Override
- public void onError(@NonNull MediaCodec mediaCodec, @NonNull MediaCodec.CodecException e) {
- AudioDecoder.super.onMediaCodecError(e);
- }
- });
-
- decoder.start();
- } catch (Exception e) {
- e.printStackTrace();
- listener.onDecoderError(e);
- listener.onDecoderFinish(false);
- stop();
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java b/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java
deleted file mode 100644
index 43daef4b3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package com.smartdevicelink.managers.audio;
-
-import android.content.Context;
-import android.media.MediaCodec;
-import android.media.MediaFormat;
-import android.net.Uri;
-import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.annotation.RequiresApi;
-import android.util.Log;
-
-import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
-
-import java.lang.ref.WeakReference;
-import java.nio.ByteBuffer;
-
-/**
- * The audio decoder to decode a single audio file to PCM.
- * This decoder supports phones with api < 21 but uses methods deprecated with api 21.
- */
-@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
-public class AudioDecoderCompat extends BaseAudioDecoder {
- private static final String TAG = AudioDecoderCompat.class.getSimpleName();
- private static final int DEQUEUE_TIMEOUT = 3000;
- private static Runnable sRunnable;
- private Thread mThread;
-
- /**
- * Creates a new object of AudioDecoder.
- * @param audioSource The audio source to decode.
- * @param context The context object to use to open the audio source.
- * @param sampleRate The desired sample rate for decoded audio data.
- * @param sampleType The desired sample type (8bit, 16bit, float).
- * @param listener A listener who receives the decoded audio.
- */
- AudioDecoderCompat(@NonNull Uri audioSource, @NonNull Context context, int sampleRate, @SampleType int sampleType, AudioDecoderListener listener) {
- super(audioSource, context, sampleRate, sampleType, listener);
- }
-
- /**
- * Starts the audio decoding asynchronously.
- */
- public void start() {
- try {
- initMediaComponents();
- decoder.start();
- mThread = new Thread(new DecoderRunnable(AudioDecoderCompat.this));
- mThread.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- if(this.listener != null) {
- this.listener.onDecoderError(e);
- this.listener.onDecoderFinish(false);
- }
- stop();
- }
- }
-
-
- /**
- * Runnable to decode audio data
- */
- private static class DecoderRunnable implements Runnable {
- WeakReference<AudioDecoderCompat> weakReference;
-
- /**
- * Decodes all audio data from source
- * @param audioDecoderCompat instance of this class
- */
- DecoderRunnable(@NonNull AudioDecoderCompat audioDecoderCompat){
- weakReference = new WeakReference<>(audioDecoderCompat);
-
- }
- @Override
- public void run() {
- final AudioDecoderCompat reference = weakReference.get();
- if (reference == null) {
- Log.w(TAG, "AudioDecoderCompat reference was null");
- return;
- }
- final ByteBuffer[] inputBuffersArray = reference.decoder.getInputBuffers();
- final ByteBuffer[] outputBuffersArray = reference.decoder.getOutputBuffers();
- MediaCodec.BufferInfo outputBufferInfo = new MediaCodec.BufferInfo();
- MediaCodec.BufferInfo inputBufferInfo;
- ByteBuffer inputBuffer, outputBuffer;
- SampleBuffer sampleBuffer;
-
- while (reference!= null && !reference.mThread.isInterrupted()) {
- int inputBuffersArrayIndex = 0;
- while (inputBuffersArrayIndex != MediaCodec.INFO_TRY_AGAIN_LATER) {
- inputBuffersArrayIndex = reference.decoder.dequeueInputBuffer(DEQUEUE_TIMEOUT);
- if (inputBuffersArrayIndex >= 0) {
- inputBuffer = inputBuffersArray[inputBuffersArrayIndex];
- inputBufferInfo = reference.onInputBufferAvailable(reference.extractor, inputBuffer);
- reference.decoder.queueInputBuffer(inputBuffersArrayIndex, inputBufferInfo.offset, inputBufferInfo.size, inputBufferInfo.presentationTimeUs, inputBufferInfo.flags);
- }
- }
-
- int outputBuffersArrayIndex = 0;
- while (outputBuffersArrayIndex != MediaCodec.INFO_TRY_AGAIN_LATER) {
- outputBuffersArrayIndex = reference.decoder.dequeueOutputBuffer(outputBufferInfo, DEQUEUE_TIMEOUT);
- if (outputBuffersArrayIndex >= 0) {
- outputBuffer = outputBuffersArray[outputBuffersArrayIndex];
- if ((outputBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0 && outputBufferInfo.size != 0) {
- reference.decoder.releaseOutputBuffer(outputBuffersArrayIndex, false);
- } else if (outputBuffer.limit() > 0) {
- sampleBuffer = reference.onOutputBufferAvailable(outputBuffer);
- if(reference.listener!=null){
- reference.listener.onAudioDataAvailable(sampleBuffer);
- }
- reference.decoder.releaseOutputBuffer(outputBuffersArrayIndex, false);
- }
- } else if (outputBuffersArrayIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
- MediaFormat newFormat = reference.decoder.getOutputFormat();
- reference.onOutputFormatChanged(newFormat);
- }
- }
-
- if (outputBufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
- if (reference.listener != null) {
- reference.listener.onDecoderFinish(true);
- }
- reference.stop();
- try {
- reference.mThread.interrupt();
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- reference.mThread = null;
- break;
- }
- }
- }
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderListener.java b/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderListener.java
deleted file mode 100644
index d8dcc1238..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.smartdevicelink.managers.audio;
-
-/**
- * An interface for the audio decoder classes.
- * The caller using the audio decoder will be
- * notified when the decoding is finished or if an error occurred.
- * During decoding the caller receives sample buffers with decoded audio data.
- */
-public interface AudioDecoderListener {
- /**
- * Notifies that decoded audio data is available.
- * @param sampleBuffer The sample buffer holding the decoded audio data.
- */
- void onAudioDataAvailable(SampleBuffer sampleBuffer);
-
- /**
- * Notifies that the audio decoding is finished.
- * @param success Indicates whether audio decoding was successful or if an error occurred.
- */
- void onDecoderFinish(boolean success);
-
- /**
- * Notifies the caller that an error/exception occurred during audio decoding.
- * @param e The exception storing information about the error.
- */
- void onDecoderError(Exception e);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java
deleted file mode 100644
index da58692af..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java
+++ /dev/null
@@ -1,447 +0,0 @@
-package com.smartdevicelink.managers.audio;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.res.Resources;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Handler;
-import android.os.Looper;
-import android.support.annotation.IntDef;
-import android.support.annotation.NonNull;
-import android.support.annotation.RequiresApi;
-import android.util.Log;
-
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.StreamingStateMachine;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
-import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
-import com.smartdevicelink.transport.utl.TransportRecord;
-import com.smartdevicelink.util.Version;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.ref.WeakReference;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
-
-/**
- * The AudioStreamManager class provides methods to start and stop an audio stream
- * to the connected device. Audio files can be pushed to the manager in order to
- * play them on the connected device. The manager uses the Android built-in MediaCodec.
- */
-@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
-public class AudioStreamManager extends BaseSubManager {
- private static final String TAG = AudioStreamManager.class.getSimpleName();
- private static final int COMPLETION_TIMEOUT = 2000;
-
- private IAudioStreamListener sdlAudioStream;
- private int sdlSampleRate;
- private @SampleType int sdlSampleType;
- private final Queue<BaseAudioDecoder> queue;
- private final WeakReference<Context> context;
- private final StreamingStateMachine streamingStateMachine;
- private AudioPassThruCapabilities audioStreamingCapabilities;
- private HMILevel hmiLevel;
- private boolean isTransportAvailable = false;
- // This completion listener is used as a callback to the app developer when starting/stopping audio service
- private CompletionListener serviceCompletionListener;
- // As the internal interface does not provide timeout we need to use a future task
- private final Handler serviceCompletionHandler;
-
- private final Runnable serviceCompletionTimeoutCallback = new Runnable() {
- @Override
- public void run() {
- serviceListener.onServiceError(null, SessionType.PCM, "Service operation timeout reached");
- }
- };
-
-
-
- // INTERNAL INTERFACE
-
- private final ISdlServiceListener serviceListener = new ISdlServiceListener() {
- @Override
- public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
- if (SessionType.PCM.equals(type)) {
- serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
-
- sdlAudioStream = session.startAudioStream();
- streamingStateMachine.transitionToState(StreamingStateMachine.STARTED);
-
- if (serviceCompletionListener != null) {
- CompletionListener completionListener = serviceCompletionListener;
- serviceCompletionListener = null;
- completionListener.onComplete(true);
- }
- }
- }
-
- @Override
- public void onServiceEnded(SdlSession session, SessionType type) {
- if (SessionType.PCM.equals(type)) {
- serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
-
- session.stopAudioStream();
- sdlAudioStream = null;
- streamingStateMachine.transitionToState(StreamingStateMachine.NONE);
-
- if (serviceCompletionListener != null) {
- CompletionListener completionListener = serviceCompletionListener;
- serviceCompletionListener = null;
- completionListener.onComplete(true);
- }
- }
- }
-
- @Override
- public void onServiceError(SdlSession session, SessionType type, String reason) {
- if (SessionType.PCM.equals(type)) {
- serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
-
- streamingStateMachine.transitionToState(StreamingStateMachine.ERROR);
- Log.e(TAG, "OnServiceError: " + reason);
- streamingStateMachine.transitionToState(StreamingStateMachine.NONE);
-
- if (serviceCompletionListener != null) {
- CompletionListener completionListener = serviceCompletionListener;
- serviceCompletionListener = null;
- completionListener.onComplete(false);
- }
- }
- }
- };
-
- private final OnRPCNotificationListener hmiListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- if(notification != null){
- hmiLevel = ((OnHMIStatus)notification).getHmiLevel();
- if(hmiLevel.equals(HMILevel.HMI_FULL) || hmiLevel.equals(HMILevel.HMI_LIMITED)){
- checkState();
- }
- }
- }
- };
-
- /**
- * Creates a new object of AudioStreamManager
- * @param internalInterface The internal interface to the connected device.
- */
- public AudioStreamManager(@NonNull ISdl internalInterface, @NonNull Context context) {
- super(internalInterface);
- if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN){
- this.queue = null;
- this.context = null;
- this.serviceCompletionHandler = null;
- this.streamingStateMachine = null;
- transitionToState(ERROR);
- return;
- }
- this.queue = new LinkedList<>();
- this.context = new WeakReference<>(context);
- this.serviceCompletionHandler = new Handler(Looper.getMainLooper());
-
- internalInterface.addServiceListener(SessionType.PCM, serviceListener);
-
- // Listen for HMILevel changes
- internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
-
- streamingStateMachine = new StreamingStateMachine();
-
- }
-
- @Override
- public void start(CompletionListener listener) {
- isTransportAvailable = internalInterface.isTransportForServiceAvailable(SessionType.PCM);
- getAudioStreamingCapabilities();
- checkState();
- super.start(listener);
- }
-
- private void checkState(){
- if(audioStreamingCapabilities != null
- && isTransportAvailable
- && hmiLevel != null
- && (hmiLevel.equals(HMILevel.HMI_LIMITED) || hmiLevel.equals(HMILevel.HMI_FULL))){
- transitionToState(READY);
- }
- }
-
- private void getAudioStreamingCapabilities(){
- internalInterface.getCapability(SystemCapabilityType.PCM_STREAMING, new OnSystemCapabilityListener() {
- @Override
- public void onCapabilityRetrieved(Object capability) {
- if(capability != null && capability instanceof AudioPassThruCapabilities){
- audioStreamingCapabilities = (AudioPassThruCapabilities) capability;
- checkState();
- }
- }
-
- @Override
- public void onError(String info) {
- Log.e(TAG, "Error retrieving audio streaming capability: " + info);
- streamingStateMachine.transitionToState(StreamingStateMachine.ERROR);
- transitionToState(ERROR);
- }
- });
- }
-
- @Override
- public void dispose() {
- stopAudioStream(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- internalInterface.removeServiceListener(SessionType.PCM, serviceListener);
- }
- });
-
- super.dispose();
- }
-
- /**
- * Starts the audio service and audio stream to the connected device.
- * The method is non-blocking.
- * @param encrypted Specify whether or not the audio stream should be encrypted.
- */
- public void startAudioStream(boolean encrypted, final CompletionListener completionListener) {
- // audio stream cannot be started without a connected internal interface
- if (!internalInterface.isConnected()) {
- Log.w(TAG, "startAudioStream called without being connected.");
- finish(completionListener, false);
- return;
- }
-
- // streaming state must be NONE (starting the service is ready. starting stream is started)
- if (streamingStateMachine.getState() != StreamingStateMachine.NONE) {
- Log.w(TAG, "startAudioStream called but streamingStateMachine is not in state NONE (current: " + streamingStateMachine.getState() + ")");
- finish(completionListener, false);
- return;
- }
-
- AudioPassThruCapabilities capabilities = (AudioPassThruCapabilities) internalInterface.getCapability(SystemCapabilityType.PCM_STREAMING);
-
- if (capabilities != null) {
- switch (capabilities.getSamplingRate()) {
- case _8KHZ:
- sdlSampleRate = 8000;
- break;
- case _16KHZ:
- sdlSampleRate = 16000;
- break;
- case _22KHZ:
- // common sample rate is 22050, not 22000
- // see https://en.wikipedia.org/wiki/Sampling_(signal_processing)#Audio_sampling
- sdlSampleRate = 22050;
- break;
- case _44KHZ:
- // 2x 22050 is 44100
- // see https://en.wikipedia.org/wiki/Sampling_(signal_processing)#Audio_sampling
- sdlSampleRate = 44100;
- break;
- default:
- finish(completionListener, false);
- return;
- }
-
- switch (capabilities.getBitsPerSample()) {
- case _8_BIT:
- sdlSampleType = SampleType.UNSIGNED_8_BIT;
- break;
- case _16_BIT:
- sdlSampleType = SampleType.SIGNED_16_BIT;
- break;
- default:
- finish(completionListener, false);
- return;
-
- }
- } else {
- finish(completionListener, false);
- return;
- }
-
- streamingStateMachine.transitionToState(StreamingStateMachine.READY);
- serviceCompletionListener = completionListener;
- serviceCompletionHandler.postDelayed(serviceCompletionTimeoutCallback, COMPLETION_TIMEOUT);
- internalInterface.startAudioService(encrypted);
- }
-
- /**
- * Makes the callback to the listener
- * @param listener the listener to notify
- * @param isSuccess flag to notify
- */
- private void finish(CompletionListener listener, boolean isSuccess) {
- if (listener != null) {
- listener.onComplete(isSuccess);
- }
- }
-
- /**
- * Stops the audio service and audio stream to the connected device.
- * The method is non-blocking.
- */
- public void stopAudioStream(final CompletionListener completionListener) {
- if (!internalInterface.isConnected()) {
- Log.w(TAG, "stopAudioStream called without being connected");
- finish(completionListener, false);
- return;
- }
-
- // streaming state must be STARTED (starting the service is ready. starting stream is started)
- if (streamingStateMachine.getState() != StreamingStateMachine.STARTED) {
- Log.w(TAG, "stopAudioStream called but streamingStateMachine is not STARTED (current: " + streamingStateMachine.getState() + ")");
- finish(completionListener, false);
- return;
- }
-
- streamingStateMachine.transitionToState(StreamingStateMachine.STOPPED);
- serviceCompletionListener = completionListener;
- serviceCompletionHandler.postDelayed(serviceCompletionTimeoutCallback, COMPLETION_TIMEOUT);
- internalInterface.stopAudioService();
- }
-
- /**
- * Pushes the specified resource file to the playback queue.
- * The audio file will be played immediately. If another audio file is currently playing
- * the specified file will stay queued and automatically played when ready.
- * @param resourceId The specified resource file to be played.
- * @param completionListener A completion listener that informs when the audio file is played.
- */
- public void pushResource(int resourceId, final CompletionListener completionListener) {
- Context c = context.get();
- Resources r = c.getResources();
- Uri uri = new Uri.Builder()
- .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
- .authority(r.getResourcePackageName(resourceId))
- .appendPath(r.getResourceTypeName(resourceId))
- .appendPath(r.getResourceEntryName(resourceId))
- .build();
-
- this.pushAudioSource(uri, completionListener);
- }
-
- /**
- * Pushes the specified audio file to the playback queue.
- * The audio file will be played immediately. If another audio file is currently playing
- * the specified file will stay queued and automatically played when ready.
- * @param audioSource The specified audio file to be played.
- * @param completionListener A completion listener that informs when the audio file is played.
- */
- @SuppressWarnings("WeakerAccess")
- public void pushAudioSource(Uri audioSource, final CompletionListener completionListener) {
- // streaming state must be STARTED (starting the service is ready. starting stream is started)
- if (streamingStateMachine.getState() != StreamingStateMachine.STARTED) {
- return;
- }
-
- BaseAudioDecoder decoder;
- AudioDecoderListener decoderListener = new AudioDecoderListener() {
- @Override
- public void onAudioDataAvailable(SampleBuffer buffer) {
- sdlAudioStream.sendAudio(buffer.getByteBuffer(), buffer.getPresentationTimeUs());
- }
-
- @Override
- public void onDecoderFinish(boolean success) {
- finish(completionListener, true);
-
- synchronized (queue) {
- // remove throws an exception if the queue is empty. The decoder of this listener
- // should still be in this queue so we should be fine by just removing it
- // if the queue is empty than we have a bug somewhere in the code
- // and we deserve the crash...
- queue.remove();
-
- // if the queue contains more items then start the first one (without removing it)
- if (queue.size() > 0) {
- queue.element().start();
- }
- }
- }
-
- @Override
- public void onDecoderError(Exception e) {
- Log.e(TAG, "decoder error", e);
- }
- };
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- decoder = new AudioDecoder(audioSource, context.get(), sdlSampleRate, sdlSampleType, decoderListener);
- } else {
- // this BaseAudioDecoder subclass uses methods deprecated with api 21
- decoder = new AudioDecoderCompat(audioSource, context.get(), sdlSampleRate, sdlSampleType, decoderListener);
- }
-
- synchronized (queue) {
- queue.add(decoder);
-
- if (queue.size() == 1) {
- decoder.start();
- }
- }
- }
-
-
- @Override
- protected void onTransportUpdate(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail){
-
- isTransportAvailable = audioStreamTransportAvail;
-
- if(internalInterface.getProtocolVersion().isNewerThan(new Version(5,1,0)) >= 0){
- if(audioStreamTransportAvail){
- checkState();
- }
- }else{
- //The protocol version doesn't support simultaneous transports.
- if(!audioStreamTransportAvail){
- //If video streaming isn't available on primary transport then it is not possible to
- //use the video streaming manager until a complete register on a transport that
- //supports video
- transitionToState(ERROR);
- }
- }
- }
-
- @IntDef({SampleType.UNSIGNED_8_BIT, SampleType.SIGNED_16_BIT, SampleType.FLOAT})
- @Retention(RetentionPolicy.SOURCE)
- public @interface SampleType {
- // ref https://developer.android.com/reference/android/media/AudioFormat "Encoding" section
- // The audio sample is a 8 bit unsigned integer in the range [0, 255], with a 128 offset for zero.
- // This is typically stored as a Java byte in a byte array or ByteBuffer. Since the Java byte is
- // signed, be careful with math operations and conversions as the most significant bit is inverted.
- //
- // The unsigned byte range is [0, 255] and should be converted to double [-1.0, 1.0]
- // The 8 bits of the byte are easily converted to int by using bitwise operator
- int UNSIGNED_8_BIT = Byte.SIZE >> 3;
-
- // ref https://developer.android.com/reference/android/media/AudioFormat "Encoding" section
- // The audio sample is a 16 bit signed integer typically stored as a Java short in a short array,
- // but when the short is stored in a ByteBuffer, it is native endian (as compared to the default Java big endian).
- // The short has full range from [-32768, 32767], and is sometimes interpreted as fixed point Q.15 data.
- //
- // the conversion is slightly easier from [-32768, 32767] to [-1.0, 1.0]
- int SIGNED_16_BIT = Short.SIZE >> 3;
-
- // ref https://developer.android.com/reference/android/media/AudioFormat "Encoding" section
- // Introduced in API Build.VERSION_CODES.LOLLIPOP, this encoding specifies that the audio sample
- // is a 32 bit IEEE single precision float. The sample can be manipulated as a Java float in a
- // float array, though within a ByteBuffer it is stored in native endian byte order. The nominal
- // range of ENCODING_PCM_FLOAT audio data is [-1.0, 1.0].
- int FLOAT = Float.SIZE >> 3;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java b/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java
deleted file mode 100644
index 22a54a172..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java
+++ /dev/null
@@ -1,246 +0,0 @@
-package com.smartdevicelink.managers.audio;
-
-import android.content.Context;
-import android.media.AudioFormat;
-import android.media.MediaCodec;
-import android.media.MediaExtractor;
-import android.media.MediaFormat;
-import android.net.Uri;
-import android.os.Build;
-import android.support.annotation.NonNull;
-import android.support.annotation.RequiresApi;
-import android.util.Log;
-import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
-import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
-
-import java.lang.ref.WeakReference;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-@SuppressWarnings("WeakerAccess")
-@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
-public abstract class BaseAudioDecoder {
- private static final String TAG = AudioDecoder.class.getSimpleName();
-
- protected final int targetSampleRate;
- protected @SampleType final int targetSampleType;
-
- private int outputChannelCount;
- private int outputSampleRate;
- private @SampleType int outputSampleType;
-
- private double lastOutputSample = 0;
-
- private double lastOutputPresentationTimeUs = 0;
- private double lastTargetPresentationTimeUs = 0;
-
- protected MediaExtractor extractor;
- protected MediaCodec decoder;
-
- protected final Uri audioSource;
- protected final WeakReference<Context> contextWeakReference;
- protected final AudioDecoderListener listener;
-
- /**
- *
- * @param audioSource Uri of the audio source to be converted
- * @param context the context
- * @param sampleRate can be either 8000, 16000, 22050 or 44100
- * @see AudioPassThruCapabilities#getSamplingRate()
- * @param sampleType can be either UNSIGNED_8_BIT, SIGNED_16_BIT, FLOAT
- * @see SampleType
- * @param listener listener for event callbacks
- */
- public BaseAudioDecoder(@NonNull Uri audioSource, @NonNull Context context, int sampleRate, @SampleType int sampleType, AudioDecoderListener listener) {
- this.audioSource = audioSource;
- this.contextWeakReference = new WeakReference<>(context);
- this.listener = listener;
-
- targetSampleRate = sampleRate;
- targetSampleType = sampleType;
- }
-
- protected void initMediaComponents() throws Exception {
- if(targetSampleRate <= 0){
- throw new InstantiationException("Target sample rate of " + targetSampleRate + " is unsupported");
- }
-
- extractor = new MediaExtractor();
- Context contextRef = contextWeakReference.get();
- if(contextRef == null){
- throw new InstantiationException("Context reference was null");
- }
- extractor.setDataSource(contextRef, audioSource, null);
- MediaFormat format = null;
- String mime = null;
-
- // Select the first audio track we find.
- int numTracks = extractor.getTrackCount();
- for (int i = 0; i < numTracks; ++i) {
- MediaFormat f = extractor.getTrackFormat(i);
- String m = f.getString(MediaFormat.KEY_MIME);
- if (m.startsWith("audio/")) {
- format = f;
- mime = m;
- extractor.selectTrack(i);
- break;
- }
- }
-
- if (mime == null) {
- throw new Exception("The audio file " + audioSource.getPath() + " doesn't contain an audio track.");
- }
-
- decoder = MediaCodec.createDecoderByType(mime);
- decoder.configure(format, null, null, 0);
- }
-
- private Double sampleAtTargetTime(double lastOutputSample, SampleBuffer outputSampleBuffer, double outputPresentationTimeUs, double outputDurationPerSampleUs, double targetPresentationTimeUs) {
- double timeDiff = targetPresentationTimeUs - outputPresentationTimeUs;
- double index = timeDiff / outputDurationPerSampleUs;
-
- // the "last known sample" allows an index from -1.0 to 0
- // the index cannot exceed the last sample. it must be stored to become the "last known sample" in the next iteration
- if (index < -1.0 || Math.ceil(index) >= outputSampleBuffer.limit()) {
- return null;
- }
-
- if (index == -1.0) {
- // the index points exactly to the last known sample
- return lastOutputSample;
- } else if (index % 1 == 0) {
- // index has no digits. therefore current index points to a known sample
- return outputSampleBuffer.get((int) index);
- } else {
- // the first sample can be the last known one
- double first = index < 0.0 ? lastOutputSample : outputSampleBuffer.get((int) index);
- double second = outputSampleBuffer.get((int) Math.ceil(index));
- double rel = index % 1;
-
- // if the relative is between -1 and 0
- if (rel < 0.0) {
- rel = 1 + rel;
- }
-
- return first + (second - first) * rel;
- }
- }
-
- protected MediaCodec.BufferInfo onInputBufferAvailable(@NonNull MediaExtractor extractor, @NonNull ByteBuffer inputBuffer) {
- long sampleTime = extractor.getSampleTime();
- int counter = 0;
- int maxresult = 0;
- int result;
- boolean advanced = false;
-
- do {
- result = extractor.readSampleData(inputBuffer, counter);
- if (result >= 0) {
- advanced = extractor.advance();
- maxresult = Math.max(maxresult, result);
- counter += result;
- }
- } while (result >= 0 && advanced && inputBuffer.capacity() - inputBuffer.limit() > maxresult);
- // the remaining capacity should be more than enough for another sample data block
-
- // queue the input buffer. At end of file counter will be 0 and flags marks end of stream
- // offset MUST be 0. The output buffer code cannot handle offsets
- // result < 0 means the end of the file input is reached
- int flags = advanced ? 0 : MediaCodec.BUFFER_FLAG_END_OF_STREAM;
-
- MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();
- bufferInfo.set(0, counter, sampleTime, flags);
-
- return bufferInfo;
- }
-
- protected SampleBuffer onOutputBufferAvailable(@NonNull ByteBuffer outputBuffer) {
- double outputPresentationTimeUs = lastOutputPresentationTimeUs;
- double outputDurationPerSampleUs = 1000000.0 / (double)outputSampleRate;
-
- double targetPresentationTimeUs = lastTargetPresentationTimeUs;
- double targetDurationPerSampleUs = 1000000.0 / (double)targetSampleRate;
-
- // wrap the output buffer to make it provide audio samples
- SampleBuffer outputSampleBuffer = SampleBuffer.wrap(outputBuffer, outputSampleType, outputChannelCount, (long)outputPresentationTimeUs);
- outputSampleBuffer.position(0);
-
- // the buffer size is related to the output and target sample rate
- // add 2 samples to round up and add an extra sample
- int sampleSize = outputSampleBuffer.limit() * targetSampleRate / outputSampleRate + 2;
-
- SampleBuffer targetSampleBuffer = SampleBuffer.allocate(sampleSize, targetSampleType, ByteOrder.LITTLE_ENDIAN, (long)targetPresentationTimeUs);
- Double sample;
-
- do {
- sample = sampleAtTargetTime(lastOutputSample, outputSampleBuffer, outputPresentationTimeUs, outputDurationPerSampleUs, targetPresentationTimeUs);
- if (sample != null) {
- targetSampleBuffer.put(sample);
- targetPresentationTimeUs += targetDurationPerSampleUs;
- }
- } while (sample != null);
-
- lastTargetPresentationTimeUs = targetPresentationTimeUs;
- lastOutputPresentationTimeUs += outputSampleBuffer.limit() * outputDurationPerSampleUs;
- lastOutputSample = outputSampleBuffer.get(outputSampleBuffer.limit() - 1);
-
- targetSampleBuffer.limit(targetSampleBuffer.position());
- targetSampleBuffer.position(0);
-
- return targetSampleBuffer;
- }
-
- protected void onOutputFormatChanged(@NonNull MediaFormat mediaFormat) {
- if (mediaFormat.containsKey(MediaFormat.KEY_CHANNEL_COUNT)) {
- outputChannelCount = mediaFormat.getInteger(MediaFormat.KEY_CHANNEL_COUNT);
- }
-
- if (mediaFormat.containsKey(MediaFormat.KEY_SAMPLE_RATE)) {
- outputSampleRate = mediaFormat.getInteger(MediaFormat.KEY_SAMPLE_RATE);
- }
-
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N && mediaFormat.containsKey(MediaFormat.KEY_PCM_ENCODING)) {
- int key = mediaFormat.getInteger(MediaFormat.KEY_PCM_ENCODING);
- switch (key) {
- case AudioFormat.ENCODING_PCM_8BIT:
- outputSampleType = SampleType.UNSIGNED_8_BIT;
- break;
- case AudioFormat.ENCODING_PCM_FLOAT:
- outputSampleType = SampleType.FLOAT;
- break;
- case AudioFormat.ENCODING_PCM_16BIT:
- default:
- // by default we fallback to signed 16 bit samples
- outputSampleType = SampleType.SIGNED_16_BIT;
- break;
- }
- } else {
- outputSampleType = SampleType.SIGNED_16_BIT;
- }
- }
-
- protected void onMediaCodecError(@NonNull MediaCodec.CodecException e) {
- Log.e(TAG, "MediaCodec.onError: " + e.getLocalizedMessage());
- if (listener != null) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- listener.onDecoderError(e);
- } else {
- listener.onDecoderError(new Exception("Error decoding audio file"));
- }
- }
- }
-
- public abstract void start();
-
- public void stop() {
- if (decoder != null) {
- decoder.stop();
- decoder.release();
- decoder = null;
- }
-
- if (extractor != null) {
- extractor = null;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java b/sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java
deleted file mode 100644
index 6ae5c6266..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java
+++ /dev/null
@@ -1,280 +0,0 @@
-package com.smartdevicelink.managers.audio;
-
-import android.util.Log;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
-
-/**
- * Wraps a buffer of raw audio samples depending on the sample type (8 bit, 16 bit)
- * Unifies samples into double.
- */
-public class SampleBuffer {
- private static final String TAG = SampleBuffer.class.getSimpleName();
-
- @SuppressWarnings({"unused", "FieldCanBeLocal"})
- private @SampleType final int sampleType;
- private final ByteBuffer byteBuffer;
- private final int channelCount;
- private final long presentationTimeUs;
-
- /**
- * Wraps a raw (mono) byte buffer to a new sample buffer.
- * @param buffer The raw buffer to be wrapped.
- * @param sampleType The sample type of the samples in the raw buffer.
- * @param presentationTimeUs The presentation time of the buffer.
- * @return A new sample buffer wrapping the specified raw buffer.
- */
- public static SampleBuffer wrap(ByteBuffer buffer, @SampleType int sampleType, long presentationTimeUs) {
- return new SampleBuffer(buffer, sampleType, 1, presentationTimeUs);
- }
-
- /**
- * Wraps a raw byte buffer to a new sample buffer.
- * @param buffer The raw buffer to be wrapped.
- * @param sampleType The sample type of the samples in the raw buffer.
- * @param channelCount The number of channels (1 = mono, 2 = stereo).
- * @param presentationTimeUs The presentation time of the buffer.
- * @return A new sample buffer wrapping the specified raw buffer.
- */
- public static SampleBuffer wrap(ByteBuffer buffer, @SampleType int sampleType, int channelCount, long presentationTimeUs) {
- return new SampleBuffer(buffer, sampleType, channelCount, presentationTimeUs);
- }
-
- /**
- * Allocates a new sample buffer.
- * @param capacity The specified sample capacity of the sample buffer.
- * @param sampleType The sample type of the samples the buffer should store.
- * @param byteOrder The byte order for the samples (little or big endian).
- * @param presentationTimeUs The presentation time for the buffer.
- * @return A new and empty sample buffer.
- */
- public static SampleBuffer allocate(int capacity, @SampleType int sampleType, ByteOrder byteOrder, long presentationTimeUs) {
- return new SampleBuffer(capacity, sampleType, 1, byteOrder, presentationTimeUs);
- }
-
- /**
- * Allocates a new sample buffer.
- * @param capacity The specified sample capacity of the sample buffer.
- * @param sampleType The sample type of the samples the buffer should store.
- * @param channelCount The number of channels (1 = mono, 2 = stereo).
- * @param byteOrder The byte order for the samples (little or big endian).
- * @param presentationTimeUs The presentation time for the buffer.
- * @return A new and empty sample buffer.
- */
- @SuppressWarnings("unused")
- public static SampleBuffer allocate(int capacity, @SampleType int sampleType, int channelCount, ByteOrder byteOrder, long presentationTimeUs) {
- return new SampleBuffer(capacity, sampleType, channelCount, byteOrder, presentationTimeUs);
- }
-
- private SampleBuffer(int capacity, @SampleType int sampleType, int channelCount, ByteOrder byteOrder, long presentationTimeUs) {
- this.byteBuffer = ByteBuffer.allocate(sampleType * capacity);
- this.byteBuffer.order(byteOrder);
- this.sampleType = sampleType;
- this.channelCount = channelCount;
- this.presentationTimeUs = presentationTimeUs;
- }
-
- private SampleBuffer(ByteBuffer buffer, @SampleType int sampleType, int channelCount, long presentationTimeUs) {
- this.byteBuffer = buffer;
- this.sampleType = sampleType;
- this.channelCount = channelCount;
- this.presentationTimeUs = presentationTimeUs;
- }
-
- /**
- * Returns the capacity of the buffer per channel.
- */
- @SuppressWarnings("unused")
- public int capacity() {
- return byteBuffer.capacity() / sampleType / channelCount;
- }
-
- /**
- * Returns the number of samples in the buffer per channel.
- */
- public int limit() {
- return byteBuffer.limit() / sampleType / channelCount;
- }
-
- /**
- * Sets the number of samples in the buffer to the new limit.
- * @param newLimit The new limit of the sample buffer.
- */
- public void limit(int newLimit) {
- byteBuffer.limit(newLimit * sampleType * channelCount);
- }
-
- /**
- * Returns the current position in the buffer per channel.
- * @return The position of the sample buffer.
- */
- public int position() {
- return byteBuffer.position() / sampleType / channelCount;
- }
-
- /**
- *Sets the position of the sample buffer to the new index.
- * @param newPosition The new position of the sample buffer.
- */
- public void position(int newPosition) {
- byteBuffer.position(newPosition * sampleType * channelCount);
- }
-
- /**
- * Returns the sample of the current position and then increments the position.
- * The sample returned is a mixed sample getting all samples from each channel.
- * @return The mixed sample.
- */
- public double get() {
- // convenient method to avoid duplicate code: we use -1 index to call get()
- return get(-1);
- }
-
- /**
- * Returns the sample from the given index in the buffer.
- * If the buffer's channel count is > 1 the sample returned
- * is a mixed sample getting all samples from each channel.
- * @param index The index of the sample requested.
- * @return The sample requested.
- */
- public double get(int index) {
- int internalIndex = index * channelCount * sampleType;
-
- switch (sampleType) {
- case SampleType.UNSIGNED_8_BIT: {
- double avg = 0;
-
- // get a sample mix to mono from the index
- for (int i = 0; i < channelCount; i++) {
- byte b = index == -1 ? byteBuffer.get() : byteBuffer.get(internalIndex + i * sampleType);
- int a = b & 0xff; // convert the 8 bits into int so we can calc > 127
- avg += a / (double)channelCount;
- }
-
- return avg * 2.0 / 255.0 - 1.0; //magic? check out SampleType
- }
- case SampleType.SIGNED_16_BIT: {
- double avg = 0;
-
- // get a sample mix to mono from the index
- for (int i = 0; i < channelCount; i++) {
- short a = index == -1 ? byteBuffer.getShort() : byteBuffer.getShort(internalIndex + i * sampleType);
- avg += a / (double)channelCount;
- }
-
- return (avg + 32768.0) * 2.0 / 65535.0 - 1.0; //magic? check out SampleType
- }
- case SampleType.FLOAT: {
- double avg = 0;
-
- // get a sample mix to mono from the index
- for (int i = 0; i < channelCount; i++) {
- double a = index == -1 ? byteBuffer.getFloat() : byteBuffer.getFloat(internalIndex + i * sampleType);
- avg += a / (double)channelCount;
- }
-
- return avg;
- }
- default: {
- Log.e(TAG, "SampleBuffer.get(int): The sample type is not known: " + sampleType);
- return 0.0;
- }
- }
- }
-
- /**
- * Puts a sample to the current position and increments the position.
- * @param sample The sample to put into the buffer.
- */
- public void put(double sample) {
- put(-1, sample);
- }
-
- /**
- * Puts a sample to the given index in the buffer.
- * If the buffer's channel count is > 1 the sample
- * will be stored in each channel at the given index.
- * @param index The index to put the sample.
- * @param sample The sample to store in the buffer.
- */
- public void put(int index, double sample) {
- int internalIndex = index * channelCount * sampleType;
- switch (sampleType) {
- case SampleType.UNSIGNED_8_BIT: {
- int a = (int)Math.round((sample + 1.0) * 255.0 / 2.0); //magic? check out SampleType
- byte b = (byte)a;
- if (index == -1) {
- for (int i = 0; i < channelCount; i++) {
- byteBuffer.put(b);
- }
- } else {
- for (int i = 0; i < channelCount; i++) {
- byteBuffer.put(internalIndex + i * sampleType, b);
- }
- }
- break;
- }
- case SampleType.SIGNED_16_BIT: {
- short a = (short)Math.round((sample + 1.0) * 65535 / 2.0 - 32767.0); //magic? check out SampleType
- if (index == -1) {
- for (int i = 0; i < channelCount; i++) {
- byteBuffer.putShort(a);
- }
- } else {
- for (int i = 0; i < channelCount; i++) {
- byteBuffer.putShort(internalIndex + i * sampleType, a);
- }
- }
- break;
- }
- case SampleType.FLOAT: {
- if (index == -1) {
- for (int i = 0; i < channelCount; i++) {
- byteBuffer.putFloat((float) sample);
- }
- } else {
- for (int i = 0; i < channelCount; i++) {
- byteBuffer.putFloat(internalIndex + i * sampleType, (float) sample);
- }
- }
- break;
- }
- default: {
- Log.e(TAG, "SampleBuffer.set(int): The sample type is not known: " + sampleType);
- }
- }
- }
-
- /**
- * Returns the raw byte buffer managed by this sample buffer.
- * @return The raw byte buffer managed by this sample buffer.
- */
- public ByteBuffer getByteBuffer() {
- return byteBuffer;
- }
-
- /**
- * Returns a copy of the bytes from position 0 to the current limit.
- * @return A copy of the bytes.
- */
- public byte[] getBytes() {
- int limit = byteBuffer.limit();
- byte[] bytes = new byte[limit];
-
- for (int i = 0; i < limit; ++i) {
- bytes[i] = byteBuffer.get(i);
- }
-
- return bytes;
- }
-
- /**
- * The presentation time of this sample buffer.
- * @return The presentation time of this sample buffer.
- */
- public long getPresentationTimeUs() {
- return presentationTimeUs;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java
deleted file mode 100644
index 559b74514..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java
+++ /dev/null
@@ -1,434 +0,0 @@
-package com.smartdevicelink.managers.file;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.net.Uri;
-import android.support.annotation.NonNull;
-import android.util.Log;
-import android.util.SparseArray;
-
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.managers.file.filetypes.SdlFile;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.DeleteFile;
-import com.smartdevicelink.proxy.rpc.ListFiles;
-import com.smartdevicelink.proxy.rpc.ListFilesResponse;
-import com.smartdevicelink.proxy.rpc.PutFile;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * <strong>FileManager</strong> <br>
- *
- * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
- *
- * The SDLFileManager uploads files and keeps track of all the uploaded files names during a session. <br>
- *
- * We need to add the following struct: SDLFile<br>
- *
- * It is broken down to these areas: <br>
- *
- * 1. Getters <br>
- * 2. Deletion methods <br>
- * 3. Uploading Files / Artwork
- */
-public class FileManager extends BaseSubManager {
-
- private final static String TAG = "FileManager";
- private List<String> remoteFiles, uploadedEphemeralFileNames;
- private final WeakReference<Context> context;
-
- public FileManager(ISdl internalInterface, Context context) {
-
- // setup
- super(internalInterface);
- this.context = new WeakReference<>(context);
-
- uploadedEphemeralFileNames = new ArrayList<>();
- }
-
- @Override
- public void start(CompletionListener listener) {
- // prepare manager - don't set state to ready until we have list of files
- retrieveRemoteFiles();
- super.start(listener);
- }
-
- // GETTERS
-
- /**
- * Returns a list of file names currently residing on core
- * @return List<String> of remote file names
- */
- public List<String> getRemoteFileNames() {
- if (getState() != BaseSubManager.READY){
- // error and dont return list
- throw new IllegalArgumentException("FileManager is not READY");
- }
- // return list (this is synchronous at this point)
- return remoteFiles;
- }
-
- private void retrieveRemoteFiles(){
- remoteFiles = new ArrayList<>();
- // hold list in remoteFiles class var
- ListFiles listFiles = new ListFiles();
- listFiles.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if(response.getSuccess()){
- if(((ListFilesResponse) response).getFilenames() != null){
- remoteFiles.addAll(((ListFilesResponse) response).getFilenames());
- }
- // on callback set manager to ready state
- transitionToState(BaseSubManager.READY);
- }
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- // file list could not be received
- transitionToState(BaseSubManager.ERROR);
- }
- });
- internalInterface.sendRPCRequest(listFiles);
- }
-
- // DELETION
-
- /**
- * Attempts to delete the desired file from core, calls listener with indication of success/failure
- * @param fileName name of file to be deleted
- * @param listener callback that is called on response from core
- */
- public void deleteRemoteFileWithName(@NonNull final String fileName, final CompletionListener listener){
- DeleteFile deleteFile = new DeleteFile();
- deleteFile.setSdlFileName(fileName);
- deleteFile.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if(response.getSuccess()){
- remoteFiles.remove(fileName);
- uploadedEphemeralFileNames.remove(fileName);
- }
- if(listener != null){
- listener.onComplete(response.getSuccess());
- }
- }
- });
- internalInterface.sendRPCRequest(deleteFile);
- }
-
- /**
- * Attempts to delete a list of files from core, calls listener with indication of success/failure
- * @param fileNames list of file names to be deleted
- * @param listener callback that is called once core responds to all deletion requests
- */
- public void deleteRemoteFilesWithNames(@NonNull List<String> fileNames, final MultipleFileCompletionListener listener){
- if(fileNames.isEmpty()){
- return;
- }
- final List<DeleteFile> deleteFileRequests = new ArrayList<>();
- for(String fileName : fileNames){
- DeleteFile deleteFile = new DeleteFile();
- deleteFile.setSdlFileName(fileName);
- deleteFileRequests.add(deleteFile);
- }
- sendMultipleFileOperations(deleteFileRequests, listener);
- }
-
- // UPLOAD FILES / ARTWORK
-
- /**
- * Creates and returns a PutFile request that would upload a given SdlFile
- * @param file SdlFile with fileName and one of A) fileData, B) Uri, or C) resourceID set
- * @return a valid PutFile request if SdlFile contained a fileName and sufficient data
- */
- private PutFile createPutFile(@NonNull final SdlFile file){
- PutFile putFile = new PutFile();
- if(file.getName() == null){
- throw new IllegalArgumentException("You must specify an file name in the SdlFile");
- }else{
- putFile.setSdlFileName(file.getName());
- }
-
- if(file.getResourceId() > 0){
- // Use resource id to upload file
- byte[] contents = contentsOfResource(file.getResourceId());
- if(contents != null){
- putFile.setFileData(contents);
- }else{
- throw new IllegalArgumentException("Resource file id was empty");
- }
- }else if(file.getUri() != null){
- // Use URI to upload file
- byte[] contents = contentsOfUri(file.getUri());
- if(contents != null){
- putFile.setFileData(contents);
- }else{
- throw new IllegalArgumentException("Uri was empty");
- }
- }else if(file.getFileData() != null){
- // Use file data (raw bytes) to upload file
- putFile.setFileData(file.getFileData());
- }else{
- throw new IllegalArgumentException("The SdlFile to upload does " +
- "not specify its resourceId, Uri, or file data");
- }
-
- if(file.getType() != null){
- putFile.setFileType(file.getType());
- }
- putFile.setPersistentFile(file.isPersistent());
-
- return putFile;
- }
-
- /**
- * Sends list of provided requests (strictly PutFile or DeleteFile) asynchronously through internalInterface,
- * calls listener on conclusion of sending requests.
- * @param requests Non-empty list of PutFile or DeleteFile requests
- * @param listener MultipleFileCompletionListener that is called upon conclusion of sending requests
- */
- private void sendMultipleFileOperations(final List<? extends RPCRequest> requests, final MultipleFileCompletionListener listener){
- final Map<String, String> errors = new HashMap<>();
- final SparseArray<String> fileNameMap = new SparseArray<>();
- final boolean deletionOperation;
- if(requests.get(0) instanceof PutFile){
- deletionOperation = false;
- }else if(requests.get(0) instanceof DeleteFile){
- deletionOperation = true;
- }else{
- return; // requests are not DeleteFile or PutFile
- }
- internalInterface.sendRequests(requests, new OnMultipleRequestListener() {
- int fileNum = 0;
-
- @Override
- public void addCorrelationId(int correlationid) {
- super.addCorrelationId(correlationid);
- if(deletionOperation){
- fileNameMap.put(correlationid, ((DeleteFile) requests.get(fileNum++)).getSdlFileName());
- }else{
- fileNameMap.put(correlationid, ((PutFile) requests.get(fileNum++)).getSdlFileName());
- }
- }
-
- @Override
- public void onUpdate(int remainingRequests) {}
-
- @Override
- public void onFinished() {
- if(listener != null) {
- if (errors.isEmpty()) {
- listener.onComplete(null);
- } else {
- listener.onComplete(errors);
- }
- }
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- if(fileNameMap.get(correlationId) != null){
- errors.put(fileNameMap.get(correlationId), buildErrorString(resultCode, info));
- }// else no fileName for given correlation ID
- }
-
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if(response.getSuccess()){
- if(fileNameMap.get(correlationId) != null){
- if(deletionOperation){
- remoteFiles.remove(fileNameMap.get(correlationId));
- uploadedEphemeralFileNames.remove(fileNameMap.get(correlationId));
- }else{
- remoteFiles.add(fileNameMap.get(correlationId));
- uploadedEphemeralFileNames.add(fileNameMap.get(correlationId));
- }
- }
- }
- }
- });
- }
-
- /**
- * Attempts to upload a SdlFile to core
- * @param file SdlFile with file name and one of A) fileData, B) Uri, or C) resourceID set
- * @param listener called when core responds to the attempt to upload the file
- */
- public void uploadFile(@NonNull final SdlFile file, final CompletionListener listener){
- PutFile putFile = createPutFile(file);
-
- putFile.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if(response.getSuccess()){
- remoteFiles.add(file.getName());
- uploadedEphemeralFileNames.add(file.getName());
- }
- if(listener != null){
- listener.onComplete(response.getSuccess());
- }
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- super.onError(correlationId, resultCode, info);
- if(listener != null){
- listener.onComplete(false);
- }
- }
- });
-
- internalInterface.sendRPCRequest(putFile);
- }
-
- /**
- * Attempts to upload a list of SdlFiles to core
- * @param files list of SdlFiles with file name and one of A) fileData, B) Uri, or C) resourceID set
- * @param listener callback that is called once core responds to all upload requests
- */
- public void uploadFiles(@NonNull List<? extends SdlFile> files, final MultipleFileCompletionListener listener){
- if(files.isEmpty()){
- return;
- }
- final List<PutFile> putFileRequests = new ArrayList<>();
- for(SdlFile file : files){
- putFileRequests.add(createPutFile(file));
- }
- sendMultipleFileOperations(putFileRequests, listener);
- }
-
- /**
- * Attempts to upload a SdlArtwork to core
- * @param file SdlArtwork with file name and one of A) fileData, B) Uri, or C) resourceID set
- * @param listener called when core responds to the attempt to upload the file
- */
- public void uploadArtwork(final SdlArtwork file, final CompletionListener listener){
- uploadFile(file, listener);
- }
-
- /**
- * Attempts to upload a list of SdlArtworks to core
- * @param files list of SdlArtworks with file name and one of A) fileData, B) Uri, or C) resourceID set
- * @param listener callback that is called once core responds to all upload requests
- */
- public void uploadArtworks(List<SdlArtwork> files, final MultipleFileCompletionListener listener){
- uploadFiles(files, listener);
- }
-
- /**
- * Check if an SdlFile has been uploaded to core
- * @param file SdlFile
- * @return boolean that tells whether file has been uploaded to core (true) or not (false)
- */
- public boolean hasUploadedFile(@NonNull SdlFile file){
- if(file.isPersistent() && remoteFiles != null && remoteFiles.contains(file.getName())){
- return true;
- }else if(!file.isPersistent() && remoteFiles != null && remoteFiles.contains(file.getName())
- && uploadedEphemeralFileNames.contains(file.getName())){
- return true;
- }
- return false;
- }
-
- // HELPERS
-
- /**
- * Builds an error string for a given Result and info string
- * @param resultCode Result
- * @param info String returned from OnRPCRequestListener.onError()
- * @return Error string
- */
- static public String buildErrorString(Result resultCode, String info){
- return resultCode.toString() + " : " + info;
- }
-
- /**
- * Helper method to take resource files and turn them into byte arrays
- * @param resource Resource file id
- * @return Resulting byte array
- */
- private byte[] contentsOfResource(int resource) {
- InputStream is = null;
- try {
- is = context.get().getResources().openRawResource(resource);
- return contentsOfInputStream(is);
- } catch (Resources.NotFoundException e) {
- Log.w(TAG, "Can't read from resource", e);
- return null;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- /**
- * Helper method to take Uri and turn it into byte array
- * @param uri Uri for desired file
- * @return Resulting byte array
- */
- private byte[] contentsOfUri(Uri uri){
- InputStream is = null;
- try{
- is = context.get().getContentResolver().openInputStream(uri);
- return contentsOfInputStream(is);
- } catch (IOException e){
- Log.w(TAG, "Can't read from Uri", e);
- return null;
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- /**
- * Helper method to take InputStream and turn it into byte array
- * @param is valid InputStream
- * @return Resulting byte array
- */
- private byte[] contentsOfInputStream(InputStream is){
- if(is == null){
- return null;
- }
- try{
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- final int bufferSize = 4096;
- final byte[] buffer = new byte[bufferSize];
- int available;
- while ((available = is.read(buffer)) >= 0) {
- os.write(buffer, 0, available);
- }
- return os.toByteArray();
- } catch (IOException e){
- Log.w(TAG, "Can't read from InputStream", e);
- return null;
- }
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/file/MultipleFileCompletionListener.java b/sdl_android/src/main/java/com/smartdevicelink/managers/file/MultipleFileCompletionListener.java
deleted file mode 100644
index 803c54f64..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/file/MultipleFileCompletionListener.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.smartdevicelink.managers.file;
-
-import java.util.Map;
-
-public interface MultipleFileCompletionListener {
-
- /**
- * @param errors - a dictionary (map) property, of type <String: String>, and contains information
- * on all failed uploads. The key is the name of the file that did not upload properly,
- * the value is an error String describing what went wrong on that particular upload attempt.
- * If all files are uploaded successfully, errors is null
- */
- void onComplete(Map<String, String> errors);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java b/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
deleted file mode 100644
index d888f56ed..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.managers.file.filetypes;
-
-import android.net.Uri;
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-
-/**
- * A class that extends SdlFile, representing artwork (JPEG, PNG, or BMP) to be uploaded to core
- */
-public class SdlArtwork extends SdlFile {
- public SdlArtwork(){}
-
- public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, int id, boolean persistentFile) {
- super(fileName, fileType, id, persistentFile);
- }
-
- public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, Uri uri, boolean persistentFile) {
- super(fileName, fileType, uri, persistentFile);
- }
-
- public SdlArtwork(@NonNull String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile) {
- super(fileName, fileType, data, persistentFile);
- }
-
- @Override
- public void setType(@NonNull FileType fileType) {
- if(fileType.equals(FileType.GRAPHIC_JPEG) || fileType.equals(FileType.GRAPHIC_PNG)
- || fileType.equals(FileType.GRAPHIC_BMP)){
- super.setType(fileType);
- }else{
- throw new IllegalArgumentException("Only JPEG, PNG, and BMP image types are supported.");
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
deleted file mode 100644
index ce4cf8285..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.managers.file.filetypes;
-
-import android.net.Uri;
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-
-/**
- * A class representing data to be uploaded to core
- */
-public class SdlFile{
- private String fileName;
- private int id = -1;
- private Uri uri;
- private byte[] fileData;
- private FileType fileType;
- private boolean persistentFile;
-
- public SdlFile(){}
-
- public SdlFile(@NonNull String fileName, @NonNull FileType fileType, int id, boolean persistentFile){
- this.fileName = fileName;
- this.fileType = fileType;
- this.id = id;
- this.persistentFile = persistentFile;
- }
-
- public SdlFile(@NonNull String fileName, @NonNull FileType fileType, Uri uri, boolean persistentFile){
- this.fileName = fileName;
- this.fileType = fileType;
- this.uri = uri;
- this.persistentFile = persistentFile;
- }
-
- public SdlFile(@NonNull String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile){
- this.fileName = fileName;
- this.fileType = fileType;
- this.fileData = data;
- this.persistentFile = persistentFile;
- }
-
- public void setName(@NonNull String fileName){
- this.fileName = fileName;
- }
- public String getName(){
- return fileName;
- }
-
- public void setResourceId(int id){
- this.id = id;
- }
- public int getResourceId(){
- return id;
- }
-
- public void setUri(Uri uri){
- this.uri = uri;
- }
- public Uri getUri(){
- return uri;
- }
-
- public void setFileData(byte[] data){
- this.fileData = data;
- }
- public byte[] getFileData(){
- return fileData;
- }
-
- public void setType(@NonNull FileType fileType){
- this.fileType = fileType;
- }
- public FileType getType(){
- return fileType;
- }
-
- public void setPersistent(boolean persistentFile){
- this.persistentFile = persistentFile;
- }
- public boolean isPersistent(){
- return this.persistentFile;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java b/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java
deleted file mode 100644
index ce571daeb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package com.smartdevicelink.managers.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/managers/lockscreen/LockScreenManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java
deleted file mode 100644
index 4bd2f229f..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java
+++ /dev/null
@@ -1,289 +0,0 @@
-package com.smartdevicelink.managers.lockscreen;
-
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.os.Build;
-import android.util.Log;
-
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-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;
- private volatile boolean isApplicationForegrounded;
- private android.arch.lifecycle.LifecycleObserver lifecycleObserver;
- 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();
- }
-
- @Override
- public void start(CompletionListener listener) {
- transitionToState(READY);
- super.start(listener);
- }
-
- @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;
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- try {
- if (android.arch.lifecycle.ProcessLifecycleOwner.get() != null && lifecycleObserver != null) {
- android.arch.lifecycle.ProcessLifecycleOwner.get().getLifecycle().removeObserver(lifecycleObserver);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- lifecycleObserver = null;
- }
-
- isApplicationForegrounded = false;
-
- super.dispose();
- }
-
- ////
- // 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);
- }
-
- // Set up listener for Application Foreground / Background events
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- try {
- lifecycleObserver = new android.arch.lifecycle.LifecycleObserver() {
- @android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_START)
- public void onMoveToForeground() {
- isApplicationForegrounded = true;
- launchLockScreenActivity();
- }
-
- @android.arch.lifecycle.OnLifecycleEvent(android.arch.lifecycle.Lifecycle.Event.ON_STOP)
- public void onMoveToBackground() {
- isApplicationForegrounded = false;
- }
- };
-
- if (android.arch.lifecycle.ProcessLifecycleOwner.get() != null) {
- android.arch.lifecycle.ProcessLifecycleOwner.get().getLifecycle().addObserver(lifecycleObserver);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- } else{
- isApplicationForegrounded = true;
- }
- }
-
- ////
- // 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 && isApplicationForegrounded && 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));
- }
- }
- }
-
- ////
- // 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/managers/lockscreen/SDLLockScreenActivity.java b/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java
deleted file mode 100644
index b99cc0d05..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package com.smartdevicelink.managers.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/managers/permission/OnPermissionChangeListener.java b/sdl_android/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java
deleted file mode 100644
index 45035b91a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.smartdevicelink.managers.permission;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-
-import java.util.Map;
-
-/**
- * OnPermissionChangeListener is a listener which includes a callback method that can be called when there are permission changes
- */
-public interface OnPermissionChangeListener {
- /**
- * Call back method that PermissionManager will call to inform the developer about permission changes
- * @param allowedPermissions an overall view about the status of the permissions
- * @param permissionGroupStatus a detailed view about which permissions are allowed and which ones are not
- * @see com.smartdevicelink.managers.permission.PermissionManager.PermissionGroupStatus
- */
- void onPermissionsChange(@NonNull Map<FunctionID, PermissionStatus> allowedPermissions, @NonNull @PermissionManager.PermissionGroupStatus int permissionGroupStatus);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java b/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java
deleted file mode 100644
index edb3788b6..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.smartdevicelink.managers.permission;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-
-import java.util.List;
-
-/**
- * PermissionElement holds the RPC name that the developer wants to add a listener for.
- * It also holds any permission parameters for that RPC that the developer wants to track as well.
- */
-public class PermissionElement {
- private final FunctionID rpcName;
- private final List<String> parameters;
-
- /**
- * Create a new instance of PermissionElement
- * @param rpcName
- * @param parameters
- */
- public PermissionElement(@NonNull FunctionID rpcName, List<String> parameters){
- this.rpcName = rpcName;
- this.parameters = parameters;
- }
-
- /**
- * Get the RPC name
- * @return FunctionID value represents the RPC name
- */
- public FunctionID getRPCName() {
- return rpcName;
- }
-
- /**
- * Get the permission parameters for the RPC
- * @return List<String> represents the permission parameters for the RPC
- */
- public List<String> getParameters() {
- return parameters;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java b/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java
deleted file mode 100644
index de7aab01a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.managers.permission;
-
-import android.support.annotation.NonNull;
-
-import java.util.List;
-import java.util.UUID;
-
-/**
- * PermissionFilter holds all the required information for a specific OnPermissionChangeListener
- */
-class PermissionFilter {
- private final UUID identifier;
- private final List<PermissionElement> permissionElements;
- private final int groupType;
- private final OnPermissionChangeListener listener;
-
- /**
- * Creates a new instance of PermissionFilter
- * @param identifier
- * @param permissionElements
- * @param groupType
- * @param listener
- * @see com.smartdevicelink.managers.permission.PermissionManager.PermissionGroupType
- */
- PermissionFilter(UUID identifier, @NonNull List<PermissionElement> permissionElements, @NonNull @PermissionManager.PermissionGroupType int groupType, @NonNull OnPermissionChangeListener listener) {
- if (identifier == null) {
- this.identifier = UUID.randomUUID();
- } else {
- this.identifier = identifier;
- }
- this.permissionElements = permissionElements;
- this.groupType = groupType;
- this.listener = listener;
- }
-
- /**
- * Get the unique id for the listener
- * @return UUID object represents the id for the listener
- */
- protected UUID getIdentifier() {
- return identifier;
- }
-
- /**
- * Get the permission elements that the developer wants to add a listener for
- * @return List<PermissionElement> represents the RPCs and their parameters that the developer wants to add a listener for
- */
- protected List<PermissionElement> getPermissionElements() {
- return permissionElements;
- }
-
- /**
- * Get how we want the listener to be called: when any change happens? or when all permissions become allowed?
- * @return PermissionGroupType int value represents whether the developer needs the listener to be called when there is any permissions change or only when all permission become allowed
- * @see com.smartdevicelink.managers.permission.PermissionManager.PermissionGroupType
- */
- protected @PermissionManager.PermissionGroupType int getGroupType() {
- return groupType;
- }
-
- /**
- * Get the listener object
- * @return OnPermissionChangeListener object represents the listener for that filter
- */
- protected OnPermissionChangeListener getListener() {
- return listener;
- }
-
-
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
deleted file mode 100644
index 0c0ea2b6e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
+++ /dev/null
@@ -1,350 +0,0 @@
-package com.smartdevicelink.managers.permission;
-
-import android.support.annotation.IntDef;
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.PermissionItem;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- PermissionManager gives the developer information about what permissions are permitted in specific HMI level
- and helps developers setup listeners to be called when specific permissions become allowed.<br>
-
- This should be used through the {@link com.smartdevicelink.managers.SdlManager} and not be instantiated by itself
-**/
-
- public class PermissionManager extends BaseSubManager{
-
- private HMILevel currentHMILevel;
- private Map<FunctionID, PermissionItem> currentPermissionItems;
- private OnRPCNotificationListener onHMIStatusListener, onPermissionsChangeListener;
- private List<PermissionFilter> filters;
-
- // Permission groups status constants
- @IntDef({PERMISSION_GROUP_STATUS_ALLOWED, PERMISSION_GROUP_STATUS_DISALLOWED,
- PERMISSION_GROUP_STATUS_MIXED, PERMISSION_GROUP_STATUS_UNKNOWN})
- @Retention(RetentionPolicy.SOURCE)
- public @interface PermissionGroupStatus {}
- public static final int PERMISSION_GROUP_STATUS_ALLOWED = 0; // Every permission in the group is currently allowed
- public static final int PERMISSION_GROUP_STATUS_DISALLOWED = 1; // Every permission in the group is currently disallowed
- public static final int PERMISSION_GROUP_STATUS_MIXED = 2; // Some permissions in the group are allowed and some disallowed
- public static final int PERMISSION_GROUP_STATUS_UNKNOWN = 3; // The current status of the group is unknown
-
- // Permission groups type constants
- @IntDef({PERMISSION_GROUP_TYPE_ALL_ALLOWED, PERMISSION_GROUP_TYPE_ANY})
- @Retention(RetentionPolicy.SOURCE)
- public @interface PermissionGroupType {}
- public static final int PERMISSION_GROUP_TYPE_ALL_ALLOWED = 0; // Be notified when all of the permission in the group are allowed, or, when they all stop being allowed in some sense, that is, when they were all allowed, and now they are not.
- public static final int PERMISSION_GROUP_TYPE_ANY = 1; // Be notified when any change in availability occurs among the group
-
- /**
- * Creates a new instance of the PermissionManager
- * @param internalInterface
- */
- public PermissionManager(@NonNull ISdl internalInterface){
- super(internalInterface);
- this.currentPermissionItems = new HashMap<>();
- this.filters = new ArrayList<>();
-
- // Set PermissionManager's OnHMIStatusListener to keep currentHMILevel updated and call developer's listeners if needed
- onHMIStatusListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- HMILevel previousHMILevel = currentHMILevel;
- currentHMILevel = ((OnHMIStatus)notification).getHmiLevel();
- checkState();
- notifyListeners(currentPermissionItems, previousHMILevel, currentPermissionItems, currentHMILevel);
- }
- };
- internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
-
- // Set PermissionManager's PermissionsChangeListener to keep currentPermissionItems updated and call developer's listeners if needed
- onPermissionsChangeListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- List<PermissionItem> permissionItems = ((OnPermissionsChange)notification).getPermissionItem();
- Map<FunctionID, PermissionItem> previousPermissionItems = currentPermissionItems;
- currentPermissionItems = new HashMap<>();
- for (PermissionItem permissionItem : permissionItems) {
- currentPermissionItems.put(FunctionID.getEnumForString(permissionItem.getRpcName()), permissionItem);
- }
- notifyListeners(previousPermissionItems, currentHMILevel, currentPermissionItems, currentHMILevel);
- previousPermissionItems.clear();
- }
- };
- internalInterface.addOnRPCNotificationListener(FunctionID.ON_PERMISSIONS_CHANGE, onPermissionsChangeListener);
- }
-
- @Override
- public void start(CompletionListener listener) {
- checkState();
- super.start(listener);
- }
-
- private synchronized void checkState(){
- if(this.getState() == SETTING_UP && currentHMILevel != null){
- transitionToState(READY);
- }
- }
-
- /**
- * Go over all developer's listeners and call them if needed because of HMI level change or permission items change
- * @param previousPermissionItems
- * @param previousHmiLevel
- * @param currentPermissionItems
- * @param currentHMILevel
- */
- private void notifyListeners(Map<FunctionID, PermissionItem> previousPermissionItems, HMILevel previousHmiLevel, Map<FunctionID, PermissionItem> currentPermissionItems, HMILevel currentHMILevel){
- for (PermissionFilter filter : filters) {
- boolean anyChange = false;
- boolean allWereAllowed = true;
- boolean allNowAllowed = true;
- for (PermissionElement permissionElement : filter.getPermissionElements()) {
- // If at any point this condition is satisfied, then we don't need to continue
- if (anyChange && !allWereAllowed && !allNowAllowed){
- break;
- }
- boolean rpcWasAllowed = isRPCAllowed(permissionElement.getRPCName(), previousPermissionItems, previousHmiLevel);
- boolean rpcNowAllowed = isRPCAllowed(permissionElement.getRPCName(), currentPermissionItems, currentHMILevel);
- if (rpcWasAllowed != rpcNowAllowed){
- anyChange = true;
- }
- if (!rpcWasAllowed){
- allWereAllowed = false;
- }
- if (!rpcNowAllowed){
- allNowAllowed = false;
- }
- if (permissionElement.getParameters() != null && permissionElement.getParameters().size() > 0) {
- for (String parameter : permissionElement.getParameters()) {
- boolean parameterWasAllowed = isPermissionParameterAllowed(permissionElement.getRPCName(), parameter, previousPermissionItems, previousHmiLevel);
- boolean parameterNowAllowed = isPermissionParameterAllowed(permissionElement.getRPCName(), parameter, currentPermissionItems, currentHMILevel);
- if (parameterWasAllowed != parameterNowAllowed){
- anyChange = true;
- }
- if (!parameterWasAllowed){
- allWereAllowed = false;
- }
- if (!parameterNowAllowed){
- allNowAllowed = false;
- }
- }
- }
- }
- if (filter.getGroupType() == PERMISSION_GROUP_TYPE_ALL_ALLOWED && anyChange && (allWereAllowed || allNowAllowed)){
- notifyListener(filter);
- } else if (filter.getGroupType() == PERMISSION_GROUP_TYPE_ANY && anyChange){
- notifyListener(filter);
- }
- }
- }
-
- /**
- * Determine if an individual RPC is allowed
- * @param rpcName FunctionID value that represents the name of the RPC
- * @param permissionItems Map containing HMI and parameter permissions for a specific RPC
- * @param hmiLevel If the RPC is allowed at that HMI Level. Ex: None or Full
- * @return boolean represents whether the RPC is allowed or not
- */
- private boolean isRPCAllowed(@NonNull FunctionID rpcName, Map<FunctionID, PermissionItem> permissionItems, HMILevel hmiLevel){
- PermissionItem permissionItem = permissionItems.get(rpcName);
- if (hmiLevel == null || permissionItem == null || permissionItem.getHMIPermissions() == null || permissionItem.getHMIPermissions().getAllowed() == null){
- return false;
- } else if (permissionItem.getHMIPermissions().getUserDisallowed() != null){
- return permissionItem.getHMIPermissions().getAllowed().contains(hmiLevel) && !permissionItem.getHMIPermissions().getUserDisallowed().contains(hmiLevel);
- } else {
- return permissionItem.getHMIPermissions().getAllowed().contains(hmiLevel);
- }
- }
-
- /**
- * Determine if an individual RPC is allowed for the current permission items and HMI level
- * @param rpcName rpcName FunctionID value that represents the name of the RPC
- * @return boolean represents whether the RPC is allowed or not
- */
- @SuppressWarnings("WeakerAccess")
- public boolean isRPCAllowed(@NonNull FunctionID rpcName){
- return isRPCAllowed(rpcName, currentPermissionItems, currentHMILevel);
- }
-
- /**
- * Determine if an individual permission parameter is allowed
- * @param rpcName FunctionID value that represents the name of the RPC
- * @param parameter String value that represents a parameter for the RPC. Ex: "rpm" or "speed" for GetVehicleData
- * @param permissionItems Map containing HMI and parameter permissions for a specific RPC
- * @param hmiLevel If the RPC is allowed at that HMI Level. Ex: None or Full
- * @return boolean represents whether the permission parameter is allowed or not
- */
- private boolean isPermissionParameterAllowed(@NonNull FunctionID rpcName, @NonNull String parameter, Map<FunctionID, PermissionItem> permissionItems, HMILevel hmiLevel){
- PermissionItem permissionItem = permissionItems.get(rpcName);
- if (!isRPCAllowed(rpcName, permissionItems, hmiLevel) || permissionItem.getParameterPermissions() == null || permissionItem.getParameterPermissions().getAllowed() == null){
- return false;
- } else if (permissionItem.getParameterPermissions().getUserDisallowed() != null){
- return permissionItem.getParameterPermissions().getAllowed().contains(parameter) && !permissionItem.getParameterPermissions().getUserDisallowed().contains(parameter);
- } else {
- return permissionItem.getParameterPermissions().getAllowed().contains(parameter);
- }
- }
-
- /**
- * Determine if an individual permission parameter is allowed for current permission items and current HMI level
- * @param rpcName FunctionID value that represents the name of the RPC
- * @param parameter String value that represents a parameter for the RPC
- * @return boolean represents whether the permission parameter is allowed or not
- */
- @SuppressWarnings("WeakerAccess")
- public boolean isPermissionParameterAllowed(@NonNull FunctionID rpcName, @NonNull String parameter){
- return isPermissionParameterAllowed(rpcName, parameter, currentPermissionItems, currentHMILevel);
- }
-
- /**
- * Clean up everything after the manager is no longer needed
- */
- @Override
- public void dispose(){
- super.dispose();
-
- // Remove onHMIStatusListener
- internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
- onHMIStatusListener = null;
-
- // Remove onPermissionsChangeListener
- internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onPermissionsChangeListener);
- onPermissionsChangeListener = null;
-
- // Remove developer's listeners
- filters.clear();
- }
-
- /**
- * Determine if a group of permissions is allowed for the current HMI level
- * @param permissionElements list of PermissionElement that represents the RPC names and their parameters
- * @return PermissionGroupStatus int value that gives an overall view whether the permissions are allowed or not
- * @see PermissionGroupStatus
- */
- @SuppressWarnings("WeakerAccess")
- public @PermissionGroupStatus int getGroupStatusOfPermissions(@NonNull List<PermissionElement> permissionElements){
- if (currentHMILevel == null){
- return PERMISSION_GROUP_STATUS_UNKNOWN;
- }
-
- boolean hasAllowed = false;
- boolean hasDisallowed = false;
-
- for (PermissionElement permissionElement : permissionElements) {
- // If at any point, we have both allowed and disallowed permissions, return the mixed result
- if (hasAllowed && hasDisallowed) {
- return PERMISSION_GROUP_STATUS_MIXED;
- }
-
- if (permissionElement == null){
- continue;
- } else if (!isRPCAllowed(permissionElement.getRPCName())){
- hasDisallowed = true;
- } else {
- if (permissionElement.getParameters() == null || permissionElement.getParameters().size() == 0){
- hasAllowed = true;
- } else {
- for (String permissionParameter : permissionElement.getParameters()) {
- if (isPermissionParameterAllowed(permissionElement.getRPCName(), permissionParameter)) {
- hasAllowed = true;
- } else {
- hasDisallowed = true;
- }
- }
- }
- }
- }
-
- if (!hasAllowed && !hasDisallowed){
- return PERMISSION_GROUP_STATUS_ALLOWED;
- } else if (hasAllowed && hasDisallowed) {
- return PERMISSION_GROUP_STATUS_MIXED;
- } else if (hasAllowed) {
- return PERMISSION_GROUP_STATUS_ALLOWED;
- } else{
- return PERMISSION_GROUP_STATUS_DISALLOWED;
- }
- }
-
- /**
- * Determine if a group of permissions is allowed for the current HMI level
- * This method is similar to getGroupStatusOfPermissions() but returns more detailed result about each individual permission
- * @param permissionElements list of PermissionElement that represents the RPC names and their parameters
- * @return a map with keys that are the passed in RPC names specifying if that RPC and its parameter permissions are currently allowed for the current HMI level
- */
- @SuppressWarnings("WeakerAccess")
- public Map <FunctionID, PermissionStatus> getStatusOfPermissions(@NonNull List<PermissionElement> permissionElements){
- Map<FunctionID, PermissionStatus> statusOfPermissions = new HashMap<>();
- for (PermissionElement permissionElement : permissionElements) {
- if (permissionElement == null){
- continue;
- }
- Map<String, Boolean> allowedParameters = null;
- if (permissionElement.getParameters() != null && permissionElement.getParameters().size() > 0) {
- allowedParameters = new HashMap<>();
- for (String permissionParameter : permissionElement.getParameters()) {
- allowedParameters.put(permissionParameter, isPermissionParameterAllowed(permissionElement.getRPCName(), permissionParameter));
- }
- }
- PermissionStatus permissionStatus = new PermissionStatus(permissionElement.getRPCName(), isRPCAllowed(permissionElement.getRPCName()), allowedParameters);
- statusOfPermissions.put(permissionElement.getRPCName(), permissionStatus);
- }
- return statusOfPermissions;
- }
-
- /**
- * Call the listener for a specific filter
- * @param filter the permission filter to cal
- */
- private void notifyListener(@NonNull PermissionFilter filter){
- int permissionGroupStatus = getGroupStatusOfPermissions(filter.getPermissionElements());
- Map <FunctionID, PermissionStatus> allowedPermissions = getStatusOfPermissions(filter.getPermissionElements());
- filter.getListener().onPermissionsChange(allowedPermissions, permissionGroupStatus);
- }
-
- /**
- * Add a listener to be called when there is permissions change
- * @param permissionElements list of PermissionElement that represents the RPC names and their parameters
- * @param groupType PermissionGroupType int value represents whether we need the listener to be called when there is any permissions change or only when all permission become allowed
- * @param listener OnPermissionChangeListener interface
- * @return unique uuid number for the listener. It can be used to remove the listener later.
- */
- @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"})
- public UUID addListener(@NonNull List<PermissionElement> permissionElements, @PermissionGroupType int groupType, @NonNull OnPermissionChangeListener listener){
- PermissionFilter filter = new PermissionFilter(null, permissionElements, groupType, listener);
- filters.add(filter);
- return filter.getIdentifier();
- }
-
- /**
- * Removes specific listener
- * @param listenerId the id of the listener
- */
- @SuppressWarnings("WeakerAccess")
- public void removeListener(@NonNull UUID listenerId){
- for (PermissionFilter filter : filters) {
- if (filter.getIdentifier().equals(listenerId)) {
- filters.remove(filter);
- break;
- }
- }
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java b/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java
deleted file mode 100644
index 11f464552..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.smartdevicelink.managers.permission;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-
-import java.util.Map;
-
-/**
- * PermissionStatus gives a detailed view about whether an RPC and its permission parameters are allowed or not
- */
-public class PermissionStatus {
- private final FunctionID rpcName;
- private boolean isRPCAllowed;
- private Map<String, Boolean> allowedParameters;
-
- /**
- * Creates a new PermissionStatus instance
- * @param rpcName
- * @param isRPCAllowed
- * @param allowedParameters
- */
- public PermissionStatus(@NonNull FunctionID rpcName, @NonNull boolean isRPCAllowed, Map<String, Boolean> allowedParameters) {
- this.rpcName = rpcName;
- this.isRPCAllowed = isRPCAllowed;
- this.allowedParameters = allowedParameters;
- }
-
- /**
- * Get the name of the RPC
- * @return FunctionID value represents the name of the RPC
- */
- public FunctionID getRPCName() {
- return rpcName;
- }
-
- /**
- * Get whether the RCP is allowed or not
- * @return boolean represents whether the RCP is allowed or not
- */
- public boolean getIsRPCAllowed() {
- return isRPCAllowed;
- }
-
- /**
- * Set whether the RPC is allowed or not
- * @param isRPCAllowed
- */
- protected void setIsRPCAllowed(@NonNull boolean isRPCAllowed) {
- this.isRPCAllowed = isRPCAllowed;
- }
-
- /**
- * Get the status of the permission parameter for the RPC
- * @return Map<String, Boolean> object with keys that represent the permission parameter names and values that represent whether the parameters are allowed or not
- */
- public Map<String, Boolean> getAllowedParameters() {
- return allowedParameters;
- }
-
- /**
- * Set the status of the permission parameter for the RPC
- * @param allowedParameters
- */
- protected void setAllowedParameters(Map<String, Boolean> allowedParameters) {
- this.allowedParameters = allowedParameters;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
deleted file mode 100644
index 5372cc72c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
+++ /dev/null
@@ -1,361 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayout;
-import com.smartdevicelink.proxy.rpc.enums.MetadataType;
-import com.smartdevicelink.proxy.rpc.enums.PredefinedLayout;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.util.DebugTool;
-
-import java.lang.ref.WeakReference;
-import java.util.List;
-
-/**
- * <strong>ScreenManager</strong> <br>
- *
- * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
-*/
-public class ScreenManager extends BaseSubManager {
-
- private static String TAG = "ScreenManager";
- private final WeakReference<FileManager> fileManager;
- private SoftButtonManager softButtonManager;
- private TextAndGraphicManager textAndGraphicManager;
-
- // Sub manager listener
- private final CompletionListener subManagerListener = new CompletionListener() {
- @Override
- public synchronized void onComplete(boolean success) {
- if (softButtonManager != null && textAndGraphicManager != null) {
- if (softButtonManager.getState() == BaseSubManager.READY && textAndGraphicManager.getState() == BaseSubManager.READY) {
- DebugTool.logInfo("Starting screen manager, all sub managers are in ready state");
- transitionToState(READY);
- } else if (softButtonManager.getState() == BaseSubManager.ERROR && textAndGraphicManager.getState() == BaseSubManager.ERROR) {
- Log.e(TAG, "ERROR starting screen manager, both sub managers in error state");
- transitionToState(ERROR);
- } else if (textAndGraphicManager.getState() == BaseSubManager.SETTING_UP || softButtonManager.getState() == BaseSubManager.SETTING_UP) {
- DebugTool.logInfo("SETTING UP screen manager, one sub manager is still setting up");
- transitionToState(SETTING_UP);
- } else {
- Log.w(TAG, "LIMITED starting screen manager, one sub manager in error state and the other is ready");
- transitionToState(LIMITED);
- }
- } else {
- // We should never be here, but somehow one of the sub-sub managers is null
- Log.e(TAG, "ERROR one of the screen sub managers is null");
- transitionToState(ERROR);
- }
- }
- };
-
- public ScreenManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) {
- super(internalInterface);
- this.fileManager = new WeakReference<>(fileManager);
- initialize();
- }
-
- @Override
- public void start(CompletionListener listener) {
- super.start(listener);
- }
-
- private void initialize(){
- if (fileManager.get() != null) {
- this.softButtonManager = new SoftButtonManager(internalInterface, fileManager.get());
- this.textAndGraphicManager = new TextAndGraphicManager(internalInterface, fileManager.get(), softButtonManager);
- this.softButtonManager.start(subManagerListener);
- this.textAndGraphicManager.start(subManagerListener);
- }
- }
-
- /**
- * <p>Called when manager is being torn down</p>
- */
- @Override
- public void dispose() {
- softButtonManager.dispose();
- textAndGraphicManager.dispose();
- super.dispose();
- }
-
- /**
- * Set the textField1 on the head unit screen
- * Sending an empty String "" will clear the field
- * @param textField1 String value represents the textField1
- */
- public void setTextField1(String textField1) {
- this.softButtonManager.setCurrentMainField1(textField1);
- this.textAndGraphicManager.setTextField1(textField1);
- }
-
- /**
- * Get the current textField1 value
- * @return a String value represents the current textField1 value
- */
- public String getTextField1() {
- return this.textAndGraphicManager.getTextField1();
- }
-
- /**
- * Set the textField2 on the head unit screen
- * Sending an empty String "" will clear the field
- * @param textField2 String value represents the textField1
- */
- public void setTextField2(String textField2) {
- this.textAndGraphicManager.setTextField2(textField2);
- }
-
- /**
- * Get the current textField2 value
- * @return a String value represents the current textField2 value
- */
- public String getTextField2() {
- return this.textAndGraphicManager.getTextField2();
- }
-
- /**
- * Set the textField3 on the head unit screen
- * Sending an empty String "" will clear the field
- * @param textField3 String value represents the textField1
- */
- public void setTextField3(String textField3) {
- this.textAndGraphicManager.setTextField3(textField3);
- }
-
- /**
- * Get the current textField3 value
- * @return a String value represents the current textField3 value
- */
- public String getTextField3() {
- return this.textAndGraphicManager.getTextField3();
- }
-
- /**
- * Set the textField4 on the head unit screen
- * Sending an empty String "" will clear the field
- * @param textField4 String value represents the textField1
- */
- public void setTextField4(String textField4) {
- this.textAndGraphicManager.setTextField4(textField4);
- }
-
- /**
- * Get the current textField4 value
- * @return a String value represents the current textField4 value
- */
- public String getTextField4() {
- return this.textAndGraphicManager.getTextField4();
- }
-
- /**
- * Set the mediaTrackTextField on the head unit screen
- * @param mediaTrackTextField String value represents the mediaTrackTextField
- */
- public void setMediaTrackTextField(String mediaTrackTextField) {
- this.textAndGraphicManager.setMediaTrackTextField(mediaTrackTextField);
- }
-
- /**
- * Get the current mediaTrackTextField value
- * @return a String value represents the current mediaTrackTextField
- */
- public String getMediaTrackTextField() {
- return this.textAndGraphicManager.getMediaTrackTextField();
- }
-
- /**
- * Set the primaryGraphic on the head unit screen
- * @param primaryGraphic an SdlArtwork object represents the primaryGraphic
- */
- public void setPrimaryGraphic(SdlArtwork primaryGraphic) {
- if (primaryGraphic == null){
- primaryGraphic = textAndGraphicManager.getBlankArtwork();
- }
- this.textAndGraphicManager.setPrimaryGraphic(primaryGraphic);
- }
-
- /**
- * Get the current primaryGraphic value
- * @return an SdlArtwork object represents the current primaryGraphic
- */
- public SdlArtwork getPrimaryGraphic() {
- return this.textAndGraphicManager.getPrimaryGraphic();
- }
-
- /**
- * Set the secondaryGraphic on the head unit screen
- * @param secondaryGraphic an SdlArtwork object represents the secondaryGraphic
- */
- public void setSecondaryGraphic(SdlArtwork secondaryGraphic) {
- if (secondaryGraphic == null){
- secondaryGraphic = textAndGraphicManager.getBlankArtwork();
- }
- this.textAndGraphicManager.setSecondaryGraphic(secondaryGraphic);
- }
-
- /**
- * Get the current secondaryGraphic value
- * @return an SdlArtwork object represents the current secondaryGraphic
- */
- public SdlArtwork getSecondaryGraphic() {
- return this.textAndGraphicManager.getSecondaryGraphic();
- }
-
- /**
- * Set the alignment for the text fields
- * @param textAlignment TextAlignment value represents the alignment for the text fields
- */
- public void setTextAlignment(TextAlignment textAlignment) {
- this.textAndGraphicManager.setTextAlignment(textAlignment);
- }
-
- /**
- * Get the alignment for the text fields
- * @return a TextAlignment value represents the alignment for the text fields
- */
- public TextAlignment getTextAlignment() {
- return this.textAndGraphicManager.getTextAlignment();
- }
-
- /**
- * Set the metadata type for the textField1
- * @param textField1Type a MetadataType value represents the metadata for textField1
- */
- public void setTextField1Type(MetadataType textField1Type) {
- this.textAndGraphicManager.setTextField1Type(textField1Type);
- }
-
- /**
- * Get the metadata type for textField1
- * @return a MetadataType value represents the metadata for textField1
- */
- public MetadataType getTextField1Type() {
- return this.textAndGraphicManager.getTextField1Type();
- }
-
- /**
- * Set the metadata type for the textField2
- * @param textField2Type a MetadataType value represents the metadata for textField2
- */
- public void setTextField2Type(MetadataType textField2Type) {
- this.textAndGraphicManager.setTextField2Type(textField2Type);
- }
-
- /**
- * Get the metadata type for textField2
- * @return a MetadataType value represents the metadata for textField2
- */
- public MetadataType getTextField2Type() {
- return this.textAndGraphicManager.getTextField2Type();
- }
-
- /**
- * Set the metadata type for the textField3
- * @param textField3Type a MetadataType value represents the metadata for textField3
- */
- public void setTextField3Type(MetadataType textField3Type) {
- this.textAndGraphicManager.setTextField3Type(textField3Type);
- }
-
- /**
- * Get the metadata type for textField3
- * @return a MetadataType value represents the metadata for textField3
- */
- public MetadataType getTextField3Type() {
- return this.textAndGraphicManager.getTextField3Type();
- }
-
- /**
- * Set the metadata type for the textField4
- * @param textField4Type a MetadataType value represents the metadata for textField4
- */
- public void setTextField4Type(MetadataType textField4Type) {
- this.textAndGraphicManager.setTextField4Type(textField4Type);
- }
-
- /**
- * Get the metadata type for textField4
- * @return a MetadataType value represents the metadata for textField4
- */
- public MetadataType getTextField4Type() {
- return this.textAndGraphicManager.getTextField4Type();
- }
-
- /**
- * Set softButtonObjects list and upload the images to the head unit
- * @param softButtonObjects the list of the SoftButtonObject values that should be displayed on the head unit
- */
- public void setSoftButtonObjects(@NonNull List<SoftButtonObject> softButtonObjects) {
- softButtonManager.setSoftButtonObjects(softButtonObjects);
- }
-
- /**
- * Get the soft button objects list
- * @return a List<SoftButtonObject>
- */
- public List<SoftButtonObject> getSoftButtonObjects() {
- return softButtonManager.getSoftButtonObjects();
- }
-
- /**
- * Get the SoftButtonObject that has the provided name
- * @param name a String value that represents the name
- * @return a SoftButtonObject
- */
- public SoftButtonObject getSoftButtonObjectByName(@NonNull String name){
- return softButtonManager.getSoftButtonObjectByName(name);
- }
-
- /**
- * Get the SoftButtonObject that has the provided buttonId
- * @param buttonId a int value that represents the id of the button
- * @return a SoftButtonObject
- */
- public SoftButtonObject getSoftButtonObjectById(int buttonId){
- return softButtonManager.getSoftButtonObjectById(buttonId);
- }
-
- /**
- * Begin a multiple updates transaction. The updates will be applied when commit() is called<br>
- * Note: if we don't use beginTransaction & commit, every update will be sent individually.
- */
- public void beginTransaction(){
- softButtonManager.setBatchUpdates(true);
- textAndGraphicManager.setBatchUpdates(true);
- }
-
- /**
- * Send the updates that were started after beginning the transaction
- * @param listener a CompletionListener that has a callback that will be called when the updates are finished
- */
- public void commit(final CompletionListener listener){
- softButtonManager.setBatchUpdates(false);
- softButtonManager.update(new CompletionListener() {
- boolean updateSuccessful = true;
- @Override
- public void onComplete(boolean success) {
- if (!success){
- updateSuccessful = false;
- }
- textAndGraphicManager.setBatchUpdates(false);
- textAndGraphicManager.update(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- if (!success){
- updateSuccessful = false;
- }
- listener.onComplete(updateSuccessful);
- }
- });
- }
- });
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
deleted file mode 100644
index f995231eb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
+++ /dev/null
@@ -1,568 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.OnButtonEvent;
-import com.smartdevicelink.proxy.rpc.OnButtonPress;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
-import com.smartdevicelink.util.DebugTool;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * <strong>SoftButtonManager</strong> <br>
- * SoftButtonManager gives the developer the ability to control how soft buttons are displayed on the head unit.<br>
- * Note: This class must be accessed through the SdlManager->ScreenManager. Do not instantiate it by itself.<br>
- */
-class SoftButtonManager extends BaseSubManager {
-
- private static final String TAG = "SoftButtonManager";
- private WeakReference<FileManager> fileManager;
- private DisplayCapabilities displayCapabilities;
- private SoftButtonCapabilities softButtonCapabilities;
- private CopyOnWriteArrayList<SoftButtonObject> softButtonObjects;
- private HMILevel currentHMILevel;
- private Show inProgressShowRPC;
- private CompletionListener inProgressListener, queuedUpdateListener, cachedListener;
- private boolean hasQueuedUpdate, batchUpdates, waitingOnHMILevelUpdateToSetButtons;
- private final OnSystemCapabilityListener onSoftButtonCapabilitiesListener, onDisplayCapabilitiesListener;
- private final OnRPCNotificationListener onHMIStatusListener, onButtonPressListener, onButtonEventListener;
- private final SoftButtonObject.UpdateListener updateListener;
-
- /**
- * HAX: This is necessary due to a Ford Sync 3 bug that doesn't like Show requests without a main field being set (it will accept them, but with a GENERIC_ERROR, and 10-15 seconds late...)
- */
- private String currentMainField1;
-
-
- /**
- * Creates a new instance of the SoftButtonManager
- * @param internalInterface
- * @param fileManager
- */
- SoftButtonManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) {
- super(internalInterface);
- this.fileManager = new WeakReference<>(fileManager);
- this.softButtonObjects = new CopyOnWriteArrayList<>();
- this.currentHMILevel = HMILevel.HMI_NONE; // Assume NONE until we get something else
- this.waitingOnHMILevelUpdateToSetButtons = false;
- this.updateListener = new SoftButtonObject.UpdateListener() {
- @Override
- public void onUpdate() {
- update(null);
- }
- };
-
-
- // Add OnSoftButtonCapabilitiesListener to keep softButtonCapabilities updated
- onSoftButtonCapabilitiesListener = new OnSystemCapabilityListener() {
- @Override
- public void onCapabilityRetrieved(Object capability) {
- List<SoftButtonCapabilities> softButtonCapabilitiesList = (List<SoftButtonCapabilities>) capability;
- if (softButtonCapabilitiesList != null && !softButtonCapabilitiesList.isEmpty()) {
- softButtonCapabilities = softButtonCapabilitiesList.get(0);
- } else {
- softButtonCapabilities = null;
- }
- }
-
- @Override
- public void onError(String info) {
- Log.w(TAG, "SoftButton Capability cannot be retrieved:");
- softButtonCapabilities = null;
- }
- };
- this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.SOFTBUTTON, onSoftButtonCapabilitiesListener);
-
-
- // Add OnDisplayCapabilitiesListener to keep displayCapabilities updated
- onDisplayCapabilitiesListener = new OnSystemCapabilityListener() {
- @Override
- public void onCapabilityRetrieved(Object capability) {
- displayCapabilities = (DisplayCapabilities) capability;
- }
-
- @Override
- public void onError(String info) {
- Log.w(TAG, "Display Capability cannot be retrieved:");
- displayCapabilities = null;
- }
- };
- this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAY, onDisplayCapabilitiesListener);
-
-
- // Add OnHMIStatusListener to keep currentHMILevel updated
- this.onHMIStatusListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
-
- OnHMIStatus onHMIStatus = (OnHMIStatus) notification;
- HMILevel oldHmiLevel = currentHMILevel;
- currentHMILevel = onHMIStatus.getHmiLevel();
-
-
- // Auto-send an updated show if we were in NONE and now we are not
- if (oldHmiLevel == HMILevel.HMI_NONE && currentHMILevel != HMILevel.HMI_NONE) {
- if (waitingOnHMILevelUpdateToSetButtons) {
- setSoftButtonObjects(softButtonObjects);
- } else {
- update(cachedListener);
- }
- }
- }
- };
- this.internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
-
-
- // Add OnButtonPressListener to notify SoftButtonObjects when there is a button press
- this.onButtonPressListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- OnButtonPress onButtonPress = (OnButtonPress) notification;
- if (onButtonPress!= null && onButtonPress.getButtonName() == ButtonName.CUSTOM_BUTTON) {
- Integer buttonId = onButtonPress.getCustomButtonName();
- if (getSoftButtonObjects() != null) {
- for (SoftButtonObject softButtonObject : getSoftButtonObjects()) {
- if (softButtonObject.getButtonId() == buttonId && softButtonObject.getOnEventListener() != null) {
- softButtonObject.getOnEventListener().onPress(getSoftButtonObjectById(buttonId), onButtonPress);
- break;
- }
- }
- }
- }
- }
- };
- this.internalInterface.addOnRPCNotificationListener(FunctionID.ON_BUTTON_PRESS, onButtonPressListener);
-
-
- // Add OnButtonEventListener to notify SoftButtonObjects when there is a button event
- this.onButtonEventListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- OnButtonEvent onButtonEvent = (OnButtonEvent) notification;
- if (onButtonEvent!= null && onButtonEvent.getButtonName() == ButtonName.CUSTOM_BUTTON) {
- Integer buttonId = onButtonEvent.getCustomButtonID();
- if (getSoftButtonObjects() != null) {
- for (SoftButtonObject softButtonObject : getSoftButtonObjects()) {
- if (softButtonObject.getButtonId() == buttonId && softButtonObject.getOnEventListener() != null) {
- softButtonObject.getOnEventListener().onEvent(getSoftButtonObjectById(buttonId), onButtonEvent);
- break;
- }
- }
- }
- }
- }
- };
- this.internalInterface.addOnRPCNotificationListener(FunctionID.ON_BUTTON_EVENT, onButtonEventListener);
- }
-
- @Override
- public void start(CompletionListener listener) {
- transitionToState(READY);
- super.start(listener);
- }
-
- /**
- * Get the SoftButtonObject that has the provided name
- * @param name a String value that represents the name
- * @return a SoftButtonObject
- */
- protected SoftButtonObject getSoftButtonObjectByName(String name) {
- for (SoftButtonObject softButtonObject : softButtonObjects) {
- if (softButtonObject.getName().equals(name)) {
- return softButtonObject;
- }
- }
- return null;
- }
-
- /**
- * Get the SoftButtonObject that has the provided buttonId
- * @param buttonId a int value that represents the id of the button
- * @return a SoftButtonObject
- */
- protected SoftButtonObject getSoftButtonObjectById(int buttonId) {
- for (SoftButtonObject softButtonObject : softButtonObjects) {
- if (softButtonObject.getButtonId() == buttonId) {
- return softButtonObject;
- }
- }
- return null;
- }
-
- /**
- * Get the soft button objects list
- * @return a List<SoftButtonObject>
- */
- protected List<SoftButtonObject> getSoftButtonObjects() {
- return softButtonObjects;
- }
-
- /**
- * Set softButtonObjects list and upload the images to the head unit
- * @param list the list of the SoftButtonObject values that should be displayed on the head unit
- */
- protected void setSoftButtonObjects(@NonNull List<SoftButtonObject> list) {
- // Convert the List to CopyOnWriteArrayList
- CopyOnWriteArrayList<SoftButtonObject> softButtonObjects;
- if(list instanceof CopyOnWriteArrayList){
- softButtonObjects = (CopyOnWriteArrayList<SoftButtonObject>) list;
- }else{
- softButtonObjects = new CopyOnWriteArrayList<>(list);
- }
-
-
- if (hasTwoSoftButtonObjectsOfSameName(softButtonObjects)) {
- this.softButtonObjects = new CopyOnWriteArrayList<>();
- Log.e(TAG, "Attempted to set soft button objects, but two buttons had the same name");
- return;
- }
-
- // Set ids and updateListeners for soft button objects
- for (int i = 0; i < softButtonObjects.size(); i++) {
- softButtonObjects.get(i).setButtonId(i * 100);
- softButtonObjects.get(i).setUpdateListener(updateListener);
- }
- this.softButtonObjects = softButtonObjects;
-
-
- if (currentHMILevel == null || currentHMILevel == HMILevel.HMI_NONE) {
- waitingOnHMILevelUpdateToSetButtons = true;
- return;
- }
-
-
- // End any in-progress update
- inProgressShowRPC = null;
- if (inProgressListener != null) {
- inProgressListener.onComplete(false);
- inProgressListener = null;
- }
-
-
- // End any queued update
- hasQueuedUpdate = false;
- if (queuedUpdateListener != null) {
- queuedUpdateListener.onComplete(false);
- queuedUpdateListener = null;
- }
-
-
- // Prepare soft button images to be uploaded to the head unit.
- // we will prepare a list for initial state images and another list for other state images
- // so we can upload the initial state images first, then the other states images.
- List<SdlArtwork> initialStatesToBeUploaded = new ArrayList<>();
- List<SdlArtwork> otherStatesToBeUploaded = new ArrayList<>();
- if (softButtonImagesSupported() && fileManager.get() != null) {
- for (SoftButtonObject softButtonObject : softButtonObjects) {
- SoftButtonState initialState = null;
- if (softButtonObject != null) {
- initialState = softButtonObject.getCurrentState();
- }
- if (initialState != null && softButtonObject.getStates() != null) {
- for (SoftButtonState softButtonState : softButtonObject.getStates()) {
- if (softButtonState != null && softButtonState.getName() != null && softButtonState.getArtwork() != null && !fileManager.get().hasUploadedFile(softButtonState.getArtwork())) {
- if (softButtonState.getName().equals(initialState.getName())) {
- initialStatesToBeUploaded.add(softButtonObject.getCurrentState().getArtwork());
- } else{
- otherStatesToBeUploaded.add(softButtonState.getArtwork());
- }
- }
- }
- }
- }
- }
-
-
- // Upload initial state images
- if (initialStatesToBeUploaded.size() > 0 && fileManager.get() != null) {
- DebugTool.logInfo( "Uploading soft button initial state artworks");
- fileManager.get().uploadArtworks(initialStatesToBeUploaded, new MultipleFileCompletionListener() {
- @Override
- public void onComplete(Map<String, String> errors) {
- if (errors != null && errors.size() > 0) {
- Log.e(TAG, "Error uploading soft button artworks");
- }
- DebugTool.logInfo( "Soft button initial artworks uploaded");
- update(cachedListener);
- }
- });
- }
-
-
- // Upload other state images
- if (otherStatesToBeUploaded.size() > 0 && fileManager.get() != null) {
- DebugTool.logInfo("Uploading soft button other state artworks");
- fileManager.get().uploadArtworks(otherStatesToBeUploaded, new MultipleFileCompletionListener() {
- @Override
- public void onComplete(Map<String, String> errors) {
- if (errors != null && errors.size() > 0) {
- Log.e(TAG, "Error uploading soft button artworks");
- }
- DebugTool.logInfo("Soft button other state artworks uploaded");
- // In case our soft button states have changed in the meantime
- update(cachedListener);
- }
- });
- }
-
- // This is necessary because there may be no images needed to be uploaded
- update(cachedListener);
- }
-
- /**
- * Update the SoftButtonManger by sending a new Show RPC to reflect the changes
- * @param listener a CompletionListener
- */
- protected void update(CompletionListener listener) {
- cachedListener = listener;
-
- if (batchUpdates) {
- return;
- }
-
- // Don't send if we're in HMI NONE
- if (currentHMILevel == null || currentHMILevel == HMILevel.HMI_NONE) {
- return;
- }
-
- DebugTool.logInfo("Updating soft buttons");
-
- cachedListener = null;
-
-
- // Check if we have update already in progress
- if (inProgressShowRPC != null) {
- DebugTool.logInfo("In progress update exists, queueing update");
- // If we already have a pending update, we're going to tell the old listener that it was superseded by a new update and then return
- if (queuedUpdateListener != null) {
- DebugTool.logInfo("Queued update already exists, superseding previous queued update");
- queuedUpdateListener.onComplete(false);
- queuedUpdateListener = null;
- }
-
- // Note: the queued update will be started after the in-progress one finishes
- if (listener != null) {
- queuedUpdateListener = listener;
- }
- hasQueuedUpdate = true;
- return;
- }
-
-
- // Send Show RPC with soft buttons representing the current state for the soft button objects
- inProgressListener = listener;
- inProgressShowRPC = new Show();
- inProgressShowRPC.setMainField1(getCurrentMainField1());
- if (softButtonObjects == null) {
- DebugTool.logInfo("Soft button objects are null, sending an empty array");
- inProgressShowRPC.setSoftButtons(new ArrayList<SoftButton>());
- } else if ((currentStateHasImages() && !allCurrentStateImagesAreUploaded()) || !softButtonImagesSupported()) {
- // The images don't yet exist on the head unit, or we cannot use images, send a text update if possible, otherwise, don't send anything yet
- List<SoftButton> textOnlySoftButtons = createTextSoftButtonsForCurrentState();
- if (textOnlySoftButtons != null) {
- DebugTool.logInfo( "Soft button images unavailable, sending text buttons");
- inProgressShowRPC.setSoftButtons(textOnlySoftButtons);
-
- } else {
- DebugTool.logInfo( "Soft button images unavailable, text buttons unavailable");
- inProgressShowRPC = null;
- return;
- }
-
- } else {
- DebugTool.logInfo( "Sending soft buttons with images");
- inProgressShowRPC.setSoftButtons(createSoftButtonsForCurrentState());
- }
-
-
- inProgressShowRPC.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- DebugTool.logInfo("Soft button update completed");
- handleResponse(true);
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- super.onError(correlationId, resultCode, info);
-
- Log.e(TAG, "Soft button update error");
- handleResponse(false);
-
- }
-
- private void handleResponse(boolean success){
-
- inProgressShowRPC = null;
- CompletionListener currentListener;
- if (inProgressListener != null) {
- currentListener = inProgressListener;
- inProgressListener = null;
- currentListener.onComplete(success);
- }
-
-
- if (hasQueuedUpdate) {
- DebugTool.logInfo("Queued update exists, sending another update");
- currentListener = queuedUpdateListener;
- queuedUpdateListener = null;
- hasQueuedUpdate = false;
- update(currentListener);
- }
- }
- });
-
-
- internalInterface.sendRPCRequest(inProgressShowRPC);
- }
-
- private boolean softButtonImagesSupported(){
- return (displayCapabilities == null || displayCapabilities.getGraphicSupported()) && (softButtonCapabilities == null || softButtonCapabilities.getImageSupported());
- }
-
- /**
- * Check if two SoftButtonObject have the same name
- * @param softButtonObjects
- * @return a boolean value
- */
- private boolean hasTwoSoftButtonObjectsOfSameName(List<SoftButtonObject> softButtonObjects) {
- for (int i = 0; i < softButtonObjects.size(); i++) {
- String buttonName = softButtonObjects.get(i).getName();
- for (int j = (i + 1); j < softButtonObjects.size(); j++) {
- if (softButtonObjects.get(j).getName().equals(buttonName)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Get the TextField1
- * @return currentMainField1
- */
- protected String getCurrentMainField1() {
- if (currentMainField1 == null){
- return "";
- }
- return currentMainField1;
- }
-
- /**
- * Set the TextField1
- * @param currentMainField1
- */
- protected void setCurrentMainField1(String currentMainField1) {
- this.currentMainField1 = currentMainField1;
- }
-
- /**
- * Set the batchUpdates flag that represents whether the manager should wait until commit() is called to send the updated show RPC
- * @param batchUpdates
- */
- protected void setBatchUpdates(boolean batchUpdates) {
- this.batchUpdates = batchUpdates;
- }
-
- /**
- * Clean up everything after the manager is no longer needed
- */
- @Override
- public void dispose() {
- super.dispose();
-
- // Remove listeners
- internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
- internalInterface.removeOnRPCNotificationListener(FunctionID.ON_BUTTON_PRESS, onButtonPressListener);
- internalInterface.removeOnRPCNotificationListener(FunctionID.ON_BUTTON_EVENT, onButtonEventListener);
- internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.SOFTBUTTON, onSoftButtonCapabilitiesListener);
- internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAY, onDisplayCapabilitiesListener);
- }
-
- /**
- * Check if the current state for any SoftButtonObject has images
- * @return a boolean value
- */
- private boolean currentStateHasImages() {
- for (SoftButtonObject softButtonObject : this.softButtonObjects) {
- if (softButtonObject.getCurrentState() != null && softButtonObject.getCurrentState().getArtwork() != null) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Check if the current state for any SoftButtonObject has images that are not uploaded yet
- * @return a boolean value
- */
- private boolean allCurrentStateImagesAreUploaded() {
- if (fileManager.get() != null) {
- for (SoftButtonObject softButtonObject : softButtonObjects) {
- SoftButtonState currentState = softButtonObject.getCurrentState();
- if (currentState != null && currentState.getArtwork() != null && !fileManager.get().hasUploadedFile(currentState.getArtwork())) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * Returns text soft buttons representing the initial states of the button objects, or null if _any_ of the buttons' current states are image only buttons.
- * @return The text soft buttons
- */
- private List<SoftButton> createTextSoftButtonsForCurrentState() {
- List<SoftButton> textButtons = new ArrayList<>();
- for (SoftButtonObject softButtonObject : softButtonObjects) {
- SoftButton softButton = softButtonObject.getCurrentStateSoftButton();
- if (softButton.getText() == null) {
- return null;
- }
- // We should create a new softButtonObject rather than modifying the original one
- SoftButton textOnlySoftButton = new SoftButton(SoftButtonType.SBT_TEXT, softButton.getSoftButtonID());
- textOnlySoftButton.setText(softButton.getText());
- textButtons.add(textOnlySoftButton);
- }
- return textButtons;
- }
-
- /**
- * Returns a list of the SoftButton for the SoftButtonObjects' current state
- * @return a List<SoftButton>
- */
- protected List<SoftButton> createSoftButtonsForCurrentState() {
- List<SoftButton> softButtons = new ArrayList<>();
- for (SoftButtonObject softButtonObject : softButtonObjects) {
- softButtons.add(softButtonObject.getCurrentStateSoftButton());
- }
- return softButtons;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java
deleted file mode 100644
index 01c760d09..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java
+++ /dev/null
@@ -1,272 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.smartdevicelink.proxy.rpc.OnButtonEvent;
-import com.smartdevicelink.proxy.rpc.OnButtonPress;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.util.DebugTool;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * <strong>SoftButtonObject</strong> <br>
- * SoftButtonObject define a button that can have multiple SoftButtonState values.<br>
- * The states of SoftButtonObject allow the developer to not have to manage multiple SoftButtons that have very similar functionality.<br>
- * For example, a repeat button in a music app can be thought of as one SoftButtonObject with three typical states: repeat off, repeat 1, and repeat on.<br>
- * @see SoftButtonState
- */
-public class SoftButtonObject {
-
- private static final String TAG = "SoftButtonObject";
- private String name;
- private List<SoftButtonState> states;
- private String currentStateName;
- private int buttonId;
- private OnEventListener onEventListener;
- private UpdateListener updateListener;
-
- /**
- * Create a new instance of the SoftButtonObject with multiple states
- * @param name a String value represents name of the object
- * @param states a list of SoftButtonState represents the SoftButtonState values for the object
- * @param initialStateName a String value represents the name for the initial state
- * @param onEventListener a listener that has a callback that will be triggered when a button event happens
- * Note: the initialStateName should match exactly the name of one of the states for the object. Otherwise an exception will be thrown.
- */
- public SoftButtonObject(@NonNull String name, @NonNull List<SoftButtonState> states, @NonNull String initialStateName, OnEventListener onEventListener) {
-
- // Make sure there aren't two states with the same name
- if (hasTwoStatesOfSameName(states)) {
- Log.e(TAG, "Two states have the same name in states list for soft button object");
- return;
- }
-
- this.name = name;
- this.states = states;
- currentStateName = initialStateName;
- this.buttonId = 0;
- this.onEventListener = onEventListener;
- }
-
- /**
- * Create a new instance of the SoftButtonObject with one state
- * @param name a String value represents name of the object
- * @param state a SoftButtonState represents state for the object
- * @param onEventListener a listener that has a callback that will be triggered when a button event happens
- */
- public SoftButtonObject(@NonNull String name, @NonNull SoftButtonState state, OnEventListener onEventListener) {
- this(name, Collections.singletonList(state), state.getName(), onEventListener);
- }
-
- /**
- * Transition the SoftButtonObject to a specific state
- * @param newStateName a String value represents the name fo the state that we want to transition the SoftButtonObject to
- * @return a boolean value that represents whether the transition succeeded or failed
- */
- public boolean transitionToStateByName(@NonNull String newStateName) {
- SoftButtonState newState = getStateByName(newStateName);
- if (newState == null) {
- Log.e(TAG, String.format("Attempted to transition to state: %s on soft button object: %s but no state with that name was found", newStateName, this.name));
- return false;
- }
- DebugTool.logInfo(String.format("Transitioning soft button object %s to state %s", this.name, newStateName));
- currentStateName = newStateName;
-
- // Send a new Show RPC because the state has changed which means the actual SoftButton has changed
- if (updateListener != null) {
- updateListener.onUpdate();
- } else {
- Log.e(TAG, String.format("SoftButtonManager is not set for soft button object: %s. Update cannot be triggered", this.name));
- }
-
- return true;
- }
-
- /**
- * Transition the SoftButtonObject to the next state
- */
- public void transitionToNextState() {
- String nextStateName = null;
- for (int i = 0; i < states.size(); i++) {
- if (states.get(i).getName().equals(currentStateName)) {
- if (i == (states.size() - 1)) {
- nextStateName = states.get(0).getName();
- } else {
- nextStateName = states.get(i + 1).getName();
- }
- break;
- }
- }
- if (nextStateName == null) {
- Log.e(TAG, String.format("Current state name : %s cannot be found for soft button object %s", currentStateName, this.name));
- return;
- }
- transitionToStateByName(nextStateName);
- }
-
- /**
- * Get the current state for the SoftButtonObject
- * @return a SoftButtonState represents the current state
- */
- public SoftButtonState getCurrentState() {
- SoftButtonState state = getStateByName(currentStateName);
- if (state == null) {
- Log.e(TAG, String.format("Current state name : %s cannot be found for soft button object %s", currentStateName, this.name));
- }
- return state;
- }
-
- /**
- * Get the SoftButton object for the current state
- * @return a SoftButton object that is associated with the current state
- */
- public SoftButton getCurrentStateSoftButton() {
- SoftButtonState currentState = getCurrentState();
- if (currentState == null || currentState.getSoftButton() == null) {
- return null;
- }
-
- SoftButton softButton = currentState.getSoftButton();
- softButton.setSoftButtonID(this.buttonId);
- return softButton;
- }
-
- /**
- * Find and get the SoftButtonState that has the provided name
- * @param stateName a String value that represents the name of the state
- * @return a SoftButtonState object that represents the state that has the provided name
- */
- private SoftButtonState getStateByName(String stateName) {
- if (stateName != null && states != null) {
- for (SoftButtonState state : states) {
- if (state.getName().equals(stateName)) {
- return state;
- }
- }
- }
- return null;
- }
-
- /**
- * Check if two SoftButtonState have the same name
- * @param states a list of SoftButtonState
- * @return a boolean value that represents whether we have two states with the same name
- */
- private boolean hasTwoStatesOfSameName(List<SoftButtonState> states) {
- for (int i = 0; i < states.size(); i++) {
- String stateName = states.get(i).getName();
- for (int j = (i + 1); j < states.size(); j++) {
- if (states.get(j).getName().equals(stateName)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Set the SoftButtonManager's update listener
- * @param updateListener the SoftButtonManager.UpdateListener object
- */
- protected void setUpdateListener(UpdateListener updateListener) {
- this.updateListener = updateListener;
- }
-
- /**
- * Get the name of the SoftButtonObject
- * @return a String that represents the name of the SoftButtonObject
- */
- public String getName() {
- return name;
- }
-
- /**
- * Set the name of the SoftButtonObject
- * @param name a String that represents the name of the SoftButtonObject
- */
- public void setName(@NonNull String name) {
- this.name = name;
- }
-
- /**
- * Get the SoftButtonState list
- * @return a list of the object's soft button states
- */
- public List<SoftButtonState> getStates() {
- return states;
- }
-
- /**
- * Set the the SoftButtonState list
- * @param states a list of the object's soft button states
- */
- public void setStates(@NonNull List<SoftButtonState> states) {
- this.states = states;
- }
-
- /**
- * Get the name of the current state
- * @return a String that represents the name of the current state
- */
- public String getCurrentStateName() {
- return currentStateName;
- }
-
- /**
- * Set the name of the current state
- * @param currentStateName a String that represents the name of the current state
- */
- public void setCurrentStateName(@NonNull String currentStateName) {
- this.currentStateName = currentStateName;
- }
-
- /**
- * Get the dd of the SoftButtonObject
- * @return an int value that represents the id of the SoftButtonObject
- */
- public int getButtonId() {
- return buttonId;
- }
-
- /**
- * Set the id of the SoftButtonObject
- * @param buttonId an int value that represents the id of the SoftButtonObject
- */
- public void setButtonId(int buttonId) {
- this.buttonId = buttonId;
- }
-
- /**
- * Get the event listener for the SoftButtonObject
- * @return OnEventListener
- */
- public OnEventListener getOnEventListener() {
- return onEventListener;
- }
-
- /**
- * Set the event listener for the SoftButtonObject
- * @param onEventListener a listener that has a callback that will be triggered when a button event happens
- */
- public void setOnEventListener(OnEventListener onEventListener) {
- this.onEventListener = onEventListener;
- }
-
- public interface OnEventListener{
- void onPress(SoftButtonObject softButtonObject, OnButtonPress onButtonPress);
- void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEvent);
- }
-
- /**
- * A listener interface that is used by SoftButtonObject to request an update from SoftButtonManager
- */
- interface UpdateListener{
- /**
- * Requests an update from SoftButtonManager
- */
- void onUpdate();
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java
deleted file mode 100644
index 67458ce2c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonState.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
-
-/**
- * <strong>SoftButtonState</strong> <br>
- * Defines an individual state for SoftButtonObject.<br>
- * The states of SoftButtonObject allow the developer to not have to manage multiple SoftButtons that have very similar functionality.<br>
- * For example, a repeat button in a music app can be thought of as one SoftButtonObject with three typical states: repeat off, repeat 1, and repeat on.<br>
- * @see SoftButtonObject
- */
-public class SoftButtonState {
-
- private static final String TAG = "SoftButtonState";
- private String name;
- private SdlArtwork artwork;
- private final SoftButton softButton;
-
- /**
- * Creates a new instance of SoftButtonState
- * Note: state names should be different for each SoftButtonObject
- * @param name a String value represents name of the state
- * @param text a String represents the text for the state
- * @param artwork an SdlArtwork represents the artwork for the state
- */
- public SoftButtonState(@NonNull String name, String text, SdlArtwork artwork) {
- if (text == null && artwork == null) {
- Log.e(TAG, "Attempted to create an invalid soft button state: text and artwork are both null");
- softButton = null;
- return;
- }
- this.name = name;
- this.artwork = artwork;
-
-
- // Create a SoftButton and set its Type
- SoftButtonType type;
- if (artwork != null && text != null) {
- type = SoftButtonType.SBT_BOTH;
- } else if (artwork != null) {
- type = SoftButtonType.SBT_IMAGE;
- } else {
- type = SoftButtonType.SBT_TEXT;
- }
- this.softButton = new SoftButton(type, 0);
-
-
- // Set the SoftButton's image
- if (artwork != null) {
- softButton.setImage(new Image(artwork.getName(), ImageType.DYNAMIC));
- }
-
- // Set the SoftButton's text
- if (text != null) {
- softButton.setText(text);
- }
- }
-
- /**
- * Get the state name
- * @return a String value represents the name of the state
- */
- public String getName() {
- return name;
- }
-
- /**
- * Set the state name
- * @param name a String value represents the name of the state
- */
- public void setName(@NonNull String name) {
- this.name = name;
- }
-
- /**
- * Get the SoftButton for the state
- * @return a SoftButton object represents the SoftButton for the state
- */
- public SoftButton getSoftButton() {
- return softButton;
- }
-
- /**
- * Get the Artwork for the state
- * @return an SdlArtwork object represents the artwork for the state
- */
- public SdlArtwork getArtwork() {
- return artwork;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
deleted file mode 100644
index 4497062ef..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
+++ /dev/null
@@ -1,895 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.smartdevicelink.R;
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.MetadataTags;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.TextField;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-import com.smartdevicelink.proxy.rpc.enums.MetadataType;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
-import com.smartdevicelink.util.DebugTool;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static com.smartdevicelink.proxy.rpc.enums.TextAlignment.CENTERED;
-
-/**
- * <strong>TextAndGraphicManager</strong> <br>
- *
- * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
- *
- */
-class TextAndGraphicManager extends BaseSubManager {
-
- private static final String TAG = "TextAndGraphicManager";
-
- boolean isDirty, hasQueuedUpdate;
- volatile Show inProgressUpdate;
- Show currentScreenData, queuedImageUpdate;
- HMILevel currentHMILevel;
- protected DisplayCapabilities displayCapabilities;
- private boolean pendingHMIFull, batchingUpdates;
- private final WeakReference<FileManager> fileManager;
- private final WeakReference<SoftButtonManager> softButtonManager;
- private CompletionListener queuedUpdateListener, inProgressListener, pendingHMIListener;
- private SdlArtwork blankArtwork;
- private OnRPCNotificationListener hmiListener;
- private OnSystemCapabilityListener onDisplayCapabilitiesListener;
- private SdlArtwork primaryGraphic, secondaryGraphic;
- private TextAlignment textAlignment;
- private String textField1, textField2, textField3, textField4, mediaTrackTextField;
- private MetadataType textField1Type, textField2Type, textField3Type, textField4Type;
-
- //Constructors
-
- TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
- // set class vars
- super(internalInterface);
- this.fileManager = new WeakReference<>(fileManager);
- this.softButtonManager = new WeakReference<>(softButtonManager);
- batchingUpdates = false;
- isDirty = false;
- pendingHMIFull = false;
- textAlignment = CENTERED;
- currentHMILevel = HMILevel.HMI_NONE;
- currentScreenData = new Show();
- addListeners();
- getBlankArtwork();
- }
-
- @Override
- public void start(CompletionListener listener) {
- transitionToState(READY);
- super.start(listener);
- }
-
- @Override
- public void dispose(){
-
- textField1 = null;
- textField1Type = null;
- textField2 = null;
- textField2Type = null;
- textField3 = null;
- textField3Type = null;
- textField4 = null;
- textField4Type = null;
- mediaTrackTextField = null;
- textAlignment = null;
- primaryGraphic = null;
- secondaryGraphic = null;
- blankArtwork = null;
- displayCapabilities = null;
- inProgressUpdate = null;
- queuedImageUpdate = null;
- currentScreenData = null;
- queuedUpdateListener = null;
- pendingHMIListener = null;
- inProgressListener = null;
- hasQueuedUpdate = false;
- isDirty = false;
- pendingHMIFull = false;
-
- // remove listeners
- internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
- internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAY, onDisplayCapabilitiesListener);
-
- super.dispose();
- }
-
- private void addListeners() {
- // add listener
- hmiListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- currentHMILevel = ((OnHMIStatus)notification).getHmiLevel();
- if (currentHMILevel == HMILevel.HMI_FULL){
- if (pendingHMIFull){
- DebugTool.logInfo( "Acquired HMI_FULL with pending update. Sending now");
- pendingHMIFull = false;
- sdlUpdate(pendingHMIListener);
- pendingHMIListener = null;
- }
- }
- }
- };
- internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
-
- // Add OnDisplayCapabilitiesListener to keep displayCapabilities updated
- onDisplayCapabilitiesListener = new OnSystemCapabilityListener() {
- @Override
- public void onCapabilityRetrieved(Object capability) {
- displayCapabilities = (DisplayCapabilities)capability;
- }
-
- @Override
- public void onError(String info) {
- Log.e(TAG, "DISPLAY Capability cannot be retrieved:");
- displayCapabilities = null;
- }
- };
- this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAY, onDisplayCapabilitiesListener);
- }
-
- // Upload / Send
-
- protected void update(CompletionListener listener) {
-
- // check if is batch update
- if (batchingUpdates) {
- return;
- }
-
- if (isDirty){
- isDirty = false;
- sdlUpdate(listener);
- }
- }
-
- private synchronized void sdlUpdate(CompletionListener listener){
-
- // make sure hmi is not none
- if (currentHMILevel == null || currentHMILevel == HMILevel.HMI_NONE){
- //Trying to send show on HMI_NONE, waiting for full
- pendingHMIFull = true;
- if (listener != null){
- pendingHMIListener = listener;
- }
- return;
- }
-
- //Updating Text and Graphics
- if (inProgressUpdate != null){
-
- //In progress update exists, queueing update
- if (queuedUpdateListener != null){
-
- //Queued update already exists, superseding previous queued update
- queuedUpdateListener.onComplete(false);
- queuedUpdateListener = null;
- }
-
- if (listener != null){
- queuedUpdateListener = listener;
- }else{
- hasQueuedUpdate = true;
- }
- return;
- }
-
- Show fullShow = new Show();
- fullShow.setAlignment(textAlignment);
- fullShow = assembleShowText(fullShow);
- fullShow = assembleShowImages(fullShow);
-
- inProgressListener = listener;
-
- if (!shouldUpdatePrimaryImage() && !shouldUpdateSecondaryImage()){
-
- //No Images to send, only sending text
- inProgressUpdate = extractTextFromShow(fullShow);
- sendShow();
-
- }else if (isArtworkUploadedOrDoesntExist(primaryGraphic) && ( secondaryGraphic == blankArtwork || isArtworkUploadedOrDoesntExist(secondaryGraphic))){
-
- //Images already uploaded, sending full update
- // The files to be updated are already uploaded, send the full show immediately
- inProgressUpdate = fullShow;
- sendShow();
- } else{
-
- // Images need to be uploaded, sending text and uploading images
- inProgressUpdate = fullShow;
- final Show thisUpdate = fullShow;
-
- uploadImages(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- if (!success){
- Log.e(TAG, "Error uploading image");
- inProgressUpdate = extractTextFromShow(inProgressUpdate);
- sendShow();
- }
- // Check if queued image update still matches our images (there could have been a new Show in the meantime)
- // and send a new update if it does. Since the images will already be on the head unit, the whole show will be sent
- if (thisUpdate.getGraphic() != null && thisUpdate.getGraphic().equals(queuedImageUpdate.getGraphic()) ||
- (thisUpdate.getSecondaryGraphic() != null && queuedImageUpdate.getSecondaryGraphic() != null) && thisUpdate.getSecondaryGraphic().equals(queuedImageUpdate.getSecondaryGraphic())){
- // Queued image update matches the images we need, sending update
- sendShow();
- }
- // Else, Queued image update does not match the images we need, skipping update
- }
- });
- queuedImageUpdate = fullShow;
- }
- }
-
- private void sendShow(){
- inProgressUpdate.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if (response.getSuccess()){
- updateCurrentScreenDataState(inProgressUpdate);
- }
-
- inProgressUpdate = null;
- if (inProgressListener != null){
- inProgressListener.onComplete(true);
- inProgressListener = null;
- }
-
- if (hasQueuedUpdate){
- //Queued update exists, sending another update
- hasQueuedUpdate = false;
- CompletionListener temp = queuedUpdateListener;
- queuedUpdateListener = null;
- sdlUpdate(temp);
- }
- }
- });
-
- if (this.softButtonManager.get() != null) {
- this.softButtonManager.get().setCurrentMainField1(inProgressUpdate.getMainField1());
- }
- internalInterface.sendRPCRequest(inProgressUpdate);
- }
-
- // Images
-
- private void uploadImages(final CompletionListener listener) {
-
- List<SdlArtwork> artworksToUpload = new ArrayList<>();
-
- // add primary image
- if (shouldUpdatePrimaryImage()){
- artworksToUpload.add(primaryGraphic);
- }
-
- // add secondary image
- if (shouldUpdateSecondaryImage()){
- artworksToUpload.add(secondaryGraphic);
- }
-
- // use file manager to upload art
- if (fileManager.get() != null) {
- fileManager.get().uploadArtworks(artworksToUpload, new MultipleFileCompletionListener() {
- @Override
- public void onComplete(Map<String, String> errors) {
- if (errors != null) {
- Log.e(TAG, "Error Uploading Artworks. Error: " + errors.toString());
- listener.onComplete(false);
- } else {
- listener.onComplete(true);
- }
- }
- });
- }
- }
-
- private Show assembleShowImages(Show show){
-
- if (shouldUpdatePrimaryImage()){
- Image primaryImage = new Image();
- primaryImage.setImageType(ImageType.DYNAMIC);
- primaryImage.setValue(primaryGraphic.getName());
- show.setGraphic(primaryImage);
- }
-
- if (shouldUpdateSecondaryImage()){
- Image secondaryImage = new Image();
- secondaryImage.setImageType(ImageType.DYNAMIC);
- secondaryImage.setValue(secondaryGraphic.getName());
- show.setSecondaryGraphic(secondaryImage);
- }
-
- return show;
- }
-
- // Text
-
- Show assembleShowText(Show show){
-
- show = setBlankTextFields(show);
-
- if (mediaTrackTextField != null){
- show.setMediaTrack(mediaTrackTextField);
- }
-
- List<String> nonNullFields = findValidMainTextFields();
- if (nonNullFields.isEmpty()){
- return show;
- }
-
- int numberOfLines = getNumberOfLines();
-
- switch (numberOfLines) {
- case 1: show = assembleOneLineShowText(show, nonNullFields);
- break;
- case 2: show = assembleTwoLineShowText(show);
- break;
- case 3: show = assembleThreeLineShowText(show);
- break;
- case 4: show = assembleFourLineShowText(show);
- break;
- }
-
- return show;
- }
-
- private Show assembleOneLineShowText(Show show, List<String> showFields){
-
- StringBuilder showString1 = new StringBuilder();
- for (int i = 0; i < showFields.size(); i++) {
- if (i > 0) {
- showString1.append(" - ").append(showFields.get(i));
- }else{
- showString1.append(showFields.get(i));
- }
- }
- show.setMainField1(showString1.toString());
-
- MetadataTags tags = new MetadataTags();
- tags.setMainField1(findNonNullMetadataFields());
-
- show.setMetadataTags(tags);
-
- return show;
- }
-
- private Show assembleTwoLineShowText(Show show){
-
- StringBuilder tempString = new StringBuilder();
- MetadataTags tags = new MetadataTags();
-
- if (textField1 != null && textField1.length() > 0) {
- tempString.append(textField1);
- if (textField1Type != null){
- tags.setMainField1(textField1Type);
- }
- }
-
- if (textField2 != null && textField2.length() > 0) {
- if (( textField3 == null || !(textField3.length() > 0)) && (textField4 == null || !(textField4.length() > 0))){
- // text does not exist in slots 3 or 4, put text2 in slot 2
- show.setMainField2(textField2);
- if (textField2Type != null){
- tags.setMainField2(textField2Type);
- }
- } else if (textField1 != null && textField1.length() > 0) {
- // If text 1 exists, put it in slot 1 formatted
- tempString.append(" - ").append(textField2);
- if (textField2Type != null){
- List<MetadataType> typeList = new ArrayList<>();
- typeList.add(textField2Type);
- if (textField1Type != null){
- typeList.add(textField1Type);
- }
- tags.setMainField1(typeList);
- }
- }else {
- // If text 1 does not exist, put it in slot 1 unformatted
- tempString.append(textField2);
- if (textField2Type != null){
- tags.setMainField1(textField2Type);
- }
- }
- }
-
- // set mainfield 1
- show.setMainField1(tempString.toString());
-
- // new stringbuilder object
- tempString = new StringBuilder();
-
- if (textField3 != null && textField3.length() > 0){
- // If text 3 exists, put it in slot 2
- tempString.append(textField3);
- if (textField3Type != null){
- List<MetadataType> typeList = new ArrayList<>();
- typeList.add(textField3Type);
- tags.setMainField2(typeList);
- }
- }
-
- if (textField4 != null && textField4.length() > 0){
- if (textField3 != null && textField3.length() > 0){
- // If text 3 exists, put it in slot 2 formatted
- tempString.append(" - ").append(textField4);
- if (textField4Type != null){
- List<MetadataType> typeList = new ArrayList<>();
- typeList.add(textField4Type);
- if (textField3Type != null){
- typeList.add(textField3Type);
- }
- tags.setMainField2(typeList);
- }
- } else {
- // If text 3 does not exist, put it in slot 3 unformatted
- tempString.append(textField4);
- if (textField4Type != null){
- tags.setMainField2(textField4Type);
- }
- }
- }
-
- if (tempString.toString().length() > 0){
- show.setMainField2(tempString.toString());
- }
-
- show.setMetadataTags(tags);
- return show;
- }
-
- private Show assembleThreeLineShowText(Show show){
-
- MetadataTags tags = new MetadataTags();
-
- if (textField1 != null && textField1.length() > 0) {
- show.setMainField1(textField1);
- if (textField1Type != null){
- tags.setMainField1(textField1Type);
- }
- }
-
- if (textField2 != null && textField2.length() > 0) {
- show.setMainField2(textField2);
- if (textField2Type != null){
- tags.setMainField2(textField2Type);
- }
- }
-
- StringBuilder tempString = new StringBuilder();
-
- if (textField3 != null && textField3.length() > 0){
- tempString.append(textField3);
- if (textField3Type != null){
- tags.setMainField3(textField3Type);
- }
- }
-
- if (textField4 != null && textField4.length() > 0) {
- if (textField3 != null && textField3.length() > 0) {
- // If text 3 exists, put it in slot 3 formatted
- tempString.append(" - ").append(textField4);
- if (textField4Type != null){
- List<MetadataType> tags4 = new ArrayList<>();
- if (textField3Type != null){
- tags4.add(textField3Type);
- }
- tags4.add(textField4Type);
- tags.setMainField3(tags4);
- }
- } else {
- // If text 3 does not exist, put it in slot 3 formatted
- tempString.append(textField4);
- if (textField4Type != null){
- tags.setMainField3(textField4Type);
- }
- }
- }
-
- show.setMainField3(tempString.toString());
- show.setMetadataTags(tags);
- return show;
- }
-
- private Show assembleFourLineShowText(Show show){
-
- MetadataTags tags = new MetadataTags();
-
- if (textField1 != null && textField1.length() > 0) {
- show.setMainField1(textField1);
- if (textField1Type != null){
- tags.setMainField1(textField1Type);
- }
- }
-
- if (textField2 != null && textField2.length() > 0) {
- show.setMainField2(textField2);
- if (textField2Type != null){
- tags.setMainField2(textField2Type);
- }
- }
-
- if (textField3 != null && textField3.length() > 0) {
- show.setMainField3(textField3);
- if (textField3Type != null){
- tags.setMainField3(textField3Type);
- }
- }
-
- if (textField4 != null && textField4.length() > 0) {
- show.setMainField4(textField4);
- if (textField4Type != null){
- tags.setMainField4(textField4Type);
- }
- }
-
- show.setMetadataTags(tags);
- return show;
- }
-
- // Extraction
-
- Show extractTextFromShow(Show show){
-
- Show newShow = new Show();
- newShow.setMainField1(show.getMainField1());
- newShow.setMainField2(show.getMainField2());
- newShow.setMainField3(show.getMainField3());
- newShow.setMainField4(show.getMainField4());
-
- return newShow;
- }
-
- private Show setBlankTextFields(Show newShow){
-
- newShow.setMainField1("");
- newShow.setMainField2("");
- newShow.setMainField3("");
- newShow.setMainField4("");
- newShow.setMediaTrack("");
-
- return newShow;
- }
-
- private void updateCurrentScreenDataState(Show show){
-
- if (show == null){
- Log.e(TAG, "can not updateCurrentScreenDataFromShow from null show");
- return;
- }
-
- // If the items are null, they were not updated, so we can't just set it directly
- if (show.getMainField1() != null){
- currentScreenData.setMainField1(show.getMainField1());
- }
- if (show.getMainField2() != null){
- currentScreenData.setMainField2(show.getMainField2());
- }
- if (show.getMainField3() != null){
- currentScreenData.setMainField3(show.getMainField3());
- }
- if (show.getMainField4() != null){
- currentScreenData.setMainField4(show.getMainField4());
- }
- if (show.getMediaTrack() != null){
- currentScreenData.setMediaTrack(show.getMediaTrack());
- }
- if (show.getMetadataTags() != null){
- currentScreenData.setMetadataTags(show.getMetadataTags());
- }
- if (show.getAlignment() != null){
- currentScreenData.setAlignment(show.getAlignment());
- }
- if (show.getGraphic() != null){
- currentScreenData.setGraphic(show.getGraphic());
- }
- if (show.getSecondaryGraphic() != null){
- currentScreenData.setSecondaryGraphic(show.getSecondaryGraphic());
- }
- }
-
- // Helpers
-
- private List<String> findValidMainTextFields(){
- List<String> array = new ArrayList<>();
-
- if (textField1 != null && textField1.length() > 0) {
- array.add(textField1);
- }
-
- if (textField2 != null && textField2.length() > 0) {
- array.add(textField2);
- }
-
- if (textField3 != null && textField3.length() > 0) {
- array.add(textField3);
- }
-
- if (textField4 != null && textField4.length() > 0) {
- array.add(textField4);
- }
-
- return array;
- }
-
-
- private List<MetadataType> findNonNullMetadataFields(){
- List<MetadataType> array = new ArrayList<>();
-
- if (textField1Type != null) {
- array.add(textField1Type);
- }
-
- if (textField2Type != null) {
- array.add(textField2Type);
- }
-
- if (textField3Type != null) {
- array.add(textField3Type);
- }
-
- if (textField4Type != null) {
- array.add(textField4Type);
- }
-
- return array;
- }
-
- SdlArtwork getBlankArtwork(){
-
- if (blankArtwork != null){
- blankArtwork = new SdlArtwork();
- blankArtwork.setType(FileType.GRAPHIC_PNG);
- blankArtwork.setName("blankArtwork");
- blankArtwork.setResourceId(R.drawable.transparent);
- }
- return blankArtwork;
- }
-
- private boolean isArtworkUploadedOrDoesntExist(SdlArtwork artwork){
-
- if (fileManager.get() != null){
- return artwork != null && fileManager.get().hasUploadedFile(artwork);
- }
-
- return false;
- }
-
- private boolean shouldUpdatePrimaryImage() {
- if (displayCapabilities == null || displayCapabilities.getGraphicSupported()) {
- if (currentScreenData.getGraphic() == null && primaryGraphic != null) {
- return true;
- } else if (currentScreenData.getGraphic() == null && primaryGraphic == null) {
- return false;
- }
- return currentScreenData != null && (primaryGraphic != null && !currentScreenData.getGraphic().getValue().equalsIgnoreCase(primaryGraphic.getName()));
- }
- return false;
- }
-
- private boolean shouldUpdateSecondaryImage() {
- // Cannot detect if there is a secondary image, so we'll just try to detect if there's a primary image and allow it if there is.
- if (displayCapabilities == null || displayCapabilities.getGraphicSupported()) {
- if (currentScreenData.getGraphic() == null && secondaryGraphic != null) {
- return true;
- } else if (currentScreenData.getGraphic() == null && secondaryGraphic == null) {
- return false;
- }
- return currentScreenData != null && (secondaryGraphic != null && !currentScreenData.getGraphic().getValue().equalsIgnoreCase(secondaryGraphic.getName()));
- }
- return false;
- }
-
- int getNumberOfLines() {
-
- if (displayCapabilities == null){
- return 4;
- }
-
- int linesFound = 0;
-
- List<TextField> textFields = displayCapabilities.getTextFields();
- TextFieldName name;
- for (TextField field : textFields) {
- if (field.getName() != null) {
- name = field.getName();
- if (name == TextFieldName.mainField1 || name == TextFieldName.mainField2 || name == TextFieldName.mainField3 || name == TextFieldName.mainField4) {
- linesFound += 1;
- }
- }
- }
-
- return linesFound;
- }
-
- // SCREEN ITEM SETTERS AND GETTERS
-
- void setTextAlignment(TextAlignment textAlignment){
- this.textAlignment = textAlignment;
- // If we aren't batching, send the update immediately, if we are, set ourselves as dirty (so we know we should send an update after the batch ends)
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- TextAlignment getTextAlignment(){
- return textAlignment;
- }
-
- void setMediaTrackTextField(String mediaTrackTextField){
- this.mediaTrackTextField = mediaTrackTextField;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- String getMediaTrackTextField(){
- return mediaTrackTextField;
- }
-
- void setTextField1(String textField1){
- this.textField1 = textField1;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- String getTextField1(){
- return textField1;
- }
-
- void setTextField2(String textField2){
- this.textField2 = textField2;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- String getTextField2(){
- return textField2;
- }
-
- void setTextField3(String textField3){
- this.textField3 = textField3;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- String getTextField3(){
- return textField3;
- }
-
- void setTextField4(String textField4){
- this.textField4 = textField4;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- String getTextField4(){
- return textField4;
- }
-
- void setTextField1Type(MetadataType textField1Type){
- this.textField1Type = textField1Type;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- MetadataType getTextField1Type(){
- return textField1Type;
- }
-
- void setTextField2Type(MetadataType textField2Type){
- this.textField2Type = textField2Type;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- MetadataType getTextField2Type(){
- return textField2Type;
- }
-
- void setTextField3Type(MetadataType textField3Type){
- this.textField3Type = textField3Type;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- MetadataType getTextField3Type(){
- return textField3Type;
- }
-
- void setTextField4Type(MetadataType textField4Type){
- this.textField4Type = textField4Type;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- MetadataType getTextField4Type(){
- return textField4Type;
- }
-
- void setPrimaryGraphic(SdlArtwork primaryGraphic){
- this.primaryGraphic = primaryGraphic;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- SdlArtwork getPrimaryGraphic(){
- return primaryGraphic;
- }
-
- void setSecondaryGraphic(SdlArtwork secondaryGraphic){
- this.secondaryGraphic = secondaryGraphic;
- if (!batchingUpdates){
- sdlUpdate(null);
- }else{
- isDirty = true;
- }
- }
-
- SdlArtwork getSecondaryGraphic(){
- return secondaryGraphic;
- }
-
- void setBatchUpdates(boolean batching){
- this.batchingUpdates = batching;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java b/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java
deleted file mode 100644
index 1e84531bd..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java
+++ /dev/null
@@ -1,621 +0,0 @@
-package com.smartdevicelink.managers.video;
-
-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 com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.encoder.VirtualDisplayEncoder;
-import com.smartdevicelink.haptic.HapticInterfaceManager;
-import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.StreamingStateMachine;
-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 com.smartdevicelink.transport.utl.TransportRecord;
-import com.smartdevicelink.util.Version;
-
-import java.lang.ref.WeakReference;
-import java.util.List;
-import java.util.concurrent.FutureTask;
-
-@TargetApi(19)
-public class VideoStreamManager extends BaseSubManager {
- private static String TAG = "VideoStreamManager";
-
- 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;
- private boolean isTransportAvailable = false;
-
- // 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();
- if(hmiLevel.equals(HMILevel.HMI_FULL)){
- checkState();
- }
- }
- }
- };
-
- 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 VideoStreamManager(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();
- }
-
- @Override
- public void start(CompletionListener listener) {
- isTransportAvailable = internalInterface.isTransportForServiceAvailable(SessionType.NAV);
- getVideoStreamingParams();
- checkState();
- super.start(listener);
- }
-
- private synchronized void checkState(){
- if(this.getState() == SETTING_UP
- && isTransportAvailable
- && hmiLevel != null
- && hmiLevel.equals(HMILevel.HMI_FULL)
- && parameters != null){
- transitionToState(READY);
- }
- }
-
- private void getVideoStreamingParams(){
- if(internalInterface.getProtocolVersion().getMajor() >= 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
- VideoStreamManager.this.parameters = params;
-
- checkState();
-
- }
-
- @Override
- public void onError(String info) {
- Log.e(TAG, "Error retrieving video streaming capability: " + info);
- stateMachine.transitionToState(StreamingStateMachine.ERROR);
- transitionToState(ERROR);
- }
- });
- }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());
- }
-
- this.parameters = params;
- checkState();
- }
- }
-
- /**
- * 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;
- int majorProtocolVersion = internalInterface.getProtocolVersion().getMajor();
- if(majorProtocolVersion >= 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(majorProtocolVersion >= 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.
- */
- @Override
- 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);
- super.dispose();
- }
-
- // 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
- VideoStreamManager.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.getProtocolVersion().getMajor() >= 5){ //At this point we should already have the capability
- VideoStreamingCapability capability = (VideoStreamingCapability) internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING);
- if(capability != null){
- resolution = capability.getPreferredResolution();
- }
- }
-
- if(resolution == null){ //Either the protocol version is too low to access video streaming caps, or they were null
- 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);
- }
-
- }
- }
- }
- }
-
- @Override
- protected void onTransportUpdate(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail){
-
- isTransportAvailable = videoStreamTransportAvail;
-
- if(internalInterface.getProtocolVersion().isNewerThan(new Version(5,1,0)) >= 0){
- if(videoStreamTransportAvail){
- checkState();
- }
- }else{
- //The protocol version doesn't support simultaneous transports.
- if(!videoStreamTransportAvail){
- //If video streaming isn't available on primary transport then it is not possible to
- //use the video streaming manager until a complete register on a transport that
- //supports video
- transitionToState(ERROR);
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java b/sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
deleted file mode 100644
index 89f4d1ef7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package com.smartdevicelink.marshal;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.trace.*;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-import com.smartdevicelink.util.DebugTool;
-
-/*
- * Responsible for marshalling and unmarshing between RPC Objects and byte streams that are sent
- * over transmission
- */
-
-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 {
- JSONObject jsonObject = msg.serializeJSON(version);
- jsonBytes = jsonObject.toString().getBytes();
-
- SdlTrace.logMarshallingEvent(InterfaceActivityDirection.Transmit, jsonBytes, SDL_LIB_PRIVATE_KEY);
- } catch (JSONException e) {
- DebugTool.logError("Failed to encode messages to JSON.", e);
- }
- return jsonBytes;
- }
-
- public static Hashtable<String, Object> unmarshall(byte[] message) {
- SdlTrace.logMarshallingEvent(InterfaceActivityDirection.Receive, message, SDL_LIB_PRIVATE_KEY);
- Hashtable<String, Object> ret = null;
- try {
- String jsonString = new String(message);
- JSONObject jsonObject = new JSONObject(jsonString);
- ret = deserializeJSONObject(jsonObject);
- } catch (JSONException e) {
- DebugTool.logError("Failed to parse JSON", e);
- }
- return ret;
- }
-
- @SuppressWarnings("unchecked")
- public static Hashtable<String, Object> deserializeJSONObject(JSONObject jsonObject)
- throws JSONException {
- Hashtable<String, Object> ret = new Hashtable<String, Object>();
- Iterator<String> it = jsonObject.keys();
- String key = null;
- while (it.hasNext()) {
- key = it.next();
- Object value = jsonObject.get(key);
- if (value instanceof JSONObject) {
- ret.put(key, deserializeJSONObject((JSONObject)value));
- } else if (value instanceof JSONArray) {
- JSONArray arrayValue = (JSONArray) value;
- List<Object> putList = new ArrayList<Object>(arrayValue.length());
- for (int i = 0; i < arrayValue.length(); i++) {
- Object anObject = arrayValue.get(i);
- if (anObject instanceof JSONObject) {
- Hashtable<String, Object> deserializedObject = deserializeJSONObject((JSONObject)anObject);
- putList.add(deserializedObject);
- } else {
- putList.add(anObject);
- }
- }
- ret.put(key, putList);
- } else {
- ret.put(key, value);
- }
- }
- return ret;
- }
-
- @SuppressWarnings("unchecked" )
- private static JSONArray serializeList(List<?> list) throws JSONException{
- JSONArray toPut = new JSONArray();
- Iterator<Object> valueIterator = (Iterator<Object>) list.iterator();
- while(valueIterator.hasNext()){
- Object anObject = valueIterator.next();
- if (anObject instanceof RPCStruct) {
- RPCStruct toSerialize = (RPCStruct) anObject;
- toPut.put(toSerialize.serializeJSON());
- } else if(anObject instanceof Hashtable){
- Hashtable<String, Object> toSerialize = (Hashtable<String, Object>)anObject;
- toPut.put(serializeHashtable(toSerialize));
- } else {
- toPut.put(anObject);
- }
- }
- return toPut;
- }
-
- @SuppressWarnings({"unchecked" })
- public static JSONObject serializeHashtable(Hashtable<String, Object> hash) throws JSONException{
- JSONObject obj = new JSONObject();
- Iterator<String> hashKeyIterator = hash.keySet().iterator();
- while (hashKeyIterator.hasNext()){
- String key = (String) hashKeyIterator.next();
- Object value = hash.get(key);
- if (value instanceof RPCStruct) {
- obj.put(key, ((RPCStruct) value).serializeJSON());
- } else if (value instanceof List<?>) {
- obj.put(key, serializeList((List<?>) value));
- } else if (value instanceof Hashtable) {
- obj.put(key, serializeHashtable((Hashtable<String, Object>)value));
- } else {
- obj.put(key, value);
- }
- }
- return obj;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/AbstractProtocol.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/AbstractProtocol.java
deleted file mode 100644
index 043f7e994..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/AbstractProtocol.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package com.smartdevicelink.protocol;
-
-
-import com.smartdevicelink.protocol.WiProProtocol.MessageFrameAssembler;
-import com.smartdevicelink.protocol.enums.SessionType;
-
-import java.util.List;
-
-/**
- * @see SdlProtocol
- */
-@Deprecated
-public abstract class AbstractProtocol {
- private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
-
- private IProtocolListener _protocolListener = null;
- //protected IProtocolListener ProtocolListener() { return _protocolListener; }
-
- // Lock to ensure all frames are sent uninterupted
- private Object _frameLock = new Object();
-
- // Caller must provide a non-null IProtocolListener interface reference.
- public AbstractProtocol(IProtocolListener protocolListener) {
- if (protocolListener == null) {
- throw new IllegalArgumentException("Provided protocol listener interface reference is null");
- } // end-if
-
- _protocolListener = protocolListener;
- } // end-ctor
-
-
- // This method receives a protocol message (e.g. RPC, BULK, etc.) and processes
- // it for transmission over the transport. The results of this processing will
- // be sent to the onProtocolMessageBytesToSend() method on protocol listener
- // interface. Note that the ProtocolMessage itself contains information
- // about the type of message (e.g. RPC, BULK, etc.) and the protocol session
- // over which to send the message, etc.
- public abstract void SendMessage(ProtocolMessage msg);
-
- public abstract int getMtu();
- public abstract long getMtu(SessionType type);
-
- public abstract void handlePacketReceived(SdlPacket packet);
-
- // This method starts a protocol session. A corresponding call to the protocol
- // listener onProtocolSessionStarted() method will be made when the protocol
- // session has been established.
- public abstract void StartProtocolSession(SessionType sessionType);
-
- public abstract void StartProtocolService(SessionType sessionType, byte sessionID, boolean isEncrypted);
-
- public abstract void EndProtocolService(SessionType serviceType, byte sessionID);
- // This method ends a protocol session. A corresponding call to the protocol
- // listener onProtocolSessionEnded() method will be made when the protocol
- // session has ended.
- public abstract void EndProtocolSession(SessionType sessionType, byte sessionID, int hashID);
-
- // TODO REMOVE
- // This method sets the interval at which heartbeat protocol messages will be
- // sent to SDL.
- public abstract void SetHeartbeatSendInterval(int heartbeatSendInterval_ms);
-
- // This method sets the interval at which heartbeat protocol messages are
- // expected to be received from SDL.
- public abstract void SetHeartbeatReceiveInterval(int heartbeatReceiveInterval_ms);
-
- public abstract void SendHeartBeat(byte sessionID);
-
- public abstract void SendHeartBeatACK(byte sessionID);
-
- // This method is called whenever the protocol receives a complete frame
- protected void handleProtocolFrameReceived(SdlPacket packet, MessageFrameAssembler assembler) {
- //FIXME SdlTrace.logProtocolEvent(InterfaceActivityDirection.Receive, header, data,
- // 0, packet.dataSize, SDL_LIB_TRACE_KEY);
-
- assembler.handleFrame(packet);
- }
-
- private synchronized void resetOutgoingHeartbeat(SessionType sessionType, byte sessionID) {
- if (_protocolListener != null) {
- _protocolListener.onResetOutgoingHeartbeat(sessionType,sessionID);
- }
- }
-
- private synchronized void resetIncomingHeartbeat(SessionType sessionType, byte sessionID) {
- if (_protocolListener != null) {
- _protocolListener.onResetIncomingHeartbeat(sessionType,sessionID);
- }
- }
-
- // This method is called whenever a protocol has an entire frame to send
- /**
- * SdlPacket should have included payload at this point.
- * @param header
- */
- protected void handlePacketToSend(SdlPacket header) {
- //FIXME SdlTrace.logProtocolEvent(InterfaceActivityDirection.Transmit, header, data,
- // offset, length, SDL_LIB_TRACE_KEY);
- resetOutgoingHeartbeat(SessionType.valueOf((byte)header.getServiceType()), (byte)header.getSessionId());
-
- synchronized(_frameLock) {
-
- //byte[] frameHeader = header.constructPacket();
- if(header!=null){
- _protocolListener.onProtocolMessageBytesToSend(header);
- }//TODO else log out error
-
- }
- }
-
-
- // This method handles received protocol messages.
- protected void handleProtocolMessageReceived(ProtocolMessage message) {
- _protocolListener.onProtocolMessageReceived(message);
- }
-
- // This method handles the end of a protocol session. A callback is
- // sent to the protocol listener.
- protected void handleProtocolSessionEndedNACK(SessionType sessionType,
- byte sessionID, String correlationID) {
- _protocolListener.onProtocolSessionEndedNACKed(sessionType, sessionID, correlationID);
- }
-
- // This method handles the end of a protocol session. A callback is
- // sent to the protocol listener.
- protected void handleProtocolSessionEnded(SessionType sessionType,
- byte sessionID, String correlationID) {
- _protocolListener.onProtocolSessionEnded(sessionType, sessionID, correlationID);
- }
-
- // This method handles the startup of a protocol session. A callback is sent
- // to the protocol listener.
- protected void handleProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
- _protocolListener.onProtocolSessionStarted(sessionType, sessionID, version, correlationID, hashID, isEncrypted);
- }
-
- protected void handleProtocolSessionNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
- _protocolListener.onProtocolSessionNACKed(sessionType, sessionID, version, correlationID, rejectedParams);
- }
-
- // This method handles protocol errors. A callback is sent to the protocol
- // listener.
- protected void handleProtocolError(String string, Exception ex) {
- _protocolListener.onProtocolError(string, ex);
- }
- protected void handleProtocolHeartbeat(SessionType sessionType, byte sessionID) {
- SendHeartBeatACK(sessionID);
- _protocolListener.onProtocolHeartbeat(sessionType, sessionID);
- }
- protected void handleProtocolHeartbeatACK(SessionType sessionType, byte sessionID) {
- _protocolListener.onProtocolHeartbeatACK(sessionType, sessionID);
- }
- protected void handleProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID) {
- _protocolListener.onProtocolServiceDataACK(sessionType, dataSize, sessionID);
- }
- protected void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID) {
- resetIncomingHeartbeat(sessionType, sessionID);
- }
-
-} // end-class
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
deleted file mode 100644
index 5848b9f5a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import android.util.Log;
-
-import com.smartdevicelink.util.BitConverter;
-
-public class BinaryFrameHeader {
- private static final String TAG = "BinaryFrameHeader";
-
- private byte _rpcType;
- private int _functionID;
- private int _correlationID;
- private int _jsonSize;
-
- private byte[] _jsonData;
- private byte[] _bulkData;
-
- public BinaryFrameHeader() {}
-
- public static BinaryFrameHeader parseBinaryHeader(byte[] binHeader) {
- BinaryFrameHeader msg = new BinaryFrameHeader();
-
- byte RPC_Type = (byte) (binHeader[0] >>> 4);
- msg.setRPCType(RPC_Type);
-
- int _functionID = (BitConverter.intFromByteArray(binHeader, 0) & 0x0FFFFFFF);
- msg.setFunctionID(_functionID);
-
- int corrID = BitConverter.intFromByteArray(binHeader, 4);
- msg.setCorrID(corrID);
-
- int _jsonSize = BitConverter.intFromByteArray(binHeader, 8);
- msg.setJsonSize(_jsonSize);
-
- try {
- if (_jsonSize > 0) {
- byte[] _jsonData = new byte[_jsonSize];
- System.arraycopy(binHeader, 12, _jsonData, 0, _jsonSize);
- msg.setJsonData(_jsonData);
- }
-
- if (binHeader.length - _jsonSize - 12 > 0) {
- byte[] _bulkData = new byte[binHeader.length - _jsonSize - 12];
- System.arraycopy(binHeader, 12 + _jsonSize, _bulkData, 0, _bulkData.length);
- msg.setBulkData(_bulkData);
- }
- } catch (OutOfMemoryError|ArrayIndexOutOfBoundsException e){
- Log.e(TAG, "Unable to process data to form header");
- return null;
- }
-
- return msg;
- }
-
- public byte[] assembleHeaderBytes() {
- int binHeader = _functionID;
- // reset the 4 leftmost bits, for _rpcType
- binHeader &= 0xFFFFFFFF >>> 4;
- binHeader |= (_rpcType << 28);
-
- byte[] ret = new byte[12];
- System.arraycopy(BitConverter.intToByteArray(binHeader), 0, ret, 0, 4);
- System.arraycopy(BitConverter.intToByteArray(_correlationID), 0, ret, 4, 4);
- System.arraycopy(BitConverter.intToByteArray(_jsonSize), 0, ret, 8, 4);
-
- return ret;
- }
-
- public byte getRPCType() {
- return _rpcType;
- }
-
- public void setRPCType(byte _rpcType) {
- this._rpcType = _rpcType;
- }
-
- public int getFunctionID() {
- return _functionID;
- }
-
- public void setFunctionID(int _functionID) {
- this._functionID = _functionID;
- }
-
- public int getCorrID() {
- return _correlationID;
- }
-
- public void setCorrID(int _correlationID) {
- this._correlationID = _correlationID;
- }
-
- public int getJsonSize() {
- return _jsonSize;
- }
-
- public void setJsonSize(int _jsonSize) {
- this._jsonSize = _jsonSize;
- }
-
- public byte[] getJsonData() {
- return _jsonData;
- }
-
- public void setJsonData(byte[] _jsonData) {
- this._jsonData = new byte[this._jsonSize];
- System.arraycopy(_jsonData, 0, this._jsonData, 0, _jsonSize);
- //this._jsonData = _jsonData;
- }
-
- public byte[] getBulkData() {
- return _bulkData;
- }
-
- public void setBulkData(byte[] _bulkData) {
- this._bulkData = _bulkData;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
deleted file mode 100644
index e0c6808e1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.smartdevicelink.protocol;
-
-
-import com.smartdevicelink.protocol.enums.*;
-
-import java.util.List;
-
-public interface IProtocolListener {
- // Called to indicate that these bytes are to be sent as part of a message.
- // This call includes the part of the message.
- void onProtocolMessageBytesToSend(SdlPacket packet);
-
- // Called to indicate that a complete message (RPC, BULK, etc.) has been
- // received. This call includes the message.
- void onProtocolMessageReceived(ProtocolMessage msg);
-
- // Called to indicate that a protocol session has been started (from either side)
- void onProtocolSessionStarted(SessionType sessionType, byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted);
-
- void onProtocolSessionNACKed(SessionType sessionType, byte sessionID, byte version,
- String correlationID, List<String> rejectedParams);
-
- // Called to indicate that a protocol session has ended (from either side)
- void onProtocolSessionEnded(SessionType sessionType, byte sessionID, String correlationID /*, String info, Exception ex*/);
-
- void onProtocolSessionEndedNACKed(SessionType sessionType, byte sessionID, String correlationID /*, String info, Exception ex*/);
-
- void onProtocolHeartbeat(SessionType sessionType, byte sessionID);
-
- /**
- * Called when a protocol heartbeat ACK message has been received from SDL.
- */
- void onProtocolHeartbeatACK(SessionType sessionType, byte sessionID);
-
- void onProtocolServiceDataACK(SessionType sessionType, int dataSize, byte sessionID);
-
- void onResetOutgoingHeartbeat(SessionType sessionType, byte sessionID);
-
- void onResetIncomingHeartbeat(SessionType sessionType, byte sessionID);
-
- // Called to indicate that a protocol error was detected in received data.
- void onProtocolError(String info, Exception e);
-
-} // end-interfCe
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java
deleted file mode 100644
index beb78a90a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/ISdlProtocol.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.protocol;
-
-
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.security.SdlSecurityBase;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-
-public interface ISdlProtocol extends IProtocolListener {
-
- byte getSessionId();
-
- void shutdown(String info);
-
- void onTransportDisconnected(String info, boolean altTransportAvailable, MultiplexTransportConfig transportConfig);
-
- SdlSecurityBase getSdlSecurity();
-
- VideoStreamingParameters getDesiredVideoParams();
-
- void setAcceptedVideoParams(VideoStreamingParameters acceptedVideoParams);
-
- void stopStream(SessionType serviceType);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
deleted file mode 100644
index 17db7ad11..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-public interface ISecondaryTransportListener {
- void onConnectionSuccess(TransportRecord transportRecord);
- void onConnectionFailure();
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
deleted file mode 100644
index cb5ad3a74..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-
-public class ProtocolMessage {
- private byte version = 1;
- private SessionType _sessionType = SessionType.RPC;
- private MessageType _messageType = MessageType.UNDEFINED;
- private byte _sessionID = 0;
- private byte _rpcType;
- private int _functionID;
- private int _correlationID;
- private int _jsonSize;
- private boolean payloadProtected = false;
-
- int priorityCoefficient = 0;
-
- private byte[] _data = null;
- private byte[] _bulkData = null;
-
- public ProtocolMessage() {}
-
- public byte getVersion() {
- return version;
- }
-
- public void setVersion(byte version) {
- this.version = version;
- }
-
- public byte getSessionID() {
- return _sessionID;
- }
-
- public void setSessionID(byte sessionID) {
- this._sessionID = sessionID;
- }
-
- public byte[] getData() {
- return _data;
- }
-
- public void setData(byte[] data) {
- this._data = data;
- this._jsonSize = data.length;
- }
-
- public void setData(byte[] data, int length) {
- setData(data, 0, length);
- }
-
- public void setData(byte[] data, int offset, int length) {
- if (this._data != null)
- this._data = null;
- this._data = new byte[length];
- System.arraycopy(data, offset, this._data, 0, length);
- this._jsonSize = 0;
- }
-
- public byte[] getBulkData() {
- return _bulkData;
- }
-
- public void setBulkDataNoCopy(byte[] bulkData) {
- this._bulkData = bulkData;
- }
-
- public void setBulkData(byte[] bulkData) {
- if (this._bulkData != null)
- this._bulkData = null;
- this._bulkData = new byte[bulkData.length];
- System.arraycopy(bulkData, 0, this._bulkData, 0, bulkData.length);
- //this._bulkData = bulkData;
- }
-
- public void setBulkData(byte[] bulkData, int length) {
- if (this._bulkData != null)
- this._bulkData = null;
- this._bulkData = new byte[length];
- System.arraycopy(bulkData, 0, this._bulkData, 0, length);
- //this._bulkData = bulkData;
- }
-
- public SessionType getSessionType() {
- return _sessionType;
- }
-
- public void setSessionType(SessionType sessionType) {
- this._sessionType = sessionType;
- }
-
- public MessageType getMessageType() {
- return _messageType;
- }
-
- public void setMessageType(MessageType messageType) {
- this._messageType = messageType;
- }
-
- public byte getRPCType() {
- return _rpcType;
- }
-
- public void setRPCType(byte _rpcType) {
- this._rpcType = _rpcType;
- }
-
- public int getFunctionID() {
- return _functionID;
- }
-
- public void setFunctionID(int _functionID) {
- this._functionID = _functionID;
- }
-
- public int getCorrID() {
- return _correlationID;
- }
-
- public void setCorrID(int _correlationID) {
- this._correlationID = _correlationID;
- }
-
- public int getJsonSize() {
- return _jsonSize;
- }
-
- public void setJsonSize(int _jsonSize) {
- this._jsonSize = _jsonSize;
- }
-
- public void setPayloadProtected(boolean bVal) {
- payloadProtected = bVal;
- }
-
- public boolean getPayloadProtected() {
- return payloadProtected;
- }
-
- /**
- * Set the priority for this packet. The lower the number the higher the priority. <br>0 is the highest priority and the default.
- * @param priority
- */
- public void setPriorityCoefficient(int priority){
- this.priorityCoefficient = priority;
- }
- public int getPrioirtyCoefficient(){
- return this.priorityCoefficient;
- }
-} // end-class \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
deleted file mode 100644
index b635ab3f5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
+++ /dev/null
@@ -1,437 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-
-import com.livio.BSON.BsonEncoder;
-import com.smartdevicelink.protocol.enums.FrameType;
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-import android.os.Parcel;
-import android.os.ParcelFormatException;
-import android.os.Parcelable;
-
-/**
- * This class is only intended to be parcelable from the transport broker to the SDL Router Service.
- * Any other binder transactions must include an additional int flag into their bundle or the parsing
- * of this object will fail.
- */
-public class SdlPacket implements Parcelable{
-
- /**
- * This is the amount of bytes added to the bundle from the router service for a specific int
- * flag; this data will always and must be included. This flag is the
- * TransportConstants.BYTES_TO_SEND_FLAGS.
- *
- * @see com.smartdevicelink.transport.TransportConstants#BYTES_TO_SEND_FLAGS
- */
- private static final int EXTRA_PARCEL_DATA_LENGTH = 24;
-
- public static final int HEADER_SIZE = 12;
- public static final int HEADER_SIZE_V1 = 8;//Backwards
-
- private static final int ENCRYPTION_MASK = 0x08; //4th lowest bit
-
- public static final int FRAME_TYPE_CONTROL = 0x00;
- public static final int FRAME_TYPE_SINGLE = 0x01;
- public static final int FRAME_TYPE_FIRST = 0x02;
- public static final int FRAME_TYPE_CONSECUTIVE = 0x03;
-
- /*
- * Service Type
- */
- public static final int SERVICE_TYPE_CONTROL = 0x00;
- //RESERVED 0x01 - 0x06
- public static final int SERVICE_TYPE_RPC = 0x07;
- //RESERVED 0x08 - 0x09
- public static final int SERVICE_TYPE_PCM = 0x0A;
- public static final int SERVICE_TYPE_VIDEO = 0x0B;
- //RESERVED 0x0C - 0x0E
- public static final int SERVICE_TYPE_BULK_DATA = 0x0F;
- //RESERVED 0x10 - 0xFF
-
-
- /*
- * Frame Info
- */
- //Control Frame Info
- public static final int FRAME_INFO_HEART_BEAT = 0x00;
- public static final int FRAME_INFO_START_SERVICE = 0x01;
- public static final int FRAME_INFO_START_SERVICE_ACK = 0x02;
- public static final int FRAME_INFO_START_SERVICE_NAK = 0x03;
- public static final int FRAME_INFO_END_SERVICE = 0x04;
- public static final int FRAME_INFO_END_SERVICE_ACK = 0x05;
- public static final int FRAME_INFO_END_SERVICE_NAK = 0x06;
- public static final int FRAME_INFO_REGISTER_SECONDARY_TRANSPORT = 0x07;
- public static final int FRAME_INFO_REGISTER_SECONDARY_TRANSPORT_ACK = 0x08;
- public static final int FRAME_INFO_REGISTER_SECONDARY_TRANSPORT_NAK = 0x09;
- //0x0A-0xFC are reserved
- public static final int FRAME_INFO_TRANSPORT_EVENT_UPDATE = 0xFD;
- public static final int FRAME_INFO_SERVICE_DATA_ACK = 0xFE;
- public static final int FRAME_INFO_HEART_BEAT_ACK = 0xFF;
-
- public static final int FRAME_INFO_FINAL_CONNESCUTIVE_FRAME = 0x00;
-
- //Most others
- public static final int FRAME_INFO_RESERVED = 0x00;
-
-
- int version;
- boolean encryption;
- int frameType;
- int serviceType;
- int frameInfo;
- int sessionId;
- int dataSize;
- int messageId;
- int priorityCoefficient;
- byte[] payload = null;
- HashMap<String, Object> bsonPayload;
-
- int messagingVersion = 1;
- TransportRecord transportRecord;
-
- public SdlPacket(int version, boolean encryption, int frameType,
- int serviceType, int frameInfo, int sessionId,
- int dataSize, int messageId, byte[] payload) {
- this.version = version;
- this.encryption = encryption;
- this.frameType = frameType;
- this.serviceType = serviceType;
- this.frameInfo = frameInfo;
- this.sessionId = sessionId;
- this.dataSize = dataSize;
- this.messageId = messageId;
- this.priorityCoefficient = 0;
- if(payload!=null){
- this.payload = new byte[payload.length];
- System.arraycopy(payload, 0, this.payload, 0, payload.length);
- }
- }
-
- public SdlPacket(int version, boolean encryption, int frameType,
- int serviceType, int frameInfo, int sessionId,
- int dataSize, int messageId, byte[] payload, int offset,int bytesToWrite) {
- this.version = version;
- this.encryption = encryption;
- this.frameType = frameType;
- this.serviceType = serviceType;
- this.frameInfo = frameInfo;
- this.sessionId = sessionId;
- this.dataSize = dataSize;
- this.messageId = messageId;
- this.priorityCoefficient = 0;
- if(payload!=null){
- this.payload = new byte[bytesToWrite];
- System.arraycopy(payload, offset, this.payload, 0, bytesToWrite);
- }
- }
- /**
- * This constructor is available as a protected method. A few defaults have been set, however a few things <b>MUST</b> be set before use. The rest will "work"
- * however, it won't be valid data.
- *
- * <p>Frame Type
- * <p>Service Type
- * <p>Frame Info
- * <p>
- */
- protected SdlPacket(){
- //Package only empty constructor
- //TODO add defaults
- this.version = 1;
- this.encryption = false;
- this.frameType = -1; //This NEEDS to be set
- this.serviceType = -1;
- this.frameInfo = -1;
- this.sessionId = 0;
- this.dataSize = 0;
- this.messageId = 0;
-
- }
-
- /**
- * Creates a new packet based on previous packet definitions
- * @param packet
- */
- protected SdlPacket(SdlPacket packet){
- this.version = packet.version;
- this.encryption = packet.encryption;
- this.frameType = packet.frameType;
- this.serviceType = packet.serviceType;
- this.frameInfo = packet.frameInfo;
- this.sessionId = packet.sessionId;
- this.dataSize = 0;
- this.messageId = 0;
- }
-
- public int getVersion() {
- return version;
- }
-
- public boolean isEncrypted() {
- return encryption;
- }
-
- public FrameType getFrameType() {
- switch(frameType){
- case FRAME_TYPE_CONTROL:
- return FrameType.Control;
- case FRAME_TYPE_FIRST:
- return FrameType.First;
- case FRAME_TYPE_CONSECUTIVE:
- return FrameType.Consecutive;
- case FRAME_TYPE_SINGLE:
- default:
- return FrameType.Single;
- }
- }
-
- public int getServiceType() {
- return serviceType;
- }
-
- public int getFrameInfo() {
- return frameInfo;
- }
-
- public int getSessionId() {
- return sessionId;
- }
-
- public int getMessageId() {
- return messageId;
- }
-
- public long getDataSize() {
- return dataSize;
- }
-
- public byte[] getPayload() {
- return payload;
- }
-
- public byte[] constructPacket() {
- if (bsonPayload != null && !bsonPayload.isEmpty()) {
- byte[] bsonBytes = BsonEncoder.encodeToBytes(bsonPayload);
- payload = bsonBytes;
- dataSize = bsonBytes.length;
- }
- return constructPacket(version, encryption, frameType,
- serviceType, frameInfo, sessionId,
- dataSize, messageId, payload);
- }
- public void setPayload(byte[] bytes){
- this.payload = bytes;
- }
- /**
- * Set the priority for this packet. The lower the number the higher the priority. <br>0 is the highest priority and the default.
- * @param priority
- */
- public void setPriorityCoefficient(int priority){
- this.priorityCoefficient = priority;
- }
- public int getPrioirtyCoefficient(){
- return this.priorityCoefficient;
- }
-
- public void setTransportRecord(TransportRecord transportRecord){
- this.transportRecord = transportRecord;
- }
-
- public TransportRecord getTransportRecord() {
- return this.transportRecord;
- }
-
- /**
- * This method takes in the various components to the SDL packet structure and creates a new byte array that can be sent via the transport
- * @param version
- * @param encryption
- * @param frameType
- * @param serviceType
- * @param controlFrameInfo
- * @param sessionId
- * @param dataSize
- * @param messageId
- * @param payload
- * @return
- */
- public static byte[] constructPacket(int version, boolean encryption, int frameType,
- int serviceType, int controlFrameInfo, int sessionId,
- int dataSize, int messageId, byte[] payload){
-
- ByteBuffer builder;
- switch(version){
- case 1:
- builder = ByteBuffer.allocate(HEADER_SIZE_V1 + dataSize);
- break;
- default:
- builder = ByteBuffer.allocate(HEADER_SIZE + dataSize);
- break;
- }
-
- builder.put((byte)((version<<4) + getEncryptionBit(encryption) + frameType));
- builder.put((byte)serviceType);
- builder.put((byte)controlFrameInfo);
- builder.put((byte)sessionId);
-
- builder.put((byte)((dataSize&0xFF000000)>>24));
- builder.put((byte)((dataSize&0x00FF0000)>>16));
- builder.put((byte)((dataSize&0x0000FF00)>>8));
- builder.put((byte)((dataSize&0x000000FF)));
-
- if(version>1){ //Version 1 did not include this part of the header
- builder.put((byte)((messageId&0xFF000000)>>24));
- builder.put((byte)((messageId&0x00FF0000)>>16));
- builder.put((byte)((messageId&0x0000FF00)>>8));
- builder.put((byte)((messageId&0x000000FF)));
- }
-
- if(payload!=null && payload.length>0){
- builder.put(payload);
- }
-
- return builder.array();
- }
-
-
- public static int getEncryptionBit(boolean encryption){
- if(encryption){
- return ENCRYPTION_MASK;
- }else{
- return 0;
- }
- }
-
-
-
-@Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("***** Sdl Packet ******");
- builder.append( "\nVersion: " +version);
- builder.append( "\nEncryption: " +encryption);
- builder.append( "\nFrameType: " +frameType);
- builder.append( "\nServiceType: " +serviceType);
- builder.append( "\nFrameInfo: " +frameInfo);
- builder.append( "\nSessionId: " +sessionId);
- builder.append( "\nDataSize: " +dataSize);
- if(version>1){
- builder.append( "\nMessageId: " +messageId);
- }
- builder.append("\n***** Sdl Packet End******");
-
-
- return builder.toString();
- }
-
- public void setMessagingVersion(int version){
- this.messagingVersion = version;
- }
-
-
-
- /* ***************************************************************************************************************************************************
- * *********************************************************** Parceable Overrides *****************************************************************
- *****************************************************************************************************************************************************/
-
-
-
- //I think this is FIFO...right?
- public SdlPacket(Parcel p) {
- this.version = p.readInt();
- this.encryption = (p.readInt() == 0) ? false : true;
- this.frameType = p.readInt();
- this.serviceType = p.readInt();
- this.frameInfo = p.readInt();
- this.sessionId = p.readInt();
- this.dataSize = p.readInt();
- this.messageId = p.readInt();
- if(p.readInt() == 1){ //We should have a payload attached
- payload = new byte[dataSize];
- p.readByteArray(payload);
- }
-
- this.priorityCoefficient = p.readInt();
-
- if(p.dataAvail() > EXTRA_PARCEL_DATA_LENGTH) { //See note on constant for why not 0
- try {
- messagingVersion = p.readInt();
- if (messagingVersion >= 2) {
- if (p.readInt() == 1) { //We should have a transport type attached
- this.transportRecord = p.readParcelable(TransportRecord.class.getClassLoader());
- }
- }
- }catch (ParcelFormatException e){
-
- }
- }
- }
-
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
-
- dest.writeInt(version);
- dest.writeInt(encryption? 1 : 0);
- dest.writeInt(frameType);
- dest.writeInt(serviceType);
- dest.writeInt(frameInfo);
- dest.writeInt(sessionId);
- dest.writeInt(dataSize);
- dest.writeInt(messageId);
- dest.writeInt(payload!=null? 1 : 0);
- if(payload!=null){
- dest.writeByteArray(payload);
- }
- dest.writeInt(priorityCoefficient);
-
- ///Additions after initial creation
- if(messagingVersion > 1){
- dest.writeInt(messagingVersion);
-
- dest.writeInt(transportRecord!=null? 1 : 0);
- if(transportRecord != null){
- dest.writeParcelable(transportRecord,0);
- }
- }
-
- }
-
- public static final Parcelable.Creator<SdlPacket> CREATOR = new Parcelable.Creator<SdlPacket>() {
- public SdlPacket createFromParcel(Parcel in) {
- return new SdlPacket(in);
- }
-
- @Override
- public SdlPacket[] newArray(int size) {
- return new SdlPacket[size];
- }
-
- };
-
- public void putTag(String tag, Object data){
- if(bsonPayload == null){
- bsonPayload = new HashMap<>();
- }
- bsonPayload.put(tag, data);
- }
-
- public Object getTag(String tag){
- if(payload == null){
- return null;
- }else if(bsonPayload == null || bsonPayload.isEmpty()){
- bsonPayload = BsonEncoder.decodeFromBytes(payload);
- }
-
- if(bsonPayload == null){
- return null;
- }
-
- return bsonPayload.get(tag);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
deleted file mode 100644
index 31898175c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
-import com.smartdevicelink.protocol.enums.SessionType;
-
-public class SdlPacketFactory {
-
- /*
- * public SdlPacket(int version, boolean compression, int frameType,
- int serviceType, int frameInfo, int sessionId,
- int dataSize, int messageId, byte[] payload) {
- */
- public static SdlPacket createStartSession(SessionType serviceType, int messageID, byte version, byte sessionID, boolean encrypted) {
- SdlPacket packet = new SdlPacket(version,encrypted,SdlPacket.FRAME_TYPE_CONTROL,
- serviceType.getValue(),SdlPacket.FRAME_INFO_START_SERVICE,sessionID,
- 0,messageID,null);
-
- return packet;
- }
-
- public static SdlPacket createHeartbeat(SessionType serviceType, byte sessionID, byte version) {
-
- return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
- serviceType.getValue(),FrameDataControlFrameType.Heartbeat.value(),sessionID,
- 0,0,null);
-
- }
-
- public static SdlPacket createHeartbeatACK(SessionType serviceType, byte sessionID, byte version) {
- return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
- serviceType.getValue(),FrameDataControlFrameType.HeartbeatACK.value(),sessionID,
- 0,0,null);
- }
-
- public static SdlPacket createStartSessionACK(SessionType serviceType, byte sessionID, int messageID, byte version) {
-
- return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
- serviceType.getValue(),FrameDataControlFrameType.StartSessionACK.value(),sessionID,
- 0,messageID,null);
-
- }
-
- public static SdlPacket createStartSessionNACK(SessionType serviceType, byte sessionID, int messageID, byte version) {
-
- return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
- serviceType.getValue(),SdlPacket.FRAME_INFO_START_SERVICE_NAK,sessionID,
- 0,messageID,null);
- }
-
- public static SdlPacket createEndSession(SessionType serviceType, byte sessionID, int messageID, byte version, byte[] payload) {
- return new SdlPacket(version,false,SdlPacket.FRAME_TYPE_CONTROL,
- serviceType.getValue(),SdlPacket.FRAME_INFO_END_SERVICE,sessionID,
- payload.length,messageID,payload);
- }
-
- public static SdlPacket createSingleSendData(SessionType serviceType, byte sessionID,
- int dataLength, int messageID, byte version, byte[] payload, boolean encrypted) {
-
- return new SdlPacket(version,encrypted,SdlPacket.FRAME_TYPE_SINGLE,
- serviceType.getValue(),0,sessionID,
- payload.length,messageID,payload);
- }
-
- public static SdlPacket createMultiSendDataFirst(SessionType serviceType, byte sessionID,
- int messageID, byte version, byte[] payload, boolean encrypted) {
-
- return new SdlPacket(version,encrypted,SdlPacket.FRAME_TYPE_FIRST,
- serviceType.getValue(),0,sessionID,
- 8,messageID,payload);
-
- }
-
- public static SdlPacket createMultiSendDataRest(SessionType serviceType, byte sessionID,
- int dataLength, byte frameSequenceNumber, int messageID, byte version, byte[] payload,int offset,int length, boolean encrypted) {
-
- return new SdlPacket(version,encrypted,SdlPacket.FRAME_TYPE_CONSECUTIVE,
- serviceType.getValue(),frameSequenceNumber,sessionID,
- length,messageID,payload,offset,length);
- }
-
- public static SdlPacket createRegisterSecondaryTransport(byte sessionID, byte version) {
- return new SdlPacket(version, false, SdlPacket.FRAME_TYPE_CONTROL,
- SessionType.CONTROL.getValue(), SdlPacket.FRAME_INFO_REGISTER_SECONDARY_TRANSPORT,
- sessionID, 0, 0x01, null);
- }
-
- public static BinaryFrameHeader createBinaryFrameHeader(byte rpcType, int functionID, int corrID, int jsonSize) {
- BinaryFrameHeader msg = new BinaryFrameHeader();
- msg.setRPCType(rpcType);
- msg.setFunctionID(functionID);
- msg.setCorrID(corrID);
- msg.setJsonSize(jsonSize);
-
- return msg;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
deleted file mode 100644
index 4ca01ac5b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
+++ /dev/null
@@ -1,1437 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.protocol;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.protocol.enums.ControlFrameTags;
-import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
-import com.smartdevicelink.protocol.enums.FrameType;
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.rpc.ImageResolution;
-import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-import com.smartdevicelink.security.SdlSecurityBase;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.TransportConstants;
-import com.smartdevicelink.transport.TransportManager;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.TransportRecord;
-import com.smartdevicelink.util.BitConverter;
-import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.Version;
-
-import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-@SuppressWarnings("WeakerAccess")
-public class SdlProtocol {
- private static final String TAG ="SdlProtocol";
- private final static String FailurePropagating_Msg = "Failure propagating ";
-
- private static final int TLS_MAX_RECORD_SIZE = 16384;
-
- private static final int PRIMARY_TRANSPORT_ID = 1;
- private static final int SECONDARY_TRANSPORT_ID = 2;
-
- /**
- * Original header size based on version 1.0.0 only
- */
- public static final int V1_HEADER_SIZE = 8;
- /**
- * Larger header size that is used by versions 2.0.0 and up
- */
- public static final int V2_HEADER_SIZE = 12;
-
- //If increasing MAX PROTOCOL VERSION major version, make sure to alter it in SdlPsm
- private static final Version MAX_PROTOCOL_VERSION = new Version("5.1.0");
-
- public static final int V1_V2_MTU_SIZE = 1500;
- public static final int V3_V4_MTU_SIZE = 131072;
-
- private static final List<SessionType> HIGH_BANDWIDTH_SERVICES
- = Arrays.asList(SessionType.NAV, SessionType.PCM);
-
- // Lock to ensure all frames are sent uninterrupted
- private final Object FRAME_LOCK = new Object();
-
- private final ISdlProtocol iSdlProtocol;
- private final MultiplexTransportConfig transportConfig;
- private final Hashtable<Integer, MessageFrameAssembler> _assemblerForMessageID = new Hashtable<>();
- private final Hashtable<Byte, Object> _messageLocks = new Hashtable<>();
- private final HashMap<SessionType, Long> mtus = new HashMap<>();
- private final HashMap<SessionType, TransportRecord> activeTransports = new HashMap<>();
- private final Map<TransportType, List<ISecondaryTransportListener>> secondaryTransportListeners = new HashMap<>();
-
-
- private TransportManager transportManager;
- private Version protocolVersion = new Version("1.0.0");
- private int hashID = 0;
- private int messageID = 0;
- private int headerSize = V1_HEADER_SIZE;
-
- /**
- * Requested transports for primary and secondary
- */
- List<TransportType> requestedPrimaryTransports, requestedSecondaryTransports;
-
- /**
- * List of secondary transports supported by the module
- */
- List<TransportType> supportedSecondaryTransports;
-
- /**
- * Holds the priority of transports for a specific service when that service can be started
- * on a primary or secondary transport.
- */
- Map<SessionType, List<Integer>> transportPriorityForServiceMap;
- boolean requiresHighBandwidth;
- Map<TransportType, Bundle> secondaryTransportParams;
- TransportRecord connectedPrimaryTransport;
-
-
- @SuppressWarnings("ConstantConditions")
- public SdlProtocol(@NonNull ISdlProtocol iSdlProtocol, @NonNull MultiplexTransportConfig config) {
- if (iSdlProtocol == null ) {
- throw new IllegalArgumentException("Provided protocol listener interface reference is null");
- } // end-if
-
- this.iSdlProtocol = iSdlProtocol;
- this.transportConfig = config;
- this.requestedPrimaryTransports = this.transportConfig.getPrimaryTransports();
- this.requestedSecondaryTransports = this.transportConfig.getSecondaryTransports();
- this.requiresHighBandwidth = this.transportConfig.requiresHighBandwidth();
- this.transportManager = new TransportManager(transportConfig, transportEventListener);
-
-
- mtus.put(SessionType.RPC, (long) (V1_V2_MTU_SIZE - headerSize));
- } // end-ctor
-
-
- public void start(){
- transportManager.start();
-
- }
- /**
- * Retrieves the max payload size for a packet to be sent to the module
- * @return the max transfer unit
- */
- public int getMtu(){
- return mtus.get(SessionType.RPC).intValue();
- }
-
- public long getMtu(SessionType type){
- Long mtu = mtus.get(type);
- if(mtu == null){
- mtu = mtus.get(SessionType.RPC);
- }
- return mtu;
- }
-
- public boolean isConnected(){
- return transportManager != null && transportManager.isConnected(null,null);
- }
-
- /**
- * Resets the protocol to init status
- */
- protected void reset(){
- protocolVersion = new Version("1.0.0");
- hashID = 0;
- messageID = 0;
- headerSize = V1_HEADER_SIZE;
- this.activeTransports.clear();
- this.mtus.clear();
- mtus.put(SessionType.RPC, (long) (V1_V2_MTU_SIZE - headerSize));
- this.secondaryTransportParams = null;
- this._assemblerForMessageID.clear();
- this._messageLocks.clear();
- }
-
- /**
- * For logging purposes, prints active services on each connected transport
- */
- protected void printActiveTransports(){
- StringBuilder activeTransportString = new StringBuilder();
- activeTransportString.append("Active transports --- \n");
-
- for(Map.Entry entry : activeTransports.entrySet()){
- String sessionString = null;
- if(entry.getKey().equals(SessionType.NAV)) {
- sessionString = "NAV";
- }else if(entry.getKey().equals(SessionType.PCM)) {
- sessionString = "PCM";
- }else if(entry.getKey().equals(SessionType.RPC)) {
- sessionString = "RPC";
- }
- if(sessionString != null){
- activeTransportString.append("Session: ");
-
- activeTransportString.append(sessionString);
- activeTransportString.append(" Transport: ");
- activeTransportString.append(entry.getValue().toString());
- activeTransportString.append("\n");
- }
- }
- Log.d(TAG, activeTransportString.toString());
- }
-
- protected void printSecondaryTransportDetails(List<String> secondary, List<Integer> audio, List<Integer> video){
- StringBuilder secondaryDetailsBldr = new StringBuilder();
- secondaryDetailsBldr.append("Checking secondary transport details \n");
-
- if(secondary != null){
- secondaryDetailsBldr.append("Supported secondary transports: ");
- for(String s : secondary){
- secondaryDetailsBldr.append(" ").append(s);
- }
- secondaryDetailsBldr.append("\n");
- }else{
- Log.d(TAG, "Supported secondary transports list is empty!");
- }
- if(audio != null){
- secondaryDetailsBldr.append("Supported audio transports: ");
- for(int a : audio){
- secondaryDetailsBldr.append(" ").append(a);
- }
- secondaryDetailsBldr.append("\n");
- }
- if(video != null){
- secondaryDetailsBldr.append("Supported video transports: ");
- for(int v : video){
- secondaryDetailsBldr.append(" ").append(v);
- }
- secondaryDetailsBldr.append("\n");
- }
-
- Log.d(TAG, secondaryDetailsBldr.toString());
- }
-
-
- private TransportRecord getTransportForSession(SessionType type){
- return activeTransports.get(type);
- }
-
- private void setTransportPriorityForService(SessionType serviceType, List<Integer> order){
- if(transportPriorityForServiceMap == null){
- transportPriorityForServiceMap = new HashMap<>();
- }
- this.transportPriorityForServiceMap.put(serviceType, order);
- for(SessionType service : HIGH_BANDWIDTH_SERVICES){
- if (transportPriorityForServiceMap.get(service) != null
- && transportPriorityForServiceMap.get(service).contains(PRIMARY_TRANSPORT_ID)) {
- if(connectedPrimaryTransport != null) {
- activeTransports.put(service, connectedPrimaryTransport);
- }
- }
- }
- }
-
- /**
- * Handles when a secondary transport can be used to start services on or when the request as failed.
- * @param transportRecord the transport type that the event has taken place on
- * @param registered if the transport was successfully registered on
- */
- private void handleSecondaryTransportRegistration(TransportRecord transportRecord, boolean registered){
- if(registered) {
- //Session has been registered on secondary transport
- Log.d(TAG, transportRecord.getType().toString() + " transport was registered!");
- if (supportedSecondaryTransports.contains(transportRecord.getType())) {
- // If the transport type that is now available to be used it should be checked
- // against the list of services that might be able to be started on it
-
- for(SessionType secondaryService : HIGH_BANDWIDTH_SERVICES){
- if (transportPriorityForServiceMap.containsKey(secondaryService)) {
- // If this service type has extra information from the RPC StartServiceACK
- // parse through it to find which transport should be used to start this
- // specific service type
- for(int transportNum : transportPriorityForServiceMap.get(secondaryService)){
- if(transportNum == PRIMARY_TRANSPORT_ID){
- break; // Primary is favored for this service type, break out...
- }else if(transportNum == SECONDARY_TRANSPORT_ID){
- // The secondary transport can be used to start this service
- activeTransports.put(secondaryService, transportRecord);
- break;
- }
- }
- }
- }
- }
- }else{
- Log.d(TAG, transportRecord.toString() + " transport was NOT registered!");
- }
- //Notify any listeners for this secondary transport
- List<ISecondaryTransportListener> listenerList = secondaryTransportListeners.remove(transportRecord.getType());
- if(listenerList != null){
- for(ISecondaryTransportListener listener : listenerList){
- if(registered) {
- listener.onConnectionSuccess(transportRecord);
- }else{
- listener.onConnectionFailure();
- }
- }
- }
-
- if(DebugTool.isDebugEnabled()){
- printActiveTransports();
- }
- }
-
- private void onTransportsConnectedUpdate(List<TransportRecord> transports){
- //Log.d(TAG, "Connected transport update");
-
- //Temporary: this logic should all be changed to handle multiple transports of the same type
- ArrayList<TransportType> connectedTransports = new ArrayList<>();
- if(transports != null) {
- for (TransportRecord record : transports) {
- connectedTransports.add(record.getType());
- }
- }
-
- if(connectedPrimaryTransport != null && !connectedTransports.contains(connectedPrimaryTransport.getType())){
- //The primary transport being used is no longer part of the connected transports
- //The transport manager callbacks should handle the disconnect code
- connectedPrimaryTransport = null;
- notifyDevTransportListener();
- return;
- }
-
- if(activeTransports.get(SessionType.RPC) == null){
- //There is no currently active transport for the RPC service meaning no primary transport
- TransportRecord preferredPrimaryTransport = getPreferredTransport(requestedPrimaryTransports,transports);
- if(preferredPrimaryTransport != null) {
- connectedPrimaryTransport = preferredPrimaryTransport;
- startService(SessionType.RPC, (byte) 0x00, false);
- }else{
- onTransportNotAccepted("No transports match requested primary transport");
- }
- //Return to that the developer does not receive the transport callback at this time
- // as it is better to wait until the RPC service is registered and secondary transport
- //information is available
- return;
- }else if(secondaryTransportListeners != null
- && transports != null
- && iSdlProtocol!= null){
- // Check to see if there is a listener for a given transport.
- // If a listener exists, it can be assumed that the transport should be registered on
- for(TransportRecord record: transports){
- if(secondaryTransportListeners.get(record.getType()) != null
- && !secondaryTransportListeners.get(record.getType()).isEmpty()){
- registerSecondaryTransport(iSdlProtocol.getSessionId(), record);
- }
- }
- }
- //Update the developer that a new transport has become available
- notifyDevTransportListener();
- }
-
-
- /**
- * Check to see if a transport is available to start/use the supplied service.
- * @param serviceType the session that should be checked for transport availability
- * @return true if there is either a supported
- * transport currently connected or a transport is
- * available to connect with for the supplied service type.
- * <br>false if there is no
- * transport connected to support the service type in question and
- * no possibility in the foreseeable future.
- */
- public boolean isTransportForServiceAvailable(@NonNull SessionType serviceType){
- if(connectedPrimaryTransport == null){
- //If there is no connected primary then there is no transport available for any service
- return false;
- }else if(activeTransports!= null && activeTransports.containsKey(serviceType)){
- //There is an active transport that this service can be used on
- //This should catch RPC, Bulk, and Control service types
- return true;
- }
-
- if(transportPriorityForServiceMap != null) {
- List<Integer> transportPriority = transportPriorityForServiceMap.get(serviceType);
-
- if (transportPriority != null && !transportPriority.isEmpty()) {
- if (transportPriority.contains(PRIMARY_TRANSPORT_ID)) {
- //If the transport priority for this service type contains primary then
- // the service can be used/started
- return true;
- } else if (transportPriority.contains(SECONDARY_TRANSPORT_ID)) {
- //This would mean only secondary transport is supported for this service
- return isSecondaryTransportAvailable(false);
- }
- }
- }
-
- //No transport priority for this service type
- if(connectedPrimaryTransport.getType() == TransportType.USB || connectedPrimaryTransport.getType() == TransportType.TCP){
- //Since the only service type that should reach this point are ones that require a high
- //bandwidth, true can be returned if the primary transport is a high bandwidth transport
- return true;
- }else{
- //Since the only service type that should reach this point are ones that require a high
- //bandwidth, true can be returned if a secondary transport is a high bandwidth transport
- return isSecondaryTransportAvailable(true);
- }
- }
-
- /**
- * Checks to see if a secondary transport is available for this session
- * @param onlyHighBandwidth if only high bandwidth transports should be included in this check
- * @return true if any connected or potential transport meets the criteria to be a secondary
- * transport
- */
- private boolean isSecondaryTransportAvailable(boolean onlyHighBandwidth){
- if (supportedSecondaryTransports != null) {
- for (TransportType supportedSecondary : supportedSecondaryTransports) {
- if(!onlyHighBandwidth || supportedSecondary == TransportType.USB || supportedSecondary == TransportType.TCP) {
- if (transportManager.isConnected(supportedSecondary, null)) {
- //A supported secondary transport is already connected
- return true;
- } else if (secondaryTransportParams != null && secondaryTransportParams.containsKey(supportedSecondary)) {
- //A secondary transport is available to connect to
- return true;
- }
- }
- }
- }
- // No supported secondary transports
- return false;
- }
-
-
- /**
- * If there was a TransportListener attached to the supplied multiplex config, this method will
- * call the onTransportEvent method.
- */
- private void notifyDevTransportListener (){
- if(transportConfig.getTransportListener() != null && transportManager != null) {
- transportConfig.getTransportListener().onTransportEvent(transportManager.getConnectedTransports(), isTransportForServiceAvailable(SessionType.PCM),isTransportForServiceAvailable(SessionType.NAV));
- }
- }
-
- /**
- * Retrieves the preferred transport for the given connected transport
- * @param preferredList the list of preferred transports (primary or secondary)
- * @param connectedTransports the current list of connected transports
- * @return the preferred connected transport
- */
- private TransportRecord getPreferredTransport(List<TransportType> preferredList, List<TransportRecord> connectedTransports) {
- for (TransportType transportType : preferredList) {
- for(TransportRecord record: connectedTransports) {
- if (record.getType().equals(transportType)) {
- return record;
- }
- }
- }
- return null;
- }
-
- private void onTransportNotAccepted(String info){
- if(iSdlProtocol != null) {
- iSdlProtocol.shutdown(info);
- }
- }
-
-
- public Version getProtocolVersion(){
- return this.protocolVersion;
- }
-
- /**
- * This method will set the major protocol version that we should use. It will also set the default MTU based on version.
- * @param version major version to use
- */
- protected void setVersion(byte version) {
- if (version > 5) {
- this.protocolVersion = new Version("5.0.0"); //protect for future, proxy only supports v5 or lower
- headerSize = V2_HEADER_SIZE;
- mtus.put(SessionType.RPC, (long) V3_V4_MTU_SIZE);
- } else if (version == 5) {
- this.protocolVersion = new Version("5.0.0");
- headerSize = V2_HEADER_SIZE;
- mtus.put(SessionType.RPC, (long) V3_V4_MTU_SIZE);
- }else if (version == 4) {
- this.protocolVersion = new Version("4.0.0");
- headerSize = V2_HEADER_SIZE;
- mtus.put(SessionType.RPC, (long) V3_V4_MTU_SIZE); //versions 4 supports 128k MTU
- } else if (version == 3) {
- this.protocolVersion = new Version("3.0.0");
- headerSize = V2_HEADER_SIZE;
- mtus.put(SessionType.RPC, (long) V3_V4_MTU_SIZE); //versions 3 supports 128k MTU
- } else if (version == 2) {
- this.protocolVersion = new Version("2.0.0");
- headerSize = V2_HEADER_SIZE;
- mtus.put(SessionType.RPC, (long) (V1_V2_MTU_SIZE - headerSize));
- } else if (version == 1){
- this.protocolVersion = new Version("1.0.0");
- headerSize = V1_HEADER_SIZE;
- mtus.put(SessionType.RPC, (long) (V1_V2_MTU_SIZE - headerSize));
- }
- }
-
- public void endSession(byte sessionID, int hashId) {
- SdlPacket header;
- if(protocolVersion.getMajor() < 5){
- header = SdlPacketFactory.createEndSession(SessionType.RPC, sessionID, hashId, (byte)protocolVersion.getMajor(), BitConverter.intToByteArray(hashId));
- }else{
- header = SdlPacketFactory.createEndSession(SessionType.RPC, sessionID, hashId, (byte)protocolVersion.getMajor(), new byte[0]);
- header.putTag(ControlFrameTags.RPC.EndService.HASH_ID, hashId);
- }
-
- handlePacketToSend(header);
-
- } // end-method
-
- public void sendPacket(SdlPacket packet){
- if(transportManager != null){
- transportManager.sendPacket(packet);
- }
- }
-
- public void sendMessage(ProtocolMessage protocolMsg) {
- protocolMsg.setRPCType((byte) 0x00); //always sending a request
- SessionType sessionType = protocolMsg.getSessionType();
- byte sessionID = protocolMsg.getSessionID();
-
- byte[] data;
- if (protocolVersion.getMajor() > 1 && sessionType != SessionType.NAV && sessionType != SessionType.PCM) {
- if (sessionType.eq(SessionType.CONTROL)) {
- final byte[] secureData = protocolMsg.getData().clone();
- data = new byte[headerSize + secureData.length];
-
- final BinaryFrameHeader binFrameHeader =
- SdlPacketFactory.createBinaryFrameHeader(protocolMsg.getRPCType(),protocolMsg.getFunctionID(), protocolMsg.getCorrID(), 0);
- System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, headerSize);
- System.arraycopy(secureData, 0, data, headerSize, secureData.length);
- }
- else if (protocolMsg.getBulkData() != null) {
- data = new byte[12 + protocolMsg.getJsonSize() + protocolMsg.getBulkData().length];
- sessionType = SessionType.BULK_DATA;
- } else {
- data = new byte[12 + protocolMsg.getJsonSize()];
- }
- if (!sessionType.eq(SessionType.CONTROL)) {
- BinaryFrameHeader binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(protocolMsg.getRPCType(), protocolMsg.getFunctionID(), protocolMsg.getCorrID(), protocolMsg.getJsonSize());
- System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
- System.arraycopy(protocolMsg.getData(), 0, data, 12, protocolMsg.getJsonSize());
- if (protocolMsg.getBulkData() != null) {
- System.arraycopy(protocolMsg.getBulkData(), 0, data, 12 + protocolMsg.getJsonSize(), protocolMsg.getBulkData().length);
- }
- }
- } else {
- data = protocolMsg.getData();
- }
-
- if (iSdlProtocol != null && protocolMsg.getPayloadProtected()){
-
- if (data != null && data.length > 0) {
- byte[] dataToRead = new byte[TLS_MAX_RECORD_SIZE];
- SdlSecurityBase sdlSec = iSdlProtocol.getSdlSecurity();
- if (sdlSec == null)
- return;
-
- Integer iNumBytes = sdlSec.encryptData(data, dataToRead);
- if ((iNumBytes == null) || (iNumBytes <= 0))
- return;
-
- byte[] encryptedData = new byte[iNumBytes];
- System.arraycopy(dataToRead, 0, encryptedData, 0, iNumBytes);
- data = encryptedData;
- }
- }
-
- // Get the message lock for this protocol session
- Object messageLock = _messageLocks.get(sessionID);
- if (messageLock == null) {
- handleProtocolError("Error sending protocol message to SDL.",
- new SdlException("Attempt to send protocol message prior to startSession ACK.", SdlExceptionCause.SDL_UNAVAILABLE));
- return;
- }
-
- synchronized(messageLock) {
- if (data.length > getMtu(sessionType)) {
-
- messageID++;
-
- // Assemble first frame.
- Long mtu = getMtu(sessionType);
- int frameCount = Long.valueOf(data.length / mtu).intValue();
- if (data.length % mtu > 0) {
- frameCount++;
- }
- byte[] firstFrameData = new byte[8];
- // First four bytes are data size.
- System.arraycopy(BitConverter.intToByteArray(data.length), 0, firstFrameData, 0, 4);
- // Second four bytes are frame count.
- System.arraycopy(BitConverter.intToByteArray(frameCount), 0, firstFrameData, 4, 4);
-
- SdlPacket firstHeader = SdlPacketFactory.createMultiSendDataFirst(sessionType, sessionID, messageID, (byte)protocolVersion.getMajor(),firstFrameData,protocolMsg.getPayloadProtected());
- firstHeader.setPriorityCoefficient(1+protocolMsg.priorityCoefficient);
- firstHeader.setTransportRecord(activeTransports.get(sessionType));
- //Send the first frame
- handlePacketToSend(firstHeader);
-
- int currentOffset = 0;
- byte frameSequenceNumber = 0;
-
- for (int i = 0; i < frameCount; i++) {
- if (i < (frameCount - 1)) {
- ++frameSequenceNumber;
- if (frameSequenceNumber ==
- SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME) {
- // we can't use 0x00 as frameSequenceNumber, because
- // it's reserved for the last frame
- ++frameSequenceNumber;
- }
- } else {
- frameSequenceNumber = SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME;
- } // end-if
-
- int bytesToWrite = data.length - currentOffset;
- if (bytesToWrite > mtu) {
- bytesToWrite = mtu.intValue();
- }
- SdlPacket consecHeader = SdlPacketFactory.createMultiSendDataRest(sessionType, sessionID, bytesToWrite, frameSequenceNumber , messageID, (byte)protocolVersion.getMajor(),data, currentOffset, bytesToWrite, protocolMsg.getPayloadProtected());
- consecHeader.setTransportRecord(activeTransports.get(sessionType));
- consecHeader.setPriorityCoefficient(i+2+protocolMsg.priorityCoefficient);
- handlePacketToSend(consecHeader);
- currentOffset += bytesToWrite;
- }
- } else {
- messageID++;
- SdlPacket header = SdlPacketFactory.createSingleSendData(sessionType, sessionID, data.length, messageID, (byte)protocolVersion.getMajor(),data, protocolMsg.getPayloadProtected());
- header.setPriorityCoefficient(protocolMsg.priorityCoefficient);
- header.setTransportRecord(activeTransports.get(sessionType));
- handlePacketToSend(header);
- }
- }
- }
-
- protected void handlePacketReceived(SdlPacket packet){
- //Check for a version difference
- if (protocolVersion == null || protocolVersion.getMajor() == 1) {
- setVersion((byte)packet.version);
- }
-
- MessageFrameAssembler assembler = getFrameAssemblerForFrame(packet);
- assembler.handleFrame(packet);
-
- }
-
-
- protected MessageFrameAssembler getFrameAssemblerForFrame(SdlPacket packet) {
- Integer iSessionId = packet.getSessionId();
- Byte bySessionId = iSessionId.byteValue();
-
- MessageFrameAssembler ret = _assemblerForMessageID.get(packet.getMessageId());
- if (ret == null) {
- ret = new MessageFrameAssembler();
- _assemblerForMessageID.put(packet.getMessageId(), ret);
- } // end-if
-
- return ret;
- } // end-method
-
-
-
- private void registerSecondaryTransport(byte sessionId, TransportRecord transportRecord) {
- SdlPacket header = SdlPacketFactory.createRegisterSecondaryTransport(sessionId, (byte)protocolVersion.getMajor());
- header.setTransportRecord(transportRecord);
- handlePacketToSend(header);
- }
-
- public void startService(SessionType serviceType, byte sessionID, boolean isEncrypted) {
- final SdlPacket header = SdlPacketFactory.createStartSession(serviceType, 0x00, (byte)protocolVersion.getMajor(), sessionID, isEncrypted);
- if(SessionType.RPC.equals(serviceType)){
- if(connectedPrimaryTransport != null) {
- header.setTransportRecord(connectedPrimaryTransport);
- }
- //This is going to be our primary transport
- header.putTag(ControlFrameTags.RPC.StartService.PROTOCOL_VERSION, MAX_PROTOCOL_VERSION.toString());
- handlePacketToSend(header);
- return; // We don't need to go any further
- }else if(serviceType.equals(SessionType.NAV)){
- if(iSdlProtocol != null){
- VideoStreamingParameters videoStreamingParameters = iSdlProtocol.getDesiredVideoParams();
- if(videoStreamingParameters != null) {
- ImageResolution desiredResolution = videoStreamingParameters.getResolution();
- VideoStreamingFormat desiredFormat = videoStreamingParameters.getFormat();
- if (desiredResolution != null) {
- header.putTag(ControlFrameTags.Video.StartService.WIDTH, desiredResolution.getResolutionWidth());
- header.putTag(ControlFrameTags.Video.StartService.HEIGHT, desiredResolution.getResolutionHeight());
- }
- if (desiredFormat != null) {
- header.putTag(ControlFrameTags.Video.StartService.VIDEO_CODEC, desiredFormat.getCodec().toString());
- header.putTag(ControlFrameTags.Video.StartService.VIDEO_PROTOCOL, desiredFormat.getProtocol().toString());
- }
- }
- }
- }
- if(transportPriorityForServiceMap == null
- || transportPriorityForServiceMap.get(serviceType) == null
- || transportPriorityForServiceMap.get(serviceType).isEmpty()){
- //If there is no transport priority for this service it can be assumed it's primary
- header.setTransportRecord(connectedPrimaryTransport);
- handlePacketToSend(header);
- return;
- }
- int transportPriority = transportPriorityForServiceMap.get(serviceType).get(0);
- if(transportPriority == PRIMARY_TRANSPORT_ID){
- // Primary is favored, and we're already connected...
- header.setTransportRecord(connectedPrimaryTransport);
- handlePacketToSend(header);
- }else if(transportPriority == SECONDARY_TRANSPORT_ID) {
- // Secondary is favored
- for(TransportType secondaryTransportType : supportedSecondaryTransports) {
-
- if(!requestedSecondaryTransports.contains(secondaryTransportType)){
- // Secondary transport is not accepted by the client
- continue;
- }
-
- if(activeTransports.get(serviceType) != null
- && activeTransports.get(serviceType).getType() !=null
- && activeTransports.get(serviceType).getType().equals(secondaryTransportType)){
- // Transport is already active and accepted
- header.setTransportRecord(activeTransports.get(serviceType));
- handlePacketToSend(header);
- return;
- }
-
-
-
- //If the secondary transport isn't connected yet that will have to be performed first
-
- List<ISecondaryTransportListener> listenerList = secondaryTransportListeners.get(secondaryTransportType);
- if(listenerList == null){
- listenerList = new ArrayList<>();
- secondaryTransportListeners.put(secondaryTransportType, listenerList);
- }
-
- //Check to see if the primary transport can also be used as a backup
- final boolean primaryTransportBackup = transportPriorityForServiceMap.get(serviceType).contains(PRIMARY_TRANSPORT_ID);
-
- ISecondaryTransportListener secondaryListener = new ISecondaryTransportListener() {
- @Override
- public void onConnectionSuccess(TransportRecord transportRecord) {
- header.setTransportRecord(transportRecord);
- handlePacketToSend(header);
- }
-
- @Override
- public void onConnectionFailure() {
- if(primaryTransportBackup) {
- // Primary is also supported as backup
- header.setTransportRecord(connectedPrimaryTransport);
- handlePacketToSend(header);
- }else{
- Log.d(TAG, "Failed to connect secondary transport, threw away StartService");
- }
- }
- };
-
- if(transportManager.isConnected(secondaryTransportType,null)){
- //The transport is actually connected, however no service has been registered
- listenerList.add(secondaryListener);
- registerSecondaryTransport(sessionID,transportManager.getTransportRecord(secondaryTransportType,null));
- }else if(secondaryTransportParams != null && secondaryTransportParams.containsKey(secondaryTransportType)) {
- //No acceptable secondary transport is connected, so first one must be connected
- header.setTransportRecord(new TransportRecord(secondaryTransportType,""));
- listenerList.add(secondaryListener);
- transportManager.requestSecondaryTransportConnection(sessionID,secondaryTransportParams.get(secondaryTransportType));
- }else{
- Log.w(TAG, "No params to connect to secondary transport");
- //Unable to register or start a secondary connection. Use the callback in case
- //there is a chance to use the primary transport for this service.
- secondaryListener.onConnectionFailure();
- }
-
- }
- }
- }
-
- private void sendHeartBeatACK(SessionType sessionType, byte sessionID) {
- final SdlPacket heartbeat = SdlPacketFactory.createHeartbeatACK(SessionType.CONTROL, sessionID, (byte)protocolVersion.getMajor());
- heartbeat.setTransportRecord(activeTransports.get(sessionType));
- handlePacketToSend(heartbeat);
- }
-
- public void endService(SessionType serviceType, byte sessionID) {
- if(serviceType.equals(SessionType.RPC)){ //RPC session will close all other sessions so we want to make sure we use the correct EndProtocolSession method
- endSession(sessionID,hashID);
- }else {
- SdlPacket header = SdlPacketFactory.createEndSession(serviceType, sessionID, hashID, (byte)protocolVersion.getMajor(), new byte[0]);
- TransportRecord transportRecord = activeTransports.get(serviceType);
- if(transportRecord != null){
- header.setTransportRecord(transportRecord);
- handlePacketToSend(header);
- }
- }
- }
-
- /* --------------------------------------------------------------------------------------------
- ----------------------------------- OLD ABSTRACT PROTOCOL ---------------------------------
- -------------------------------------------------------------------------------------------*/
-
-
- // This method is called whenever a protocol has an entire frame to send
- /**
- * SdlPacket should have included payload at this point.
- * @param packet packet that will be sent to the router service
- */
- protected void handlePacketToSend(SdlPacket packet) {
- synchronized(FRAME_LOCK) {
-
- if(packet!=null){
- iSdlProtocol.onProtocolMessageBytesToSend(packet);
- }
-
- }
- }
-
- /** This method handles the end of a protocol session. A callback is
- * sent to the protocol listener.
- **/
- protected void handleServiceEndedNAK(SdlPacket packet, SessionType serviceType) {
- if(packet.version >= 5){
- if(DebugTool.isDebugEnabled()) {
- //Currently this is only during a debugging session. Might pass back in the future
- String rejectedTag = null;
- if (serviceType.equals(SessionType.RPC)) {
- rejectedTag = ControlFrameTags.RPC.EndServiceNAK.REJECTED_PARAMS;
- } else if (serviceType.equals(SessionType.PCM)) {
- rejectedTag = ControlFrameTags.Audio.EndServiceNAK.REJECTED_PARAMS;
- } else if (serviceType.equals(SessionType.NAV)) {
- rejectedTag = ControlFrameTags.Video.EndServiceNAK.REJECTED_PARAMS;
- }
-
- List<String> rejectedParams = (List<String>) packet.getTag(rejectedTag);
- if(rejectedParams != null && rejectedParams.size() > 0){
- StringBuilder builder = new StringBuilder();
- builder.append("Rejected params for service type ");
- builder.append(serviceType.getName());
- builder.append(" :");
- for(String rejectedParam : rejectedParams){
- builder.append(rejectedParam);
- builder.append(" ");
- }
- DebugTool.logWarning(builder.toString());
- }
-
- }
- }
-
- iSdlProtocol.onProtocolSessionEndedNACKed(serviceType, (byte)packet.getSessionId(), "");
- }
-
- // This method handles the end of a protocol session. A callback is
- // sent to the protocol listener.
- protected void handleServiceEnded(SdlPacket packet, SessionType sessionType) {
-
- iSdlProtocol.onProtocolSessionEnded(sessionType, (byte)packet.getSessionId(), "");
-
- }
-
- /**
- * This method handles the startup of a protocol session. A callback is sent
- * to the protocol listener.
- * @param packet StarServiceACK packet
- * @param serviceType the service type that has just been started
- */
- protected void handleProtocolSessionStarted(SdlPacket packet, SessionType serviceType) {
- // Use this sessionID to create a message lock
- Object messageLock = _messageLocks.get((byte)packet.getSessionId());
- if (messageLock == null) {
- messageLock = new Object();
- _messageLocks.put((byte)packet.getSessionId(), messageLock);
- }
- if(packet.version >= 5){
- String mtuTag = null;
- if(serviceType.equals(SessionType.RPC)){
- mtuTag = ControlFrameTags.RPC.StartServiceACK.MTU;
- }else if(serviceType.equals(SessionType.PCM)){
- mtuTag = ControlFrameTags.Audio.StartServiceACK.MTU;
- }else if(serviceType.equals(SessionType.NAV)){
- mtuTag = ControlFrameTags.Video.StartServiceACK.MTU;
- }
- Object mtu = packet.getTag(mtuTag);
- if(mtu!=null){
- mtus.put(serviceType,(Long) packet.getTag(mtuTag));
- }
- if(serviceType.equals(SessionType.RPC)){
- hashID = (Integer) packet.getTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID);
- Object version = packet.getTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION);
-
- if(version!=null) {
- //At this point we have confirmed the negotiated version between the module and the proxy
- protocolVersion = new Version((String) version);
- }else{
- protocolVersion = new Version("5.0.0");
- }
-
- //Check to make sure this is a transport we are willing to accept
- TransportRecord transportRecord = packet.getTransportRecord();
-
- if(transportRecord == null || !requestedPrimaryTransports.contains(transportRecord.getType())){
- onTransportNotAccepted("Transport is not in requested primary transports");
- return;
- }
-
-
- // This enables custom behavior based on protocol version specifics
- if (protocolVersion.isNewerThan(new Version("5.1.0")) >= 0) {
-
- if (activeTransports.get(SessionType.RPC) == null) { //Might be a better way to handle this
-
- ArrayList<String> secondary = (ArrayList<String>) packet.getTag(ControlFrameTags.RPC.StartServiceACK.SECONDARY_TRANSPORTS);
- ArrayList<Integer> audio = (ArrayList<Integer>) packet.getTag(ControlFrameTags.RPC.StartServiceACK.AUDIO_SERVICE_TRANSPORTS);
- ArrayList<Integer> video = (ArrayList<Integer>) packet.getTag(ControlFrameTags.RPC.StartServiceACK.VIDEO_SERVICE_TRANSPORTS);
-
- activeTransports.put(SessionType.RPC, transportRecord);
- activeTransports.put(SessionType.BULK_DATA, transportRecord);
- activeTransports.put(SessionType.CONTROL, transportRecord);
-
- //Build out the supported secondary transports received from the
- // RPC start service ACK.
- supportedSecondaryTransports = new ArrayList<>();
- if (secondary == null) {
- // If no secondary transports were attached we should assume
- // the Video and Audio services can be used on primary
- if (requiresHighBandwidth
- && TransportType.BLUETOOTH.equals(transportRecord.getType())) {
- //transport can't support high bandwidth
- onTransportNotAccepted(transportRecord.getType() + " can't support high bandwidth requirement, and secondary transport not supported.");
- return;
- }
-
- if (video == null || video.contains(PRIMARY_TRANSPORT_ID)) {
- activeTransports.put(SessionType.NAV, transportRecord);
- }
- if (audio == null || audio.contains(PRIMARY_TRANSPORT_ID)) {
- activeTransports.put(SessionType.PCM, transportRecord);
- }
- }else{
-
- if(DebugTool.isDebugEnabled()){
- printSecondaryTransportDetails(secondary,audio,video);
- }
- for (String s : secondary) {
- switch (s) {
- case TransportConstants.TCP_WIFI:
- supportedSecondaryTransports.add(TransportType.TCP);
- break;
- case TransportConstants.AOA_USB:
- supportedSecondaryTransports.add(TransportType.USB);
- break;
- case TransportConstants.SPP_BLUETOOTH:
- supportedSecondaryTransports.add(TransportType.BLUETOOTH);
- break;
- }
- }
- }
-
- setTransportPriorityForService(SessionType.PCM, audio);
- setTransportPriorityForService(SessionType.NAV, video);
-
- //Update the developer on the transport status
- notifyDevTransportListener();
-
- } else {
- Log.w(TAG, "Received a start service ack for RPC service while already active on a different transport.");
- return;
- }
- }else {
-
- //Version is either not included or lower than 5.1.0
- if (requiresHighBandwidth
- && TransportType.BLUETOOTH.equals(transportRecord.getType())) {
- //transport can't support high bandwidth
- onTransportNotAccepted(transportRecord.getType() + " can't support high bandwidth requirement, and secondary transport not supported in this protocol version: " + version);
- return;
- }
-
- activeTransports.put(SessionType.RPC, transportRecord);
- activeTransports.put(SessionType.BULK_DATA, transportRecord);
- activeTransports.put(SessionType.CONTROL, transportRecord);
- activeTransports.put(SessionType.NAV, transportRecord);
- activeTransports.put(SessionType.PCM, transportRecord);
-
- //Inform the developer of the initial transport connection
- notifyDevTransportListener();
- }
-
-
- }else if(serviceType.equals(SessionType.NAV)){
- if(iSdlProtocol != null) {
- ImageResolution acceptedResolution = new ImageResolution();
- VideoStreamingFormat acceptedFormat = new VideoStreamingFormat();
- acceptedResolution.setResolutionHeight((Integer) packet.getTag(ControlFrameTags.Video.StartServiceACK.HEIGHT));
- acceptedResolution.setResolutionWidth((Integer) packet.getTag(ControlFrameTags.Video.StartServiceACK.WIDTH));
- acceptedFormat.setCodec(VideoStreamingCodec.valueForString((String) packet.getTag(ControlFrameTags.Video.StartServiceACK.VIDEO_CODEC)));
- acceptedFormat.setProtocol(VideoStreamingProtocol.valueForString((String) packet.getTag(ControlFrameTags.Video.StartServiceACK.VIDEO_PROTOCOL)));
- VideoStreamingParameters agreedVideoParams = iSdlProtocol.getDesiredVideoParams();
- agreedVideoParams.setResolution(acceptedResolution);
- agreedVideoParams.setFormat(acceptedFormat);
- iSdlProtocol.setAcceptedVideoParams(agreedVideoParams);
- }
- }
- } else {
- TransportRecord transportRecord = packet.getTransportRecord();
- if(transportRecord == null || (requiresHighBandwidth
- && TransportType.BLUETOOTH.equals(transportRecord.getType()))){
- //transport can't support high bandwidth
- onTransportNotAccepted((transportRecord != null ? transportRecord.getType().toString() : "Transport") + "can't support high bandwidth requirement, and secondary transport not supported in this protocol version");
- return;
- }
- //If version < 5 and transport is acceptable we need to just add these
- activeTransports.put(SessionType.RPC, transportRecord);
- activeTransports.put(SessionType.BULK_DATA, transportRecord);
- activeTransports.put(SessionType.CONTROL, transportRecord);
- activeTransports.put(SessionType.NAV, transportRecord);
- activeTransports.put(SessionType.PCM, transportRecord);
-
- if (protocolVersion.getMajor() > 1){
- if (packet.payload!= null && packet.dataSize == 4){ //hashid will be 4 bytes in length
- hashID = BitConverter.intFromByteArray(packet.payload, 0);
- }
- }
- }
-
- iSdlProtocol.onProtocolSessionStarted(serviceType, (byte) packet.getSessionId(), (byte)protocolVersion.getMajor(), "", hashID, packet.isEncrypted());
- }
-
- protected void handleProtocolSessionNAKed(SdlPacket packet, SessionType serviceType) {
- List<String> rejectedParams = null;
- if(packet.version >= 5){
- if(DebugTool.isDebugEnabled()) {
- //Currently this is only during a debugging session. Might pass back in the future
- String rejectedTag = null;
- if (serviceType.equals(SessionType.RPC)) {
- rejectedTag = ControlFrameTags.RPC.StartServiceNAK.REJECTED_PARAMS;
- } else if (serviceType.equals(SessionType.PCM)) {
- rejectedTag = ControlFrameTags.Audio.StartServiceNAK.REJECTED_PARAMS;
- } else if (serviceType.equals(SessionType.NAV)) {
- rejectedTag = ControlFrameTags.Video.StartServiceNAK.REJECTED_PARAMS;
- }
-
- rejectedParams = (List<String>) packet.getTag(rejectedTag);
- if(rejectedParams != null && rejectedParams.size() > 0){
- StringBuilder builder = new StringBuilder();
- builder.append("Rejected params for service type ");
- builder.append(serviceType.getName());
- builder.append(" :");
- for(String rejectedParam : rejectedParams){
- builder.append(rejectedParam);
- builder.append(" ");
- }
- DebugTool.logWarning(builder.toString());
- }
-
- }
- }
- if (serviceType.eq(SessionType.NAV) || serviceType.eq(SessionType.PCM)) {
- iSdlProtocol.onProtocolSessionNACKed(serviceType, (byte)packet.sessionId, (byte)protocolVersion.getMajor(), "", rejectedParams);
-
- } else {
- handleProtocolError("Got StartSessionNACK for protocol sessionID = " + packet.getSessionId(), null);
- }
- }
-
- // This method handles protocol errors. A callback is sent to the protocol
- // listener.
- protected void handleProtocolError(String string, Exception ex) {
- iSdlProtocol.onProtocolError(string, ex);
- }
-
- protected void handleProtocolHeartbeat(SessionType sessionType, byte sessionID) {
- sendHeartBeatACK(sessionType,sessionID);
- }
-
- protected void handleServiceDataACK(SdlPacket packet, SessionType sessionType) {
-
- if (packet.getPayload() != null && packet.getDataSize() == 4){ //service data ack will be 4 bytes in length
- int serviceDataAckSize = BitConverter.intFromByteArray(packet.getPayload(), 0);
- iSdlProtocol.onProtocolServiceDataACK(sessionType, serviceDataAckSize, (byte)packet.getSessionId ());
-
- }
- }
-
- /* --------------------------------------------------------------------------------------------
- ----------------------------------- TRANSPORT_TYPE LISTENER ---------------------------------
- -------------------------------------------------------------------------------------------*/
-
- @SuppressWarnings("FieldCanBeLocal")
- private final TransportManager.TransportEventListener transportEventListener = new TransportManager.TransportEventListener() {
- private boolean requestedSession = false;
-
- @Override
- public void onPacketReceived(SdlPacket packet) {
- handlePacketReceived(packet);
- }
-
- @Override
- public void onTransportConnected(List<TransportRecord> connectedTransports) {
- Log.d(TAG, "onTransportConnected");
- //In the future we should move this logic into the Protocol Layer
- TransportRecord transportRecord = getTransportForSession(SessionType.RPC);
- if(transportRecord == null && !requestedSession){ //There is currently no transport registered
- requestedSession = true;
- transportManager.requestNewSession(getPreferredTransport(requestedPrimaryTransports,connectedTransports));
- }
- onTransportsConnectedUpdate(connectedTransports);
- if(DebugTool.isDebugEnabled()){
- printActiveTransports();
- }
- }
-
- @Override
- public void onTransportDisconnected(String info, TransportRecord disconnectedTransport, List<TransportRecord> connectedTransports) {
- if (disconnectedTransport == null) {
- Log.d(TAG, "onTransportDisconnected");
- transportManager.close(iSdlProtocol.getSessionId());
- iSdlProtocol.shutdown("No transports left connected");
- return;
- } else {
- Log.d(TAG, "onTransportDisconnected - " + disconnectedTransport.getType().name());
- }
-
- //In the future we will actually compare the record but at this point we can assume only
- //a single transport record per transport.
- //TransportType type = disconnectedTransport.getType();
- if(disconnectedTransport.equals(getTransportForSession(SessionType.NAV))){
- //stopVideoStream();
- iSdlProtocol.stopStream(SessionType.NAV);
- activeTransports.remove(SessionType.NAV);
- }
- if(disconnectedTransport.equals(getTransportForSession(SessionType.PCM))){
- //stopAudioStream();
- iSdlProtocol.stopStream(SessionType.PCM);
- activeTransports.remove(SessionType.PCM);
- }
-
- if(disconnectedTransport.equals(getTransportForSession(SessionType.RPC))){
- //transportTypes.remove(type);
- boolean primaryTransportAvailable = false;
- if(requestedPrimaryTransports != null && requestedPrimaryTransports.size() > 1){
- for (TransportType transportType: requestedPrimaryTransports){ Log.d(TAG, "Checking " + transportType.name());
- if(!disconnectedTransport.getType().equals(transportType)
- && transportManager != null
- && transportManager.isConnected(transportType,null)){
- primaryTransportAvailable = true;
- ( transportConfig).setService(transportManager.getRouterService());
- break;
- }
- }
- }
- transportManager.close(iSdlProtocol.getSessionId());
- transportManager = null;
- requestedSession = false;
-
- activeTransports.clear();
-
- iSdlProtocol.onTransportDisconnected(info, primaryTransportAvailable, transportConfig);
-
- } //else Transport was not primary, continuing to stay connected
-
- //Update the developer since a transport just disconnected
- notifyDevTransportListener();
-
- }
-
- @Override
- public void onError(String info) {
- iSdlProtocol.shutdown(info);
-
- }
-
- @Override
- public boolean onLegacyModeEnabled(String info) {
- //Await a connection from the legacy transport
- if(requestedPrimaryTransports!= null && requestedPrimaryTransports.contains(TransportType.BLUETOOTH)
- && !transportConfig.requiresHighBandwidth()){
- Log.d(TAG, "Entering legacy mode; creating new protocol instance");
- reset();
- return true;
- }else{
- Log.d(TAG, "Bluetooth is not an acceptable transport; not moving to legacy mode");
- return false;
- }
- }
- };
-
-/* -------------------------------------------------------------------------------------------------
------------------------------------ Internal Classes ------------------------------------------
---------------------------------------------------------------------------------------------------*/
-
-
- protected class MessageFrameAssembler {
- protected ByteArrayOutputStream accumulator = null;
- protected int totalSize = 0;
-
- protected void handleFirstDataFrame(SdlPacket packet) {
- //The message is new, so let's figure out how big it is.
- totalSize = BitConverter.intFromByteArray(packet.payload, 0) - headerSize;
- try {
- accumulator = new ByteArrayOutputStream(totalSize);
- }catch(OutOfMemoryError e){
- DebugTool.logError("OutOfMemory error", e); //Garbled bits were received
- accumulator = null;
- }
- }
-
- protected void handleRemainingFrame(SdlPacket packet) {
- accumulator.write(packet.payload, 0, (int)packet.getDataSize());
- notifyIfFinished(packet);
- }
-
- protected void notifyIfFinished(SdlPacket packet) {
- if (packet.getFrameType() == FrameType.Consecutive && packet.getFrameInfo() == 0x0) {
- ProtocolMessage message = new ProtocolMessage();
- message.setPayloadProtected(packet.isEncrypted());
- message.setSessionType(SessionType.valueOf((byte)packet.getServiceType()));
- message.setSessionID((byte)packet.getSessionId());
- //If it is WiPro 2.0 it must have binary header
- if (protocolVersion.getMajor() > 1) {
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
- parseBinaryHeader(accumulator.toByteArray());
- if(binFrameHeader == null) {
- return;
- }
- message.setVersion((byte)protocolVersion.getMajor());
- message.setRPCType(binFrameHeader.getRPCType());
- message.setFunctionID(binFrameHeader.getFunctionID());
- message.setCorrID(binFrameHeader.getCorrID());
- if (binFrameHeader.getJsonSize() > 0) message.setData(binFrameHeader.getJsonData());
- if (binFrameHeader.getBulkData() != null) message.setBulkData(binFrameHeader.getBulkData());
- } else{
- message.setData(accumulator.toByteArray());
- }
-
- _assemblerForMessageID.remove(packet.getMessageId());
-
- try {
- iSdlProtocol.onProtocolMessageReceived(message);
- } catch (Exception excp) {
- DebugTool.logError(FailurePropagating_Msg + "onProtocolMessageReceived: " + excp.toString(), excp);
- } // end-catch
-
- accumulator = null;
- } // end-if
- } // end-method
-
- protected void handleMultiFrameMessageFrame(SdlPacket packet) {
- if (packet.getFrameType() == FrameType.First) {
- handleFirstDataFrame(packet);
- }
- else{
- if(accumulator != null){
- handleRemainingFrame(packet);
- }
- }
-
- } // end-method
-
- protected void handleFrame(SdlPacket packet) {
-
- if (packet.getPayload() != null && packet.getDataSize() > 0 && packet.isEncrypted() ) {
-
- SdlSecurityBase sdlSec = iSdlProtocol.getSdlSecurity();
- byte[] dataToRead = new byte[4096];
-
- Integer iNumBytes = sdlSec.decryptData(packet.getPayload(), dataToRead);
- if ((iNumBytes == null) || (iNumBytes <= 0)){
- return;
- }
-
- byte[] decryptedData = new byte[iNumBytes];
- System.arraycopy(dataToRead, 0, decryptedData, 0, iNumBytes);
- packet.payload = decryptedData;
- }
-
- if (packet.getFrameType().equals(FrameType.Control)) {
- handleControlFrame(packet);
- } else {
- // Must be a form of data frame (single, first, consecutive, etc.)
- if ( packet.getFrameType() == FrameType.First
- || packet.getFrameType() == FrameType.Consecutive
- ) {
- handleMultiFrameMessageFrame(packet);
- } else {
- handleSingleFrameMessageFrame(packet);
- }
- }
- }
-
- private void handleProtocolHeartbeatACK(SdlPacket packet) {
- //Heartbeat is not supported in the SdlProtocol class beyond responding with ACKs to
- //heartbeat messages. Receiving this ACK is suspicious and should be logged
- DebugTool.logInfo("Received HeartbeatACK - " + packet.toString());
- }
-
- private void handleProtocolHeartbeat(SdlPacket packet) {
- SdlProtocol.this.handleProtocolHeartbeat(SessionType.valueOf((byte)packet.getServiceType()),(byte)packet.getSessionId());
- }
-
- /**
- * Directing method that will push the packet to the method that can handle it best
- * @param packet a control frame packet
- */
- private void handleControlFrame(SdlPacket packet) {
- Integer frameTemp = packet.getFrameInfo();
- Byte frameInfo = frameTemp.byteValue();
-
- SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
-
- if (frameInfo == FrameDataControlFrameType.Heartbeat.getValue()) {
-
- handleProtocolHeartbeat(packet);
-
- }else if (frameInfo == FrameDataControlFrameType.HeartbeatACK.getValue()) {
-
- handleProtocolHeartbeatACK(packet);
-
- }else if (frameInfo == FrameDataControlFrameType.StartSessionACK.getValue()) {
-
- handleProtocolSessionStarted(packet, serviceType);
-
- } else if (frameInfo == FrameDataControlFrameType.StartSessionNACK.getValue()) {
-
- handleProtocolSessionNAKed(packet, serviceType);
-
- } else if (frameInfo == FrameDataControlFrameType.EndSession.getValue()
- || frameInfo == FrameDataControlFrameType.EndSessionACK.getValue()) {
-
- handleServiceEnded(packet,serviceType);
-
- } else if (frameInfo == FrameDataControlFrameType.EndSessionNACK.getValue()) {
-
- handleServiceEndedNAK(packet, serviceType);
-
- } else if (frameInfo == FrameDataControlFrameType.ServiceDataACK.getValue()) {
-
- handleServiceDataACK(packet, serviceType);
-
- } else if (frameInfo == FrameDataControlFrameType.RegisterSecondaryTransportACK.getValue()) {
-
- handleSecondaryTransportRegistration(packet.getTransportRecord(),true);
-
- } else if (frameInfo == FrameDataControlFrameType.RegisterSecondaryTransportNACK.getValue()) {
-
- String reason = (String) packet.getTag(ControlFrameTags.RPC.RegisterSecondaryTransportNAK.REASON);
- DebugTool.logWarning(reason);
- handleSecondaryTransportRegistration(packet.getTransportRecord(),false);
-
- } else if (frameInfo == FrameDataControlFrameType.TransportEventUpdate.getValue()) {
-
- // Get TCP params
- String ipAddr = (String) packet.getTag(ControlFrameTags.RPC.TransportEventUpdate.TCP_IP_ADDRESS);
- Integer port = (Integer) packet.getTag(ControlFrameTags.RPC.TransportEventUpdate.TCP_PORT);
-
- if(secondaryTransportParams == null){
- secondaryTransportParams = new HashMap<>();
- }
-
- if(ipAddr != null && port != null) {
- Bundle bundle = new Bundle();
- bundle.putString(ControlFrameTags.RPC.TransportEventUpdate.TCP_IP_ADDRESS, ipAddr);
- bundle.putInt(ControlFrameTags.RPC.TransportEventUpdate.TCP_PORT, port);
- bundle.putString(TransportConstants.TRANSPORT_TYPE, TransportType.TCP.name());
- secondaryTransportParams.put(TransportType.TCP, bundle);
-
- //A new secondary transport just became available. Notify the developer.
- notifyDevTransportListener();
- }
-
- }
-
- _assemblerForMessageID.remove(packet.getMessageId());
-
- } // end-method
-
- private void handleSingleFrameMessageFrame(SdlPacket packet) {
- ProtocolMessage message = new ProtocolMessage();
- message.setPayloadProtected(packet.isEncrypted());
- SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
- if (serviceType == SessionType.RPC) {
- message.setMessageType(MessageType.RPC);
- } else if (serviceType == SessionType.BULK_DATA) {
- message.setMessageType(MessageType.BULK);
- } // end-if
- message.setSessionType(serviceType);
- message.setSessionID((byte)packet.getSessionId());
- //If it is WiPro 2.0 it must have binary header
- boolean isControlService = message.getSessionType().equals(SessionType.CONTROL);
- if (protocolVersion.getMajor() > 1 && !isControlService) {
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
- parseBinaryHeader(packet.payload);
- if(binFrameHeader == null) {
- return;
- }
- message.setVersion((byte)protocolVersion.getMajor());
- message.setRPCType(binFrameHeader.getRPCType());
- message.setFunctionID(binFrameHeader.getFunctionID());
- message.setCorrID(binFrameHeader.getCorrID());
- if (binFrameHeader.getJsonSize() > 0){
- message.setData(binFrameHeader.getJsonData());
- }
- if (binFrameHeader.getBulkData() != null){
- message.setBulkData(binFrameHeader.getBulkData());
- }
- } else {
- message.setData(packet.payload);
- }
-
- _assemblerForMessageID.remove(packet.getMessageId());
-
- try {
- iSdlProtocol.onProtocolMessageReceived(message);
- } catch (Exception ex) {
- DebugTool.logError(FailurePropagating_Msg + "onProtocolMessageReceived: " + ex.toString(), ex);
- handleProtocolError(FailurePropagating_Msg + "onProtocolMessageReceived: ", ex);
- } // end-catch
- } // end-method
- } // end-class
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java
deleted file mode 100644
index 73fbcffba..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java
+++ /dev/null
@@ -1,660 +0,0 @@
-package com.smartdevicelink.protocol;
-
-import com.smartdevicelink.SdlConnection.SdlConnection;
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.protocol.enums.ControlFrameTags;
-import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
-import com.smartdevicelink.protocol.enums.FrameType;
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.rpc.ImageResolution;
-import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-import com.smartdevicelink.security.SdlSecurityBase;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-import com.smartdevicelink.util.BitConverter;
-import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.Version;
-
-import java.io.ByteArrayOutputStream;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * @see SdlProtocol
- */
-@Deprecated
-public class WiProProtocol extends AbstractProtocol {
- private final static String FailurePropagating_Msg = "Failure propagating ";
- //If increasing MAX PROTOCOL VERSION major version, make sure to alter it in SdlPsm
- public static final Version MAX_PROTOCOL_VERSION = new Version("5.0.0");
- private Version protocolVersion = new Version("1.0.0");
- byte _version = 1;
-
- public static final int V1_V2_MTU_SIZE = 1500;
- public static final int V3_V4_MTU_SIZE = 131072;
- public static final int V1_HEADER_SIZE = 8;
- public static final int V2_HEADER_SIZE = 12;
- private static int HEADER_SIZE = 8;
- private static int TLS_MAX_RECORD_SIZE = 16384;
-
- int hashID = 0;
- int messageID = 0;
- SdlConnection sdlconn = null;
-
- @SuppressWarnings("unused")
- private int _heartbeatSendInterval_ms = 0;
- @SuppressWarnings("unused")
- private int _heartbeatReceiveInterval_ms = 0;
-
- Hashtable<Integer, MessageFrameAssembler> _assemblerForMessageID = new Hashtable<Integer, MessageFrameAssembler>();
- Hashtable<Byte, Hashtable<Integer, MessageFrameAssembler>> _assemblerForSessionID = new Hashtable<Byte, Hashtable<Integer, MessageFrameAssembler>>();
- Hashtable<Byte, Object> _messageLocks = new Hashtable<Byte, Object>();
- private HashMap<SessionType, Long> mtus = new HashMap<SessionType,Long>();
-
- // Hide no-arg ctor
- private WiProProtocol() {
- super(null);
- } // end-ctor
-
-
- public WiProProtocol(IProtocolListener protocolListener) {
- super(protocolListener);
-
- if (protocolListener instanceof SdlConnection)
- {
- sdlconn = (SdlConnection) protocolListener;
- }
- mtus.put(SessionType.RPC, new Long(V1_V2_MTU_SIZE - HEADER_SIZE));
- } // end-ctor
-
- /**
- * Retrieves the max payload size for a packet to be sent to the module
- * @return the max transfer unit
- */
- public int getMtu(){
- return mtus.get(SessionType.RPC).intValue();
- }
-
- public long getMtu(SessionType type){
- Long mtu = mtus.get(type);
- if(mtu == null){
- mtu = mtus.get(SessionType.RPC);
- }
- return mtu;
- }
-
-
- /**
- * Use getProtocolVersion() or getMajorVersionByte instead.<br>
- * Returns the Major version of the currently used protocol version
- */
- @Deprecated
- public byte getVersion() {
- return getMajorVersionByte();
- }
-
- public Version getProtocolVersion(){
- return this.protocolVersion;
- }
- public byte getMajorVersionByte(){
- if(_version == 1){
- _version = new Integer(this.protocolVersion.getMajor()).byteValue();
- }
- return _version;
-
- }
-
- /**
- * This method will set the major protocol version that we should use. It will also set the default MTU based on version.
- * @param version
- */
- public void setVersion(byte version) {
- if (version > 5) {
- this.protocolVersion = new Version("5.0.0"); //protect for future, proxy only supports v5 or lower
- HEADER_SIZE = 12;
- mtus.put(SessionType.RPC,new Long(V3_V4_MTU_SIZE) );
- } else if (version == 5) {
- this.protocolVersion = new Version("5.0.0");
- HEADER_SIZE = 12;
- mtus.put(SessionType.RPC,new Long(V3_V4_MTU_SIZE) );
- }else if (version == 4) {
- this.protocolVersion = new Version("4.0.0");
- HEADER_SIZE = 12;
- mtus.put(SessionType.RPC,new Long(V3_V4_MTU_SIZE) ); //versions 4 supports 128k MTU
- } else if (version == 3) {
- this.protocolVersion = new Version("3.0.0");
- HEADER_SIZE = 12;
- mtus.put(SessionType.RPC,new Long(V3_V4_MTU_SIZE) ); //versions 3 supports 128k MTU
- } else if (version == 2) {
- this.protocolVersion = new Version("2.0.0");
- HEADER_SIZE = 12;
- mtus.put(SessionType.RPC,new Long(V1_V2_MTU_SIZE - HEADER_SIZE) );
- } else if (version == 1){
- this.protocolVersion = new Version("1.0.0");
- HEADER_SIZE = 8;
- mtus.put(SessionType.RPC,new Long(V1_V2_MTU_SIZE - HEADER_SIZE) );
- }
- }
-
- public void StartProtocolSession(SessionType sessionType) {
- SdlPacket header = SdlPacketFactory.createStartSession(sessionType, 0x00, getMajorVersionByte(), (byte) 0x00, false);
- if(sessionType.equals(SessionType.RPC)){ // check for RPC session
- header.putTag(ControlFrameTags.RPC.StartService.PROTOCOL_VERSION, MAX_PROTOCOL_VERSION.toString());
- }
- handlePacketToSend(header);
- } // end-method
-
- private void sendStartProtocolSessionACK(SessionType sessionType, byte sessionID) {
- SdlPacket header = SdlPacketFactory.createStartSessionACK(sessionType, sessionID, 0x00, getMajorVersionByte());
- handlePacketToSend(header);
- } // end-method
-
- public void EndProtocolSession(SessionType sessionType, byte sessionID, int hashId) {
- SdlPacket header;
- if (sessionType.equals(SessionType.RPC)) { // check for RPC session
- if(_version < 5){
- header = SdlPacketFactory.createEndSession(sessionType, sessionID, hashID, getMajorVersionByte(), BitConverter.intToByteArray(hashID));
- }else{
- header = SdlPacketFactory.createEndSession(sessionType, sessionID, hashID, getMajorVersionByte(), new byte[0]);
- header.putTag(ControlFrameTags.RPC.EndService.HASH_ID, hashID);
- }
- }else{ //Any other service type we don't include the hash id
- header = SdlPacketFactory.createEndSession(sessionType, sessionID, hashID, getMajorVersionByte(), new byte[0]);
- }
- handlePacketToSend(header);
-
- } // end-method
-
- public void SendMessage(ProtocolMessage protocolMsg) {
- protocolMsg.setRPCType((byte) 0x00); //always sending a request
- SessionType sessionType = protocolMsg.getSessionType();
- byte sessionID = protocolMsg.getSessionID();
-
- byte[] data = null;
- if (protocolVersion.getMajor() > 1 && sessionType != SessionType.NAV && sessionType != SessionType.PCM) {
- if (sessionType.eq(SessionType.CONTROL)) {
- final byte[] secureData = protocolMsg.getData().clone();
- data = new byte[HEADER_SIZE + secureData.length];
-
- final BinaryFrameHeader binFrameHeader =
- SdlPacketFactory.createBinaryFrameHeader(protocolMsg.getRPCType(),protocolMsg.getFunctionID(), protocolMsg.getCorrID(), 0);
- System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, HEADER_SIZE);
- System.arraycopy(secureData, 0, data,HEADER_SIZE, secureData.length);
- }
- else if (protocolMsg.getBulkData() != null) {
- data = new byte[12 + protocolMsg.getJsonSize() + protocolMsg.getBulkData().length];
- sessionType = SessionType.BULK_DATA;
- } else {
- data = new byte[12 + protocolMsg.getJsonSize()];
- }
- if (!sessionType.eq(SessionType.CONTROL)) {
- BinaryFrameHeader binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(protocolMsg.getRPCType(), protocolMsg.getFunctionID(), protocolMsg.getCorrID(), protocolMsg.getJsonSize());
- System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
- System.arraycopy(protocolMsg.getData(), 0, data, 12, protocolMsg.getJsonSize());
- if (protocolMsg.getBulkData() != null) {
- System.arraycopy(protocolMsg.getBulkData(), 0, data, 12 + protocolMsg.getJsonSize(), protocolMsg.getBulkData().length);
- }
- }
- } else {
- data = protocolMsg.getData();
- }
-
- if (sdlconn != null && protocolMsg.getPayloadProtected())
- {
- if (data != null && data.length > 0) {
- SdlSession session = sdlconn.findSessionById(sessionID);
-
- if (session == null)
- return;
-
- byte[] dataToRead = new byte[TLS_MAX_RECORD_SIZE];
- SdlSecurityBase sdlSec = session.getSdlSecurity();
- if (sdlSec == null)
- return;
-
- Integer iNumBytes = sdlSec.encryptData(data, dataToRead);
- if ((iNumBytes == null) || (iNumBytes <= 0))
- return;
-
- byte[] encryptedData = new byte[iNumBytes];
- System.arraycopy(dataToRead, 0, encryptedData, 0, iNumBytes);
- data = encryptedData;
- }
- }
-
- // Get the message lock for this protocol session
- Object messageLock = _messageLocks.get(sessionID);
- if (messageLock == null) {
- handleProtocolError("Error sending protocol message to SDL.",
- new SdlException("Attempt to send protocol message prior to startSession ACK.", SdlExceptionCause.SDL_UNAVAILABLE));
- return;
- }
-
- synchronized(messageLock) {
- if (data.length > getMtu(sessionType)) {
-
- messageID++;
-
- // Assemble first frame.
- Long mtu = getMtu(sessionType);
- int frameCount = new Long(data.length / mtu).intValue();
- if (data.length % mtu > 0) {
- frameCount++;
- }
- //byte[] firstFrameData = new byte[HEADER_SIZE];
- byte[] firstFrameData = new byte[8];
- // First four bytes are data size.
- System.arraycopy(BitConverter.intToByteArray(data.length), 0, firstFrameData, 0, 4);
- // Second four bytes are frame count.
- System.arraycopy(BitConverter.intToByteArray(frameCount), 0, firstFrameData, 4, 4);
-
- SdlPacket firstHeader = SdlPacketFactory.createMultiSendDataFirst(sessionType, sessionID, messageID, getMajorVersionByte(),firstFrameData,protocolMsg.getPayloadProtected());
- firstHeader.setPriorityCoefficient(1+protocolMsg.priorityCoefficient);
- //Send the first frame
- handlePacketToSend(firstHeader);
-
- int currentOffset = 0;
- byte frameSequenceNumber = 0;
-
- for (int i = 0; i < frameCount; i++) {
- if (i < (frameCount - 1)) {
- ++frameSequenceNumber;
- if (frameSequenceNumber ==
- SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME) {
- // we can't use 0x00 as frameSequenceNumber, because
- // it's reserved for the last frame
- ++frameSequenceNumber;
- }
- } else {
- frameSequenceNumber = SdlPacket.FRAME_INFO_FINAL_CONNESCUTIVE_FRAME;
- } // end-if
-
- int bytesToWrite = data.length - currentOffset;
- if (bytesToWrite > mtu) {
- bytesToWrite = mtu.intValue();
- }
- SdlPacket consecHeader = SdlPacketFactory.createMultiSendDataRest(sessionType, sessionID, bytesToWrite, frameSequenceNumber , messageID, getMajorVersionByte(),data, currentOffset, bytesToWrite, protocolMsg.getPayloadProtected());
- consecHeader.setPriorityCoefficient(i+2+protocolMsg.priorityCoefficient);
- handlePacketToSend(consecHeader);
- currentOffset += bytesToWrite;
- }
- } else {
- messageID++;
- SdlPacket header = SdlPacketFactory.createSingleSendData(sessionType, sessionID, data.length, messageID, getMajorVersionByte(),data, protocolMsg.getPayloadProtected());
- header.setPriorityCoefficient(protocolMsg.priorityCoefficient);
- handlePacketToSend(header);
- }
- }
- }
-
- public void handlePacketReceived(SdlPacket packet){
- //Check for a version difference
- if (getMajorVersionByte() == 1) {
- setVersion((byte)packet.version);
- }
-
- MessageFrameAssembler assembler = getFrameAssemblerForFrame(packet);
- assembler.handleFrame(packet);
-
- onResetIncomingHeartbeat(SessionType.valueOf((byte)packet.getServiceType()), (byte)packet.getSessionId());
-
- }
-
-
-
- protected MessageFrameAssembler getFrameAssemblerForFrame(SdlPacket packet) {
- Integer iSessionId = Integer.valueOf(packet.getSessionId());
- Byte bySessionId = iSessionId.byteValue();
-
- Hashtable<Integer, MessageFrameAssembler> hashSessionID = _assemblerForSessionID.get(bySessionId);
- if (hashSessionID == null) {
- hashSessionID = new Hashtable<Integer, MessageFrameAssembler>();
- _assemblerForSessionID.put(bySessionId, hashSessionID);
- } // end-if
-
- MessageFrameAssembler ret = (MessageFrameAssembler) _assemblerForMessageID.get(Integer.valueOf(packet.getMessageId()));
- if (ret == null) {
- ret = new MessageFrameAssembler();
- _assemblerForMessageID.put(Integer.valueOf(packet.getMessageId()), ret);
- } // end-if
-
- return ret;
- } // end-method
-
- protected class MessageFrameAssembler {
- protected boolean hasFirstFrame = false;
- protected ByteArrayOutputStream accumulator = null;
- protected int totalSize = 0;
- protected int framesRemaining = 0;
-
- protected void handleFirstDataFrame(SdlPacket packet) {
- //The message is new, so let's figure out how big it is.
- hasFirstFrame = true;
- totalSize = BitConverter.intFromByteArray(packet.payload, 0) - HEADER_SIZE;
- framesRemaining = BitConverter.intFromByteArray(packet.payload, 4);
- try {
- accumulator = new ByteArrayOutputStream(totalSize);
- }catch(OutOfMemoryError e){
- DebugTool.logError("OutOfMemory error", e); //Garbled bits were received
- accumulator = null;
- }
- }
-
- protected void handleRemainingFrame(SdlPacket packet) {
- accumulator.write(packet.payload, 0, (int)packet.getDataSize());
- notifyIfFinished(packet);
- }
-
- protected void notifyIfFinished(SdlPacket packet) {
- //if (framesRemaining == 0) {
- if (packet.getFrameType() == FrameType.Consecutive && packet.getFrameInfo() == 0x0)
- {
- ProtocolMessage message = new ProtocolMessage();
- message.setPayloadProtected(packet.isEncrypted());
- message.setSessionType(SessionType.valueOf((byte)packet.getServiceType()));
- message.setSessionID((byte)packet.getSessionId());
- //If it is WiPro 2.0 it must have binary header
- if (protocolVersion.getMajor() > 1) {
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
- parseBinaryHeader(accumulator.toByteArray());
- if(binFrameHeader == null) {
- return;
- }
- message.setVersion(getMajorVersionByte());
- message.setRPCType(binFrameHeader.getRPCType());
- message.setFunctionID(binFrameHeader.getFunctionID());
- message.setCorrID(binFrameHeader.getCorrID());
- if (binFrameHeader.getJsonSize() > 0) message.setData(binFrameHeader.getJsonData());
- if (binFrameHeader.getBulkData() != null) message.setBulkData(binFrameHeader.getBulkData());
- } else{
- message.setData(accumulator.toByteArray());
- }
-
- _assemblerForMessageID.remove(packet.getMessageId());
-
- try {
- handleProtocolMessageReceived(message);
- } catch (Exception excp) {
- DebugTool.logError(FailurePropagating_Msg + "onProtocolMessageReceived: " + excp.toString(), excp);
- } // end-catch
-
- hasFirstFrame = false;
- accumulator = null;
- } // end-if
- } // end-method
-
- protected void handleMultiFrameMessageFrame(SdlPacket packet) {
- if (packet.getFrameType() == FrameType.First){
- handleFirstDataFrame(packet);
- }
- else{
- if(accumulator != null)
- handleRemainingFrame(packet);
- }
-
- } // end-method
-
- protected void handleFrame(SdlPacket packet) {
-
- if (packet.getPayload() != null && packet.getDataSize() > 0 && packet.isEncrypted() )
- {
- if (sdlconn != null)
- {
- SdlSession session = sdlconn.findSessionById((byte)packet.getSessionId());
-
- if (session == null)
- return;
-
- SdlSecurityBase sdlSec = session.getSdlSecurity();
- byte[] dataToRead = new byte[4096];
-
- Integer iNumBytes = sdlSec.decryptData(packet.getPayload(), dataToRead);
- if ((iNumBytes == null) || (iNumBytes <= 0))
- return;
-
- byte[] decryptedData = new byte[iNumBytes];
- System.arraycopy(dataToRead, 0, decryptedData, 0, iNumBytes);
- packet.payload = decryptedData;
- }
- }
-
- if (packet.getFrameType().equals(FrameType.Control)) {
- handleControlFrame(packet);
- } else {
- // Must be a form of data frame (single, first, consecutive, etc.)
- if ( packet.getFrameType() == FrameType.First
- || packet.getFrameType() == FrameType.Consecutive
- ) {
- handleMultiFrameMessageFrame(packet);
- } else {
- handleSingleFrameMessageFrame(packet);
- }
- } // end-if
- } // end-method
-
- private void handleProtocolHeartbeatACK(SdlPacket packet) {
- WiProProtocol.this.handleProtocolHeartbeatACK(SessionType.valueOf((byte)packet.getServiceType()),(byte)packet.getSessionId());
- } // end-method
- private void handleProtocolHeartbeat(SdlPacket packet) {
- WiProProtocol.this.handleProtocolHeartbeat(SessionType.valueOf((byte)packet.getServiceType()),(byte)packet.getSessionId());
- } // end-method
-
- private void handleControlFrame(SdlPacket packet) {
- Integer frameTemp = Integer.valueOf(packet.getFrameInfo());
- Byte frameInfo = frameTemp.byteValue();
-
- SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
-
- if (frameInfo == FrameDataControlFrameType.Heartbeat.getValue()) {
- handleProtocolHeartbeat(packet);
- }
- if (frameInfo == FrameDataControlFrameType.HeartbeatACK.getValue()) {
- handleProtocolHeartbeatACK(packet);
- }
- else if (frameInfo == FrameDataControlFrameType.StartSession.getValue()) {
- sendStartProtocolSessionACK(serviceType, (byte)packet.getSessionId());
- } else if (frameInfo == FrameDataControlFrameType.StartSessionACK.getValue()) {
- // Use this sessionID to create a message lock
- Object messageLock = _messageLocks.get(packet.getSessionId());
- if (messageLock == null) {
- messageLock = new Object();
- _messageLocks.put((byte)packet.getSessionId(), messageLock);
- }
- if(packet.version >= 5){
- String mtuTag = null;
- if(serviceType.equals(SessionType.RPC)){
- mtuTag = ControlFrameTags.RPC.StartServiceACK.MTU;
- }else if(serviceType.equals(SessionType.PCM)){
- mtuTag = ControlFrameTags.Audio.StartServiceACK.MTU;
- }else if(serviceType.equals(SessionType.NAV)){
- mtuTag = ControlFrameTags.Video.StartServiceACK.MTU;
- }
- Object mtu = packet.getTag(mtuTag);
- if(mtu!=null){
- mtus.put(serviceType,(Long) packet.getTag(mtuTag));
- }
- if(serviceType.equals(SessionType.RPC)){
- hashID = (Integer) packet.getTag(ControlFrameTags.RPC.StartServiceACK.HASH_ID);
- Object version = packet.getTag(ControlFrameTags.RPC.StartServiceACK.PROTOCOL_VERSION);
- if(version!=null){
- //At this point we have confirmed the negotiated version between the module and the proxy
- protocolVersion = new Version((String)version);
- }
- }else if(serviceType.equals(SessionType.NAV)){
- SdlSession session = sdlconn.findSessionById((byte) packet.sessionId);
- if(session != null) {
- ImageResolution acceptedResolution = new ImageResolution();
- VideoStreamingFormat acceptedFormat = new VideoStreamingFormat();
- acceptedResolution.setResolutionHeight((Integer) packet.getTag(ControlFrameTags.Video.StartServiceACK.HEIGHT));
- acceptedResolution.setResolutionWidth((Integer) packet.getTag(ControlFrameTags.Video.StartServiceACK.WIDTH));
- acceptedFormat.setCodec(VideoStreamingCodec.valueForString((String) packet.getTag(ControlFrameTags.Video.StartServiceACK.VIDEO_CODEC)));
- acceptedFormat.setProtocol(VideoStreamingProtocol.valueForString((String) packet.getTag(ControlFrameTags.Video.StartServiceACK.VIDEO_PROTOCOL)));
- VideoStreamingParameters agreedVideoParams = session.getDesiredVideoParams();
- agreedVideoParams.setResolution(acceptedResolution);
- agreedVideoParams.setFormat(acceptedFormat);
- session.setAcceptedVideoParams(agreedVideoParams);
- }
- }
- }else{
- if (protocolVersion.getMajor() > 1){
- if (packet.payload!= null && packet.dataSize == 4){ //hashid will be 4 bytes in length
- hashID = BitConverter.intFromByteArray(packet.payload, 0);
- }
- }
- }
- handleProtocolSessionStarted(serviceType,(byte) packet.getSessionId(), getMajorVersionByte(), "", hashID, packet.isEncrypted());
- } else if (frameInfo == FrameDataControlFrameType.StartSessionNACK.getValue()) {
- List<String> rejectedParams = null;
- if(packet.version >= 5){
- String rejectedTag = null;
- if(serviceType.equals(SessionType.RPC)){
- rejectedTag = ControlFrameTags.RPC.StartServiceNAK.REJECTED_PARAMS;
- }else if(serviceType.equals(SessionType.PCM)){
- rejectedTag = ControlFrameTags.Audio.StartServiceNAK.REJECTED_PARAMS;
- }else if(serviceType.equals(SessionType.NAV)){
- rejectedTag = ControlFrameTags.Video.StartServiceNAK.REJECTED_PARAMS;
- }
- rejectedParams = (List<String>) packet.getTag(rejectedTag);
- }
- if (serviceType.eq(SessionType.NAV) || serviceType.eq(SessionType.PCM)) {
- handleProtocolSessionNACKed(serviceType, (byte)packet.getSessionId(), getMajorVersionByte(), "", rejectedParams);
- } else {
- handleProtocolError("Got StartSessionNACK for protocol sessionID=" + packet.getSessionId(), null);
- }
- } else if (frameInfo == FrameDataControlFrameType.EndSession.getValue()) {
- if (protocolVersion.getMajor() > 1) {
- handleProtocolSessionEnded(serviceType, (byte)packet.getSessionId(), "");
- } else {
- handleProtocolSessionEnded(serviceType, (byte)packet.getSessionId(), "");
- }
- } else if (frameInfo == FrameDataControlFrameType.EndSessionACK.getValue()) {
- handleProtocolSessionEnded(serviceType, (byte)packet.getSessionId(), "");
- } else if (frameInfo == FrameDataControlFrameType.EndSessionNACK.getValue()) {
- if(packet.version >= 5){
- String rejectedTag = null;
- if(serviceType.equals(SessionType.RPC)){
- rejectedTag = ControlFrameTags.RPC.EndServiceNAK.REJECTED_PARAMS;
- }else if(serviceType.equals(SessionType.PCM)){
- rejectedTag = ControlFrameTags.Audio.EndServiceNAK.REJECTED_PARAMS;
- }else if(serviceType.equals(SessionType.NAV)){
- rejectedTag = ControlFrameTags.Video.EndServiceNAK.REJECTED_PARAMS;
- }
- List<String> rejectedParams = (List<String>) packet.getTag(rejectedTag);
- // TODO: Pass these back
- }
- handleProtocolSessionEndedNACK(serviceType, (byte)packet.getSessionId(), "");
- } else if (frameInfo == FrameDataControlFrameType.ServiceDataACK.getValue()) {
- if (packet.getPayload() != null && packet.getDataSize() == 4) //service data ack will be 4 bytes in length
- {
- int serviceDataAckSize = BitConverter.intFromByteArray(packet.getPayload(), 0);
- handleProtocolServiceDataACK(serviceType, serviceDataAckSize,(byte)packet.getSessionId ());
- }
- }
- _assemblerForMessageID.remove(packet.getMessageId());
- } // end-method
-
- private void handleSingleFrameMessageFrame(SdlPacket packet) {
- ProtocolMessage message = new ProtocolMessage();
- message.setPayloadProtected(packet.isEncrypted());
- SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
- if (serviceType == SessionType.RPC) {
- message.setMessageType(MessageType.RPC);
- } else if (serviceType == SessionType.BULK_DATA) {
- message.setMessageType(MessageType.BULK);
- } // end-if
- message.setSessionType(serviceType);
- message.setSessionID((byte)packet.getSessionId());
- //If it is WiPro 2.0 it must have binary header
- boolean isControlService = message.getSessionType().equals(SessionType.CONTROL);
- if (protocolVersion.getMajor() > 1 && !isControlService) {
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
- parseBinaryHeader(packet.payload);
- if(binFrameHeader == null) {
- return;
- }
- message.setVersion(getMajorVersionByte());
- message.setRPCType(binFrameHeader.getRPCType());
- message.setFunctionID(binFrameHeader.getFunctionID());
- message.setCorrID(binFrameHeader.getCorrID());
- if (binFrameHeader.getJsonSize() > 0){
- message.setData(binFrameHeader.getJsonData());
- }
- if (binFrameHeader.getBulkData() != null){
- message.setBulkData(binFrameHeader.getBulkData());
- }
- } else {
- message.setData(packet.payload);
- }
-
- _assemblerForMessageID.remove(packet.getMessageId());
-
- try {
- handleProtocolMessageReceived(message);
- } catch (Exception ex) {
- DebugTool.logError(FailurePropagating_Msg + "onProtocolMessageReceived: " + ex.toString(), ex);
- handleProtocolError(FailurePropagating_Msg + "onProtocolMessageReceived: ", ex);
- } // end-catch
- } // end-method
- } // end-class
-
- @Override
- public void StartProtocolService(SessionType sessionType, byte sessionID, boolean isEncrypted) {
- SdlPacket header = SdlPacketFactory.createStartSession(sessionType, 0x00, getMajorVersionByte(), sessionID, isEncrypted);
- if(sessionType.equals(SessionType.NAV)){
- SdlSession videoSession = sdlconn.findSessionById(sessionID);
- if(videoSession != null){
- ImageResolution desiredResolution = videoSession.getDesiredVideoParams().getResolution();
- VideoStreamingFormat desiredFormat = videoSession.getDesiredVideoParams().getFormat();
- if(desiredResolution != null){
- header.putTag(ControlFrameTags.Video.StartService.WIDTH, desiredResolution.getResolutionWidth());
- header.putTag(ControlFrameTags.Video.StartService.HEIGHT, desiredResolution.getResolutionHeight());
- }
- if(desiredFormat != null){
- header.putTag(ControlFrameTags.Video.StartService.VIDEO_CODEC, desiredFormat.getCodec().toString());
- header.putTag(ControlFrameTags.Video.StartService.VIDEO_PROTOCOL, desiredFormat.getProtocol().toString());
- }
- }
- }
- handlePacketToSend(header);
- }
-
- @Override
- public void SetHeartbeatSendInterval(int heartbeatSendInterval_ms) {
- _heartbeatSendInterval_ms = heartbeatSendInterval_ms;
-
- }
-
- @Override
- public void SetHeartbeatReceiveInterval(int heartbeatReceiveInterval_ms) {
- _heartbeatReceiveInterval_ms = heartbeatReceiveInterval_ms;
-
- }
-
- @Override
- public void SendHeartBeat(byte sessionID) {
- final SdlPacket heartbeat = SdlPacketFactory.createHeartbeat(SessionType.CONTROL, sessionID, getMajorVersionByte());
- handlePacketToSend(heartbeat);
- }
-
- @Override
- public void SendHeartBeatACK(byte sessionID) {
- final SdlPacket heartbeat = SdlPacketFactory.createHeartbeatACK(SessionType.CONTROL, sessionID, getMajorVersionByte());
- handlePacketToSend(heartbeat);
- }
-
- @Override
- public void EndProtocolService(SessionType serviceType, byte sessionID) {
- if(serviceType.equals(SessionType.RPC)){ //RPC session will close all other sessions so we want to make sure we use the correct EndProtocolSession method
- EndProtocolSession(serviceType,sessionID,hashID);
- }else {
- SdlPacket header = SdlPacketFactory.createEndSession(serviceType, sessionID, hashID, getMajorVersionByte(), new byte[0]);
- handlePacketToSend(header);
- }
- }
-
-} // end-class \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java
deleted file mode 100644
index bc926f714..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package com.smartdevicelink.protocol.enums;
-
-/**
- * Control frame payload tags that relate to the respective services. Each class represents a different service, RPC, Audio, and Video services.
- */
-public class ControlFrameTags {
-
- private static class StartServiceACKBase{
- /** Max transport unit to be used for this service */
- public static final String MTU = "mtu";
- }
-
- private static class NAKBase{
- /** An array of rejected parameters related to the corresponding request*/
- public static final String REJECTED_PARAMS = "rejectedParams";
- }
-
- /**
- * Control frame payloads that relate to the Remote Procedure Call (RPC) service.
- */
- public static class RPC {
- public static class StartService {
- /** The max version of the protocol supported by client requesting service to start.<br>
- * Must be in the format "Major.Minor.Patch"
- */
- public static final String PROTOCOL_VERSION = "protocolVersion";
- }
- public static class StartServiceACK extends StartServiceACKBase{
- /** The negotiated version of the protocol. Must be in the format "Major.Minor.Patch"*/
- public static final String PROTOCOL_VERSION = StartService.PROTOCOL_VERSION;
- /** Hash ID to identify this service and used when sending an EndService control frame*/
- public static final String HASH_ID = "hashId";
- /** HU allowed transport for secondary connection */
- public static final String SECONDARY_TRANSPORTS = "secondaryTransports";
- /** HU allowed transports for audio and video services (1 == Primary, 2 == Secondary) */
- public static final String AUDIO_SERVICE_TRANSPORTS = "audioServiceTransports";
- public static final String VIDEO_SERVICE_TRANSPORTS = "videoServiceTransports";
- }
- public static class StartServiceNAK extends NAKBase{}
- public static class EndService {
- /** Hash ID supplied in the StartServiceACK for this service type*/
- public static final String HASH_ID = RPC.StartServiceACK.HASH_ID;
- }
- public static class EndServiceACK {}
- public static class EndServiceNAK extends NAKBase{}
- /** This frame is sent from Core to application to indicate that status or configuration of
- * transport(s) is/are updated. This frame should not be sent prior to Version Negotiation.
- **/
- public static class TransportEventUpdate {
- /** The HU reported IP address and port of TCP connection */
- public static final String TCP_IP_ADDRESS = "tcpIpAddress";
- public static final String TCP_PORT = "tcpPort";
- }
- /**This frame is sent from application to Core to notify that Secondary Transport has been
- * established. This frame should be only sent on Secondary Transport.
- **/
- public static class RegisterSecondaryTransport {}
- public static class RegisterSecondaryTransportACK {}
- public static class RegisterSecondaryTransportNAK extends NAKBase {
- public static final String REASON = "reason";
- }
- }
-
- /**
- * Control frame payloads that relate to the Audio streaming service. This service has also been referred to as the PCM service.
- */
- public static class Audio {
- public static class StartService {}
- public static class StartServiceACK extends StartServiceACKBase{}
- public static class StartServiceNAK extends NAKBase{}
- public static class EndService {}
- public static class EndServiceACK {}
- public static class EndServiceNAK extends NAKBase{}
- }
-
- /**
- * Control frame payloads that relate to the Video streaming service. This service has also been referred to as the .h264 service.
- */
- public static class Video {
- public static class StartService {
- /** Desired height in pixels from the client requesting the video service to start*/
- public static final String HEIGHT = "height";
- /** Desired width in pixels from the client requesting the video service to start*/
- public static final String WIDTH = "width";
- /** Desired video protocol to be used*/
- public static final String VIDEO_PROTOCOL = "videoProtocol";
- /** Desired video codec to be used*/
- public static final String VIDEO_CODEC = "videoCodec";
- }
- public static class StartServiceACK extends StartServiceACKBase{
- /** Accepted height in pixels from the client requesting the video service to start*/
- public static final String HEIGHT = StartService.HEIGHT;
- /** Accepted width in pixels from the client requesting the video service to start*/
- public static final String WIDTH = StartService.WIDTH;
- /** Accepted video protocol to be used*/
- public static final String VIDEO_PROTOCOL = StartService.VIDEO_PROTOCOL;
- /** Accepted video codec to be used*/
- public static final String VIDEO_CODEC = StartService.VIDEO_CODEC;
- }
-
- public static class StartServiceNAK extends NAKBase{}
- public static class EndService {}
- public static class EndServiceACK {}
- public static class EndServiceNAK extends NAKBase{}
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java
deleted file mode 100644
index bff606c3b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.smartdevicelink.protocol.enums;
-
-import java.util.Vector;
-
-import com.smartdevicelink.util.ByteEnumer;
-
-public class FrameData extends ByteEnumer {
-
- private static Vector<FrameData> theList = new Vector<FrameData>();
- public static Vector<FrameData> getList() { return theList; }
-
- byte i = 0x00;
-
- protected FrameData(byte value, String name) {
- super(value, name);
- }
-
- public final static FrameData StartSession = new FrameData((byte)0x01, "StartSession");
- public final static FrameData StartSessionACK = new FrameData((byte)0x02, "StartSessionACK");
- public final static FrameData StartSessionNACK = new FrameData((byte)0x03, "StartSessionNACK");
- public final static FrameData EndSession = new FrameData((byte)0x04, "EndSession");
-
- public final static FrameData SingleFrame = new FrameData((byte)0x00, "SingleFrame");
- public final static FrameData FirstFrame = new FrameData((byte)0x00, "FirstFrame");
- public final static FrameData ConsecutiveFrame = new FrameData((byte)0x00, "ConsecutiveFrame");
- public final static byte LastFrame = (byte)0x00;
-
- static {
- theList.addElement(StartSession);
- theList.addElement(StartSessionACK);
- theList.addElement(StartSessionNACK);
- theList.addElement(EndSession);
- }
-
- public static FrameData valueOf(String passedButton) {
- return (FrameData) get(theList, passedButton);
- }
-
- public static FrameData[] values() {
- return theList.toArray(new FrameData[theList.size()]);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java
deleted file mode 100644
index bef31fe5c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.smartdevicelink.protocol.enums;
-
-import java.util.Vector;
-
-import com.smartdevicelink.util.ByteEnumer;
-
-public class FrameDataControlFrameType extends ByteEnumer {
- private static Vector<FrameDataControlFrameType> theList = new Vector<FrameDataControlFrameType>();
- public static Vector<FrameDataControlFrameType> getList() { return theList; }
-
- @SuppressWarnings("unused")
- private byte _i = 0x00;
-
- protected FrameDataControlFrameType(byte value, String name) {
- super(value, name);
- }
-
- public final static FrameDataControlFrameType Heartbeat = new FrameDataControlFrameType((byte)0x0, "Heartbeat");
- public final static FrameDataControlFrameType StartSession = new FrameDataControlFrameType((byte)0x01, "StartSession");
- public final static FrameDataControlFrameType StartSessionACK = new FrameDataControlFrameType((byte)0x02, "StartSessionACK");
- public final static FrameDataControlFrameType StartSessionNACK = new FrameDataControlFrameType((byte)0x03, "StartSessionNACK");
- public final static FrameDataControlFrameType EndSession = new FrameDataControlFrameType((byte)0x04, "EndSession");
- public final static FrameDataControlFrameType EndSessionACK = new FrameDataControlFrameType((byte)0x05, "EndSessionACK");
- public final static FrameDataControlFrameType EndSessionNACK = new FrameDataControlFrameType((byte)0x06, "EndSessionNACK");
- public final static FrameDataControlFrameType RegisterSecondaryTransport = new FrameDataControlFrameType((byte)0x07, "RegisterSecondaryTransport");
- public final static FrameDataControlFrameType RegisterSecondaryTransportACK = new FrameDataControlFrameType((byte)0x08, "RegisterSecondaryTransportACK");
- public final static FrameDataControlFrameType RegisterSecondaryTransportNACK = new FrameDataControlFrameType((byte)0x09, "RegisterSecondaryTransportNACK");
- public final static FrameDataControlFrameType TransportEventUpdate = new FrameDataControlFrameType((byte)0xFD, "TransportEventUpdate");
- public final static FrameDataControlFrameType ServiceDataACK = new FrameDataControlFrameType((byte)0xFE, "ServiceDataACK");
- public final static FrameDataControlFrameType HeartbeatACK = new FrameDataControlFrameType((byte)0xFF, "HeartbeatACK");
-
- static {
- theList.addElement(Heartbeat);
- theList.addElement(StartSession);
- theList.addElement(StartSessionACK);
- theList.addElement(StartSessionNACK);
- theList.addElement(EndSession);
- theList.addElement(EndSessionACK);
- theList.addElement(EndSessionNACK);
- theList.addElement(RegisterSecondaryTransport);
- theList.addElement(RegisterSecondaryTransportACK);
- theList.addElement(RegisterSecondaryTransportNACK);
- theList.addElement(TransportEventUpdate);
- theList.addElement(ServiceDataACK);
- theList.addElement(HeartbeatACK);
- }
-
- public static FrameDataControlFrameType valueOf(String passedButton) {
- return (FrameDataControlFrameType) get(theList, passedButton);
- }
-
- public static FrameDataControlFrameType[] values() {
- return theList.toArray(new FrameDataControlFrameType[theList.size()]);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java
deleted file mode 100644
index d724807d0..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.smartdevicelink.protocol.enums;
-
-import java.util.Vector;
-
-import com.smartdevicelink.util.ByteEnumer;
-
-public class FrameType extends ByteEnumer {
-
- private static Vector<FrameType> theList = new Vector<FrameType>();
- public static Vector<FrameType> getList() { return theList; }
-
- byte i = 0x00;
-
- protected FrameType(byte value, String name) {
- super(value, name);
- }
-
- public final static FrameType Control = new FrameType((byte)0x00, "Control");
- public final static FrameType Single = new FrameType((byte)0x01, "Single");
- public final static FrameType First = new FrameType((byte)0x02, "First");
- public final static FrameType Consecutive = new FrameType((byte)0x03, "Consecutive");
-
- static {
- theList.addElement(Control);
- theList.addElement(Single);
- theList.addElement(First);
- theList.addElement(Consecutive);
- }
-
- public static FrameType valueOf(byte passed) {
- return (FrameType) get(theList, passed);
- }
-
- public static FrameType[] values() {
- return theList.toArray(new FrameType[theList.size()]);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java
deleted file mode 100644
index 4f1ad71b5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package com.smartdevicelink.protocol.enums;
-
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map.Entry;
-
-public enum FunctionID{
- // DEPRECATED FUNCTIONS
- SYNC_P_DATA(65537, "SyncPData"),
- ON_SYNC_P_DATA(98305, "OnSyncPData"),
- ENCODED_SYNC_P_DATA(65536, "EncodedSyncPData"),
- ON_ENCODED_SYNC_P_DATA(98304, "OnEncodedSyncPData"),
-
- // REQUESTS & RESPONSES
- REGISTER_APP_INTERFACE(1, "RegisterAppInterface"),
- UNREGISTER_APP_INTERFACE(2, "UnregisterAppInterface"),
- SET_GLOBAL_PROPERTIES(3, "SetGlobalProperties"),
- RESET_GLOBAL_PROPERTIES(4, "ResetGlobalProperties"),
- ADD_COMMAND(5, "AddCommand"),
- DELETE_COMMAND(6, "DeleteCommand"),
- ADD_SUB_MENU(7, "AddSubMenu"),
- DELETE_SUB_MENU(8, "DeleteSubMenu"),
- CREATE_INTERACTION_CHOICE_SET(9, "CreateInteractionChoiceSet"),
- PERFORM_INTERACTION(10, "PerformInteraction"),
- DELETE_INTERACTION_CHOICE_SET(11, "DeleteInteractionChoiceSet"),
- ALERT(12, "Alert"),
- SHOW(13, "Show"),
- SPEAK(14, "Speak"),
- SET_MEDIA_CLOCK_TIMER(15, "SetMediaClockTimer"),
- PERFORM_AUDIO_PASS_THRU(16, "PerformAudioPassThru"),
- END_AUDIO_PASS_THRU(17, "EndAudioPassThru"),
- SUBSCRIBE_BUTTON(18, "SubscribeButton"),
- UNSUBSCRIBE_BUTTON(19, "UnsubscribeButton"),
- SUBSCRIBE_VEHICLE_DATA(20, "SubscribeVehicleData"),
- UNSUBSCRIBE_VEHICLE_DATA(21, "UnsubscribeVehicleData"),
- GET_VEHICLE_DATA(22, "GetVehicleData"),
- READ_DID(23, "ReadDID"),
- GET_DTCS(24, "GetDTCs"),
- SCROLLABLE_MESSAGE(25, "ScrollableMessage"),
- SLIDER(26, "Slider"),
- SHOW_CONSTANT_TBT(27, "ShowConstantTBT"),
- ALERT_MANEUVER(28, "AlertManeuver"),
- UPDATE_TURN_LIST(29, "UpdateTurnList"),
- CHANGE_REGISTRATION(30, "ChangeRegistration"),
- GENERIC_RESPONSE(31, "GenericResponse"),
- PUT_FILE(32, "PutFile"),
- DELETE_FILE(33, "DeleteFile"),
- LIST_FILES(34, "ListFiles"),
- SET_APP_ICON(35, "SetAppIcon"),
- SET_DISPLAY_LAYOUT(36, "SetDisplayLayout"),
- DIAGNOSTIC_MESSAGE(37, "DiagnosticMessage"),
- SYSTEM_REQUEST(38, "SystemRequest"),
- SEND_LOCATION(39, "SendLocation"),
- DIAL_NUMBER(40, "DialNumber"),
-
- BUTTON_PRESS(41, "ButtonPress"),
- GET_INTERIOR_VEHICLE_DATA(43, "GetInteriorVehicleData"),
- SET_INTERIOR_VEHICLE_DATA(44, "SetInteriorVehicleData"),
-
- GET_WAY_POINTS(45, "GetWayPoints"),
- SUBSCRIBE_WAY_POINTS(46, "SubscribeWayPoints"),
- UNSUBSCRIBE_WAY_POINTS(47, "UnsubscribeWayPoints"),
- GET_SYSTEM_CAPABILITY(48, "GetSystemCapability"),
- SEND_HAPTIC_DATA(49, "SendHapticData"),
-
- // NOTIFICATIONS
- ON_HMI_STATUS(32768, "OnHMIStatus"),
- ON_APP_INTERFACE_UNREGISTERED(32769, "OnAppInterfaceUnregistered"),
- ON_BUTTON_EVENT(32770, "OnButtonEvent"),
- ON_BUTTON_PRESS(32771, "OnButtonPress"),
- ON_VEHICLE_DATA(32772, "OnVehicleData"),
- ON_COMMAND(32773, "OnCommand"),
- ON_TBT_CLIENT_STATE(32774, "OnTBTClientState"),
- ON_DRIVER_DISTRACTION(32775, "OnDriverDistraction"),
- ON_PERMISSIONS_CHANGE(32776, "OnPermissionsChange"),
- ON_AUDIO_PASS_THRU(32777, "OnAudioPassThru"),
- ON_LANGUAGE_CHANGE(32778, "OnLanguageChange"),
- ON_KEYBOARD_INPUT(32779, "OnKeyboardInput"),
- ON_TOUCH_EVENT(32780, "OnTouchEvent"),
- ON_SYSTEM_REQUEST(32781, "OnSystemRequest"),
- ON_HASH_CHANGE(32782, "OnHashChange"),
- ON_INTERIOR_VEHICLE_DATA(32783, "OnInteriorVehicleData"),
- ON_WAY_POINT_CHANGE(32784, "OnWayPointChange"),
- ON_RC_STATUS(32785, "OnRCStatus"),
-
- // MOCKED FUNCTIONS (NOT SENT FROM HEAD-UNIT)
- ON_LOCK_SCREEN_STATUS(-1, "OnLockScreenStatus"),
- ON_SDL_CHOICE_CHOSEN(-1, "OnSdlChoiceChosen"),
- ON_STREAM_RPC(-1, "OnStreamRPC"),
- STREAM_RPC(-1, "StreamRPC"),
-
- ;
-
- public static final int INVALID_ID = -1;
-
- private static HashMap<String, Integer> functionMap;
-
- private final int ID;
- private final String JSON_NAME;
-
- private FunctionID(int id, String jsonName){
- this.ID = id;
- this.JSON_NAME = jsonName;
- }
-
- public int getId(){
- return this.ID;
- }
-
- @Override
- public String toString(){
- return this.JSON_NAME;
- }
-
- private static void initFunctionMap(){
- functionMap = new HashMap<String, Integer>(values().length);
-
- for(FunctionID value : EnumSet.allOf(FunctionID.class)){
- functionMap.put(value.toString(), value.getId());
- }
- }
-
- public static String getFunctionName(int i){
- if(functionMap == null){
- initFunctionMap();
- }
-
- Iterator<Entry<String, Integer>> iterator = functionMap.entrySet().iterator();
- while(iterator.hasNext()){
- Entry<String, Integer> thisEntry = iterator.next();
- if(Integer.valueOf(i).equals(thisEntry.getValue())){
- return thisEntry.getKey();
- }
- }
-
- return null;
- }
-
- public static int getFunctionId(String functionName){
- if(functionMap == null){
- initFunctionMap();
- }
-
- Integer result = functionMap.get(functionName);
- return ( result == null ) ? INVALID_ID : result;
- }
-
- /**
- * This method gives the corresponding FunctionID enum value for a string RPC
- * @param name String value represents the name of the RPC
- * @return FunctionID represents the equivalent enum value for the provided string
- */
- public static FunctionID getEnumForString(String name){
- for(FunctionID value : EnumSet.allOf(FunctionID.class)) {
- if(value.JSON_NAME.equals(name)){
- return value;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java
deleted file mode 100644
index 87f5b9eb3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/MessageType.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.smartdevicelink.protocol.enums;
-
-
-public enum MessageType {
-// START_SESSION,
-// START_SESSION_ACK,
-// START_SESSION_NACK,
-// END_SESSION,
- UNDEFINED,
- BULK,
- RPC;
-
- public static MessageType valueForString (String value) {
- try{
- return valueOf(value);
- } catch(Exception e) {
- return null;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java
deleted file mode 100644
index f6cd888b4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.smartdevicelink.protocol.enums;
-
-import java.util.Vector;
-
-import com.smartdevicelink.util.ByteEnumer;
-
-
-public class SessionType extends ByteEnumer {
-
- private static Vector<SessionType> theList = new Vector<SessionType>();
- public static Vector<SessionType> getList() { return theList; }
-
- byte i = 0x00;
-
- protected SessionType(byte value, String name) {super(value, name);}
- public final static SessionType CONTROL = new SessionType((byte) 0, "CONTROL");
- public final static SessionType RPC = new SessionType((byte)0x07, "RPC");
- public final static SessionType PCM = new SessionType((byte)0x0A, "PCM");
- public final static SessionType NAV = new SessionType((byte)0x0B, "NAV");
- public final static SessionType BULK_DATA = new SessionType((byte)0xF, "BULK_DATA");
-
- static {
- theList.addElement(RPC);
- theList.addElement(PCM);
- theList.addElement(NAV);
- theList.addElement(BULK_DATA);
- theList.addElement(CONTROL);
- }
-
- public static SessionType valueOf(byte passedButton) {
- return (SessionType) get(theList, passedButton);
- }
-
- public static SessionType[] values() {
- return theList.toArray(new SessionType[theList.size()]);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java
deleted file mode 100644
index 0b7051c27..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java
+++ /dev/null
@@ -1,228 +0,0 @@
-package com.smartdevicelink.protocol.heartbeat;
-
-
-import android.os.Handler;
-import android.os.Looper;
-
-
-public class HeartbeatMonitor implements IHeartbeatMonitor {
-
- public static final int HEARTBEAT_INTERVAL = 5000;
- public static final int HEARTBEAT_INTERVAL_MAX = Integer.MAX_VALUE;
-
- private final Object heartbeatThreadHandlerLock = new Object();
- private final Object listenerLock = new Object();
-
- private int mHeartBeatInterval = HEARTBEAT_INTERVAL;
- private boolean mHeartBeatAck = true;
-
- private IHeartbeatMonitorListener mListener;
- private volatile boolean mIsAckReceived;
- private volatile boolean isHeartbeatReceived;
- private Thread mHeartbeatThread;
- private Looper mHeartbeatThreadLooper;
- private Handler mHeartbeatThreadHandler;
-
- public HeartbeatMonitor() {
- }
-
- // Methods used to retrieve values for unit testing only.
- // See com/smartdevicelink/tests/protocol/heartbeat/HeartbeatMonitorTests.
- public Runnable getHeartbeatRunnable () { return heartbeatTimeoutRunnable; }
- public boolean isHeartbeatReceived () { return isHeartbeatReceived; }
-
- private Runnable heartbeatTimeoutRunnable = new Runnable() {
-
- @Override
- public void run() {
- try{
- synchronized (listenerLock) {
- if (isHeartbeatReceived) {
- if (mListener != null) {
- mListener.sendHeartbeat(HeartbeatMonitor.this);
- } else {
-
- }
- isHeartbeatReceived = false;
- } else {
- if (mListener != null) {
- mListener.heartbeatTimedOut(HeartbeatMonitor.this);
- }
- }
- }
- }
- catch(Exception ex)
- {
- stop();
- }
- }
- };
-
- private Runnable heartbeatAckTimeoutRunnable = new Runnable() {
-
- @Override
- public void run() {
-
- try
- {
- synchronized (listenerLock) {
- if (mIsAckReceived) {
- if (mListener != null) {
- mListener.sendHeartbeat(HeartbeatMonitor.this);
- } else {
- }
- mIsAckReceived = false;
- } else {
- if (mListener != null) {
- mListener.heartbeatTimedOut(HeartbeatMonitor.this);
- }
- stop();
- }
- }
-
- }
- catch(Exception ex)
- {
- stop();
- }
-
- rescheduleHeartbeat();
- }
-
- private void rescheduleHeartbeat() {
- synchronized (heartbeatThreadHandlerLock) {
- if (mHeartbeatThreadHandler != null) {
- if (!Thread.interrupted()) {
- if (!mHeartbeatThreadHandler.postDelayed(this, mHeartBeatInterval)) {
- }
- } else {
- }
- } else {
- stop();
- }
- }
- }
- };
-
- @Override
- public void start() {
-
- synchronized (heartbeatThreadHandlerLock) {
-
- if (mHeartbeatThread != null) {
- return;
- }
-
- mHeartbeatThread = new Thread(new Runnable() {
-
- @Override
- public void run() {
-
- while (!Thread.interrupted()) {
- Looper.prepare();
- mHeartbeatThreadLooper = Looper.myLooper();
-
- mHeartbeatThreadHandler = new Handler();
- mIsAckReceived = true;
- isHeartbeatReceived = true;
-
- if (!mHeartbeatThreadHandler.postDelayed(
- heartbeatAckTimeoutRunnable, mHeartBeatInterval)) {
- }
- Looper.loop();
- }
- }
-
- }, "HeartbeatThread");
- mHeartbeatThread.setPriority(Thread.MAX_PRIORITY);
- mHeartbeatThread.start();
- }
- }
-
- @Override
- public void stop() {
-
-
- synchronized (heartbeatThreadHandlerLock) {
-
- if (mHeartbeatThread == null) {
- mHeartbeatThreadHandler = null;
- mHeartbeatThreadLooper = null;
- return;
- }
-
- mHeartbeatThread.interrupt();
- mHeartbeatThread = null;
-
- if (mHeartbeatThreadHandler != null) {
- mHeartbeatThreadHandler.removeCallbacks(heartbeatAckTimeoutRunnable);
- mHeartbeatThreadHandler.removeCallbacks(heartbeatTimeoutRunnable);
- mHeartbeatThreadHandler = null;
- } else {
- }
-
- if (mHeartbeatThreadLooper != null) {
- mHeartbeatThreadLooper.quit();
- mHeartbeatThreadLooper = null;
- } else {
- }
- }
- }
-
- @Override
- public int getInterval() {
- return mHeartBeatInterval;
- }
-
- @Override
- public void setInterval(int value) {
- mHeartBeatInterval = value;
- }
-
- @Override
- public IHeartbeatMonitorListener getListener() {
- return mListener;
- }
-
- @Override
- public void setListener(IHeartbeatMonitorListener value) {
- mListener = value;
- }
-
- @Override
- public void notifyTransportActivity() {
- if (mHeartbeatThreadHandler == null) {
- return;
- }
- synchronized (heartbeatThreadHandlerLock) {
- if (mHeartbeatThreadHandler == null) {
- return;
- }
- mHeartbeatThreadHandler.removeCallbacks(heartbeatAckTimeoutRunnable);
- if (!mHeartbeatThreadHandler.postDelayed(heartbeatAckTimeoutRunnable, mHeartBeatInterval)) {
- }
- }
- }
-
-
- @Override
- public synchronized void heartbeatACKReceived() {
- synchronized (listenerLock) {
- mIsAckReceived = true;
- }
- }
-
- @Override
- public void heartbeatReceived() {
- if (mHeartbeatThreadHandler == null) {
- return;
- }
- synchronized (listenerLock) {
- if (mHeartBeatAck) {
- isHeartbeatReceived = true;
- if (!mHeartbeatThreadHandler.post(heartbeatTimeoutRunnable)) {
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java
deleted file mode 100644
index ff4feb9cb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.smartdevicelink.protocol.heartbeat;
-
-
-public interface IHeartbeatMonitor {
- /**
- * Starts the monitor. If the monitor is already started, nothing happens.
- */
- public void start();
-
- /**
- * Stops the monitor. Does nothing if it is already stopped.
- */
- public void stop();
-
- /**
- * Returns the heartbeat messages interval.
- *
- * @return interval in milliseconds
- */
- public int getInterval();
-
- /**
- * Sets the interval for sending heartbeat messages if nothing is sent over
- * transport.
- *
- * @param interval interval in milliseconds (min/max values depend on
- * concrete implementations)
- */
- public void setInterval(int interval);
-
- /**
- * Returns the listener.
- *
- * @return the listener
- */
- public IHeartbeatMonitorListener getListener();
-
- /**
- * Sets the heartbeat's listener.
- *
- * @param listener the new listener
- */
- public void setListener(IHeartbeatMonitorListener listener);
-
- /**
- * Notifies the monitor about sent/received messages.
- */
- public void notifyTransportActivity();
-
- /**
- * Notifies the monitor about a received heartbeat ACK message.
- */
- public void heartbeatACKReceived();
-
- /**
- * Notifies the monitor about a received heartbeat message.
- */
- public void heartbeatReceived();
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java
deleted file mode 100644
index 584115f21..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.smartdevicelink.protocol.heartbeat;
-
-/**
- * Listener (aka delegate) that actually knows how to work with the outside
- * world.
- */
-public interface IHeartbeatMonitorListener {
- /**
- * The listener should create and send a heartbeat message.
- *
- * @param monitor the caller
- */
- public void sendHeartbeat(IHeartbeatMonitor monitor);
-
- /**
- * Notifies the listener that the heartbeat timed out.
- *
- * @param monitor the caller
- */
- public void heartbeatTimedOut(IHeartbeatMonitor monitor);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/IProxyListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
deleted file mode 100644
index 2ef06c3b9..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import com.smartdevicelink.proxy.interfaces.IProxyListenerBase;
-import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterfaceResponse;
-
-public interface IProxyListener extends IProxyListenerBase{
- // Adds Legacy Life-cycle Management call-backs to the IProxyListenerAbstract interface
-
- public void onProxyOpened();
-
- public void onRegisterAppInterfaceResponse(RegisterAppInterfaceResponse response);
-
- public void onOnAppInterfaceUnregistered(OnAppInterfaceUnregistered notification);
-
- public void onUnregisterAppInterfaceResponse(UnregisterAppInterfaceResponse response);
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java
deleted file mode 100644
index 28b1d3dfb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import java.io.IOException;
-
-import android.graphics.Bitmap;
-
-import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
-import com.smartdevicelink.util.HttpUtils;
-
-public class LockScreenManager {
-
- public interface OnLockScreenIconDownloadedListener{
- public void onLockScreenIconDownloaded(Bitmap icon);
- public void onLockScreenIconDownloadError(Exception e);
- }
-
- private Bitmap lockScreenIcon;
- private Boolean bUserSelected = false;
- private Boolean bDriverDistStatus = null;
- private HMILevel hmiLevel = null;
- @SuppressWarnings("unused")
- private int iSessionID;
-
- public synchronized void setSessionID(int iVal)
- {
- iSessionID = iVal;
- }
-
- private synchronized void setUserSelectedStatus(boolean bVal)
- {
- bUserSelected = bVal;
- }
-
- public synchronized void setDriverDistStatus(boolean bVal)
- {
- bDriverDistStatus = bVal;
- }
-
- public synchronized void setHMILevel(HMILevel hmiVal)
- {
- hmiLevel = hmiVal;
-
- if (hmiVal != null) {
- if ((hmiVal.equals(HMILevel.HMI_FULL)) || (hmiVal.equals(HMILevel.HMI_LIMITED)))
- setUserSelectedStatus(true);
- else if (hmiVal.equals(HMILevel.HMI_NONE))
- setUserSelectedStatus(false);
- }else{
- setUserSelectedStatus(false);
- }
- }
-
- public synchronized OnLockScreenStatus getLockObj(/*int SessionID*/)
- {
- //int iSessionID = SessionID;
- OnLockScreenStatus myLock = new OnLockScreenStatus();
- myLock.setDriverDistractionStatus(bDriverDistStatus);
- myLock.setHMILevel(hmiLevel);
- myLock.setUserSelected(bUserSelected);
- myLock.setShowLockScreen(getLockScreenStatus());
-
- return myLock;
- }
-
- private synchronized LockScreenStatus getLockScreenStatus()
- {
-
- if ( (hmiLevel == null) || (hmiLevel.equals(HMILevel.HMI_NONE)) )
- {
- return LockScreenStatus.OFF;
- }
- else if ( hmiLevel.equals(HMILevel.HMI_BACKGROUND) )
- {
- if (bDriverDistStatus == null)
- {
- //we don't have driver distraction, lockscreen is entirely based on userselection
- if (bUserSelected)
- return LockScreenStatus.REQUIRED;
- else
- return LockScreenStatus.OFF;
- }
- else if (bDriverDistStatus && bUserSelected)
- {
- return LockScreenStatus.REQUIRED;
- }
- else if (!bDriverDistStatus && bUserSelected)
- {
- return LockScreenStatus.OPTIONAL;
- }
- else
- {
- return LockScreenStatus.OFF;
- }
- }
- else if ( (hmiLevel.equals(HMILevel.HMI_FULL)) || (hmiLevel.equals(HMILevel.HMI_LIMITED)) )
- {
- if ( (bDriverDistStatus != null) && (!bDriverDistStatus) )
- {
- return LockScreenStatus.OPTIONAL;
- }
- else
- return LockScreenStatus.REQUIRED;
- }
- return LockScreenStatus.OFF;
- }
-
- public void downloadLockScreenIcon(final String url, final OnLockScreenIconDownloadedListener l){
- new Thread(new Runnable(){
- @Override
- public void run(){
- try{
- lockScreenIcon = HttpUtils.downloadImage(url);
- if(l != null){
- l.onLockScreenIconDownloaded(lockScreenIcon);
- }
- }catch(IOException e){
- if(l != null){
- l.onLockScreenIconDownloadError(e);
- }
- }
- }
- }).start();
- }
-
- public Bitmap getLockScreenIcon(){
- return this.lockScreenIcon;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCMessage.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
deleted file mode 100644
index e55292aad..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import java.util.Hashtable;
-
-public class RPCMessage extends RPCStruct {
- public static final String KEY_REQUEST = "request";
- public static final String KEY_RESPONSE = "response";
- public static final String KEY_NOTIFICATION = "notification";
- public static final String KEY_FUNCTION_NAME = "name";
- public static final String KEY_PARAMETERS = "parameters";
- public static final String KEY_CORRELATION_ID = "correlationID";
-
- public RPCMessage(String functionName) {
- this(functionName, "request");
- }
-
- protected RPCMessage(RPCMessage rpcm) {
- this(rpcm.store);
- }
-
- protected RPCMessage(RPCStruct rpcs) {
- this("", "");
- this.parameters = rpcs.store;
- }
-
- public RPCMessage(String functionName, String messageType) {
- function = new Hashtable<String, Object>();
- parameters = new Hashtable<String, Object>();
-
- this.messageType = messageType;
- function.put(KEY_PARAMETERS, parameters);
-
- if (messageType != null)
- store.put(messageType, function);
- if (functionName != null)
- function.put(KEY_FUNCTION_NAME, functionName);
- }
-
- @SuppressWarnings("unchecked")
- public RPCMessage(Hashtable<String, Object> hash) {
- store = hash;
- messageType = getMessageTypeName(hash.keySet());
- function = (Hashtable<String, Object>) hash.get(messageType);
- parameters = (Hashtable<String, Object>) function.get(KEY_PARAMETERS);
- if (hasKey(hash.keySet(), RPCStruct.KEY_BULK_DATA)) {
- setBulkData((byte[]) hash.get(RPCStruct.KEY_BULK_DATA));
- }
- if (hasKey(hash.keySet(), RPCStruct.KEY_PROTECTED)) {
- setPayloadProtected((Boolean) hash.get(RPCStruct.KEY_PROTECTED));
- }
- }
-
- protected String messageType;
- protected Hashtable<String, Object> parameters;
- protected Hashtable<String, Object> function;
-
- public String getFunctionName() {
- return (String)function.get(KEY_FUNCTION_NAME);
- }
-
- protected void setFunctionName(String functionName) {
- function.put(KEY_FUNCTION_NAME, functionName);
- }
-
- public String getMessageType() {
- if (messageType.equals(KEY_REQUEST) ||
- messageType.equals(KEY_RESPONSE) ||
- messageType.equals(KEY_NOTIFICATION)) {
- return messageType;
- }
- return null;
- }
-
- // Generalized Getters and Setters
-
- public void setParameters(String key, Object value) {
- if (value != null) {
- parameters.put(key, value);
- } else {
- parameters.remove(key);
- }
- }
-
- public Object getParameters(String key) {
- return parameters.get(key);
- }
-
- @Override
- public Object getObject(Class tClass, String key) {
- Object obj = parameters.get(key);
- return formatObject(tClass, obj);
- }
-
- // Common Object Getters
-
- @Override
- public String getString(String key) {
- return (String) parameters.get(key);
- }
-
- @Override
- public Integer getInteger(String key) {
- return (Integer) parameters.get(key);
- }
-
- @Override
- public Float getFloat(String key) {
- return (Float) parameters.get(key);
- }
-
- @Override
- public Double getDouble(String key) {
- return (Double) parameters.get(key);
- }
-
- @Override
- public Boolean getBoolean(String key) { return (Boolean) parameters.get(key); }
-
- @Override
- public Long getLong(String key){
- Object result = parameters.get(key);
- if (result instanceof Integer) {
- return ((Integer) result).longValue();
- }else if(result instanceof Long){
- return (Long) result;
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCNotification.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
deleted file mode 100644
index b9992e78b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- *
- */
-package com.smartdevicelink.proxy;
-
-import java.util.Hashtable;
-
-public class RPCNotification extends RPCMessage {
-
- public RPCNotification(String functionName) {
- super(functionName, RPCMessage.KEY_NOTIFICATION);
- }
-
- public RPCNotification(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public RPCNotification(RPCMessage rpcMsg) {
- super(preprocessMsg(rpcMsg));
- }
-
- static RPCMessage preprocessMsg (RPCMessage rpcMsg) {
- if (rpcMsg.getMessageType() != RPCMessage.KEY_NOTIFICATION) {
- rpcMsg.messageType = RPCMessage.KEY_NOTIFICATION;
- }
-
- return rpcMsg;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequest.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
deleted file mode 100644
index db493fecf..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- *
- */
-package com.smartdevicelink.proxy;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
-import com.smartdevicelink.util.CorrelationIdGenerator;
-
-public class RPCRequest extends RPCMessage {
-
- protected OnRPCResponseListener onResponseListener;
-
- public RPCRequest(String functionName) {
- super(functionName, RPCMessage.KEY_REQUEST);
- messageType = RPCMessage.KEY_REQUEST;
- }
-
- public RPCRequest(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public RPCRequest(RPCRequest request){
- super(request);
- setCorrelationID(CorrelationIdGenerator.generateId());
- }
- public Integer getCorrelationID() {
- //First we check to see if a correlation ID is set. If not, create one.
- if(!function.containsKey(RPCMessage.KEY_CORRELATION_ID)){
- setCorrelationID(CorrelationIdGenerator.generateId());
- }
- return (Integer)function.get(RPCMessage.KEY_CORRELATION_ID);
- }
-
- public void setCorrelationID(Integer correlationID) {
- if (correlationID != null) {
- function.put(RPCMessage.KEY_CORRELATION_ID, correlationID );
- } else {
- function.remove(RPCMessage.KEY_CORRELATION_ID);
- }
- }
- public void setOnRPCResponseListener(OnRPCResponseListener listener){
- onResponseListener = listener;
- }
-
- public OnRPCResponseListener getOnRPCResponseListener(){
- return this.onResponseListener;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java
deleted file mode 100644
index 7f9986822..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java
+++ /dev/null
@@ -1,999 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import java.util.Vector;
-
-import android.os.Build;
-
-import com.smartdevicelink.proxy.rpc.AddCommand;
-import com.smartdevicelink.proxy.rpc.AddSubMenu;
-import com.smartdevicelink.proxy.rpc.Alert;
-import com.smartdevicelink.proxy.rpc.ChangeRegistration;
-import com.smartdevicelink.proxy.rpc.Choice;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
-import com.smartdevicelink.proxy.rpc.DeleteCommand;
-import com.smartdevicelink.proxy.rpc.DeleteFile;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenu;
-import com.smartdevicelink.proxy.rpc.DeviceInfo;
-import com.smartdevicelink.proxy.rpc.EndAudioPassThru;
-import com.smartdevicelink.proxy.rpc.GetVehicleData;
-import com.smartdevicelink.proxy.rpc.Image;
-import com.smartdevicelink.proxy.rpc.ListFiles;
-import com.smartdevicelink.proxy.rpc.MenuParams;
-import com.smartdevicelink.proxy.rpc.PerformAudioPassThru;
-import com.smartdevicelink.proxy.rpc.PerformInteraction;
-import com.smartdevicelink.proxy.rpc.PutFile;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
-import com.smartdevicelink.proxy.rpc.ScrollableMessage;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.proxy.rpc.SetAppIcon;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayout;
-import com.smartdevicelink.proxy.rpc.SetGlobalProperties;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimer;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.Slider;
-import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.Speak;
-import com.smartdevicelink.proxy.rpc.StartTime;
-import com.smartdevicelink.proxy.rpc.SubscribeButton;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleData;
-import com.smartdevicelink.proxy.rpc.SystemRequest;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButton;
-import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData;
-import com.smartdevicelink.proxy.rpc.VrHelpItem;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.proxy.rpc.enums.RequestType;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
-
-/**
- * @deprecated Use RPC constructors directly instead
- */
-@Deprecated
-public class RPCRequestFactory {
-
- public static final int SDL_MSG_MAJOR_VERSION = 1;
- public static final int SDL_MSG_MINOR_VERSION = 0;
-
- public static SystemRequest buildSystemRequest(
- String data, Integer correlationID) {
-
- if(data == null) return null;
-
- SystemRequest msg = new SystemRequest();
- msg.setRequestType(RequestType.PROPRIETARY);
- msg.setCorrelationID(correlationID);
- msg.setBulkData(data.getBytes());
- return msg;
- }
-
- public static SystemRequest buildSystemRequestLegacy(
- Vector<String> data, Integer correlationID) {
-
- if(data == null) return null;
-
- SystemRequest msg = new SystemRequest(true);
- msg.setCorrelationID(correlationID);
- msg.setLegacyData(data);
- return msg;
- }
-
- public static AddCommand buildAddCommand(Integer commandID,
- String menuText, Integer parentID, Integer position,
- Vector<String> vrCommands, Image cmdIcon, Integer correlationID) {
- AddCommand msg = new AddCommand();
- msg.setCorrelationID(correlationID);
- msg.setCmdID(commandID);
- msg.setVrCommands(vrCommands);
-
- if (cmdIcon != null) msg.setCmdIcon(cmdIcon);
-
- if(menuText != null || parentID != null || position != null) {
- MenuParams menuParams = new MenuParams();
- menuParams.setMenuName(menuText);
- menuParams.setPosition(position);
- menuParams.setParentID(parentID);
- msg.setMenuParams(menuParams);
- }
-
- return msg;
- }
-
- public static AddCommand buildAddCommand(Integer commandID,
- String menuText, Integer parentID, Integer position,
- Vector<String> vrCommands, String IconValue, ImageType IconType,
- Integer correlationID) {
- AddCommand msg = new AddCommand();
- msg.setCorrelationID(correlationID);
- msg.setCmdID(commandID);
-
- if (vrCommands != null) msg.setVrCommands(vrCommands);
-
- Image cmdIcon = null;
-
- if (IconValue != null && IconType != null)
- {
- cmdIcon = new Image();
- cmdIcon.setValue(IconValue);
- cmdIcon.setImageType(IconType);
- }
-
- if (cmdIcon != null) msg.setCmdIcon(cmdIcon);
-
- if(menuText != null || parentID != null || position != null) {
- MenuParams menuParams = new MenuParams();
- menuParams.setMenuName(menuText);
- menuParams.setPosition(position);
- menuParams.setParentID(parentID);
- msg.setMenuParams(menuParams);
- }
-
- return msg;
- }
-
- public static AddCommand buildAddCommand(Integer commandID,
- String menuText, Integer parentID, Integer position,
- Vector<String> vrCommands, Integer correlationID) {
- AddCommand msg = new AddCommand();
- msg.setCorrelationID(correlationID);
- msg.setCmdID(commandID);
- msg.setVrCommands(vrCommands);
-
- if(menuText != null || parentID != null || position != null) {
- MenuParams menuParams = new MenuParams();
- menuParams.setMenuName(menuText);
- menuParams.setPosition(position);
- menuParams.setParentID(parentID);
- msg.setMenuParams(menuParams);
- }
-
- return msg;
- }
-
- public static AddCommand buildAddCommand(Integer commandID,
- String menuText, Vector<String> vrCommands, Integer correlationID) {
- AddCommand msg = buildAddCommand(commandID, menuText, null, null,
- vrCommands, correlationID);
- return msg;
- }
-
- public static AddCommand buildAddCommand(Integer commandID,
- Vector<String> vrCommands, Integer correlationID) {
- AddCommand msg = new AddCommand();
- msg.setCorrelationID(correlationID);
- msg.setCmdID(commandID);
- msg.setVrCommands(vrCommands);
-
- return msg;
- }
-
- public static AddSubMenu buildAddSubMenu(Integer menuID, String menuName,
- Integer correlationID) {
- AddSubMenu msg = buildAddSubMenu(menuID, menuName, null, correlationID);
- return msg;
- }
-
- public static AddSubMenu buildAddSubMenu(Integer menuID, String menuName,
- Integer position, Integer correlationID) {
- AddSubMenu msg = new AddSubMenu();
- msg.setCorrelationID(correlationID);
- msg.setMenuName(menuName);
- msg.setMenuID(menuID);
- msg.setPosition(position);
-
- return msg;
- }
-
- public static Alert buildAlert(String ttsText, Boolean playTone,
- Vector<SoftButton> softButtons, Integer correlationID) {
- Vector<TTSChunk> chunks = TTSChunkFactory
- .createSimpleTTSChunks(ttsText);
- Alert msg = buildAlert(chunks, null, null, null, playTone, null, softButtons,
- correlationID);
- return msg;
- }
-
- public static Alert buildAlert(String alertText1, String alertText2,
- String alertText3, Integer duration, Vector<SoftButton> softButtons,
- Integer correlationID) {
- Alert msg = buildAlert((Vector<TTSChunk>) null, alertText1, alertText2,
- alertText3, null, duration, softButtons, correlationID);
- return msg;
- }
-
- public static Alert buildAlert(String ttsText, String alertText1,
- String alertText2, String alertText3, Boolean playTone,
- Integer duration, Vector<SoftButton> softButtons, Integer correlationID) {
- Vector<TTSChunk> chunks = TTSChunkFactory
- .createSimpleTTSChunks(ttsText);
- Alert msg = buildAlert(chunks, alertText1, alertText2, alertText3,
- playTone, duration, softButtons, correlationID);
- return msg;
- }
-
- public static Alert buildAlert(Vector<TTSChunk> chunks, Boolean playTone,
- Vector<SoftButton> softButtons, Integer correlationID) {
- Alert msg = buildAlert(chunks, null, null, null, playTone, null, softButtons, correlationID);
- return msg;
- }
-
- public static Alert buildAlert(Vector<TTSChunk> ttsChunks,
- String alertText1, String alertText2, String alertText3,
- Boolean playTone, Integer duration, Vector<SoftButton> softButtons,
- Integer correlationID) {
- Alert msg = new Alert();
- msg.setCorrelationID(correlationID);
- msg.setAlertText1(alertText1);
- msg.setAlertText2(alertText2);
- msg.setAlertText3(alertText3);
- msg.setDuration(duration);
- msg.setPlayTone(playTone);
- msg.setTtsChunks(ttsChunks);
- msg.setSoftButtons(softButtons);
-
- return msg;
- }
-
- public static Alert buildAlert(String ttsText, Boolean playTone,
- Integer correlationID) {
- Vector<TTSChunk> chunks = TTSChunkFactory
- .createSimpleTTSChunks(ttsText);
- Alert msg = buildAlert(chunks, null, null, playTone, null,
- correlationID);
- return msg;
- }
-
- public static Alert buildAlert(String alertText1, String alertText2,
- Integer duration, Integer correlationID) {
- Alert msg = buildAlert((Vector<TTSChunk>) null, alertText1, alertText2,
- null, duration, correlationID);
- return msg;
- }
-
- public static Alert buildAlert(String ttsText, String alertText1,
- String alertText2, Boolean playTone, Integer duration,
- Integer correlationID) {
- Vector<TTSChunk> chunks = TTSChunkFactory
- .createSimpleTTSChunks(ttsText);
- Alert msg = buildAlert(chunks, alertText1, alertText2, playTone,
- duration, correlationID);
- return msg;
- }
-
- public static Alert buildAlert(Vector<TTSChunk> chunks, Boolean playTone,
- Integer correlationID) {
- Alert msg = buildAlert(chunks, null, null, playTone, null,
- correlationID);
- return msg;
- }
-
- public static Alert buildAlert(Vector<TTSChunk> ttsChunks,
- String alertText1, String alertText2, Boolean playTone,
- Integer duration, Integer correlationID) {
- Alert msg = new Alert();
- msg.setCorrelationID(correlationID);
- msg.setAlertText1(alertText1);
- msg.setAlertText2(alertText2);
- msg.setDuration(duration);
- msg.setPlayTone(playTone);
- msg.setTtsChunks(ttsChunks);
-
- return msg;
- }
-
- public static CreateInteractionChoiceSet buildCreateInteractionChoiceSet(
- Vector<Choice> choiceSet, Integer interactionChoiceSetID,
- Integer correlationID) {
- CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet();
- msg.setChoiceSet(choiceSet);
- msg.setInteractionChoiceSetID(interactionChoiceSetID);
- msg.setCorrelationID(correlationID);
- return msg;
- }
-
- public static DeleteCommand buildDeleteCommand(Integer commandID,
- Integer correlationID) {
- DeleteCommand msg = new DeleteCommand();
- msg.setCmdID(commandID);
- msg.setCorrelationID(correlationID);
- return msg;
- }
-
- public static DeleteFile buildDeleteFile(String sdlFileName,
- Integer correlationID) {
- DeleteFile deleteFile = new DeleteFile();
- deleteFile.setCorrelationID(correlationID);
- deleteFile.setSdlFileName(sdlFileName);
- return deleteFile;
- }
-
- public static DeleteInteractionChoiceSet buildDeleteInteractionChoiceSet(
- Integer interactionChoiceSetID, Integer correlationID) {
- DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet();
- msg.setInteractionChoiceSetID(interactionChoiceSetID);
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- public static DeleteSubMenu buildDeleteSubMenu(Integer menuID,
- Integer correlationID) {
- DeleteSubMenu msg = new DeleteSubMenu();
- msg.setCorrelationID(correlationID);
- msg.setMenuID(menuID);
-
- return msg;
- }
-
- public static ListFiles buildListFiles(Integer correlationID) {
- ListFiles listFiles = new ListFiles();
- listFiles.setCorrelationID(correlationID);
- return listFiles;
- }
-
- public static PerformInteraction buildPerformInteraction(
- Vector<TTSChunk> initChunks, String displayText,
- Vector<Integer> interactionChoiceSetIDList,
- Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
- InteractionMode interactionMode, Integer timeout,
- Vector<VrHelpItem> vrHelp, Integer correlationID) {
- PerformInteraction msg = new PerformInteraction();
- msg.setInitialPrompt(initChunks);
- msg.setInitialText(displayText);
- msg.setInteractionChoiceSetIDList(interactionChoiceSetIDList);
- msg.setInteractionMode(interactionMode);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setTimeoutPrompt(timeoutChunks);
- msg.setVrHelp(vrHelp);
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- public static PerformInteraction buildPerformInteraction(
- String initPrompt, String displayText,
- Vector<Integer> interactionChoiceSetIDList,
- String helpPrompt, String timeoutPrompt,
- InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
- Integer correlationID) {
- Vector<TTSChunk> initChunks = TTSChunkFactory
- .createSimpleTTSChunks(initPrompt);
- Vector<TTSChunk> helpChunks = TTSChunkFactory
- .createSimpleTTSChunks(helpPrompt);
- Vector<TTSChunk> timeoutChunks = TTSChunkFactory
- .createSimpleTTSChunks(timeoutPrompt);
- return buildPerformInteraction(initChunks,
- displayText, interactionChoiceSetIDList, helpChunks,
- timeoutChunks, interactionMode, timeout, vrHelp, correlationID);
- }
-
- public static PerformInteraction buildPerformInteraction(
- String initPrompt, String displayText,
- Integer interactionChoiceSetID,
- String helpPrompt, String timeoutPrompt,
- InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
- Integer correlationID) {
- Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
- interactionChoiceSetIDs.add(interactionChoiceSetID);
-
- return buildPerformInteraction(
- initPrompt, displayText, interactionChoiceSetIDs,
- helpPrompt, timeoutPrompt, interactionMode,
- timeout, vrHelp, correlationID);
- }
-
- public static PerformInteraction buildPerformInteraction(String initPrompt,
- String displayText, Integer interactionChoiceSetID, Vector<VrHelpItem> vrHelp,
- Integer correlationID) {
-
- return buildPerformInteraction(initPrompt, displayText,
- interactionChoiceSetID, null, null,
- InteractionMode.BOTH, null, vrHelp, correlationID);
- }
-
- public static PerformInteraction buildPerformInteraction(
- Vector<TTSChunk> initChunks, String displayText,
- Vector<Integer> interactionChoiceSetIDList,
- Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
- InteractionMode interactionMode, Integer timeout,
- Integer correlationID) {
- PerformInteraction msg = new PerformInteraction();
- msg.setInitialPrompt(initChunks);
- msg.setInitialText(displayText);
- msg.setInteractionChoiceSetIDList(interactionChoiceSetIDList);
- msg.setInteractionMode(interactionMode);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setTimeoutPrompt(timeoutChunks);
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- public static PerformInteraction buildPerformInteraction(
- String initPrompt, String displayText,
- Vector<Integer> interactionChoiceSetIDList,
- String helpPrompt, String timeoutPrompt,
- InteractionMode interactionMode, Integer timeout,
- Integer correlationID) {
- Vector<TTSChunk> initChunks = TTSChunkFactory
- .createSimpleTTSChunks(initPrompt);
- Vector<TTSChunk> helpChunks = TTSChunkFactory
- .createSimpleTTSChunks(helpPrompt);
- Vector<TTSChunk> timeoutChunks = TTSChunkFactory
- .createSimpleTTSChunks(timeoutPrompt);
- return buildPerformInteraction(initChunks,
- displayText, interactionChoiceSetIDList, helpChunks,
- timeoutChunks, interactionMode, timeout, correlationID);
- }
-
- public static PerformInteraction buildPerformInteraction(
- String initPrompt, String displayText,
- Integer interactionChoiceSetID,
- String helpPrompt, String timeoutPrompt,
- InteractionMode interactionMode, Integer timeout,
- Integer correlationID) {
- Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
- interactionChoiceSetIDs.add(interactionChoiceSetID);
-
- return buildPerformInteraction(
- initPrompt, displayText, interactionChoiceSetIDs,
- helpPrompt, timeoutPrompt, interactionMode,
- timeout, correlationID);
- }
-
- public static PerformInteraction buildPerformInteraction(String initPrompt,
- String displayText, Integer interactionChoiceSetID,
- Integer correlationID) {
-
- return buildPerformInteraction(initPrompt, displayText,
- interactionChoiceSetID, null, null,
- InteractionMode.BOTH, null, correlationID);
- }
-
- @Deprecated
- public static PerformInteraction buildPerformInteraction(
- Vector<TTSChunk> initChunks, String displayText,
- Vector<Integer> interactionChoiceSetIDList,
- Vector<TTSChunk> helpChunks, InteractionMode interactionMode,
- Integer timeout, Integer correlationID) {
- PerformInteraction msg = new PerformInteraction();
- msg.setInitialPrompt(initChunks);
- msg.setInitialText(displayText);
- msg.setInteractionChoiceSetIDList(interactionChoiceSetIDList);
- msg.setInteractionMode(interactionMode);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setCorrelationID(correlationID);
- return msg;
- }
-
- @Deprecated
- public static PerformInteraction buildPerformInteraction(String initPrompt,
- String displayText, Vector<Integer> interactionChoiceSetIDList,
- String helpPrompt, InteractionMode interactionMode,
- Integer timeout, Integer correlationID) {
- Vector<TTSChunk> initChunks = TTSChunkFactory
- .createSimpleTTSChunks(initPrompt);
- Vector<TTSChunk> helpChunks = TTSChunkFactory
- .createSimpleTTSChunks(helpPrompt);
- PerformInteraction msg = buildPerformInteraction(initChunks,
- displayText, interactionChoiceSetIDList, helpChunks,
- interactionMode, timeout, correlationID);
- return msg;
- }
-
- public static PutFile buildPutFile(String sdlFileName, FileType fileType,
- Boolean persistentFile, byte[] fileData, Integer correlationID) {
- PutFile putFile = new PutFile();
- putFile.setCorrelationID(correlationID);
- putFile.setSdlFileName(sdlFileName);
- putFile.setFileType(fileType);
- putFile.setPersistentFile(persistentFile);
- putFile.setBulkData(fileData);
- putFile.setCRC(fileData);
- return putFile;
- }
-
- @Deprecated
- public static PutFile buildPutFile(String sdlFileName, Integer iOffset, Integer iLength) {
- PutFile putFile = new PutFile();
- putFile.setCorrelationID(10000);
- putFile.setSdlFileName(sdlFileName);
- putFile.setFileType(FileType.BINARY);
- putFile.setSystemFile(true);
- putFile.setOffset(iOffset);
- putFile.setLength(iLength);
- return putFile;
- }
-
- public static PutFile buildPutFile(String sdlFileName, Long iOffset, Long iLength) {
- PutFile putFile = new PutFile();
- putFile.setCorrelationID(10000);
- putFile.setSdlFileName(sdlFileName);
- putFile.setFileType(FileType.BINARY);
- putFile.setSystemFile(true);
- putFile.setOffset(iOffset);
- putFile.setLength(iLength);
- return putFile;
- }
-
- @Deprecated
- public static PutFile buildPutFile(String syncFileName, Integer iOffset, Integer iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) {
- PutFile putFile = new PutFile();
- putFile.setCorrelationID(10000);
- putFile.setSdlFileName(syncFileName);
- putFile.setFileType(fileType);
- putFile.setPersistentFile(bPersistentFile);
- putFile.setSystemFile(bSystemFile);
- putFile.setOffset(iOffset);
- putFile.setLength(iLength);
- return putFile;
- }
-
- public static PutFile buildPutFile(String syncFileName, Long iOffset, Long iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) {
- PutFile putFile = new PutFile();
- putFile.setCorrelationID(10000);
- putFile.setSdlFileName(syncFileName);
- putFile.setFileType(fileType);
- putFile.setPersistentFile(bPersistentFile);
- putFile.setSystemFile(bSystemFile);
- putFile.setOffset(iOffset);
- putFile.setLength(iLength);
- return putFile;
- }
-
- @Deprecated
- public static PutFile buildPutFile(String sdlFileName, Integer iOffset, Integer iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Integer iCorrelationID) {
- PutFile putFile = new PutFile();
- putFile.setCorrelationID(iCorrelationID);
- putFile.setSdlFileName(sdlFileName);
- putFile.setFileType(fileType);
- putFile.setPersistentFile(bPersistentFile);
- putFile.setSystemFile(bSystemFile);
- putFile.setOffset(iOffset);
- putFile.setLength(iLength);
- return putFile;
- }
-
- public static PutFile buildPutFile(String sdlFileName, Long iOffset, Long iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Boolean isPayloadProtected, Integer iCorrelationID) {
- PutFile putFile = new PutFile();
- putFile.setCorrelationID(iCorrelationID);
- putFile.setSdlFileName(sdlFileName);
- putFile.setFileType(fileType);
- putFile.setPersistentFile(bPersistentFile);
- putFile.setSystemFile(bSystemFile);
- putFile.setOffset(iOffset);
- putFile.setLength(iLength);
- putFile.setPayloadProtected(isPayloadProtected);
- return putFile;
- }
-
- public static RegisterAppInterface buildRegisterAppInterface(String appName, String appID) {
- return buildRegisterAppInterface(appName, false, appID);
- }
-
- public static RegisterAppInterface buildRegisterAppInterface(
- String appName, Boolean isMediaApp, String appID) {
-
- return buildRegisterAppInterface(null, appName, null, null, null, isMediaApp,
- null, null, null, appID, null, null);
- }
-
- public static RegisterAppInterface buildRegisterAppInterface(
- SdlMsgVersion sdlMsgVersion, String appName, Vector<TTSChunk> ttsName,
- String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
- String appID, Integer correlationID, DeviceInfo deviceInfo) {
- RegisterAppInterface msg = new RegisterAppInterface();
-
- if (correlationID == null) {
- correlationID = 1;
- }
- msg.setCorrelationID(correlationID);
-
- if (sdlMsgVersion == null) {
- sdlMsgVersion = new SdlMsgVersion();
- sdlMsgVersion.setMajorVersion(Integer.valueOf(SDL_MSG_MAJOR_VERSION));
- sdlMsgVersion.setMinorVersion(Integer.valueOf(SDL_MSG_MINOR_VERSION));
- }
- msg.setSdlMsgVersion(sdlMsgVersion);
- msg.setDeviceInfo(deviceInfo);
- msg.setAppName(appName);
-
- msg.setTtsName(ttsName);
-
- if (ngnMediaScreenAppName == null) {
- ngnMediaScreenAppName = appName;
- }
-
- msg.setNgnMediaScreenAppName(ngnMediaScreenAppName);
-
- if (vrSynonyms == null) {
- vrSynonyms = new Vector<String>();
- vrSynonyms.add(appName);
- }
- msg.setVrSynonyms(vrSynonyms);
-
- msg.setIsMediaApplication(isMediaApp);
-
- if (languageDesired == null) {
- languageDesired = Language.EN_US;
- }
- msg.setLanguageDesired(languageDesired);
-
- if (hmiDisplayLanguageDesired == null) {
- hmiDisplayLanguageDesired = Language.EN_US;
- }
-
- msg.setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
-
- msg.setAppHMIType(appType);
-
- msg.setAppID(appID);
-
- return msg;
- }
-
- public static SetAppIcon buildSetAppIcon(String sdlFileName,
- Integer correlationID) {
- SetAppIcon setAppIcon = new SetAppIcon();
- setAppIcon.setCorrelationID(correlationID);
- setAppIcon.setSdlFileName(sdlFileName);
- return setAppIcon;
- }
-
- public static SetGlobalProperties buildSetGlobalProperties(
- String helpPrompt, String timeoutPrompt, Integer correlationID) {
- return buildSetGlobalProperties(TTSChunkFactory
- .createSimpleTTSChunks(helpPrompt), TTSChunkFactory
- .createSimpleTTSChunks(timeoutPrompt), correlationID);
- }
-
- public static SetGlobalProperties buildSetGlobalProperties(
- Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
- Integer correlationID) {
- SetGlobalProperties req = new SetGlobalProperties();
- req.setCorrelationID(correlationID);
-
- req.setHelpPrompt(helpChunks);
- req.setTimeoutPrompt(timeoutChunks);
-
- return req;
- }
-
- public static SetGlobalProperties buildSetGlobalProperties(
- String helpPrompt, String timeoutPrompt, String vrHelpTitle,
- Vector<VrHelpItem> vrHelp, Integer correlationID) {
- return buildSetGlobalProperties(TTSChunkFactory
- .createSimpleTTSChunks(helpPrompt), TTSChunkFactory
- .createSimpleTTSChunks(timeoutPrompt), vrHelpTitle, vrHelp, correlationID);
- }
-
- public static SetGlobalProperties buildSetGlobalProperties(
- Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
- String vrHelpTitle, Vector<VrHelpItem> vrHelp,
- Integer correlationID) {
- SetGlobalProperties req = new SetGlobalProperties();
- req.setCorrelationID(correlationID);
-
- req.setHelpPrompt(helpChunks);
- req.setTimeoutPrompt(timeoutChunks);
-
- req.setVrHelpTitle(vrHelpTitle);
- req.setVrHelp(vrHelp);
-
- return req;
- }
-
- public static SetMediaClockTimer buildSetMediaClockTimer(Integer hours,
- Integer minutes, Integer seconds, UpdateMode updateMode,
- Integer correlationID) {
-
- SetMediaClockTimer msg = new SetMediaClockTimer();
- if (hours != null || minutes != null || seconds != null) {
- StartTime startTime = new StartTime();
- msg.setStartTime(startTime);
- startTime.setHours(hours);
- startTime.setMinutes(minutes);
- startTime.setSeconds(seconds);
- }
-
- msg.setUpdateMode(updateMode);
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- @Deprecated
- public static SetMediaClockTimer buildSetMediaClockTimer(
- UpdateMode updateMode, Integer correlationID) {
- Integer hours = null;
- Integer minutes = null;
- Integer seconds = null;
-
- SetMediaClockTimer msg = buildSetMediaClockTimer(hours, minutes,
- seconds, updateMode, correlationID);
- return msg;
- }
-
- @SuppressWarnings("deprecation")
- public static Show buildShow(String mainText1, String mainText2,
- String mainText3, String mainText4,
- String statusBar, String mediaClock, String mediaTrack,
- Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets,
- TextAlignment alignment, Integer correlationID) {
- Show msg = new Show();
- msg.setCorrelationID(correlationID);
- msg.setMainField1(mainText1);
- msg.setMainField2(mainText2);
- msg.setStatusBar(statusBar);
- msg.setMediaClock(mediaClock);
- msg.setMediaTrack(mediaTrack);
- msg.setAlignment(alignment);
- msg.setMainField3(mainText3);
- msg.setMainField4(mainText4);
- msg.setGraphic(graphic);
- msg.setSoftButtons(softButtons);
- msg.setCustomPresets(customPresets);
-
- return msg;
- }
-
- public static Show buildShow(String mainText1, String mainText2, String mainText3, String mainText4,
- TextAlignment alignment, Integer correlationID) {
- Show msg = buildShow(mainText1, mainText2, mainText3, mainText4, null, null, null, null, null, null, alignment,
- correlationID);
- return msg;
- }
-
- @SuppressWarnings("deprecation")
- public static Show buildShow(String mainText1, String mainText2,
- String statusBar, String mediaClock, String mediaTrack,
- TextAlignment alignment, Integer correlationID) {
- Show msg = new Show();
- msg.setCorrelationID(correlationID);
- msg.setMainField1(mainText1);
- msg.setMainField2(mainText2);
- msg.setStatusBar(statusBar);
- msg.setMediaClock(mediaClock);
- msg.setMediaTrack(mediaTrack);
- msg.setAlignment(alignment);
-
- return msg;
- }
-
- public static Show buildShow(String mainText1, String mainText2,
- TextAlignment alignment, Integer correlationID) {
- Show msg = buildShow(mainText1, mainText2, null, null, null, alignment,
- correlationID);
- return msg;
- }
-
- public static Speak buildSpeak(String ttsText, Integer correlationID) {
- Speak msg = buildSpeak(TTSChunkFactory.createSimpleTTSChunks(ttsText),
- correlationID);
- return msg;
- }
-
- public static Speak buildSpeak(Vector<TTSChunk> ttsChunks,
- Integer correlationID) {
-
- Speak msg = new Speak();
- msg.setCorrelationID(correlationID);
-
- msg.setTtsChunks(ttsChunks);
-
- return msg;
- }
-
- public static SubscribeButton buildSubscribeButton(ButtonName buttonName,
- Integer correlationID) {
-
- SubscribeButton msg = new SubscribeButton();
- msg.setCorrelationID(correlationID);
- msg.setButtonName(buttonName);
-
- return msg;
- }
-
- public static UnregisterAppInterface buildUnregisterAppInterface(
- Integer correlationID) {
- UnregisterAppInterface msg = new UnregisterAppInterface();
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- public static UnsubscribeButton buildUnsubscribeButton(
- ButtonName buttonName, Integer correlationID) {
-
- UnsubscribeButton msg = new UnsubscribeButton();
- msg.setCorrelationID(correlationID);
- msg.setButtonName(buttonName);
-
- return msg;
- }
-
- @SuppressWarnings("deprecation")
- public static SubscribeVehicleData BuildSubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
- boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID)
- {
- SubscribeVehicleData msg = new SubscribeVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- @SuppressWarnings("deprecation")
- public static UnsubscribeVehicleData BuildUnsubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
- boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID)
- {
- UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- @SuppressWarnings("deprecation")
- public static GetVehicleData BuildGetVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure,
- boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID)
- {
- GetVehicleData msg = new GetVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setVin(vin);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- public static ScrollableMessage BuildScrollableMessage(String scrollableMessageBody, Integer timeout, Vector<SoftButton> softButtons, Integer correlationID)
- {
- ScrollableMessage msg = new ScrollableMessage();
- msg.setCorrelationID(correlationID);
- msg.setScrollableMessageBody(scrollableMessageBody);
- msg.setTimeout(timeout);
- msg.setSoftButtons(softButtons);
-
- return msg;
- }
-
- public static Slider BuildSlider(Integer numTicks, Integer position, String sliderHeader, Vector<String> sliderFooter, Integer timeout, Integer correlationID)
- {
- Slider msg = new Slider();
- msg.setCorrelationID(correlationID);
- msg.setNumTicks(numTicks);
- msg.setPosition(position);
- msg.setSliderHeader(sliderHeader);
- msg.setSliderFooter(sliderFooter);
- msg.setTimeout(timeout);
-
- return msg;
- }
-
- public static ChangeRegistration BuildChangeRegistration(Language language, Language hmiDisplayLanguage, Integer correlationID)
- {
- ChangeRegistration msg = new ChangeRegistration();
- msg.setCorrelationID(correlationID);
- msg.setLanguage(language);
- msg.setHmiDisplayLanguage(hmiDisplayLanguage);
-
- return msg;
- }
-
- public static SetDisplayLayout BuildSetDisplayLayout(String displayLayout, Integer correlationID)
- {
- SetDisplayLayout msg = new SetDisplayLayout();
- msg.setCorrelationID(correlationID);
- msg.setDisplayLayout(displayLayout);
-
- return msg;
- }
-
- public static PerformAudioPassThru BuildPerformAudioPassThru(String ttsText, String audioPassThruDisplayText1, String audioPassThruDisplayText2,
- SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample,
- AudioType audioType, Boolean muteAudio, Integer correlationID)
- {
- Vector<TTSChunk> chunks = TTSChunkFactory
- .createSimpleTTSChunks(ttsText);
-
- PerformAudioPassThru msg = BuildPerformAudioPassThru(chunks, audioPassThruDisplayText1, audioPassThruDisplayText2,
- samplingRate, maxDuration, bitsPerSample,audioType, muteAudio, correlationID);
-
- return msg;
- }
-
- public static PerformAudioPassThru BuildPerformAudioPassThru(Vector<TTSChunk> initialPrompt, String audioPassThruDisplayText1, String audioPassThruDisplayText2,
- SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample,
- AudioType audioType, Boolean muteAudio, Integer correlationID)
- {
- PerformAudioPassThru msg = new PerformAudioPassThru();
- msg.setCorrelationID(correlationID);
- msg.setInitialPrompt(initialPrompt);
- msg.setAudioPassThruDisplayText1(audioPassThruDisplayText1);
- msg.setAudioPassThruDisplayText2(audioPassThruDisplayText2);
- msg.setSamplingRate(samplingRate);
- msg.setMaxDuration(maxDuration);
- msg.setBitsPerSample(bitsPerSample);
- msg.setAudioType(audioType);
- msg.setMuteAudio(muteAudio);
-
- return msg;
- }
-
- public static EndAudioPassThru BuildEndAudioPassThru(Integer correlationID)
- {
- EndAudioPassThru msg = new EndAudioPassThru();
- msg.setCorrelationID(correlationID);
-
- return msg;
- }
-
- public static DeviceInfo BuildDeviceInfo(String carrierName)
- {
- DeviceInfo msg = new DeviceInfo();
- msg.setHardware(android.os.Build.MODEL);
- msg.setOs(DeviceInfo.DEVICE_OS);
- msg.setOsVersion(Build.VERSION.RELEASE);
- msg.setCarrier(carrierName);
- return msg;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
deleted file mode 100644
index a7c0ed188..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- *
- */
-package com.smartdevicelink.proxy;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Result sent by SDL after an RPC is processed, consists of four parts:
- * <ul>
- * <li>
- * CorrelationID:
- * <ul>
- * An integer value correlating the response to the corresponding request.
- * </ul>
- * </li> <li>Success:
- * <ul>
- * A Boolean indicating whether the original request was successfully processed.
- * </ul>
- * </li> <li>ResultCode:
- * <ul>
- *
- * <p>The result code provides additional information about a response returning a
- * failed outcome.</p>
- *
- *
- * <p>Any response can have at least one, or possibly more, of the following result
- * code values: SUCCESS, INVALID_DATA, OUT_OF_MEMORY, TOO_MANY_PENDING_REQUESTS,
- * APPLICATION_NOT_REGISTERED, GENERIC_ERROR,REJECTED.</p>
- *
- *
- * <p>Any additional result codes for a given operation can be found in related
- * RPCs</p>
- *
- * </ul>
- * </li> <li>Info:
- * <ul>
- * A string of text representing additional information returned from SDL. This
- * could be useful in debugging.
- * </ul>
- * </li>
- * </ul>
- */
-public class RPCResponse extends RPCMessage {
- public static final String KEY_SUCCESS = "success";
- public static final String KEY_INFO = "info";
- public static final String KEY_RESULT_CODE = "resultCode";
- /**
- *<p>Constructs a newly allocated RPCResponse object using function name</p>
- *@param functionName a string that indicates the function's name
- */
- public RPCResponse(String functionName) {
- super(functionName, RPCMessage.KEY_RESPONSE);
- }
- /**
- *<p>Constructs a newly allocated RPCResponse object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public RPCResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *<p>Constructs a newly allocated RPCResponse object using a RPCMessage object</p>
- *@param rpcMsg The {@linkplain RPCMessage} to use
- */
- public RPCResponse(RPCMessage rpcMsg) {
- super(preprocessMsg(rpcMsg));
- }
-
- static RPCMessage preprocessMsg (RPCMessage rpcMsg) {
- if (rpcMsg.getMessageType() != RPCMessage.KEY_RESPONSE) {
- rpcMsg.messageType = RPCMessage.KEY_RESPONSE;
- }
-
- return rpcMsg;
- }
-
- /**
- * <p>
- * Returns correlationID the ID of the request
- * </p>
- *
- * @return int the ID of the request
- */
- public Integer getCorrelationID() {
- return (Integer)function.get(RPCMessage.KEY_CORRELATION_ID);
- }
-
- /**
- * <p>
- * Set the correlationID
- * </p>
- *
- * @param correlationID
- * the ID of the response
- */
- public void setCorrelationID(Integer correlationID) {
- if (correlationID != null) {
- function.put(RPCMessage.KEY_CORRELATION_ID, correlationID );
- } else {
- function.remove(RPCMessage.KEY_CORRELATION_ID);
- }
- }
- /**
- * <p>
- * Returns Success whether the request is successfully processed
- * </p>
- *
- * @return Boolean the status of whether the request is successfully done
- */
- public Boolean getSuccess() {
- return (Boolean) parameters.get( RPCResponse.KEY_SUCCESS );
- }
- /**
- * <p>
- * Set the Success status
- * </p>
- *
- * @param success
- * whether the request is successfully processed
- */
- public void setSuccess( @NonNull Boolean success ) {
- if (success != null) {
- parameters.put(RPCResponse.KEY_SUCCESS, success );
- }
- }
- /**
- * <p>
- * Returns ResultCode additional information about a response returning a failed outcome
- * </p>
- *
- * @return {@linkplain Result} the status of whether the request is successfully done
- */
- public Result getResultCode() {
- Object obj = parameters.get(RPCResponse.KEY_RESULT_CODE);
- if (obj instanceof Result) {
- return (Result) obj;
- } else if (obj instanceof String) {
- return Result.valueForString((String) obj);
- }
- return null;
- }
- /**
- * <p>
- * Set the additional information about a response returning a failed outcome
- * </p>
- *
- * @param resultCode
- * whether the request is successfully processed
- */
- public void setResultCode( @NonNull Result resultCode ) {
- if (resultCode != null) {
- parameters.put(RPCResponse.KEY_RESULT_CODE, resultCode );
- }
- }
- /**
- * <p>
- * Returns a string of text representing additional information returned from SDL
- * </p>
- *
- * @return String A string of text representing additional information returned from SDL
- */
- public String getInfo() {
- return (String) parameters.get( RPCResponse.KEY_INFO );
- }
- /**
- * <p>
- * Set a string of text representing additional information returned from SDL
- * </p>
- *
- * @param info
- * a string of text representing additional information returned from SDL
- */
- public void setInfo( String info ) {
- if (info != null) {
- parameters.put(RPCResponse.KEY_INFO, info );
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java
deleted file mode 100644
index 0e2af0bc6..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import com.smartdevicelink.streaming.StreamRPCPacketizer;
-
-public class RPCStreamController {
- private StreamRPCPacketizer rpcPacketizer;
- private Integer iCorrelationID;
-
- public RPCStreamController(StreamRPCPacketizer rpcPacketizer, Integer iCorrelationID)
- {
- this.rpcPacketizer = rpcPacketizer;
- this.iCorrelationID = iCorrelationID;
- }
-
- public Integer getCorrelationID()
- {
- return iCorrelationID;
- }
-
- public void pause()
- {
- rpcPacketizer.pause();
- }
- public void resume()
- {
- rpcPacketizer.resume();
- }
- public void stop()
- {
- rpcPacketizer.onPutFileStreamError(null, "Stop Putfile Stream Requested");
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
deleted file mode 100644
index f23fac781..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
+++ /dev/null
@@ -1,322 +0,0 @@
-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;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Set;
-
-public class RPCStruct {
- public static final String KEY_BULK_DATA = "bulkData";
- public static final String KEY_PROTECTED = "protected";
-
- 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
- return store.contains(key);
- }
-
- public Hashtable<String,Object> getStore () { // for unit testing
- return store;
- }
-
- public RPCStruct() {
- store = new Hashtable<String, Object>();
- }
-
- protected RPCStruct(RPCStruct rpcs) {
- this.store = rpcs.store;
- }
-
- public RPCStruct(Hashtable<String, Object> hashtable) {
- store = hashtable;
- //store = (Hashtable<String, Object>) ObjectCopier.copy(hashtable);
- }
-
- public void deserializeJSON(JSONObject jsonObject) throws JSONException {
- store = JsonRPCMarshaller.deserializeJSONObject(jsonObject);
-
- }
-
- // deserializeJSONObject method moved to JsonRPCMarshaller for consistency
- // Keep reference here for backwards compatibility
- @Deprecated
- public static Hashtable<String, Object> deserializeJSONObject(JSONObject jsonObject)
- throws JSONException {
- return JsonRPCMarshaller.deserializeJSONObject(jsonObject);
- }
-
- public JSONObject serializeJSON() throws JSONException {
- return JsonRPCMarshaller.serializeHashtable(store);
- }
-
- @SuppressWarnings("unchecked")
- 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);
- return JsonRPCMarshaller.serializeHashtable(parameters);
- } 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;
- }
-
- if (parameters != null) {
- 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;
- }
-
- public void setBulkData(byte[] bulkData) {
- if (bulkData != null) {
- this._bulkData = new byte[bulkData.length];
- System.arraycopy(bulkData, 0, _bulkData, 0, bulkData.length);
- }
- else{
- this._bulkData = null;
- }
- }
-
- public void setPayloadProtected(Boolean bVal) {
- protectedPayload = bVal;
- }
-
- public Boolean isPayloadProtected() {
- return protectedPayload;
- }
-
- protected String getMessageTypeName(Set<String> keys) {
- for (String key : keys) {
- if (key == null) {
- continue;
- }
- if (key.equals(RPCMessage.KEY_REQUEST) || key.equals(RPCMessage.KEY_RESPONSE) ||
- key.equals(RPCMessage.KEY_NOTIFICATION)) {
- return key;
- }
- }
- return null;
- }
-
- protected boolean hasKey(Set<String> keys, String keyName) {
- for (String key : keys) {
- if (key == null) {
- continue;
- }
- if (key.equals(keyName)) {
- return true;
- }
- }
- return false;
- }
-
- // Generalized Getters and Setters
-
- public void setValue(String key, Object value){
- if (value != null) {
- store.put(key, value);
- } else {
- store.remove(key);
- }
- }
-
- public Object getValue(String key) {
- return store.get(key);
- }
-
- public Object getObject(Class tClass, String key) {
- Object obj = store.get(key);
- return formatObject(tClass, obj);
- }
-
- // Helper methods
-
- /**
- * @param tClass a Class to cast Objects to
- * @param obj Object returned from a stored hashtable
- * @return A null object if obj is null or if none of the following is true:
- * a) obj is an instance of tClass
- * b) obj is an instance of String and it tClass has a valid `valueForString` method
- * c) obj is an instance of a Hashtable
- * d) obj is an instance of a List
- */
- protected Object formatObject(Class tClass, Object obj){
- if(obj == null){
- return null;
- } else if (tClass.isInstance(obj)) {
- return obj;
- } else if (obj instanceof String) {
- return getValueForString(tClass, (String) obj);
- } else if (obj instanceof Hashtable) {
- try {
- Constructor constructor = tClass.getConstructor(Hashtable.class);
- 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();
- }
- } else if (obj instanceof List<?>) {
- List<?> list = (List<?>) obj;
- if (list != null && list.size() > 0) {
- Object item = list.get(0);
- if (tClass.isInstance(item)) {
- 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);
- 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;
- }
- }
- return newList;
- } else if (item instanceof String){
- List<Object> newList = new ArrayList<Object>();
- for (Object hashObj : list) {
- Object toAdd = getValueForString(tClass, (String) hashObj);
- if (toAdd != null) {
- newList.add(toAdd);
- }
- }
- return newList;
- }
- }
- }
- return null;
- }
-
- /**
- * @param tClass - a Class with a `valueForString(String s)` method that returns an Object for a given String
- * @param s - a String to be converted to an Object using a `valueForString(String s)` method
- * @return An Object converted using a `valueForString(String s)` method in the Class passed in, or a null object if such method does not exist
- */
- protected Object getValueForString(Class tClass, String s){
- Method valueForString = null;
- try {
- valueForString = tClass.getDeclaredMethod("valueForString", String.class);
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- if(valueForString != null){
- try {
- Object value = valueForString.invoke(null, (String) s);
- return value;
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- return null;
- }
-
- // Common Object Getters
- public String getString(String key) {
- return (String) store.get(key);
- }
-
- public Integer getInteger(String key) {
- return (Integer) store.get(key);
- }
-
- public Double getDouble(String key) {
- return (Double) store.get(key);
- }
-
- public Float getFloat(String key) {
- return (Float) store.get(key);
- }
-
- public Boolean getBoolean(String key) { return (Boolean) store.get(key); }
-
- public Long getLong(String key){
- Object result = store.get(key);
- if (result instanceof Integer) {
- return ((Integer) result).longValue();
- }else if(result instanceof Long){
- return (Long) result;
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java
deleted file mode 100644
index d3690146c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java
+++ /dev/null
@@ -1,2036 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import java.util.List;
-import java.util.Vector;
-
-import android.app.Service;
-import android.content.Context;
-
-import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.proxy.interfaces.IProxyListenerALM;
-import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
-import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.HMICapabilities;
-import com.smartdevicelink.proxy.rpc.PresetBankCapabilities;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.VehicleType;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
-import com.smartdevicelink.trace.SdlTrace;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-
-import static com.smartdevicelink.proxy.SystemCapabilityManager.convertToList;
-
-
-public class SdlProxyALM extends SdlProxyBase<IProxyListenerALM> {
-
- private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
- @SuppressWarnings("unused")
- private static final String SDL_LIB_PRIVATE_TOKEN = "{DAE1A88C-6C16-4768-ACA5-6F1247EA01C2}";
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL
- *
- * Takes advantage of the advanced lifecycle management.
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param isMediaApp - Indicates if the app is a media application.
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- /*ngn media app*/null,
- /*vr synonyms*/null,
- /*is media app*/isMediaApp,
- /*sdlMsgVersion*/null,
- /*language desired*/languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- /*callbackToUIThread*/ false,
- new BTTransportConfig());
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL
- *
- * Takes advantage of the advanced lifecycle management.
- * @param context - Used to create a multiplexing transport config
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param isMediaApp - Indicates if the app is a media application.
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, Boolean isMediaApp,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- /*ngn media app*/null,
- /*vr synonyms*/null,
- /*is media app*/isMediaApp,
- /*sdlMsgVersion*/null,
- /*language desired*/languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- /*callbackToUIThread*/ false,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, appName, and isMediaApp.", SDL_LIB_TRACE_KEY);
- }
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp - Indicates if the app is a media application.
- * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired - Indicates the language desired for the SDL interface.
- * @param autoActivateID - ID used to re-register previously registered application.
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
- Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
- String autoActivateID) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- /*callbackToUIThread*/ false,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, appName, ngnMediaScreenAppName, " +
- "vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp - Indicates if the app is a media application.
- * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired - Indicates the language desired for the SDL interface.
- * @param autoActivateID - ID used to re-register previously registered application.
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
- Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
- String autoActivateID) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- /*callbackToUIThread*/ false,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, appName, ngnMediaScreenAppName, " +
- "vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
- }
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp - Indicates if the app is a media application.
- * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired - Indicates the language desired for the SDL interface.
- * @param autoActivateID - ID used to re-register previously registered application.
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms,
- Boolean isMediaApp, SdlMsgVersion sdlMsgVersion, Language languageDesired,
- Language hmiDisplayLanguageDesired, String appID, String autoActivateID) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- /*callbackToUIThread*/ false,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp - Indicates if the app is a media application.
- * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired - Indicates the language desired for the SDL interface.
- * @param autoActivateID - ID used to re-register previously registered application.
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms,
- Boolean isMediaApp, SdlMsgVersion sdlMsgVersion, Language languageDesired,
- Language hmiDisplayLanguageDesired, String appID, String autoActivateID) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- /*callbackToUIThread*/ false,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
- }
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp - Indicates if the app is a media application.
- * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired - Indicates the language desired for the SDL interface.
- * @param autoActivateID - ID used to re-register previously registered application.
- * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
- Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
- String autoActivateID, boolean callbackToUIThread) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "and callbackToUIThread", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp - Indicates if the app is a media application.
- * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired - Indicates the language desired for the SDL interface.
- * @param autoActivateID - ID used to re-register previously registered application.
- * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
- Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
- String autoActivateID, boolean callbackToUIThread) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "and callbackToUIThread", SDL_LIB_TRACE_KEY);
- }
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp - Indicates if the app is a media application.
- * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired - Indicates the language desired for the SDL interface.
- * @param autoActivateID - ID used to re-register previously registered application.
- * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID,
- boolean callbackToUIThread) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "and callbackToUIThread", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener - Reference to the object in the App listening to callbacks from SDL.
- * @param appName - Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName - Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms - A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp - Indicates if the app is a media application.
- * @param sdlMsgVersion - Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired - Indicates the language desired for the SDL interface.
- * @param autoActivateID - ID used to re-register previously registered application.
- * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID,
- boolean callbackToUIThread) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "and callbackToUIThread", SDL_LIB_TRACE_KEY);
- }
-
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
-
- public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
-
- /********************************************** TRANSPORT SWITCHING SUPPORT *****************************************/
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- /*ngn media app*/null,
- /*vr synonyms*/null,
- /*is media app*/isMediaApp,
- /*sdlMsgVersion*/null,
- /*language desired*/languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- /*callbackToUIThread*/ false,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, appName, and isMediaApp.", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
- Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
- String autoActivateID, TransportType transportType, BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- /*callbackToUIThread*/ false,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, appName, ngnMediaScreenAppName, " +
- "vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms,
- Boolean isMediaApp, SdlMsgVersion sdlMsgVersion, Language languageDesired,
- Language hmiDisplayLanguageDesired, String appID, String autoActivateID,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- /*callbackToUIThread*/ false,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, and autoActivateID.", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands to
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName,
- Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
- String autoActivateID, boolean callbackToUIThread,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- /*sdl proxy configuration resources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "and callbackToUIThread", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID,
- boolean callbackToUIThread, BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "and callbackToUIThread", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*TTS Name*/null,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appID Identifier of the client application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, boolean callbackToUIThread, boolean preRegister) throws SdlException
- {
- super( listener,
- /*sdlProxyConfigurationResources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- languageDesired,
- hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- callbackToUIThread,
- preRegister,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, isMediaApp, languageDesired, hmiDisplayLanguageDesired" + "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appID Identifier of the client application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, Boolean isMediaApp,Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, boolean callbackToUIThread, boolean preRegister) throws SdlException
- {
- super( listener,
- /*sdlProxyConfigurationResources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- languageDesired,
- hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- callbackToUIThread,
- preRegister,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, isMediaApp, languageDesired, hmiDisplayLanguageDesired" + "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param appID Identifier of the client application.
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID) throws SdlException {
- super( listener,
- /*sdlProxyConfigurationResources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- /*languageDesired*/null,
- /*hmiDisplayLanguageDesired*/null,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- false,
- false,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param appID Identifier of the client application.
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID) throws SdlException {
- super( listener,
- /*sdlProxyConfigurationResources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- /*languageDesired*/null,
- /*hmiDisplayLanguageDesired*/null,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- false,
- false,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param appID Identifier of the client application.
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources, String appName, Boolean isMediaApp,String appID) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- /*languageDesired*/null,
- /*hmiDisplayLanguageDesired*/null,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- false,
- false,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "sdlProxyConfigurationResources, appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param appID Identifier of the client application.
- * @throws SdlException
- */
- public SdlProxyALM(Context context, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources, String appName, Boolean isMediaApp,String appID) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- /*languageDesired*/null,
- /*hmiDisplayLanguageDesired*/null,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- false,
- false,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "sdlProxyConfigurationResources, appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
- }
-
- public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID,BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- /*sdlProxyConfigurationResources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- /*languageDesired*/null,
- /*hmiDisplayLanguageDesired*/null,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- false,
- false,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, isMediaApp, appID", SDL_LIB_TRACE_KEY);
- }
-
- public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp, String appID,
- TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme, BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- /*sdlProxyConfigurationResources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- /*languageDesired*/null,
- /*hmiDisplayLanguageDesired*/null,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- dayColorScheme,
- nightColorScheme,
- false,
- false,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, isMediaApp, appID, dayColorScheme, nightColorScheme", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param appID Identifier of the client application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID,
- boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- /*sdlProxyConfigurationResources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- /*languageDesired*/null,
- /*hmiDisplayLanguageDesired*/null,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- callbackToUIThread,
- preRegister,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, isMediaApp, " + "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param appName Name of the application displayed on SDL.
- * @param isMediaApp Indicates if the app is a media application.
- * @param appID Identifier of the client application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, String appName, Boolean isMediaApp,String appID,
- boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- /*sdlProxyConfigurationResources*/null,
- /*enable advanced lifecycle management*/true,
- appName,
- /*ttsName*/null,
- /*ngnMediaScreenAppName*/null,
- /*vrSynonyms*/null,
- isMediaApp,
- /*sdlMsgVersion*/null,
- /*languageDesired*/null,
- /*hmiDisplayLanguageDesired*/null,
- /*App Type*/null,
- /*App ID*/appID,
- /*autoActivateID*/null,
- callbackToUIThread,
- preRegister,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " +
- "appName, isMediaApp, " + "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- * @param appService Reference to the apps service object.
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- new MultiplexTransportConfig(appService.getBaseContext(),appID));
-
- this.setAppService(appService);
- this.sendTransportBroadcast();
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
-
-
- public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister, BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- transportConfig);
-
- this.setAppService(appService);
- this.sendTransportBroadcast();
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
-
-
-
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
-
-
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/null,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- /**
- * @deprecated
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appType Type of application.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- @Deprecated
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- Vector<AppHMIType> appType, String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/appType,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- new BTTransportConfig());
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param context - Used to create a multiplexing transport config
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appType Type of application.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @throws SdlException
- */
- public SdlProxyALM(Context context,IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired,
- Vector<AppHMIType> appType, String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/appType,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- new MultiplexTransportConfig(context,appID));
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appType Type of application.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/appType,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/appType,
- /*App ID*/appID,
- autoActivateID,
- callbackToUIThread,
- preRegister,
- transportConfig);
-
- this.setAppService(appService);
- this.sendTransportBroadcast();
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- /**
- * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
- *
- * Takes advantage of the advanced lifecycle management.
- *
- * @param listener Reference to the object in the App listening to callbacks from SDL.
- * @param sdlProxyConfigurationResources Proxy configuration resources.
- * @param appName Name of the application displayed on SDL.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
- * vehicles. Limited to five characters.
- * @param vrSynonyms A vector of strings, all of which can be used as voice commands too
- * @param isMediaApp Indicates if the app is a media application.
- * @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
- * or equal to the version of SDL SmartDeviceLink running on the vehicle.
- * @param languageDesired Indicates the language desired for the SDL interface.
- * @param hmiDisplayLanguageDesired Desired language in HMI.
- * @param appType Type of application.
- * @param appID Identifier of the client application.
- * @param autoActivateID ID used to re-register previously registered application.
- * @param callbackToUIThread If true, all callbacks will occur on the UI thread.
- * @param preRegister Flag that indicates that client should be pre-registred or not
- * @param sHashID HashID used for app resumption
- * @param transportConfig Initial configuration for transport.
- * @throws SdlException
- */
- public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister, String sHashID,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/appType,
- /*App ID*/appID,
- autoActivateID,
- null,
- null,
- callbackToUIThread,
- preRegister,
- /*sHashID*/sHashID,
- true,
- transportConfig);
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
- String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister, String sHashID,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/appType,
- /*App ID*/appID,
- autoActivateID,
- null,
- null,
- callbackToUIThread,
- preRegister,
- /*sHashID*/sHashID,
- /*bEnableResume*/true,
- transportConfig);
-
- this.setAppService(appService);
- this.sendTransportBroadcast();
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- public SdlProxyALM(Service appService, IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
- SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
- String appID, String autoActivateID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme, boolean callbackToUIThread, boolean preRegister, String sHashID,
- BaseTransportConfig transportConfig) throws SdlException {
- super( listener,
- sdlProxyConfigurationResources,
- /*enable advanced lifecycle management*/true,
- appName,
- ttsName,
- ngnMediaScreenAppName,
- vrSynonyms,
- isMediaApp,
- sdlMsgVersion,
- languageDesired,
- /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
- /*App Type*/appType,
- /*App ID*/appID,
- autoActivateID,
- dayColorScheme,
- nightColorScheme,
- callbackToUIThread,
- preRegister,
- /*sHashID*/sHashID,
- /*bEnableResume*/true,
- transportConfig);
-
- this.setAppService(appService);
- this.sendTransportBroadcast();
-
- SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
- "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, dayColorScheme, nightColorScheme" +
- "callbackToUIThread and version", SDL_LIB_TRACE_KEY);
- }
- /***************************************** END OF TRANSPORT SWITCHING SUPPORT ***************************************/
-
- // Allow applications using ALM to reset the proxy (dispose and reinstantiate)
- /**
- * Disconnects the application from SDL, then recreates the transport such that
- * the next time a SDL unit discovers applications, this application will be
- * available.
- */
- public void resetProxy() throws SdlException {
- super.cycleProxy(SdlDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);
- }
-
- /********* Getters for values returned by RegisterAppInterfaceResponse **********/
-
- /**
- * Gets buttonCapabilities set when application interface is registered.
- *
- * @return buttonCapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public List<ButtonCapabilities> getButtonCapabilities() throws SdlException{
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
- throw new SdlException("SDL is unavailable. Unable to get the buttonCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
-
- return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.BUTTON), ButtonCapabilities.class);
- }
-
- /**
- * Gets getSoftButtonCapabilities set when application interface is registered.
- *
- * @return softButtonCapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public List<SoftButtonCapabilities> getSoftButtonCapabilities() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
- throw new SdlException("SDL is not connected. Unable to get the softButtonCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON),SoftButtonCapabilities.class);
- }
-
- /**
- * Gets getPresetBankCapabilities set when application interface is registered.
- *
- * @return presetBankCapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public PresetBankCapabilities getPresetBankCapabilities() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is not connected. Unable to get the presetBankCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return ( PresetBankCapabilities ) _systemCapabilityManager.getCapability(SystemCapabilityType.PRESET_BANK);
- }
-
- /**
- * Gets the current version information of the proxy.
- *
- * @return String
- * @throws SdlException
- */
- public String getProxyVersionInfo() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- if (Version.VERSION != null)
- return Version.VERSION;
-
- return null;
- }
-
-
-
- /**
- * Gets displayCapabilities set when application interface is registered.
- *
- * @return displayCapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public DisplayCapabilities getDisplayCapabilities() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
- throw new SdlException("SDL is unavailable. Unable to get the displayCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return ( DisplayCapabilities ) _systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY);
- }
-
- /**
- * Gets hmiZoneCapabilities set when application interface is registered.
- *
- * @return hmiZoneCapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public List<HmiZoneCapabilities> getHmiZoneCapabilities() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
- throw new SdlException("SDL is unavailable. Unable to get the hmiZoneCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.HMI_ZONE), HmiZoneCapabilities.class);
- }
-
- /**
- * Gets speechCapabilities set when application interface is registered.
- *
- * @return speechCapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public List<SpeechCapabilities> getSpeechCapabilities() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
- throw new SdlException("SDL is unavailable. Unable to get the speechCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
-
- return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.SPEECH), SpeechCapabilities.class);
- }
- /**
- * Gets PrerecordedSpeech set when application interface is registered.
- *
- * @return PrerecordedSpeech
- * @throws SdlException
- */
- public List<PrerecordedSpeech> getPrerecordedSpeech() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is unavailable. Unable to get the PrerecordedSpeech.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
-
- return _prerecordedSpeech;
- }
- /**
- * Gets sdlLanguage set when application interface is registered.
- *
- * @return sdlLanguage
- * @throws SdlException
- */
- public Language getSdlLanguage() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is unavailable. Unable to get the sdlLanguage.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return _sdlLanguage;
- }
-
- /**
- * Gets getHmiDisplayLanguage set when application interface is registered.
- *
- * @return hmiDisplayLanguage
- * @throws SdlException
- */
- public Language getHmiDisplayLanguage() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is not connected. Unable to get the hmiDisplayLanguage.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return _hmiDisplayLanguage;
- }
-
- /**
- * Gets sdlMsgVersion set when application interface is registered.
- *
- * @return sdlMsgVersion
- * @throws SdlException
- */
- public SdlMsgVersion getSdlMsgVersion() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is unavailable. Unable to get the sdlMsgVersion.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return _sdlMsgVersion;
- }
-
- /**
- * Gets vrCapabilities set when application interface is registered.
- *
- * @return vrCapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public List<VrCapabilities> getVrCapabilities() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
- throw new SdlException("SDL is unavailable. Unable to get the vrCapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.VOICE_RECOGNITION), VrCapabilities.class);
- }
-
- /**
- * Gets getVehicleType set when application interface is registered.
- *
- * @return vehicleType
- * @throws SdlException
- */
- public VehicleType getVehicleType() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is not connected. Unable to get the vehicleType.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return _vehicleType;
- }
-
- /**
- * Gets AudioPassThruCapabilities set when application interface is registered.
- *
- * @return AudioPassThruCapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public List<AudioPassThruCapabilities> getAudioPassThruCapabilities() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
- throw new SdlException("SDL is not connected. Unable to get the vehicleType.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return convertToList(_systemCapabilityManager.getCapability(SystemCapabilityType.AUDIO_PASSTHROUGH), AudioPassThruCapabilities.class);
- }
-
- public List<Integer> getSupportedDiagModes() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is not connected. Unable to get SupportedDiagModes.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return _diagModes;
- }
-
- /**
- * Gets HMICapabilities when application interface is registered.
- *
- * @return HMICapabilities
- * @throws SdlException
- * @deprecated use {@link SystemCapabilityManager#getCapability(SystemCapabilityType)} instead
- */
- @Deprecated
- public HMICapabilities getHmiCapabilities() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd || _systemCapabilityManager == null) {
- throw new SdlException("SDL is not connected. Unable to get the HMICapabilities.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return ( HMICapabilities ) _systemCapabilityManager.getCapability(SystemCapabilityType.HMI);
- }
-
-
- public String getSystemSoftwareVersion() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is not connected. Unable to get the SystemSoftwareVersion.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return _systemSoftwareVersion;
- }
-
- public boolean isAppResumeSuccess() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is not connected. Unable to get isResumeSuccess.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return _bResumeSuccess;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
deleted file mode 100644
index 79284c302..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
+++ /dev/null
@@ -1,7696 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import android.annotation.TargetApi;
-import android.app.Service;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.os.Build;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.SystemClock;
-import android.support.annotation.NonNull;
-import android.telephony.TelephonyManager;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import android.util.SparseArray;
-import android.util.SparseIntArray;
-import android.view.Display;
-import android.view.InputDevice;
-import android.view.MotionEvent;
-import android.view.Surface;
-
-import com.smartdevicelink.Dispatcher.IDispatchingStrategy;
-import com.smartdevicelink.Dispatcher.ProxyMessageDispatcher;
-import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
-import com.smartdevicelink.SdlConnection.SdlConnection;
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.SdlConnection.SdlSession2;
-import com.smartdevicelink.encoder.VirtualDisplayEncoder;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.haptic.HapticInterfaceManager;
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.protocol.heartbeat.HeartbeatMonitor;
-import com.smartdevicelink.proxy.LockScreenManager.OnLockScreenIconDownloadedListener;
-import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
-import com.smartdevicelink.proxy.callbacks.OnError;
-import com.smartdevicelink.proxy.callbacks.OnProxyClosed;
-import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
-import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
-import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
-import com.smartdevicelink.proxy.interfaces.IProxyListenerBase;
-import com.smartdevicelink.proxy.interfaces.IPutFileResponseListener;
-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.*;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
-import com.smartdevicelink.proxy.rpc.enums.RequestType;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-import com.smartdevicelink.proxy.rpc.enums.SdlConnectionState;
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
-import com.smartdevicelink.proxy.rpc.enums.SdlInterfaceAvailability;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-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.video.SdlRemoteDisplay;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-import com.smartdevicelink.trace.SdlTrace;
-import com.smartdevicelink.trace.TraceDeviceInfo;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.SiphonServer;
-import com.smartdevicelink.transport.USBTransportConfig;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.util.CorrelationIdGenerator;
-import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.Version;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-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.ArrayList;
-import java.util.Collections;
-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> {
- // Used for calls to Android Log class.
- public static final String TAG = "SdlProxy";
- private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
- private static final int PROX_PROT_VER_ONE = 1;
- private static final int RESPONSE_WAIT_TIME = 2000;
-
- 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
- private final int REGISTER_APP_INTERFACE_CORRELATION_ID = 65529,
- UNREGISTER_APP_INTERFACE_CORRELATION_ID = 65530,
- POLICIES_CORRELATION_ID = 65535;
-
- // Sdl Synchronization Objects
- private static final Object CONNECTION_REFERENCE_LOCK = new Object(),
- INCOMING_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
- OUTGOING_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
- INTERNAL_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
- ON_UPDATE_LISTENER_LOCK = new Object(),
- ON_NOTIFICATION_LISTENER_LOCK = new Object();
-
- private final Object APP_INTERFACE_REGISTERED_LOCK = new Object();
-
- private int iFileCount = 0;
-
- private boolean navServiceStartResponseReceived = false;
- private boolean navServiceStartResponse = false;
- private List<String> navServiceStartRejectedParams = null;
- private boolean pcmServiceStartResponseReceived = false;
- private boolean pcmServiceStartResponse = false;
- @SuppressWarnings("FieldCanBeLocal")
- private List<String> pcmServiceStartRejectedParams = null;
- private boolean navServiceEndResponseReceived = false;
- private boolean navServiceEndResponse = false;
- private boolean pcmServiceEndResponseReceived = false;
- private boolean pcmServiceEndResponse = false;
- private boolean rpcProtectedResponseReceived = false;
- private boolean rpcProtectedStartResponse = false;
-
- // Device Info for logging
- private TraceDeviceInfo _traceDeviceInterrogator = null;
-
- // Declare Queuing Threads
- private ProxyMessageDispatcher<ProtocolMessage> _incomingProxyMessageDispatcher;
- private ProxyMessageDispatcher<ProtocolMessage> _outgoingProxyMessageDispatcher;
- private ProxyMessageDispatcher<InternalProxyMessage> _internalProxyMessageDispatcher;
-
- // Flag indicating if callbacks should be called from UIThread
- private Boolean _callbackToUIThread = false;
- // UI Handler
- private Handler _mainUIHandler = null;
- final int HEARTBEAT_CORRELATION_ID = 65531;
-
- // SdlProxy Advanced Lifecycle Management
- protected Boolean _advancedLifecycleManagementEnabled = false;
- // Parameters passed to the constructor from the app to register an app interface
- private String _applicationName = null;
- private final long instanceDateTime = System.currentTimeMillis();
- private String sConnectionDetails = "N/A";
- private Vector<TTSChunk> _ttsName = null;
- private String _ngnMediaScreenAppName = null;
- private Boolean _isMediaApp = null;
- private Language _sdlLanguageDesired = null;
- private Language _hmiDisplayLanguageDesired = null;
- private Vector<AppHMIType> _appType = null;
- private String _appID = null;
- private TemplateColorScheme _dayColorScheme = null;
- private TemplateColorScheme _nightColorScheme = null;
- @SuppressWarnings({"FieldCanBeLocal", "unused"}) //Need to understand what this is used for
- private String _autoActivateIdDesired = null;
- private String _lastHashID = null;
- private SdlMsgVersion _sdlMsgVersionRequest = null;
- private Vector<String> _vrSynonyms = null;
- private boolean _bAppResumeEnabled = false;
- private OnSystemRequest lockScreenIconRequest = null;
- private TelephonyManager telephonyManager = null;
- private DeviceInfo deviceInfo = null;
-
- /**
- * Contains current configuration for the transport that was selected during
- * construction of this object
- */
- private BaseTransportConfig _transportConfig = null;
- // Proxy State Variables
- protected Boolean _appInterfaceRegisterd = false;
- protected Boolean _preRegisterd = false;
- @SuppressWarnings({"unused", "FieldCanBeLocal"})
- private Boolean _haveReceivedFirstNonNoneHMILevel = false;
- protected Boolean _haveReceivedFirstFocusLevel = false;
- protected Boolean _haveReceivedFirstFocusLevelFull = false;
- protected Boolean _proxyDisposed = false;
- protected SdlConnectionState _sdlConnectionState = null;
- protected SdlInterfaceAvailability _sdlIntefaceAvailablity = null;
- protected HMILevel _hmiLevel = null;
- protected AudioStreamingState _audioStreamingState = null;
- // Variables set by RegisterAppInterfaceResponse
- protected SdlMsgVersion _sdlMsgVersion = null;
- protected String _autoActivateIdReturned = null;
- protected Language _sdlLanguage = null;
- protected Language _hmiDisplayLanguage = null;
- protected List<PrerecordedSpeech> _prerecordedSpeech = null;
- protected VehicleType _vehicleType = null;
- protected String _systemSoftwareVersion = null;
- protected List<Integer> _diagModes = null;
- protected Boolean firstTimeFull = true;
- protected String _proxyVersionInfo = null;
- protected Boolean _bResumeSuccess = false;
- protected List<Class<? extends SdlSecurityBase>> _secList = null;
- protected SystemCapabilityManager _systemCapabilityManager;
- protected Boolean _iconResumed = false;
-
- private final CopyOnWriteArrayList<IPutFileResponseListener> _putFileListenerList = new CopyOnWriteArrayList<IPutFileResponseListener>();
-
- protected com.smartdevicelink.util.Version protocolVersion = new com.smartdevicelink.util.Version(1,0,0);
- protected com.smartdevicelink.util.Version rpcSpecVersion;
-
- protected SparseArray<OnRPCResponseListener> rpcResponseListeners = null;
- protected SparseArray<CopyOnWriteArrayList<OnRPCNotificationListener>> rpcNotificationListeners = null;
-
- protected VideoStreamingManager manager; //Will move to SdlSession once the class becomes public
-
-
- // Interface broker
- private SdlInterfaceBroker _interfaceBroker = null;
- //We create an easily passable anonymous class of the interface so that we don't expose the internal interface to developers
- private ISdl _internalInterface = new ISdl() {
- @Override
- public void start() {
- try{
- initializeProxy();
- }catch (SdlException e){
- e.printStackTrace();
- }
- }
-
- @Override
- public void stop() {
- try{
- dispose();
- }catch (SdlException e){
- e.printStackTrace();
- }
- }
-
- @Override
- public boolean isConnected() {
- return getIsConnected();
- }
-
- @Override
- public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
- SdlProxyBase.this.addServiceListener(serviceType,sdlServiceListener);
- }
-
- @Override
- public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
- SdlProxyBase.this.removeServiceListener(serviceType,sdlServiceListener);
- }
-
- @Override
- public void startVideoService(VideoStreamingParameters parameters, boolean encrypted) {
- if(isConnected()){
- sdlSession.setDesiredVideoParams(parameters);
- sdlSession.startService(SessionType.NAV,sdlSession.getSessionId(),encrypted);
- }
- }
-
- @Override
- public void stopVideoService() {
- if(isConnected()){
- sdlSession.endService(SessionType.NAV,sdlSession.getSessionId());
- }
- }
-
- @Override public void stopAudioService() {
- if(isConnected()){
- sdlSession.endService(SessionType.PCM,sdlSession.getSessionId());
- }
- }
-
- @Override
- public void sendRPCRequest(RPCRequest message){
- try {
- SdlProxyBase.this.sendRPCRequest(message);
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void sendRequests(List<? extends RPCRequest> rpcs, OnMultipleRequestListener listener) {
- try {
- SdlProxyBase.this.sendRequests(rpcs, listener);
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
- SdlProxyBase.this.addOnRPCNotificationListener(notificationId,listener);
- }
-
- @Override
- public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {
- return SdlProxyBase.this.removeOnRPCNotificationListener(notificationId,listener);
- }
-
- @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);
- }
-
- @Override
- public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) {
- SdlProxyBase.this.getCapability(systemCapabilityType, scListener);
- }
-
- @Override
- public SdlMsgVersion getSdlMsgVersion(){
- try {
- return SdlProxyBase.this.getSdlMsgVersion();
- } catch (SdlException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- public com.smartdevicelink.util.Version getProtocolVersion() {
- return SdlProxyBase.this.protocolVersion;
- }
-
- @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 boolean isTransportForServiceAvailable(SessionType serviceType) {
- return SdlProxyBase.this.sdlSession != null
- && SdlProxyBase.this.sdlSession.isTransportForServiceAvailable(serviceType);
- }
-
- @Override
- public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
- if(getIsConnected()){
- SdlProxyBase.this.startAudioStream(isEncrypted, codec, params);
- }
- }
-
- @Override
- public void startAudioService(boolean encrypted) {
- if(isConnected()){
- sdlSession.startService(SessionType.PCM,sdlSession.getSessionId(),encrypted);
- }
- }
-
- @Override
- public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters){
- return SdlProxyBase.this.startVideoStream(isEncrypted, parameters);
- }
-
- @Override
- public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
- return SdlProxyBase.this.startAudioStream(isEncrypted, codec, params);
- }
- };
-
- private void notifyPutFileStreamError(Exception e, String info)
- {
- for (IPutFileResponseListener _putFileListener : _putFileListenerList) {
- _putFileListener.onPutFileStreamError(e, info);
- }
- }
-
- private void notifyPutFileStreamResponse(PutFileResponse msg)
- {
- for (IPutFileResponseListener _putFileListener : _putFileListenerList) {
- _putFileListener.onPutFileResponse(msg);
- }
- }
-
- public void addPutFileResponseListener(IPutFileResponseListener _putFileListener)
- {
- _putFileListenerList.addIfAbsent(_putFileListener);
- }
-
- public void remPutFileResponseListener(IPutFileResponseListener _putFileListener)
- {
- _putFileListenerList.remove(_putFileListener);
- }
-
- // Private Class to Interface with SdlConnection
- private class SdlInterfaceBroker implements ISdlConnectionListener {
-
- @Override
- public void onTransportDisconnected(String info) {
- // proxyOnTransportDisconnect is called to alert the proxy that a requested
- // disconnect has completed
- notifyPutFileStreamError(null, info);
-
- //if (!_advancedLifecycleManagementEnabled) {
- // If original model, notify app the proxy is closed so it will delete and reinstanciate
- Log.d(TAG, "notifying proxy of closed");
- notifyProxyClosed(info, new SdlException("Transport disconnected.", SdlExceptionCause.SDL_UNAVAILABLE), SdlDisconnectedReason.TRANSPORT_DISCONNECT);
- //}// else If ALM, nothing is required to be done here
-
- }
-
- @Override
- public void onTransportDisconnected(String info, boolean altTransportAvailable, MultiplexTransportConfig transportConfig) {
- notifyPutFileStreamError(null, info);
-
- if( altTransportAvailable){
- SdlProxyBase.this._transportConfig = transportConfig;
- Log.d(TAG, "notifying RPC session ended, but potential primary transport available");
- cycleProxy(SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST);
-
- }else{
- notifyProxyClosed(info, new SdlException("Transport disconnected.", SdlExceptionCause.SDL_UNAVAILABLE), SdlDisconnectedReason.TRANSPORT_DISCONNECT);
- }
- }
-
- @Override
- public void onTransportError(String info, Exception e) {
- DebugTool.logError("Transport failure: " + info, e);
-
- notifyPutFileStreamError(e, info);
-
- if (_advancedLifecycleManagementEnabled) {
- // Cycle the proxy
- if(SdlConnection.isLegacyModeEnabled()){ //FIXME
- cycleProxy(SdlDisconnectedReason.LEGACY_BLUETOOTH_MODE_ENABLED);
-
- }else{
- cycleProxy(SdlDisconnectedReason.TRANSPORT_ERROR);
- }
- } else {
- notifyProxyClosed(info, e, SdlDisconnectedReason.TRANSPORT_ERROR);
- }
- }
-
- @Override
- public void onProtocolMessageReceived(ProtocolMessage msg) {
-
- // AudioPathThrough is coming WITH BulkData but WITHOUT JSON Data
- // Policy Snapshot is coming WITH BulkData and WITH JSON Data
- if ((msg.getData() != null && msg.getData().length > 0) ||
- (msg.getBulkData() != null && msg.getBulkData().length > 0)) {
- queueIncomingMessage(msg);
- }
- }
-
- @Override
- public void onProtocolSessionStarted(SessionType sessionType,
- byte sessionID, byte version, String correlationID, int hashID, boolean isEncrypted) {
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStarted");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " ServiceType: " + sessionType.getName());
- updateBroadcastIntent(sendIntent, "COMMENT3", " Encrypted: " + isEncrypted);
- sendBroadcastIntent(sendIntent);
-
- if(sdlSession!= null){
- setProtocolVersion(sdlSession.getProtocolVersion());
- }else{
- setProtocolVersion(new com.smartdevicelink.util.Version(version,0,0));
- }
-
- if (sessionType.eq(SessionType.RPC)) {
-
- if (!isEncrypted)
- {
- if ( (_transportConfig.getHeartBeatTimeout() != Integer.MAX_VALUE) && (version > 2))
- {
- HeartbeatMonitor outgoingHeartbeatMonitor = new HeartbeatMonitor();
- outgoingHeartbeatMonitor.setInterval(_transportConfig.getHeartBeatTimeout());
- sdlSession.setOutgoingHeartbeatMonitor(outgoingHeartbeatMonitor);
-
- HeartbeatMonitor incomingHeartbeatMonitor = new HeartbeatMonitor();
- incomingHeartbeatMonitor.setInterval(_transportConfig.getHeartBeatTimeout());
- sdlSession.setIncomingHeartbeatMonitor(incomingHeartbeatMonitor);
- }
-
- startRPCProtocolSession();
- }
- else
- {
- RPCProtectedServiceStarted();
- }
- } else if (sessionType.eq(SessionType.NAV)) {
- NavServiceStarted();
- } else if (sessionType.eq(SessionType.PCM)) {
- AudioServiceStarted();
- } else if (sessionType.eq(SessionType.RPC)){
- cycleProxy(SdlDisconnectedReason.RPC_SESSION_ENDED);
- }
- else if (protocolVersion!= null && protocolVersion.getMajor() > 1) {
- //If version is 2 or above then don't need to specify a Session Type
- startRPCProtocolSession();
- } //else{} Handle other protocol session types here
-
- }
-
- @Override
- public void onProtocolSessionStartedNACKed(SessionType sessionType,
- byte sessionID, byte version, String correlationID, List<String> rejectedParams) {
- OnServiceNACKed message = new OnServiceNACKed(sessionType);
- queueInternalMessage(message);
-
- if (sessionType.eq(SessionType.NAV)) {
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStartedNACKed");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " NACK ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- NavServiceStartedNACK(rejectedParams);
- }
- else if (sessionType.eq(SessionType.PCM)) {
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionStartedNACKed");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " NACK ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- AudioServiceStartedNACK(rejectedParams);
- }
- }
-
- @Override
- public void onProtocolSessionEnded(SessionType sessionType,
- byte sessionID, String correlationID) {
- OnServiceEnded message = new OnServiceEnded(sessionType);
- queueInternalMessage(message);
-
- if (sessionType.eq(SessionType.NAV)) {
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEnded");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " End ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- NavServiceEnded();
- }
- else if (sessionType.eq(SessionType.PCM)) {
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEnded");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " End ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- AudioServiceEnded();
- }
- }
-
- @Override
- public void onProtocolError(String info, Exception e) {
- notifyPutFileStreamError(e, info);
- passErrorToProxyListener(info, e);
- }
-
- @Override
- public void onHeartbeatTimedOut(byte sessionID) {
- final String msg = "Heartbeat timeout";
- DebugTool.logInfo(msg);
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onHeartbeatTimedOut");
- updateBroadcastIntent(sendIntent, "COMMENT1", "Heartbeat timeout for SessionID: " + sessionID);
- sendBroadcastIntent(sendIntent);
-
- notifyProxyClosed(msg, new SdlException(msg, SdlExceptionCause.HEARTBEAT_PAST_DUE), SdlDisconnectedReason.HB_TIMEOUT);
-
- }
-
- @Override
- public void onProtocolSessionEndedNACKed(SessionType sessionType,
- byte sessionID, String correlationID) {
- if (sessionType.eq(SessionType.NAV)) {
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEndedNACKed");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " End NACK ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- NavServiceEndedNACK();
- }
- else if (sessionType.eq(SessionType.PCM)) {
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "onProtocolSessionEndedNACKed");
- updateBroadcastIntent(sendIntent, "COMMENT1", "SessionID: " + sessionID);
- updateBroadcastIntent(sendIntent, "COMMENT2", " End NACK ServiceType: " + sessionType.getName());
- sendBroadcastIntent(sendIntent);
-
- AudioServiceEndedNACK();
- }
-
- }
- public void onProtocolServiceDataACK(SessionType sessionType, final int dataSize,
- byte sessionID) {
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onServiceDataACK(dataSize);
- }
- });
- } else {
- _proxyListener.onServiceDataACK(dataSize);
- }
- }
- }
-
- /**
- * 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.
- * @param languageDesired Desired language.
- * @param hmiDisplayLanguageDesired Desired language for HMI.
- * @param appType Type of application.
- * @param appID Application identifier.
- * @param dayColorScheme TemplateColorScheme for the day
- * @param nightColorScheme TemplateColorScheme for the night
- * @param transportConfig Configuration of transport to be used by underlying connection.
- * @param vrSynonyms List of synonyms.
- * @param ttsName TTS name.
- * @throws SdlException
- */
- 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;
- }
-
- /**
- * Constructor.
- *
- * @param listener Type of listener for this proxy base.
- * @param sdlProxyConfigurationResources Configuration resources for this proxy.
- * @param enableAdvancedLifecycleManagement Flag that ALM should be enabled or not.
- * @param appName Client application name.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Media Screen Application name.
- * @param vrSynonyms List of synonyms.
- * @param isMediaApp Flag that indicates that client application if media application or not.
- * @param sdlMsgVersion Version of Sdl Message.
- * @param languageDesired Desired language.
- * @param hmiDisplayLanguageDesired Desired language for HMI.
- * @param appType Type of application.
- * @param appID Application identifier.
- * @param autoActivateID Auto activation identifier.
- * @param callbackToUIThread Flag that indicates that this proxy should send callback to UI thread or not.
- * @param transportConfig Configuration of transport to be used by underlying connection.
- * @throws SdlException if there is an unrecoverable error class might throw an exception.
- */
- protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
- String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
- String autoActivateID, boolean callbackToUIThread, BaseTransportConfig transportConfig)
- throws SdlException {
-
- performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
- sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, null, null, callbackToUIThread, null, null, null, transportConfig);
- }
-
- @SuppressWarnings("ConstantConditions")
- private void performBaseCommon(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
- String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
- String autoActivateID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme,
- boolean callbackToUIThread, Boolean preRegister, String sHashID, Boolean bAppResumeEnab,
- BaseTransportConfig transportConfig) throws SdlException
- {
- Log.i(TAG, "SDL_LIB_VERSION: " + com.smartdevicelink.proxy.Version.VERSION);
- setProtocolVersion(new Version(PROX_PROT_VER_ONE,0,0));
-
- if (preRegister != null && preRegister)
- {
- _appInterfaceRegisterd = preRegister;
- _preRegisterd = preRegister;
- }
-
- if (bAppResumeEnab != null && bAppResumeEnab)
- {
- _bAppResumeEnabled = true;
- _lastHashID = sHashID;
- }
- _interfaceBroker = new SdlInterfaceBroker();
-
- _callbackToUIThread = callbackToUIThread;
-
- if (_callbackToUIThread) {
- _mainUIHandler = new Handler(Looper.getMainLooper());
- }
-
- // Set variables for Advanced Lifecycle Management
- _advancedLifecycleManagementEnabled = enableAdvancedLifecycleManagement;
- _applicationName = appName;
- _ttsName = ttsName;
- _ngnMediaScreenAppName = ngnMediaScreenAppName;
- _isMediaApp = isMediaApp;
- _sdlMsgVersionRequest = sdlMsgVersion;
- _vrSynonyms = vrSynonyms;
- _sdlLanguageDesired = languageDesired;
- _hmiDisplayLanguageDesired = hmiDisplayLanguageDesired;
- _appType = appType;
- _appID = appID;
- _autoActivateIdDesired = autoActivateID;
- _dayColorScheme = dayColorScheme;
- _nightColorScheme = nightColorScheme;
- _transportConfig = transportConfig;
-
- // Test conditions to invalidate the proxy
- if (listener == null) {
- throw new IllegalArgumentException("IProxyListener listener must be provided to instantiate SdlProxy object.");
- }
- if (_advancedLifecycleManagementEnabled) {
- /* if (_applicationName == null ) {
- throw new IllegalArgumentException("To use SdlProxyALM, an application name, appName, must be provided");
- }
- if (_applicationName.length() < 1 || _applicationName.length() > 100) {
- throw new IllegalArgumentException("A provided application name, appName, must be between 1 and 100 characters in length.");
- }*/
- if (_isMediaApp == null) {
- throw new IllegalArgumentException("isMediaApp must not be null when using SdlProxyALM.");
- }
- }
-
- _proxyListener = listener;
-
- // Get information from sdlProxyConfigurationResources
- if (sdlProxyConfigurationResources != null) {
- telephonyManager = sdlProxyConfigurationResources.getTelephonyManager();
- }
-
- // Use the telephonyManager to get and log phone info
- if (telephonyManager != null) {
- // Following is not quite thread-safe (because m_traceLogger could test null twice),
- // so we need to fix this, but vulnerability (i.e. two instances of listener) is
- // likely harmless.
- if (_traceDeviceInterrogator == null) {
- _traceDeviceInterrogator = new TraceDeviceInfo(telephonyManager);
- } // end-if
-
- } // end-if
-
- // Setup Internal ProxyMessage Dispatcher
- synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
- // Ensure internalProxyMessageDispatcher is null
- if (_internalProxyMessageDispatcher != null) {
- _internalProxyMessageDispatcher.dispose();
- _internalProxyMessageDispatcher = null;
- }
-
- _internalProxyMessageDispatcher = new ProxyMessageDispatcher<InternalProxyMessage>("INTERNAL_MESSAGE_DISPATCHER", new IDispatchingStrategy<InternalProxyMessage>() {
-
- @Override
- public void dispatch(InternalProxyMessage message) {
- dispatchInternalMessage(message);
- }
-
- @Override
- public void handleDispatchingError(String info, Exception ex) {
- handleErrorsFromInternalMessageDispatcher(info, ex);
- }
-
- @Override
- public void handleQueueingError(String info, Exception ex) {
- handleErrorsFromInternalMessageDispatcher(info, ex);
- }
- });
- }
-
- // Setup Incoming ProxyMessage Dispatcher
- synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
- // Ensure incomingProxyMessageDispatcher is null
- if (_incomingProxyMessageDispatcher != null) {
- _incomingProxyMessageDispatcher.dispose();
- _incomingProxyMessageDispatcher = null;
- }
-
- _incomingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("INCOMING_MESSAGE_DISPATCHER",new IDispatchingStrategy<ProtocolMessage>() {
- @Override
- public void dispatch(ProtocolMessage message) {
- dispatchIncomingMessage(message);
- }
-
- @Override
- public void handleDispatchingError(String info, Exception ex) {
- handleErrorsFromIncomingMessageDispatcher(info, ex);
- }
-
- @Override
- public void handleQueueingError(String info, Exception ex) {
- handleErrorsFromIncomingMessageDispatcher(info, ex);
- }
- });
- }
-
- // Setup Outgoing ProxyMessage Dispatcher
- synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {
- // Ensure outgoingProxyMessageDispatcher is null
- if (_outgoingProxyMessageDispatcher != null) {
- _outgoingProxyMessageDispatcher.dispose();
- _outgoingProxyMessageDispatcher = null;
- }
-
- _outgoingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("OUTGOING_MESSAGE_DISPATCHER",new IDispatchingStrategy<ProtocolMessage>() {
- @Override
- public void dispatch(ProtocolMessage message) {
- dispatchOutgoingMessage(message);
- }
-
- @Override
- public void handleDispatchingError(String info, Exception ex) {
- handleErrorsFromOutgoingMessageDispatcher(info, ex);
- }
-
- @Override
- public void handleQueueingError(String info, Exception ex) {
- handleErrorsFromOutgoingMessageDispatcher(info, ex);
- }
- });
- }
-
- rpcResponseListeners = new SparseArray<OnRPCResponseListener>();
- rpcNotificationListeners = new SparseArray<CopyOnWriteArrayList<OnRPCNotificationListener>>();
-
- // Initialize the proxy
- try {
- initializeProxy();
- } catch (SdlException e) {
- // Couldn't initialize the proxy
- // Dispose threads and then rethrow exception
-
- if (_internalProxyMessageDispatcher != null) {
- _internalProxyMessageDispatcher.dispose();
- _internalProxyMessageDispatcher = null;
- }
- if (_incomingProxyMessageDispatcher != null) {
- _incomingProxyMessageDispatcher.dispose();
- _incomingProxyMessageDispatcher = null;
- }
- if (_outgoingProxyMessageDispatcher != null) {
- _outgoingProxyMessageDispatcher.dispose();
- _outgoingProxyMessageDispatcher = null;
- }
- throw e;
- }
-
- // Trace that ctor has fired
- SdlTrace.logProxyEvent("SdlProxy Created, instanceID=" + this.toString(), SDL_LIB_TRACE_KEY);
- }
-
- protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
- String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
- String autoActivateID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme,
- boolean callbackToUIThread, boolean preRegister, String sHashID, Boolean bEnableResume, BaseTransportConfig transportConfig)
- throws SdlException
- {
- performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
- sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, dayColorScheme, nightColorScheme, callbackToUIThread, preRegister, sHashID, bEnableResume, transportConfig);
- }
-
- /**
- * Constructor.
- *
- * @param listener Type of listener for this proxy base.
- * @param sdlProxyConfigurationResources Configuration resources for this proxy.
- * @param enableAdvancedLifecycleManagement Flag that ALM should be enabled or not.
- * @param appName Client application name.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Media Screen Application name.
- * @param vrSynonyms List of synonyms.
- * @param isMediaApp Flag that indicates that client application if media application or not.
- * @param sdlMsgVersion Version of Sdl Message.
- * @param languageDesired Desired language.
- * @param hmiDisplayLanguageDesired Desired language for HMI.
- * @param appType Type of application.
- * @param appID Application identifier.
- * @param autoActivateID Auto activation identifier.
- * @param callbackToUIThread Flag that indicates that this proxy should send callback to UI thread or not.
- * @param preRegister Flag that indicates that this proxy should be pre-registerd or not.
- * @param transportConfig Configuration of transport to be used by underlying connection.
- * @throws SdlException if there is an unrecoverable error class might throw an exception.
- */
- protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
- String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
- String autoActivateID, boolean callbackToUIThread, boolean preRegister, BaseTransportConfig transportConfig)
- throws SdlException
- {
- performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
- sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, null, null, callbackToUIThread, preRegister, null, null, transportConfig);
- }
-
- /**
- * Constructor.
- *
- * @param listener Type of listener for this proxy base.
- * @param sdlProxyConfigurationResources Configuration resources for this proxy.
- * @param enableAdvancedLifecycleManagement Flag that ALM should be enabled or not.
- * @param appName Client application name.
- * @param ttsName TTS name.
- * @param ngnMediaScreenAppName Media Screen Application name.
- * @param vrSynonyms List of synonyms.
- * @param isMediaApp Flag that indicates that client application if media application or not.
- * @param sdlMsgVersion Version of Sdl Message.
- * @param languageDesired Desired language.
- * @param hmiDisplayLanguageDesired Desired language for HMI.
- * @param appType Type of application.
- * @param appID Application identifier.
- * @param autoActivateID Auto activation identifier.
- * @param dayColorScheme Day color scheme.
- * @param dayColorScheme Night color scheme.
- * @param callbackToUIThread Flag that indicates that this proxy should send callback to UI thread or not.
- * @param preRegister Flag that indicates that this proxy should be pre-registerd or not.
- * @param transportConfig Configuration of transport to be used by underlying connection.
- * @throws SdlException if there is an unrecoverable error class might throw an exception.
- */
- protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
- boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
- String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
- Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
- String autoActivateID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme,
- boolean callbackToUIThread, boolean preRegister, BaseTransportConfig transportConfig)
- throws SdlException
- {
- performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
- sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, dayColorScheme, nightColorScheme, callbackToUIThread, preRegister, null, null, transportConfig);
- }
-
- private Intent createBroadcastIntent()
- {
- Intent sendIntent = new Intent();
- sendIntent.setAction("com.smartdevicelink.broadcast");
- sendIntent.putExtra("APP_NAME", this._applicationName);
- sendIntent.putExtra("APP_ID", this._appID);
- sendIntent.putExtra("RPC_NAME", "");
- sendIntent.putExtra("TYPE", "");
- sendIntent.putExtra("SUCCESS", true);
- sendIntent.putExtra("CORRID", 0);
- sendIntent.putExtra("FUNCTION_NAME", "");
- sendIntent.putExtra("COMMENT1", "");
- sendIntent.putExtra("COMMENT2", "");
- sendIntent.putExtra("COMMENT3", "");
- sendIntent.putExtra("COMMENT4", "");
- sendIntent.putExtra("COMMENT5", "");
- sendIntent.putExtra("COMMENT6", "");
- sendIntent.putExtra("COMMENT7", "");
- sendIntent.putExtra("COMMENT8", "");
- sendIntent.putExtra("COMMENT9", "");
- sendIntent.putExtra("COMMENT10", "");
- sendIntent.putExtra("DATA", "");
- sendIntent.putExtra("SHOW_ON_UI", true);
- return sendIntent;
- }
- private void updateBroadcastIntent(Intent sendIntent, String sKey, String sValue)
- {
- if (sValue == null) sValue = "";
- sendIntent.putExtra(sKey, sValue);
- }
- private void updateBroadcastIntent(Intent sendIntent, String sKey, boolean bValue)
- {
- sendIntent.putExtra(sKey, bValue);
- }
- private void updateBroadcastIntent(Intent sendIntent, String sKey, int iValue)
- {
- sendIntent.putExtra(sKey, iValue);
- }
-
- private Service getService()
- {
- try {
- Service myService = null;
- if (_proxyListener != null && _proxyListener instanceof Service) {
- myService = (Service) _proxyListener;
- } else if (_appService != null) {
- myService = _appService;
- } else if (_appContext != null && _appContext instanceof Service) {
- myService = (Service) _appContext;
- }
- return myService;
- } catch (Exception ex){
- return null;
- }
- }
-
- private void sendBroadcastIntent(Intent sendIntent)
- {
- Service myService = null;
- if (_proxyListener != null && _proxyListener instanceof Service)
- {
- myService = (Service) _proxyListener;
- }
- else if (_appService != null)
- {
- myService = _appService;
- }
- Context myContext;
- if (myService != null){
- myContext = myService.getApplicationContext();
- } else if (_appContext != null){
- myContext = _appContext;
- }
- else
- {
- return;
- }
- try
- {
- if (myContext != null) myContext.sendBroadcast(sendIntent);
- }
- catch(Exception ex)
- {
- //If the service or context has become unavailable unexpectedly, catch the exception and move on -- no broadcast log will occur.
- }
- }
-
- private HttpURLConnection getURLConnection(Headers myHeader, String sURLString, int Timeout, int iContentLen)
- {
- String sContentType = "application/json";
- int CONNECTION_TIMEOUT = Timeout * 1000;
- int READ_TIMEOUT = Timeout * 1000;
- boolean bDoOutput = true;
- boolean bDoInput = true;
- boolean bUsesCaches = false;
- String sRequestMeth = "POST";
-
- boolean bInstFolRed = false;
- String sCharSet = "utf-8";
- int iContentLength = iContentLen;
-
- URL url;
- HttpURLConnection urlConnection;
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "getURLConnection");
- updateBroadcastIntent(sendIntent, "COMMENT1", "Actual Content Length: " + iContentLen);
-
- if (myHeader != null)
- {
- //if the header isn't null, use it and replace the hardcoded params
- int iTimeout;
- int iReadTimeout;
- sContentType = myHeader.getContentType();
- iTimeout = myHeader.getConnectTimeout();
- bDoOutput = myHeader.getDoOutput();
- bDoInput = myHeader.getDoInput();
- bUsesCaches = myHeader.getUseCaches();
- sRequestMeth = myHeader.getRequestMethod();
- iReadTimeout = myHeader.getReadTimeout();
- bInstFolRed = myHeader.getInstanceFollowRedirects();
- sCharSet = myHeader.getCharset();
- iContentLength = myHeader.getContentLength();
- CONNECTION_TIMEOUT = iTimeout*1000;
- READ_TIMEOUT = iReadTimeout*1000;
- updateBroadcastIntent(sendIntent, "COMMENT2", "\nHeader Defined Content Length: " + iContentLength);
- }
-
- try
- {
- url = new URL(sURLString);
- urlConnection = (HttpURLConnection) url.openConnection();
- urlConnection.setConnectTimeout(CONNECTION_TIMEOUT);
- urlConnection.setDoOutput(bDoOutput);
- urlConnection.setDoInput(bDoInput);
- urlConnection.setRequestMethod(sRequestMeth);
- urlConnection.setReadTimeout(READ_TIMEOUT);
- urlConnection.setInstanceFollowRedirects(bInstFolRed);
- urlConnection.setRequestProperty("Content-Type", sContentType);
- urlConnection.setRequestProperty("charset", sCharSet);
- urlConnection.setRequestProperty("Content-Length", "" + Integer.toString(iContentLength));
- urlConnection.setUseCaches(bUsesCaches);
- return urlConnection;
- }
- catch (Exception e)
- {
- return null;
- }
- finally
- {
- sendBroadcastIntent(sendIntent);
- }
- }
-
-
- private void sendOnSystemRequestToUrl(OnSystemRequest msg)
- {
- Intent sendIntent = createBroadcastIntent();
- Intent sendIntent2 = createBroadcastIntent();
-
- HttpURLConnection urlConnection = null;
- boolean bLegacy = false;
-
- String sURLString;
- if (!getPoliciesURL().equals(""))
- sURLString = sPoliciesURL;
- else
- sURLString = msg.getUrl();
-
- Integer iTimeout = msg.getTimeout();
-
- if (iTimeout == null)
- iTimeout = 2000;
-
- Headers myHeader = msg.getHeader();
-
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "sendOnSystemRequestToUrl");
- updateBroadcastIntent(sendIntent, "COMMENT5", "\r\nCloud URL: " + sURLString);
-
- try
- {
- if (myHeader == null)
- updateBroadcastIntent(sendIntent, "COMMENT7", "\r\nHTTPRequest Header is null");
-
- String sBodyString = msg.getBody();
-
- JSONObject jsonObjectToSendToServer;
- String valid_json = "";
- int length;
- if (sBodyString == null)
- {
- if(RequestType.HTTP.equals(msg.getRequestType())){
- length = msg.getBulkData().length;
- Intent sendIntent3 = createBroadcastIntent();
- updateBroadcastIntent(sendIntent3, "FUNCTION_NAME", "replace");
- updateBroadcastIntent(sendIntent3, "COMMENT1", "Valid Json length before replace: " + length);
- sendBroadcastIntent(sendIntent3);
-
- }else{
- List<String> legacyData = msg.getLegacyData();
- JSONArray jsonArrayOfSdlPPackets = new JSONArray(legacyData);
- jsonObjectToSendToServer = new JSONObject();
- jsonObjectToSendToServer.put("data", jsonArrayOfSdlPPackets);
- bLegacy = true;
- updateBroadcastIntent(sendIntent, "COMMENT6", "\r\nLegacy SystemRequest: true");
- valid_json = jsonObjectToSendToServer.toString().replace("\\", "");
- length = valid_json.getBytes("UTF-8").length;
- }
- }
- else
- {
- Intent sendIntent3 = createBroadcastIntent();
- updateBroadcastIntent(sendIntent3, "FUNCTION_NAME", "replace");
- updateBroadcastIntent(sendIntent3, "COMMENT1", "Valid Json length before replace: " + sBodyString.getBytes("UTF-8").length);
- sendBroadcastIntent(sendIntent3);
- valid_json = sBodyString.replace("\\", "");
- length = valid_json.getBytes("UTF-8").length;
- }
-
- urlConnection = getURLConnection(myHeader, sURLString, iTimeout, length);
-
- if (urlConnection == null)
- {
- Log.i(TAG, "urlConnection is null, check RPC input parameters");
- updateBroadcastIntent(sendIntent, "COMMENT2", "urlConnection is null, check RPC input parameters");
- return;
- }
-
- DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream());
- if(RequestType.HTTP.equals(msg.getRequestType())){
- wr.write(msg.getBulkData());
- }else{
- wr.writeBytes(valid_json);
- }
-
- wr.flush();
- wr.close();
-
-
- long BeforeTime = System.currentTimeMillis();
- long AfterTime = System.currentTimeMillis();
- final long roundtriptime = AfterTime - BeforeTime;
-
- updateBroadcastIntent(sendIntent, "COMMENT4", " Round trip time: " + roundtriptime);
- updateBroadcastIntent(sendIntent, "COMMENT1", "Received response from cloud, response code=" + urlConnection.getResponseCode() + " ");
-
- int iResponseCode = urlConnection.getResponseCode();
-
- if (iResponseCode != HttpURLConnection.HTTP_OK)
- {
- Log.i(TAG, "Response code not HTTP_OK, returning from sendOnSystemRequestToUrl.");
- updateBroadcastIntent(sendIntent, "COMMENT2", "Response code not HTTP_OK, aborting request. ");
- return;
- }
-
- InputStream is = urlConnection.getInputStream();
- BufferedReader rd = new BufferedReader(new InputStreamReader(is));
- String line;
- StringBuilder response = new StringBuilder();
- while((line = rd.readLine()) != null)
- {
- response.append(line);
- response.append('\r');
- }
- rd.close();
- //We've read the body
- if(RequestType.HTTP.equals(msg.getRequestType())){
- // Create the SystemRequest RPC to send to module.
- PutFile putFile = new PutFile();
- putFile.setFileType(FileType.JSON);
- putFile.setCorrelationID(POLICIES_CORRELATION_ID);
- putFile.setSdlFileName("response_data");
- putFile.setFileData(response.toString().getBytes("UTF-8"));
- putFile.setCRC(response.toString().getBytes());
- updateBroadcastIntent(sendIntent, "DATA", "Data from cloud response: " + response.toString());
-
- sendRPCRequestPrivate(putFile);
- Log.i("sendSystemRequestToUrl", "sent to sdl");
-
- updateBroadcastIntent(sendIntent2, "RPC_NAME", FunctionID.PUT_FILE.toString());
- updateBroadcastIntent(sendIntent2, "TYPE", RPCMessage.KEY_REQUEST);
- updateBroadcastIntent(sendIntent2, "CORRID", putFile.getCorrelationID());
-
- }else{
- Vector<String> cloudDataReceived = new Vector<String>();
- final String dataKey = "data";
- // Convert the response to JSON
- JSONObject jsonResponse = new JSONObject(response.toString());
- if(jsonResponse.has(dataKey)){
- if (jsonResponse.get(dataKey) instanceof JSONArray)
- {
- JSONArray jsonArray = jsonResponse.getJSONArray(dataKey);
- for (int i=0; i<jsonArray.length(); i++)
- {
- if (jsonArray.get(i) instanceof String)
- {
- cloudDataReceived.add(jsonArray.getString(i));
- //Log.i("sendSystemRequestToUrl", "jsonArray.getString(i): " + jsonArray.getString(i));
- }
- }
- }
- else if (jsonResponse.get(dataKey) instanceof String)
- {
- cloudDataReceived.add(jsonResponse.getString(dataKey));
- //Log.i("sendSystemRequestToUrl", "jsonResponse.getString(data): " + jsonResponse.getString("data"));
- }
- }
- else
- {
- DebugTool.logError("sendSystemRequestToUrl: Data in JSON Object neither an array nor a string.");
- //Log.i("sendSystemRequestToUrl", "sendSystemRequestToUrl: Data in JSON Object neither an array nor a string.");
- return;
- }
-
- String sResponse = cloudDataReceived.toString();
-
- if (sResponse.length() > 512)
- {
- sResponse = sResponse.substring(0, 511);
- }
-
- updateBroadcastIntent(sendIntent, "DATA", "Data from cloud response: " + sResponse);
-
- // Send new SystemRequest to SDL
- SystemRequest mySystemRequest = null;
-
- if (bLegacy){
- if(cloudDataReceived != null) {
- mySystemRequest = new SystemRequest(true);
- mySystemRequest.setCorrelationID(getPoliciesReservedCorrelationID());
- mySystemRequest.setLegacyData(cloudDataReceived);
- }
- }else{
- if (response != null) {
- mySystemRequest = new SystemRequest();
- mySystemRequest.setRequestType(RequestType.PROPRIETARY);
- mySystemRequest.setCorrelationID(getPoliciesReservedCorrelationID());
- mySystemRequest.setBulkData(response.toString().getBytes());
- }
- }
-
- if (getIsConnected())
- {
- sendRPCRequestPrivate(mySystemRequest);
- Log.i("sendSystemRequestToUrl", "sent to sdl");
-
- updateBroadcastIntent(sendIntent2, "RPC_NAME", FunctionID.SYSTEM_REQUEST.toString());
- updateBroadcastIntent(sendIntent2, "TYPE", RPCMessage.KEY_REQUEST);
- updateBroadcastIntent(sendIntent2, "CORRID", mySystemRequest.getCorrelationID());
- }
- }
- }
- catch (SdlException e)
- {
- DebugTool.logError("sendSystemRequestToUrl: Could not get data from JSONObject received.", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " SdlException encountered sendOnSystemRequestToUrl: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: Could not get data from JSONObject received."+ e);
- }
- catch (JSONException e)
- {
- DebugTool.logError("sendSystemRequestToUrl: JSONException: ", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " JSONException encountered sendOnSystemRequestToUrl: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: JSONException: "+ e);
- }
- catch (UnsupportedEncodingException e)
- {
- DebugTool.logError("sendSystemRequestToUrl: Could not encode string.", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " UnsupportedEncodingException encountered sendOnSystemRequestToUrl: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: Could not encode string."+ e);
- }
- catch (ProtocolException e)
- {
- DebugTool.logError("sendSystemRequestToUrl: Could not set request method to post.", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " ProtocolException encountered sendOnSystemRequestToUrl: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: Could not set request method to post."+ e);
- }
- catch (MalformedURLException e)
- {
- DebugTool.logError("sendSystemRequestToUrl: URL Exception when sending SystemRequest to an external server.", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " MalformedURLException encountered sendOnSystemRequestToUrl: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: URL Exception when sending SystemRequest to an external server."+ e);
- }
- catch (IOException e)
- {
- DebugTool.logError("sendSystemRequestToUrl: IOException: ", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " IOException while sending to cloud: IOException: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: IOException: "+ e);
- }
- catch (Exception e)
- {
- DebugTool.logError("sendSystemRequestToUrl: Unexpected Exception: ", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " Exception encountered sendOnSystemRequestToUrl: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: Unexpected Exception: " + e);
- }
- finally
- {
- sendBroadcastIntent(sendIntent);
- sendBroadcastIntent(sendIntent2);
-
- if (iFileCount < 10)
- iFileCount++;
- else
- iFileCount = 0;
-
- if(urlConnection != null)
- {
- urlConnection.disconnect();
- }
- }
- }
-
- private int getPoliciesReservedCorrelationID() {
- return POLICIES_CORRELATION_ID;
- }
-
- // Test correlationID
- private boolean isCorrelationIDProtected(Integer correlationID) {
- return correlationID != null &&
- (HEARTBEAT_CORRELATION_ID == correlationID
- || REGISTER_APP_INTERFACE_CORRELATION_ID == correlationID
- || UNREGISTER_APP_INTERFACE_CORRELATION_ID == correlationID
- || POLICIES_CORRELATION_ID == correlationID);
-
- }
-
- // Protected isConnected method to allow legacy proxy to poll isConnected state
- public Boolean getIsConnected() {
- return sdlSession != null && sdlSession.getIsConnected();
- }
-
-
- /**
- * Returns whether the application is registered in SDL. Note: for testing
- * purposes, it's possible that the connection is established, but the
- * application is not registered.
- *
- * @return true if the application is registered in SDL
- */
- public Boolean getAppInterfaceRegistered() {
- return _appInterfaceRegisterd;
- }
-
- // Function to initialize new proxy connection
- public void initializeProxy() throws SdlException {
- // Reset all of the flags and state variables
- _haveReceivedFirstNonNoneHMILevel = false;
- _haveReceivedFirstFocusLevel = false;
- _haveReceivedFirstFocusLevelFull = false;
- _appInterfaceRegisterd = _preRegisterd;
-
- _putFileListenerList.clear();
-
- _sdlIntefaceAvailablity = SdlInterfaceAvailability.SDL_INTERFACE_UNAVAILABLE;
-
- //Initialize _systemCapabilityManager here.
- _systemCapabilityManager = new SystemCapabilityManager(_internalInterface);
- // Setup SdlConnection
- synchronized(CONNECTION_REFERENCE_LOCK) {
-
- //Handle legacy USB connections
- if(_transportConfig != null
- && TransportType.USB.equals(_transportConfig.getTransportType())){
- //A USB transport config was provided
- USBTransportConfig usbTransportConfig = (USBTransportConfig)_transportConfig;
- if(usbTransportConfig.getUsbAccessory() == null){
- DebugTool.logInfo("Legacy USB transport config was used, but received null for accessory. Attempting to connect with router service");
- //The accessory was null which means it came from a router service
- MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(usbTransportConfig.getUSBContext(),_appID);
- multiplexTransportConfig.setRequiresHighBandwidth(true);
- multiplexTransportConfig.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF);
- multiplexTransportConfig.setPrimaryTransports(Collections.singletonList(TransportType.USB));
- multiplexTransportConfig.setSecondaryTransports(new ArrayList<TransportType>());
- _transportConfig = multiplexTransportConfig;
- }
- }
-
- if(_transportConfig.getTransportType().equals(TransportType.MULTIPLEX)){
- this.sdlSession = new SdlSession2(_interfaceBroker,(MultiplexTransportConfig)_transportConfig);
- }else{
- this.sdlSession = SdlSession.createSession((byte)getProtocolVersion().getMajor(),_interfaceBroker, _transportConfig);
- }
- }
-
- synchronized(CONNECTION_REFERENCE_LOCK) {
- this.sdlSession.startSession();
- sendTransportBroadcast();
- }
- }
- /**
- * This method will fake the multiplex connection event
- */
- @SuppressWarnings("unused")
- public void forceOnConnected(){
- synchronized(CONNECTION_REFERENCE_LOCK) {
- if (sdlSession != null) {
- Log.d(TAG, "Forcing on connected.... might actually need this"); //FIXME
- /*if(sdlSession.getSdlConnection()==null){ //There is an issue when switching from v1 to v2+ where the connection is closed. So we restart the session during this call.
- try {
- sdlSession.startSession();
- } catch (SdlException e) {
- e.printStackTrace();
- }
- }
- sdlSession.getSdlConnection().forceHardwareConnectEvent(TransportType.BLUETOOTH);
- */
- }
- }
- }
-
- public void sendTransportBroadcast()
- {
- if (sdlSession == null || _transportConfig == null) return;
-
- String sTransComment = sdlSession.getBroadcastComment(_transportConfig);
-
- if (sTransComment == null || sTransComment.equals("")) return;
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "initializeProxy");
- updateBroadcastIntent(sendIntent, "COMMENT1", sTransComment);
- sendBroadcastIntent(sendIntent);
- }
-
-
- /**
- * Public method to enable the siphon transport
- */
- @SuppressWarnings("unused")
- public void enableSiphonDebug() {
-
- short enabledPortNumber = SiphonServer.enableSiphonServer();
- String sSiphonPortNumber = "Enabled Siphon Port Number: " + enabledPortNumber;
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "enableSiphonDebug");
- updateBroadcastIntent(sendIntent, "COMMENT1", sSiphonPortNumber);
- sendBroadcastIntent(sendIntent);
- }
-
-
-
- /**
- * Public method to disable the Siphon Trace Server
- */
- @SuppressWarnings("unused")
- public void disableSiphonDebug() {
-
- short disabledPortNumber = SiphonServer.disableSiphonServer();
- if (disabledPortNumber != -1) {
- String sSiphonPortNumber = "Disabled Siphon Port Number: " + disabledPortNumber;
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "disableSiphonDebug");
- updateBroadcastIntent(sendIntent, "COMMENT1", sSiphonPortNumber);
- sendBroadcastIntent(sendIntent);
- }
- }
-
-
-
- /**
- * Public method to enable the Debug Tool
- */
- public static void enableDebugTool() {
- DebugTool.enableDebugTool();
- }
-
- /**
- * Public method to disable the Debug Tool
- */
- public static void disableDebugTool() {
- DebugTool.disableDebugTool();
- }
-
- /**
- * Public method to determine Debug Tool enabled
- */
- @SuppressWarnings("BooleanMethodIsAlwaysInverted")
- public static boolean isDebugEnabled() {
- return DebugTool.isDebugEnabled();
- }
-
-
- /**
- * Check to see if it a transport is available to perform audio streaming.
- * <br><strong>NOTE:</strong> This is only for the audio streaming service, not regular
- * streaming of media playback.
- * @return true if there is either an audio streaming supported
- * transport currently connected or a transport is
- * available to connect with. false if there is no
- * transport connected to support audio streaming and
- * no possibility in the foreseeable future.
- */
- public boolean isAudioStreamTransportAvailable(){
- return sdlSession!= null && sdlSession.isTransportForServiceAvailable(SessionType.PCM);
- }
-
- /**
- * Check to see if it a transport is available to perform video streaming.
-
- * @return true if there is either an video streaming supported
- * transport currently connected or a transport is
- * available to connect with. false if there is no
- * transport connected to support video streaming and
- * no possibility in the foreseeable future.
- */
- public boolean isVideoStreamTransportAvailable(){
- return sdlSession!= null && sdlSession.isTransportForServiceAvailable(SessionType.NAV);
- }
-
-
- @SuppressWarnings("unused")
- @Deprecated
- public void close() throws SdlException {
- dispose();
- }
-
- @SuppressWarnings("UnusedParameters")
- private void cleanProxy(SdlDisconnectedReason disconnectedReason) throws SdlException {
- try {
-
- // ALM Specific Cleanup
- if (_advancedLifecycleManagementEnabled) {
- _sdlConnectionState = SdlConnectionState.SDL_DISCONNECTED;
-
- firstTimeFull = true;
-
- // Should we wait for the interface to be unregistered?
- Boolean waitForInterfaceUnregistered = false;
- // Unregister app interface
- synchronized(CONNECTION_REFERENCE_LOCK) {
- if (getIsConnected() && getAppInterfaceRegistered()) {
- waitForInterfaceUnregistered = true;
- unregisterAppInterfacePrivate(UNREGISTER_APP_INTERFACE_CORRELATION_ID);
- }
- }
-
- // Wait for the app interface to be unregistered
- if (waitForInterfaceUnregistered) {
- synchronized(APP_INTERFACE_REGISTERED_LOCK) {
- try {
- APP_INTERFACE_REGISTERED_LOCK.wait(3000);
- } catch (InterruptedException e) {
- // Do nothing
- }
- }
- }
- }
-
- if(rpcResponseListeners != null){
- rpcResponseListeners.clear();
- }
- if(rpcNotificationListeners != null){
- rpcNotificationListeners.clear();
- }
-
- // Clean up SDL Connection
- synchronized(CONNECTION_REFERENCE_LOCK) {
- if (sdlSession != null) sdlSession.close();
- }
- } finally {
- SdlTrace.logProxyEvent("SdlProxy cleaned.", SDL_LIB_TRACE_KEY);
- }
- }
-
- /**
- * Terminates the App's Interface Registration, closes the transport connection, ends the protocol session, and frees any resources used by the proxy.
- */
- public void dispose() throws SdlException
- {
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- _proxyDisposed = true;
-
- SdlTrace.logProxyEvent("Application called dispose() method.", SDL_LIB_TRACE_KEY);
-
- try{
- // Clean the proxy
- cleanProxy(SdlDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);
-
- // Close IncomingProxyMessageDispatcher thread
- synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
- if (_incomingProxyMessageDispatcher != null) {
- _incomingProxyMessageDispatcher.dispose();
- _incomingProxyMessageDispatcher = null;
- }
- }
-
- // Close OutgoingProxyMessageDispatcher thread
- synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {
- if (_outgoingProxyMessageDispatcher != null) {
- _outgoingProxyMessageDispatcher.dispose();
- _outgoingProxyMessageDispatcher = null;
- }
- }
-
- // Close InternalProxyMessageDispatcher thread
- synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
- if (_internalProxyMessageDispatcher != null) {
- _internalProxyMessageDispatcher.dispose();
- _internalProxyMessageDispatcher = null;
- }
- }
-
- _traceDeviceInterrogator = null;
-
- rpcResponseListeners = null;
-
- } finally {
- SdlTrace.logProxyEvent("SdlProxy disposed.", SDL_LIB_TRACE_KEY);
- }
- } // end-method
-
-
- private final static Object CYCLE_LOCK = new Object();
-
- private boolean _cycling = false;
-
- // Method to cycle the proxy, only called in ALM
- protected void cycleProxy(SdlDisconnectedReason disconnectedReason) {
- if (_cycling) return;
-
- synchronized(CYCLE_LOCK)
- {
- try{
- _cycling = true;
- cleanProxy(disconnectedReason);
- initializeProxy();
- if(!SdlDisconnectedReason.LEGACY_BLUETOOTH_MODE_ENABLED.equals(disconnectedReason)
- && !SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST.equals(disconnectedReason)){//We don't want to alert higher if we are just cycling for legacy bluetooth
- notifyProxyClosed("Sdl Proxy Cycled", new SdlException("Sdl Proxy Cycled", SdlExceptionCause.SDL_PROXY_CYCLED), disconnectedReason);
- }
- }
- catch (SdlException e) {
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "cycleProxy");
- updateBroadcastIntent(sendIntent, "COMMENT1", "Proxy cycled, exception cause: " + e.getSdlExceptionCause());
- sendBroadcastIntent(sendIntent);
-
- switch(e.getSdlExceptionCause()) {
- case BLUETOOTH_DISABLED:
- notifyProxyClosed("Bluetooth is disabled. Bluetooth must be enabled to connect to SDL. Reattempt a connection once Bluetooth is enabled.",
- new SdlException("Bluetooth is disabled. Bluetooth must be enabled to connect to SDL. Reattempt a connection once Bluetooth is enabled.", SdlExceptionCause.BLUETOOTH_DISABLED), SdlDisconnectedReason.BLUETOOTH_DISABLED);
- break;
- case BLUETOOTH_ADAPTER_NULL:
- notifyProxyClosed("Cannot locate a Bluetooth adapater. A SDL connection is impossible on this device until a Bluetooth adapter is added.",
- new SdlException("Cannot locate a Bluetooth adapater. A SDL connection is impossible on this device until a Bluetooth adapter is added.", SdlExceptionCause.BLUETOOTH_ADAPTER_NULL), SdlDisconnectedReason.BLUETOOTH_ADAPTER_ERROR);
- break;
- default :
- notifyProxyClosed("Cycling the proxy failed.", e, SdlDisconnectedReason.GENERIC_ERROR);
- break;
- }
- } catch (Exception e) {
- notifyProxyClosed("Cycling the proxy failed.", e, SdlDisconnectedReason.GENERIC_ERROR);
- }
- _cycling = false;
- }
- }
-
-
-
- /************* Functions used by the Message Dispatching Queues ****************/
- private void dispatchIncomingMessage(ProtocolMessage message) {
- try{
- // Dispatching logic
- if (message.getSessionType().equals(SessionType.RPC)
- ||message.getSessionType().equals(SessionType.BULK_DATA) ) {
- try {
- if (protocolVersion!= null && protocolVersion.getMajor() == 1 && message.getVersion() > 1) {
- if(sdlSession != null
- && sdlSession.getProtocolVersion()!= null
- && sdlSession.getProtocolVersion().getMajor() > 1){
- setProtocolVersion(sdlSession.getProtocolVersion());
- }else{
- setProtocolVersion(new Version(message.getVersion(),0,0));
- }
- }
-
- Hashtable<String, Object> hash = new Hashtable<String, Object>();
- if (protocolVersion!= null && protocolVersion.getMajor() > 1) {
- Hashtable<String, Object> hashTemp = new Hashtable<String, Object>();
- hashTemp.put(RPCMessage.KEY_CORRELATION_ID, message.getCorrID());
- if (message.getJsonSize() > 0) {
- final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());
- //hashTemp.put(Names.parameters, mhash.get(Names.parameters));
- if (mhash != null) {
- hashTemp.put(RPCMessage.KEY_PARAMETERS, mhash);
- }
- }
-
- String functionName = FunctionID.getFunctionName(message.getFunctionID());
- if (functionName != null) {
- hashTemp.put(RPCMessage.KEY_FUNCTION_NAME, functionName);
- } else {
- DebugTool.logWarning("Dispatch Incoming Message - function name is null unknown RPC. FunctionId: " + message.getFunctionID());
- return;
- }
- if (message.getRPCType() == 0x00) {
- hash.put(RPCMessage.KEY_REQUEST, hashTemp);
- } else if (message.getRPCType() == 0x01) {
- hash.put(RPCMessage.KEY_RESPONSE, hashTemp);
- } else if (message.getRPCType() == 0x02) {
- hash.put(RPCMessage.KEY_NOTIFICATION, hashTemp);
- }
- if (message.getBulkData() != null) hash.put(RPCStruct.KEY_BULK_DATA, message.getBulkData());
- if (message.getPayloadProtected()) hash.put(RPCStruct.KEY_PROTECTED, true);
- } else {
- hash = JsonRPCMarshaller.unmarshall(message.getData());
- }
- handleRPCMessage(hash);
- } catch (final Exception excp) {
- DebugTool.logError("Failure handling protocol message: " + excp.toString(), excp);
- passErrorToProxyListener("Error handing incoming protocol message.", excp);
- } // end-catch
- } //else { Handle other protocol message types here}
- } catch (final Exception e) {
- // Pass error to application through listener
- DebugTool.logError("Error handing proxy event.", e);
- passErrorToProxyListener("Error handing incoming protocol message.", e);
- }
- }
-
- /**
- * Get the SDL protocol spec version being used
- * @return Version of the protocol spec
- */
- public @NonNull Version getProtocolVersion(){
- if(this.protocolVersion == null){
- this.protocolVersion = new Version(1,0,0);
- }
- return this.protocolVersion;
- }
-
- private void setProtocolVersion(@NonNull Version version) {
- this.protocolVersion = version;
- }
-
- public String serializeJSON(RPCMessage msg)
- {
- try
- {
- return msg.serializeJSON((byte)this.getProtocolVersion().getMajor()).toString(2);
- }
- catch (final Exception e)
- {
- DebugTool.logError("Error handing proxy event.", e);
- passErrorToProxyListener("Error serializing message.", e);
- return null;
- }
- }
-
- private void handleErrorsFromIncomingMessageDispatcher(String info, Exception e) {
- passErrorToProxyListener(info, e);
- }
-
- private void dispatchOutgoingMessage(ProtocolMessage message) {
- synchronized(CONNECTION_REFERENCE_LOCK) {
- if (sdlSession != null) {
- sdlSession.sendMessage(message);
- }
- }
- SdlTrace.logProxyEvent("SdlProxy sending Protocol Message: " + message.toString(), SDL_LIB_TRACE_KEY);
- }
-
- private void handleErrorsFromOutgoingMessageDispatcher(String info, Exception e) {
- passErrorToProxyListener(info, e);
- }
-
- void dispatchInternalMessage(final InternalProxyMessage message) {
- try{
- switch (message.getFunctionName()) {
- case InternalProxyMessage.OnProxyError: {
- final OnError msg = (OnError) message;
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onError(msg.getInfo(), msg.getException());
- }
- });
- } else {
- _proxyListener.onError(msg.getInfo(), msg.getException());
- }
- break;
- }
- case InternalProxyMessage.OnServiceEnded: {
- final OnServiceEnded msg = (OnServiceEnded) message;
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onServiceEnded(msg);
- }
- });
- } else {
- _proxyListener.onServiceEnded(msg);
- }
- break;
- }
- case InternalProxyMessage.OnServiceNACKed: {
- final OnServiceNACKed msg = (OnServiceNACKed) message;
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onServiceNACKed(msg);
- }
- });
- } else {
- _proxyListener.onServiceNACKed(msg);
- }
-
- /* *************Start Legacy Specific Call-backs************/
- break;
- }
- case InternalProxyMessage.OnProxyOpened:
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- ((IProxyListener) _proxyListener).onProxyOpened();
- }
- });
- } else {
- ((IProxyListener) _proxyListener).onProxyOpened();
- }
- break;
- case InternalProxyMessage.OnProxyClosed: {
- final OnProxyClosed msg = (OnProxyClosed) message;
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onProxyClosed(msg.getInfo(), msg.getException(), msg.getReason());
- }
- });
- } else {
- _proxyListener.onProxyClosed(msg.getInfo(), msg.getException(), msg.getReason());
- }
- /* ***************End Legacy Specific Call-backs************/
- break;
- }
- default:
- // Diagnostics
- SdlTrace.logProxyEvent("Unknown RPC Message encountered. Check for an updated version of the SDL Proxy.", SDL_LIB_TRACE_KEY);
- DebugTool.logError("Unknown RPC Message encountered. Check for an updated version of the SDL Proxy.");
- break;
- }
-
- SdlTrace.logProxyEvent("Proxy fired callback: " + message.getFunctionName(), SDL_LIB_TRACE_KEY);
- } catch(final Exception e) {
- // Pass error to application through listener
- DebugTool.logError("Error handing proxy event.", e);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onError("Error handing proxy event.", e);
- }
- });
- } else {
- _proxyListener.onError("Error handing proxy event.", e);
- }
- }
- }
-
- private void handleErrorsFromInternalMessageDispatcher(String info, Exception e) {
- DebugTool.logError(info, e);
- // This error cannot be passed to the user, as it indicates an error
- // in the communication between the proxy and the application.
-
- DebugTool.logError("InternalMessageDispatcher failed.", e);
-
- // Note, this is the only place where the _proxyListener should be referenced asdlhronously,
- // with an error on the internalMessageDispatcher, we have no other reliable way of
- // communicating with the application.
- notifyProxyClosed("Proxy callback dispatcher is down. Proxy instance is invalid.", e, SdlDisconnectedReason.GENERIC_ERROR);
- _proxyListener.onError("Proxy callback dispatcher is down. Proxy instance is invalid.", e);
- }
- /************* END Functions used by the Message Dispatching Queues ****************/
-
- // Private sendPRCRequest method. All RPCRequests are funneled through this method after
- // error checking.
- private void sendRPCRequestPrivate(RPCRequest request) throws SdlException {
- try {
- SdlTrace.logRPCEvent(InterfaceActivityDirection.Transmit, request, SDL_LIB_TRACE_KEY);
-
- request.format(rpcSpecVersion,true);
- byte[] msgBytes = JsonRPCMarshaller.marshall(request, (byte)getProtocolVersion().getMajor());
-
- ProtocolMessage pm = new ProtocolMessage();
- pm.setData(msgBytes);
- if (sdlSession != null)
- pm.setSessionID(sdlSession.getSessionId());
- pm.setMessageType(MessageType.RPC);
- pm.setSessionType(SessionType.RPC);
- pm.setFunctionID(FunctionID.getFunctionId(request.getFunctionName()));
- pm.setPayloadProtected(request.isPayloadProtected());
- if (request.getCorrelationID() == null)
- {
- //Log error here
- throw new SdlException("CorrelationID cannot be null. RPC: " + request.getFunctionName(), SdlExceptionCause.INVALID_ARGUMENT);
- }
- pm.setCorrID(request.getCorrelationID());
- if (request.getBulkData() != null){
- pm.setBulkData(request.getBulkData());
- }
- if(request.getFunctionName().equalsIgnoreCase(FunctionID.PUT_FILE.name())){
- pm.setPriorityCoefficient(1);
- }
-
- // Queue this outgoing message
- synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {
- if (_outgoingProxyMessageDispatcher != null) {
- _outgoingProxyMessageDispatcher.queueMessage(pm);
- //Since the message is queued we can add it's listener to our list
- OnRPCResponseListener listener = request.getOnRPCResponseListener();
- if(request.getMessageType().equals(RPCMessage.KEY_REQUEST)){//We might want to include other message types in the future
- addOnRPCResponseListener(listener, request.getCorrelationID(), msgBytes.length);
- }
- }
- }
- } catch (OutOfMemoryError e) {
- SdlTrace.logProxyEvent("OutOfMemory exception while sending request " + request.getFunctionName(), SDL_LIB_TRACE_KEY);
- throw new SdlException("OutOfMemory exception while sending request " + request.getFunctionName(), e, SdlExceptionCause.INVALID_ARGUMENT);
- }
- }
-
- /**
- * Only call this method for a PutFile response. It will cause a class cast exception if not.
- * @param correlationId correlation id of the packet being updated
- * @param bytesWritten how many bytes were written
- * @param totalSize the total size in bytes
- */
- @SuppressWarnings("unused")
- public void onPacketProgress(int correlationId, long bytesWritten, long totalSize){
- synchronized(ON_UPDATE_LISTENER_LOCK){
- if(rpcResponseListeners !=null
- && rpcResponseListeners.indexOfKey(correlationId)>=0){
- ((OnPutFileUpdateListener)rpcResponseListeners.get(correlationId)).onUpdate(correlationId, bytesWritten, totalSize);
- }
- }
-
- }
-
- /**
- * Will provide callback to the listener either onFinish or onError depending on the RPCResponses result code,
- * <p>Will automatically remove the listener for the list of listeners on completion.
- * @param msg The RPCResponse message that was received
- * @return if a listener was called or not
- */
- @SuppressWarnings("UnusedReturnValue")
- private boolean onRPCResponseReceived(RPCResponse msg){
- synchronized(ON_UPDATE_LISTENER_LOCK){
- int correlationId = msg.getCorrelationID();
- if(rpcResponseListeners !=null
- && rpcResponseListeners.indexOfKey(correlationId)>=0){
- OnRPCResponseListener listener = rpcResponseListeners.get(correlationId);
- if(msg.getSuccess()){
- listener.onResponse(correlationId, msg);
- }else{
- listener.onError(correlationId, msg.getResultCode(), msg.getInfo());
- }
- rpcResponseListeners.remove(correlationId);
- return true;
- }
- return false;
- }
- }
-
-/**
- * Add a listener that will receive the response to the specific RPCRequest sent with the corresponding correlation id
- * @param listener that will get called back when a response is received
- * @param correlationId of the RPCRequest that was sent
- * @param totalSize only include if this is an OnPutFileUpdateListener. Otherwise it will be ignored.
- */
- public void addOnRPCResponseListener(OnRPCResponseListener listener,int correlationId, int totalSize){
- synchronized(ON_UPDATE_LISTENER_LOCK){
- if(rpcResponseListeners!=null
- && listener !=null){
- if(listener.getListenerType() == OnRPCResponseListener.UPDATE_LISTENER_TYPE_PUT_FILE){
- ((OnPutFileUpdateListener)listener).setTotalSize(totalSize);
- }
- listener.onStart(correlationId);
- rpcResponseListeners.put(correlationId, listener);
- }
- }
- }
-
- @SuppressWarnings("unused")
- public SparseArray<OnRPCResponseListener> getResponseListeners(){
- synchronized(ON_UPDATE_LISTENER_LOCK){
- return this.rpcResponseListeners;
- }
- }
-
- @SuppressWarnings("UnusedReturnValue")
- public boolean onRPCNotificationReceived(RPCNotification notification){
- synchronized(ON_NOTIFICATION_LISTENER_LOCK){
- CopyOnWriteArrayList<OnRPCNotificationListener> listeners = rpcNotificationListeners.get(FunctionID.getFunctionId(notification.getFunctionName()));
- if(listeners!=null && listeners.size()>0) {
- for (OnRPCNotificationListener listener : listeners) {
- listener.onNotified(notification);
- }
- return true;
- }
- return false;
- }
- }
-
- /**
- * This will ad a listener for the specific type of notification. As of now it will only allow
- * a single listener per notification function id
- * @param notificationId The notification type that this listener is designated for
- * @param listener The listener that will be called when a notification of the provided type is received
- */
- @SuppressWarnings("unused")
- public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
- synchronized(ON_NOTIFICATION_LISTENER_LOCK){
- if(notificationId != null && listener != null){
- if(rpcNotificationListeners.indexOfKey(notificationId.getId()) < 0 ){
- rpcNotificationListeners.put(notificationId.getId(),new CopyOnWriteArrayList<OnRPCNotificationListener>());
- }
- rpcNotificationListeners.get(notificationId.getId()).add(listener);
- }
- }
- }
-
- /**
- * This method is no longer valid and will not remove the listener for the supplied notificaiton id
- * @param notificationId n/a
- * @see #removeOnRPCNotificationListener(FunctionID, OnRPCNotificationListener)
- */
- @SuppressWarnings("unused")
- @Deprecated
- public void removeOnRPCNotificationListener(FunctionID notificationId){
- synchronized(ON_NOTIFICATION_LISTENER_LOCK){
- //rpcNotificationListeners.delete(notificationId.getId());
- }
- }
-
- public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
- synchronized(ON_NOTIFICATION_LISTENER_LOCK){
- if(rpcNotificationListeners!= null
- && notificationId != null
- && listener != null
- && rpcNotificationListeners.indexOfKey(notificationId.getId()) >= 0){
- return rpcNotificationListeners.get(notificationId.getId()).remove(listener);
- }
- }
- return false;
- }
-
- private void processRaiResponse(RegisterAppInterfaceResponse rai)
- {
- if (rai == null) return;
-
- VehicleType vt = rai.getVehicleType();
- if (vt == null) return;
-
- String make = vt.getMake();
- if (make == null) return;
-
- if (_secList == null) return;
-
- 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
- {
- sec = cls.newInstance();
- }
- catch (Exception e)
- {
- continue;
- }
-
- if ( (sec != null) && (sec.getMakeList() != null) )
- {
- if (sec.getMakeList().contains(make))
- {
- setSdlSecurity(sec);
- sec.setAppId(_appID);
- if (sdlSession != null)
- sec.handleSdlSession(sdlSession);
- return;
- }
- }
- }
- }
-
- 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();
-
- if (messageType.equals(RPCMessage.KEY_RESPONSE)) {
- SdlTrace.logRPCEvent(InterfaceActivityDirection.Receive, new RPCResponse(rpcMsg), SDL_LIB_TRACE_KEY);
-
- // Check to ensure response is not from an internal message (reserved correlation ID)
- if (isCorrelationIDProtected((new RPCResponse(hash)).getCorrelationID())) {
- // This is a response generated from an internal message, it can be trapped here
- // The app should not receive a response for a request it did not send
- if ((new RPCResponse(hash)).getCorrelationID() == REGISTER_APP_INTERFACE_CORRELATION_ID
- && _advancedLifecycleManagementEnabled
- && functionName.equals(FunctionID.REGISTER_APP_INTERFACE.toString())) {
- final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (msg.getSuccess()) {
- _appInterfaceRegisterd = true;
- }
- processRaiResponse(msg);
-
- //Populate the system capability manager with the RAI response
- _systemCapabilityManager.parseRAIResponse(msg);
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.REGISTER_APP_INTERFACE.toString());
- updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
- updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
- updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
- updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
- updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
- updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
- sendBroadcastIntent(sendIntent);
-
- //_autoActivateIdReturned = msg.getAutoActivateID();
- /*Place holder for legacy support*/ _autoActivateIdReturned = "8675309";
- _prerecordedSpeech = msg.getPrerecordedSpeech();
- _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)
- {
- if ( (_sdlMsgVersion.getMajorVersion() > 2) && (_lastHashID != null) && (msg.getSuccess()) && (msg.getResultCode() != Result.RESUME_FAILED) )
- _bResumeSuccess = true;
- else
- {
- _bResumeSuccess = false;
- _lastHashID = null;
- }
- }
- _diagModes = msg.getSupportedDiagModes();
-
- String sVersionInfo = "SDL Proxy Version: " + _proxyVersionInfo;
-
- if (!isDebugEnabled())
- {
- enableDebugTool();
- DebugTool.logInfo(sVersionInfo, false);
- disableDebugTool();
- }
- else
- DebugTool.logInfo(sVersionInfo, false);
-
- sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "FUNCTION_NAME", "RAI_RESPONSE");
- updateBroadcastIntent(sendIntent, "COMMENT1", sVersionInfo);
- sendBroadcastIntent(sendIntent);
-
- // Send onSdlConnected message in ALM
- _sdlConnectionState = SdlConnectionState.SDL_CONNECTED;
-
- // If registerAppInterface failed, exit with OnProxyUnusable
- if (!msg.getSuccess()) {
- notifyProxyClosed("Unable to register app interface. Review values passed to the SdlProxy constructor. RegisterAppInterface result code: ",
- new SdlException("Unable to register app interface. Review values passed to the SdlProxy constructor. RegisterAppInterface result code: " + msg.getResultCode(), SdlExceptionCause.SDL_REGISTRATION_ERROR), SdlDisconnectedReason.SDL_REGISTRATION_ERROR);
- }
-
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- if (_proxyListener instanceof IProxyListener) {
- ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
- }
- onRPCResponseReceived(msg);
- }
- });
- } else {
- if (_proxyListener instanceof IProxyListener) {
- ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
- }
- onRPCResponseReceived(msg);
- }
- } else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID
- && functionName.equals(FunctionID.ON_ENCODED_SYNC_P_DATA.toString())) {
-
- Log.i("pt", "POLICIES_CORRELATION_ID SystemRequest Notification (Legacy)");
-
- final OnSystemRequest msg = new OnSystemRequest(hash);
-
- // If url is not null, then send to URL
- if ( (msg.getUrl() != null) )
- {
- // URL has data, attempt to post request to external server
- Thread handleOffboardTransmissionThread = new Thread() {
- @Override
- public void run() {
- sendOnSystemRequestToUrl(msg);
- }
- };
-
- handleOffboardTransmissionThread.start();
- }
- }
- else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID
- && functionName.equals(FunctionID.ENCODED_SYNC_P_DATA.toString())) {
-
- Log.i("pt", "POLICIES_CORRELATION_ID SystemRequest Response (Legacy)");
- final SystemRequestResponse msg = new SystemRequestResponse(hash);
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.SYSTEM_REQUEST.toString());
- updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
- updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
- updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
- updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
- updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
- sendBroadcastIntent(sendIntent);
- }
- else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID
- && functionName.equals(FunctionID.SYSTEM_REQUEST.toString())) {
- final SystemRequestResponse msg = new SystemRequestResponse(hash);
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.SYSTEM_REQUEST.toString());
- updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
- updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
- updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
- updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
- updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
- updateBroadcastIntent(sendIntent, "DATA", serializeJSON(msg));
- sendBroadcastIntent(sendIntent);
- }
- else if (functionName.equals(FunctionID.UNREGISTER_APP_INTERFACE.toString())) {
- // UnregisterAppInterface
- _appInterfaceRegisterd = false;
- synchronized(APP_INTERFACE_REGISTERED_LOCK) {
- 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);
- updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
- updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
- updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
- updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
- updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
- sendBroadcastIntent(sendIntent);
- }
- return;
- }
-
- if (functionName.equals(FunctionID.REGISTER_APP_INTERFACE.toString())) {
- final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (msg.getSuccess()) {
- _appInterfaceRegisterd = true;
- }
- processRaiResponse(msg);
- //Populate the system capability manager with the RAI response
- _systemCapabilityManager.parseRAIResponse(msg);
-
- //_autoActivateIdReturned = msg.getAutoActivateID();
- /*Place holder for legacy support*/ _autoActivateIdReturned = "8675309";
- _prerecordedSpeech = msg.getPrerecordedSpeech();
- _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();
-
- if (_bAppResumeEnabled)
- {
- if ( (_sdlMsgVersion.getMajorVersion() > 2) && (_lastHashID != null) && (msg.getSuccess()) && (msg.getResultCode() != Result.RESUME_FAILED) )
- _bResumeSuccess = true;
- else
- {
- _bResumeSuccess = false;
- _lastHashID = null;
- }
- }
-
- _diagModes = msg.getSupportedDiagModes();
-
- if (!isDebugEnabled())
- {
- enableDebugTool();
- DebugTool.logInfo("SDL Proxy Version: " + _proxyVersionInfo);
- disableDebugTool();
- }
- else
- DebugTool.logInfo("SDL Proxy Version: " + _proxyVersionInfo);
-
- // RegisterAppInterface
- if (_advancedLifecycleManagementEnabled) {
-
- // Send onSdlConnected message in ALM
- _sdlConnectionState = SdlConnectionState.SDL_CONNECTED;
-
- // If registerAppInterface failed, exit with OnProxyUnusable
- if (!msg.getSuccess()) {
- notifyProxyClosed("Unable to register app interface. Review values passed to the SdlProxy constructor. RegisterAppInterface result code: ",
- new SdlException("Unable to register app interface. Review values passed to the SdlProxy constructor. RegisterAppInterface result code: " + msg.getResultCode(), SdlExceptionCause.SDL_REGISTRATION_ERROR), SdlDisconnectedReason.SDL_REGISTRATION_ERROR);
- }
- } else {
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- if (_proxyListener instanceof IProxyListener) {
- ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
- }
- onRPCResponseReceived(msg);
- }
- });
- } else {
- if (_proxyListener instanceof IProxyListener) {
- ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
- }
- onRPCResponseReceived(msg);
- }
- }
- } else if (functionName.equals(FunctionID.SPEAK.toString())) {
- // SpeakResponse
-
- final SpeakResponse msg = new SpeakResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onSpeakResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSpeakResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ALERT.toString())) {
- // AlertResponse
-
- final AlertResponse msg = new AlertResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onAlertResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onAlertResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.SHOW.toString())) {
- // ShowResponse
-
- final ShowResponse msg = new ShowResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onShowResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onShowResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ADD_COMMAND.toString())) {
- // AddCommand
-
- final AddCommandResponse msg = new AddCommandResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onAddCommandResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onAddCommandResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.DELETE_COMMAND.toString())) {
- // DeleteCommandResponse
-
- final DeleteCommandResponse msg = new DeleteCommandResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onDeleteCommandResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onDeleteCommandResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ADD_SUB_MENU.toString())) {
- // AddSubMenu
-
- final AddSubMenuResponse msg = new AddSubMenuResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onAddSubMenuResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onAddSubMenuResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.DELETE_SUB_MENU.toString())) {
- // DeleteSubMenu
-
- final DeleteSubMenuResponse msg = new DeleteSubMenuResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onDeleteSubMenuResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onDeleteSubMenuResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.SUBSCRIBE_BUTTON.toString())) {
- // SubscribeButton
-
- final SubscribeButtonResponse msg = new SubscribeButtonResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onSubscribeButtonResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSubscribeButtonResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.UNSUBSCRIBE_BUTTON.toString())) {
- // UnsubscribeButton
-
- final UnsubscribeButtonResponse msg = new UnsubscribeButtonResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onUnsubscribeButtonResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onUnsubscribeButtonResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.SET_MEDIA_CLOCK_TIMER.toString())) {
- // SetMediaClockTimer
-
- final SetMediaClockTimerResponse msg = new SetMediaClockTimerResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onSetMediaClockTimerResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSetMediaClockTimerResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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);
- updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
- updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
- updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
- updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
- sendBroadcastIntent(sendIntent);
-
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onSystemRequestResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSystemRequestResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.CREATE_INTERACTION_CHOICE_SET.toString())) {
- // CreateInteractionChoiceSet
-
- final CreateInteractionChoiceSetResponse msg = new CreateInteractionChoiceSetResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onCreateInteractionChoiceSetResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onCreateInteractionChoiceSetResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.DELETE_INTERACTION_CHOICE_SET.toString())) {
- // DeleteInteractionChoiceSet
-
- final DeleteInteractionChoiceSetResponse msg = new DeleteInteractionChoiceSetResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onDeleteInteractionChoiceSetResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onDeleteInteractionChoiceSetResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.PERFORM_INTERACTION.toString())) {
- // PerformInteraction
-
- final PerformInteractionResponse msg = new PerformInteractionResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onPerformInteractionResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onPerformInteractionResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.SET_GLOBAL_PROPERTIES.toString())) {
- // SetGlobalPropertiesResponse
-
- final SetGlobalPropertiesResponse msg = new SetGlobalPropertiesResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onSetGlobalPropertiesResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSetGlobalPropertiesResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.RESET_GLOBAL_PROPERTIES.toString())) {
- // ResetGlobalProperties
-
- final ResetGlobalPropertiesResponse msg = new ResetGlobalPropertiesResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onResetGlobalPropertiesResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onResetGlobalPropertiesResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.UNREGISTER_APP_INTERFACE.toString())) {
- // UnregisterAppInterface
-
- _appInterfaceRegisterd = false;
- synchronized(APP_INTERFACE_REGISTERED_LOCK) {
- 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);
- updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());
- updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());
- updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());
- updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
- updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
- sendBroadcastIntent(sendIntent);
-
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- if (_proxyListener instanceof IProxyListener) {
- ((IProxyListener)_proxyListener).onUnregisterAppInterfaceResponse(msg);
- }
- onRPCResponseReceived(msg);
- }
- });
- } else {
- if (_proxyListener instanceof IProxyListener) {
- ((IProxyListener)_proxyListener).onUnregisterAppInterfaceResponse(msg);
- }
- onRPCResponseReceived(msg);
- }
-
- notifyProxyClosed("UnregisterAppInterfaceResponse", null, SdlDisconnectedReason.APP_INTERFACE_UNREG);
- } 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() {
- @Override
- public void run() {
- _proxyListener.onGenericResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onGenericResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onSliderResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSliderResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onPutFileResponse(msg);
- onRPCResponseReceived(msg);
- notifyPutFileStreamResponse(msg);
- }
- });
- } else {
- _proxyListener.onPutFileResponse(msg);
- onRPCResponseReceived(msg);
- notifyPutFileStreamResponse(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onDeleteFileResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onDeleteFileResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onListFilesResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onListFilesResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onSetAppIconResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSetAppIconResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onScrollableMessageResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onScrollableMessageResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onChangeRegistrationResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onChangeRegistrationResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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());
- _systemCapabilityManager.setCapability(SystemCapabilityType.BUTTON, msg.getButtonCapabilities());
- _systemCapabilityManager.setCapability(SystemCapabilityType.PRESET_BANK, msg.getPresetBankCapabilities());
- _systemCapabilityManager.setCapability(SystemCapabilityType.SOFTBUTTON, msg.getSoftButtonCapabilities());
- }
-
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onSetDisplayLayoutResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSetDisplayLayoutResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onPerformAudioPassThruResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onPerformAudioPassThruResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onEndAudioPassThruResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onEndAudioPassThruResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onSubscribeVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSubscribeVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onUnsubscribeVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onUnsubscribeVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onGetVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onGetVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onSubscribeWayPointsResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSubscribeWayPointsResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onUnsubscribeWayPointsResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onUnsubscribeWayPointsResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onGetWayPointsResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onGetWayPointsResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onReadDIDResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onReadDIDResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onGetDTCsResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onGetDTCsResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onDiagnosticMessageResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onDiagnosticMessageResponse(msg);
- onRPCResponseReceived(msg);
- }
- }
- 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() {
- @Override
- public void run() {
- _proxyListener.onSystemRequestResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSystemRequestResponse(msg);
- onRPCResponseReceived(msg);
- }
- }
- 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() {
- @Override
- public void run() {
- _proxyListener.onSendLocationResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSendLocationResponse(msg);
- onRPCResponseReceived(msg);
- }
- }
- 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() {
- @Override
- public void run() {
- _proxyListener.onDialNumberResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onDialNumberResponse(msg);
- onRPCResponseReceived(msg);
- }
- }
- 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
- public void run() {
- _proxyListener.onShowConstantTbtResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onShowConstantTbtResponse(msg);
- onRPCResponseReceived(msg);
- }
- }
- 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
- public void run() {
- _proxyListener.onAlertManeuverResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onAlertManeuverResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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
- public void run() {
- _proxyListener.onUpdateTurnListResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onUpdateTurnListResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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
- public void run() {
- _proxyListener.onSetInteriorVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSetInteriorVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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
- public void run() {
- _proxyListener.onGetInteriorVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onGetInteriorVehicleDataResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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
- public void run() {
- _proxyListener.onGetSystemCapabilityResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onGetSystemCapabilityResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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
- public void run() {
- _proxyListener.onButtonPressResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onButtonPressResponse(msg);
- onRPCResponseReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onSendHapticDataResponse( msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onSendHapticDataResponse( msg);
- onRPCResponseReceived(msg);
- }
- }
- else {
- if (_sdlMsgVersion != null) {
- DebugTool.logError("Unrecognized response Message: " + functionName +
- " SDL Message Version = " + _sdlMsgVersion);
- } else {
- DebugTool.logError("Unrecognized response Message: " + functionName);
- }
- } // end-if
-
- } else if (messageType.equals(RPCMessage.KEY_NOTIFICATION)) {
- SdlTrace.logRPCEvent(InterfaceActivityDirection.Receive, new RPCNotification(rpcMsg), SDL_LIB_TRACE_KEY);
- if (functionName.equals(FunctionID.ON_HMI_STATUS.toString())) {
- // OnHMIStatus
-
- final OnHMIStatus msg = new OnHMIStatus(hash);
-
- //setup lockscreeninfo
- if (sdlSession != null)
- {
- sdlSession.getLockScreenMan().setHMILevel(msg.getHmiLevel());
- }
-
- msg.setFirstRun(firstTimeFull);
- if (msg.getHmiLevel() == HMILevel.HMI_FULL) firstTimeFull = false;
-
- _hmiLevel = msg.getHmiLevel();
- _audioStreamingState = msg.getAudioStreamingState();
-
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnHMIStatus(msg);
- _proxyListener.onOnLockScreenNotification(sdlSession.getLockScreenMan().getLockObj());
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnHMIStatus(msg);
- _proxyListener.onOnLockScreenNotification(sdlSession.getLockScreenMan().getLockObj());
- onRPCNotificationReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ON_COMMAND.toString())) {
- // OnCommand
-
- final OnCommand msg = new OnCommand(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnCommand(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnCommand(msg);
- onRPCNotificationReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ON_DRIVER_DISTRACTION.toString())) {
- // OnDriverDistration
-
- final OnDriverDistraction msg = new OnDriverDistraction(hash);
-
- //setup lockscreeninfo
- if (sdlSession != null)
- {
- DriverDistractionState drDist = msg.getState();
- sdlSession.getLockScreenMan().setDriverDistStatus(drDist == DriverDistractionState.DD_ON);
- }
-
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnDriverDistraction(msg);
- _proxyListener.onOnLockScreenNotification(sdlSession.getLockScreenMan().getLockObj());
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnDriverDistraction(msg);
- _proxyListener.onOnLockScreenNotification(sdlSession.getLockScreenMan().getLockObj());
- onRPCNotificationReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ON_ENCODED_SYNC_P_DATA.toString())) {
-
- final OnSystemRequest msg = new OnSystemRequest(hash);
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.ON_SYSTEM_REQUEST.toString());
- updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_NOTIFICATION);
-
- // 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);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnSystemRequest(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnSystemRequest(msg);
- onRPCNotificationReceived(msg);
- }
- } else {
- updateBroadcastIntent(sendIntent, "COMMENT1", "Sending to cloud: " + msg.getUrl());
- sendBroadcastIntent(sendIntent);
-
- Log.i("pt", "send to url");
-
- if ( (msg.getUrl() != null) )
- {
- Thread handleOffboardTransmissionThread = new Thread() {
- @Override
- public void run() {
- sendOnSystemRequestToUrl(msg);
- }
- };
-
- handleOffboardTransmissionThread.start();
- }
- }
- } else if (functionName.equals(FunctionID.ON_PERMISSIONS_CHANGE.toString())) {
- //OnPermissionsChange
-
- final OnPermissionsChange msg = new OnPermissionsChange(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnPermissionsChange(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnPermissionsChange(msg);
- onRPCNotificationReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ON_TBT_CLIENT_STATE.toString())) {
- // OnTBTClientState
-
- final OnTBTClientState msg = new OnTBTClientState(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnTBTClientState(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnTBTClientState(msg);
- onRPCNotificationReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ON_BUTTON_PRESS.toString())) {
- // OnButtonPress
-
- final OnButtonPress msg = new OnButtonPress(hash);
- msg.format(rpcSpecVersion, true);
- final OnButtonPress onButtonPressCompat = (OnButtonPress)handleButtonNotificationFormatting(msg);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnButtonPress(msg);
- onRPCNotificationReceived(msg);
- if(onButtonPressCompat != null){
- _proxyListener.onOnButtonPress(onButtonPressCompat);
- }
- }
- });
- } else {
- _proxyListener.onOnButtonPress(msg);
- onRPCNotificationReceived(msg);
- if(onButtonPressCompat != null){
- _proxyListener.onOnButtonPress(onButtonPressCompat);
- }
- }
- } else if (functionName.equals(FunctionID.ON_BUTTON_EVENT.toString())) {
- // OnButtonEvent
-
- final OnButtonEvent msg = new OnButtonEvent(hash);
- msg.format(rpcSpecVersion, true);
- final OnButtonEvent onButtonEventCompat = (OnButtonEvent)handleButtonNotificationFormatting(msg);
-
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnButtonEvent(msg);
- onRPCNotificationReceived(msg);
- if(onButtonEventCompat != null){
- _proxyListener.onOnButtonEvent(onButtonEventCompat);
- }
- }
- });
- } else {
- _proxyListener.onOnButtonEvent(msg);
- onRPCNotificationReceived(msg);
- if(onButtonEventCompat != null){
- _proxyListener.onOnButtonEvent(onButtonEventCompat);
- }
- }
- } else if (functionName.equals(FunctionID.ON_LANGUAGE_CHANGE.toString())) {
- // OnLanguageChange
-
- final OnLanguageChange msg = new OnLanguageChange(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnLanguageChange(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnLanguageChange(msg);
- onRPCNotificationReceived(msg);
- }
- } else if (functionName.equals(FunctionID.ON_HASH_CHANGE.toString())) {
- // OnLanguageChange
-
- final OnHashChange msg = new OnHashChange(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnHashChange(msg);
- onRPCNotificationReceived(msg);
- if (_bAppResumeEnabled)
- {
- _lastHashID = msg.getHashID();
- }
- }
- });
- } else {
- _proxyListener.onOnHashChange(msg);
- onRPCNotificationReceived(msg);
- if (_bAppResumeEnabled)
- {
- _lastHashID = msg.getHashID();
- }
- }
- } else if (functionName.equals(FunctionID.ON_SYSTEM_REQUEST.toString())) {
- // 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)))){
- Thread handleOffboardTransmissionThread = new Thread() {
- @Override
- public void run() {
- sendOnSystemRequestToUrl(msg);
- }
- };
-
- handleOffboardTransmissionThread.start();
- }
-
-
- if(msg.getRequestType() == RequestType.LOCK_SCREEN_ICON_URL &&
- msg.getUrl() != null){
- lockScreenIconRequest = msg;
- }
-
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onOnSystemRequest(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnSystemRequest(msg);
- onRPCNotificationReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onOnAudioPassThru(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnAudioPassThru(msg);
- onRPCNotificationReceived(msg);
- }
- } 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() {
- @Override
- public void run() {
- _proxyListener.onOnVehicleData(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnVehicleData(msg);
- onRPCNotificationReceived(msg);
- }
- }
- else if (functionName.equals(FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString())) {
- // OnAppInterfaceUnregistered
-
- _appInterfaceRegisterd = false;
- synchronized(APP_INTERFACE_REGISTERED_LOCK) {
- APP_INTERFACE_REGISTERED_LOCK.notify();
- }
-
- final OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered(hash);
- msg.format(rpcSpecVersion,true);
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString());
- updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_NOTIFICATION);
- updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
- sendBroadcastIntent(sendIntent);
-
- if (_advancedLifecycleManagementEnabled) {
- // This requires the proxy to be cycled
- cycleProxy(SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(msg.getReason()));
- } else {
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- ((IProxyListener)_proxyListener).onOnAppInterfaceUnregistered(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- ((IProxyListener)_proxyListener).onOnAppInterfaceUnregistered(msg);
- onRPCNotificationReceived(msg);
- }
- notifyProxyClosed("OnAppInterfaceUnregistered", null, SdlDisconnectedReason.APP_INTERFACE_UNREG);
- }
- }
- 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() {
- @Override
- public void run() {
- _proxyListener.onOnKeyboardInput(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnKeyboardInput(msg);
- onRPCNotificationReceived(msg);
- }
- }
- 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() {
- @Override
- public void run() {
- _proxyListener.onOnTouchEvent(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnTouchEvent(msg);
- onRPCNotificationReceived(msg);
- }
- }
- 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() {
- @Override
- public void run() {
- _proxyListener.onOnWayPointChange(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnWayPointChange(msg);
- onRPCNotificationReceived(msg);
- }
- }
- 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() {
- @Override
- public void run() {
- _proxyListener.onOnInteriorVehicleData(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnInteriorVehicleData(msg);
- onRPCNotificationReceived(msg);
- }
- }
- 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() {
- @Override
- public void run() {
- _proxyListener.onOnRCStatus(msg);
- onRPCNotificationReceived(msg);
- }
- });
- } else {
- _proxyListener.onOnRCStatus(msg);
- onRPCNotificationReceived(msg);
- }
- }
- else {
- if (_sdlMsgVersion != null) {
- DebugTool.logInfo("Unrecognized notification Message: " + functionName +
- " connected to SDL using message version: " + _sdlMsgVersion.getMajorVersion() + "." + _sdlMsgVersion.getMinorVersion());
- } else {
- DebugTool.logInfo("Unrecognized notification Message: " + functionName);
- }
- } // end-if
- } // end-if notification
-
- SdlTrace.logProxyEvent("Proxy received RPC Message: " + functionName, SDL_LIB_TRACE_KEY);
- }
-
- //FIXME
- /**
- * Temporary method to bridge the new PLAY_PAUSE and OKAY button functionality with the old
- * OK button name. This should be removed during the next major release
- * @param notification
- */
- private RPCNotification handleButtonNotificationFormatting(RPCNotification notification){
- if(FunctionID.ON_BUTTON_EVENT.toString().equals(notification.getFunctionName())
- || FunctionID.ON_BUTTON_PRESS.toString().equals(notification.getFunctionName())){
-
- ButtonName buttonName = (ButtonName)notification.getObject(ButtonName.class, OnButtonEvent.KEY_BUTTON_NAME);
- ButtonName compatBtnName = null;
-
- if(rpcSpecVersion != null && rpcSpecVersion.getMajor() >= 5){
- if(ButtonName.PLAY_PAUSE.equals(buttonName)){
- compatBtnName = ButtonName.OK;
- }
- }else{ // rpc spec version is either null or less than 5
- if(ButtonName.OK.equals(buttonName)){
- compatBtnName = ButtonName.PLAY_PAUSE;
- }
- }
-
- try {
- if (compatBtnName != null) { //There is a button name that needs to be swapped out
- RPCNotification notification2;
- //The following is done because there is currently no way to make a deep copy
- //of an RPC. Since this code will be removed, it's ugliness is borderline acceptable.
- if (notification instanceof OnButtonEvent) {
- OnButtonEvent onButtonEvent = new OnButtonEvent();
- onButtonEvent.setButtonEventMode(((OnButtonEvent) notification).getButtonEventMode());
- onButtonEvent.setCustomButtonID(((OnButtonEvent) notification).getCustomButtonID());
- notification2 = onButtonEvent;
- } else if (notification instanceof OnButtonPress) {
- OnButtonPress onButtonPress = new OnButtonPress();
- onButtonPress.setButtonPressMode(((OnButtonPress) notification).getButtonPressMode());
- onButtonPress.setCustomButtonName(((OnButtonPress) notification).getCustomButtonName());
- notification2 = onButtonPress;
- } else {
- return null;
- }
-
- notification2.setParameters(OnButtonEvent.KEY_BUTTON_NAME, compatBtnName);
- return notification2;
- }
- }catch (Exception e){
- //Should never get here
- }
- }
- return null;
- }
-
- /**
- * Get SDL Message Version
- * @return SdlMsgVersion
- * @throws SdlException
- */
- public SdlMsgVersion getSdlMsgVersion() throws SdlException{
- return _sdlMsgVersion;
- }
-
- /**
- * Takes a list of RPCRequests and sends it to SDL in a synchronous fashion. Responses are captured through callback on OnMultipleRequestListener.
- * For sending requests asynchronously, use sendRequests <br>
- *
- * <strong>NOTE: This will override any listeners on individual RPCs</strong>
- *
- * @param rpcs is the list of RPCRequests being sent
- * @param listener listener for updates and completions
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void sendSequentialRequests(final List<? extends RPCRequest> rpcs, final OnMultipleRequestListener listener) throws SdlException {
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- SdlTrace.logProxyEvent("Application called sendSequentialRequests", SDL_LIB_TRACE_KEY);
-
- synchronized(CONNECTION_REFERENCE_LOCK) {
- if (!getIsConnected()) {
- SdlTrace.logProxyEvent("Application attempted to call sendSequentialRequests without a connected transport.", SDL_LIB_TRACE_KEY);
- throw new SdlException("There is no valid connection to SDL. sendSequentialRequests cannot be called until SDL has been connected.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- }
-
- if (rpcs == null){
- //Log error here
- throw new SdlException("You must send some RPCs", SdlExceptionCause.INVALID_ARGUMENT);
- }
-
- int requestCount = rpcs.size();
-
- // Break out of recursion, we have finished the requests
- if (requestCount == 0) {
- if(listener != null){
- listener.onFinished();
- }
- return;
- }
-
- RPCRequest rpc = rpcs.remove(0);
- rpc.setCorrelationID(CorrelationIdGenerator.generateId());
-
- rpc.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if (response.getSuccess()) {
- // success
- if(listener!=null){
- listener.onUpdate(rpcs.size());
- }
- try {
- // recurse after successful response of RPC
- sendSequentialRequests(rpcs, listener);
- } catch (SdlException e) {
- e.printStackTrace();
- if(listener != null){
- listener.onError(correlationId, Result.GENERIC_ERROR, e.toString());
- }
- }
- }
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- if(listener != null){
- listener.onError(correlationId, resultCode, info);
- }
- }
- });
-
- sendRPCRequestPrivate(rpc);
- }
-
- /**
- * Takes a list of RPCRequests and sends it to SDL. Responses are captured through callback on OnMultipleRequestListener.
- * For sending requests synchronously, use sendSequentialRequests <br>
- *
- * <strong>NOTE: This will override any listeners on individual RPCs</strong>
- *
- * @param rpcs is the list of RPCRequests being sent
- * @param listener listener for updates and completions
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void sendRequests(List<? extends RPCRequest> rpcs, final OnMultipleRequestListener listener) throws SdlException {
-
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- SdlTrace.logProxyEvent("Application called sendRequests", SDL_LIB_TRACE_KEY);
-
- synchronized(CONNECTION_REFERENCE_LOCK) {
- if (!getIsConnected()) {
- SdlTrace.logProxyEvent("Application attempted to call sendRequests without a connected transport.", SDL_LIB_TRACE_KEY);
- throw new SdlException("There is no valid connection to SDL. sendRequests cannot be called until SDL has been connected.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- }
-
- if (rpcs == null){
- //Log error here
- throw new SdlException("You must send some RPCs, the array is null", SdlExceptionCause.INVALID_ARGUMENT);
- }
-
- int arraySize = rpcs.size();
-
- if (arraySize == 0) {
- throw new SdlException("You must send some RPCs, the array is empty", SdlExceptionCause.INVALID_ARGUMENT);
- }
-
- for (int i = 0; i < arraySize; i++) {
- RPCRequest rpc = rpcs.get(i);
- rpc.setCorrelationID(CorrelationIdGenerator.generateId());
- if(listener != null) {
- listener.addCorrelationId(rpc.getCorrelationID());
- rpc.setOnRPCResponseListener(listener.getSingleRpcResponseListener());
- }
- sendRPCRequestPrivate(rpc);
- }
- }
-
- /**
- * Takes an RPCRequest and sends it to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param request is the RPCRequest being sent
- * @throws SdlException if an unrecoverable error is encountered
- */
- public void sendRPCRequest(RPCRequest request) throws SdlException {
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test if request is null
- if (request == null) {
- SdlTrace.logProxyEvent("Application called sendRPCRequest method with a null RPCRequest.", SDL_LIB_TRACE_KEY);
- throw new IllegalArgumentException("sendRPCRequest cannot be called with a null request.");
- }
-
- SdlTrace.logProxyEvent("Application called sendRPCRequest method for RPCRequest: ." + request.getFunctionName(), SDL_LIB_TRACE_KEY);
-
- // Test if SdlConnection is null
- synchronized(CONNECTION_REFERENCE_LOCK) {
- if (!getIsConnected()) {
- SdlTrace.logProxyEvent("Application attempted to send and RPCRequest without a connected transport.", SDL_LIB_TRACE_KEY);
- throw new SdlException("There is no valid connection to SDL. sendRPCRequest cannot be called until SDL has been connected.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- }
-
- // Test for illegal correlation ID
- if (isCorrelationIDProtected(request.getCorrelationID())) {
-
- SdlTrace.logProxyEvent("Application attempted to use the reserved correlation ID, " + request.getCorrelationID(), SDL_LIB_TRACE_KEY);
- throw new SdlException("Invalid correlation ID. The correlation ID, " + request.getCorrelationID()
- + " , is a reserved correlation ID.", SdlExceptionCause.RESERVED_CORRELATION_ID);
- }
- // Throw exception if RPCRequest is sent when SDL is unavailable
- if (!_appInterfaceRegisterd && !request.getFunctionName().equals(FunctionID.REGISTER_APP_INTERFACE.toString())) {
-
- SdlTrace.logProxyEvent("Application attempted to send an RPCRequest (non-registerAppInterface), before the interface was registerd.", SDL_LIB_TRACE_KEY);
- throw new SdlException("SDL is currently unavailable. RPC Requests cannot be sent.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
-
- if (_advancedLifecycleManagementEnabled) {
- if (request.getFunctionName().equals(FunctionID.REGISTER_APP_INTERFACE.toString())
- || request.getFunctionName().equals(FunctionID.UNREGISTER_APP_INTERFACE.toString())) {
-
- SdlTrace.logProxyEvent("Application attempted to send a RegisterAppInterface or UnregisterAppInterface while using ALM.", SDL_LIB_TRACE_KEY);
- throw new SdlException("The RPCRequest, " + request.getFunctionName() +
- ", is un-allowed using the Advanced Lifecycle Management Model.", SdlExceptionCause.INCORRECT_LIFECYCLE_MODEL);
- }
- }
-
- //FIXME this is temporary until the next major release of the library where OK is removed
-
- if(FunctionID.SUBSCRIBE_BUTTON.toString().equals(request.getFunctionName())
- || FunctionID.UNSUBSCRIBE_BUTTON.toString().equals(request.getFunctionName())
- || FunctionID.BUTTON_PRESS.toString().equals(request.getFunctionName())){
-
- ButtonName buttonName = (ButtonName)request.getObject(ButtonName.class, SubscribeButton.KEY_BUTTON_NAME);
-
- if(rpcSpecVersion != null && rpcSpecVersion.getMajor() < 5) {
-
- if (ButtonName.PLAY_PAUSE.equals(buttonName)) {
- request.setParameters(SubscribeButton.KEY_BUTTON_NAME, ButtonName.OK);
- }
- } else { //Newer than version 5.0.0
- if(ButtonName.OK.equals(buttonName)){
- RPCRequest request2 = new RPCRequest(request);
- request2.setParameters(SubscribeButton.KEY_BUTTON_NAME, ButtonName.PLAY_PAUSE);
- sendRPCRequestPrivate(request2);
- }
- }
- }
-
- sendRPCRequestPrivate(request);
- } // end-method
-
- protected void notifyProxyClosed(final String info, final Exception e, final SdlDisconnectedReason reason) {
- SdlTrace.logProxyEvent("NotifyProxyClose", SDL_LIB_TRACE_KEY);
- Log.d(TAG, "notifyProxyClosed: " + info);
- OnProxyClosed message = new OnProxyClosed(info, e, reason);
- queueInternalMessage(message);
- }
-
- private void passErrorToProxyListener(final String info, final Exception e) {
-
- OnError message = new OnError(info, e);
- queueInternalMessage(message);
- }
-
- private void startRPCProtocolSession() {
-
- // Set Proxy Lifecyclek Available
- if (_advancedLifecycleManagementEnabled) {
-
- try {
- registerAppInterfacePrivate(
- _sdlMsgVersionRequest,
- _applicationName,
- _ttsName,
- _ngnMediaScreenAppName,
- _vrSynonyms,
- _isMediaApp,
- _sdlLanguageDesired,
- _hmiDisplayLanguageDesired,
- _appType,
- _appID,
- _dayColorScheme,
- _nightColorScheme,
- REGISTER_APP_INTERFACE_CORRELATION_ID);
-
- } catch (Exception e) {
- notifyProxyClosed("Failed to register application interface with SDL. Check parameter values given to SdlProxy constructor.", e, SdlDisconnectedReason.SDL_REGISTRATION_ERROR);
- }
- } else {
- InternalProxyMessage message = new InternalProxyMessage(InternalProxyMessage.OnProxyOpened);
- queueInternalMessage(message);
- }
- }
-
- // Queue internal callback message
- private void queueInternalMessage(InternalProxyMessage message) {
- synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
- if (_internalProxyMessageDispatcher != null) {
- _internalProxyMessageDispatcher.queueMessage(message);
- }
- }
- }
-
- // Queue incoming ProtocolMessage
- private void queueIncomingMessage(ProtocolMessage message) {
- synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
- if (_incomingProxyMessageDispatcher != null) {
- _incomingProxyMessageDispatcher.queueMessage(message);
- }
- }
- }
-
- private FileInputStream getFileInputStream(String sLocalFile)
- {
- FileInputStream is = null;
- try
- {
- is = new FileInputStream(sLocalFile);
- }
- catch (IOException e1)
- {
- e1.printStackTrace();
- }
- return is;
- }
-
- private Long getFileInputStreamSize(FileInputStream is)
- {
- Long lSize = null;
-
- try
- {
- lSize = is.getChannel().size();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- return lSize;
- }
-
- private void closeFileInputStream(FileInputStream is)
- {
- try
- {
- is.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- @SuppressWarnings("unchecked")
- private RPCStreamController startRPCStream(String sLocalFile, PutFile request, SessionType sType, byte rpcSessionID, Version protocolVersion)
- {
- if (sdlSession == null) return null;
-
- FileInputStream is = getFileInputStream(sLocalFile);
- if (is == null) return null;
-
- Long lSize = getFileInputStreamSize(is);
- if (lSize == null)
- {
- closeFileInputStream(is);
- return null;
- }
-
- try {
- StreamRPCPacketizer rpcPacketizer = new StreamRPCPacketizer((SdlProxyBase<IProxyListenerBase>) this, sdlSession, is, request, sType, rpcSessionID, protocolVersion, rpcSpecVersion, lSize, sdlSession);
- rpcPacketizer.start();
- return new RPCStreamController(rpcPacketizer, request.getCorrelationID());
- } catch (Exception e) {
- Log.e("SyncConnection", "Unable to start streaming:" + e.toString());
- return null;
- }
- }
-
- @SuppressWarnings({"unchecked", "UnusedReturnValue"})
- private RPCStreamController startRPCStream(InputStream is, PutFile request, SessionType sType, byte rpcSessionID, Version protocolVersion)
- {
- if (sdlSession == null) return null;
- Long lSize = request.getLength();
-
- if (lSize == null)
- {
- return null;
- }
-
- try {
- StreamRPCPacketizer rpcPacketizer = new StreamRPCPacketizer((SdlProxyBase<IProxyListenerBase>) this, sdlSession, is, request, sType, rpcSessionID, protocolVersion, rpcSpecVersion, lSize, sdlSession);
- rpcPacketizer.start();
- return new RPCStreamController(rpcPacketizer, request.getCorrelationID());
- } catch (Exception e) {
- Log.e("SyncConnection", "Unable to start streaming:" + e.toString());
- return null;
- }
- }
-
- private RPCStreamController startPutFileStream(String sPath, PutFile msg) {
- if (sdlSession == null) return null;
- return startRPCStream(sPath, msg, SessionType.RPC, sdlSession.getSessionId(), protocolVersion);
- }
-
- private RPCStreamController startPutFileStream(InputStream is, PutFile msg) {
- if (sdlSession == null) return null;
- if (is == null) return null;
- return startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), protocolVersion);
- }
-
- @SuppressWarnings("UnusedReturnValue")
- public boolean startRPCStream(InputStream is, RPCRequest msg) {
- if (sdlSession == null) return false;
- sdlSession.startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), (byte)getProtocolVersion().getMajor());
- return true;
- }
-
- public OutputStream startRPCStream(RPCRequest msg) {
- if (sdlSession == null) return null;
- return sdlSession.startRPCStream(msg, SessionType.RPC, sdlSession.getSessionId(), (byte)getProtocolVersion().getMajor());
- }
-
- public void endRPCStream() {
- if (sdlSession == null) return;
- sdlSession.stopRPCStream();
- }
-
- private class CallableMethod implements Callable<Void> {
-
- private final long waitTime;
-
- public CallableMethod(int timeInMillis){
- this.waitTime=timeInMillis;
- }
- @Override
- public Void call() {
- try {
- Thread.sleep(waitTime);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- return null;
- }
- }
-
- public FutureTask<Void> createFutureTask(CallableMethod callMethod){
- return new FutureTask<Void>(callMethod);
- }
-
- public ScheduledExecutorService createScheduler(){
- return Executors.newSingleThreadScheduledExecutor();
- }
-
- @SuppressWarnings("unused")
- public void startService(SessionType serviceType, boolean isEncrypted){
- sdlSession.startService(serviceType, sdlSession.getSessionId(), isEncrypted);
- }
-
- @SuppressWarnings("unused")
- public void endService(SessionType serviceType){
- sdlSession.endService(serviceType, sdlSession.getSessionId());
- }
-
-
-
- /**
- * @deprecated
- *Opens the video service (serviceType 11) and subsequently streams raw H264 video from an InputStream provided by the app
- *@return true if service is opened successfully and stream is started, return false otherwise
- * @see #startRemoteDisplayStream(Context, Class, VideoStreamingParameters, boolean) startRemoteDisplayStream
- * @see #startVideoStream(boolean, VideoStreamingParameters) startVideoStream
- * @see #createOpenGLInputSurface(int, int, int, int, int, boolean) createOpenGLInputSurface
- */
- @SuppressWarnings("unused")
- @Deprecated
- public boolean startH264(InputStream is, boolean isEncrypted) {
-
- if (sdlSession == null) return false;
-
- navServiceStartResponseReceived = false;
- navServiceStartResponse = false;
- navServiceStartRejectedParams = null;
-
- // When startH264() API is used, we will not send video format / width / height information
- // with StartService. (Reasons: InputStream does not provide timestamp information so RTP
- // cannot be used. startH264() does not provide with/height information.)
- VideoStreamingParameters emptyParam = new VideoStreamingParameters();
- emptyParam.setResolution(null);
- emptyParam.setFormat(null);
- sdlSession.setDesiredVideoParams(emptyParam);
-
- sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!navServiceStartResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- if (navServiceStartResponse) {
- try {
- sdlSession.startStream(is, SessionType.NAV, sdlSession.getSessionId());
- return true;
- } catch (Exception e) {
- return false;
- }
- } else {
- return false;
- }
- }
-
- /**
- * @deprecated
- *Opens the video service (serviceType 11) and subsequently provides an OutputStream to the app to use for a raw H264 video stream
- *@return OutputStream if service is opened successfully and stream is started, return null otherwise
- * @see #startRemoteDisplayStream(Context, Class, VideoStreamingParameters, boolean) startRemoteDisplayStream
- * @see #startVideoStream(boolean, VideoStreamingParameters) startVideoStream
- * @see #createOpenGLInputSurface(int, int, int, int, int, boolean) createOpenGLInputSurface
- */
- @SuppressWarnings("unused")
- @Deprecated
- public OutputStream startH264(boolean isEncrypted) {
-
- if (sdlSession == null) return null;
-
- navServiceStartResponseReceived = false;
- navServiceStartResponse = false;
- navServiceStartRejectedParams = null;
-
- // When startH264() API is used, we will not send video format / width / height information
- // with StartService. (Reasons: OutputStream does not provide timestamp information so RTP
- // cannot be used. startH264() does not provide with/height information.)
- VideoStreamingParameters emptyParam = new VideoStreamingParameters();
- emptyParam.setResolution(null);
- emptyParam.setFormat(null);
- sdlSession.setDesiredVideoParams(emptyParam);
-
- sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!navServiceStartResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- if (navServiceStartResponse) {
- try {
- return sdlSession.startStream(SessionType.NAV, sdlSession.getSessionId());
- } catch (Exception e) {
- return null;
- }
- } else {
- return null;
- }
- }
-
- /**
- *Closes the opened video service (serviceType 11)
- *@return true if the video service is closed successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- @Deprecated
- public boolean endH264() {
- return endVideoStream();
- }
- /**
- *Pauses the stream for the opened audio service (serviceType 10)
- *@return true if the audio service stream is paused successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- @Deprecated
- public boolean pausePCM() {
- return pauseAudioStream();
- }
-
- /**
- *Pauses the stream for the opened video service (serviceType 11)
- *@return true if the video service stream is paused successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- @Deprecated
- public boolean pauseH264() {
- return pauseVideoStream();
- }
-
- /**
- *Resumes the stream for the opened audio service (serviceType 10)
- *@return true if the audio service stream is resumed successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- @Deprecated
- public boolean resumePCM() {
- return resumeAudioStream();
- }
-
- /**
- *Resumes the stream for the opened video service (serviceType 11)
- *@return true if the video service is resumed successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- @Deprecated
- public boolean resumeH264() {
- return resumeVideoStream();
- }
-
-
- /**
- *Opens the audio service (serviceType 10) and subsequently streams raw PCM audio from an InputStream provided by the app
- *@return true if service is opened successfully and stream is started, return false otherwise
- */
- @SuppressWarnings("unused")
- @Deprecated
- public boolean startPCM(InputStream is, boolean isEncrypted) {
- if (sdlSession == null) return false;
-
- pcmServiceStartResponseReceived = false;
- pcmServiceStartResponse = false;
- sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!pcmServiceStartResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- if (pcmServiceStartResponse) {
- try {
- sdlSession.startStream(is, SessionType.PCM, sdlSession.getSessionId());
- return true;
- } catch (Exception e) {
- return false;
- }
- } else {
- return false;
- }
- }
-
- /**
- *Opens the audio service (serviceType 10) and subsequently provides an OutputStream to the app
- *@return OutputStream if service is opened successfully and stream is started, return null otherwise
- */
- @SuppressWarnings("unused")
- @Deprecated
- public OutputStream startPCM(boolean isEncrypted) {
- if (sdlSession == null) return null;
-
- pcmServiceStartResponseReceived = false;
- pcmServiceStartResponse = false;
- sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!pcmServiceStartResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- if (pcmServiceStartResponse) {
- try {
- return sdlSession.startStream(SessionType.PCM, sdlSession.getSessionId());
- } catch (Exception e) {
- return null;
- }
- } else {
- if (pcmServiceStartRejectedParams != null) {
- StringBuilder builder = new StringBuilder();
- for (String paramName : pcmServiceStartRejectedParams) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append(paramName);
- }
- DebugTool.logWarning("StartService for nav failed. Rejected params: " + builder.toString());
-
- } else {
- DebugTool.logWarning("StartService for nav failed (rejected params not supplied)");
- }
- return null;
- }
- }
-
- /**
- *Closes the opened audio service (serviceType 10)
- *@return true if the audio service is closed successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- @Deprecated
- public boolean endPCM() {
- return endAudioStream();
- }
-
- /**
- * 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 isEncrypted Specify true if packets on this service have to be encrypted
- * @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.
- *
- * @return IVideoStreamListener interface if service is opened successfully and streaming is
- * started, null otherwise
- */
- @SuppressWarnings("unused")
- public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters) {
- if (sdlSession == null) {
- DebugTool.logWarning("SdlSession is not created yet.");
- return null;
- }
- if (!sdlSession.getIsConnected()) {
- DebugTool.logWarning("Connection is not available.");
- return null;
- }
-
- sdlSession.setDesiredVideoParams(parameters);
-
- VideoStreamingParameters acceptedParams = tryStartVideoStream(isEncrypted, parameters);
- if (acceptedParams != null) {
- return sdlSession.startVideoStream();
- } else {
- return null;
- }
- }
-
- /**
- *Closes the opened video service (serviceType 11)
- *@return true if the video service is closed successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- public boolean endVideoStream() {
- if (sdlSession == null){ return false; }
-
- navServiceEndResponseReceived = false;
- navServiceEndResponse = false;
- sdlSession.stopVideoStream();
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!navServiceEndResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- return navServiceEndResponse;
- }
-
- /**
- *Pauses the stream for the opened video service (serviceType 11)
- *@return true if the video service stream is paused successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- public boolean pauseVideoStream() {
- return sdlSession != null && sdlSession.pauseVideoStream();
- }
-
- /**
- *Resumes the stream for the opened video service (serviceType 11)
- *@return true if the video service is resumed successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- public boolean resumeVideoStream() {
- return sdlSession != null && sdlSession.resumeVideoStream();
- }
-
- /**
- * Opens the video service (serviceType 11) and creates a Surface (used for streaming video) with input parameters provided by the app
- * @param frameRate - specified rate of frames to utilize for creation of Surface
- * @param iFrameInterval - specified interval to utilize for creation of Surface
- * @param width - specified width to utilize for creation of Surface
- * @param height - specified height to utilize for creation of Surface
- * @param bitrate - specified bitrate to utilize for creation of Surface
- *@return Surface if service is opened successfully and stream is started, return null otherwise
- */
- @SuppressWarnings("unused")
- public Surface createOpenGLInputSurface(int frameRate, int iFrameInterval, int width,
- int height, int bitrate, boolean isEncrypted) {
-
- if (sdlSession == null || !sdlSession.getIsConnected()){
- return null;
- }
-
- VideoStreamingParameters desired = new VideoStreamingParameters();
- desired.setFrameRate(frameRate);
- desired.setInterval(iFrameInterval);
- ImageResolution resolution = new ImageResolution();
- resolution.setResolutionWidth(width);
- resolution.setResolutionHeight(height);
- desired.setResolution(resolution);
- desired.setBitrate(bitrate);
-
- VideoStreamingParameters acceptedParams = tryStartVideoStream(isEncrypted, desired);
- if (acceptedParams != null) {
- return sdlSession.createOpenGLInputSurface(frameRate, iFrameInterval, width,
- height, bitrate, SessionType.NAV, sdlSession.getSessionId());
- } else {
- return null;
- }
- }
-
- /**
- * 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 remoteDisplay 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.
- */
- @TargetApi(19)
- public void startRemoteDisplayStream(Context context, final Class<? extends SdlRemoteDisplay> remoteDisplay, final VideoStreamingParameters parameters, final boolean encrypted){
- if(protocolVersion!= null && protocolVersion.getMajor() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
- Log.e(TAG, "Video streaming not supported on this module");
- return;
- }
- //Create streaming manager
- if(manager == null){
- manager = new VideoStreamingManager(context,this._internalInterface);
- }
-
- if(parameters == null){
- if(protocolVersion!= null && protocolVersion.getMajor() >= 5) {
- _systemCapabilityManager.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
- sdlSession.setDesiredVideoParams(params);
- manager.startVideoStreaming(remoteDisplay, params, encrypted);
- }
-
- @Override
- public void onError(String info) {
- Log.e(TAG, "Error retrieving video streaming capability: " + info);
-
- }
- });
- }else{
- //We just use default video streaming params
- VideoStreamingParameters params = new VideoStreamingParameters();
- DisplayCapabilities dispCap = (DisplayCapabilities)_systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY);
- if(dispCap !=null){
- params.setResolution(dispCap.getScreenParams().getImageResolution());
- }
- sdlSession.setDesiredVideoParams(params);
- manager.startVideoStreaming(remoteDisplay,params, encrypted);
- }
- }else{
- sdlSession.setDesiredVideoParams(parameters);
- manager.startVideoStreaming(remoteDisplay,parameters, encrypted);
- }
- }
-
- /**
- * Stops the remote display stream if one has been started
- */
- public void stopRemoteDisplayStream(){
- if(manager!=null){
- manager.dispose();
- }
- manager = null;
- }
-
- /**
- * Try to open a video service by using the video streaming parameters supplied.
- *
- * Only information from codecs, width and height are used during video format negotiation.
- *
- * @param isEncrypted Specify true if packets on this service have to be encrypted
- * @param parameters VideoStreamingParameters that are desired. Does not guarantee this is what will be accepted.
- *
- * @return If the service is opened successfully, an instance of VideoStreamingParams is
- * returned which contains accepted video format. If the service is opened with legacy
- * mode (i.e. without any negotiation) then an instance of VideoStreamingParams is
- * returned. If the service was not opened then null is returned.
- */
- @SuppressWarnings("unused")
- private VideoStreamingParameters tryStartVideoStream(boolean isEncrypted, VideoStreamingParameters parameters) {
- if (sdlSession == null) {
- DebugTool.logWarning("SdlSession is not created yet.");
- return null;
- }
- if(protocolVersion!= null && protocolVersion.getMajor() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
- DebugTool.logWarning("Module doesn't support video streaming.");
- return null;
- }
- if (parameters == null) {
- DebugTool.logWarning("Video parameters were not supplied.");
- return null;
- }
-
- sdlSession.setDesiredVideoParams(parameters);
-
- navServiceStartResponseReceived = false;
- navServiceStartResponse = false;
- navServiceStartRejectedParams = null;
-
- sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!navServiceStartResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- if (navServiceStartResponse) {
- if(protocolVersion!= null && protocolVersion.getMajor() < 5){ //Versions 1-4 do not support streaming parameter negotiations
- sdlSession.setAcceptedVideoParams(parameters);
- }
- return sdlSession.getAcceptedVideoParams();
- }
-
- if (navServiceStartRejectedParams != null) {
- StringBuilder builder = new StringBuilder();
- for (String paramName : navServiceStartRejectedParams) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append(paramName);
- }
-
- DebugTool.logWarning("StartService for nav failed. Rejected params: " + builder.toString());
-
- } else {
- DebugTool.logWarning("StartService for nav failed (rejected params not supplied)");
- }
-
- return null;
- }
-
- /**
- *Starts the MediaCodec encoder utilized in conjunction with the Surface returned via the createOpenGLInputSurface method
- */
- @SuppressWarnings("unused")
- public void startEncoder () {
- if (sdlSession == null || !sdlSession.getIsConnected()) return;
-
- sdlSession.startEncoder();
- }
-
- /**
- *Releases the MediaCodec encoder utilized in conjunction with the Surface returned via the createOpenGLInputSurface method
- */
- @SuppressWarnings("unused")
- public void releaseEncoder() {
- if (sdlSession == null || !sdlSession.getIsConnected()) return;
-
- sdlSession.releaseEncoder();
- }
-
- /**
- *Releases the MediaCodec encoder utilized in conjunction with the Surface returned via the createOpenGLInputSurface method
- */
- @SuppressWarnings("unused")
- public void drainEncoder(boolean endOfStream) {
- if (sdlSession == null || !sdlSession.getIsConnected()) return;
-
- sdlSession.drainEncoder(endOfStream);
- }
-
- /**
- * Opens a audio service (service type 10) and subsequently provides an IAudioStreamListener
- * to the app to send audio data.
- *
- * Currently information passed by "params" are ignored, since Audio Streaming feature lacks
- * capability negotiation mechanism. App should configure audio stream data to align with
- * head unit's capability by checking (upcoming) pcmCapabilities. The default format is in
- * 16kHz and 16 bits.
- *
- * @param isEncrypted Specify true if packets on this service have to be encrypted
- * @param codec Audio codec which will be used for streaming. Currently, only
- * AudioStreamingCodec.LPCM is accepted.
- * @param params (Reserved for future use) Additional configuration information for each
- * codec. If "codec" is AudioStreamingCodec.LPCM, "params" must be an
- * instance of LPCMParams class.
- *
- * @return IAudioStreamListener interface if service is opened successfully and streaming is
- * started, null otherwise
- */
- @SuppressWarnings("unused")
- public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
- if (sdlSession == null) {
- DebugTool.logWarning("SdlSession is not created yet.");
- return null;
- }
- if (!sdlSession.getIsConnected()) {
- DebugTool.logWarning("Connection is not available.");
- return null;
- }
- if (codec != AudioStreamingCodec.LPCM) {
- DebugTool.logWarning("Audio codec " + codec + " is not supported.");
- return null;
- }
-
- pcmServiceStartResponseReceived = false;
- pcmServiceStartResponse = false;
- sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!pcmServiceStartResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- if (pcmServiceStartResponse) {
- DebugTool.logInfo("StartService for audio succeeded");
- return sdlSession.startAudioStream();
- } else {
- if (pcmServiceStartRejectedParams != null) {
- StringBuilder builder = new StringBuilder();
- for (String paramName : pcmServiceStartRejectedParams) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
- builder.append(paramName);
- }
- DebugTool.logWarning("StartService for audio failed. Rejected params: " + builder.toString());
- } else {
- DebugTool.logWarning("StartService for audio failed (rejected params not supplied)");
- }
- return null;
- }
- }
-
- /**
- *Closes the opened audio service (serviceType 10)
- *@return true if the audio service is closed successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- public boolean endAudioStream() {
- if (sdlSession == null || !sdlSession.getIsConnected()) return false;
-
- pcmServiceEndResponseReceived = false;
- pcmServiceEndResponse = false;
- sdlSession.stopAudioStream();
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!pcmServiceEndResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- return pcmServiceEndResponse;
- }
-
- /**
- *Pauses the stream for the opened audio service (serviceType 10)
- *@return true if the audio service stream is paused successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- public boolean pauseAudioStream() {
- return sdlSession != null && sdlSession.pauseAudioStream();
- }
-
- /**
- *Resumes the stream for the opened audio service (serviceType 10)
- *@return true if the audio service stream is resumed successfully, return false otherwise
- */
- @SuppressWarnings("unused")
- public boolean resumeAudioStream() {
- return sdlSession != null && sdlSession.resumeAudioStream();
- }
-
- private void NavServiceStarted() {
- navServiceStartResponseReceived = true;
- navServiceStartResponse = true;
- }
-
- private void NavServiceStartedNACK(List<String> rejectedParams) {
- navServiceStartResponseReceived = true;
- navServiceStartResponse = false;
- navServiceStartRejectedParams = rejectedParams;
- }
-
- private void AudioServiceStarted() {
- pcmServiceStartResponseReceived = true;
- pcmServiceStartResponse = true;
- }
-
- private void RPCProtectedServiceStarted() {
- rpcProtectedResponseReceived = true;
- rpcProtectedStartResponse = true;
- }
- private void AudioServiceStartedNACK(List<String> rejectedParams) {
- pcmServiceStartResponseReceived = true;
- pcmServiceStartResponse = false;
- pcmServiceStartRejectedParams = rejectedParams;
- }
-
- private void NavServiceEnded() {
- navServiceEndResponseReceived = true;
- navServiceEndResponse = true;
- }
-
- private void NavServiceEndedNACK() {
- navServiceEndResponseReceived = true;
- navServiceEndResponse = false;
- }
-
- private void AudioServiceEnded() {
- pcmServiceEndResponseReceived = true;
- pcmServiceEndResponse = true;
- }
-
- private void AudioServiceEndedNACK() {
- pcmServiceEndResponseReceived = true;
- pcmServiceEndResponse = false;
- }
-
- public void setAppService(Service mService)
- {
- _appService = mService;
- }
-
- @SuppressWarnings("unused")
- public boolean startProtectedRPCService() {
- rpcProtectedResponseReceived = false;
- rpcProtectedStartResponse = false;
- sdlSession.startService(SessionType.RPC, sdlSession.getSessionId(), true);
-
- FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
- ScheduledExecutorService scheduler = createScheduler();
- scheduler.execute(fTask);
-
- //noinspection StatementWithEmptyBody
- while (!rpcProtectedResponseReceived && !fTask.isDone());
- scheduler.shutdown();
-
- return rpcProtectedStartResponse;
- }
-
- @SuppressWarnings("unused")
- public void getLockScreenIcon(final OnLockScreenIconDownloadedListener l){
- if(lockScreenIconRequest == null){
- l.onLockScreenIconDownloadError(new SdlException("This version of SDL core may not support lock screen icons.",
- SdlExceptionCause.LOCK_SCREEN_ICON_NOT_SUPPORTED));
- return;
- }
-
- LockScreenManager lockMan = sdlSession.getLockScreenMan();
- Bitmap bitmap = lockMan.getLockScreenIcon();
-
- // read bitmap if it was already downloaded so we don't have to download it every time
- if(bitmap != null){
- l.onLockScreenIconDownloaded(bitmap);
- }
- else{
- String url = lockScreenIconRequest.getUrl();
- sdlSession.getLockScreenMan().downloadLockScreenIcon(url, l);
- }
- }
-
- /* ******************* Public Helper Methods *************************/
-
- /*Begin V1 Enhanced helper*/
-
- /**
- *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param parentID -Menu parent ID for optional sub value containing menu parameters.
- *@param position -Menu position for optional sub value containing menu parameters.
- *@param vrCommands -VR synonyms for this AddCommand.
- *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
- *@param IconType -Describes whether the image is static or dynamic
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("SameParameterValue")
- public void addCommand(@NonNull Integer commandID,
- String menuText, Integer parentID, Integer position,
- Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
- throws SdlException {
-
-
- AddCommand msg = new AddCommand(commandID);
- msg.setCorrelationID(correlationID);
-
- if (vrCommands != null) msg.setVrCommands(vrCommands);
-
- Image cmdIcon = null;
-
- if (IconValue != null && IconType != null)
- {
- cmdIcon = new Image();
- cmdIcon.setValue(IconValue);
- cmdIcon.setImageType(IconType);
- }
-
- if (cmdIcon != null) msg.setCmdIcon(cmdIcon);
-
- if(menuText != null || parentID != null || position != null) {
- MenuParams menuParams = new MenuParams();
- menuParams.setMenuName(menuText);
- menuParams.setPosition(position);
- menuParams.setParentID(parentID);
- msg.setMenuParams(menuParams);
- }
-
- sendRPCRequest(msg);
- }
-
- /**
- *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param position -Menu position for optional sub value containing menu parameters.
- *@param vrCommands -VR synonyms for this AddCommand.
- *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
- *@param IconType -Describes whether the image is static or dynamic
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- String menuText, Integer position,
- Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, menuText, null, position, vrCommands, IconValue, IconType, correlationID);
- }
-
- /**
- *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param position -Menu position for optional sub value containing menu parameters.
- *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
- *@param IconType -Describes whether the image is static or dynamic
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- String menuText, Integer position, String IconValue, ImageType IconType,
- Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, menuText, null, position, null, IconValue, IconType, correlationID);
- }
-
- /**
- *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
- *@param IconType -Describes whether the image is static or dynamic
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- String menuText, String IconValue, ImageType IconType, Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, menuText, null, null, null, IconValue, IconType, correlationID);
- }
-
- /**
- * Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param commandID -Unique command ID of the command to add.
- * @param menuText -Menu text for optional sub value containing menu parameters.
- * @param vrCommands -VR synonyms for this AddCommand.
- * @param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
- * @param IconType -Describes whether the image is static or dynamic
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- String menuText, Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, menuText, null, null, vrCommands, IconValue, IconType, correlationID);
- }
-
- /**
- * Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param commandID -Unique command ID of the command to add.
- * @param vrCommands -VR synonyms for this AddCommand.
- * @param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).
- * @param IconType -Describes whether the image is static or dynamic
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, null, null, null, vrCommands, IconValue, IconType, correlationID);
- }
-
- /*End V1 Enhanced helper*/
-
- /**
- *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param parentID -Menu parent ID for optional sub value containing menu parameters.
- *@param position -Menu position for optional sub value containing menu parameters.
- *@param vrCommands -VR synonyms for this AddCommand.
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("SameParameterValue")
- public void addCommand(@NonNull Integer commandID,
- String menuText, Integer parentID, Integer position,
- Vector<String> vrCommands, Integer correlationID)
- throws SdlException {
-
- AddCommand msg = new AddCommand(commandID);
- msg.setCorrelationID(correlationID);
- msg.setVrCommands(vrCommands);
- if(menuText != null || parentID != null || position != null) {
- MenuParams menuParams = new MenuParams();
- menuParams.setMenuName(menuText);
- menuParams.setPosition(position);
- menuParams.setParentID(parentID);
- msg.setMenuParams(menuParams);
- }
-
- sendRPCRequest(msg);
- }
-
- /**
- *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param position -Menu position for optional sub value containing menu parameters.
- *@param vrCommands -VR synonyms for this AddCommand.
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- String menuText, Integer position,
- Vector<String> vrCommands, Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, menuText, null, position, vrCommands, correlationID);
- }
-
- /**
- *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param position -Menu position for optional sub value containing menu parameters.
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- String menuText, Integer position,
- Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, menuText, null, position, null, correlationID);
- }
-
- /**
- *Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- String menuText, Integer correlationID)
- throws SdlException {
- addCommand(commandID, menuText, null, null, (Vector<String>)null, correlationID);
- }
-
- /**
- * Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param menuText -Menu text for optional sub value containing menu parameters.
- *@param vrCommands -VR synonyms for this AddCommand.
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- String menuText, Vector<String> vrCommands, Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, menuText, null, null, vrCommands, correlationID);
- }
-
- /**
- * Sends an AddCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- *@param commandID -Unique command ID of the command to add.
- *@param vrCommands -VR synonyms for this AddCommand.
- *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void addCommand(Integer commandID,
- Vector<String> vrCommands, Integer correlationID)
- throws SdlException {
-
- addCommand(commandID, null, null, null, vrCommands, correlationID);
- }
-
- /**
- * Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param menuID -Unique ID of the sub menu to add.
- * @param menuName -Text to show in the menu for this sub menu.
- * @param position -Position within the items that are are at top level of the in application menu.
- * @param menuIcon -Image to be be shown along with the submenu item
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("SameParameterValue")
- public void addSubMenu(@NonNull Integer menuID, @NonNull String menuName,
- Integer position, Image menuIcon, Integer correlationID)
- throws SdlException {
-
- AddSubMenu msg = new AddSubMenu(menuID, menuName);
- msg.setCorrelationID(correlationID);
- msg.setPosition(position);
- msg.setMenuIcon(menuIcon);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param menuID -Unique ID of the sub menu to add.
- * @param menuName -Text to show in the menu for this sub menu.
- * @param position -Position within the items that are are at top level of the in application menu.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @Deprecated
- @SuppressWarnings("SameParameterValue")
- public void addSubMenu(@NonNull Integer menuID, @NonNull String menuName,
- Integer position, Integer correlationID)
- throws SdlException {
-
- addSubMenu(menuID, menuName, position, null, correlationID);
- }
-
- /**
- * Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param menuID -Unique ID of the sub menu to add.
- * @param menuName -Text to show in the menu for this sub menu.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @Deprecated
- @SuppressWarnings("unused")
- public void addSubMenu(Integer menuID, String menuName,
- Integer correlationID) throws SdlException {
-
- addSubMenu(menuID, menuName, null, null, correlationID);
- }
-
- /*Begin V1 Enhanced helper*/
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param ttsText -The text to speech message in the form of a string.
- * @param alertText1 -The first line of the alert text field.
- * @param alertText2 -The second line of the alert text field.
- * @param alertText3 -The optional third line of the alert text field.
- * @param playTone -Defines if tone should be played.
- * @param duration -Timeout in milliseconds.
- * @param softButtons -A list of App defined SoftButtons.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("SameParameterValue")
- public void alert(String ttsText, String alertText1,
- String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons,
- Integer correlationID) throws SdlException {
-
- Vector<TTSChunk> chunks = TTSChunkFactory.createSimpleTTSChunks(ttsText);
- Alert msg = new Alert();
- msg.setCorrelationID(correlationID);
- msg.setAlertText1(alertText1);
- msg.setAlertText2(alertText2);
- msg.setAlertText3(alertText3);
- msg.setDuration(duration);
- msg.setPlayTone(playTone);
- msg.setTtsChunks(chunks);
- msg.setSoftButtons(softButtons);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param ttsChunks -Text/phonemes to speak in the form of ttsChunks.
- * @param alertText1 -The first line of the alert text field.
- * @param alertText2 -The second line of the alert text field.
- * @param alertText3 -The optional third line of the alert text field.
- * @param playTone -Defines if tone should be played.
- * @param duration -Timeout in milliseconds.
- * @param softButtons -A list of App defined SoftButtons.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- public void alert(Vector<TTSChunk> ttsChunks,
- String alertText1, String alertText2, String alertText3, Boolean playTone,
- Integer duration, Vector<SoftButton> softButtons, Integer correlationID) throws SdlException {
-
- Alert msg = new Alert();
- msg.setCorrelationID(correlationID);
- msg.setAlertText1(alertText1);
- msg.setAlertText2(alertText2);
- msg.setAlertText3(alertText3);
- msg.setDuration(duration);
- msg.setPlayTone(playTone);
- msg.setTtsChunks(ttsChunks);
- msg.setSoftButtons(softButtons);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param ttsText -The text to speech message in the form of a string.
- * @param playTone -Defines if tone should be played.
- * @param softButtons -A list of App defined SoftButtons.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void alert(String ttsText, Boolean playTone, Vector<SoftButton> softButtons,
- Integer correlationID) throws SdlException {
-
- alert(ttsText, null, null, null, playTone, null, softButtons, correlationID);
- }
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param chunks -A list of text/phonemes to speak in the form of ttsChunks.
- * @param playTone -Defines if tone should be played.
- * @param softButtons -A list of App defined SoftButtons.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void alert(Vector<TTSChunk> chunks, Boolean playTone, Vector<SoftButton> softButtons,
- Integer correlationID) throws SdlException {
-
- alert(chunks, null, null, null, playTone, null, softButtons, correlationID);
- }
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param alertText1 -The first line of the alert text field.
- * @param alertText2 -The second line of the alert text field.
- * @param alertText3 -The optional third line of the alert text field.
- * @param playTone -Defines if tone should be played.
- * @param duration -Timeout in milliseconds.
- * @param softButtons -A list of App defined SoftButtons.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void alert(String alertText1, String alertText2, String alertText3,
- Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID)
- throws SdlException {
-
- alert((Vector<TTSChunk>)null, alertText1, alertText2, alertText3, playTone, duration, softButtons, correlationID);
- }
-
- /*End V1 Enhanced helper*/
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param ttsText -The text to speech message in the form of a string.
- * @param alertText1 -The first line of the alert text field.
- * @param alertText2 -The second line of the alert text field.
- * @param playTone -Defines if tone should be played.
- * @param duration -Timeout in milliseconds.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("SameParameterValue")
- public void alert(String ttsText, String alertText1,
- String alertText2, Boolean playTone, Integer duration,
- Integer correlationID) throws SdlException {
-
- Vector<TTSChunk> chunks = TTSChunkFactory.createSimpleTTSChunks(ttsText);
- Alert msg = new Alert();
- msg.setCorrelationID(correlationID);
- msg.setAlertText1(alertText1);
- msg.setAlertText2(alertText2);
- msg.setDuration(duration);
- msg.setPlayTone(playTone);
- msg.setTtsChunks(chunks);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param ttsChunks -A list of text/phonemes to speak in the form of ttsChunks.
- * @param alertText1 -The first line of the alert text field.
- * @param alertText2 -The second line of the alert text field.
- * @param playTone -Defines if tone should be played.
- * @param duration -Timeout in milliseconds.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- public void alert(Vector<TTSChunk> ttsChunks,
- String alertText1, String alertText2, Boolean playTone,
- Integer duration, Integer correlationID) throws SdlException {
-
- Alert msg = new Alert();
- msg.setCorrelationID(correlationID);
- msg.setAlertText1(alertText1);
- msg.setAlertText2(alertText2);
- msg.setDuration(duration);
- msg.setPlayTone(playTone);
- msg.setTtsChunks(ttsChunks);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param ttsText -The text to speech message in the form of a string.
- * @param playTone -Defines if tone should be played.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void alert(String ttsText, Boolean playTone,
- Integer correlationID) throws SdlException {
-
- alert(ttsText, null, null, playTone, null, correlationID);
- }
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param chunks -A list of text/phonemes to speak in the form of ttsChunks.
- * @param playTone -Defines if tone should be played.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void alert(Vector<TTSChunk> chunks, Boolean playTone,
- Integer correlationID) throws SdlException {
-
- alert(chunks, null, null, playTone, null, correlationID);
- }
-
- /**
- * Sends an Alert RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param alertText1 -The first line of the alert text field.
- * @param alertText2 -The second line of the alert text field.
- * @param playTone -Defines if tone should be played.
- * @param duration -Timeout in milliseconds.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void alert(String alertText1, String alertText2,
- Boolean playTone, Integer duration, Integer correlationID)
- throws SdlException {
-
- alert((Vector<TTSChunk>)null, alertText1, alertText2, playTone, duration, correlationID);
- }
-
- /**
- * Sends a CreateInteractionChoiceSet RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param choiceSet to be sent to the module
- * @param interactionChoiceSetID to be used in reference to the supplied choiceSet
- * @param correlationID to be set to the RPCRequest
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void createInteractionChoiceSet(
- @NonNull Vector<Choice> choiceSet, @NonNull Integer interactionChoiceSetID,
- Integer correlationID) throws SdlException {
-
- CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet(interactionChoiceSetID, choiceSet);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a DeleteCommand RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param commandID -ID of the command(s) to delete.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void deleteCommand(@NonNull Integer commandID,
- Integer correlationID) throws SdlException {
-
- DeleteCommand msg = new DeleteCommand(commandID);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a DeleteInteractionChoiceSet RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param interactionChoiceSetID -ID of the interaction choice set to delete.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void deleteInteractionChoiceSet(
- @NonNull Integer interactionChoiceSetID, Integer correlationID)
- throws SdlException {
-
- DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet(interactionChoiceSetID);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a DeleteSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param menuID -The menuID of the submenu to delete.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void deleteSubMenu(Integer menuID,
- Integer correlationID) throws SdlException {
-
- DeleteSubMenu msg = new DeleteSubMenu(menuID);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
-
-
- /*Begin V1 Enhanced helper*/
-
- /**
- * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
- * @param displayText -Text to be displayed first.
- * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.
- * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performInteraction(String initPrompt,
- @NonNull String displayText, @NonNull Integer interactionChoiceSetID, Vector<VrHelpItem> vrHelp,
- Integer correlationID) throws SdlException {
-
- Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
- interactionChoiceSetIDs.add(interactionChoiceSetID);
- Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
- PerformInteraction msg = new PerformInteraction(displayText, InteractionMode.BOTH, interactionChoiceSetIDs);
- msg.setInitialPrompt(initChunks);
- msg.setVrHelp(vrHelp);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
- * @param displayText -Text to be displayed first.
- * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.
- * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.
- * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.
- * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
- * @param timeout -Timeout in milliseconds.
- * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performInteraction(String initPrompt,
- @NonNull String displayText, @NonNull Integer interactionChoiceSetID,
- String helpPrompt, String timeoutPrompt,
- @NonNull InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
- Integer correlationID) throws SdlException {
-
- Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
- interactionChoiceSetIDs.add(interactionChoiceSetID);
- Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
- Vector<TTSChunk> helpChunks = TTSChunkFactory.createSimpleTTSChunks(helpPrompt);
- Vector<TTSChunk> timeoutChunks = TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt);
- PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDs);
- msg.setInitialPrompt(initChunks);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setTimeoutPrompt(timeoutChunks);
- msg.setVrHelp(vrHelp);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
- * @param displayText -Text to be displayed first.
- * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.
- * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.
- * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.
- * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
- * @param timeout -Timeout in milliseconds.
- * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performInteraction(String initPrompt,
- @NonNull String displayText, @NonNull Vector<Integer> interactionChoiceSetIDList,
- String helpPrompt, String timeoutPrompt,
- @NonNull InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
- Integer correlationID) throws SdlException {
-
- Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
- Vector<TTSChunk> helpChunks = TTSChunkFactory.createSimpleTTSChunks(helpPrompt);
- Vector<TTSChunk> timeoutChunks = TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt);
- PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDList);
- msg.setInitialPrompt(initChunks);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setTimeoutPrompt(timeoutChunks);
- msg.setVrHelp(vrHelp);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param initChunks -A list of text/phonemes to speak for the initial prompt in the form of ttsChunks.
- * @param displayText -Text to be displayed first.
- * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.
- * @param helpChunks -A list of text/phonemes to speak for the help text that is spoken when a user speaks "help" during the interaction.
- * @param timeoutChunks A list of text/phonems to speak for the timeout text that is spoken when a VR interaction times out.
- * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
- * @param timeout -Timeout in milliseconds.
- * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performInteraction(
- Vector<TTSChunk> initChunks, @NonNull String displayText,
- @NonNull Vector<Integer> interactionChoiceSetIDList,
- Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
- @NonNull InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,
- Integer correlationID) throws SdlException {
-
- PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDList);
- msg.setInitialPrompt(initChunks);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setTimeoutPrompt(timeoutChunks);
- msg.setVrHelp(vrHelp);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /*End V1 Enhanced*/
-
- /**
- * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
- * @param displayText -Text to be displayed first.
- * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performInteraction(String initPrompt,
- @NonNull String displayText, @NonNull Integer interactionChoiceSetID,
- Integer correlationID) throws SdlException {
-
- Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
- interactionChoiceSetIDs.add(interactionChoiceSetID);
- Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
- PerformInteraction msg = new PerformInteraction(displayText, InteractionMode.BOTH, interactionChoiceSetIDs);
- msg.setInitialPrompt(initChunks);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
- * @param displayText -Text to be displayed first.
- * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.
- * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.
- * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.
- * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
- * @param timeout -Timeout in milliseconds.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performInteraction(String initPrompt,
- @NonNull String displayText, @NonNull Integer interactionChoiceSetID,
- String helpPrompt, String timeoutPrompt,
- @NonNull InteractionMode interactionMode, Integer timeout,
- Integer correlationID) throws SdlException {
-
- Vector<Integer> interactionChoiceSetIDs = new Vector<Integer>();
- interactionChoiceSetIDs.add(interactionChoiceSetID);
- Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
- Vector<TTSChunk> helpChunks = TTSChunkFactory.createSimpleTTSChunks(helpPrompt);
- Vector<TTSChunk> timeoutChunks = TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt);
- PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDs);
- msg.setInitialPrompt(initChunks);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setTimeoutPrompt(timeoutChunks);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.
- * @param displayText -Text to be displayed first.
- * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.
- * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.
- * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.
- * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
- * @param timeout -Timeout in milliseconds.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performInteraction(String initPrompt,
- @NonNull String displayText, @NonNull Vector<Integer> interactionChoiceSetIDList,
- String helpPrompt, String timeoutPrompt,
- @NonNull InteractionMode interactionMode, Integer timeout,
- Integer correlationID) throws SdlException {
-
- Vector<TTSChunk> initChunks = TTSChunkFactory.createSimpleTTSChunks(initPrompt);
- Vector<TTSChunk> helpChunks = TTSChunkFactory.createSimpleTTSChunks(helpPrompt);
- Vector<TTSChunk> timeoutChunks = TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt);
- PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDList);
- msg.setInitialPrompt(initChunks);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setTimeoutPrompt(timeoutChunks);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a PerformInteraction RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param initChunks -A list of text/phonemes to speak for the initial prompt in the form of ttsChunks.
- * @param displayText -Text to be displayed first.
- * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.
- * @param helpChunks -A list of text/phonemes to speak for the help text that is spoken when a user speaks "help" during the interaction.
- * @param timeoutChunks A list of text/phonems to speak for the timeout text that is spoken when a VR interaction times out.
- * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).
- * @param timeout -Timeout in milliseconds.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performInteraction(
- Vector<TTSChunk> initChunks, @NonNull String displayText,
- @NonNull Vector<Integer> interactionChoiceSetIDList,
- Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
- @NonNull InteractionMode interactionMode, Integer timeout,
- Integer correlationID) throws SdlException {
-
- PerformInteraction msg = new PerformInteraction(displayText, interactionMode, interactionChoiceSetIDList);
- msg.setInitialPrompt(initChunks);
- msg.setTimeout(timeout);
- msg.setHelpPrompt(helpChunks);
- msg.setTimeoutPrompt(timeoutChunks);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- // Protected registerAppInterface used to ensure only non-ALM applications call
- // reqisterAppInterface
- protected void registerAppInterfacePrivate(
- @NonNull SdlMsgVersion sdlMsgVersion, @NonNull String appName, Vector<TTSChunk> ttsName,
- String ngnMediaScreenAppName, Vector<String> vrSynonyms, @NonNull Boolean isMediaApp,
- @NonNull Language languageDesired, @NonNull Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
- @NonNull String appID, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme, Integer correlationID)
- throws SdlException {
- String carrierName = null;
- if(telephonyManager != null){
- carrierName = telephonyManager.getNetworkOperatorName();
- }
-
- DeviceInfo deviceInfo = new DeviceInfo();
- deviceInfo.setHardware(android.os.Build.MODEL);
- deviceInfo.setOs(DeviceInfo.DEVICE_OS);
- deviceInfo.setOsVersion(Build.VERSION.RELEASE);
- deviceInfo.setCarrier(carrierName);
-
- if (sdlMsgVersion == null) {
- sdlMsgVersion = new SdlMsgVersion();
- sdlMsgVersion.setMajorVersion(MAX_SUPPORTED_RPC_VERSION.getMajor());
- sdlMsgVersion.setMinorVersion(MAX_SUPPORTED_RPC_VERSION.getMinor());
- }
- if (languageDesired == null) {
- languageDesired = Language.EN_US;
- }
- if (hmiDisplayLanguageDesired == null) {
- hmiDisplayLanguageDesired = Language.EN_US;
- }
-
- RegisterAppInterface msg = new RegisterAppInterface(sdlMsgVersion, appName, isMediaApp, languageDesired, hmiDisplayLanguageDesired, appID);
-
- if (correlationID != null) {
- msg.setCorrelationID(correlationID);
- }
-
- msg.setDeviceInfo(deviceInfo);
-
- msg.setTtsName(ttsName);
-
- if (ngnMediaScreenAppName == null) {
- ngnMediaScreenAppName = appName;
- }
-
- msg.setNgnMediaScreenAppName(ngnMediaScreenAppName);
-
- if (vrSynonyms == null) {
- vrSynonyms = new Vector<String>();
- vrSynonyms.add(appName);
- }
- msg.setVrSynonyms(vrSynonyms);
-
- msg.setAppHMIType(appType);
-
- msg.setDayColorScheme(dayColorScheme);
- msg.setNightColorScheme(nightColorScheme);
-
- if (_bAppResumeEnabled)
- {
- if (_lastHashID != null)
- msg.setHashID(_lastHashID);
- }
-
- Intent sendIntent = createBroadcastIntent();
- updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.REGISTER_APP_INTERFACE.toString());
- updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_REQUEST);
- updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
- updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
- sendBroadcastIntent(sendIntent);
-
- sendRPCRequestPrivate(msg);
- }
-
- /*Begin V1 Enhanced helper function*/
-
- /**
- * Sends a SetGlobalProperties RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param helpPrompt that will be used for the VR screen
- * @param timeoutPrompt string to be displayed after timeout
- * @param vrHelpTitle string that may be displayed on VR prompt dialog
- * @param vrHelp a list of VR synonyms that may be displayed to user
- * @param correlationID to be attached to the request
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void setGlobalProperties(
- String helpPrompt, String timeoutPrompt, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID)
- throws SdlException {
-
- SetGlobalProperties req = new SetGlobalProperties();
- req.setCorrelationID(correlationID);
- req.setHelpPrompt(TTSChunkFactory.createSimpleTTSChunks(helpPrompt));
- req.setTimeoutPrompt(TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt));
- req.setVrHelpTitle(vrHelpTitle);
- req.setVrHelp(vrHelp);
-
- sendRPCRequest(req);
- }
-
- /**
- * Sends a SetGlobalProperties RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param helpChunks tts chunks that should be used when prompting the user
- * @param timeoutChunks tts chunks that will be used when a timeout occurs
- * @param vrHelpTitle string that may be displayed on VR prompt dialog
- * @param vrHelp a list of VR synonyms that may be displayed to user
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void setGlobalProperties(
- Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, String vrHelpTitle, Vector<VrHelpItem> vrHelp,
- Integer correlationID) throws SdlException {
-
- SetGlobalProperties req = new SetGlobalProperties();
- req.setCorrelationID(correlationID);
- req.setHelpPrompt(helpChunks);
- req.setTimeoutPrompt(timeoutChunks);
- req.setVrHelpTitle(vrHelpTitle);
- req.setVrHelp(vrHelp);
-
- sendRPCRequest(req);
- }
-
- /*End V1 Enhanced helper function*/
-
- /**
- * Sends a SetGlobalProperties RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param helpPrompt that will be used for the VR screen
- * @param timeoutPrompt string to be displayed after timeout
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void setGlobalProperties(
- String helpPrompt, String timeoutPrompt, Integer correlationID)
- throws SdlException {
-
- SetGlobalProperties req = new SetGlobalProperties();
- req.setCorrelationID(correlationID);
- req.setHelpPrompt(TTSChunkFactory.createSimpleTTSChunks(helpPrompt));
- req.setTimeoutPrompt(TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt));
-
- sendRPCRequest(req);
- }
-
- /**
- * Sends a SetGlobalProperties RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param helpChunks tts chunks that should be used when prompting the user
- * @param timeoutChunks tts chunks that will be used when a timeout occurs
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void setGlobalProperties(
- Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
- Integer correlationID) throws SdlException {
-
- SetGlobalProperties req = new SetGlobalProperties();
- req.setCorrelationID(correlationID);
- req.setHelpPrompt(helpChunks);
- req.setTimeoutPrompt(timeoutChunks);
-
- sendRPCRequest(req);
- }
-
- @SuppressWarnings("unused")
- public void resetGlobalProperties(Vector<GlobalProperty> properties,
- Integer correlationID) throws SdlException {
-
- ResetGlobalProperties req = new ResetGlobalProperties();
-
- req.setCorrelationID(correlationID);
- req.setProperties(properties);
-
- sendRPCRequest(req);
- }
-
-
- /**
- * Sends a SetMediaClockTimer RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param hours integer for hours
- * @param minutes integer for minutes
- * @param seconds integer for seconds
- * @param updateMode mode in which the media clock timer should be updated
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void setMediaClockTimer(Integer hours,
- Integer minutes, Integer seconds, @NonNull UpdateMode updateMode,
- Integer correlationID) throws SdlException {
-
- SetMediaClockTimer msg = new SetMediaClockTimer(updateMode);
- if (hours != null || minutes != null || seconds != null) {
- StartTime startTime = new StartTime(hours, minutes, seconds);
- msg.setStartTime(startTime);
- }
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Pauses the media clock. Responses are captured through callback on IProxyListener.
- *
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void pauseMediaClockTimer(Integer correlationID)
- throws SdlException {
-
- SetMediaClockTimer msg = new SetMediaClockTimer(UpdateMode.PAUSE);
- StartTime startTime = new StartTime(0, 0, 0);
- msg.setStartTime(startTime);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Resumes the media clock. Responses are captured through callback on IProxyListener.
- *
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void resumeMediaClockTimer(Integer correlationID)
- throws SdlException {
-
- SetMediaClockTimer msg = new SetMediaClockTimer(UpdateMode.RESUME);
- StartTime startTime = new StartTime(0, 0, 0);
- msg.setStartTime(startTime);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Clears the media clock. Responses are captured through callback on IProxyListener.
- *
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void clearMediaClockTimer(Integer correlationID)
- throws SdlException {
-
- Show msg = new Show();
- msg.setCorrelationID(correlationID);
- msg.setMediaClock(" ");
-
- sendRPCRequest(msg);
- }
-
- /*Begin V1 Enhanced helper*/
- /**
- * Sends a Show RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param mainText1 text displayed in a single or upper display line.
- * @param mainText2 text displayed on the second display line.
- * @param mainText3 text displayed on the second "page" first display line.
- * @param mainText4 text displayed on the second "page" second display line.
- * @param statusBar text is placed in the status bar area (Only valid for NAVIGATION apps)
- * @param mediaClock text value for MediaClock field.
- * @param mediaTrack text displayed in the track field.
- * @param graphic image struct determining whether static or dynamic image to display in app.
- * @param softButtons app defined SoftButtons.
- * @param customPresets app labeled on-screen presets.
- * @param alignment specifies how mainText1 and mainText2s texts should be aligned on display.
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("SameParameterValue")
- public void show(String mainText1, String mainText2, String mainText3, String mainText4,
- String statusBar, String mediaClock, String mediaTrack,
- Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets,
- TextAlignment alignment, Integer correlationID)
- throws SdlException {
-
- Show msg = new Show();
- msg.setCorrelationID(correlationID);
- msg.setMainField1(mainText1);
- msg.setMainField2(mainText2);
- msg.setStatusBar(statusBar);
- msg.setMediaClock(mediaClock);
- msg.setMediaTrack(mediaTrack);
- msg.setAlignment(alignment);
- msg.setMainField3(mainText3);
- msg.setMainField4(mainText4);
- msg.setGraphic(graphic);
- msg.setSoftButtons(softButtons);
- msg.setCustomPresets(customPresets);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a Show RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param mainText1 -Text displayed in a single or upper display line.
- * @param mainText2 -Text displayed on the second display line.
- * @param mainText3 -Text displayed on the second "page" first display line.
- * @param mainText4 -Text displayed on the second "page" second display line.
- * @param graphic -Image struct determining whether static or dynamic image to display in app.
- * @param softButtons -App defined SoftButtons.
- * @param customPresets -App labeled on-screen presets.
- * @param alignment -Specifies how mainText1 and mainText2s texts should be aligned on display.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void show(String mainText1, String mainText2, String mainText3, String mainText4,
- Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets,
- TextAlignment alignment, Integer correlationID)
- throws SdlException {
-
- show(mainText1, mainText2, mainText3, mainText4, null, null, null, graphic, softButtons, customPresets, alignment, correlationID);
- }
- /*End V1 Enhanced helper*/
-
- /**
- * Sends a Show RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param mainText1 text displayed in a single or upper display line.
- * @param mainText2 text displayed on the second display line.
- * @param statusBar text is placed in the status bar area (Only valid for NAVIGATION apps)
- * @param mediaClock text value for MediaClock field.
- * @param mediaTrack text displayed in the track field.
- * @param alignment specifies how mainText1 and mainText2s texts should be aligned on display.
- * @param correlationID unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("SameParameterValue")
- public void show(String mainText1, String mainText2,
- String statusBar, String mediaClock, String mediaTrack,
- TextAlignment alignment, Integer correlationID)
- throws SdlException {
-
- Show msg = new Show();
- msg.setCorrelationID(correlationID);
- msg.setMainField1(mainText1);
- msg.setMainField2(mainText2);
- msg.setStatusBar(statusBar);
- msg.setMediaClock(mediaClock);
- msg.setMediaTrack(mediaTrack);
- msg.setAlignment(alignment);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a Show RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param mainText1 -Text displayed in a single or upper display line.
- * @param mainText2 -Text displayed on the second display line.
- * @param alignment -Specifies how mainText1 and mainText2s texts should be aligned on display.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void show(String mainText1, String mainText2,
- TextAlignment alignment, Integer correlationID)
- throws SdlException {
-
- show(mainText1, mainText2, null, null, null, alignment, correlationID);
- }
-
- /**
- * Sends a Speak RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param ttsText -The text to speech message in the form of a string.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void speak(@NonNull String ttsText, Integer correlationID)
- throws SdlException {
-
- Speak msg = new Speak(TTSChunkFactory.createSimpleTTSChunks(ttsText));
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a Speak RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param ttsChunks -Text/phonemes to speak in the form of ttsChunks.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void speak(@NonNull Vector<TTSChunk> ttsChunks,
- Integer correlationID) throws SdlException {
-
- Speak msg = new Speak(ttsChunks);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Sends a SubscribeButton RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param buttonName -Name of the button to subscribe.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void subscribeButton(@NonNull ButtonName buttonName,
- Integer correlationID) throws SdlException {
-
- SubscribeButton msg = new SubscribeButton(buttonName);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- // Protected unregisterAppInterface used to ensure no non-ALM app calls
- // unregisterAppInterface.
- protected void unregisterAppInterfacePrivate(Integer correlationID)
- throws SdlException {
-
- UnregisterAppInterface msg = new UnregisterAppInterface();
- msg.setCorrelationID(correlationID);
-
- Intent sendIntent = createBroadcastIntent();
-
- updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.UNREGISTER_APP_INTERFACE.toString());
- updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_REQUEST);
- updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
- updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
- sendBroadcastIntent(sendIntent);
-
- sendRPCRequestPrivate(msg);
- }
-
- /**
- * Sends an UnsubscribeButton RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
- * @param buttonName -Name of the button to unsubscribe.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void unsubscribeButton(@NonNull ButtonName buttonName,
- Integer correlationID) throws SdlException {
-
- UnsubscribeButton msg = new UnsubscribeButton(buttonName);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Creates a choice to be added to a choiceset. Choice has both a voice and a visual menu component.
- *
- * @param choiceID -Unique ID used to identify this choice (returned in callback).
- * @param choiceMenuName -Text name displayed for this choice.
- * @param choiceVrCommands -Vector of vrCommands used to select this choice by voice. Must contain
- * at least one non-empty element.
- * @return Choice created.
- */
- @SuppressWarnings("unused")
- public Choice createChoiceSetChoice(Integer choiceID, String choiceMenuName,
- Vector<String> choiceVrCommands) {
- Choice returnChoice = new Choice();
-
- returnChoice.setChoiceID(choiceID);
- returnChoice.setMenuName(choiceMenuName);
- returnChoice.setVrCommands(choiceVrCommands);
-
- return returnChoice;
- }
-
- /**
- * Starts audio pass thru session. Responses are captured through callback on IProxyListener.
- *
- * @param initialPrompt -SDL will speak this prompt before opening the audio pass thru session.
- * @param audioPassThruDisplayText1 -First line of text displayed during audio capture.
- * @param audioPassThruDisplayText2 -Second line of text displayed during audio capture.
- * @param samplingRate -Allowable values of 8 khz or 16 or 22 or 44 khz.
- * @param maxDuration -The maximum duration of audio recording in milliseconds.
- * @param bitsPerSample -Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.
- * @param audioType -Specifies the type of audio data being requested.
- * @param muteAudio -Defines if the current audio source should be muted during the APT session.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void performaudiopassthru(String initialPrompt, String audioPassThruDisplayText1, String audioPassThruDisplayText2,
- @NonNull SamplingRate samplingRate, @NonNull Integer maxDuration, @NonNull BitsPerSample bitsPerSample,
- @NonNull AudioType audioType, Boolean muteAudio, Integer correlationID) throws SdlException {
- Vector<TTSChunk> chunks = TTSChunkFactory.createSimpleTTSChunks(initialPrompt);
- PerformAudioPassThru msg = new PerformAudioPassThru(samplingRate, maxDuration, bitsPerSample, audioType);
- msg.setCorrelationID(correlationID);
- msg.setInitialPrompt(chunks);
- msg.setAudioPassThruDisplayText1(audioPassThruDisplayText1);
- msg.setAudioPassThruDisplayText2(audioPassThruDisplayText2);
- msg.setMuteAudio(muteAudio);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Ends audio pass thru session. Responses are captured through callback on IProxyListener.
- *
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void endaudiopassthru(Integer correlationID) throws SdlException
- {
- EndAudioPassThru msg = new EndAudioPassThru();
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Subscribes for specific published data items. The data will be only sent if it has changed.
- * Responses are captured through callback on IProxyListener.
- *
- * @param gps -Subscribes to GPS data.
- * @param speed -Subscribes to vehicle speed data in kilometers per hour.
- * @param rpm -Subscribes to number of revolutions per minute of the engine.
- * @param fuelLevel -Subscribes to fuel level in the tank (percentage).
- * @param fuelLevel_State -Subscribes to fuel level state.
- * @param instantFuelConsumption -Subscribes to instantaneous fuel consumption in microlitres.
- * @param externalTemperature -Subscribes to the external temperature in degrees celsius.
- * @param prndl -Subscribes to PRNDL data that houses the selected gear.
- * @param tirePressure -Subscribes to the TireStatus data containing status and pressure of tires.
- * @param odometer -Subscribes to Odometer data in km.
- * @param beltStatus -Subscribes to status of the seat belts.
- * @param bodyInformation -Subscribes to body information including power modes.
- * @param deviceStatus -Subscribes to device status including signal and battery strength.
- * @param driverBraking -Subscribes to the status of the brake pedal.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- @Deprecated
- public void subscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
- boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID) throws SdlException
- {
- SubscribeVehicleData msg = new SubscribeVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
-
- /**
- * Subscribes for specific published data items. The data will be only sent if it has changed.
- * Responses are captured through callback on IProxyListener.
- *
- * @param gps -Subscribes to GPS data.
- * @param speed -Subscribes to vehicle speed data in kilometers per hour.
- * @param rpm -Subscribes to number of revolutions per minute of the engine.
- * @param fuelLevel -Subscribes to fuel level in the tank (percentage).
- * @param fuelLevel_State -Subscribes to fuel level state.
- * @param instantFuelConsumption -Subscribes to instantaneous fuel consumption in microlitres.
- * @param externalTemperature -Subscribes to the external temperature in degrees celsius.
- * @param prndl -Subscribes to PRNDL data that houses the selected gear.
- * @param tirePressure -Subscribes to the TireStatus data containing status and pressure of tires.
- * @param engineOilLife -Subscribes to Engine Oil Life data.
- * @param odometer -Subscribes to Odometer data in km.
- * @param beltStatus -Subscribes to status of the seat belts.
- * @param bodyInformation -Subscribes to body information including power modes.
- * @param deviceStatus -Subscribes to device status including signal and battery strength.
- * @param driverBraking -Subscribes to the status of the brake pedal.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void subscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
- boolean engineOilLife, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID) throws SdlException
- {
- SubscribeVehicleData msg = new SubscribeVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setEngineOilLife(engineOilLife);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
-
- /**
- * Unsubscribes for specific published data items.
- * Responses are captured through callback on IProxyListener.
- *
- * @param gps -Unsubscribes to GPS data.
- * @param speed -Unsubscribes to vehicle speed data in kilometers per hour.
- * @param rpm -Unsubscribes to number of revolutions per minute of the engine.
- * @param fuelLevel -Unsubscribes to fuel level in the tank (percentage).
- * @param fuelLevel_State -Unsubscribes to fuel level state.
- * @param instantFuelConsumption -Unsubscribes to instantaneous fuel consumption in microlitres.
- * @param externalTemperature -Unsubscribes to the external temperature in degrees celsius.
- * @param prndl -Unsubscribes to PRNDL data that houses the selected gear.
- * @param tirePressure -Unsubscribes to the TireStatus data containing status and pressure of tires.
- * @param odometer -Unsubscribes to Odometer data in km.
- * @param beltStatus -Unsubscribes to status of the seat belts.
- * @param bodyInformation -Unsubscribes to body information including power modes.
- * @param deviceStatus -Unsubscribes to device status including signal and battery strength.
- * @param driverBraking -Unsubscribes to the status of the brake pedal.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
-
- @SuppressWarnings("unused")
- @Deprecated
- public void unsubscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
- boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID) throws SdlException
- {
- UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
-
- /**
- * Unsubscribes for specific published data items.
- * Responses are captured through callback on IProxyListener.
- *
- * @param gps -Unsubscribes to GPS data.
- * @param speed -Unsubscribes to vehicle speed data in kilometers per hour.
- * @param rpm -Unsubscribes to number of revolutions per minute of the engine.
- * @param fuelLevel -Unsubscribes to fuel level in the tank (percentage).
- * @param fuelLevel_State -Unsubscribes to fuel level state.
- * @param instantFuelConsumption -Unsubscribes to instantaneous fuel consumption in microlitres.
- * @param externalTemperature -Unsubscribes to the external temperature in degrees celsius.
- * @param prndl -Unsubscribes to PRNDL data that houses the selected gear.
- * @param tirePressure -Unsubscribes to the TireStatus data containing status and pressure of tires.
- * @param engineOilLife -Unsubscribes to Engine Oil Life data.
- * @param odometer -Unsubscribes to Odometer data in km.
- * @param beltStatus -Unsubscribes to status of the seat belts.
- * @param bodyInformation -Unsubscribes to body information including power modes.
- * @param deviceStatus -Unsubscribes to device status including signal and battery strength.
- * @param driverBraking -Unsubscribes to the status of the brake pedal.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
-
- @SuppressWarnings("unused")
- public void unsubscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,
- boolean engineOilLife, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID) throws SdlException
- {
- UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setEngineOilLife(engineOilLife);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
-
- /**
- * Performs a Non periodic vehicle data read request.
- * Responses are captured through callback on IProxyListener.
- *
- * @param gps -Performs an ad-hoc request for GPS data.
- * @param speed -Performs an ad-hoc request for vehicle speed data in kilometers per hour.
- * @param rpm -Performs an ad-hoc request for number of revolutions per minute of the engine.
- * @param fuelLevel -Performs an ad-hoc request for fuel level in the tank (percentage).
- * @param fuelLevel_State -Performs an ad-hoc request for fuel level state.
- * @param instantFuelConsumption -Performs an ad-hoc request for instantaneous fuel consumption in microlitres.
- * @param externalTemperature -Performs an ad-hoc request for the external temperature in degrees celsius.
- * @param vin -Performs an ad-hoc request for the Vehicle identification number
- * @param prndl -Performs an ad-hoc request for PRNDL data that houses the selected gear.
- * @param tirePressure -Performs an ad-hoc request for the TireStatus data containing status and pressure of tires.
- * @param odometer -Performs an ad-hoc request for Odometer data in km.
- * @param beltStatus -Performs an ad-hoc request for status of the seat belts.
- * @param bodyInformation -Performs an ad-hoc request for body information including power modes.
- * @param deviceStatus -Performs an ad-hoc request for device status including signal and battery strength.
- * @param driverBraking -Performs an ad-hoc request for the status of the brake pedal.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- @Deprecated
- public void getvehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure,
- boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID) throws SdlException
- {
- GetVehicleData msg = new GetVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setVin(vin);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
-
- /**
- * Performs a Non periodic vehicle data read request.
- * Responses are captured through callback on IProxyListener.
- *
- * @param gps -Performs an ad-hoc request for GPS data.
- * @param speed -Performs an ad-hoc request for vehicle speed data in kilometers per hour.
- * @param rpm -Performs an ad-hoc request for number of revolutions per minute of the engine.
- * @param fuelLevel -Performs an ad-hoc request for fuel level in the tank (percentage).
- * @param fuelLevel_State -Performs an ad-hoc request for fuel level state.
- * @param instantFuelConsumption -Performs an ad-hoc request for instantaneous fuel consumption in microlitres.
- * @param externalTemperature -Performs an ad-hoc request for the external temperature in degrees celsius.
- * @param vin -Performs an ad-hoc request for the Vehicle identification number
- * @param prndl -Performs an ad-hoc request for PRNDL data that houses the selected gear.
- * @param tirePressure -Performs an ad-hoc request for the TireStatus data containing status and pressure of tires.
- * @param engineOilLife -Performs an ad-hoc request for Engine Oil Life data.
- * @param odometer -Performs an ad-hoc request for Odometer data in km.
- * @param beltStatus -Performs an ad-hoc request for status of the seat belts.
- * @param bodyInformation -Performs an ad-hoc request for body information including power modes.
- * @param deviceStatus -Performs an ad-hoc request for device status including signal and battery strength.
- * @param driverBraking -Performs an ad-hoc request for the status of the brake pedal.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void getvehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,
- boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure,
- boolean engineOilLife, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,
- boolean driverBraking, Integer correlationID) throws SdlException
- {
- GetVehicleData msg = new GetVehicleData();
- msg.setGps(gps);
- msg.setSpeed(speed);
- msg.setRpm(rpm);
- msg.setFuelLevel(fuelLevel);
- msg.setFuelLevel_State(fuelLevel_State);
- msg.setInstantFuelConsumption(instantFuelConsumption);
- msg.setExternalTemperature(externalTemperature);
- msg.setVin(vin);
- msg.setPrndl(prndl);
- msg.setTirePressure(tirePressure);
- msg.setEngineOilLife(engineOilLife);
- msg.setOdometer(odometer);
- msg.setBeltStatus(beltStatus);
- msg.setBodyInformation(bodyInformation);
- msg.setDeviceStatus(deviceStatus);
- msg.setDriverBraking(driverBraking);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
-
- /**
- * Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined.
- * Responses are captured through callback on IProxyListener.
- *
- * @param scrollableMessageBody -Body of text that can include newlines and tabs.
- * @param timeout -App defined timeout. Indicates how long of a timeout from the last action.
- * @param softButtons -App defined SoftButtons.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void scrollablemessage(@NonNull String scrollableMessageBody, Integer timeout, Vector<SoftButton> softButtons, Integer correlationID) throws SdlException
- {
- ScrollableMessage msg = new ScrollableMessage(scrollableMessageBody);
- msg.setCorrelationID(correlationID);
- msg.setTimeout(timeout);
- msg.setSoftButtons(softButtons);
-
- sendRPCRequest(msg);
- }
-
-
- /**
- * Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.
- * Responses are captured through callback on IProxyListener.
- *
- * @param numTicks -Number of selectable items on a horizontal axis.
- * @param position -Initial position of slider control (cannot exceed numTicks).
- * @param sliderHeader -Text header to display.
- * @param sliderFooter - Text footer to display (meant to display min/max threshold descriptors).
- * @param timeout -App defined timeout. Indicates how long of a timeout from the last action.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void slider(@NonNull Integer numTicks, @NonNull Integer position, @NonNull String sliderHeader, Vector<String> sliderFooter, Integer timeout, Integer correlationID) throws SdlException
- {
- Slider msg = new Slider(numTicks, position, sliderHeader);
- msg.setCorrelationID(correlationID);
- msg.setSliderFooter(sliderFooter);
- msg.setTimeout(timeout);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Responses are captured through callback on IProxyListener.
- *
- * @param language requested SDL voice engine (VR+TTS) language registration
- * @param hmiDisplayLanguage request display language registration.
- * @param correlationID ID to be attached to the RPCRequest that correlates the RPCResponse
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void changeregistration(@NonNull Language language, @NonNull Language hmiDisplayLanguage, Integer correlationID) throws SdlException
- {
- ChangeRegistration msg = new ChangeRegistration(language, hmiDisplayLanguage);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile device.
- * Responses are captured through callback on IProxyListener.
- *
- * @param is - The input stream of byte data that putFileStream will read from
- * @param sdlFileName - The file reference name used by the putFile RPC.
- * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of the file.
- * A value greater than zero is used for resuming partial data chunks.
- * @param iLength - The total length of the file being sent.
- * @throws SdlException if an unrecoverable error is encountered
- * @see #putFileStream(InputStream, String, Long, Long)
- */
- @SuppressWarnings("unused")
- @Deprecated
- public void putFileStream(InputStream is, @NonNull String sdlFileName, Integer iOffset, Integer iLength) throws SdlException
- {
- PutFile msg = new PutFile(sdlFileName, FileType.BINARY);
- msg.setCorrelationID(10000);
- msg.setSystemFile(true);
- msg.setOffset(iOffset);
- msg.setLength(iLength);
-
- startRPCStream(is, msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile
- * device. Responses are captured through callback on IProxyListener.
- *
- * @param inputStream The input stream of byte data that will be read from.
- * @param fileName The SDL file reference name used by the RPC.
- * @param offset The data offset in bytes. A value of zero is used to
- * indicate data starting from the beginning of the file and a value greater
- * than zero is used for resuming partial data chunks.
- * @param length The total length of the file being sent.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void putFileStream(InputStream inputStream, @NonNull String fileName, Long offset, Long length) throws SdlException {
- PutFile msg = new PutFile(fileName, FileType.BINARY);
- msg.setCorrelationID(10000);
- msg.setSystemFile(true);
- msg.setOffset(offset);
- msg.setLength(length);
-
- startRPCStream(inputStream, msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile device.
- * Responses are captured through callback on IProxyListener.
- *
- * @param sdlFileName - The file reference name used by the putFile RPC.
- * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of a file.
- * A value greater than zero is used for resuming partial data chunks.
- * @param iLength - The total length of the file being sent.
- *
- * @return OutputStream - The output stream of byte data that is written to by the app developer
- * @throws SdlException if an unrecoverable error is encountered
- * @see #putFileStream(String, Long, Long)
- */
- @SuppressWarnings("unused")
- @Deprecated
- public OutputStream putFileStream(@NonNull String sdlFileName, Integer iOffset, Integer iLength) throws SdlException
- {
- PutFile msg = new PutFile(sdlFileName, FileType.BINARY);
- msg.setCorrelationID(10000);
- msg.setSystemFile(true);
- msg.setOffset(iOffset);
- msg.setLength(iLength);
-
- return startRPCStream(msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile
- * device. Responses are captured through callback on IProxyListener.
- *
- * @param fileName The SDL file reference name used by the RPC.
- * @param offset The data offset in bytes. A value of zero is used to
- * indicate data starting from the beginning of the file and a value greater
- * than zero is used for resuming partial data chunks.
- * @param length The total length of the file being sent.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public OutputStream putFileStream(@NonNull String fileName, Long offset, Long length) throws SdlException {
- PutFile msg = new PutFile(fileName, FileType.BINARY);
- msg.setCorrelationID(10000);
- msg.setSystemFile(true);
- msg.setOffset(offset);
- msg.setLength(length);
-
- return startRPCStream(msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile device.
- * Responses are captured through callback on IProxyListener.
- *
- * @param is - The input stream of byte data that PutFileStream will read from
- * @param sdlFileName - The file reference name used by the putFile RPC.
- * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of the file.
- * A value greater than zero is used for resuming partial data chunks.
- * @param iLength - The total length of the file being sent.
- * @param fileType - The selected file type -- see the FileType enumeration for details
- * @param bPersistentFile - Indicates if the file is meant to persist between sessions / ignition cycles.
- * @param bSystemFile - Indicates if the file is meant to be passed thru core to elsewhere on the system.
- * @throws SdlException if an unrecoverable error is encountered
- * @see #putFileStream(InputStream, String, Long, Long, FileType, Boolean, Boolean, OnPutFileUpdateListener)
- */
- @SuppressWarnings("unused")
- @Deprecated
- public void putFileStream(InputStream is, @NonNull String sdlFileName, Integer iOffset, Integer iLength, @NonNull FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) throws SdlException
- {
- PutFile msg = new PutFile(sdlFileName, fileType);
- msg.setCorrelationID(10000);
- msg.setPersistentFile(bPersistentFile);
- msg.setSystemFile(bSystemFile);
- msg.setOffset(iOffset);
- msg.setLength(iLength);
-
- startRPCStream(is, msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile
- * device. Responses are captured through callback on IProxyListener.
- *
- * @param inputStream The input stream of byte data that will be read from.
- * @param fileName The SDL file reference name used by the RPC.
- * @param offset The data offset in bytes. A value of zero is used to
- * indicate data starting from the beginning of the file and a value greater
- * than zero is used for resuming partial data chunks.
- * @param length The total length of the file being sent.
- * @param fileType The selected file type. See the {@link FileType} enum for
- * details.
- * @param isPersistentFile Indicates if the file is meant to persist between
- * sessions / ignition cycles.
- * @param isSystemFile Indicates if the file is meant to be passed through
- * core to elsewhere in the system.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void putFileStream(InputStream inputStream, @NonNull String fileName, Long offset, Long length, FileType fileType, Boolean isPersistentFile, Boolean isSystemFile, OnPutFileUpdateListener cb) throws SdlException {
- PutFile msg = new PutFile(fileName, FileType.BINARY);
- msg.setCorrelationID(10000);
- msg.setSystemFile(true);
- msg.setOffset(offset);
- msg.setLength(length);
- msg.setOnPutFileUpdateListener(cb);
- startRPCStream(inputStream, msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile device.
- * Responses are captured through callback on IProxyListener.
- *
- * @param sdlFileName - The file reference name used by the putFile RPC.
- * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of a file.
- * A value greater than zero is used for resuming partial data chunks.
- * @param iLength - The total length of the file being sent.
- * @param fileType - The selected file type -- see the FileType enumeration for details
- * @param bPersistentFile - Indicates if the file is meant to persist between sessions / ignition cycles.
- * @param bSystemFile - Indicates if the file is meant to be passed thru core to elsewhere on the system.
- * @return OutputStream - The output stream of byte data that is written to by the app developer
- * @throws SdlException if an unrecoverable error is encountered
- * @see #putFileStream(String, Long, Long, FileType, Boolean, Boolean, OnPutFileUpdateListener)
- */
- @SuppressWarnings("unused")
- @Deprecated
- public OutputStream putFileStream(@NonNull String sdlFileName, Integer iOffset, Integer iLength, @NonNull FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) throws SdlException
- {
- PutFile msg = new PutFile(sdlFileName, fileType);
- msg.setCorrelationID(10000);
- msg.setPersistentFile(bPersistentFile);
- msg.setSystemFile(bSystemFile);
- msg.setOffset(iOffset);
- msg.setLength(iLength);
-
- return startRPCStream(msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile
- * device. Responses are captured through callback on IProxyListener.
- *
- * @param fileName The SDL file reference name used by the RPC.
- * @param offset The data offset in bytes. A value of zero is used to
- * indicate data starting from the beginning of the file and a value greater
- * than zero is used for resuming partial data chunks.
- * @param length The total length of the file being sent.
- * @param fileType The selected file type. See the {@link FileType} enum for
- * details.
- * @param isPersistentFile Indicates if the file is meant to persist between
- * sessions / ignition cycles.
- * @param isSystemFile Indicates if the file is meant to be passed through
- * core to elsewhere in the system.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public OutputStream putFileStream(@NonNull String fileName, Long offset, Long length, FileType fileType, Boolean isPersistentFile, Boolean isSystemFile, OnPutFileUpdateListener cb) throws SdlException {
- PutFile msg = new PutFile(fileName, FileType.BINARY);
- msg.setCorrelationID(10000);
- msg.setSystemFile(true);
- msg.setOffset(offset);
- msg.setLength(length);
- msg.setOnPutFileUpdateListener(cb);
-
- return startRPCStream(msg);
- }
-
- /**
- * Used to push a stream of putfile RPC's containing binary data from a mobile device to the module.
- * Responses are captured through callback on IProxyListener.
- *
- * @param sPath - The physical file path on the mobile device.
- * @param sdlFileName - The file reference name used by the putFile RPC.
- * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of a file.
- * A value greater than zero is used for resuming partial data chunks.
- * @param fileType - The selected file type -- see the FileType enumeration for details
- * @param bPersistentFile - Indicates if the file is meant to persist between sessions / ignition cycles.
- * @param bSystemFile - Indicates if the file is meant to be passed thru core to elsewhere on the system.
- * @param iCorrelationID - A unique ID that correlates each RPCRequest and RPCResponse.
- * @return RPCStreamController - If the putFileStream was not started successfully null is returned, otherwise a valid object reference is returned
- * @throws SdlException if an unrecoverable error is encountered
- * @see #putFileStream(String, String, Long, FileType, Boolean, Boolean, Boolean, Integer, OnPutFileUpdateListener)
- */
- @SuppressWarnings("unused")
- @Deprecated
- public RPCStreamController putFileStream(String sPath, @NonNull String sdlFileName, Integer iOffset, @NonNull FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Integer iCorrelationID) throws SdlException
- {
- PutFile msg = new PutFile(sdlFileName, fileType);
- msg.setCorrelationID(iCorrelationID);
- msg.setPersistentFile(bPersistentFile);
- msg.setSystemFile(bSystemFile);
- msg.setOffset(iOffset);
- msg.setLength(0);
-
- return startPutFileStream(sPath, msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile
- * device. Responses are captured through callback on IProxyListener.
- *
- * @param path The physical file path on the mobile device.
- * @param fileName The SDL file reference name used by the RPC.
- * @param offset The data offset in bytes. A value of zero is used to
- * indicate data starting from the beginning of the file and a value greater
- * than zero is used for resuming partial data chunks.
- * @param fileType The selected file type. See the {@link FileType} enum for
- * details.
- * @param isPersistentFile Indicates if the file is meant to persist between
- * sessions / ignition cycles.
- * @param isSystemFile Indicates if the file is meant to be passed through
- * core to elsewhere in the system.
- * @param correlationId A unique id that correlates each RPCRequest and
- * RPCResponse.
- * @return RPCStreamController If the putFileStream was not started
- * successfully null is returned, otherwise a valid object reference is
- * returned .
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public RPCStreamController putFileStream(String path, @NonNull String fileName, Long offset, @NonNull FileType fileType, Boolean isPersistentFile, Boolean isSystemFile, Boolean isPayloadProtected, Integer correlationId, OnPutFileUpdateListener cb ) throws SdlException {
- PutFile msg = new PutFile(fileName, fileType);
- msg.setCorrelationID(correlationId);
- msg.setPersistentFile(isPersistentFile);
- msg.setSystemFile(isSystemFile);
- msg.setOffset(offset);
- msg.setLength(0L);
- msg.setPayloadProtected(isPayloadProtected);
- msg.setOnPutFileUpdateListener(cb);
-
- return startPutFileStream(path,msg);
- }
-
- /**
- * Used to push a stream of putfile RPC's containing binary data from a mobile device to the module.
- * Responses are captured through callback on IProxyListener.
- *
- * @param is - The input stream of byte data that putFileStream will read from.
- * @param sdlFileName - The file reference name used by the putFile RPC.
- * @param iOffset - The data offset in bytes, a value of zero is used to indicate data starting from the beginging of a file.
- * A value greater than zero is used for resuming partial data chunks.
- * @param fileType - The selected file type -- see the FileType enumeration for details
- * @param bPersistentFile - Indicates if the file is meant to persist between sessions / ignition cycles.
- * @param bSystemFile - Indicates if the file is meant to be passed thru core to elsewhere on the system.
- * @param iCorrelationID - A unique ID that correlates each RPCRequest and RPCResponse.
- * @return RPCStreamController - If the putFileStream was not started successfully null is returned, otherwise a valid object reference is returned
- * @throws SdlException if an unrecoverable error is encountered
- * @see #putFileStream(InputStream, String, Long, Long, FileType, Boolean, Boolean, Boolean, Integer)
- */
- @SuppressWarnings("unused")
- @Deprecated
- public RPCStreamController putFileStream(InputStream is, @NonNull String sdlFileName, Integer iOffset, Integer iLength, @NonNull FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Integer iCorrelationID) throws SdlException
- {
- PutFile msg = new PutFile(sdlFileName, fileType);
- msg.setCorrelationID(iCorrelationID);
- msg.setPersistentFile(bPersistentFile);
- msg.setSystemFile(bSystemFile);
- msg.setOffset(iOffset);
- msg.setLength(iLength);
-
- return startPutFileStream(is, msg);
- }
-
- /**
- * Used to push a binary stream of file data onto the module from a mobile
- * device. Responses are captured through callback on IProxyListener.
- *
- * @param inputStream The input stream of byte data that will be read from.
- * @param fileName The SDL file reference name used by the RPC.
- * @param offset The data offset in bytes. A value of zero is used to
- * indicate data starting from the beginning of the file and a value greater
- * than zero is used for resuming partial data chunks.
- * @param length The total length of the file being sent.
- * @param fileType The selected file type. See the {@link FileType} enum for
- * details.
- * @param isPersistentFile Indicates if the file is meant to persist between
- * sessions / ignition cycles.
- * @param isSystemFile Indicates if the file is meant to be passed through
- * core to elsewhere in the system.
- * @param correlationId A unique id that correlates each RPCRequest and
- * RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public RPCStreamController putFileStream(InputStream inputStream, @NonNull String fileName, Long offset, Long length, @NonNull FileType fileType, Boolean isPersistentFile, Boolean isSystemFile, Boolean isPayloadProtected, Integer correlationId) throws SdlException {
- PutFile msg = new PutFile(fileName, fileType);
- msg.setCorrelationID(correlationId);
- msg.setPersistentFile(isPersistentFile);
- msg.setSystemFile(isSystemFile);
- msg.setOffset(offset);
- msg.setLength(length);
- msg.setPayloadProtected(isPayloadProtected);
-
- return startPutFileStream(inputStream, msg);
- }
-
- /**
- *
- * Used to end an existing putFileStream that was previously initiated with any putFileStream method.
- *
- */
- @SuppressWarnings("unused")
- public void endPutFileStream()
- {
- endRPCStream();
- }
-
-
- /**
- * Used to push a binary data onto the SDL module from a mobile device, such as icons and album art. Not supported on first generation SDL vehicles.
- * Responses are captured through callback on IProxyListener.
- *
- * @param sdlFileName -File reference name.
- * @param fileType -Selected file type.
- * @param persistentFile -Indicates if the file is meant to persist between sessions / ignition cycles.
- * @param fileData byte array of data of the file that is to be sent
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void putfile(@NonNull String sdlFileName, @NonNull FileType fileType, Boolean persistentFile, byte[] fileData, Integer correlationID) throws SdlException
- {
- PutFile msg = new PutFile(sdlFileName, fileType);
- msg.setCorrelationID(correlationID);
- msg.setPersistentFile(persistentFile);
- msg.setBulkData(fileData);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Used to delete a file resident on the SDL module in the app's local cache. Not supported on first generation SDL vehicles.
- * Responses are captured through callback on IProxyListener.
- *
- * @param sdlFileName -File reference name.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void deletefile(@NonNull String sdlFileName, Integer correlationID) throws SdlException
- {
- DeleteFile msg = new DeleteFile(sdlFileName);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Requests the current list of resident filenames for the registered app. Not supported on first generation SDL vehicles.
- * Responses are captured through callback on IProxyListener.
- *
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void listfiles(Integer correlationID) throws SdlException
- {
- ListFiles msg = new ListFiles();
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Used to set existing local file on SDL as the app's icon. Not supported on first generation SDL vehicles.
- * Responses are captured through callback on IProxyListener.
- *
- * @param sdlFileName -File reference name.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void setappicon(@NonNull String sdlFileName, Integer correlationID) throws SdlException
- {
- SetAppIcon msg = new SetAppIcon(sdlFileName);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Set an alternate display layout. If not sent, default screen for given platform will be shown.
- * Responses are captured through callback on IProxyListener.
- *
- * @param displayLayout -Predefined or dynamically created screen layout.
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void setdisplaylayout(@NonNull String displayLayout, Integer correlationID) throws SdlException
- {
- SetDisplayLayout msg = new SetDisplayLayout(displayLayout);
- msg.setCorrelationID(correlationID);
-
- sendRPCRequest(msg);
- }
-
- /**
- * Set an alternate display layout. If not sent, default screen for given platform will be shown.
- * Responses are captured through callback on IProxyListener.
- *
- * @param displayLayout -Predefined or dynamically created screen layout.
- * @param dayColorScheme a TemplateColorScheme object representing the colors that will be used for day color scheme
- * @param nightColorScheme a TemplateColorScheme object representing the colors that will be used for night color scheme
- * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.
- * @throws SdlException if an unrecoverable error is encountered
- */
- @SuppressWarnings("unused")
- public void setdisplaylayout(String displayLayout, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme, Integer correlationID) throws SdlException
- {
- SetDisplayLayout msg = new SetDisplayLayout(displayLayout);
- msg.setCorrelationID(correlationID);
- msg.setDayColorScheme(dayColorScheme);
- msg.setNightColorScheme(nightColorScheme);
- 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);
- }
-
- @SuppressWarnings("unused")
- public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener){
- if(_systemCapabilityManager != null){
- _systemCapabilityManager.getCapability(systemCapabilityType, scListener);
- }
- }
-
- @SuppressWarnings("unused")
- public Object getCapability(SystemCapabilityType systemCapabilityType){
- if(_systemCapabilityManager != null ){
- return _systemCapabilityManager.getCapability(systemCapabilityType);
- }else{
- return null;
- }
- }
-
- /**
- * 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 *************************/
-
- /**
- * Gets type of transport currently used by this SdlProxy.
- *
- * @return One of TransportType enumeration values.
- *
- * @see TransportType
- */
- @SuppressWarnings("unused")
- public TransportType getCurrentTransportType() throws IllegalStateException {
- if (sdlSession == null) {
- throw new IllegalStateException("Incorrect state of SdlProxyBase: Calling for getCurrentTransportType() while connection is not initialized");
- }
-
- return sdlSession.getCurrentTransportType();
- }
-
- public void setSdlSecurityClassList(List<Class<? extends SdlSecurityBase>> list) {
- _secList = list;
- }
-
- private void setSdlSecurity(SdlSecurityBase sec) {
- if (sdlSession != null)
- {
- sdlSession.setSdlSecurity(sec);
- }
- }
-
- @SuppressWarnings("unused")
- public boolean isServiceTypeProtected(SessionType sType) {
- return sdlSession != null && sdlSession.isServiceProtected(sType);
-
- }
-
-
- public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
- if(serviceType != null && sdlSession != null && sdlServiceListener != null){
- sdlSession.addServiceListener(serviceType, sdlServiceListener);
- }
- }
-
- public void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener){
- if(serviceType != null && sdlSession != null && sdlServiceListener != null){
- sdlSession.removeServiceListener(serviceType, sdlServiceListener);
- }
- }
-
- @SuppressWarnings("unused")
- public VideoStreamingParameters getAcceptedVideoParams(){
- return sdlSession.getAcceptedVideoParams();
- }
-
- public IProxyListenerBase getProxyListener()
- {
- return _proxyListener;
- }
-
- @SuppressWarnings("unused")
- public String getAppName()
- {
- return _applicationName;
- }
-
- @SuppressWarnings("unused")
- public String getNgnAppName()
- {
- return _ngnMediaScreenAppName;
- }
-
- @SuppressWarnings("unused")
- public String getAppID()
- {
- return _appID;
- }
- @SuppressWarnings("unused")
- public DeviceInfo getDeviceInfo()
- {
- return deviceInfo;
- }
- @SuppressWarnings("unused")
- public long getInstanceDT()
- {
- return instanceDateTime;
- }
- @SuppressWarnings("unused")
- public void setConnectionDetails(String sDetails)
- {
- sConnectionDetails = sDetails;
- }
- @SuppressWarnings("unused")
- public String getConnectionDetails()
- {
- return sConnectionDetails;
- }
- //for testing only
- @SuppressWarnings("unused")
- public void setPoliciesURL(String sText)
- {
- sPoliciesURL = sText;
- }
- //for testing only
- public String getPoliciesURL()
- {
- return sPoliciesURL;
- }
-
- /**
- * Tells developer whether or not their app icon has been resumed on core.
- * @return boolean - true if icon was resumed, false if not
- * @throws SdlException if proxy is disposed or app is not registered
- */
- public boolean getIconResumed() throws SdlException {
- // Test if proxy has been disposed
- if (_proxyDisposed) {
- throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
- }
-
- // Test SDL availability
- if (!_appInterfaceRegisterd) {
- throw new SdlException("SDL is not connected. Unable to determine if app icon was resumed.", SdlExceptionCause.SDL_UNAVAILABLE);
- }
- return _iconResumed;
- }
-
-
- /**
- * VideoStreamingManager houses all the elements needed to create a scoped, streaming manager for video projection. It is only a private, instance
- * dependant class at the moment until it can become public. Once the class is public and API defined, it will be moved into the SdlSession class
- */
- @TargetApi(19)
- private class VideoStreamingManager implements ISdlServiceListener{
- Context context;
- ISdl internalInterface;
- volatile VirtualDisplayEncoder encoder;
- private Class<? extends SdlRemoteDisplay> remoteDisplayClass = null;
- SdlRemoteDisplay remoteDisplay;
- IVideoStreamListener streamListener;
- float[] touchScalar = {1.0f,1.0f}; //x, y
- private HapticInterfaceManager hapticManager;
- SdlMotionEvent sdlMotionEvent = null;
-
- public VideoStreamingManager(Context context,ISdl iSdl){
- this.context = context;
- this.internalInterface = iSdl;
- encoder = new VirtualDisplayEncoder();
- internalInterface.addServiceListener(SessionType.NAV,this);
- //Take care of the touch events
- internalInterface.addOnRPCNotificationListener(FunctionID.ON_TOUCH_EVENT, new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- if(notification !=null && remoteDisplay != null){
- MotionEvent event = convertTouchEvent((OnTouchEvent)notification);
- if(event!=null){
- remoteDisplay.handleMotionEvent(event);
- }
- }
- }
- });
- }
-
- public void startVideoStreaming(Class<? extends SdlRemoteDisplay> remoteDisplayClass, VideoStreamingParameters parameters, boolean encrypted){
- streamListener = startVideoStream(encrypted,parameters);
- if(streamListener == null){
- Log.e(TAG, "Error starting video service");
- return;
- }
- VideoStreamingCapability capability = (VideoStreamingCapability)_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING);
- if(capability != null && capability.getIsHapticSpatialDataSupported()){
- hapticManager = new HapticInterfaceManager(internalInterface);
- }
- this.remoteDisplayClass = remoteDisplayClass;
- try {
- encoder.init(context,streamListener,parameters);
- //We are all set so we can start streaming at at this point
- encoder.start();
- //Encoder should be up and running
- createRemoteDisplay(encoder.getVirtualDisplay());
- } catch (Exception e) {
- e.printStackTrace();
- }
- Log.d(TAG, parameters.toString());
- }
-
- public void stopStreaming(){
- if(remoteDisplay!=null){
- remoteDisplay.stop();
- remoteDisplay = null;
- }
- if(encoder!=null){
- encoder.shutDown();
- }
- if(internalInterface!=null){
- internalInterface.stopVideoService();
- }
- }
-
- public void dispose(){
- stopStreaming();
- internalInterface.removeServiceListener(SessionType.NAV,this);
- }
-
- 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, 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
- SdlProxyBase.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(protocolVersion!= null && protocolVersion.getMajor()>=5){ //At this point we should already have the capability
- VideoStreamingCapability capability = (VideoStreamingCapability)_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING);
- if (capability != null) {
- resolution = capability.getPreferredResolution();
- }
- }
-
- if(resolution == null){ //Either the protocol version is too low to access video streaming caps, or they were null
- 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.");
- }
- }
-
- @Override
- public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
-
-
- }
-
- @Override
- public void onServiceEnded(SdlSession session, SessionType type) {
- if(SessionType.NAV.equals(type)){
- if(remoteDisplay!=null){
- stopStreaming();
- }
- }
- }
-
- @Override
- public void onServiceError(SdlSession session, SessionType type, String reason) {
-
- }
-
- private 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);
- }
-
- }
- }
- }
- }
-} // end-class
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java
deleted file mode 100644
index 42e2fbbc2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java
+++ /dev/null
@@ -1,192 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import java.util.List;
-import java.util.Vector;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.proxy.interfaces.IProxyListenerALM;
-import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
-import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.security.SdlSecurityBase;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-
-import android.app.Service;
-import android.content.Context;
-
-public class SdlProxyBuilder {
- // Required parameters
- private IProxyListenerALM listener;
- private String appId;
- private String appName;
- private Boolean isMediaApp;
- private Context context;
- private BaseTransportConfig mTransport;
-
- // Optional parameters
- private Service service;
- private SdlProxyConfigurationResources sdlProxyConfigurationResources;
- private Vector<TTSChunk> ttsChunks;
- private String sShortAppName;
- private Vector<String> vrSynonyms;
- private SdlMsgVersion sdlMessageVersion;
- private Language lang;
- private Language hmiLang;
- private Vector<AppHMIType> vrAppHMITypes;
- private String autoActivateID;
- private boolean callbackToUIThread;
- private boolean preRegister;
- private String sAppResumeHash;
- private List<Class<? extends SdlSecurityBase>> sdlSecList;
- private TemplateColorScheme dayColorScheme, nightColorScheme;
-
- private SdlProxyBuilder() {
- service = null;
- sdlProxyConfigurationResources = null;
- ttsChunks = null;
- sShortAppName = null;
- vrSynonyms = null;
- sdlMessageVersion = null;
- lang = Language.EN_US;
- hmiLang = Language.EN_US;
- vrAppHMITypes = null;
- autoActivateID = null;
- callbackToUIThread = false;
- preRegister = false;
- sAppResumeHash = null;
- sdlSecList = null;
- dayColorScheme = null;
- nightColorScheme = null;
-}
-
- public static class Builder {
- SdlProxyBuilder sdlProxyBuilder;
-
- /**
- * @deprecated Use Builder(IProxyListenerALM, String, String, Boolean, Context) instead
- */
- @Deprecated
- public Builder(IProxyListenerALM listener, String appId, String appName, Boolean isMediaApp) {
- sdlProxyBuilder = new SdlProxyBuilder();
- sdlProxyBuilder.listener = listener;
- sdlProxyBuilder.appId = appId;
- sdlProxyBuilder.appName = appName;
- sdlProxyBuilder.isMediaApp = isMediaApp;
- sdlProxyBuilder.mTransport = new BTTransportConfig();
- }
-
- public Builder(IProxyListenerALM listener, String appId, String appName, Boolean isMediaApp, Context context) {
- sdlProxyBuilder = new SdlProxyBuilder();
- sdlProxyBuilder.listener = listener;
- sdlProxyBuilder.appId = appId;
- sdlProxyBuilder.appName = appName;
- sdlProxyBuilder.isMediaApp = isMediaApp;
- sdlProxyBuilder.context = context;
- sdlProxyBuilder.mTransport = new MultiplexTransportConfig(context, appId);
- }
-
- public Builder setService(Service val) {
- sdlProxyBuilder.service = val;
- return this;
- }
-
- public Builder setSdlProxyConfigurationResources(SdlProxyConfigurationResources val) {
- sdlProxyBuilder.sdlProxyConfigurationResources = val;
- return this;
- }
-
- public Builder setTtsName(Vector<TTSChunk> val) {
- sdlProxyBuilder.ttsChunks = val;
- return this;
- }
-
- public Builder setShortAppName(String val) {
- sdlProxyBuilder.sShortAppName = val;
- return this;
- }
-
- public Builder setVrSynonyms(Vector<String> val) {
- sdlProxyBuilder.vrSynonyms = val;
- return this;
- }
-
- public Builder setSdlMessageVersion(SdlMsgVersion val) {
- sdlProxyBuilder.sdlMessageVersion = val;
- return this;
- }
-
- public Builder setLangDesired(Language val) {
- sdlProxyBuilder.lang = val;
- return this;
- }
-
- public Builder setHMILangDesired(Language val) {
- sdlProxyBuilder.hmiLang = val;
- return this;
- }
-
- public Builder setVrAppHMITypes(Vector<AppHMIType> val) {
- sdlProxyBuilder.vrAppHMITypes = val;
- return this;
- }
-
- public Builder setAutoActivateID(String val) {
- sdlProxyBuilder.autoActivateID = val;
- return this;
- }
-
- public Builder setCallbackToUIThread(boolean val) {
- sdlProxyBuilder.callbackToUIThread = val;
- return this;
- }
-
- public Builder setPreRegister(boolean val) {
- sdlProxyBuilder.preRegister = val;
- return this;
- }
-
- public Builder setAppResumeDataHash(String val) {
- sdlProxyBuilder.sAppResumeHash = val;
- return this;
- }
-
- public Builder setTransportType(BaseTransportConfig val) {
- sdlProxyBuilder.mTransport = val;
- return this;
- }
-
- public Builder setSdlSecurity(List<Class<? extends SdlSecurityBase>> val) {
- sdlProxyBuilder.sdlSecList = val;
- return this;
- }
- public Builder setDayColorScheme(TemplateColorScheme val) {
- sdlProxyBuilder.dayColorScheme = val;
- return this;
- }
-
- public Builder setNightColorScheme(TemplateColorScheme val) {
- sdlProxyBuilder.nightColorScheme = val;
- return this;
- }
-
- public SdlProxyALM build() throws SdlException {
- SdlProxyALM proxy = new SdlProxyALM(sdlProxyBuilder.service, sdlProxyBuilder.listener,
- sdlProxyBuilder.sdlProxyConfigurationResources, sdlProxyBuilder.appName,
- sdlProxyBuilder.ttsChunks, sdlProxyBuilder.sShortAppName, sdlProxyBuilder.vrSynonyms,
- sdlProxyBuilder.isMediaApp, sdlProxyBuilder.sdlMessageVersion, sdlProxyBuilder.lang,
- sdlProxyBuilder.hmiLang, sdlProxyBuilder.vrAppHMITypes, sdlProxyBuilder.appId,
- sdlProxyBuilder.autoActivateID, sdlProxyBuilder.dayColorScheme, sdlProxyBuilder.nightColorScheme,
- sdlProxyBuilder.callbackToUIThread, sdlProxyBuilder.preRegister,
- sdlProxyBuilder.sAppResumeHash, sdlProxyBuilder.mTransport);
- proxy.setSdlSecurityClassList(sdlProxyBuilder.sdlSecList);
- return proxy;
- }
- }
-}
-
-
-
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java
deleted file mode 100644
index d875b59ce..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import android.telephony.TelephonyManager;
-
-public class SdlProxyConfigurationResources {
- private String _sdlConfigurationFilePath;
- private TelephonyManager _telephonyManager;
-
- public SdlProxyConfigurationResources() {
- this(null, null);
- }
-
- public SdlProxyConfigurationResources(String sdlConfigurationFilePath,
- TelephonyManager telephonyManager) {
- _sdlConfigurationFilePath = sdlConfigurationFilePath;
- _telephonyManager = telephonyManager;
- }
-
- public void setSdlConfigurationFilePath(String sdlConfigurationFilePath) {
- _sdlConfigurationFilePath = sdlConfigurationFilePath;
- }
-
- public String getSdlConfigurationFilePath() {
- return _sdlConfigurationFilePath;
- }
-
- public void setTelephonyManager(TelephonyManager telephonyManager) {
- _telephonyManager = telephonyManager;
- }
-
- public TelephonyManager getTelephonyManager() {
- return _telephonyManager;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
deleted file mode 100644
index 291d02a8f..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
-import com.smartdevicelink.proxy.rpc.GetSystemCapability;
-import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
-import com.smartdevicelink.proxy.rpc.HMICapabilities;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
-import com.smartdevicelink.util.CorrelationIdGenerator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-public class SystemCapabilityManager {
- 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()) {
- 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());
- }
- }
-
- /**
- * Sets a capability in the cached map. This should only be done when an RPC is received and contains updates to the capability
- * that is being cached in the SystemCapabilityManager.
- * @param systemCapabilityType
- * @param 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);
- }
- }
- }
- }
-
- /**
- * Ability to see if the connected module supports the given capability. Useful to check before
- * attempting to query for capabilities that require asynchronous calls to initialize.
- * @param type the SystemCapabilityType that is to be checked
- * @return if that capability is supported with the current, connected module
- */
- public boolean isCapabilitySupported(SystemCapabilityType 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));
- switch (type) {
- case NAVIGATION:
- return hmiCapabilities.isNavigationAvailable();
- case PHONE_CALL:
- return hmiCapabilities.isPhoneCallAvailable();
- case VIDEO_STREAMING:
- return hmiCapabilities.isVideoStreamingAvailable();
- case REMOTE_CONTROL:
- return hmiCapabilities.isRemoteControlAvailable();
- default:
- return false;
- }
- }else{
- return false;
- }
- }
- /**
- * @param systemCapabilityType Type of capability desired
- * @param scListener callback to execute upon retrieving capability
- */
- public void getCapability(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener scListener){
- Object capability = cachedSystemCapabilities.get(systemCapabilityType);
- if(capability != null){
- scListener.onCapabilityRetrieved(capability);
- return;
- }else if(scListener == null){
- return;
- }
-
- retrieveCapability(systemCapabilityType, scListener);
- }
-
- /**
- * @param systemCapabilityType Type of capability desired
- * @return Desired capability if it is cached in the manager, otherwise returns a null object
- * and works in the background to retrieve the capability for the next call
- */
- public Object getCapability(final SystemCapabilityType systemCapabilityType){
- Object capability = cachedSystemCapabilities.get(systemCapabilityType);
- if(capability != null){
- return capability;
- }
-
- retrieveCapability(systemCapabilityType, null);
- return null;
- }
-
- /**
- * 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
- */
- private void retrieveCapability(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener scListener){
- final GetSystemCapability request = new GetSystemCapability();
- request.setSystemCapabilityType(systemCapabilityType);
- request.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if(response.getSuccess()){
- Object retrievedCapability = ((GetSystemCapabilityResponse) response).getSystemCapability().getCapabilityForType(systemCapabilityType);
- cachedSystemCapabilities.put(systemCapabilityType, retrievedCapability);
- if(scListener!=null){scListener.onCapabilityRetrieved(retrievedCapability); }
- }else{
- if(scListener!=null){scListener.onError(response.getInfo());}
- }
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- if(scListener!=null){scListener.onError(info);}
- }
- });
- request.setCorrelationID(CorrelationIdGenerator.generateId());
-
- if(callback!=null){
- callback.sendRPCRequest(request);
- }
- }
-
- /**
- * Converts a capability object into a list.
- * @param object the capability that needs to be converted
- * @param classType The class type of that should be contained in the list
- * @return a List of capabilities if object is instance of List, otherwise it will return null.
- */
- @SuppressWarnings({"unchecked"})
- public static <T> List<T> convertToList(Object object, Class<T> classType){
- if(classType!=null && object!=null && object instanceof List ){
- List list = (List)object;
- if(!list.isEmpty()){
- if(classType.isInstance(list.get(0))){
- return (List<T>)object;
- }else{
- //The list is not of the correct list type
- return null;
- }
- }else {
- //We return a new list of type T instead of null because while we don't know if
- //the original list was of type T we want to ensure that we don't throw a cast class exception
- //but still
- return new ArrayList<T>();
- }
- }else{
- return null;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
deleted file mode 100644
index b8b847261..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import java.util.Vector;
-
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-
-public class TTSChunkFactory {
-
- public static TTSChunk createChunk(SpeechCapabilities type, String text) {
- TTSChunk ret = new TTSChunk();
- ret.setType(type);
- ret.setText(text);
- return ret;
- }
-
- public static Vector<TTSChunk> createSimpleTTSChunks(String simple) {
- if (simple == null) {
- return null;
- }
-
- Vector<TTSChunk> chunks = new Vector<TTSChunk>();
-
- TTSChunk chunk = createChunk(SpeechCapabilities.TEXT, simple);
- chunks.add(chunk);
- return chunks;
- }
-
- public static Vector<TTSChunk> createPrerecordedTTSChunks(String prerecorded) {
- if (prerecorded == null) {
- return null;
- }
-
- Vector<TTSChunk> chunks = new Vector<TTSChunk>();
- TTSChunk chunk = createChunk(SpeechCapabilities.PRE_RECORDED, prerecorded);
- chunks.add(chunk);
- return chunks;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java
deleted file mode 100644
index d49d979fe..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.smartdevicelink.proxy;
-
-import com.smartdevicelink.BuildConfig;
-
-public class Version {
- public static final String VERSION = BuildConfig.VERSION_NAME;
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java
deleted file mode 100644
index dc03f5c72..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.smartdevicelink.proxy.callbacks;
-
-public class InternalProxyMessage {
- private String _functionName;
- public static final String OnProxyError = "OnProxyError";
- public static final String OnProxyOpened = "OnProxyOpened";
- public static final String OnProxyClosed = "OnProxyClosed";
- public static final String OnServiceEnded = "OnServiceEnded";
- public static final String OnServiceNACKed = "OnServiceNACKed";
-
- public InternalProxyMessage(String functionName) {
- //this(functionName, null, null);
- this._functionName = functionName;
- }
-
- public String getFunctionName() {
- return _functionName;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java
deleted file mode 100644
index 0323afa15..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.smartdevicelink.proxy.callbacks;
-
-public class OnError extends InternalProxyMessage {
-
- private String _info;
- private Exception _e;
-
- public OnError() {
- super(InternalProxyMessage.OnProxyError);
- }
-
- public OnError(String info, Exception e) {
- super(InternalProxyMessage.OnProxyError);
- this._info = info;
- this._e = e;
- }
-
- public String getInfo() {
- return _info;
- }
-
- public Exception getException() {
- return _e;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java
deleted file mode 100644
index 9a32c4a8d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.smartdevicelink.proxy.callbacks;
-
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
-
-public class OnProxyClosed extends InternalProxyMessage {
-
- private String _info;
- private Exception _e;
- private SdlDisconnectedReason _reason;
-
- public OnProxyClosed() {
- super(InternalProxyMessage.OnProxyClosed);
- }
-
- public OnProxyClosed(String info, Exception e, SdlDisconnectedReason reason) {
- super(InternalProxyMessage.OnProxyClosed);
- this._info = info;
- this._e = e;
- this._reason = reason;
- }
-
- public String getInfo() {
- return _info;
- }
-
- public SdlDisconnectedReason getReason() {
- return _reason;
- }
-
- public Exception getException() {
- return _e;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java
deleted file mode 100644
index 1fa9c19eb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.smartdevicelink.proxy.callbacks;
-
-public class OnProxyOpened extends InternalProxyMessage {
-
- public OnProxyOpened() {
- super(InternalProxyMessage.OnProxyOpened);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java
deleted file mode 100644
index d69802e0f..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.smartdevicelink.proxy.callbacks;
-
-import com.smartdevicelink.protocol.enums.SessionType;
-
-public class OnServiceEnded extends InternalProxyMessage {
- private SessionType sessionType;
-
- public OnServiceEnded() {
- super(InternalProxyMessage.OnServiceEnded);
- }
-
- public OnServiceEnded(SessionType sessionType) {
- super(InternalProxyMessage.OnServiceEnded);
- this.sessionType = sessionType;
- }
-
- public SessionType getSessionType() {
- return this.sessionType;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java
deleted file mode 100644
index 9eae5e4c4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.smartdevicelink.proxy.callbacks;
-
-import com.smartdevicelink.protocol.enums.SessionType;
-
-public class OnServiceNACKed extends InternalProxyMessage {
- private SessionType sessionType;
-
- public OnServiceNACKed() {
- super(InternalProxyMessage.OnServiceNACKed);
- }
-
- public OnServiceNACKed(SessionType sessionType) {
- super(InternalProxyMessage.OnServiceNACKed);
- this.sessionType = sessionType;
- }
-
- public SessionType getSessionType() {
- return this.sessionType;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java
deleted file mode 100644
index b029e55e8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.smartdevicelink.proxy.constants;
-
-@Deprecated
-public class Jingles {
- public static final String POSITIVE_JINGLE = "POSITIVE_JINGLE";
-
- public static final String NEGATIVE_JINGLE = "NEGATIVE_JINGLE";
-
- public static final String INITIAL_JINGLE = "INITIAL_JINGLE";
-
- public static final String LISTEN_JINGLE = "LISTEN_JINGLE";
-
- public static final String HELP_JINGLE = "HELP_JINGLE";
-
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/constants/Names.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/constants/Names.java
deleted file mode 100644
index 26729e997..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/constants/Names.java
+++ /dev/null
@@ -1,506 +0,0 @@
-package com.smartdevicelink.proxy.constants;
-
-@Deprecated
-public class Names {
- public static final String request = "request";
- public static final String response = "response";
- public static final String notification = "notification";
- public static final String function_name = "name";
- public static final String parameters = "parameters";
- public static final String bulkData = "bulkData";
-
- public static final String RegisterAppInterface = "RegisterAppInterface";
- public static final String UnregisterAppInterface = "UnregisterAppInterface";
- public static final String Alert = "Alert";
- public static final String Show = "Show";
- public static final String Speak = "Speak";
- public static final String AddCommand = "AddCommand";
- public static final String DeleteCommand = "DeleteCommand";
- public static final String AddSubMenu = "AddSubMenu";
- public static final String DeleteSubMenu = "DeleteSubMenu";
- public static final String CreateInteractionChoiceSet = "CreateInteractionChoiceSet";
- public static final String DeleteInteractionChoiceSet = "DeleteInteractionChoiceSet";
- public static final String PerformInteraction = "PerformInteraction";
- public static final String DialNumber = "DialNumber";
- public static final String EncodedSyncPData = "EncodedSyncPData";
- public static final String SyncPData = "SyncPData";
- public static final String SubscribeButton = "SubscribeButton";
- public static final String UnsubscribeButton = "UnsubscribeButton";
- public static final String SubscribeVehicleData = "SubscribeVehicleData";
- public static final String UnsubscribeVehicleData = "UnsubscribeVehicleData";
- public static final String SetMediaClockTimer = "SetMediaClockTimer";
- public static final String SetGlobalProperties = "SetGlobalProperties";
- public static final String GenericResponse = "GenericResponse";
- public static final String ScrollableMessage = "ScrollableMessage";
- public static final String GetDID = "GetDID";
- public static final String GetDTCs = "GetDTCs";
- public static final String DiagnosticMessage = "DiagnosticMessage";
- public static final String SystemRequest = "SystemRequest";
- public static final String ReadDID = "ReadDID";
- public static final String OnVehicleData = "OnVehicleData";
- public static final String GetFile = "GetFile";
- public static final String PutFile = "PutFile";
- public static final String DeleteFile = "DeleteFile";
- public static final String ListFiles = "ListFiles";
- public static final String EndAudioCapture = "EndAudioCapture";
- public static final String GetVehicleData = "GetVehicleData";
- public static final String ResetGlobalProperties = "ResetGlobalProperties";
- public static final String PerformAudioCapture = "PerformAudioCapture";
- public static final String SetAppIcon = "SetAppIcon";
- public static final String ChangeRegistration = "ChangeRegistration";
- public static final String SetDisplayLayout = "SetDisplayLayout";
- public static final String keypressMode = "keypressMode";
- public static final String keyboardLayout = "keyboardLayout";
- public static final String limitedCharacterList = "limitedCharacterList";
- public static final String autoCompleteText = "autoCompleteText";
- public static final String OnLanguageChange = "OnLanguageChange";
- public static final String hmiDisplayLanguage = "hmiDisplayLanguage";
- public static final String displayLayout = "displayLayout";
- public static final String ttsName = "ttsName";
- public static final String hmiDisplayLanguageDesired = "hmiDisplayLanguageDesired";
- public static final String appHMIType = "appHMIType";
- public static final String hashID = "hashID";
- public static final String appID = "appID";
- public static final String vrHelpTitle = "vrHelpTitle";
- public static final String graphic = "graphic";
- public static final String customPresets = "customPresets";
- public static final String softButtonCapabilities = "softButtonCapabilities";
- public static final String presetBankCapabilities = "presetBankCapabilities";
- public static final String vehicleType = "vehicleType";
- public static final String make = "make";
- public static final String model = "model";
- public static final String modelYear = "modelYear";
- public static final String trim = "trim";
- public static final String allowed = "allowed";
- public static final String userDisallowed = "userDisallowed";
- public static final String rpcName = "rpcName";
- public static final String hmiPermissions = "hmiPermissions";
- public static final String parameterPermissions = "parameterPermissions";
- public static final String permissionItem = "permissionItem";
- public static final String numTicks = "numTicks";
- public static final String sliderHeader = "sliderHeader";
- public static final String sliderFooter = "sliderFooter";
- public static final String PerformAudioPassThru = "PerformAudioPassThru";
- public static final String PerformAudioPassThruResponse = "PerformAudioPassThruResponse";
- public static final String EndAudioPassThru = "EndAudioPassThru";
- public static final String EndAudioPassThruResponse = "EndAudioPassThruResponse";
- public static final String OnAudioPassThru = "OnAudioPassThru";
- public static final String ShowConstantTBT = "ShowConstantTBT";
- public static final String AlertManeuver = "AlertManeuver";
- public static final String UpdateTurnList = "UpdateTurnList";
-
- public static final String OnCommand = "OnCommand";
- public static final String OnDataPublished = "OnDataPublished";
- public static final String OnButtonPress = "OnButtonPress";
- public static final String OnButtonEvent = "OnButtonEvent";
- public static final String OnHMIStatus = "OnHMIStatus";
- public static final String OnTBTClientState = "OnTBTClientState";
- public static final String OnEncodedSyncPData = "OnEncodedSyncPData";
- public static final String onEncodedSyncPDataResponse = "onEncodedSyncPDataResponse";
- public static final String OnSyncPData = "OnSyncPData";
- public static final String onOnSyncPData = "onOnSyncPData";
- public static final String OnDriverDistraction = "OnDriverDistraction";
- public static final String OnAppInterfaceUnregistered = "OnAppInterfaceUnregistered";
- public static final String OnKeyboardInput = "OnKeyboardInput";
- public static final String OnTouchEvent = "OnTouchEvent";
- public static final String OnSystemRequest = "OnSystemRequest";
- public static final String OnHashChange = "OnHashChange";
- public static final String OnProxyClosed = "OnProxyClosed";
- public static final String OnProxyError = "OnProxyError";
- public static final String OnProxyOpened = "OnProxyOpened";
- public static final String OnProxyUnusable = "OnProxyUnusable";
- public static final String OnHMILevelChange = "OnHMILevelChange";
- public static final String OnSdlChoiceChosen = "OnSdlChoiceChosen";
- public static final String OnPermissionsChange = "OnPermissionsChange";
- public static final String OnScreenPresetsAvailable = "OnScreenPresetsAvailable";
- public static final String isHighlighted = "isHighlighted";
- public static final String softButtonID = "softButtonID";
- public static final String fileType = "fileType";
- public static final String url = "url";
- public static final String requestType = "requestType";
- public static final String fileName = "fileName";
- public static final String persistentFile = "persistentFile";
- public static final String spaceAvailable = "spaceAvailable";
- public static final String filenames = "filenames";
- public static final String cmdIcon = "cmdIcon";
- public static final String Slider = "Slider";
- public static final String sliderPosition = "sliderPosition";
- public static final String samplingRate = "samplingRate";
- public static final String audioType = "audioType";
- public static final String satRadioESN = "satRadioESN";
- public static final String dtc = "dtc";
- public static final String tryAgainTime = "tryAgainTime";
-
- public static final String success = "success";
- public static final String resultCode = "resultCode";
- public static final String info = "info";
-
- public static final String payload = "payload";
- public static final String reason = "reason";
- public static final String state = "state";
- public static final String cmdID = "cmdID";
- public static final String menuParams = "menuParams";
- public static final String parentID = "parentID";
- public static final String position = "position";
- public static final String menuName = "menuName";
- public static final String vrCommands = "vrCommands";
- public static final String language = "language";
- public static final String languageDesired = "languageDesired";
- public static final String triggerSource = "triggerSource";
- public static final String subscriptionType = "subscriptionType";
- public static final String data = "data";
- public static final String event = "event";
- public static final String correlationID = "correlationID";
- public static final String sdlMsgVersion = "syncMsgVersion";
- public static final String deviceInfo = "deviceInfo";
- public static final String majorVersion = "majorVersion";
- public static final String minorVersion = "minorVersion";
- public static final String appName = "appName";
- public static final String ngnMediaScreenAppName = "ngnMediaScreenAppName";
- public static final String isMediaApplication = "isMediaApplication";
- public static final String vrSynonyms = "vrSynonyms";
- public static final String usesVehicleData = "usesVehicleData";
- public static final String text = "text";
- public static final String type = "type";
- public static final String ttsChunks = "ttsChunks";
- public static final String playTone = "playTone";
- public static final String duration = "duration";
- public static final String mainField1 = "mainField1";
- public static final String mainField2 = "mainField2";
- public static final String mainField3 = "mainField3";
- public static final String mainField4 = "mainField4";
- public static final String statusBar = "statusBar";
- public static final String name = "name";
- public static final String menuID = "menuID";
- public static final String longPress = "longPress";
- public static final String shortPress = "shortPress";
- public static final String buttonName = "buttonName";
- public static final String buttonPressMode = "buttonPressMode";
- public static final String buttonEventMode = "buttonEventMode";
- public static final String minutes = "minutes";
- public static final String seconds = "seconds";
- public static final String startTime = "startTime";
- public static final String endTime = "endTime";
- public static final String updateMode = "updateMode";
- public static final String mediaClock = "mediaClock";
- public static final String initialText = "initialText";
- public static final String initialPrompt = "initialPrompt";
- public static final String helpPrompt = "helpPrompt";
- public static final String timeoutPrompt = "timeoutPrompt";
- public static final String timeout = "timeout";
- public static final String choiceSet = "choiceSet";
- public static final String interactionMode = "interactionMode";
- public static final String result = "result";
- public static final String alertText1 = "alertText1";
- public static final String alertText2 = "alertText2";
- public static final String alertText3 = "alertText3";
- public static final String shortPressAvailable = "shortPressAvailable";
- public static final String longPressAvailable = "longPressAvailable";
- public static final String upDownAvailable = "upDownAvailable";
- public static final String width = "width";
- public static final String height = "height";
- public static final String resolutionWidth = "resolutionWidth";
- public static final String resolutionHeight = "resolutionHeight";
- public static final String characterSet = "characterSet";
- public static final String displayType = "displayType";
- public static final String mediaClockFormats = "mediaClockFormats";
- public static final String textFields = "textFields";
- public static final String imageFields = "imageFields";
- public static final String autoActivateID = "autoActivateID";
- public static final String vehicleDataCapabilities = "vehicleDataCapabilities";
- public static final String speechCapabilities = "speechCapabilities";
- public static final String vrCapabilities = "vrCapabilities";
- public static final String audioPassThruCapabilities = "audioPassThruCapabilities";
- public static final String buttonCapabilities = "buttonCapabilities";
- public static final String displayCapabilities = "displayCapabilities";
- public static final String hmiZoneCapabilities = "hmiZoneCapabilities";
- public static final String interactionChoiceSetID = "interactionChoiceSetID";
- public static final String interactionChoiceSetIDList = "interactionChoiceSetIDList";
- public static final String audioFileName = "audioFileName";
- public static final String gpsPositionValid = "gpsPositionValid";
- public static final String longitudeDegrees = "longitudeDegrees";
- public static final String latitudeDegrees = "latitudeDegrees";
- public static final String utcYear = "utcYear";
- public static final String utcMonth = "utcMonth";
- public static final String utcDay = "utcDay";
- public static final String utcHours = "utcHours";
- public static final String utcMinutes = "utcMinutes";
- public static final String utcSeconds = "utcSeconds";
- public static final String compassDirection = "compassDirection";
- public static final String pdop = "pdop";
- public static final String vdop = "vdop";
- public static final String hdop = "hdop";
- public static final String actual = "actual";
- public static final String satellites = "satellites";
- public static final String dimension = "dimension";
- public static final String altitude = "altitude";
- public static final String heading = "heading";
- public static final String speed = "speed";
- public static final String number = "number";
- public static final String smartDeviceLinkFileName = "syncFileName";
- public static final String localFileName = "localFileName";
- public static final String maxDuration = "maxDuration";
- public static final String timerMode = "timerMode";
- public static final String status = "status";
- public static final String pressure = "pressure";
- public static final String hours = "hours";
- public static final String rows = "rows";
- public static final String pressureTellTale = "pressureTellTale";
- public static final String leftFront = "leftFront";
- public static final String rightFront = "rightFront";
- public static final String leftRear = "leftRear";
- public static final String rightRear = "rightRear";
- public static final String innerLeftRear = "innerLeftRear";
- public static final String innerRightRear = "innerRightRear";
- public static final String VehicleData = "VehicleData";
- public static final String alignment = "alignment";
- public static final String mediaTrack = "mediaTrack";
- public static final String properties = "properties";
- public static final String choiceID = "choiceID";
- public static final String bitsPerSample = "bitsPerSample";
- public static final String hmiLevel = "hmiLevel";
- public static final String audioStreamingState = "audioStreamingState";
- public static final String systemContext = "systemContext";
- public static final String sdlChoice = "sdlChoice";
- public static final String sdlCommand = "sdlCommand";
- public static final String URL = "URL";
- public static final String Timeout = "Timeout";
- public static final String PermissionGroupName = "PermissionGroupName";
- public static final String PermissionGroupStatus = "PermissionGroupStatus";
- public static final String PermissionGroupItems = "PermissionGroupItems";
- public static final String audioPacket = "audioPacket";
- public static final String audioPassThruDisplayText1 = "audioPassThruDisplayText1";
- public static final String audioPassThruDisplayText2 = "audioPassThruDisplayText2";
- public static final String bitRate = "bitRate";
- public static final String rpm = "rpm";
- public static final String fuelLevel = "fuelLevel";
- public static final String avgFuelEconomy = "avgFuelEconomy";
- public static final String batteryVoltage = "batteryVoltage";
- public static final String externalTemperature = "externalTemperature";
- public static final String vin = "vin";
- public static final String prndl = "prndl";
- public static final String tirePressure = "tirePressure";
- public static final String batteryPackVoltage = "batteryPackVoltage";
- public static final String batteryPackCurrent = "batteryPackCurrent";
- public static final String batteryPackTemperature = "batteryPackTemperature";
- public static final String engineTorque = "engineTorque";
- public static final String odometer = "odometer";
- public static final String tripOdometer = "tripOdometer";
- public static final String genericbinary = "genericbinary";
- public static final String GPSData = "GPSData";
- public static final String gps = "gps";
- public static final String fuelLevel_State = "fuelLevel_State";
- public static final String instantFuelConsumption = "instantFuelConsumption";
- public static final String beltStatus = "beltStatus";
- public static final String bodyInformation = "bodyInformation";
- public static final String deviceStatus = "deviceStatus";
- public static final String driverBraking = "driverBraking";
- public static final String wiperStatus = "wiperStatus";
- public static final String fuelEconomy = "fuelEconomy";
- public static final String engineOilLife = "engineOilLife";
- public static final String headLampStatus = "headLampStatus";
- public static final String brakeTorque = "brakeTorque";
- public static final String turboBoost = "turboBoost";
- public static final String coolantTemp = "coolantTemp";
- public static final String airFuelRatio = "airFuelRatio";
- public static final String coolingHeadTemp = "coolingHeadTemp";
- public static final String oilTemp = "oilTemp";
- public static final String intakeAirTemp = "intakeAirTemp";
- public static final String gearShiftAdvice = "gearShiftAdvice";
- public static final String acceleration = "acceleration";
- public static final String accPedalPosition = "accPedalPosition";
- public static final String clutchPedalPosition = "clutchPedalPosition";
- public static final String reverseGearStatus = "reverseGearStatus";
- public static final String accTorque = "accTorque";
- public static final String ambientLightStatus = "ambientLightStatus";
- public static final String ambientLightSensorStatus = "ambientLightSensorStatus";
- public static final String dataType = "dataType";
- public static final String identifier = "identifier";
- public static final String statusByte = "statusByte";
- public static final String didResult = "didResult";
- public static final String ecuName = "ecuName";
- public static final String didLocation = "didLocation";
- public static final String value = "value";
- public static final String softButtonName = "softButtonName";
- public static final String imageSupported = "imageSupported";
- public static final String systemAction = "systemAction";
- public static final String image = "image";
- public static final String secondaryText = "secondaryText";
- public static final String tertiaryText = "tertiaryText";
- public static final String secondaryImage = "secondaryImage";
- public static final String imageType = "imageType";
- public static final String fileData = "fileData";
- public static final String scrollableMessageBody = "scrollableMessageBody";
- public static final String softButtons = "softButtons";
- public static final String customButtonID = "customButtonID";
- public static final String vrHelp = "vrHelp";
- public static final String interactionLayout = "interactionLayout";
- public static final String customButtonName = "customButtonName";
- public static final String navigationText = "navigationText";
- public static final String turnIcon = "turnIcon";
- public static final String nextTurnIcon = "nextTurnIcon";
- public static final String navigationText1 = "navigationText1";
- public static final String navigationText2 = "navigationText2";
- public static final String eta = "eta";
- public static final String totalDistance = "totalDistance";
- public static final String distanceToManeuver = "distanceToManeuver";
- public static final String distanceToManeuverScale = "distanceToManeuverScale";
- public static final String maneuverComplete = "maneuverComplete";
- public static final String turnList = "turnList";
- public static final String steeringWheelAngle = "steeringWheelAngle";
- public static final String menuTitle = "menuTitle";
- public static final String menuIcon = "menuIcon";
- public static final String keyboardProperties = "keyboardProperties";
- public static final String driverBeltDeployed = "driverBeltDeployed";
- public static final String passengerBeltDeployed = "passengerBeltDeployed";
- public static final String passengerBuckleBelted = "passengerBuckleBelted";
- public static final String driverBuckleBelted = "driverBuckleBelted";
- public static final String leftRow2BuckleBelted = "leftRow2BuckleBelted";
- public static final String passengerChildDetected = "passengerChildDetected";
- public static final String rightRow2BuckleBelted = "rightRow2BuckleBelted";
- public static final String middleRow2BuckleBelted = "middleRow2BuckleBelted";
- public static final String middleRow3BuckleBelted = "middleRow3BuckleBelted";
- public static final String leftRow3BuckleBelted = "leftRow3BuckleBelted";
- public static final String rightRow3BuckleBelted = "rightRow3BuckleBelted";
- public static final String rearInflatableBelted = "rearInflatableBelted";
- public static final String leftRearInflatableBelted = "leftRearInflatableBelted";
- public static final String rightRearInflatableBelted = "rightRearInflatableBelted";
- public static final String middleRow1BeltDeployed = "middleRow1BeltDeployed";
- public static final String middleRow1BuckleBelted = "middleRow1BuckleBelted";
-
- public static final String graphicSupported = "graphicSupported";
- public static final String screenParams = "screenParams";
- public static final String muteAudio = "muteAudio";
- public static final String parkBrakeActive = "parkBrakeActive";
- public static final String ignitionStableStatus = "ignitionStableStatus";
- public static final String ignitionStatus = "ignitionStatus";
- public static final String driverDoorAjar = "driverDoorAjar";
- public static final String passengerDoorAjar = "passengerDoorAjar";
- public static final String rearLeftDoorAjar = "rearLeftDoorAjar";
- public static final String rearRightDoorAjar = "rearRightDoorAjar";
- public static final String systemFile = "systemFile";
-
- public static final String voiceRecOn = "voiceRecOn";
- public static final String btIconOn = "btIconOn";
- public static final String callActive = "callActive";
- public static final String phoneRoaming = "phoneRoaming";
- public static final String textMsgAvailable = "textMsgAvailable";
- public static final String battLevelStatus = "battLevelStatus";
- public static final String stereoAudioOutputMuted = "stereoAudioOutputMuted";
- public static final String monoAudioOutputMuted = "monoAudioOutputMuted";
- public static final String signalLevelStatus = "signalLevelStatus";
- public static final String primaryAudioSource = "primaryAudioSource";
- public static final String eCallEventActive = "eCallEventActive";
-
- public static final String fuelEconomySinceLastReset = "fuelEconomySinceLastReset";
- public static final String currentTripFuelEconomy = "currentTripFuelEconomy";
- public static final String averageTripFuelEconomy = "averageTripFuelEconomy";
- public static final String currentCycleFuelEconomy = "currentCycleFuelEconomy";
-
- public static final String lightSwitchStatus = "lightSwitchStatus";
- public static final String highBeamsOn = "highBeamsOn";
- public static final String lowBeamsOn = "lowBeamsOn";
-
- public static final String electricFuelConsumption = "electricFuelConsumption";
- public static final String stateOfCharge = "stateOfCharge";
- public static final String fuelMaintenanceMode = "fuelMaintenanceMode";
- public static final String distanceToEmpty = "distanceToEmpty";
-
- public static final String dtcMask = "dtcMask";
- public static final String targetID = "targetID";
- public static final String messageLength = "messageLength";
- public static final String messageData = "messageData";
- public static final String messageDataResult = "messageDataResult";
-
- public static final String imageTypeSupported = "imageTypeSupported";
- public static final String imageResolution = "imageResolution";
- public static final String x = "x";
- public static final String y = "y";
- public static final String id = "id";
- public static final String ts = "ts";
- public static final String c = "c";
- public static final String resolution = "resolution";
- public static final String touchEventAvailable = "touchEventAvailable";
-
- public static final String pressAvailable = "pressAvailable";
- public static final String multiTouchAvailable = "multiTouchAvailable";
- public static final String doublePressAvailable = "doublePressAvailable";
- public static final String templatesAvailable = "templatesAvailable";
- public static final String numCustomPresetsAvailable = "numCustomPresetsAvailable";
- public static final String prerecordedSpeech = "prerecordedSpeech";
- public static final String manualTextEntry = "manualTextEntry";
- public static final String progressIndicator = "progressIndicator";
- public static final String secondaryGraphic = "secondaryGraphic";
- public static final String offset = "offset";
- public static final String length = "length";
-
- public static final String hardware = "hardware";
- public static final String firmwareRev = "firmwareRev";
- public static final String os = "os";
- public static final String osVersion = "osVersion";
- public static final String carrier = "carrier";
- public static final String maxNumberRFCOMMPorts = "maxNumberRFCOMMPorts";
-
- public static final String onReadDIDResponse = "onReadDIDResponse";
- public static final String onGetDTCsResponse = "onGetDTCsResponse";
- public static final String onOnKeyboardInput = "onOnKeyboardInput";
- public static final String onOnTouchEvent = "onOnTouchEvent";
- public static final String onOnSystemRequest = "onOnSystemRequest";
-
- public static final String onDiagnosticMessageResponse = "onDiagnosticMessageResponse";
- public static final String onSystemRequestResponse = "onSystemRequestResponse";
- public static final String onGetVehicleDataResponse = "onGetVehicleDataResponse";
- public static final String getSupportedDiagModes = "getSupportedDiagModes";
- public static final String supportedDiagModes = "supportedDiagModes";
-
- public static final String driverAirbagDeployed = "driverAirbagDeployed";
- public static final String driverSideAirbagDeployed = "driverSideAirbagDeployed";
- public static final String driverCurtainAirbagDeployed = "driverCurtainAirbagDeployed";
- public static final String passengerAirbagDeployed = "passengerAirbagDeployed";
- public static final String passengerCurtainAirbagDeployed = "passengerCurtainAirbagDeployed";
- public static final String driverKneeAirbagDeployed = "driverKneeAirbagDeployed";
- public static final String passengerSideAirbagDeployed = "passengerSideAirbagDeployed";
- public static final String passengerKneeAirbagDeployed = "passengerKneeAirbagDeployed";
-
- public static final String powerModeActive = "powerModeActive";
- public static final String powerModeQualificationStatus = "powerModeQualificationStatus";
- public static final String carModeStatus = "carModeStatus";
- public static final String powerModeStatus = "powerModeStatus";
-
- public static final String eCallNotificationStatus = "eCallNotificationStatus";
- public static final String auxECallNotificationStatus = "auxECallNotificationStatus";
- public static final String eCallConfirmationStatus = "eCallConfirmationStatus";
- public static final String e911Override = "e911Override";
-
- public static final String emergencyEventType = "emergencyEventType";
- public static final String fuelCutoffStatus = "fuelCutoffStatus";
- public static final String rolloverEvent = "rolloverEvent";
- public static final String maximumChangeVelocity = "maximumChangeVelocity";
- public static final String multipleEvents = "multipleEvents";
-
- public static final String eCallInfo = "eCallInfo";
- public static final String airbagStatus = "airbagStatus";
- public static final String emergencyEvent = "emergencyEvent";
- public static final String clusterModeStatus = "clusterModeStatus";
- public static final String myKey = "myKey";
- public static final String timeToDestination = "timeToDestination";
-
- public static final String driverDistraction = "driverDistraction";
- public static final String showLockScreen = "showLockScreen";
- public static final String userSelected = "userSelected";
- public static final String notSet = "notSet";
-
- public static final String headers = "headers";
- public static final String body = "body";
-
- public static final String ContentType = "ContentType";
- public static final String ConnectTimeout = "ConnectTimeout";
- public static final String DoOutput = "DoOutput";
- public static final String DoInput = "DoInput";
- public static final String UseCaches = "UseCaches";
- public static final String RequestMethod = "RequestMethod";
- public static final String ReadTimeout = "ReadTimeout";
- public static final String InstanceFollowRedirects = "InstanceFollowRedirects";
- public static final String charset = "charset";
- public static final String ContentLength = "Content-Length";
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
deleted file mode 100644
index 2fb5a4063..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.smartdevicelink.proxy.interfaces;
-
-public interface IProxyListenerALM extends IProxyListenerBase {
- // Adds Advanced Life-cycle Management call-backs to the IProxyListenerAbstract interface
-
- /**
- * **MOVED TO IProxyListenerBase** - onOnHMIStatus() being called indicates that the proxy has entered a state in which the
- * application may create SDL related resources (addCommands, ChoiceSets).
- */
- //public void onOnHMIStatus(OnHMIStatus notification);
-
- /**
- * **MOVED TO IProxyListenerBase** - onProxyClosed() being called indicates that the app is no longer registered with SDL
- * All resources on SDL (addCommands and ChoiceSets) have been deleted and will have to be
- * recreated upon the next onReadyForInitialization() call-back.
- */
- //public void onProxyClosed(String info, Exception e);
-
- /**
- * **MOVED TO IProxyListenerBase** - onError() being called indicates that the proxy has experienced an unrecoverable error.
- * A new proxy object must be initiated to reestablish connection with SDL.
- *
- * @param info - Any info present about the error that occurred.
- * @param e - Any exception thrown by the error.
- */
- //public void onError(String info, Exception e);
-
- /**
- * **Deprecated** - onSdlInterfaceAvailable() being called indicates that the proxy now has access to SDL's HMI.
- * Monitor the onFocusChange call-back to determine which level of HMI is available to the proxy.
- *
- * @param isFirstAvailability - Indicates this is the first onSdlInterfaceAvailable in this lifecycle.
- */
- // HMI (Background, Limited, Full) from Unavailable = onSdlInterfaceAvailable(Boolean isFirstAvailability);
-
- /**
- * **Deprecated** - onSdlInterfaceUnavailable() being called indicates that the proxy does NOT have access to SDL's HIM.
- */
- // HMI None onSdlInterfaceUnavailable();
-
- /**
- * **Deprecated** - ALM HMI states converted back to HMI Levels
- *
- * HMI Full = onSdlInFocus(Boolean isFirstSdlInFocus);
- * HMI Limited = onSdlInFocusLimited();
- * HMI Background = onSdlLostFocus();
- */
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java
deleted file mode 100644
index b7486785f..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java
+++ /dev/null
@@ -1,359 +0,0 @@
-package com.smartdevicelink.proxy.interfaces;
-
-import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
-import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
-import com.smartdevicelink.proxy.rpc.AddCommandResponse;
-import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.AlertManeuverResponse;
-import com.smartdevicelink.proxy.rpc.AlertResponse;
-import com.smartdevicelink.proxy.rpc.ButtonPressResponse;
-import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
-import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse;
-import com.smartdevicelink.proxy.rpc.DialNumberResponse;
-import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse;
-import com.smartdevicelink.proxy.rpc.GenericResponse;
-import com.smartdevicelink.proxy.rpc.GetDTCsResponse;
-import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse;
-import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.GetWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.ListFilesResponse;
-import com.smartdevicelink.proxy.rpc.OnAudioPassThru;
-import com.smartdevicelink.proxy.rpc.OnButtonEvent;
-import com.smartdevicelink.proxy.rpc.OnButtonPress;
-import com.smartdevicelink.proxy.rpc.OnCommand;
-import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.OnHashChange;
-import com.smartdevicelink.proxy.rpc.OnInteriorVehicleData;
-import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
-import com.smartdevicelink.proxy.rpc.OnLanguageChange;
-import com.smartdevicelink.proxy.rpc.OnLockScreenStatus;
-import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.OnRCStatus;
-import com.smartdevicelink.proxy.rpc.OnStreamRPC;
-import com.smartdevicelink.proxy.rpc.OnSystemRequest;
-import com.smartdevicelink.proxy.rpc.OnTBTClientState;
-import com.smartdevicelink.proxy.rpc.OnTouchEvent;
-import com.smartdevicelink.proxy.rpc.OnVehicleData;
-import com.smartdevicelink.proxy.rpc.OnWayPointChange;
-import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse;
-import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
-import com.smartdevicelink.proxy.rpc.PutFileResponse;
-import com.smartdevicelink.proxy.rpc.ReadDIDResponse;
-import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse;
-import com.smartdevicelink.proxy.rpc.SendHapticDataResponse;
-import com.smartdevicelink.proxy.rpc.SendLocationResponse;
-import com.smartdevicelink.proxy.rpc.SetAppIconResponse;
-import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse;
-import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.SetInteriorVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
-import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse;
-import com.smartdevicelink.proxy.rpc.ShowResponse;
-import com.smartdevicelink.proxy.rpc.SliderResponse;
-import com.smartdevicelink.proxy.rpc.SpeakResponse;
-import com.smartdevicelink.proxy.rpc.StreamRPCResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
-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;
-
-
-public interface IProxyListenerBase {
-
- /**
- * onOnHMIStatus being called indicates that there has been an HMI Level change,
- * system context change or audio streaming state change.
- *
- * @param notification - Contains information about the HMI Level,
- * system context and audio streaming state.
- */
- public void onOnHMIStatus(OnHMIStatus notification);
-
- /**
- * onProxyClosed has different functionality for the different models.
- * In the non-ALM model this indicates that the proxy has experienced an unrecoverable error.
- * A new proxy object must be initiated to reestablish connection with SDL.
- * In the ALM model this indicates that the app is no longer registered with SDL
- * All resources on SDL (addCommands and ChoiceSets) have been deleted and will have to be
- * recreated upon the next onReadyForInitialization() call-back.
- *
- * @param info - Includes information about the reason the proxy has been closed.
- * @param e - The exception that occurred.
- */
- public void onProxyClosed(String info, Exception e, SdlDisconnectedReason reason);
-
- public void onServiceEnded(OnServiceEnded serviceEnded);
-
- public void onServiceNACKed(OnServiceNACKed serviceNACKed);
-
- public void onOnStreamRPC(OnStreamRPC notification);
-
- public void onStreamRPCResponse(StreamRPCResponse response);
-
- /**
- * onProxyError() being called indicates that the SDL Proxy experenced an error.
- *
- * @param info - Includes information about the Exception that occurred.
- * @param e - The exception that occurred.
- */
- public void onError(String info, Exception e);
-
- /**
- * onGenericResponse() being called indicates that SDL could not determine the
- * type of request it is responding to. This is usually result of an unknown RPC Request
- * being sent.
- *
- * @param response - Includes detailed information about the response.
- */
- public void onGenericResponse(GenericResponse response);
-
- /**
- * onOnCommand() being called indicates that the user selected a command on SDL.
- *
- * @param notification - Contains information about the command chosen.
- */
- public void onOnCommand(OnCommand notification);
-
- /**
- * onAddCommandResponse() being called indicates that SDL has responded to
- * a request to add a command.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onAddCommandResponse(AddCommandResponse response);
-
- /**
- * onAddSubMenuResponse() being called indicates that SDL has responded to
- * a request to add a command.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onAddSubMenuResponse(AddSubMenuResponse response);
-
- /**
- * onCreateInteractionChoiceSetResponse() being called indicates that SDL has
- * responded to a request to add an interactionChoiceSet.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse response);
-
- /**
- * onAlertResponse being called indicates that SDL has
- * responded to a request to alert the user.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onAlertResponse(AlertResponse response);
-
- /**
- * onDeleteCommandResponse being called indicates that SDL has
- * responded to a request to delete a command.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onDeleteCommandResponse(DeleteCommandResponse response);
-
- /**
- * onDeleteCommandResponse being called indicates that SDL has
- * responded to a request to delete an interaction choice set.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse response);
-
- /**
- * onDeleteCommandResponse being called indicates that SDL has
- * responded to a request to delete a submenu.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onDeleteSubMenuResponse(DeleteSubMenuResponse response);
-
- /**
- * onPerformInteractionResponse being called indicates that SDL has
- * responded to a request to perform an interaction.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onPerformInteractionResponse(PerformInteractionResponse response);
-
- /**
- * onResetGlobalPropertiesResponse being called indicates that SDL has
- * responded to a request to reset global properties.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onResetGlobalPropertiesResponse(ResetGlobalPropertiesResponse response);
-
- /**
- * onSetGlobalPropertiesResponse being called indicates that SDL has
- * responded to a request to set global properties.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse response);
-
- /**
- * onSetMediaClockTimerResponse being called indicates that SDL has
- * responded to a request to set the media clock timer.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response);
-
- /**
- * onShowResponse being called indicates that SDL has
- * responded to a request to display information to the user.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onShowResponse(ShowResponse response);
-
- /**
- * onSpeakResponse being called indicates that SDL has
- * responded to a request to speak information to the user.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onSpeakResponse(SpeakResponse response);
-
- /**
- * onButtonEvent being called indicates that a button event has occurred.
- *
- * @param notification - Contains information about the notification sent from SDL.
- */
- public void onOnButtonEvent(OnButtonEvent notification);
-
- /**
- * onButtonPress being called indicates that SDL has a button has
- * been pressed by the user.
- *
- * @param notification - Contains information about the notification sent from SDL.
- */
- public void onOnButtonPress(OnButtonPress notification);
-
- /**
- * onSubscribeButtonResponse being called indicates that SDL has
- * responded to a request to subscribe to button events and button presses.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onSubscribeButtonResponse(SubscribeButtonResponse response);
-
- /**
- * onUnsubscribeButtonResponse being called indicates that SDL has
- * responded to a request to unsubscribe from button events and button presses.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response);
-
- /**
- * onOnPermissionsChange being called indicates that your app permissions have
- * changed due to a policy table change. This can mean your app has received additional
- * permissions OR lost permissions.
- *
- * @param notification - Contains information about the changed permissions.
- */
- public void onOnPermissionsChange(OnPermissionsChange notification);
-
- public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response);
-
- public void onUnsubscribeVehicleDataResponse(UnsubscribeVehicleDataResponse response);
-
- public void onGetVehicleDataResponse(GetVehicleDataResponse response);
-
- public void onOnVehicleData(OnVehicleData notification);
-
- public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response);
-
- public void onEndAudioPassThruResponse(EndAudioPassThruResponse response);
-
- public void onOnAudioPassThru(OnAudioPassThru notification);
-
- public void onPutFileResponse(PutFileResponse response);
-
- public void onDeleteFileResponse(DeleteFileResponse response);
-
- public void onListFilesResponse(ListFilesResponse response);
-
- public void onSetAppIconResponse(SetAppIconResponse response);
-
- public void onScrollableMessageResponse(ScrollableMessageResponse response);
-
- public void onChangeRegistrationResponse(ChangeRegistrationResponse response);
-
- public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response);
-
- public void onOnLanguageChange(OnLanguageChange notification);
-
- public void onOnHashChange(OnHashChange notification);
-
- public void onSliderResponse(SliderResponse response);
-
- public void onOnDriverDistraction(OnDriverDistraction notification);
-
- public void onOnTBTClientState(OnTBTClientState notification);
-
- public void onOnSystemRequest(OnSystemRequest notification);
-
- public void onSystemRequestResponse(SystemRequestResponse response);
-
- public void onOnKeyboardInput(OnKeyboardInput notification);
-
- public void onOnTouchEvent(OnTouchEvent notification);
-
- public void onDiagnosticMessageResponse(DiagnosticMessageResponse response);
-
- public void onReadDIDResponse(ReadDIDResponse response);
-
- public void onGetDTCsResponse(GetDTCsResponse response);
-
- public void onOnLockScreenNotification(OnLockScreenStatus notification);
-
- public void onDialNumberResponse(DialNumberResponse response);
-
- public void onSendLocationResponse(SendLocationResponse response);
-
- public void onShowConstantTbtResponse(ShowConstantTbtResponse response);
-
- public void onAlertManeuverResponse(AlertManeuverResponse response);
-
- public void onUpdateTurnListResponse(UpdateTurnListResponse response);
-
- public void onServiceDataACK(int dataSize);
- public void onGetWayPointsResponse(GetWayPointsResponse response);
-
- public void onSubscribeWayPointsResponse(SubscribeWayPointsResponse response);
-
- public void onUnsubscribeWayPointsResponse(UnsubscribeWayPointsResponse response);
- public void onOnWayPointChange(OnWayPointChange notification);
-
- public void onGetSystemCapabilityResponse(GetSystemCapabilityResponse response);
-
- public void onGetInteriorVehicleDataResponse(GetInteriorVehicleDataResponse response);
-
- public void onButtonPressResponse(ButtonPressResponse response);
-
- public void onSetInteriorVehicleDataResponse(SetInteriorVehicleDataResponse response);
-
- public void onOnInteriorVehicleData(OnInteriorVehicleData notification);
-
- public void onSendHapticDataResponse(SendHapticDataResponse response);
-
- public void onOnRCStatus(OnRCStatus notification);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
deleted file mode 100644
index 7929e86e6..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.smartdevicelink.proxy.interfaces;
-
-import com.smartdevicelink.proxy.rpc.PutFileResponse;
-
-public interface IPutFileResponseListener {
- public void onPutFileResponse(PutFileResponse response);
-
- public void onPutFileStreamError(Exception e, String info);
-}
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
deleted file mode 100644
index 5eb8ff36a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
+++ /dev/null
@@ -1,229 +0,0 @@
-package com.smartdevicelink.proxy.interfaces;
-
-import android.support.annotation.NonNull;
-
-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;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-
-import java.util.List;
-
-/*
- * Copyright (c) 2017 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-@SuppressWarnings("unused")
-public interface ISdl {
-
- /**
- * Starts the connection with the module
- */
- void start();
-
- /**
- * Ends connection with the module
- */
- void stop();
-
- /**
- * Method to check if the session is connected
- * @return if there is a connected session
- */
- boolean isConnected();
-
- /**
- * Add a service listener for a specific service type
- * @param serviceType service type that the listener will be attached to
- * @param sdlServiceListener listener for events that happen to the service
- */
- void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener);
-
- /**
- * Remote a service listener for a specific service type
- * @param serviceType service type that the listener was attached to
- * @param sdlServiceListener service listener that was previously added for the service type
- */
- void removeServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener);
-
- /**
- * Starts the video streaming service
- * @param parameters desired video streaming params for this sevice to be started with
- * @param encrypted flag to start this service with encryption or not
- */
- void startVideoService(VideoStreamingParameters parameters, boolean encrypted);
-
- /**
- * Stops the video service if open
- */
- void stopVideoService();
-
- /**
- * Starts the video streaming service
- * @param isEncrypted flag to start this service with encryption or not
- * @param parameters desired video streaming params for this sevice to be started with
- */
- IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters);
-
- /**
- * Starts the Audio streaming service
- * @param encrypted flag to start this service with encryption or not
- */
- void startAudioService(boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params);
-
- /**
- * Starts the Audio streaming service
- * @param encrypted flag to start this service with encryption or not
- */
- void startAudioService(boolean encrypted);
-
- /**
- * Stops the audio service if open
- */
- void stopAudioService();
-
- /**
- * Start Audio Stream and return IAudioStreamListener
- * @param isEncrypted
- * @param codec
- * @param params
- * @return IAudioStreamListener
- */
- IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec, AudioStreamingParams params);
-
- /**
- * Pass an RPC message through the proxy to be sent to the connected module
- * @param message RPCRequest that should be sent to the module
- */
- void sendRPCRequest(RPCRequest message);
-
- /**
- * Pass a list of RPC requests through the proxy to be sent to core
- * @param rpcs List of RPC requests
- * @param listener OnMultipleRequestListener that is called between requests and after all are processed
- */
- void sendRequests(List<? extends RPCRequest> rpcs, final OnMultipleRequestListener listener);
-
- /**
- * Add an OnRPCNotificationListener for specified notification
- * @param notificationId FunctionID of the notification that is to be listened for
- * @param listener listener that should be added for the notification ID
- */
- void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener);
-
- /**
- * Removes an OnRPCNotificationListener for specified notification
- * @param notificationId FunctionID of the notification that was to be listened for
- * @param listener listener that was previously added for the notification ID
- */
- 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
- */
- Object getCapability(SystemCapabilityType systemCapabilityType);
-
- /**
- * Get Capability
- * @param systemCapabilityType
- * @param scListener
- */
- void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener);
-
- /**
- * Check if capability is supported
- * @param systemCapabilityType
- * @return Boolean
- */
- 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);
-
- /**
- * Check to see if a transport is available to start/use the supplied service.
- * @param serviceType the session that should be checked for transport availability
- * @return true if there is either a supported
- * transport currently connected or a transport is
- * available to connect with for the supplied service type.
- * <br>false if there is no
- * transport connected to support the service type in question and
- * no possibility in the foreseeable future.
- */
- boolean isTransportForServiceAvailable(SessionType serviceType);
-
- /**
- * Get the RPC specification version currently being used for the SDL messages
- * @return SdlMsgVersion the current RPC specification version
- */
- @NonNull SdlMsgVersion getSdlMsgVersion();
-
- /**
- * Get the protocol version of this session
- * @return byte value representing WiPro version
- */
- @NonNull Version getProtocolVersion();
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java
deleted file mode 100644
index db5179a73..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.smartdevicelink.proxy.interfaces;
-
-
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.protocol.enums.SessionType;
-
-public interface ISdlServiceListener {
- public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted);
- public void onServiceEnded(SdlSession session, SessionType type);
- public void onServiceError(SdlSession session, SessionType type, String reason);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java
deleted file mode 100644
index d6fb11b4d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/OnSystemCapabilityListener.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.smartdevicelink.proxy.interfaces;
-
-public interface OnSystemCapabilityListener {
- void onCapabilityRetrieved(Object capability);
- void onError(String info);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java
deleted file mode 100644
index 9dec67b7d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java
+++ /dev/null
@@ -1,231 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
-*
-* <p>This class will add a command to the application's Command Menu</p>
-*
-*
-* <p><b>Note:</b> A command will be added to the end of the list of elements in
-* the Command Menu under the following conditions:</p>
-*
-* <ul>
-* <li>When a Command is added with no MenuParams value provided</li>
-* <li>When a MenuParams value is provided with a MenuParam.position value
-* greater than or equal to the number of menu items currently defined in the
-* menu specified by the MenuParam.parentID value</li>
-* </ul>
-*
-*
-* <p>The set of choices which the application builds using AddCommand can be a
-* mixture of:</p>
-*
-* <ul>
-* <li>Choices having only VR synonym definitions, but no MenuParams definitions
-* </li>
-* <li>Choices having only MenuParams definitions, but no VR synonym definitions
-* </li>
-* <li>Choices having both MenuParams and VR synonym definitions</li>
-* </ul>
-*
-* <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUD</b></p>
-*
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>cmdID</td>
- * <td> Integer</td>
- * <td>unique ID of the command to add</td>
- * <td>Y</td>
- * <td> minvalue:0; maxvalue:2000000000</td>
- * <td>SmartDeviceLink 1.0</td>
- * <tr>
- * <td>menuParams</td>
- * <td>ButtonName</td>
- * <td>Name of the button to unsubscribe.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>vrCommands</td>
- * <td>String</td>
- * <td><p>An array of strings to be used as VR synonyms for this command.</p> <p>If this array is provided, it may not be empty.</p></td>
- * <td>N</td>
- * <td>minsize:1; maxsize:100</td>
- * <td>SmartDeviceLink 1.0</td>
- * <tr>
- * <td>cmdIcon</td>
- * <td>Image</td>
- * <td><p>Image struct determining whether static or dynamic icon.</p><p>If omitted on supported displays, no (or the default if applicable) icon shall be displayed.</p></td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
-* </table>
-* <p> <b>Response</b></p><p>Indicates that the corresponding request has failed or succeeded, if the response returns with a SUCCESS result code, this means a command was added to the Command Menu successfully.</p>
-*
-* <p><b>Non-default Result Codes:</b></p> <p>INVALID_ID</p> <p>DUPLICATE_NAME</p>
-* @since SmartDeviceLink 1.0
-* @see DeleteCommand
-* @see AddSubMenu
-* @see DeleteSubMenu
-*/
-
-public class AddCommand extends RPCRequest {
- public static final String KEY_CMD_ICON = "cmdIcon";
- public static final String KEY_MENU_PARAMS = "menuParams";
- public static final String KEY_CMD_ID = "cmdID";
- public static final String KEY_VR_COMMANDS = "vrCommands";
-
- /**
- * Constructs a new AddCommand object
- */
- public AddCommand() {
- super(FunctionID.ADD_COMMAND.toString());
- }
-
- /**
- * <p>
- * Constructs a new AddCommand object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public AddCommand(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new AddCommand object
- * @param cmdID an integer object representing a Command ID <p><b>Notes:</b> Min Value: 0; Max Value: 2000000000</p>
- */
- public AddCommand(@NonNull Integer cmdID) {
- this();
- setCmdID(cmdID);
- }
- /**
- * <p>
- * Returns an <i>Integer</i> object representing the Command ID that you want to add
- * </p>
- *
- * @return Integer -an integer representation a Unique Command ID
- */
- public Integer getCmdID() {
- return getInteger(KEY_CMD_ID);
- }
- /**
- * <p>Sets an Unique Command ID that identifies the command. Is returned in an
- * <i>{@linkplain OnCommand}</i> notification to identify the command
- * selected by the user</p>
- *
- *
- * @param cmdID
- * an integer object representing a Command ID
- * <p>
- * <b>Notes:</b> Min Value: 0; Max Value: 2000000000</p>
- */
- public void setCmdID(@NonNull Integer cmdID) {
- setParameters(KEY_CMD_ID, cmdID);
- }
- /**
- * <p>
- * Returns a <I>MenuParams</I> object which will defined the command and how
- * it is added to the Command Menu
- * </p>
- *
- * @return MenuParams -a MenuParams object
- *
- */
- @SuppressWarnings("unchecked")
- public MenuParams getMenuParams() {
- return (MenuParams) getObject(MenuParams.class, KEY_MENU_PARAMS);
- }
- /**
- * <p>
- * Sets Menu parameters</p>
- * If provided, this will define the command and how it is added to the
- * Command Menu<p>
- * If null, commands will not be accessible through the HMI application menu
- * </p>
- *
- * @param menuParams
- * a menuParams object
- */
- public void setMenuParams(MenuParams menuParams) {
- setParameters(KEY_MENU_PARAMS, menuParams);
- }
- /**
- * <p>
- * Gets Voice Recognition Commands
- * </p>
- *
- * @return List<String> -(List<String>) indicating one or more VR phrases
- */
- @SuppressWarnings("unchecked")
- public List<String> getVrCommands() {
- return (List<String>) getObject(String.class, KEY_VR_COMMANDS);
- }
- /**
- * <p>
- * Sets Voice Recognition Commands </p>
- * <p>If provided, defines one or more VR phrases the recognition of any of
- * which triggers the <i>{@linkplain OnCommand}</i> notification with this
- * cmdID</p>
- * <p>If null, commands will not be accessible by voice commands (when the user
- * hits push-to-talk)
- * </p>
- *
- * @param vrCommands
- * List<String> indicating one or more VR phrases
- * <p>
- * <b>Notes: </b>Optional only if menuParams is provided. If
- * provided, array must contain at least one non-empty (not null,
- * not zero-length, not whitespace only) element</p>
- */
- public void setVrCommands( List<String> vrCommands ) {
- setParameters(KEY_VR_COMMANDS, vrCommands);
- }
-
- /**
- * <p>Gets the image to be shown along with a command </p>
- *
- * @return Image -an Image object
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public Image getCmdIcon() {
- return (Image) getObject(Image.class, KEY_CMD_ICON);
- }
-
- /**
- * <p>Sets the Image
- * If provided, defines the image to be be shown along with a command</p>
- * @param cmdIcon
- * <p>an Image obj representing the Image obj shown along with a
- * command</p>
- * <p>
- * <b>Notes: </b>If omitted on supported displays, no (or the
- * default if applicable) icon will be displayed</p>
- * @since SmartDeviceLink 2.0
- */
- public void setCmdIcon(Image cmdIcon) {
- setParameters(KEY_CMD_ICON, cmdIcon);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java
deleted file mode 100644
index 27a19a53e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddCommandResponse.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Add Command Response is sent, when AddCommand has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class AddCommandResponse extends RPCResponse {
- /**
- * Constructs a new AddCommandResponse object
- */
- public AddCommandResponse() {
- super(FunctionID.ADD_COMMAND.toString());
- }
-
- public AddCommandResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new AddCommandResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public AddCommandResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-}
-
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
deleted file mode 100644
index a272e5455..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
+++ /dev/null
@@ -1,195 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * <p>Add a SubMenu to the Command Menu</p>
- *
- * <p>A SubMenu can only be added to the Top Level Menu (i.e.a SubMenu cannot be
- * added to a SubMenu), and may only contain commands as children</p>
- *
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUD</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>menuID</td>
- * <td>Integer</td>
- * <td>Unique ID that identifies this sub menu. This value is used in AddCommand to which SubMenu is the parent of the command being added.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>position</td>
- * <td>Integer</td>
- * <td>Position within the items of the top level Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc. Position of any submenu will always be located before the return and exit options.</td>
- * <td>N</td>
- * <td>Min Value: 0 <p>Max Value: 1000</p> <p>If position is greater or equal than the number of items on top level, the sub menu will be appended by the end.</p><p>If this parameter is omitted, the entry will be added at the end of the list.</P></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>menuName</td>
- * <td>String</td>
- * <td>Text which is displayed representing this submenu item</td>
- * <td>Y</td>
- * <td>maxlength:500</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>menuIcon</td>
- * <td>Image</td>
- * <td>Image to be be shown along with the submenu item</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * </table>
- * <b>Response</b>
- * <p>Indicates that the corresponding request either failed or succeeded. If the response returns with a SUCCESS result code, this means the SubMenu was added to the Command Menu successfully</p>
- *
- * <p><b>Non-default Result Codes:</b></p>
- * <p>INVALID_ID</p>
- * <p>DUPLICATE NAME</p>
- * @since SmartDeviceLink 1.0
- * @see DeleteSubMenu
- * @see AddCommand
- * @see DeleteCommand
- */
-public class AddSubMenu extends RPCRequest {
- public static final String KEY_POSITION = "position";
- public static final String KEY_MENU_NAME = "menuName";
- public static final String KEY_MENU_ID = "menuID";
- public static final String KEY_MENU_ICON = "menuIcon";
-
- /**
- * Constructs a new AddSubMenu object
- */
- public AddSubMenu() {
- super(FunctionID.ADD_SUB_MENU.toString());
- }
- /**
- * Constructs a new AddSubMenu object indicated by the Hashtable parameter
- *
- *
- * @param hash The Hashtable to use
- */
- public AddSubMenu(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new AddSubMenu object
- * @param menuID an integer object representing a Menu ID
- * <p><b>Notes:</b> Min Value: 0; Max Value: 2000000000</p>
- * @param menuName String which will be displayed representing this submenu item
- */
- public AddSubMenu(@NonNull Integer menuID, @NonNull String menuName) {
- this();
- setMenuID(menuID);
- setMenuName(menuName);
- }
- /**
- * Returns an <i>Integer</i> object representing the Menu ID that identifies
- * a sub menu
- *
- * @return Integer -an integer representing the Menu ID that identifies a sub
- * menu
- */
- public Integer getMenuID() {
- return getInteger( KEY_MENU_ID );
- }
- /**
- * <p>Sets a Menu ID that identifies a sub menu.</p><p> This value is used in
- * {@linkplain AddCommand} to which SubMenu is the parent of the command
- * being added</p>
- *
- *
- * @param menuID
- * an integer object representing a Menu ID
- *
- * <p><b>Notes:</b> Min Value: 0; Max Value: 2000000000</p>
- */
- public void setMenuID( @NonNull Integer menuID ) {
- setParameters(KEY_MENU_ID, menuID);
- }
- /**
- * <p>Returns an <i>Integer</i> object representing the position of menu</p>
- *
- *
- * @return Integer -the value representing the relative position of menus
- */
- public Integer getPosition() {
- return getInteger( KEY_POSITION );
- }
- /**
- * Sets a position of menu
- *
- * @param position
- * <p>An Integer object representing the position within the items
- * of the top level Command Menu. 0 will insert at the front, 1
- * will insert after the first existing element, etc. Position of
- * any submenu will always be located before the return and exit
- * options
- * </p>
- * <b>Notes: </b>
- * <ul>
- * <li>
- * Min Value: 0; Max Value: 1000</li>
- * <li>If position is greater than or equal to the number of items
- * on top level, the sub menu will be appended by the end</li>
- * <li>If this parameter is omitted, the entry will be added at
- * the end of the list</li>
- * </ul>
- */
- public void setPosition( Integer position ) {
- setParameters(KEY_POSITION, position);
- }
- /**
- * Returns String which is displayed representing this submenu item
- *
- * @return String -a Submenu item's name
- */
- public String getMenuName() {
- return getString( KEY_MENU_NAME );
- }
- /**
- * Sets a menuName which is displayed representing this submenu item
- *
- * @param menuName
- * String which will be displayed representing this submenu item
- */
- public void setMenuName( @NonNull String menuName ) {
- setParameters(KEY_MENU_NAME, menuName);
- }
- /**
- * Returns Image to be be shown along with the submenu item
- *
- * @return Image - the submenu icon
- */
- public Image getMenuIcon() {
- return (Image) getObject(Image.class, KEY_MENU_ICON);
- }
- /**
- * Sets image to be be shown along with the submenu item
- *
- * @param menuIcon
- * Image to be be shown along with the submenu item
- */
- public void setMenuIcon(Image menuIcon) {
- setParameters(KEY_MENU_ICON, menuIcon);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java
deleted file mode 100644
index dff7cd091..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenuResponse.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Add SubMenu Response is sent, when AddSubMenu has been called
- * @since SmartDeviceLink 1.0
- */
-public class AddSubMenuResponse extends RPCResponse {
- /**
- * Constructs a new AddSubMenuResponse object
- */
-
- public AddSubMenuResponse() {
- super(FunctionID.ADD_SUB_MENU.toString());
- }
- public AddSubMenuResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new AddSubMenuResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public AddSubMenuResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java
deleted file mode 100644
index a1ef8aa88..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-
-import static com.smartdevicelink.proxy.constants.Names.driverCurtainAirbagDeployed;
-import static com.smartdevicelink.proxy.constants.Names.driverSideAirbagDeployed;
-
-/**
- * <p>The status of the air bags.</p>
- *
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Version.</th>
- * </tr>
- * <tr>
- * <td>driverAirbagDeployed </td>
- * <td>VehicleDataEventStatus</td>
- * <td>Status of driver airbag.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>driverSideAirbagDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>Status of driver side airbag.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>driverCurtainAirbagDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>Status of driver curtain airbag.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>passengerAirbagDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>Status of passenger airbag.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>passengerCurtainAirbagDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>Status of passenger curtain airbag.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>driverKneeAirbagDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>Status of driver knee airbag.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>passengerSideAirbagDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>Status of passenger side airbag.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>passengerKneeAirbagDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>Status of passenger knee airbag</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- *
- * </table>
- *
- * <p><b>Response:</b></p>
- * If a resultCode of "SUCCESS" is returned, the request was accepted by SDL. By the time the corresponding response is received, the Alert will have completed.
- *
- * <p><b> Non-default Result Codes:</b></p>
- * <p>REJECTED</p><p> ABORTED</P>
- *
- *
- * @since SmartDeviceLink 1.0
- *
- * @see TextFieldName
- * @see Image
- * @see SubscribeVehicleData
- */
-public class AirbagStatus extends RPCStruct {
- public static final String KEY_DRIVER_AIRBAG_DEPLOYED = "driverAirbagDeployed";
- public static final String KEY_DRIVER_SIDE_AIRBAG_DEPLOYED = "driverSideAirbagDeployed";
- public static final String KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED = "driverCurtainAirbagDeployed";
- public static final String KEY_DRIVER_KNEE_AIRBAG_DEPLOYED = "driverKneeAirbagDeployed";
- public static final String KEY_PASSENGER_AIRBAG_DEPLOYED = "passengerAirbagDeployed";
- public static final String KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED = "passengerSideAirbagDeployed";
- public static final String KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED = "passengerCurtainAirbagDeployed";
- public static final String KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED = "passengerKneeAirbagDeployed";
- /** Constructs a new AirbagStatus object indicated by the Hashtable
- * parameter
- * @param hash
- * The hash table to use
- *
- *
- */
-
- public AirbagStatus() { }
- public AirbagStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public AirbagStatus(@NonNull VehicleDataEventStatus driverAirbagDeployed, @NonNull VehicleDataEventStatus driverSideAirbagDeployed, @NonNull VehicleDataEventStatus driverCurtainAirbagDeployed, @NonNull VehicleDataEventStatus driverKneeAirbagDeployed,
- @NonNull VehicleDataEventStatus passengerCurtainAirbagDeployed, @NonNull VehicleDataEventStatus passengerAirbagDeployed, @NonNull VehicleDataEventStatus passengerSideAirbagDeployed, @NonNull VehicleDataEventStatus passengerKneeAirbagDeployed) {
- this();
- setDriverAirbagDeployed(driverAirbagDeployed);
- setDriverSideAirbagDeployed(driverSideAirbagDeployed);
- setDriverCurtainAirbagDeployed(driverCurtainAirbagDeployed);
- setDriverKneeAirbagDeployed(driverKneeAirbagDeployed);
- setPassengerAirbagDeployed(passengerAirbagDeployed);
- setPassengerSideAirbagDeployed(passengerSideAirbagDeployed);
- setPassengerCurtainAirbagDeployed(passengerCurtainAirbagDeployed);
- setPassengerKneeAirbagDeployed(passengerKneeAirbagDeployed);
- }
-
- public void setDriverAirbagDeployed(@NonNull VehicleDataEventStatus driverAirbagDeployed) {
- setValue(KEY_DRIVER_AIRBAG_DEPLOYED, driverAirbagDeployed);
- }
- public VehicleDataEventStatus getDriverAirbagDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_AIRBAG_DEPLOYED);
- }
- public void setDriverSideAirbagDeployed(@NonNull VehicleDataEventStatus driverSideAirbagDeployed) {
- setValue(KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, driverSideAirbagDeployed);
- }
- public VehicleDataEventStatus getDriverSideAirbagDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_SIDE_AIRBAG_DEPLOYED);
- }
- public void setDriverCurtainAirbagDeployed(@NonNull VehicleDataEventStatus driverCurtainAirbagDeployed) {
- setValue(KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, driverCurtainAirbagDeployed);
- }
- public VehicleDataEventStatus getDriverCurtainAirbagDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED);
- }
- public void setPassengerAirbagDeployed(@NonNull VehicleDataEventStatus passengerAirbagDeployed) {
- setValue(KEY_PASSENGER_AIRBAG_DEPLOYED, passengerAirbagDeployed);
- }
- public VehicleDataEventStatus getPassengerAirbagDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_AIRBAG_DEPLOYED);
- }
- public void setPassengerCurtainAirbagDeployed(@NonNull VehicleDataEventStatus passengerCurtainAirbagDeployed) {
- setValue(KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, passengerCurtainAirbagDeployed);
- }
- public VehicleDataEventStatus getPassengerCurtainAirbagDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED);
- }
- public void setDriverKneeAirbagDeployed(@NonNull VehicleDataEventStatus driverKneeAirbagDeployed) {
- setValue(KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, driverKneeAirbagDeployed);
- }
- public VehicleDataEventStatus getDriverKneeAirbagDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_KNEE_AIRBAG_DEPLOYED);
- }
- public void setPassengerSideAirbagDeployed(@NonNull VehicleDataEventStatus passengerSideAirbagDeployed) {
- setValue(KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, passengerSideAirbagDeployed);
- }
- public VehicleDataEventStatus getPassengerSideAirbagDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED);
- }
- public void setPassengerKneeAirbagDeployed(@NonNull VehicleDataEventStatus passengerKneeAirbagDeployed) {
- setValue(KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, passengerKneeAirbagDeployed);
- }
- public VehicleDataEventStatus getPassengerKneeAirbagDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java
deleted file mode 100644
index d0c4e0400..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java
+++ /dev/null
@@ -1,346 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Provides information to the user using either TTS, the Display or both and
- * can include a system-generated alert tone
- *
- * <ul>
- * <li>The displayed portion of the Alert, if any, will persist until the
- * specified timeout has elapsed, or the Alert is preempted</li>
- * <li>An Alert will preempt (abort) any SmartDeviceLink Operation that is in-progress,
- * except an already-in-progress Alert</li>
- * <li>An Alert cannot be preempted by any SmartDeviceLink Operation</li>
- * <li>An Alert can be preempted by a user action (button push)</li>
- * <li>An Alert will fail if it is issued while another Alert is in progress</li>
- * <li>Although each Alert parameter is optional, in fact each Alert request
- * must supply at least one of the following parameters:
- * <ul>
- * <li>alertText1</li>
- * <li>alertText2</li>
- * <li>alertText3</li>
- * <li>ttsChunks</li>
- * </ul>
- * </li>
- * </ul>
- *
- * <p><b>HMILevel needs to be FULL or LIMITED.</b></p>
- * <b>If the app has been granted function group Notification the HMILevel can
- * also be BACKGROUND</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>alertText1</td>
- * <td>String</td>
- * <td>Text to be displayed in the first field of the display during the Alert. </td>
- * <td>N</td>
- * <td> Length is limited to what is indicated in RegisterAppInterface response. If omitted, top display line will be cleared. Text is always centered</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>alertText2</td>
- * <td>String</td>
- * <td>Text to be displayed in the second field of the display during the Alert. </td>
- * <td>N</td>
- * <td> Only permitted if HMI supports a second display line. Length is limited to what is indicated in RegisterAppInterface response. If omitted, second display line will be cleared. </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>alertText3</td>
- * <td>String</td>
- * <td>Text to be displayed in the third field of the display during the Alert.</td>
- * <td>N</td>
- * <td>Array must have a least one element. </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>ttsChunks</td>
- * <td>TTSChunk[]</td>
- * <td>Array of type TTSChunk which, taken together, specify what is to be spoken to the user.</td>
- * <td>N</td>
- * <td>Array must have a least one element. </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>duration</td>
- * <td>Integer</td>
- * <td><p>The duration of the displayed portion of the alert, in milliseconds.</p> After this amount of time has passed, the display fields alertText1 and alertText2 will revert to what was displayed in those fields before the alert began.</td>
- * <td>N</td>
- * <td>Min Value: 3000 Max Value: 10000 <p>If omitted, the default is 5000 milliseconds</p></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>playTone</td>
- * <td>Boolean</td>
- * <td>Specifies whether the alert tone should be played before the TTS (if any) is spoken.</td>
- * <td>N</td>
- * <td>If omitted, default is true.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>softButtons</td>
- * <td>SoftButton[]</td>
- * <td>Specifies the softbuttons, the apps wants to use in this alert.</td>
- * <td></td>
- * <td>If omitted on supported displays, the alert will not have any SoftButton.ArrayMin: 0; ArrayMax: 4</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>progressIndicator</td>
- * <td>Boolean</td>
- * <td>If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- *
- *
- * @see GetVehicleData
- * @see OnVehicleData
- * @see Show
- * @see Speak
- */
-public class Alert extends RPCRequest {
- public static final String KEY_PLAY_TONE = "playTone";
- public static final String KEY_DURATION = "duration";
- public static final String KEY_ALERT_TEXT_1 = "alertText1";
- public static final String KEY_ALERT_TEXT_2 = "alertText2";
- public static final String KEY_ALERT_TEXT_3 = "alertText3";
- public static final String KEY_PROGRESS_INDICATOR = "progressIndicator";
- public static final String KEY_TTS_CHUNKS = "ttsChunks";
- public static final String KEY_SOFT_BUTTONS = "softButtons";
-
- /**
- * Constructs a new Alert object
- */
- public Alert() {
- super(FunctionID.ALERT.toString());
- }
- /**
- * <p>Constructs a new Alert object indicated by the Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public Alert(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Gets the text which is displayed in the first field of the display during
- * the Alert
- *
- * @return String - a String value representing the text which is displayed
- * in the first field during the Alert
- */
- public String getAlertText1() {
- return getString(KEY_ALERT_TEXT_1);
- }
- /**
- * Sets the String to be displayed in the first field of the display during
- * the Alert
- *
- * @param alertText1
- * String Value
- *
- * <p><b>Notes: </b></p>
- * <ul>
- * <li>Length is limited to what is indicated in <i>
- * {@linkplain RegisterAppInterface}</i> response</li>
- * <li>If omitted, top display line will be cleared</li>
- * <li>Text is always centered</li>
- * </ul>
- */
- public void setAlertText1(String alertText1) {
- setParameters(KEY_ALERT_TEXT_1, alertText1);
- }
- /**
- * Gets the text which is displayed in the second field of the display
- * during the Alert
- *
- * @return String -a String value representing the text which is displayed
- * in the second field during the Alert
- */
- public String getAlertText2() {
- return getString(KEY_ALERT_TEXT_2);
- }
- /**
- * Sets the String to be displayed in the second field of the display during
- * the Alert
- *
- * @param alertText2
- * String Value
- *
- * <p><b>Notes: </b></p>
- * <ul>
- * <li>Only permitted if HMI supports a second display line</li>
- * <li>Length is limited to what is indicated in <i>
- * {@linkplain RegisterAppInterface}</i> response</li>
- * <li>If omitted, second display line will be cleared</li>
- * <li>Text is always centered</li>
- * </ul>
- */
- public void setAlertText2(String alertText2) {
- setParameters(KEY_ALERT_TEXT_2, alertText2);
- }
-
- /**
- * Gets the text which is displayed in the third field of the display during
- * the Alert
- *
- * @return String -a String value representing the text which is displayed
- * in the third field during the Alert
- *
- * @since SmartDeviceLink 2.0
- */
- public String getAlertText3() {
- return getString(KEY_ALERT_TEXT_3);
- }
-
- /**
- * Sets the String to be displayed in the third field of the display during
- * the Alert
- *
- * @param alertText3
- * String Value
- *
- * <p> <b>Notes: </b></p>
- * <ul>
- * <li>Only permitted if HMI supports a third display line</li>
- * <li>Length is limited to what is indicated in <i>
- * {@linkplain RegisterAppInterface}</i> response</li>
- * <li>If omitted, third display line will be cleared</li>
- * <li>Text is always centered</li>
- * </ul>
- *
- * @since SmartDeviceLink 2.0
- */
- public void setAlertText3(String alertText3) {
- setParameters(KEY_ALERT_TEXT_3, alertText3);
- }
- /**
- * Gets TTSChunk[], the Array of type TTSChunk which, taken together,
- * specify what is to be spoken to the user
- *
- * @return List -a List<TTSChunk> value specify what is to be spoken to
- * the user
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getTtsChunks() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_CHUNKS);
- }
- /**
- * Sets array of type TTSChunk which, taken together, specify what is to be
- * spoken to the user
- *
- * @param ttsChunks
- *
- * <p> <b>Notes: </b>Array must have a least one element</p>
- */
- public void setTtsChunks(List<TTSChunk> ttsChunks) {
- setParameters(KEY_TTS_CHUNKS, ttsChunks);
- }
- /**
- * Gets the duration of the displayed portion of the alert, in milliseconds
- *
- * @return Integer -an Integer value representing the duration of the
- * displayed portion of the alert, in milliseconds
- */
- public Integer getDuration() {
- return getInteger(KEY_DURATION);
- }
- /**
- * <p>Sets the duration of the displayed portion of the alert, in milliseconds.
- * After this amount of time has passed, the display fields alertText1 and
- * alertText2 will revert to what was displayed in those fields before the
- * alert began</p>
- *
- *
- * @param duration
- * the Integer values representing the duration time, in
- * milliseconds
- * <p>
- * <b>Notes: </b></p>
- * <ul>
- * <li>Min Value: 3000; Max Value: 10000</li>
- * <li>If omitted, the default is 5000 milliseconds</li>
- * </ul>
- */
- public void setDuration(Integer duration) {
- setParameters(KEY_DURATION, duration);
- }
- /**
- * Gets a Boolean value representing the alert tone
- *
- * @return Boolean -If TRUE, means an alert tone will be played before the
- * TTS (if any) is spoken
- */
- public Boolean getPlayTone() {
- return getBoolean(KEY_PLAY_TONE);
- }
- /**
- * Sets whether the alert tone should be played before the TTS (if any) is
- * spoken
- *
- * @param playTone
- * a Boolean value which specifies whether the alert tone should
- * be played before the TTS (if any) is spoken
- *
- * <p> <b>Notes: </b>If omitted, default is true</p>
- */
- public void setPlayTone(Boolean playTone) {
- setParameters(KEY_PLAY_TONE, playTone);
- }
-
- /**
- * Gets the SoftButton List object
- *
- * @return List<SoftButton> -a List<SoftButton> representing the List
- * object
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<SoftButton> getSoftButtons() {
- return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
- }
-
- /**
- * Sets the SoftButtons
- *
- * @param softButtons
- * a List<SoftButton> value
- * <p>
- * <b>Notes: </b></p>
- * <ul>
- * <li>If omitted on supported displays, the alert will not have
- * any SoftButton</li>
- * <li>ArrayMin: 0</li>
- * <li>ArrayMax: 4</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
-
- public void setSoftButtons(List<SoftButton> softButtons) {
- setParameters(KEY_SOFT_BUTTONS, softButtons);
- }
- public Boolean getProgressIndicator() {
- return getBoolean(KEY_PROGRESS_INDICATOR);
- }
- public void setProgressIndicator(Boolean progressIndicator) {
- setParameters(KEY_PROGRESS_INDICATOR, progressIndicator);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java
deleted file mode 100644
index 4fd218fa8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * <p>This will bring up an alert with information related to the next navigation maneuver including potential voice
- * navigation instructions. Shown information will be taken from the ShowConstantTBT function
- * </p>
- * <p>Function Group: Navigation</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- *
- * @since SmartDeviceLink 2.0
- * @see ShowConstantTbt
- */
-public class AlertManeuver extends RPCRequest{
-
- public static final String KEY_TTS_CHUNKS = "ttsChunks";
- public static final String KEY_SOFT_BUTTONS = "softButtons";
-
- /**
- * Constructs a new AlertManeuver object
- */
- public AlertManeuver(){
- super(FunctionID.ALERT_MANEUVER.toString());
- }
-
- /**
- *
- * <p>Constructs a new AlertManeuver object indicated by the Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public AlertManeuver(Hashtable<String, Object> hash){
- super(hash);
- }
-
- /**
- * Gets the SoftButton List object
- *
- * @return List<SoftButton> -a List<SoftButton> representing the List object
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<SoftButton> getSoftButtons(){
- return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
- }
-
- /**
- * Sets the SoftButtons
- *
- * @param softButtons
- * a List<SoftButton> value
- * <p>
- * <b>Notes: </b></p>
- * <ul>
- * <li>If omitted on supported displays, the alert will not have any SoftButton</li>
- * <li>ArrayMin: 0</li>
- * <li>ArrayMax: 4</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
-
- public void setSoftButtons(List<SoftButton> softButtons){
- setParameters(KEY_SOFT_BUTTONS, softButtons);
- }
-
- /**
- * Gets TTSChunk[], the Array of type TTSChunk which, taken together, specify what is to be spoken to the user
- *
- * @return List -a List<TTSChunk> value specify what is to be spoken to the user
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getTtsChunks(){
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_CHUNKS);
- }
-
- /**
- * Sets array of type TTSChunk which, taken together, specify what is to be spoken to the user
- *
- * @param ttsChunks
- * <p>
- * <b>Notes: </b></p>Array must have a least one element
- */
- public void setTtsChunks(List<TTSChunk> ttsChunks){
- setParameters(KEY_TTS_CHUNKS, ttsChunks);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java
deleted file mode 100644
index f1a71bd66..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuverResponse.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Alert Maneuver Response is sent, when AlertManeuver has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class AlertManeuverResponse extends RPCResponse{
-
- /**
- * Constructs a new AlertManeuverResponse object
- */
- public AlertManeuverResponse() {
- super(FunctionID.ALERT_MANEUVER.toString());
- }
-
- /**
- * <p>
- * Constructs a new AlertManeuverResponse object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public AlertManeuverResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new AlertManeuverResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public AlertManeuverResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java
deleted file mode 100644
index c95be6e37..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-/**
- * Alert Response is sent, when Alert has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class AlertResponse extends RPCResponse {
- public static final String KEY_TRY_AGAIN_TIME = "tryAgainTime";
-
- /**
- * Constructs a new AlertResponse object
- */
- public AlertResponse() {
- super(FunctionID.ALERT.toString());
- }
-
- /**
- * <p>Constructs a new AlertResponse object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public AlertResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new AlertResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public AlertResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
- public Integer getTryAgainTime() {
- return getInteger(KEY_TRY_AGAIN_TIME);
- }
- public void setTryAgainTime(Integer tryAgainTime) {
- setParameters(KEY_TRY_AGAIN_TIME, tryAgainTime);
- }
-}
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
deleted file mode 100644
index fcaa7bf4c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java
+++ /dev/null
@@ -1,150 +0,0 @@
-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_KEEP_CONTEXT_AVAILABLE = "keepContextAvailable";
- public static final String KEY_VOLUME_AVAILABLE = "volumeAvailable";
- public static final String KEY_EQUALIZER_AVAILABLE = "equalizerAvailable";
- public static final String KEY_EQUALIZER_MAX_CHANNEL_ID = "equalizerMaxChannelId";
-
- /**
- * 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 keepContextAvailable portion of the AudioControlCapabilities class
- *
- * @param keepContextAvailable Availability of the keepContext parameter.
- */
- public void setKeepContextAvailable(Boolean keepContextAvailable) {
- setValue(KEY_KEEP_CONTEXT_AVAILABLE, keepContextAvailable);
- }
-
- /**
- * Gets the keepContextAvailable portion of the AudioControlCapabilities class
- *
- * @return Boolean - Availability of the keepContext parameter.
- */
- public Boolean getKeepContextAvailable() {
- return getBoolean(KEY_KEEP_CONTEXT_AVAILABLE);
- }
-
- /**
- * Sets the sourceAvailable portion of the AudioControlCapabilities class
- *
- * @param sourceAvailable Availability of the control of audio source.
- */
- 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
deleted file mode 100644
index b6ec0bfb1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java
+++ /dev/null
@@ -1,115 +0,0 @@
-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 not included.
- * If it is false, the system not only changes the audio source but also brings the default application or
- * system UI associated with the audio source to foreground.
- * If it is true, the system only changes the audio source, but keeps the current application in foreground.
- */
- public void setKeepContext(Boolean keepContext) {
- setValue(KEY_KEEP_CONTEXT, keepContext);
- }
-
- /**
- * 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 not included.
- * If it is false, the system not only changes the audio source but also brings the default application or
- * system UI associated with the audio source to foreground.
- * If it is true, the system only changes the audio source, but keeps the current application in foreground.
- */
- public Boolean getKeepContext() {
- return getBoolean(KEY_KEEP_CONTEXT);
- }
-
- /**
- * 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/AudioPassThruCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java
deleted file mode 100644
index 7252eeb83..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-
-import java.util.Hashtable;
-
-import static com.smartdevicelink.proxy.rpc.AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED;
-
-/**
- *<p> Describes different audio type configurations for PerformAudioPassThru, e.g. {8kHz,8-bit,PCM}
- * Specifies the capabilities of audio capturing: sampling rate, bits per sample, audio type.</p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>samplingRate</td>
- * <td>SamplingRate</td>
- * <td>Describes the sampling rate for AudioPassThru
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>bitsPerSample</td>
- * <td>BitsPerSample</td>
- * <td>Describes the sample depth in bit for AudioPassThru
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>audioType</td>
- * <td>AudioType</td>
- * <td>Describes the audiotype for AudioPassThru
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @see ButtonName
- * @see GetCapabilities
- * @since SmartDeviceLink 2.0
- */
-public class AudioPassThruCapabilities extends RPCStruct {
- public static final String KEY_SAMPLING_RATE = "samplingRate";
- public static final String KEY_AUDIO_TYPE = "audioType";
- public static final String KEY_BITS_PER_SAMPLE = "bitsPerSample";
-
- /**
- * Constructs a newly allocated AudioPassThruCapabilities object
- */
- public AudioPassThruCapabilities() {}
-
- /**
- * Constructs a newly allocated AudioPassThruCapabilities object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public AudioPassThruCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a newly allocated AudioPassThruCapabilities object
- * @param samplingRate the sampling rate for AudioPassThru
- * @param bitsPerSample the sample depth in bit for AudioPassThru
- * @param audioType the audiotype for AudioPassThru
- */
- public AudioPassThruCapabilities(@NonNull SamplingRate samplingRate, @NonNull BitsPerSample bitsPerSample, @NonNull AudioType audioType) {
- this();
- setSamplingRate(samplingRate);
- setBitsPerSample(bitsPerSample);
- setAudioType(audioType);
- }
-
- /**
- * set the sampling rate for AudioPassThru
- * @param samplingRate the sampling rate for AudioPassThru
- */
- public void setSamplingRate(@NonNull SamplingRate samplingRate) {
- setValue(KEY_SAMPLING_RATE, samplingRate);
- }
-
- /**
- * get the sampling rate for AudioPassThru
- * @return the sampling rate for AudioPassThru
- */
- public SamplingRate getSamplingRate() {
- return (SamplingRate) getObject(SamplingRate.class, KEY_SAMPLING_RATE);
- }
-
- /**
- * set the sample depth in bit for AudioPassThru
- * @param bitsPerSample the sample depth in bit for AudioPassThru
- */
- public void setBitsPerSample(@NonNull BitsPerSample bitsPerSample) {
- setValue(KEY_BITS_PER_SAMPLE, bitsPerSample);
- }
-
- /**
- * get the sample depth in bit for AudioPassThru
- * @return the sample depth in bit for AudioPassThru
- */
- public BitsPerSample getBitsPerSample() {
- return (BitsPerSample) getObject(BitsPerSample.class, KEY_BITS_PER_SAMPLE);
- }
-
- /**
- * set the audiotype for AudioPassThru
- * @param audioType the audiotype for AudioPassThru
- */
- public void setAudioType(@NonNull AudioType audioType) {
- setValue(KEY_AUDIO_TYPE, audioType);
- }
-
- /**
- * get the audiotype for AudioPassThru
- * @return the audiotype for AudioPassThru
- */
- public AudioType getAudioType() {
- return (AudioType) getObject(AudioType.class, KEY_AUDIO_TYPE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java
deleted file mode 100644
index 440343354..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java
+++ /dev/null
@@ -1,266 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-
-import static com.smartdevicelink.proxy.rpc.AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED;
-import static com.smartdevicelink.proxy.rpc.AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED;
-
-/** The status of the seat belts.
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Mandatory</th>
- * <th>Description</th>
- * </tr>
- * <tr>
- * <td>driverBeltDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The driver seat belt is deployed.</td>
- * </tr>
- * <tr>
- * <td>passengerBeltDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The passenger seat belt is deployed.</td>
- * </tr>
- * <tr>
- * <td>passengerBuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The passenger seat belt is buckled.</td>
- * </tr>
- * <tr>
- * <td>driverBuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The driver seat belt is buckled.</td>
- * </tr>
- * <tr>
- * <td>leftRow2BuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The left seat belt of the 2nd row is buckled.</td>
- * </tr>
- * <tr>
- * <td>passengerChildDetected</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The child passenger is detected.</td>
- * </tr>
- * <tr>
- * <td>rightRow2BuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The right seat belt of the 2nd row is buckled.</td>
- * </tr>
- * <tr>
- * <td>middleRow2BuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The middle seat belt of the 2nd row is buckled.</td>
- * </tr>
- * <tr>
- * <td>middleRow3BuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The middle seat belt of the 3rd row is buckled.</td>
- * </tr>
- * <tr>
- * <td>leftRow3BuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The left seat belt of the 3rd row is buckled.</td>
- * </tr>
- * <tr>
- * <td>rightRow3BuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The right seat belt of the 3rd row is buckled.</td>
- * </tr>
- * <tr>
- * <td>leftRearInflatableBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The left rear inflatable is belted.</td>
- * </tr>
- * <tr>
- * <td>rightRearInflatableBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The right rear inflatable is belted.</td>
- * </tr>
- * <tr>
- * <td>middleRow1BeltDeployed</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The seat belt of the middle row is deployed.</td>
- * </tr>
- * <tr>
- * <td>middleRow1BuckleBelted</td>
- * <td>VehicleDataEventStatus</td>
- * <td>false</td>
- * <td>The seat belt of the middle row is buckled.</td>
- * </tr>
- * </table>
-* @since SmartDeviceLink 2.0
-* @see VehicleDataEventStatus
-* @see GetVehicleData
-* @see OnVehicleData
- * @see SubscribeVehicleData
- */
-
-public class BeltStatus extends RPCStruct {
- public static final String KEY_DRIVER_BELT_DEPLOYED = "driverBeltDeployed";
- public static final String KEY_PASSENGER_BELT_DEPLOYED = "passengerBeltDeployed";
- public static final String KEY_PASSENGER_BUCKLE_BELTED = "passengerBuckleBelted";
- public static final String KEY_DRIVER_BUCKLE_BELTED = "driverBuckleBelted";
- public static final String KEY_LEFT_ROW_2_BUCKLE_BELTED = "leftRow2BuckleBelted";
- public static final String KEY_PASSENGER_CHILD_DETECTED = "passengerChildDetected";
- public static final String KEY_RIGHT_ROW_2_BUCKLE_BELTED = "rightRow2BuckleBelted";
- public static final String KEY_MIDDLE_ROW_2_BUCKLE_BELTED = "middleRow2BuckleBelted";
- public static final String KEY_MIDDLE_ROW_3_BUCKLE_BELTED = "middleRow3BuckleBelted";
- public static final String KEY_LEFT_ROW_3_BUCKLE_BELTED = "leftRow3BuckleBelted";
-
- public static final String KEY_RIGHT_ROW_3_BUCKLE_BELTED = "rightRow3BuckleBelted";
- public static final String KEY_REAR_INFLATABLE_BELTED = "rearInflatableBelted";
- public static final String KEY_RIGHT_REAR_INFLATABLE_BELTED = "rightRearInflatableBelted";
- public static final String KEY_MIDDLE_ROW_1_BELT_DEPLOYED = "middleRow1BeltDeployed";
- public static final String KEY_MIDDLE_ROW_1_BUCKLE_BELTED = "middleRow1BuckleBelted";
- /** Constructs a new BeltStatus object indicated by the Hashtable
- * parameter
- * @param hash
- * The hash table to use
- *
- *
- */
-
- public BeltStatus() { }
- public BeltStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public BeltStatus(@NonNull VehicleDataEventStatus driverBeltDeployed, @NonNull VehicleDataEventStatus passengerBeltDeployed, @NonNull VehicleDataEventStatus passengerBuckleBelted,
- @NonNull VehicleDataEventStatus driverBuckleBelted, @NonNull VehicleDataEventStatus leftRow2BuckleBelted, @NonNull VehicleDataEventStatus passengerChildDetected,
- @NonNull VehicleDataEventStatus rightRow2BuckleBelted, @NonNull VehicleDataEventStatus middleRow2BuckleBelted, @NonNull VehicleDataEventStatus middleRow3BuckleBelted,
- @NonNull VehicleDataEventStatus leftRow3BuckleBelted, @NonNull VehicleDataEventStatus rightRow3BuckleBelted, @NonNull VehicleDataEventStatus leftRearInflatableBelted,
- @NonNull VehicleDataEventStatus rightRearInflatableBelted, @NonNull VehicleDataEventStatus middleRow1BeltDeployed, @NonNull VehicleDataEventStatus middleRow1BuckleBelted
- ) {
- this();
- setDriverBeltDeployed(driverBeltDeployed);
- setPassengerBeltDeployed(passengerBeltDeployed);
- setPassengerBuckleBelted(passengerBuckleBelted);
- setDriverBuckleBelted(driverBuckleBelted);
- setLeftRow2BuckleBelted(leftRow2BuckleBelted);
- setPassengerChildDetected(passengerChildDetected);
- setRightRow2BuckleBelted(rightRow2BuckleBelted);
- setMiddleRow2BuckleBelted(middleRow2BuckleBelted);
- setMiddleRow3BuckleBelted(middleRow3BuckleBelted);
- setLeftRow3BuckleBelted(leftRow3BuckleBelted);
- setRightRow3BuckleBelted(rightRow3BuckleBelted);
- setLeftRearInflatableBelted(leftRearInflatableBelted);
- setRightRearInflatableBelted(rightRearInflatableBelted);
- setMiddleRow1BeltDeployed(middleRow1BeltDeployed);
- setMiddleRow1BuckleBelted(middleRow1BuckleBelted);
- }
-
- public void setDriverBeltDeployed(@NonNull VehicleDataEventStatus driverBeltDeployed) {
- setValue(KEY_DRIVER_BELT_DEPLOYED, driverBeltDeployed);
- }
- public VehicleDataEventStatus getDriverBeltDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BELT_DEPLOYED);
- }
- public void setPassengerBeltDeployed(@NonNull VehicleDataEventStatus passengerBeltDeployed) {
- setValue(KEY_PASSENGER_BELT_DEPLOYED, passengerBeltDeployed);
- }
- public VehicleDataEventStatus getPassengerBeltDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_BELT_DEPLOYED);
- }
- public void setPassengerBuckleBelted(@NonNull VehicleDataEventStatus passengerBuckleBelted) {
- setValue(KEY_PASSENGER_BUCKLE_BELTED, passengerBuckleBelted);
- }
- public VehicleDataEventStatus getPassengerBuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_BUCKLE_BELTED);
- }
- public void setDriverBuckleBelted(VehicleDataEventStatus driverBuckleBelted) {
- setValue(KEY_DRIVER_BUCKLE_BELTED, driverBuckleBelted);
- }
- public VehicleDataEventStatus getDriverBuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BUCKLE_BELTED);
- }
- public void setLeftRow2BuckleBelted(VehicleDataEventStatus leftRow2BuckleBelted) {
- setValue(KEY_LEFT_ROW_2_BUCKLE_BELTED, leftRow2BuckleBelted);
- }
- public VehicleDataEventStatus getLeftRow2BuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_LEFT_ROW_2_BUCKLE_BELTED);
- }
- public void setPassengerChildDetected(@NonNull VehicleDataEventStatus passengerChildDetected) {
- setValue(KEY_PASSENGER_CHILD_DETECTED, passengerChildDetected);
- }
- public VehicleDataEventStatus getPassengerChildDetected() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_CHILD_DETECTED);
- }
- public void setRightRow2BuckleBelted(@NonNull VehicleDataEventStatus rightRow2BuckleBelted) {
- setValue(KEY_RIGHT_ROW_2_BUCKLE_BELTED, rightRow2BuckleBelted);
- }
- public VehicleDataEventStatus getRightRow2BuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_ROW_2_BUCKLE_BELTED);
- }
- public void setMiddleRow2BuckleBelted(@NonNull VehicleDataEventStatus middleRow2BuckleBelted) {
- setValue(KEY_MIDDLE_ROW_2_BUCKLE_BELTED, middleRow2BuckleBelted);
- }
- public VehicleDataEventStatus getMiddleRow2BuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_2_BUCKLE_BELTED);
- }
- public void setMiddleRow3BuckleBelted(@NonNull VehicleDataEventStatus middleRow3BuckleBelted) {
- setValue(KEY_MIDDLE_ROW_3_BUCKLE_BELTED, middleRow3BuckleBelted);
- }
- public VehicleDataEventStatus getMiddleRow3BuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_3_BUCKLE_BELTED);
- }
- public void setLeftRow3BuckleBelted(@NonNull VehicleDataEventStatus leftRow3BuckleBelted) {
- setValue(KEY_LEFT_ROW_3_BUCKLE_BELTED, leftRow3BuckleBelted);
- }
- public VehicleDataEventStatus getLeftRow3BuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_LEFT_ROW_3_BUCKLE_BELTED);
- }
- public void setRightRow3BuckleBelted(@NonNull VehicleDataEventStatus rightRow3BuckleBelted) {
- setValue(KEY_RIGHT_ROW_3_BUCKLE_BELTED, rightRow3BuckleBelted);
- }
- public VehicleDataEventStatus getRightRow3BuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_ROW_3_BUCKLE_BELTED);
- }
- public void setLeftRearInflatableBelted(@NonNull VehicleDataEventStatus rearInflatableBelted) {
- setValue(KEY_REAR_INFLATABLE_BELTED, rearInflatableBelted);
- }
- public VehicleDataEventStatus getLeftRearInflatableBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_REAR_INFLATABLE_BELTED);
- }
- public void setRightRearInflatableBelted(@NonNull VehicleDataEventStatus rightRearInflatableBelted) {
- setValue(KEY_RIGHT_REAR_INFLATABLE_BELTED, rightRearInflatableBelted);
- }
- public VehicleDataEventStatus getRightRearInflatableBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_REAR_INFLATABLE_BELTED);
- }
- public void setMiddleRow1BeltDeployed(@NonNull VehicleDataEventStatus middleRow1BeltDeployed) {
- setValue(KEY_MIDDLE_ROW_1_BELT_DEPLOYED, middleRow1BeltDeployed);
- }
- public VehicleDataEventStatus getMiddleRow1BeltDeployed() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_1_BELT_DEPLOYED);
- }
- public void setMiddleRow1BuckleBelted(@NonNull VehicleDataEventStatus middleRow1BuckleBelted) {
- setValue(KEY_MIDDLE_ROW_1_BUCKLE_BELTED, middleRow1BuckleBelted);
- }
- public VehicleDataEventStatus getMiddleRow1BuckleBelted() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_1_BUCKLE_BELTED);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java
deleted file mode 100644
index 7773aaaa7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
-import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-
-import java.util.Hashtable;
-
-import static com.smartdevicelink.proxy.rpc.AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED;
-
-/** The body information including power modes.
- *
- * <p><b>Note:</b> The structure defines the information about the park brake and ignition.</p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Mandatory</th>
- * <th>Description</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>parkBrakeActive</td>
- * <td>Boolean</td>
- * <td>true</td>
- * <td>Describes, if the parkbreak is active. The information about the park brake: - true, if active - false if not.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>ignitionStableStatus</td>
- * <td>IgnitionStableStatus</td>
- * <td>true</td>
- * <td>Describes, if the ignition situation is considered stableThe information about stability of the ignition switch. See {@linkplain IgnitionStableStatus}</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>ignitionStatus</td>
- * <td>IgnitionStatus</td>
- * <td>true</td>
- * <td>The information about ignition status. See {@linkplain IgnitionStatus}</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>parkBrakeActive</td>
- * <td>Boolean</td>
- * <td>true</td>
- * <td>The information about the park brake: - true, if active - false if not.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>driverDoorAjar</td>
- * <td>Boolean</td>
- * <td>true</td>
- * <td>The information about the park brake: - true, if active - false if not.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>passengerDoorAjar</td>
- * <td>Boolean</td>
- * <td>true</td>
- * <td>The information about the park brake: - true, if active - false if not.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>rearLeftDoorAjar</td>
- * <td>Boolean</td>
- * <td>true</td>
- * <td>The information about the park brake: - true, if active - false if not.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>rearRightDoorAjar</td>
- * <td>Boolean</td>
- * <td>true</td>
- * <td>References signal "DrStatRr_B_Actl".</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * </table>
- * @since SmartDeviceLink 2.0
- * @see SubscribeVehicleData
- * @see GetVehicleData
- * @see OnVehicleData
- *
- */
-
-public class BodyInformation extends RPCStruct {
- public static final String KEY_PARK_BRAKE_ACTIVE = "parkBrakeActive";
- public static final String KEY_IGNITION_STABLE_STATUS = "ignitionStableStatus";
- public static final String KEY_IGNITION_STATUS = "ignitionStatus";
- public static final String KEY_DRIVER_DOOR_AJAR = "driverDoorAjar";
- public static final String KEY_PASSENGER_DOOR_AJAR = "passengerDoorAjar";
- public static final String KEY_REAR_LEFT_DOOR_AJAR = "rearLeftDoorAjar";
- public static final String KEY_REAR_RIGHT_DOOR_AJAR = "rearRightDoorAjar";
- /** Constructs a new BodyInformation object indicated by the Hashtable
- * parameter
- * @param hash
- * The hash table to use
- *
- *
- */
-
- public BodyInformation() { }
- public BodyInformation(Hashtable<String, Object> hash) {
- super(hash);
- }
- public BodyInformation(@NonNull Boolean parkBrakeActive, @NonNull IgnitionStableStatus ignitionStableStatus, @NonNull IgnitionStatus ignitionStatus) {
- this();
- setParkBrakeActive(parkBrakeActive);
- setIgnitionStableStatus(ignitionStableStatus);
- setIgnitionStatus(ignitionStatus);
- }
- public void setParkBrakeActive(@NonNull Boolean parkBrakeActive) {
- setValue(KEY_PARK_BRAKE_ACTIVE, parkBrakeActive);
- }
- public Boolean getParkBrakeActive() {
- return getBoolean(KEY_PARK_BRAKE_ACTIVE);
- }
- public void setIgnitionStableStatus(@NonNull IgnitionStableStatus ignitionStableStatus) {
- setValue(KEY_IGNITION_STABLE_STATUS, ignitionStableStatus);
- }
- public IgnitionStableStatus getIgnitionStableStatus() {
- return (IgnitionStableStatus) getObject(IgnitionStableStatus.class, KEY_IGNITION_STABLE_STATUS);
- }
- public void setIgnitionStatus(@NonNull IgnitionStatus ignitionStatus) {
- setValue(KEY_IGNITION_STATUS, ignitionStatus);
- }
- public IgnitionStatus getIgnitionStatus() {
- return (IgnitionStatus) getObject(IgnitionStatus.class, KEY_IGNITION_STATUS);
- }
-
- public void setDriverDoorAjar(Boolean driverDoorAjar) {
- setValue(KEY_DRIVER_DOOR_AJAR, driverDoorAjar);
- }
- public Boolean getDriverDoorAjar() {
- return getBoolean(KEY_DRIVER_DOOR_AJAR);
- }
-
-
- public void setPassengerDoorAjar(Boolean passengerDoorAjar) {
- setValue(KEY_PASSENGER_DOOR_AJAR, passengerDoorAjar);
- }
- public Boolean getPassengerDoorAjar() {
- return getBoolean(KEY_PASSENGER_DOOR_AJAR);
- }
-
- public void setRearLeftDoorAjar(Boolean rearLeftDoorAjar) {
- setValue(KEY_REAR_LEFT_DOOR_AJAR, rearLeftDoorAjar);
- }
- public Boolean getRearLeftDoorAjar() {
- return getBoolean(KEY_REAR_LEFT_DOOR_AJAR);
- }
-
- public void setRearRightDoorAjar(Boolean rearRightDoorAjar) {
- setValue(KEY_REAR_RIGHT_DOOR_AJAR, rearRightDoorAjar);
- }
- public Boolean getRearRightDoorAjar() {
- return getBoolean(KEY_REAR_RIGHT_DOOR_AJAR);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java
deleted file mode 100644
index b79685d12..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-
-/**
- * Provides information about the capabilities of a SDL HMI button.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>name</td>
- * <td>ButtonName</td>
- * <td>The name of theSDL HMI button.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>shortPressAvailable</td>
- * <td>Boolean</td>
- * <td>The button supports a SHORT press. See {@linkplain ButtonPressMode} for more information.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>longPressAvailable</td>
- * <td>Boolean</td>
- * <td>The button supports a LONG press. See {@linkplain ButtonPressMode} for more information.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>upDownAvailable</td>
- * <td>Boolean</td>
- * <td>The button supports "button down" and "button up". When the button is depressed, the <i>{@linkplain OnButtonEvent}</i> notification will be invoked with a value of BUTTONDOWN.
- * <p> When the button is released, the <i>{@linkplain OnButtonEvent}</i> notification will be invoked with a value of BUTTONUP.</p></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- *
- * <p>Upon the request HMI must provide the list of the following information:</p>
- * <p>The names of all existing/supported hardware buttons.</p>
- * <p>The availability of LONG/SHORT press for each existing/supported hardware button correspondingly</p>
- * <p>The availability of UP/DOWN events for each existing/supported hardware button correspondingly.</p>
- *
- * @since SmartDeviceLink 1.0
- *
- * @see ButtonName
- * @see ButtonEventMode
- * @see ButtonPressMode
- *
- *
- *
- * @see OnButtonEvent
- * @see OnButtonPress
- *
- */
-public class ButtonCapabilities extends RPCStruct {
- public static final String KEY_NAME = "name";
- public static final String KEY_SHORT_PRESS_AVAILABLE = "shortPressAvailable";
- public static final String KEY_LONG_PRESS_AVAILABLE = "longPressAvailable";
- public static final String KEY_UP_DOWN_AVAILABLE = "upDownAvailable";
- /**
- * Constructs a newly allocated ButtonCapabilities object
- */
- public ButtonCapabilities() { }
- /**
- * Constructs a newly allocated ButtonCapabilities object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public ButtonCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a newly allocated ButtonCapabilities object
- * @param name the name of button
- * @param shortPressAvailable True if support otherwise False.
- * @param longPressAvailable True if support otherwise False.
- * @param upDownAvailable True if support otherwise False.
- */
- public ButtonCapabilities(@NonNull ButtonName name, @NonNull Boolean shortPressAvailable, @NonNull Boolean longPressAvailable, @NonNull Boolean upDownAvailable) {
- this();
- setName(name);
- setShortPressAvailable(shortPressAvailable);
- setLongPressAvailable(longPressAvailable);
- setUpDownAvailable(upDownAvailable);
- }
- /**
- * Get the name of theSDL HMI button.
- * @return ButtonName the name of the Button
- */
- public ButtonName getName() {
- return (ButtonName) getObject(ButtonName.class, KEY_NAME);
- }
- /**
- * Set the name of theSDL HMI button.
- * @param name the name of button
- */
- public void setName( @NonNull ButtonName name ) {
- setValue(KEY_NAME, name);
- }
- /**
- * Whether the button supports a SHORT press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
- * @return True if support otherwise False.
- */
- public Boolean getShortPressAvailable() {
- return getBoolean( KEY_SHORT_PRESS_AVAILABLE );
- }
- /**
- * Set the button supports a SHORT press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
- * @param shortPressAvailable True if support otherwise False.
- */
- public void setShortPressAvailable( @NonNull Boolean shortPressAvailable ) {
- setValue(KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable);
- }
- /**
- * Whether the button supports a LONG press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
- * @return True if support otherwise False.
- */
- public Boolean getLongPressAvailable() {
- return getBoolean( KEY_LONG_PRESS_AVAILABLE );
- }
- /**
- * Set the button supports a LONG press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
- * @param longPressAvailable True if support otherwise False.
- */
- public void setLongPressAvailable( @NonNull Boolean longPressAvailable ) {
- setValue(KEY_LONG_PRESS_AVAILABLE, longPressAvailable);
- }
- /**
- * Whether the button supports "button down" and "button up". When the button is depressed, the <i>{@linkplain OnButtonEvent}</i> notification will be invoked with a value of BUTTONDOWN.
- * @return True if support otherwise False.
- */
- public Boolean getUpDownAvailable() {
- return getBoolean( KEY_UP_DOWN_AVAILABLE );
- }
- /**
- * Set the button supports "button down" and "button up". When the button is depressed, the <i>{@linkplain OnButtonEvent}</i> notification will be invoked with a value of BUTTONDOWN.
- * @param upDownAvailable True if support otherwise False.
- */
- public void setUpDownAvailable( @NonNull Boolean upDownAvailable ) {
- setValue(KEY_UP_DOWN_AVAILABLE, upDownAvailable);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java
deleted file mode 100644
index 94fb75083..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
-import com.smartdevicelink.proxy.rpc.enums.ModuleType;
-import java.util.Hashtable;
-
-/**
- * This function allows a remote control type mobile application
- * simulate a hardware button press event.
- */
-public class ButtonPress extends RPCRequest {
- public static final String KEY_MODULE_TYPE = "moduleType";
- public static final String KEY_BUTTON_NAME = "buttonName";
- public static final String KEY_BUTTON_PRESS_MODE = "buttonPressMode";
-
- /**
- * Constructs a new ButtonPress object
- */
- public ButtonPress() {
- super(FunctionID.BUTTON_PRESS.toString());
- }
-
- /**
- * <p>Constructs a new ButtonPress object indicated by the
- * Hashtable parameter</p>
- *
- * @param hash The Hashtable to use
- */
- public ButtonPress(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ButtonPress object
- * @param moduleType Represents module where the button should be pressed
- * @param buttonName Represents name of supported RC climate or radio button
- * @param buttonPressMode Indicates whether this is a LONG or SHORT button press event.
- */
- public ButtonPress(@NonNull ModuleType moduleType, @NonNull ButtonName buttonName, @NonNull ButtonPressMode buttonPressMode) {
- this();
- setModuleType(moduleType);
- setButtonName(buttonName);
- setButtonPressMode(buttonPressMode);
- }
-
- /**
- * Gets the ModuleType
- *
- * @return ModuleType - The module where the button should be pressed
- */
- public ModuleType getModuleType() {
- return (ModuleType) getObject(ModuleType.class, KEY_MODULE_TYPE);
- }
-
- /**
- * Sets a ModuleType
- *
- * @param moduleType
- * Represents module where the button should be pressed
- */
- public void setModuleType(@NonNull ModuleType moduleType) {
- setParameters(KEY_MODULE_TYPE, moduleType);
- }
-
- /**
- * Gets the ButtonName
- *
- * @return ButtonName - The name of supported RC climate or radio button
- */
- public ButtonName getButtonName() {
- return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
- }
-
- /**
- * Sets a ButtonName
- *
- * @param buttonName
- * Represents name of supported RC climate or radio button
- */
- public void setButtonName(@NonNull ButtonName buttonName) {
- setParameters(KEY_BUTTON_NAME, buttonName);
- }
-
- /**
- * Gets the ButtonPressMode
- *
- * @return ButtonPressMode - Indicates whether this is a LONG or SHORT button press event.
- */
- public ButtonPressMode getButtonPressMode() {
- return (ButtonPressMode) getObject(ButtonPressMode.class, KEY_BUTTON_PRESS_MODE);
- }
-
- /**
- * Sets a ButtonPressMode
- *
- * @param buttonPressMode
- * Indicates whether this is a LONG or SHORT button press event.
- */
- public void setButtonPressMode(@NonNull ButtonPressMode buttonPressMode) {
- setParameters(KEY_BUTTON_PRESS_MODE, buttonPressMode);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java
deleted file mode 100644
index f2644160e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPressResponse.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-public class ButtonPressResponse extends RPCResponse {
-
- /**
- * Constructs a new ButtonPressResponse object
- */
- public ButtonPressResponse() {
- super(FunctionID.BUTTON_PRESS.toString());
- }
-
- /**
- * <p>Constructs a new ButtonPressResponse object indicated by the
- * Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public ButtonPressResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new ButtonPressResponse object
- * @param resultCode whether the request is successfully processed
- * @param success whether the request is successfully processed
- */
- public ButtonPressResponse(@NonNull Result resultCode, @NonNull Boolean success) {
- this();
- setResultCode(resultCode);
- setSuccess(success);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java
deleted file mode 100644
index f2981412f..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java
+++ /dev/null
@@ -1,266 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * If the app recognizes during the app registration that the SDL HMI language
- * (voice/TTS and/or display) does not match the app language, the app will be
- * able (but does not need) to change this registration with changeRegistration
- * prior to app being brought into focus.
- *
- * <p>Function Group: Base</p>
- *
- * <p><b>HMILevel can by any</b></p>
- *
- * <b>Note:</b>
- *
- * <p>SDL will send the language value confirmed to be supported by HMI via UI.GetCapabilities.</p>
- * <p><b> Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>Language</td>
- * <td>Language</td>
- * <td>Requested SDL voice engine (VR+TTS) language registration.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>hmiDisplayLanguage</td>
- * <td>Language</td>
- * <td>Request display language registration.</td>
- * <td>Y</td>
- * <td>Minvalue=0; Maxvalue=2000000000</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * <tr>
- * <td>appName</td>
- * <td>String</td>
- * <td>Request new app name registration</td>
- * <td>N</td>
- * <td>maxlength:100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>ttsName</td>
- * <td>TTSChunk</td>
- * <td>Request new ttsName registration</td>
- * <td>N</td>
- * <td>minsize:1; maxsize:100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>ngnMediaScreenAppName</td>
- * <td>String</td>
- * <td>Request new app short name registration</td>
- * <td>N</td>
- * <td>maxlength: 100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>vrSynonyms</td>
- * <td>String</td>
- * <td>Request new VR synonyms registration</td>
- * <td>N</td>
- * <td>maxlength: 40; minsize:1; maxsize:100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * <p><b>Response </b></p>
- *
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p> TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>REJECTED</p>
- * <p>DISALLOWED</p>
- *
- * @since SmartDeviceLink 2.0
- * @see RegisterAppInterface
- */
-public class ChangeRegistration extends RPCRequest {
- public static final String KEY_LANGUAGE = "language";
- public static final String KEY_HMI_DISPLAY_LANGUAGE = "hmiDisplayLanguage";
- public static final String KEY_APP_NAME = "appName";
- public static final String KEY_TTS_NAME = "ttsName";
- public static final String KEY_NGN_MEDIA_SCREEN_NAME = "ngnMediaScreenAppName";
- public static final String KEY_VR_SYNONYMS = "vrSynonyms";
-
- /**
- * Constructs a new ChangeRegistration object
- */
- public ChangeRegistration() {
- super(FunctionID.CHANGE_REGISTRATION.toString());
- }
-
- /**
- * <p>Constructs a new ChangeRegistration object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public ChangeRegistration(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ChangeRegistration object
- * @param language a language value
- * @param hmiDisplayLanguage a Language value
- */
- public ChangeRegistration(@NonNull Language language, @NonNull Language hmiDisplayLanguage) {
- this();
- setLanguage(language);
- setHmiDisplayLanguage(hmiDisplayLanguage);
- }
-
- /**
- * Sets language
- *
- * @param language
- * a language value
- */
- public void setLanguage(@NonNull Language language) {
- setParameters(KEY_LANGUAGE, language);
- }
-
- /**
- * Gets language
- *
- * @return Language -a Language value
- */
- public Language getLanguage() {
- return (Language) getObject(Language.class, KEY_LANGUAGE);
- }
-
- /**
- * Sets HMI display language
- *
- * @param hmiDisplayLanguage
- * a Language value
- */
- public void setHmiDisplayLanguage(@NonNull Language hmiDisplayLanguage) {
- setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
- }
-
- /**
- * Gets HMI display language
- *
- * @return Language -a Language value
- */
- public Language getHmiDisplayLanguage() {
- return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE);
- }
-
- /**
- * Sets app name
- *
- * @param appName App name to set
- */
- public void setAppName(String appName){
- setParameters(KEY_APP_NAME, appName);
- }
-
- /**
- * Gets app name
- *
- * @return The app name
- */
- public String getAppName(){
- return getString(KEY_APP_NAME);
- }
-
- /**
- * Sets NGN media screen app name
- *
- * @param ngnAppName The NGN app name
- */
- public void setNgnMediaScreenAppName(String ngnAppName){
- setParameters(KEY_NGN_MEDIA_SCREEN_NAME, ngnAppName);
- }
-
- /**
- * Gets NGN media screen app name
- *
- * @return The NGN app name
- */
- public String getNgnMediaScreenAppName(){
- return getString(KEY_NGN_MEDIA_SCREEN_NAME);
- }
-
- /**
- * Sets the TTS name
- *
- * @param ttsName The TTS name to set
- */
- public void setTtsName(List<TTSChunk> ttsName){
- setParameters(KEY_TTS_NAME, ttsName);
- }
-
- /**
- * Gets the TTS name
- *
- * @return The TTS name
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getTtsName(){
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_NAME);
- }
-
- /**
- * Gets the List<String> representing the an array of 1-100 elements, each
- * element containing a voice-recognition synonym
- *
- * @return List<String> -a List value representing the an array of
- * 1-100 elements, each element containing a voice-recognition
- * synonym
- */
- @SuppressWarnings("unchecked")
- public List<String> getVrSynonyms() {
- return (List<String>) getObject(String.class, KEY_VR_SYNONYMS);
- }
-
- /**
- * Sets a vrSynonyms representing the an array of 1-100 elements, each
- * element containing a voice-recognition synonym
- *
- * @param vrSynonyms
- * a List<String> value representing the an array of 1-100
- * elements
- * <p>
- * <b>Notes: </b></p>
- * <ul>
- * <li>Each vr synonym is limited to 40 characters, and there can
- * be 1-100 synonyms in array</li>
- * <li>May not be the same (by case insensitive comparison) as
- * the name or any synonym of any currently-registered
- * application</li>
- * </ul>
- */
- public void setVrSynonyms(List<String> vrSynonyms) {
- setParameters(KEY_VR_SYNONYMS, vrSynonyms);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java
deleted file mode 100644
index 4c1b0209b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistrationResponse.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Change Registration Response is sent, when ChangeRegistration has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class ChangeRegistrationResponse extends RPCResponse {
-
- /**
- * Constructs a new ChangeRegistrationResponse object
- */
- public ChangeRegistrationResponse() {
- super(FunctionID.CHANGE_REGISTRATION.toString());
- }
-
- /**
- * <p>Constructs a new ChangeRegistrationResponse object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public ChangeRegistrationResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ChangeRegistrationResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public ChangeRegistrationResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-}
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
deleted file mode 100644
index e93196bd5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
+++ /dev/null
@@ -1,229 +0,0 @@
-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;
-
-/**
- * A choice is an option which a user can select either via the menu or via voice recognition (VR) during an application initiated interaction.
- * For example, the application may request for the user`s choice among several suggested ones: Yes, No, Skip.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>choiceID</td>
- * <td>Integer</td>
- * <td>Application-scoped identifier that uniquely identifies this choice.
- * Min: 0;
- * Max: 65535
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>menuName</td>
- * <td>String</td>
- * <td>Text which appears in menu, representing this choice.
- * Min: 1;
- * Max: 100
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>vrCommands</td>
- * <td>String[]</td>
- * <td>An array of strings to be used as VR synonyms for this choice. If this array is provided, it must have at least one non-empty element</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>image</td>
- * <td>Image</td>
- * <td>Either a static hex icon value or a binary image file name identifier (sent by PutFile).</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * @since SmartDeviceLink 1.0
- *
- * @see AddCommand
- * @see PerformInteraction
- * @see Image
- */
-public class Choice extends RPCStruct {
- public static final String KEY_SECONDARY_TEXT = "secondaryText";
- public static final String KEY_TERTIARY_TEXT = "tertiaryText";
- public static final String KEY_SECONDARY_IMAGE = "secondaryImage";
- public static final String KEY_MENU_NAME = "menuName";
- 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
- */
- 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
- */
- public Integer getChoiceID() {
- return getInteger(KEY_CHOICE_ID);
- }
- /**
- * Set the application-scoped identifier that uniquely identifies this choice.
- * @param choiceID Min: 0 Max: 65535
- */
- public void setChoiceID(@NonNull Integer choiceID) {
- setValue(KEY_CHOICE_ID, choiceID);
- }
- /**
- * Text which appears in menu, representing this choice.
- * Min: 1;
- * Max: 100
- * @return menuName the menu name
- */
- public String getMenuName() {
- return getString(KEY_MENU_NAME);
- }
- /**
- * Text which appears in menu, representing this choice.
- * Min: 1;
- * Max: 100
- * @param menuName the menu name
- */
- public void setMenuName(@NonNull String menuName) {
- setValue(KEY_MENU_NAME, menuName);
- }
- /**
- * Get an array of strings to be used as VR synonyms for this choice. If this array is provided, it must have at least one non-empty element
- * @return vrCommands List
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<String> getVrCommands() {
- return (List<String>) getObject(String.class, KEY_VR_COMMANDS);
- }
- /**
- * Set an array of strings to be used as VR synonyms for this choice. If this array is provided, it must have at least one non-empty element
- * @param vrCommands the List of vrCommands
- * @since SmartDeviceLink 2.0
- */
- public void setVrCommands(List<String> vrCommands) {
- setValue(KEY_VR_COMMANDS, vrCommands);
- }
- /**
- * Set the image
- * @param image the image of the choice
- */
- public void setImage(Image image) {
- setValue(KEY_IMAGE, image);
- }
- /**
- * Get the image
- * @return the image of the choice
- */
- @SuppressWarnings("unchecked")
- public Image getImage() {
- return (Image) getObject(Image.class, KEY_IMAGE);
- }
-
- public String getSecondaryText() {
- return getString(KEY_SECONDARY_TEXT);
- }
-
- public void setSecondaryText(String secondaryText) {
- setValue(KEY_SECONDARY_TEXT, secondaryText);
- }
-
- public String getTertiaryText() {
- return getString(KEY_TERTIARY_TEXT);
- }
-
- public void setTertiaryText(String tertiaryText) {
- setValue(KEY_TERTIARY_TEXT, tertiaryText);
- }
-
- public void setSecondaryImage(Image image) {
- setValue(KEY_SECONDARY_IMAGE, image);
- }
-
- @SuppressWarnings("unchecked")
- public Image getSecondaryImage() {
- return (Image) getObject(Image.class, KEY_SECONDARY_IMAGE);
- }
-}
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
deleted file mode 100644
index 335fffa48..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
+++ /dev/null
@@ -1,374 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.DefrostZone;
-import com.smartdevicelink.proxy.rpc.enums.VentilationMode;
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Contains information about a climate control module's capabilities.
- */
-
-public class ClimateControlCapabilities extends RPCStruct{
- public static final String KEY_MODULE_NAME= "moduleName";
- public static final String KEY_FAN_SPEED_AVAILABLE= "fanSpeedAvailable";
- public static final String KEY_DESIRED_TEMPERATURE_AVAILABLE= "desiredTemperatureAvailable";
- public static final String KEY_AC_ENABLE_AVAILABLE= "acEnableAvailable";
- public static final String KEY_AC_MAX_ENABLE_AVAILABLE= "acMaxEnableAvailable";
- public static final String KEY_CIRCULATE_AIR_ENABLE_AVAILABLE= "circulateAirEnableAvailable";
- public static final String KEY_AUTO_MODE_ENABLE_AVAILABLE= "autoModeEnableAvailable";
- public static final String KEY_DUAL_MODE_ENABLE_AVAILABLE= "dualModeEnableAvailable";
- public static final String KEY_DEFROST_ZONE_AVAILABLE= "defrostZoneAvailable";
- 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() {
- }
-
- public ClimateControlCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated ClimateControlCapabilities
- *
- * @param moduleName The short friendly name of the climate control module. It should not be used to identify a module by mobile application.
- */
- public ClimateControlCapabilities(@NonNull String moduleName) {
- this();
- setModuleName(moduleName);
- }
-
- /**
- * Sets the moduleName portion of the ClimateControlCapabilities class
- *
- * @param moduleName The short friendly name of the climate 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 ClimateControlCapabilities class
- *
- * @return String - Short friendly name of the climate control module.
- */
- public String getModuleName() {
- return getString(KEY_MODULE_NAME);
- }
-
- /**
- * Sets the fanSpeedAvailable portion of the ClimateControlCapabilities class
- *
- * @param fanSpeedAvailable
- * Availability of the control of fan speed.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setFanSpeedAvailable(Boolean fanSpeedAvailable) {
- setValue(KEY_FAN_SPEED_AVAILABLE, fanSpeedAvailable);
- }
-
- /**
- * Gets the fanSpeedAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of fan speed.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getFanSpeedAvailable() {
- return getBoolean(KEY_FAN_SPEED_AVAILABLE);
- }
-
- /**
- * Sets the desiredTemperatureAvailable portion of the ClimateControlCapabilities class
- *
- * @param desiredTemperatureAvailable
- * Availability of the control of desired temperature.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setDesiredTemperatureAvailable(Boolean desiredTemperatureAvailable) {
- setValue(KEY_DESIRED_TEMPERATURE_AVAILABLE, desiredTemperatureAvailable);
- }
-
- /**
- * Gets the desiredTemperatureAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of desired temperature.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getDesiredTemperatureAvailable() {
- return getBoolean(KEY_DESIRED_TEMPERATURE_AVAILABLE);
- }
-
- /**
- * Sets the acEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @param acEnableAvailable
- * Availability of the control of turn on/off AC.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setAcEnableAvailable(Boolean acEnableAvailable) {
- setValue(KEY_AC_ENABLE_AVAILABLE, acEnableAvailable);
- }
-
- /**
- * Gets the acEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of turn on/off AC.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getAcEnableAvailable() {
- return getBoolean(KEY_AC_ENABLE_AVAILABLE);
- }
-
- /**
- * Sets the acMaxEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @param acMaxEnableAvailable
- * Availability of the control of enable/disable air conditioning is ON on the maximum level.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setAcMaxEnableAvailable(Boolean acMaxEnableAvailable) {
- setValue(KEY_AC_MAX_ENABLE_AVAILABLE, acMaxEnableAvailable);
- }
-
- /**
- * Gets the acMaxEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of enable/disable air conditioning is ON on the maximum level.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getAcMaxEnableAvailable() {
- return getBoolean(KEY_AC_MAX_ENABLE_AVAILABLE);
- }
-
- /**
- * Sets the circulateAirEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @param circulateAirEnableAvailable
- * Availability of the control of enable/disable circulate Air mode.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setCirculateAirEnableAvailable(Boolean circulateAirEnableAvailable) {
- setValue(KEY_CIRCULATE_AIR_ENABLE_AVAILABLE, circulateAirEnableAvailable);
- }
-
- /**
- * Gets the circulateAirEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of enable/disable circulate Air mode.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getCirculateAirEnableAvailable() {
- return getBoolean(KEY_CIRCULATE_AIR_ENABLE_AVAILABLE);
- }
-
- /**
- * Sets the autoModeEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @param autoModeEnableAvailable
- * Availability of the control of enable/disable auto mode.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setAutoModeEnableAvailable(Boolean autoModeEnableAvailable) {
- setValue(KEY_AUTO_MODE_ENABLE_AVAILABLE, autoModeEnableAvailable);
- }
-
- /**
- * Gets the autoModeEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of enable/disable auto mode.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getAutoModeEnableAvailable() {
- return getBoolean(KEY_AUTO_MODE_ENABLE_AVAILABLE);
- }
-
- /**
- * Sets the dualModeEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @param dualModeEnableAvailable
- * Availability of the control of enable/disable dual mode.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setDualModeEnableAvailable(Boolean dualModeEnableAvailable) {
- setValue(KEY_DUAL_MODE_ENABLE_AVAILABLE, dualModeEnableAvailable);
- }
-
- /**
- * Gets the dualModeEnableAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of enable/disable dual mode.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getDualModeEnableAvailable() {
- return getBoolean(KEY_DUAL_MODE_ENABLE_AVAILABLE);
- }
-
- /**
- * Sets the defrostZoneAvailable portion of the ClimateControlCapabilities class
- *
- * @param defrostZoneAvailable
- * Availability of the control of defrost zones.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setDefrostZoneAvailable(Boolean defrostZoneAvailable) {
- setValue(KEY_DEFROST_ZONE_AVAILABLE, defrostZoneAvailable);
- }
-
- /**
- * Gets the defrostZoneAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of defrost zones.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getDefrostZoneAvailable() {
- return getBoolean(KEY_DEFROST_ZONE_AVAILABLE);
- }
-
- /**
- * Gets the List<DefrostZone> portion of the ClimateControlCapabilities class
- *
- * @return List<DefrostZone> - A set of all defrost zones that are controllable.
- */
- public List<DefrostZone> getDefrostZone() {
- return (List<DefrostZone>) getObject(DefrostZone.class, KEY_DEFROST_ZONE);
- }
-
- /**
- * Sets the defrostZone portion of the ClimateControlCapabilities class
- *
- * @param defrostZone
- * A set of all defrost zones that are controllable.
- */
- public void setDefrostZone(List<DefrostZone> defrostZone) {
- setValue(KEY_DEFROST_ZONE, defrostZone);
- }
-
- /**
- * Sets the ventilationModeAvailable portion of the ClimateControlCapabilities class
- *
- * @param ventilationModeAvailable
- * Availability of the control of air ventilation mode.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setVentilationModeAvailable(Boolean ventilationModeAvailable) {
- setValue(KEY_VENTILATION_MODE_AVAILABLE, ventilationModeAvailable);
- }
-
- /**
- * Gets the ventilationModeAvailable portion of the ClimateControlCapabilities class
- *
- * @return Boolean - Availability of the control of air ventilation mode.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getVentilationModeAvailable() {
- return getBoolean(KEY_VENTILATION_MODE_AVAILABLE);
- }
-
- /**
- * Gets the List<VentilationMode> portion of the ClimateControlCapabilities class
- *
- * @return List<VentilationMode> - A set of all ventilation modes that are controllable.
- */
- public List<VentilationMode> getVentilationMode() {
- return (List<VentilationMode>) getObject(VentilationMode.class, KEY_VENTILATION_MODE);
- }
-
- /**
- * Sets the ventilationMode portion of the ClimateControlCapabilities class
- *
- * @param ventilationMode
- * A set of all ventilation modes that are controllable.
- */
- 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
deleted file mode 100644
index 1229e4668..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
+++ /dev/null
@@ -1,183 +0,0 @@
-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{
- public static final String KEY_FAN_SPEED= "fanSpeed";
- public static final String KEY_CURRENT_TEMPERATURE= "currentTemperature";
- public static final String KEY_DESIRED_TEMPERATURE= "desiredTemperature";
- public static final String KEY_AC_ENABLE= "acEnable";
- public static final String KEY_CIRCULATE_AIR_ENABLE= "circulateAirEnable";
- public static final String KEY_AUTO_MODE_ENABLE= "autoModeEnable";
- public static final String KEY_DEFROST_ZONE= "defrostZone";
- 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() {
- }
-
- public ClimateControlData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public void setFanSpeed(Integer fanSpeed) {
- setValue(KEY_FAN_SPEED, fanSpeed);
- }
-
- public Integer getFanSpeed() {
- return getInteger(KEY_FAN_SPEED);
- }
-
- public void setCurrentTemperature(Temperature currentTemperature) {
- setValue(KEY_CURRENT_TEMPERATURE, currentTemperature);
- }
-
- public Temperature getCurrentTemperature() {
- return (Temperature) getObject(Temperature.class, KEY_CURRENT_TEMPERATURE);
- }
-
- public void setDesiredTemperature(Temperature desiredTemperature) {
- setValue(KEY_DESIRED_TEMPERATURE, desiredTemperature);
- }
-
- public Temperature getDesiredTemperature() {
- return (Temperature) getObject(Temperature.class, KEY_DESIRED_TEMPERATURE);
- }
-
- public void setAcEnable(Boolean acEnable) {
- setValue(KEY_AC_ENABLE, acEnable);
- }
-
- public Boolean getAcEnable() {
- return getBoolean(KEY_AC_ENABLE);
- }
-
- public void setCirculateAirEnable(Boolean circulateAirEnable) {
- setValue(KEY_CIRCULATE_AIR_ENABLE, circulateAirEnable);
- }
-
- public Boolean getCirculateAirEnable() {
- return getBoolean(KEY_CIRCULATE_AIR_ENABLE);
- }
-
- public void setAutoModeEnable(Boolean autoModeEnable) {
- setValue(KEY_AUTO_MODE_ENABLE, autoModeEnable);
- }
-
- public Boolean getAutoModeEnable() {
- return getBoolean(KEY_AUTO_MODE_ENABLE);
- }
-
- public void setDefrostZone(DefrostZone defrostZone) {
- setValue(KEY_DEFROST_ZONE, defrostZone);
- }
-
- public DefrostZone getDefrostZone() {
- return (DefrostZone) getObject(DefrostZone.class, KEY_DEFROST_ZONE);
- }
-
- public void setDualModeEnable(Boolean dualModeEnable) {
- setValue(KEY_DUAL_MODE_ENABLE, dualModeEnable);
- }
-
- public Boolean getDualModeEnable() {
- return getBoolean(KEY_DUAL_MODE_ENABLE);
- }
-
- public void setAcMaxEnable(Boolean acMaxEnable) {
- setValue(KEY_AC_MAX_ENABLE, acMaxEnable);
- }
-
- public Boolean getAcMaxEnable() {
- return getBoolean(KEY_AC_MAX_ENABLE);
- }
-
- public void setVentilationMode(VentilationMode ventilationMode) {
- setValue(KEY_VENTILATION_MODE, ventilationMode);
- }
-
- 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/ClusterModeStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java
deleted file mode 100644
index 3f663ca35..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus;
-import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus;
-
-import static android.provider.Contacts.SettingsColumns.KEY;
-
-/** <p>The status modes of the instrument panel cluster.</p>
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Mandatory</th>
- * <th>Description</th>
- * </tr>
- * <tr>
- * <td>powerModeActive</td>
- * <td>Boolean</td>
- * <td></td>
- * <td>References signal "PowerMode_UB".</td>
- * </tr>
- * <tr>
- * <td>powerModeQualificationStatus</td>
- * <td>PowerModeQualificationStatus</td>
- * <td></td>
- * <td>References signal "PowerModeQF".</td>
- * </tr>
- * <tr>
- * <td>carModeStatus</td>
- * <td>CarModeStatus</td>
- * <td></td>
- * <td>Describes the carmode the vehicle is in.</td>
- * </tr>
- * <tr>
- * <td>powerModeStatus</td>
- * <td>PowerModeStatus</td>
- * <td>true</td>
- * <td>Describes the different powermodes</td>
- * </tr>
- *
- * </table>
- * @since SmartDeviceLink 1.0
- *
- * @see SubscribeVehicleData
- * @see SubscribeVehicleData
- * @see Image
- *
- */
-
-public class ClusterModeStatus extends RPCStruct {
- public static final String KEY_POWER_MODE_ACTIVE = "powerModeActive";
- public static final String KEY_POWER_MODE_QUALIFICATION_STATUS = "powerModeQualificationStatus";
- public static final String KEY_CAR_MODE_STATUS = "carModeStatus";
- public static final String KEY_POWER_MODE_STATUS = "powerModeStatus";
- /** <p>Constructs a new ClusterModeStatus object indicated by the Hashtable
- * parameter</p>
- * @param hash
- * The hash table to use
- *
- */
-
- public ClusterModeStatus() { }
- public ClusterModeStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
- public ClusterModeStatus(@NonNull Boolean powerModeActive, @NonNull PowerModeQualificationStatus powerModeQualificationStatus, @NonNull CarModeStatus carModeStatus, @NonNull PowerModeStatus powerModeStatus) {
- this();
- setPowerModeActive(powerModeActive);
- setPowerModeQualificationStatus(powerModeQualificationStatus);
- setCarModeStatus(carModeStatus);
- setPowerModeStatus(powerModeStatus);
- }
-
- public void setPowerModeActive(@NonNull Boolean powerModeActive) {
- setValue(KEY_POWER_MODE_ACTIVE, powerModeActive);
- }
- public Boolean getPowerModeActive() {
- return getBoolean(KEY_POWER_MODE_ACTIVE);
- }
- public void setPowerModeQualificationStatus(@NonNull PowerModeQualificationStatus powerModeQualificationStatus) {
- setValue(KEY_POWER_MODE_QUALIFICATION_STATUS, powerModeQualificationStatus);
- }
- public PowerModeQualificationStatus getPowerModeQualificationStatus() {
- return (PowerModeQualificationStatus) getObject(PowerModeQualificationStatus.class, KEY_POWER_MODE_QUALIFICATION_STATUS);
- }
- public void setCarModeStatus(@NonNull CarModeStatus carModeStatus) {
- setValue(KEY_CAR_MODE_STATUS, carModeStatus);
- }
- public CarModeStatus getCarModeStatus() {
- return (CarModeStatus) getObject(CarModeStatus.class, KEY_CAR_MODE_STATUS);
- }
- public void setPowerModeStatus(@NonNull PowerModeStatus powerModeStatus) {
- setValue(KEY_POWER_MODE_STATUS, powerModeStatus);
- }
- public PowerModeStatus getPowerModeStatus() {
- return (PowerModeStatus) getObject(PowerModeStatus.class, KEY_POWER_MODE_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java
deleted file mode 100644
index f886ff52a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import java.util.Hashtable;
-
-public class Coordinate extends RPCStruct{
- public static final String KEY_LATITUDE_DEGREES = "latitudeDegrees";
- public static final String KEY_LONGITUDE_DEGREES = "longitudeDegrees";
-
- public Coordinate() {
- }
-
- public Coordinate(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public Coordinate(@NonNull Float latitudeDegrees, @NonNull Float longitudeDegrees) {
- this();
- setLatitudeDegrees(latitudeDegrees);
- setLongitudeDegrees(longitudeDegrees);
- }
-
- public Float getLatitudeDegrees() {
- Object value = getValue(KEY_LATITUDE_DEGREES);
- return SdlDataTypeConverter.objectToFloat(value);
- }
-
- public void setLatitudeDegrees(@NonNull Float latitudeDegrees) {
- setValue(KEY_LATITUDE_DEGREES, latitudeDegrees);
- }
-
- public Float getLongitudeDegrees() {
- Object value = getValue(KEY_LONGITUDE_DEGREES);
- return SdlDataTypeConverter.objectToFloat(value);
- }
-
- public void setLongitudeDegrees(@NonNull Float longitudeDegrees) {
- setValue(KEY_LONGITUDE_DEGREES, longitudeDegrees);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java
deleted file mode 100644
index 07f17d1e6..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Creates a Choice Set which can be used in subsequent <i>
- * {@linkplain PerformInteraction}</i> Operations.
- *
- * <p>Function Group: Base </p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p>AudioStreamingState : ANY</p>
- *
- * <p>SystemContext: MAIN, MENU, VR</p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>interactionChoiceSetID</td>
- * <td>Integer</td>
- * <td>A unique ID that identifies the Choice Set</td>
- * <td>Y</td>
- * <td>Min Value: 0; Max Value: 2000000000</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>choiceSet</td>
- * <td>Choice[]</td>
- * <td>Array of one or more elements.</td>
- * <td>Y</td>
- * <td>Min Value: 1; Max Value: 100</td>
- * <td>SmartDeviceLink 1.0 </td>
- * </tr>
- * </table>
- *
- *
- * <p> <b>Note:</b></p>Second Utterance issue with CreateInteractionChoiceSet RPC. Before a perform interaction
- * is sent you MUST wait for the success from the CreateInteractionChoiceSet RPC.
- * If you do not wait the system may not recognize the first utterance from the user.
- *
- * <p><b>Response</b></p>
- *
- * Indicates that the corresponding request either failed or succeeded. If the response returns with a SUCCESS result code, this means the Choice Set was created.
- *
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p> REJECTED</p>
- * <p> INVALID_ID</p>
- * <p> DUPLICATE_NAME</p>
- * <p>UNSUPPORTED_RESOURCE </p>
- *
- *
- * @since SmartDeviceLink 1.0
- * @see DeleteInteractionChoiceSet
- * @see PerformInteraction
- */
-public class CreateInteractionChoiceSet extends RPCRequest {
- public static final String KEY_CHOICE_SET = "choiceSet";
- public static final String KEY_INTERACTION_CHOICE_SET_ID = "interactionChoiceSetID";
-
- /**
- * Constructs a new CreateInteractionChoiceSet object
- */
- public CreateInteractionChoiceSet() {
- super(FunctionID.CREATE_INTERACTION_CHOICE_SET.toString());
- }
- /**
- * <p>Constructs a new CreateInteractionChoiceSet object indicated by the
- * Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public CreateInteractionChoiceSet(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new CreateInteractionChoiceSet object
- * @param interactionChoiceSetID: an Integer value representing the Choice Set ID
- * <b>Notes: </b>Min Value: 0; Max Value: 2000000000
- * @param choiceSet: a List<Choice> representing the array of one or more elements
- * <b>Notes: </b>Min Value: 1; Max Value: 100
- */
- public CreateInteractionChoiceSet(@NonNull Integer interactionChoiceSetID, @NonNull List<Choice> choiceSet) {
- this();
- setInteractionChoiceSetID(interactionChoiceSetID);
- setChoiceSet(choiceSet);
- }
- /**
- * Gets the Choice Set unique ID
- *
- * @return Integer -an Integer representing the Choice Set ID
- */
- public Integer getInteractionChoiceSetID() {
- return getInteger( KEY_INTERACTION_CHOICE_SET_ID );
- }
- /**
- * Sets a unique ID that identifies the Choice Set
- *
- * @param interactionChoiceSetID
- * an Integer value representing the Choice Set ID
- *
- * <b>Notes: </b>Min Value: 0; Max Value: 2000000000
- */
- public void setInteractionChoiceSetID( @NonNull Integer interactionChoiceSetID ) {
- setParameters(KEY_INTERACTION_CHOICE_SET_ID, interactionChoiceSetID);
- }
- /**
- * Gets Choice Set Array of one or more elements
- *
- * @return List<Choice> -a List<Choice> representing the array of one or
- * more elements
- */
- @SuppressWarnings("unchecked")
- public List<Choice> getChoiceSet() {
- return (List<Choice>) getObject(Choice.class, KEY_CHOICE_SET);
- }
- /**
- * Sets a Choice Set that is an Array of one or more elements
- *
- * @param choiceSet
- * a List<Choice> representing the array of one or more
- * elements
- *
- * <b>Notes: </b>Min Value: 1; Max Value: 100
- */
- public void setChoiceSet( @NonNull List<Choice> choiceSet ) {
- setParameters(KEY_CHOICE_SET, choiceSet);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java
deleted file mode 100644
index db368bb61..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSetResponse.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Create Interaction ChoiceSet Response is sent, when CreateInteractionChoiceSet
- * has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class CreateInteractionChoiceSetResponse extends RPCResponse {
- /**
- * Constructs a new CreateInteractionChoiceSetResponse object
- */
-
- public CreateInteractionChoiceSetResponse() {
- super(FunctionID.CREATE_INTERACTION_CHOICE_SET.toString());
- }
- public CreateInteractionChoiceSetResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new CreateInteractionChoiceSetResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public CreateInteractionChoiceSetResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java
deleted file mode 100644
index b739e8789..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-/** Individual requested DID result and data.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Mandatory</th>
- * <th> Additional</th>
- * <th>Description</th>
- * </tr>
- * <tr>
- * <td>resultCode</td>
- * <td>VehicleDataResultCode</td>
- * <td>true</td>
- * <td></td>
- * <td>Individual DID result code </td>
- * </tr>
- * <tr>
- * <td>didLocation</td>
- * <td>Integer</td>
- * <td>true</td>
- * <td>minvalue = 0 maxvalue = 65535 </td>
- * <td>The address of DID location from the ReadDID request.</td>
- * </tr>
- *
- * <tr>
- * <td>data</td>
- * <td>String</td>
- * <td>false</td>
- * <td>maxlength = 5000 </td>
- * <td>The DID data which is the hex byte string of however many bytes are stored at that location</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- *
- * @see VehicleDataResultCode
- * @see ReadDID
- */
-
-public class DIDResult extends RPCStruct {
- public static final String KEY_RESULT_CODE = "resultCode";
- public static final String KEY_DATA = "data";
- public static final String KEY_DID_LOCATION = "didLocation";
- /** <p>Constructs a new DIDResult object indicated by the Hashtable
- * parameter</p>
- * @param hash
- * The hash table to use
- */
-
- public DIDResult() {}
- public DIDResult(Hashtable<String, Object> hash) {
- super(hash);
- }
- public DIDResult(@NonNull VehicleDataResultCode resultCode, @NonNull Integer didLocation) {
- this();
- setResultCode(resultCode);
- setDidLocation(didLocation);
- }
- public void setResultCode(@NonNull VehicleDataResultCode resultCode) {
- setValue(KEY_RESULT_CODE, resultCode);
- }
- public VehicleDataResultCode getResultCode() {
- return (VehicleDataResultCode) getObject(VehicleDataResultCode.class, KEY_RESULT_CODE);
- }
- public void setDidLocation(@NonNull Integer didLocation) {
- setValue(KEY_DID_LOCATION, didLocation);
- }
- public Integer getDidLocation() {
- return getInteger(KEY_DID_LOCATION);
- }
- public void setData(String data) {
- setValue(KEY_DATA, data);
- }
- public String getData() {
- return getString(KEY_DATA);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java
deleted file mode 100644
index 57595672e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/**
- * String containing hexadecimal identifier as well as other common names.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>statusByte</td>
- * <td>String</td>
- * <td>Hexadecimal byte string
- * <ul>
- * <li>Maxlength = 500</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class DTC extends RPCStruct {
- public static final String KEY_IDENTIFIER = "identifier";
- public static final String KEY_STATUS_BYTE = "statusByte";
- /**
- * Constructs a newly allocated DTC object
- */
- public DTC() { }
-
- /**
- * Constructs a newly allocated DTC object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public DTC(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * set identifier
- * @param identifier
- */
- public void setIdentifier(String identifier) {
- setValue(KEY_IDENTIFIER, identifier);
- }
-
- /**
- * get identifier
- * @return identifier
- */
- public String getIdentifier() {
- return getString(KEY_IDENTIFIER);
- }
-
- /**
- * set Hexadecimal byte string
- * @param statusByte Hexadecimal byte string
- */
- public void setStatusByte(String statusByte) {
- setValue(KEY_STATUS_BYTE, statusByte);
- }
-
- /**
- * get Hexadecimal byte string
- * @return Hexadecimal byte string
- */
- public String getStatusByte() {
- return getString(KEY_STATUS_BYTE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java
deleted file mode 100644
index 1c3af0e88..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java
+++ /dev/null
@@ -1,215 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-public class DateTime extends RPCStruct{
- public static final String KEY_MILLISECOND = "millisecond";
- public static final String KEY_SECOND = "second";
- public static final String KEY_MINUTE = "minute";
- public static final String KEY_HOUR = "hour";
- public static final String KEY_DAY = "day";
- public static final String KEY_MONTH = "month";
- public static final String KEY_YEAR = "year";
- public static final String KEY_TZ_HOUR = "tz_hour";
- public static final String KEY_TZ_MINUTE = "tz_minute";
-
- public DateTime() {
- }
-
- public DateTime(Hashtable<String, Object> hash) {
- super(hash);
- }
-
-
- /**
- * Gets the Milliseconds portion of the DateTime class
- *
- * @return Integer - Milliseconds associated with this DateTime class
- *
- */
- public Integer getMilliSecond() {
- return getInteger(KEY_MILLISECOND);
- }
-
- /**
- * Sets the Milliseconds portion of the DateTime class
- *
- * @param milliSecond
- * The milliseconds associated with this DateTime class
- *
- */
- public void setMilliSecond(Integer milliSecond) {
- setValue(KEY_MILLISECOND, milliSecond);
- }
-
-
- /**
- * Gets the Seconds portion of the DateTime class
- *
- * @return Integer - Seconds associated with this DateTime class
- *
- */
- public Integer getSecond() {
- return getInteger(KEY_SECOND);
- }
-
- /**
- * Sets the Seconds portion of the DateTime class
- *
- * @param second
- * The Seconds associated with this DateTime class
- *
- */
- public void setSecond(Integer second) {
- setValue(KEY_SECOND, second);
- }
-
-
- /**
- * Gets the Minutes portion of the DateTime class
- *
- * @return Integer - Minutes associated with this DateTime class
- *
- */
- public Integer getMinute() {
- return getInteger(KEY_MINUTE);
- }
-
- /**
- * Sets the Minutes portion of the DateTime class
- *
- * @param minute
- * The Minutes associated with this DateTime class
- *
- */
- public void setMinute(Integer minute) {
- setValue(KEY_MINUTE, minute);
- }
-
- /**
- * Gets the Hours portion of the DateTime class.
- *
- * @return Integer - Hours associated with this DateTime class.
- *
- */
- public Integer getHour() {
- return getInteger(KEY_HOUR);
- }
-
- /**
- * Sets the Hours portion of the DateTime class.
- *
- * @param hour
- * The Hours associated with this DateTime class. This structure is used to store hours in a 24 hour format.
- *
- */
- public void setHour(Integer hour) {
- setValue(KEY_HOUR, hour);
- }
-
- /**
- * Gets the Day portion of the DateTime class.
- *
- * @return Integer - Day of the month associated with this DateTime class
- *
- */
- public Integer getDay() {
- return getInteger(KEY_DAY);
- }
-
- /**
- * Sets the Day portion of the DateTime class
- *
- * @param day
- * The Day of the month associated with this DateTime class
- *
- */
- public void setDay(Integer day) {
- setValue(KEY_DAY, day);
- }
-
- /**
- * Gets the Month portion of the DateTime class.
- *
- * @return Integer - Month of the year associated with this DateTime class
- *
- */
- public Integer getMonth() {
- return getInteger(KEY_MONTH);
- }
-
- /**
- * Sets the Month portion of the DateTime class
- *
- * @param month
- * The Month of the year associate with this DateTime class
- *
- */
- public void setMonth(Integer month) {
- setValue(KEY_MONTH, month);
- }
-
- /**
- * Gets the Year portion of the DateTime class.
- *
- * @return Integer - The year in YYYY format associated with this DateTime class
- *
- */
- public Integer getYear() {
- return getInteger(KEY_YEAR);
- }
-
- /**
- * Sets the Year portion of the DateTime class
- *
- * @param year
- * The Year in YYYY format associated with this DateTime class
- *
- */
- public void setYear(Integer year) {
- setValue(KEY_YEAR, year);
- }
-
- /**
- * Gets the Time Zone Hours portion of the DateTime class.
- *
- * @return Integer - The time zone offset in Hours with regard to UTC time associated with this DateTime class
- *
- */
- public Integer getTzHour() {
- return getInteger(KEY_TZ_HOUR);
- }
-
- /**
- * Sets the Time Zone Hours portion of the DateTime class
- *
- * @param tzHour
- * The time zone offset in Hours with regard to UTC time associated with this DateTime class
- *
- */
- public void setTzHour(Integer tzHour) {
- setValue(KEY_TZ_HOUR, tzHour);
- }
-
- /**
- * Gets the Time Zone Minutes portion of the DateTime class.
- *
- * @return Integer - The time zone offset in minutes with regard to UTC associated with this DateTime class
- *
- */
- public Integer getTzMinute() {
- return getInteger(KEY_TZ_MINUTE);
- }
-
- /**
- * Sets the Time Zone Minutes portion of the DateTime class
- *
- * @param tzMinute
- * The time zone offset in Minutes with regard to UTC associated with this DateTime class
- */
- public void setTzMinute(Integer tzMinute) {
- setValue(KEY_TZ_MINUTE, tzMinute);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java
deleted file mode 100644
index b08fa56c3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Removes a command from the Command Menu.
- *
- * <p><b>HMI Status Requirements:</b></p>
- * <p>HMILevel: FULL, LIMITED or BACKGROUND</p>
- * AudioStreamingState: N/A
- * <p>SystemContext: Should not be attempted when VRSESSION or MENU</p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>cmdID</td>
- * <td>Integer</td>
- * <td>Unique ID that identifies the Command to be deleted from Command Menu</td>
- * <td>Y</td>
- * <td>Min Value: 0;Max Value: 2000000000</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- *
- *<p><b> Response:</b></p>
- *
- * Indicates that the corresponding request either failed or succeeded. If the response returns with a SUCCESS result code,this means a command was removed from the Command Menu successfully.
- *
- *<p><b> Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p>REJECTED</p>
- * <p> INVALID_ID</p>
- * <p> IN_USER</p>
- * @since SmartDeviceLink 1.0
- * @see AddCommand
- * @see AddSubMenu
- * @see DeleteSubMenu
- */
-public class DeleteCommand extends RPCRequest {
- public static final String KEY_CMD_ID = "cmdID";
-
- /**
- * Constructs a new DeleteCommand object
- */
- public DeleteCommand() {
- super(FunctionID.DELETE_COMMAND.toString());
- }
- /**
- * Constructs a new DeleteCommand object indicated by the Hashtable
- * parameter
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public DeleteCommand(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new DeleteCommand object
- * @param cmdID: an Integer value representing Command ID
- */
- public DeleteCommand(@NonNull Integer cmdID) {
- this();
- setCmdID(cmdID);
- }
- /**
- * Gets the Command ID that identifies the Command to be deleted from
- * Command Menu
- *
- * @return Integer - Integer value representing Command ID that identifies
- * the Command to be deleted from Command Menu
- */
- public Integer getCmdID() {
- return getInteger( KEY_CMD_ID );
- }
- /**
- * Sets the Command ID that identifies the Command to be deleted from Command Menu
- *
- * @param cmdID
- * an Integer value representing Command ID
- *
- * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000</p>
- */
- public void setCmdID( @NonNull Integer cmdID ) {
- setParameters(KEY_CMD_ID, cmdID);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java
deleted file mode 100644
index c6b5c994c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommandResponse.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Delete Command Response is sent, when DeleteCommand has been called.
- *
- * @since SmartDeviceLink 1.0
- */
-public class DeleteCommandResponse extends RPCResponse {
- /** Constructs a new DeleteCommandResponse object
- *
- */
-
- public DeleteCommandResponse() {
- super(FunctionID.DELETE_COMMAND.toString());
- }
- public DeleteCommandResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new DeleteCommandResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public DeleteCommandResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java
deleted file mode 100644
index c9a0e76c7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Used to delete a file resident on the SDL module in the app's local cache.
- * Not supported on first generation SDL vehicles
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink 2.0</th>
- * </tr>
- * <tr>
- * <td>SDLFileName</td>
- * <td>String</td>
- * <td> File reference name.</td>
- * <td>Y</td>
- * <td>maxlength:500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * <p><b>Response </b></p>
- *
- * <p><b>Non-default Result Codes:</b></p>
- * <p> SUCCESS</p>
- * <p> INVALID_DATA</p>
- * <p> OUT_OF_MEMORY</p>
- * <p> TOO_MANY_PENDING_REQUESTS</p>
- * <p> APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>REJECTED</p>
- * @since SmartDeviceLink 2.0
- * @see PutFile
- * @see ListFiles
- */
-public class DeleteFile extends RPCRequest {
- public static final String KEY_SDL_FILE_NAME = "syncFileName";
-
- /**
- * Constructs a new DeleteFile object
- */
- public DeleteFile() {
- super(FunctionID.DELETE_FILE.toString());
- }
-
- /**
- * <p>Constructs a new DeleteFile object indicated by the Hashtable parameter</p>
- * @param hash The Hashtable to use
- */
- public DeleteFile(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new DeleteFile object
- * @param sdlFileName a String value representing a file reference name
- */
- public DeleteFile(@NonNull String sdlFileName) {
- this();
- setSdlFileName(sdlFileName);
- }
-
- /**
- * Sets a file reference name
- *
- * @param sdlFileName
- * a String value representing a file reference name
- */
- public void setSdlFileName(@NonNull String sdlFileName) {
- setParameters(KEY_SDL_FILE_NAME, sdlFileName);
- }
-
- /**
- * Gets a file reference name
- *
- * @return String -a String value representing a file reference name
- */
- public String getSdlFileName() {
- return getString(KEY_SDL_FILE_NAME);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java
deleted file mode 100644
index 918ca7fce..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.util.Version;
-
-import java.util.Hashtable;
-
-/**
- * Delete File Response is sent, when DeleteFile has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class DeleteFileResponse extends RPCResponse {
- public static final String KEY_SPACE_AVAILABLE = "spaceAvailable";
- private static final Integer MAX_VALUE = 2000000000;
-
- /**
- * Constructs a new DeleteFileResponse object
- */
- public DeleteFileResponse() {
- super(FunctionID.DELETE_FILE.toString());
- }
-
- public DeleteFileResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * @deprecated use {@link DeleteFileResponse#DeleteFileResponse(Boolean, Result)} instead <br>
- *
- * Constructs a new DeleteFileResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- * @param spaceAvailable the total local space available on the module for the registered app.
- */
- @Deprecated
- public DeleteFileResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer spaceAvailable) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- setSpaceAvailable(spaceAvailable);
- }
-
- /**
- * Constructs a new DeleteFileResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public DeleteFileResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- /**
- * SpaceAvailable became optional as of RPC Spec 5.0. If a system that expected the value to
- * always have a value connects to such a system, it could return null. Check to see if there
- * is a value, and if not, set it to MAX_VALUE as defined by the RPC Spec
- *
- * @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){
- if (getSpaceAvailable() == null){
- setSpaceAvailable(MAX_VALUE);
- }
- }
- super.format(rpcVersion, formatParams);
- }
-
- public void setSpaceAvailable(Integer spaceAvailable) {
- setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
- }
-
- public Integer getSpaceAvailable() {
- return getInteger(KEY_SPACE_AVAILABLE);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java
deleted file mode 100644
index 741675419..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Deletes an existing Choice Set identified by the parameter
- * interactionChoiceSetID. If the specified interactionChoiceSetID is currently
- * in use by an active <i> {@linkplain PerformInteraction}</i> this call to
- * delete the Choice Set will fail returning an IN_USE resultCode
- *
- * <p>Function Group: Base</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUD</b></p>
- *
- * <p>AudioStreamingState: Any</p>
- *
- * <p>SystemContext: MAIN, MENU, VR </p>
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>interactionChoiceSetID</td>
- * <td>Integer</td>
- * <td> A unique ID that identifies the Choice Set (specified in a previous call to CreateInteractionChoiceSet)</td>
- * <td>Y</td>
- * <td>Min Value: 0 ; Max Value: 2000000000</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- *
- * <p><b>Response </b></p>
- *
- * If a resultCode of "SUCCESS" is returned, the requested choice set has been created and can now be referenced by the application using the value of interactionChoiceSetID provided by the application.
- *
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>REJECTED</p>
- * <p>INVALID_ID</p>
-
- * @since SmartDeviceLink 1.0
- * @see CreateInteractionChoiceSet
- * @see PerformInteraction
- */
-public class DeleteInteractionChoiceSet extends RPCRequest {
- public static final String KEY_INTERACTION_CHOICE_SET_ID = "interactionChoiceSetID";
-
- /**
- * Constructs a new DeleteInteractionChoiceSet object
- */
- public DeleteInteractionChoiceSet() {
- super(FunctionID.DELETE_INTERACTION_CHOICE_SET.toString());
- }
- /**
- * <p>Constructs a new DeleteInteractionChoiceSet object indicated by the
- * Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public DeleteInteractionChoiceSet(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new DeleteInteractionChoiceSet object
- * @param interactionChoiceSetID a unique ID that identifies the Choice Set
- * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000 </p>
- */
- public DeleteInteractionChoiceSet(@NonNull Integer interactionChoiceSetID) {
- this();
- setInteractionChoiceSetID(interactionChoiceSetID);
- }
- /**
- * Gets a unique ID that identifies the Choice Set
- * @return Integer -an Integer value representing the unique Choice Set ID
- */
- public Integer getInteractionChoiceSetID() {
- return getInteger( KEY_INTERACTION_CHOICE_SET_ID );
- }
- /**
- * Sets a unique ID that identifies the Choice Set
- * @param interactionChoiceSetID a unique ID that identifies the Choice Set
- * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000 </p>
- */
- public void setInteractionChoiceSetID( @NonNull Integer interactionChoiceSetID ) {
- setParameters(KEY_INTERACTION_CHOICE_SET_ID, interactionChoiceSetID);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java
deleted file mode 100644
index d122975a0..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSetResponse.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Delete Interaction ChoiceSet Response is sent, when DeleteInteractionChoiceSet has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class DeleteInteractionChoiceSetResponse extends RPCResponse {
-
- public DeleteInteractionChoiceSetResponse() {
- super(FunctionID.DELETE_INTERACTION_CHOICE_SET.toString());
- }
- public DeleteInteractionChoiceSetResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new DeleteInteractionChoiceSetResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public DeleteInteractionChoiceSetResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java
deleted file mode 100644
index 97c4042e3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Deletes a submenu from the Command Menu.
- *
- * <p><b>Notes: </b>When an app deletes a submenu that has child commands, those
- * child commands are also deleted</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>menuID</td>
- * <td>Integer</td>
- * <td>Unique ID that identifies the SubMenu to be delete</td>
- * <td>Y</td>
- * <td>Min Value: 0; Max Value: 2000000000</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- *
- *<p> <b>Response </b></p>
- *
- * <p><b>Non-default Result Codes:</b></p>
- *<p>SUCCESS</p>
- *<p> INVALID_DATA</p>
- * <p> OUT_OF_MEMORY</p>
- * <p> TOO_MANY_PENDING_REQUESTS</p>
- * <p> APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p> REJECTED</p>
- * <p> INVALID_ID</p>
- * <p> IN_USE </p>
- *
- * @since SmartDeviceLink 1.0
- * @see AddCommand
- * @see AddSubMenu
- * @see DeleteCommand
- */
-public class DeleteSubMenu extends RPCRequest {
- public static final String KEY_MENU_ID = "menuID";
- /**
- * Constructs a new DeleteSubMenu object
- */
- public DeleteSubMenu() {
- super(FunctionID.DELETE_SUB_MENU.toString());
- }
- /**
- * Constructs a new DeleteSubMenu object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public DeleteSubMenu(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new DeleteSubMenu object
- * @param menuID an Integer value representing menuID that identifies the SubMenu to be delete
- *
- * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000</p>
- */
- public DeleteSubMenu(@NonNull Integer menuID) {
- this();
- setMenuID(menuID);
- }
- /**
- * Gets the Menu ID that identifies the SubMenu to be delete
- * @return Integer -an Integer value representing menuID that identifies the SubMenu to be delete
- */
- public Integer getMenuID() {
- return getInteger( KEY_MENU_ID );
- }
- /**
- * Sets the MenuID that identifies the SubMenu to be delete
- * @param menuID an Integer value representing menuID that identifies the SubMenu to be delete
- *
- * <p><b>Notes: </b>Min Value: 0; Max Value: 2000000000</p>
- */
- public void setMenuID( @NonNull Integer menuID ) {
- setParameters(KEY_MENU_ID, menuID);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java
deleted file mode 100644
index d13c850df..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenuResponse.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Delete SubMenu Response is sent, when DeleteSubMenu has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class DeleteSubMenuResponse extends RPCResponse {
- /**
- * Constructs a new DeleteSubMenuResponse object
- */
-
- public DeleteSubMenuResponse() {
- super(FunctionID.DELETE_SUB_MENU.toString());
- }
- public DeleteSubMenuResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new DeleteSubMenuResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public DeleteSubMenuResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java
deleted file mode 100644
index 485d859b7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-/**
- * Various information about connecting device.
- *
- *
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>hardware</td>
- * <td>String</td>
- * <td>Device model</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>firmwareRev</td>
- * <td>String</td>
- * <td>Device firmware revision</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>os</td>
- * <td>String</td>
- * <td>Device OS version</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>osVersion</td>
- * <td>String</td>
- * <td>Device OS version</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>carrier</td>
- * <td>String</td>
- * <td>Device mobile carrier (if applicable)</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>maxNumberRFCOMMPorts</td>
- * <td>Integer</td>
- * <td>Omitted if connected not via BT.</td>
- * <td>N</td>
- * <td>Min Value: 0; Max Value: 100</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * </table>
- *
- */
-public class DeviceInfo extends RPCStruct{
- public static final String KEY_HARDWARE = "hardware";
- public static final String KEY_FIRMWARE_REV = "firmwareRev";
- public static final String KEY_OS = "os";
- public static final String KEY_OS_VERSION = "osVersion";
- public static final String KEY_CARRIER = "carrier";
- public static final String KEY_MAX_NUMBER_RFCOMM_PORTS = "maxNumberRFCOMMPorts";
- public static final String DEVICE_OS = "Android";
-
- /** Constructs a new DeviceInfo object indicated by the Hashtable
- * parameter
- * @param hash
- *
- * The hash table to use
- *
- *
- */
-
- public DeviceInfo() { }
-
- public DeviceInfo(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public void setHardware(String hardware) {
- setValue(KEY_HARDWARE, hardware);
- }
-
- public String getHardware() {
- return getString(KEY_HARDWARE);
- }
-
- public void setFirmwareRev(String firmwareRev) {
- setValue(KEY_FIRMWARE_REV, firmwareRev);
- }
-
- public String getFirmwareRev() {
- return getString(KEY_FIRMWARE_REV);
- }
-
- public void setOs(String os) {
- setValue(KEY_OS, os);
- }
-
- public String getOs() {
- return getString(KEY_OS);
- }
-
- public void setOsVersion(String osVersion) {
- setValue(KEY_OS_VERSION, osVersion);
-}
-
-public String getOsVersion() {
- return getString(KEY_OS_VERSION);
-}
-
-public void setCarrier(String carrier) {
- setValue(KEY_CARRIER, carrier);
-}
-
-public String getCarrier() {
- return getString(KEY_CARRIER);
-}
-
-public Integer getMaxNumberRFCOMMPorts() {
- return getInteger( KEY_MAX_NUMBER_RFCOMM_PORTS );
-}
-
-public void setMaxNumberRFCOMMPorts( Integer maxNumberRFCOMMPorts ) {
- setValue(KEY_MAX_NUMBER_RFCOMM_PORTS, maxNumberRFCOMMPorts);
-}
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java
deleted file mode 100644
index 40382b81a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java
+++ /dev/null
@@ -1,322 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
-import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
-
-import java.util.Hashtable;
-
-/**
- * Describes the status related to a connected mobile device or SDL and if or how it is represented in the vehicle.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>voiceRecOn</td>
- * <td>Boolean</td>
- * <td>Voice recognition is on
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>btIconOn</td>
- * <td>Boolean</td>
- * <td>Bluetooth connection established
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>callActive</td>
- * <td>Boolean</td>
- * <td>A call is being active
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>phoneRoaming</td>
- * <td>Boolean</td>
- * <td>The phone is in roaming mode
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>textMsgAvailable</td>
- * <td>Boolean</td>
- * <td>A textmessage is available
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>battLevelStatus</td>
- * <td>DeviceLevelStatus</td>
- * <td>Battery level status
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>stereoAudioOutputMuted</td>
- * <td>Boolean</td>
- * <td>Status of the stereo audio output channel
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>monoAudioOutputMuted</td>
- * <td>Boolean</td>
- * <td>Status of the mono audio output channel
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>signalLevelStatus</td>
- * <td>DeviceLevelStatus</td>
- * <td>Signal level status
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>primaryAudioSource</td>
- * <td>PrimaryAudioSource</td>
- * <td>Reflects the current primary audio source of SDL (if selected).
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>eCallEventActive</td>
- * <td>Boolean</td>
- * <td>Reflects, if an eCall event is active
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- *
- * @see DeviceLevelStatus
- * @see GetVehicleData
- * @see OnVehicleData
- *
- */
-public class DeviceStatus extends RPCStruct {
- public static final String KEY_VOICE_REC_ON = "voiceRecOn";
- public static final String KEY_BT_ICON_ON = "btIconOn";
- public static final String KEY_CALL_ACTIVE = "callActive";
- public static final String KEY_PHONE_ROAMING = "phoneRoaming";
- public static final String KEY_TEXT_MSG_AVAILABLE = "textMsgAvailable";
- public static final String KEY_BATT_LEVEL_STATUS = "battLevelStatus";
- public static final String KEY_STEREO_AUDIO_OUTPUT_MUTED = "stereoAudioOutputMuted";
- public static final String KEY_MONO_AUDIO_OUTPUT_MUTED = "monoAudioOutputMuted";
- public static final String KEY_SIGNAL_LEVEL_STATUS = "signalLevelStatus";
- public static final String KEY_PRIMARY_AUDIO_SOURCE = "primaryAudioSource";
- public static final String KEY_E_CALL_EVENT_ACTIVE = "eCallEventActive";
-
- /**
- * Constructs a newly allocated DeviceStatus object
- */
- public DeviceStatus() {}
-
- /**
- * Constructs a newly allocated DeviceStatus object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public DeviceStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated DeviceStatus object
- * @param voiceRecOn
- * @param btIconOn the bluetooth connection established
- * @param callActive a call is being active
- * @param phoneRoaming the phone is in roaming mode
- * @param textMsgAvailable a textmessage is available
- * @param battLevelStatus battery level status
- * @param stereoAudioOutputMuted the status of the stereo audio output channel
- * @param monoAudioOutputMuted the status of the mono audio output channel
- * @param signalLevelStatus signal level status
- * @param primaryAudioSource the current primary audio source of SDL (if selected
- * @param eCallEventActive
- */
- public DeviceStatus(@NonNull Boolean voiceRecOn, @NonNull Boolean btIconOn, @NonNull Boolean callActive, @NonNull Boolean phoneRoaming, @NonNull Boolean textMsgAvailable, @NonNull DeviceLevelStatus battLevelStatus,
- @NonNull Boolean stereoAudioOutputMuted, @NonNull Boolean monoAudioOutputMuted, @NonNull DeviceLevelStatus signalLevelStatus, @NonNull PrimaryAudioSource primaryAudioSource, @NonNull Boolean eCallEventActive) {
- this();
- setVoiceRecOn(voiceRecOn);
- setBtIconOn(btIconOn);
- setCallActive(callActive);
- setPhoneRoaming(phoneRoaming);
- setTextMsgAvailable(textMsgAvailable);
- setBattLevelStatus(battLevelStatus);
- setStereoAudioOutputMuted(stereoAudioOutputMuted);
- setMonoAudioOutputMuted(monoAudioOutputMuted);
- setSignalLevelStatus(signalLevelStatus);
- setPrimaryAudioSource(primaryAudioSource);
- setECallEventActive(eCallEventActive);
- }
-
- /**
- * set the voice recognition on or off
- * @param voiceRecOn
- */
- public void setVoiceRecOn(@NonNull Boolean voiceRecOn) {
- setValue(KEY_VOICE_REC_ON, voiceRecOn);
- }
-
- /**
- * get whether the voice recognition is on
- * @return whether the voice recognition is on
- */
- public Boolean getVoiceRecOn() {
- return getBoolean(KEY_VOICE_REC_ON);
- }
-
- /**
- * set the bluetooth connection established
- * @param btIconOn the bluetooth connection established
- */
- public void setBtIconOn(@NonNull Boolean btIconOn) {
- setValue(KEY_BT_ICON_ON, btIconOn);
- }
-
- /**
- * get the bluetooth connection established
- * @return the bluetooth connection established
- */
- public Boolean getBtIconOn() {
- return getBoolean(KEY_BT_ICON_ON);
- }
-
- /**
- * set a call is being active
- * @param callActive a call is being active
- */
- public void setCallActive(@NonNull Boolean callActive) {
- setValue(KEY_CALL_ACTIVE, callActive);
- }
-
- /**
- * get a call is being active
- * @return a call is being active
- */
- public Boolean getCallActive() {
- return getBoolean(KEY_CALL_ACTIVE);
- }
-
- /**
- * set the phone is in roaming mode
- * @param phoneRoaming the phone is in roaming mode
- */
- public void setPhoneRoaming(@NonNull Boolean phoneRoaming) {
- setValue(KEY_PHONE_ROAMING, phoneRoaming);
- }
-
- /**
- * get the phone is in roaming mode
- * @return the phone is in roaming mode
- */
- public Boolean getPhoneRoaming() {
- return getBoolean(KEY_PHONE_ROAMING);
- }
- public void setTextMsgAvailable(@NonNull Boolean textMsgAvailable) {
- setValue(KEY_TEXT_MSG_AVAILABLE, textMsgAvailable);
- }
-
- /**
- * get a textmessage is available
- * @return a textmessage is available
- */
- public Boolean getTextMsgAvailable() {
- return getBoolean(KEY_TEXT_MSG_AVAILABLE);
- }
-
- /**
- * set battery level status
- * @param battLevelStatus battery level status
- */
- public void setBattLevelStatus(@NonNull DeviceLevelStatus battLevelStatus) {
- setValue(KEY_BATT_LEVEL_STATUS, battLevelStatus);
- }
-
- /**
- * get battery level status
- * @return battery level status
- */
- public DeviceLevelStatus getBattLevelStatus() {
- return (DeviceLevelStatus) getObject(DeviceLevelStatus.class, KEY_BATT_LEVEL_STATUS);
- }
-
- /**
- * set the status of the stereo audio output channel
- * @param stereoAudioOutputMuted the status of the stereo audio output channel
- */
- public void setStereoAudioOutputMuted(@NonNull Boolean stereoAudioOutputMuted) {
- setValue(KEY_STEREO_AUDIO_OUTPUT_MUTED, stereoAudioOutputMuted);
- }
-
- /**
- * get the status of the stereo audio output channel
- * @return the status of the stereo audio output channel
- */
- public Boolean getStereoAudioOutputMuted() {
- return getBoolean(KEY_STEREO_AUDIO_OUTPUT_MUTED);
- }
-
- /**
- * set the status of the mono audio output channel
- * @param monoAudioOutputMuted the status of the mono audio output channel
- */
- public void setMonoAudioOutputMuted(@NonNull Boolean monoAudioOutputMuted) {
- setValue(KEY_MONO_AUDIO_OUTPUT_MUTED, monoAudioOutputMuted);
- }
-
- /**
- * get the status of the mono audio output channel
- * @return the status of the mono audio output channel
- */
- public Boolean getMonoAudioOutputMuted() {
- return getBoolean(KEY_MONO_AUDIO_OUTPUT_MUTED);
- }
-
- /**
- * set signal level status
- * @param signalLevelStatus signal level status
- */
- public void setSignalLevelStatus(@NonNull DeviceLevelStatus signalLevelStatus) {
- setValue(KEY_SIGNAL_LEVEL_STATUS, signalLevelStatus);
- }
-
- /**
- * get signal level status
- * @return signal level status
- */
- public DeviceLevelStatus getSignalLevelStatus() {
- return (DeviceLevelStatus) getObject(DeviceLevelStatus.class, KEY_SIGNAL_LEVEL_STATUS);
- }
-
- /**
- * set the current primary audio source of SDL (if selected).
- * @param primaryAudioSource the current primary audio source of SDL (if selected).
- */
- public void setPrimaryAudioSource(@NonNull PrimaryAudioSource primaryAudioSource) {
- setValue(KEY_PRIMARY_AUDIO_SOURCE, primaryAudioSource);
- }
-
- /**
- * get the current primary audio source of SDL (if selected).
- * @return the current primary audio source of SDL (if selected).
- */
- public PrimaryAudioSource getPrimaryAudioSource() {
- return (PrimaryAudioSource) getObject(PrimaryAudioSource.class, KEY_PRIMARY_AUDIO_SOURCE);
- }
- public void setECallEventActive(@NonNull Boolean eCallEventActive) {
- setValue(KEY_E_CALL_EVENT_ACTIVE, eCallEventActive);
- }
- public Boolean getECallEventActive() {
- return getBoolean(KEY_E_CALL_EVENT_ACTIVE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java
deleted file mode 100644
index 3d40ba31d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/** Non periodic vehicle diagnostic request.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>targetID</td>
- * <td>Integer</td>
- * <td>Name of target ECU.</td>
- * <td>Y</td>
- * <td>Min Value: 0; Max Value: 65535</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>messageLength</td>
- * <td>Integer</td>
- * <td>Length of message (in bytes).</td>
- * <td>Y</td>
- * <td>Min Value: 0; Max Value:65535</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>messageData</td>
- * <td>Integer</td>
- * <td>Array of bytes comprising CAN message.</td>
- * <td>Y</td>
- * <td>Min Value: 0; Max Value:255; Min Size:1; Max Size:65535</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * </table>
- * <p><b>HMI must:</b> </p>
- *
- * <p>1. Check the requested data using provided information of targetID (name of ECU),messageLength and messageData.</p>
- * <p> 2. Respond with one of the appropriate result codes.And in case of SUCCESS return messageDataResult which is an array of bytes comprising CAN message result.</p>
- * @since SmartDeviceLink 3.0
- *
- */
-
-public class DiagnosticMessage extends RPCRequest {
- public static final String KEY_TARGET_ID = "targetID";
- public static final String KEY_MESSAGE_LENGTH = "messageLength";
- public static final String KEY_MESSAGE_DATA = "messageData";
- /**
- * Constructs a new DiagnosticMessage object
- */
-
- public DiagnosticMessage() {
- super(FunctionID.DIAGNOSTIC_MESSAGE.toString());
- }
- /**
- * <p>
- * Constructs a new DiagnosticMessage object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public DiagnosticMessage(Hashtable<String, Object> hash) {
- super(hash);
- }
- /** Sets TargetID
- *
- * @param targetID
- */
-
-
- /**
- * Constructs a new DiagnosticMessage object
- */
- public DiagnosticMessage(@NonNull Integer targetID, @NonNull Integer messageLength, @NonNull List<Integer> messageData) {
- this();
- setTargetID(targetID);
- setMessageLength(messageLength);
- setMessageData(messageData);
- }
-
- public void setTargetID(@NonNull Integer targetID) {
- setParameters(KEY_TARGET_ID, targetID);
- }
- /**
- * <p>
- * Returns an <i>Integer</i> object representing the Target ID that you want to add
- * </p>
- *
- * @return Integer -an integer representation a Unique Target ID
- */
-
- public Integer getTargetID() {
- return getInteger(KEY_TARGET_ID);
- }
-
- public void setMessageLength(@NonNull Integer messageLength) {
- setParameters(KEY_MESSAGE_LENGTH, messageLength);
- }
- public Integer getMessageLength() {
- return getInteger(KEY_MESSAGE_LENGTH);
- }
-
- @SuppressWarnings("unchecked")
- public List<Integer> getMessageData() {
- return (List<Integer>) getObject(Integer.class, KEY_MESSAGE_DATA);
- }
-
- public void setMessageData(@NonNull List<Integer> messageData) {
- setParameters(KEY_MESSAGE_DATA, messageData);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
deleted file mode 100644
index 096acbd50..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Diagnostic Message Response is sent, when DiagnosticMessage has been called.
- *
- * @since SmartDeviceLink 3.0
- */
-public class DiagnosticMessageResponse extends RPCResponse {
- public static final String KEY_MESSAGE_DATA_RESULT = "messageDataResult";
- /**
- * Constructs a new DiagnosticMessageResponse object
- */
-
- public DiagnosticMessageResponse() {
- super(FunctionID.DIAGNOSTIC_MESSAGE.toString());
- }
- public DiagnosticMessageResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new DiagnosticMessageResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public DiagnosticMessageResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull List<Integer> messageDataResult) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- setMessageDataResult(messageDataResult);
- }
- @SuppressWarnings("unchecked")
- public List<Integer> getMessageDataResult() {
- return (List<Integer>) getObject(Integer.class, KEY_MESSAGE_DATA_RESULT);
- }
-
- public void setMessageDataResult(@NonNull List<Integer> messageDataResult) {
- setParameters(KEY_MESSAGE_DATA_RESULT, messageDataResult);
- }
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java
deleted file mode 100644
index 4707efc86..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Dials a phone number and switches to phone application.
- *
- * @since SmartDeviceLink 4.0
- */
-public class DialNumber extends RPCRequest {
- public static final String KEY_NUMBER = "number";
-
-
- public DialNumber(){
- super(FunctionID.DIAL_NUMBER.toString());
- }
-
- public DialNumber(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public DialNumber(@NonNull String number){
- this();
- setNumber(number);
- }
- /**
- * Sets a number to dial
- *
- * @param number
- * a phone number is a string, which can be up to 40 chars.
- * <p>
- * <b>Notes: </b>Maxlength=40</p>
- * All characters shall be stripped from string except digits 0-9 and * # , ; +
- */
- public void setNumber(@NonNull String number) {
- if (number != null) {
- number = number.replaceAll("[^0-9*#,;+]", ""); //This will sanitize the input
- }
- setParameters(KEY_NUMBER, number);
- }
-
- /**
- * Gets a number to dial
- *
- * @return String - a String value representing a number to dial
- */
- public String getNumber() {
- return getString(KEY_NUMBER);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java
deleted file mode 100644
index ff2cef3be..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DialNumberResponse.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Dial Number Response is sent, when DialNumber has been called
- *
- * @since SmartDeviceLink 4.0
- */
-public class DialNumberResponse extends RPCResponse {
-
- public DialNumberResponse() {
- super(FunctionID.DIAL_NUMBER.toString());
- }
-
- public DialNumberResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new DialNumberResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public DialNumberResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java
deleted file mode 100644
index e97a3d449..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java
+++ /dev/null
@@ -1,237 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.DisplayType;
-import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-import com.smartdevicelink.util.DebugTool;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import static com.smartdevicelink.proxy.constants.Names.displayType;
-
-/**
- * Contains information about the display for the SDL system to which the application is currently connected.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * @Deprecated
- * <td>displayType</td>
- * <td>DisplayType</td>
- * <td>The type of display
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>displayName</td>
- * <td>String</td>
- * <td>The name of the display
- * </td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>textField</td>
- * <td>TextField[]</td>
- * <td>An array of TextField structures, each of which describes a field in the HMI which the application can write to using operations such as <i>{@linkplain Show}</i>, <i>{@linkplain SetMediaClockTimer}</i>, etc.
- * This array of TextField structures identify all the text fields to which the application can write on the current display (identified by DisplayType ).
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>mediaClockFormats</td>
- * <td>MediaClockFormat[]</td>
- * <td>An array of MediaClockFormat elements, defining the valid string formats used in specifying the contents of the media clock field</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>graphicSupported</td>
- * <td>Boolean</td>
- * <td>The display's persistent screen supports referencing a static or dynamic image.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- * @see DisplayType
- * @see MediaClockFormat
- * @see TextFieldName
- * @see ImageType
- *
- */
-public class DisplayCapabilities extends RPCStruct {
- public static final String KEY_DISPLAY_TYPE = "displayType";
- public static final String KEY_DISPLAY_NAME = "displayName";
- public static final String KEY_MEDIA_CLOCK_FORMATS = "mediaClockFormats";
- public static final String KEY_TEXT_FIELDS = "textFields";
- public static final String KEY_IMAGE_FIELDS = "imageFields";
- public static final String KEY_GRAPHIC_SUPPORTED = "graphicSupported";
- public static final String KEY_SCREEN_PARAMS = "screenParams";
- public static final String KEY_TEMPLATES_AVAILABLE = "templatesAvailable";
- public static final String KEY_NUM_CUSTOM_PRESETS_AVAILABLE = "numCustomPresetsAvailable";
- /**
- * Constructs a newly allocated DisplayCapabilities object
- */
- public DisplayCapabilities() { }
- /**
- * Constructs a newly allocated DisplayCapabilities object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public DisplayCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a newly allocated DisplayCapabilities object
- * @param displayType the display type
- * @param textFields the List of textFields
- * @param mediaClockFormats the List of MediaClockFormat
- * @param graphicSupported
- */
- @Deprecated
- public DisplayCapabilities(@NonNull DisplayType displayType, @NonNull List<TextField> textFields, @NonNull List<MediaClockFormat> mediaClockFormats, @NonNull Boolean graphicSupported) {
- this();
- setDisplayType(displayType);
- setTextFields(textFields);
- setMediaClockFormats(mediaClockFormats);
- setGraphicSupported(graphicSupported);
- }
- /**
- * Constructs a newly allocated DisplayCapabilities object
- * @param displayName the display name (String)
- * @param textFields the List of textFields
- * @param mediaClockFormats the List of MediaClockFormat
- * @param graphicSupported
- */
- public DisplayCapabilities(String displayName, @NonNull List<TextField> textFields, @NonNull List<MediaClockFormat> mediaClockFormats, @NonNull Boolean graphicSupported) {
- this();
- setDisplayName(displayName);
- setTextFields(textFields);
- setMediaClockFormats(mediaClockFormats);
- setGraphicSupported(graphicSupported);
- }
- /**
- * Get the type of display
- * @return the type of display
- */
- @Deprecated
- public DisplayType getDisplayType() {
- return (DisplayType) getObject(DisplayType.class, KEY_DISPLAY_TYPE);
- }
- /**
- * Set the type of display
- * @param displayType the display type
- */
- @Deprecated
- public void setDisplayType( @NonNull DisplayType displayType ) {
- setValue(KEY_DISPLAY_TYPE, displayType);
- }
- /** Get the name of the display
- * @return the name of the display
- */
- public String getDisplayName() {
- return getString(KEY_DISPLAY_NAME);
- }
- /**
- * Set the name of the display
- * @param displayName the name of the display
- */
- public void setDisplayName( String displayName ) {
- setValue(KEY_DISPLAY_NAME, displayName);
- }
- /**
- *Get an array of TextField structures, each of which describes a field in the HMI which the application can write to using operations such as <i>{@linkplain Show}</i>, <i>{@linkplain SetMediaClockTimer}</i>, etc.
- * This array of TextField structures identify all the text fields to which the application can write on the current display (identified by DisplayType ).
- * @return the List of textFields
- */
- @SuppressWarnings("unchecked")
- public List<TextField> getTextFields() {
- return (List<TextField>) getObject(TextField.class, KEY_TEXT_FIELDS);
- }
- /**
- * Set an array of TextField structures, each of which describes a field in the HMI which the application can write to using operations such as <i>{@linkplain Show}</i>, <i>{@linkplain SetMediaClockTimer}</i>, etc.
- * This array of TextField structures identify all the text fields to which the application can write on the current display (identified by DisplayType ).
- * @param textFields the List of textFields
- */
- public void setTextFields( @NonNull List<TextField> textFields ) {
- setValue(KEY_TEXT_FIELDS, textFields);
- }
-
-
-
- @SuppressWarnings("unchecked")
- public List<ImageField> getImageFields() {
- return (List<ImageField>) getObject(ImageField.class, KEY_IMAGE_FIELDS);
- }
-
- public void setImageFields( List<ImageField> imageFields ) {
- setValue(KEY_IMAGE_FIELDS, imageFields);
- }
-
- public Integer getNumCustomPresetsAvailable() {
- return getInteger(KEY_NUM_CUSTOM_PRESETS_AVAILABLE);
- }
-
- public void setNumCustomPresetsAvailable(Integer numCustomPresetsAvailable) {
- setValue(KEY_NUM_CUSTOM_PRESETS_AVAILABLE, numCustomPresetsAvailable);
- }
-
- /**
- * Get an array of MediaClockFormat elements, defining the valid string formats used in specifying the contents of the media clock field
- * @return the Veotor of mediaClockFormat
- */
- @SuppressWarnings("unchecked")
- public List<MediaClockFormat> getMediaClockFormats() {
- return (List<MediaClockFormat>) getObject(MediaClockFormat.class, KEY_MEDIA_CLOCK_FORMATS);
- }
- /**
- * Set an array of MediaClockFormat elements, defining the valid string formats used in specifying the contents of the media clock field
- * @param mediaClockFormats the List of MediaClockFormat
- */
- public void setMediaClockFormats( @NonNull List<MediaClockFormat> mediaClockFormats ) {
- setValue(KEY_MEDIA_CLOCK_FORMATS, mediaClockFormats);
- }
-
- /**
- * set the display's persistent screen supports.
- * @param graphicSupported
- * @since SmartDeviceLink 2.0
- */
- public void setGraphicSupported(@NonNull Boolean graphicSupported) {
- setValue(KEY_GRAPHIC_SUPPORTED, graphicSupported);
- }
-
- /**
- * Get the display's persistent screen supports.
- * @return Boolean get the value of graphicSupported
- * @since SmartDeviceLink 2.0
- */
- public Boolean getGraphicSupported() {
- return getBoolean(KEY_GRAPHIC_SUPPORTED);
- }
-
- @SuppressWarnings("unchecked")
- public List<String> getTemplatesAvailable() {
- return (List<String>) getObject(String.class, KEY_TEMPLATES_AVAILABLE);
- }
-
- public void setTemplatesAvailable(List<String> templatesAvailable) {
- setValue(KEY_TEMPLATES_AVAILABLE, templatesAvailable);
- }
-
- public void setScreenParams(ScreenParams screenParams) {
- setValue(KEY_SCREEN_PARAMS, screenParams);
- }
-
- @SuppressWarnings("unchecked")
- public ScreenParams getScreenParams() {
- return (ScreenParams) getObject(ScreenParams.class, KEY_SCREEN_PARAMS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java
deleted file mode 100644
index b62620026..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-
-import java.util.Hashtable;
-
-/** Emergency Call notification and confirmation data.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>eCallNotificationStatus</td>
- * <td>VehicleDataNotificationStatus</td>
- * <td>References signal "eCallNotification_4A".</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>auxECallNotificationStatus</td>
- * <td>VehicleDataNotificationStatus</td>
- * <td>References signal "eCallNotification". This is an alternative signal available on some carlines replacing the eCallNotificationStatus, but showing the same values.</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>eCallConfirmationStatus</td>
- * <td>ECallConfirmationStatus</td>
- * <td>References signal "eCallConfirmation"</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- * @see SubscribeVehicleData
- *
- *
- * @see TextFieldName
- * @see Image
- *
- */
-
-public class ECallInfo extends RPCStruct {
- public static final String KEY_E_CALL_NOTIFICATION_STATUS = "eCallNotificationStatus";
- public static final String KEY_AUX_E_CALL_NOTIFICATION_STATUS = "auxECallNotificationStatus";
- public static final String KEY_E_CALL_CONFIRMATION_STATUS = "eCallConfirmationStatus";
- /** Constructs a new ECallInfo object
- */
- public ECallInfo() { }
- /** Constructs a new ECallInfo object indicated by the Hashtable
- * parameter
- * @param hash <p>The hash table to use</p>
- */
- public ECallInfo(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new ECallInfo object
- */
- public ECallInfo(@NonNull VehicleDataNotificationStatus eCallNotificationStatus, @NonNull VehicleDataNotificationStatus auxECallNotificationStatus, @NonNull ECallConfirmationStatus eCallConfirmationStatus) {
- this();
- setECallNotificationStatus(eCallNotificationStatus);
- setAuxECallNotificationStatus(auxECallNotificationStatus);
- setECallConfirmationStatus(eCallConfirmationStatus);
- }
-
- public void setECallNotificationStatus(@NonNull VehicleDataNotificationStatus eCallNotificationStatus) {
- setValue(KEY_E_CALL_NOTIFICATION_STATUS, eCallNotificationStatus);
- }
- public VehicleDataNotificationStatus getECallNotificationStatus() {
- return (VehicleDataNotificationStatus) getObject(VehicleDataNotificationStatus.class, KEY_E_CALL_NOTIFICATION_STATUS);
- }
- public void setAuxECallNotificationStatus(@NonNull VehicleDataNotificationStatus auxECallNotificationStatus) {
- setValue(KEY_AUX_E_CALL_NOTIFICATION_STATUS, auxECallNotificationStatus);
- }
- public VehicleDataNotificationStatus getAuxECallNotificationStatus() {
- return (VehicleDataNotificationStatus) getObject(VehicleDataNotificationStatus.class, KEY_AUX_E_CALL_NOTIFICATION_STATUS);
- }
- public void setECallConfirmationStatus(@NonNull ECallConfirmationStatus eCallConfirmationStatus) {
- setValue(KEY_E_CALL_CONFIRMATION_STATUS, eCallConfirmationStatus);
- }
- public ECallConfirmationStatus getECallConfirmationStatus() {
- return (ECallConfirmationStatus) getObject(ECallConfirmationStatus.class, KEY_E_CALL_CONFIRMATION_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java
deleted file mode 100644
index 0bc0a2e67..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
-import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-
-import static android.provider.Contacts.SettingsColumns.KEY;
-import static com.smartdevicelink.proxy.constants.Names.multipleEvents;
-import static com.smartdevicelink.proxy.rpc.TireStatus.KEY_INNER_RIGHT_REAR;
-
-/** Information related to an emergency event (and if it occurred).
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Mandatory</th>
- * <th>Description</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>emergencyEventType</td>
- * <td>EmergencyEventType</td>
- * <td></td>
- * <td>References signal "VedsEvntType_D_Ltchd". See{@linkplain EmergencyEventType}</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>fuelCutoffStatus</td>
- * <td>FuelCutoffStatus</td>
- * <td></td>
- * <td>References signal "RCM_FuelCutoff". See{@linkplain FuelCutoffStatus}</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>rolloverEvent</td>
- * <td>VehicleDataEventStatus</td>
- * <td></td>
- * <td>References signal "VedsEvntRoll_D_Ltchd". See{@linkplain VehicleDataEventStatus}</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>maximumChangeVelocity</td>
- * <td>Integer</td>
- * <td></td>
- * <td>References signal "VedsMaxDeltaV_D_Ltchd".</td>
- * <td>minvalue=0; maxvalue=255;<p> Additional reserved values:</p> <p>0x00 No event; 0xFE Not supported; 0xFF Fault</p> </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- *
- * <tr>
- * <td>multipleEvents</td>
- * <td>VehicleDataEventStatus</td>
- * <td></td>
- * <td>References signal "VedsMultiEvnt_D_Ltchd". See{@linkplain VehicleDataEventStatus}</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * @see Image
- * @see SubscribeVehicleData
- * @since SmartDeviceLink 2.0
- *
- */
-
-public class EmergencyEvent extends RPCStruct {
- public static final String KEY_EMERGENCY_EVENT_TYPE = "emergencyEventType";
- public static final String KEY_FUEL_CUTOFF_STATUS = "fuelCutoffStatus";
- public static final String KEY_ROLLOVER_EVENT = "rolloverEvent";
- public static final String KEY_MAXIMUM_CHANGE_VELOCITY = "maximumChangeVelocity";
- public static final String KEY_MULTIPLE_EVENTS = "multipleEvents";
-
- /** Constructs a new EmergencyEvent object
- *
- */
- public EmergencyEvent() { }
- /** Constructs a new EmergencyEvent object indicated by the Hashtable
- * parameter
- * @param hash <p>The hash table to use</p>
- */
- public EmergencyEvent(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new EmergencyEvent object
- */
- public EmergencyEvent(@NonNull EmergencyEventType emergencyEventType, @NonNull FuelCutoffStatus fuelCutoffStatus, @NonNull VehicleDataEventStatus rolloverEvent, @NonNull Integer maximumChangeVelocity, @NonNull VehicleDataEventStatus multipleEvents) {
- this();
- setEmergencyEventType(emergencyEventType);
- setFuelCutoffStatus(fuelCutoffStatus);
- setRolloverEvent(rolloverEvent);
- setMaximumChangeVelocity(maximumChangeVelocity);
- setMultipleEvents(multipleEvents);
- }
-
- public void setEmergencyEventType(@NonNull EmergencyEventType emergencyEventType) {
- setValue(KEY_EMERGENCY_EVENT_TYPE, emergencyEventType);
- }
- public EmergencyEventType getEmergencyEventType() {
- return (EmergencyEventType) getObject(EmergencyEventType.class, KEY_EMERGENCY_EVENT_TYPE);
- }
- public void setFuelCutoffStatus(@NonNull FuelCutoffStatus fuelCutoffStatus) {
- setValue(KEY_FUEL_CUTOFF_STATUS, fuelCutoffStatus);
- }
- public FuelCutoffStatus getFuelCutoffStatus() {
- return (FuelCutoffStatus) getObject(FuelCutoffStatus.class, KEY_FUEL_CUTOFF_STATUS);
- }
- public void setRolloverEvent(@NonNull VehicleDataEventStatus rolloverEvent) {
- setValue(KEY_ROLLOVER_EVENT, rolloverEvent);
- }
- public VehicleDataEventStatus getRolloverEvent() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_ROLLOVER_EVENT);
- }
- public void setMaximumChangeVelocity(@NonNull Integer maximumChangeVelocity) {
- setValue(KEY_MAXIMUM_CHANGE_VELOCITY, maximumChangeVelocity);
- }
- public Integer getMaximumChangeVelocity() {
- return getInteger(KEY_MAXIMUM_CHANGE_VELOCITY);
- }
- public void setMultipleEvents(@NonNull VehicleDataEventStatus multipleEvents) {
- setValue(KEY_MULTIPLE_EVENTS, multipleEvents);
- }
- public VehicleDataEventStatus getMultipleEvents() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MULTIPLE_EVENTS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThru.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThru.java
deleted file mode 100644
index ab61c548e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThru.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-/**
- * When this request is invoked, the audio capture stops
- *
- * <p>Function Group: AudioPassThru</p>
- *
- * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>
- *
- * <p><b>Request</b></p>
- *
- * <p>No parameters.</p>
- * <p><b>Response</b> </p>
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>REJECTED</p>
- * <p>DISALLOWED</p>
- * @since SmartDeviceLink 2.0
- * @see PerformAudioPassThru
- */
-public class EndAudioPassThru extends RPCRequest {
-
- /**
- * Constructs a new EndAudioPassThru object
- */
- public EndAudioPassThru() {
- super(FunctionID.END_AUDIO_PASS_THRU.toString());
- }
-
- /**
- * <p>Constructs a new EndAudioPassThru object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public EndAudioPassThru(Hashtable<String, Object> hash) {
- super(hash);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java
deleted file mode 100644
index fddb8a30c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * End Audio Pass Thru Response is sent, when EndAudioPassThru has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class EndAudioPassThruResponse extends RPCResponse {
-
- /**
- * Constructs a new EndAudioPassThruResponse object
- */
- public EndAudioPassThruResponse() {
- super(FunctionID.END_AUDIO_PASS_THRU.toString());
- }
- public EndAudioPassThruResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new EndAudioPassThruResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public EndAudioPassThruResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
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
deleted file mode 100644
index 78e76c808..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java
+++ /dev/null
@@ -1,97 +0,0 @@
-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/FuelRange.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java
deleted file mode 100644
index 01027aa8d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.FuelType;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import java.util.Hashtable;
-
-public class FuelRange extends RPCStruct{
- public static final String KEY_TYPE = "type";
- public static final String KEY_RANGE = "range";
-
- /**
- * Constructs a new FuelRange object
- */
- public FuelRange() { }
-
- /**
- * <p>Constructs a new FuelRange object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public FuelRange(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets the type portion of the FuelRange class
- *
- * @param fuelType
- */
- public void setType(FuelType fuelType) {
- setValue(KEY_TYPE, fuelType);
- }
-
- /**
- * Gets the type portion of the FuelRange class
- *
- * @return FuelType.
- */
- public FuelType getType() {
- return (FuelType) getObject(FuelType.class, KEY_TYPE);
- }
-
- /**
- * Gets the range portion of the FuelRange class
- *
- * @return Float - The estimate range in KM the vehicle can travel based on fuel level and consumption.
- */
- public Float getRange() {
- Object object = getValue(KEY_RANGE);
- return SdlDataTypeConverter.objectToFloat(object);
- }
-
- /**
- * Sets the range portion of the FuelRange class
- *
- * @param range
- * The estimate range in KM the vehicle can travel based on fuel level and consumption.
- */
- public void setRange(Float range) {
- setValue(KEY_RANGE, range);
- }
-}
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
deleted file mode 100644
index ca264556f..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
+++ /dev/null
@@ -1,493 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
-import com.smartdevicelink.proxy.rpc.enums.Dimension;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import java.util.Hashtable;
-
-/**
- * Describes the GPS data. Not all data will be available on all carlines.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>longitudeDegrees</td>
- * <td>Double</td>
- * <td>Minvalue: - 180
- * <b>Maxvalue: 180
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>latitudeDegrees</td>
- * <td>Double</td>
- * <td>Minvalue: - 90<b>Maxvalue: 90
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>utcYear</td>
- * <td>Integer</td>
- * <td>Minvalue: 2010<b>Maxvalue: 2100
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>utcMonth</td>
- * <td>Integer</td>
- * <td>Minvalue: 1<b>Maxvalue: 12
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>utcDay</td>
- * <td>Integer</td>
- * <td>Minvalue: 1<b>Maxvalue: 31
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>utcHours</td>
- * <td>Integer</td>
- * <td>Minvalue: 0<b>Maxvalue: 23
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>utcMinutes</td>
- * <td>Integer</td>
- * <td>Minvalue: 0<b>Maxvalue: 59
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>utcSeconds</td>
- * <td>Integer</td>
- * <td>Minvalue: 0<b>Maxvalue: 59
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>pdop</td>
- * <td>Integer</td>
- * <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. 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. 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>actual</td>
- * <td>Boolean</td>
- * <td>True, if coordinates are based on satellites.
- * False, if based on dead reckoning
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>satellites</td>
- * <td>Integer</td>
- * <td>Number of satellites in view
- * <b>Minvalue: 0
- * <b>Maxvalue: 31
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>altitude</td>
- * <td>Integer</td>
- * <td>Altitude in meters
- * <b>Minvalue: -10000</b>
- * <b>Maxvalue: 10000</b>
- * <b>Note:</b> SYNC uses Mean Sea Level for calculating GPS. </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>heading</td>
- * <td>Double</td>
- * <td>The heading. North is 0, East is 90, etc.
- * <b>Minvalue: 0
- * <b>Maxvalue: 359.99
- * <b>Resolution is 0.01
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>speed</td>
- * <td>Integer</td>
- * <td>The speed in KPH
- * <b>Minvalue: 0
- * <b>Maxvalue: 500
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class GPSData extends RPCStruct {
- public static final String KEY_LONGITUDE_DEGREES = "longitudeDegrees";
- public static final String KEY_LATITUDE_DEGREES = "latitudeDegrees";
- public static final String KEY_UTC_YEAR = "utcYear";
- public static final String KEY_UTC_MONTH = "utcMonth";
- public static final String KEY_UTC_DAY = "utcDay";
- public static final String KEY_UTC_HOURS = "utcHours";
- public static final String KEY_UTC_MINUTES = "utcMinutes";
- public static final String KEY_UTC_SECONDS = "utcSeconds";
- public static final String KEY_COMPASS_DIRECTION = "compassDirection";
- public static final String KEY_PDOP = "pdop";
- public static final String KEY_VDOP = "vdop";
- public static final String KEY_HDOP = "hdop";
- public static final String KEY_ACTUAL = "actual";
- public static final String KEY_SATELLITES = "satellites";
- public static final String KEY_DIMENSION = "dimension";
- public static final String KEY_ALTITUDE = "altitude";
- public static final String KEY_HEADING = "heading";
- public static final String KEY_SPEED = "speed";
-
- /**
- * 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
- */
- public GPSData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * 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,
- @NonNull Double pdop, @NonNull Double hdop, @NonNull Double vdop, @NonNull Boolean actual,
- @NonNull Integer satellites, @NonNull Dimension dimension, @NonNull Double altitude, @NonNull Double heading, @NonNull Double speed) {
- this();
- setLongitudeDegrees(longitudeDegrees);
- setLatitudeDegrees(latitudeDegrees);
- setUtcYear(utcYear);
- setUtcMonth(utcMonth);
- setUtcDay(utcDay);
- setUtcHours(utcHours);
- setUtcMinutes(utcMinutes);
- setUtcSeconds(utcSeconds);
- setCompassDirection(compassDirection);
- setPdop(pdop);
- setHdop(hdop);
- setVdop(vdop);
- setActual(actual);
- setSatellites(satellites);
- setDimension(dimension);
- setAltitude(altitude);
- 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
- */
- public void setLongitudeDegrees(@NonNull Double longitudeDegrees) {
- setValue(KEY_LONGITUDE_DEGREES, longitudeDegrees);
- }
-
- /**
- * get longitude degrees
- * @return longitude degrees
- */
- public Double getLongitudeDegrees() {
- Object object = getValue(KEY_LONGITUDE_DEGREES);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- /**
- * set latitude degrees
- * @param latitudeDegrees latitude degrees
- */
- public void setLatitudeDegrees(@NonNull Double latitudeDegrees) {
- setValue(KEY_LATITUDE_DEGREES, latitudeDegrees);
- }
-
- /**
- * get latitude degrees
- * @return latitude degrees
- */
- public Double getLatitudeDegrees() {
- Object object = getValue(KEY_LATITUDE_DEGREES);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- /**
- * set utc year
- * @param utcYear utc year
- */
- public void setUtcYear(Integer utcYear) {
- setValue(KEY_UTC_YEAR, utcYear);
- }
-
- /**
- * get utc year
- * @return utc year
- */
- public Integer getUtcYear() {
- return getInteger(KEY_UTC_YEAR);
- }
-
- /**
- * set utc month
- * @param utcMonth utc month
- */
- public void setUtcMonth(Integer utcMonth) {
- setValue(KEY_UTC_MONTH, utcMonth);
- }
-
- /**
- * get utc month
- * @return utc month
- */
- public Integer getUtcMonth() {
- return getInteger(KEY_UTC_MONTH);
- }
-
- /**
- * set utc day
- * @param utcDay utc day
- */
- public void setUtcDay(Integer utcDay) {
- setValue(KEY_UTC_DAY, utcDay);
- }
-
- /**
- * get utc day
- * @return utc day
- */
- public Integer getUtcDay() {
- return getInteger(KEY_UTC_DAY);
- }
-
- /**
- * set utc hours
- * @param utcHours utc hours
- */
- public void setUtcHours(Integer utcHours) {
- setValue(KEY_UTC_HOURS, utcHours);
- }
-
- /**
- * get utc hours
- * @return utc hours
- */
- public Integer getUtcHours() {
- return getInteger(KEY_UTC_HOURS);
- }
-
- /**
- * set utc minutes
- * @param utcMinutes utc minutes
- */
- public void setUtcMinutes(Integer utcMinutes) {
- setValue(KEY_UTC_MINUTES, utcMinutes);
- }
-
- /**
- * get utc minutes
- * @return utc minutes
- */
- public Integer getUtcMinutes() {
- return getInteger(KEY_UTC_MINUTES);
- }
-
- /**
- * set utc seconds
- * @param utcSeconds utc seconds
- */
- public void setUtcSeconds(Integer utcSeconds) {
- setValue(KEY_UTC_SECONDS, utcSeconds);
- }
-
- /**
- * get utc seconds
- * @return utc seconds
- */
- public Integer getUtcSeconds() {
- return getInteger(KEY_UTC_SECONDS);
- }
- public void setCompassDirection(CompassDirection compassDirection) {
- setValue(KEY_COMPASS_DIRECTION, compassDirection);
- }
- public CompassDirection getCompassDirection() {
- return (CompassDirection) getObject(CompassDirection.class, KEY_COMPASS_DIRECTION);
- }
-
- /**
- * set the positional dilution of precision
- * @param pdop the positional dilution of precision
- */
- public void setPdop(Double pdop) {
- setValue(KEY_PDOP, pdop);
- }
-
- /**
- * get the positional dilution of precision
- */
- public Double getPdop() {
- Object object = getValue(KEY_PDOP);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- /**
- * set the horizontal dilution of precision
- * @param hdop the horizontal dilution of precision
- */
- public void setHdop(Double hdop) {
- setValue(KEY_HDOP, hdop);
- }
-
- /**
- * get the horizontal dilution of precision
- * @return the horizontal dilution of precision
- */
- public Double getHdop() {
- Object object = getValue(KEY_HDOP);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- /**
- * set the vertical dilution of precision
- * @param vdop the vertical dilution of precision
- */
- public void setVdop(Double vdop) {
- setValue(KEY_VDOP, vdop);
- }
-
- /**
- * get the vertical dilution of precision
- * @return the vertical dilution of precision
- */
- public Double getVdop() {
- Object object = getValue(KEY_VDOP);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- /**
- * set what coordinates based on
- * @param actual True, if coordinates are based on satellites.False, if based on dead reckoning
- */
- public void setActual(Boolean actual) {
- setValue(KEY_ACTUAL, actual);
- }
-
- /**
- * get what coordinates based on
- * @return True, if coordinates are based on satellites.False, if based on dead reckoning
- */
- public Boolean getActual() {
- return getBoolean(KEY_ACTUAL);
- }
-
- /**
- * set the number of satellites in view
- * @param satellites the number of satellites in view
- */
- public void setSatellites(Integer satellites) {
- setValue(KEY_SATELLITES, satellites);
- }
-
- /**
- * get the number of satellites in view
- * @return the number of satellites in view
- */
- public Integer getSatellites() {
- return getInteger(KEY_SATELLITES);
- }
- public void setDimension(Dimension dimension) {
- setValue(KEY_DIMENSION, dimension);
- }
- public Dimension getDimension() {
- return (Dimension) getObject(Dimension.class, KEY_DIMENSION);
- }
-
- /**
- * set altitude in meters
- * @param altitude altitude in meters
- */
- public void setAltitude(Double altitude) {
- setValue(KEY_ALTITUDE, altitude);
- }
-
- /**
- * get altitude in meters
- * @return altitude in meters
- */
- public Double getAltitude() {
- Object object = getValue(KEY_ALTITUDE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- /**
- * set the heading.North is 0, East is 90, etc.
- * @param heading the heading.
- */
- public void setHeading(Double heading) {
- setValue(KEY_HEADING, heading);
- }
-
- /**
- * get the heading
- */
- public Double getHeading() {
- Object object = getValue(KEY_HEADING);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- /**
- * set speed in KPH
- * @param speed the speed
- */
- public void setSpeed(Double speed) {
- setValue(KEY_SPEED, speed);
- }
-
- /**
- * get the speed in KPH
- * @return the speed in KPH
- */
- public Double getSpeed() {
- Object object = getValue(KEY_SPEED);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java
deleted file mode 100644
index a92c237e3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Generic Response is sent, when the name of a received msg cannot be
- * retrieved. Only used in case of an error. Currently, only resultCode
- * INVALID_DATA is used.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>success</td>
- * <td>Boolean</td>
- * <td>true, if successful; false, if failed</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>resultCode</td>
- * <td>Result</td>
- * <td>Defines the possible result codes returned by SDL to the application in a Response to a requested operation</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>info</td>
- * <td>String</td>
- * <td>Provides additional human readable info regarding the result.</td>
- * <td>N</td>
- * <td>maxlength=1000</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- */
-public class GenericResponse extends RPCResponse {
-
- public GenericResponse() {
- super(FunctionID.GENERIC_RESPONSE.toString());
- }
- public GenericResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new GenericResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public GenericResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java
deleted file mode 100644
index 23eeac0d4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * This RPC allows to request diagnostic module trouble codes from a certain
- * vehicle module.
- *
- *<p> Function Group: ProprietaryData</p>
- *
- *<p> <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>ecuName</td>
- * <td>Integer</td>
- * <td>Name of ECU.</td>
- * <td>Y</td>
- * <td>Min Value: 0; Max Value: 65535</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>dtcMask</td>
- * <td>Integer</td>
- * <td>DTC Mask Byte to be sent in diagnostic request to module.</td>
- * <td>N</td>
- * <td>Min Value: 0; Max Value: 255</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * </table>
- * <p><b>Response</b></p>
- *
- * <p><b>Non-default Result Codes:</b></p>
- *<p> SUCCESS</p>
- * <p>INVALID_DATA</p>
- *<p> OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- *<p>GENERIC_ERROR</p>
- * <p>REJECTED</p>
- * <p>DISALLOWED </p>
- * <p>USER_DISALLOWED</p>
- * @since SmartDeviceLink 2.0
- */
-public class GetDTCs extends RPCRequest {
- public static final String KEY_DTC_MASK = "dtcMask";
- public static final String KEY_ECU_NAME = "ecuName";
-
- /**
- * Constructs a new GetDTCs object
- */
- public GetDTCs() {
- super(FunctionID.GET_DTCS.toString());
- }
-
- /**
- * <p>Constructs a new GetDTCs object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash The Hashtable to use
- */
- public GetDTCs(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new GetDTCs object
- * @param ecuName an Integer value representing a name of the module to receive the DTC form <br>
- * <b>Notes: </b>Minvalue:0; Maxvalue:65535
- */
- public GetDTCs(@NonNull Integer ecuName) {
- this();
- setEcuName(ecuName);
- }
-
- /**
- * Sets a name of the module to receive the DTC form
- *
- * @param ecuName
- * an Integer value representing a name of the module to receive
- * the DTC form
- * <p>
- * <b>Notes:</p> </b>Minvalue:0; Maxvalue:65535
- */
- public void setEcuName(@NonNull Integer ecuName) {
- setParameters(KEY_ECU_NAME, ecuName);
- }
-
- /**
- * Gets a name of the module to receive the DTC form
- *
- * @return Integer -an Integer value representing a name of the module to
- * receive the DTC form
- */
- public Integer getEcuName() {
- return getInteger(KEY_ECU_NAME);
- }
- public void setDtcMask(Integer dtcMask) {
- setParameters(KEY_DTC_MASK, dtcMask);
- }
- public Integer getDtcMask() {
- return getInteger(KEY_DTC_MASK);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
deleted file mode 100644
index 802f6b34a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Get DTCs Response is sent, when GetDTCs has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class GetDTCsResponse extends RPCResponse{
-
- public static final String KEY_ECU_HEADER = "ecuHeader";
- public static final String KEY_DTC = "dtc";
-
- public GetDTCsResponse(){
- super(FunctionID.GET_DTCS.toString());
- }
-
- public GetDTCsResponse(Hashtable<String, Object> hash){
- super(hash);
- }
-
- /**
- * Constructs a new GetDTCsResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- * @param ecuHeader
- */
- public GetDTCsResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer ecuHeader) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- setEcuHeader(ecuHeader);
- }
-
- @SuppressWarnings("unchecked")
- public List<String> getDtc(){
- return (List<String>) getObject(String.class, KEY_DTC);
- }
-
- public void setDtc(List<String> dtc){
- setParameters(KEY_DTC, dtc);
- }
-
- public Integer getEcuHeader(){
- return getInteger(KEY_ECU_HEADER);
- }
-
- public void setEcuHeader(@NonNull Integer ecuHeader){
- setParameters(KEY_ECU_HEADER, ecuHeader);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java
deleted file mode 100644
index dc6ab5444..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.ModuleType;
-import java.util.Hashtable;
-
-/**
- * Read the current status value of specified remote control module (type). In addition,
- * When subscribe=true, subscribes for specific remote control module data items;
- * When subscribe=false, un-subscribes for specific remote control module data items.
- * Once subscribed, the application will be notified by the onInteriorVehicleData notification
- * whenever new data is available for the module.
- */
-public class GetInteriorVehicleData extends RPCRequest {
- public static final String KEY_MODULE_TYPE = "moduleType";
- public static final String KEY_SUBSCRIBE = "subscribe";
-
- /**
- * Constructs a new GetInteriorVehicleData object
- */
- public GetInteriorVehicleData() {
- super(FunctionID.GET_INTERIOR_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new GetInteriorVehicleData object indicated by the
- * Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public GetInteriorVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new GetInteriorVehicleData object
- */
- public GetInteriorVehicleData(@NonNull ModuleType moduleType) {
- this();
- setModuleType(moduleType);
- }
-
- /**
- * Gets the ModuleType
- *
- * @return ModuleType - The type of a RC module to retrieve module data from the vehicle.
- * In the future, this should be the Identification of a module.
- */
- public ModuleType getModuleType() {
- return (ModuleType) getObject(ModuleType.class, KEY_MODULE_TYPE);
- }
-
- /**
- * Sets a ModuleType
- *
- * @param moduleType
- * The type of a RC module to retrieve module data from the vehicle.
- * In the future, this should be the Identification of a module.
- */
- public void setModuleType(@NonNull ModuleType moduleType) {
- setParameters(KEY_MODULE_TYPE, moduleType);
- }
-
- /**
- * Sets subscribe parameter
- *
- * @param subscribe
- * If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType.
- * If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType.
- */
- public void setSubscribe(Boolean subscribe) {
- setParameters(KEY_SUBSCRIBE, subscribe);
- }
-
- /**
- * Gets subscribe parameter
- *
- * @return Boolean - If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType.
- * If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType.
- */
- public Boolean getSubscribe() {
- return getBoolean(KEY_SUBSCRIBE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
deleted file mode 100644
index 88d663805..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-public class GetInteriorVehicleDataResponse extends RPCResponse {
- public static final String KEY_MODULE_DATA = "moduleData";
- public static final String KEY_IS_SUBSCRIBED = "isSubscribed";
-
- /**
- * Constructs a new GetInteriorVehicleDataResponse object
- */
- public GetInteriorVehicleDataResponse() {
- super(FunctionID.GET_INTERIOR_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new GetInteriorVehicleDataResponse object indicated by the
- * Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public GetInteriorVehicleDataResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new GetInteriorVehicleDataResponse object
- * @param moduleData
- * @param resultCode whether the request is successfully processed
- * @param success whether the request is successfully processed
-
- */
- public GetInteriorVehicleDataResponse( @NonNull ModuleData moduleData, @NonNull Result resultCode, @NonNull Boolean success) {
- this();
- setModuleData(moduleData);
- setResultCode(resultCode);
- setSuccess(success);
- }
-
- /**
- * Gets the moduleData
- *
- * @return ModuleData
- */
- public ModuleData getModuleData() {
- return (ModuleData) getObject(ModuleData.class, KEY_MODULE_DATA);
- }
-
- /**
- * Sets the moduleData
- *
- * @param moduleData
- */
- public void setModuleData(ModuleData moduleData) {
- setParameters(KEY_MODULE_DATA, moduleData);
- }
-
- /**
- * Sets isSubscribed parameter
- *
- * @param isSubscribed
- * It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
- * If "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType.
- * If "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.
- * */
- public void setIsSubscribed(Boolean isSubscribed) {
- setParameters(KEY_IS_SUBSCRIBED, isSubscribed);
- }
-
- /**
- * Gets isSubscribed parameter
- *
- * @return Boolean - It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
- * If "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType.
- * If "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.
- * */
- public Boolean getIsSubscribed() {
- return getBoolean(KEY_IS_SUBSCRIBED);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java
deleted file mode 100644
index 031adddcf..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-
-import java.util.Hashtable;
-
-/**
- * Used to request the corresponding capability object for a given capability.
- */
-
-public class GetSystemCapability extends RPCRequest {
- public static final String KEY_SYSTEM_CAPABILITY_TYPE = "systemCapabilityType";
-
- /**
- * Constructs a new GetSystemCapability object
- */
- public GetSystemCapability(){
- super(FunctionID.GET_SYSTEM_CAPABILITY.toString());
- }
-
- /**
- * <p>Constructs a new GetSystemCapability object indicated by the Hashtable parameter</p>
- *
- * @param hash
- * The Hashtable to use
- */
- public GetSystemCapability(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new GetSystemCapability object
- * @param systemCapabilityType SystemCapabilityType being requested
- */
- public GetSystemCapability(@NonNull SystemCapabilityType systemCapabilityType){
- this();
- setSystemCapabilityType(systemCapabilityType);
- }
-
- /**
- * Used to get the SystemCapabilityType being requested
- * @return the SystemCapabilityType being requested
- */
- public SystemCapabilityType getSystemCapabilityType(){
- return (SystemCapabilityType) getObject(SystemCapabilityType.class, KEY_SYSTEM_CAPABILITY_TYPE);
- }
-
- /**
- * Used to set the SystemCapabilityType being requested
- * @param value SystemCapabilityType being requested
- */
- public void setSystemCapabilityType(@NonNull SystemCapabilityType value){
- setParameters(KEY_SYSTEM_CAPABILITY_TYPE, value);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
deleted file mode 100644
index afcc8c48c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-/**
- * GetSystemCapabilityResponse is sent, when GetSystemCapability has been called
- */
-
-public class GetSystemCapabilityResponse extends RPCResponse {
- public static final String KEY_SYSTEM_CAPABILITY = "systemCapability";
-
- /**
- * Constructs a new GetSystemCapability object
- */
- public GetSystemCapabilityResponse(){
- super(FunctionID.GET_SYSTEM_CAPABILITY.toString());
- }
-
- /**
- * <p>Constructs a new GetSystemCapability object indicated by the Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public GetSystemCapabilityResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new GetSystemCapabilityResponse object
- * @param systemCapability SystemCapability object
- * @param resultCode whether the request is successfully processed
- * @param success whether the request is successfully processed
- */
- public GetSystemCapabilityResponse(@NonNull SystemCapability systemCapability, @NonNull Result resultCode, @NonNull Boolean success) {
- this();
- setSystemCapability(systemCapability);
- setResultCode(resultCode);
- setSuccess(success);
- }
-
- /**
- * Get the SystemCapability object returned after a GetSystemCapability call
- * @return SystemCapability object
- */
- public SystemCapability getSystemCapability(){
- return (SystemCapability) getObject(SystemCapability.class, KEY_SYSTEM_CAPABILITY);
- }
-
- /**
- * Set a SystemCapability object in the response
- * @param value SystemCapability object
- */
- public void setSystemCapability(@NonNull SystemCapability value){
- setParameters(KEY_SYSTEM_CAPABILITY, value);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java
deleted file mode 100644
index d2ac79454..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java
+++ /dev/null
@@ -1,495 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import static android.provider.Contacts.SettingsColumns.KEY;
-import static com.smartdevicelink.proxy.constants.Names.choiceSet;
-import static com.smartdevicelink.proxy.constants.Names.externalTemperature;
-import static com.smartdevicelink.proxy.constants.Names.instantFuelConsumption;
-import static com.smartdevicelink.proxy.constants.Names.prndl;
-import static com.smartdevicelink.proxy.constants.Names.vin;
-import static com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet.KEY_CHOICE_SET;
-
-/**
- * Non periodic vehicle data read request.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>gps</td>
- * <td>Boolean</td>
- * <td>GPS data. See {@linkplain GPS data }for details</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>speed</td>
- * <td>Boolean</td>
- * <td>The vehicle speed in kilometers per hour</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>rpm</td>
- * <td>Boolean</td>
- * <td>The number of revolutions per minute of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel</td>
- * <td>Boolean</td>
- * <td>The fuel level in the tank (percentage)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel_State</td>
- * <td>Boolean</td>
- * <td>The fuel level state</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>instantFuelConsumption</td>
- * <td>Boolean</td>
- * <td>The instantaneous fuel consumption in microlitres</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>externalTemperature</td>
- * <td>Boolean</td>
- * <td>The external temperature in degrees celsius</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>vin</td>
- * <td>Boolean</td>
- * <td>Vehicle identification number</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>prndl</td>
- * <td>Boolean</td>
- * <td>Currently selected gear.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>tirePressure</td>
- * <td>Boolean</td>
- * <td>Tire pressure status</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>odometer</td>
- * <td>Boolean</td>
- * <td>Odometer in km</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>beltStatus</td>
- * <td>Boolean</td>
- * <td>The status of the seat belts</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>bodyInformation</td>
- * <td>Boolean</td>
- * <td>The body information including ignition status and internal temp</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>deviceStatus</td>
- * <td>Boolean</td>
- * <td>The device status including signal and battery strength</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>driverBraking</td>
- * <td>Boolean</td>
- * <td>The status of the brake pedal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>wiperStatus</td>
- * <td>Boolean</td>
- * <td>The status of the wipers</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>headLampStatus</td>
- * <td>Boolean</td>
- * <td>Status of the head lamps</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>engineTorque</td>
- * <td>Boolean</td>
- * <td>Torque value for engine (in Nm) on non-diesel variants</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>engineOilLife</td>
- * <td>Boolean</td>
- * <td>The estimated percentage of remaining oil life of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>accPedalPosition</td>
- * <td>Boolean</td>
- * <td>Accelerator pedal position (percentage depressed)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>steeringWheelAngle</td>
- * <td>Boolean</td>
- * <td>Current angle of the steering wheel (in deg)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>turnSignal</td>
- * <td>Boolean</td>
- * <td>@see TurnSignal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * </table>
- *
- *
- * <p><b>Response</b></p>
- *
- * <p> <b>Non-default Result Codes:</b></p>
- * <p> SUCCESS</p>
- * <p> INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p> REJECTED</p>
- * <p> VEHICLE_DATA_NOT_ALLOWED</p>
- * <p>VEHICLE_DATA_NOT_AVAILABLE</p>
- * <p> USER_DISALLOWED</p>
- *
- * @see SubscribeVehicleData
- * @see UnsubscribeVehicleData
- * @since SmartDeviceLink 2.0
- *
- *
- */
-public class GetVehicleData extends RPCRequest {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- public static final String KEY_VIN = "vin";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
-
- /**
- * Constructs a new GetVehicleData object
- */
-
- public GetVehicleData() {
- super(FunctionID.GET_VEHICLE_DATA.toString());
- }
- /**
- * <p>
- * Constructs a new GetVehicleDta object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public GetVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
- public void setGps(Boolean gps) {
- setParameters(KEY_GPS, gps);
- }
- public Boolean getGps() {
- return getBoolean(KEY_GPS);
- }
- public void setSpeed(Boolean speed) {
- setParameters(KEY_SPEED, speed);
- }
- public Boolean getSpeed() {
- return getBoolean(KEY_SPEED);
- }
- public void setRpm(Boolean rpm) {
- setParameters(KEY_RPM, rpm);
- }
- public Boolean getRpm() {
- return getBoolean(KEY_RPM);
- }
- public void setFuelLevel(Boolean fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- }
- public Boolean getFuelLevel() {
- return getBoolean(KEY_FUEL_LEVEL);
- }
- @Deprecated
- public void setFuelLevel_State(Boolean fuelLevel_State) {
- setFuelLevelState(fuelLevel_State);
- }
- @Deprecated
- public Boolean getFuelLevel_State() {
- return getFuelLevelState();
- }
- public void setFuelLevelState(Boolean fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- }
- public Boolean getFuelLevelState() {
- return getBoolean(KEY_FUEL_LEVEL_STATE);
- }
- public void setInstantFuelConsumption(Boolean instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- }
- public Boolean getInstantFuelConsumption() {
- return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
- }
- public void setExternalTemperature(Boolean externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- }
- public Boolean getExternalTemperature() {
- return getBoolean(KEY_EXTERNAL_TEMPERATURE);
- }
-
- public void setVin(Boolean vin) {
- setParameters(KEY_VIN, vin);
- }
- public Boolean getVin() {
- return getBoolean(KEY_VIN);
- }
-
- public void setPrndl(Boolean prndl) {
- setParameters(KEY_PRNDL, prndl);
- }
- public Boolean getPrndl() {
- return getBoolean(KEY_PRNDL);
- }
- public void setTirePressure(Boolean tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- }
- public Boolean getTirePressure() {
- return getBoolean(KEY_TIRE_PRESSURE);
- }
- public void setOdometer(Boolean odometer) {
- setParameters(KEY_ODOMETER, odometer);
- }
- public Boolean getOdometer() {
- return getBoolean(KEY_ODOMETER);
- }
- public void setBeltStatus(Boolean beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- }
- public Boolean getBeltStatus() {
- return getBoolean(KEY_BELT_STATUS);
- }
- public void setBodyInformation(Boolean bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- }
- public Boolean getBodyInformation() {
- return getBoolean(KEY_BODY_INFORMATION);
- }
- public void setDeviceStatus(Boolean deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- }
- public Boolean getDeviceStatus() {
- return getBoolean(KEY_DEVICE_STATUS);
- }
- public void setDriverBraking(Boolean driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- }
- public Boolean getDriverBraking() {
- return getBoolean(KEY_DRIVER_BRAKING);
- }
- public void setWiperStatus(Boolean wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- }
- public Boolean getWiperStatus() {
- return getBoolean(KEY_WIPER_STATUS);
- }
- public void setHeadLampStatus(Boolean headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- }
- public Boolean getHeadLampStatus() {
- return getBoolean(KEY_HEAD_LAMP_STATUS);
- }
- public void setEngineTorque(Boolean engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
- public Boolean getEngineTorque() {
- return getBoolean(KEY_ENGINE_TORQUE);
- }
- public void setEngineOilLife(Boolean engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
- public Boolean getEngineOilLife() {
- return getBoolean(KEY_ENGINE_OIL_LIFE);
- }
- public void setAccPedalPosition(Boolean accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- }
- public Boolean getAccPedalPosition() {
- return getBoolean(KEY_ACC_PEDAL_POSITION);
- }
-
- public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- }
- public Boolean getSteeringWheelAngle() {
- return getBoolean(KEY_STEERING_WHEEL_ANGLE);
- }
- public void setECallInfo(Boolean eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- }
- public Boolean getECallInfo() {
- return getBoolean(KEY_E_CALL_INFO);
- }
-
-
- public void setAirbagStatus(Boolean airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- }
- public Boolean getAirbagStatus() {
- return getBoolean(KEY_AIRBAG_STATUS);
- }
- public void setEmergencyEvent(Boolean emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- }
- public Boolean getEmergencyEvent() {
- return getBoolean(KEY_EMERGENCY_EVENT);
- }
- public void setClusterModeStatus(Boolean clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- }
- public Boolean getClusterModeStatus() {
- return getBoolean(KEY_CLUSTER_MODE_STATUS);
- }
- public void setMyKey(Boolean myKey) {
- setParameters(KEY_MY_KEY, myKey);
- }
- public Boolean getMyKey() {
- return getBoolean(KEY_MY_KEY);
- }
-
- /**
- * Sets a boolean value. If true, gets fuelRange data
- * @param fuelRange
- * a boolean value
- */
- public void setFuelRange(Boolean fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
-
- /**
- * Gets a boolean value.
- *
- * @return Boolean -a Boolean value.
- *
- */
- public Boolean getFuelRange() {
- return getBoolean(KEY_FUEL_RANGE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes turnSignal data
- * @param turnSignal a boolean value
- */
- public void setTurnSignal(Boolean turnSignal) { setParameters(KEY_TURN_SIGNAL, turnSignal); }
-
- /**
- * Gets a boolean value. If true, means the turnSignal data has been subscribed.
- * @return a Boolean value.
- */
- public Boolean getTurnSignal() { return getBoolean(KEY_TURN_SIGNAL); }
-
- /**
- * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
- * @param electronicParkBrakeStatus a boolean value
- */
- public void setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus){
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
- * @return a Boolean value.
- */
- public Boolean getElectronicParkBrakeStatus(){
- return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java
deleted file mode 100644
index 91eefc13c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java
+++ /dev/null
@@ -1,316 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PRNDL;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Get Vehicle Data Response is sent, when GetVehicleData has been called.
- *
- * @since SmartDeviceLink 2.0
- */
-public class GetVehicleDataResponse extends RPCResponse {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- public static final String KEY_VIN = "vin";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
-
- /**
- * Constructs a new GetVehicleDataResponse object
- */
-
- public GetVehicleDataResponse() {
- super(FunctionID.GET_VEHICLE_DATA.toString());
- }
- public GetVehicleDataResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new GetVehicleDataResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public GetVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
- public void setGps(GPSData gps) {
- setParameters(KEY_GPS, gps);
- }
- @SuppressWarnings("unchecked")
- public GPSData getGps() {
- return (GPSData) getObject(GPSData.class, KEY_GPS);
- }
- public void setSpeed(Double speed) {
- setParameters(KEY_SPEED, speed);
- }
- public Double getSpeed() {
- Object object = getParameters(KEY_SPEED);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setRpm(Integer rpm) {
- setParameters(KEY_RPM, rpm);
- }
- public Integer getRpm() {
- return getInteger(KEY_RPM);
- }
- public void setFuelLevel(Double fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- }
- public Double getFuelLevel() {
- Object object = getParameters(KEY_FUEL_LEVEL);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- @Deprecated
- public void setFuelLevel_State(ComponentVolumeStatus fuelLevel_State) {
- setFuelLevelState(fuelLevel_State);
- }
- @Deprecated
- public ComponentVolumeStatus getFuelLevel_State() {
- return getFuelLevelState();
- }
- public void setFuelLevelState(ComponentVolumeStatus fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- }
- public ComponentVolumeStatus getFuelLevelState() {
- return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE);
- }
- public void setInstantFuelConsumption(Double instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- }
- public Double getInstantFuelConsumption() {
- Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setExternalTemperature(Double externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- }
- public Double getExternalTemperature() {
- Object object = getParameters(KEY_EXTERNAL_TEMPERATURE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setVin(String vin) {
- setParameters(KEY_VIN, vin);
- }
- public String getVin() {
- return getString(KEY_VIN);
- }
- public void setPrndl(PRNDL prndl) {
- setParameters(KEY_PRNDL, prndl);
- }
- public PRNDL getPrndl() {
- return (PRNDL) getObject(PRNDL.class, KEY_PRNDL);
- }
- public void setTirePressure(TireStatus tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- }
- @SuppressWarnings("unchecked")
- public TireStatus getTirePressure() {
- return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE);
- }
- public void setOdometer(Integer odometer) {
- setParameters(KEY_ODOMETER, odometer);
- }
- public Integer getOdometer() {
- return getInteger(KEY_ODOMETER);
- }
- public void setBeltStatus(BeltStatus beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- }
- @SuppressWarnings("unchecked")
- public BeltStatus getBeltStatus() {
- return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS);
- }
- public void setBodyInformation(BodyInformation bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- }
- @SuppressWarnings("unchecked")
- public BodyInformation getBodyInformation() {
- return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION);
- }
- public void setDeviceStatus(DeviceStatus deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- }
- @SuppressWarnings("unchecked")
- public DeviceStatus getDeviceStatus() {
- return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS);
- }
- public void setDriverBraking(VehicleDataEventStatus driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- }
- public VehicleDataEventStatus getDriverBraking() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING);
- }
- public void setWiperStatus(WiperStatus wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- }
- public WiperStatus getWiperStatus() {
- return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS);
- }
-
- public void setHeadLampStatus(HeadLampStatus headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- }
- @SuppressWarnings("unchecked")
- public HeadLampStatus getHeadLampStatus() {
- return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS);
- }
- public void setEngineTorque(Double engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
- public Double getEngineTorque() {
- Object object = getParameters(KEY_ENGINE_TORQUE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setEngineOilLife(Float engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
- public Float getEngineOilLife() {
- Object object = getParameters(KEY_ENGINE_OIL_LIFE);
- return SdlDataTypeConverter.objectToFloat(object);
- }
-
- public void setAccPedalPosition(Double accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- }
- public Double getAccPedalPosition() {
- Object object = getParameters(KEY_ACC_PEDAL_POSITION);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public void setSteeringWheelAngle(Double steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- }
- public Double getSteeringWheelAngle() {
- Object object = getParameters(KEY_STEERING_WHEEL_ANGLE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public void setECallInfo(ECallInfo eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- }
- @SuppressWarnings("unchecked")
- public ECallInfo getECallInfo() {
- return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO);
- }
-
- public void setAirbagStatus(AirbagStatus airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- }
- @SuppressWarnings("unchecked")
- public AirbagStatus getAirbagStatus() {
- return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS);
- }
-
- public void setEmergencyEvent(EmergencyEvent emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- }
- @SuppressWarnings("unchecked")
- public EmergencyEvent getEmergencyEvent() {
- return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT);
- }
- public void setClusterModeStatus(ClusterModeStatus clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- }
- @SuppressWarnings("unchecked")
- public ClusterModeStatus getClusterModeStatus() {
- return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS);
- }
- public void setMyKey(MyKey myKey) {
- setParameters(KEY_MY_KEY, myKey);
- }
- @SuppressWarnings("unchecked")
- public MyKey getMyKey() {
- return (MyKey) getObject(MyKey.class, KEY_MY_KEY);
- }
-
- /**
- * Sets Fuel Range List. Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
- * @param fuelRange
- */
- public void setFuelRange(List<FuelRange> fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
-
- /**
- * Gets Fuel Range List
- * @return List<FuelRange>
- * Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
- */
- @SuppressWarnings("unchecked")
- public List<FuelRange> getFuelRange() {
- return (List<FuelRange>) getObject(FuelRange.class, KEY_FUEL_RANGE);
- }
-
- /**
- * Sets turnSignal
- * @param turnSignal
- */
- public void setTurnSignal(TurnSignal turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- }
-
- /**
- * Gets turnSignal
- * @return TurnSignal
- */
- @SuppressWarnings("unchecked")
- public TurnSignal getTurnSignal() {
- return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets electronicParkBrakeStatus
- * @param electronicParkBrakeStatus
- */
- public void setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus){
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- }
-
- /**
- * Gets electronicParkBrakeStatus
- * @return ElectronicParkBrakeStatus
- */
- public ElectronicParkBrakeStatus getElectronicParkBrakeStatus(){
- return (ElectronicParkBrakeStatus) getObject(ElectronicParkBrakeStatus.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java
deleted file mode 100644
index 95b076e52..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.WayPointType;
-
-import java.util.Hashtable;
-
-public class GetWayPoints extends RPCRequest {
- public static final String KEY_WAY_POINT_TYPE = "wayPointType";
-
- public GetWayPoints() {
- super(FunctionID.GET_WAY_POINTS.toString());
- }
-
- public GetWayPoints(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public GetWayPoints(@NonNull WayPointType wayPointType) {
- this();
- setWayPointType(wayPointType);
- }
-
- public WayPointType getWayPointType() {
- return (WayPointType) getObject(WayPointType.class, KEY_WAY_POINT_TYPE);
- }
-
- public void setWayPointType(@NonNull WayPointType wayPointType) {
- setParameters(KEY_WAY_POINT_TYPE, wayPointType);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java
deleted file mode 100644
index 32344ffbd..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-import java.util.List;
-
-public class GetWayPointsResponse extends RPCResponse {
- public static final String KEY_WAY_POINTS = "wayPoints";
-
- public GetWayPointsResponse() {
- super(FunctionID.GET_WAY_POINTS.toString());
- }
- public GetWayPointsResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new GetWayPointsResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public GetWayPointsResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
- public void setWayPoints(List<LocationDetails> wayPoints) {
- setParameters(KEY_WAY_POINTS, wayPoints);
- }
- @SuppressWarnings("unchecked")
- public List<LocationDetails> getWayPoints() {
- return (List<LocationDetails>) getObject(LocationDetails.class, KEY_WAY_POINTS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java
deleted file mode 100644
index 8f4cdfe66..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-public class HMICapabilities extends RPCStruct{
- public static final String KEY_NAVIGATION = "navigation";
- public static final String KEY_PHONE_CALL = "phoneCall";
- public static final String KEY_VIDEO_STREAMING = "videoStreaming";
- public static final String KEY_REMOTE_CONTROL = "remoteControl";
-
- public HMICapabilities() { }
-
- public HMICapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public boolean isNavigationAvailable(){
- Object available = getValue(KEY_NAVIGATION);
- if(available == null){
- return false;
- }
- return (Boolean)available;
- }
-
- public void setNavigationAvilable(Boolean available){
- setValue(KEY_NAVIGATION, available);
- }
-
- public boolean isPhoneCallAvailable(){
- Object available = getValue(KEY_PHONE_CALL);
- if(available == null){
- return false;
- }
- return (Boolean)available;
- }
-
- public void setPhoneCallAvilable(Boolean available){
- setValue(KEY_PHONE_CALL, available);
- }
-
- public boolean isVideoStreamingAvailable(){
- Object available = getValue(KEY_VIDEO_STREAMING);
- if(available == null){
- return false;
- }
- return (Boolean)available;
- }
-
- public void setVideoStreamingAvailable(Boolean available){
- setValue(KEY_VIDEO_STREAMING, available);
- }
-
- public boolean isRemoteControlAvailable(){
- Object available = getValue(KEY_REMOTE_CONTROL);
- if(available == null){
- return false;
- }
- return (Boolean)available;
- }
-
- public void setRemoteControlAvailable(Boolean available){
- setValue(KEY_REMOTE_CONTROL, available);
- }
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java
deleted file mode 100644
index 307ff8b06..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Defining sets of HMI levels, which are permitted or prohibited for a given RPC.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>allowed</td>
- * <td>HMILevel</td>
- * <td>A set of all HMI levels that are permitted for this given RPC.
- * <ul>
- * <li>Min: 0</li>
- * <li>Max: 100</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>userDisallowed</td>
- * <td>HMILevel</td>
- * <td>A set of all HMI levels that are prohibited for this given RPC.
- * <ul>
- * <li>Min: 0</li>
- * <li>Max: 100</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class HMIPermissions extends RPCStruct {
- public static final String KEY_ALLOWED = "allowed";
- public static final String KEY_USER_DISALLOWED = "userDisallowed";
- /**
- * Constructs a newly allocated HMIPermissions object
- */
- public HMIPermissions() { }
-
- /**
- * Constructs a newly allocated HMIPermissions object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public HMIPermissions(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a newly allocated HMIPermissions object
- * @param allowed HMI level that is permitted for this given RPC
- * @param userDisallowed HMI level that is prohibited for this given RPC
- */
- public HMIPermissions(@NonNull List<HMILevel> allowed, @NonNull List<HMILevel> userDisallowed) {
- this();
- setAllowed(allowed);
- setUserDisallowed(userDisallowed);
- }
- /**
- * get a set of all HMI levels that are permitted for this given RPC.
- * @return a set of all HMI levels that are permitted for this given RPC
- */
- @SuppressWarnings("unchecked")
- public List<HMILevel> getAllowed() {
- return (List<HMILevel>) getObject(HMILevel.class, KEY_ALLOWED);
- }
-
- /**
- * set HMI level that is permitted for this given RPC.
- * @param allowed HMI level that is permitted for this given RPC
- */
- public void setAllowed(@NonNull List<HMILevel> allowed) {
- setValue(KEY_ALLOWED, allowed);
- }
-
- /**
- * get a set of all HMI levels that are prohibited for this given RPC
- * @return a set of all HMI levels that are prohibited for this given RPC
- */
- @SuppressWarnings("unchecked")
- public List<HMILevel> getUserDisallowed() {
- return (List<HMILevel>) getObject(HMILevel.class, KEY_USER_DISALLOWED);
- }
-
- /**
- * set a set of all HMI levels that are prohibited for this given RPC
- * @param userDisallowed HMI level that is prohibited for this given RPC
- */
- public void setUserDisallowed(@NonNull List<HMILevel> userDisallowed) {
- setValue(KEY_USER_DISALLOWED, userDisallowed);
- }
-}
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
deleted file mode 100644
index f5377b1b0..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java
+++ /dev/null
@@ -1,107 +0,0 @@
-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
deleted file mode 100644
index e6dc4d301..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java
+++ /dev/null
@@ -1,79 +0,0 @@
-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/HeadLampStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java
deleted file mode 100644
index 68ffc88ad..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
-/** Status of the head lamps.
- *
- * <p><table border="1" rules="all"></p>
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Mandatory</th>
- * <th>Description</th>
- * </tr>
- * <tr>
- * <td>lowBeamsOn</td>
- * <td>Boolean</td>
- * <td>true</td>
- * <td>Status of the low beam lamps. </td>
- * </tr>
- * <tr>
- * <td>highBeamsOn</td>
- * <td>Boolean</td>
- * <td>true</td>
- * <td>Status of the high beam lamps. </td>
- * </tr>
- * <tr>
- * <td>ambientLightSensorStatus</td>
- * <td>AmbientLightStatus</td>
- * <td>true</td>
- * <td>Status of the ambient light sensor.</td>
- * </tr>
- *
- *
- * </table>
- * @see OnVehicleData
- * @see GetVehicleData
- * @since SmartDeviceLink 1.0
- *
- */
-
-public class HeadLampStatus extends RPCStruct {
- public static final String KEY_AMBIENT_LIGHT_SENSOR_STATUS = "ambientLightSensorStatus";
- public static final String KEY_HIGH_BEAMS_ON = "highBeamsOn";
- public static final String KEY_LOW_BEAMS_ON = "lowBeamsOn";
-
- /**
- * Constructs a new HeadLampStatus object
- */
- public HeadLampStatus() {}
- /**
- * <p>Constructs a new HeadLampStatus object indicated by the Hashtable
- * parameter</p>
- * @param hash The hash table to use
- */
- public HeadLampStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new HeadLampStatus object
- */
- public HeadLampStatus(@NonNull Boolean lowBeamsOn, @NonNull Boolean highBeamsOn) {
- this();
- setLowBeamsOn(lowBeamsOn);
- setHighBeamsOn(highBeamsOn);
- }
- public void setAmbientLightStatus(AmbientLightStatus ambientLightSensorStatus) {
- setValue(KEY_AMBIENT_LIGHT_SENSOR_STATUS, ambientLightSensorStatus);
- }
- public AmbientLightStatus getAmbientLightStatus() {
- return (AmbientLightStatus) getObject(AmbientLightStatus.class, KEY_AMBIENT_LIGHT_SENSOR_STATUS);
- }
- public void setHighBeamsOn(@NonNull Boolean highBeamsOn) {
- setValue(KEY_HIGH_BEAMS_ON, highBeamsOn);
- }
- public Boolean getHighBeamsOn() {
- return getBoolean(KEY_HIGH_BEAMS_ON);
- }
- public void setLowBeamsOn(@NonNull Boolean lowBeamsOn) {
- setValue(KEY_LOW_BEAMS_ON, lowBeamsOn);
- }
- public Boolean getLowBeamsOn() {
- return getBoolean(KEY_LOW_BEAMS_ON);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java
deleted file mode 100644
index 2ae607100..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-/**
- *
- * @since SmartDeviceLink 3.0
- *
- */
-
-public class Headers extends RPCStruct {
- public static final String KEY_CONTENT_TYPE = "ContentType";
- public static final String KEY_CONNECT_TIMEOUT = "ConnectTimeout";
- public static final String KEY_DO_OUTPUT = "DoOutput";
- public static final String KEY_DO_INPUT = "DoInput";
- public static final String KEY_USE_CACHES = "UseCaches";
- public static final String KEY_REQUEST_METHOD = "RequestMethod";
- public static final String KEY_READ_TIMEOUT = "ReadTimeout";
- public static final String KEY_INSTANCE_FOLLOW_REDIRECTS = "InstanceFollowRedirects";
- public static final String KEY_CHARSET = "charset";
- public static final String KEY_CONTENT_LENGTH = "Content-Length";
-
- public Headers() { }
- /**
- * <p>
- * Constructs a new Headers object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public Headers(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public void setContentType(String contenttype) {
- setValue(KEY_CONTENT_TYPE, contenttype);
- }
-
- public String getContentType() {
- return getString(KEY_CONTENT_TYPE);
- }
-
- public void setConnectTimeout(Integer connectiontimeout) {
- setValue(KEY_CONNECT_TIMEOUT, connectiontimeout);
- }
-
- public Integer getConnectTimeout() {
- return getInteger(KEY_CONNECT_TIMEOUT);
- }
-
- public void setDoOutput(Boolean dooutput) {
- setValue(KEY_DO_OUTPUT, dooutput);
- }
-
- public Boolean getDoOutput() {
- return getBoolean(KEY_DO_OUTPUT);
- }
-
- public void setDoInput(Boolean doinput) {
- setValue(KEY_DO_INPUT, doinput);
- }
-
- public Boolean getDoInput() {
- return getBoolean(KEY_DO_INPUT);
- }
-
- public void setUseCaches(Boolean usescaches) {
- setValue(KEY_USE_CACHES, usescaches);
- }
-
- public Boolean getUseCaches() {
- return getBoolean(KEY_USE_CACHES);
- }
-
- public void setRequestMethod(String requestmethod) {
- setValue(KEY_REQUEST_METHOD, requestmethod);
- }
-
- public String getRequestMethod() {
- return getString(KEY_REQUEST_METHOD);
- }
-
-
- public void setReadTimeout(Integer readtimeout) {
- setValue(KEY_READ_TIMEOUT, readtimeout);
- }
-
- public Integer getReadTimeout() {
- return getInteger(KEY_READ_TIMEOUT);
- }
-
- public void setInstanceFollowRedirects(Boolean instancefollowredirects) {
- setValue(KEY_INSTANCE_FOLLOW_REDIRECTS, instancefollowredirects);
- }
-
- public Boolean getInstanceFollowRedirects() {
- return getBoolean(KEY_INSTANCE_FOLLOW_REDIRECTS);
- }
-
- public void setCharset(String charset) {
- setValue(KEY_CHARSET, charset);
- }
-
- public String getCharset() {
- return getString(KEY_CHARSET);
- }
-
- public void setContentLength(Integer contentlength) {
- setValue(KEY_CONTENT_LENGTH, contentlength);
- }
-
- public Integer getContentLength() {
- return getInteger(KEY_CONTENT_LENGTH);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Image.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Image.java
deleted file mode 100644
index f58664054..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Image.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.ImageType;
-
-import java.util.Hashtable;
-
-/**
- *Specifies, which image shall be used, e.g. in Alerts or on Softbuttons provided the display supports it.
- *<p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>value</td>
- * <td>String</td>
- * <td>Either the static hex icon value or the binary image file name identifier (sent by PutFile).
- * <ul>
- * <li>Min: 0</li>
- * <li>Max: 65535</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>imageType</td>
- * <td>ImageType</td>
- * <td>Describes, whether it is a static or dynamic image.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class Image extends RPCStruct {
- public static final String KEY_VALUE = "value";
- public static final String KEY_IMAGE_TYPE = "imageType";
- public static final String KEY_IS_TEMPLATE = "isTemplate";
-
- /**
- * Constructs a newly allocated Image object
- */
- public Image() { }
-
- /**
- * Constructs a newly allocated Image object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public Image(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated Image object
- * @param value either the static hex icon value or the binary image file name identifier (sent by PutFile)
- * @param imageType whether it is a static or dynamic image
- */
- public Image(@NonNull String value, @NonNull ImageType imageType) {
- this();
- setValue(value);
- setImageType(imageType);
- }
-
- /**
- * Set either the static hex icon value or the binary image file name identifier (sent by PutFile)
- * @param value either the static hex icon value or the binary image file name identifier (sent by PutFile)
- */
- public void setValue(@NonNull String value) {
- setValue(KEY_VALUE, value);
- }
-
- /**
- * Get either the static hex icon value or the binary image file name identifier (sent by PutFile)
- * @return either the static hex icon value or the binary image file name identifier (sent by PutFile)
- */
- public String getValue() {
- return getString(KEY_VALUE);
- }
-
- /**
- * Set the image type (static or dynamic image)
- * @param imageType whether it is a static or dynamic image
- */
- public void setImageType(@NonNull ImageType imageType) {
- setValue(KEY_IMAGE_TYPE, imageType);
- }
-
- /**
- * Get image type (static or dynamic image)
- * @return the image type (static or dynamic image)
- */
- public ImageType getImageType() {
- return (ImageType) getObject(ImageType.class, KEY_IMAGE_TYPE);
- }
-
- /**
- * Set whether this Image is a template image whose coloring should be decided by the HMI
- * @param isTemplate boolean that tells whether this Image is a template image
- */
- public void setIsTemplate(Boolean isTemplate){
- setValue(KEY_IS_TEMPLATE, isTemplate);
- }
-
- /**
- * Get whether this Image is a template image whose coloring should be decided by the HMI
- * @return boolean that tells whether this Image is a template image
- */
- public Boolean getIsTemplate(){
- return getBoolean(KEY_IS_TEMPLATE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java
deleted file mode 100644
index 0dccc55cc..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
-import com.smartdevicelink.util.DebugTool;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import static com.smartdevicelink.proxy.rpc.HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS;
-
-/** <p>The name that identifies the field.For example AppIcon,SoftButton, LocationImage, etc.</p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th> Version</th>
- * </tr>
- * <tr>
- * <td>name</td>
- * <td>ImageFieldName</td>
- * <td>The name that identifies the field.{@linkplain ImageFieldName}</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>imageTypeSupported</td>
- * <td>FileType</td>
- * <td>The image types that are supported in this field. {@linkplain FileType}</td>
- * <td></td>
- * <td>maxlength: 100</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>imageResolution</td>
- * <td>ImageResolution</td>
- * <td>The image resolution of this field.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 3.0
- * @see DisplayType
- * @see MediaClockFormat
- * @see TextFieldName
- * @see ImageType
- *
- *
- *
- *
- */
-
-public class ImageField extends RPCStruct {
- public static final String KEY_IMAGE_TYPE_SUPPORTED = "imageTypeSupported";
- public static final String KEY_IMAGE_RESOLUTION = "imageResolution";
- public static final String KEY_NAME = "name";
-
-
- public ImageField() { }
-
- public ImageField(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public ImageField(@NonNull ImageFieldName name, @NonNull List<FileType> imageTypeSupported) {
- this();
- setName(name);
- setImageTypeSupported(imageTypeSupported);
- }
-
- public ImageFieldName getName() {
- return (ImageFieldName) getObject(ImageFieldName.class, KEY_NAME);
- }
- public void setName(@NonNull ImageFieldName name ) {
- setValue(KEY_NAME, name);
- }
- @SuppressWarnings("unchecked")
- public List<FileType> getImageTypeSupported() {
- return (List<FileType>) getObject(FileType.class, KEY_IMAGE_TYPE_SUPPORTED);
- }
- public void setImageTypeSupported(@NonNull List<FileType> imageTypeSupported ) {
- setValue(KEY_IMAGE_TYPE_SUPPORTED, imageTypeSupported);
- }
- @SuppressWarnings("unchecked")
- public ImageResolution getImageResolution() {
- return (ImageResolution) getObject(ImageResolution.class, KEY_IMAGE_RESOLUTION);
- }
- public void setImageResolution( ImageResolution imageResolution ) {
- setValue(KEY_IMAGE_RESOLUTION, imageResolution);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java
deleted file mode 100644
index 2eb69f652..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-/** The image resolution of this field.
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>resolutionWidth</td>
- * <td>Integer</td>
- * <td>The image resolution width.</td>
- * <td></td>
- * <td>minvalue:1; maxvalue: 10000</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>resolutionHeight</td>
- * <td>Integer</td>
- * <td>The image resolution height.</td>
- * <td></td>
- * <td>minvalue:1; maxvalue: 10000</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- *
- * </table>
- * @since SmartDeviceLink 3.0
- * @see DisplayType
- * @see MediaClockFormat
- * @see TextFieldName
- * @see ImageType
- *
- */
-
-public class ImageResolution extends RPCStruct {
- public static final String KEY_RESOLUTION_WIDTH = "resolutionWidth";
- public static final String KEY_RESOLUTION_HEIGHT = "resolutionHeight";
-
- public ImageResolution() {}
- /**
- * <p>
- * Constructs a new ImageResolution object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public ImageResolution(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public ImageResolution(@NonNull Integer resolutionWidth, @NonNull Integer resolutionHeight) {
- this();
- setResolutionWidth(resolutionWidth);
- setResolutionHeight(resolutionHeight);
- }
-
- public void setResolutionWidth(@NonNull Integer resolutionWidth) {
- setValue(KEY_RESOLUTION_WIDTH, resolutionWidth);
- }
-
- public Integer getResolutionWidth() {
- return getInteger(KEY_RESOLUTION_WIDTH);
- }
-
- public void setResolutionHeight(@NonNull Integer resolutionHeight) {
- setValue(KEY_RESOLUTION_HEIGHT, resolutionHeight);
- }
-
- public Integer getResolutionHeight() {
- return getInteger(KEY_RESOLUTION_HEIGHT);
- }
-
- @Override
- public String toString() {
- return "width=" + String.valueOf(getResolutionWidth()) +
- ", height=" + String.valueOf(getResolutionHeight());
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
deleted file mode 100644
index 6f651b832..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
-import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
-import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import static android.provider.Contacts.SettingsColumns.KEY;
-import static com.smartdevicelink.proxy.rpc.HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS;
-
-/** This mode causes the interaction to immediately display a keyboard entry through the HMI.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Mandatory</th>
- * <th> Additional</th>
- * <th>Description</th>
- * </tr>
- * <tr>
- * <td>language</td>
- * <td>Language</td>
- * <td>false</td>
- * <td></td>
- * <td>The keyboard language. </td>
- * </tr>
- * <tr>
- * <td>keyboardLayout</td>
- * <td>KeyboardLayout</td>
- * <td>false</td>
- * <td></td>
- * <td>Desired keyboard layout.</td>
- * </tr>
- * <tr>
- * <td>sendDynamicEntry</td>
- * <td>Boolean</td>
- * <td>false</td>
- * <td></td>
- * <td>In this mode, all keypresses will be sent as they occur. If disabled, entire string of text will be returned only once submitted by user.If omitted, this value will be set to FALSE.</td>
- * </tr>
- * <tr>
- * <td>keypressMode</td>
- * <td>KeypressMode</td>
- * <td>False</td>
- * <td></td>
- * <td>Desired keypress mode.If omitted, this value will be set to RESEND_CURRENT_ENTRY. </td>
- * </tr>
- * <tr>
- * <td>limitedCharacterList</td>
- * <td>String</td>
- * <td>false</td>
- * <td>Array = true maxlength = 1 minsize = 1 maxsize = 100</td>
- * <td>Array of keyboard characters to enable. All omitted characters will be greyed out (disabled) on the keyboard. If omitted, the entire keyboard will be enabled.</td>
- * </tr>
- *
- * <tr>
- * <td>autoCompleteText</td>
- * <td>String</td>
- * <td>false</td>
- * <td>maxlength = 1000 </td>
- * <td>Allows an app to prepopulate the text field with a suggested or completed entry as the user types.</td>
- * </tr>
- * </table>
- *
- * @since SmartDeviceLink 3.0
- *@see ButtonName
- *
- */
-
-public class KeyboardProperties extends RPCStruct {
- public static final String KEY_KEYPRESS_MODE = "keypressMode";
- public static final String KEY_KEYBOARD_LAYOUT = "keyboardLayout";
- public static final String KEY_LIMITED_CHARACTER_LIST = "limitedCharacterList";
- public static final String KEY_AUTO_COMPLETE_TEXT = "autoCompleteText";
- public static final String KEY_LANGUAGE = "language";
-
- private static final KeypressMode KEYPRESS_MODE_DEFAULT = KeypressMode.RESEND_CURRENT_ENTRY;
-
- public KeyboardProperties() {
- setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
- }
-
- public KeyboardProperties(Hashtable<String, Object> hash) {
- super(hash);
- if (!store.containsKey(KEY_KEYPRESS_MODE)) {
- setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
- }
- }
-
- public Language getLanguage() {
- return (Language) getObject(Language.class, KEY_LANGUAGE);
- }
-
- public void setLanguage(Language language) {
- setValue(KEY_LANGUAGE, language);
- }
-
- public KeyboardLayout getKeyboardLayout() {
- return (KeyboardLayout) getObject(KeyboardLayout.class, KEY_KEYBOARD_LAYOUT);
- }
-
- public void setKeyboardLayout(KeyboardLayout keyboardLayout) {
- setValue(KEY_KEYBOARD_LAYOUT, keyboardLayout);
- }
-
- public KeypressMode getKeypressMode() {
- KeypressMode kp = (KeypressMode) getObject(KeypressMode.class, KEY_KEYPRESS_MODE);
- if(kp == null){
- kp = KEYPRESS_MODE_DEFAULT;
- }
- return kp;
- }
-
- public void setKeypressMode(KeypressMode keypressMode) {
- if (keypressMode != null) {
- setValue(KEY_KEYPRESS_MODE, keypressMode);
- } else {
- setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
- }
- }
-
- @SuppressWarnings("unchecked")
- public List<String> getLimitedCharacterList() {
- return (List<String>) getObject(String.class, KEY_LIMITED_CHARACTER_LIST);
- }
-
- public void setLimitedCharacterList(List<String> limitedCharacterList) {
- setValue(KEY_LIMITED_CHARACTER_LIST, limitedCharacterList);
- }
-
- public String getAutoCompleteText() {
- return (String) getObject(String.class, KEY_AUTO_COMPLETE_TEXT);
- }
-
- public void setAutoCompleteText(String autoCompleteText) {
- setValue(KEY_AUTO_COMPLETE_TEXT, autoCompleteText);
- }
-}
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
deleted file mode 100644
index b23c8356c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java
+++ /dev/null
@@ -1,113 +0,0 @@
-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
deleted file mode 100644
index ab84da275..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java
+++ /dev/null
@@ -1,78 +0,0 @@
-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
deleted file mode 100644
index a78b979c5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java
+++ /dev/null
@@ -1,58 +0,0 @@
-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
deleted file mode 100644
index 90315f785..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java
+++ /dev/null
@@ -1,119 +0,0 @@
-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/ListFiles.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFiles.java
deleted file mode 100644
index faeaa7977..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFiles.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-/**
- * Requests the current list of resident filenames for the registered app. Not
- * supported on First generation SDL vehicles.
- *
- * <p><b>Request</b></p>
- * <p>No parameters.</p>
- * <p><b>Response:</b></p>
- * Returns the current list of resident filenames for the registered app along with the current space available.
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR </p>
- * <p>REJECTED</p>
- * @since SmartDeviceLink 2.0
- */
-public class ListFiles extends RPCRequest {
-
- /**
- * Constructs a new ListFiles object
- */
- public ListFiles() {
- super(FunctionID.LIST_FILES.toString());
- }
-
- /**
- * <p>Constructs a new ListFiles object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public ListFiles(Hashtable<String, Object> hash) {
- super(hash);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java
deleted file mode 100644
index b525bc599..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.util.Version;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * List Files Response is sent, when ListFiles has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class ListFilesResponse extends RPCResponse {
- public static final String KEY_FILENAMES = "filenames";
- public static final String KEY_SPACE_AVAILABLE = "spaceAvailable";
- private static final Integer MAX_VALUE = 2000000000;
-
- /**
- * Constructs a new ListFilesResponse object
- */
- public ListFilesResponse() {
- super(FunctionID.LIST_FILES.toString());
- }
- public ListFilesResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * @deprecated use {@link ListFilesResponse#ListFilesResponse(Boolean, Result)} instead <br>
- *
- * Constructs a new ListFilesResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- @Deprecated
- public ListFilesResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer spaceAvailable) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- setSpaceAvailable(spaceAvailable);
- }
-
- /**
- * Constructs a new ListFilesResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public ListFilesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- /**
- * SpaceAvailable became optional as of RPC Spec 5.0. If a system that expected the value to
- * always have a value connects to such a system, it could return null. Check to see if there
- * is a value, and if not, set it to MAX_VALUE as defined by the RPC Spec
- *
- * @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){
- if (getSpaceAvailable() == null){
- setSpaceAvailable(MAX_VALUE);
- }
- }
- super.format(rpcVersion, formatParams);
- }
-
- public void setFilenames(List<String> filenames) {
- setParameters(KEY_FILENAMES, filenames);
- }
-
- @SuppressWarnings("unchecked")
- public List<String> getFilenames() {
- return (List<String>) getObject(String.class, KEY_FILENAMES);
- }
-
- public void setSpaceAvailable(Integer spaceAvailable) {
- setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
- }
-
- public Integer getSpaceAvailable() {
- return getInteger(KEY_SPACE_AVAILABLE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java
deleted file mode 100644
index 51d150a2b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-import java.util.List;
-
-public class LocationDetails extends RPCStruct{
- public static final String KEY_COORDINATE = "coordinate";
- public static final String KEY_LOCATION_NAME = "locationName";
- public static final String KEY_ADDRESS_LINES = "addressLines";
- public static final String KEY_LOCATION_DESCRIPTION = "locationDescription";
- public static final String KEY_PHONE_NUMBER = "phoneNumber";
- public static final String KEY_LOCATION_IMAGE = "locationImage";
- public static final String KEY_SEARCH_ADDRESS = "searchAddress";
-
- public LocationDetails() {
- }
-
- public LocationDetails(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- @SuppressWarnings("unchecked")
- public Coordinate getCoordinate() {
- return (Coordinate) getObject(Coordinate.class, KEY_COORDINATE);
- }
- public void setCoordinate(Coordinate coordinate) {
- setValue(KEY_COORDINATE, coordinate);
- }
-
- public String getLocationName() {
- return getString(KEY_LOCATION_NAME);
- }
-
- public void setLocationName(String locationName) {
- setValue(KEY_LOCATION_NAME, locationName);
- }
-
- @SuppressWarnings("unchecked")
- public List<String> getAddressLines() {
- return (List<String>) getObject(String.class, KEY_ADDRESS_LINES);
- }
-
- public void setAddressLines(List<String> addressLines) {
- setValue(KEY_ADDRESS_LINES, addressLines);
- }
-
- public String getLocationDescription() {
- return getString(KEY_LOCATION_DESCRIPTION);
- }
-
- public void setLocationDescription(String locationDescription) {
- setValue(KEY_LOCATION_DESCRIPTION, locationDescription);
- }
-
- public String getPhoneNumber() {
- return getString(KEY_PHONE_NUMBER);
- }
-
- public void setPhoneNumber(String phoneNumber) {
- setValue(KEY_PHONE_NUMBER, phoneNumber);
- }
-
- @SuppressWarnings("unchecked")
- public Image getLocationImage() {
- return (Image) getObject(Image.class, KEY_LOCATION_IMAGE);
- }
-
- public void setLocationImage(Image locationImage) {
- setValue(KEY_LOCATION_IMAGE, locationImage);
- }
-
- @SuppressWarnings("unchecked")
- public OasisAddress getSearchAddress() {
- return (OasisAddress) getObject(OasisAddress.class, KEY_SEARCH_ADDRESS);
- }
- public void setSearchAddress(OasisAddress searchAddress) {
- setValue(KEY_SEARCH_ADDRESS, searchAddress);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java
deleted file mode 100644
index 8e87eff7d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.MassageCushion;
-
-import java.util.Hashtable;
-
-/**
- * The intensity or firmness of a cushion.
- */
-public class MassageCushionFirmness extends RPCStruct {
- public static final String KEY_CUSHION = "cushion";
- public static final String KEY_FIRMNESS = "firmness";
-
- /**
- * Constructs a new MassageCushionFirmness object
- */
- public MassageCushionFirmness() {
- }
-
- /**
- * <p>Constructs a new MassageCushionFirmness object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash The Hashtable to use
- */
- public MassageCushionFirmness(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated MassageCushionFirmness object
- * @param cushion type of MassageCushion for multi-contour massage seat
- * @param firmness Min: 0 Max: 100
- */
- public MassageCushionFirmness(@NonNull MassageCushion cushion, @NonNull Integer firmness) {
- this();
- setCushion(cushion);
- setFirmness(firmness);
- }
-
- /**
- * Sets the cushion portion of the MassageCushionFirmness class
- *
- * @param cushion
- */
- public void setCushion(@NonNull MassageCushion cushion) {
- setValue(KEY_CUSHION, cushion);
- }
-
- /**
- * Gets the cushion portion of the MassageCushionFirmness class
- *
- * @return MassageCushion.
- */
- public MassageCushion getCushion() {
- return (MassageCushion) getObject(MassageCushion.class, KEY_CUSHION);
- }
-
- /**
- * Sets the firmness portion of the MassageCushionFirmness class
- *
- * @param firmness
- */
- public void setFirmness(@NonNull Integer firmness) {
- setValue(KEY_FIRMNESS, firmness);
- }
-
- /**
- * Gets the firmness portion of the MassageCushionFirmness class
- *
- * @return Integer
- */
- public Integer getFirmness() {
- return getInteger(KEY_FIRMNESS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java
deleted file mode 100644
index 857d4dc7c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.MassageMode;
-import com.smartdevicelink.proxy.rpc.enums.MassageZone;
-
-import java.util.Hashtable;
-
-/**
- * Specify the mode of a massage zone.
- */
-public class MassageModeData extends RPCStruct {
- public static final String KEY_MASSAGE_ZONE = "massageZone";
- public static final String KEY_MASSAGE_MODE = "massageMode";
-
- /**
- * Constructs a new MassageModeData object
- */
- public MassageModeData() {
- }
-
- /**
- * <p>Constructs a new MassageModeData object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash The Hashtable to use
- */
- public MassageModeData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated MassageModeData object
- * @param massageZone type of MassageZone for multi-contour massage seat
- * @param massageMode mode of massage zone.
- */
- public MassageModeData(@NonNull MassageZone massageZone, @NonNull MassageMode massageMode) {
- this();
- setMassageZone(massageZone);
- setMassageMode(massageMode);
- }
-
- /**
- * Sets the massageZone portion of the MassageModeData class
- *
- * @param massageZone
- */
- public void setMassageZone(@NonNull MassageZone massageZone) {
- setValue(KEY_MASSAGE_ZONE, massageZone);
- }
-
- /**
- * Gets the massageZone portion of the MassageModeData class
- *
- * @return MassageZone.
- */
- public MassageZone getMassageZone() {
- return (MassageZone) getObject(MassageZone.class, KEY_MASSAGE_ZONE);
- }
-
- /**
- * Gets the massageMode portion of the MassageModeData class
- *
- * @return MassageMode
- */
- public MassageMode getMassageMode() {
- return (MassageMode) getObject(MassageMode.class, KEY_MASSAGE_MODE);
- }
-
- /**
- * Sets the massageMode portion of the MassageModeData class
- *
- * @param massageMode
- */
- public void setMassageMode(@NonNull MassageMode massageMode) {
- setValue(KEY_MASSAGE_MODE, massageMode);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java
deleted file mode 100644
index 841cf6b90..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-/**
- * Used when adding a sub menu to an application menu or existing sub menu.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>parentID</td>
- * <td>Integer</td>
- * <td>The unique ID of an existing submenu to which a command will be added.
- * If this element is not provided, the command will be added to the top level of the Command Menu.
- * <ul>
- * <li>Min: 0</li>
- * <li>Max: 2000000000</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>position</td>
- * <td>Integer</td>
- * <td>Position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc.
- * Position of any submenu will always be located before the return and exit options.
- * <ul>
- * <li>Min Value: 0</li>
- * <li>Max Value: 1000</li>
- * <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>
- * <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>menuName</td>
- * <td>String</td>
- * <td>Text which appears in menu, representing this command.
- * <ul>
- * <li>Min: 1</li>
- * <li>Max: 100</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- * @see AddCommand
- * @see AddSubMenu
- */
-public class MenuParams extends RPCStruct {
- public static final String KEY_PARENT_ID = "parentID";
- public static final String KEY_POSITION = "position";
- public static final String KEY_MENU_NAME = "menuName";
- /**
- * Constructs a newly allocated MenuParams object
- */
- public MenuParams() { }
- /**
- * Constructs a newly allocated MenuParams object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public MenuParams(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a newly allocated MenuParams object
- * @param menuName the menu name
- */
- public MenuParams(@NonNull String menuName) {
- this();
- setMenuName(menuName);
- }
- /**
- * Get the unique ID of an existing submenu to which a command will be added.
- * If this element is not provided, the command will be added to the top level of the Command Menu.
- * @return parentID Min: 0 Max: 2000000000
- */
- public Integer getParentID() {
- return getInteger( KEY_PARENT_ID );
- }
- /**
- * Set the unique ID of an existing submenu to which a command will be added.
- * If this element is not provided, the command will be added to the top level of the Command Menu.
- * @param parentID Min: 0; Max: 2000000000
- */
- public void setParentID( Integer parentID ) {
- setValue(KEY_PARENT_ID, parentID);
- }
- /**
- * Get the position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc.
- * Position of any submenu will always be located before the return and exit options.
- * <ul>
- * <li>Min Value: 0</li>
- * <li>Max Value: 1000</li>
- * <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>
- * <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>
- * </ul>
- * @return the position within the items of the parent Command Menu
- */
- public Integer getPosition() {
- return getInteger( KEY_POSITION );
- }
- /**
- * Set the position within the items of the parent Command Menu. 0 will insert at the front, 1 will insert after the first existing element, etc.
- * Position of any submenu will always be located before the return and exit options.
- * <ul>
- * <li>Min Value: 0</li>
- * <li>Max Value: 1000</li>
- * <li>If position is greater or equal than the number of items in the parent Command Menu, the sub menu will be appended to the end of that Command Menu.</li>
- * <li>If this element is omitted, the entry will be added at the end of the parent menu.</li>
- * </ul>
- * @param position Mix: 0 Max: 1000
- */
- public void setPosition( Integer position ) {
- setValue(KEY_POSITION, position);
- }
- /**
- * Get the text which appears in menu, representing this command.
- * <ul>
- * <li>Min: 1</li>
- * <li>Max: 100</li>
- * </ul>
- * @return menuName the menu name
- */
-
- public String getMenuName() {
- return getString( KEY_MENU_NAME );
- }
- /**
- * Set text which appears in menu, representing this command.
- * <ul>
- * <li>Min: 1</li>
- * <li>Max: 100</li>
- * </ul>
- * @param menuName the menu name
- */
-
- public void setMenuName( @NonNull String menuName ) {
- setValue(KEY_MENU_NAME, menuName);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java
deleted file mode 100644
index dc5a9b5aa..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.MetadataType;
-
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.List;
-
-public class MetadataTags extends RPCStruct {
-
- public static final String KEY_MAIN_FIELD_1_TYPE = "mainField1";
- public static final String KEY_MAIN_FIELD_2_TYPE = "mainField2";
- public static final String KEY_MAIN_FIELD_3_TYPE = "mainField3";
- public static final String KEY_MAIN_FIELD_4_TYPE = "mainField4";
-
- /**
- * Constructs a newly allocated MetadataTags object
- */
- public MetadataTags(){}
-
- /**
- * Constructs a newly allocated MetadataTags object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public MetadataTags(Hashtable<String, Object> hash){super(hash);}
-
- /**
- * Set the metadata types of data contained in the "mainField1" text field
- */
- public void setMainField1( List<MetadataType> metadataTypes ) {
- setValue(KEY_MAIN_FIELD_1_TYPE, metadataTypes);
- }
-
- /**
- * Set the metadata type of data contained in the "mainField1" text field
- */
- public void setMainField1(MetadataType metadataType) {
- setValue(KEY_MAIN_FIELD_1_TYPE, Collections.singletonList(metadataType));
- }
-
- /**
- * @return The type of data contained in the "mainField1" text field
- */
- @SuppressWarnings("unchecked")
- public List<MetadataType> getMainField1() {
- return (List<MetadataType>) getObject(MetadataType.class, KEY_MAIN_FIELD_1_TYPE);
- }
-
- /**
- * Set the metadata types of data contained in the "mainField2" text field
- */
- public void setMainField2( List<MetadataType> metadataTypes ) {
- setValue(KEY_MAIN_FIELD_2_TYPE, metadataTypes);
- }
-
- /**
- * Set the metadata type of data contained in the "mainField2" text field
- */
- public void setMainField2(MetadataType metadataType) {
- setValue(KEY_MAIN_FIELD_2_TYPE, Collections.singletonList(metadataType));
- }
-
- /**
- * @return The type of data contained in the "mainField2" text field
- */
- @SuppressWarnings("unchecked")
- public List<MetadataType> getMainField2() {
- return (List<MetadataType>) getObject(MetadataType.class, KEY_MAIN_FIELD_2_TYPE);
- }
-
- /**
- * Set the metadata types of data contained in the "mainField3" text field
- */
- public void setMainField3( List<MetadataType> metadataTypes ) {
- setValue(KEY_MAIN_FIELD_3_TYPE, metadataTypes);
- }
-
- /**
- * Set the metadata type of data contained in the "mainField3" text field
- */
- public void setMainField3(MetadataType metadataType) {
- setValue(KEY_MAIN_FIELD_3_TYPE, Collections.singletonList(metadataType));
- }
-
- /**
- * @return The type of data contained in the "mainField3" text field
- */
- @SuppressWarnings("unchecked")
- public List<MetadataType> getMainField3() {
- return (List<MetadataType>) getObject(MetadataType.class, KEY_MAIN_FIELD_3_TYPE);
- }
-
- /**
- * Set the metadata types of data contained in the "mainField4" text field
- */
- public void setMainField4( List<MetadataType> metadataTypes ) {
- setValue(KEY_MAIN_FIELD_4_TYPE, metadataTypes);
- }
-
- /**
- * Set the metadata type of data contained in the "mainField4" text field
- */
- public void setMainField4(MetadataType metadataType) {
- setValue(KEY_MAIN_FIELD_4_TYPE, Collections.singletonList(metadataType));
- }
-
- /**
- * @return The type of data contained in the "mainField4" text field
- */
- @SuppressWarnings("unchecked")
- public List<MetadataType> getMainField4() {
- return (List<MetadataType>) getObject(MetadataType.class, KEY_MAIN_FIELD_4_TYPE);
- }
-
-}
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
deleted file mode 100644
index 85a24c064..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.ModuleType;
-
-import java.util.Hashtable;
-
-public class ModuleData extends RPCStruct {
- public static final String KEY_MODULE_TYPE = "moduleType";
- 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() {
- }
-
- public ModuleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public ModuleData(@NonNull ModuleType moduleType) {
- this();
- setModuleType(moduleType);
- }
-
- /**
- * Sets the moduleType portion of the ModuleData class
- *
- * @param moduleType The moduleType indicates which type of data should be changed and identifies which data object exists in this struct.
- * For example, if the moduleType is CLIMATE then a "climateControlData" should exist
- */
- public void setModuleType(@NonNull ModuleType moduleType) {
- setValue(KEY_MODULE_TYPE, moduleType);
- }
-
- /**
- * Gets the moduleType portion of the ModuleData class
- *
- * @return ModuleType - The moduleType indicates which type of data should be changed and identifies which data object exists in this struct.
- * For example, if the moduleType is CLIMATE then a "climateControlData" should exist.
- */
- public ModuleType getModuleType() {
- return (ModuleType) getObject(ModuleType.class, KEY_MODULE_TYPE);
- }
-
- /**
- * Sets the radioControlData portion of the ModuleData class
- *
- * @param radioControlData
- */
- public void setRadioControlData(RadioControlData radioControlData) {
- setValue(KEY_RADIO_CONTROL_DATA, radioControlData);
- }
-
- /**
- * Gets the radioControlData portion of the ModuleData class
- *
- * @return RadioControlData
- */
- public RadioControlData getRadioControlData() {
- return (RadioControlData) getObject(RadioControlData.class, KEY_RADIO_CONTROL_DATA);
- }
-
- /**
- * Sets the climateControlData portion of the ModuleData class
- *
- * @param climateControlData
- */
- public void setClimateControlData(ClimateControlData climateControlData) {
- setValue(KEY_CLIMATE_CONTROL_DATA, climateControlData);
- }
-
- /**
- * Gets the climateControlData portion of the ModuleData class
- *
- * @return ClimateControlData
- */
- public ClimateControlData getClimateControlData() {
- return (ClimateControlData) getObject(ClimateControlData.class, KEY_CLIMATE_CONTROL_DATA);
- }
-
- /**
- * Sets the seatControlData portion of the ModuleData class
- *
- * @param seatControlData
- */
- public void setSeatControlData(SeatControlData seatControlData) {
- setValue(KEY_SEAT_CONTROL_DATA, seatControlData);
- }
-
- /**
- * Gets the seatControlData portion of the ModuleData class
- *
- * @return SeatControlData
- */
- 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/MyKey.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java
deleted file mode 100644
index 3393f527a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
-/** Information related to the MyKey feature.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Mandatory</th>
- * <th>Description</th>
- * </tr>
- * <tr>
- * <td>e911Override</td>
- * <td>VehicleDataStatus</td>
- * <td>true</td>
- * <td>Indicates whether e911 override is on.</td>
- * </tr>
- * </table>
- *
- *@since SmartDeviceLink 2.0
- *
- *@see GetVehicleData
- *@see OnVehicleData
- *@see VehicleDataStatus
- *
- *
- */
-
-public class MyKey extends RPCStruct {
- public static final String KEY_E_911_OVERRIDE = "e911Override";
- /**
- * Constructs a new MyKey object indicated
- */
- public MyKey() { }
- /**
- * <p>Constructs a new MyKey object indicated by the Hashtable
- * parameter</p>
- * @param hash The Hashtable to use
- */
- public MyKey(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new MyKey object indicated
- */
- public MyKey(@NonNull VehicleDataStatus e911Override) {
- this();
- setE911Override(e911Override);
- }
- public void setE911Override(@NonNull VehicleDataStatus e911Override) {
- setValue(KEY_E_911_OVERRIDE, e911Override);
- }
- public VehicleDataStatus getE911Override() {
- return (VehicleDataStatus) getObject(VehicleDataStatus.class, KEY_E_911_OVERRIDE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java
deleted file mode 100644
index c3d0d59f8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/*
- * Extended capabilities for an onboard navigation system
- */
-public class NavigationCapability extends RPCStruct{
- public static final String KEY_LOCATION_ENABLED = "sendLocationEnabled";
- public static final String KEY_GETWAYPOINTS_ENABLED = "getWayPointsEnabled";
-
- public NavigationCapability(){}
-
- public NavigationCapability(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public Boolean getSendLocationEnabled(){
- return getBoolean(KEY_LOCATION_ENABLED);
- }
-
- public void setSendLocationEnabled(Boolean sendLocationEnabled){
- setValue(KEY_LOCATION_ENABLED, sendLocationEnabled);
- }
-
- public Boolean getWayPointsEnabled(){
- return getBoolean(KEY_GETWAYPOINTS_ENABLED);
- }
-
- public void setWayPointsEnabled(Boolean getWayPointsEnabled){
- setValue(KEY_GETWAYPOINTS_ENABLED, getWayPointsEnabled);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java
deleted file mode 100644
index 54b95e300..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java
+++ /dev/null
@@ -1,218 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-public class OasisAddress extends RPCStruct{
- public static final String KEY_COUNTRY_NAME = "countryName";
- public static final String KEY_COUNTRY_CODE = "countryCode";
- public static final String KEY_POSTAL_CODE = "postalCode";
- public static final String KEY_ADMINISTRATIVE_AREA = "administrativeArea";
- public static final String KEY_SUB_ADMINISTRATIVE_AREA = "subAdministrativeArea";
- public static final String KEY_LOCALITY = "locality";
- public static final String KEY_SUB_LOCALITY = "subLocality";
- public static final String KEY_THOROUGH_FARE = "thoroughfare";
- public static final String KEY_SUB_THOROUGH_FARE = "subThoroughfare";
-
- /**
- * OASIS Address - A standard based address class that has been established by The Organization for the Advancement of Structured Information Standards (OASIS).
- * Oasis is a global nonprofit consortium that works on the development, convergence, and adoption of standards for security,
- * Internet of Things, energy, content technologies, emergency management, and other areas.
- *
- */
- public OasisAddress() {
- }
-
- public OasisAddress(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Gets the localized Name of the country associated with the OasisAddress class.
- *
- * @return String - The localized Name of the country associated with the OasisAddress class.
- *
- */
- public String getCountryName() {
- return getString(KEY_COUNTRY_NAME);
- }
-
- /**
- * Sets the localized Name of the country associated with the OasisAddress class.
- *
- * @param countryName
- * The localized Name of the country associated with the OasisAddress class.
- *
- */
- public void setCountryName(String countryName) {
- setValue(KEY_COUNTRY_NAME, countryName);
- }
-
- /**
- * Gets the country code in ISO 3166-2 format associated with the OasisAddress class.
- *
- * @return String - The country code in ISO 3166-2 format associated with the OasisAddress class.
- *
- */
- public String getCountryCode() {
- return getString(KEY_COUNTRY_CODE);
- }
-
- /**
- * Sets the country code in ISO 3166-2 format associated with the OasisAddress class.
- *
- * @param countryCode
- * The country code in ISO 3166-2 format associated with the OasisAddress class.
- *
- */
- public void setCountryCode(String countryCode) {
- setValue(KEY_COUNTRY_CODE, countryCode);
- }
-
- /**
- * Gets the Postal Code associated with the OasisAddress class.
- *
- * @return String - The Postal Code associated with the OasisAddress class.
- *
- */
- public String getPostalCode() {
- return getString(KEY_POSTAL_CODE);
- }
-
- /**
- * Sets the Postal Code associated with the OasisAddress class.
- *
- * @param postalCode
- * The Postal Code associated with the OasisAddress class.
- *
- */
- public void setPostalCode(String postalCode) {
- setValue(KEY_POSTAL_CODE, postalCode);
- }
-
- /**
- * Gets the Administrative Area associated with the OasisAddress class. A portion of the country - Administrative Area's can include details of the top-level area division in the country, such as state, district, province, island, region, etc.
- *
- * @return String - The Administrative Area associated with the OasisAddress class.
- *
- */
- public String getAdministrativeArea() {
- return getString(KEY_ADMINISTRATIVE_AREA);
- }
-
- /**
- * Sets the Administrative Area associated with the OasisAddress class. A portion of the country - Administrative Area can include details of the top-level area division in the country, such as state, district, province, island, region, etc.
- *
- * @param administrativeArea
- * The Administrative Area associated with the OasisAddress class.
- *
- */
- public void setAdministrativeArea(String administrativeArea) {
- setValue(KEY_ADMINISTRATIVE_AREA, administrativeArea);
- }
-
- /**
- * Gets the SubAdministrative Area associated with the OasisAddress class. A portion of the administrativeArea - The next level down division of the area. E.g. state / county, province / reservation.
- *
- * @return String - The SubAdministrative Area associated with the OasisAddress class.
- *
- */
- public String getSubAdministrativeArea() {
- return getString(KEY_SUB_ADMINISTRATIVE_AREA);
- }
-
- /**
- * Sets the SubAdministrative Area associated with the OasisAddress class. A portion of the administrativeArea - The next level down division of the area. E.g. state / county, province / reservation.
- *
- * @param subAdministrativeArea
- * The SubAdministrative Area associated with the OasisAddress class.
- *
- */
- public void setSubAdministrativeArea(String subAdministrativeArea) {
- setValue(KEY_SUB_ADMINISTRATIVE_AREA, subAdministrativeArea);
- }
-
- /**
- * Gets the Locality associated with the OasisAddress class. - A hypernym for city/village
- *
- * @return String - The Locality associated with the OasisAddress class.
- *
- */
- public String getLocality() {
- return getString(KEY_LOCALITY);
- }
-
- /**
- * Sets the Locality associated with the OasisAddress class. - A hypernym for city/village.
- *
- * @param locality
- * The Locality associated with the OasisAddress class.
- *
- */
- public void setLocality(String locality) {
- setValue(KEY_LOCALITY, locality);
- }
-
- /**
- * Gets the Sub-Locality associated with the OasisAddress class. - Hypernym for district.
- *
- * @return String - The Sub-Locality associated with the OasisAddress class.
- *
- */
- public String getSubLocality() {
- return getString(KEY_SUB_LOCALITY);
- }
-
- /**
- * Sets the Sub-Locality associated with the OasisAddress class. A hypernym for district.
- *
- * @param subLocality
- * The Sub-Locality associated with the OasisAddress class.
- *
- */
- public void setSubLocality(String subLocality) {
- setValue(KEY_SUB_LOCALITY, subLocality);
- }
-
- /**
- * Gets the Thoroughfare associated with the OasisAddress class. - A hypernym for street, road etc.
- *
- * @return String - The Thoroughfare associated with the OasisAddress class.
- *
- */
- public String getThoroughfare() {
- return getString(KEY_THOROUGH_FARE);
- }
-
- /**
- * Sets the Thoroughfare associated with the OasisAddress class. A hypernym for street, road etc.
- *
- * @param thoroughFare
- * The Thoroughfare associated with the OasisAddress class.
- *
- */
- public void setThoroughfare(String thoroughFare) {
- setValue(KEY_THOROUGH_FARE, thoroughFare);
- }
-
- /**
- * Gets the Sub-Thoroughfare associated with the OasisAddress class. - A Portion of thoroughfare (e.g. house number).
- *
- * @return String - The Sub-Thoroughfare associated with the OasisAddress class.
- */
- public String getSubThoroughfare() {
- return getString(KEY_SUB_THOROUGH_FARE);
- }
-
- /**
- * Sets the Sub-Thoroughfare associated with the OasisAddress class. - A Portion of thoroughfare (e.g. house number).
- *
- * @param subThoroughfare
- * The Sub-Thoroughfare associated with the OasisAddress class.
- *
- */
- public void setSubThoroughfare(String subThoroughfare) {
- setValue(KEY_SUB_THOROUGH_FARE, subThoroughfare);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java
deleted file mode 100644
index adc3296c1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason;
-
-import java.util.Hashtable;
-
-/**
- * <p>Notifies an application that its interface registration has been terminated. This means that all SDL resources
- * associated with the application are discarded, including the Command Menu, Choice Sets, button subscriptions, etc.</p>
- * For more information about SDL resources related to an interface registration, see {@linkplain RegisterAppInterface}.
- * <p></p>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul><li>Any</li></ul>
- * AudioStreamingState:
- * <ul><li>Any</li></ul>
- * SystemContext:
- * <ul><li>Any</li></ul>
- * </ul>
- * <p></p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>reason</td>
- * <td>{@linkplain AppInterfaceUnregisteredReason}</td>
- * <td>The reason the application's interface registration was terminated</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- * @see RegisterAppInterface
- */
-public class OnAppInterfaceUnregistered extends RPCNotification {
- public static final String KEY_REASON = "reason";
- /**
- *Constructs a newly allocated OnAppInterfaceUnregistered object
- */
- public OnAppInterfaceUnregistered() {
- super(FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString());
- }
- /**
- *<p>Constructs a newly allocated OnAppInterfaceUnregistered object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public OnAppInterfaceUnregistered(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *Constructs a newly allocated OnAppInterfaceUnregistered object
- * @param reason The reason application's interface registration was terminated
- */
- public OnAppInterfaceUnregistered(@NonNull AppInterfaceUnregisteredReason reason) {
- this();
- setReason(reason);
- }
- /**
- * <p>Get the reason the registration was terminated</p>
- * @return {@linkplain AppInterfaceUnregisteredReason} the reason the application's interface registration was terminated
- */
- public AppInterfaceUnregisteredReason getReason() {
- return (AppInterfaceUnregisteredReason) getObject(AppInterfaceUnregisteredReason.class, KEY_REASON);
- }
- /**
- * <p>Set the reason application's interface was terminated</p>
- * @param reason The reason application's interface registration was terminated
- */
- public void setReason( @NonNull AppInterfaceUnregisteredReason reason ) {
- setParameters(KEY_REASON, reason);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java
deleted file mode 100644
index 40186c63d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-
-/**
- * Binary data is in binary part of hybrid msg.
- * <p>
- * </p>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul>
- * <li>BACKGROUND, FULL, LIMITED</li>
- * </ul>
- * AudioStreamingState:
- * <ul>
- * <li>TBD</li>
- * </ul>
- * SystemContext:
- * <ul>
- * <li>TBD</li>
- * </ul>
- * </ul>
- * <p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Req</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * </table>
- * </p>
- *
- */
-public class OnAudioPassThru extends RPCNotification {
- /**
- *Constructs a newly allocated OnCommand object
- */
- public OnAudioPassThru() {
- super(FunctionID.ON_AUDIO_PASS_THRU.toString());
- }
- /**
- *<p>Constructs a newly allocated OnAudioPassThru object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public OnAudioPassThru(Hashtable<String, Object> hash) {
- super(hash);
- }
- public void setAPTData(byte[] aptData) {
- setBulkData(aptData);
- }
- public byte[] getAPTData() {
- return getBulkData();
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java
deleted file mode 100644
index 28bf0b3ce..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-
-import java.util.Hashtable;
-
-/**
- * Notifies application that user has depressed or released a button to which
- * the application has subscribed.Further information about button events
- * and button-presses can be found at {@linkplain SubscribeButton}.
- * <p>
- * </p>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul>
- * <li>The application will receive OnButtonEvent notifications for all
- * subscribed buttons when HMILevel is FULL.</li>
- * <li>The application will receive OnButtonEvent notifications for subscribed
- * media buttons when HMILevel is LIMITED.</li>
- * <li>Media buttons include SEEKLEFT, SEEKRIGHT, TUNEUP, TUNEDOWN, and
- * PRESET_0-PRESET_9.</li>
- * <li>The application will not receive OnButtonEvent notification when HMILevel
- * is BACKGROUND.</li>
- * </ul>
- * AudioStreamingState:
- * <ul>
- * <li> Any </li>
- * </ul>
- * SystemContext:
- * <ul>
- * <li>MAIN, VR. In MENU, only PRESET buttons. In VR, pressing any subscribable
- * button will cancel VR.</li>
- * </ul>
- * </ul>
- * <p></p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Req</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>buttonName</td>
- * <td>{@linkplain ButtonName}</td>
- * <td>Name of the button which triggered this event</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>buttonEventMode</td>
- * <td>{@linkplain ButtonEventMode}</td>
- * <td>Indicats button was depressed (DOWN) or released (UP)</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>customButtonID</td>
- * <td>Integer</td>
- * <td>If ButtonName is CUSTOM_BUTTON", this references the integer ID passed
- * by a custom button. (e.g. softButton ID)</td>
- * <td>N</td>
- * <td>Minvalue=0 Maxvalue=65536</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * <p></p>
- *
- * @since SmartDeviceLink 1.0
- *
- * @see SubscribeButton
- * @see UnsubscribeButton
- *
- *
- */
-public class OnButtonEvent extends RPCNotification {
- public static final String KEY_BUTTON_EVENT_MODE = "buttonEventMode";
- public static final String KEY_BUTTON_NAME = "buttonName";
- public static final String KEY_CUSTOM_BUTTON_ID = "customButtonID";
- /**
- *Constructs a newly allocated OnButtonEvent object
- */
- public OnButtonEvent() {
- super(FunctionID.ON_BUTTON_EVENT.toString());
- }
- /**
- * <p>
- * Constructs a newly allocated OnButtonEvent object indicated by the
- * Hashtable parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public OnButtonEvent(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * <p>Returns <i>{@linkplain ButtonName}</i> the button's name</p>
- * @return ButtonName Name of the button
- */
- /**
- *Constructs a newly allocated OnButtonEvent object
- * @param buttonName name of the button
- * @param buttonEventMode indicates the button is pressed or released
- */
- public OnButtonEvent(@NonNull ButtonName buttonName, @NonNull ButtonEventMode buttonEventMode) {
- this();
- setButtonName(buttonName);
- setButtonEventMode(buttonEventMode);
- }
- public ButtonName getButtonName() {
- return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
- }
- /**
- * <p>Set the button's name</p>
- * @param buttonName name of the button
- */
- public void setButtonName(@NonNull ButtonName buttonName) {
- setParameters(KEY_BUTTON_NAME, buttonName);
- }
- /**
- * <p>Return <i>{@linkplain ButtonEventMode} indicates the button was depressed or released</i></p>
- * @return ButtonEventMode the button depressed or released
- */
- public ButtonEventMode getButtonEventMode() {
- return (ButtonEventMode) getObject(ButtonEventMode.class, KEY_BUTTON_EVENT_MODE);
- }
- /**
- * <p> Set the event mode of the button,pressed or released</p>
- * @param buttonEventMode indicates the button is pressed or released
- * @see ButtonEventMode
- */
- public void setButtonEventMode(@NonNull ButtonEventMode buttonEventMode) {
- setParameters(KEY_BUTTON_EVENT_MODE, buttonEventMode);
- }
- public void setCustomButtonID(Integer customButtonID) {
- setParameters(KEY_CUSTOM_BUTTON_ID, customButtonID);
- }
- public Integer getCustomButtonID() {
- return getInteger(KEY_CUSTOM_BUTTON_ID);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java
deleted file mode 100644
index f96548ec2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode;
-
-import java.util.Hashtable;
-
-/**
- * <p>
- * Notifies application of button press events for buttons to which the
- * application is subscribed. SDL supports two button press events defined as
- * follows:
- * </p>
- * <ul>
- * <li>SHORT - Occurs when a button is depressed, then released within two
- * seconds. The event is considered to occur immediately after the button is
- * released.</li>
- * <li>LONG - Occurs when a button is depressed and held for two seconds or
- * more. The event is considered to occur immediately after the two second
- * threshold has been crossed, before the button is released</li>
- * </ul>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul>
- * <li>The application will receive OnButtonPress notifications for all
- * subscribed buttons when HMILevel is FULL.</li>
- * <li>The application will receive OnButtonPress notifications for subscribed
- * media buttons when HMILevel is LIMITED.</li>
- * <li>Media buttons include SEEKLEFT, SEEKRIGHT, TUNEUP, TUNEDOWN, and
- * PRESET_0-PRESET_9.</li>
- * <li>The application will not receive OnButtonPress notification when HMILevel
- * is BACKGROUND or NONE.</li>
- * </ul>
- * AudioStreamingState:
- * <ul>
- * <li> Any </li>
- * </ul>
- * SystemContext:
- * <ul>
- * <li>MAIN, VR. In MENU, only PRESET buttons. In VR, pressing any subscribable
- * button will cancel VR.</li>
- * </ul>
- * </ul>
- * <p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Req</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>buttonName</td>
- * <td>{@linkplain ButtonName}</td>
- * <td>Name of the button which triggered this event</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>buttonPressMode</td>
- * <td>{@linkplain ButtonPressMode}</td>
- * <td>Indicates whether this is an SHORT or LONG button press event.</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>customButtonID</td>
- * <td>Integer</td>
- * <td>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed
- * by a custom button. (e.g. softButton ID)</td>
- * <td>N</td>
- * <td>Minvalue=0 Maxvalue=65536</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * </p>
- *
- * @since SmartDeviceLink 1.0
- * @see SubscribeButton
- * @see UnsubscribeButton
- */
-public class OnButtonPress extends RPCNotification {
- public static final String KEY_BUTTON_PRESS_MODE = "buttonPressMode";
- public static final String KEY_BUTTON_NAME = "buttonName";
- public static final String KEY_CUSTOM_BUTTON_ID = "customButtonID";
- /**
- *Constructs a newly allocated OnButtonPress object
- */
- public OnButtonPress() {
- super(FunctionID.ON_BUTTON_PRESS.toString());
- }
- /**
- * <p>
- * Constructs a newly allocated OnButtonPress object indicated by the
- * Hashtable parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public OnButtonPress(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *Constructs a newly allocated OnButtonPress object
- * @param buttonName name of the button
- * @param buttonPressMode indicates whether this is a short or long press
- */
- public OnButtonPress(@NonNull ButtonName buttonName, @NonNull ButtonPressMode buttonPressMode) {
- this();
- setButtonName(buttonName);
- setButtonPressMode(buttonPressMode);
- }
- /**
- * <p>Returns an <i>{@linkplain ButtonName}</i> the button's name</p>
- * @return ButtonName Name of the button
- */
- public ButtonName getButtonName() {
- return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
- }
- /**
- * <p>Set the button's name</p>
- * @param buttonName name of the button
- */
- public void setButtonName( @NonNull ButtonName buttonName ) {
- setParameters(KEY_BUTTON_NAME, buttonName);
- }
- /**<p>Returns <i>{@linkplain ButtonPressMode}</i></p>
- * @return ButtonPressMode whether this is a long or short button press event
- */
- public ButtonPressMode getButtonPressMode() {
- return (ButtonPressMode) getObject(ButtonPressMode.class, KEY_BUTTON_PRESS_MODE);
- }
- /**
- * <p>Set the button press mode of the event</p>
- * @param buttonPressMode indicates whether this is a short or long press
- */
- public void setButtonPressMode( @NonNull ButtonPressMode buttonPressMode ) {
- setParameters(KEY_BUTTON_PRESS_MODE, buttonPressMode);
- }
- public void setCustomButtonName(Integer customButtonID) {
- setParameters(KEY_CUSTOM_BUTTON_ID, customButtonID);
- }
- public Integer getCustomButtonName() {
- return getInteger(KEY_CUSTOM_BUTTON_ID);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java
deleted file mode 100644
index 0a7f1e89d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-
-import java.util.Hashtable;
-
-/**
- * This is called when a command was selected via VR after pressing the PTT button, or selected from the menu after
- * pressing the MENU button. <p>
- * <b>Note: </b>Sequence of OnHMIStatus and OnCommand notifications for user-initiated interactions is indeterminate.
- * <p></p>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul><li>FULL,LIMITED</li></ul>
- * AudioStreamingState:
- * <ul><li>Any</li></ul>
- * SystemContext:
- * <ul><li>Any</li></ul>
- * </ul>
- * <p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>cmdID</td>
- * <td>Integer</td>
- * <td>The cmdID of the command the user selected. This is the cmdID value provided by the application in the AddCommand operation that created the command.</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>triggerSource</td>
- * <td>{@linkplain TriggerSource}</td>
- * <td>Indicates whether command was selected via VR or via a menu selection (using the OKbutton).</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * </p>
- * @since SmartDeviceLink 1.0
- * @see AddCommand
- * @see DeleteCommand
- * @see DeleteSubMenu
- */
-public class OnCommand extends RPCNotification {
- public static final String KEY_CMD_ID = "cmdID";
- public static final String KEY_TRIGGER_SOURCE = "triggerSource";
- /**
- *Constructs a newly allocated OnCommand object
- */
- public OnCommand() {
- super(FunctionID.ON_COMMAND.toString());
- }
- /**
- *<p>Constructs a newly allocated OnCommand object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public OnCommand(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *Constructs a newly allocated OnCommand object
- * @param cmdID an integer object representing a Command ID
- * @param triggerSource a TriggerSource object
- */
- public OnCommand(@NonNull Integer cmdID, @NonNull TriggerSource triggerSource) {
- this();
- setCmdID(cmdID);
- setTriggerSource(triggerSource);
- }
- /**
- * <p>Returns an <i>Integer</i> object representing the Command ID</p>
- * @return Integer an integer representation of this object
- */
- public Integer getCmdID() {
- return getInteger( KEY_CMD_ID );
- }
- /**
- * <p>Sets a Command ID</p>
- * @param cmdID an integer object representing a Command ID
- */
- public void setCmdID( @NonNull Integer cmdID ) {
- setParameters(KEY_CMD_ID, cmdID);
- }
- /**
- * <p>Returns a <I>TriggerSource</I> object which will be shown in the HMI</p>
- * @return TriggerSource a TriggerSource object
- */
- public TriggerSource getTriggerSource() {
- return (TriggerSource) getObject(TriggerSource.class, KEY_TRIGGER_SOURCE);
- }
- /**
- * <p>Sets TriggerSource</p>
- * <p>Indicates whether command was selected via VR or via a menu selection (using the OK button).</p>
- * @param triggerSource a TriggerSource object
- */
- public void setTriggerSource( @NonNull TriggerSource triggerSource ) {
- setParameters(KEY_TRIGGER_SOURCE, triggerSource);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java
deleted file mode 100644
index 8bd45e528..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
-
-import java.util.Hashtable;
-
-/**
- * <p>Notifies the application of the current driver distraction state (whether driver distraction rules are in effect, or
- * not).</p>
- *
- * <p></p>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul><li>Can be sent with FULL, LIMITED or BACKGROUND</li></ul>
- * AudioStreamingState:
- * <ul><li>Any</li></ul>
- * SystemContext:
- * <ul><li>Any</li></ul>
- * </ul>
- * <p></p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>state</td>
- * <td>{@linkplain DriverDistractionState}</td>
- * <td>Current driver distraction state (i.e. whether driver distraction rules are in effect, or not). </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- */
-public class OnDriverDistraction extends RPCNotification {
- public static final String KEY_STATE = "state";
- /**
- *Constructs a newly allocated OnDriverDistraction object
- */
- public OnDriverDistraction() {
- super(FunctionID.ON_DRIVER_DISTRACTION.toString());
- }
- /**
- *<p>Constructs a newly allocated OnDriverDistraction object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public OnDriverDistraction(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *Constructs a newly allocated OnDriverDistraction object
- * @param state the current driver distraction state
- */
- public OnDriverDistraction(@NonNull DriverDistractionState state) {
- this();
- setState(state);
- }
- /**
- * <p>Called to get the current driver distraction state(i.e. whether driver distraction rules are in effect, or not)</p>
- * @return {@linkplain DriverDistractionState} the Current driver distraction state.
- */
- public DriverDistractionState getState() {
- return (DriverDistractionState) getObject(DriverDistractionState.class, KEY_STATE);
- }
- /**
- * <p>Called to set the driver distraction state(i.e. whether driver distraction rules are in effect, or not)</p>
- * @param state the current driver distraction state
- */
- public void setState( @NonNull DriverDistractionState state ) {
- setParameters(KEY_STATE, state);
- }
-}
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
deleted file mode 100644
index 6c79eeb5d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.SystemContext;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingState;
-
-import java.util.Hashtable;
-
-/**
- * <p>Notifies an application that HMI conditions have changed for the application. This indicates whether the application
- * can speak phrases, display text, perform interactions, receive button presses and events, stream audio, etc. This
- * notification will be sent to the application when there has been a change in any one or several of the indicated
- * states ({@linkplain HMILevel}, {@linkplain AudioStreamingState} or {@linkplain SystemContext}) for the application</p>
- * <p>All three values are, in principle, independent of each other (though there may be some relationships). A value for
- * one parameter should not be interpreted from the value of another parameter.</p>
- * <p>There are no guarantees about the timeliness or latency of the OnHMIStatus notification. Therefore, for example,
- * information such as {@linkplain AudioStreamingState} may not indicate that the audio stream became inaudible to the user
- * exactly when the OnHMIStatus notification was received.</p>
- *
- * <p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>hmiLevel</td>
- * <td>{@linkplain HMILevel}</td>
- * <td>The current HMI Level in effect for the application.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>audioStreamingState</td>
- * <td>{@linkplain AudioStreamingState}</td>
- * <td>Current state of audio streaming for the application.
- * When this parameter has a value of NOT_AUDIBLE,
- * the application must stop streaming audio to SDL.
- * Informs app whether any currently streaming audio is
- * audible to user (AUDIBLE) or not (NOT_AUDIBLE). A
- * value of NOT_AUDIBLE means that either the
- * application's audio will not be audible to the user, or
- * that the application's audio should not be audible to
- * the user (i.e. some other application on the mobile
- * device may be streaming audio and the application's
- * audio would be blended with that other audio). </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>videoStreamingState</td>
- * <td>{@linkplain VideoStreamingState}</td>
- * <td>If it is NOT_STREAMABLE, the app must stop streaming video to SDL Core(stop service).</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>systemContext</td>
- * <td>{@linkplain SystemContext}</td>
- * <td>Indicates that a user-initiated interaction is in-progress
- * (VRSESSION or MENU), or not (MAIN)</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * </p>
- * @since SmartDeviceLink 1.0
- * @see RegisterAppInterface
- */
-public class OnHMIStatus extends RPCNotification {
- public static final String KEY_AUDIO_STREAMING_STATE = "audioStreamingState";
- public static final String KEY_VIDEO_STREAMING_STATE = "videoStreamingState";
- public static final String KEY_SYSTEM_CONTEXT = "systemContext";
- public static final String KEY_HMI_LEVEL = "hmiLevel";
-
- private Boolean firstRun;
-
- /**
- *Constructs a newly allocated OnHMIStatus object
- */
- public OnHMIStatus() {
- super(FunctionID.ON_HMI_STATUS.toString());
- }
- /**
- *<p>Constructs a newly allocated OnHMIStatus object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public OnHMIStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *Constructs a newly allocated OnHMIStatus object
- * @param hmiLevel the HMILevel to set
- * @param audioStreamingState the state of audio streaming of the application
- * @param systemContext Indicates that a user-initiated interaction is in-progress
- */
- public OnHMIStatus(@NonNull HMILevel hmiLevel, @NonNull AudioStreamingState audioStreamingState, @NonNull SystemContext systemContext) {
- this();
- setHmiLevel(hmiLevel);
- 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
- */
- public HMILevel getHmiLevel() {
- return (HMILevel) getObject(HMILevel.class, KEY_HMI_LEVEL);
- }
- /**
- * <p>Set the HMILevel of OnHMIStatus</p>
- * @param hmiLevel the HMILevel to set
- */
- public void setHmiLevel( @NonNull HMILevel hmiLevel ) {
- setParameters(KEY_HMI_LEVEL, hmiLevel);
- }
- /**
- * <p>Get current state of audio streaming for the application</p>
- * @return {@linkplain AudioStreamingState} Returns current state of audio streaming for the application
- */
- public AudioStreamingState getAudioStreamingState() {
- return (AudioStreamingState) getObject(AudioStreamingState.class, KEY_AUDIO_STREAMING_STATE);
- }
- /**
- * <p>Set the audio streaming state</p>
- * @param audioStreamingState the state of audio streaming of the application
- */
- public void setAudioStreamingState(@NonNull AudioStreamingState audioStreamingState ) {
- setParameters(KEY_AUDIO_STREAMING_STATE, audioStreamingState);
- }
- /**
- * <p>Get current state of video streaming for the application</p>
- * @return {@linkplain VideoStreamingState} Returns current state of video streaming for the application
- */
- public VideoStreamingState getVideoStreamingState() {
- return (VideoStreamingState) getObject(VideoStreamingState.class, KEY_VIDEO_STREAMING_STATE);
- }
- /**
- * <p>Set the video streaming state</p>
- * @param videoStreamingState the state of video streaming of the application
- */
- public void setVideoStreamingState( VideoStreamingState videoStreamingState ) {
- setParameters(KEY_VIDEO_STREAMING_STATE, videoStreamingState);
- }
- /**
- * <p>Get the System Context</p>
- * @return {@linkplain SystemContext} whether a user-initiated interaction is in-progress (VRSESSION or MENU), or not (MAIN).
- */
- public SystemContext getSystemContext() {
- return (SystemContext) getObject(SystemContext.class, KEY_SYSTEM_CONTEXT);
- }
- /**
- * <p>Set the System Context of OnHMIStatus</p>
- * @param systemContext Indicates that a user-initiated interaction is in-progress
- * (VRSESSION or MENU), or not (MAIN)
- */
- public void setSystemContext( @NonNull SystemContext systemContext ) {
- setParameters(KEY_SYSTEM_CONTEXT, systemContext);
- }
- /**
- * <p>Query whether it's the first run</p>
- * @return boolean whether it's the first run
- */
- public Boolean getFirstRun() {
- return this.firstRun;
- }
- /**
- * <p>Set the firstRun value</p>
- * @param firstRun True if it is the first run, False or not
- */
- public void setFirstRun(Boolean firstRun) {
- this.firstRun = firstRun;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java
deleted file mode 100644
index 2a4581f06..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-
-import java.util.Hashtable;
-
-/**
- * Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
- * Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
- * <p></p>
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>hashID</td>
- * <td>String</td>
- * <td>Calculated hash ID to be referenced during RegisterAppInterface.</td>
- * <td>Y</td>
- * <td>maxlength: 100</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 3.0
- *
- */
-public class OnHashChange extends RPCNotification {
- public static final String KEY_HASH_ID = "hashID";
- /**
- * Constructs a new OnHashChange object
- */
-
- public OnHashChange() {
- super(FunctionID.ON_HASH_CHANGE.toString());
- }
- /**
- * <p>
- * Constructs a new OnKeyboardInput object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public OnHashChange(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new OnHashChange object
- */
- public OnHashChange(@NonNull String hashID) {
- this();
- setHashID(hashID);
- }
-
- public String getHashID() {
- return getString(KEY_HASH_ID);
- }
-
- public void setHashID(@NonNull String hashID) {
- setParameters(KEY_HASH_ID, hashID);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java
deleted file mode 100644
index a91a720c4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-
-import java.util.Hashtable;
-
-public class OnInteriorVehicleData extends RPCNotification {
- public static final String KEY_MODULE_DATA = "moduleData";
-
- /**
- * Constructs a new OnInteriorVehicleData object
- */
- public OnInteriorVehicleData() {
- super(FunctionID.ON_INTERIOR_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new OnInteriorVehicleData object indicated by the
- * Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public OnInteriorVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new OnInteriorVehicleData object
- * @param moduleData
- */
- public OnInteriorVehicleData(@NonNull ModuleData moduleData) {
- this();
- setModuleData(moduleData);
- }
-
- /**
- * Gets the moduleData
- *
- * @return ModuleData
- */
- public ModuleData getModuleData() {
- return (ModuleData) getObject(ModuleData.class, KEY_MODULE_DATA);
- }
-
- /**
- * Sets the moduleData
- *
- * @param moduleData
- */
- public void setModuleData(@NonNull ModuleData moduleData) {
- setParameters(KEY_MODULE_DATA, moduleData);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java
deleted file mode 100644
index 5bf3b8893..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent;
-
-import java.util.Hashtable;
-
-/**
- * On-screen keyboard event. Can be full string or individual keypresses depending on keyboard mode.
- * <p></p>
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>event</td>
- * <td>KeyboardEvent</td>
- * <td>On-screen keyboard input data.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0</td>
- * </tr>
- * <tr>
- * <td>data</td>
- * <td>String</td>
- * <td>On-screen keyboard input data.For dynamic keypress events, this will be the current compounded string of entry text.For entry cancelled and entry aborted events, this data param will be omitted.</td>
- * <td></td>
- * <td>Maxlength: 500</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- *
- * </table>
- *
- */
-
-public class OnKeyboardInput extends RPCNotification {
- public static final String KEY_DATA = "data";
- public static final String KEY_EVENT = "event";
- /**
- * Constructs a new OnKeyboardInput object
- */
- public OnKeyboardInput() {
- super(FunctionID.ON_KEYBOARD_INPUT.toString());
- }
- /**
- * <p>
- * Constructs a new OnKeyboardInput object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public OnKeyboardInput(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new OnKeyboardInput object
- */
- public OnKeyboardInput(@NonNull KeyboardEvent event) {
- this();
- setEvent(event);
- }
-
- public KeyboardEvent getEvent() {
- return (KeyboardEvent) getObject(KeyboardEvent.class, KEY_EVENT);
- }
-
- public void setEvent(@NonNull KeyboardEvent event) {
- setParameters(KEY_EVENT, event);
- }
-
- public void setData(String data) {
- setParameters(KEY_DATA, data);
- }
- public String getData() {
- Object obj = getParameters(KEY_DATA);
- if (obj instanceof String) {
- return (String) obj;
- }
- return null;
- }
-
- @Override
- public String toString(){
- String result = this.getFunctionName() +": " + " data: " + this.getData() + " event:" + this.getEvent().toString();
- return result;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java
deleted file mode 100644
index 5464eb359..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-
-import java.util.Hashtable;
-
-/**
- * Provides information to what language the Sdl HMI language was changed
- * <p>
- * </p>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul>
- * <li>TBD</li>
- * </ul>
- * AudioStreamingState:
- * <ul>
- * <li>TBD</li>
- * </ul>
- * SystemContext:
- * <ul>
- * <li>TBD</li>
- * </ul>
- * </ul>
- * <p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Req</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>language</td>
- * <td>{@linkplain Language}</td>
- * <td>Current SDL voice engine (VR+TTS) language</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>hmiDisplayLanguage</td>
- * <td>{@linkplain Language}</td>
- * <td>Current display language</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * </p>
- *
- */
-public class OnLanguageChange extends RPCNotification {
- public static final String KEY_LANGUAGE = "language";
- public static final String KEY_HMI_DISPLAY_LANGUAGE = "hmiDisplayLanguage";
- /**
- *Constructs a newly allocated OnCommand object
- */
- public OnLanguageChange() {
- super(FunctionID.ON_LANGUAGE_CHANGE.toString());
- }
- /**
- *<p>Constructs a newly allocated OnLanguageChange object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public OnLanguageChange(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *Constructs a newly allocated OnCommand object
- * @param language language that current SDL voice engine(VR+TTS) use
- * @param hmiDisplayLanguage language that current SDL voice engine(VR+TTS) use
- */
- public OnLanguageChange(@NonNull Language language, @NonNull Language hmiDisplayLanguage) {
- this();
- setLanguage(language);
- setHmiDisplayLanguage(hmiDisplayLanguage);
- }
- /**
- * <p>Sets language that current SDL voice engine(VR+TTS) use</p>
- * @param language language that current SDL voice engine(VR+TTS) use
- */
- public void setLanguage(@NonNull Language language) {
- setParameters(KEY_LANGUAGE, language);
- }
- /**
- * <p>Returns language that current SDL voice engine(VR+TTS) use</p>
- * @return {@linkplain Language} language that current SDL voice engine(VR+TTS) use
- */
- public Language getLanguage() {
- return (Language) getObject(Language.class, KEY_LANGUAGE);
- }
- /**
- * <p>Sets language that current display use</p>
- * @param hmiDisplayLanguage language that current SDL voice engine(VR+TTS) use
- */
- public void setHmiDisplayLanguage(@NonNull Language hmiDisplayLanguage) {
- setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
- }
- /**
- * <p>Returns language that current display use</p>
- * @return {@linkplain Language} language that current display use
- */
- public Language getHmiDisplayLanguage() {
- return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnLockScreenStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnLockScreenStatus.java
deleted file mode 100644
index 21a5c3520..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnLockScreenStatus.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
-
-import static com.smartdevicelink.proxy.rpc.OnHMIStatus.KEY_HMI_LEVEL;
-
-/**
- * The lockscreen must perform the following:
- * Limit all application control usability from the mobile device with a full-screen static image overlay or separate view.
- * For simplicity, the OnLockScreenStatus RPC will be provided via the onOnLockScreenNotification call back. The call back will include the LockScreenStatus enum which indicates if the lockscreen is required, optional or not required.
- * The call back also includes details regarding the current HMI_Status level, driver distraction status and user selection status of the application.
- *
- *
- */
-public class OnLockScreenStatus extends RPCNotification {
- public static final String KEY_DRIVER_DISTRACTION = "driverDistraction";
- public static final String KEY_SHOW_LOCK_SCREEN = "showLockScreen";
- public static final String KEY_USER_SELECTED = "userSelected";
-
- public OnLockScreenStatus() {
- super(FunctionID.ON_LOCK_SCREEN_STATUS.toString());
- }
- /**
- * <p>Get the current driver distraction status(i.e. whether driver distraction rules are in effect, or not)</p>
- * @return Boolean
- */
-
- public Boolean getDriverDistractionStatus() {
- return getBoolean(KEY_DRIVER_DISTRACTION);
- }
-
- public void setDriverDistractionStatus(Boolean driverDistractionStatus) {
- setParameters(KEY_DRIVER_DISTRACTION, driverDistractionStatus);
- }
- /**
- * <p>Get the {@linkplain LockScreenStatus} enumeration, indicating if the lockscreen should be required, optional or off </p>
- * @return {@linkplain LockScreenStatus}
- */
-
- public LockScreenStatus getShowLockScreen() {
- return (LockScreenStatus) getParameters(KEY_SHOW_LOCK_SCREEN);
- }
-
- public void setShowLockScreen(LockScreenStatus showLockScreen) {
- setParameters(KEY_SHOW_LOCK_SCREEN, showLockScreen);
- }
- /**
- * <p>Get user selection status for the application (has the app been selected via hmi or voice command)</p>
- * @return Boolean the current user selection status
- */
-
- public Boolean getUserSelected() {
- return getBoolean(KEY_USER_SELECTED);
- }
-
- public void setUserSelected(Boolean userSelected) {
- setParameters(KEY_USER_SELECTED, userSelected);
- }
- /**
- * <p>Get HMILevel in effect for the application</p>
- * @return {@linkplain HMILevel} the current HMI Level in effect for the application
- */
-
- public HMILevel getHMILevel() {
- return (HMILevel) getParameters(KEY_HMI_LEVEL);
- }
-
- public void setHMILevel(HMILevel setHMILevel) {
- setParameters(KEY_HMI_LEVEL, setHMILevel);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java
deleted file mode 100644
index efe1c184b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Provides update to app of which sets of functions are available
- * <p>
- * </p>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul>
- * <li>Any</li>
- * </ul>
- * AudioStreamingState:
- * <ul>
- * <li>TBD</li>
- * </ul>
- * SystemContext:
- * <ul>
- * <li>TBD</li>
- * </ul>
- * </ul>
- * <p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Req</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>permissionItem</td>
- * <td>PermissionItem[]</td>
- * <td>Change in permissions for a given set of RPCs</td>
- * <td>Y</td>
- * <td>Minsize=1 Maxsize=100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * </p>
- */
-public class OnPermissionsChange extends RPCNotification {
- public static final String KEY_PERMISSION_ITEM = "permissionItem";
- /**
- *Constructs a newly allocated OnCommand object
- */
- public OnPermissionsChange() {
- super(FunctionID.ON_PERMISSIONS_CHANGE.toString());
- }
- /**
- *<p>Constructs a newly allocated OnPermissionsChange object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public OnPermissionsChange(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *Constructs a newly allocated OnCommand object
- * @param permissionItem an List of PermissionItem describing change in permissions for a given set of RPCs
- */
- public OnPermissionsChange(@NonNull List<PermissionItem> permissionItem) {
- this();
- setPermissionItem(permissionItem);
- }
- /**
- * <p>Returns List<PermissionItem> object describing change in permissions for a given set of RPCs</p>
- * @return List<{@linkplain PermissionItem}> an object describing describing change in permissions for a given set of RPCs
- */
- @SuppressWarnings("unchecked")
- public List<PermissionItem> getPermissionItem() {
- return (List<PermissionItem>) getObject(PermissionItem.class, KEY_PERMISSION_ITEM);
- }
- /**
- * <p>Sets PermissionItems describing change in permissions for a given set of RPCs</p>
- * @param permissionItem an List of PermissionItem describing change in permissions for a given set of RPCs
- */
- public void setPermissionItem(@NonNull List<PermissionItem> permissionItem) {
- setParameters(KEY_PERMISSION_ITEM, permissionItem);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java
deleted file mode 100644
index 8be1e0007..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-
-import java.util.Hashtable;
-import java.util.List;
-
-public class OnRCStatus extends RPCNotification {
- public static final String KEY_ALLOCATED_MODULES = "allocatedModules";
- public static final String KEY_FREE_MODULES = "freeModules";
- public static final String KEY_ALLOWED = "allowed";
-
- /**
- * Constructs a new OnRCStatus object
- */
- public OnRCStatus() {
- super(FunctionID.ON_RC_STATUS.toString());
- }
-
- /**
- * Constructs a new OnRCStatus object indicated by the Hashtable
- * parameter
- * @param hash The Hashtable to use
- */
- public OnRCStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated OnRCStatus object
- *
- * @param allocatedModules Contains a list (zero or more) of module types that are allocated to the application.
- * @param freeModules Contains a list (zero or more) of module types that are free to access for the application.
- */
- public OnRCStatus(@NonNull List<ModuleData> allocatedModules, @NonNull List<ModuleData> freeModules) {
- this();
- setAllocatedModules(allocatedModules);
- setFreeModules(freeModules);
- }
-
- @SuppressWarnings("unchecked")
- public List<ModuleData> getAllocatedModules() {
- return (List<ModuleData>) getObject(ModuleData.class, KEY_ALLOCATED_MODULES);
- }
-
- public void setAllocatedModules(@NonNull List<ModuleData> allocatedModules) {
- setParameters(KEY_ALLOCATED_MODULES, allocatedModules);
- }
-
- @SuppressWarnings("unchecked")
- public List<ModuleData> getFreeModules() {
- return (List<ModuleData>) getObject(ModuleData.class, KEY_FREE_MODULES);
- }
-
- public void setFreeModules(@NonNull List<ModuleData> freeModules) {
- setParameters(KEY_FREE_MODULES, freeModules);
- }
-
- public Boolean getAllowed() {
- return getBoolean(KEY_ALLOWED);
- }
-
- public void setAllowed(Boolean allowed) {
- setParameters(KEY_ALLOWED, allowed);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnSdlChoiceChosen.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnSdlChoiceChosen.java
deleted file mode 100644
index 5eec2db91..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnSdlChoiceChosen.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-
-import java.util.Hashtable;
-import java.util.List;
-
-public class OnSdlChoiceChosen extends RPCNotification {
- public static final String KEY_SDL_CHOICE = "sdlChoice";
- public static final String KEY_TRIGGER_SOURCE = "triggerSource";
-
- public class SdlSubMenu {
- private Integer _menuID = null;
- @SuppressWarnings("unused")
- private Integer _position = null;
- private String _menuName = null;
-
- // Constructor
- SdlSubMenu(Integer menuID, Integer position, String menuName) {
- _menuID = menuID;
- _position = position;
- _menuName = menuName;
- }
-
- // Restrict no-arg constructor
- @SuppressWarnings("unused")
- private SdlSubMenu() {}
-
- // Public Getters
- public Integer getMenuID() {
- return _menuID;
- }
-
- public String getMenuName() {
- return _menuName;
- }
-
- public String toString() {
- return _menuName;
- }
- }
-
- public class SdlCommand {
- private Integer _commandID = null;
- private SdlSubMenu _parentSubMenu = null;
- @SuppressWarnings("unused")
- private Integer _position = null;
- private String _menuName = null;
- private List<String> _vrCommands = null;
-
- // Constructor
- SdlCommand(Integer commandID, SdlSubMenu parentSubMenu, Integer position, String menuName, List<String> vrCommands) {
- _commandID = commandID;
- _parentSubMenu = parentSubMenu;
- _position = position;
- _menuName = menuName;
- _vrCommands = vrCommands;
- }
-
- // Restrict no-arg constructor
- @SuppressWarnings("unused")
- private SdlCommand() {}
-
- // Public Getters
- public Integer getCommandID() {
- return _commandID;
- }
-
- public SdlSubMenu getParentSubMenu() {
- return _parentSubMenu;
- }
-
- public String getMenuName() {
- return _menuName;
- }
-
- public List<String> getVrCommands() {
- return _vrCommands;
- }
-
- public String toString() {
- return _menuName;
- }
- }
-
- public class SdlChoice {
-
- private Choice _choice = null;
-
- // Constructor
- public SdlChoice(Choice choice) {
- _choice = choice;
- }
-
- public Choice getChoice() {
- return _choice;
- }
-
- public Integer getChoiceID() {
- return _choice.getChoiceID();
- }
-
- public String getMenuName() {
- return _choice.getMenuName();
- }
-
- public List<String> getVrCommands() {
- return _choice.getVrCommands();
- }
-
- public String toString() {
- return _choice.getMenuName();
- }
- }
-
- public class SdlChoiceSet {
- private Integer _choiceSetID = null;
- private List<SdlChoice> _choiceSet = null;
-
- // Constructor
- SdlChoiceSet(Integer choiceSetID, List<SdlChoice> choiceSet) {
- _choiceSetID = choiceSetID;
- _choiceSet = choiceSet;
- }
-
- public Integer getChoiceSetID() {
- return _choiceSetID;
- }
-
- public List<SdlChoice> getChoiceSet() {
- return _choiceSet;
- }
- }
-
-
-
-
- public OnSdlChoiceChosen() {
- super(FunctionID.ON_SDL_CHOICE_CHOSEN.toString());
- }
- public OnSdlChoiceChosen(Hashtable<String, Object> hash){
- super(hash);
- }
- public SdlChoice getSdlChoice() {
- return (SdlChoice) getParameters(KEY_SDL_CHOICE);
- }
- public void setSdlChoice(SdlChoice sdlChoice) {
- setParameters(KEY_SDL_CHOICE, sdlChoice);
- }
- public TriggerSource getTriggerSource() {
- return (TriggerSource) getObject(TriggerSource.class, KEY_TRIGGER_SOURCE);
- }
- public void setTriggerSource( TriggerSource triggerSource ) {
- setParameters(KEY_TRIGGER_SOURCE, triggerSource);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnStreamRPC.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnStreamRPC.java
deleted file mode 100644
index 679596026..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnStreamRPC.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-
-public class OnStreamRPC extends RPCNotification {
- public static final String KEY_FILENAME = "fileName";
- public static final String KEY_BYTESCOMPLETE = "bytesComplete";
- public static final String KEY_FILESIZE = "fileSize";
-
- public OnStreamRPC() {
- super(FunctionID.ON_STREAM_RPC.toString());
- }
-
- public void setFileName(String fileName) {
- setParameters(KEY_FILENAME, fileName);
- }
- public String getFileName() {
- return getString(KEY_FILENAME);
- }
-
- public void setBytesComplete(Long bytesComplete) {
- setParameters(KEY_BYTESCOMPLETE, bytesComplete);
- }
- public Long getBytesComplete() {
- return getLong(KEY_BYTESCOMPLETE);
- }
-
- public void setFileSize(Long fileSize) {
- setParameters(KEY_FILESIZE, fileSize);
- }
- public Long getFileSize() {
- return getLong(KEY_FILESIZE);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java
deleted file mode 100644
index 9654d8c2a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java
+++ /dev/null
@@ -1,361 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.enums.RequestType;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud. Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>requestType</td>
- * <td>RequestType</td>
- * <td>The type of system request.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.3.2 </td>
- * </tr>
- * </tr>
- * <tr>
- * <td>requestSubType</td>
- * <td>String</td>
- * <td>This parameter is filled for supporting OEM proprietary data exchanges.</td>
- * <td>N</td>
- * <td>Max Length: 255</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>url</td>
- * <td>Array of Strings</td>
- * <td>Optional URL for HTTP requests.If blank, the binary data shall be forwarded to the app.If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds.</td>
- * <td>N</td>
- * <td>maxlength: 1000; minsize:1; maxsize: 100</td>
- * <td>SmartDeviceLink 2.3.2 </td>
- * </tr>
- * <tr>
- * <td>timeout</td>
- * <td>Integer</td>
- * <td>Optional timeout for HTTP requests;Required if a URL is provided</td>
- * <td>N</td>
- * <td>minvalue:0; maxvalue: 2000000000</td>
- * <td>SmartDeviceLink </td>
- * </tr>
- * <tr>
- * <td>fileType</td>
- * <td>FileType</td>
- * <td>Optional file type (meant for HTTP file requests).</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.3.2 </td>
- * </tr>
- * <tr>
- * <td>offset</td>
- * <td>Float</td>
- * <td>Optional offset in bytes for resuming partial data chunks</td>
- * <td>N</td>
- * <td>minvalue:0; maxvalue:100000000000</td>
- * <td>SmartDeviceLink 2.3.2 </td>
- * </tr>
- * <tr>
- * <td>length</td>
- * <td>Float</td>
- * <td>Optional length in bytes for resuming partial data chunks</td>
- * <td>N</td>
- * <td>minvalue: 0; maxvalue:100000000000</td>
- * <td>SmartDeviceLink 2.3.2 </td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.3.2
- */
-public class OnSystemRequest extends RPCNotification {
- public static final String KEY_URL_V1 = "URL";
- public static final String KEY_URL = "url";
- public static final String KEY_TIMEOUT_V1 = "Timeout";
- public static final String KEY_TIMEOUT = "timeout";
- public static final String KEY_HEADERS = "headers";
- public static final String KEY_BODY = "body";
- public static final String KEY_FILE_TYPE = "fileType";
- public static final String KEY_REQUEST_TYPE = "requestType";
- public static final String KEY_REQUEST_SUB_TYPE = "requestSubType";
- public static final String KEY_DATA = "data";
- public static final String KEY_OFFSET = "offset";
- public static final String KEY_LENGTH = "length";
-
- private String body;
- private Headers headers;
-
- /**
- * Constructs a new OnSystemsRequest object
- */
- public OnSystemRequest() {
- super(FunctionID.ON_SYSTEM_REQUEST.toString());
- }
-
- public OnSystemRequest(Hashtable<String, Object> hash) {
- this(hash, (byte[]) hash.get(RPCStruct.KEY_BULK_DATA));
- }
-
- public OnSystemRequest(Hashtable<String, Object> hash, byte[] bulkData){
- super(hash);
- setBulkData(bulkData);
- }
-
- /**
- * Constructs a new OnSystemsRequest object
- */
- public OnSystemRequest(@NonNull RequestType requestType) {
- this();
- setRequestType(requestType);
- }
-
- private void handleBulkData(byte[] bulkData){
- if(bulkData == null){
- return;
- }
-
- JSONObject httpJson;
- String tempBody = null;
- Headers tempHeaders = null;
- if(RequestType.PROPRIETARY.equals(this.getRequestType())){
- try{
- JSONObject bulkJson = new JSONObject(new String(bulkData));
-
- httpJson = bulkJson.getJSONObject("HTTPRequest");
- tempBody = getBody(httpJson);
- tempHeaders = getHeaders(httpJson);
- }catch(JSONException e){
- Log.e("OnSystemRequest", "HTTPRequest in bulk data was malformed.");
- e.printStackTrace();
- }catch(NullPointerException e){
- Log.e("OnSystemRequest", "Invalid HTTPRequest object in bulk data.");
- e.printStackTrace();
- }
- }else if(RequestType.HTTP.equals(this.getRequestType())){
- tempHeaders = new Headers();
- tempHeaders.setContentType("application/json");
- tempHeaders.setConnectTimeout(7);
- tempHeaders.setDoOutput(true);
- tempHeaders.setDoInput(true);
- tempHeaders.setUseCaches(false);
- tempHeaders.setRequestMethod("POST");
- tempHeaders.setReadTimeout(7);
- tempHeaders.setInstanceFollowRedirects(false);
- tempHeaders.setCharset("utf-8");
- tempHeaders.setContentLength(bulkData.length);
- }
-
- this.body = tempBody;
- this.headers = tempHeaders;
- }
-
- private String getBody(JSONObject httpJson){
- String result = null;
-
- try{
- result = httpJson.getString("body");
- }catch(JSONException e){
- Log.e("OnSystemRequest", "\"body\" key doesn't exist in bulk data.");
- e.printStackTrace();
- }
-
- return result;
- }
-
- private Headers getHeaders(JSONObject httpJson){
- Headers result = null;
-
- try{
- JSONObject httpHeadersJson = httpJson.getJSONObject("headers");
- Hashtable<String, Object> httpHeadersHash = JsonRPCMarshaller.deserializeJSONObject(httpHeadersJson);
- result = new Headers(httpHeadersHash);
- }catch(JSONException e){
- Log.e("OnSystemRequest", "\"headers\" key doesn't exist in bulk data.");
- e.printStackTrace();
- }
-
- return result;
- }
-
- @Deprecated
- public void setBinData(byte[] aptData) {
- setBulkData(aptData);
- }
-
- @Deprecated
- public byte[] getBinData() {
- return getBulkData();
- }
-
- @Override
- public void setBulkData(byte[] bulkData){
- super.setBulkData(bulkData);
- handleBulkData(bulkData);
- }
-
-
- @SuppressWarnings("unchecked")
- public List<String> getLegacyData() {
- return (List<String>) getObject(String.class, KEY_DATA);
- }
-
- public String getBody(){
- return this.body;
- }
-
- public void setBody(String body) {
- this.body = body;
- }
-
- public void setHeaders(Headers header) {
- this.headers = header;
- }
-
- public Headers getHeader() {
- return this.headers;
- }
-
- public RequestType getRequestType() {
- return (RequestType) getObject(RequestType.class, KEY_REQUEST_TYPE);
- }
-
- public void setRequestType(@NonNull RequestType requestType) {
- setParameters(KEY_REQUEST_TYPE, requestType);
- }
-
- public String getRequestSubType() {
- return getString(KEY_REQUEST_SUB_TYPE);
- }
-
- public void setRequestSubType(String requestSubType) {
- setParameters(KEY_REQUEST_SUB_TYPE, requestSubType);
- }
-
- public String getUrl() {
- Object o = getParameters(KEY_URL);
- if (o == null)
- {
- //try again for gen 1.1
- o = getParameters(KEY_URL_V1);
- }
- if (o == null)
- return null;
-
- if (o instanceof String) {
- return (String) o;
- }
- return null;
- }
-
- public void setUrl(String url) {
- setParameters(KEY_URL, url);
- }
-
- public FileType getFileType() {
- return (FileType) getObject(FileType.class, KEY_FILE_TYPE);
- }
-
- public void setFileType(FileType fileType) {
- setParameters(KEY_FILE_TYPE, fileType);
- }
-
- /**
- * @deprecated as of SmartDeviceLink 4.0
- * @param offset
- */
- public void setOffset(Integer offset) {
- if(offset == null){
- setOffset((Long)null);
- }else{
- setOffset(offset.longValue());
- }
- }
-
- public Long getOffset() {
- final Object o = getParameters(KEY_OFFSET);
-
- if (o == null){
- return null;
- }
-
- if (o instanceof Integer) {
- return ((Integer) o).longValue();
- }else if(o instanceof Long){
- return (Long) o;
- }
- return null;
- }
-
- public void setOffset(Long offset) {
- setParameters(KEY_OFFSET, offset);
- }
-
- public Integer getTimeout() {
- Object o = getParameters(KEY_TIMEOUT);
-
- if (o == null){
- o = getParameters(KEY_TIMEOUT_V1);
- if (o == null) return null;
- }
-
- if (o instanceof Integer) {
- return (Integer) o;
- }
- return null;
- }
-
- public void setTimeout(Integer timeout) {
- setParameters(KEY_TIMEOUT, timeout);
- }
-
- public Long getLength() {
- final Object o = getParameters(KEY_LENGTH);
- if (o == null){
- return null;
- }
-
- if (o instanceof Integer) {
- return ((Integer) o).longValue();
- }else if(o instanceof Long){
- return (Long) o;
- }
- return null;
- }
-
- /**
- * @deprecated as of SmartDeviceLink 4.0
- * @param length
- */
- public void setLength(Integer length) {
- if(length == null){
- setLength((Long)null);
- }else{
- setLength(length.longValue());
- }
- }
-
- public void setLength(Long length) {
- setParameters(KEY_LENGTH, length);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java
deleted file mode 100644
index fad694373..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.TBTState;
-
-import java.util.Hashtable;
-
-/**
- * <p>Notifies the application of the current TBT client status on the module.</p>
- *
- * <p></p>
- * <b>HMI Status Requirements:</b>
- * <ul>
- * HMILevel:
- * <ul><li>Can be sent with FULL, LIMITED or BACKGROUND</li></ul>
- * AudioStreamingState:
- * <ul><li>Any</li></ul>
- * SystemContext:
- * <ul><li>Any</li></ul>
- * </ul>
- * <p></p>
- * <b>Parameter List:</b>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver Available</th>
- * </tr>
- * <tr>
- * <td>state</td>
- * <td>{@linkplain TBTState}</td>
- * <td>Current state of TBT client.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- *
- */
-public class OnTBTClientState extends RPCNotification {
- public static final String KEY_STATE = "state";
- /**
- *Constructs a newly allocated OnTBTClientState object
- */
- public OnTBTClientState() {
- super(FunctionID.ON_TBT_CLIENT_STATE.toString());
- }
- /**
- *<p>Constructs a newly allocated OnTBTClientState object indicated by the Hashtable parameter</p>
- *@param hash The Hashtable to use
- */
- public OnTBTClientState(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- *Constructs a newly allocated OnTBTClientState object
- * @param state current state of TBT client
- */
- public OnTBTClientState(@NonNull TBTState state) {
- this();
- setState(state);
- }
- /**
- * <p>Called to get the current state of TBT client</p>
- * @return {@linkplain TBTState} the current state of TBT client
- */
- public TBTState getState() {
- return (TBTState) getObject(TBTState.class, KEY_STATE);
- }
- /**
- * <p>Called to set the current state of TBT client</p>
- * @param state current state of TBT client
- */
- public void setState( TBTState state ) {
- setParameters(KEY_STATE, state);
- }
-} // end-class
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java
deleted file mode 100644
index 7504c9197..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.TouchType;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- *
- * Notifies about touch events on the screen's prescribed area.
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>type</td>
- * <td>TouchType</td>
- * <td>The type of touch event.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>event</td>
- * <td>TouchEvent</td>
- * <td>List of all individual touches involved in this event.</td>
- * <td>Y</td>
- * <td>minsize:1; maxsize:10</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * </table>
- *
- * <p><b>Note:</b></p>
- * <p>SDL needs to be informed about every User`s touching the touch screen.</p>
- *
- */
-public class OnTouchEvent extends RPCNotification {
- public static final String KEY_EVENT = "event";
- public static final String KEY_TYPE = "type";
- /**
- * Constructs a new OnTouchEvent object
- */
-
- public OnTouchEvent() {
- super(FunctionID.ON_TOUCH_EVENT.toString());
- }
- /**
- * <p>
- * Constructs a new OnTouchEvent object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public OnTouchEvent(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new OnTouchEvent object
- */
- public OnTouchEvent(@NonNull TouchType type, @NonNull List<TouchEvent> event) {
- this();
- setType(type);
- setEvent(event);
- }
-
- public void setType(@NonNull TouchType type) {
- setParameters(KEY_TYPE, type);
- }
-
- public TouchType getType() {
- return (TouchType) getObject(TouchType.class, KEY_TYPE);
- }
-
- public void setEvent(@NonNull List<TouchEvent> event) {
- setParameters(KEY_EVENT, event);
- }
-
- @SuppressWarnings("unchecked")
- public List<TouchEvent> getEvent() {
- return (List<TouchEvent>) getObject(TouchEvent.class, KEY_EVENT);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java
deleted file mode 100644
index 42bf02305..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java
+++ /dev/null
@@ -1,531 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-import java.util.List;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PRNDL;
-import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
-import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import static com.smartdevicelink.proxy.constants.Names.timeout;
-
-/**
- *Individual requested DID result and data.
- *
- *
- * <p>Callback for the periodic and non periodic vehicle data read function.</p>
- *
- * <p> <b>Note:</b></p>
- *
- * Initially SDL sends SubscribeVehicleData for getting the periodic updates from HMI whenever each of subscribed data types changes. OnVehicleData is expected to bring such updated values to SDL
- *
- *
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>Gps</td>
- * <td>Boolean</td>
- * <td>GPS data. See {@linkplain GPSdata} for details</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>Speed</td>
- * <td>Float</td>
- * <td>The vehicle speed in kilometers per hour</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>rpm</td>
- * <td>Integer</td>
- * <td>The number of revolutions per minute of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel</td>
- * <td>Float</td>
- * <td>The fuel level in the tank (percentage)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel_State</td>
- * <td>ComponentVolumeStatus</td>
- * <td>The fuel level state (Ok/Low)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>instantFuelConsumption</td>
- * <td>Float</td>
- * <td>The instantaneous fuel consumption in microlitres</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>externalTemperature</td>
- * <td>Float</td>
- * <td>The external temperature in degrees celsius.</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>vin</td>
- * <td>String</td>
- * <td>Vehicle identification number.</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>prndl</td>
- * <td>PRNDL</td>
- * <td>Currently selected gear.</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>tirePressure</td>
- * <td>TireStatus</td>
- * <td>Tire pressure status</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>odometer</td>
- * <td>Integer</td>
- * <td>Odometer in km</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>beltStatus</td>
- * <td>BeltStatus</td>
- * <td>The status of the seat belts.</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>bodyInformation</td>
- * <td>BodyInformation</td>
- * <td>The body information including power modes.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>deviceStatus</td>
- * <td>DeviceStatus</td>
- * <td>The connected mobile device status including signal and battery strength.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>eCallInfo</td>
- * <td>ECallInfo</td>
- * <td>Emergency Call notification and confirmation data.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>airbagStatus</td>
- * <td>AirBagStatus</td>
- * <td>The status of the air bags.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>emergencyEvent</td>
- * <td>EmergencyEvernt</td>
- * <td>Information related to an emergency event (and if it occurred).</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>clusterModeStatus</td>
- * <td>ClusterModeStatus</td>
- * <td>The status modes of the instrument panel cluster.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>myKey</td>
- * <td>MyKey</td>
- * <td>Information related to the MyKey feature.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * <tr>
- * <td>driverBraking</td>
- * <td>vehicleDataEventStatus</td>
- * <td>The status of the brake pedal.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>wiperStatus</td>
- * <td>WiperStatus</td>
- * <td>The status of the wipers</td>
- * <td>N</td>
- * <td> </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>headLampStatus</td>
- * <td>headLampStatus</td>
- * <td>Status of the head lamps</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>engineTorque</td>
- * <td>Float</td>
- * <td>Torque value for engine (in Nm) on non-diesel variants</td>
- * <td>N</td>
- * <td>minvalue:-1000; maxvalue:2000</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>engineOilLife</td>
- * <td>Float</td>
- * <td>The estimated percentage of remaining oil life of the engine</td>
- * <td>N</td>
- * <td>minvalue:0; maxvalue:100</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>accPedalPosition</td>
- * <td>Float</td>
- * <td>Accelerator pedal position (percentage depressed)</td>
- * <td>N</td>
- * <td>minvalue: 0; maxvalue:100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>steeringWheelAngle</td>
- * <td>Float</td>
- * <td>Current angle of the steering wheel (in deg)</td>
- * <td>N</td>
- * <td> minvalue: -2000; maxvalue:2000</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * @since SmartDeviceLink 1.0
- *
- * @see SubscribeVehicleData
- * @see UnsubscribeVehicleData
- *
- *
- */
-public class OnVehicleData extends RPCNotification {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- public static final String KEY_VIN = "vin";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
-
- public OnVehicleData() {
- super(FunctionID.ON_VEHICLE_DATA.toString());
- }
- public OnVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
- public void setGps(GPSData gps) {
- setParameters(KEY_GPS, gps);
- }
- @SuppressWarnings("unchecked")
- public GPSData getGps() {
- return (GPSData) getObject(GPSData.class, KEY_GPS);
- }
- public void setSpeed(Double speed) {
- setParameters(KEY_SPEED, speed);
- }
- public Double getSpeed() {
- Object object = getParameters(KEY_SPEED);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setRpm(Integer rpm) {
- setParameters(KEY_RPM, rpm);
- }
- public Integer getRpm() {
- return getInteger(KEY_RPM);
- }
- public void setFuelLevel(Double fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- }
- public Double getFuelLevel() {
- Object object = getParameters(KEY_FUEL_LEVEL);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- @Deprecated
- public void setFuelLevel_State(ComponentVolumeStatus fuelLevel_State) {
- setFuelLevelState(fuelLevel_State);
- }
- @Deprecated
- public ComponentVolumeStatus getFuelLevel_State() {
- return getFuelLevelState();
- }
- public void setFuelLevelState(ComponentVolumeStatus fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- }
- public ComponentVolumeStatus getFuelLevelState() {
- return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE);
- }
- public void setInstantFuelConsumption(Double instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- }
- public Double getInstantFuelConsumption() {
- Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setExternalTemperature(Double externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- }
- public Double getExternalTemperature() {
- Object object = getParameters(KEY_EXTERNAL_TEMPERATURE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setVin(String vin) {
- setParameters(KEY_VIN, vin);
- }
- public String getVin() {
- return getString(KEY_VIN);
- }
- public void setPrndl(PRNDL prndl) {
- setParameters(KEY_PRNDL, prndl);
- }
- public PRNDL getPrndl() {
- return (PRNDL) getObject(PRNDL.class, KEY_PRNDL);
- }
- public void setTirePressure(TireStatus tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- }
- @SuppressWarnings("unchecked")
- public TireStatus getTirePressure() {
- return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE);
- }
- public void setOdometer(Integer odometer) {
- setParameters(KEY_ODOMETER, odometer);
- }
- public Integer getOdometer() {
- return getInteger(KEY_ODOMETER);
- }
- public void setBeltStatus(BeltStatus beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- }
- @SuppressWarnings("unchecked")
- public BeltStatus getBeltStatus() {
- return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS);
- }
- public void setBodyInformation(BodyInformation bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- }
- @SuppressWarnings("unchecked")
- public BodyInformation getBodyInformation() {
- return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION);
- }
- public void setDeviceStatus(DeviceStatus deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- }
- @SuppressWarnings("unchecked")
- public DeviceStatus getDeviceStatus() {
- return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS);
- }
- public void setDriverBraking(VehicleDataEventStatus driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- }
- public VehicleDataEventStatus getDriverBraking() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING);
- }
- public void setWiperStatus(WiperStatus wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- }
- public WiperStatus getWiperStatus() {
- return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS);
- }
- public void setHeadLampStatus(HeadLampStatus headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- }
- @SuppressWarnings("unchecked")
- public HeadLampStatus getHeadLampStatus() {
- return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS);
- }
- public void setEngineTorque(Double engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
- public Double getEngineTorque() {
- Object object = getParameters(KEY_ENGINE_TORQUE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setEngineOilLife(Float engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
- public Float getEngineOilLife() {
- Object object = getParameters(KEY_ENGINE_OIL_LIFE);
- return SdlDataTypeConverter.objectToFloat(object);
- }
- public void setAccPedalPosition(Double accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- }
- public Double getAccPedalPosition() {
- Object object = getParameters(KEY_ACC_PEDAL_POSITION);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setSteeringWheelAngle(Double steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- }
- public Double getSteeringWheelAngle() {
- Object object = getParameters(KEY_STEERING_WHEEL_ANGLE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
- public void setECallInfo(ECallInfo eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- }
- @SuppressWarnings("unchecked")
- public ECallInfo getECallInfo() {
- return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO);
- }
- public void setAirbagStatus(AirbagStatus airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- }
- @SuppressWarnings("unchecked")
- public AirbagStatus getAirbagStatus() {
- return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS);
- }
- public void setEmergencyEvent(EmergencyEvent emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- }
- @SuppressWarnings("unchecked")
- public EmergencyEvent getEmergencyEvent() {
- return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT);
- }
- public void setClusterModeStatus(ClusterModeStatus clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- }
- @SuppressWarnings("unchecked")
- public ClusterModeStatus getClusterModeStatus() {
- return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS);
- }
- public void setMyKey(MyKey myKey) {
- setParameters(KEY_MY_KEY, myKey);
- }
- @SuppressWarnings("unchecked")
- public MyKey getMyKey() {
- return (MyKey) getObject(MyKey.class, KEY_MY_KEY);
- }
-
- /**
- * Sets Fuel Range List. Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
- * @param fuelRange
- */
- public void setFuelRange(List<FuelRange> fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
-
- /**
- * Gets Fuel Range List.
- * @return List<FuelRange>
- * Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
- */
- @SuppressWarnings("unchecked")
- public List<FuelRange> getFuelRange() {
- return (List<FuelRange>) getObject(FuelRange.class, KEY_FUEL_RANGE);
- }
-
- /**
- * Sets turnSignal
- * @param turnSignal
- */
- public void setTurnSignal(TurnSignal turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- }
-
- /**
- * Gets turnSignal
- * @return TurnSignal
- */
- @SuppressWarnings("unchecked")
- public TurnSignal getTurnSignal() {
- return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets electronicParkBrakeStatus
- * @param electronicParkBrakeStatus
- */
- public void setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus){
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- }
-
- /**
- * Gets electronicParkBrakeStatus
- * @return ElectronicParkBrakeStatus
- */
- public ElectronicParkBrakeStatus getElectronicParkBrakeStatus(){
- return (ElectronicParkBrakeStatus) getObject(ElectronicParkBrakeStatus.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java
deleted file mode 100644
index cb9130e1a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-
-import java.util.Hashtable;
-import java.util.List;
-
-public class OnWayPointChange extends RPCNotification {
- public static final String KEY_WAY_POINTS = "wayPoints";
-
- public OnWayPointChange() {
- super(FunctionID.ON_WAY_POINT_CHANGE.toString());
- }
-
- public OnWayPointChange(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public OnWayPointChange(@NonNull List<LocationDetails> wayPoints) {
- this();
- setWayPoints(wayPoints);
- }
-
- @SuppressWarnings("unchecked")
- public List<LocationDetails> getWayPoints() {
- return (List<LocationDetails>) getObject(LocationDetails.class, KEY_WAY_POINTS);
- }
-
- public void setWayPoints(@NonNull List<LocationDetails> wayPoints) {
- setParameters(KEY_WAY_POINTS, wayPoints);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java
deleted file mode 100644
index 5fbb00b74..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Defining sets of parameters, which are permitted or prohibited for a given RPC.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>allowed</td>
- * <td>String</td>
- * <td>A set of all parameters that are permitted for this given RPC.
- * <ul>
- * <li>Min size: 0</li>
- * <li>Max size: 100</li>
- * <li>Max length: 100</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>userDisallowed</td>
- * <td>String</td>
- * <td>A set of all parameters that are prohibated for this given RPC.
- * <ul>
- * <li>Min size: 0</li>
- * <li>Max size: 100</li>
- * <li>Max length: 100</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class ParameterPermissions extends RPCStruct {
- public static final String KEY_ALLOWED = "allowed";
- public static final String KEY_USER_DISALLOWED = "userDisallowed";
-
- /**
- * Constructs a newly allocated ParameterPermissions object
- */
- public ParameterPermissions() { }
-
- /**
- * Constructs a newly allocated ParameterPermissions object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public ParameterPermissions(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated ParameterPermissions object
- * @param allowed parameter that is permitted for this given RPC
- * @param userDisallowed parameter that is prohibited for this given RPC
- */
- public ParameterPermissions(@NonNull List<String> allowed, @NonNull List<String> userDisallowed) {
- this();
- setAllowed(allowed);
- setUserDisallowed(userDisallowed);
- }
-
- /**
- * get a set of all parameters that are permitted for this given RPC.
- * @return a set of all parameters that are permitted for this given RPC.
- */
- @SuppressWarnings("unchecked")
- public List<String> getAllowed() {
- return (List<String>) getObject(String.class, KEY_ALLOWED);
- }
-
- /**
- * set a set of all parameters that are permitted for this given RPC.
- * @param allowed parameter that is permitted for this given RPC
- */
- public void setAllowed(@NonNull List<String> allowed) {
- setValue(KEY_ALLOWED, allowed);
- }
-
- /**
- * get a set of all parameters that are prohibited for this given RPC.
- * @return a set of all parameters that are prohibited for this given RPC
- */
- @SuppressWarnings("unchecked")
- public List<String> getUserDisallowed() {
- return (List<String>) getObject(String.class, KEY_USER_DISALLOWED);
- }
-
- /**
- * set a set of all parameters that are prohibited for this given RPC.
- * @param userDisallowed paramter that is prohibited for this given RPC
- */
- public void setUserDisallowed(@NonNull List<String> userDisallowed) {
- setValue(KEY_USER_DISALLOWED, userDisallowed);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java
deleted file mode 100644
index bbd0c32e3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java
+++ /dev/null
@@ -1,326 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.AudioType;
-import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
-import com.smartdevicelink.proxy.rpc.enums.SamplingRate;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * This will open an audio pass thru session. By doing so the app can receive
- * audio data through the vehicles microphone
- *
- * <p>Function Group: AudioPassThru</p>
- *
- * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th> Version</th>
- * </tr>
- * <tr>
- * <td>initialPrompt</td>
- * <td>TTSChunk[]</td>
- * <td>SDL will speak this prompt before opening the audio pass thru session. </td>
- * <td>N</td>
- * <td>This is an array of text chunks of type TTSChunk. The array must have at least one item If omitted, then no initial prompt is spoken: <p>Array Minsize: 1</p> Array Maxsize: 100</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>audioPassThruDisplayText1</td>
- * <td>String</td>
- * <td>First line of text displayed during audio capture.</td>
- * <td>N</td>
- * <td>Maxlength = 500</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>samplingRate</td>
- * <td>SamplingRate</td>
- * <td>This value shall is allowed to be 8 or 16 or 22 or 44 khz.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>maxDuration</td>
- * <td>Integer</td>
- * <td>The maximum duration of audio recording in milliseconds.</td>
- * <td>Y</td>
- * <td>Minvalue: 1; Maxvalue: 1000000</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>bitsPerSample</td>
- * <td>BitsPerSample</td>
- * <td>Specifies the quality the audio is recorded - 8 bit or 16 bit.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>audioType</td>
- * <td>AudioType</td>
- * <td>Specifies the type of audio data being requested.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>muteAudio</td>
- * <td>Boolean</td>
- * <td>N</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- *
- *
- *
- *
- * </table>
- * @since SmartDeviceLink 2.0
- * @see EndAudioPassThru
- */
-public class PerformAudioPassThru extends RPCRequest {
- public static final String KEY_MAX_DURATION = "maxDuration";
- public static final String KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1 = "audioPassThruDisplayText1";
- public static final String KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2 = "audioPassThruDisplayText2";
- public static final String KEY_MUTE_AUDIO = "muteAudio";
- public static final String KEY_SAMPLING_RATE = "samplingRate";
- public static final String KEY_AUDIO_TYPE = "audioType";
- public static final String KEY_INITIAL_PROMPT = "initialPrompt";
- public static final String KEY_BITS_PER_SAMPLE = "bitsPerSample";
-
- /**
- * Constructs a new PerformAudioPassThru object
- */
- public PerformAudioPassThru() {
- super(FunctionID.PERFORM_AUDIO_PASS_THRU.toString());
- }
-
- /**
- * <p>Constructs a new PerformAudioPassThru object indicated by the Hashtable
- * parameter</p>
- *
- * @param hash The Hashtable to use
- */
- public PerformAudioPassThru(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new PerformAudioPassThru object
- * @param samplingRate a SamplingRate value representing a 8 or 16 or 22 or 24 khz
- * @param maxDuration an Integer value representing the maximum duration of audio recording in millisecond <b>Notes: </b>Minvalue:1; Maxvalue:1000000
- * @param bitsPerSample a BitsPerSample value representing 8 bit or 16 bit
- * @param audioType an audioType
- */
- public PerformAudioPassThru(@NonNull SamplingRate samplingRate, @NonNull Integer maxDuration, @NonNull BitsPerSample bitsPerSample, @NonNull AudioType audioType) {
- this();
- setSamplingRate(samplingRate);
- setMaxDuration(maxDuration);
- setBitsPerSample(bitsPerSample);
- setAudioType(audioType);
- }
-
- /**
- * Sets initial prompt which will be spoken before opening the audio pass
- * thru session by SDL
- *
- * @param initialPrompt
- * a List<TTSChunk> value represents the initial prompt which
- * will be spoken before opening the audio pass thru session by
- * SDL
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>This is an array of text chunks of type TTSChunk</li>
- * <li>The array must have at least one item</li>
- * <li>If omitted, then no initial prompt is spoken</li>
- * <li>Array Minsize: 1</li>
- * <li>Array Maxsize: 100</li>
- * </ul>
- */
- public void setInitialPrompt(List<TTSChunk> initialPrompt) {
- setParameters(KEY_INITIAL_PROMPT, initialPrompt);
- }
-
- /**
- * Gets a List value representing an initial prompt which will be spoken
- * before opening the audio pass thru session by SDL
- *
- * @return List<TTSChunk> -a List value representing an initial prompt
- * which will be spoken before opening the audio pass thru session
- * by SDL
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getInitialPrompt() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_INITIAL_PROMPT);
- }
-
- /**
- * Sets a line of text displayed during audio capture
- *
- * @param audioPassThruDisplayText1
- * <p>a String value representing the line of text displayed during
- * audio capture</p>
- * <p></p>
- * <b>Notes: </b>Maxlength=500
- */
- public void setAudioPassThruDisplayText1(String audioPassThruDisplayText1) {
- setParameters(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1, audioPassThruDisplayText1);
- }
-
- /**
- * Gets a first line of text displayed during audio capture
- *
- * @return String -a String value representing a first line of text
- * displayed during audio capture
- */
- public String getAudioPassThruDisplayText1() {
- return getString(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1);
- }
-
- /**
- * Sets a line of text displayed during audio capture
- *
- * @param audioPassThruDisplayText2
- * <p>a String value representing the line of text displayed during
- * audio capture</p>
- * <p></p>
- * <b>Notes: </b>Maxlength=500
- */
- public void setAudioPassThruDisplayText2(String audioPassThruDisplayText2) {
- setParameters(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2, audioPassThruDisplayText2);
- }
-
- /**
- * Gets a second line of text displayed during audio capture
- *
- * @return String -a String value representing a first line of text
- * displayed during audio capture
- */
- public String getAudioPassThruDisplayText2() {
- return getString(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2);
- }
-
- /**
- * Sets a samplingRate
- *
- * @param samplingRate
- * a SamplingRate value representing a 8 or 16 or 22 or 24 khz
- */
- public void setSamplingRate(@NonNull SamplingRate samplingRate) {
- setParameters(KEY_SAMPLING_RATE, samplingRate);
- }
-
- /**
- * Gets a samplingRate
- *
- * @return SamplingRate -a SamplingRate value
- */
- public SamplingRate getSamplingRate() {
- return (SamplingRate) getObject(SamplingRate.class, KEY_SAMPLING_RATE);
- }
-
- /**
- * Sets the maximum duration of audio recording in milliseconds
- *
- * @param maxDuration
- * an Integer value representing the maximum duration of audio
- * recording in millisecond
- * <p></p>
- * <b>Notes: </b>Minvalue:1; Maxvalue:1000000
- */
- public void setMaxDuration(@NonNull Integer maxDuration) {
- setParameters(KEY_MAX_DURATION, maxDuration);
- }
-
- /**
- * Gets a max duration of audio recording in milliseconds
- *
- * @return int -an int value representing the maximum duration of audio
- * recording in milliseconds
- */
- public Integer getMaxDuration() {
- return getInteger(KEY_MAX_DURATION);
- }
-
- /**
- * Sets the quality the audio is recorded - 8 bit or 16 bit
- *
- * @param audioQuality
- * a BitsPerSample value representing 8 bit or 16 bit
- */
- public void setBitsPerSample(@NonNull BitsPerSample audioQuality) {
- setParameters(KEY_BITS_PER_SAMPLE, audioQuality);
- }
-
- /**
- * Gets a BitsPerSample value, 8 bit or 16 bit
- *
- * @return BitsPerSample -a BitsPerSample value
- */
- public BitsPerSample getBitsPerSample() {
- return (BitsPerSample) getObject(BitsPerSample.class, KEY_BITS_PER_SAMPLE);
- }
-
- /**
- * Sets an audioType
- *
- * @param audioType
- * an audioType
- */
- public void setAudioType(@NonNull AudioType audioType) {
- setParameters(KEY_AUDIO_TYPE, audioType);
- }
-
- /**
- * Gets a type of audio data
- *
- * @return AudioType -an AudioType
- */
- public AudioType getAudioType() {
- return (AudioType) getObject(AudioType.class, KEY_AUDIO_TYPE);
- }
-
- /**
- *<p> Gets a Boolean value representing if the current audio source should be
- * muted during the APT session</p>
- *
- *
- * @return Boolean -a Boolean value representing if the current audio source
- * should be muted during the APT session
- */
- public Boolean getMuteAudio() {
- return getBoolean(KEY_MUTE_AUDIO);
- }
-
- /**
- * <p>Sets a muteAudio value representing if the current audio source should be
- * muted during the APT session
- * If not, the audio source will play without interruption. If omitted, the
- * value is set to true</p>
- *
- *
- * @param muteAudio
- * a Boolean value representing if the current audio source
- * should be muted during the APT session
- */
- public void setMuteAudio(Boolean muteAudio) {
- setParameters(KEY_MUTE_AUDIO, muteAudio);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java
deleted file mode 100644
index f68a412f0..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThruResponse.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Perform Audio Pass Thru Response is sent, when PerformAudioPassThru has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class PerformAudioPassThruResponse extends RPCResponse {
-
- /**
- * Constructs a new PerformAudioPassThruResponse object
- */
- public PerformAudioPassThruResponse() {
- super(FunctionID.PERFORM_AUDIO_PASS_THRU.toString());
- }
-
- /**
- * <p>Constructs a new PerformAudioPassThruResponse object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public PerformAudioPassThruResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new PerformAudioPassThruResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public PerformAudioPassThruResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java
deleted file mode 100644
index 9067edb98..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java
+++ /dev/null
@@ -1,367 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
-import com.smartdevicelink.proxy.rpc.enums.LayoutMode;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Performs an application-initiated interaction in which the user can select a
- * {@linkplain Choice} from among the specified Choice Sets. For instance, an
- * application may use a PerformInteraction to ask a user to say the name of a
- * song to play. The user's response is only valid if it appears in the
- * specified Choice Sets and is recognized by SDL
- * <p></p>
- * <p>Function Group: Base</p>
- *
- * <p><b>HMILevel needs to be FULL</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>initialText</td>
- * <td>String</td>
- * <td>Displayed when the interaction begins. This text may be overlaid by the "Listening" prompt during the interaction. Text is displayed on first line of multiline display, and is centered. If text does not fit on line, it will be truncated</td>
- * <td>Y</td>
- * <td>maxlength:500</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>initialPrompt</td>
- * <td>TTSChunk</td>
- * <td>An array of one or more TTSChunks that, taken together, specify what is to be spoken to the user at the start of an interaction.</td>
- * <td>Y</td>
- * <td>minsize:1; maxsize:100</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>interactionMode</td>
- * <td>InteractionMode</td>
- * <td>Indicates how user selects interaction choice. User can choose either by voice (VR_ONLY), by visual selection from the menu (MANUAL_ONLY), or by either mode (BOTH). </td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>interactionChoiceSetIDList</td>
- * <td>Integer</td>
- * <td>Array of one or more Choice Set IDs. User can select any choice from any of the specified Choice Sets.</td>
- * <td>Y</td>
- * <td>minsize:0; maxsize:100; minvalue:0; maxvalue:2000000000</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>helpPrompt</td>
- * <td>TTSChunk</td>
- * <td>An array of TTSChunks which, taken together, specify the help phrase to be spoken when the user says "help" during the VR session. If this parameter is omitted, the help prompt will be constructed by SDL from the first vrCommand of each choice of all the Choice Sets specified in the interactionChoiceSetIDList parameter. </td>
- * <td>N</td>
- * <td>minsize:1; maxsize:100; The helpPrompt specified in SetGlobalProperties is not used by PerformInteraction.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>timeoutPrompt</td>
- * <td>TTSChunk</td>
- * <td>An array of TTSChunks which, taken together, specify the phrase to be spoken when the listen times out during the VR session. If this parameter is omitted, the timeout prompt will be the same as the help prompt (see helpPrompt parameter). </td>
- * <td>N</td>
- * <td>The timeoutPrompt specified in SetGlobalProperties is not used by PerformInteraction. minsize:1;maxsize:100</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>timeout</td>
- * <td>Integer</td>
- * <td>The amount of time, in milliseconds, SDL will wait for the user to make a choice (VR or Menu). If this time elapses without the user making a choice, the timeoutPrompt will be spoken. After this timeout value has been reached, the interaction will stop and a subsequent interaction will take place after SDL speaks the timeout prompt. If that times out as well, the interaction will end completely. If omitted, the default is 10000ms.</td>
- * <td>N</td>
- * <td>minvalue:5000; maxvalue:100000; defvalue:10000</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>vrHelp</td>
- * <td>VrHelpItem</td>
- * <td>Ability to send suggested VR Help Items to display on-screen during Perform Interaction If omitted on supported displays, the default SDL generated list of suggested choices will be displayed.</td>
- * <td>N</td>
- * <td>Min = 1;Max = 100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>interactionLayout</td>
- * <td>LayoutMode</td>
- * <td>See {@linkplain LayoutMode}</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0</td>
- * </tr>
- * </table>
- *
- *
- * @since SmartDeviceLink 1.0
- * @see CreateInteractionChoiceSet
- * @see DeleteInteractionChoiceSet
- */
-public class PerformInteraction extends RPCRequest {
- public static final String KEY_INITIAL_TEXT = "initialText";
- public static final String KEY_INTERACTION_MODE = "interactionMode";
- public static final String KEY_INTERACTION_CHOICE_SET_ID_LIST = "interactionChoiceSetIDList";
- public static final String KEY_INTERACTION_LAYOUT = "interactionLayout";
- public static final String KEY_INITIAL_PROMPT = "initialPrompt";
- public static final String KEY_HELP_PROMPT = "helpPrompt";
- public static final String KEY_TIMEOUT_PROMPT = "timeoutPrompt";
- public static final String KEY_TIMEOUT = "timeout";
- public static final String KEY_VR_HELP = "vrHelp";
- /**
- * Constructs a new PerformInteraction object
- */
- public PerformInteraction() {
- super(FunctionID.PERFORM_INTERACTION.toString());
- }
- /**
- * Constructs a new PerformInteraction object indicated by the Hashtable
- * parameter
- *
- * @param hash The Hashtable to use
- */
- public PerformInteraction(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new PerformInteraction object
- * @param initialText a String value that Displayed when the interaction begins
- * @param interactionMode indicate how user selects interaction choice (VR_ONLY, MANUAL_ONLY or BOTH)
- * @param interactionChoiceSetIDList a List<Integer> representing an Array of one or more Choice Set IDs. User can select any choice from any of the specified
- * Choice Sets <b>Notes: </b>Min Value: 0; Max Vlaue: 2000000000
- */
- public PerformInteraction(@NonNull String initialText, @NonNull InteractionMode interactionMode, @NonNull List<Integer> interactionChoiceSetIDList) {
- this();
- setInitialText(initialText);
- setInteractionMode(interactionMode);
- setInteractionChoiceSetIDList(interactionChoiceSetIDList);
- }
- /**
- * Gets the Text that Displayed when the interaction begins. This text may
- * be overlaid by the "Listening" prompt during the interaction. Text is
- * displayed on first line of multiline display, and is centered. If text
- * does not fit on line, it will be truncated
- *
- * @return String -the text displayed when the interaction begins
- */
- public String getInitialText() {
- return getString(KEY_INITIAL_TEXT);
- }
- /**
- * Sets the Text that Displayed when the interaction begins. This text may
- * be overlaid by the "Listening" prompt during the interaction. Text is
- * displayed on first line of multiline display, and is centered. If text
- * does not fit on line, it will be truncated
- *
- * @param initialText
- * a String value that Displayed when the interaction begins
- */
- public void setInitialText(@NonNull String initialText) {
- setParameters(KEY_INITIAL_TEXT, initialText);
- }
- /**
- * Gets an An array of one or more TTSChunks that, taken together, specify
- * what is to be spoken to the user at the start of an interaction
- *
- * @return List<TTSChunk> -a List<TTSChunk> value, specify what is to be
- * spoken to the user at the start of an interaction
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getInitialPrompt() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_INITIAL_PROMPT);
- }
- /**
- * Sets An array of one or more TTSChunks that, taken together, specify what
- * is to be spoken to the user at the start of an interaction
- *
- * @param initialPrompt
- * a List<TTSChunk> value, specify what is to be spoken to the
- * user at the start of an interaction
- */
- public void setInitialPrompt(List<TTSChunk> initialPrompt) {
- setParameters(KEY_INITIAL_PROMPT, initialPrompt);
- }
- /**
- * Gets the Indicates mode that indicate how user selects interaction
- * choice. User can choose either by voice (VR_ONLY), by visual selection
- * from the menu (MANUAL_ONLY), or by either mode (BOTH)
- *
- * @return InteractionMode -indicate how user selects interaction choice
- * (VR_ONLY, MANUAL_ONLY or BOTH)
- */
- public InteractionMode getInteractionMode() {
- return (InteractionMode) getObject(InteractionMode.class, KEY_INTERACTION_MODE);
- }
- /**
- * Sets the Indicates mode that indicate how user selects interaction
- * choice. User can choose either by voice (VR_ONLY), by visual selection
- * from the menu (MANUAL_ONLY), or by either mode (BOTH)
- *
- * @param interactionMode
- * indicate how user selects interaction choice (VR_ONLY,
- * MANUAL_ONLY or BOTH)
- */
- public void setInteractionMode(@NonNull InteractionMode interactionMode) {
- setParameters(KEY_INTERACTION_MODE, interactionMode);
- }
- /**
- * Gets a List<Integer> value representing an Array of one or more Choice
- * Set IDs
- *
- * @return List<Integer> -a List<Integer> value representing an Array of
- * one or more Choice Set IDs. User can select any choice from any
- * of the specified Choice Sets
- */
- @SuppressWarnings("unchecked")
- public List<Integer> getInteractionChoiceSetIDList() {
- return (List<Integer>) getObject(Integer.class, KEY_INTERACTION_CHOICE_SET_ID_LIST);
- }
- /**
- * Sets a List<Integer> representing an Array of one or more Choice Set
- * IDs. User can select any choice from any of the specified Choice Sets
- *
- * @param interactionChoiceSetIDList
- * -a List<Integer> representing an Array of one or more Choice
- * Set IDs. User can select any choice from any of the specified
- * Choice Sets
- * <p></p>
- * <b>Notes: </b>Min Value: 0; Max Vlaue: 2000000000
- */
- public void setInteractionChoiceSetIDList(@NonNull List<Integer> interactionChoiceSetIDList) {
- setParameters(KEY_INTERACTION_CHOICE_SET_ID_LIST, interactionChoiceSetIDList);
- }
- /**
- * Gets a List<TTSChunk> which taken together, specify the help phrase to
- * be spoken when the user says "help" during the VR session
- *
- * @return List<TTSChunk> -a List<TTSChunk> which taken together,
- * specify the help phrase to be spoken when the user says "help"
- * during the VR session
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getHelpPrompt() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_HELP_PROMPT);
- }
- /**
- * Sets An array of TTSChunks which, taken together, specify the help phrase
- * to be spoken when the user says "help" during the VR session
- * <p></p>
- * If this parameter is omitted, the help prompt will be constructed by SDL
- * from the first vrCommand of each choice of all the Choice Sets specified
- * in the interactionChoiceSetIDList parameter
- * <P></p>
- * <b>Notes: </b>The helpPrompt specified in
- * {@linkplain SetGlobalProperties} is not used by PerformInteraction
- *
- * @param helpPrompt
- * a List<TTSChunk> which taken together, specify the help
- * phrase to be spoken when the user says "help" during the VR
- * session
- */
- public void setHelpPrompt(List<TTSChunk> helpPrompt) {
- setParameters(KEY_HELP_PROMPT, helpPrompt);
- }
- /**
- * Gets An array of TTSChunks which, taken together, specify the phrase to
- * be spoken when the listen times out during the VR session
- *
- * @return List<TTSChunk> -a List<TTSChunk> specify the phrase to be
- * spoken when the listen times out during the VR session
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getTimeoutPrompt() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TIMEOUT_PROMPT);
- }
- /**
- * Sets An array of TTSChunks which, taken together, specify the phrase to
- * be spoken when the listen times out during the VR session
- * <p></p>
- * <b>Notes: </b>The timeoutPrompt specified in
- * {@linkplain SetGlobalProperties} is not used by PerformInteraction
- *
- * @param timeoutPrompt
- * a List<TTSChunk> specify the phrase to be spoken when the
- * listen times out during the VR session
- */
- public void setTimeoutPrompt(List<TTSChunk> timeoutPrompt) {
- setParameters(KEY_TIMEOUT_PROMPT, timeoutPrompt);
- }
- /**
- * Gets a Integer value representing the amount of time, in milliseconds,
- * SDL will wait for the user to make a choice (VR or Menu)
- *
- * @return Integer -a Integer representing the amount of time, in
- * milliseconds, SDL will wait for the user to make a choice (VR or
- * Menu)
- */
- public Integer getTimeout() {
- return getInteger(KEY_TIMEOUT);
- }
- /**
- * Sets the amount of time, in milliseconds, SDL will wait for the user to
- * make a choice (VR or Menu). If this time elapses without the user making
- * a choice, the timeoutPrompt will be spoken. After this timeout value has
- * been reached, the interaction will stop and a subsequent interaction will
- * take place after SDL speaks the timeout prompt. If that times out as
- * well, the interaction will end completely. If omitted, the default is
- * 10000ms
- *
- * @param timeout
- * an Integer value representing the amount of time, in
- * milliseconds, SDL will wait for the user to make a choice (VR
- * or Menu)
- * <p></p>
- * <b>Notes: </b>Min Value: 5000; Max Value: 100000
- */
- public void setTimeout(Integer timeout) {
- setParameters(KEY_TIMEOUT, timeout);
- }
-
- /**
- * Gets a Voice recognition Help, which is a suggested VR Help Items to
- * display on-screen during Perform Interaction
- *
- * @return List<VrHelpItem> -a List value representing a suggested VR
- * Help Items to display on-screen during Perform Interaction
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<VrHelpItem> getVrHelp() {
- return (List<VrHelpItem>) getObject(VrHelpItem.class, KEY_VR_HELP);
- }
-
- /**
- *
- * @param vrHelp
- * a List representing a suggested VR Help Items to display
- * on-screen during Perform Interaction
- * If omitted on supported displays, the default SDL generated
- * list of suggested choices will be displayed
- * <p></p>
- * <b>Notes: </b>Min=1; Max=100
- * @since SmartDeviceLink 2.0
- */
- public void setVrHelp(List<VrHelpItem> vrHelp) {
- setParameters(KEY_VR_HELP, vrHelp);
- }
-
- public LayoutMode getInteractionLayout() {
- return (LayoutMode) getObject(LayoutMode.class, KEY_INTERACTION_LAYOUT);
- }
-
- public void setInteractionLayout( LayoutMode interactionLayout ) {
- setParameters(KEY_INTERACTION_LAYOUT, interactionLayout);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java
deleted file mode 100644
index 5bd4afe8c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-
-import java.util.Hashtable;
-
-/**
- * PerformInteraction Response is sent, when PerformInteraction has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class PerformInteractionResponse extends RPCResponse {
- public static final String KEY_MANUAL_TEXT_ENTRY = "manualTextEntry";
- public static final String KEY_TRIGGER_SOURCE = "triggerSource";
- public static final String KEY_CHOICE_ID = "choiceID";
-
- /**
- * Constructs a new PerformInteractionResponse object
- */
- public PerformInteractionResponse() {
- super(FunctionID.PERFORM_INTERACTION.toString());
- }
-
- /**
- * Constructs a new PerformInteractionResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public PerformInteractionResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new PerformInteractionResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public PerformInteractionResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
- /**
- * Gets the application-scoped identifier that uniquely identifies this choice.
- * @return choiceID Min: 0 Max: 65535
- */
- public Integer getChoiceID() {
- return getInteger( KEY_CHOICE_ID );
- }
- /**
- * Sets the application-scoped identifier that uniquely identifies this choice.
- * @param choiceID Min: 0 Max: 65535
- */
- public void setChoiceID( Integer choiceID ) {
- setParameters(KEY_CHOICE_ID, choiceID);
- }
- /**
- * <p>Returns a <I>TriggerSource</I> object which will be shown in the HMI</p>
- * @return TriggerSource a TriggerSource object
- */
- public TriggerSource getTriggerSource() {
- return (TriggerSource) getObject(TriggerSource.class, KEY_TRIGGER_SOURCE);
- }
- /**
- * <p>Sets TriggerSource
- * Indicates whether command was selected via VR or via a menu selection (using the OK button).</p>
- * @param triggerSource a TriggerSource object
- */
- public void setTriggerSource( TriggerSource triggerSource ) {
- setParameters(KEY_TRIGGER_SOURCE, triggerSource);
- }
-
- public void setManualTextEntry(String manualTextEntry) {
- setParameters(KEY_MANUAL_TEXT_ENTRY, manualTextEntry);
- }
- public String getManualTextEntry() {
- return getString(KEY_MANUAL_TEXT_ENTRY);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java
deleted file mode 100644
index aad3af8eb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.util.DebugTool;
-/**
- * Change in permissions for a given set of RPCs
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>rpcName</td>
- * <td>String</td>
- * <td>Name of the individual RPC in the policy table.</td>
- * <td></td>
- * <td>maxlength:100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>hmiPermissions</td>
- * <td>HMIPermissions</td>
- * <td>Sets of parameters, which are permitted or prohibited for the given RPC.</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * <tr>
- * <td>parameterPermissions</td>
- * <td>ParameterPermissions</td>
- * <td>Sets of parameters, which are permitted or prohibited for the given RPC.</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * @since SmartDeviceLink 2.0
- */
-public class PermissionItem extends RPCStruct {
- public static final String KEY_RPC_NAME = "rpcName";
- public static final String KEY_HMI_PERMISSIONS = "hmiPermissions";
- public static final String KEY_PARAMETER_PERMISSIONS = "parameterPermissions";
- /**
- * Constructs a new PermissionItem object
- */
- public PermissionItem(@NonNull String rpcName, @NonNull HMIPermissions hmiPermissions, @NonNull ParameterPermissions parameterPermissions) {
- this();
- setRpcName(rpcName);
- setHMIPermissions(hmiPermissions);
- setParameterPermissions(parameterPermissions);
- }
- /**
- * Constructs a new PermissionItem object indicated by the Hashtable
- * parameter
- *
- * @param hash The Hashtable to use
- */
- public PermissionItem(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new PermissionItem object
- */
- public PermissionItem() { }
- public String getRpcName() {
- return getString(KEY_RPC_NAME);
- }
- public void setRpcName(@NonNull String rpcName) {
- setValue(KEY_RPC_NAME, rpcName);
- }
- @SuppressWarnings("unchecked")
- public HMIPermissions getHMIPermissions() {
- return (HMIPermissions) getObject(HMIPermissions.class, KEY_HMI_PERMISSIONS);
- }
- public void setHMIPermissions(@NonNull HMIPermissions hmiPermissions) {
- setValue(KEY_HMI_PERMISSIONS, hmiPermissions);
- }
- @SuppressWarnings("unchecked")
- public ParameterPermissions getParameterPermissions() {
- return (ParameterPermissions) getObject(ParameterPermissions.class, KEY_PARAMETER_PERMISSIONS);
- }
- public void setParameterPermissions(@NonNull ParameterPermissions parameterPermissions) {
- setValue(KEY_PARAMETER_PERMISSIONS, parameterPermissions);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
deleted file mode 100644
index c317e0eb9..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/**
- * Extended capabilities of the module's phone feature
- */
-
-public class PhoneCapability extends RPCStruct {
- public static final String KEY_DIALNUMBER_ENABLED = "dialNumberEnabled";
-
- public PhoneCapability(){}
-
- public PhoneCapability(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public Boolean getDialNumberEnabled(){
- return getBoolean(KEY_DIALNUMBER_ENABLED);
- }
-
- public void setDialNumberEnabled(Boolean dialNumberEnabled){
- setValue(KEY_DIALNUMBER_ENABLED, dialNumberEnabled);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java
deleted file mode 100644
index 79d7c9546..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/**
- * Contains information about on-screen preset capabilities.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>onScreenPresetsAvailable</td>
- * <td>Boolean</td>
- * <td>Defines, if Onscreen custom presets are available.
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class PresetBankCapabilities extends RPCStruct {
- public static final String KEY_ON_SCREEN_PRESETS_AVAILABLE = "OnScreenPresetsAvailable";
-
- /**
- * Constructs a newly allocated PresetBankCapabilities object
- */
- public PresetBankCapabilities() { }
-
- /**
- * Constructs a newly allocated PresetBankCapabilities object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public PresetBankCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated PresetBankCapabilities object
- * @param onScreenPresetsAvailable if Onscreen custom presets are available.
- */
- public PresetBankCapabilities(@NonNull Boolean onScreenPresetsAvailable) {
- this();
- setOnScreenPresetsAvailable(onScreenPresetsAvailable);
- }
-
- /**
- * set if Onscreen custom presets are available.
- * @param onScreenPresetsAvailable if Onscreen custom presets are available.
- */
- public void setOnScreenPresetsAvailable(@NonNull Boolean onScreenPresetsAvailable) {
- setValue(KEY_ON_SCREEN_PRESETS_AVAILABLE, onScreenPresetsAvailable);
- }
-
- /**
- * Defines, if Onscreen custom presets are available.
- * @return if Onscreen custom presets are available
- */
- public Boolean onScreenPresetsAvailable() {
- return getBoolean(KEY_ON_SCREEN_PRESETS_AVAILABLE);
- }
-
- /**
- * Defines, if Onscreen custom presets are available.
- * @return if Onscreen custom presets are available
- */
- public Boolean getOnScreenPresetsAvailable() {
- return getBoolean(KEY_ON_SCREEN_PRESETS_AVAILABLE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java
deleted file mode 100644
index 2d9010600..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java
+++ /dev/null
@@ -1,367 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.FileType;
-import com.smartdevicelink.proxy.rpc.listeners.OnPutFileUpdateListener;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
-
-import java.util.Hashtable;
-import java.util.zip.CRC32;
-
-/**
- * Used to push a binary data onto the SDL module from a mobile device, such as
- * icons and album art.
- *
- * <p><b> Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>FileName</td>
- * <td>String</td>
- * <td>File reference name.</td>
- * <td>Y</td>
- * <td>Maxlength=500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>fileType</td>
- * <td>FileType</td>
- * <td>Selected file type.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>persistentFile</td>
- * <td>Boolean</td>
- * <td>Indicates if the file is meant to persist between sessions / ignition cycles. If set to TRUE,then the system will aim to persist this file through session / cycles. While files with this designation will have priority over others,they are subject to deletion by the system at any time.In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file. If omitted, the value will be set to false.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>systemFile</td>
- * <td>Boolean</td>
- * <td>Indicates if the file is meant to be passed thru core to elsewhere on the system. If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core. If omitted, the value will be set to false.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * <tr>
- * <td>offset</td>
- * <td>Float</td>
- * <td>Optional offset in bytes for resuming partial data chunks</td>
- * <td>N</td>
- * <td>Minvalue=0; Maxvalue=100000000000</td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * <tr>
- * <td>length</td>
- * <td>Float</td>
- * <td>Optional length in bytes for resuming partial data chunks. If offset is set to 0, then length is the total length of the file to be downloaded</td>
- * <td>N</td>
- * <td>Minvalue=0; Maxvalue=100000000000</td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * <tr>
- * <td>crc</td>
- * <td>Long</td>
- * <td>Additional CRC32 checksum to protect data integrity up to 512 Mbits .</td>
- * <td>N</td>
- * <td>minvalue="0" maxvalue="4294967295"</td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * </table>
- * <p> <b>Note: </b></p>
- * When using PutFiles you may want to check for memory
- *
- * <p><b>Response</b> </p>
- * Response is sent, when the file data was copied (success case). Or when an error occurred. Not supported on First generation SDL modules.
- *
- * <p><b> Non-default Result Codes:</b></p>
- * <p> SUCCESS</p>
- * <p> INVALID_DATA</p>
- * <p> OUT_OF_MEMORY</p>
- * <p> TOO_MANY_PENDING_REQUESTS</p>
- * <p> APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p>REJECTED</p>
- *
- * <p><table border="1" rules="all"></p>
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>spaceAvailable</td>
- * <td>Integer</td>
- * <td>Provides the total local space available on SDL for the registered app.</td>
- * <td></td>
- * <td>Minvalue=0; Maxvalue=2000000000</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * </table>
- * @since SmartDeviceLink 2.0
- * @see DeleteFile
- * @see ListFiles
- */
-public class PutFile extends RPCRequest {
- public static final String KEY_PERSISTENT_FILE = "persistentFile";
- public static final String KEY_SYSTEM_FILE = "systemFile";
- public static final String KEY_FILE_TYPE = "fileType";
- public static final String KEY_SDL_FILE_NAME = "syncFileName";
- public static final String KEY_OFFSET = "offset";
- public static final String KEY_LENGTH = "length";
- public static final String KEY_CRC = "crc";
-
- /**
- * Constructs a new PutFile object
- */
- public PutFile() {
- super(FunctionID.PUT_FILE.toString());
- }
-
- /**
- * Constructs a new PutFile object indicated by the Hashtable parameter
- *
- * @param hash The Hashtable to use
- */
- public PutFile(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new PutFile object
- * @param syncFileName a String value representing a file reference name
- * <b>Notes: </b>Maxlength=500, however the max file name length may vary based on remote filesystem limitations
- * @param fileType a FileType value representing a selected file type
- */
- public PutFile(@NonNull String syncFileName, @NonNull FileType fileType) {
- this();
- setSdlFileName(syncFileName);
- setFileType(fileType);
- }
-
- /**
- * Sets a file reference name
- *
- * @param sdlFileName
- * a String value representing a file reference name
- * <p></p>
- * <b>Notes: </b>Maxlength=500, however the max file name length may vary based on remote filesystem limitations
- */
- public void setSdlFileName(@NonNull String sdlFileName) {
- setParameters(KEY_SDL_FILE_NAME, sdlFileName);
- }
-
- /**
- * Gets a file reference name
- *
- * @return String - a String value representing a file reference name
- */
- public String getSdlFileName() {
- return getString(KEY_SDL_FILE_NAME);
- }
-
- /**
- * Sets file type
- *
- * @param fileType
- * a FileType value representing a selected file type
- */
- public void setFileType(@NonNull FileType fileType) {
- setParameters(KEY_FILE_TYPE, fileType);
- }
-
- /**
- * Gets a file type
- *
- * @return FileType -a FileType value representing a selected file type
- */
- public FileType getFileType() {
- return (FileType) getObject(FileType.class, KEY_FILE_TYPE);
- }
-
- /**
- * Sets a value to indicates if the file is meant to persist between
- * sessions / ignition cycles. If set to TRUE, then the system will aim to
- * persist this file through session / cycles. While files with this
- * designation will have priority over others, they are subject to deletion
- * by the system at any time. In the event of automatic deletion by the
- * system, the app will receive a rejection and have to resend the file. If
- * omitted, the value will be set to false
- * <p></p>
- *
- * @param persistentFile
- * a Boolean value
- */
- public void setPersistentFile(Boolean persistentFile) {
- setParameters(KEY_PERSISTENT_FILE, persistentFile);
- }
-
- /**
- * Gets a value to Indicates if the file is meant to persist between
- * sessions / ignition cycles
- *
- * @return Boolean -a Boolean value to indicates if the file is meant to
- * persist between sessions / ignition cycles
- */
- public Boolean getPersistentFile() {
- return getBoolean(KEY_PERSISTENT_FILE);
- }
- public void setFileData(byte[] fileData) {
- setBulkData(fileData);
- }
- public byte[] getFileData() {
- return getBulkData();
- }
-
- /**
- * @deprecated as of SmartDeviceLink 4.0
- * @param offset
- */
- public void setOffset(Integer offset) {
- if(offset == null){
- setOffset((Long)null);
- }else{
- setOffset(offset.longValue());
- }
- }
-
- public void setOffset(Long offset) {
- setParameters(KEY_OFFSET, offset);
- }
-
- public Long getOffset() {
- final Object o = getParameters(KEY_OFFSET);
- if (o == null){
- return null;
- }
- if (o instanceof Integer) {
- return ((Integer) o).longValue();
- }else if(o instanceof Long){
- return (Long) o;
- }
-
-
- return null;
- }
-
- /**
- * @deprecated as of SmartDeviceLink 4.0
- * @param length
- */
- public void setLength(Integer length) {
- if(length == null){
- setLength((Long)null);
- }else{
- setLength(length.longValue());
- }
- }
-
- public void setLength(Long length) {
- setParameters(KEY_LENGTH, length);
- }
-
- public Long getLength() {
- final Object o = getParameters(KEY_LENGTH);
- if (o == null){
- return null;
- }
- if (o instanceof Integer) {
- return ((Integer) o).longValue();
- }else if(o instanceof Long){
- return (Long) o;
- }
-
- return null;
- }
-
- public void setSystemFile(Boolean systemFile) {
- setParameters(KEY_SYSTEM_FILE, systemFile);
- }
-
- public Boolean getSystemFile() {
- final Object o = getParameters(KEY_SYSTEM_FILE);
- if (o instanceof Boolean) {
- return (Boolean) o;
- }
- else
- return null;
- }
-
- /**
- * This takes the file data as an array of bytes and calculates the
- * CRC32 for it.
- * @param fileData - the file as a byte array
- */
- public void setCRC(byte[] fileData) {
- if (fileData != null) {
- CRC32 crc = new CRC32();
- crc.update(fileData);
- parameters.put(KEY_CRC, crc.getValue());
- } else {
- parameters.remove(KEY_CRC);
- }
- }
-
- /**
- * This assumes you have created your own CRC32 and are setting it with the file
- * <STRONG>Please avoid using your own calculations for this, and use the method
- * included in java.util</STRONG>
- * @param crc - the CRC32 of the file being set
- */
- public void setCRC(Long crc) {
- if (crc != null) {
- parameters.put(KEY_CRC, crc);
- } else {
- parameters.remove(KEY_CRC);
- }
- }
-
- /**
- * This returns the CRC, if it has been set, for the file object
- * @return - a CRC32 Long
- */
- public Long getCRC() {
- final Object o = parameters.get(KEY_CRC);
- if (o == null){
- return null;
- }
- if (o instanceof Integer) {
- return ((Integer) o).longValue();
- }else if(o instanceof Long){
- return (Long) o;
- }
- return null;
- }
-
- @Override
- public final void setOnRPCResponseListener(OnRPCResponseListener listener) {
- super.setOnRPCResponseListener(listener);
- }
-
- public void setOnPutFileUpdateListener(OnPutFileUpdateListener listener) {
- super.setOnRPCResponseListener(listener); //We can use the same method because it get stored as a parent class
- }
-
- public OnPutFileUpdateListener getOnPutFileUpdateListener() {
- return (OnPutFileUpdateListener)getOnRPCResponseListener();
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java
deleted file mode 100644
index f8d4a3bca..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.util.Version;
-
-import java.util.Hashtable;
-
-/**
- * Put File Response is sent, when PutFile has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class PutFileResponse extends RPCResponse {
- public static final String KEY_SPACE_AVAILABLE = "spaceAvailable";
- private static final Integer MAX_VALUE = 2000000000;
-
- /**
- * Constructs a new PutFileResponse object
- */
- public PutFileResponse() {
- super(FunctionID.PUT_FILE.toString());
- }
-
- /**
- * Constructs a new PutFileResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash The Hashtable to use
- */
- public PutFileResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * @deprecated use {@link PutFileResponse#PutFileResponse(Boolean, Result)} <br>
- *
- * Constructs a new PutFileResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- * @param spaceAvailable the spaceAvailable on the head unit
- */
- @Deprecated
- public PutFileResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer spaceAvailable) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- setSpaceAvailable(spaceAvailable);
- }
-
- /**
- * Constructs a new PutFileResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public PutFileResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- /**
- * SpaceAvailable became optional as of RPC Spec 5.0. If a system that expected the value to
- * always have a value connects to such a system, it could return null. Check to see if there
- * is a value, and if not, set it to MAX_VALUE as defined by the RPC Spec
- *
- * @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){
- if (getSpaceAvailable() == null){
- setSpaceAvailable(MAX_VALUE);
- }
- }
- super.format(rpcVersion, formatParams);
- }
-
- public void setSpaceAvailable(Integer spaceAvailable) {
- setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
- }
-
- public Integer getSpaceAvailable() {
- return getInteger(KEY_SPACE_AVAILABLE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java
deleted file mode 100644
index 81d43161d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import java.util.Hashtable;
-
-/**
- * A color class that stores RGB values
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>red</td>
- * <td>Integer</td>
- * <td>Y</td>
- * <td><ul><li>minvalue="0"</li><li>maxvalue="255"</li></ul></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>green</td>
- * <td>Integer</td>
- * <td>Y</td>
- * <td><ul><li>minvalue="0"</li><li>maxvalue="255"</li></ul></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>blue</td>
- * <td>Integer</td>
- * <td>Y</td>
- * <td><ul><li>minvalue="0"</li><li>maxvalue="255"</li></ul></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 5.0
- */
-public class RGBColor extends RPCStruct{
- public static final String KEY_RED = "red";
- public static final String KEY_GREEN = "green";
- public static final String KEY_BLUE = "blue";
- private static final Integer MIN_VALUE = 0, MAX_VALUE = 255;
-
- /**
- * Constructs a new RGBColor object
- */
- public RGBColor(){
- this(MIN_VALUE, MIN_VALUE, MIN_VALUE);
- }
-
- /**
- * Constructs a new RGBColor object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public RGBColor(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new RGB object
- * @param red red value - min: 0; max: 255
- * @param green green value - min: 0; max: 255
- * @param blue blue value - min: 0; max: 255
- */
- public RGBColor(Integer red, Integer green, Integer blue) {
- Hashtable<String, Object> hash = new Hashtable<>();
- if (red != null && red >= MIN_VALUE && red <= MAX_VALUE) {
- hash.put(KEY_RED, red);
- } else {
- hash.put(KEY_RED, MIN_VALUE);
- }
- if (green != null && green >= MIN_VALUE && green <= MAX_VALUE) {
- hash.put(KEY_GREEN, green);
- } else {
- hash.put(KEY_GREEN, MIN_VALUE);
- }
- if (blue != null && blue >= MIN_VALUE && blue <= MAX_VALUE) {
- hash.put(KEY_BLUE, blue);
- } else {
- hash.put(KEY_BLUE, MIN_VALUE);
- }
- this.store = hash;
- }
-
- /**
- * Sets the red value of the color object
- * @param color red value - min: 0; max: 255
- */
- public void setRed(Integer color) {
- if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
- setValue(KEY_RED, color);
- }
- }
-
- /**
- * Gets the red value of the color
- * @return red value
- */
- public Integer getRed() {
- return getInteger(KEY_RED);
- }
-
- /**
- * Sets the green value of the color object
- * @param color green value - min: 0; max: 255
- */
- public void setGreen(Integer color) {
- if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
- setValue(KEY_GREEN, color);
- }
- }
-
- /**
- * Gets the green value of the color
- * @return green value
- */
- public Integer getGreen() {
- return getInteger(KEY_GREEN);
- }
-
- /**
- * Sets the blue value of the color object
- * @param color blue value - min: 0; max: 255
- */
- public void setBlue(Integer color) {
- if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
- setValue(KEY_BLUE, color);
- }
- }
-
- /**
- * Gets the green value of the color
- * @return green value
- */
- public Integer getBlue() {
- return getInteger(KEY_BLUE);
- }
-}
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
deleted file mode 100644
index ac46368d8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
+++ /dev/null
@@ -1,311 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import java.util.Hashtable;
-
-/**
- * Contains information about a radio control module's capabilities.
- */
-public class RadioControlCapabilities extends RPCStruct{
- public static final String KEY_MODULE_NAME= "moduleName";
- public static final String KEY_RADIO_ENABLE_AVAILABLE= "radioEnableAvailable";
- public static final String KEY_RADIO_BAND_AVAILABLE= "radioBandAvailable";
- public static final String KEY_RADIO_FREQUENCY_AVAILABLE= "radioFrequencyAvailable";
- public static final String KEY_HD_CHANNEL_AVAILABLE= "hdChannelAvailable";
- public static final String KEY_RDS_DATA_AVAILABLE= "rdsDataAvailable";
- public static final String KEY_AVAILABLE_HDS_AVAILABLE= "availableHDsAvailable";
- 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_HD_RADIO_ENABLE_AVAILABLE = "hdRadioEnableAvailable";
- public static final String KEY_SIRIUS_XM_RADIO_AVAILABLE = "siriusxmRadioAvailable";
- public static final String KEY_SIS_DATA_AVAILABLE = "sisDataAvailable";
-
- public RadioControlCapabilities() {
- }
-
- public RadioControlCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new RadioControlCapabilities object
- * @param moduleName
- * The short friendly name of the climate control module.
- * It should not be used to identify a module by mobile application.
- */
- public RadioControlCapabilities(@NonNull String moduleName) {
- this();
- setModuleName(moduleName);
- }
- /**
- * Sets the moduleName portion of the RadioControlCapabilities class
- *
- * @param moduleName
- * The short friendly name of the climate 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 RadioControlCapabilities class
- *
- * @return String - Short friendly name of the climate control module.
- */
- public String getModuleName() {
- return getString(KEY_MODULE_NAME);
- }
-
- /**
- * Sets the radioEnableAvailable portion of the RadioControlCapabilities class
- *
- * @param radioEnableAvailable
- * Availability of the control of enable/disable radio.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setRadioEnableAvailable(Boolean radioEnableAvailable) {
- setValue(KEY_RADIO_ENABLE_AVAILABLE, radioEnableAvailable);
- }
-
- /**
- * Gets the radioEnableAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the control of enable/disable radio.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getRadioEnableAvailable() {
- return getBoolean(KEY_RADIO_ENABLE_AVAILABLE);
- }
-
- /**
- * Sets the radioBandAvailable portion of the RadioControlCapabilities class
- *
- * @param radioBandAvailable
- * Availability of the control of radio band.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setRadioBandAvailable(Boolean radioBandAvailable) {
- setValue(KEY_RADIO_BAND_AVAILABLE, radioBandAvailable);
- }
-
- /**
- * Gets the radioBandAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the control of radio band.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getRadioBandAvailable() {
- return getBoolean(KEY_RADIO_BAND_AVAILABLE);
- }
-
- /**
- * Sets the radioFrequencyAvailable portion of the RadioControlCapabilities class
- *
- * @param radioFrequencyAvailable
- * Availability of the control of radio frequency.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setRadioFrequencyAvailable(Boolean radioFrequencyAvailable) {
- setValue(KEY_RADIO_FREQUENCY_AVAILABLE, radioFrequencyAvailable);
- }
-
- /**
- * Gets the radioFrequencyAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the control of radio frequency.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getRadioFrequencyAvailable() {
- return getBoolean(KEY_RADIO_FREQUENCY_AVAILABLE);
- }
-
- /**
- * Sets the hdChannelAvailable portion of the RadioControlCapabilities class
- *
- * @param hdChannelAvailable
- * Availability of the control of HD radio channel.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setHdChannelAvailable(Boolean hdChannelAvailable) {
- setValue(KEY_HD_CHANNEL_AVAILABLE, hdChannelAvailable);
- }
-
- /**
- * Gets the hdChannelAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the control of HD radio channel.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getHdChannelAvailable() {
- return getBoolean(KEY_HD_CHANNEL_AVAILABLE);
- }
-
- /**
- * Sets the rdsDataAvailable portion of the RadioControlCapabilities class
- *
- * @param rdsDataAvailable
- * Availability of the getting Radio Data System (RDS) data.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setRdsDataAvailable(Boolean rdsDataAvailable) {
- setValue(KEY_RDS_DATA_AVAILABLE, rdsDataAvailable);
- }
-
- /**
- * Gets the rdsDataAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the getting Radio Data System (RDS) data.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getRdsDataAvailable() {
- return getBoolean(KEY_RDS_DATA_AVAILABLE);
- }
-
- /**
- * Sets the availableHDsAvailable portion of the RadioControlCapabilities class
- *
- * @param availableHDsAvailable
- * Availability of the getting the number of available HD channels.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setAvailableHDsAvailable(Boolean availableHDsAvailable) {
- setValue(KEY_AVAILABLE_HDS_AVAILABLE, availableHDsAvailable);
- }
-
- /**
- * Gets the availableHDsAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the getting the number of available HD channels.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getAvailableHDsAvailable() {
- return getBoolean(KEY_AVAILABLE_HDS_AVAILABLE);
- }
-
- /**
- * Sets the stateAvailable portion of the RadioControlCapabilities class
- *
- * @param stateAvailable
- * Availability of the getting the Radio state.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setStateAvailable(Boolean stateAvailable) {
- setValue(KEY_STATE_AVAILABLE, stateAvailable);
- }
-
- /**
- * Gets the stateAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the getting the Radio state.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getStateAvailable() {
- return getBoolean(KEY_STATE_AVAILABLE);
- }
-
- /**
- * Sets the signalStrengthAvailable portion of the RadioControlCapabilities class
- *
- * @param signalStrengthAvailable
- * Availability of the getting the signal strength.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setSignalStrengthAvailable(Boolean signalStrengthAvailable) {
- setValue(KEY_SIGNAL_STRENGTH_AVAILABLE, signalStrengthAvailable);
- }
-
- /**
- * Gets the signalStrengthAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the getting the signal strength.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getSignalStrengthAvailable() {
- return getBoolean(KEY_SIGNAL_STRENGTH_AVAILABLE);
- }
-
- /**
- * Sets the signalChangeThresholdAvailable portion of the RadioControlCapabilities class
- *
- * @param signalChangeThresholdAvailable
- * Availability of the getting the signal Change Threshold.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setSignalChangeThresholdAvailable(Boolean signalChangeThresholdAvailable) {
- setValue(KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, signalChangeThresholdAvailable);
- }
-
- /**
- * Gets the signalChangeThresholdAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the getting the signal Change Threshold.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getSignalChangeThresholdAvailable() {
- return getBoolean(KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE);
- }
-
- /**
- * Sets the hdRadioEnableAvailable portion of the RadioControlCapabilities class
- *
- * @param hdRadioEnableAvailable Availability of the control of enable/disable HD radio.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setHdRadioEnableAvailable(Boolean hdRadioEnableAvailable) {
- setValue(KEY_HD_RADIO_ENABLE_AVAILABLE, hdRadioEnableAvailable);
- }
-
- /**
- * Gets the hdRadioEnableAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of the control of enable/disable HD radio.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getHdRadioEnableAvailable() {
- return getBoolean(KEY_HD_RADIO_ENABLE_AVAILABLE);
- }
-
- /**
- * Sets the siriusxmRadioAvailable portion of the RadioControlCapabilities class
- *
- * @param siriusxmRadioAvailable Availability of sirius XM radio.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public void setSiriusXMRadioAvailable(Boolean siriusxmRadioAvailable) {
- setValue(KEY_SIRIUS_XM_RADIO_AVAILABLE, siriusxmRadioAvailable);
- }
-
- /**
- * Gets the siriusxmRadioAvailable portion of the RadioControlCapabilities class
- *
- * @return Boolean - Availability of sirius XM radio.
- * True: Available, False: Not Available, Not present: Not Available.
- */
- public Boolean getSiriusXMRadioAvailable() {
- return getBoolean(KEY_SIRIUS_XM_RADIO_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
deleted file mode 100644
index fcedfdb0f..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
+++ /dev/null
@@ -1,261 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.RadioBand;
-import com.smartdevicelink.proxy.rpc.enums.RadioState;
-import java.util.Hashtable;
-
-/**
- * Include information (both read-only and changeable data) about a
- * remote control radio module.
- */
-public class RadioControlData extends RPCStruct{
- public static final String KEY_FREQUENCY_INTEGER= "frequencyInteger";
- public static final String KEY_FREQUENCY_FRACTION= "frequencyFraction";
- public static final String KEY_BAND= "band";
- public static final String KEY_RDS_DATA= "rdsData";
- public static final String KEY_AVAILABLE_HDS= "availableHDs";
- public static final String KEY_HD_CHANNEL= "hdChannel";
- public static final String KEY_SIGNAL_STRENGTH= "signalStrength";
- 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_HD_RADIO_ENABLE = "hdRadioEnable";
- public static final String KEY_SIS_DATA = "sisData";
-
- public RadioControlData() {
- }
-
- public RadioControlData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets the frequencyInteger portion of the RadioControlData class
- *
- * @param frequencyInteger
- * The integer part of the frequency i.e. for 101.7 this value should be 101
- */
- public void setFrequencyInteger(Integer frequencyInteger) {
- setValue(KEY_FREQUENCY_INTEGER, frequencyInteger);
- }
-
- /**
- * Gets the frequencyInteger portion of the RadioControlData class
- *
- * @return Integer - The integer part of the frequency i.e. for 101.7 this value should be 101.
- */
- public Integer getFrequencyInteger() {
- return getInteger(KEY_FREQUENCY_INTEGER);
- }
-
- /**
- * Sets the frequencyFraction portion of the RadioControlData class
- *
- * @param frequencyFraction
- * The fractional part of the frequency i.e. for 101.7 is 7.
- */
- public void setFrequencyFraction(Integer frequencyFraction) {
- setValue(KEY_FREQUENCY_FRACTION, frequencyFraction);
- }
-
- /**
- * Gets the frequencyFraction portion of the RadioControlData class
- *
- * @return Integer - The fractional part of the frequency i.e. for 101.7 is 7.
- */
- public Integer getFrequencyFraction() {
- return getInteger(KEY_FREQUENCY_FRACTION);
- }
-
- /**
- * Sets the band portion of the RadioControlData class
- *
- * @param band
- * The radio band (AM|FM|XM) of the radio tuner.
- */
- public void setBand(RadioBand band) {
- setValue(KEY_BAND, band);
- }
-
- /**
- * Gets the band portion of the RadioControlData class
- *
- * @return RadioBand - The radio band (AM|FM|XM) of the radio tuner.
- */
- public RadioBand getBand() {
- return (RadioBand) getObject(RadioBand.class, KEY_BAND);
- }
-
- /**
- * Sets the rdsData portion of the RadioControlData class
- *
- * @param rdsData
- * Read only parameter. See RdsData data type for details.
- */
- public void setRdsData(RdsData rdsData) {
- setValue(KEY_RDS_DATA, rdsData);
- }
-
- /**
- * Gets the rdsData portion of the RadioControlData class
- *
- * @return RdsData - Read only parameter. See RdsData data type for details.
- */
- public RdsData getRdsData() {
- return (RdsData) getObject(RdsData.class, KEY_RDS_DATA);
- }
-
- /**
- * Sets the availableHDs portion of the RadioControlData class
- *
- * @param availableHDs
- * Number of HD sub-channels if available.
- */
- public void setAvailableHDs(Integer availableHDs) {
- setValue(KEY_AVAILABLE_HDS, availableHDs);
- }
-
- /**
- * Gets the availableHDs portion of the RadioControlData class
- *
- * @return Integer - Number of HD sub-channels if available.
- */
- public Integer getAvailableHDs() {
- return getInteger(KEY_AVAILABLE_HDS);
- }
-
- /**
- * Sets the hdChannel portion of the RadioControlData class
- *
- * @param hdChannel
- * Current HD sub-channel if available.
- */
- public void setHdChannel(Integer hdChannel) {
- setValue(KEY_HD_CHANNEL, hdChannel);
- }
-
- /**
- * Gets the hdChannel portion of the RadioControlData class
- *
- * @return Integer - Current HD sub-channel if available.
- */
- public Integer getHdChannel() {
- return getInteger(KEY_HD_CHANNEL);
- }
-
- /**
- * Sets the signalStrength portion of the RadioControlData class
- *
- * @param signalStrength
- * Read only parameter. Indicates the strength of receiving radio signal in current frequency.
- */
- public void setSignalStrength(Integer signalStrength) {
- setValue(KEY_SIGNAL_STRENGTH, signalStrength);
- }
-
- /**
- * Gets the signalStrength portion of the RadioControlData class
- *
- * @return Integer - Read only parameter. Indicates the strength of receiving radio signal in current frequency.
- */
- public Integer getSignalStrength() {
- return getInteger(KEY_SIGNAL_STRENGTH);
- }
-
- /**
- * Sets the signalChangeThreshold portion of the RadioControlData class
- *
- * @param signalChangeThreshold
- * If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency.
- */
- public void setSignalChangeThreshold(Integer signalChangeThreshold) {
- setValue(KEY_SIGNAL_CHANGE_THRESHOLD, signalChangeThreshold);
- }
-
- /**
- * Gets the signalChangeThreshold portion of the RadioControlData class
- *
- * @return Integer - If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency.
- */
- public Integer getSignalChangeThreshold() {
- return getInteger(KEY_SIGNAL_CHANGE_THRESHOLD);
- }
-
- /**
- * Sets the radioEnable portion of the RadioControlData class
- * <br><b>Note: </b> If this is set to false, no other data will be included.
- * <br><b>Note: </b> This setting is normally a <b>READ-ONLY</b> setting.
- *
- * @param radioEnable
- * True if the radio is on, false is the radio is off.
- */
- public void setRadioEnable(Boolean radioEnable) {
- setValue(KEY_RADIO_ENABLE, radioEnable);
- }
-
- /**
- * Gets the radioEnable portion of the RadioControlData class
- * <br><b>Note: </b> If this is set to false, no other data will be included.
- *
- * @return Boolean - True if the radio is on, false is the radio is off.
- */
- public Boolean getRadioEnable() {
- return getBoolean(KEY_RADIO_ENABLE);
- }
-
- /**
- * Sets the state portion of the RadioControlData class
- *
- * @param state
- * Read only parameter. See RadioState data type for details.
- */
- public void setState(RadioState state) {
- setValue(KEY_STATE, state);
- }
-
- /**
- * Gets the state portion of the RadioControlData class
- *
- * @return RadioState - Read only parameter. See RadioState data type for details.
- */
- public RadioState getState() {
- return (RadioState) getObject(RadioState.class, KEY_STATE);
- }
-
- /**
- * Sets the hdRadioEnable portion of the RadioControlData class
- *
- * @param hdRadioEnable True if the hd radio is on, false if the radio is off.
- */
- public void setHdRadioEnable(Boolean hdRadioEnable) {
- setValue(KEY_HD_RADIO_ENABLE, hdRadioEnable);
- }
-
- /**
- * Gets the hdRadioEnable portion of the RadioControlData class
- *
- * @return Boolean - True if the hd radio is on, false if the radio is off.
- */
- public Boolean getHdRadioEnable() {
- return getBoolean(KEY_HD_RADIO_ENABLE);
- }
-
- /**
- * 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/RdsData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java
deleted file mode 100644
index 2ed934865..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/**
- * Include the data defined in Radio Data System, which is a communications protocol standard
- * for embedding small amounts of digital information in conventional FM radio broadcasts.
- */
-public class RdsData extends RPCStruct{
- public static final String KEY_PS= "PS";
- public static final String KEY_RT= "RT";
- public static final String KEY_CT= "CT";
- public static final String KEY_PI= "PI";
- public static final String KEY_PTY= "PTY";
- public static final String KEY_TP= "TP";
- public static final String KEY_TA= "TA";
- public static final String KEY_REG= "REG";
-
- public RdsData() {
- }
-
- public RdsData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets the programService portion of the RdsData class
- *
- * @param programService
- * Program Service Name.
- */
- public void setProgramService(String programService) {
- setValue(KEY_PS, programService);
- }
-
- /**
- * Gets the programService portion of the RdsData class
- *
- * @return String - Program Service Name.
- */
- public String getProgramService() {
- return getString(KEY_PS);
- }
-
- /**
- * Sets the radioText portion of the RdsData class
- *
- * @param radioText
- * Radio Text.
- */
- public void setRadioText(String radioText) {
- setValue(KEY_RT, radioText);
- }
-
- /**
- * Gets the radioText portion of the RdsData class
- *
- * @return String - Radio Text.
- */
- public String getRadioText() {
- return getString(KEY_RT);
- }
-
- /**
- * Sets the clockText portion of the RdsData class
- *
- * @param clockText
- * The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD.
- */
- public void setClockText(String clockText) {
- setValue(KEY_CT, clockText);
- }
-
- /**
- * Gets the clockText portion of the RdsData class
- *
- * @return String - The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD.
- */
- public String getClockText() {
- return getString(KEY_CT);
- }
-
- /**
- * Sets the programIdentification portion of the RdsData class
- *
- * @param programIdentification
- * Program Identification - the call sign for the radio station.
- */
- public void setProgramIdentification(String programIdentification) {
- setValue(KEY_PI, programIdentification);
- }
-
- /**
- * Gets the programIdentification portion of the RdsData class
- *
- * @return String - Program Identification - the call sign for the radio station.
- */
- public String getProgramIdentification() {
- return getString(KEY_PI);
- }
-
- /**
- * Sets the region portion of the RdsData class
- *
- * @param region
- * Region.
- */
- public void setRegion(String region) {
- setValue(KEY_REG, region);
- }
-
- /**
- * Gets the region portion of the RdsData class
- *
- * @return String - Region.
- */
- public String getRegion() {
- return getString(KEY_REG);
- }
-
- /**
- * Sets the trafficProgram portion of the RdsData class
- *
- * @param trafficProgram
- * Traffic Program Identification - Identifies a station that offers traffic.
- */
- public void setTrafficProgram(Boolean trafficProgram) {
- setValue(KEY_TP, trafficProgram);
- }
-
- /**
- * Gets the trafficProgram portion of the RdsData class
- *
- * @return Boolean - Traffic Program Identification - Identifies a station that offers traffic.
- */
- public Boolean getTrafficProgram() {
- return getBoolean(KEY_TP);
- }
-
- /**
- * Sets the trafficAnnouncement portion of the RdsData class
- *
- * @param trafficAnnouncement
- * Traffic Announcement Identification - Indicates an ongoing traffic announcement.
- */
- public void setTrafficAnnouncement(Boolean trafficAnnouncement) {
- setValue(KEY_TA, trafficAnnouncement);
- }
-
- /**
- * Gets the trafficAnnouncement portion of the RdsData class
- *
- * @return Boolean - Traffic Announcement Identification - Indicates an ongoing traffic announcement.
- */
- public Boolean getTrafficAnnouncement() {
- return getBoolean(KEY_TA);
- }
-
- /**
- * Sets the programType portion of the RdsData class
- *
- * @param programType
- * The program type - The region should be used to differentiate between EU and North America program types.
- */
- public void setProgramType(Integer programType) {
- setValue(KEY_PTY, programType);
- }
-
- /**
- * Gets the programType portion of the RdsData class
- *
- * @return Integer - The program type.
- * The region should be used to differentiate between EU and North America program types.
- */
- public Integer getProgramType() {
- return getInteger(KEY_PTY);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java
deleted file mode 100644
index 7d62cf019..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * <p>Non periodic vehicle data read request. This is an RPC to get diagnostics
- * data from certain vehicle modules. DIDs of a certain module might differ from
- * vehicle type to vehicle type</p>
- *
- * <p>Function Group: ProprietaryData</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>ecuName</td>
- * <td>Integer</td>
- * <td>Name of ECU.</td>
- * <td>Y</td>
- * <td>Minvalue: 0; Maxvalue: 65535</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * <tr>
- * <td>didLocation</td>
- * <td>Integer</td>
- * <td>Get raw data from vehicle data DID location(s).</td>
- * <td>Y</td>
- * <td>Minvalue: 0; Maxvalue: 65535</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <td>appID</td>
- * <td>Integer</td>
- * <td>ID of the application that requested this RPC.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * <p><b>Response</b></p>
- *
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>REJECTED</p>
- * <p> DISALLOWED</p>
- * <p>USER_DISALLOWED </p>
- * <p>TRUNCATED_DATA</p>
- *
- * @since SmartDeviceLink 2.0
- */
-public class ReadDID extends RPCRequest {
- public static final String KEY_ECU_NAME = "ecuName";
- public static final String KEY_DID_LOCATION = "didLocation";
-
- /**
- * Constructs a new ReadDID object
- */
- public ReadDID() {
- super(FunctionID.READ_DID.toString());
- }
-
- /**
- * Constructs a new ReadDID object indicated by the Hashtable parameter
- *
- * @param hash The Hashtable to use
- */
- public ReadDID(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ReadDID object
- * @param ecuName an Integer value representing the ID of the vehicle module
- * <b>Notes: </b>Minvalue:0; Maxvalue:65535
- * @param didLocation a List<Integer> value representing raw data from vehicle data DID location(s) <br>
- * <b>Notes: </b>
- * <ul>
- * <li>Minvalue:0; Maxvalue:65535</li>
- * <li>ArrayMin:0; ArrayMax:1000</li>
- * </ul>
- */
- public ReadDID(@NonNull Integer ecuName, @NonNull List<Integer> didLocation) {
- this();
- setEcuName(ecuName);
- setDidLocation(didLocation);
- }
-
- /**
- * Sets an ID of the vehicle module
- *
- * @param ecuName
- * an Integer value representing the ID of the vehicle module
- * <p></p>
- * <b>Notes: </b>Minvalue:0; Maxvalue:65535
- */
- public void setEcuName(@NonNull Integer ecuName) {
- setParameters(KEY_ECU_NAME, ecuName);
- }
-
- /**
- * Gets the ID of the vehicle module
- *
- * @return Integer -an Integer value representing the ID of the vehicle
- * module
- */
- public Integer getEcuName() {
- return getInteger(KEY_ECU_NAME);
- }
-
- /**
- * Sets raw data from vehicle data DID location(s)
- *
- * @param didLocation
- * a List<Integer> value representing raw data from vehicle
- * data DID location(s)
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Minvalue:0; Maxvalue:65535</li>
- * <li>ArrayMin:0; ArrayMax:1000</li>
- * </ul>
- */
- public void setDidLocation(@NonNull List<Integer> didLocation) {
- setParameters(KEY_DID_LOCATION, didLocation);
- }
-
- /**
- * Gets raw data from vehicle data DID location(s)
- *
- * @return List<Integer> -a List<Integer> value representing raw data
- * from vehicle data DID location(s)
- */
- @SuppressWarnings("unchecked")
- public List<Integer> getDidLocation() {
- return (List<Integer>) getObject(Integer.class, KEY_DID_LOCATION);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java
deleted file mode 100644
index 3cf835906..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Read DID Response is sent, when ReadDID has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class ReadDIDResponse extends RPCResponse {
- public static final String KEY_DID_RESULT = "didResult";
-
- public ReadDIDResponse() {
- super(FunctionID.READ_DID.toString());
- }
- public ReadDIDResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new ReadDIDResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public ReadDIDResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
- public void setDidResult(List<DIDResult> didResult) {
- setParameters(KEY_DID_RESULT, didResult);
- }
- @SuppressWarnings("unchecked")
- public List<DIDResult> getDidResult() {
- return (List<DIDResult>) getObject(DIDResult.class, KEY_DID_RESULT);
- }
-}
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
deleted file mode 100644
index 5ba1e623d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
+++ /dev/null
@@ -1,707 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-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;
-/**
- * Registers the application's interface with SDL&reg;, declaring properties of
- * the registration, including the messaging interface version, the app name,
- * etc. The mobile application must establish its interface registration with
- * SDL&reg; before any other interaction with SDL&reg; can take place. The
- * registration lasts until it is terminated either by the application calling
- * the <i> {@linkplain UnregisterAppInterface}</i> method, or by SDL&reg;
- * sending an <i> {@linkplain OnAppInterfaceUnregistered}</i> notification, or
- * by loss of the underlying transport connection, or closing of the underlying
- * message transmission protocol RPC session
- * <p></p>
- * Until the application receives its first <i>{@linkplain OnHMIStatus}</i>
- * Notification, its HMI Status is assumed to be: <i>
- * {@linkplain com.smartdevicelink.proxy.rpc.enums.HMILevel}</i>=NONE, <i>
- * {@linkplain com.smartdevicelink.proxy.rpc.enums.AudioStreamingState}
- * </i>=NOT_AUDIBLE, <i>
- * {@linkplain com.smartdevicelink.proxy.rpc.enums.SystemContext}</i>=MAIN
- * <p></p>
- * All SDL&reg; resources which the application creates or uses (e.g. Choice
- * Sets, Command Menu, etc.) are associated with the application's interface
- * registration. Therefore, when the interface registration ends, the SDL&reg;
- * resources associated with the application are disposed of. As a result, even
- * though the application itself may continue to run on its host platform (e.g.
- * mobile device) after the interface registration terminates, the application
- * will not be able to use the SDL&reg; HMI without first establishing a new
- * interface registration and re-creating its required SDL&reg; resources. That
- * is, SDL&reg; resources created by (or on behalf of) an application do not
- * persist beyond the life-span of the interface registration
- * <p></p>
- * Resources and settings whose lifespan is tied to the duration of an
- * application's interface registration:
- * <ul>
- * <li>Choice Sets</li>
- * <li>Command Menus (built by successive calls to <i>{@linkplain AddCommand}
- * </i>)</li>
- * <li>Media clock timer display value</li>
- * <li>Media clock timer display value</li>
- * <li>Media clock timer display value</li>
- * </ul>
- * <p></p>
- * The autoActivateID is used to grant an application the HMILevel and
- * AudioStreamingState it had when it last disconnected
- * <p></p>
- * <b>Notes: </b>The autoActivateID parameter, and associated behavior, is
- * currently ignored by SDL&reg;
- * <p></p>
- * When first calling this method (i.e. first time within life cycle of mobile
- * app), an autoActivateID should not be included. After successfully
- * registering an interface, an autoActivateID is returned to the mobile
- * application for it to use in subsequent connections. If the connection
- * between SDL&reg; and the mobile application is lost, such as the vehicle is
- * turned off while the application is running, the autoActivateID can then be
- * passed in another call to RegisterAppInterface to re-acquire <i>
- * {@linkplain com.smartdevicelink.proxy.rpc.enums.HMILevel}</i>=FULL
- * <p></p>
- * If the application intends to stream audio it is important to indicate so via
- * the isMediaApp parameter. When set to true, audio will reliably stream
- * without any configuration required by the user. When not set, audio may
- * stream, depending on what the user might have manually configured as a media
- * source on SDL&reg;
- * <p></p>
- * There is no time limit for how long the autoActivateID is "valid" (i.e. would
- * confer focus and opt-in)
- *
- *<p> <b>HMILevel is not defined before registering</b></p>
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>MsgVersion</td>
- * <td>MsgVersion</td>
- * <td>Declares what version of the SDL interface the application expects to use with SDL</td>
- * <td>Y</td>
- * <td>To be compatible, app msg major version number must be less than or equal to SDL major version number. <p>If msg versions are incompatible, app has 20 seconds to attempt successful RegisterAppInterface (w.r.t. msg version) on underlying protocol session, else will be terminated. Major version number is a compatibility declaration. Minor version number indicates minor functional variations (e.g. features, capabilities, bug fixes) when sent from SDL to app (in RegisterAppInterface response).</p>However, the minor version number sent from the app to SDL (in RegisterAppInterface request) is ignored by SDL.</td>
- * <td>SmartDeviceLink 1.0 </td>
- * </tr>
- * <tr>
- * <td>appName</td>
- * <td>String</td>
- * <td>The mobile application's name. This name is displayed in the SDL Mobile Applications menu. It also serves as the unique identifier of the application for SDL .</td>
- * <td>Y</td>
- * <td><p> Must be 1-100 characters in length. Must consist of following characters: </p><p>May not be the same (by case insensitive comparison) as the name or any synonym of any currently registered application.</p> </td>
- * <td>SmartDeviceLink 1.0 </td>
- * </tr>
- * <tr>
- * <td>ttsName</td>
- * <td>TTSChunk</td>
- * <td>TTS string for VR recognition of the mobile application name. Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.</td>
- * <td>N</td>
- * <td><p>Size must be 1-100 Needs to be unique over all applications. May not be empty.<p>May not start with a new line character.</p></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>ngnMediaScreenAppName</td>
- * <td>String</td>
- * <td>Provides an abbreviated version of the app name (if necessary) that will be displayed on the NGN media screen.</td>
- * <td>N</td>
- * <td>- Must be 1-5 characters. If not provided, value will be derived from appName truncated to 5 characters.</td>
- * <td>SmartDeviceLink 1.0 </td>
- * </tr>
- * <tr>
- * <td>vrSynonyms</td>
- * <td>String</td>
- * <td>An array of 1-100 elements, each element containing a voice-recognition synonym by which this app can be called when being addressed in the mobile applications menu.</td>
- * <td>N</td>
- * <td>Each vr synonym is limited to 40 characters, and there can be 1-100 synonyms in array. May not be the same (by case insensitive comparison) as the name or any synonym of any currently-registered application.</td>
- * <td>SmartDeviceLink 1.0 </td>
- * </tr>
- * <tr>
- * <td>isMediaApplication</td>
- * <td>Boolean</td>
- * <td>Indicates that the application will be streaming audio to SDL (via A2DP) that is audible outside of the BT media source.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0 </td>
- * </tr>
- * <tr>
- * <td>languageDesired</td>
- * <td>Language</td>
- * <td>An enumeration indicating what language the application intends to use for user interaction (Display, TTS and VR).</td>
- * <td>Y</td>
- * <td>If the language indicated does not match the active language on SDL, the interface registration will be rejected.If the user changes the SDL language while this interface registration is active, the interface registration will be terminated. </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>hmiDisplayLanguageDesired</td>
- * <td>Language</td>
- * <td>An enumeration indicating what language the application intends to use for user interaction ( Display).</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>appHMIType</td>
- * <td>AppHMIType</td>
- * <td>List of all applicable app types stating which classifications to be given to the app.e.g. for platforms , like GEN2, this will determine which "corner(s)" the app can populate</td>
- * <td>N</td>
- * <td>Array Minsize: 1; Array Maxsize: 100</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>hashID</td>
- * <td>String</td>
- * <td>ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece. If omitted, then the previous state of an app's commands, etc. will not be restored.When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.). </td>
- * <td>N</td>
- * <td>maxlength:100</td>
- * <td>SmartDeviceLink 2.3.1 </td>
- * </tr>
- * <tr>
- * <td>deviceInfo</td>
- * <td>DeviceInfo</td>
- * <td>Various information abount connecting device.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.3.1 </td>
- * </tr>
- * <tr>
- * <td>appID</td>
- * <td>String</td>
- * <td>ID used to validate app with policy table entries</td>
- * <td>Y</td>
- * <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 5.0</td>
- * </tr>
- * <tr>
- * <td>hmiCapabilities</td>
- * <td>HMICapabilities</td>
- * <td>Specifies the HMI capabilities.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.3.2.2 </td>
- * </tr>
- *
- * <tr>
- * <td>sdlVersion</td>
- * <td>String</td>
- * <td>The SmartDeviceLink version.</td>
- * <td>N</td>
- * <td>Maxlength: 100</td>
- * <td>SmartDeviceLink 2.3.2.2</td>
- * </tr>
- *
- * <tr>
- * <td>systemSoftwareVersion</td>
- * <td>String</td>
- * <td>The software version of the system that implements the SmartDeviceLink core.</td>
- * <td>N</td>
- * <td>Maxlength: 100</td>
- * <td>SmartDeviceLink 2.3.2.2</td>
- * </tr>
- *
- * <tr>
- * <td>dayColorScheme</td>
- * <td>TemplateColorScheme</td>
- * <td>The color scheme that is used for day.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- *
- * <tr>
- * <td>nightColorScheme</td>
- * <td>TemplateColorScheme</td>
- * <td>The color scheme that is used for night.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * </table>
- * <p></p>
- * @since SmartDeviceLink 1.0
- * @see UnregisterAppInterface
- * @see OnAppInterfaceUnregistered
- */
-public class RegisterAppInterface extends RPCRequest {
- public static final String KEY_TTS_NAME = "ttsName";
- 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";
- public static final String KEY_NGN_MEDIA_SCREEN_APP_NAME = "ngnMediaScreenAppName";
- public static final String KEY_IS_MEDIA_APPLICATION = "isMediaApplication";
- public static final String KEY_VR_SYNONYMS = "vrSynonyms";
- public static final String KEY_SDL_MSG_VERSION = "syncMsgVersion";
- 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
- */
- public RegisterAppInterface() {
- super(FunctionID.REGISTER_APP_INTERFACE.toString());
- }
- /**
- * Constructs a new RegisterAppInterface object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public RegisterAppInterface(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new RegisterAppInterface object
- * @param syncMsgVersion a SdlMsgVersion object representing version of the SDL&reg; SmartDeviceLink interface <br>
- * <b>Notes: </b>To be compatible, app msg major version number
- * must be less than or equal to SDL&reg; major version number.
- * If msg versions are incompatible, app has 20 seconds to
- * attempt successful RegisterAppInterface (w.r.t. msg version)
- * on underlying protocol session, else will be terminated. Major
- * version number is a compatibility declaration. Minor version
- * number indicates minor functional variations (e.g. features,
- * capabilities, bug fixes) when sent from SDL&reg; to app (in
- * RegisterAppInterface response). However, the minor version
- * number sent from the app to SDL&reg; (in RegisterAppInterface
- * request) is ignored by SDL&reg;
- * @param appName a String value representing the Mobile Application's Name <br>
- * <b>Notes: </b>
- * <ul>
- * <li>Must be 1-100 characters in length</li>
- * <li>May not be the same (by case insensitive comparison) as
- * the name or any synonym of any currently-registered
- * application</li>
- * </ul>
- * @param isMediaApplication a Boolean value
- * @param languageDesired a Language Enumeration
- * @param hmiDisplayLanguageDesired
- * @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 fullAppID) {
- this();
- setSdlMsgVersion(syncMsgVersion);
- setAppName(appName);
- setIsMediaApplication(isMediaApplication);
- setLanguageDesired(languageDesired);
- setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
- setFullAppID(fullAppID);
- }
- /**
- * Gets the version of the SDL&reg; SmartDeviceLink interface
- *
- * @return SdlMsgVersion -a SdlMsgVersion object representing version of
- * the SDL&reg; SmartDeviceLink interface
- */
- @SuppressWarnings("unchecked")
- public SdlMsgVersion getSdlMsgVersion() {
- return (SdlMsgVersion) getObject(SdlMsgVersion.class, KEY_SDL_MSG_VERSION);
- }
- /**
- * Sets the version of the SDL&reg; SmartDeviceLink interface
- *
- * @param sdlMsgVersion
- * a SdlMsgVersion object representing version of the SDL&reg;
- * SmartDeviceLink interface
- * <p></p>
- * <b>Notes: </b>To be compatible, app msg major version number
- * must be less than or equal to SDL&reg; major version number.
- * If msg versions are incompatible, app has 20 seconds to
- * attempt successful RegisterAppInterface (w.r.t. msg version)
- * on underlying protocol session, else will be terminated. Major
- * version number is a compatibility declaration. Minor version
- * number indicates minor functional variations (e.g. features,
- * capabilities, bug fixes) when sent from SDL&reg; to app (in
- * RegisterAppInterface response). However, the minor version
- * number sent from the app to SDL&reg; (in RegisterAppInterface
- * request) is ignored by SDL&reg;
- *
- */
- public void setSdlMsgVersion(@NonNull SdlMsgVersion sdlMsgVersion) {
- setParameters(KEY_SDL_MSG_VERSION, sdlMsgVersion);
- }
-
- @SuppressWarnings("unchecked")
- public DeviceInfo getDeviceInfo() {
- return (DeviceInfo) getObject(DeviceInfo.class, KEY_DEVICE_INFO);
- }
-
- public void setDeviceInfo(DeviceInfo deviceInfo) {
- setParameters(KEY_DEVICE_INFO, deviceInfo);
- }
- /**
- * Gets Mobile Application's Name
- *
- * @return String -a String representing the Mobile Application's Name
- */
- public String getAppName() {
- return getString(KEY_APP_NAME);
- }
- /**
- * Sets Mobile Application's Name, This name is displayed in the SDL&reg;
- * Mobile Applications menu. It also serves as the unique identifier of the
- * application for SmartDeviceLink
- *
- * @param appName
- * a String value representing the Mobile Application's Name
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Must be 1-100 characters in length</li>
- * <li>May not be the same (by case insensitive comparison) as
- * the name or any synonym of any currently-registered
- * application</li>
- * </ul>
- */
- public void setAppName(@NonNull String appName) {
- setParameters(KEY_APP_NAME, appName);
- }
-
- /**
- * Gets TTS string for VR recognition of the mobile application name
- *
- * @return List<TTSChunk> -List value representing the TTS string
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getTtsName() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_NAME);
- }
-
- /**
- *
- * @param ttsName
- * a List<TTSChunk> value represeting the TTS Name
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Size must be 1-100</li>
- * <li>Needs to be unique over all applications</li>
- * <li>May not be empty</li>
- * <li>May not start with a new line character</li>
- * <li>May not interfere with any name or synonym of previously
- * registered applications and the following list of words</li>
- * <li>Needs to be unique over all applications. Applications
- * with the same name will be rejected</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
- public void setTtsName(List<TTSChunk> ttsName) {
- setParameters(KEY_TTS_NAME, ttsName);
- }
- /**
- * Gets a String representing an abbreviated version of the mobile
- * applincation's name (if necessary) that will be displayed on the NGN
- * media screen
- *
- * @return String -a String value representing an abbreviated version of the
- * mobile applincation's name
- */
- public String getNgnMediaScreenAppName() {
- return getString(KEY_NGN_MEDIA_SCREEN_APP_NAME);
- }
- /**
- * Sets a String representing an abbreviated version of the mobile
- * applincation's name (if necessary) that will be displayed on the NGN
- * media screen
- *
- * @param ngnMediaScreenAppName
- * a String value representing an abbreviated version of the
- * mobile applincation's name
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Must be 1-5 characters</li>
- * <li>If not provided, value will be derived from appName
- * truncated to 5 characters</li>
- * </ul>
- */
- public void setNgnMediaScreenAppName(String ngnMediaScreenAppName) {
- setParameters(KEY_NGN_MEDIA_SCREEN_APP_NAME, ngnMediaScreenAppName);
- }
- /**
- * Gets the List<String> representing the an array of 1-100 elements, each
- * element containing a voice-recognition synonym
- *
- * @return List<String> -a List value representing the an array of
- * 1-100 elements, each element containing a voice-recognition
- * synonym
- */
- @SuppressWarnings("unchecked")
- public List<String> getVrSynonyms() {
- return (List<String>) getObject(String.class, KEY_VR_SYNONYMS);
- }
- /**
- * Sets a vrSynonyms representing the an array of 1-100 elements, each
- * element containing a voice-recognition synonym
- *
- * @param vrSynonyms
- * a List<String> value representing the an array of 1-100
- * elements
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Each vr synonym is limited to 40 characters, and there can
- * be 1-100 synonyms in array</li>
- * <li>May not be the same (by case insensitive comparison) as
- * the name or any synonym of any currently-registered
- * application</li>
- * </ul>
- */
- public void setVrSynonyms(List<String> vrSynonyms) {
- setParameters(KEY_VR_SYNONYMS, vrSynonyms);
- }
- /**
- * Gets a Boolean representing MediaApplication
- *
- * @return Boolean -a Boolean value representing a mobile application that is
- * a media application or not
- */
- public Boolean getIsMediaApplication() {
- return getBoolean(KEY_IS_MEDIA_APPLICATION);
- }
- /**
- * Sets a Boolean to indicate a mobile application that is a media
- * application or not
- *
- * @param isMediaApplication
- * a Boolean value
- */
- public void setIsMediaApplication(@NonNull Boolean isMediaApplication) {
- setParameters(KEY_IS_MEDIA_APPLICATION, isMediaApplication);
- }
- /**
- * Gets a Language enumeration indicating what language the application
- * intends to use for user interaction (Display, TTS and VR)
- *
- * @return Enumeration -a language enumeration
- */
- public Language getLanguageDesired() {
- return (Language) getObject(Language.class, KEY_LANGUAGE_DESIRED);
- }
- /**
- * Sets an enumeration indicating what language the application intends to
- * use for user interaction (Display, TTS and VR)
- *
- * @param languageDesired
- * a Language Enumeration
- *
- *
- */
- public void setLanguageDesired(@NonNull Language languageDesired) {
- setParameters(KEY_LANGUAGE_DESIRED, languageDesired);
- }
-
- /**
- * Gets an enumeration indicating what language the application intends to
- * use for user interaction ( Display)
- *
- * @return Language - a Language value representing an enumeration
- * indicating what language the application intends to use for user
- * interaction ( Display)
- * @since SmartDeviceLink 2.0
- */
- public Language getHmiDisplayLanguageDesired() {
- return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE_DESIRED);
- }
-
- /**
- * Sets an enumeration indicating what language the application intends to
- * use for user interaction ( Display)
- *
- * @param hmiDisplayLanguageDesired
- * @since SmartDeviceLink 2.0
- */
- public void setHmiDisplayLanguageDesired(@NonNull Language hmiDisplayLanguageDesired) {
- setParameters(KEY_HMI_DISPLAY_LANGUAGE_DESIRED, hmiDisplayLanguageDesired);
- }
-
- /**
- * Gets a list of all applicable app types stating which classifications to
- * be given to the app.e.g. for platforms , like GEN2, this will determine
- * which "corner(s)" the app can populate
- *
- * @return List<AppHMIType> - a List value representing a list of all
- * applicable app types stating which classifications to be given to
- * the app
- * @since SmartDeviceLinke 2.0
- */
- @SuppressWarnings("unchecked")
- public List<AppHMIType> getAppHMIType() {
- return (List<AppHMIType>) getObject(AppHMIType.class, KEY_APP_HMI_TYPE);
- }
-
- /**
- * Sets a a list of all applicable app types stating which classifications
- * to be given to the app. e.g. for platforms , like GEN2, this will
- * determine which "corner(s)" the app can populate
- *
- * @param appHMIType
- * a List<AppHMIType>
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Array Minsize: = 1</li>
- * <li>Array Maxsize = 100</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
- public void setAppHMIType(List<AppHMIType> appHMIType) {
- setParameters(KEY_APP_HMI_TYPE, appHMIType);
- }
-
- public String getHashID() {
- return getString(KEY_HASH_ID);
- }
-
- 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);
- }
-
- /**
- * 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
- * <p></p>
- * <b>Notes: </b>Maxlength = 100
- * @since SmartDeviceLink 2.0
- */
- 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 5.0
- */
- 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 5.0
- */
- 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
- *
- * @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used
- * for day color scheme
- * @since SmartDeviceLink 5.0
- */
- public TemplateColorScheme getDayColorScheme(){
- return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_DAY_COLOR_SCHEME);
- }
-
- /**
- * Sets the color scheme that is intended to be used for day
- *
- * @param templateColorScheme a TemplateColorScheme object representing the colors that will be
- * used for day color scheme
- * @since SmartDeviceLink 5.0
- */
- public void setDayColorScheme(TemplateColorScheme templateColorScheme){
- setParameters(KEY_DAY_COLOR_SCHEME, templateColorScheme);
- }
-
- /**
- * Gets the color scheme that is currently used for night
- *
- * @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used
- * for night color scheme
- * @since SmartDeviceLink 5.0
- */
- public TemplateColorScheme getNightColorScheme(){
- return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_NIGHT_COLOR_SCHEME);
- }
-
- /**
- * Sets the color scheme that is intended to be used for night
- *
- * @param templateColorScheme a TemplateColorScheme object representing the colors that will be
- * used for night color scheme
- * @since SmartDeviceLink 5.0
- */
- public void setNightColorScheme(TemplateColorScheme templateColorScheme){
- setParameters(KEY_NIGHT_COLOR_SCHEME, templateColorScheme);
- }
-}
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
deleted file mode 100644
index 746129a85..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
+++ /dev/null
@@ -1,429 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.Version;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.proxy.rpc.enums.PrerecordedSpeech;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Register AppInterface Response is sent, when RegisterAppInterface has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class RegisterAppInterfaceResponse extends RPCResponse {
- public static final String KEY_VEHICLE_TYPE = "vehicleType";
- public static final String KEY_SPEECH_CAPABILITIES = "speechCapabilities";
- public static final String KEY_VR_CAPABILITIES = "vrCapabilities";
- public static final String KEY_AUDIO_PASS_THRU_CAPABILITIES = "audioPassThruCapabilities";
- public static final String KEY_HMI_ZONE_CAPABILITIES = "hmiZoneCapabilities";
- public static final String KEY_PRERECORDED_SPEECH = "prerecordedSpeech";
- public static final String KEY_SUPPORTED_DIAG_MODES = "supportedDiagModes";
- public static final String KEY_SDL_MSG_VERSION = "syncMsgVersion";
- public static final String KEY_LANGUAGE = "language";
- public static final String KEY_BUTTON_CAPABILITIES = "buttonCapabilities";
- public static final String KEY_DISPLAY_CAPABILITIES = "displayCapabilities";
- public static final String KEY_HMI_DISPLAY_LANGUAGE = "hmiDisplayLanguage";
- public static final String KEY_SOFT_BUTTON_CAPABILITIES = "softButtonCapabilities";
- public static final String KEY_PRESET_BANK_CAPABILITIES = "presetBankCapabilities";
- public static final String KEY_HMI_CAPABILITIES = "hmiCapabilities"; //As of v4.0
- public static final String KEY_SDL_VERSION = "sdlVersion"; //As of v4.0
- public static final String KEY_SYSTEM_SOFTWARE_VERSION = "systemSoftwareVersion"; //As of v4.0
- public static final String KEY_ICON_RESUMED = "iconResumed";
- public static final String KEY_PCM_STREAM_CAPABILITIES = "pcmStreamCapabilities";
-
- /**
- * Constructs a new RegisterAppInterfaceResponse object
- */
- public RegisterAppInterfaceResponse() {
- super(FunctionID.REGISTER_APP_INTERFACE.toString());
- }
-
- /**
- * Constructs a new RegisterAppInterfaceResponse object indicated by the Hashtable
- * parameter
- * <p>
- *
- * @param hash
- * The Hashtable to use
- */
- public RegisterAppInterfaceResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Gets the version of the SDL&reg; SmartDeviceLink interface
- *
- * @return SdlMsgVersion -a SdlMsgVersion object representing version of
- * the SDL&reg; SmartDeviceLink interface
- */
- /**
- * Constructs a new RegisterAppInterfaceResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public RegisterAppInterfaceResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- 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);
- }
-
- List<ButtonCapabilities> capabilities = getButtonCapabilities();
- if(capabilities != null){
- List<ButtonCapabilities> additions = new ArrayList<>();
- for(ButtonCapabilities capability : capabilities){
- if(ButtonName.OK.equals(capability.getName())){
- if(rpcVersion == null || rpcVersion.getMajor() < 5){
- //If version is < 5, the play pause button must also be added
- additions.add(new ButtonCapabilities(ButtonName.PLAY_PAUSE, capability.getShortPressAvailable(), capability.getLongPressAvailable(), capability.getUpDownAvailable()));
- }
- }
- }
- capabilities.addAll(additions);
- setButtonCapabilities(capabilities);
- }
-
-
- super.format(rpcVersion,formatParams);
- }
-
- @SuppressWarnings("unchecked")
- public SdlMsgVersion getSdlMsgVersion() {
- return (SdlMsgVersion) getObject(SdlMsgVersion.class, KEY_SDL_MSG_VERSION);
- }
-
- /**
- * Sets the version of the SDL&reg; SmartDeviceLink interface
- *
- * @param sdlMsgVersion
- * a SdlMsgVersion object representing version of the SDL&reg;
- * SmartDeviceLink interface
- * <p></p>
- * <b>Notes: </b>To be compatible, app msg major version number
- * must be less than or equal to SDL&reg; major version number.
- * If msg versions are incompatible, app has 20 seconds to
- * attempt successful RegisterAppInterface (w.r.t. msg version)
- * on underlying protocol session, else will be terminated. Major
- * version number is a compatibility declaration. Minor version
- * number indicates minor functional variations (e.g. features,
- * capabilities, bug fixes) when sent from SDL&reg; to app (in
- * RegisterAppInterface response). However, the minor version
- * number sent from the app to SDL&reg; (in RegisterAppInterface
- * request) is ignored by SDL&reg;
- */
- public void setSdlMsgVersion(SdlMsgVersion sdlMsgVersion) {
- setParameters(KEY_SDL_MSG_VERSION, sdlMsgVersion);
- }
-
- /**
- * Gets a Language enumeration indicating what language the application
- * intends to use for user interaction (Display, TTS and VR)
- *
- * @return Enumeration -a language enumeration
- */
- public Language getLanguage() {
- return (Language) getObject(Language.class, KEY_LANGUAGE);
- }
-
- /**
- * Sets an enumeration indicating what language the application intends to
- * use for user interaction (Display, TTS and VR)
- *
- * @param language
- * a Language Enumeration
- *
- *
- */
- public void setLanguage(Language language) {
- setParameters(KEY_LANGUAGE, language);
- }
-
- /**
- * Gets an enumeration indicating what language the application intends to
- * use for user interaction ( Display)
- *
- * @return Language - a Language value representing an enumeration
- * indicating what language the application intends to use for user
- * interaction ( Display)
- * @since SmartDeviceLink 2.0
- */
- public Language getHmiDisplayLanguage() {
- return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE);
- }
-
- /**
- * Sets an enumeration indicating what language the application intends to
- * use for user interaction ( Display)
- *
- * @param hmiDisplayLanguage
- * @since SmartDeviceLink 2.0
- */
- public void setHmiDisplayLanguage(Language hmiDisplayLanguage) {
- setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
- }
-
- /**
- * Gets getDisplayCapabilities set when application interface is registered.
- *
- * @return DisplayCapabilities
- */
- @SuppressWarnings("unchecked")
- public DisplayCapabilities getDisplayCapabilities() {
- return (DisplayCapabilities) getObject(DisplayCapabilities.class, KEY_DISPLAY_CAPABILITIES);
- }
- /**
- * Sets Display Capabilities
- * @param displayCapabilities
- */
- public void setDisplayCapabilities(DisplayCapabilities displayCapabilities) {
- setParameters(KEY_DISPLAY_CAPABILITIES, displayCapabilities);
- }
-
- /**
- * Gets buttonCapabilities set when application interface is registered.
- *
- * @return buttonCapabilities
- */
- @SuppressWarnings("unchecked")
- public List<ButtonCapabilities> getButtonCapabilities() {
- return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES);
- }
- /**
- * Sets Button Capabilities
- * @param buttonCapabilities
- */
- public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
- setParameters(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
- }
- /**
- * Gets getSoftButtonCapabilities set when application interface is registered.
- *
- * @return SoftButtonCapabilities
- */
- @SuppressWarnings("unchecked")
- public List<SoftButtonCapabilities> getSoftButtonCapabilities() {
- return (List<SoftButtonCapabilities>) getObject(SoftButtonCapabilities.class, KEY_SOFT_BUTTON_CAPABILITIES);
- }
- /**
- * Sets softButtonCapabilities
- * @param softButtonCapabilities
- */
- public void setSoftButtonCapabilities(List<SoftButtonCapabilities> softButtonCapabilities) {
- setParameters(KEY_SOFT_BUTTON_CAPABILITIES, softButtonCapabilities);
- }
-
- /**
- * Gets getPresetBankCapabilities set when application interface is registered.
- *
- * @return PresetBankCapabilities
- */
- @SuppressWarnings("unchecked")
- public PresetBankCapabilities getPresetBankCapabilities() {
- return (PresetBankCapabilities) getObject(PresetBankCapabilities.class, KEY_PRESET_BANK_CAPABILITIES);
- }
- /**
- * Sets presetBankCapabilities
- * @param presetBankCapabilities
- */
- public void setPresetBankCapabilities(PresetBankCapabilities presetBankCapabilities) {
- setParameters(KEY_PRESET_BANK_CAPABILITIES, presetBankCapabilities);
- }
-
- /**
- * Gets hmiZoneCapabilities set when application interface is registered.
- *
- * @return HmiZoneCapabilities
- */
- @SuppressWarnings("unchecked")
- public List<HmiZoneCapabilities> getHmiZoneCapabilities() {
- return (List<HmiZoneCapabilities>) getObject(HmiZoneCapabilities.class, KEY_HMI_ZONE_CAPABILITIES);
- }
- /**
- * Sets hmiZoneCapabilities
- * @param hmiZoneCapabilities
- */
- public void setHmiZoneCapabilities(List<HmiZoneCapabilities> hmiZoneCapabilities) {
- setParameters(KEY_HMI_ZONE_CAPABILITIES, hmiZoneCapabilities);
- }
-
- /**
- * Gets speechCapabilities set when application interface is registered.
- *
- * @return SpeechCapabilities
- */
- @SuppressWarnings("unchecked")
- public List<SpeechCapabilities> getSpeechCapabilities() {
- Object speechCapabilities = getObject(SpeechCapabilities.class, KEY_SPEECH_CAPABILITIES);
- if (speechCapabilities instanceof List<?>) {
- return (List<SpeechCapabilities>) speechCapabilities;
- } else if (speechCapabilities instanceof SpeechCapabilities) {
- // this is a known issue observed with some core implementations
- List<SpeechCapabilities> newSpeechCapList = new ArrayList<>();
- newSpeechCapList.add((SpeechCapabilities) speechCapabilities);
- return newSpeechCapList;
- }
- return null;
- }
- /**
- * Sets speechCapabilities
- * @param speechCapabilities
- */
- public void setSpeechCapabilities(List<SpeechCapabilities> speechCapabilities) {
- setParameters(KEY_SPEECH_CAPABILITIES, speechCapabilities);
- }
-
-
- @SuppressWarnings("unchecked")
- public List<PrerecordedSpeech> getPrerecordedSpeech() {
- return (List<PrerecordedSpeech>) getObject(PrerecordedSpeech.class, KEY_PRERECORDED_SPEECH);
- }
-
- public void setPrerecordedSpeech(List<PrerecordedSpeech> prerecordedSpeech) {
- setParameters(KEY_PRERECORDED_SPEECH, prerecordedSpeech);
- }
-
-
- /**
- * Gets vrCapabilities set when application interface is registered.
- *
- * @return VrCapabilities
- */
- @SuppressWarnings("unchecked")
- public List<VrCapabilities> getVrCapabilities() {
- return (List<VrCapabilities>) getObject(VrCapabilities.class, KEY_VR_CAPABILITIES);
- }
- /**
- * Sets VrCapabilities
- * @param vrCapabilities
- */
- public void setVrCapabilities(List<VrCapabilities> vrCapabilities) {
- setParameters(KEY_VR_CAPABILITIES, vrCapabilities);
- }
-
- /**
- * Gets getVehicleType set when application interface is registered.
- *
- * @return vehicleType
- */
- @SuppressWarnings("unchecked")
- public VehicleType getVehicleType() {
- return (VehicleType) getObject(VehicleType.class, KEY_VEHICLE_TYPE);
- }
- /**
- * Sets vehicleType
- * @param vehicleType
- */
- public void setVehicleType(VehicleType vehicleType) {
- setParameters(KEY_VEHICLE_TYPE, vehicleType);
- }
-
- /**
- * Gets AudioPassThruCapabilities set when application interface is registered.
- *
- * @return AudioPassThruCapabilities
- */
- @SuppressWarnings("unchecked")
- public List<AudioPassThruCapabilities> getAudioPassThruCapabilities() {
- return (List<AudioPassThruCapabilities>) getObject(AudioPassThruCapabilities.class, KEY_AUDIO_PASS_THRU_CAPABILITIES);
- }
- /**
- * Sets AudioPassThruCapabilities
- * @param audioPassThruCapabilities
- */
- public void setAudioPassThruCapabilities(List<AudioPassThruCapabilities> audioPassThruCapabilities) {
- setParameters(KEY_AUDIO_PASS_THRU_CAPABILITIES, audioPassThruCapabilities);
- }
-
- /**
- * Gets pcmStreamingCapabilities set when application interface is registered.
- *
- * @return pcmStreamingCapabilities
- */
- @SuppressWarnings("unchecked")
- public AudioPassThruCapabilities getPcmStreamingCapabilities() {
- return (AudioPassThruCapabilities) getObject(AudioPassThruCapabilities.class, KEY_PCM_STREAM_CAPABILITIES);
- }
- /**
- * Sets pcmStreamingCapabilities
- * @param pcmStreamingCapabilities
- */
- public void setPcmStreamingCapabilities(AudioPassThruCapabilities pcmStreamingCapabilities) {
- setParameters(KEY_PCM_STREAM_CAPABILITIES, pcmStreamingCapabilities);
- }
- public String getProxyVersionInfo() {
- if (Version.VERSION != null)
- return Version.VERSION;
-
- return null;
- }
- public void setSupportedDiagModes(List<Integer> supportedDiagModes) {
- setParameters(KEY_SUPPORTED_DIAG_MODES, supportedDiagModes);
- }
-
- @SuppressWarnings("unchecked")
- public List<Integer> getSupportedDiagModes() {
- return (List<Integer>) getObject(Integer.class, KEY_SUPPORTED_DIAG_MODES);
- }
-
- public void setHmiCapabilities(HMICapabilities hmiCapabilities) {
- setParameters(KEY_HMI_CAPABILITIES, hmiCapabilities);
- }
-
- @SuppressWarnings("unchecked")
- public HMICapabilities getHmiCapabilities() {
- return (HMICapabilities) getObject(HMICapabilities.class, KEY_HMI_CAPABILITIES);
- }
-
- public void setSdlVersion(String sdlVersion) {
- setParameters(KEY_SDL_VERSION, sdlVersion);
- }
-
- public String getSdlVersion() {
- return getString(KEY_SDL_VERSION);
- }
-
- public void setSystemSoftwareVersion(String systemSoftwareVersion) {
- setParameters(KEY_SYSTEM_SOFTWARE_VERSION, systemSoftwareVersion);
- }
-
- public String getSystemSoftwareVersion() {
- return getString(KEY_SYSTEM_SOFTWARE_VERSION);
- }
-
- /**
- * 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);
- }
-
- /**
- * 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
deleted file mode 100644
index 4c9861101..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-import java.util.List;
-
-public class RemoteControlCapabilities extends RPCStruct {
- public static final String KEY_CLIMATE_CONTROL_CAPABILITIES = "climateControlCapabilities";
- 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() {
- }
-
- public RemoteControlCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets the climateControlCapabilities portion of the RemoteControlCapabilities class
- *
- * @param climateControlCapabilities If included, the platform supports RC climate controls.
- * For this baseline version, maxsize=1. i.e. only one climate control module is supported.
- */
- public void setClimateControlCapabilities(List<ClimateControlCapabilities> climateControlCapabilities) {
- setValue(KEY_CLIMATE_CONTROL_CAPABILITIES, climateControlCapabilities);
- }
-
- /**
- * Gets the climateControlCapabilities portion of the RemoteControlCapabilities class
- *
- * @return List<ClimateControlCapabilities>
- * If included, the platform supports RC climate controls.
- * For this baseline version, maxsize=1. i.e. only one climate control module is supported.
- */
- public List<ClimateControlCapabilities> getClimateControlCapabilities() {
- return (List<ClimateControlCapabilities>) getObject(ClimateControlCapabilities.class, KEY_CLIMATE_CONTROL_CAPABILITIES);
- }
-
- /**
- * Sets the radioControlCapabilities portion of the RemoteControlCapabilities class
- *
- * @param radioControlCapabilities If included, the platform supports RC climate controls.
- * For this baseline version, maxsize=1. i.e. only one radio control module is supported.
- */
- public void setRadioControlCapabilities(List<RadioControlCapabilities> radioControlCapabilities) {
- setValue(KEY_RADIO_CONTROL_CAPABILITIES, radioControlCapabilities);
- }
-
- /**
- * Gets the radioControlCapabilities portion of the RemoteControlCapabilities class
- *
- * @return List<RadioControlCapabilities>
- * If included, the platform supports RC climate controls.
- * For this baseline version, maxsize=1. i.e. only one radio control module is supported.
- */
- public List<RadioControlCapabilities> getRadioControlCapabilities() {
- return (List<RadioControlCapabilities>) getObject(RadioControlCapabilities.class, KEY_RADIO_CONTROL_CAPABILITIES);
- }
-
- /**
- * Sets the buttonCapabilities portion of the RemoteControlCapabilities class
- *
- * @param buttonCapabilities If included, the platform supports RC button controls with the included button names.
- */
- public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
- setValue(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
- }
-
- /**
- * Gets the buttonCapabilities portion of the RemoteControlCapabilities class
- *
- * @return List<ButtonCapabilities>
- * If included, the platform supports RC button controls with the included button names.
- */
- public List<ButtonCapabilities> getButtonCapabilities() {
- return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES);
- }
-
- /**
- * Sets the seatControlCapabilities portion of the RemoteControlCapabilities class
- *
- * @param seatControlCapabilities If included, the platform supports seat controls.
- */
- public void setSeatControlCapabilities(List<SeatControlCapabilities> seatControlCapabilities) {
- setValue(KEY_SEAT_CONTROL_CAPABILITIES, seatControlCapabilities);
- }
-
- /**
- * Gets the seatControlCapabilities portion of the RemoteControlCapabilities class
- *
- * @return List<SeatControlCapabilities>
- * If included, the platform supports seat controls.
- */
- 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/ResetGlobalProperties.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java
deleted file mode 100644
index 2adb03ec1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Resets the passed global properties to their default values as defined by
- * SDL
- * <p></p>
- * The HELPPROMPT global property default value is generated by SDL consists of
- * the first vrCommand of each Command Menu item defined at the moment PTT is
- * pressed
- * <p>The TIMEOUTPROMPT global property default value is the same as the HELPPROMPT
- * global property default value</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>properties</td>
- * <td>GlobalProperty</td>
- * <td>An array of one or more GlobalProperty enumeration elements indicating which global properties to reset to their default value.</td>
- * <td>Y</td>
- * <td>Array must have at least one element.; minsize:1; maxsize:100</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- *
- * </table>
- * <p><b>Response</b></p>
- *
- * <p>Indicates whether the Global Properties were successfully set to their default values.</p>
- *
- * <p><b>Non-default Result Codes:</b></p>
- *
- * <p> SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p> OUT_OF_MEMORY</p>
- * <p> TOO_MANY_PENDING_REQUESTS</p>
- * <p> APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR </p>
- * <p> REJECTED </p>
- * <p>DISALLOWED </p>
- * @since SmartDeviceLink 1.0
- * @see SetGlobalProperties
- */
-public class ResetGlobalProperties extends RPCRequest {
- public static final String KEY_PROPERTIES = "properties";
- /**
- * Constructs a new ResetGlobalProperties object
- */
- public ResetGlobalProperties() {
- super(FunctionID.RESET_GLOBAL_PROPERTIES.toString());
- }
- /**
- * Constructs a new ResetGlobalProperties object indicated by the Hashtable
- * parameter
- *
- * @param hash The Hashtable to use
- */
- public ResetGlobalProperties(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new ResetGlobalProperties object
- * @param properties a List<GlobalProperty> An array of one or more
- * GlobalProperty enumeration elements indicating which global
- * properties to reset to their default value <br>
- * <b>Notes: </b>Array must have at least one element
- */
- public ResetGlobalProperties(@NonNull List<GlobalProperty> properties) {
- this();
- setProperties(properties);
- }
- /**
- * Gets an array of one or more GlobalProperty enumeration elements
- * indicating which global properties to reset to their default value
- *
- * @return List<GlobalProperty> -an array of one or more GlobalProperty
- * enumeration elements
- */
- @SuppressWarnings("unchecked")
- public List<GlobalProperty> getProperties() {
- return (List<GlobalProperty>) getObject(GlobalProperty.class, KEY_PROPERTIES);
- }
- /**
- * Sets an array of one or more GlobalProperty enumeration elements
- * indicating which global properties to reset to their default value
- *
- * @param properties
- * a List<GlobalProperty> An array of one or more
- * GlobalProperty enumeration elements indicating which global
- * properties to reset to their default value
- * <p></p>
- * <b>Notes: </b>Array must have at least one element
- */
- public void setProperties(@NonNull List<GlobalProperty> properties ) {
- setParameters(KEY_PROPERTIES, properties);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java
deleted file mode 100644
index 78f245ea8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalPropertiesResponse.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Reset Global Properties Response is sent, when ResetGlobalProperties has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class ResetGlobalPropertiesResponse extends RPCResponse {
-
- /**
- * Constructs a new ResetGlobalPropertiesResponse object
- */
- public ResetGlobalPropertiesResponse() {
- super(FunctionID.RESET_GLOBAL_PROPERTIES.toString());
- }
-
- /**
- * Constructs a new ResetGlobalPropertiesResponse object indicated by the Hashtable
- * parameter
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public ResetGlobalPropertiesResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new ResetGlobalPropertiesResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public ResetGlobalPropertiesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java
deleted file mode 100644
index e9a3168e7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-/** The resolution of the prescribed screen area.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>resolution</td>
- * <td>ImageResolution</td>
- * <td>The resolution of the prescribed screen area.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * <tr>
- * <td>touchEventAvailable</td>
- * <td>TouchEventCapabilities</td>
- * <td>Types of screen touch events available in screen area.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- *
- * </table>
- * @since SmartDeviceLink 2.3.2
- *
- */
-
-public class ScreenParams extends RPCStruct {
- public static final String KEY_RESOLUTION = "resolution";
- public static final String KEY_TOUCH_EVENT_AVAILABLE = "touchEventAvailable";
- /**
- * Constructs a new ScreenParams object
- */
-
- public ScreenParams() { }
- /**
- * <p>
- * Constructs a new ScreenParamst object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public ScreenParams(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ScreenParams object
- */
-
- public ScreenParams(@NonNull ImageResolution resolution) {
- this();
- setImageResolution(resolution);
- }
-
- @SuppressWarnings("unchecked")
- public ImageResolution getImageResolution() {
- return (ImageResolution) getObject(ImageResolution.class, KEY_RESOLUTION);
- }
- public void setImageResolution( @NonNull ImageResolution resolution ) {
- setValue(KEY_RESOLUTION, resolution);
- }
- @SuppressWarnings("unchecked")
- public TouchEventCapabilities getTouchEventAvailable() {
- return (TouchEventCapabilities) getObject(TouchEventCapabilities.class, KEY_TOUCH_EVENT_AVAILABLE);
- }
- public void setTouchEventAvailable( TouchEventCapabilities touchEventAvailable ) {
- setValue(KEY_TOUCH_EVENT_AVAILABLE, touchEventAvailable);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java
deleted file mode 100644
index 8f249ffe0..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Creates a full screen overlay containing a large block of formatted text that
- * can be scrolled with up to 8 SoftButtons defined
- *
- * <p>Function Group: ScrollableMessage</p>
- *
- * <p><b>HMILevel needs to be FULL</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>scrollableMessageBody</td>
- * <td>String</td>
- * <td>Body of text that can include newlines and tabs.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDevice Link 1.0 </td>
- * </tr>
- * <tr>
- * <td>timeout</td>
- * <td>Integer</td>
- * <td>App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout).</td>
- * <td>N</td>
- * <td>minvalue=1000; maxvalue=65535; defvalue=30000</td>
- * <td>SmartDevice Link 1.0 </td>
- * </tr>
- * <tr>
- * <td>softButtons</td>
- * <td>SoftButton</td>
- * <td>App defined SoftButtons. If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.</td>
- * <td>N</td>
- * <td>minsize=0; maxsize=8</td>
- * <td>SmartDevice Link 1.0 </td>
- * </tr>
- * </table>
- * <p> <b>Response</b></p>
- *<b>Non-default Result Codes:</b>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA </p>
- * <p>OUT_OF_MEMORY</p>
- * <p>CHAR_LIMIT_EXCEEDED</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR </p>
- * <p>DISALLOWED</p>
- * <p>UNSUPPORTED_RESOURCE</p>
- * <p>REJECTED </p>
- * <p>ABORTED</p>
- *
- * @see scrollableMessageBody
- * @see TextFieldName
- */
-public class ScrollableMessage extends RPCRequest {
- public static final String KEY_SCROLLABLE_MESSAGE_BODY = "scrollableMessageBody";
- public static final String KEY_TIMEOUT = "timeout";
- public static final String KEY_SOFT_BUTTONS = "softButtons";
-
- /**
- * Constructs a new ScrollableMessage object
- */
- public ScrollableMessage() {
- super(FunctionID.SCROLLABLE_MESSAGE.toString());
- }
-
- /**
- * Constructs a new ScrollableMessage object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash The Hashtable to use
- */
- public ScrollableMessage(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ScrollableMessage object
- * @param scrollableMessageBody a String value representing the Body of text that can include newlines and tabs <br>
- * <b>Notes: </b>Maxlength=500
- */
- public ScrollableMessage(@NonNull String scrollableMessageBody) {
- this();
- setScrollableMessageBody(scrollableMessageBody);
- }
-
- /**
- * Sets a Body of text that can include newlines and tabs
- *
- * @param scrollableMessageBody
- * a String value representing the Body of text that can include
- * newlines and tabs
- * <p></p>
- * <b>Notes: </b>Maxlength=500
- */
- public void setScrollableMessageBody(@NonNull String scrollableMessageBody) {
- setParameters(KEY_SCROLLABLE_MESSAGE_BODY, scrollableMessageBody);
- }
-
- /**
- * Gets a Body of text that can include newlines and tabs
- *
- * @return String -a String value
- */
- public String getScrollableMessageBody() {
- return getString(KEY_SCROLLABLE_MESSAGE_BODY);
- }
-
- /**
- * Sets an App defined timeout. Indicates how long of a timeout from the
- * last action
- *
- * @param timeout
- * an Integer value representing an App defined timeout
- * <p></p>
- * <b>Notes</b>:Minval=0; Maxval=65535;Default=30000
- */
- public void setTimeout(Integer timeout) {
- setParameters(KEY_TIMEOUT, timeout);
- }
-
- /**
- * Gets an App defined timeout
- *
- * @return Integer -an Integer value representing an App defined timeout
- */
- public Integer getTimeout() {
- return getInteger(KEY_TIMEOUT);
- }
-
- /**
- * Sets App defined SoftButtons.If omitted on supported displays, only the
- * system defined "Close" SoftButton will be displayed
- *
- * @param softButtons
- * a List<SoftButton> value representing App defined
- * SoftButtons
- * <p></p>
- * <b>Notes: </b>Minsize=0, Maxsize=8
- */
- public void setSoftButtons(List<SoftButton> softButtons) {
- setParameters(KEY_SOFT_BUTTONS, softButtons);
- }
-
- /**
- * Gets App defined soft button
- * @return List -List<SoftButton> value
- */
- @SuppressWarnings("unchecked")
- public List<SoftButton> getSoftButtons() {
- return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java
deleted file mode 100644
index 2113e3095..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessageResponse.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Scrollable Message Response is sent, when ScrollableMessage has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class ScrollableMessageResponse extends RPCResponse {
-
- /**
- * Constructs a new ScrollableMessageResponse object
- */
- public ScrollableMessageResponse() {
- super(FunctionID.SCROLLABLE_MESSAGE.toString());
- }
-
- /**
- * Constructs a new ScrollableMessageResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public ScrollableMessageResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new ScrollableMessageResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public ScrollableMessageResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
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
deleted file mode 100644
index 3e1637e22..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/**
- * Specifies the version number of the SDL V4 interface. This is used by both the application and SDL to declare what interface version each is using.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>majorVersion</td>
- * <td>Integer</td>
- * <td>
- * <ul>
- * <li>minvalue="1"</li>
- * <li>maxvalue="10"</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>minorVersion</td>
- * <td>Integer</td>
- * <td>
- * <ul>
- * <li>minvalue="0"</li>
- * <li>maxvalue="1000"</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- */
-public class SdlMsgVersion extends RPCStruct {
- public static final String KEY_MAJOR_VERSION = "majorVersion";
- public static final String KEY_MINOR_VERSION = "minorVersion";
- public static final String KEY_PATCH_VERSION = "patchVersion";
-
- /**
- * Constructs a newly allocated SdlMsgVersion object
- */
- public SdlMsgVersion() { }
- /**
- * Constructs a newly allocated SdlMsgVersion object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public SdlMsgVersion(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Get major version
- * <ul>
- * <li>minvalue="1"</li>
- * <li>maxvalue="10"</li>
- * </ul>
- * @return the major version
- */
- /**
- * Constructs a newly allocated SdlMsgVersion object
- * @param majorVersion minvalue="1" and maxvalue="10"
- * @param minorVersion min: 0; max: 1000
- */
- public SdlMsgVersion(@NonNull Integer majorVersion, @NonNull Integer minorVersion) {
- 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 );
- }
- /**
- * Set major version
- * <ul>
- * <li>minvalue="1"</li>
- * <li>maxvalue="10"</li>
- * </ul>
- * @param majorVersion minvalue="1" and maxvalue="10"
- */
- public void setMajorVersion( @NonNull Integer majorVersion ) {
- setValue(KEY_MAJOR_VERSION, majorVersion);
- }
- /**
- * Get minor version
- * <ul>
- * <li>minvalue="0"</li>
- * <li>maxvalue="1000"</li>
- * </ul>
- * @return the minor version
- */
- public Integer getMinorVersion() {
- return getInteger( KEY_MINOR_VERSION );
- }
- /**
- * Set minor version
- * <ul>
- * <li>minvalue="0"</li>
- * <li>maxvalue="1000"</li>
- * </ul>
- * @param minorVersion min: 0; max: 1000
- */
- public void setMinorVersion( @NonNull Integer minorVersion ) {
- setValue(KEY_MINOR_VERSION, minorVersion);
- }
-
- /**
- * Get patch version
- * <ul>
- * <li>minvalue="0"</li>
- * <li>maxvalue="1000"</li>
- * </ul>
- * @return the patch version
- */
- public Integer getPatchVersion() {
- return getInteger( KEY_PATCH_VERSION );
- }
- /**
- * Set patch version
- * <ul>
- * <li>minvalue="0"</li>
- * <li>maxvalue="1000"</li>
- * </ul>
- * @param patchVersion min: 0; max: 1000
- */
- public void setPatchVersion( Integer patchVersion ) {
- setValue(KEY_PATCH_VERSION, patchVersion);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java
deleted file mode 100644
index e1d488cb5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java
+++ /dev/null
@@ -1,339 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-public class SeatControlCapabilities extends RPCStruct {
- public static final String KEY_MODULE_NAME = "moduleName";
- public static final String KEY_HEATING_ENABLED_AVAILABLE = "heatingEnabledAvailable";
- public static final String KEY_COOLING_ENABLED_AVAILABLE = "coolingEnabledAvailable";
- public static final String KEY_HEATING_LEVEL_AVAILABLE = "heatingLevelAvailable";
- public static final String KEY_COOLING_LEVEL_AVAILABLE = "coolingLevelAvailable";
- public static final String KEY_HORIZONTAL_POSITION_AVAILABLE = "horizontalPositionAvailable";
- public static final String KEY_VERTICAL_POSITION_AVAILABLE = "verticalPositionAvailable";
- public static final String KEY_FRONT_VERTICAL_POSITION_AVAILABLE = "frontVerticalPositionAvailable";
- public static final String KEY_BACK_VERTICAL_POSITION_AVAILABLE = "backVerticalPositionAvailable";
- public static final String KEY_BACK_TILT_ANGLE_AVAILABLE = "backTiltAngleAvailable";
- public static final String KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE = "headSupportHorizontalPositionAvailable";
- public static final String KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE = "headSupportVerticalPositionAvailable";
- public static final String KEY_MASSAGE_ENABLED_AVAILABLE = "massageEnabledAvailable";
- public static final String KEY_MASSAGE_MODE_AVAILABLE = "massageModeAvailable";
- public static final String KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE = "massageCushionFirmnessAvailable";
- public static final String KEY_MEMORY_AVAILABLE = "memoryAvailable";
-
- /**
- * Constructs a new SeatControlCapabilities object
- */
- public SeatControlCapabilities() {
- }
-
- /**
- * <p>Constructs a new SeatControlCapabilities object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash The Hashtable to use
- */
- public SeatControlCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated SeatControlCapabilities object
- * @param moduleName short friendly name of the light control module.
- */
- public SeatControlCapabilities(@NonNull String moduleName) {
- this();
- setModuleName(moduleName);
- }
-
- /**
- * Get the moduleName portion of the SeatControlCapabilities class
- *
- * @return String
- */
- public String getModuleName() {
- return getString(KEY_MODULE_NAME);
- }
-
- /**
- * Sets the moduleName portion of the SeatControlCapabilities 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);
- }
-
- /**
- * Sets the heatingEnabledAvailable portion of the SeatControlCapabilities class
- *
- * @param heatingEnabledAvailable
- */
- public void setHeatingEnabledAvailable(Boolean heatingEnabledAvailable) {
- setValue(KEY_HEATING_ENABLED_AVAILABLE, heatingEnabledAvailable);
- }
-
- /**
- * Gets the heatingEnabledAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getHeatingEnabledAvailable() {
- return getBoolean(KEY_HEATING_ENABLED_AVAILABLE);
- }
-
- /**
- * Sets the coolingEnabledAvailable portion of the SeatControlCapabilities class
- *
- * @param coolingEnabledAvailable
- */
- public void setCoolingEnabledAvailable(Boolean coolingEnabledAvailable) {
- setValue(KEY_COOLING_ENABLED_AVAILABLE, coolingEnabledAvailable);
- }
-
- /**
- * Gets the coolingEnabledAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getCoolingEnabledAvailable() {
- return getBoolean(KEY_COOLING_ENABLED_AVAILABLE);
- }
-
- /**
- * Sets the heatingLevelAvailable portion of the SeatControlCapabilities class
- *
- * @param heatingLevelAvailable
- */
- public void setHeatingLevelAvailable(Boolean heatingLevelAvailable) {
- setValue(KEY_HEATING_LEVEL_AVAILABLE, heatingLevelAvailable);
- }
-
- /**
- * Gets the heatingLevelAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getHeatingLevelAvailable() {
- return getBoolean(KEY_HEATING_LEVEL_AVAILABLE);
- }
-
- /**
- * Sets the coolingLevelAvailable portion of the SeatControlCapabilities class
- *
- * @param coolingLevelAvailable
- */
- public void setCoolingLevelAvailable(Boolean coolingLevelAvailable) {
- setValue(KEY_COOLING_LEVEL_AVAILABLE, coolingLevelAvailable);
- }
-
- /**
- * Gets the coolingLevelAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getCoolingLevelAvailable() {
- return getBoolean(KEY_COOLING_LEVEL_AVAILABLE);
- }
-
- /**
- * Sets the horizontalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @param horizontalPositionAvailable
- */
- public void setHorizontalPositionAvailable(Boolean horizontalPositionAvailable) {
- setValue(KEY_HORIZONTAL_POSITION_AVAILABLE, horizontalPositionAvailable);
- }
-
- /**
- * Gets the horizontalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getHorizontalPositionAvailable() {
- return getBoolean(KEY_HORIZONTAL_POSITION_AVAILABLE);
- }
-
- /**
- * Sets the verticalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @param verticalPositionAvailable
- */
- public void setVerticalPositionAvailable(Boolean verticalPositionAvailable) {
- setValue(KEY_VERTICAL_POSITION_AVAILABLE, verticalPositionAvailable);
- }
-
- /**
- * Gets the verticalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getVerticalPositionAvailable() {
- return getBoolean(KEY_VERTICAL_POSITION_AVAILABLE);
- }
-
- /**
- * Sets the frontVerticalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @param frontVerticalPositionAvailable
- */
- public void setFrontVerticalPositionAvailable(Boolean frontVerticalPositionAvailable) {
- setValue(KEY_FRONT_VERTICAL_POSITION_AVAILABLE, frontVerticalPositionAvailable);
- }
-
- /**
- * Gets the frontVerticalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getFrontVerticalPositionAvailable() {
- return getBoolean(KEY_FRONT_VERTICAL_POSITION_AVAILABLE);
- }
-
- /**
- * Sets the backVerticalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @param backVerticalPositionAvailable
- */
- public void setBackVerticalPositionAvailable(Boolean backVerticalPositionAvailable) {
- setValue(KEY_BACK_VERTICAL_POSITION_AVAILABLE, backVerticalPositionAvailable);
- }
-
- /**
- * Gets the backVerticalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getBackVerticalPositionAvailable() {
- return getBoolean(KEY_BACK_VERTICAL_POSITION_AVAILABLE);
- }
-
- /**
- * Sets the backTiltAngleAvailable portion of the SeatControlCapabilities class
- *
- * @param backTiltAngleAvailable
- */
- public void setBackTiltAngleAvailable(Boolean backTiltAngleAvailable) {
- setValue(KEY_BACK_TILT_ANGLE_AVAILABLE, backTiltAngleAvailable);
- }
-
- /**
- * Gets the backTiltAngleAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getBackTiltAngleAvailable() {
- return getBoolean(KEY_BACK_TILT_ANGLE_AVAILABLE);
- }
-
- /**
- * Sets the headSupportHorizontalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @param headSupportHorizontalPositionAvailable
- */
- public void setHeadSupportHorizontalPositionAvailable(Boolean headSupportHorizontalPositionAvailable) {
- setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE, headSupportHorizontalPositionAvailable);
- }
-
- /**
- * Gets the headSupportHorizontalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getHeadSupportHorizontalPositionAvailable() {
- return getBoolean(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE);
- }
-
- /**
- * Sets the headSupportVerticalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @param headSupportVerticalPositionAvailable
- */
- public void setHeadSupportVerticalPositionAvailable(Boolean headSupportVerticalPositionAvailable) {
- setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE, headSupportVerticalPositionAvailable);
- }
-
- /**
- * Gets the headSupportVerticalPositionAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getHeadSupportVerticalPositionAvailable() {
- return getBoolean(KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE);
- }
-
- /**
- * Sets the massageEnabledAvailable portion of the SeatControlCapabilities class
- *
- * @param massageEnabledAvailable
- */
- public void setMassageEnabledAvailable(Boolean massageEnabledAvailable) {
- setValue(KEY_MASSAGE_ENABLED_AVAILABLE, massageEnabledAvailable);
- }
-
- /**
- * Gets the massageEnabledAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getMassageEnabledAvailable() {
- return getBoolean(KEY_MASSAGE_ENABLED_AVAILABLE);
- }
-
- /**
- * Sets the massageModeAvailable portion of the SeatControlCapabilities class
- *
- * @param massageModeAvailable
- */
- public void setMassageModeAvailable(Boolean massageModeAvailable) {
- setValue(KEY_MASSAGE_MODE_AVAILABLE, massageModeAvailable);
- }
-
- /**
- * Gets the massageModeAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getMassageModeAvailable() {
- return getBoolean(KEY_MASSAGE_MODE_AVAILABLE);
- }
-
- /**
- * Sets the massageCushionFirmnessAvailable portion of the SeatControlCapabilities class
- *
- * @param massageCushionFirmnessAvailable
- */
- public void setMassageCushionFirmnessAvailable(Boolean massageCushionFirmnessAvailable) {
- setValue(KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE, massageCushionFirmnessAvailable);
- }
-
- /**
- * Gets the massageCushionFirmnessAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getMassageCushionFirmnessAvailable() {
- return getBoolean(KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE);
- }
-
- /**
- * Sets the memoryAvailable portion of the SeatControlCapabilities class
- *
- * @param memoryAvailable
- */
- public void setMemoryAvailable(Boolean memoryAvailable) {
- setValue(KEY_MEMORY_AVAILABLE, memoryAvailable);
- }
-
- /**
- * Gets the memoryAvailable portion of the SeatControlCapabilities class
- *
- * @return Boolean.
- */
- public Boolean getMemoryAvailable() {
- return getBoolean(KEY_MEMORY_AVAILABLE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java
deleted file mode 100644
index 26d52d713..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java
+++ /dev/null
@@ -1,347 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.SupportedSeat;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Seat control data corresponds to "SEAT" ModuleType.
- */
-public class SeatControlData extends RPCStruct {
- public static final String KEY_ID = "id";
- public static final String KEY_HEATING_ENABLED = "heatingEnabled";
- public static final String KEY_COOLING_ENABLED = "coolingEnabled";
- public static final String KEY_HEATING_LEVEL = "heatingLevel";
- public static final String KEY_COOLING_LEVEL = "coolingLevel";
- public static final String KEY_HORIZONTAL_POSITION = "horizontalPosition";
- public static final String KEY_VERTICAL_POSITION = "verticalPosition";
- public static final String KEY_FRONT_VERTICAL_POSITION = "frontVerticalPosition";
- public static final String KEY_BACK_VERTICAL_POSITION = "backVerticalPosition";
- public static final String KEY_BACK_TILT_ANGLE = "backTiltAngle";
- public static final String KEY_HEAD_SUPPORT_HORIZONTAL_POSITION = "headSupportHorizontalPosition";
- public static final String KEY_HEAD_SUPPORT_VERTICAL_POSITION = "headSupportVerticalPosition";
- public static final String KEY_MASSAGE_ENABLED = "massageEnabled";
- public static final String KEY_MASSAGE_MODE = "massageMode";
- public static final String KEY_MASSAGE_CUSHION_FIRMNESS = "massageCushionFirmness";
- public static final String KEY_MEMORY = "memory";
-
- /**
- * Constructs a new SeatControlData object
- */
- public SeatControlData() {
- }
-
- /**
- * <p>Constructs a new SeatControlData object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash The Hashtable to use
- */
- public SeatControlData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated SeatControlData object
- * @param id type of SupportedSeat.
- */
- public SeatControlData(@NonNull SupportedSeat id) {
- this();
- setId(id);
- }
-
- /**
- * Sets the id portion of the SeatControlData class
- *
- * @param id
- */
- public void setId(@NonNull SupportedSeat id) {
- setValue(KEY_ID, id);
- }
-
- /**
- * Gets the id portion of the SeatControlData class
- *
- * @return SupportedSeat.
- */
- public SupportedSeat getId() {
- return (SupportedSeat) getObject(SupportedSeat.class, KEY_ID);
- }
-
- /**
- * Sets the heatingEnabled portion of the SeatControlData class
- *
- * @param heatingEnabled
- */
- public void setHeatingEnabled(Boolean heatingEnabled) {
- setValue(KEY_HEATING_ENABLED, heatingEnabled);
- }
-
- /**
- * Gets the heatingEnabled portion of the SeatControlData class
- *
- * @return Boolean.
- */
- public Boolean getHeatingEnabled() {
- return getBoolean(KEY_HEATING_ENABLED);
- }
-
- /**
- * Sets the coolingEnabled portion of the SeatControlData class
- *
- * @param coolingEnabled
- */
- public void setCoolingEnabled(Boolean coolingEnabled) {
- setValue(KEY_COOLING_ENABLED, coolingEnabled);
- }
-
- /**
- * Gets the coolingEnabled portion of the SeatControlData class
- *
- * @return Boolean.
- */
- public Boolean getCoolingEnabled() {
- return getBoolean(KEY_COOLING_ENABLED);
- }
-
- /**
- * Sets the heatingLevel portion of the SeatControlData class
- *
- * @param heatingLevel
- */
- public void setHeatingLevel(Integer heatingLevel) {
- setValue(KEY_HEATING_LEVEL, heatingLevel);
- }
-
- /**
- * Gets the heatingLevel portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getHeatingLevel() {
- return getInteger(KEY_HEATING_LEVEL);
- }
-
- /**
- * Sets the coolingLevel portion of the SeatControlData class
- *
- * @param coolingLevel
- */
- public void setCoolingLevel(Integer coolingLevel) {
- setValue(KEY_COOLING_LEVEL, coolingLevel);
- }
-
- /**
- * Gets the coolingLevel portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getCoolingLevel() {
- return getInteger(KEY_COOLING_LEVEL);
- }
-
- /**
- * Sets the horizontalPosition portion of the SeatControlData class
- *
- * @param horizontalPosition
- */
- public void setHorizontalPosition(Integer horizontalPosition) {
- setValue(KEY_HORIZONTAL_POSITION, horizontalPosition);
- }
-
- /**
- * Gets the horizontalPosition portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getHorizontalPosition() {
- return getInteger(KEY_HORIZONTAL_POSITION);
- }
-
- /**
- * Sets the verticalPosition portion of the SeatControlData class
- *
- * @param verticalPosition
- */
- public void setVerticalPosition(Integer verticalPosition) {
- setValue(KEY_VERTICAL_POSITION, verticalPosition);
- }
-
- /**
- * Gets the verticalPosition portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getVerticalPosition() {
- return getInteger(KEY_VERTICAL_POSITION);
- }
-
- /**
- * Sets the frontVerticalPosition portion of the SeatControlData class
- *
- * @param frontVerticalPosition
- */
- public void setFrontVerticalPosition(Integer frontVerticalPosition) {
- setValue(KEY_FRONT_VERTICAL_POSITION, frontVerticalPosition);
- }
-
- /**
- * Gets the frontVerticalPosition portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getFrontVerticalPosition() {
- return getInteger(KEY_FRONT_VERTICAL_POSITION);
- }
-
- /**
- * Sets the backVerticalPosition portion of the SeatControlData class
- *
- * @param backVerticalPosition
- */
- public void setBackVerticalPosition(Integer backVerticalPosition) {
- setValue(KEY_BACK_VERTICAL_POSITION, backVerticalPosition);
- }
-
- /**
- * Gets the backVerticalPosition portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getBackVerticalPosition() {
- return getInteger(KEY_BACK_VERTICAL_POSITION);
- }
-
- /**
- * Sets the backTiltAngle portion of the SeatControlData class
- *
- * @param backTiltAngle
- */
- public void setBackTiltAngle(Integer backTiltAngle) {
- setValue(KEY_BACK_TILT_ANGLE, backTiltAngle);
- }
-
- /**
- * Gets the backTiltAngle portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getBackTiltAngle() {
- return getInteger(KEY_BACK_TILT_ANGLE);
- }
-
- /**
- * Sets the headSupportHorizontalPosition portion of the SeatControlData class
- *
- * @param headSupportHorizontalPosition
- */
- public void setHeadSupportHorizontalPosition(Integer headSupportHorizontalPosition) {
- setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION, headSupportHorizontalPosition);
- }
-
- /**
- * Gets the headSupportHorizontalPosition portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getHeadSupportHorizontalPosition() {
- return getInteger(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION);
- }
-
- /**
- * Sets the headSupportVerticalPosition portion of the SeatControlData class
- *
- * @param headSupportVerticalPosition
- */
- public void setHeadSupportVerticalPosition(Integer headSupportVerticalPosition) {
- setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION, headSupportVerticalPosition);
- }
-
- /**
- * Gets the headSupportVerticalPosition portion of the SeatControlData class
- *
- * @return Integer
- */
- public Integer getHeadSupportVerticalPosition() {
- return getInteger(KEY_HEAD_SUPPORT_VERTICAL_POSITION);
- }
-
- /**
- * Sets the massageEnabled portion of the SeatControlData class
- *
- * @param massageEnabled
- */
- public void setMassageEnabled(Boolean massageEnabled) {
- setValue(KEY_MASSAGE_ENABLED, massageEnabled);
- }
-
- /**
- * Gets the massageEnabled portion of the SeatControlData class
- *
- * @return Boolean.
- */
- public Boolean getMassageEnabled() {
- return getBoolean(KEY_MASSAGE_ENABLED);
- }
-
- /**
- * Gets the List<MassageModeData> portion of the SeatControlData class
- *
- * @return List<MassageModeData>.
- */
- @SuppressWarnings("unchecked")
- public List<MassageModeData> getMassageMode() {
- return (List<MassageModeData>) getObject(MassageModeData.class, KEY_MASSAGE_MODE);
- }
-
- /**
- * Sets the massageMode portion of the SeatControlData class
- *
- * @param massageMode
- */
- public void setMassageMode(List<MassageModeData> massageMode) {
- setValue(KEY_MASSAGE_MODE, massageMode);
- }
-
- /**
- * Gets the List<MassageCushionFirmness> portion of the SeatControlData class
- *
- * @return List<MassageCushionFirmness>.
- */
- @SuppressWarnings("unchecked")
- public List<MassageCushionFirmness> getMassageCushionFirmness() {
- return (List<MassageCushionFirmness>) getObject(MassageCushionFirmness.class, KEY_MASSAGE_CUSHION_FIRMNESS);
- }
-
- /**
- * Sets the massageCushionFirmness portion of the SeatControlData class
- *
- * @param massageCushionFirmness
- */
- public void setMassageCushionFirmness(List<MassageCushionFirmness> massageCushionFirmness) {
- setValue(KEY_MASSAGE_CUSHION_FIRMNESS, massageCushionFirmness);
- }
-
- /**
- * Sets the memory portion of the SeatControlData class
- *
- * @param memory
- */
- public void setMemory(SeatMemoryAction memory) {
- setValue(KEY_MEMORY, memory);
- }
-
- /**
- * Gets the memory portion of the SeatControlData class
- *
- * @return SeatMemoryAction.
- */
- @SuppressWarnings("unchecked")
- public SeatMemoryAction getMemory() {
- return (SeatMemoryAction) getObject(SeatMemoryAction.class, KEY_MEMORY);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java
deleted file mode 100644
index a8673a9eb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType;
-
-import java.util.Hashtable;
-
-public class SeatMemoryAction extends RPCStruct {
- public static final String KEY_ID = "id";
- public static final String KEY_LABEL = "label";
- public static final String KEY_ACTION = "action";
-
- /**
- * Constructs a new SeatMemoryAction object
- */
- public SeatMemoryAction() {
- }
-
- /**
- * <p>Constructs a new SeatMemoryAction object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash The Hashtable to use
- */
- public SeatMemoryAction(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated SeatMemoryAction object
- * @param id Min: 0 Max: 10
- * @param action type of SeatMemoryActionType.
- */
- public SeatMemoryAction(@NonNull Integer id, @NonNull SeatMemoryActionType action) {
- this();
- setId(id);
- setAction(action);
- }
-
- /**
- * Sets the id portion of the SeatMemoryAction class
- *
- * @param id
- */
- public void setId(@NonNull Integer id) {
- setValue(KEY_ID, id);
- }
-
- /**
- * Gets the id portion of the SeatMemoryAction class
- *
- * @return Integer
- */
- public Integer getId() {
- return getInteger(KEY_ID);
- }
-
- /**
- * Sets the label portion of the SeatMemoryAction class
- *
- * @param label
- */
- public void setLabel(String label) {
- setValue(KEY_LABEL, label);
- }
-
- /**
- * Gets the label portion of the SeatMemoryAction class
- *
- * @return String
- */
- public String getLabel() {
- return getString(KEY_LABEL);
- }
-
- /**
- * Sets the action portion of the SeatMemoryAction class
- *
- * @param action
- */
- public void setAction(@NonNull SeatMemoryActionType action) {
- setValue(KEY_ACTION, action);
- }
-
- /**
- * Gets the action portion of the SeatMemoryAction class
- *
- * @return SeatMemoryActionType.
- */
- public SeatMemoryActionType getAction() {
- return (SeatMemoryActionType) getObject(SeatMemoryActionType.class, KEY_ACTION);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java
deleted file mode 100644
index a93fd2b98..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/*
- * Copyright (c) 2017 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * Request to describe UI elements boundaries to a connected modules.
- * @since SmartDeviceLink 4.5.0
- */
-public class SendHapticData extends RPCRequest {
-
- public static final String KEY_HAPTIC_RECT_DATA = "hapticRectData";
-
- /**
- * Constructs a new SendHapticData object
- */
- public SendHapticData(){
- super(FunctionID.SEND_HAPTIC_DATA.toString());
- }
-
- /**
- * <p>
- * Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI.
- * This data will be utilized by the HMI to determine how and when haptic events should occur
- * </p>
- *
- * @param hash The Hashtable to use
- */
- public SendHapticData(Hashtable<String, Object> hash){
- super(hash);
- }
-
- /**
- * Array of spatial data structures that represent the locations of all user controls present on the app's layout.
- * This data should be updated if/when the application presents a new screen.
- * When a request is sent, if successful, it will replace all spatial data previously sent through RPC.
- * If an empty array is sent, the existing spatial data will be cleared
- */
- public void setHapticRectData(List<HapticRect> hapticRectData) {
- setParameters(KEY_HAPTIC_RECT_DATA, hapticRectData);
- }
-
- @SuppressWarnings("unchecked")
- /**
- * @return array of spatial data structures that represent the locations of all user controls present on the app's layout.
- */
- public List<HapticRect> getHapticRectData() {
- return (List<HapticRect>) getObject(HapticRect.class, KEY_HAPTIC_RECT_DATA);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java
deleted file mode 100644
index c25f57648..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java
+++ /dev/null
@@ -1,203 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.DeliveryMode;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import java.util.Hashtable;
-import java.util.List;
-
-
-/**
- * Sends a location to the head-unit to display on a map or list.
- *
- * @since SmartDeviceLink 3.0
- *
- */
-public class SendLocation extends RPCRequest{
-
- public static final String KEY_LAT_DEGREES = "latitudeDegrees";
- public static final String KEY_LON_DEGREES = "longitudeDegrees";
- public static final String KEY_LOCATION_NAME = "locationName";
- public static final String KEY_LOCATION_DESCRIPTION = "locationDescription";
- public static final String KEY_PHONE_NUMBER = "phoneNumber";
- public static final String KEY_ADDRESS_LINES = "addressLines";
- public static final String KEY_LOCATION_IMAGE = "locationImage";
- public static final String KEY_DELIVERY_MODE = "deliveryMode";
- public static final String KEY_TIME_STAMP = "timeStamp";
- public static final String KEY_ADDRESS = "address";
-
- /**
- * Constructs a new SendLocation object
- */
- public SendLocation(){
- super(FunctionID.SEND_LOCATION.toString());
- }
-
- /**
- * <p>
- * Constructs a new SendLocation object indicated by the Hashtable parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public SendLocation(Hashtable<String, Object> hash){
- super(hash);
- }
-
- /**
- * Getter for longitude of the location to send.
- *
- * <p><b>IMPORTANT NOTE:</b> </p><p>A previous version of this method call returned a Float
- * value, however, it has been changed to return a Double.</p> This will compile,
- * but cause a ClassCastException if your value is not also a Double type.
- * @since SmartDeviceLink v4.0
- *
- * @return The longitude of the location
- */
- public Double getLongitudeDegrees(){
- Object value = getParameters(KEY_LON_DEGREES);
- return SdlDataTypeConverter.objectToDouble(value);
- }
-
- /**
- * Setter for longitude of the location to send.
- * @param longitudeDegrees
- */
- public void setLongitudeDegrees(Double longitudeDegrees){
- setParameters(KEY_LON_DEGREES, longitudeDegrees);
- }
-
- /**
- * Getter for latitude of the location to send.
- *
- * <p><b>IMPORTANT NOTE:</b> </p><p>A previous version of this method call returned a Float
- * value, however, it has been changed to return a Double.</p> This will compile,
- * but cause a ClassCastException if your value is not also a Double type.
- * @since SmartDeviceLink v4.0
- *
- * @return The latitude of the location
- */
- public Double getLatitudeDegrees(){
- Object value = getParameters(KEY_LAT_DEGREES);
- return SdlDataTypeConverter.objectToDouble(value);
- }
-
- /**
- * Setter for latitude of the location to send.
- * @param latitudeDegrees
- */
- public void setLatitudeDegrees(Double latitudeDegrees){
- setParameters(KEY_LAT_DEGREES, latitudeDegrees);
- }
-
- /**
- * Getter for name of the location to send.
- * @return The name of the location
- */
- public String getLocationName(){
- return getString(KEY_LOCATION_NAME);
- }
-
- /**
- * Setter for name of the location to send.
- * @param locationName The name of the location
- */
- public void setLocationName(String locationName){
- setParameters(KEY_LOCATION_NAME, locationName);
- }
-
- /**
- * Getter for description of the location to send.
- * @return The description of the location to send
- */
- public String getLocationDescription(){
- return getString(KEY_LOCATION_DESCRIPTION);
- }
-
- /**
- * Setter for description of the location to send.
- * @param locationDescription The description of the location
- */
- public void setLocationDescription(String locationDescription){
- setParameters(KEY_LOCATION_DESCRIPTION, locationDescription);
- }
-
- /**
- * Getter for phone number of the location to send.
- * @return
- */
- public String getPhoneNumber(){
- return getString(KEY_PHONE_NUMBER);
- }
-
- /**
- * Setter for phone number of the location to send.
- * @param phoneNumber The phone number of the location
- */
- public void setPhoneNumber(String phoneNumber){
- setParameters(KEY_PHONE_NUMBER, phoneNumber);
- }
-
- /**
- * Getter for address lines of the location to send.
- * @return The address lines of the location
- */
- @SuppressWarnings("unchecked")
- public List<String> getAddressLines(){
- return (List<String>) getObject(String.class, KEY_ADDRESS_LINES);
- }
-
- /**
- * Setter for address lines of the location to send.
- * @param addressLines The address lines of the location
- */
- public void setAddressLines(List<String> addressLines){
- setParameters(KEY_ADDRESS_LINES, addressLines);
- }
-
- /**
- * Getter for image of the location to send.
- * @return The image of the location to send
- */
- @SuppressWarnings("unchecked")
- public Image getLocationImage(){
- return (Image) getObject(Image.class, KEY_LOCATION_IMAGE);
- }
-
- /**
- * Setter for image of the location to send.
- * @param locationImage The image of the location to send
- */
- public void setLocationImage(Image locationImage){
- setParameters(KEY_LOCATION_IMAGE, locationImage);
- }
-
- public DeliveryMode getDeliveryMode() {
- return (DeliveryMode) getObject(DeliveryMode.class, KEY_DELIVERY_MODE);
- }
-
- public void setDeliveryMode(DeliveryMode deliveryMode) {
- setParameters(KEY_DELIVERY_MODE, deliveryMode);
- }
-
- @SuppressWarnings("unchecked")
- public DateTime getTimeStamp() {
- return (DateTime) getObject(DateTime.class, KEY_TIME_STAMP);
- }
-
- public void setTimeStamp(DateTime timeStamp) {
- setParameters(KEY_TIME_STAMP, timeStamp);
- }
-
- @SuppressWarnings("unchecked")
- public OasisAddress getAddress() {
- return (OasisAddress) getObject(OasisAddress.class, KEY_ADDRESS);
- }
-
- public void setAddress(OasisAddress address) {
- setParameters(KEY_ADDRESS, address);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java
deleted file mode 100644
index dc1193a8b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SendLocationResponse.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Add SendLocation Response is sent, when SendLocation has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class SendLocationResponse extends RPCResponse{
-
- public SendLocationResponse(){
- super(FunctionID.SEND_LOCATION.toString());
- }
-
- public SendLocationResponse(Hashtable<String, Object> hash){
- super(hash);
- }
-
- /**
- * Constructs a new SendLocationResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SendLocationResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java
deleted file mode 100644
index 02ee081c2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Used to set existing local file on SDL as the app's icon. Not supported on
- * first generation SDL vehicles
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>SDLFileName</td>
- * <td>String</td>
- * <td>File reference name.</td>
- * <td>Y</td>
- * <td>Maxlength=500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * </table>
- *
- *<p><b>Response </b></p>
- *<p><b> Non-default Result Codes: </b></p>
- *<p>SUCCESS</p>
- * <p> INVALID_DATA</p>
- * <p> OUT_OF_MEMORY</p>
- * <p> TOO_MANY_PENDING_REQUESTS</p>
- * <p> APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p> REJECTED</p>
- *
- * @since SmartDeviceLink 2.0
- * @see Image
- */
-public class SetAppIcon extends RPCRequest {
- public static final String KEY_SDL_FILE_NAME = "syncFileName";
-
- /**
- * Constructs a new SetAppIcon object
- */
- public SetAppIcon() {
- super(FunctionID.SET_APP_ICON.toString());
- }
-
- /**
- * Constructs a new SetAppIcon object indicated by the Hashtable parameter
- * <p></p>
- *
- * @param hash The Hashtable to use
- */
- public SetAppIcon(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SetAppIcon object
- * @param sdlFileName a String value representing a file reference name <br>
- * <b>Notes: </b>Maxlength=500, however the max file name length may vary based on remote filesystem limitations
- */
- public SetAppIcon(@NonNull String sdlFileName) {
- this();
- setSdlFileName(sdlFileName);
- }
-
- /**
- * Sets a file reference name
- *
- * @param sdlFileName
- * a String value representing a file reference name
- * <p></p>
- * <b>Notes: </b>Maxlength=500, however the max file name length may vary based on remote filesystem limitations
- */
- public void setSdlFileName(@NonNull String sdlFileName) {
- setParameters(KEY_SDL_FILE_NAME, sdlFileName);
- }
-
- /**
- * Gets a file reference name
- * @return String -a String value
- */
- public String getSdlFileName() {
- return getString(KEY_SDL_FILE_NAME);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java
deleted file mode 100644
index 45e6ff180..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIconResponse.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Set App Icon Response is sent, when SetAppIcon has been called.
- *
- * @since SmartDeviceLink 2.0
- */
-public class SetAppIconResponse extends RPCResponse {
- /**
- * Constructs a new SetAppIconResponse object
- */
-
- public SetAppIconResponse() {
- super(FunctionID.SET_APP_ICON.toString());
- }
- /**
- * Constructs a new SetAppIconResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
-
- public SetAppIconResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ResetGlobalPropertiesResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SetAppIconResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java
deleted file mode 100644
index 2bff6d1ec..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Used to set an alternate display layout. If not sent, default screen for
- * given platform will be shown
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>displayLayout</td>
- * <td>string</td>
- * <td>Predefined or dynamically created screen layout.<p>Currently only predefined screen layouts are defined.</p> Predefined layouts include: "ONSCREEN_PRESETS" Custom screen containing app-defined onscreen presets. </td>
- * <td>Y</td>
- * <td>maxlength: 500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>dayColorScheme</td>
- * <td>TemplateColorScheme</td>
- * <td>The color scheme that is used for day.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- *
- * <tr>
- * <td>nightColorScheme</td>
- * <td>TemplateColorScheme</td>
- * <td>The color scheme that is used for night.</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- *
- * </table>
- *<p><b>Response </b></p>
- *
- *<p><b> Non-default Result Codes: </b></p>
- *<p> SUCCESS </p>
- *<p> INVALID_DATA</p>
- *<p> OUT_OF_MEMORY</p>
- *<p> TOO_MANY_PENDING_REQUESTS</p>
- * <p> APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p> REJECTED</p>
- * @since SmartDeviceLink 2.0
- */
-public class SetDisplayLayout extends RPCRequest {
- public static final String KEY_DISPLAY_LAYOUT = "displayLayout";
- public static final String KEY_DAY_COLOR_SCHEME = "dayColorScheme";
- public static final String KEY_NIGHT_COLOR_SCHEME = "nightColorScheme";
- /**
- * Constructs a new SetDisplayLayout object
- */
- public SetDisplayLayout() {
- super(FunctionID.SET_DISPLAY_LAYOUT.toString());
- }
-
- /**
- * Constructs a new SetDisplayLayout object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public SetDisplayLayout(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SetDisplayLayout object
- * @param displayLayout
- * a String value representing a display layout
- */
- public SetDisplayLayout(@NonNull String displayLayout) {
- this();
- setDisplayLayout(displayLayout);
- }
-
- /**
- * Sets a display layout. Predefined or dynamically created screen layout.
- * Currently only predefined screen layouts are defined. Predefined layouts
- * include: "ONSCREEN_PRESETS" Custom screen containing app-defined onscreen
- * presets. Currently defined for GEN2
- *
- * @param displayLayout
- * a String value representing a display layout
- */
- public void setDisplayLayout(@NonNull String displayLayout) {
- setParameters(KEY_DISPLAY_LAYOUT, displayLayout);
- }
-
- /**
- * Gets a display layout.
- */
- public String getDisplayLayout() {
- return getString(KEY_DISPLAY_LAYOUT);
- }
-
- /**
- * Gets the color scheme that is currently used for day
- *
- * @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used
- * for day color scheme
- * @since SmartDeviceLink 5.0
- */
- public TemplateColorScheme getDayColorScheme(){
- return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_DAY_COLOR_SCHEME);
- }
-
- /**
- * Sets the color scheme that is intended to be used for day
- *
- * @param templateColorScheme a TemplateColorScheme object representing the colors that will be
- * used for day color scheme
- * @since SmartDeviceLink 5.0
- */
- public void setDayColorScheme(TemplateColorScheme templateColorScheme){
- setParameters(KEY_DAY_COLOR_SCHEME, templateColorScheme);
- }
-
- /**
- * Gets the color scheme that is currently used for night
- *
- * @return TemplateColorScheme - a TemplateColorScheme object representing the colors that are used
- * for night color scheme
- * @since SmartDeviceLink 5.0
- */
- public TemplateColorScheme getNightColorScheme(){
- return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_NIGHT_COLOR_SCHEME);
- }
-
- /**
- * Sets the color scheme that is intended to be used for night
- *
- * @param templateColorScheme a TemplateColorScheme object representing the colors that will be
- * used for night color scheme
- * @since SmartDeviceLink 5.0
- */
- public void setNightColorScheme(TemplateColorScheme templateColorScheme){
- setParameters(KEY_NIGHT_COLOR_SCHEME, templateColorScheme);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java
deleted file mode 100644
index 48b98bd24..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Set Display Layout Response is sent, when SetDisplayLayout has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class SetDisplayLayoutResponse extends RPCResponse {
- public static final String KEY_BUTTON_CAPABILITIES = "buttonCapabilities";
- public static final String KEY_DISPLAY_CAPABILITIES = "displayCapabilities";
- public static final String KEY_SOFT_BUTTON_CAPABILITIES = "softButtonCapabilities";
- public static final String KEY_PRESET_BANK_CAPABILITIES = "presetBankCapabilities";
-
- /**
- * Constructs a new SetDisplayLayoutResponse object
- */
- public SetDisplayLayoutResponse() {
- super(FunctionID.SET_DISPLAY_LAYOUT.toString());
- }
-
- /**
- * Constructs a new SetDisplayLayoutResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public SetDisplayLayoutResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SetDisplayLayoutResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SetDisplayLayoutResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- @SuppressWarnings("unchecked")
- public DisplayCapabilities getDisplayCapabilities() {
- return (DisplayCapabilities) getObject(DisplayCapabilities.class, KEY_DISPLAY_CAPABILITIES);
- }
-
- public void setDisplayCapabilities(DisplayCapabilities displayCapabilities) {
- setParameters(KEY_DISPLAY_CAPABILITIES, displayCapabilities);
- }
-
- @SuppressWarnings("unchecked")
- public List<ButtonCapabilities> getButtonCapabilities() {
- return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES);
- }
-
- public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
- setParameters(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
- }
-
- @SuppressWarnings("unchecked")
- public List<SoftButtonCapabilities> getSoftButtonCapabilities() {
- return (List<SoftButtonCapabilities>) getObject(SoftButtonCapabilities.class, KEY_SOFT_BUTTON_CAPABILITIES);
- }
-
- public void setSoftButtonCapabilities(List<SoftButtonCapabilities> softButtonCapabilities) {
- setParameters(KEY_SOFT_BUTTON_CAPABILITIES, softButtonCapabilities);
- }
-
- @SuppressWarnings("unchecked")
- public PresetBankCapabilities getPresetBankCapabilities() {
- return (PresetBankCapabilities) getObject(PresetBankCapabilities.class, KEY_PRESET_BANK_CAPABILITIES);
- }
-
- public void setPresetBankCapabilities(PresetBankCapabilities presetBankCapabilities) {
- setParameters(KEY_PRESET_BANK_CAPABILITIES, presetBankCapabilities);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java
deleted file mode 100644
index edd943494..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java
+++ /dev/null
@@ -1,279 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Sets value(s) for the specified global property(ies)
- *
- * <p>Function Group: Base </p>
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>AudioStreamingState:</b></p>
- * Any
- *
- * <p><b>SystemContext:</b></p>
- * Any
- *
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>helpPrompt</td>
- * <td>TTSChunk</td>
- * <td>The help prompt. An array of text chunks of type TTSChunk. See {@linkplain TTSChunk}.The array must have at least one item.</td>
- * <td>N</td>
- * <td>Array must have at least one element.<p>Only optional it timeoutPrompt has been specified.</p>minsize:1; maxsize: 100</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>timeoutPrompt</td>
- * <td>TTSChunk</td>
- * <td>Array of one or more TTSChunk elements specifying the help prompt used in an interaction started by PTT.</td>
- * <td>N</td>
- * <td>Array must have at least one element. Only optional it helpPrompt has been specified <p>minsize: 1; maxsize: 100</p></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>vrHelpTitle</td>
- * <td>string</td>
- * <td>Text, which is shown as title of the VR help screen used in an interaction started by PTT.</td>
- * <td>N</td>
- * <td>If omitted on supported displays, the default SDL help title will be used. <p>If omitted and one or more vrHelp items are provided, the request will be rejected.</p>maxlength: 500</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>vrHelp</td>
- * <td>VrHelep</td>
- * <td>Items listed in the VR help screen used in an interaction started by PTT.</td>
- * <td>N</td>
- * <td>If omitted on supported displays, the default SDL VR help / What Can I Say? screen will be used<p>If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC will be rejected.</p><p>If omitted and a vrHelpTitle is provided, the request will be rejected.</p>minsize:1; maxsize: 100 </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>menuTitle</td>
- * <td></td>
- * <td>Optional text to label an app menu button (for certain touchscreen platforms).</td>
- * <td>N</td>
- * <td>maxlength: 500</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>menuIcon</td>
- * <td> Image</td>
- * <td>Optional icon to draw on an app menu button (for certain touchscreen platforms).</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>keyboardProperties</td>
- * <td>KeyboardProperties</td>
- * <td>On-screen keybaord configuration (if available).</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- *
- * </table>
- *
- * <p><b>Note: </b>Your application shall send a SetGlobalProperties to establish an advanced help prompt before sending any voice commands.</p>
- *
- * <p><b>Response</b></p>
- * Indicates whether the requested Global Properties were successfully set.
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * </p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>REJECTED</p>
- * <p>DISALLOWED</p>
- * @since SmartDeviceLink 1.0
- * @see ResetGlobalProperties
- */
-public class SetGlobalProperties extends RPCRequest {
- public static final String KEY_VR_HELP_TITLE = "vrHelpTitle";
- public static final String KEY_MENU_TITLE = "menuTitle";
- public static final String KEY_MENU_ICON = "menuIcon";
- public static final String KEY_KEYBOARD_PROPERTIES = "keyboardProperties";
- public static final String KEY_HELP_PROMPT = "helpPrompt";
- public static final String KEY_TIMEOUT_PROMPT = "timeoutPrompt";
- public static final String KEY_VR_HELP = "vrHelp";
- /**
- * Constructs a new SetGlobalProperties object
- */
- public SetGlobalProperties() {
- super(FunctionID.SET_GLOBAL_PROPERTIES.toString());
- }
- /**
- * Constructs a new SetGlobalProperties object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public SetGlobalProperties(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Gets a List<TTSChunk> for Help Prompt representing Array of one or more
- * TTSChunk elements specifying the help prompt used in an interaction
- * started by PTT
- *
- * @return List<TTSChunk> -an Array of one or more TTSChunk elements
- * specifying the help prompt used in an interaction started by PTT
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getHelpPrompt() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_HELP_PROMPT);
- }
- /**
- * Sets a List<TTSChunk> for Help Prompt that Array of one or more
- * TTSChunk elements specifying the help prompt used in an interaction
- * started by PTT
- *
- * @param helpPrompt
- * a List<TTSChunk> of one or more TTSChunk elements
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Array must have at least one element</li>
- * <li>Only optional it timeoutPrompt has been specified</li>
- * </ul>
- */
- public void setHelpPrompt(List<TTSChunk> helpPrompt) {
- setParameters(KEY_HELP_PROMPT, helpPrompt);
- }
- /**
- * Gets a List<TTSChunk> for Timeout Prompt representing Array of one or
- * more TTSChunk elements specifying the help prompt used in an interaction
- * started by PTT
- *
- * @return List<TTSChunk> -an Array of one or more TTSChunk elements
- * specifying the help prompt used in an interaction started by PTT
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getTimeoutPrompt() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TIMEOUT_PROMPT);
- }
- /**
- * Sets a List<TTSChunk> for Timeout Prompt representing Array of one or
- * more TTSChunk elements specifying the help prompt used in an interaction
- * started by PTT
- *
- */
- public void setTimeoutPrompt(List<TTSChunk> timeoutPrompt) {
- setParameters(KEY_TIMEOUT_PROMPT, timeoutPrompt);
- }
-
- /**
- * Gets a voice recognition Help Title
- *
- * @return String - a String value representing the text, which is shown as
- * title of the VR help screen used in an interaction started by PTT
- * @since SmartDeviceLink 2.0
- */
- public String getVrHelpTitle() {
- return getString(KEY_VR_HELP_TITLE);
- }
-
- /**
- * Sets a voice recognition Help Title
- *
- * @param vrHelpTitle
- * a String value representing a voice recognition Help Title
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If omitted on supported displays, the default SDL help
- * title will be used</li>
- * <li>If omitted and one or more vrHelp items are provided, the
- * request will be rejected.</li>
- * <li>String Maxlength = 500</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
- public void setVrHelpTitle(String vrHelpTitle) {
- setParameters(KEY_VR_HELP_TITLE, vrHelpTitle);
- }
-
- /**
- * Gets items listed in the VR help screen used in an interaction started by
- * PTT
- *
- * @return List<VrHelpItem> - a List value representing items listed in
- * the VR help screen used in an interaction started by PTT
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<VrHelpItem> getVrHelp() {
- return (List<VrHelpItem>) getObject(VrHelpItem.class, KEY_VR_HELP);
- }
-
- /**
- * Sets the items listed in the VR help screen used in an interaction
- * started by PTT
- *
- * @param vrHelp
- * a List value representing items listed in the VR help screen
- * used in an interaction started by PTT
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If omitted on supported displays, the default SmartDeviceLink VR
- * help / What Can I Say? screen will be used</li>
- * <li>If the list of VR Help Items contains nonsequential
- * positions (e.g. [1,2,4]), the RPC will be rejected</li>
- * <li>If omitted and a vrHelpTitle is provided, the request
- * will be rejected</li>
- * <li>Array Minsize: = 1</li>
- * <li>Array Maxsize = 100</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
- public void setVrHelp(List<VrHelpItem> vrHelp) {
- setParameters(KEY_VR_HELP, vrHelp);
- }
-
- public String getMenuTitle() {
- return getString(KEY_MENU_TITLE);
- }
-
- public void setMenuTitle(String menuTitle) {
- setParameters(KEY_MENU_TITLE, menuTitle);
- }
-
- public void setMenuIcon(Image menuIcon) {
- setParameters(KEY_MENU_ICON, menuIcon);
- }
-
- @SuppressWarnings("unchecked")
- public Image getMenuIcon() {
- return (Image) getObject(Image.class, KEY_MENU_ICON);
- }
-
- public void setKeyboardProperties(KeyboardProperties keyboardProperties) {
- setParameters(KEY_KEYBOARD_PROPERTIES, keyboardProperties);
- }
-
- @SuppressWarnings("unchecked")
- public KeyboardProperties getKeyboardProperties() {
- return (KeyboardProperties) getObject(KeyboardProperties.class, KEY_KEYBOARD_PROPERTIES);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java
deleted file mode 100644
index 89b5219a5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalPropertiesResponse.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Set Global Properties Response is sent, when SetGlobalProperties has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class SetGlobalPropertiesResponse extends RPCResponse {
-
- /**
- * Constructs a new SetGlobalPropertiesResponse object
- */
- public SetGlobalPropertiesResponse() {
- super(FunctionID.SET_GLOBAL_PROPERTIES.toString());
- }
-
- /**
- * Constructs a new SetGlobalPropertiesResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public SetGlobalPropertiesResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SetGlobalPropertiesResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SetGlobalPropertiesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java
deleted file mode 100644
index ad5a0d26a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * This function allows a remote control type mobile application change the settings
- * of a specific remote control module.
- */
-public class SetInteriorVehicleData extends RPCRequest {
- public static final String KEY_MODULE_DATA = "moduleData";
-
- /**
- * Constructs a new SetInteriorVehicleData object
- */
- public SetInteriorVehicleData() {
- super(FunctionID.SET_INTERIOR_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new SetInteriorVehicleData object indicated by the
- * Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public SetInteriorVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SetInteriorVehicleData object
- * @param moduleData
- */
- public SetInteriorVehicleData(@NonNull ModuleData moduleData) {
- this();
- setModuleData(moduleData);
- }
-
- /**
- * Sets the moduleData
- *
- * @param moduleData
- */
- public void setModuleData(@NonNull ModuleData moduleData) {
- setParameters(KEY_MODULE_DATA, moduleData);
- }
-
- /**
- * Gets the moduleData
- *
- * @return ModuleData
- */
- public ModuleData getModuleData() {
- return (ModuleData) getObject(ModuleData.class, KEY_MODULE_DATA);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
deleted file mode 100644
index 837b36fc7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-public class SetInteriorVehicleDataResponse extends RPCResponse {
- public static final String KEY_MODULE_DATA = "moduleData";
-
- /**
- * Constructs a new SetInteriorVehicleDataResponse object
- */
- public SetInteriorVehicleDataResponse() {
- super(FunctionID.SET_INTERIOR_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new SetInteriorVehicleDataResponse object indicated by the
- * Hashtable parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public SetInteriorVehicleDataResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SetInteriorVehicleDataResponse object
- * @param moduleData
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SetInteriorVehicleDataResponse(@NonNull ModuleData moduleData, @NonNull Result resultCode, @NonNull Boolean success) {
- this();
- setModuleData(moduleData);
- setResultCode(resultCode);
- setSuccess(success);
- }
-
- /**
- * Gets the moduleData
- *
- * @return ModuleData
- */
- public ModuleData getModuleData() {
- return (ModuleData) getObject(ModuleData.class, KEY_MODULE_DATA);
- }
-
- /**
- * Sets the moduleData
- *
- * @param moduleData
- */
- public void setModuleData(@NonNull ModuleData moduleData) {
- setParameters(KEY_MODULE_DATA, moduleData);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java
deleted file mode 100644
index 8dd53449d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java
+++ /dev/null
@@ -1,196 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator;
-import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
-
-import java.util.Hashtable;
-
-/**
- * Sets the media clock/timer value and the update method (e.g.count-up,
- * count-down, etc.)
- *
- * <p>Function Group: Base </p>
- * <p><b>HMILevel needs to be FULL, LIMITIED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>startTime</td>
- * <td>StartTime</td>
- * <td>StartTime struct specifying hour, minute, second values to which media clock timer is set.</td>
- * <td>N</td>
- * <td> </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>endTime</td>
- * <td>StartTime</td>
- * <td> EndTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
- * If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
- * endTime will be ignored for "RESUME", and "CLEAR"
- * endTime can be sent for "PAUSE", in which case it will update the paused endTime</td>
- * <td>N</td>
- * <td>Array must have at least one element.<p>Only optional it helpPrompt has been specified</p> minsize: 1; maxsize: 100</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>updateMode</td>
- * <td>UpdateMode</td>
- * <td>Specifies how the media clock/timer is to be updated (COUNTUP/COUNTDOWN/PAUSE/RESUME), based at the startTime.</td>
- * <td>Y</td>
- * <td>If "updateMode" is COUNTUP or COUNTDOWN, this parameter must be provided. Will be ignored for PAUSE,RESUME and CLEAR</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>audioStreamingIndicator</td>
- * <td>AudioStreamingIndicator</td>
- * <td></td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- *
- * </table>
- *
- *<p><b>Response </b></p>
- *
- *<p><b> Non-default Result Codes: </b></p>
- *
- * <p> SUCCESS </p>
- * <p> INVALID_DATA</p>
- * <p> OUT_OF_MEMORY</p>
- * <p> TOO_MANY_PENDING_REQUESTS</p>
- * <p> APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p> REJECTED </p>
- * <p> IGNORED </p>
- *
- * @since SmartDeviceLink 1.0
- */
-public class SetMediaClockTimer extends RPCRequest {
- public static final String KEY_START_TIME = "startTime";
- public static final String KEY_END_TIME = "endTime";
- public static final String KEY_UPDATE_MODE = "updateMode";
- public static final String KEY_AUDIO_STREAMING_INDICATOR = "audioStreamingIndicator";
- /**
- * Constructs a new SetMediaClockTimer object
- */
- public SetMediaClockTimer() {
- super(FunctionID.SET_MEDIA_CLOCK_TIMER.toString());
- }
- /**
- * Constructs a new SetMediaClockTimer object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash The Hashtable to use
- */
- public SetMediaClockTimer(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new SetMediaClockTimer object
- * @param updateMode a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME) <br>
- * <b>Notes: </b>
- * <ul>
- * <li>When updateMode is PAUSE, RESUME or CLEAR, the start time value
- * is ignored</li>
- * <li>When updateMode is RESUME, the timer resumes counting from
- * the timer's value when it was paused</li>
- * </ul>
- */
- public SetMediaClockTimer(@NonNull UpdateMode updateMode) {
- this();
- setUpdateMode(updateMode);
- }
- /**
- * Gets the Start Time which media clock timer is set
- *
- * @return StartTime -a StartTime object specifying hour, minute, second
- * values
- */
- @SuppressWarnings("unchecked")
- public StartTime getStartTime() {
- return (StartTime) getObject(StartTime.class, KEY_START_TIME);
- }
- /**
- * Sets a Start Time with specifying hour, minute, second values
- *
- * @param startTime
- * a startTime object with specifying hour, minute, second values
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If "updateMode" is COUNTUP or COUNTDOWN, this parameter
- * must be provided</li>
- * <li>Will be ignored for PAUSE/RESUME and CLEAR</li>
- * </ul>
- */
- public void setStartTime( StartTime startTime ) {
- setParameters(KEY_START_TIME, startTime);
- }
-
- @SuppressWarnings("unchecked")
- public StartTime getEndTime() {
- return (StartTime) getObject(StartTime.class, KEY_END_TIME);
- }
-
- public void setEndTime( StartTime endTime ) {
- setParameters(KEY_END_TIME, endTime);
- }
-
- /**
- * Gets the media clock/timer update mode (COUNTUP/COUNTDOWN/PAUSE/RESUME)
- *
- * @return UpdateMode -a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME)
- */
- public UpdateMode getUpdateMode() {
- return (UpdateMode) getObject(UpdateMode.class, KEY_UPDATE_MODE);
- }
- /**
- * Sets the media clock/timer update mode (COUNTUP/COUNTDOWN/PAUSE/RESUME)
- *
- * @param updateMode
- * a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME)
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>When updateMode is PAUSE, RESUME or CLEAR, the start time value
- * is ignored</li>
- * <li>When updateMode is RESUME, the timer resumes counting from
- * the timer's value when it was paused</li>
- * </ul>
- */
- public void setUpdateMode( @NonNull UpdateMode updateMode ) {
- setParameters(KEY_UPDATE_MODE, updateMode);
- }
-
- /**
- * Gets the playback status of a media app
- *
- * @return AudioStreamingIndicator - a Enumeration value
- */
- public AudioStreamingIndicator getAudioStreamingIndicator() {
- return (AudioStreamingIndicator) getObject(AudioStreamingIndicator.class, KEY_AUDIO_STREAMING_INDICATOR);
- }
-
- /**
- * Sets the playback status of a media app
- */
- public void setAudioStreamingIndicator(AudioStreamingIndicator audioStreamingIndicator ) {
- setParameters(KEY_AUDIO_STREAMING_INDICATOR, audioStreamingIndicator);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java
deleted file mode 100644
index 56a63c947..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimerResponse.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Set Media Clock Timer Response is sent, when SetMediaClockTimer has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class SetMediaClockTimerResponse extends RPCResponse {
-
- /**
- * Constructs a new SetMediaClockTimerResponse object
- */
- public SetMediaClockTimerResponse() {
- super(FunctionID.SET_MEDIA_CLOCK_TIMER.toString());
- }
-
- /**
- * Constructs a new SetMediaClockTimerResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public SetMediaClockTimerResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new SetMediaClockTimerResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SetMediaClockTimerResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Show.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Show.java
deleted file mode 100644
index 6a42fe1a8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Show.java
+++ /dev/null
@@ -1,549 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Updates the application's display text area, regardless of whether or not
- * this text area is visible to the user at the time of the request. The
- * application's display text area remains unchanged until updated by subsequent
- * calls to Show
- * <p></p>
- * The content of the application's display text area is visible to the user
- * when the application's {@linkplain com.smartdevicelink.proxy.rpc.enums.HMILevel}
- * is FULL or LIMITED, and the
- * {@linkplain com.smartdevicelink.proxy.rpc.enums.SystemContext}=MAIN and no
- * {@linkplain Alert} is in progress
- * <p></p>
- * The Show operation cannot be used to create an animated scrolling screen. To
- * avoid distracting the driver, Show commands cannot be issued more than once
- * every 4 seconds. Requests made more frequently than this will be rejected
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>mainField1</td>
- * <td>String</td>
- * <td>Text to be displayed in a single-line display, or in the upper display line in a two-line display.</td>
- * <td>N</td>
- * <td>If this parameter is omitted, the text of mainField1 does not change. If this parameter is an empty string, the field will be cleared. <p>Maxlength = 500</p></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>mainField2</td>
- * <td>String</td>
- * <td>Text to be displayed on the second display line of a two-line display.</td>
- * <td>N</td>
- * <td><p>If this parameter is omitted, the text of mainField2 does not change. </p> <p>If this parameter is an empty string, the field will be cleared.</p><p>If provided and the display is a single-line display, the parameter is ignored.</p>Maxlength = 500</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>mainField3</td>
- * <td>String</td>
- * <td>Text to be displayed on the first display line of the second page.</td>
- * <td>N</td>
- * <td><p>If this parameter is omitted, the text of mainField3 does not change. </p><p>If this parameter is an empty string, the field will be cleared.</p><p>If provided and the display is a single-line display, the parameter is ignored.</p> Maxlength = 500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>mainField4</td>
- * <td>String</td>
- * <td>Text to be displayed on the second display line of the second page.</td>
- * <td>N</td>
- * <td><p>If this parameter is omitted, the text of mainField4 does not change. </p><p>If this parameter is an empty string, the field will be cleared.</p><p>If provided and the display is a single-line display, the parameter is ignored.</p>Maxlength = 500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>alignment</td>
- * <td>TextAlignment</td>
- * <td>Specifies how mainField1 and mainField2 text should be aligned on display.</td>
- * <td>N</td>
- * <td><p>Applies only to mainField1 and mainField2 provided on this call, not to what is already showing in display.</p><p>If this parameter is omitted, text in both mainField1 and mainField2 will be centered. </p>Has no effect with navigation display</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>statusBar</td>
- * <td>String</td>
- * <td>The text is placed in the status bar area.</td>
- * <td>N</td>
- * <td><p>Note: The status bar only exists on navigation displays</p><p>If this parameter is omitted, the status bar text will remain unchanged.</p><p>If this parameter is an empty string, the field will be cleared.</p><p>If provided and the display has no status bar, this parameter is ignored.</p>Maxlength = 500</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>mediaClock</td>
- * <td>String</td>
- * <td><p>Text value for MediaClock field.</p> <p>Has to be properly formatted by Mobile App according to SDL capabilities.</p>If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.</td>
- * <td>N</td>
- * <td><p>Must be properly formatted as described in the MediaClockFormat enumeration. </p><p>If a value of five spaces is provided, this will clear that field on the display (i.e. the media clock timer field will not display anything) </p>Maxlength = 500</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>mediaTrack</td>
- * <td>String</td>
- * <td>Array of one or more TTSChunk elements specifying the help prompt used in an interaction started by PTT.</td>
- * <td>N</td>
- * <td><p>If parameter is omitted, the track field remains unchanged.</p><p>If an empty string is provided, the field will be cleared.</p><p>This field is only valid for media applications on navigation displays.</p>Maxlength = 500</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>graphic</td>
- * <td>Image</td>
- * <td>Image to be shown on supported displays.</td>
- * <td>N</td>
- * <td>If omitted on supported displays, the displayed graphic shall not change.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>secondaryGraphic</td>
- * <td>Image</td>
- * <td> <p>Image struct determining whether static or dynamic secondary image to display in app.</p>If omitted on supported displays, the displayed secondary graphic shall not change.</td>
- * <td>N</td>
- * <td> </td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * <tr>
- * <td>softButtons</td>
- * <td>SoftButton</td>
- * <td>Soft buttons as defined by the App</td>
- * <td>N</td>
- * <td><p>If omitted on supported displays, the currently displayed SoftButton values will not change.</p>Array Minsize: 0; Array Maxsize: 8</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>customPresets</td>
- * <td>String</td>
- * <td>Custom presets as defined by the App.</td>
- * <td>N</td>
- * <td><p>If omitted on supported displays, the presets will be shown as not defined.</p>Minsize: 0; Maxsize: 6</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * </table>
- *<p><b>Response </b></p>
- *
- *<p><b> Non-default Result Codes: </b></p>
- * <p>SUCCESS </p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p> TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p> REJECTED</p>
- * <p> DISALLOWED</p>
- * <p> UNSUPPORTED_RESOURCE </p>
- * <p>ABORTED</p>
- *
- * @since SmartDeviceLink 1.0
- * @see Alert
- * @see SetMediaClockTimer
- */
-public class Show extends RPCRequest {
- public static final String KEY_GRAPHIC = "graphic";
- public static final String KEY_CUSTOM_PRESETS = "customPresets";
- public static final String KEY_MAIN_FIELD_1 = "mainField1";
- public static final String KEY_MAIN_FIELD_2 = "mainField2";
- public static final String KEY_MAIN_FIELD_3 = "mainField3";
- public static final String KEY_MAIN_FIELD_4 = "mainField4";
- public static final String KEY_STATUS_BAR = "statusBar";
- public static final String KEY_MEDIA_CLOCK = "mediaClock";
- public static final String KEY_ALIGNMENT = "alignment";
- public static final String KEY_MEDIA_TRACK = "mediaTrack";
- public static final String KEY_SECONDARY_GRAPHIC = "secondaryGraphic";
- public static final String KEY_SOFT_BUTTONS = "softButtons";
- public static final String KEY_METADATA_TAGS = "metadataTags";
- /**
- * Constructs a new Show object
- */
- public Show() {
- super(FunctionID.SHOW.toString());
- }
- /**
- * Constructs a new Show object indicated by the Hashtable parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public Show(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Gets the text displayed in a single-line display, or in the upper display
- * line in a two-line display
- *
- * @return String -a String value representing the text displayed in a
- * single-line display, or in the upper display line in a two-line
- * display
- */
- public String getMainField1() {
- return getString(KEY_MAIN_FIELD_1);
- }
- /**
- * Sets the text displayed in a single-line display, or in the upper display
- * line in a two-line display
- *
- * @param mainField1
- * the String value representing the text displayed in a
- * single-line display, or in the upper display line in a
- * two-line display
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If this parameter is omitted, the text of mainField1 does
- * not change</li>
- * <li>If this parameter is an empty string, the field will be
- * cleared</li>
- * </ul>
- */
- public void setMainField1(String mainField1) {
- setParameters(KEY_MAIN_FIELD_1, mainField1);
- }
- /**
- * Gets the text displayed on the second display line of a two-line display
- *
- * @return String -a String value representing the text displayed on the
- * second display line of a two-line display
- */
- public String getMainField2() {
- return getString(KEY_MAIN_FIELD_2);
- }
- /**
- * Sets the text displayed on the second display line of a two-line display
- *
- * @param mainField2
- * the String value representing the text displayed on the second
- * display line of a two-line display
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If this parameter is omitted, the text of mainField2 does
- * not change</li>
- * <li>If this parameter is an empty string, the field will be
- * cleared</li>
- * <li>If provided and the display is a single-line display, the
- * parameter is ignored</li>
- * <li>Maxlength = 500</li>
- * </ul>
- */
- public void setMainField2(String mainField2) {
- setParameters(KEY_MAIN_FIELD_2, mainField2);
- }
-
- /**
- * Gets the text displayed on the first display line of the second page
- *
- * @return String -a String value representing the text displayed on the
- * first display line of the second page
- * @since SmartDeviceLink 2.0
- */
- public String getMainField3() {
- return getString(KEY_MAIN_FIELD_3);
- }
-
- /**
- * Sets the text displayed on the first display line of the second page
- *
- * @param mainField3
- * the String value representing the text displayed on the first
- * display line of the second page
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If this parameter is omitted, the text of mainField3 does
- * not change</li>
- * <li>If this parameter is an empty string, the field will be
- * cleared</li>
- * <li>If provided and the display is a single-line display, the
- * parameter is ignored</li>
- * <li>Maxlength = 500</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
- public void setMainField3(String mainField3) {
- setParameters(KEY_MAIN_FIELD_3, mainField3);
- }
-
- /**
- * Gets the text displayed on the second display line of the second page
- *
- * @return String -a String value representing the text displayed on the
- * first display line of the second page
- * @since SmartDeviceLink 2.0
- */
- public String getMainField4() {
- return getString(KEY_MAIN_FIELD_4);
- }
-
- /**
- * Sets the text displayed on the second display line of the second page
- *
- * @param mainField4
- * the String value representing the text displayed on the second
- * display line of the second page
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If this parameter is omitted, the text of mainField4 does
- * not change</li>
- * <li>If this parameter is an empty string, the field will be
- * cleared</li>
- * <li>If provided and the display is a single-line display, the
- * parameter is ignored</li>
- * <li>Maxlength = 500</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
- public void setMainField4(String mainField4) {
- setParameters(KEY_MAIN_FIELD_4, mainField4);
- }
- /**
- * Gets the alignment that Specifies how mainField1 and mainField2 text
- * should be aligned on display
- *
- * @return TextAlignment -an Enumeration value
- */
- public TextAlignment getAlignment() {
- return (TextAlignment) getObject(TextAlignment.class, KEY_ALIGNMENT);
- }
- /**
- * Sets the alignment that Specifies how mainField1 and mainField2 text
- * should be aligned on display
- *
- * @param alignment
- * an Enumeration value
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Applies only to mainField1 and mainField2 provided on this
- * call, not to what is already showing in display</li>
- * <li>If this parameter is omitted, text in both mainField1 and
- * mainField2 will be centered</li>
- * <li>Has no effect with navigation display</li>
- * </ul>
- */
- public void setAlignment(TextAlignment alignment) {
- setParameters(KEY_ALIGNMENT, alignment);
- }
- /**
- * Gets text in the Status Bar
- *
- * @return String -the value in the Status Bar
- */
- public String getStatusBar() {
- return getString(KEY_STATUS_BAR);
- }
- /**
- * Sets text in the Status Bar
- *
- * @param statusBar
- * a String representing the text you want to add in the Status
- * Bar
- * <p></p>
- * <b>Notes: </b><i>The status bar only exists on navigation
- * displays</i>
- * <ul>
- * <li>If this parameter is omitted, the status bar text will
- * remain unchanged</li>
- * <li>If this parameter is an empty string, the field will be
- * cleared</li>
- * <li>If provided and the display has no status bar, this
- * parameter is ignored</li>
- * </ul>
- */
- public void setStatusBar(String statusBar) {
- setParameters(KEY_STATUS_BAR, statusBar);
- }
- /**
- * Gets the String value of the MediaClock
- *
- * @return String -a String value of the MediaClock
- */
- @Deprecated
- public String getMediaClock() {
- return getString(KEY_MEDIA_CLOCK);
- }
- /**
- * Sets the value for the MediaClock field using a format described in the
- * MediaClockFormat enumeration
- *
- * @param mediaClock
- * a String value for the MdaiaClock
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>Must be properly formatted as described in the
- * MediaClockFormat enumeration</li>
- * <li>If a value of five spaces is provided, this will clear
- * that field on the display (i.e. the media clock timer field
- * will not display anything)</li>
- * </ul>
- */
- @Deprecated
- public void setMediaClock(String mediaClock) {
- setParameters(KEY_MEDIA_CLOCK, mediaClock);
- }
- /**
- * Gets the text in the track field
- *
- * @return String -a String displayed in the track field
- */
- public String getMediaTrack() {
- return getString(KEY_MEDIA_TRACK);
- }
- /**
- * Sets the text in the track field
- *
- * @param mediaTrack
- * a String value disaplayed in the track field
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If parameter is omitted, the track field remains unchanged</li>
- * <li>If an empty string is provided, the field will be cleared</li>
- * <li>This field is only valid for media applications on navigation displays</li>
- * </ul>
- */
- public void setMediaTrack(String mediaTrack) {
- setParameters(KEY_MEDIA_TRACK, mediaTrack);
- }
-
- /**
- * Sets an image to be shown on supported displays
- *
- * @param graphic
- * the value representing the image shown on supported displays
- * <p></p>
- * <b>Notes: </b>If omitted on supported displays, the displayed
- * graphic shall not change
- * @since SmartDeviceLink 2.0
- */
- public void setGraphic(Image graphic) {
- setParameters(KEY_GRAPHIC, graphic);
- }
-
- /**
- * Gets an image to be shown on supported displays
- *
- * @return Image -the value representing the image shown on supported
- * displays
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public Image getGraphic() {
- return (Image) getObject(Image.class, KEY_GRAPHIC);
- }
-
-
- public void setSecondaryGraphic(Image secondaryGraphic) {
- setParameters(KEY_SECONDARY_GRAPHIC, secondaryGraphic);
- }
-
-
- @SuppressWarnings("unchecked")
- public Image getSecondaryGraphic() {
- return (Image) getObject(Image.class, KEY_SECONDARY_GRAPHIC);
- }
-
-
- /**
- * Gets the Soft buttons defined by the App
- *
- * @return List<SoftButton> -a List value representing the Soft buttons
- * defined by the App
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<SoftButton> getSoftButtons() {
- return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
- }
-
- /**
- * Sets the the Soft buttons defined by the App
- *
- * @param softButtons
- * a List value represemting the Soft buttons defined by the
- * App
- * <p></p>
- * <b>Notes: </b>
- * <ul>
- * <li>If omitted on supported displays, the currently displayed
- * SoftButton values will not change</li>
- * <li>Array Minsize: 0</li>
- * <li>Array Maxsize: 8</li>
- * </ul>
- *
- * @since SmartDeviceLink 2.0
- */
- public void setSoftButtons(List<SoftButton> softButtons) {
- setParameters(KEY_SOFT_BUTTONS, softButtons);
- }
-
- /**
- * Gets the Custom Presets defined by the App
- *
- * @return List<String> - a List value representing the Custom presets
- * defined by the App
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<String> getCustomPresets() {
- return (List<String>) getObject(String.class, KEY_CUSTOM_PRESETS);
- }
-
- /**
- * Sets the Custom Presets defined by the App
- *
- * @param customPresets
- * a List value representing the Custom Presets defined by the
- * App
- * <p></p>
- * <ul>
- * <li>If omitted on supported displays, the presets will be shown as not defined</li>
- * <li>Array Minsize: 0</li>
- * <li>Array Maxsize: 6</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
- public void setCustomPresets(List<String> customPresets) {
- setParameters(KEY_CUSTOM_PRESETS, customPresets);
- }
-
- /**
- * Sets text field metadata defined by the App
- *
- * @param metadataTags
- * A Struct containing metadata pertaining to the main text fields
- * <p></p>
- * <ul>
- * @since SmartDeviceLink 4.5.0
- */
- public void setMetadataTags(MetadataTags metadataTags){
- setParameters(KEY_METADATA_TAGS, metadataTags);
- }
-
- /**
- * Gets text field metadata defined by the App
- *
- * @return metadataTags - App defined metadata information. See MetadataTags. Uses mainField1, mainField2, mainField3, mainField4.
- * If omitted on supported displays, the currently set metadata tags will not change.
- * If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.
- * @since SmartDeviceLink 4.5.0
- */
- public MetadataTags getMetadataTags() {
- return (MetadataTags) getObject(MetadataTags.class, KEY_METADATA_TAGS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java
deleted file mode 100644
index 6a44b9068..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java
+++ /dev/null
@@ -1,273 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * <p>This RPC is used to update the user with navigation information for the constantly shown screen (base screen), but
- * also for the alert type screen</p>
- *
- * <p>Function Group: Navigation</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- *
- * @since SmartDeviceLink 2.0
- * @see AlertManeuver
- * @see UpdateTurnList
- */
-public class ShowConstantTbt extends RPCRequest{
-
- public static final String KEY_TEXT1 = "navigationText1";
- public static final String KEY_TEXT2 = "navigationText2";
- public static final String KEY_ETA = "eta";
- public static final String KEY_TOTAL_DISTANCE = "totalDistance";
- public static final String KEY_MANEUVER_DISTANCE = "distanceToManeuver";
- public static final String KEY_MANEUVER_DISTANCE_SCALE = "distanceToManeuverScale";
- public static final String KEY_MANEUVER_IMAGE = "turnIcon";
- public static final String KEY_NEXT_MANEUVER_IMAGE = "nextTurnIcon";
- public static final String KEY_MANEUVER_COMPLETE = "maneuverComplete";
- public static final String KEY_SOFT_BUTTONS = "softButtons";
- public static final String KEY_TIME_TO_DESTINATION = "timeToDestination";
-
- /**
- * Constructs a new ShowConstantTbt object
- */
- public ShowConstantTbt(){
- super(FunctionID.SHOW_CONSTANT_TBT.toString());
- }
-
- /**
- * Constructs a new ShowConstantTbt object indicated by the Hashtable parameter
- * <p>
- *
- * @param hash
- * The Hashtable to use
- */
- public ShowConstantTbt(Hashtable<String, Object> hash){
- super(hash);
- }
-
- /**
- * Sets a text for navigation text field 1
- *
- * @param navigationText1
- * a String value representing a text for navigation text field 1
- * <p></p>
- * <b>Notes: </b>Maxlength=500
- */
- public void setNavigationText1(String navigationText1){
- setParameters(KEY_TEXT1, navigationText1);
- }
-
- /**
- * Gets a text for navigation text field 1
- *
- * @return String -a String value representing a text for navigation text field 1
- */
- public String getNavigationText1(){
- return getString(KEY_TEXT1);
- }
-
- /**
- * Sets a text for navigation text field 2
- *
- * @param navigationText2
- * a String value representing a text for navigation text field 2
- * <p></p>
- * <b>Notes: </b>Maxlength=500
- */
- public void setNavigationText2(String navigationText2){
- setParameters(KEY_TEXT2, navigationText2);
- }
-
- /**
- * Gets a text for navigation text field 2
- *
- * @return String -a String value representing a text for navigation text field 2
- */
- public String getNavigationText2(){
- return getString(KEY_TEXT2);
- }
-
- /**
- * Sets a text field for estimated time of arrival
- *
- * @param eta
- * a String value representing a text field for estimated time of arrival
- * <p></p>
- * <b>Notes: </b>Maxlength=500
- */
- public void setEta(String eta){
- setParameters(KEY_ETA, eta);
- }
-
- /**
- * Gets a text field for estimated time of arrival
- *
- * @return String -a String value representing a text field for estimated time of arrival
- */
- public String getEta(){
- return getString(KEY_ETA);
- }
-
- /**
- * Sets a text field for total distance
- *
- * @param totalDistance
- * a String value representing a text field for total distance
- * <p></p>
- * <b>Notes: </b>Maxlength=500
- */
- public void setTotalDistance(String totalDistance){
- setParameters(KEY_TOTAL_DISTANCE, totalDistance);
- }
-
- /**
- * Gets a text field for total distance
- *
- * @return String -a String value representing a text field for total distance
- */
- public String getTotalDistance(){
- return getString(KEY_TOTAL_DISTANCE);
- }
-
- /**
- * Sets an Image for turnicon
- *
- * @param turnIcon
- * an Image value
- */
- public void setTurnIcon(Image turnIcon){
- setParameters(KEY_MANEUVER_IMAGE, turnIcon);
- }
-
- /**
- * Gets an Image for turnicon
- *
- * @return Image -an Image value representing an Image for turnicon
- */
- @SuppressWarnings("unchecked")
- public Image getTurnIcon(){
- return (Image) getObject(Image.class, KEY_MANEUVER_IMAGE);
- }
-
- /**
- * Sets an Image for nextTurnIcon
- *
- * @param nextTurnIcon
- * an Image value
- */
- public void setNextTurnIcon(Image nextTurnIcon){
- setParameters(KEY_NEXT_MANEUVER_IMAGE, nextTurnIcon);
- }
-
- /**
- * Gets an Image for nextTurnIcon
- *
- * @return Image -an Image value representing an Image for nextTurnIcon
- */
- @SuppressWarnings("unchecked")
- public Image getNextTurnIcon(){
- return (Image) getObject(Image.class, KEY_NEXT_MANEUVER_IMAGE);
- }
-
- /**
- * Sets a Fraction of distance till next maneuver
- *
- * @param distanceToManeuver
- * a Double value representing a Fraction of distance till next maneuver
- * <p></p>
- * <b>Notes: </b>Minvalue=0; Maxvalue=1000000000
- */
- public void setDistanceToManeuver(Double distanceToManeuver){
- setParameters(KEY_MANEUVER_DISTANCE, distanceToManeuver);
- }
-
- /**
- * Gets a Fraction of distance till next maneuver
- *
- * @return Double -a Double value representing a Fraction of distance till next maneuver
- */
- public Double getDistanceToManeuver(){
- return getDouble(KEY_MANEUVER_DISTANCE);
- }
-
- /**
- * Sets a Distance till next maneuver (starting from) from previous maneuver
- *
- * @param distanceToManeuverScale
- * a Double value representing a Distance till next maneuver (starting from) from previous maneuver
- * <p></p>
- * <b>Notes: </b>Minvalue=0; Maxvalue=1000000000
- */
- public void setDistanceToManeuverScale(Double distanceToManeuverScale){
- setParameters(KEY_MANEUVER_DISTANCE_SCALE, distanceToManeuverScale);
- }
-
- /**
- * Gets a Distance till next maneuver (starting from) from previous maneuver
- *
- * @return Double -a Double value representing a Distance till next maneuver (starting from) from previous maneuver
- */
- public Double getDistanceToManeuverScale(){
- return getDouble(KEY_MANEUVER_DISTANCE_SCALE);
- }
-
- /**
- * <p>Sets a maneuver complete flag. If and when a maneuver has completed while an AlertManeuver is active, the app
- * must send this value set to TRUE in order to clear the AlertManeuver overlay
- * If omitted the value will be assumed as FALSE</p>
- *
- *
- * @param maneuverComplete
- * a Boolean value
- */
- public void setManeuverComplete(Boolean maneuverComplete){
- setParameters(KEY_MANEUVER_COMPLETE, maneuverComplete);
- }
-
- /**
- * Gets a maneuver complete flag
- *
- * @return Boolean -a Boolean value
- */
- public Boolean getManeuverComplete(){
- return getBoolean(KEY_MANEUVER_COMPLETE);
- }
-
- /**
- * <p>Sets Three dynamic SoftButtons available (first SoftButton is fixed to "Turns"). If omitted on supported
- * displays, the currently displayed SoftButton values will not change</p>
- *
- * <p><b>Notes: </b>Minsize=0; Maxsize=3</p>
- *
- * @param softButtons
- * a List<SoftButton> value
- */
- public void setSoftButtons(List<SoftButton> softButtons){
- setParameters(KEY_SOFT_BUTTONS, softButtons);
- }
-
- /**
- * Gets Three dynamic SoftButtons available (first SoftButton is fixed to "Turns"). If omitted on supported
- * displays, the currently displayed SoftButton values will not change
- *
- * @return Vector<SoftButton> -a Vector<SoftButton> value
- */
- @SuppressWarnings("unchecked")
- public List<SoftButton> getSoftButtons(){
- return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
- }
-
- public void setTimeToDestination(String timeToDestination){
- setParameters(KEY_TIME_TO_DESTINATION, timeToDestination);
- }
-
- public String getTimeToDestination(){
- return getString(KEY_TIME_TO_DESTINATION);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java
deleted file mode 100644
index 5482a00ae..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbtResponse.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Show Constant TBT Response is sent, when ShowConstantTBT has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class ShowConstantTbtResponse extends RPCResponse{
-
- public ShowConstantTbtResponse() {
- super(FunctionID.SHOW_CONSTANT_TBT.toString());
- }
-
- public ShowConstantTbtResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ShowConstantTbtResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public ShowConstantTbtResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java
deleted file mode 100644
index 1187f6687..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ShowResponse.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Show Response is sent, when Show has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class ShowResponse extends RPCResponse {
-
- /**
- * Constructs a new ShowResponse object
- */
- public ShowResponse() {
- super(FunctionID.SHOW.toString());
- }
-
- /**
- * Constructs a new ShowResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public ShowResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new ShowResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public ShowResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java
deleted file mode 100644
index e3a63c276..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-import com.smartdevicelink.proxy.rpc.enums.TPMS;
-
-import java.util.Hashtable;
-
-/**
- * Tire pressure status of a single tire.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>status</td>
- * <td>ComponentVolumeStatus</td>
- * <td>Describes the volume status of a single tire
- * See {@linkplain ComponentVolumeStatus}
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>tpms</td>
- * <td>TPMS</td>
- * <td>The status of TPMS according to the particular tire.
- * See {@linkplain com.smartdevicelink.proxy.rpc.enums.TPMS}
- * </td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>pressure</td>
- * <td>Float</td>
- * <td>The pressure value of the particular tire in kilo pascal.</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class SingleTireStatus extends RPCStruct {
- public static final String KEY_STATUS = "status";
- public static final String KEY_TPMS = "tpms";
- public static final String KEY_PRESSURE = "pressure";
-
- /**
- * Constructs a newly allocated SingleTireStatus object
- */
- public SingleTireStatus() { }
-
- /**
- * Constructs a newly allocated SingleTireStatus object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public SingleTireStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated SingleTireStatus object
- * @param status Describes the volume status of a single tire
- */
- public SingleTireStatus(@NonNull ComponentVolumeStatus status){
- this();
- setStatus(status);
- }
-
- /**
- * set the volume status of a single tire
- * @param status the volume status of a single tire
- */
- public void setStatus(@NonNull ComponentVolumeStatus status) {
- setValue(KEY_STATUS, status);
- }
-
- /**
- * get the volume status of a single tire
- * @return the volume status of a single tire
- */
- public ComponentVolumeStatus getStatus() {
- return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_STATUS);
- }
-
- /**
- * Set the status of TPMS according to the particular tire.
- * @param tpms The status of TPMS
- */
- public void setTPMS(@NonNull TPMS tpms) { setValue(KEY_TPMS, tpms); }
-
- /**
- * Get the status of TPMS according to the particular tire.
- * @return the TPMS status
- */
- public TPMS getTPMS() {
- return (TPMS) getObject(TPMS.class, KEY_TPMS);
- }
-
- /**
- * @param pressure The pressure value of the particular tire in kilo pascal.
- */
- public void setPressure(@NonNull Float pressure) { setValue(KEY_PRESSURE, pressure); }
-
- /**
- * @return the pressure value of the particular tire in kilo pascal.
- */
- public Float getPressure() {
- return getFloat(KEY_PRESSURE);
- }
-}
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
deleted file mode 100644
index 13b30e37d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java
+++ /dev/null
@@ -1,123 +0,0 @@
-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/Slider.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java
deleted file mode 100644
index df92e22fe..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java
+++ /dev/null
@@ -1,235 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * <p>Creates a full screen or pop-up overlay (depending on platform) with a single
- * user controlled slider.</p>
- *
- * <p>Function Group: Base</p>
- *
- * <p><b>HMILevel needs to be FULL</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>numTicks</td>
- * <td>Integer</td>
- * <td>Number of selectable items on a horizontal axis.</td>
- * <td>Y</td>
- * <td>Minvalue=2; Maxvalue=26</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * <tr>
- * <td>position</td>
- * <td>Integer</td>
- * <td>Initial position of slider control (cannot exceed numTicks),</td>
- * <td>Y</td>
- * <td>Minvalue=1; Maxvalue=26</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>sliderHeader</td>
- * <td>String</td>
- * <td>Text header to display</td>
- * <td>N</td>
- * <td>Maxlength=500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>sliderFooter</td>
- * <td>Integer</td>
- * <td><p>Text footer to display (meant to display min/max threshold descriptors).</p>For a static text footer, only one footer string shall be provided in the array. For a dynamic text footer, the number of footer text string in the array must match the numTicks value.For a dynamic text footer, text array string should correlate with potential slider position index.If omitted on supported displays, no footer text shall be displayed.</td>
- * <td>N</td>
- * <td>Maxlength=500; Minvalue=1; Maxvalue=26</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * <tr>
- * <td>timeout</td>
- * <td>String</td>
- * <td>App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout). If omitted, the value is set to 10000.</td>
- * <td>N</td>
- * <td>Minvalue=0; Maxvalue=65535; Defvalue= 10000</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
-*<p><b>Response </b></p>
-*
-*<p><b>Non-default Result Codes:</b></p>
-* <p> SAVED </p>
-* <p> INVALID_DATA</p>
-* <p>OUT_OF_MEMORY</p>
-* <p>TOO_MANY_PENDING_REQUESTS</p>
-* <p>APPLICATION_NOT_REGISTERED</p>
-* <p>GENERIC_ERROR</p>
-*<p> DISALLOWED</p>
-*<p> UNSUPPORTED_RESOURCE </p>
-*<p> REJECTED </p>
-* <p>ABORTED </p>
-*
- * @since SmartDeviceLink 2.0
- *
- */
-public class Slider extends RPCRequest {
-
- public static final String KEY_NUM_TICKS = "numTicks";
- public static final String KEY_SLIDER_HEADER = "sliderHeader";
- public static final String KEY_SLIDER_FOOTER = "sliderFooter";
- public static final String KEY_POSITION = "position";
- public static final String KEY_TIMEOUT = "timeout";
- /**
- * Constructs a new Slider object
- */
- public Slider() {
- super(FunctionID.SLIDER.toString());
- }
-
- /**
- * Constructs a new Slider object indicated by the Hashtable parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public Slider(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new Slider object \
- * @param numTicks Number of selectable items on a horizontal axis.
- * @param position Initial position of slider control (cannot exceed numTicks)
- * @param sliderHeader Text header to display
- */
- public Slider(@NonNull Integer numTicks, @NonNull Integer position, @NonNull String sliderHeader){
- this();
- setNumTicks(numTicks);
- setPosition(position);
- setSliderHeader(sliderHeader);
- }
-
- /**
- * Sets a number of selectable items on a horizontal axis
- *
- * @param numTicks
- * an Integer value representing a number of selectable items on
- * a horizontal axis
- * <p></p>
- * <b>Notes: </b>Minvalue=2; Maxvalue=26
- */
- public void setNumTicks(@NonNull Integer numTicks) {
- setParameters(KEY_NUM_TICKS, numTicks);
- }
-
- /**
- * Gets a number of selectable items on a horizontal axis
- *
- * @return Integer -an Integer value representing a number of selectable
- * items on a horizontal axis
- */
- public Integer getNumTicks() {
- return getInteger(KEY_NUM_TICKS);
- }
-
- /**
- * Sets an Initial position of slider control
- *
- * @param position
- * an Integer value representing an Initial position of slider
- * control
- * <p></p>
- * <b>Notes: </b>Minvalue=1; Maxvalue=26
- */
- public void setPosition(@NonNull Integer position) {
- setParameters(KEY_POSITION, position);
- }
-
- /**
- * Gets an Initial position of slider control
- *
- * @return Integer -an Integer value representing an Initial position of
- * slider control
- */
- public Integer getPosition() {
- return getInteger(KEY_POSITION);
- }
-
- /**
- * Sets a text header to display
- *
- * @param sliderHeader
- * a String value
- * <p></p>
- * <b>Notes: </b>Maxlength=500
- */
- public void setSliderHeader(@NonNull String sliderHeader) {
- setParameters(KEY_SLIDER_HEADER, sliderHeader);
- }
-
- /**
- * Gets a text header to display
- *
- * @return String -a String value representing a text header to display
- */
- public String getSliderHeader() {
- return getString(KEY_SLIDER_HEADER);
- }
-
- /**
- * Sets a text footer to display
- *
- * @param sliderFooter
- * a List<String> value representing a text footer to display
- * <p></p>
- * <b>Notes: </b>Maxlength=500; Minvalue=1; Maxvalue=26
- */
- public void setSliderFooter(List<String> sliderFooter) {
- setParameters(KEY_SLIDER_FOOTER, sliderFooter);
- }
-
- /**
- * Gets a text footer to display
- *
- * @return String -a String value representing a text footer to display
- */
- @SuppressWarnings("unchecked")
- public List<String> getSliderFooter() {
- return (List<String>) getObject(String.class, KEY_SLIDER_FOOTER);
- }
-
- /**
- * Sets an App defined timeout
- *
- * @param timeout
- * an Integer value representing an App defined timeout
- * <p></p>
- * <b>Notes: </b>Minvalue=0; Maxvalue=65535; Defvalue=10000
- */
- public void setTimeout(Integer timeout) {
- setParameters(KEY_TIMEOUT, timeout);
- }
-
- /**
- * Gets an App defined timeout
- * @return Integer -an Integer value representing an App defined timeout
- */
- public Integer getTimeout() {
- return getInteger(KEY_TIMEOUT);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java
deleted file mode 100644
index b7f4a08a6..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-/**
- * Slider Response is sent, when Slider has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class SliderResponse extends RPCResponse {
- public static final String KEY_SLIDER_POSITION = "sliderPosition";
-
- /**
- * Constructs a new SliderResponse object
- */
- public SliderResponse() {
- super(FunctionID.SLIDER.toString());
- }
-
- /**
- * Constructs a new SliderResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public SliderResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SliderResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SliderResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- /**
- * Sets an Initial position of slider control
- * @param sliderPosition
- */
- public void setSliderPosition(Integer sliderPosition) {
- setParameters(KEY_SLIDER_POSITION, sliderPosition);
- }
- /**
- * Gets an Initial position of slider control
- * @return Integer
- */
- public Integer getSliderPosition() {
- return getInteger(KEY_SLIDER_POSITION);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java
deleted file mode 100644
index 751729220..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
-import com.smartdevicelink.proxy.rpc.enums.SystemAction;
-import com.smartdevicelink.util.DebugTool;
-/**
- * <p> A simulated button or keyboard key that is displayed on a touch screen.</p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>type</td>
- * <td>SoftButtonType</td>
- * <td>Describes, whether it is text, highlighted text, icon, or dynamic image. </td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>text</td>
- * <td>String</td>
- * <td>Optional text to display (if defined as TEXT or BOTH)</td>
- * <td>N</td>
- * <td>Min: 0; Maxlength: 500</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>image</td>
- * <td>Image</td>
- * <td>Optional image struct for SoftButton (if defined as IMAGE or BOTH).</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>isHighlighted</td>
- * <td>Boolean</td>
- * <td>True, if highlighted False, if not highlighted</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>softButtonID</td>
- * <td>Integer</td>
- * <td>Value which is returned via OnButtonPress / OnButtonEvent</td>
- * <td></td>
- * <td>Min: 0; Max: 65535</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>systemAction</td>
- * <td>SystemAction</td>
- * <td>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</td>
- * <td>N</td>
- * <td>defvalue: DEFAULT_ACTION</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * </table>
- *
- */
-public class SoftButton extends RPCStruct {
-
- public static final String KEY_IS_HIGHLIGHTED = "isHighlighted";
- public static final String KEY_SOFT_BUTTON_ID = "softButtonID";
- public static final String KEY_SYSTEM_ACTION = "systemAction";
- public static final String KEY_TEXT = "text";
- public static final String KEY_TYPE = "type";
- public static final String KEY_IMAGE = "image";
-
- public SoftButton() { }
-
- /**
- *
- * <p>Constructs a new SoftButton object indicated by the Hashtable
- * parameter</p>
- *
- * @param hash The Hashtable to use
- */
- public SoftButton(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SoftButton object
- * @param type Describes, whether it is text, highlighted text, icon, or dynamic image.
- * @param softButtonID Value which is returned via OnButtonPress / OnButtonEvent
- */
- public SoftButton(@NonNull SoftButtonType type, @NonNull Integer softButtonID){
- this();
- setType(type);
- setSoftButtonID(softButtonID);
- }
-
- public void setType(@NonNull SoftButtonType type) {
- setValue(KEY_TYPE, type);
- }
- public SoftButtonType getType() {
- return (SoftButtonType) getObject(SoftButtonType.class, KEY_TYPE);
- }
- public void setText(String text) {
- setValue(KEY_TEXT, text);
- }
- public String getText() {
- return getString(KEY_TEXT);
- }
- public void setImage(Image image) {
- setValue(KEY_IMAGE, image);
- }
- @SuppressWarnings("unchecked")
- public Image getImage() {
- return (Image) getObject(Image.class, KEY_IMAGE);
- }
- public void setIsHighlighted(Boolean isHighlighted) {
- setValue(KEY_IS_HIGHLIGHTED, isHighlighted);
- }
- public Boolean getIsHighlighted() {
- return getBoolean(KEY_IS_HIGHLIGHTED);
- }
- public void setSoftButtonID(@NonNull Integer softButtonID) {
- setValue(KEY_SOFT_BUTTON_ID, softButtonID);
- }
- public Integer getSoftButtonID() {
- return getInteger(KEY_SOFT_BUTTON_ID);
- }
- public void setSystemAction(SystemAction systemAction) {
- setValue(KEY_SYSTEM_ACTION, systemAction);
- }
- public SystemAction getSystemAction() {
- return (SystemAction) getObject(SystemAction.class, KEY_SYSTEM_ACTION);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java
deleted file mode 100644
index 9299e1b2b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/**
- * <p>Contains information about a SoftButton's capabilities.</p>
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>shortPressAvailable</td>
- * <td>Boolean</td>
- * <td>The button supports a short press.
- * Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>longPressAvailable</td>
- * <td>Boolean</td>
- * <td>The button supports a LONG press.
- * Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>upDownAvailable</td>
- * <td>Boolean</td>
- * <td>The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
- * Whenever the button is released, onButtonEvent( UP) will be invoked. *
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>imageSupported</td>
- * <td>Boolean</td>
- * <td>The button supports referencing a static or dynamic image.
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class SoftButtonCapabilities extends RPCStruct {
- public static final String KEY_IMAGE_SUPPORTED = "imageSupported";
- public static final String KEY_SHORT_PRESS_AVAILABLE = "shortPressAvailable";
- public static final String KEY_LONG_PRESS_AVAILABLE = "longPressAvailable";
- public static final String KEY_UP_DOWN_AVAILABLE = "upDownAvailable";
-
- /**
- * Constructs a newly allocated SoftButtonCapabilities object
- */
- public SoftButtonCapabilities() { }
-
- /**
- * Constructs a newly allocated SoftButtonCapabilities object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public SoftButtonCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated SoftButtonCapabilities object
- * @param shortPressAvailable The button supports a short press.
- * @param longPressAvailable The button supports a LONG press
- * @param upDownAvailable The button supports "button down" and "button up".
- * @param imageSupported The button supports referencing a static or dynamic image.
- */
- public SoftButtonCapabilities(@NonNull Boolean shortPressAvailable, @NonNull Boolean longPressAvailable, @NonNull Boolean upDownAvailable, @NonNull Boolean imageSupported){
- this();
- setShortPressAvailable(shortPressAvailable);
- setLongPressAvailable(longPressAvailable);
- setUpDownAvailable(upDownAvailable);
- setImageSupported(imageSupported);
- }
-
- /**
- * set the button supports a short press.
- * @param shortPressAvailable whether the button supports a short press.
- */
- public void setShortPressAvailable(@NonNull Boolean shortPressAvailable) {
- setValue(KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable);
- }
-
- /**
- * get whether the button supports a short press.
- * @return whether the button supports a short press
- */
- public Boolean getShortPressAvailable() {
- return getBoolean( KEY_SHORT_PRESS_AVAILABLE);
- }
-
- /**
- * set the button supports a LONG press.
- * @param longPressAvailable whether the button supports a long press
- */
- public void setLongPressAvailable(@NonNull Boolean longPressAvailable) {
- setValue(KEY_LONG_PRESS_AVAILABLE, longPressAvailable);
- }
-
- /**
- * get whether the button supports a LONG press.
- * @return whether the button supports a LONG press
- */
- public Boolean getLongPressAvailable() {
- return getBoolean( KEY_LONG_PRESS_AVAILABLE);
- }
-
- /**
- * set the button supports "button down" and "button up".
- * @param upDownAvailable the button supports "button down" and "button up".
- */
- public void setUpDownAvailable(@NonNull Boolean upDownAvailable) {
- setValue(KEY_UP_DOWN_AVAILABLE, upDownAvailable);
- }
-
- /**
- * get the button supports "button down" and "button up".
- * @return the button supports "button down" and "button up".
- */
- public Boolean getUpDownAvailable() {
- return getBoolean( KEY_UP_DOWN_AVAILABLE);
- }
-
- /**
- * set the button supports referencing a static or dynamic image.
- * @param imageSupported whether the button supports referencing a static or dynamic image.
- */
- public void setImageSupported(@NonNull Boolean imageSupported) {
- setValue(KEY_IMAGE_SUPPORTED, imageSupported);
- }
-
- /**
- * get the button supports referencing a static or dynamic image.
- * @return the button supports referencing a static or dynamic image.
- */
- public Boolean getImageSupported() {
- return getBoolean( KEY_IMAGE_SUPPORTED);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java
deleted file mode 100644
index 8a0b3a380..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java
+++ /dev/null
@@ -1,168 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Speaks a phrase over the vehicle audio system using SDL's TTS
- * (text-to-speech) engine. The provided text to be spoken can be simply a text
- * phrase, or it can consist of phoneme specifications to direct SDL's TTS
- * engine to speak a "speech-sculpted" phrase
- * <p></p>
- * Receipt of the Response indicates the completion of the Speak operation,
- * regardless of how the Speak operation may have completed (i.e. successfully,
- * interrupted, terminated, etc.)
- * <p></p>
- * Requesting a new Speak operation while the application has another Speak
- * operation already in progress (i.e. no corresponding Response for that
- * in-progress Speak operation has been received yet) will terminate the
- * in-progress Speak operation (causing its corresponding Response to be sent by
- * SDL) and begin the requested Speak operation
- * <p></p>
- * Requesting a new Speak operation while the application has an <i>
- * {@linkplain Alert}</i> operation already in progress (i.e. no corresponding
- * Response for that in-progress <i>{@linkplain Alert}</i> operation has been
- * received yet) will result in the Speak operation request being rejected
- * (indicated in the Response to the Request)
- * <p></p>
- * Requesting a new <i>{@linkplain Alert}</i> operation while the application
- * has a Speak operation already in progress (i.e. no corresponding Response for
- * that in-progress Speak operation has been received yet) will terminate the
- * in-progress Speak operation (causing its corresponding Response to be sent by
- * SDL) and begin the requested <i>{@linkplain Alert}</i> operation
- * <p></p>
- * Requesting a new Speak operation while the application has a <i>
- * {@linkplain PerformInteraction}</i> operation already in progress (i.e. no
- * corresponding Response for that in-progress <i>
- * {@linkplain PerformInteraction}</i> operation has been received yet) will
- * result in the Speak operation request being rejected (indicated in the
- * Response to the Request)
- * <p></p>
- * Requesting a <i> {@linkplain PerformInteraction}</i> operation while the
- * application has a Speak operation already in progress (i.e. no corresponding
- * Response for that in-progress Speak operation has been received yet) will
- * terminate the in-progress Speak operation (causing its corresponding Response
- * to be sent by SDL) and begin the requested <i>
- * {@linkplain PerformInteraction}</i> operation
- * <p></p>
- *
- * <p><b>HMI Status Requirements:</b></p>
- * <p>HMILevel: FULL, Limited</p>
- *<p> AudioStreamingState: Any</p>
- * <p>SystemContext: MAIN, MENU, VR</p>
- *
- * <p><b>Notes: </b></p>
- * <ul>
- * <li>When <i>{@linkplain Alert}</i> is issued with MENU in effect, <i>
- * {@linkplain Alert}</i> is queued and "played" when MENU interaction is
- * completed (i.e. SystemContext reverts to MAIN). When <i>{@linkplain Alert}
- * </i> is issued with VR in effect, <i>{@linkplain Alert}</i> is queued and
- * "played" when VR interaction is completed (i.e. SystemContext reverts to
- * MAIN)</li>
- * <li>When both <i>{@linkplain Alert}</i> and Speak are queued during MENU or
- * VR, they are "played" back in the order in which they were queued, with all
- * existing rules for "collisions" still in effect</li>
- * </ul>
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th> Ver. Available</th>
- * </tr>
- * <tr>
- * <td>ttsChunks</td>
- * <td>String</td>
- * <td>An array of 1-100 TTSChunk structs which, taken together, specify the phrase to be spoken.</td>
- * <td>Y</td>
- * <td><p>The array must have 1-100 elements. </p><p>The total length of the phrase composed from the ttsChunks provided must be less than 500 characters or the request will be rejected. </p>Each chunk can be no more than 500 characters.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * <p><b>Response</b> </p>
- * <p>This Response notifies the application of the completion, interruption, or failure of a Speak Request.</p>
- *
- * <p><b>Non-default Result Codes:</b> </p>
- *
- * <p> SUCCESS </p>
- *<p> INVALID_DATA</p>
- * <p> OUT_OF_MEMORY </p>
- * <p>APPLICATION_NOT_REGISTERED </p>
- * <p>TOO_MANY_PENDING_REQUESTS </p>
- *<p> GENERIC_ERROR </p>
- * <p>REJECTED </p>
- * <p>DISALLOWED </p>
- * <p>ABORTED </p>
- *
- * <p><b>Additional Notes:</b></p><ul>Total character limit depends on platform. Chunks are limited to 500 characters; however you can have multiple TTS chunks. On Gen 1.1 there is a total character limit of 500 characters across all chunks. This could vary according to the VCA.
- *
- * @since SmartDeviceLink 1.0
- * @see Alert
- */
-public class Speak extends RPCRequest {
- public static final String KEY_TTS_CHUNKS = "ttsChunks";
-
- /**
- * Constructs a new Speak object
- */
- public Speak() {
- super(FunctionID.SPEAK.toString());
- }
- /**
- * Constructs a new Speak object indicated by the Hashtable parameter
- * <p></p>
- *
- * @param hash The Hashtable to use
- */
- public Speak(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new Speak object
- * @param ttsChunks An array of 1-100 TTSChunk structs which, taken together, specify the phrase to be spoken.
- */
- public Speak(@NonNull List<TTSChunk> ttsChunks){
- this();
- setTtsChunks(ttsChunks);
- }
- /**
- * Gets a List<TTSChunk> representing an array of 1-100 TTSChunk structs
- * which, taken together, specify the phrase to be spoken
- *
- * @return List<TTSChunk> -an Array of 1-100 TTSChunk specify the phrase to be spoken
- */
- @SuppressWarnings("unchecked")
- public List<TTSChunk> getTtsChunks() {
- return (List<TTSChunk>) getObject(TTSChunk.class, KEY_TTS_CHUNKS);
- }
- /**
- * Sets a List<TTSChunk> representing an array of 1-100 TTSChunk structs
- * which, taken together, specify the phrase to be spoken
- *
- * @param ttsChunks
- * a List<TTSChunk> value representing an array of 1-100 TTSChunk structs
- * which specify the phrase to be spoken
- * <p></p>
- * <ul>
- * <li>The array must have 1-100 elements</li>
- * <li>The total length of the phrase composed from the ttsChunks
- * provided must be less than 500 characters or the request will
- * be rejected</li>
- * <li>Each chunk can be no more than 500 characters</li>
- * </ul>
- */
- public void setTtsChunks( @NonNull List<TTSChunk> ttsChunks ) {
- setParameters(KEY_TTS_CHUNKS, ttsChunks);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java
deleted file mode 100644
index 5f78b609b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SpeakResponse.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Speak Response is sent, when Speak has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class SpeakResponse extends RPCResponse {
-
- /**
- * Constructs a new SpeakResponse object
- */
- public SpeakResponse() {
- super(FunctionID.SPEAK.toString());
- }
-
- /**
- * Constructs a new SpeakResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public SpeakResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SpeakResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SpeakResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java
deleted file mode 100644
index e047a716b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/**
- * Describes the hour, minute and second values used to set the media clock.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>hours</td>
- * <td>Integer</td>
- * <td>The hour. Minvalue="0", maxvalue="59"
- * <p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>minutes</td>
- * <td>Integer</td>
- * <td>The minute. Minvalue="0", maxvalue="59".</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>seconds</td>
- * <td>Integer</td>
- * <td>The second. Minvalue="0", maxvalue="59".</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- */
-public class StartTime extends RPCStruct {
- public static final String KEY_MINUTES = "minutes";
- public static final String KEY_SECONDS = "seconds";
- public static final String KEY_HOURS = "hours";
-
- /**
- * Constructs a newly allocated StartTime object
- */
- public StartTime() { }
- /**
- * Constructs a newly allocated StartTime object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public StartTime(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated StartTime object
- * @param hours The hour
- * @param minutes The minute
- * @param seconds The second
- */
- public StartTime(@NonNull Integer hours, @NonNull Integer minutes, @NonNull Integer seconds){
- this();
- setHours(hours);
- setMinutes(minutes);
- setSeconds(seconds);
- }
- /**
- * Get the hour. Minvalue="0", maxvalue="59"
- * <p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
- * @return hours Minvalue="0", maxvalue="59"
- */
- public Integer getHours() {
- return getInteger( KEY_HOURS );
- }
- /**
- * Set the hour. Minvalue="0", maxvalue="59"
- * <p><b>Note:</b></p>Some display types only support a max value of 19. If out of range, it will be rejected.
- * @param hours min: 0; max: 59
- */
- public void setHours(@NonNull Integer hours ) {
- setValue(KEY_HOURS, hours);
- }
- /**
- * Get the minute. Minvalue="0", maxvalue="59".
- * @return minutes Minvalue="0", maxvalue="59"
- */
- public Integer getMinutes() {
- return getInteger( KEY_MINUTES );
- }
- /**
- * Set the minute. Minvalue="0", maxvalue="59".
- * @param minutes min: 0; max: 59
- */
- public void setMinutes( @NonNull Integer minutes ) {
- setValue(KEY_MINUTES, minutes);
- }
- /**
- * Get the second. Minvalue="0", maxvalue="59".
- * @return seconds. Minvalue="0", maxvalue="59".
- */
- public Integer getSeconds() {
- return getInteger( KEY_SECONDS );
- }
- /**
- * Set the second. Minvalue="0", maxvalue="59".
- * @param seconds min: 0 max: 59
- */
- public void setSeconds( @NonNull Integer seconds ) {
- setValue(KEY_SECONDS, seconds);
- }
-}
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
deleted file mode 100644
index a8e926a2b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java
+++ /dev/null
@@ -1,54 +0,0 @@
-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/StreamRPCResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StreamRPCResponse.java
deleted file mode 100644
index d1de24993..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StreamRPCResponse.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-
-import java.util.Hashtable;
-
-public class StreamRPCResponse extends RPCResponse {
- public static final String KEY_FILENAME = "fileName";
- public static final String KEY_FILESIZE = "fileSize";
-
- public StreamRPCResponse() {
- super(FunctionID.STREAM_RPC.toString());
- }
- public StreamRPCResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public void setFileName(String fileName) {
- setParameters(KEY_FILENAME, fileName);
- }
- public String getFileName() {
- return getString(KEY_FILENAME);
- }
-
- public void setFileSize(Long fileSize) {
- setParameters(KEY_FILESIZE, fileSize);
- }
- public Long getFileSize() {
- return getLong(KEY_FILESIZE);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java
deleted file mode 100644
index 80e988e35..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-
-import java.util.Hashtable;
-
-/**
- *<p> Establishes a subscription to button notifications for HMI buttons. Buttons
- * are not necessarily physical buttons, but can also be "soft" buttons on a
- * touch screen, depending on the display in the vehicle. Once subscribed to a
- * particular button, an application will receive both
- * {@linkplain OnButtonEvent} and {@linkplain OnButtonPress} notifications
- * whenever that button is pressed. The application may also unsubscribe from
- * notifications for a button by invoking the {@linkplain UnsubscribeButton}
- * operation</p>
- *
- * <p>When a button is depressed, an {@linkplain OnButtonEvent} notification is
- * sent to the application with a ButtonEventMode of BUTTONDOWN. When that same
- * button is released, an {@linkplain OnButtonEvent} notification is sent to the
- * application with a ButtonEventMode of BUTTONUP</p>
- *
- * <p>When the duration of a button depression (that is, time between depression
- * and release) is less than two seconds, an {@linkplain OnButtonPress}
- * notification is sent to the application (at the moment the button is
- * released) with a ButtonPressMode of SHORT. When the duration is two or more
- * seconds, an {@linkplain OnButtonPress} notification is sent to the
- * application (at the moment the two seconds have elapsed) with a
- * ButtonPressMode of LONG</p>
- *
- * The purpose of {@linkplain OnButtonPress} notifications is to allow for
- * programmatic detection of long button presses similar to those used to store
- * presets while listening to the radio, for example
- *
- * <p>When a button is depressed and released, the sequence in which notifications
- * will be sent to the application is as follows:</p>
- *
- * <p>For short presses:</p>
- * <ul>
- * <li>OnButtonEvent (ButtonEventMode = BUTTONDOWN)</li>
- * <li>OnButtonEvent (ButtonEventMode = BUTTONUP)</li>
- * <li>OnButtonPress (ButtonPressMode = SHORT)</li>
- * </ul>
- *
- * <p>For long presses:</p>
- * <ul>
- * <li>OnButtonEvent (ButtonEventMode = BUTTONDOWN)</li>
- * <li>OnButtonEvent (ButtonEventMode = BUTTONUP)</li>
- * <li>OnButtonPress (ButtonPressMode = LONG)</li>
- * </ul>
- *
- *<p> <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>buttonName</td>
- * <td>ButtonName</td>
- * <td>Name of the button to subscribe.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0 </td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- * @see UnsubscribeButton
- */
-public class SubscribeButton extends RPCRequest {
- public static final String KEY_BUTTON_NAME = "buttonName";
-
- /**
- * Constructs a new SubscribeButton object
- */
- public SubscribeButton() {
- super(FunctionID.SUBSCRIBE_BUTTON.toString());
- }
- /**
- * <p>Constructs a new SubscribeButton object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash The Hashtable to use
- */
- public SubscribeButton(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SubscribeButton object
- * @param buttonName Name of the button to subscribe.
- */
- public SubscribeButton(@NonNull ButtonName buttonName){
- this();
- setButtonName(buttonName);
- }
- /**
- * Gets the name of the button to subscribe to
- * @return ButtonName -an enum value, see <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i>
- */
- public ButtonName getButtonName() {
- return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
- }
- /**
- * Sets a name of the button to subscribe to
- * @param buttonName a <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i> value
- */
- public void setButtonName(@NonNull ButtonName buttonName ) {
- setParameters(KEY_BUTTON_NAME, buttonName);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java
deleted file mode 100644
index fbed88bbc..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButtonResponse.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Sub scribeButton Response is sent, when SubscribeButton has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class SubscribeButtonResponse extends RPCResponse {
-
- /**
- * Constructs a new SubscribeButtonResponse object
- */
- public SubscribeButtonResponse() {
- super(FunctionID.SUBSCRIBE_BUTTON.toString());
- }
-
- /**
- * <p>Constructs a new SubscribeButtonResponse object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash The Hashtable to use
- */
- public SubscribeButtonResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SubscribeButtonResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SubscribeButtonResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java
deleted file mode 100644
index 420d907b1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java
+++ /dev/null
@@ -1,811 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Subscribes for specific published vehicle data items. The data will be only
- * sent, if it has changed. The application will be notified by the
- * onVehicleData notification whenever new data is available. The update rate is
- * very much dependent on sensors, vehicle architecture and vehicle type. Be
- * also prepared for the situation that a signal is not available on a vehicle
- *
- * <p>Function Group: Location, VehicleInfo and DrivingChara</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Version</th>
- * </tr>
- * <tr>
- * <td>gps</td>
- * <td>Boolean</td>
- * <td>GPS data. See {@linkplain GPSData}for details</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>speed</td>
- * <td>Boolean</td>
- * <td>The vehicle speed in kilometers per hour</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>rpm</td>
- * <td>Boolean</td>
- * <td>The number of revolutions per minute of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>fuelLevel</td>
- * <td>Boolean</td>
- * <td>The fuel level in the tank (percentage)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>fuelLevel_State</td>
- * <td>Boolean</td>
- * <td>The fuel level state</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>instantFuelConsumption</td>
- * <td>Boolean</td>
- * <td>The instantaneous fuel consumption in microlitres</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>externalTemperature</td>
- * <td>Boolean</td>
- * <td>The external temperature in degrees celsius</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>prndl</td>
- * <td>Boolean</td>
- * <td>Currently selected gear.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>tirePressure</td>
- * <td>Boolean</td>
- * <td>Tire pressure status</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>odometer</td>
- * <td>Boolean</td>
- * <td>Odometer in km</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>beltStatus</td>
- * <td>Boolean</td>
- * <td>The status of the seat belts</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>bodyInformation</td>
- * <td>Boolean</td>
- * <td>The body information including ignition status and internal temp</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>deviceStatus</td>
- * <td>Boolean</td>
- * <td>The device status including signal and battery strength</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>driverBraking</td>
- * <td>Boolean</td>
- * <td>The status of the brake pedal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>wiperStatus</td>
- * <td>Boolean</td>
- * <td>The status of the wipers</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>headLampStatus</td>
- * <td>Boolean</td>
- * <td>Status of the head lamps</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>engineTorque</td>
- * <td>Boolean</td>
- * <td>Torque value for engine (in Nm) on non-diesel variants</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>engineOilLife</td>
- * <td>Boolean</td>
- * <td>The estimated percentage of remaining oil life of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0 </td>
- * </tr>
- * <tr>
- * <td>accPedalPosition</td>
- * <td>Boolean</td>
- * <td>Accelerator pedal position (percentage depressed)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>steeringWheelAngle</td>
- * <td>Boolean</td>
- * <td>Current angle of the steering wheel (in deg)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>eCallInfo</td>
- * <td>Boolean</td>
- * <td>Emergency Call notification and confirmation data.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>airbagStatus</td>
- * <td>Boolean</td>
- * <td>The status of the air bags.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>emergencyEvent</td>
- * <td>Boolean</td>
- * <td>Information related to an emergency event (and if it occurred).</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>clusterModeStatus</td>
- * <td>Boolean</td>
- * <td>The status modes of the instrument panel cluster.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>myKey</td>
- * <td>Boolean</td>
- * <td>Information related to the MyKey feature.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>turnSignal</td>
- * <td>Boolean</td>
- * <td>@see TurnSignal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0 </td>
- * </tr>
- * </table>
- *
- * <p> <b>Response</b></p>
- *<p><b>Non-default Result Codes:</b></p>
- *<p>SUCCESS</p>
- *<p>WARNINGS </p>
- *<p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>IGNORED </p>
- * <p>DISALLOWED</p>
- * <p>USER_DISALLOWED </p>
- *
- * @since SmartDeviceLink 2.0
- * @see UnsubscribeVehicleData
- * @see GetVehicleData
- */
-public class SubscribeVehicleData extends RPCRequest {
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_SPEED = "speed";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
-
- /**
- * Constructs a new SubscribeVehicleData object
- */
- public SubscribeVehicleData() {
- super(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new SubscribeVehicleData object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public SubscribeVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Gps data
- *
- * @param gps
- * a boolean value
- */
- public void setGps(Boolean gps) {
- setParameters(KEY_GPS, gps);
- }
-
- /**
- * Gets a boolean value. If true, means the Gps data has been subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Gps data has been
- * subscribed.
- */
- public Boolean getGps() {
- return getBoolean(KEY_GPS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes speed data
- *
- * @param speed
- * a boolean value
- */
- public void setSpeed(Boolean speed) {
- setParameters(KEY_SPEED, speed);
- }
-
- /**
- * Gets a boolean value. If true, means the Speed data has been subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Speed data has been
- * subscribed.
- */
- public Boolean getSpeed() {
- return getBoolean(KEY_SPEED);
- }
-
- /**
- * Sets a boolean value. If true, subscribes rpm data
- *
- * @param rpm
- * a boolean value
- */
- public void setRpm(Boolean rpm) {
- setParameters(KEY_RPM, rpm);
- }
-
- /**
- * Gets a boolean value. If true, means the rpm data has been subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the rpm data has been
- * subscribed.
- */
- public Boolean getRpm() {
- return getBoolean(KEY_RPM);
- }
-
- /**
- * Sets a boolean value. If true, subscribes FuelLevel data
- *
- * @param fuelLevel
- * a boolean value
- */
- public void setFuelLevel(Boolean fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- }
-
- /**
- * Gets a boolean value. If true, means the FuelLevel data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the FuelLevel data has
- * been subscribed.
- */
- public Boolean getFuelLevel() {
- return getBoolean(KEY_FUEL_LEVEL);
- }
-
- /**
- * Sets a boolean value. If true, subscribes fuelLevel_State data
- *
- * @param fuelLevel_State
- * a boolean value
- */
- @Deprecated
- public void setFuelLevel_State(Boolean fuelLevel_State) {
- setFuelLevelState(fuelLevel_State);
- }
-
- /**
- * Gets a boolean value. If true, means the fuelLevel_State data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the fuelLevel_State data
- * has been subscribed.
- */
- @Deprecated
- public Boolean getFuelLevel_State() {
- return getFuelLevelState();
- }
-
- /**
- * Sets a boolean value. If true, subscribes fuelLevelState data
- *
- * @param fuelLevelState
- * a boolean value
- */
- public void setFuelLevelState(Boolean fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- }
-
- /**
- * Gets a boolean value. If true, means the fuelLevelState data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the fuelLevelState data
- * has been subscribed.
- */
- public Boolean getFuelLevelState() {
- return getBoolean(KEY_FUEL_LEVEL_STATE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes instantFuelConsumption data
- *
- * @param instantFuelConsumption
- * a boolean value
- */
- public void setInstantFuelConsumption(Boolean instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- }
-
- /**
- * Gets a boolean value. If true, means the getInstantFuelConsumption data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the getInstantFuelConsumption data
- * has been subscribed.
- */
- public Boolean getInstantFuelConsumption() {
- return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
- }
-
- /**
- * Sets a boolean value. If true, subscribes externalTemperature data
- *
- * @param externalTemperature
- * a boolean value
- */
- public void setExternalTemperature(Boolean externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- }
-
- /**
- * Gets a boolean value. If true, means the externalTemperature data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the externalTemperature data
- * has been subscribed.
- */
- public Boolean getExternalTemperature() {
- return getBoolean(KEY_EXTERNAL_TEMPERATURE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Currently selected gear data
- *
- * @param prndl
- * a boolean value
- */
- public void setPrndl(Boolean prndl) {
- setParameters(KEY_PRNDL, prndl);
- }
-
- /**
- * Gets a boolean value. If true, means the Currently selected gear data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Currently selected gear data
- * has been subscribed.
- */
- public Boolean getPrndl() {
- return getBoolean(KEY_PRNDL);
- }
-
- /**
- * Sets a boolean value. If true, subscribes tire pressure status data
- *
- * @param tirePressure
- * a boolean value
- */
- public void setTirePressure(Boolean tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- }
-
- /**
- * Gets a boolean value. If true, means the tire pressure status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the tire pressure status data
- * has been subscribed.
- */
- public Boolean getTirePressure() {
- return getBoolean(KEY_TIRE_PRESSURE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes odometer data
- *
- * @param odometer
- * a boolean value
- */
- public void setOdometer(Boolean odometer) {
- setParameters(KEY_ODOMETER, odometer);
- }
-
- /**
- * Gets a boolean value. If true, means the odometer data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the odometer data
- * has been subscribed.
- */
- public Boolean getOdometer() {
- return getBoolean(KEY_ODOMETER);
- }
-
- /**
- * Sets a boolean value. If true, subscribes belt Status data
- *
- * @param beltStatus
- * a boolean value
- */
- public void setBeltStatus(Boolean beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the belt Status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the belt Status data
- * has been subscribed.
- */
- public Boolean getBeltStatus() {
- return getBoolean(KEY_BELT_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes body Information data
- *
- * @param bodyInformation
- * a boolean value
- */
- public void setBodyInformation(Boolean bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- }
-
- /**
- * Gets a boolean value. If true, means the body Information data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the body Information data
- * has been subscribed.
- */
- public Boolean getBodyInformation() {
- return getBoolean(KEY_BODY_INFORMATION);
- }
-
- /**
- * Sets a boolean value. If true, subscribes device Status data
- *
- * @param deviceStatus
- * a boolean value
- */
- public void setDeviceStatus(Boolean deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the device Status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the device Status data
- * has been subscribed.
- */
- public Boolean getDeviceStatus() {
- return getBoolean(KEY_DEVICE_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes driver Braking data
- *
- * @param driverBraking
- * a boolean value
- */
- public void setDriverBraking(Boolean driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- }
-
- /**
- * Gets a boolean value. If true, means the driver Braking data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the driver Braking data
- * has been subscribed.
- */
- public Boolean getDriverBraking() {
- return getBoolean(KEY_DRIVER_BRAKING);
- }
-
- /**
- * Sets a boolean value. If true, subscribes wiper Status data
- *
- * @param wiperStatus
- * a boolean value
- */
- public void setWiperStatus(Boolean wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the wiper Status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the wiper Status data
- * has been subscribed.
- */
- public Boolean getWiperStatus() {
- return getBoolean(KEY_WIPER_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Head Lamp Status data
- *
- * @param headLampStatus
- * a boolean value
- */
- public void setHeadLampStatus(Boolean headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the Head Lamp Status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Head Lamp Status data
- * has been subscribed.
- */
- public Boolean getHeadLampStatus() {
- return getBoolean(KEY_HEAD_LAMP_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Engine Torque data
- *
- * @param engineTorque
- * a boolean value
- */
- public void setEngineTorque(Boolean engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
-
- /**
- * Gets a boolean value. If true, means the Engine Oil Life data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Engine Oil Life data
- * has been subscribed.
- */
- public Boolean getEngineOilLife() {
- return getBoolean(KEY_ENGINE_OIL_LIFE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Engine Oil Life data
- *
- * @param engineOilLife
- * a boolean value
- */
- public void setEngineOilLife(Boolean engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
-
- /**
- * Gets a boolean value. If true, means the Engine Torque data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Engine Torque data
- * has been subscribed.
- */
- public Boolean getEngineTorque() {
- return getBoolean(KEY_ENGINE_TORQUE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes accPedalPosition data
- *
- * @param accPedalPosition
- * a boolean value
- */
- public void setAccPedalPosition(Boolean accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- }
-
- /**
- * Gets a boolean value. If true, means the accPedalPosition data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the accPedalPosition data
- * has been subscribed.
- */
- public Boolean getAccPedalPosition() {
- return getBoolean(KEY_ACC_PEDAL_POSITION);
- }
-
- public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- }
-
- public Boolean getSteeringWheelAngle() {
- return getBoolean(KEY_STEERING_WHEEL_ANGLE);
- }
- public void setECallInfo(Boolean eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- }
- public Boolean getECallInfo() {
- return getBoolean(KEY_E_CALL_INFO);
- }
- public void setAirbagStatus(Boolean airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- }
- public Boolean getAirbagStatus() {
- return getBoolean(KEY_AIRBAG_STATUS);
- }
- public void setEmergencyEvent(Boolean emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- }
- public Boolean getEmergencyEvent() {
- return getBoolean(KEY_EMERGENCY_EVENT);
- }
- public void setClusterModeStatus(Boolean clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- }
- public Boolean getClusterModeStatus() {
- return getBoolean(KEY_CLUSTER_MODE_STATUS);
- }
- public void setMyKey(Boolean myKey) {
- setParameters(KEY_MY_KEY, myKey);
- }
- public Boolean getMyKey() {
- return getBoolean(KEY_MY_KEY);
- }
-
- /**
- * Sets a boolean value. If true, subscribes fuelRange data
- *
- * @param fuelRange
- * a boolean value
- */
- public void setFuelRange(Boolean fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
-
- /**
- * Gets a boolean value. If true, means the Fuel Range data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Fuel Range data
- * has been subscribed.
- *
- */
- public Boolean getFuelRange() {
- return getBoolean(KEY_FUEL_RANGE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes turnSignal data
- * @param turnSignal a boolean value
- */
- public void setTurnSignal(Boolean turnSignal) { setParameters(KEY_TURN_SIGNAL, turnSignal); }
-
- /**
- * Gets a boolean value. If true, means the turnSignal data has been subscribed.
- * @return a Boolean value.
- */
- public Boolean getTurnSignal() { return getBoolean(KEY_TURN_SIGNAL); }
-
- /**
- * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
- * @param electronicParkBrakeStatus a boolean value
- */
- public void setElectronicParkBrakeStatus(boolean electronicParkBrakeStatus){
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
- * @return a Boolean value.
- */
- public Boolean getElectronicParkBrakeStatus(){
- return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java
deleted file mode 100644
index 47d32936d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java
+++ /dev/null
@@ -1,469 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-/**
- * Subscribe Vehicle Data Response is sent, when SubscribeVehicleData has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class SubscribeVehicleDataResponse extends RPCResponse {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
-
- /**
- * Constructs a new SubscribeVehicleDataResponse object
- */
- public SubscribeVehicleDataResponse() {
- super(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new SubscribeVehicleDataResponse object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash The Hashtable to use
- */
- public SubscribeVehicleDataResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a new SubscribeVehicleDataResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SubscribeVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
- /**
- * Sets gps
- * @param gps
- */
- public void setGps(VehicleDataResult gps) {
- setParameters(KEY_GPS, gps);
- }
- /**
- * Gets gps
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getGps() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS);
- }
- /**
- * Sets speed
- * @param speed
- */
- public void setSpeed(VehicleDataResult speed) {
- setParameters(KEY_SPEED, speed);
- }
- /**
- * Gets speed
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getSpeed() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED);
- }
- /**
- * Sets rpm
- * @param rpm
- */
- public void setRpm(VehicleDataResult rpm) {
- setParameters(KEY_RPM, rpm);
- }
- /**
- * Gets rpm
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getRpm() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_RPM);
- }
- /**
- * Sets Fuel Level
- * @param fuelLevel
- */
- public void setFuelLevel(VehicleDataResult fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- }
- /**
- * Gets Fuel Level
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getFuelLevel() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL);
- }
- /**
- * Sets Fuel Level State
- * @param fuelLevel_State
- */
- @Deprecated
- public void setFuelLevel_State(VehicleDataResult fuelLevel_State) {
- setFuelLevelState(fuelLevel_State);
- }
- /**
- * Gets Fuel Level State
- * @return VehicleDataResult
- */
- @Deprecated
- public VehicleDataResult getFuelLevel_State() {
- return getFuelLevelState();
- }
- /**
- * Sets Fuel Level State
- * @param fuelLevelState
- */
- public void setFuelLevelState(VehicleDataResult fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- }
- /**
- * Gets Fuel Level State
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getFuelLevelState() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE);
- }
- /**
- * Sets Instant Fuel Comsumption
- * @param instantFuelConsumption
- */
- public void setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- }
- /**
- * Gets Instant Fuel Consumption
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getInstantFuelConsumption() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_INSTANT_FUEL_CONSUMPTION);
- }
- /**
- * Sets External Temperature
- * @param externalTemperature
- */
- public void setExternalTemperature(VehicleDataResult externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- }
- /**
- * Gets External Temperature
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getExternalTemperature() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE);
- }
- /**
- * Sets currently selected gear data
- * @param prndl
- */
- public void setPrndl(VehicleDataResult prndl) {
- setParameters(KEY_PRNDL, prndl);
- }
- /**
- * Gets currently selected gear data
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getPrndl() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL);
- }
- /**
- * Sets Tire Pressure
- * @param tirePressure
- */
- public void setTirePressure(VehicleDataResult tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- }
- /**
- * Gets Tire Pressure
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getTirePressure() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE);
- }
- /**
- * Sets Odometer
- * @param odometer
- */
- public void setOdometer(VehicleDataResult odometer) {
- setParameters(KEY_ODOMETER, odometer);
- }
- /**
- * Gets Odometer
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getOdometer() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER);
- }
- /**
- * Sets Belt Status
- * @param beltStatus
- */
- public void setBeltStatus(VehicleDataResult beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- }
- /**
- * Gets Belt Status
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getBeltStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BELT_STATUS);
- }
- /**
- * Sets Body Information
- * @param bodyInformation
- */
- public void setBodyInformation(VehicleDataResult bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- }
- /**
- * Gets Body Information
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getBodyInformation() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION);
- }
- /**
- * Sets Device Status
- * @param deviceStatus
- */
- public void setDeviceStatus(VehicleDataResult deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- }
- /**
- * Gets Device Status
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getDeviceStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DEVICE_STATUS);
- }
- /**
- * Sets Driver Barking
- * @param driverBraking
- */
- public void setDriverBraking(VehicleDataResult driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- }
- /**
- * Gets Driver Barking
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getDriverBraking() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DRIVER_BRAKING);
- }
- /**
- * Sets wiper Status
- * @param wiperStatus
- */
- public void setWiperStatus(VehicleDataResult wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- }
- /**
- * Gets Wiper Status
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getWiperStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS);
- }
- /**
- * Sets Head Lamp Status
- * @param headLampStatus
- */
- public void setHeadLampStatus(VehicleDataResult headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- }
- /**
- * Gets Head Lamp Status
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getHeadLampStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HEAD_LAMP_STATUS);
- }
- /**
- * Sets Engine Torque
- * @param engineTorque
- */
- public void setEngineTorque(VehicleDataResult engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
- /**
- * Gets Engine Torque
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getEngineTorque() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE);
- }
- /**
- * Sets Engine Oil Life
- * @param engineOilLife
- */
- public void setEngineOilLife(VehicleDataResult engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
- /**
- * Gets Engine Oil Life
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getEngineOilLife() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_OIL_LIFE);
- }
- /**
- * Sets AccPedal Position
- * @param accPedalPosition
- */
- public void setAccPedalPosition(VehicleDataResult accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- }
- /**
- * Gets AccPedal Position
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getAccPedalPosition() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ACC_PEDAL_POSITION);
- }
-
- public void setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- }
-
- @SuppressWarnings("unchecked")
- public VehicleDataResult getSteeringWheelAngle() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE);
- }
-
- public void setECallInfo(VehicleDataResult eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getECallInfo() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO);
- }
- public void setAirbagStatus(VehicleDataResult airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getAirbagStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS);
- }
- public void setEmergencyEvent(VehicleDataResult emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getEmergencyEvent() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT);
- }
- public void setClusterModeStatus(VehicleDataResult clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getClusterModeStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODE_STATUS);
- }
- public void setMyKey(VehicleDataResult myKey) {
- setParameters(KEY_MY_KEY, myKey);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getMyKey() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_MY_KEY);
- }
-
- /**
- * Sets Fuel Range
- * @param fuelRange
- */
- public void setFuelRange(VehicleDataResult fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
-
- /**
- * Gets Fuel Range
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getFuelRange() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE);
- }
-
- /**
- * Sets turnSignal
- * @param turnSignal
- */
- public void setTurnSignal(VehicleDataResult turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- }
-
- /**
- * Gets turnSignal
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getTurnSignal() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets electronicParkBrakeStatus
- * @param electronicParkBrakeStatus
- */
- public void setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus){
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- }
-
- /**
- * Gets electronicParkBrakeStatus
- * @return VehicleDataResult
- */
- public VehicleDataResult getElectronicParkBrakeStatus(){
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPoints.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPoints.java
deleted file mode 100644
index e0d3627e2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPoints.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-public class SubscribeWayPoints extends RPCRequest {
- public SubscribeWayPoints() {
- super(FunctionID.SUBSCRIBE_WAY_POINTS.toString());
- }
- public SubscribeWayPoints(Hashtable<String, Object> hash) {
- super(hash);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java
deleted file mode 100644
index 8ca946c5c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeWayPointsResponse.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-public class SubscribeWayPointsResponse extends RPCResponse {
-
- public SubscribeWayPointsResponse() {
- super(FunctionID.SUBSCRIBE_WAY_POINTS.toString());
- }
- public SubscribeWayPointsResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SubscribeWayPointsResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SubscribeWayPointsResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
deleted file mode 100644
index 6ee294905..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
-
-import java.util.Hashtable;
-
-/**
- * Struct that indicates the a SystemCapabilityType and houses different structs to describe particular capabilities
- */
-
-public class SystemCapability extends RPCStruct {
- public static final String KEY_SYSTEM_CAPABILITY_TYPE = "systemCapabilityType";
- public static final String KEY_NAVIGATION_CAPABILITY = "navigationCapability";
- public static final String KEY_PHONE_CAPABILITY = "phoneCapability";
- public static final String KEY_VIDEO_STREAMING_CAPABILITY = "videoStreamingCapability";
- public static final String KEY_REMOTE_CONTROL_CAPABILITY = "remoteControlCapability";
-
- public SystemCapability(){}
-
- public SystemCapability(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Create a systemCapability object
- * @param systemCapabilityType The type
- */
- public SystemCapability(@NonNull SystemCapabilityType systemCapabilityType){
- this();
- setSystemCapabilityType(systemCapabilityType);
- }
-
- /**
- *
- * @return The SystemCapabilityType that indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist
- */
- public SystemCapabilityType getSystemCapabilityType(){
- return (SystemCapabilityType) getObject(SystemCapabilityType.class, KEY_SYSTEM_CAPABILITY_TYPE);
- }
-
- /**
- * @param value Set the SystemCapabilityType that indicates which type of data should be changed and identifies which data object exists in this struct.
- */
- public void setSystemCapabilityType(@NonNull SystemCapabilityType value){
- setValue(KEY_SYSTEM_CAPABILITY_TYPE, value);
- }
-
- public RPCStruct getCapabilityForType(SystemCapabilityType type) {
- if (type.equals(SystemCapabilityType.NAVIGATION)) {
- return (RPCStruct) getObject(NavigationCapability.class, KEY_NAVIGATION_CAPABILITY);
- } else if (type.equals(SystemCapabilityType.PHONE_CALL)) {
- return (RPCStruct) getObject(PhoneCapability.class, KEY_PHONE_CAPABILITY);
- } else if (type.equals(SystemCapabilityType.VIDEO_STREAMING)){
- return (RPCStruct) getObject(VideoStreamingCapability.class, KEY_VIDEO_STREAMING_CAPABILITY);
- }else if(type.equals(SystemCapabilityType.REMOTE_CONTROL)){
- return (RPCStruct) getObject(RemoteControlCapabilities.class, KEY_REMOTE_CONTROL_CAPABILITY);
- }else{
- return null;
- }
- }
-
- public void setCapabilityForType(SystemCapabilityType type, RPCStruct capability){
- if(type.equals(SystemCapabilityType.NAVIGATION)){
- setValue(KEY_NAVIGATION_CAPABILITY, capability);
- }else if(type.equals(SystemCapabilityType.PHONE_CALL)){
- setValue(KEY_PHONE_CAPABILITY, capability);
- }else if(type.equals(SystemCapabilityType.VIDEO_STREAMING)){
- setValue(KEY_VIDEO_STREAMING_CAPABILITY, capability);
- }else if(type.equals(SystemCapabilityType.REMOTE_CONTROL)){
- setValue(KEY_REMOTE_CONTROL_CAPABILITY, capability);
- }else{
- return;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java
deleted file mode 100644
index ee7dad05b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.RequestType;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/** An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests)
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>requestType</td>
- * <td>RequestType</td>
- * <td>The type of system request. Note that Proprietary requests should forward the binary data to the known proprietary module on the system.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>requestSubType</td>
- * <td>String</td>
- * <td>This parameter is filled for supporting OEM proprietary data exchanges.</td>
- * <td>N</td>
- * <td>Max Length: 255</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>fileName</td>
- * <td>String</td>
- * <td>Filename of HTTP data to store in predefined system staging area. Mandatory if requestType is HTTP. PROPRIETARY requestType should ignore this parameter. </td>
- * <td>N</td>
- * <td>Max Length: 255</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 3.0
- *
- *
- *
- */
-
-public class SystemRequest extends RPCRequest {
- public static final String KEY_FILE_NAME = "fileName";
- public static final String KEY_REQUEST_TYPE = "requestType";
- public static final String KEY_REQUEST_SUB_TYPE = "requestSubType";
- public static final String KEY_DATA = "data";
- /**
- * Constructs a new SystemRequest object
- */
-
- public SystemRequest() {
- super(FunctionID.SYSTEM_REQUEST.toString());
- }
-
- public SystemRequest(boolean bLegacy) {
- super(FunctionID.ENCODED_SYNC_P_DATA.toString());
- }
-
- public SystemRequest(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SystemRequest object
- * @param requestType The type of system request.
- */
- public SystemRequest(@NonNull RequestType requestType){
- this();
- setRequestType(requestType);
- }
-
- @SuppressWarnings("unchecked")
- public List<String> getLegacyData() {
- return (List<String>) getObject(String.class, KEY_DATA);
- }
-
- public void setLegacyData( List<String> data ) {
- setParameters(KEY_DATA, data);
- }
-
- public String getFileName() {
- return getString(KEY_FILE_NAME);
- }
-
- public void setFileName(String fileName) {
- setParameters(KEY_FILE_NAME, fileName);
- }
-
- public RequestType getRequestType() {
- return (RequestType) getObject(RequestType.class, KEY_REQUEST_TYPE);
- }
-
- public void setRequestType(@NonNull RequestType requestType) {
- setParameters(KEY_REQUEST_TYPE, requestType);
- }
-
- public String getRequestSubType() {
- return getString(KEY_REQUEST_SUB_TYPE);
- }
-
- public void setRequestSubType(String requestSubType) {
- setParameters(KEY_REQUEST_SUB_TYPE, requestSubType);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java
deleted file mode 100644
index fab8b09ba..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequestResponse.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * System Request Response is sent, when SystemRequest has been called
- *
- * @since SmartDeviceLink 3.0
- */
-public class SystemRequestResponse extends RPCResponse {
- public SystemRequestResponse() {
- super(FunctionID.SYSTEM_REQUEST.toString());
- }
-
- public SystemRequestResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SystemRequestResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SystemRequestResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java
deleted file mode 100644
index a1e26d6b2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-
-import java.util.Hashtable;
-
-/**
- * <p>Specifies what is to be spoken. This can be simply a text phrase, which SDL will speak according to its own rules.
- * It can also be phonemes from either the Microsoft SAPI phoneme set, or from the LHPLUS phoneme set.
- * It can also be a pre-recorded sound in WAV format (either developer-defined, or provided by the SDL platform).</p>
- *
- * <p>In SDL, words, and therefore sentences, can be built up from phonemes and are used to explicitly provide the proper pronounciation to the TTS engine.
- * For example, to have SDL pronounce the word "read" as "red", rather than as when it is pronounced like "reed",
- * the developer would use phonemes to express this desired pronounciation.</p>
- * <p>For more information about phonemes, see <a href="http://en.wikipedia.org/wiki/Phoneme">http://en.wikipedia.org/wiki/Phoneme</a></p>.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>text</td>
- * <td>String</td>
- * <td>Text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field.</td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>type</td>
- * <td>SpeechCapabilities</td>
- * <td>Indicates the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound). </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- */
-public class TTSChunk extends RPCStruct {
- public static final String KEY_TEXT = "text";
- public static final String KEY_TYPE = "type";
- /**
- * Constructs a newly allocated TTSChunk object
- */
- public TTSChunk() { }
- /**
- * Constructs a newly allocated TTSChunk object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public TTSChunk(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a newly allocated TTSChunk object
- * @param text Text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field.
- * @param type Indicates the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound).
- */
- public TTSChunk(@NonNull String text, @NonNull SpeechCapabilities type){
- this();
- setText(text);
- setType(type);
- }
- /**
- * Get text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field.
- * @return text to be spoken, or a phoneme specification, or the name of a pre-recorded sound
- */
- public String getText() {
- return getString( KEY_TEXT );
- }
- /**
- * Set the text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field.
- * @param text to be spoken, or a phoneme specification, or the name of a pre-recorded sound.
- */
- public void setText(@NonNull String text ) {
- setValue(KEY_TEXT, text);
- }
- /**
- * Get the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound).
- * @return the type of information in the "text" field
- */
- public SpeechCapabilities getType() {
- return (SpeechCapabilities) getObject(SpeechCapabilities.class, KEY_TYPE);
- }
- /**
- * Set the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound).
- * @param type the type of information in the "text" field
- */
- public void setType(@NonNull SpeechCapabilities type ) {
- setValue(KEY_TYPE, type);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java
deleted file mode 100644
index 87513a3cd..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import java.util.Hashtable;
-
-public class Temperature extends RPCStruct{
- public static final String KEY_UNIT = "unit";
- public static final String KEY_VALUE = "value";
-
- public Temperature() { }
- public Temperature(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Create the temperature object
- * @param unit Temperature Unit.
- * @param value Temperature Value in TemperatureUnit specified unit
- */
- public Temperature(@NonNull TemperatureUnit unit, @NonNull Float value){
- this();
- setUnit(unit);
- setValue(value);
- }
-
- /**
- * Sets the unit portion of the Temperature class
- *
- * @param unit
- * Temperature Unit.
- */
- public void setUnit(@NonNull TemperatureUnit unit) {
- setValue(KEY_UNIT, unit);
- }
-
- /**
- * Gets the unit portion of the Temperature class
- *
- * @return TemperatureUnit - Temperature Unit.
- */
- public TemperatureUnit getUnit() {
- return (TemperatureUnit) getObject(TemperatureUnit.class, KEY_UNIT);
- }
-
- /**
- * Gets the value portion of the Temperature class
- *
- * @return Float - Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.
- */
- public Float getValue() {
- Object value = getValue(KEY_VALUE);
- return SdlDataTypeConverter.objectToFloat(value);
- }
-
- /**
- * Sets the value portion of the Temperature class
- *
- * @param value
- * Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.
- */
- public void setValue(@NonNull Float value) {
- setValue(KEY_VALUE, value);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java
deleted file mode 100644
index db915a4eb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import java.util.Hashtable;
-
-/**
- * A color scheme for all display layout templates.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>primaryColor</td>
- * <td>RGBColor</td>
- * <td>The primary "accent" color</td>
- * <td>N</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>secondaryColor</td>
- * <td>RGBColor</td>
- * <td>The secondary "accent" color</td>
- * <td>N</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>backgroundColor</td>
- * <td>RGBColor</td>
- * <td>The color of the background</td>
- * <td>N</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 5.0
- */
-public class TemplateColorScheme extends RPCStruct {
-
- public static final String KEY_PRIMARY_COLOR = "primaryColor";
- public static final String KEY_SECONDARY_COLOR = "secondaryColor";
- public static final String KEY_BACKGROUND_COLOR = "backgroundColor";
-
- /**
- * Constructs a new TemplateColorScheme object
- */
- public TemplateColorScheme(){
- }
-
- /**
- * Constructs a new TemplateColorScheme object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public TemplateColorScheme(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets the primaryColor of the scheme
- * @param color an RGBColor object representing the primaryColor
- */
- public void setPrimaryColor(RGBColor color) {
- setValue(KEY_PRIMARY_COLOR, color);
- }
-
- /**
- * Gets the primaryColor of the scheme
- * @return an RGBColor object representing the primaryColor
- */
- public RGBColor getPrimaryColor() {
- return (RGBColor) getObject(RGBColor.class, KEY_PRIMARY_COLOR);
- }
-
- /**
- * Sets the secondaryColor of the scheme
- * @param color an RGBColor object representing the secondaryColor
- */
- public void setSecondaryColor(RGBColor color) {
- setValue(KEY_SECONDARY_COLOR, color);
- }
-
- /**
- * Gets the secondaryColor of the scheme
- * @return an RGBColor object representing the secondaryColor
- */
- public RGBColor getSecondaryColor() {
- return (RGBColor) getObject(RGBColor.class, KEY_SECONDARY_COLOR);
- }
-
- /**
- * Sets the backgroundColor of the scheme
- * @param color an RGBColor object representing the backgroundColor
- */
- public void setBackgroundColor(RGBColor color) {
- setValue(KEY_BACKGROUND_COLOR, color);
- }
-
- /**
- * Gets the backgroundColor of the scheme
- * @return an RGBColor object representing the backgroundColor
- */
- public RGBColor getBackgroundColor() {
- return (RGBColor) getObject(RGBColor.class, KEY_BACKGROUND_COLOR);
- }
-}
-
-
-
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java
deleted file mode 100644
index 7f745186b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
-import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
-
-import static com.smartdevicelink.proxy.rpc.TireStatus.KEY_INNER_RIGHT_REAR;
-
-/**
- * Struct defining the characteristics of a displayed field on the HMI.
- * <p><b> Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>name</td>
- * <td>TextFieldName</td>
- * <td>Enumeration identifying the field. </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>characterSet</td>
- * <td>CharacterSet</td>
- * <td>The character set that is supported in this field. </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>width</td>
- * <td>Integer</td>
- * <td>The number of characters in one row of this field.
- * <ul>
- * <li>Minvalue="1"</li>
- * <li>maxvalue="500"</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>rows</td>
- * <td>Integer</td>
- * <td>The number of rows for this text field.
- * <ul>
- * <li>Minvalue="1"</li>
- * <li>maxvalue="3"</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 1.0
- *
- * @see TextFieldName
- * @see Alert
- * @see Show
- * @see PerformInteraction
- * @see ScrollableMessage
- * @see PerformAudioPassThru
- * @see ShowConstantTbt
- *
- */
-public class TextField extends RPCStruct {
- public static final String KEY_WIDTH = "width";
- public static final String KEY_CHARACTER_SET = "characterSet";
- public static final String KEY_ROWS = "rows";
- public static final String KEY_NAME = "name";
- /**
- * Constructs a newly allocated TextField object
- */
- public TextField() { }
- /**
- * Constructs a newly allocated TextField object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public TextField(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Constructs a newly allocated TextField object
- * @param name Enumeration identifying the field.
- * @param characterSet The character set that is supported in this field.
- * @param width The number of characters in one row of this field.
- * @param rows The number of rows for this text field.
- */
- public TextField(@NonNull TextFieldName name, @NonNull CharacterSet characterSet, @NonNull Integer width, @NonNull Integer rows){
- this();
- setName(name);
- setCharacterSet(characterSet);
- setWidth(width);
- setRows(rows);
- }
- /**
- * Get the enumeration identifying the field.
- * @return the name of TextField
- */
- public TextFieldName getName() {
- return (TextFieldName) getObject(TextFieldName.class, KEY_NAME);
- }
- /**
- * Set the enumeration identifying the field.
- * @param name the name of TextField
- */
- public void setName(@NonNull TextFieldName name ) {
- setValue(KEY_NAME, name);
- }
- /**
- * Get the character set that is supported in this field.
- * @return the character set
- */
- public CharacterSet getCharacterSet() {
- return (CharacterSet) getObject(CharacterSet.class, KEY_CHARACTER_SET);
- }
- /**
- * Set the character set that is supported in this field.
- * @param characterSet - the character set
- */
- public void setCharacterSet(@NonNull CharacterSet characterSet ) {
- setValue(KEY_CHARACTER_SET, characterSet);
- }
- /**
- * Get the number of characters in one row of this field.
- * <ul>
- * <li>Minvalue="1"</li>
- * <li>maxvalue="500"</li>
- * </ul>
- * @return the number of characters in one row of this field
- */
- public Integer getWidth() {
- return getInteger( KEY_WIDTH );
- }
- /**
- * Set the number of characters in one row of this field.
- * <ul>
- * <li>Minvalue="1"</li>
- * <li>maxvalue="500"</li>
- * </ul>
- * @param width the number of characters in one row of this field
- */
- public void setWidth(@NonNull Integer width ) {
- setValue(KEY_WIDTH, width);
- }
- /**
- *Get the number of rows for this text field.
- * <ul>
- * <li>Minvalue="1"</li>
- * <li>maxvalue="3"</li>
- * </ul>
- * @return the number of rows for this text field
- */
- public Integer getRows() {
- return getInteger( KEY_ROWS );
- }
- public void setRows(@NonNull Integer rows ) {
- setValue(KEY_ROWS, rows);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
deleted file mode 100644
index 4a5e95625..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
-import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
-import com.smartdevicelink.util.DebugTool;
-
-import java.util.Hashtable;
-
-import static com.smartdevicelink.proxy.rpc.ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS;
-
-/** <p>The status and pressure of the tires.</p>
- * <p><b> Parameter List:</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>PressureTellTale</td>
- * <td>WarningLightStatus</td>
- * <td>Status of the Tire Pressure TellTale</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>LeftFront</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the left front tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>RightFront</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the right front tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>LeftRear</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the left rear tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>RightRear</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the right rear tire</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>InnerLeftRear</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the inner left rear tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>InnerRightRear</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the inner right rear tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * @since SmartDeviceLink 2.0
- *
- * @see WarningLightStatus
- * @see SingleTireStatus
- * @see GetVehicleData
- * @see OnVehicleData
- */
-
-public class TireStatus extends RPCStruct {
- public static final String KEY_PRESSURE_TELL_TALE = "pressureTellTale";
- public static final String KEY_LEFT_FRONT = "leftFront";
- public static final String KEY_RIGHT_FRONT = "rightFront";
- public static final String KEY_LEFT_REAR = "leftRear";
- public static final String KEY_INNER_LEFT_REAR = "innerLeftRear";
- public static final String KEY_INNER_RIGHT_REAR = "innerRightRear";
- public static final String KEY_RIGHT_REAR = "rightRear";
-
- public TireStatus() { }
-
- /**
- * <p>Constructs a new TireStatus object indicated by the Hashtable parameter</p>
- *
- * @param hash The Hashtable to use
- */
- public TireStatus(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new TireStatus object
- * @param pressureTellTale Status of the Tire Pressure TellTale
- * @param leftFront The status of the left front tire.
- * @param rightFront The status of the right front tire.
- * @param leftRear The status of the left rear tire.
- * @param rightRear The status of the right rear tire
- * @param innerLeftRear The status of the inner left rear tire.
- * @param innerRightRear The status of the inner right rear tire.
- */
- public TireStatus(@NonNull WarningLightStatus pressureTellTale, @NonNull SingleTireStatus leftFront, @NonNull SingleTireStatus rightFront, @NonNull SingleTireStatus leftRear, @NonNull SingleTireStatus rightRear, @NonNull SingleTireStatus innerLeftRear, @NonNull SingleTireStatus innerRightRear){
- this();
- setPressureTellTale(pressureTellTale);
- setLeftFront(leftFront);
- setRightFront(rightFront);
- setLeftRear(leftRear);
- setRightRear(rightRear);
- setInnerLeftRear(innerLeftRear);
- setInnerRightRear(innerRightRear);
- }
-
- public void setPressureTellTale(@NonNull WarningLightStatus pressureTellTale) {
- setValue(KEY_PRESSURE_TELL_TALE, pressureTellTale);
- }
- public WarningLightStatus getPressureTellTale() {
- return (WarningLightStatus) getObject(WarningLightStatus.class, KEY_PRESSURE_TELL_TALE);
- }
- public void setLeftFront(@NonNull SingleTireStatus leftFront) {
- setValue(KEY_LEFT_FRONT, leftFront);
- }
- @SuppressWarnings("unchecked")
- public SingleTireStatus getLeftFront() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_FRONT);
- }
- public void setRightFront(@NonNull SingleTireStatus rightFront) {
- setValue(KEY_RIGHT_FRONT, rightFront);
- }
- @SuppressWarnings("unchecked")
- public SingleTireStatus getRightFront() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_FRONT);
- }
- public void setLeftRear(@NonNull SingleTireStatus leftRear) {
- setValue(KEY_LEFT_REAR, leftRear);
- }
- @SuppressWarnings("unchecked")
- public SingleTireStatus getLeftRear() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_REAR);
- }
- public void setRightRear(@NonNull SingleTireStatus rightRear) {
- setValue(KEY_RIGHT_REAR, rightRear);
- }
- @SuppressWarnings("unchecked")
- public SingleTireStatus getRightRear() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_REAR);
- }
- public void setInnerLeftRear(@NonNull SingleTireStatus innerLeftRear) {
- setValue(KEY_INNER_LEFT_REAR, innerLeftRear);
- }
- @SuppressWarnings("unchecked")
- public SingleTireStatus getInnerLeftRear() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_INNER_LEFT_REAR);
- }
- public void setInnerRightRear(@NonNull SingleTireStatus innerRightRear) {
- setValue(KEY_INNER_RIGHT_REAR, innerRightRear);
- }
- @SuppressWarnings("unchecked")
- public SingleTireStatus getInnerRightRear() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_INNER_RIGHT_REAR);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java
deleted file mode 100644
index b14dcfaec..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-/**
- * <p>The x or y coordinate of the touch.</p>
- *
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th> Version</th>
- * </tr>
- * <tr>
- * <td>x</td>
- * <td>Integer</td>
- * <td>The x coordinate of the touch.</td>
- * <td>Y</td>
- * <td>minvalue = 0; maxvalue = 10000</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>y</td>
- * <td>Integer</td>
- * <td>The y coordinate of the touch.</td>
- * <td>Y</td>
- * <td>minvalue = 0; maxvalue = 10000</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * </table>
- *@see SoftButtonCapabilities
- *@see ButtonCapabilities
- *@see OnButtonPress
- *
- *@since SmartDeviceLink 3.0
- */
-
-public class TouchCoord extends RPCStruct {
- public static final String KEY_X = "x";
- public static final String KEY_Y = "y";
-
- public TouchCoord() {}
-
- /**
- * <p>Constructs a new TouchCoord object indicated by the Hashtable parameter</p>
- *
- * @param hash The Hashtable to use
- */
- public TouchCoord(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new TouchCoord object
- * @param x The x coordinate of the touch.
- * @param y The y coordinate of the touch.
- */
- public TouchCoord(@NonNull Integer x, @NonNull Integer y){
- this();
- setX(x);
- setY(y);
- }
-
- public void setX(@NonNull Integer x) {
- setValue(KEY_X, x);
- }
-
- public Integer getX() {
- return getInteger(KEY_X);
- }
-
- public void setY(@NonNull Integer y) {
- setValue(KEY_Y, y);
- }
-
- public Integer getY() {
- return getInteger(KEY_Y);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java
deleted file mode 100644
index 0abb75062..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * <p>For touchscreen interactions, the mode of how the choices are presented.</p>
- *
- * <p><b>Parameter List</b></p>
- *
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>id</td>
- * <td>Integer</td>
- * <td> A touch's unique identifier. The application can track the current touch events by id. If a touch event has type begin, the id should be added to the set of touches. If a touch event has type end, the id should be removed from the set of touches.</td>
- * <td>N</td>
- * <td>Min Value: 0; Max Value: 9</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>ts</td>
- * <td>Float</td>
- * <td>The time that the touch was recorded. <p> This number can the time since the beginning of the session or something else as long as the units are in milliseconds.</p>
- * <p>The timestamp is used to determined the rate of change of position of a touch.</p><p>The application also uses the time to verify whether two touches,with different ids, are part of a single action by the user.</p>
- * <p>If there is only a single timestamp in this array,</p> it is the same for every coordinate in the coordinates array.</td>
- * <td>Y</td>
- * <td>minvalue="0" maxvalue="5000000000" minsize="1" maxsize="1000"</td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>c</td>
- * <td>Integer</td>
- * <td>The coordinates of the screen area where the touch event occurred.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0</td>
- * </tr>
- * </table>
- *
- * @since SmartDeviceLink 3.0
- *
- * @see SoftButtonCapabilities
- * @see ButtonCapabilities
- * @see OnButtonPress
- */
-
-public class TouchEvent extends RPCStruct {
- public static final String KEY_ID = "id";
- public static final String KEY_TS = "ts";
- public static final String KEY_C = "c";
-
- public TouchEvent() { }
- /**
- * <p>Constructs a new TouchEvent object indicated by the Hashtable parameter</p>
- *
- * @param hash The Hashtable to use
- */
- public TouchEvent(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new TouchEvent object
- * @param id A touch's unique identifier.
- * @param ts The time that the touch was recorded.
- * @param c The coordinates of the screen area where the touch event occurred.
- */
- public TouchEvent(@NonNull Integer id, @NonNull List<Long> ts, @NonNull List<TouchCoord> c){
- this();
- setId(id);
- setTimestamps(ts);
- setTouchCoordinates(c);
- }
-
- public void setId(@NonNull Integer id) {
- setValue(KEY_ID, id);
- }
-
- public Integer getId() {
- return getInteger(KEY_ID);
- }
-
- /**
- * Use getTimestamps
- * @deprecated 4.0.2
- * @return
- */
- @Deprecated
- public List<Long> getTs() {
- return getTimestamps();
- }
-
- @SuppressWarnings("unchecked")
- public List<Long> getTimestamps() {
- if(getValue(KEY_TS) instanceof List<?>){
- List<?> list = (List<?>) getValue(KEY_TS);
- if(list != null && list.size()>0){
- Object obj = list.get(0);
- if(obj instanceof Integer){ //Backwards case
- int size = list.size();
- List<Integer> listOfInt = (List<Integer>) list;
- List<Long> listofLongs = new ArrayList<Long>(size);
- for(int i = 0; i<size;i++){
- listofLongs.add(listOfInt.get(i).longValue());
- }
- return listofLongs;
- }else if(obj instanceof Long){
- return (List<Long>) list;
- }
- }
- }
- return null;
- }
-
- public void setTimestamps(@NonNull List<Long> ts){
- setValue(KEY_TS, ts);
- }
-
- /**
- * Use setTimestamps.
- * @deprecated 4.0.2
- * @param ts
- */
- @Deprecated
- public void setTs(List<Long> ts) {
- setTimestamps(ts);
- }
-
- /**
- * Use getTouchCoordinates
- * @deprecated 4.0.2
- * @return
- */
- @Deprecated
- public List<TouchCoord> getC() {
- return getTouchCoordinates();
- }
- @SuppressWarnings("unchecked")
- public List<TouchCoord> getTouchCoordinates() {
- return (List<TouchCoord>) getObject(TouchCoord.class, KEY_C);
- }
-
- /**
- * Use setTouchCoordinates
- * @deprecated 4.0.2
- * @return
- */
- @Deprecated
- public void setC( List<TouchCoord> c ) {
- setTouchCoordinates(c);
- }
-
- public void setTouchCoordinates(@NonNull List<TouchCoord> c ) {
- setValue(KEY_C, c);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java
deleted file mode 100644
index c8c441158..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-/**
- * Types of screen touch events available in screen area.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Version</th>
- * </tr>
- * <tr>
- * <td>pressAvailable</td>
- * <td>Boolean</td>
- * <td></td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>multiTouchAvailable</td>
- * <td>Boolean</td>
- * <td></td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * <tr>
- * <td>doublePressAvailable</td>
- * <td>Boolean</td>
- * <td></td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 3.0 </td>
- * </tr>
- * </table>
- *
- */
-public class TouchEventCapabilities extends RPCStruct {
- public static final String KEY_PRESS_AVAILABLE = "pressAvailable";
- public static final String KEY_MULTI_TOUCH_AVAILABLE = "multiTouchAvailable";
- public static final String KEY_DOUBLE_PRESS_AVAILABLE = "doublePressAvailable";
- public TouchEventCapabilities() {}
-
- public TouchEventCapabilities(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Types of screen touch events available in screen area.
- * @param pressAvailable if press is available
- * @param multiTouchAvailable if multi touch is available
- * @param doublePressAvailable if double press is available
- */
- public TouchEventCapabilities(@NonNull Boolean pressAvailable, @NonNull Boolean multiTouchAvailable, @NonNull Boolean doublePressAvailable){
- this();
- setPressAvailable(pressAvailable);
- setMultiTouchAvailable(multiTouchAvailable);
- setDoublePressAvailable(doublePressAvailable);
- }
-
- public void setPressAvailable(@NonNull Boolean pressAvailable) {
- setValue(KEY_PRESS_AVAILABLE, pressAvailable);
- }
-
- public Boolean getPressAvailable() {
- return getBoolean(KEY_PRESS_AVAILABLE);
- }
-
- public void setMultiTouchAvailable(@NonNull Boolean multiTouchAvailable) {
- setValue(KEY_MULTI_TOUCH_AVAILABLE, multiTouchAvailable);
- }
-
- public Boolean getMultiTouchAvailable() {
- return getBoolean(KEY_MULTI_TOUCH_AVAILABLE);
- }
-
- public void setDoublePressAvailable(@NonNull Boolean doublePressAvailable) {
- setValue(KEY_DOUBLE_PRESS_AVAILABLE, doublePressAvailable);
- }
-
- public Boolean getDoublePressAvailable() {
- return getBoolean(KEY_DOUBLE_PRESS_AVAILABLE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java
deleted file mode 100644
index 6cebac7f1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-
-import java.util.Hashtable;
-
-/**
- * Describes a navigation turn including an optional icon
- *
- * <p><b>Parameter List</p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>navigationText</td>
- * <td>String</td>
- * <td>Text to describe the turn (e.g. streetname)
- * <ul>
- * <li>Maxlength = 500</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>turnIcon</td>
- * <td>Image</td>
- * <td>Image to be shown for a turn</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- *
- * @since SmartDeviceLink 2.0
- */
-public class Turn extends RPCStruct{
- public static final String KEY_NAVIGATION_TEXT = "navigationText";
- public static final String KEY_TURN_IMAGE = "turnIcon";
-
- public Turn() { }
- public Turn(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * set the text to describe the turn (e.g. streetname)
- *
- * @param navigationText
- * the text to describe the turn (e.g. streetname)
- */
- public void setNavigationText(String navigationText){
- setValue(KEY_NAVIGATION_TEXT, navigationText);
- }
-
- /**
- * get the text to describe the turn (e.g. streetname)
- *
- * @return the text to describe the turn (e.g. streetname)
- */
- public String getNavigationText(){
- return getString(KEY_NAVIGATION_TEXT);
- }
-
- /**
- * set Image to be shown for a turn
- *
- * @param turnIcon
- * the image to be shown for a turn
- */
- public void setTurnIcon(Image turnIcon){
- setValue(KEY_TURN_IMAGE, turnIcon);
- }
-
- /**
- * get the image to be shown for a turn
- *
- * @return the image to be shown for a turn
- */
- @SuppressWarnings("unchecked")
- public Image getTurnIcon(){
- return (Image) getObject(Image.class, KEY_TURN_IMAGE);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterface.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterface.java
deleted file mode 100644
index b832d81c4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterface.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-/**
- * Terminates an application's interface registration. This causes SDL&reg; to
- * dispose of all resources associated with the application's interface
- * registration (e.g. Command Menu items, Choice Sets, button subscriptions,
- * etc.)
- *
- * <p>After the UnregisterAppInterface operation is performed, no other operations
- * can be performed until a new app interface registration is established by
- * calling <i>{@linkplain RegisterAppInterface}</i></p>
- *
- * @see RegisterAppInterface
- * @see OnAppInterfaceUnregistered
- */
-public class UnregisterAppInterface extends RPCRequest {
- /**
- * Constructs a new UnregisterAppInterface object
- */
- public UnregisterAppInterface() {
- super(FunctionID.UNREGISTER_APP_INTERFACE.toString());
- }
- /**
- * <p>Constructs a new UnregisterAppInterface object indicated by the Hashtable
- * parameter</p>
- *
- *
- * @param hash
- * The Hashtable to use
- */
- public UnregisterAppInterface(Hashtable<String, Object> hash) {
- super(hash);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java
deleted file mode 100644
index 4660dc24e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnregisterAppInterfaceResponse.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Unregister AppInterface Response is sent, when UnregisterAppInterface has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class UnregisterAppInterfaceResponse extends RPCResponse {
-
- /**
- * Constructs a new UnregisterAppInterfaceResponse object
- */
- public UnregisterAppInterfaceResponse() {
- super(FunctionID.UNREGISTER_APP_INTERFACE.toString());
- }
-
- /**
- * Constructs a new UnregisterAppInterfaceResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public UnregisterAppInterfaceResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new UnregisterAppInterfaceResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public UnregisterAppInterfaceResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java
deleted file mode 100644
index 53a4e9162..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-
-import java.util.Hashtable;
-
-/**
- * Deletes a subscription to button notifications for the specified button. For
- * more information about button subscriptions, see {@linkplain SubscribeButton}
- *
- * <p>Application can unsubscribe from a button that is currently being pressed
- * (i.e. has not yet been released), but app will not get button event</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>buttonName</td>
- * <td>ButtonName</td>
- * <td>Name of the button to unsubscribe.</td>
- * <td>Y</td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- *
- * <p> <b>Response</b></p>
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR </p>
- * <p>UNSUPPORTED_RESOURCE</p>
- * <p>IGNORED</p>
- * <p>REJECTED</p>
- * @since SmartDeviceLink 1.0
- * @see SubscribeButton
- */
-public class UnsubscribeButton extends RPCRequest {
- public static final String KEY_BUTTON_NAME = "buttonName";
-
- /**
- * Constructs a new UnsubscribeButton object
- */
- public UnsubscribeButton() {
- super(FunctionID.UNSUBSCRIBE_BUTTON.toString());
- }
- /**
- * Constructs a new UnsubscribeButton object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash The Hashtable to use
- */
- public UnsubscribeButton(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new UnsubscribeButton object
- * @param buttonName Name of the button to unsubscribe.
- */
- public UnsubscribeButton(@NonNull ButtonName buttonName){
- this();
- setButtonName(buttonName);
- }
-
- /**
- * Gets a name of the button to unsubscribe from
- *
- * @return ButtonName -an Enumeration value, see <i> {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i>
- */
- public ButtonName getButtonName() {
- return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
- }
- /**
- * Sets the name of the button to unsubscribe from
- *
- * @param buttonName an enum value, see <i> {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i>
- */
- public void setButtonName(@NonNull ButtonName buttonName ) {
- setParameters(KEY_BUTTON_NAME, buttonName);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java
deleted file mode 100644
index 5d6bd8579..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButtonResponse.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Unsubscribe Button Response is sent, when UnsubscribeButton has been called
- *
- * @since SmartDeviceLink 1.0
- */
-public class UnsubscribeButtonResponse extends RPCResponse {
-
- /**
- * Constructs a new UnsubscribeButtonResponse object
- */
- public UnsubscribeButtonResponse() {
- super(FunctionID.UNSUBSCRIBE_BUTTON.toString());
- }
-
- /**
- * Constructs a new UnsubscribeButtonResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash The Hashtable to use
- */
- public UnsubscribeButtonResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new UnsubscribeButtonResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public UnsubscribeButtonResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java
deleted file mode 100644
index ca2439b9e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java
+++ /dev/null
@@ -1,805 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-/**
- * This function is used to unsubscribe the notifications from the
- * subscribeVehicleData function
- * <p>Function Group: Location, VehicleInfo and DrivingChara</p>
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>gps</td>
- * <td>Boolean</td>
- * <td>GPS data. See {@linkplain GPSdata} for details</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>speed</td>
- * <td>Boolean</td>
- * <td>The vehicle speed in kilometers per hour</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>rpm</td>
- * <td>Boolean</td>
- * <td>The number of revolutions per minute of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>fuelLevel</td>
- * <td>Boolean</td>
- * <td>The fuel level in the tank (percentage)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>fuelLevel_State</td>
- * <td>Boolean</td>
- * <td>The fuel level state</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>instantFuelConsumption</td>
- * <td>Boolean</td>
- * <td>The instantaneous fuel consumption in microlitres</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>externalTemperature</td>
- * <td>Boolean</td>
- * <td>The external temperature in degrees celsius</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>prndl</td>
- * <td>Boolean</td>
- * <td>Currently selected gear.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>tirePressure</td>
- * <td>Boolean</td>
- * <td>Tire pressure status</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>odometer</td>
- * <td>Boolean</td>
- * <td>Odometer in km</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>beltStatus</td>
- * <td>Boolean</td>
- * <td>The status of the seat belts</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>bodyInformation</td>
- * <td>Boolean</td>
- * <td>The body information including ignition status and internal temp</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>deviceStatus</td>
- * <td>Boolean</td>
- * <td>The device status including signal and battery strength</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>driverBraking</td>
- * <td>Boolean</td>
- * <td>The status of the brake pedal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>wiperStatus</td>
- * <td>Boolean</td>
- * <td>The status of the wipers</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>headLampStatus</td>
- * <td>Boolean</td>
- * <td>Status of the head lamps</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>engineTorque</td>
- * <td>Boolean</td>
- * <td>Torque value for engine (in Nm) on non-diesel variants</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>engineOilLife</td>
- * <td>Boolean</td>
- * <td>The estimated percentage of remaining oil life of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0 </td>
- * </tr>
- * <tr>
- * <td>accPedalPosition</td>
- * <td>Boolean</td>
- * <td>Accelerator pedal position (percentage depressed)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>steeringWheelAngle</td>
- * <td>Boolean</td>
- * <td>Current angle of the steering wheel (in deg)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>eCallInfo</td>
- * <td>Boolean</td>
- * <td>Emergency Call notification and confirmation data.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>airbagStatus</td>
- * <td>Boolean</td>
- * <td>The status of the air bags.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>emergencyEvent</td>
- * <td>Boolean</td>
- * <td>Information related to an emergency event (and if it occurred).</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>clusterModeStatus</td>
- * <td>Boolean</td>
- * <td>The status modes of the instrument panel cluster.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>myKey</td>
- * <td>Boolean</td>
- * <td>Information related to the MyKey feature.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>turnSignal</td>
- * <td>Boolean</td>
- * <td>@see TurnSignal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0 </td>
- * </tr>
- * </table>
- * <p><b> Response</b></p>
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>WARNINGS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>IGNORED</p>
- * <p>DISALLOWED</p>
- *
- * @since SmartDeviceLink 2.0
- * @see SubscribeVehicleData
- * @see GetVehicleData
- */
-public class UnsubscribeVehicleData extends RPCRequest {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
-
- /**
- * Constructs a new UnsubscribeVehicleData object
- */
- public UnsubscribeVehicleData() {
- super(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString());
- }
-
- /**
- * Constructs a new UnsubscribeVehicleData object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public UnsubscribeVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes Gps data
- *
- * @param gps
- * a boolean value
- */
- public void setGps(Boolean gps) {
- setParameters(KEY_GPS, gps);
- }
-
- /**
- * Gets a boolean value. If true, means the Gps data has been unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Gps data has been
- * unsubscribed.
- */
- public Boolean getGps() {
- return getBoolean(KEY_GPS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes speed data
- *
- * @param speed
- * a boolean value
- */
- public void setSpeed(Boolean speed) {
- setParameters(KEY_SPEED, speed);
- }
-
- /**
- * Gets a boolean value. If true, means the Speed data has been unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Speed data has been
- * unsubscribed.
- */
- public Boolean getSpeed() {
- return getBoolean(KEY_SPEED);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribe data
- *
- * @param rpm
- * a boolean value
- */
- public void setRpm(Boolean rpm) {
- setParameters(KEY_RPM, rpm);
- }
-
- /**
- * Gets a boolean value. If true, means the rpm data has been unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the rpm data has been
- * unsubscribed.
- */
- public Boolean getRpm() {
- return getBoolean(KEY_RPM);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes FuelLevel data
- *
- * @param fuelLevel
- * a boolean value
- */
- public void setFuelLevel(Boolean fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- }
-
- /**
- * Gets a boolean value. If true, means the FuelLevel data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the FuelLevel data has
- * been unsubscribed.
- */
- public Boolean getFuelLevel() {
- return getBoolean(KEY_FUEL_LEVEL);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes fuelLevel_State data
- *
- * @param fuelLevel_State
- * a boolean value
- */
- @Deprecated
- public void setFuelLevel_State(Boolean fuelLevel_State) {
- setFuelLevelState(fuelLevel_State);
- }
-
- /**
- * Gets a boolean value. If true, means the fuelLevel_State data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the fuelLevel_State data
- * has been unsubscribed.
- */
- @Deprecated
- public Boolean getFuelLevel_State() {
- return getFuelLevelState();
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes fuelLevelState data
- *
- * @param fuelLevelState
- * a boolean value
- */
- public void setFuelLevelState(Boolean fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- }
-
- /**
- * Gets a boolean value. If true, means the fuelLevel_State data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the fuelLevelState data
- * has been unsubscribed.
- */
- public Boolean getFuelLevelState() {
- return getBoolean(KEY_FUEL_LEVEL_STATE);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes instantFuelConsumption data
- *
- * @param instantFuelConsumption
- * a boolean value
- */
- public void setInstantFuelConsumption(Boolean instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- }
-
- /**
- * Gets a boolean value. If true, means the getInstantFuelConsumption data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the getInstantFuelConsumption data
- * has been unsubscribed.
- */
- public Boolean getInstantFuelConsumption() {
- return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes externalTemperature data
- *
- * @param externalTemperature
- * a boolean value
- */
- public void setExternalTemperature(Boolean externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- }
-
- /**
- * Gets a boolean value. If true, means the externalTemperature data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the externalTemperature data
- * has been unsubscribed.
- */
- public Boolean getExternalTemperature() {
- return getBoolean(KEY_EXTERNAL_TEMPERATURE);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes Currently selected gear data
- *
- * @param prndl
- * a boolean value
- */
- public void setPrndl(Boolean prndl) {
- setParameters(KEY_PRNDL, prndl);
- }
-
- /**
- * Gets a boolean value. If true, means the Currently selected gear data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Currently selected gear data
- * has been unsubscribed.
- */
- public Boolean getPrndl() {
- return getBoolean(KEY_PRNDL);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes tire pressure status data
- *
- * @param tirePressure
- * a boolean value
- */
- public void setTirePressure(Boolean tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- }
-
- /**
- * Gets a boolean value. If true, means the tire pressure status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the tire pressure status data
- * has been unsubscribed.
- */
- public Boolean getTirePressure() {
- return getBoolean(KEY_TIRE_PRESSURE);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes odometer data
- *
- * @param odometer
- * a boolean value
- */
- public void setOdometer(Boolean odometer) {
- setParameters(KEY_ODOMETER, odometer);
- }
-
- /**
- * Gets a boolean value. If true, means the odometer data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the odometer data
- * has been unsubscribed.
- */
- public Boolean getOdometer() {
- return getBoolean(KEY_ODOMETER);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes belt Status data
- *
- * @param beltStatus
- * a boolean value
- */
- public void setBeltStatus(Boolean beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the belt Status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the belt Status data
- * has been unsubscribed.
- */
- public Boolean getBeltStatus() {
- return getBoolean(KEY_BELT_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes body Information data
- *
- * @param bodyInformation
- * a boolean value
- */
- public void setBodyInformation(Boolean bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- }
-
- /**
- * Gets a boolean value. If true, means the body Information data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the body Information data
- * has been unsubscribed.
- */
- public Boolean getBodyInformation() {
- return getBoolean(KEY_BODY_INFORMATION);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes device Status data
- *
- * @param deviceStatus
- * a boolean value
- */
- public void setDeviceStatus(Boolean deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the device Status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the device Status data
- * has been unsubscribed.
- */
- public Boolean getDeviceStatus() {
- return getBoolean(KEY_DEVICE_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes driver Braking data
- *
- * @param driverBraking
- * a boolean value
- */
- public void setDriverBraking(Boolean driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- }
-
- /**
- * Gets a boolean value. If true, means the driver Braking data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the driver Braking data
- * has been unsubscribed.
- */
- public Boolean getDriverBraking() {
- return getBoolean(KEY_DRIVER_BRAKING);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes wiper Status data
- *
- * @param wiperStatus
- * a boolean value
- */
- public void setWiperStatus(Boolean wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the wiper Status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the wiper Status data
- * has been unsubscribed.
- */
- public Boolean getWiperStatus() {
- return getBoolean(KEY_WIPER_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes Head Lamp Status data
- *
- * @param headLampStatus
- * a boolean value
- */
- public void setHeadLampStatus(Boolean headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the Head Lamp Status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Head Lamp Status data
- * has been unsubscribed.
- */
- public Boolean getHeadLampStatus() {
- return getBoolean(KEY_HEAD_LAMP_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes Engine Torque data
- *
- * @param engineTorque
- * a boolean value
- */
- public void setEngineTorque(Boolean engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
-
- /**
- * Gets a boolean value. If true, means the Engine Torque data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Engine Torque data
- * has been unsubscribed.
- */
- public Boolean getEngineTorque() {
- return getBoolean(KEY_ENGINE_TORQUE);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes Engine Oil Life data
- *
- * @param engineOilLife
- * a boolean value
- */
- public void setEngineOilLife(Boolean engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
-
- /**
- * Gets a boolean value. If true, means the Engine Oil Life data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Engine Oil Life data
- * has been unsubscribed.
- */
- public Boolean getEngineOilLife() {
- return getBoolean(KEY_ENGINE_OIL_LIFE);
- }
-
-
- /**
- * Sets a boolean value. If true, unsubscribes accPedalPosition data
- *
- * @param accPedalPosition
- * a boolean value
- */
- public void setAccPedalPosition(Boolean accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- }
-
- /**
- * Gets a boolean value. If true, means the accPedalPosition data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the accPedalPosition data
- * has been unsubscribed.
- */
- public Boolean getAccPedalPosition() {
- return getBoolean(KEY_ACC_PEDAL_POSITION);
- }
-
- public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- }
-
- public Boolean getSteeringWheelAngle() {
- return getBoolean(KEY_STEERING_WHEEL_ANGLE);
- }
-
- public void setECallInfo(Boolean eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- }
- public Boolean getECallInfo() {
- return getBoolean(KEY_E_CALL_INFO);
- }
- public void setAirbagStatus(Boolean airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- }
- public Boolean getAirbagStatus() {
- return getBoolean(KEY_AIRBAG_STATUS);
- }
- public void setEmergencyEvent(Boolean emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- }
- public Boolean getEmergencyEvent() {
- return getBoolean(KEY_EMERGENCY_EVENT);
- }
- public void setClusterModeStatus(Boolean clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- }
- public Boolean getClusterModeStatus() {
- return getBoolean(KEY_CLUSTER_MODE_STATUS);
- }
- public void setMyKey(Boolean myKey) {
- setParameters(KEY_MY_KEY, myKey);
- }
- public Boolean getMyKey() {
- return getBoolean(KEY_MY_KEY);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes fuelRange data
- *
- * @param fuelRange
- * a boolean value
- */
- public void setFuelRange(Boolean fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
-
- /**
- * Gets a boolean value. If true, means the fuelRange data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the fuelRange data
- * has been unsubscribed.
- */
- public Boolean getFuelRange() {
- return getBoolean(KEY_FUEL_RANGE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes turnSignal data
- * @param turnSignal a boolean value
- */
- public void setTurnSignal(Boolean turnSignal) { setParameters(KEY_TURN_SIGNAL, turnSignal); }
-
- /**
- * Gets a boolean value. If true, means the turnSignal data has been subscribed.
- * @return a Boolean value.
- */
- public Boolean getTurnSignal() { return getBoolean(KEY_TURN_SIGNAL); }
-
- /**
- * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
- * @param electronicParkBrakeStatus a boolean value
- */
- public void setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus) {
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- }
-
- /**
- * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
- * @return a Boolean value.
- */
- public Boolean getElectronicParkBrakeStatus() {
- return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java
deleted file mode 100644
index 0ed8aac33..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java
+++ /dev/null
@@ -1,474 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.util.DebugTool;
-
-import static android.provider.Contacts.SettingsColumns.KEY;
-
-/**
- * Unsubscribe Vehicle Data Response is sent, when UnsubscribeVehicleData has been called.
- *
- * @since SmartDeviceLink 2.0
- */
-public class UnsubscribeVehicleDataResponse extends RPCResponse {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
-
- /**
- * Constructs a new UnsubscribeVehicleDataResponse object
- */
- public UnsubscribeVehicleDataResponse() {
- super(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString());
- }
-
- /**
- * Constructs a new UnsubscribeVehicleDataResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public UnsubscribeVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- /**
- * Constructs a new UnsubscribeVehicleDataResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash
- * The Hashtable to use
- */
- public UnsubscribeVehicleDataResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
- /**
- * Sets Gps
- * @param gps
- */
- public void setGps(VehicleDataResult gps) {
- setParameters(KEY_GPS, gps);
- }
- /**
- * Gets Gps
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getGps() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS);
- }
- /**
- * Sets Speed
- * @param speed
- */
- public void setSpeed(VehicleDataResult speed) {
- setParameters(KEY_SPEED, speed);
- }
- /**
- * Gets Speed
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getSpeed() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED);
- }
- /**
- * Sets rpm
- * @param rpm
- */
- public void setRpm(VehicleDataResult rpm) {
- setParameters(KEY_RPM, rpm);
- }
- /**
- * Gets rpm
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getRpm() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_RPM);
- }
- /**
- * Sets Fuel Level
- * @param fuelLevel
- */
- public void setFuelLevel(VehicleDataResult fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- }
- /**
- * Gets Fuel Level
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getFuelLevel() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL);
- }
- /**
- * Sets Fuel Level State
- * @param fuelLevel_State
- */
- @Deprecated
- public void setFuelLevel_State(VehicleDataResult fuelLevel_State) {
- setFuelLevel(fuelLevel_State);
- }
- /**
- * Gets Fuel Level State
- * @return VehicleDataResult
- */
- @Deprecated
- public VehicleDataResult getFuelLevel_State() {
- return getFuelLevelState();
- }
- /**
- * Sets Fuel Level State
- * @param fuelLevelState
- */
- public void setFuelLevelState(VehicleDataResult fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- }
- /**
- * Gets Fuel Level State
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getFuelLevelState() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE);
- }
- /**
- * Sets Instant Fuel Comsumption
- * @param instantFuelConsumption
- */
- public void setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- }
- /**
- * Gets Instant Fuel Comsumption
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getInstantFuelConsumption() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_INSTANT_FUEL_CONSUMPTION);
- }
- /**
- * Sets External Temperature
- * @param externalTemperature
- */
- public void setExternalTemperature(VehicleDataResult externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- }
- /**
- * Gets External Temperature
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getExternalTemperature() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE);
- }
- /**
- * Gets currently selected gear data
- * @param prndl
- */
- public void setPrndl(VehicleDataResult prndl) {
- setParameters(KEY_PRNDL, prndl);
- }
- /**
- * Gets currently selected gear data
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getPrndl() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL);
- }
- /**
- * Sets Tire Pressure
- * @param tirePressure
- */
- public void setTirePressure(VehicleDataResult tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- }
- /**
- * Gets Tire Pressure
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getTirePressure() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE);
- }
- /**
- * Sets Odometer
- * @param odometer
- */
- public void setOdometer(VehicleDataResult odometer) {
- setParameters(KEY_ODOMETER, odometer);
- }
- /**
- * Gets Odometer
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getOdometer() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER);
- }
- /**
- * Sets Belt Status
- * @param beltStatus
- */
- public void setBeltStatus(VehicleDataResult beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- }
- /**
- * Gets Belt Status
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getBeltStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BELT_STATUS);
- }
- /**
- * Sets Body Information
- * @param bodyInformation
- */
- public void setBodyInformation(VehicleDataResult bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- }
- /**
- * Gets Body Information
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getBodyInformation() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION);
- }
- /**
- * Sets Device Status
- * @param deviceStatus
- */
- public void setDeviceStatus(VehicleDataResult deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- }
- /**
- * Gets Device Status
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getDeviceStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DEVICE_STATUS);
- }
- /**
- * Sets Driver Braking
- * @param driverBraking
- */
- public void setDriverBraking(VehicleDataResult driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- }
- /**
- * Gets Driver Braking
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getDriverBraking() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DRIVER_BRAKING);
- }
- /**
- * Sets Wiper Status
- * @param wiperStatus
- */
- public void setWiperStatus(VehicleDataResult wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- }
- /**
- * Gets Wiper Status
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getWiperStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS);
- }
- /**
- * Sets Head Lamp Status
- * @param headLampStatus
- */
- public void setHeadLampStatus(VehicleDataResult headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- }
- /**
- * Gets Head Lamp Status
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getHeadLampStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HEAD_LAMP_STATUS);
- }
- /**
- * Sets Engine Torque
- * @param engineTorque
- */
- public void setEngineTorque(VehicleDataResult engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
- /**
- * Gets Engine Torque
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getEngineTorque() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE);
- }
- /**
- * Sets Engine Oil Life
- * @param engineOilLife
- */
- public void setEngineOilLife(VehicleDataResult engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
- /**
- * Gets Engine Oil Life
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getEngineOilLife() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_OIL_LIFE);
- }
- /**
- * Sets AccPedal Position
- * @param accPedalPosition
- */
- public void setAccPedalPosition(VehicleDataResult accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- }
- /**
- * Gets AccPedal Position
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getAccPedalPosition() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ACC_PEDAL_POSITION);
- }
-
- public void setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- }
-
- @SuppressWarnings("unchecked")
- public VehicleDataResult getSteeringWheelAngle() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE);
- }
-
- public void setECallInfo(VehicleDataResult eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getECallInfo() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO);
- }
- public void setAirbagStatus(VehicleDataResult airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getAirbagStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS);
- }
- public void setEmergencyEvent(VehicleDataResult emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getEmergencyEvent() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT);
- }
- public void setClusterModeStatus(VehicleDataResult clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getClusterModeStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODE_STATUS);
- }
- public void setMyKey(VehicleDataResult myKey) {
- setParameters(KEY_MY_KEY, myKey);
- }
- @SuppressWarnings("unchecked")
- public VehicleDataResult getMyKey() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_MY_KEY);
- }
-
- /**
- * Sets Fuel Range
- * @param fuelRange
- */
- public void setFuelRange(VehicleDataResult fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
-
- /**
- * Gets Fuel Range
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getFuelRange() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE);
- }
-
- /**
- * Sets turnSignal
- * @param turnSignal
- */
- public void setTurnSignal(VehicleDataResult turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- }
-
- /**
- * Gets turnSignal
- * @return VehicleDataResult
- */
- @SuppressWarnings("unchecked")
- public VehicleDataResult getTurnSignal() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets electronicParkBrakeStatus
- * @param electronicParkBrakeStatus
- */
- public void setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus){
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- }
-
- /**
- * Gets electronicParkBrakeStatus
- * @return VehicleDataResult
- */
- public VehicleDataResult getElectronicParkBrakeStatus(){
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPoints.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPoints.java
deleted file mode 100644
index b748ef673..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPoints.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-public class UnsubscribeWayPoints extends RPCRequest {
- public UnsubscribeWayPoints() {
- super(FunctionID.UNSUBSCRIBE_WAY_POINTS.toString());
- }
- public UnsubscribeWayPoints(Hashtable<String, Object> hash) {
- super(hash);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java
deleted file mode 100644
index b7feef73e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeWayPointsResponse.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-public class UnsubscribeWayPointsResponse extends RPCResponse {
-
- public UnsubscribeWayPointsResponse() {
- super(FunctionID.UNSUBSCRIBE_WAY_POINTS.toString());
- }
- public UnsubscribeWayPointsResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new UnsubscribeWayPointsResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public UnsubscribeWayPointsResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java
deleted file mode 100644
index cb1dde7e4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Updates the list of next maneuvers, which can be requested by the user pressing the softbutton "Turns" on the
- * Navigation base screen. Three softbuttons are predefined by the system: Up, Down, Close
- *
- * <p>Function Group: Navigation</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- *
- * @since SmartDeviceLink 2.0
- * @see ShowConstantTbt
- */
-public class UpdateTurnList extends RPCRequest{
- public static final String KEY_TURN_LIST = "turnList";
- public static final String KEY_SOFT_BUTTONS = "softButtons";
-
- /**
- * Constructs a new UpdateTurnList object
- */
- public UpdateTurnList() {
- super(FunctionID.UPDATE_TURN_LIST.toString());
- }
-
- /**
- * <p>
- * Constructs a new UpdateTurnList object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
- */
- public UpdateTurnList(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets a list of turns to be shown to the user
- *
- * @param turnList
- * a List<Turn> value representing a list of turns to be shown to the user
- * <p>
- * <b>Notes: </b>Minsize=1; Maxsize=100</p>
- */
- public void setTurnList(List<Turn> turnList){
- setParameters(KEY_TURN_LIST, turnList);
- }
-
- /**
- * Gets a list of turns to be shown to the user
- *
- * @return List<Turn> -a List value representing a list of turns
- */
- @SuppressWarnings("unchecked")
- public List<Turn> getTurnList(){
- return (List<Turn>) getObject(Turn.class, KEY_TURN_LIST);
- }
-
- /**
- * Gets the SoftButton List object
- *
- * @return List<SoftButton> -a List<SoftButton> representing the List object
- * @since SmartDeviceLink 2.0
- */
- @SuppressWarnings("unchecked")
- public List<SoftButton> getSoftButtons(){
- return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
- }
-
- /**
- * Sets the SoftButtons
- *
- * @param softButtons
- * a List<SoftButton> value
- * <p>
- * <b>Notes: </b></p>
- * <ul>
- * <li>If omitted on supported displays, the alert will not have any SoftButton</li>
- * <li>ArrayMin: 0</li>
- * <li>ArrayMax: 4</li>
- * </ul>
- * @since SmartDeviceLink 2.0
- */
-
- public void setSoftButtons(List<SoftButton> softButtons){
- setParameters(KEY_SOFT_BUTTONS, softButtons);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java
deleted file mode 100644
index 5b0fbabf7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnListResponse.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-/**
- * Update Turn List Response is sent, when UpdateTurnList has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class UpdateTurnListResponse extends RPCResponse{
-
- /**
- * Constructs a new UpdateTurnListResponse object
- */
- public UpdateTurnListResponse() {
- super(FunctionID.UPDATE_TURN_LIST.toString());
- }
-
- public UpdateTurnListResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new UpdateTurnListResponse object
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public UpdateTurnListResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java
deleted file mode 100644
index 10860deab..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataType;
-/**
- *
- * Individual published data request result.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>dataType</td>
- * <td>VehicleDataType</td>
- * <td>Defined published data element type.</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * <tr>
- * <td>resultCode</td>
- * <td>VehicleDataResultCode</td>
- * <td>Published data result code.</td>
- * <td></td>
- * <td></td>
- * <td>SmartDeviceLink 1.0</td>
- * </tr>
- * </table>
- *
- */
-public class VehicleDataResult extends RPCStruct {
- public static final String KEY_DATA_TYPE = "dataType";
- public static final String KEY_RESULT_CODE = "resultCode";
-
- public VehicleDataResult() { }
- /**
- * <p>
- * Constructs a new VehicleDataResult object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash the Hashtable to use
- */
- public VehicleDataResult(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Individual published data request result.
- * @param dataType Defined published data element type.
- * @param resultCode Published data result code.
- */
- public VehicleDataResult(@NonNull VehicleDataType dataType, @NonNull VehicleDataResultCode resultCode){
- this();
- setDataType(dataType);
- setResultCode(resultCode);
- }
-
- public void setDataType(@NonNull VehicleDataType dataType) {
- setValue(KEY_DATA_TYPE, dataType);
- }
- public VehicleDataType getDataType() {
- return (VehicleDataType) getObject(VehicleDataType.class, KEY_DATA_TYPE);
- }
- public void setResultCode(@NonNull VehicleDataResultCode resultCode) {
- setValue(KEY_RESULT_CODE, resultCode);
- }
- public VehicleDataResultCode getResultCode() {
- return (VehicleDataResultCode) getObject(VehicleDataResultCode.class, KEY_RESULT_CODE);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java
deleted file mode 100644
index e6f860007..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-
-/**
- * Describes the type of vehicle the mobile phone is connected with.
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>SmartDeviceLink Ver. Available</th>
- * </tr>
- * <tr>
- * <td>make</td>
- * <td>String</td>
- * <td>Make of the vehicle
- * <ul>
- * <li>Maxlength = 500</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>Model</td>
- * <td>String</td>
- * <td>Model of the vehicle, e.g. Fiesta
- * <ul>
- * <li>Maxlength = 500</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>modelYear</td>
- * <td>String</td>
- * <td>Model Year of the vehicle, e.g. 2013
- * <ul>
- * <li>Maxlength = 500</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>trim</td>
- * <td>String</td>
- * <td>Trim of the vehicle, e.g. SE
- * <ul>
- * <li>Maxlength = 500</li>
- * </ul>
- * </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * @since SmartDeviceLink 2.0
- */
-public class VehicleType extends RPCStruct {
- public static final String KEY_MAKE = "make";
- public static final String KEY_MODEL = "model";
- public static final String KEY_MODEL_YEAR = "modelYear";
- public static final String KEY_TRIM = "trim";
-
- /**
- * Constructs a newly allocated VehicleType object
- */
- public VehicleType() { }
-
- /**
- * Constructs a newly allocated VehicleType object indicated by the Hashtable parameter
- * @param hash The Hashtable to use
- */
- public VehicleType(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * get the make of the vehicle
- * @return the make of the vehicle
- */
- public String getMake() {
- return getString(KEY_MAKE);
- }
-
- /**
- * set the make of the vehicle
- *@param make the make of the vehicle
- */
- public void setMake(String make) {
- setValue(KEY_MAKE, make);
- }
-
- /**
- * get the model of the vehicle
- * @return the model of the vehicle
- */
- public String getModel() {
- return getString(KEY_MODEL);
- }
-
- /**
- * set the model of the vehicle
- * @param model the model of the vehicle
- */
- public void setModel(String model) {
- setValue(KEY_MODEL, model);
- }
-
- /**
- * get the model year of the vehicle
- * @return the model year of the vehicle
- */
- public String getModelYear() {
- return getString(KEY_MODEL_YEAR);
- }
-
- /**
- * set the model year of the vehicle
- * @param modelYear the model year of the vehicle
- */
- public void setModelYear(String modelYear) {
- setValue(KEY_MODEL_YEAR, modelYear);
- }
-
- /**
- * get the trim of the vehicle
- * @return the trim of the vehicle
- */
- public String getTrim() {
- return getString(KEY_TRIM);
- }
-
- /**
- * set the trim of the vehicle
- * @param trim the trim of the vehicle
- */
- public void setTrim(String trim) {
- setValue(KEY_TRIM, trim);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java
deleted file mode 100644
index c558673e5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.proxy.RPCStruct;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Contains information about this system's video streaming capabilities.
- */
-
-public class VideoStreamingCapability extends RPCStruct {
- public static final String KEY_PREFERRED_RESOLUTION = "preferredResolution";
- public static final String KEY_MAX_BITRATE = "maxBitrate";
- public static final String KEY_SUPPORTED_FORMATS = "supportedFormats";
- public static final String KEY_HAPTIC_SPATIAL_DATA_SUPPORTED = "hapticSpatialDataSupported";
-
- public VideoStreamingCapability(){}
- public VideoStreamingCapability(Hashtable<String, Object> hash){super(hash);}
-
- public void setPreferredResolution(ImageResolution res){
- setValue(KEY_PREFERRED_RESOLUTION, res);
- }
-
- public ImageResolution getPreferredResolution(){
- return (ImageResolution) getObject(ImageResolution.class, KEY_PREFERRED_RESOLUTION);
- }
-
- /**
- * Set the max bitrate supported by this module.
- *
- * <b>NOTE: </b> Unit is in kbps.
- * @param maxBitrate in kbps
- */
- public void setMaxBitrate(Integer maxBitrate){
- setValue(KEY_MAX_BITRATE, maxBitrate);
- }
-
- /**
- * Retrieves the max bitrate supported by this module.
- *
- * <b>NOTE: </b> Unit is in kbps.
- * @return max bitrate in kbps
- */
- public Integer getMaxBitrate(){
- return getInteger(KEY_MAX_BITRATE);
- }
-
- public void setSupportedFormats(List<VideoStreamingFormat> formats){
- setValue(KEY_SUPPORTED_FORMATS, formats);
- }
-
- public List<VideoStreamingFormat> getSupportedFormats(){
- return (List<VideoStreamingFormat>) getObject(VideoStreamingFormat.class, KEY_SUPPORTED_FORMATS);
- }
-
- public Boolean getIsHapticSpatialDataSupported() {
- return getBoolean(KEY_HAPTIC_SPATIAL_DATA_SUPPORTED);
- }
-
- public void setIsHapticSpatialDataSupported(Boolean hapticSpatialDataSupported) {
- setValue(KEY_HAPTIC_SPATIAL_DATA_SUPPORTED, hapticSpatialDataSupported);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java
deleted file mode 100644
index 0ddfec2ef..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-
-import java.util.Hashtable;
-
-/**
- * Video streaming formats and their specifications.
- */
-
-public class VideoStreamingFormat extends RPCStruct {
- public static final String KEY_PROTOCOL = "protocol";
- public static final String KEY_CODEC = "codec";
-
- public VideoStreamingFormat(){}
- public VideoStreamingFormat(Hashtable<String, Object> hash){super(hash);}
-
- /**
- * Create the VideoStreamingFormat object
- * @param protocol The protocol used
- * @param codec The codec used
- */
- public VideoStreamingFormat(@NonNull VideoStreamingProtocol protocol, @NonNull VideoStreamingCodec codec){
- this();
- setProtocol(protocol);
- setCodec(codec);
- }
-
- public void setProtocol(@NonNull VideoStreamingProtocol protocol){
- setValue(KEY_PROTOCOL, protocol);
- }
-
- public VideoStreamingProtocol getProtocol(){
- return (VideoStreamingProtocol) getObject(VideoStreamingProtocol.class, KEY_PROTOCOL);
- }
-
- public void setCodec(@NonNull VideoStreamingCodec codec){
- setValue(KEY_CODEC, codec);
- }
-
- public VideoStreamingCodec getCodec(){
- return (VideoStreamingCodec) getObject(VideoStreamingCodec.class, KEY_CODEC);
- }
-
- @Override
- public String toString() {
- return "codec=" + String.valueOf(getCodec()) +
- ", protocol=" + String.valueOf(getProtocol());
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java
deleted file mode 100644
index 10eb6b0be..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.smartdevicelink.proxy.rpc;
-
-import android.support.annotation.NonNull;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.util.DebugTool;
-/**
- *
- * VR help items i.e. the text strings to be displayed, and when pronounced by the user the recognition of any of which must trigger the corresponding VR command.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>text</td>
- * <td>String</td>
- * <td>Text to display for VR Help item</td>
- * <td>Y</td>
- * <td>maxlength: 500</td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * <tr>
- * <td>image</td>
- * <td>Image</td>
- * <td>Image struct for VR Help item</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * <tr>
- * <td>position</td>
- * <td>Integer</td>
- * <td>Position to display item in VR Help list</td>
- * <td>N</td>
- * <td> minvalue=1; maxvalue=100</td>
- * <td>SmartDeviceLink 2.3.2</td>
- * </tr>
- * </table>
- *
- */
-public class VrHelpItem extends RPCStruct {
- public static final String KEY_POSITION = "position";
- public static final String KEY_TEXT = "text";
- public static final String KEY_IMAGE = "image";
-
- public VrHelpItem() { }
- /**
- * <p>
- * Constructs a new VrHelpItem object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash -The Hashtable to use
- */
- public VrHelpItem(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * VR help items i.e. the text strings to be displayed, and when pronounced
- * by the user the recognition of any of which must trigger the corresponding VR command.
- * @param text Text to display for VR Help item
- * @param position Position to display item in VR Help list
- */
- public VrHelpItem(@NonNull String text, @NonNull Integer position){
- this();
- setText(text);
- setPosition(position);
- }
-
- public void setText(@NonNull String text) {
- setValue(KEY_TEXT, text);
- }
- public String getText() {
- return getString(KEY_TEXT);
- }
- public void setImage(Image image) {
- setValue(KEY_IMAGE, image);
- }
- @SuppressWarnings("unchecked")
- public Image getImage() {
- return (Image) getObject(Image.class, KEY_IMAGE);
- }
- public void setPosition(@NonNull Integer position) {
- setValue(KEY_POSITION, position);
- }
- public Integer getPosition() {
- return getInteger(KEY_POSITION);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AmbientLightStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AmbientLightStatus.java
deleted file mode 100644
index 3f4076b11..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AmbientLightStatus.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Reflects the status of the ambient light sensor.
- *
- * @since SmartDeviceLink 2.3.2
- *
- * @see SoftButtonCapabilities
- * @see ButtonCapabilities
- * @see OnButtonPress
- *
- */
-
-public enum AmbientLightStatus {
- NIGHT,
- TWILIGHT_1,
- TWILIGHT_2,
- TWILIGHT_3,
- TWILIGHT_4,
- DAY,
- UNKNOWN,
- INVALID;
- /**
- * Convert String to AmbientLightStatus
- * @param value String
- * @return AmbientLightStatus
- */
-
- public static AmbientLightStatus 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/AppHMIType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java
deleted file mode 100644
index 1bb045006..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppHMIType.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enumeration listing possible app hmi types.
- * @since SmartDeviceLink 2.0
- */
-public enum AppHMIType {
- /**
- * The App will have default rights.
- */
- DEFAULT,
- /**
- * Communication type of App
- */
- COMMUNICATION,
- /**
- * App dealing with Media
- */
- MEDIA,
- /**
- * Messaging App
- */
- MESSAGING,
- /**
- * Navigation App
- */
- NAVIGATION,
- /**
- * Information App
- */
- INFORMATION,
- /**
- * App dealing with social media
- */
- SOCIAL,
- BACKGROUND_PROCESS,
- /**
- * App only for Testing purposes
- */
- TESTING,
- /**
- * Custom App Interfaces
- */
- PROJECTION,
- /**
- * System App
- */
- SYSTEM,
- /**
- * Remote Control
- */
- REMOTE_CONTROL,
- ;
-
- /**
- * Convert String to AppHMIType
- * @param value String
- * @return AppHMIType
- */
- public static AppHMIType 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/AppInterfaceUnregisteredReason.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java
deleted file mode 100644
index d4a7ff103..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AppInterfaceUnregisteredReason.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Indicates reason why app interface was unregistered. The application is being
- * disconnected by SDL.
- *
- * @since SmartDeviceLink 1.0
- */
-public enum AppInterfaceUnregisteredReason {
- USER_EXIT,
- /**
- * Vehicle ignition turned off.
- *
- * @since SmartDeviceLink 1.0
- */
- IGNITION_OFF,
- /**
- * Bluetooth was turned off, causing termination of a necessary Bluetooth
- * connection.
- *
- * @since SmartDeviceLink 1.0
- */
- BLUETOOTH_OFF,
- /**
- * USB was disconnected, causing termination of a necessary iAP connection.
- *
- * @since SmartDeviceLink 1.0
- */
- USB_DISCONNECTED,
- /**
- * Application attempted SmartDeviceLink RPC request while {@linkplain HMILevel}
- * =NONE. App must have HMILevel other than NONE to issue RPC requests or
- * get notifications or RPC responses.
- *
- * @since SmartDeviceLink 1.0
- */
- REQUEST_WHILE_IN_NONE_HMI_LEVEL,
- /**
- * Either too many -- or too many per unit of time -- requests were made by
- * the application.
- *
- * @since SmartDeviceLink 1.0
- */
- TOO_MANY_REQUESTS,
- /**
- * The application has issued requests which cause driver distraction rules
- * to be violated.
- *
- * @since SmartDeviceLink 1.0
- */
- DRIVER_DISTRACTION_VIOLATION,
- /**
- * The user has changed the language in effect on the SDL platform to a
- * language that is incompatible with the language declared by the
- * application in its RegisterAppInterface request.
- *
- * @since SmartDeviceLink 1.0
- */
- LANGUAGE_CHANGE,
- /**
- * The user performed a MASTER RESET on the SDL platform, causing removal
- * of a necessary Bluetooth pairing.
- *
- * @since SmartDeviceLink 1.0
- */
- MASTER_RESET,
- /**
- * The user restored settings to FACTORY DEFAULTS on the SDL platform.
- *
- * @since SmartDeviceLink 1.0
- */
- FACTORY_DEFAULTS,
- /**
- * The app is not being authorized to be connected to SDL.
- *
- * @since SmartDeviceLink 2.0
- */
- APP_UNAUTHORIZED,
- /**
- * The app has committed a protocol violation.
- *
- * @since SmartDeviceLink 4.0
- */
- PROTOCOL_VIOLATION,
- ;
- /**
- * Convert String to AppInterfaceUnregisteredReason
- * @param value String
- * @return AppInterfaceUnregisteredReason
- */
- public static AppInterfaceUnregisteredReason 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/AudioStreamingIndicator.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingIndicator.java
deleted file mode 100644
index 00a15d9f0..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingIndicator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Identifies the playback status of a media app
- *
- * @since SmartDeviceLink 5.0
- */
-public enum AudioStreamingIndicator {
- /**
- * Default playback indicator.
- *
- * @since SmartDeviceLink 5.0
- */
- PLAY_PAUSE,
-
- /**
- * Indicates that a button press of the Play/Pause button would start the playback.
- *
- * @since SmartDeviceLink 5.0
- */
- PLAY,
- /**
- * Indicates that a button press of the Play/Pause button would pause the current playback.
- *
- * @since SmartDeviceLink 5.0
- */
- PAUSE,
- /**
- * Indicates that a button press of the Play/Pause button would stop the current playback.
- *
- * @since SmartDeviceLink 5.0
- */
- STOP,
- ;
-
- /**
- * Convert String to AudioStreamingIndicator
- * @param value String
- * @return AudioStreamingIndicator
- */
- public static AudioStreamingIndicator 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/AudioStreamingState.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingState.java
deleted file mode 100644
index 50accb6bf..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioStreamingState.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Describes whether or not streaming audio is currently audible to the user.
- * Though provided in every OnHMIStatus notification, this information is only
- * relevant for applications that declare themselves as media apps in
- * RegisterAppInterface
- *
- * @since SmartDeviceLink 1.0
- */
-public enum AudioStreamingState {
- /**
- * Currently streaming audio, if any, is audible to user.
- *
- * @since SmartDeviceLink 1.0
- */
- AUDIBLE,
-
- /**
- * Some kind of audio mixing is taking place. Currently streaming audio, if
- * any, is audible to the user at a lowered volume.
- *
- * @since SmartDeviceLink 2.0
- */
- ATTENUATED,
- /**
- * Currently streaming audio, if any, is not audible to user. made via VR
- * session.
- *
- * @since SmartDeviceLink 1.0
- */
- NOT_AUDIBLE;
- /**
- * Convert String to AudioStreamingState
- * @param value String
- * @return AudioStreamingState
- */
-
- public static AudioStreamingState 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/AudioType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioType.java
deleted file mode 100644
index d340e0e4c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/AudioType.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Describes different audio type options for PerformAudioPassThru
- *
- * @see SoftButtonCapabilities
- * @see ButtonCapabilities
- * @see OnButtonPress
- * @since SmartDeviceLink 2.0
-
- */
-public enum AudioType {
- /**
- * PCM raw audio
- *
- * @since SmartDeviceLink 2.0
- */
- PCM;
- /**
- * Convert String to AudioType
- * @param value String
- * @return AudioType
- */
-
- public static AudioType 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/BitsPerSample.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/BitsPerSample.java
deleted file mode 100644
index b21e138a9..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/BitsPerSample.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-/**
- * Describes different bit depth options for PerformAudioPassThru.
- * @see PerformAudioPassThru
- * @since SmartDeviceLink 2.0
- */
-public enum BitsPerSample {
- /**
- * 8 bits per sample
- *
- * @since SmartDeviceLink 2.0
- */
- _8_BIT("8_BIT"),
- /**
- * 16 bits per sample
- *
- * @since SmartDeviceLink 2.0
- */
- _16_BIT("16_BIT");
-
- private final String INTERNAL_NAME;
-
- private BitsPerSample(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
-
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- public static BitsPerSample valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (BitsPerSample anEnum : EnumSet.allOf(BitsPerSample.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java
deleted file mode 100644
index 33f1f0f49..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Indicates whether the button was depressed or released. A BUTTONUP event will
- * always be preceded by a BUTTONDOWN event
- *
- * @see SoftButtonCapabilities
- * @see OnButtonEvent
- * @since SmartDeviceLink 1.0
- */
-public enum ButtonEventMode {
- /**
- * The button was released
- */
- BUTTONUP,
- /**
- * The button was depressed
- */
- BUTTONDOWN;
-
- /**
- * Returns a ButtonEventMode (BUTTONUP or BUTTONDOWN)
- *
- * @param value
- * a String
- * @return ButtonEventMode -BUTTONUP or BUTTONDOWN
- */
-
- public static ButtonEventMode 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/ButtonName.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java
deleted file mode 100644
index 6d4cecffc..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * <p>
- * Defines logical buttons which, on a given SDL unit, would correspond to
- * either physical or soft (touchscreen) buttons. These logical buttons present
- * a standard functional abstraction which the developer can rely upon,
- * independent of the SDL unit. For example, the developer can rely upon the OK
- * button having the same meaning to the user across SDL platforms.
- * </p>
- * <p>
- * The preset buttons (0-9) can typically be interpreted by the application as
- * corresponding to some user-configured choices, though the application is free
- * to interpret these button presses as it sees fit.
- * </p>
- * <p>
- * The application can discover which buttons a given SDL unit implements by
- * interrogating the ButtonCapabilities parameter of the
- * RegisterAppInterface response.
- * </p>
- *
- * @since SmartDeviceLink 1.0
- */
-public enum ButtonName{
- /**
- * <br><b>THIS ENUM VALUE WILL CHANGE IN FUNCITONALITY DURING THE NEXT MAJOR RELEASE!</b>
- * <br><br>
- * This ButtonName value originally was used for both the OK button and PLAY_PAUSE button. As of
- * SmartDeviceLink 5.0.0, the functionality was broken out into the OK and PLAY_PAUSE buttons.
- * <br><br> For this version of the library OK will be received for both OK and PLAY_PAUSE to
- * mitigate a potential break in functionliaty. If the desire is only for the OK functionality,
- * this button should still be used. If the desired functionality was actually for the play/pause
- * toggle, then the new PLAY_PAUSE should be used.
- * <br><br>
- * Represents the button usually labeled "OK". A typical use of this button
- * is for the user to press it to make a selection (and until a major library version release,
- * play pause toggle).
- *
- * @since SmartDeviceLink 1.0
- * @see #PLAY_PAUSE
- */
- OK,
- /**
- * Represents the seek-left button. A typical use of this button is for the
- * user to scroll to the left through menu choices one menu item per press.
- *
- * @since SmartDeviceLink 1.0
- */
- SEEKLEFT,
- /**
- * Represents the seek-right button. A typical use of this button is for the
- * user to scroll to the right through menu choices one menu item per press.
- *
- * @since SmartDeviceLink 1.0
- */
- SEEKRIGHT,
- /**
- * Represents a turn of the tuner knob in the clockwise direction one tick.
- *
- * @since SmartDeviceLink 1.0
- */
- TUNEUP,
- /**
- * Represents a turn of the tuner knob in the counter-clockwise direction
- * one tick.
- *
- * @since SmartDeviceLink 1.0
- */
- TUNEDOWN,
- /**
- * Represents the preset 0 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_0,
- /**
- * Represents the preset 1 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_1,
- /**
- * Represents the preset 2 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_2,
- /**
- * Represents the preset 3 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_3,
- /**
- * Represents the preset 4 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_4,
- /**
- * Represents the preset 5 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_5,
- /**
- * Represents the preset 6 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_6,
- /**
- * Represents the preset 7 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_7,
- /**
- * Represents the preset 8 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_8,
- /**
- * Represents the preset 9 button.
- *
- * @since SmartDeviceLink 1.0
- */
- PRESET_9,
- CUSTOM_BUTTON,
- SEARCH,
- AC_MAX,
- AC,
- RECIRCULATE,
- FAN_UP,
- FAN_DOWN,
- TEMP_UP,
- TEMP_DOWN,
- DEFROST_MAX,
- DEFROST,
- DEFROST_REAR,
- UPPER_VENT,
- LOWER_VENT,
- VOLUME_UP,
- VOLUME_DOWN,
- EJECT,
- SOURCE,
- SHUFFLE,
- REPEAT,
- /**
- * Represents the play/pause button. A typical use of this button
- * is for the user to press it to toggle between media playing and pausing.
- *
- * <br><br><b>NOTE:</b> This functionality used to be represented by the OK button.
- *
- * @since SmartDeviceLink 5.0
- * @see #OK
- */
- PLAY_PAUSE,
-
- ;
-
- public static ButtonName valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-
- /**
- * indexForPresetButton returns the integer index for preset buttons
- * which match the preset order. E.G.: indexForPresetButton(PRESET_1)
- * returns the value 1. If the buttonName given is not a preset button,
- * the method will return null.
- *
- * @param buttonName
- * @return Integer
- */
- public static Integer indexForPresetButton(ButtonName buttonName) {
- if(buttonName == null){
- return null;
- }
-
- Integer returnIndex = null;
-
- switch(buttonName) {
- case PRESET_0:
- returnIndex = 0;
- break;
- case PRESET_1:
- returnIndex = 1;
- break;
- case PRESET_2:
- returnIndex = 2;
- break;
- case PRESET_3:
- returnIndex = 3;
- break;
- case PRESET_4:
- returnIndex = 4;
- break;
- case PRESET_5:
- returnIndex = 5;
- break;
- case PRESET_6:
- returnIndex = 6;
- break;
- case PRESET_7:
- returnIndex = 7;
- break;
- case PRESET_8:
- returnIndex = 8;
- break;
- case PRESET_9:
- returnIndex = 9;
- break;
- default:
- break;
- }
-
- return returnIndex;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonPressMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonPressMode.java
deleted file mode 100644
index cc2852526..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonPressMode.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Indicates whether this is a LONG or SHORT button press.
- * <p></p>
- *@see ButtonEventMode
- *@since SmartDeviceLink 1.0
- */
-public enum ButtonPressMode {
- /**
- * The button has been depressed for 2 seconds. The button may remain
- * depressed after receiving this event
- */
- LONG,
- /**
- * The button was released before the 2-second long-press interval had
- * elapsed
- */
- SHORT;
- /**
- * Returns a ButtonPressMode (LONG or SHORT)
- *
- * @param value
- * a String
- * @return ButtonPressMode -LONG or SHORT
- */
-
- public static ButtonPressMode 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/CarModeStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java
deleted file mode 100644
index c44b457ec..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Describes the carmode the vehicle is in.
- * @see SoftButtonCapabilities
- * @see ButtonCapabilities
- * @see OnButtonPress
- * @since SmartDeviceLink 2.0
- */
-
-public enum CarModeStatus {
- /** Provides carmode NORMAL to each module.
- */
-
- NORMAL,
- /** Provides carmode FACTORY to each module.
- */
-
- FACTORY,
- /** Provides carmode TRANSPORT to each module.
- */
-
- TRANSPORT,
- /** Provides carmode CRASH to each module.
- */
-
-
- CRASH;
- /** Convert String to CarModeStatus
- * @param value String
- * @return CarModeStatus
- */
-
- public static CarModeStatus 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/CharacterSet.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CharacterSet.java
deleted file mode 100644
index b8c4c9535..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CharacterSet.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * Character sets supported by SDL.
- * @since SmartDeviceLink 1.0
- */
-public enum CharacterSet {
- TYPE2SET,
- TYPE5SET,
- CID1SET,
- CID2SET;
-
- /**
- * Convert String to CharacterSet
- * @param value String
- * @return CharacterSet
- */
- public static CharacterSet 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/CompassDirection.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CompassDirection.java
deleted file mode 100644
index a450bf6ed..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/CompassDirection.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * The list of potential compass directions
- * @since SmartDeviceLink 2.0
- */
-public enum CompassDirection {
- /**
- * Direction North
- */
- NORTH,
- /**
- * Direction Northwest
- */
- NORTHWEST,
- /**
- * Direction West
- */
- WEST,
- /**
- * Direction Southwest
- */
- SOUTHWEST,
- /**
- * Direction South
- */
- SOUTH,
- /**
- * Direction Southeast
- */
- SOUTHEAST,
- /**
- * Direction East
- */
- EAST,
- /**
- * Direction Northeast
- */
- NORTHEAST;
-
- /**
- * Convert String to CompassDirection
- * @param value String
- * @return CompassDirection
- */
- public static CompassDirection 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/ComponentVolumeStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ComponentVolumeStatus.java
deleted file mode 100644
index 64d5515ad..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ComponentVolumeStatus.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * The volume status of a vehicle component
- * @since SmartDeviceLink 2.0
- */
-public enum ComponentVolumeStatus {
- /**
- * Unknown
- */
- UNKNOWN,
- /**
- * Normal
- */
- NORMAL,
- /**
- * Low
- */
- LOW,
- /**
- * Fault
- */
- FAULT,
- /**
- * Alert
- */
- ALERT,
- /**
- * Not supported
- */
- NOT_SUPPORTED;
-
- /**
- * Convert String to ComponentVolumeStatus
- * @param value String
- * @return ComponentVolumeStatus
- */
- public static ComponentVolumeStatus 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/DefrostZone.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DefrostZone.java
deleted file mode 100644
index 4c6b15e85..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DefrostZone.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum DefrostZone {
- FRONT,
- REAR,
- ALL,
- NONE,
- ;
-
- public static DefrostZone 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/DeliveryMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeliveryMode.java
deleted file mode 100644
index 52361a97d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeliveryMode.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum DeliveryMode {
- PROMPT,
- DESTINATION,
- QUEUE,
- ;
-
- public static DeliveryMode 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/DeviceLevelStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeviceLevelStatus.java
deleted file mode 100644
index 273dc83d3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DeviceLevelStatus.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Reflects the reported battery status of the connected device, if reported.
- * @since SmartDeviceLink 2.0
- */
-public enum DeviceLevelStatus {
- /**
- * Zero level bars
- */
- ZERO_LEVEL_BARS,
- /**
- * One level bars
- */
- ONE_LEVEL_BARS,
- /**
- * Two level bars
- */
- TWO_LEVEL_BARS,
- /**
- * Three level bars
- */
- THREE_LEVEL_BARS,
- /**
- * Four level bars
- */
- FOUR_LEVEL_BARS,
- /**
- * Not provided
- */
- NOT_PROVIDED;
-
- /**
- * Convert String to DeviceLevelStatus
- * @param value String
- * @return DeviceLevelStatus
- */
- public static DeviceLevelStatus 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/Dimension.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Dimension.java
deleted file mode 100644
index 012803510..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Dimension.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-/**
- * The supported dimensions of the GPS.
- * @since SmartDeviceLink 2.0
- */
-public enum Dimension {
- /**
- * No GPS at all
- */
- NO_FIX("NO_FIX"),
- /**
- * Longitude and latitude
- */
- _2D("2D"),
- /**
- * Longitude and latitude and altitude
- */
- _3D("3D");
-
- private final String INTERNAL_NAME;
-
- private Dimension(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
-
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- /**
- * Convert String to Dimension
- * @param value String
- * @return Dimension
- */
- public static Dimension valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (Dimension anEnum : EnumSet.allOf(Dimension.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
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
deleted file mode 100644
index 5a0c0c7e4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java
+++ /dev/null
@@ -1,16 +0,0 @@
-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/DisplayType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java
deleted file mode 100644
index 2a2996762..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** The type of the display.
- *
- *
- * @since SmartDevcieLink 1.0
- *
- */
-
-public enum DisplayType {
- /**
- * Center Information Display.
- *This display type provides a 2-line x 20 character "dot matrix" display.
- *
- */
-
- CID("CID"),
- /** TYPE II display.
- 1 line older radio head unit. */
-
- TYPE2("TYPE2"),
- /**
- * TYPE V display
- Old radio head unit.
-
- */
-
- TYPE5("TYPE5"),
- /**
- * Next Generation Navigation display.
- */
-
- NGN("NGN"),
- /**
- * GEN-2, 8 inch display.
- */
-
- GEN2_8_DMA("GEN2_8_DMA"),
- /**
- * GEN-2, 6 inch display.
- */
-
- GEN2_6_DMA("GEN2_6_DMA"),
- /**
- * 3 inch GEN1.1 display.
- */
-
- MFD3("MFD3"),
- /**
- * 4 inch GEN1.1 display
- */
-
- MFD4("MFD4"),
- /**
- * 5 inch GEN1.1 display.
- */
-
- MFD5("MFD5"),
- /**
- * GEN-3, 8 inch display.
- */
-
- GEN3_8_INCH("GEN3_8-INCH"),
-
- /**
- * SDL_GENERIC display type. Used for most SDL integrations.
- */
- SDL_GENERIC("SDL_GENERIC"),
-
- ;
-
- private final String INTERNAL_NAME;
-
- private DisplayType(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
-
- public static DisplayType valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (DisplayType type : DisplayType.values()) {
- if (type.toString().equals(value)) {
- return type;
- }
- }
-
- return null;
- }
-
- @Override
- public String toString() {
- return INTERNAL_NAME;
- }
-}
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
deleted file mode 100644
index 36e103bf3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java
+++ /dev/null
@@ -1,15 +0,0 @@
-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/DriverDistractionState.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DriverDistractionState.java
deleted file mode 100644
index 890488c5e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DriverDistractionState.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- *
- */
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enumeration that describes possible states of driver distraction.
- * @since SmartDeviceLink 1.0
- */
-public enum DriverDistractionState {
- /**
- * Driver distraction rules are in effect.
- */
- DD_ON,
- /**
- * Driver distraction rules are NOT in effect.
- */
- DD_OFF;
-
- /**
- * Convert String to DriverDistractionState
- * @param value String
- * @return DriverDistractionState
- */
- public static DriverDistractionState 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/ECallConfirmationStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ECallConfirmationStatus.java
deleted file mode 100644
index b7a341d9e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ECallConfirmationStatus.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Reflects the status of the eCall Notification.
- * <p>
- *
- * @since SmartDeviceLink 2.0
- *
- */
-
-public enum ECallConfirmationStatus {
- /**
- * No E-Call signal triggered.
- */
- NORMAL,
- /**
- * An E-Call is being in progress.
- */
- CALL_IN_PROGRESS,
- /**
- * An E-Call was cancelled by the user.
- */
- CALL_CANCELLED,
- /**
- * The E-Call sequence is completed.
- */
- CALL_COMPLETED,
- /**
- * An E-Call could not be connected.
- */
- CALL_UNSUCCESSFUL,
- /**
- * E-Call is not configured on this vehicle.
- */
- ECALL_CONFIGURED_OFF,
- /**
- * E-Call is considered to be complete without Emergency Operator contact.
- */
- CALL_COMPLETE_DTMF_TIMEOUT;
-
- public static ECallConfirmationStatus 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/ElectronicParkBrakeStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ElectronicParkBrakeStatus.java
deleted file mode 100644
index f3951c7a1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ElectronicParkBrakeStatus.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum ElectronicParkBrakeStatus {
- /**
- * Park brake actuators have been fully applied.
- */
- CLOSED,
- /**
- * Park brake actuators are transitioning to either Apply/Closed or Release/Open state.
- */
- TRANSITION,
- /**
- * Park brake actuators are released.
- */
- OPEN,
- /**
- * When driver pulls the Electronic Park Brake switch while driving "at speed".
- */
- DRIVE_ACTIVE,
- /**
- * When system has a fault or is under maintenance.
- */
- FAULT,
- ;
-
- /**
- * Convert String to ElectronicParkBrakeStatus
- * @param value String
- * @return ElectronicParkBrakeStatus
- */
- public static ElectronicParkBrakeStatus 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/EmergencyEventType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/EmergencyEventType.java
deleted file mode 100644
index 374a6c7e2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/EmergencyEventType.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- *
- * Reflects the emergency event status of the vehicle.
- *
- */
-public enum EmergencyEventType {
- /** No emergency event has happened.
- */
- NO_EVENT,
- /** Frontal collision has happened.
- */
- FRONTAL,
- /** Side collision has happened.
- */
- SIDE,
- /**Rear collision has happened.
- */
- REAR,
- /** A rollover event has happened.
- */
- ROLLOVER,
- /** The signal is not supported
- */
- NOT_SUPPORTED,
- /** Emergency status cannot be determined
- */
- FAULT;
- /**
- * Convert String to EmergencyEventType
- * @param value String
- * @return EmergencyEventTpe
- */
- public static EmergencyEventType 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/FileType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FileType.java
deleted file mode 100644
index 54e5ce8b8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FileType.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enumeration listing possible file types.
- * @since SmartDeviceLink 2.0
- */
-public enum FileType {
- /**
- * BMP
- */
- GRAPHIC_BMP,
- /**
- * JPEG
- */
- GRAPHIC_JPEG,
- /**
- * PNG
- */
- GRAPHIC_PNG,
- /**
- * WAVE
- */
- AUDIO_WAVE,
- AUDIO_AAC,
- /**
- * MP3
- */
- AUDIO_MP3,
- BINARY,
- JSON;
-
- /**
- * Convert String to FileType
- * @param value String
- * @return FileType
- */
- public static FileType 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/FuelCutoffStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelCutoffStatus.java
deleted file mode 100644
index 266f13afb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelCutoffStatus.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Reflects the status of the Restraints Control Module fuel pump cutoff.<br> The fuel pump is cut off typically after the vehicle has had a collision.
- * <p>
- *
- * @since SmartDeviceLink 2.0
- *
- */
-public enum FuelCutoffStatus {
- /** Fuel is cut off
- */
- TERMINATE_FUEL,
- /** Fuel is not cut off
- *
- */
- NORMAL_OPERATION,
- /** Status of the fuel pump cannot be determined
- *
- */
- FAULT;
- /**
- * Convert String to FuelCutoffStatus
- * @param value String
- * @return FuelCuttoffStatus
- */
- public static FuelCutoffStatus 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/FuelType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelType.java
deleted file mode 100644
index 8241ebd45..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/FuelType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum FuelType {
- GASOLINE,
- DIESEL,
- /**
- * For vehicles using compressed natural gas.
- */
- CNG,
- /**
- * For vehicles using liquefied petroleum gas.
- */
- LPG,
- /**
- * For FCEV (fuel cell electric vehicle).
- */
- HYDROGEN,
- /**
- * For BEV (Battery Electric Vehicle), PHEV (Plug-in Hybrid Electric Vehicle), solar vehicles and other vehicles which run on a battery.
- */
- BATTERY,
- ;
-
- public static FuelType 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/GlobalProperty.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/GlobalProperty.java
deleted file mode 100644
index a54d53d1d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/GlobalProperty.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Properties of a user-initiated VR interaction (i.e. interactions started by the user pressing the PTT button).
- * @since SmartDeviceLink 1.0
- */
-public enum GlobalProperty{
- /**
- * The help prompt to be spoken if the user needs assistance during a user-initiated interaction.
- */
- HELPPROMPT,
- /**
- * The prompt to be spoken if the user-initiated interaction times out waiting for the user's verbal input.
- */
- TIMEOUTPROMPT,
- /**
- * The property vrHelpTitle of setGlobalProperties
- */
-
- VRHELPTITLE,
- /**
- * The property array of vrHelp of setGlobalProperties
- */
-
- VRHELPITEMS,
- /**
- * The property in-app menu name of setGlobalProperties
- */
-
- MENUNAME,
- /**
- * The property in-app menu icon of setGlobalProperties
- */
-
- MENUICON,
- /**
- * The on-screen keyboard configuration of setGlobalProperties
- */
-
- KEYBOARDPROPERTIES;
-
- /**
- * Convert String to GlobalProperty
- * @param value String
- * @return GlobalProperty
- */
- public static GlobalProperty 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/HMILevel.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java
deleted file mode 100644
index 8757a26ec..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-/**
- * Specifies current level of the HMI. An HMI level indicates the degree of user interaction possible through the HMI (e.g. TTS only, display only, VR, etc.). The HMI level varies for an application based on the type of display (i.e. Nav or non-Nav) and the user directing "focus" to other applications (e.g. phone, other mobile applications, etc.)
- *
- * @since SmartDeviceLink 1.0
- */
-public enum HMILevel {
- /**
- * The application has full use of the SDL HMI. The app may output via TTS, display, or streaming audio and may gather input via VR, Menu, and button presses
- */
- HMI_FULL("FULL"),
- /**
- * This HMI Level is only defined for a media application using an HMI with an 8 inch touchscreen (Nav) system. The application's {@linkplain com.smartdevicelink.proxy.rpc.Show} text is displayed and it receives button presses from media-oriented buttons (SEEKRIGHT, SEEKLEFT, TUNEUP, TUNEDOWN, PRESET_0-9)
- */
- HMI_LIMITED("LIMITED"),
- /**
- * App cannot interact with user via TTS, VR, Display or Button Presses. App can perform the following operations:
- * <ul>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.AddCommand}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.DeleteCommand}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.AddSubMenu}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.DeleteSubMenu}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.SubscribeButton}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.UnsubscribeButton}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.Show}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.UnregisterAppInterface}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.ResetGlobalProperties}</li>
- * <li>Operation {@linkplain com.smartdevicelink.proxy.rpc.SetGlobalProperties}</li>
- * </ul>
- */
- HMI_BACKGROUND("BACKGROUND"),
- /**
- * Application has been discovered by SDL, but application cannot send any requests or receive any notifications
- * An HMILevel of NONE can also mean that the user has exited the application by saying "exit appname" or selecting "exit" from the application's menu. When this happens, the application still has an active interface registration with SDL and all SDL resources the application has created (e.g. Choice Sets, subscriptions, etc.) still exist. But while the HMILevel is NONE, the application cannot send any messages to SDL, except <i>{@linkplain com.smartdevicelink.proxy.rpc.UnregisterAppInterface}</li>
- */
- HMI_NONE("NONE");
-
- private final String INTERNAL_NAME;
-
- private HMILevel(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
-
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- /**
- * Returns a HMILevel Status (FULL, LIMITED, BACKGROUND or NONE)
- * @param value a String
- * @return HMILevel -a String value (FULL, LIMITED, BACKGROUND or NONE)
- */
- public static HMILevel valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (HMILevel anEnum : EnumSet.allOf(HMILevel.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/HmiZoneCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/HmiZoneCapabilities.java
deleted file mode 100644
index 4725b4ff4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/HmiZoneCapabilities.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Specifies HMI Zones in the vehicle.
- *
- * @since SmartDeviceLink 1.0
- */
-public enum HmiZoneCapabilities {
- /**
- * Indicates HMI available for front seat passengers.
- *
- * @since SmartDeviceLink 1.0
- */
- FRONT,
- /**
- * Indicates HMI available for rear seat passengers.
- *
- * @since SmartDeviceLink 1.0
- */
- BACK;
- /**
- * Convert String to HMIZoneCapabilities
- * @param value String
- * @return HMIZoneCapabilities
- */
-
- public static HmiZoneCapabilities 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/IgnitionStableStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStableStatus.java
deleted file mode 100644
index 91d6ecf8e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStableStatus.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Reflects the ignition switch stability.
- * @since SmartDeviceLink 2.0
- */
-public enum IgnitionStableStatus {
- /**
- * The current ignition switch status is considered not to be stable.
- */
- IGNITION_SWITCH_NOT_STABLE,
- /**
- * The current ignition switch status is considered to be stable.
- */
- IGNITION_SWITCH_STABLE,
- MISSING_FROM_TRANSMITTER;
-
- /**
- * Convert String to IgnitionStableStatus
- * @param value String
- * @return IgnitionStableStatus
- */
- public static IgnitionStableStatus 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/IgnitionStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStatus.java
deleted file mode 100644
index b17ccf1cf..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/IgnitionStatus.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Reflects the status of ignition.
- * @since SmartDeviceLink 2.0
- */
-public enum IgnitionStatus {
- /**
- * Ignition status currently unknown
- */
- UNKNOWN,
- /**
- * Ignition is off
- */
- OFF,
- /**
- * Ignition is in mode accessory
- */
- ACCESSORY,
- /**
- * Ignition is in mode run
- */
- RUN,
- /**
- * Ignition is in mode run
- */
- START,
- /**
- * Signal is invalid
- */
- INVALID;
-
- /**
- * Convert String to IgnitionStatus
- * @param value String
- * @return IgnitionStatus
- */
- public static IgnitionStatus 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/ImageFieldName.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java
deleted file mode 100644
index 799b1e99d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * The name that identifies the field.
- *
- * @since SmartDeviceLink 2.3.2
- */
-public enum ImageFieldName {
- /** The image field for SoftButton
- *
- */
-
- softButtonImage,
- /** The first image field for Choice.
- *
- */
-
- choiceImage,
- /** The secondary image field for Choice.
- *
- */
-
- choiceSecondaryImage,
- /** The image field for vrHelpItem.
- *
- */
-
- vrHelpItem,
- /** The image field for Turn.
- *
- */
-
- turnIcon,
- /** The image field for the menu icon in SetGlobalProperties.
- *
- */
-
- menuIcon,
- /** The image filed for AddCommand.
- *
- */
-
- cmdIcon,
- /** The image field for the app icon ( set by setAppIcon).
- *
- */
-
- appIcon,
- /** The image filed for Show.
- *
- */
-
- graphic,
- /** The primary image field for ShowConstant TBT.
- *
- */
-
- showConstantTBTIcon,
-
- /** The secondary image field for ShowConstant TBT.
- *
- */
- showConstantTBTNextTurnIcon,
- /**
- * The optional image of a destination / location
- *
- * @since SmartDeviceLink 4.0
- */
- locationImage,
- /**
- * The secondary graphic image field
- *
- * @since SmartDeviceLink 5.0
- */
- secondaryGraphic,
- ;
-
- /**
- * Convert String to ImageFieldName
- * @param value String
- * @return ImageFieldName
- */
- public static ImageFieldName 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/ImageType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageType.java
deleted file mode 100644
index 5b79257e1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageType.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Contains information about the type of image.
- * @since SmartDeviceLink 2.0
- */
-public enum ImageType {
- /**
- * Just the static hex icon value to be used
- */
- STATIC,
- /**
- * Binary image file to be used (identifier to be sent by PutFile)
- */
- DYNAMIC;
-
- /**
- * Convert String to ImageType
- * @param value String
- * @return ImageType
- */
- public static ImageType 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/InteractionMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/InteractionMode.java
deleted file mode 100644
index 98b61a1f2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/InteractionMode.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * For application-initiated interactions (<i>{@linkplain com.smartdevicelink.proxy.rpc.PerformInteraction}</i>), this specifies
- * the mode by which the user is prompted and by which the user's selection is
- * indicated
- *
- * @since SmartDeviceLink 1.0
- */
-public enum InteractionMode {
- /**
- * This mode causes the interaction to occur only on the display, meaning
- * the choices are presented and selected only via the display. Selections
- * are viewed with the SEEKRIGHT, SEEKLEFT, TUNEUP, TUNEDOWN buttons. User's
- * selection is indicated with the OK button
- */
- MANUAL_ONLY,
- /**
- * This mode causes the interaction to occur only through TTS and VR. The
- * user is prompted via TTS to select a choice by saying one of the choice's
- * synonyms
- */
- VR_ONLY,
- /**
- * This mode is a combination of MANUAL_ONLY and VR_ONLY, meaning the user
- * is prompted both visually and audibly. The user can make a selection
- * either using the mode described in MANUAL_ONLY or using the mode
- * described in VR_ONLY. If the user views selections as described in
- * MANUAL_ONLY mode, the interaction becomes strictly, and irreversibly, a
- * MANUAL_ONLY interaction (i.e. the VR session is cancelled, although the
- * interaction itself is still in progress). If the user interacts with the
- * VR session in any way (e.g. speaks a phrase, even if it is not a
- * recognized choice), the interaction becomes strictly, and irreversibly, a
- * VR_ONLY interaction (i.e. the MANUAL_ONLY mode forms of interaction will
- * no longer be honored)
- *
- * <p>The TriggerSource parameter of the
- * {@linkplain com.smartdevicelink.proxy.rpc.PerformInteraction} response will
- * indicate which interaction mode the user finally chose to attempt the
- * selection (even if the interaction did not end with a selection being
- * made)</P>
- */
- BOTH;
-
- /**
- * Returns InteractionMode (MANUAL_ONLY, VR_ONLY or BOTH)
- * @param value a String
- * @return InteractionMode -MANUAL_ONLY, VR_ONLY or BOTH
- */
-
- public static InteractionMode 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/Jingle.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Jingle.java
deleted file mode 100644
index 85a1e8e67..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Jingle.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-
-public enum Jingle{
- POSITIVE("POSITIVE_JINGLE"),
- NEGATIVE("NEGATIVE_JINGLE"),
- INITIAL("INITIAL_JINGLE"),
- LISTEN("LISTEN_JINGLE"),
- HELP("HELP_JINGLE");
-
- private final String INTERNAL_NAME;
-
- private Jingle(String name){
- this.INTERNAL_NAME = name;
- }
-
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- public static Jingle valueForString(String value) {
- for (Jingle anEnum : EnumSet.allOf(Jingle.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardEvent.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardEvent.java
deleted file mode 100644
index 7a730377d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardEvent.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * Enumeration listing possible keyboard events.
- *
- *
- */
-public enum KeyboardEvent {
- /** The use has pressed the keyboard key (applies to both SINGLE_KEYPRESS and RESEND_CURRENT_ENTRY modes).
- *
- */
-
- KEYPRESS,
- /** The User has finished entering text from the keyboard and submitted the entry.
- *
- */
-
- ENTRY_SUBMITTED,
- /** The User has pressed the HMI-defined "Cancel" button.
- *
- */
-
- ENTRY_CANCELLED,
- /** The User has not finished entering text and the keyboard is aborted with the event of higher priority.
- *
- */
- ENTRY_ABORTED,
- /**
- * @since SmartDeviceLink 4.0
- */
- ENTRY_VOICE,
- ;
- /**
- * Convert String to KeyboardEvent
- * @param value String
- * @return KeyboardEvent
- */
-
- public static KeyboardEvent 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/KeyboardLayout.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardLayout.java
deleted file mode 100644
index 2cd71b3f3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeyboardLayout.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * Enumeration listing possible keyboard layouts.
- *
- * @since SmartDeviceLink 2.3.2
- */
-public enum KeyboardLayout {
- QWERTY,
- QWERTZ,
- AZERTY;
-
- public static KeyboardLayout valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java
deleted file mode 100644
index 32e198585..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * Enumeration listing possible keyboard events.
- *
- *
- */
-public enum KeypressMode {
- /**
- * Each keypress is individually sent as the user presses the keyboard keys.
- */
- SINGLE_KEYPRESS,
- /**
- * The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.
- */
- QUEUE_KEYPRESSES,
- /**
- * The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.
- */
- RESEND_CURRENT_ENTRY;
-
- public static KeypressMode valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Language.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Language.java
deleted file mode 100644
index 4ac4f6264..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Language.java
+++ /dev/null
@@ -1,250 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-/**
- * Specifies the language to be used for TTS, VR, displayed messages/menus
- *
- *
- * @since SmartDeviceLink 1.0
- *
- */
-public enum Language {
- /**
- * English - SA
- */
-
- EN_SA("EN-SA"),
-
- /**
- * Hebrew - IL
- */
-
- HE_IL("HE-IL"),
-
- /**
- * Romanian - RO
- */
-
- RO_RO("RO-RO"),
-
- /**
- * Ukrainian - UA
- */
-
- UK_UA("UK-UA"),
-
- /**
- * Indonesian - ID
- */
-
- ID_ID("ID-ID"),
-
- /**
- * Vietnamese - VN
- */
-
- VI_VN("VI-VN"),
-
- /**
- * Malay - MY
- */
-
- MS_MY("MS-MY"),
-
- /**
- * Hindi - IN
- */
-
- HI_IN("HI-IN"),
-
- /**
- * Dutch - BE
- */
-
- NL_BE("NL-BE"),
-
- /**
- * Greek - GR
- */
-
- EL_GR("EL-GR"),
-
- /**
- * Hungarian - HU
- */
-
- HU_HU("HU-HU"),
-
- /**
- * Finnish - FI
- */
-
- FI_FI("FI-FI"),
-
- /**
- * Slovak - SK
- */
-
- SK_SK("SK-SK"),
- /**
- * English - US
- */
-
- EN_US("EN-US"),
- /**
- * Spanish - Mexico
- */
-
- ES_MX("ES-MX"),
- /**
- * French - Canada
- */
-
- FR_CA("FR-CA"),
- /**
- * German - Germany
- */
-
- DE_DE("DE-DE"),
- /**
- * Spanish - Spain
- */
-
- ES_ES("ES-ES"),
- /**
- * English - GB
- */
-
- EN_GB("EN-GB"),
- /**
- * Russian - Russia
- */
-
- RU_RU("RU-RU"),
- /**
- * Turkish - Turkey
- */
-
- TR_TR("TR-TR"),
- /**
- * Polish - Poland
- */
-
- PL_PL("PL-PL"),
- /**
- * French - France
- */
-
- FR_FR("FR-FR"),
- /**
- * Italian - Italy
- */
-
- IT_IT("IT-IT"),
- /**
- * Swedish - Sweden
- */
-
- SV_SE("SV-SE"),
- /**
- * Portuguese - Portugal
- */
-
- PT_PT("PT-PT"),
- /**
- * Dutch (Standard) - Netherlands
- */
-
- NL_NL("NL-NL"),
- /**
- * English - Australia
- */
-
- EN_AU("EN-AU"),
- /**
- * Mandarin - China
- */
-
- ZH_CN("ZH-CN"),
- /**
- * Mandarin - Taiwan
- */
-
- ZH_TW("ZH-TW"),
- /**
- * Japanese - Japan
- */
-
- JA_JP("JA-JP"),
- /**
- * Arabic - Saudi Arabia
- */
-
- AR_SA("AR-SA"),
- /**
- * Korean - South Korea
- */
-
- KO_KR("KO-KR"),
- /**
- * Portuguese - Brazil
- */
-
- PT_BR("PT-BR"),
- /**
- * Czech - Czech Republic
- */
-
- CS_CZ("CS-CZ"),
- /**
- * Danish - Denmark
- */
-
- DA_DK("DA-DK"),
- /**
- * Norwegian - Norway
- */
-
- NO_NO("NO-NO"),
- /**
- * English - India
- */
-
- EN_IN("EN-IN"),
- /**
- * Thai - Thailand
- */
-
- TH_TH("TH-TH");
-
- private final String INTERNAL_NAME;
-
- private Language(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
- /**
- * Returns a String representing a kind of Language
- */
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- /**
- * Returns a Language's name
- * @param value a String
- * @return Language -EN-US, ES-MX or FR-CA
- */
- public static Language valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (Language anEnum : EnumSet.allOf(Language.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LayoutMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LayoutMode.java
deleted file mode 100644
index b64cf1bb3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LayoutMode.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * For touchscreen interactions, the mode of how the choices are presented.
- *
- *
- */
-public enum LayoutMode {
- /**
- * This mode causes the interaction to display the previous set of choices as icons.
- */
- ICON_ONLY,
- /**
- * This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.
- */
- ICON_WITH_SEARCH,
- /**
- * This mode causes the interaction to display the previous set of choices as a list
- */
- LIST_ONLY,
- /**
- * This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.
- */
- LIST_WITH_SEARCH,
- /**
- * This mode causes the interaction to immediately display a keyboard entry through the HMI.
- */
- KEYBOARD;
-
- public static LayoutMode 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
deleted file mode 100644
index c3812f2da..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java
+++ /dev/null
@@ -1,134 +0,0 @@
-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
deleted file mode 100644
index 98c4b175c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java
+++ /dev/null
@@ -1,19 +0,0 @@
-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/LockScreenStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LockScreenStatus.java
deleted file mode 100644
index ba25a3024..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LockScreenStatus.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- *
- * Status of the Lock Screen.
- *
- */
-public enum LockScreenStatus {
- /**
- * LockScreen is Required
- */
-
- REQUIRED,
- /**
- * LockScreen is Optional
- */
-
- OPTIONAL,
- /**
- * LockScreen is Not Required
- */
-
- OFF;
-
- public static LockScreenStatus 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/MassageCushion.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java
deleted file mode 100644
index ed23b4899..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * List possible cushions of a multi-contour massage seat.
- */
-public enum MassageCushion {
- TOP_LUMBAR,
- MIDDLE_LUMBAR,
- BOTTOM_LUMBAR,
- BACK_BOLSTERS,
- SEAT_BOLSTERS,
- ;
-
- public static MassageCushion 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/MassageMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java
deleted file mode 100644
index 59a200bdb..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * List possible modes of a massage zone.
- */
-public enum MassageMode {
- OFF,
- LOW,
- HIGH,
- ;
-
- public static MassageMode 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/MassageZone.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java
deleted file mode 100644
index 9f0e23ffe..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * List possible zones of a multi-contour massage seat.
- */
-public enum MassageZone {
- /**
- * The back of a multi-contour massage seat. or SEAT_BACK
- */
- LUMBAR,
- /**
- * The bottom a multi-contour massage seat. or SEAT_BOTTOM
- */
- SEAT_CUSHION,
- ;
-
- public static MassageZone 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/MediaClockFormat.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java
deleted file mode 100644
index 2bf84744a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Indicates the format of the time displayed on the connected SDL unit.Format
- * description follows the following nomenclature:<p> Sp = Space</p> <p>| = or </p><p>c =
- * character</p>
- *
- * @since SmartDeviceLink 1.0
- */
-public enum MediaClockFormat {
- /**
- * <p>
- * </p>
- * <ul>
- * <li>maxHours = 19</li>
- * <li>maxMinutes = 59</li>
- * <li>maxSeconds = 59</li>
- * </ul>
- *
- * @since SmartDeviceLink 1.0
- *
- */
- CLOCK1,
- /**
- * <p>
- * </p>
- * <ul>
- * <li>maxHours = 59</li>
- * <li>maxMinutes = 59</li>
- * <li>maxSeconds = 59</li>
- * </ul>
- *
- * @since SmartDeviceLink 1.0
- *
- */
- CLOCK2,
- /**
- * <p>
- * </p>
- * <ul>
- * <li>maxHours = 9</li>
- * <li>maxMinutes = 59</li>
- * <li>maxSeconds = 59</li>
- * </ul>
- *
- * @since SmartDeviceLink 2.0
- *
- */
- CLOCK3,
- /**
- * <p>
- * </p>
- * <ul>
- * <li>5 characters possible</li>
- * <li>Format: 1|sp c :|sp c c</li>
- * <li>1|sp : digit "1" or space</li>
- * <li>c : character out of following character set: sp|0-9|[letters, see
- * TypeII column in XLS.</li>
- * <li>:|sp : colon or space</li>
- * <li>used for Type II headunit</li>
- * </ul>
- *
- * @since SmartDeviceLink 1.0
- */
- CLOCKTEXT1,
- /**
- * <p>
- * </p>
- * <ul>
- * <li>5 characters possible</li>
- * <li>Format: 1|sp c :|sp c c</li>
- * <li>1|sp : digit "1" or space</li>
- * <li>c : character out of following character set: sp|0-9|[letters, see
- * CID column in XLS.</li>
- * <li>:|sp : colon or space</li>
- * <li>used for CID headunit</li>
- * </ul>
- * difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character
- * set
- *
- * @since SmartDeviceLink 1.0
- */
- CLOCKTEXT2,
- /**
- * <p>
- * </p>
- * <ul>
- * <li>6 chars possible</li>
- * <li>Format: 1|sp c c :|sp c c</li>
- * <li>1|sp : digit "1" or space</li>
- * <li>c : character out of following character set: sp|0-9|[letters, see
- * Type 5 column in XLS].</li>
- * <li>:|sp : colon or space</li>
- * <li>used for Type V headunit</li>
- * </ul>
- * difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character
- * set
- *
- *
- * @since SmartDeviceLink 1.0
- */
- CLOCKTEXT3,
- /**
- * <p>
- * </p>
- * <ul>
- * <li>6 chars possible</li>
- * <li>Format: c :|sp c c : c c</li>
- * <li>:|sp : colon or space</li>
- * <li>c : character out of following character set: sp|0-9|[letters]</li>
- * <li>used for MFD3/4/5 headunits</li>
- * </ul>
- *
- *
- * @since SmartDeviceLink 2.0
- */
- CLOCKTEXT4;
-
- public static MediaClockFormat 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/MetadataType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MetadataType.java
deleted file mode 100644
index 9f51a6437..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MetadataType.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-/**
- * Defines the metadata types that can be applied to text fields
- *
- */
-public enum MetadataType {
-
- /**
- * The data in this field contains the title of the currently playing audio track.
- */
- MEDIA_TITLE("mediaTitle"),
-
- /**
- * The data in this field contains the artist or creator of the currently playing audio track.
- */
- MEDIA_ARTIST("mediaArtist"),
-
- /**
- * The data in this field contains the album title of the currently playing audio track.
- */
- MEDIA_ALBUM("mediaAlbum"),
-
- /**
- * The data in this field contains the creation year of the currently playing audio track.
- */
- MEDIA_YEAR("mediaYear"),
-
- /**
- * The data in this field contains the genre of the currently playing audio track.
- */
- MEDIA_GENRE("mediaGenre"),
-
- /**
- * The data in this field contains the name of the current source for the media.
- */
- MEDIA_STATION("mediaStation"),
-
- /**
- * The data in this field is a rating.
- */
- RATING("rating"),
-
- /**
- * The data in this field is the current temperature.
- */
- CURRENT_TEMPERATURE("currentTemperature"),
-
- /**
- * The data in this field is the maximum temperature for the day.
- */
- MAXIMUM_TEMPERATURE("maximumTemperature"),
-
- /**
- * The data in this field is the minimum temperature for the day.
- */
- MINIMUM_TEMPERATURE("minimumTemperature"),
-
- /**
- * The data in this field describes the current weather (ex. cloudy, clear, etc.).
- */
- WEATHER_TERM("weatherTerm"),
-
- /**
- * The data in this field describes the current humidity value.
- */
- HUMIDITY("humidity"),
-
-
- ;
-
- private final String internalName;
-
- private MetadataType(String internalName) {
- this.internalName = internalName;
- }
-
- public String toString() {
- return this.internalName;
- }
-
- public static MetadataType valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (MetadataType anEnum : EnumSet.allOf(MetadataType.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- 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
deleted file mode 100644
index c4bedfd46..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum ModuleType {
- CLIMATE,
- RADIO,
- SEAT,
- AUDIO,
- LIGHT,
- HMI_SETTINGS,
- ;
-
- public static ModuleType 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/PRNDL.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PRNDL.java
deleted file mode 100644
index 965ebb8b4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PRNDL.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * The selected gear.
- * @since SmartDeviceLink 2.0
- */
-public enum PRNDL {
- /**
- * Parking
- */
- PARK,
- /**
- * Reverse gear
- */
- REVERSE,
- /**
- * No gear
- */
- NEUTRAL,
- DRIVE,
- /**
- * Drive Sport mode
- */
- SPORT,
- /**
- * 1st gear hold
- */
- LOWGEAR,
- /**
- * First gear
- */
- FIRST,
- /**
- * Second gear
- */
- SECOND,
- /**
- * Third gear
- */
- THIRD,
- /**
- * Fourth gear
- */
- FOURTH,
- /**
- * Fifth gear
- */
- FIFTH,
- /**
- * Sixth gear
- */
- SIXTH,
- SEVENTH,
- EIGHTH,
- UNKNOWN,
- FAULT;
-
- /**
- * Convert String to PRNDL
- * @param value String
- * @return PRNDL
- */
- public static PRNDL 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/PowerModeQualificationStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeQualificationStatus.java
deleted file mode 100644
index c268e14aa..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeQualificationStatus.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Reflects the status of the current power mode qualification.
- *
- * @since SmartDeviceLink 2.0
- *
- */
-
-public enum PowerModeQualificationStatus {
- /** The power mode of the vehicle is currently considered undefined
- *
- */
-
- POWER_MODE_UNDEFINED,
- /** The evaluation of the power mode is in progress
- *
- */
-
- POWER_MODE_EVALUATION_IN_PROGRESS,
- /** Currently undefined
- *
- */
-
- NOT_DEFINED,
- /** The power mode of the vehicle
- *
- */
-
- POWER_MODE_OK;
- /**
- * Convert String to PowerModeQualificationStatus
- * @param value String
- * @return PowerModeQualificationStatus
- */
-
- public static PowerModeQualificationStatus 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/PowerModeStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java
deleted file mode 100644
index 06ed3ba9a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Reflects the status of the current power mode.
- *
- * @since SmartDeviceLink 2.0
- *
- */
-public enum PowerModeStatus {
- /** Key not inserted
- *
- */
- KEY_OUT,
- /** Key is currently out
- *
- */
- KEY_RECENTLY_OUT,
-
- KEY_APPROVED_0,
- POST_ACCESORY_0,
- /** Key is in accessory positon
- *
- */
-
- ACCESORY_1,
- POST_IGNITION_1,
-
- /** Key is in position ignition on
- *
- */
- IGNITION_ON_2,
- /** Key is in position running
- *
- */
-
- RUNNING_2,
- /** Key is in crank position
- *
- */
-
- CRANK_3;
-
- public static PowerModeStatus 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/PredefinedLayout.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java
deleted file mode 100644
index 458320d1e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java
+++ /dev/null
@@ -1,140 +0,0 @@
-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/PrerecordedSpeech.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrerecordedSpeech.java
deleted file mode 100644
index 2b27040a6..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrerecordedSpeech.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * Contains a list of Pre-recorded speech items present on the platform.
- *
- *
- */
-public enum PrerecordedSpeech {
- HELP_JINGLE,
- INITIAL_JINGLE,
- LISTEN_JINGLE,
- POSITIVE_JINGLE,
- NEGATIVE_JINGLE;
- /**
- * Convert String to PrerecordedSpeech
- * @param value String
- * @return PrerecordedSpeech
- */
-
- public static PrerecordedSpeech 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/PrimaryAudioSource.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java
deleted file mode 100644
index 27f83d7d4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Reflects the current primary audio source of SDL (if selected).
- * @since SmartDeviceLink 2.0
- */
-public enum PrimaryAudioSource {
- /**
- * Currently no source selected
- */
- NO_SOURCE_SELECTED,
- /**
- * CD is current source
- */
- CD,
- /**
- * USB is current source
- */
- USB,
- /**
- * USB2 is current source
- */
- USB2,
- /**
- * Bluetooth Stereo is current source
- */
- BLUETOOTH_STEREO_BTST,
- /**
- * Line in is current source
- */
- LINE_IN,
- /**
- * iPod is current source
- */
- IPOD,
- /**
- * Mobile app is current source
- */
- 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;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioBand.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioBand.java
deleted file mode 100644
index 2b2c862d8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioBand.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum RadioBand {
- AM,
- FM,
- XM,
- ;
-
- public static RadioBand 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/RadioState.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioState.java
deleted file mode 100644
index 533c86dca..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RadioState.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * List possible states of a remote control radio module.
- */
-public enum RadioState {
- ACQUIRING,
- ACQUIRED,
- MULTICAST,
- NOT_FOUND,
- ;
-
- public static RadioState 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/RequestType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RequestType.java
deleted file mode 100644
index 75707802e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/RequestType.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * Enumeration listing possible asynchronous requests.
- *
- *
- */
-public enum RequestType {
-
- HTTP,
- FILE_RESUME,
- AUTH_REQUEST,
- AUTH_CHALLENGE,
- AUTH_ACK,
- PROPRIETARY,
- /**
- * @since SmartDeviceLink 4.0
- */
- QUERY_APPS,
- /**
- * @since SmartDeviceLink 4.0
- */
- LAUNCH_APP,
- /**
- * @since SmartDeviceLink 4.0
- */
- LOCK_SCREEN_ICON_URL,
- /**
- * @since SmartDeviceLink 4.0
- */
- TRAFFIC_MESSAGE_CHANNEL,
- /**
- * @since SmartDeviceLink 4.0
- */
- DRIVER_PROFILE,
- /**
- * @since SmartDeviceLink 4.0
- */
- VOICE_SEARCH,
- /**
- * @since SmartDeviceLink 4.0
- */
- NAVIGATION,
- /**
- * @since SmartDeviceLink 4.0
- */
- PHONE,
- /**
- * @since SmartDeviceLink 4.0
- */
- CLIMATE,
- /**
- * @since SmartDeviceLink 4.0
- */
- SETTINGS,
- /**
- * @since SmartDeviceLink 4.0
- */
- VEHICLE_DIAGNOSTICS,
- /**
- * @since SmartDeviceLink 4.0
- */
- EMERGENCY,
- /**
- * @since SmartDeviceLink 4.0
- */
- MEDIA,
- /**
- * @since SmartDeviceLink 4.0
- */
- FOTA,
- /**
- * @since SmartDeviceLink 5.0
- */
- OEM_SPECIFIC,
- ;
- /**
- * Convert String to RequestType
- * @param value String
- * @return RequestType
- */
- public static RequestType 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/Result.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Result.java
deleted file mode 100644
index 25b9a16f5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/Result.java
+++ /dev/null
@@ -1,199 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Defines the possible result codes returned by SDL to the application in a
- * Response to a requested operation
- *
- *
- * @since SmartDeviceLink 1.0
- */
-public enum Result {
- /**
- * The request succeeded
- */
- SUCCESS,
- /**
- * <p>The data sent is invalid. For example:</p>
- * <ul>
- * <li>Invalid Json syntax</li>
- * <li>Parameters out of bounds (number or enum range)</li>
- * <li>Mandatory parameters not provided</li>
- * <li>Parameter provided with wrong type</li>
- * <li>Invalid characters</li>
- * <li>Empty string</li>
- * </ul>
- */
- INVALID_DATA,
- /**
- * The request is not supported by SDL
- */
- UNSUPPORTED_REQUEST,
- /**
- * The system could not process the request because the necessary memory
- * couldn't be allocated
- */
- OUT_OF_MEMORY,
- /**
- * There are too many requests pending (means that the response has not been
- * delivered yet). There is a limit of 1000 pending requests at a time
- */
- TOO_MANY_PENDING_REQUESTS,
- /**
- * <p>One of the provided IDs is not valid. For example:</p>
- * <ul>
- * <li>CorrelationID</li>
- * <li>CommandID</li>
- * <li>MenuID</li>
- * </ul>
- */
- INVALID_ID,
- /**
- * The provided name or synonym is a duplicate of some already-defined name
- * or synonym
- */
- DUPLICATE_NAME,
- /**
- * Specified application name is already associated with an active interface
- * registration. Attempts at doing a second <i>
- * {@linkplain com.smartdevicelink.proxy.rpc.RegisterAppInterface}</i> on a
- * given protocol session will also cause this
- */
- TOO_MANY_APPLICATIONS,
- /**
- * SDL does not support the interface version requested by the mobile
- * application
- */
- APPLICATION_REGISTERED_ALREADY,
- /**
- * The requested language is currently not supported. Might be because of a
- * mismatch of the currently active language
- */
- UNSUPPORTED_VERSION,
- /**
- * The request cannot be executed because no application interface has been
- * registered via <i>
- * {@linkplain com.smartdevicelink.proxy.rpc.RegisterAppInterface}</i>
- */
- WRONG_LANGUAGE,
- /**
- * The request cannot be executed because no application interface has been
- * registered via <i>
- * {@linkplain com.smartdevicelink.proxy.rpc.RegisterAppInterface}</i>
- */
- APPLICATION_NOT_REGISTERED,
- /**
- * The data may not be changed, because it is currently in use. For example,
- * when trying to delete a Choice Set that is currently involved in an
- * interaction
- */
- IN_USE,
- /**
- *The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.
- */
- VEHICLE_DATA_NOT_ALLOWED,
- /**
- * The requested vehicle data is not available on this vehicle or is not published.
- */
- VEHICLE_DATA_NOT_AVAILABLE,
- /**
- * The requested operation was rejected. No attempt was made to perform the
- * operation
- */
- REJECTED,
- /**
- * The requested operation was aborted due to some pre-empting event (e.g.
- * button push, <i>{@linkplain com.smartdevicelink.proxy.rpc.Alert}</i>
- * pre-empts <i>{@linkplain com.smartdevicelink.proxy.rpc.Speak}</i>, etc.)
- */
- ABORTED,
- /**
- * The requested operation was ignored because it was determined to be
- * redundant (e.g. pause media clock when already paused)
- */
- IGNORED,
- /**
- * A button that was requested for subscription is not supported on the
- * currently connected SDL platform. See DisplayCapabilities for further
- * information on supported buttons on the currently connected SDL platform
- */
- UNSUPPORTED_RESOURCE,
- /**
- * A specified file could not be found on Sync.
- */
- FILE_NOT_FOUND,
- /**
- * Provided data is valid but something went wrong in the lower layers.
- */
- GENERIC_ERROR,
- /**
- * RPC is not authorized in local policy table.
- */
- DISALLOWED,
- /**
- * RPC is included in a functional group explicitly blocked by the user.
- */
- USER_DISALLOWED,
- /**
- * Overlay reached the maximum timeout and closed.
- */
- TIMED_OUT,
- /**
- * User selected to Cancel Route.
- */
- CANCEL_ROUTE,
- /**
- * The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.
- */
- TRUNCATED_DATA,
- /**
- * The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.
- */
- RETRY,
- /**
- * The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.
- */
- WARNINGS,
- /**
- * The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.
- */
- SAVED,
- /**
- * The certificate provided during authentication is invalid.
- */
- INVALID_CERT,
- /**
- * The certificate provided during authentication is expired.
- */
- EXPIRED_CERT,
- /**
- * The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.
- */
- RESUME_FAILED,
- /**
- * The requested data is not available on this vehicle or is not published for the connected app.
- */
- DATA_NOT_AVAILABLE,
- /**
- * The requested data is read only thus cannot be change via remote control
- */
- READ_ONLY,
- /**
- * The data sent failed to pass CRC check in receiver end
- */
- CORRUPTED_DATA,
-
- ;
- /**
- * Convert String to Result
- * @param value String
- * @return Result
- */
-
- public static Result 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/SamplingRate.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SamplingRate.java
deleted file mode 100644
index e659ff165..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SamplingRate.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-/**
- * Describes different sampling rates for PerformAudioPassThru
- * @since SmartDeviceLink 2.0
- */
-public enum SamplingRate {
-
- /**
- * Sampling rate of 8 kHz
- *
- * @since SmartDeviceLink 2.0
- */
- _8KHZ("8KHZ"),
- /**
- * Sampling rate of 16 kHz
- *
- * @since SmartDeviceLink 2.0
- */
- _16KHZ("16KHZ"),
- /**
- * Sampling rate of 22 kHz
- *
- * @since SmartDeviceLink 2.0
- */
- _22KHZ("22KHZ"),
- /**
- * Sampling rate of 44 kHz
- *
- * @since SmartDeviceLink 2.0
- */
- _44KHZ("44KHZ");
-
- private final String INTERNAL_NAME;
-
- private SamplingRate(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
-
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- public static SamplingRate valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (SamplingRate anEnum : EnumSet.allOf(SamplingRate.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlConnectionState.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlConnectionState.java
deleted file mode 100644
index fa2caecb6..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlConnectionState.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum SdlConnectionState {
- SDL_CONNECTED,
- SDL_DISCONNECTED;
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java
deleted file mode 100644
index 60ecf5450..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlDisconnectedReason.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum SdlDisconnectedReason {
- USER_EXIT,
- IGNITION_OFF,
- BLUETOOTH_OFF,
- USB_DISCONNECTED,
- REQUEST_WHILE_IN_NONE_HMI_LEVEL,
- TOO_MANY_REQUESTS,
- DRIVER_DISTRACTION_VIOLATION,
- LANGUAGE_CHANGE,
- MASTER_RESET,
- FACTORY_DEFAULTS,
- TRANSPORT_ERROR,
- APPLICATION_REQUESTED_DISCONNECT,
- DEFAULT,
- TRANSPORT_DISCONNECT,
- HB_TIMEOUT,
- BLUETOOTH_DISABLED,
- BLUETOOTH_ADAPTER_ERROR,
- SDL_REGISTRATION_ERROR,
- APP_INTERFACE_UNREG,
- GENERIC_ERROR,
- /**
- * This only occurs when multiplexing is running and it is found to be on an old gen 1 system.
- */
- LEGACY_BLUETOOTH_MODE_ENABLED,
- RPC_SESSION_ENDED,
- PRIMARY_TRANSPORT_CYCLE_REQUEST
- ;
-
-
- public static SdlDisconnectedReason valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-
- public static SdlDisconnectedReason convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason reason) {
- if(reason == null){
- return null;
- }
-
- SdlDisconnectedReason returnReason = SdlDisconnectedReason.DEFAULT;
-
- switch(reason) {
- case USER_EXIT:
- returnReason = SdlDisconnectedReason.USER_EXIT;
- break;
- case IGNITION_OFF:
- returnReason = SdlDisconnectedReason.IGNITION_OFF;
- break;
- case BLUETOOTH_OFF:
- returnReason = SdlDisconnectedReason.BLUETOOTH_OFF;
- break;
- case USB_DISCONNECTED:
- returnReason = SdlDisconnectedReason.USB_DISCONNECTED;
- break;
- case REQUEST_WHILE_IN_NONE_HMI_LEVEL:
- returnReason = SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL;
- break;
- case TOO_MANY_REQUESTS:
- returnReason = SdlDisconnectedReason.TOO_MANY_REQUESTS;
- break;
- case DRIVER_DISTRACTION_VIOLATION:
- returnReason = SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION;
- break;
- case LANGUAGE_CHANGE:
- returnReason = SdlDisconnectedReason.LANGUAGE_CHANGE;
- break;
- case MASTER_RESET:
- returnReason = SdlDisconnectedReason.MASTER_RESET;
- break;
- case FACTORY_DEFAULTS:
- returnReason = SdlDisconnectedReason.FACTORY_DEFAULTS;
- break;
- default:
- break;
- }
-
- return returnReason;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java
deleted file mode 100644
index 0f6b2530c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum SdlInterfaceAvailability {
- SDL_INTERFACE_AVAILABLE,
- SDL_INTERFACE_UNAVAILABLE;
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java
deleted file mode 100644
index e81b2694a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum SeatMemoryActionType {
- /**
- * Save current seat positions and settings to seat memory.
- */
- SAVE,
- /**
- * Restore / apply the seat memory settings to the current seat.
- */
- RESTORE,
- /**
- * No action to be performed.
- */
- NONE,
- ;
-
- public static SeatMemoryActionType 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/SoftButtonType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SoftButtonType.java
deleted file mode 100644
index 29fa27020..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SoftButtonType.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-/** The enumeration defines the types of the soft buttons to be displayed on UI component:<p>The text is displayed on the soft button</p>
- *<p>The image is displayed on the soft button</p>
- *<p>Both image and text are displayed on the soft button.</p>
- *
- * @since SmartDeviceLink 2.0
- */
-public enum SoftButtonType {
- /** Text displayed
- *
- */
- SBT_TEXT("TEXT"),
- /** Image displayed
- *
- */
- SBT_IMAGE("IMAGE"),
- /** Image displayed
- *
- */
- SBT_BOTH("BOTH");
-
- private final String INTERNAL_NAME;
-
- private SoftButtonType(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
-
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- public static SoftButtonType valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (SoftButtonType anEnum : EnumSet.allOf(SoftButtonType.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SpeechCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SpeechCapabilities.java
deleted file mode 100644
index 7d8330d0a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SpeechCapabilities.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/**
- * Contains information about TTS capabilities on the SDL platform.
- *
- * @since SmartDeviceLink 1.0
- */
-public enum SpeechCapabilities {
- /**
- * The SDL platform can speak text phrases.
- *
- * @since SmartDeviceLink 1.0
- */
- TEXT,
- /**
- * The SDL platform can interpret and speak LHPLUS phonemes
- */
-
- SAPI_PHONEMES,
-
- /**
- * The SDL platform can interpret and speak LHPLUS phonemes
- */
-
- LHPLUS_PHONEMES,
- /**
- * The SDL platform can play pre-recorded sounds as part of a TTS operation.<p>(e.g. Speak, Alert, PerformInteraction, etc.).</p>
- */
- PRE_RECORDED,
- /**
- * The SDL platform can play the prerecorded sound of 1 second of silence (i.e. no sound at all).
- */
-
- SILENCE,
-
- /**
- * The SDL platform can play audio files in conjunction with/without TTS text.
- */
- FILE;
- /**
- * Convert String to SpeechCapabilities
- * @param value String
- * @return SpeechCapabilities
- */
-
- public static SpeechCapabilities 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/StaticIconName.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java
deleted file mode 100644
index 455995ff3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java
+++ /dev/null
@@ -1,910 +0,0 @@
-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/enums/SupportedSeat.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java
deleted file mode 100644
index c68f2e79d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * List possible seats that is a remote controllable seat.
- */
-public enum SupportedSeat {
- DRIVER,
- FRONT_PASSENGER,
- ;
-
- public static SupportedSeat 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/SystemAction.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemAction.java
deleted file mode 100644
index 835e9b1b9..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemAction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Enumeration that describes system actions that can be triggered.
- *
- * @since SmartDeviceLink 2.0
- *
- */
-
-public enum SystemAction {
- /** Default action occurs. Standard behavior (e.g. SoftButton clears overlay).
- *
- */
-
- DEFAULT_ACTION,
- /** App is brought into HMI_FULL.
- *
- */
-
- STEAL_FOCUS,
- /** Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.
- *
- */
-
- KEEP_CONTEXT;
- /**
- * Convert String to SystemAction
- * @param value String
- * @return SystemAction
- */
-
- public static SystemAction 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/SystemCapabilityType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java
deleted file mode 100644
index a6cf96d57..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java
+++ /dev/null
@@ -1,429 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * <p>The SystemCapabilityType indicates which type of capability information exists in a SystemCapability struct.</p>
- *
- * <p><b>Enum List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>NAVIGATION</td>
- * <td>NavigationCapability</td>
- * <td>Returns Navigation Capabilities</td>
- * <td align=center>Y</td>
- * <td>Call is synchronous <strong>after</strong> initial call</td>
- * </tr>
- * <tr>
- * <td>PHONE_CALL</td>
- * <td>PhoneCapability</td>
- * <td>Returns Phone Capabilities</td>
- * <td align=center>Y</td>
- * <td>Call is synchronous <strong>after</strong> initial call</td>
- * </tr>
- * <tr>
- * <td>VIDEO_STREAMING</td>
- * <td>VideoStreamingCapability</td>
- * <td>Returns Video Streaming Capabilities</td>
- * <td align=center>Y</td>
- * <td>Call is synchronous <strong>after</strong> initial call</td>
- * </tr>
- * <tr>
- * <td>REMOTE_CONTROL</td>
- * <td>RemoteControlCapabilities</td>
- * <td>Returns Remote Control Capabilities</td>
- * <td align=center>Y</td>
- * <td>Call is synchronous <strong>after</strong> initial call</td>
- * </tr>
- * <tr>
- * <td>HMI</td>
- * <td>HMICapabilities</td>
- * <td>Returns HMI Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * <tr>
- * <td>DISPLAY</td>
- * <td>DisplayCapabilities</td>
- * <td>Returns Display Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * <tr>
- * <td>AUDIO_PASSTHROUGH</td>
- * <td>List<AudioPassThruCapabilities></td>
- * <td>Returns a List of AudioPassThruCapabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
- * </tr>
- * <tr>
- * <td>PCM_STREAMING</td>
- * <td>AudioPassThruCapabilities</td>
- * <td>Returns an AudioPassThruCapabilities Object</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
- * </tr>
- * <tr>
- * <td>BUTTON</td>
- * <td>List<ButtonCapabilities></td>
- * <td>Returns a List of ButtonCapabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
- * </tr>
- * <tr>
- * <td>HMI_ZONE</td>
- * <td>HmiZoneCapabilities</td>
- * <td>Returns HmiZone Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * <tr>
- * <td>PRESET_BANK</td>
- * <td>PresetBankCapabilities</td>
- * <td>Returns PresetBank Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * <tr>
- * <td>SOFTBUTTON</td>
- * <td>List<SoftButtonCapabilities></td>
- * <td>Returns a List of SoftButtonCapabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
- * </tr>
- * <tr>
- * <td>SPEECH</td>
- * <td>SpeechCapabilities</td>
- * <td>Returns Speech Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * <tr>
- * <td>VOICE_RECOGNITION</td>
- * <td>VrCapabilities</td>
- * <td>Returns VOICE_RECOGNITION</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * </table>
- *
- */
-
-public enum SystemCapabilityType {
-
- /**
- * <strong>Requires</strong> initial asynchronous call, then available synchronously after successful call. <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>NAVIGATION</td>
- * <td>NavigationCapability</td>
- * <td>Returns Navigation Capabilities</td>
- * <td align=center>Y</td>
- * <td>Call is synchronous <strong>after</strong> initial call</td>
- * </tr>
- * </table>
- */
- NAVIGATION,
-
- /**
- * <strong>Requires</strong> initial asynchronous call, then available synchronously after successful call. <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>PHONE_CALL</td>
- * <td>PhoneCapability</td>
- * <td>Returns Phone Capabilities</td>
- * <td align=center>Y</td>
- * <td>Call is synchronous <strong>after</strong> initial call</td>
- * </tr>
- * </table>
- */
- PHONE_CALL,
-
- /**
- * <strong>Requires</strong> initial asynchronous call, then available synchronously after successful call. <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>VIDEO_STREAMING</td>
- * <td>VideoStreamingCapability</td>
- * <td>Returns Video Streaming Capabilities</td>
- * <td align=center>Y</td>
- * <td>Call is synchronous <strong>after</strong> initial call</td>
- * </tr>
- * </table>
- */
- VIDEO_STREAMING,
-
- /**
- * <strong>Requires</strong> initial asynchronous call, then available synchronously after successful call. <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <td>REMOTE_CONTROL</td>
- * <td>RemoteControlCapabilities</td>
- * <td>Returns Remote Control Capabilities</td>
- * <td align=center>Y</td>
- * <td>Call is synchronous <strong>after</strong> initial call</td>
- * </tr>
- * </table>
- *
- */
- REMOTE_CONTROL,
-
- /* These below are not part of the RPC spec. Only for Internal Proxy use */
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>HMI</td>
- * <td>HMICapabilities</td>
- * <td>Returns HMI Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * </table>
- */
- HMI,
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * Returns: DisplayCapabilities
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>DISPLAY</td>
- * <td>DisplayCapabilities</td>
- * <td>Returns Display Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response received</td>
- * </tr>
- * </table>
- */
- DISPLAY,
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * <b>Note:</b> @SuppressWarnings("unchecked") may be needed when casting depending on implementation
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>AUDIO_PASSTHROUGH</td>
- * <td>List<AudioPassThruCapabilities></td>
- * <td>Returns a List of AudioPassThruCapabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
- * </tr>
- * </table>
- */
- AUDIO_PASSTHROUGH,
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * <b>Note:</b> @SuppressWarnings("unchecked") may be needed when casting depending on implementation
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>PCM_STREAMING</td>
- * <td>AudioPassThruCapabilities</td>
- * <td>Returns a AudioPassThruCapabilities Object</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
- * </tr>
- * </table>
- */
- PCM_STREAMING,
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * <b>Note:</b> @SuppressWarnings("unchecked") may be needed when casting depending on implementation
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>BUTTON</td>
- * <td>List<ButtonCapabilities></td>
- * <td>Returns a List of ButtonCapabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
- * </tr>
- * </table>
- */
- BUTTON,
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>HMI_ZONE</td>
- * <td>HmiZoneCapabilities</td>
- * <td>Returns HmiZone Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * </table>
- */
- HMI_ZONE,
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>PRESET_BANK</td>
- * <td>PresetBankCapabilities</td>
- * <td>Returns PresetBank Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * </table>
- */
- PRESET_BANK,
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * Returns: List<SoftButtonCapabilities> <br>
- * Note: @SuppressWarnings("unchecked") may be needed when casting depending on implementation
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>SOFTBUTTON</td>
- * <td>List<SoftButtonCapabilities></td>
- * <td>Returns a List of SoftButtonCapabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response. @SuppressWarnings("unchecked") may be needed when casting depending on implementation</td>
- * </tr>
- * </table>
- */
- SOFTBUTTON,
-
- /**
- * Available Synchronously after Register App Interface response <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>SPEECH</td>
- * <td>SpeechCapabilities</td>
- * <td>Returns Speech Capabilities</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * </table>
- */
- SPEECH,
- /**
- * Available Synchronously after Register App Interface response <br>
- * <table border="1" rules="all">
- * <tr>
- * <th>Enum Name</th>
- * <th>Return Type</th>
- * <th>Description</th>
- * <th>Requires Async?</th>
- * <th>Notes</th>
- * </tr>
- * <tr>
- * <td>VOICE_RECOGNITION</td>
- * <td>VrCapabilities</td>
- * <td>Returns VOICE_RECOGNITION</td>
- * <td align=center>N</td>
- * <td>Available Synchronously <strong>after</strong> Register App Interface response</td>
- * </tr>
- * </table>
- */
- VOICE_RECOGNITION,
-
- ;
-
- public static SystemCapabilityType 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/SystemContext.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemContext.java
deleted file mode 100644
index 1ea9d60b1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemContext.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-/**
- * Indicates whether or not a user-initiated interaction is in progress, and if
- * so, in what mode (i.e. MENU or VR).
- *
- * @since SmartDeviceLink 1.0
- */
-public enum SystemContext {
- /**
- * No user interaction (user-initiated or app-initiated) is in progress.
- *
- * @since SmartDeviceLink 1.0
- */
- SYSCTXT_MAIN("MAIN"),
- /**
- * VR-oriented, user-initiated or app-initiated interaction is in-progress.
- *
- * @since SmartDeviceLink 1.0
- */
- SYSCTXT_VRSESSION("VRSESSION"),
- /**
- * Menu-oriented, user-initiated or app-initiated interaction is
- * in-progress.
- *
- * @since SmartDeviceLink 1.0
- */
- SYSCTXT_MENU("MENU"),
- /**
- * The app's display HMI is currently being obscured by either a system or
- * other app's overlay.
- *
- * @since SmartDeviceLink 2.0
- */
- SYSCTXT_HMI_OBSCURED("HMI_OBSCURED"),
- /**
- * Broadcast only to whichever app has an alert currently being displayed.
- *
- * @since SmartDeviceLink 2.0
- */
- SYSCTXT_ALERT("ALERT");
-
- private final String INTERNAL_NAME;
-
- private SystemContext(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
-
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- public static SystemContext valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (SystemContext anEnum : EnumSet.allOf(SystemContext.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TBTState.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TBTState.java
deleted file mode 100644
index d334ccad7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TBTState.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Describes possible states of turn-by-turn module.
- * @since SmartDeviceLink 1.0
- */
-public enum TBTState {
- /**
- * Indicates that driver requested a route update.
- */
- ROUTE_UPDATE_REQUEST,
- /**
- * Confirmation from HMI about accepting the route.
- */
-
- ROUTE_ACCEPTED,
- /**
- * Information from HMI about the route refusal.
- */
-
- ROUTE_REFUSED,
- /**
- * Information from HMI about canceling the route.
- */
-
- ROUTE_CANCELLED,
- /**
- * Request from HMI for Estimated time of arrival.
- */
-
- ETA_REQUEST,
- /**
- * Request from HMI for the information of the next turn.
- */
-
- NEXT_TURN_REQUEST,
- /**
- * Request from HMI for the route status.
- */
-
- ROUTE_STATUS_REQUEST,
- /**
- * Request from HMI for the route summary.
- */
-
- ROUTE_SUMMARY_REQUEST,
- /**
- * Request from HMI for the information about trip status.
- */
-
- TRIP_STATUS_REQUEST,
- /**
- * Request from HMI for the timeout for waiting for the route updating.
- */
-
- ROUTE_UPDATE_REQUEST_TIMEOUT;
-
- /**
- * Convert String to TBTState
- * @param value String
- * @return TBTState
- */
- public static TBTState 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/TPMS.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TPMS.java
deleted file mode 100644
index 69b60e211..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TPMS.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enums for Tire Pressure Monitoring Systems
- *
- * @since SmartDeviceLink 5.0
- */
-public enum TPMS {
-
- /**
- * If set the status of the tire is not known.
- */
- UNKNOWN,
- /**
- * TPMS does not function.
- */
- SYSTEM_FAULT,
- /**
- * The sensor of the tire does not function.
- */
- SENSOR_FAULT,
- /**
- * TPMS is reporting a low tire pressure for the tire.
- */
- LOW,
- /**
- * TPMS is active and the tire pressure is monitored.
- */
- SYSTEM_ACTIVE,
- /**
- * TPMS is reporting that the tire must be trained.
- */
- TRAIN,
- /**
- * TPMS reports the training for the tire is completed.
- */
- TRAINING_COMPLETE,
- /**
- * TPMS reports the tire is not trained.
- */
- NOT_TRAINED,
- ;
-
- public static TPMS 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/TemperatureUnit.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TemperatureUnit.java
deleted file mode 100644
index 6c9b04875..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TemperatureUnit.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum TemperatureUnit {
- CELSIUS,
- FAHRENHEIT;
-
- public static TemperatureUnit 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/TextAlignment.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextAlignment.java
deleted file mode 100644
index b188d6ba8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextAlignment.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * The list of possible alignments of text in a field.
- * @since SmartDeviceLink 1.0
- */
-public enum TextAlignment {
- /**
- * Text aligned left.
- */
- LEFT_ALIGNED,
- /**
- * Text aligned right.
- */
- RIGHT_ALIGNED,
- /**
- * Text aligned centered.
- */
- CENTERED;
-
- /**
- * Convert String to TextAlignment
- * @param value String
- * @return TextAlignment
- */
- public static TextAlignment 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/TextFieldName.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java
deleted file mode 100644
index ded9d0571..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Names of the text fields that can appear on the display.
- *
- * @since SmartDeviceLink 1.0
- *
- */
-
-public enum TextFieldName {
- /** The first line of first set of main fields of the persistent display; applies to "Show"
- *
- */
-
- mainField1,
- /** The second line of first set of main fields of the persistent display; applies to "Show"
- *
- */
-
- mainField2,
- /** The first line of second set of main fields of persistent display; applies to "Show"
- *
- */
-
- mainField3,
- /** The second line of second set of main fields of the persistent display; applies to "Show"
- *
- */
-
- mainField4,
- /** The status bar on NGN; applies to "Show"
- *
- */
-
- statusBar,
- /** Text value for MediaClock field; applies to "Show"
- *
- */
-
- mediaClock,
- /** The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"
- *
- */
-
- mediaTrack,
- /** The first line of the alert text field; applies to "Alert"
- *
- */
-
- alertText1,
- /** The second line of the alert text field; applies to "Alert"
- *
- */
-
- alertText2,
- /** The third line of the alert text field; applies to "Alert"
- *
- */
-
- alertText3,
- /** Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"
- *
- */
-
- scrollableMessageBody,
- /** First line suggestion for a user response (in the case of VR enabled interaction)
- *
- */
-
- initialInteractionText,
- /** First line of navigation text
- *
- */
-
- navigationText1,
- /** Second line of navigation text
- *
- */
-
- navigationText2,
- /** Estimated Time of Arrival time for navigation
- *
- */
-
- ETA,
- /** Total distance to destination for navigation
- *
- */
-
- totalDistance,
- /** First line of text for audio pass thru
- *
- */
-
- audioPassThruDisplayText1,
- /** Second line of text for audio pass thru
- *
- */
-
- audioPassThruDisplayText2,
- /** Header text for slider
- *
- */
-
- sliderHeader,
- /** Footer text for slider
- *
- */
-
- sliderFooter,
- /** Primary text for Choice
- *
- */
-
- menuName,
- /** Secondary text for Choice
- *
- */
-
- secondaryText,
- /** Tertiary text for Choice
- *
- */
-
- tertiaryText,
- /** Optional text to label an app menu button (for certain touchscreen platforms).
- *
- */
- menuTitle,
- /**
- * Optional name / title of intended location for SendLocation.
- *
- * @since SmartDeviceLink 4.0
- */
- locationName,
- /**
- * Optional description of intended location / establishment (if applicable) for SendLocation
- *
- * @since SmartDeviceLink 4.0
- */
- locationDescription,
- /**
- * Optional location address (if applicable) for SendLocation.
- *
- * @since SmartDeviceLink 4.0
- */
- addressLines,
- /**
- * Optional hone number of intended location / establishment (if applicable) for SendLocation.
- *
- * @since SmartDeviceLink 4.0
- */
- phoneNumber,
- ;
- /**
- * Convert String to TextFieldName
- * @param value String
- * @return TextFieldName
- */
-
- public static TextFieldName 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/TouchType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TouchType.java
deleted file mode 100644
index 7cc259aa4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TouchType.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** The type of touch event.
- *
- * @since SmartDeviceLink 2.3.2
- *
- */
-
-public enum TouchType {
- /** The user has touched the screen.
- *
- */
-
- BEGIN,
- /** The User has moved his finger over the screen.
- *
- */
-
- MOVE,
- /** The User has removed his finger from the screen.
- *
- */
-
- END,
- /** The user has made a cancellation gesture.
- *
- */
- CANCEL;
- /**
- * Convert String to TouchType
- * @param value String
- * @return TouchType
- */
-
- public static TouchType valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TriggerSource.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TriggerSource.java
deleted file mode 100644
index 169721705..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TriggerSource.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-import java.util.EnumSet;
-
-/**
- * Indicates whether choice/command was selected via VR or via a menu selection
- * (using SEEKRIGHT/SEEKLEFT, TUNEUP, TUNEDOWN and OK buttons)
- *
- * @since SmartDeviceLink 1.0
- *
- */
-public enum TriggerSource {
- /**
- * Selection made via menu (i.e. using SEEKRIGHT/SEEKLEFT, TUNEUP, TUNEDOWN
- * and OK buttons)
- */
- TS_MENU("MENU"),
- /**
- * Selection made via VR session
- */
- TS_VR("VR"),
-
- TS_KEYBOARD("KEYBOARD");
-
- private final String INTERNAL_NAME;
-
- private TriggerSource(String internalName) {
- this.INTERNAL_NAME = internalName;
- }
-
- public String toString() {
- return this.INTERNAL_NAME;
- }
-
- public static TriggerSource valueForString(String value) {
- if(value == null){
- return null;
- }
-
- for (TriggerSource anEnum : EnumSet.allOf(TriggerSource.class)) {
- if (anEnum.toString().equals(value)) {
- return anEnum;
- }
- }
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TurnSignal.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TurnSignal.java
deleted file mode 100644
index 923cd842e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/TurnSignal.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enumeration that describes the status of the turn light indicator.
- *
- * @since SmartDeviceLink 5.0
- */
-public enum TurnSignal {
-
- /**
- * Turn signal is OFF
- */
- OFF,
- /**
- * Left turn signal is on
- */
- LEFT,
- /**
- * Right turn signal is on
- */
- RIGHT,
- /**
- * Both signals (left and right) are on.
- */
- BOTH,
- ;
-
- public static TurnSignal 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/UpdateMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/UpdateMode.java
deleted file mode 100644
index cd9bf6dfe..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/UpdateMode.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Specifies what function should be performed on the media clock/counter
- *
- *
- * @since SmartDeviceLink 1.0
- */
-public enum UpdateMode {
- /**
- * Starts the media clock timer counting upward, in increments of 1 second
- */
- COUNTUP,
- /**
- * Starts the media clock timer counting downward, in increments of 1 second
- */
- COUNTDOWN,
- /**
- * Pauses the media clock timer
- */
- PAUSE,
- /**
- * Resumes the media clock timer. The timer resumes counting in whatever
- * mode was in effect before pausing (i.e. COUNTUP or COUNTDOWN)
- */
- RESUME,
- CLEAR;
-
-
- /**
- * Returns an UpdateMode value (COUNTUP, COUNTDOWN, PAUSE or RESUME)
- * @param value a String
- * @return UpdateMode -COUNTUP, COUNTDOWN, PAUSE or RESUME
- */
- public static UpdateMode 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/VehicleDataEventStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataEventStatus.java
deleted file mode 100644
index 64a5dd898..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataEventStatus.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Reflects the status of a vehicle data event; e.g. a seat belt event status.
- * @since SmartDeviceLink 2.0
- */
-public enum VehicleDataEventStatus {
- /**
- * No event available
- */
- NO_EVENT,
- NO,
- YES,
- /**
- * Vehicle data event is not support
- */
- NOT_SUPPORTED,
- FAULT;
-
- /**
- * Convert String to VehicleDataEventStatus
- * @param value String
- * @return VehicleDataEventStatus
- */
- public static VehicleDataEventStatus 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/VehicleDataNotificationStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataNotificationStatus.java
deleted file mode 100644
index d7bca9fc7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataNotificationStatus.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Reflects the status of a vehicle data notification.
- * @since SmartDeviceLink 2.0
- *
- * @see SoftButtonCapabilities
- * @see ButtonCapabilities
- * @see OnButtonPress
- */
-public enum VehicleDataNotificationStatus {
- /**
- * VehicleDataNotificationStatus is not supported.
- */
- NOT_SUPPORTED,
- /**
- * VehicleDataNotificationStatus is normal.
- */
- NORMAL,
- /**
- * VehicleDataNotificationStatus is active.
- */
- ACTIVE,
- /**
- * VehicleDataNotificationStatus is not in use.
- */
- NOT_USED;
-
- /**
- * Convert String to VehicleDataNotificationStatus
- * @param value String
- * @return VehicleDataNotificationStatus
- */
- public static VehicleDataNotificationStatus 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/VehicleDataResultCode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java
deleted file mode 100644
index 45c2e7c11..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** Enumeration that describes possible result codes of a vehicle data entry request.
- *
- * @since SmartDeviceLink 2.0
- *
- *@see DIDResult
- *@see ReadDID
- */
-
-public enum VehicleDataResultCode {
- /**Individual vehicle data item / DTC / DID request or subscription successful
- *
- */
-
- SUCCESS,
- /**
- *DTC / DID request successful, however, not all active DTCs or full contents of DID location available
- *
- * @since SmartDeviceLink 4.0
- */
-
- TRUNCATED_DATA,
- /** This vehicle data item is not allowed for this app .The request is not authorized in local policies.
- *
- */
-
- DISALLOWED,
- /** The user has not granted access to this type of vehicle data item at this time.
- *
- */
-
- USER_DISALLOWED,
- /** The ECU ID referenced is not a valid ID on the bus / system.
- *
- */
-
- INVALID_ID,
- /** The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system.
- *
- */
-
- VEHICLE_DATA_NOT_AVAILABLE,
- /** The vehicle data item is already subscribed.
- *
- */
-
- DATA_ALREADY_SUBSCRIBED,
- /** The vehicle data item cannot be unsubscribed because it is not currently subscribed.
- *
- */
-
- DATA_NOT_SUBSCRIBED,
- /** The request for this item is ignored because it is already in progress
- */
-
- IGNORED;
-
- public static VehicleDataResultCode 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/VehicleDataStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataStatus.java
deleted file mode 100644
index 2245bbe71..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataStatus.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Reflects the status of a binary vehicle data item.
- * @since SmartDeviceLink 2.0
- *
- */
-public enum VehicleDataStatus {
- /**
- * No data available
- */
- NO_DATA_EXISTS,
- /**
- * The vehicle item is in Off state
- */
-
- OFF,
- /**
- * The vehicle item is in On state
- */
-
- ON;
-
- /**
- * Convert String to VehicleDataStatus
- * @param value String
- * @return VehicleDataStatus
- */
- public static VehicleDataStatus 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/VehicleDataType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java
deleted file mode 100644
index 01525ef4a..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Defines the vehicle data types that can be published and subscribed to.
- *
- */
-public enum VehicleDataType {
- /**
- * Notifies GPSData may be subscribed
- */
- VEHICLEDATA_GPS,
- /**
- * Notifies SPEED Data may be subscribed
- */
- VEHICLEDATA_SPEED,
- /**
- * Notifies RPMData may be subscribed
- */
- VEHICLEDATA_RPM,
- /**
- * Notifies FUELLEVELData may be subscribed
- */
- VEHICLEDATA_FUELLEVEL,
- /**
- * Notifies FUELLEVEL_STATEData may be subscribed
- */
- VEHICLEDATA_FUELLEVEL_STATE,
-/**
- * Notifies FUELCONSUMPTIONData may be subscribed
- */
- VEHICLEDATA_FUELCONSUMPTION,
- /**
- * Notifies EXTERNTEMPData may be subscribed
- */
- VEHICLEDATA_EXTERNTEMP,
- /**
- * Notifies VINData may be subscribed
- */
- VEHICLEDATA_VIN,
- /**
- * Notifies PRNDLData may be subscribed
- */
- VEHICLEDATA_PRNDL,
- /**
- * Notifies TIREPRESSUREData may be subscribed
- */
- VEHICLEDATA_TIREPRESSURE,
- /**
- * Notifies ODOMETERData may be subscribed
- */
- VEHICLEDATA_ODOMETER,
- /**
- * Notifies BELTSTATUSData may be subscribed
- */
- VEHICLEDATA_BELTSTATUS,
- /**
- * Notifies BODYINFOData may be subscribed
- */
- VEHICLEDATA_BODYINFO,
- /**
- * Notifies DEVICESTATUSData may be subscribed
- */
- VEHICLEDATA_DEVICESTATUS,
- /**
- * Notifies BRAKINGData may be subscribed
- */
- VEHICLEDATA_BRAKING,
- /**
- * Notifies WIPERSTATUSData may be subscribed
- */
- VEHICLEDATA_WIPERSTATUS,
- /**
- * Notifies HEADLAMPSTATUSData may be subscribed
- */
- VEHICLEDATA_HEADLAMPSTATUS,
- /**
- * Notifies BATTVOLTAGEData may be subscribed
- */
- VEHICLEDATA_BATTVOLTAGE,
- /**
- * Notifies EGINETORQUEData may be subscribed
- */
- VEHICLEDATA_ENGINETORQUE,
- /**
- * Notifies ENGINEOILLIFEData may be subscribed
- */
- VEHICLEDATA_ENGINEOILLIFE,
- /**
- * Notifies ACCPEDALData may be subscribed
- */
- VEHICLEDATA_ACCPEDAL,
- /**
- * Notifies STEERINGWHEELData may be subscribed
- */
- VEHICLEDATA_STEERINGWHEEL,
- /**
- * Notifies ECALLINFOData may be subscribed
- */
- VEHICLEDATA_ECALLINFO,
- /**
- * Notifies AIRBAGSTATUSData may be subscribed
- */
- VEHICLEDATA_AIRBAGSTATUS,
- /**
- * Notifies EMERGENCYEVENTData may be subscribed
- */
- VEHICLEDATA_EMERGENCYEVENT,
- /**
- * Notifies CLUSTERMODESTATUSData may be subscribed
- */
- VEHICLEDATA_CLUSTERMODESTATUS,
- /**
- * Notifies MYKEYData may be subscribed
- */
- VEHICLEDATA_MYKEY,
-
- VEHICLEDATA_FUELRANGE,
-
- /**
- * Notifies TURNSIGNALData may be subscribed
- */
- VEHICLEDATA_TURNSIGNAL,
-
- /**
- * Notifies ELECTRONICPARKBRAKESTATUSData may be subscribed
- */
- VEHICLEDATA_ELECTRONICPARKBRAKESTATUS,
- ;
-
- /**
- * Convert String to VehicleDataType
- * @param value String
- * @return VehicleDataType
- */
-
- public static VehicleDataType 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/VentilationMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VentilationMode.java
deleted file mode 100644
index b7a2ae9a2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VentilationMode.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum VentilationMode {
- UPPER,
- LOWER,
- BOTH,
- NONE,
- ;
-
- public static VentilationMode 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/VideoStreamingCodec.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingCodec.java
deleted file mode 100644
index a41c1d064..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingCodec.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enum for each type of video streaming codec.
- */
-
-public enum VideoStreamingCodec {
- /**
- * A block-oriented motion-compensation-based video compression standard. As of 2014 it is one
- * of the most commonly used formats for the recording, compression, and distribution of video
- * content.
- */
- H264,
- /**
- * High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video
- * compression standard, one of several potential successors to the widely used AVC
- * (H.264 or MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data
- * compression ratio at the same level of video quality, or substantially improved video quality
- * at the same bit rate. It supports resolutions up to 8192x4320, including 8K UHD.
- */
- H265,
- /**
- * Theora is derived from the formerly proprietary VP3 codec, released into the public domain by
- * On2 Technologies. It is broadly comparable in design and bitrate efficiency to MPEG-4 Part 2,
- * early versions of Windows Media Video, and RealVideo while lacking some of the features
- * present in some of these other codecs. It is comparable in open standards philosophy to the
- * BBC's Dirac codec.
- */
- Theora,
- /**
- * VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and
- * Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct
- * successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance
- * for Open Media (AOMedia) are based on VP8.
- */
- VP8,
- /**
- * Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video
- * (UHD) and also enables lossless compression.
- */
- VP9;
-
- public static VideoStreamingCodec 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/VideoStreamingProtocol.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingProtocol.java
deleted file mode 100644
index 412badcac..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingProtocol.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enum for each type of video streaming protocol type.
- */
-
-public enum VideoStreamingProtocol {
- /**
- * Raw stream bytes that contains no timestamp data and is the lowest supported video streaming
- */
- RAW,
- /**
- * RTP facilitates the transfer of real-time data. Information provided by this protocol include
- * timestamps (for synchronization), sequence numbers (for packet loss and reordering detection)
- * and the payload format which indicates the encoded format of the data.
- */
- RTP,
- /**
- * The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the
- * Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for
- * media stream delivery. However, some vendors implement proprietary transport protocols.
- */
- RTSP,
- /**
- * Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by
- * Macromedia for streaming audio, video and data over the Internet, between a Flash player and
- * a server. Macromedia is now owned by Adobe, which has released an incomplete version of the
- * specification of the protocol for public use.
- */
- RTMP,
- /**
- * The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and
- * Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.
- */
- WEBM;
-
- public static VideoStreamingProtocol 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/VideoStreamingState.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingState.java
deleted file mode 100644
index 80384016b..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VideoStreamingState.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enumeration that describes possible states of video streaming.
- * @since SmartDeviceLink 5.0
- */
-public enum VideoStreamingState {
- /**
- * @since SmartDeviceLink 5.0
- */
- STREAMABLE,
- /**
- * @since SmartDeviceLink 5.0
- */
- NOT_STREAMABLE;
- public static VideoStreamingState 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/VrCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VrCapabilities.java
deleted file mode 100644
index e228638ce..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/VrCapabilities.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * The VR capabilities of the connected SDL platform.
- *
- */
-public enum VrCapabilities {
- /**
- * The SDL platform is capable of recognizing spoken text in the current
- * language.
- *
- * @since SmartDeviceLink 1.0
- */
- @Deprecated
- Text,
-
- /**
- * The SDL platform is capable of recognizing spoken text in the current
- * language.
- *
- * @since SmartDeviceLink 3.0
- */
- TEXT,
- ;
-
- public static VrCapabilities valueForString(String value) {
- if(value == null){
- return null;
- }
-
- if (value.equalsIgnoreCase(TEXT.toString()))
- {
- return TEXT;
- }
-
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java
deleted file mode 100644
index 3d002e651..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Reflects the status of a cluster instrument warning light.
- * @since SmartDeviceLink 2.0
- */
-public enum WarningLightStatus {
- /**
- * Warninglight Off
- */
- OFF,
- /**
- * Warninglight On
- */
- ON,
- /**
- * Warninglight is flashing
- */
- FLASH,
- NOT_USED;
-
- /**
- * Convert String to WarningLightStatus
- * @param value String
- * @return WarningLightStatus
- */
- public static WarningLightStatus 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/WayPointType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WayPointType.java
deleted file mode 100644
index 120facaef..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WayPointType.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-
-public enum WayPointType {
- ALL,
- DESTINATION,
- ;
-
- public static WayPointType 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/WiperStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WiperStatus.java
deleted file mode 100644
index 546cf05b5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/WiperStatus.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.smartdevicelink.proxy.rpc.enums;
-/** This enumeration reflects the status of the wipers.
- *
- * @since SmartDeviceLink 2.0
- *
- * @see GetVehicleData
- * @see OnVehicleData
- */
-
-public enum WiperStatus {
- /** The wipers are off.
- *
- */
-
- OFF,
- /** The wipers are automatically off after detecting the wipers do not need to be engaged (rain stopped, etc.).
- *
- */
-
- AUTO_OFF,
- /** Means that though set to off, somehow the wipers have been engaged (physically moved enough to engage a wiping motion).
- *
- */
-
- OFF_MOVING,
- /** The wipers are manually off after having been working.
- *
- */
-
- MAN_INT_OFF,
- /** The wipers are manually on.
- *
- */
-
- MAN_INT_ON,
- /** The wipers are manually set to low speed.
- *
- */
-
- MAN_LOW,
- /** The wipers are manually set to high speed.
- *
- */
-
- MAN_HIGH,
- /** The wipers are manually set for doing a flick.
- *
- */
-
- MAN_FLICK,
- /** The wipers are set to use the water from vehicle washer bottle for cleaning the windscreen.
- *
- */
-
- WASH,
- /** The wipers are automatically set to low speed.
- *
- */
-
- AUTO_LOW,
- /** The wipers are automatically set to high speed.
- *
- */
-
- AUTO_HIGH,
- /** This is for when a user has just initiated a WASH and several seconds later a secondary wipe is automatically initiated to clear remaining fluid
- */
-
- COURTESYWIPE,
- /** This is set as the user moves between possible automatic wiper speeds.
- *
- */
-
- AUTO_ADJUST,
- /** The wiper is stalled to its place. There may be an obstruction.
- *
- */
-
- STALLED,
- /** The sensor / module cannot provide any information for wiper.
- *
- */
-
- NO_DATA_EXISTS;
- /**
- * Convert String to WiperStatus
- * @param value String
- * @return WiperStatus
- */
-
- public static WiperStatus valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java
deleted file mode 100644
index 88f119bdd..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.smartdevicelink.proxy.rpc.listeners;
-
-import android.util.Log;
-
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Vector;
-
-/**
- * This is the listener for sending Multiple RPCs.
- */
-public abstract class OnMultipleRequestListener extends OnRPCResponseListener {
-
- final Vector<Integer> correlationIds;
- OnRPCResponseListener rpcResponseListener;
- private static String TAG = "OnMultipleRequestListener";
-
- public OnMultipleRequestListener(){
- setListenerType(UPDATE_LISTENER_TYPE_MULTIPLE_REQUESTS);
- correlationIds = new Vector<>();
-
- rpcResponseListener = new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- OnMultipleRequestListener.this.onResponse(correlationId, response);
- update(correlationId);
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- super.onError(correlationId, resultCode, info);
- OnMultipleRequestListener.this.onError(correlationId, resultCode, info);
- update(correlationId);
- }
-
- private synchronized void update(int correlationId){
- correlationIds.remove(Integer.valueOf(correlationId));
- if(correlationIds.size()>0){
- onUpdate(correlationIds.size());
- }else{
- onFinished();
- }
- }
- };
- }
-
- public void addCorrelationId(int correlationid){
- correlationIds.add(correlationid);
- }
- /**
- * onUpdate is called during multiple stream request
- * @param remainingRequests of the original request
- */
- public abstract void onUpdate(int remainingRequests);
- public abstract void onFinished();
- public abstract void onError(int correlationId, Result resultCode, String info);
-
- public OnRPCResponseListener getSingleRpcResponseListener(){
- return rpcResponseListener;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java
deleted file mode 100644
index 1a8e4f35f..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.smartdevicelink.proxy.rpc.listeners;
-
-import com.smartdevicelink.proxy.RPCResponse;
-
-public abstract class OnPutFileUpdateListener extends OnRPCResponseListener{
-
- long totalSize = 0;
-
- public OnPutFileUpdateListener(){
- setListenerType(UPDATE_LISTENER_TYPE_PUT_FILE);
- }
-
- @Override
- public final void onStart(int correlationId) {
- super.onStart(correlationId);
- onStart(correlationId, totalSize); //We do this so we can send back the total size
- }
-
- public void onStart(int correlationId, long totalSize){
-
- }
-
- @Override
- public final void onResponse(int correlationId, RPCResponse response) {
- onResponse(correlationId, response, totalSize); //Calling our special abstract method
- }
- /**
- * Called when the putfile request is responded to.
- * @param correlationId
- * @param message
- * @param totalSize
- */
- public abstract void onResponse(int correlationId, RPCResponse response, long totalSize);
-
- /**
- * onUpdate is called during a putfile stream request
- * @param correlationId of the original request
- * @param bytesWritten
- * @param totalSize
- */
- public void onUpdate(int correlationId, long bytesWritten, long totalSize){
-
- };
-
- public final void setTotalSize(long totalSize){
- this.totalSize = totalSize;
- }
-}
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
deleted file mode 100644
index 8de606b7c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-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/OnRPCNotificationListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCNotificationListener.java
deleted file mode 100644
index e760618b1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCNotificationListener.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.smartdevicelink.proxy.rpc.listeners;
-
-import com.smartdevicelink.proxy.RPCNotification;
-
-public abstract class OnRPCNotificationListener {
-
- public abstract void onNotified(RPCNotification notification);
-}
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
deleted file mode 100644
index 2c40fe0df..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java
+++ /dev/null
@@ -1,53 +0,0 @@
-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/ISecurityInitializedListener.java b/sdl_android/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java
deleted file mode 100644
index f18152ed0..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.smartdevicelink.security;
-
-public interface ISecurityInitializedListener {
- public void onSecurityInitialized();
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java b/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
deleted file mode 100644
index b3f324267..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package com.smartdevicelink.security;
-
-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;
-
-public abstract class SdlSecurityBase {
-
- protected SdlSession session = null;
- protected String appId = null;
- protected List<String> makeList = null;
- 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() {
- }
-
- public abstract void initialize();
-
- public abstract Integer runHandshake(byte[] inputData,byte[] outputData);
-
- public abstract Integer encryptData(byte[] inputData,byte[] outputData);
-
- public abstract Integer decryptData(byte[] inputData,byte[] outputData);
-
- public abstract void shutDown();
-
- public void resetParams() {
- session = null;
- appId = null;
- isInitSuccess = false;
- startServiceList.clear();
- }
-
- public List<SessionType> getServiceList() {
- return startServiceList;
- }
-
- public void handleInitResult(boolean val) {
- if (session == null) return;
-
- setInitSuccess(val);
- session.onSecurityInitialized();
- }
-
- public void handleSdlSession(SdlSession val) {
- if (val == null) return;
-
- setSessionId(val.getSessionId());
- setSdlSession(val);
- }
-
- private void setInitSuccess(boolean val) {
- isInitSuccess = val;
- }
-
- public boolean getInitSuccess() {
- return isInitSuccess;
- }
-
- private void setSessionId(byte val) {
- sessionId = val;
- }
-
- public byte getSessionId() {
- return sessionId;
- }
-
- private void setSdlSession(SdlSession val) {
- session = val;
- }
-
- public String getAppId() {
- return appId;
- }
-
- public void setAppId(String val) {
- appId = val;
- }
-
- @Deprecated
- public static Service getAppService() {
- return appService;
- }
-
- @Deprecated
- public static void setAppService(Service 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() {
- return makeList;
- }
-
- public void setMakeList(List<String> val) {
- makeList = val;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
deleted file mode 100644
index 1a2c393cd..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.smartdevicelink.streaming;
-
-import java.io.IOException;
-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 {
-
- protected IStreamListener _streamListener = null;
- protected byte _rpcSessionID = 0;
-
- protected SessionType _serviceType = null;
- protected SdlSession _session = null;
- protected InputStream is = null;
- protected int bufferSize;
- protected byte[] buffer;
- protected boolean upts = false;
- protected RPCRequest _request = null;
- protected Version _wiproVersion = new Version("1.0.0");
-
- //protected long ts = 0, intervalBetweenReports = 5000, delta = 0;
- protected long intervalBetweenReports = 5000, delta = 0;
-
- public AbstractPacketizer(IStreamListener streamListener, InputStream is, SessionType sType, byte rpcSessionID, SdlSession session) throws IOException, IllegalArgumentException {
- this._streamListener = streamListener;
- this.is = is;
- _rpcSessionID = rpcSessionID;
- _serviceType = sType;
- this._session = session;
- if (this._session != null) {
- bufferSize = this._session.getMtu();
- buffer = new byte[bufferSize];
- }else{
- throw new IllegalArgumentException("Session variable is null");
- }
- }
-
- @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 = 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();
- buffer = new byte[bufferSize];
- }else{
- throw new IllegalArgumentException("Session variable is null");
- }
- }
-
- public abstract void start() throws IOException;
-
- public abstract void stop();
-
- public abstract void pause();
-
- public abstract void resume();
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/IStreamListener.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
deleted file mode 100644
index 2e19cf578..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.smartdevicelink.streaming;
-
-import com.smartdevicelink.protocol.ProtocolMessage;
-
-public interface IStreamListener {
- void sendStreamPacket(ProtocolMessage pm);
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
deleted file mode 100644
index 24f8eb926..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
+++ /dev/null
@@ -1,249 +0,0 @@
-package com.smartdevicelink.streaming;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import com.smartdevicelink.SdlConnection.SdlConnection;
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.protocol.AbstractProtocol;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.WiProProtocol;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
-
-public class StreamPacketizer extends AbstractPacketizer implements IVideoStreamListener, IAudioStreamListener, Runnable{
-
- public final static String TAG = "StreamPacketizer";
-
- private Thread t = null;
-
-
- private final static int TLS_MAX_RECORD_SIZE = 16384;
- private final static int TLS_RECORD_HEADER_SIZE = 5;
- private final static int TLS_RECORD_MES_AUTH_CDE_SIZE = 32;
- private final static int TLS_MAX_RECORD_PADDING_SIZE = 256;
-
-
- private final static int BUFF_READ_SIZE = TLS_MAX_RECORD_SIZE - TLS_RECORD_HEADER_SIZE - TLS_RECORD_MES_AUTH_CDE_SIZE - TLS_MAX_RECORD_PADDING_SIZE;
-
- // Approximate size of data that mOutputQueue can hold in bytes.
- // By adding a buffer, we accept underlying transport being stuck for a short time. By setting
- // a limit of the buffer size, we avoid buffer overflows when underlying transport is too slow.
- private static final int MAX_QUEUE_SIZE = 256 * 1024;
-
- public SdlConnection sdlConnection = null; //TODO remove completely
- private Object mPauseLock;
- private boolean mPaused;
- private boolean isServiceProtected = false;
- private BlockingQueue<ByteBuffer> mOutputQueue;
-
- public StreamPacketizer(IStreamListener streamListener, InputStream is, SessionType sType, byte rpcSessionID, SdlSession session) throws IOException {
- super(streamListener, is, sType, rpcSessionID, session);
- mPauseLock = new Object();
- mPaused = false;
- isServiceProtected = _session.isServiceProtected(_serviceType);
- if (bufferSize == 0) {
- // fail safe
- bufferSize = BUFF_READ_SIZE;
- }
- if(isServiceProtected){ //If our service is encrypted we can only use 1024 as the max buffer size.
- bufferSize = BUFF_READ_SIZE;
- buffer = new byte[bufferSize];
- }
- mOutputQueue = new LinkedBlockingQueue<ByteBuffer>(MAX_QUEUE_SIZE / bufferSize);
- }
-
- public void start() throws IOException {
- if (t == null) {
- t = new Thread(this);
- t.start();
- }
- }
-
- public void stop() {
-
- if (t != null)
- {
- t.interrupt();
- t = null;
- }
-
- }
-
- public void run() {
- int length;
- try
- {
- while (t != null && !t.isInterrupted())
- {
- synchronized(mPauseLock)
- {
- while (mPaused)
- {
- try
- {
- mPauseLock.wait();
- }
- catch (InterruptedException e) {}
- }
- }
-
- if (is != null) { // using InputStream interface
- length = is.read(buffer, 0, bufferSize);
-
- if (length >= 0) {
- ProtocolMessage pm = new ProtocolMessage();
- pm.setSessionID(_rpcSessionID);
- pm.setSessionType(_serviceType);
- pm.setFunctionID(0);
- pm.setCorrID(0);
- pm.setData(buffer, length);
- pm.setPayloadProtected(isServiceProtected);
-
- if (t != null && !t.isInterrupted()) {
- _streamListener.sendStreamPacket(pm);
- }
- }
- } else { // using sendFrame interface
- ByteBuffer frame;
- try {
- frame = mOutputQueue.take();
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- break;
- }
-
- while (frame.hasRemaining()) {
- int len = frame.remaining() > bufferSize ? bufferSize : frame.remaining();
-
- ProtocolMessage pm = new ProtocolMessage();
- pm.setSessionID(_rpcSessionID);
- pm.setSessionType(_serviceType);
- pm.setFunctionID(0);
- pm.setCorrID(0);
- pm.setData(frame.array(), frame.arrayOffset() + frame.position(), len);
- pm.setPayloadProtected(isServiceProtected);
-
- if (t != null && !t.isInterrupted()) {
- _streamListener.sendStreamPacket(pm);
- }
-
- frame.position(frame.position() + len);
- }
- }
- }
- } catch (IOException e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(_session == null) {
- if (sdlConnection != null) {
- sdlConnection.endService(_serviceType, _rpcSessionID);
- }
- }else{
- _session.endService(_serviceType,_rpcSessionID);
- }
-
-
- }
- }
-
- @Override
- public void pause() {
- synchronized (mPauseLock) {
- mPaused = true;
- }
- }
-
- @Override
- public void resume() {
- synchronized (mPauseLock) {
- mPaused = false;
- mPauseLock.notifyAll();
- }
- }
-
- /**
- * Called by the app.
- *
- * @see com.smartdevicelink.proxy.interfaces.IVideoStreamListener#sendFrame(byte[], int, int, long)
- */
- @Override
- public void sendFrame(byte[] data, int offset, int length, long presentationTimeUs)
- throws ArrayIndexOutOfBoundsException {
- sendArrayData(data, offset, length);
- }
-
- /**
- * Called by the app.
- *
- * @see com.smartdevicelink.proxy.interfaces.IVideoStreamListener#sendFrame(ByteBuffer, long)
- */
- @Override
- public void sendFrame(ByteBuffer data, long presentationTimeUs) {
- sendByteBufferData(data);
- }
-
- /**
- * Called by the app.
- *
- * @see com.smartdevicelink.proxy.interfaces.IAudioStreamListener#sendAudio(byte[], int, int, long)
- */
- @Override
- public void sendAudio(byte[] data, int offset, int length, long presentationTimeUs)
- throws ArrayIndexOutOfBoundsException {
- sendArrayData(data, offset, length);
- }
-
- /**
- * Called by the app.
- *
- * @see com.smartdevicelink.proxy.interfaces.IAudioStreamListener#sendAudio(ByteBuffer, long)
- */
- @Override
- public void sendAudio(ByteBuffer data, long presentationTimeUs) {
- sendByteBufferData(data);
- }
-
- private void sendArrayData(byte[] data, int offset, int length)
- throws ArrayIndexOutOfBoundsException {
- if (offset < 0 || offset > data.length || length <= 0 || offset + length > data.length) {
- throw new ArrayIndexOutOfBoundsException();
- }
-
- // StreamPacketizer does not need to split a video frame into NAL units
- ByteBuffer buffer = ByteBuffer.allocate(length);
- buffer.put(data, offset, length);
- buffer.flip();
-
- try {
- mOutputQueue.put(buffer);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- }
- }
-
- private void sendByteBufferData(ByteBuffer data) {
- if (data == null || data.remaining() == 0) {
- return;
- }
-
- // copy the whole buffer, so that even if the app modifies original ByteBuffer after
- // sendFrame() or sendAudio() call, our buffer will stay intact
- ByteBuffer buffer = ByteBuffer.allocate(data.remaining());
- buffer.put(data);
- buffer.flip();
-
- try {
- mOutputQueue.put(buffer);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
deleted file mode 100644
index 8aab788c9..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
+++ /dev/null
@@ -1,307 +0,0 @@
-package com.smartdevicelink.streaming;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Hashtable;
-
-import com.smartdevicelink.SdlConnection.SdlSession;
-
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.SdlProxyBase;
-import com.smartdevicelink.proxy.interfaces.IProxyListenerBase;
-import com.smartdevicelink.proxy.interfaces.IPutFileResponseListener;
-import com.smartdevicelink.proxy.rpc.OnStreamRPC;
-import com.smartdevicelink.proxy.rpc.PutFile;
-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{
-
- private Integer iInitialCorrID = 0;
- private Hashtable<Integer, OnStreamRPC> notificationList = new Hashtable<Integer, OnStreamRPC>();
- private Thread thread = null;
- private long lFileSize = 0;
- private String sFileName;
- private SdlProxyBase<IProxyListenerBase> _proxy;
- private IProxyListenerBase _proxyListener;
-
- private Object mPauseLock;
- private boolean mPaused;
- private boolean isRPCProtected = false;
- 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);
- 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();
- }
- }
-
- 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) {
- thread = new Thread(this);
- thread.start();
- }
- }
-
- @Override
- public void stop() {
- try {
- is.close();
- } catch (IOException ignore) {}
- if (thread != null)
- {
- thread.interrupt();
- thread = null;
- }
- }
-
- private void handleStreamSuccess(RPCResponse rpc, Long iSize)
- {
- StreamRPCResponse result = new StreamRPCResponse();
- result.setSuccess(rpc.getSuccess());
- result.setResultCode(rpc.getResultCode());
- result.setInfo(rpc.getInfo());
- result.setFileName(sFileName);
- result.setFileSize(iSize);
- result.setCorrelationID(iInitialCorrID);
- if (_proxyListener != null)
- _proxyListener.onStreamRPCResponse(result);
- stop();
- _proxy.remPutFileResponseListener(this);
- return;
- }
-
- private void handleStreamException(RPCResponse rpc, Exception e, String error)
- {
- StreamRPCResponse result = new StreamRPCResponse();
- result.setFileName(sFileName);
- result.setCorrelationID(iInitialCorrID);
- if (rpc != null)
- {
- result.setSuccess(rpc.getSuccess());
- result.setResultCode(rpc.getResultCode());
- result.setInfo(rpc.getInfo());
- }
- else
- {
- result.setSuccess(false);
- result.setResultCode(Result.GENERIC_ERROR);
- String sException = "";
-
- if (e != null)
- sException = sException + " " + e.toString();
-
- sException = sException + " " + error;
- result.setInfo(sException);
- }
- if (_proxyListener != null)
- _proxyListener.onStreamRPCResponse(result);
- if (e != null)
- e.printStackTrace();
- stop();
- _proxy.remPutFileResponseListener(this);
- return;
- }
-
- @Override
- public void pause() {
- synchronized (mPauseLock) {
- mPaused = true;
- }
- }
-
- @Override
- public void resume() {
- synchronized (mPauseLock) {
- mPaused = false;
- mPauseLock.notifyAll();
- }
- }
-
- public void run() {
- int length;
- byte[] msgBytes;
- ProtocolMessage pm;
- OnStreamRPC notification;
-
- // Moves the current Thread into the background
- android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
-
- try {
-
- int iCorrID = 0;
- PutFile msg = (PutFile) _request;
- sFileName = msg.getSdlFileName();
- long iOffsetCounter = msg.getOffset();
-
- int priorityCoefficient = 1;
-
- if (lFileSize != 0)
- {
- Long iFileSize = (long) lFileSize;
- //TODO: PutFile RPC needs to be updated to accept Long as we might run into overflows since a Long can store a wider range than an Integer
- msg.setLength(iFileSize);
- }
- Long iFileLength = msg.getLength();
-
- notificationList.clear();
-
- //start reading from the stream at the given offset
- long iSkipBytes = is.skip(iOffsetCounter);
-
- if (iOffsetCounter != iSkipBytes)
- {
- handleStreamException(null,null," Error, PutFile offset invalid for file: " + sFileName);
- }
- if(callBack!=null){
- callBack.onStart(_request.getCorrelationID(), lFileSize);
- }
- while (!Thread.interrupted()) {
-
- synchronized (mPauseLock)
- {
- while (mPaused)
- {
- try
- {
- mPauseLock.wait();
- }
- catch (InterruptedException e) {}
- }
- }
-
- length = is.read(buffer, 0, bufferSize);
-
- if (length == -1)
- stop();
-
- if (length >= 0) {
-
- if (msg.getOffset() != 0)
- msg.setLength((Long)null); //only need to send length when offset 0
-
- msg.format(rpcSpecVersion,true);
- msgBytes = JsonRPCMarshaller.marshall(msg, (byte)_wiproVersion.getMajor());
- pm = new ProtocolMessage();
- pm.setData(msgBytes);
-
- pm.setSessionID(_rpcSessionID);
- pm.setMessageType(MessageType.RPC);
- pm.setSessionType(_serviceType);
- pm.setFunctionID(FunctionID.getFunctionId(msg.getFunctionName()));
-
- if (buffer.length != length)
- pm.setBulkData(buffer, length);
- else
- pm.setBulkDataNoCopy(buffer);
-
- pm.setCorrID(msg.getCorrelationID());
- pm.setPayloadProtected(isRPCProtected);
- priorityCoefficient++;
- pm.setPriorityCoefficient(priorityCoefficient);
-
- notification = new OnStreamRPC();
- notification.setFileName(msg.getSdlFileName());
- notification.setFileSize(iFileLength);
- iOffsetCounter = iOffsetCounter + length;
- notification.setBytesComplete(iOffsetCounter);
- notificationList.put(msg.getCorrelationID(),notification);
-
- msg.setOffset(iOffsetCounter);
- iCorrID = msg.getCorrelationID() + 1;
- msg.setCorrelationID(iCorrID);
-
- _streamListener.sendStreamPacket(pm);
- }
- }
- } catch (Exception e) {
- handleStreamException(null, e, "");
- }
- }
-
- @Override
- public void onPutFileResponse(PutFileResponse response)
- {
-
- OnStreamRPC streamNote = notificationList.get(response.getCorrelationID());
- if (streamNote == null) return;
-
- if (response.getSuccess())
- {
- if(callBack!=null){
- callBack.onUpdate(response.getCorrelationID(), streamNote.getBytesComplete(), lFileSize);
- }
- if (_proxyListener != null){
- _proxyListener.onOnStreamRPC(streamNote);
- }
-
- }
- else
- {
- if(callBack!=null){
- callBack.onError(response.getCorrelationID(), response.getResultCode(), response.getInfo());
- }
- handleStreamException(response, null, "");
-
- }
-
- if (response.getSuccess() && streamNote.getBytesComplete().equals(streamNote.getFileSize()) )
- {
- if(callBack!=null){
- callBack.onResponse(iInitialCorrID, response, streamNote.getBytesComplete());
- }
- handleStreamSuccess(response, streamNote.getBytesComplete());
-
- }
- }
-
- @Override
- public void onPutFileStreamError(Exception e, String info)
- {
- if (thread != null)
- handleStreamException(null, e, info);
-
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
deleted file mode 100644
index 1e2b9c5da..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
- * Copyright (c) 2017, Xevo Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * * Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.streaming.video;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.Random;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import com.smartdevicelink.SdlConnection.SdlConnection;
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-import com.smartdevicelink.streaming.AbstractPacketizer;
-import com.smartdevicelink.streaming.IStreamListener;
-
-/*
- * Note for testing.
- * The RTP stream generated by this packetizer can be tested with GStreamer (1.4 or later).
- * Assuming that "VideoStreamPort" is configured as 5050 in smartDeviceLink.ini, here is the
- * GStreamer pipeline that receives the stream, decode it and render it:
- *
- * $ gst-launch-1.0 souphttpsrc location=http://127.0.0.1:5050 ! "application/x-rtp-stream" ! rtpstreamdepay ! "application/x-rtp,media=(string)video,clock-rate=90000,encoding-name=(string)H264" ! rtph264depay ! "video/x-h264, stream-format=(string)avc, alignment=(string)au" ! avdec_h264 ! autovideosink sync=false
- */
-
-/**
- * This class receives H.264 byte stream (in Annex-B format), parses it, construct RTP packets
- * from it based on RFC 6184, then frame the packets based on RFC 4571.
- * The primary purpose of using RTP is to carry timestamp information along with the data.
- *
- * @author Sho Amano
- */
-public class RTPH264Packetizer extends AbstractPacketizer implements IVideoStreamListener, Runnable {
-
- // Approximate size of data that mOutputQueue can hold in bytes.
- // By adding a buffer, we accept underlying transport being stuck for a short time. By setting
- // a limit of the buffer size, we avoid buffer overflows when underlying transport is too slow.
- private static final int MAX_QUEUE_SIZE = 256 * 1024;
-
- private static final int FRAME_LENGTH_LEN = 2;
- private static final int MAX_RTP_PACKET_SIZE = 65535; // because length field is two bytes (RFC 4571)
- private static final int RTP_HEADER_LEN = 12;
- private static final byte DEFAULT_RTP_PAYLOAD_TYPE = 96;
- private static final int FU_INDICATOR_LEN = 1;
- private static final int FU_HEADER_LEN = 1;
- private static final byte TYPE_FU_A = 28;
-
- // To align with StreamPacketizer class
- private final static int TLS_MAX_RECORD_SIZE = 16384;
- private final static int TLS_RECORD_HEADER_SIZE = 5;
- private final static int TLS_RECORD_MES_AUTH_CDE_SIZE = 32;
- private final static int TLS_MAX_RECORD_PADDING_SIZE = 256;
-
- private final static int MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE =
- TLS_MAX_RECORD_SIZE - TLS_RECORD_HEADER_SIZE - TLS_RECORD_MES_AUTH_CDE_SIZE- TLS_MAX_RECORD_PADDING_SIZE;
-
- private boolean mServiceProtected;
- private Thread mThread;
- private BlockingQueue<ByteBuffer> mOutputQueue;
- private volatile boolean mPaused;
- private boolean mWaitForIDR;
- private NALUnitReader mNALUnitReader;
- private byte mPayloadType = 0;
- private int mSSRC = 0;
- private char mSequenceNum = 0;
- private int mInitialPTS = 0;
-
- /**
- * Constructor
- *
- * @param streamListener The listener which this packetizer outputs SDL frames to
- * @param serviceType The value of "Service Type" field in SDL frames
- * @param sessionID The value of "Session ID" field in SDL frames
- * @param session The SdlSession instance that this packetizer belongs to
- */
- public RTPH264Packetizer(IStreamListener streamListener,
- SessionType serviceType, byte sessionID, SdlSession session) throws IOException {
-
- super(streamListener, null, serviceType, sessionID, session);
-
- mServiceProtected = session.isServiceProtected(_serviceType);
-
- bufferSize = (int)this._session.getMtu(SessionType.NAV);
- if (bufferSize == 0) {
- // fail safe
- bufferSize = MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE;
- }
- if (mServiceProtected && bufferSize > MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE) {
- bufferSize = MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE;
- }
-
- mOutputQueue = new LinkedBlockingQueue<ByteBuffer>(MAX_QUEUE_SIZE / bufferSize);
- mNALUnitReader = new NALUnitReader();
- mPayloadType = DEFAULT_RTP_PAYLOAD_TYPE;
-
- Random r = new Random();
- mSSRC = r.nextInt();
-
- // initial value of the sequence number and timestamp should be random ([5.1] in RFC3550)
- mSequenceNum = (char)r.nextInt(65536);
- mInitialPTS = r.nextInt();
- }
-
- /**
- * Sets the Payload Type (PT) of RTP header field.
- *
- * Use this method if PT needs to be specified. The value should be between 0 and 127.
- * Otherwise, a default value (96) is used.
- *
- * @param type A value indicating the Payload Type
- */
- public void setPayloadType(byte type) {
- if (type >= 0 && type <= 127) {
- mPayloadType = type;
- } else {
- mPayloadType = DEFAULT_RTP_PAYLOAD_TYPE;
- }
- }
-
- /**
- * Sets the SSRC of RTP header field.
- *
- * Use this method if SSRC needs to be specified. Otherwise, a random value is generated and
- * used.
- *
- * @param ssrc An integer value representing SSRC
- */
- public void setSSRC(int ssrc) {
- mSSRC = ssrc;
- }
-
- /**
- * Starts this packetizer.
- *
- * It is recommended that the video encoder is started after the packetizer is started.
- */
- @Override
- public void start() throws IOException {
- if (mThread != null) {
- return;
- }
-
- mThread = new Thread(this);
- mThread.start();
- }
-
- /**
- * Stops this packetizer.
- *
- * It is recommended that the video encoder is stopped prior to the packetizer.
- */
- @Override
- public void stop() {
- if (mThread == null) {
- return;
- }
-
- mThread.interrupt();
- mThread = null;
-
- mPaused = false;
- mWaitForIDR = false;
- mOutputQueue.clear();
- }
-
- /**
- * Pauses this packetizer.
- *
- * This pauses the packetizer but does not pause the video encoder.
- */
- @Override
- public void pause() {
- mPaused = true;
- }
-
- /**
- * Resumes this packetizer.
- */
- @Override
- public void resume() {
- mWaitForIDR = true;
- mPaused = false;
- }
-
- /**
- * The thread routine.
- */
- public void run() {
-
- while (mThread != null && !mThread.isInterrupted()) {
- ByteBuffer frame;
- try {
- frame = mOutputQueue.take();
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- break;
- }
-
- while (frame.hasRemaining()) {
- int len = frame.remaining() > bufferSize ? bufferSize : frame.remaining();
-
- ProtocolMessage pm = new ProtocolMessage();
- pm.setSessionID(_rpcSessionID);
- pm.setSessionType(_serviceType);
- pm.setFunctionID(0);
- pm.setCorrID(0);
- pm.setData(frame.array(), frame.arrayOffset() + frame.position(), len);
- pm.setPayloadProtected(mServiceProtected);
-
- _streamListener.sendStreamPacket(pm);
-
- frame.position(frame.position() + len);
- }
- }
-
- // XXX: This is added to sync with StreamPacketizer. Actually it shouldn't be here since
- // it's confusing that a packetizer takes care of End Service request.
- if (_session != null) {
- _session.endService(_serviceType, _rpcSessionID);
- }
- }
-
- /**
- * Called by the app and encoder.
- *
- * @see com.smartdevicelink.proxy.interfaces.IVideoStreamListener#sendFrame(byte[], int, int, long)
- */
- @Override
- public void sendFrame(byte[] data, int offset, int length, long presentationTimeUs)
- throws ArrayIndexOutOfBoundsException {
- mNALUnitReader.init(data, offset, length);
- onEncoderOutput(mNALUnitReader, presentationTimeUs);
- }
-
- /**
- * Called by the app and encoder.
- *
- * @see com.smartdevicelink.proxy.interfaces.IVideoStreamListener#sendFrame(ByteBuffer, long)
- */
- @Override
- public void sendFrame(ByteBuffer data, long presentationTimeUs) {
- mNALUnitReader.init(data);
- onEncoderOutput(mNALUnitReader, presentationTimeUs);
- }
-
- private void onEncoderOutput(NALUnitReader nalUnitReader, long ptsInUs) {
- if (mPaused) {
- return;
- }
-
- ByteBuffer nalUnit;
-
- while ((nalUnit = nalUnitReader.getNalUnit()) != null) {
- if (mWaitForIDR) {
- if (isIDR(nalUnit)) {
- mWaitForIDR = false;
- } else {
- continue;
- }
- }
- outputRTPFrames(nalUnit, ptsInUs, nalUnitReader.hasConsumedAll());
- }
- }
-
- private boolean outputRTPFrames(ByteBuffer nalUnit, long ptsInUs, boolean isLast) {
- if (RTP_HEADER_LEN + nalUnit.remaining() > MAX_RTP_PACKET_SIZE) {
- // Split into multiple Fragmentation Units ([5.8] in RFC 6184)
- byte firstByte = nalUnit.get();
- boolean firstFragment = true;
- boolean lastFragment = false;
-
- while (nalUnit.remaining() > 0) {
- int payloadLength = MAX_RTP_PACKET_SIZE - (RTP_HEADER_LEN + FU_INDICATOR_LEN + FU_HEADER_LEN);
- if (nalUnit.remaining() <= payloadLength) {
- payloadLength = nalUnit.remaining();
- lastFragment = true;
- }
-
- ByteBuffer frame = allocateRTPFrame(FU_INDICATOR_LEN + FU_HEADER_LEN + payloadLength,
- false, isLast, ptsInUs);
- // FU indicator
- frame.put((byte)((firstByte & 0xE0) | TYPE_FU_A));
- // FU header
- frame.put((byte)((firstFragment ? 0x80 : lastFragment ? 0x40 : 0) | (firstByte & 0x1F)));
- // FU payload
- frame.put(nalUnit.array(), nalUnit.position(), payloadLength);
- nalUnit.position(nalUnit.position() + payloadLength);
- frame.flip();
-
- try {
- mOutputQueue.put(frame);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- return false;
- }
-
- firstFragment = false;
- }
- } else {
- // Use Single NAL Unit Packet ([5.6] in RFC 6184)
- ByteBuffer frame = allocateRTPFrame(nalUnit.remaining(), false, isLast, ptsInUs);
- frame.put(nalUnit);
- frame.flip();
-
- try {
- mOutputQueue.put(frame);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- return false;
- }
- }
-
- return true;
- }
-
- private ByteBuffer allocateRTPFrame(int rtpPayloadLen,
- boolean hasPadding, boolean isLast, long ptsInUs) {
- if (rtpPayloadLen <= 0) {
- throw new IllegalArgumentException("Invalid rtpPayloadLen value: " + rtpPayloadLen);
- }
- if (ptsInUs < 0) {
- throw new IllegalArgumentException("Invalid ptsInUs value: " + ptsInUs);
- }
-
- int packetLength = RTP_HEADER_LEN + rtpPayloadLen;
- if (packetLength > MAX_RTP_PACKET_SIZE) {
- throw new IllegalArgumentException("Invalid rtpPayloadLen value: " + rtpPayloadLen);
- }
- int ptsIn90kHz = (int)(ptsInUs * 9 / 100) + mInitialPTS;
-
- ByteBuffer frame = ByteBuffer.allocate(FRAME_LENGTH_LEN + packetLength);
- frame.order(ByteOrder.BIG_ENDIAN);
- frame.putShort((short)packetLength);
-
- // Version = 2, Padding = hasPadding, Extension = 0, CSRC count = 0
- frame.put((byte)(0x80 | (hasPadding ? 0x20 : 0)))
- // Marker = isLast, Payload type = mPayloadType
- .put((byte)((isLast ? 0x80 : 0) | (mPayloadType & 0x7F)))
- .putChar(mSequenceNum)
- .putInt(ptsIn90kHz)
- .putInt(mSSRC);
-
- if (frame.position() != FRAME_LENGTH_LEN + RTP_HEADER_LEN) {
- throw new RuntimeException("Data size in ByteBuffer mismatch");
- }
-
- mSequenceNum++;
- return frame;
- }
-
- private static boolean isIDR(ByteBuffer nalUnit) {
- if (nalUnit == null || !nalUnit.hasRemaining()) {
- throw new IllegalArgumentException("Invalid nalUnit arg");
- }
-
- byte nalUnitType = (byte)(nalUnit.get(nalUnit.position()) & 0x1F);
- return nalUnitType == 5;
- }
-
-
- private static int SKIP_TABLE[] = new int[256];
- static {
- // Sunday's quick search algorithm is used to find the start code.
- // Prepare the table (SKIP_TABLE[0] = 2, SKIP_TABLE[1] = 1 and other elements will be 4).
- byte[] NAL_UNIT_START_CODE = {0, 0, 1};
- int searchStringLen = NAL_UNIT_START_CODE.length;
- for (int i = 0; i < SKIP_TABLE.length; i++) {
- SKIP_TABLE[i] = searchStringLen + 1;
- }
- for (int i = 0; i < searchStringLen; i++) {
- SKIP_TABLE[NAL_UNIT_START_CODE[i] & 0xFF] = searchStringLen - i;
- }
- }
-
- private class NALUnitReader {
- private byte[] mData;
- private int mOffset;
- private int mLimit;
-
- NALUnitReader() {
- }
-
- void init(byte[] data) {
- mData = data;
- mOffset = 0;
- mLimit = data.length;
- }
-
- void init(byte[] data, int offset, int length) throws ArrayIndexOutOfBoundsException {
- if (offset < 0 || offset > data.length || length <= 0 || offset + length > data.length) {
- throw new ArrayIndexOutOfBoundsException();
- }
- mData = data;
- mOffset = offset;
- mLimit = offset + length;
- }
-
- void init(ByteBuffer data) {
- if (data == null || data.remaining() == 0) {
- mData = null;
- mOffset = 0;
- mLimit = 0;
- return;
- }
-
- if (data.hasArray()) {
- mData = data.array();
- mOffset = data.position() + data.arrayOffset();
- mLimit = mOffset + data.remaining();
-
- // mark the buffer as consumed
- data.position(data.position() + data.remaining());
- } else {
- byte[] buffer = new byte[data.remaining()];
- data.get(buffer);
-
- mData = buffer;
- mOffset = 0;
- mLimit = buffer.length;
- }
- }
-
- ByteBuffer getNalUnit() {
- if (hasConsumedAll()) {
- return null;
- }
-
- int pos = mOffset;
- int start = -1;
-
- while (mLimit - pos >= 3) {
- if (mData[pos] == 0 && mData[pos+1] == 0 && mData[pos+2] == 1) {
- if (start != -1) {
- // We've found a start code, a NAL unit and then another start code.
- mOffset = pos;
- // remove 0x00s in front of the start code
- while (pos > start && mData[pos-1] == 0) {
- pos--;
- }
- if (pos > start) {
- return ByteBuffer.wrap(mData, start, pos - start);
- } else {
- // No NAL unit between two start codes?! Forget it and search for
- // another start code.
- pos = mOffset;
- }
- }
- // This is the first start code.
- pos += 3;
- start = pos;
- } else {
- try {
- pos += SKIP_TABLE[mData[pos+3] & 0xFF];
- } catch (ArrayIndexOutOfBoundsException e) {
- break;
- }
- }
- }
-
- mOffset = mLimit;
- if (start != -1 && mLimit > start) {
- // We've found a start code and then reached to the end of array.
- return ByteBuffer.wrap(mData, start, mLimit - start);
- }
- // A start code was not found
- return null;
- }
-
- boolean hasConsumedAll() {
- return (mData == null) || (mLimit - mOffset < 4);
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
deleted file mode 100644
index 121176cc2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2017 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.streaming.video;
-
-import android.util.DisplayMetrics;
-
-import com.smartdevicelink.proxy.rpc.ImageResolution;
-import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
-import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec;
-import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
-
-import java.util.List;
-
-@SuppressWarnings("FieldCanBeLocal")
-public class VideoStreamingParameters {
- private final VideoStreamingProtocol DEFAULT_PROTOCOL = VideoStreamingProtocol.RAW;
- private final VideoStreamingCodec DEFAULT_CODEC = VideoStreamingCodec.H264;
- private final int DEFAULT_WIDTH = 1024;
- private final int DEFAULT_HEIGHT = 576;
- private final int DEFAULT_DENSITY = DisplayMetrics.DENSITY_HIGH;
- private final int DEFAULT_FRAMERATE = 30;
- private final int DEFAULT_BITRATE = 512000;
- private final int DEFAULT_INTERVAL = 5;
-
-
- private int displayDensity;
- private int frameRate;
- private int bitrate;
- private int interval;
- private ImageResolution resolution;
- private VideoStreamingFormat format;
-
- public VideoStreamingParameters(){
- displayDensity = DEFAULT_DENSITY;
- frameRate = DEFAULT_FRAMERATE;
- bitrate = DEFAULT_BITRATE;
- interval = DEFAULT_INTERVAL;
- resolution = new ImageResolution();
- resolution.setResolutionWidth(DEFAULT_WIDTH);
- resolution.setResolutionHeight(DEFAULT_HEIGHT);
- format = new VideoStreamingFormat();
- format.setProtocol(DEFAULT_PROTOCOL);
- format.setCodec(DEFAULT_CODEC);
- }
-
- public VideoStreamingParameters(int displayDensity, int frameRate, int bitrate, int interval,
- ImageResolution resolution, VideoStreamingFormat format){
- this.displayDensity = displayDensity;
- this.frameRate = frameRate;
- this.bitrate = bitrate;
- this.interval = interval;
- this.resolution = resolution;
- this.format = format;
- }
-
- /**
- * Will only copy values that are not null or are greater than 0
- * @param params VideoStreamingParameters that should be copied into this new instants
- */
- @SuppressWarnings("unused")
- public VideoStreamingParameters(VideoStreamingParameters params){
- update(params);
- }
-
- /**
- * Will only copy values that are not null or are greater than 0
- * @param params VideoStreamingParameters that should be copied into this new instants
- */
- public void update(VideoStreamingParameters params){
- if(params!=null) {
- if (params.displayDensity > 0) {
- this.displayDensity = params.displayDensity;
- }
- if (params.frameRate > 0) {
- this.frameRate = params.frameRate;
- }
- if (params.bitrate > 0) {
- this.bitrate = params.bitrate;
- }
- if (params.interval > 0) {
- this.interval = params.interval;
- }
- if (params.resolution != null) {
- if (params.resolution.getResolutionHeight() != null && params.resolution.getResolutionHeight() > 0) {
- this.resolution.setResolutionHeight(params.resolution.getResolutionHeight());
- }
- if (params.resolution.getResolutionWidth() != null && params.resolution.getResolutionWidth() > 0) {
- this.resolution.setResolutionWidth(params.resolution.getResolutionWidth());
- }
- }
- if (params.format != null) {
- this.format = params.format;
- }
- }
- }
-
- /**
- * Update the values contained in the capability that should have been returned through the SystemCapabilityManager.
- * This update will use the most preferred streaming format from the module.
- * @param capability the video streaming capability returned from the SystemCapabilityManager
- * @see com.smartdevicelink.proxy.SystemCapabilityManager
- * @see VideoStreamingCapability
- */
- public void update(VideoStreamingCapability capability){
- if(capability.getMaxBitrate()!=null){ this.bitrate = capability.getMaxBitrate() * 1000; } // NOTE: the unit of maxBitrate in getSystemCapability is kbps.
- ImageResolution resolution = capability.getPreferredResolution();
- if(resolution!=null){
- if(resolution.getResolutionHeight()!=null && resolution.getResolutionHeight() > 0){ this.resolution.setResolutionHeight(resolution.getResolutionHeight()); }
- if(resolution.getResolutionWidth()!=null && resolution.getResolutionWidth() > 0){ this.resolution.setResolutionWidth(resolution.getResolutionWidth()); }
- }
- List<VideoStreamingFormat> formats = capability.getSupportedFormats();
- if(formats != null && formats.size()>0){
- this.format = formats.get(0);
- }
-
- }
-
- @SuppressWarnings("unused")
- public void setDisplayDensity(int displayDensity) {
- this.displayDensity = displayDensity;
- }
-
- public int getDisplayDensity() {
- return displayDensity;
- }
-
- public void setFrameRate(int frameRate) {
- this.frameRate = frameRate;
- }
-
- public int getFrameRate() {
- return frameRate;
- }
-
- public void setBitrate(int bitrate) {
- this.bitrate = bitrate;
- }
-
- public int getBitrate() {
- return bitrate;
- }
-
- public void setInterval(int interval) {
- this.interval = interval;
- }
-
- public int getInterval() {
- return interval;
- }
-
- public void setFormat(VideoStreamingFormat format){
- this.format = format;
- }
-
- public VideoStreamingFormat getFormat(){
- return format;
- }
-
- public void setResolution(ImageResolution resolution){
- this.resolution = resolution;
- }
-
- public ImageResolution getResolution() {
- return resolution;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("VideoStreamingParams - format: {");
- builder.append(format.toString());
- builder.append("}, resolution: {");
- builder.append(resolution.getResolutionHeight());
- builder.append(" , ");
- builder.append(resolution.getResolutionWidth());
- builder.append("}, frame rate {");
- builder.append(frameRate);
- builder.append("}, displayDensity{ ");
- builder.append(displayDensity);
- builder.append("}, bitrate");
- builder.append(bitrate);
- builder.append("}, IFrame interval{ ");
- builder.append(interval);
- builder.append("}");
- return builder.toString();
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/DiagLevel.java b/sdl_android/src/main/java/com/smartdevicelink/trace/DiagLevel.java
deleted file mode 100644
index 26dfdebff..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/DiagLevel.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.smartdevicelink.trace;
-
-import com.smartdevicelink.trace.enums.DetailLevel;
-import com.smartdevicelink.trace.enums.Mod;
-
-
-public class DiagLevel {
-
- static private DetailLevel[] levels;
-
- static { // this is a static c-tor!!
- levels = new DetailLevel[Mod.values().length];
- setAllLevels(DetailLevel.OFF);
- }
-
- public static void setAllLevels(DetailLevel thisDetail) {
- if (thisDetail != null) {
- for (int i = 0; i < levels.length; i++) {
- levels[i] = thisDetail; //
- }
- }
- }
-
- public static void setLevel(Mod thisMod, DetailLevel thisDetail) {
- if (thisMod != null && thisDetail != null) {
- levels[thisMod.ordinal()] = thisDetail;
- }
- }
-
- public static DetailLevel getLevel(Mod thisMod) {
- if (thisMod != null) {
- return levels[thisMod.ordinal()];
- }
- return null;
- }
-
- public static boolean isValidDetailLevel(String dtString) {
- // Assume false
- Boolean isValid = false;
-
- if (dtString != null) {
- if (dtString.equalsIgnoreCase("verbose"))
- isValid = true;
- else if (dtString.equalsIgnoreCase("terse"))
- isValid = true;
- else if (dtString.equalsIgnoreCase("off"))
- isValid = true;
- }
-
- return isValid;
- }
-
- public static DetailLevel toDetailLevel(String dtString) {
- DetailLevel dt = DetailLevel.OFF;
- if (dtString.equalsIgnoreCase("verbose"))
- dt = DetailLevel.VERBOSE;
- else if (dtString.equalsIgnoreCase("terse"))
- dt = DetailLevel.TERSE;
- return dt;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/ISTListener.java b/sdl_android/src/main/java/com/smartdevicelink/trace/ISTListener.java
deleted file mode 100644
index 3af7d5020..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/ISTListener.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.smartdevicelink.trace;
-
-public interface ISTListener {
- void logXmlMsg(String msg, String token);
-} // end-interface \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/Mime.java b/sdl_android/src/main/java/com/smartdevicelink/trace/Mime.java
deleted file mode 100644
index 799ac98f4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/Mime.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package com.smartdevicelink.trace;
-
-// Borrowed from Dave Boll's infamous SdlLinkRelay.java
-
-public class Mime {
-
- private static final String BASE_64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
- /**
- * @param str A String to encode into base64 String.
- * @return Base64 encoded String or a null String if input is null.
- */
- public static String base64Encode(String str) {
- if(str == null){
- return null;
- }
-
- String b64String = "";
- try {
- byte[] strBytes = str.getBytes("US-ASCII");
- b64String = base64Encode(strBytes);
- } catch (Exception ex) {
- // Don't care?
- }
- return b64String;
- }
-
- /**
- * @param bytesToEncode A byte array to encode into base64 String.
- * @return Base64 encoded String or a null String if input array is null.
- */
- public static String base64Encode(byte bytesToEncode[]) {
- if(bytesToEncode != null){
- return base64Encode(bytesToEncode, 0, bytesToEncode.length);
- }
- return null;
- }
-
- /**
- * @param bytesToEncode A byte array to encode into base64 String.
- * @param offset Offset to begin at
- * @param length Length to read
- * @return Base64 encoded String or a null String if input array is null or the input range is out of bounds.
- */
- public static String base64Encode(byte bytesToEncode[], int offset, int length) {
- if (bytesToEncode == null || bytesToEncode.length < length || bytesToEncode.length < offset + length) {
- return null;
- }
-
- StringBuilder sb = new StringBuilder();
-
- int idxin = 0;
- int b64idx = 0;
-
- for (idxin = offset; idxin < offset + length; idxin++) {
- switch ((idxin - offset) % 3) {
- case 0:
- b64idx = (bytesToEncode[idxin] >> 2) & 0x3f;
- break;
- case 1:
- b64idx = (bytesToEncode[idxin] >> 4) & 0x0f;
- b64idx |= ((bytesToEncode[idxin - 1] << 4) & 0x30);
- break;
- case 2:
- b64idx = (bytesToEncode[idxin] >> 6) & 0x03;
- b64idx |= ((bytesToEncode[idxin - 1] << 2) & 0x3c);
- sb.append(getBase64Char(b64idx));
- b64idx = bytesToEncode[idxin] & 0x3f;
- break;
- }
- sb.append(getBase64Char(b64idx));
- }
-
- switch ((idxin - offset) % 3) {
- case 0:
- break;
- case 1:
- b64idx = (bytesToEncode[idxin - 1] << 4) & 0x30;
- sb.append(getBase64Char(b64idx));
- sb.append("==");
- break;
- case 2:
- b64idx = ((bytesToEncode[idxin - 1] << 2) & 0x3c);
- sb.append(getBase64Char(b64idx));
- sb.append('=');
- break;
- }
-
- return sb.toString();
-
- }
-
- private static char getBase64Char(int b64idx){
- if(b64idx >= 0 && b64idx < BASE_64_CHARS.length()) {
- return BASE_64_CHARS.charAt(b64idx);
- }else{
- return 0x20;
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java b/sdl_android/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
deleted file mode 100644
index 35a8de749..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.smartdevicelink.trace;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.RPCStruct;
-
-class OpenRPCMessage extends RPCMessage {
- private OpenRPCMessage() {super("");}
- public OpenRPCMessage(RPCMessage rpcm) {
- super(rpcm);
- } // end-method
-
- public OpenRPCMessage(RPCStruct rpcs) {
- super(rpcs);
- } // end-method
-
- public String msgDump() {
- StringBuilder pd = new StringBuilder();
-
- pd.append(this.getFunctionName() + " " + this.getMessageType());
-
- msgDump(pd);
-
- return pd.toString();
- } // end-method
-
- public void msgDump(StringBuilder pd) {
- pd.append("[");
-
- dumpParams(parameters, pd);
-
- pd.append("]");
-
- return;
- } // end-method
-
- private void dumpParams(Hashtable<String, Object> ht, StringBuilder pd) {
- Iterator<String> keySet = ht.keySet().iterator();
- Object obj = null;
- String key = "";
- boolean isFirstParam = true;
-
- while (keySet.hasNext()) {
- key = (String)keySet.next();
- obj = ht.get(key);
- if (isFirstParam) {
- isFirstParam = false;
- } else {
- pd.append(", ");
- } // end-if
-
- dumpParamNode(key, obj, pd);
-
- } // end-while
- } // end-method
-
- @SuppressWarnings("unchecked")
- private void dumpParamNode(String key, Object obj, StringBuilder pd) {
-
- if (obj instanceof Hashtable) {
- pd.append("[");
- dumpParams((Hashtable<String, Object>)obj, pd);
- pd.append("]");
- } else if (obj instanceof RPCStruct) {
- pd.append("[");
- OpenRPCMessage orpcm = new OpenRPCMessage((RPCStruct)obj);
- orpcm.msgDump(pd);
- pd.append("]");
- } else if (obj instanceof List) {
- pd.append("[");
- List<?> list = (List<?>)obj;
- for (int idx=0;idx < list.size();idx++) {
- if (idx > 0) {
- pd.append(", ");
- }
- dumpParamNode(key, list.get(idx), pd);
- } // end-for
- pd.append("]");
- } else {
- pd.append("\"" + key + "\" = \"" + obj.toString() + "\"");
- }
- } // end-method
-} // end-class OpenRPCMessage
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java b/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java
deleted file mode 100644
index 2d997b1c4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/SdlTrace.java
+++ /dev/null
@@ -1,469 +0,0 @@
-package com.smartdevicelink.trace;
-
-import java.sql.Timestamp;
-
-import android.annotation.SuppressLint;
-import android.bluetooth.BluetoothDevice;
-import android.os.Build;
-import android.os.Debug;
-import android.os.Process;
-
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
-import com.smartdevicelink.protocol.enums.FrameType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.trace.enums.DetailLevel;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-import com.smartdevicelink.trace.enums.Mod;
-import com.smartdevicelink.transport.SiphonServer;
-import com.smartdevicelink.util.BitConverter;
-import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.NativeLogTool;
-
-/* This class handles the global TraceSettings as requested by the users either through the combination of the following
- 1. System defaults
- 2. Application XML config
- 3. Programmatic requests from application itself
-
- It is manifested in the <SmartDeviceLink>...</SmartDeviceLink> tags
- */
-
-@SuppressLint("DefaultLocale")
-public class SdlTrace {
- private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
-
- public static final String SYSTEM_LOG_TAG = "SdlTrace";
-
- private static long baseTics = java.lang.System.currentTimeMillis();
- private static boolean acceptAPITraceAdjustments = true;
-
- protected static ISTListener m_appTraceListener = null;
-
- ///
- /// The PUBLIC interface to SdlTrace starts here
- ///
-
-
- public static void setAcceptAPITraceAdjustments(Boolean APITraceAdjustmentsAccepted) {
- if (APITraceAdjustmentsAccepted != null) {
- acceptAPITraceAdjustments = APITraceAdjustmentsAccepted;
- }
- }
-
- public static boolean getAcceptAPITraceAdjustments() {
- return acceptAPITraceAdjustments;
- }
-
- public static void setAppTraceListener(ISTListener listener) {
- m_appTraceListener = listener;
- } // end-method
-
- public static void setAppTraceLevel(DetailLevel dt) {
- if ( dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.app, dt);
- } // end-method
-
- public static void setProxyTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.proxy, dt);
- } // end-method
-
- public static void setRpcTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.rpc, dt);
- } // end-method
-
- public static void setMarshallingTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.mar, dt);
- } // end-method
-
- public static void setProtocolTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.proto, dt);
- } // end-method
-
- public static void setTransportTraceLevel(DetailLevel dt) {
- if (dt != null && acceptAPITraceAdjustments)
- DiagLevel.setLevel(Mod.tran, dt);
- } // end-method
-
- private static String encodeTraceMessage(long timestamp, Mod module, InterfaceActivityDirection msgDirection, String msgBodyXml) {
- StringBuilder sb = new StringBuilder("<msg><dms>");
- sb.append(timestamp);
- sb.append("</dms><pid>");
- sb.append(Process.myPid());
- sb.append("</pid><tid>");
- sb.append(Thread.currentThread().getId());
- sb.append("</tid><mod>");
- sb.append(module.toString());
- sb.append("</mod>");
- if (msgDirection != InterfaceActivityDirection.None) {
- sb.append("<dir>");
- sb.append(interfaceActivityDirectionToString(msgDirection));
- sb.append("</dir>");
- } // end-if
- sb.append(msgBodyXml);
- sb.append("</msg>");
-
- return sb.toString();
- } // end-method
-
- private static String interfaceActivityDirectionToString(InterfaceActivityDirection iaDirection) {
- String str = "";
- switch (iaDirection) {
- case Receive:
- str = "rx";
- break;
- case Transmit:
- str = "tx";
- break;
- default:
- break;
- } // end-switch
- return str;
- } // end-method
-
- static String B64EncodeForXML(String data) {
- return Mime.base64Encode(data);
- // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: return Base64.encodeToString(data.getBytes(), Base64.DEFAULT);
- } // end-method
-
- public static boolean logProxyEvent(String eventText, String token) {
- if (DiagLevel.getLevel(Mod.proxy) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- String msg = SdlTrace.B64EncodeForXML(eventText);
- String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proxy, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
- return writeXmlTraceMessage(xml);
- }
-
- public static boolean logAppEvent(String eventText) {
- if (DiagLevel.getLevel(Mod.app) == DetailLevel.OFF) {
- return false;
- }
-
- long timestamp = SdlTrace.getBaseTicsDelta();
- String msg = SdlTrace.B64EncodeForXML(eventText);
- String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.app, InterfaceActivityDirection.None, "<d>" + msg + "</d>");
- return writeXmlTraceMessage(xml);
- }
-
- public static boolean logRPCEvent(InterfaceActivityDirection msgDirection, RPCMessage rpcMsg, String token) {
- DetailLevel dl = DiagLevel.getLevel(Mod.rpc);
- if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- long timestamp = SdlTrace.getBaseTicsDelta();
- String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.rpc, msgDirection, rpc2Xml(dl, rpcMsg));
- return writeXmlTraceMessage(xml);
- }
-
- private static String rpc2Xml(DetailLevel dl, RPCMessage rpcMsg) {
- StringBuilder rpcAsXml = new StringBuilder();
- rpcAsXml.append("<op>");
- rpcAsXml.append(rpcMsg.getFunctionName());
- rpcAsXml.append("</op>");
- boolean hasCorrelationID = false;
- Integer correlationID = -1;
- if (rpcMsg instanceof RPCRequest) {
- hasCorrelationID = true;
- correlationID = ((RPCRequest)rpcMsg).getCorrelationID();
- } else if (rpcMsg instanceof RPCResponse) {
- hasCorrelationID = true;
- correlationID = ((RPCResponse)rpcMsg).getCorrelationID();
- } // end-if
- if (hasCorrelationID) {
- rpcAsXml.append("<cid>");
- rpcAsXml.append(correlationID);
- rpcAsXml.append("</cid>");
- } // end-if
- rpcAsXml.append("<type>");
- rpcAsXml.append(rpcMsg.getMessageType());
- rpcAsXml.append("</type>");
- //rpcAsXml.append(newline);
-
- if (dl == DetailLevel.VERBOSE) {
- OpenRPCMessage orpcmsg = new OpenRPCMessage(rpcMsg);
- String rpcParamList = orpcmsg.msgDump();
- String msg = SdlTrace.B64EncodeForXML(rpcParamList);
- rpcAsXml.append("<d>");
- rpcAsXml.append(msg);
- rpcAsXml.append("</d>");
- } // end-if
- return rpcAsXml.toString();
- } // end-method
-
- public static boolean logMarshallingEvent(InterfaceActivityDirection msgDirection, byte[] marshalledMessage, String token) {
- DetailLevel dl = DiagLevel.getLevel(Mod.mar);
- if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- long timestamp = SdlTrace.getBaseTicsDelta();
- StringBuilder msg = new StringBuilder();
- msg.append("<sz>");
- msg.append(marshalledMessage.length);
- msg.append("</sz>");
- if (dl == DetailLevel.VERBOSE) {
- msg.append("<d>");
- msg.append(Mime.base64Encode(marshalledMessage));
- // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: msg.append(Base64.encodeToString(marshalledMessage, Base64.DEFAULT));
- msg.append("</d>");
- }
- String xml = SdlTrace.encodeTraceMessage(timestamp, Mod.mar, msgDirection, msg.toString());
- return writeXmlTraceMessage(xml);
- }
-
- public static boolean logProtocolEvent(InterfaceActivityDirection frameDirection, SdlPacket packet, int frameDataOffset, int frameDataLength, String token) {
- DetailLevel dl = DiagLevel.getLevel(Mod.proto);
- if (dl == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- StringBuffer protoMsg = new StringBuffer();
- protoMsg.append("<frame>");
- protoMsg.append(SdlTrace.getProtocolFrameHeaderInfo(packet));
- if (dl == DetailLevel.VERBOSE) {
- if (packet.getPayload() != null && frameDataLength > 0) {
- protoMsg.append("<d>");
- String bytesInfo = "";
- bytesInfo = Mime.base64Encode(packet.getPayload(), frameDataOffset, frameDataLength);
- // Base64 only available in 2.2, when SmartDeviceLink base is 2.2 use: bytesInfo = Base64.encodeToString(frameData, frameDataOffset, frameDataLength, Base64.DEFAULT);
- protoMsg.append(bytesInfo);
- protoMsg.append("</d>");
- }
- }
- protoMsg.append("</frame>");
- String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.proto, frameDirection, protoMsg.toString());
- return writeXmlTraceMessage(xml);
- }
-
- private static String getProtocolFrameType(FrameType f) {
- if (f == FrameType.Control)
- return "Control";
- else if (f == FrameType.Consecutive)
- return "Consecutive";
- else if (f == FrameType.First)
- return "First";
- else if (f == FrameType.Single)
- return "Single";
-
- return "Unknown";
- } // end-method
-
- private static String getProtocolSessionType(SessionType serviceType) {
- String s;
- if (serviceType == SessionType.RPC )
- s = "rpc";
- else if (serviceType == SessionType.BULK_DATA)
- s = "bulk";
- else
- s = "Unknown";
- return s;
- } // end-method
-
- private static String getProtocolFrameHeaderInfo(SdlPacket hdr) {
- StringBuilder sb = new StringBuilder();
- sb.append("<hdr>");
- sb.append("<ver>");
- sb.append(hdr.getVersion());
- sb.append("</ver><cmp>");
- sb.append(hdr.isEncrypted());
- sb.append("</cmp><ft>");
- sb.append(getProtocolFrameType(hdr.getFrameType()));
- sb.append("</ft><st>");
- sb.append(getProtocolSessionType(SessionType.valueOf((byte)hdr.getServiceType())));
- sb.append("</st><sid>");
- sb.append(hdr.getSessionId());
- sb.append("</sid><sz>");
- sb.append(hdr.getDataSize());
- sb.append("</sz>");
-
- int frameData = hdr.getFrameInfo();
- if (hdr.getFrameType() == FrameType.Control) {
- sb.append("<ca>");
- if (frameData == FrameDataControlFrameType.StartSession.getValue())
- sb.append("StartSession");
- else if (frameData == FrameDataControlFrameType.StartSessionACK.getValue())
- sb.append("StartSessionACK");
- else if (frameData == FrameDataControlFrameType.StartSessionNACK.getValue())
- sb.append("StartSessionNACK");
- else if (frameData == FrameDataControlFrameType.EndSession.getValue())
- sb.append("EndSession");
- sb.append("</ca>");
- } else if (hdr.getFrameType() == FrameType.Consecutive ) {
- sb.append("<fsn>");
- if (frameData == 0 )
- sb.append("lastFrame");
- else
- sb.append(String.format("%02X",frameData));
- sb.append("</fsn>");
- } else if (hdr.getFrameType() == FrameType.First ) {
- int totalSize = BitConverter.intFromByteArray(hdr.getPayload(), 0);
- int numFrames = BitConverter.intFromByteArray(hdr.getPayload(), 4);
- sb.append("<total>" + totalSize + "</total><numframes>" + numFrames + "</numframes>");
- } else if (hdr.getFrameType() == FrameType.Single ) {
- sb.append("<single/>");
- }
-
- sb.append("</hdr>");
-
- return sb.toString();
- } // end-method
-
- public static String getBTDeviceInfo(BluetoothDevice btDevice) {
- StringBuilder sb = new StringBuilder();
- sb.append("<btp>");
- String btdn = btDevice.getName();
- sb.append("<btn>");
- sb.append(SdlTrace.B64EncodeForXML(btdn));
- sb.append("</btn>");
- sb.append("<bta>" + btDevice.getAddress() + "</bta>");
- sb.append("<bts>" + btDevice.getBondState() + "</bts>");
- sb.append("</btp>");
- return sb.toString();
- } // end-method
-
- public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int byteLength, String token) {
- return logTransportEvent(preamble, transportSpecificInfoXml, msgDirection, buf, 0, byteLength, token);
- }
-
- private static void checkB64(String x, byte[] buf, int offset, int byteLength) {
- if ((x.length() % 4) != 0) {
- NativeLogTool.logWarning(SdlTrace.SYSTEM_LOG_TAG, "b64 string length (" + x.length() + ") isn't multiple of 4: buf.length=" + buf.length + ", offset=" + offset + ", len=" + byteLength);
- } // end-if
- } // end-method
-
- public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int offset, int byteLength, String token) {
- if (DiagLevel.getLevel(Mod.tran) == DetailLevel.OFF || !token.equals(SDL_LIB_TRACE_KEY)) {
- return false;
- }
-
- StringBuilder msg = new StringBuilder();
- if (transportSpecificInfoXml != null && transportSpecificInfoXml.length() > 0) {
- msg.append(transportSpecificInfoXml);
- }
- if (preamble != null && preamble.length() > 0) {
- msg.append("<desc>");
- msg.append(preamble);
- msg.append("</desc>");
- }
- if (buf != null) {
- msg.append("<sz>");
- msg.append(byteLength);
- msg.append("</sz>");
- DetailLevel dl = DiagLevel.getLevel(Mod.tran);
- if (dl == DetailLevel.VERBOSE) {
- if (buf != null && byteLength > 0) {
- msg.append("<d>");
- String bytesInfo = Mime.base64Encode(buf, offset, byteLength);
- checkB64(bytesInfo, buf, offset, byteLength);
- msg.append(bytesInfo);
- msg.append("</d>");
- }
- }
- }
- String xml = SdlTrace.encodeTraceMessage(SdlTrace.getBaseTicsDelta(), Mod.tran, msgDirection, msg.toString());
- return writeXmlTraceMessage(xml);
- }
-
- // Package-scoped
- static long getBaseTicsDelta() {
- return java.lang.System.currentTimeMillis() - getBaseTics();
- }
-
- // Package-scoped
- static long getBaseTics() {
- return baseTics;
- } // end-method
-
- public static Boolean writeMessageToSiphonServer(String info) {
- return SiphonServer.sendFormattedTraceMessage(info);
- }
-
- private static boolean writeXmlTraceMessage(String msg) {
- try {
- // Attempt to write formatted message to the Siphon
- if (false == writeMessageToSiphonServer(msg)) {
- // If writing to the Siphon fails, write to the native log
- NativeLogTool.logInfo(SdlTrace.SYSTEM_LOG_TAG, msg);
- return false;
- }
-
- ISTListener localTraceListener = m_appTraceListener;
-
- if (localTraceListener != null) {
- try {
- localTraceListener.logXmlMsg(msg, SDL_LIB_TRACE_KEY);
- } catch (Exception ex) {
- DebugTool.logError("Failure calling ISTListener: " + ex.toString(), ex);
- return false;
- }
- }
- } catch (Exception ex) {
- NativeLogTool.logError(SdlTrace.SYSTEM_LOG_TAG, "Failure writing XML trace message: " + ex.toString());
- return false;
- }
- return true;
- }
-
- // Package-scoped
- @SuppressWarnings("deprecation")
- public static String getLogHeader(String dumpReason, int seqNo) {
- final String Sep = "-";
- StringBuilder write = new StringBuilder("<?xml version=\"1.0\"?>" + "<logs>");
- write.append("<info>");
- StringBuilder infoBlock = new StringBuilder();
- String hostInfo = Build.BRAND + Sep + Build.MANUFACTURER + Sep + Build.MODEL + "(" + Build.HOST + ")";
- infoBlock.append("<host>" + SdlTrace.B64EncodeForXML(hostInfo) + "</host>");
- String osv = Build.VERSION.RELEASE + " (" + Build.VERSION.CODENAME + ")";
- infoBlock.append("<osv>" + SdlTrace.B64EncodeForXML(osv) + "</osv>");
- infoBlock.append(TraceDeviceInfo.getTelephonyHeader());
-
- long heapSize = Debug.getNativeHeapFreeSize() / 1024;
- long heapAllocated = Debug.getNativeHeapAllocatedSize() / 1024;
- infoBlock.append("<mem><hf>" + heapSize + "KB</hf><ha>" + heapAllocated + "KB</ha></mem>");
- infoBlock.append("<np>" + Runtime.getRuntime().availableProcessors() + "</np>");
- infoBlock.append("<pid>" + Process.myPid() + "</pid>");
- infoBlock.append("<tid>" + Thread.currentThread().getId() + "</tid>");
-
- // String dateStamp = (String)
- // DateFormat.format("yy-MM-dd hh:mm:ss SSS", new Timestamp(baseTics));
- Timestamp stamp = new Timestamp(SdlTrace.getBaseTics());
- String GMTtime = stamp.toGMTString().substring(0, 19);
- long fracSec = stamp.getNanos() / 1000000; // divide by a million
- String fracSecStr = String.format("%03d", fracSec);
- infoBlock.append("<utc>" + GMTtime + "." + fracSecStr + "</utc>");
-
- infoBlock.append(TraceDeviceInfo.getLogHeaderBluetoothPairs());
- infoBlock.append(getSmartDeviceLinkTraceRoot(dumpReason, seqNo));
-
- write.append(infoBlock);
-
- write.append("</info>" + "<msgs>");
- return write.toString();
- } // end-method
-
- private static String getSmartDeviceLinkTraceRoot(String dumpReason, int seqNo) {
- StringBuilder write = new StringBuilder("<SmartDeviceLinktraceroot>" + "<sequencenum>" + seqNo
- + "</sequencenum>" + "<dumpreason>" + dumpReason
- + "</dumpreason><tracelevel>");
-
- write.append("<tran>" + DiagLevel.getLevel(Mod.tran) + "</tran>");
- write.append("<proto>" + DiagLevel.getLevel(Mod.proto) + "</proto>");
- write.append("<mar>" + DiagLevel.getLevel(Mod.mar) + "</mar>");
- write.append("<rpc>" + DiagLevel.getLevel(Mod.rpc) + "</rpc>");
- write.append("<proxy>" + DiagLevel.getLevel(Mod.proxy) + "</proxy>");
- write.append("<app>" + DiagLevel.getLevel(Mod.app) + "</app>");
-
- write.append("</tracelevel>");
- write.append("</SmartDeviceLinktraceroot>");
- return write.toString();
- } // end-method
-} // end-class \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java b/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java
deleted file mode 100644
index 83c612d76..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- *
- */
-package com.smartdevicelink.trace;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import com.smartdevicelink.util.DebugTool;
-
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.telephony.TelephonyManager;
-
-/**
- * @author vvolkman
- *
- */
-public class TraceDeviceInfo {
- // http://developer.android.com/guide/topics/data/data-storage.html
-
- private static TelephonyManager m_telephonyManager;
-
- // Constructor
- public TraceDeviceInfo(TelephonyManager telephonyManager) {
- m_telephonyManager = telephonyManager;
- }
-
- public static void setTelephonyManager(TelephonyManager telephonyManager) {
- m_telephonyManager = telephonyManager;
- }
-
- public static TelephonyManager getTelephonyManager() {
- return m_telephonyManager;
- }
-
- // package scoped
- static String getTelephonyHeader() {
- // Telephony manager can tell us a few things...
- String info = "";
-
- if (m_telephonyManager != null) {
- try { // getDeviceId() requires android.permission.READ_PHONE_STATE
- info = "<deviceid>" + m_telephonyManager.getDeviceId() + "</deviceid>";
- } catch (Exception e1) {
- DebugTool.logError("Failure getting telephony device ID: " + e1.toString(), e1);
- }
-
- info = "<pt>";
- switch (m_telephonyManager.getPhoneType()) {
- case TelephonyManager.PHONE_TYPE_NONE:
- info += "NONE";
- break;
- case TelephonyManager.PHONE_TYPE_GSM:
- info += "GSM";
- break;
- case TelephonyManager.PHONE_TYPE_CDMA:
- info += "CDMA";
- break;
- default:
- info += "UNKNOWN";
- } // end-switch
-
- info += "</pt>" + "<nt>";
-
- switch (m_telephonyManager.getNetworkType()) {
- case TelephonyManager.NETWORK_TYPE_UNKNOWN:
- info += "UKNOWN";
- break;
- case TelephonyManager.NETWORK_TYPE_GPRS:
- info += "GPRS";
- break;
- case TelephonyManager.NETWORK_TYPE_EDGE:
- info += "EDGE";
- break;
- case TelephonyManager.NETWORK_TYPE_UMTS:
- info += "UMTS";
- break;
- case TelephonyManager.NETWORK_TYPE_HSDPA:
- info += "HSDPA";
- break;
- case TelephonyManager.NETWORK_TYPE_HSUPA:
- info += "HSUPA";
- break;
- case TelephonyManager.NETWORK_TYPE_HSPA:
- info += "HSPA";
- break;
- case TelephonyManager.NETWORK_TYPE_CDMA:
- info += "CDMA";
- break;
- case TelephonyManager.NETWORK_TYPE_EVDO_0:
- info += "EVDO_O";
- break;
- case TelephonyManager.NETWORK_TYPE_EVDO_A:
- info += "EVDO_A";
- break;
- case TelephonyManager.NETWORK_TYPE_1xRTT:
- info += "1xRTT";
- break;
- default:
- info += "UNKNOWN";
- break;
- } // end-switch
-
- info += "</nt>";
- } // end-if
- return info;
- } // end-method
-
- // Package scoped
- static String getLogHeaderBluetoothPairs() {
- Set<BluetoothDevice> btDevices = BluetoothAdapter.getDefaultAdapter()
- .getBondedDevices();
-
- StringBuilder write = new StringBuilder("<btpairs>");
- Iterator<BluetoothDevice> iter = btDevices.iterator();
- while (iter.hasNext()) {
- write.append(SdlTrace.getBTDeviceInfo(iter.next()));
- }
- write.append("</btpairs>");
-
- return write.toString();
- } // end-method
-} // end-class \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/enums/DetailLevel.java b/sdl_android/src/main/java/com/smartdevicelink/trace/enums/DetailLevel.java
deleted file mode 100644
index bd213679d..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/enums/DetailLevel.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.smartdevicelink.trace.enums;
-
-
-public enum DetailLevel {
- OFF,
- TERSE,
- VERBOSE;
-
- public static DetailLevel valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/enums/InterfaceActivityDirection.java b/sdl_android/src/main/java/com/smartdevicelink/trace/enums/InterfaceActivityDirection.java
deleted file mode 100644
index 0865d2e32..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/enums/InterfaceActivityDirection.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.smartdevicelink.trace.enums;
-
-public enum InterfaceActivityDirection {
- Transmit,
- Receive,
- None;
-
- public static InterfaceActivityDirection valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/trace/enums/Mod.java b/sdl_android/src/main/java/com/smartdevicelink/trace/enums/Mod.java
deleted file mode 100644
index b363473b2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/trace/enums/Mod.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.smartdevicelink.trace.enums;
-
-public enum Mod {
- tran,
- proto,
- mar,
- rpc,
- app,
- proxy;
-
- public static Mod valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-}; \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java b/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java
deleted file mode 100644
index 74ca18478..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransport.java
+++ /dev/null
@@ -1,554 +0,0 @@
-package com.smartdevicelink.transport;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-import java.util.UUID;
-
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothServerSocket;
-import android.bluetooth.BluetoothSocket;
-import android.os.Build;
-import android.os.Build.VERSION;
-
-import com.smartdevicelink.SdlConnection.SdlConnection;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.trace.SdlTrace;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.util.DebugTool;
-
-/**
- * Bluetooth Transport Implementation. This transport advertises its existence to SDL by publishing an SDP record and waiting for an incoming connection from SDL. Connection is verified by checking for the SDL UUID. For more detailed information please refer to the <a href="#bluetoothTransport">Bluetooth Transport Guide</a>.
- *
- */
-@Deprecated
-public class BTTransport extends SdlTransport {
- //936DA01F9ABD4D9D80C702AF85C822A8
- private final static UUID SDL_V4_MOBILE_APPLICATION_SVC_CLASS = new UUID(0x936DA01F9ABD4D9DL, 0x80C702AF85C822A8L);
-
- private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
-
- private static final int READ_BUFFER_SIZE = 4096;
-
- private BluetoothAdapter _adapter = null;
- private BluetoothSocket _activeSocket = null;
- private UUID _listeningServiceUUID = SDL_V4_MOBILE_APPLICATION_SVC_CLASS;
- private BluetoothAdapterMonitor _bluetoothAdapterMonitor = null;
- private TransportReaderThread _transportReader = null;
- private OutputStream _output = null;
- private BluetoothServerSocket _serverSocket = null;
-
- private String sComment = "";
- private boolean bKeepSocketActive = true;
-
- // Boolean to monitor if the transport is in a disconnecting state
- private boolean _disconnecting = false;
-
- private final Object DISCONNECT_LOCK = new Object();
-
- public BTTransport(ITransportListener transportListener) {
- super(transportListener);
- } // end-ctor
-
- public BTTransport(ITransportListener transportListener, boolean bKeepSocket) {
- super(transportListener);
- bKeepSocketActive = bKeepSocket;
- } // end-ctor
-
- @Deprecated
- public BluetoothSocket getBTSocket(BluetoothServerSocket bsSocket){
-
- if(bsSocket == null || Build.VERSION.SDK_INT > Build.VERSION_CODES.O) { //Reflection is no longer allowed on SDK classes)
- return null;
- }
-
- Field[] f = bsSocket.getClass().getDeclaredFields();
-
- @SuppressWarnings("unused")
- int channel = -1;
-
- BluetoothSocket mySocket = null;
-
- for (Field field : f) {
- if(field.getName().equals("mSocket")){
- field.setAccessible(true);
- try {
-
- mySocket = (BluetoothSocket) field.get(bsSocket);
- return mySocket;
- //channel = field.getInt(bsSocket);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- field.setAccessible(false);
- }
- }
-
- return null;
- }
-
- @Deprecated
- public int getChannel(BluetoothSocket bsSocket){
-
- int channel = -1;
- if (bsSocket == null || Build.VERSION.SDK_INT > Build.VERSION_CODES.O){ //Reflection is no longer allowed on SDK classes
- return channel;
- }
-
- Field[] f = bsSocket.getClass().getDeclaredFields();
-
- for (Field field : f) {
- if(field.getName().equals("mPort")){
- field.setAccessible(true);
- try {
-
-
- channel = field.getInt(bsSocket);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- field.setAccessible(false);
- }
- }
-
- return channel;
- }
-
-
- /* private BluetoothServerSocket getBluetoothServerSocket() throws IOException {
- BluetoothServerSocket tmp;
-
- BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
-
-
- try {
- // compatibility with pre SDK 10 devices
- Method listener = mBluetoothAdapter.getClass().getMethod(
- "listenUsingRfcommWithServiceRecord", String.class, UUID.class);
- tmp = (BluetoothServerSocket) listener.invoke(mBluetoothAdapter, "SdlProxy", _listeningServiceUUID);
-
- } catch (NoSuchMethodException e) {
-
- throw new IOException(e);
- } catch (InvocationTargetException e) {
- throw new IOException(e);
- } catch (IllegalAccessException e) {
- throw new IOException(e);
- }
-
- return tmp;
- }*/
-
-
- public void openConnection () throws SdlException {
- if (_serverSocket != null) {
- return;
- }
-
- // Get the device's default Bluetooth Adapter
- _adapter = BluetoothAdapter.getDefaultAdapter();
-
-
- // Test if Adapter exists
- if (_adapter == null) {
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("No Bluetooth adapter found. Bluetooth adapter must exist to communicate with SDL.", SdlExceptionCause.BLUETOOTH_ADAPTER_NULL);
- }
-
- // Test if Bluetooth is enabled
- try {
- if (!_adapter.isEnabled()) {
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("Bluetooth adapter must be enabled to instantiate a SdlProxy object.", SdlExceptionCause.BLUETOOTH_DISABLED);
- }
- } catch (SecurityException e) {
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("Insufficient permissions to interact with the Bluetooth Adapter.", SdlExceptionCause.PERMISSION_DENIED);
- }
-
- // Start BluetoothAdapterMonitor to ensure the Bluetooth Adapter continues to be enabled
- _bluetoothAdapterMonitor = new BluetoothAdapterMonitor(_adapter);
-
- try {
- _serverSocket = _adapter.listenUsingRfcommWithServiceRecord("SdlProxy", _listeningServiceUUID);
- BluetoothSocket mySock = getBTSocket(_serverSocket);
- int iSocket = getChannel(mySock);
-
- sComment = "Accepting Connections on SDP Server Port Number: " + iSocket + "\r\n";
- sComment += "Keep Server Socket Open: " + bKeepSocketActive;
- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O && iSocket < 0)
- {
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("Could not open connection to SDL.", SdlExceptionCause.BLUETOOTH_SOCKET_UNAVAILABLE);
- }
- } catch (IOException e) {
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("Could not open connection to SDL.", SdlExceptionCause.BLUETOOTH_SOCKET_UNAVAILABLE);
-
- } catch (Exception ex) {
-
- // Test to determine if the bluetooth has been disabled since last check
- if (!_adapter.isEnabled()) {
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("Bluetooth adapter must be on to instantiate a SdlProxy object.", SdlExceptionCause.BLUETOOTH_DISABLED);
- }
-
- if(ex instanceof SdlException && ((SdlException) ex).getSdlExceptionCause() == SdlExceptionCause.BLUETOOTH_SOCKET_UNAVAILABLE) {
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("Could not open connection to SDL.", SdlExceptionCause.BLUETOOTH_SOCKET_UNAVAILABLE);
-
- }
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("Could not open connection to SDL.", ex, SdlExceptionCause.SDL_CONNECTION_FAILED);
- }
-
- // Test to ensure serverSocket is not null
- if (_serverSocket == null) {
- SdlConnection.enableLegacyMode(false, null);
- throw new SdlException("Could not open connection to SDL.", SdlExceptionCause.SDL_CONNECTION_FAILED);
- }
-
- SdlTrace.logTransportEvent("BTTransport: listening for incoming connect to service ID " + _listeningServiceUUID, null, InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
-
- // Setup transportReader thread
- _transportReader = new TransportReaderThread();
- _transportReader.setName("TransportReader");
- _transportReader.setDaemon(true);
- _transportReader.start();
-
- // Initialize the SiphonServer
- if (SiphonServer.getSiphonEnabledStatus()) {
- SiphonServer.init();
- }
-
- } // end-method
-
- public void disconnect() {
- disconnect(null, null);
- }
-
- /**
- * Destroys the transport between SDL and the mobile app
- *
- * @param msg
- * @param ex
- */
- private void disconnect(String msg, Exception ex) {
- synchronized(DISCONNECT_LOCK) {
- // If already disconnecting, return
- if (_disconnecting) {
- // No need to recursively call
- return;
- }
- _disconnecting = true;
- }
-
- String disconnectMsg = (msg == null ? "" : msg);
- if (ex != null) {
- disconnectMsg += ", " + ex.toString();
- } // end-if
-
- SdlTrace.logTransportEvent("BTTransport.disconnect: " + disconnectMsg, null, InterfaceActivityDirection.Transmit, null, 0, SDL_LIB_TRACE_KEY);
-
- try {
- if (_transportReader != null) {
- _transportReader.halt();
- _transportReader = null;
- }
- } catch (Exception e) {
- DebugTool.logError("Failed to stop transport reader thread.", e);
- } // end-catch
-
- try {
- if (_bluetoothAdapterMonitor != null) {
- _bluetoothAdapterMonitor.halt();
- _bluetoothAdapterMonitor = null;
- }
- } catch (Exception e) {
- DebugTool.logError("Failed to stop adapter monitor thread.", e);
- }
-
- try {
- if (_serverSocket != null) {
- _serverSocket.close();
- _serverSocket = null;
- }
- } catch (Exception e) {
- DebugTool.logError("Failed to close serverSocket", e);
- } // end-catch
-
- try {
- if (_activeSocket != null) {
- _activeSocket.close();
- _activeSocket = null;
- }
- } catch (Exception e) {
- DebugTool.logError("Failed to close activeSocket", e);
- } // end-catch
-
-
-
- try {
- if (_output != null) {
- _output.close();
- _output = null;
- }
- } catch (Exception e) {
- DebugTool.logError("Failed to close output stream", e);
- } // end-catch
-
- if (ex == null) {
- // This disconnect was not caused by an error, notify the proxy that
- // the trasport has been disconnected.
- handleTransportDisconnected(msg);
- } else {
- // This disconnect was caused by an error, notify the proxy
- // that there was a transport error.
- handleTransportError(msg, ex);
- }
- _disconnecting = false;
- } // end-method
-
-
- /**
- * Sends data over the transport. Takes a byte array and transmits data provided starting at the
- * offset and of the provided length to fragment transmission.
- */
- public boolean sendBytesOverTransport(SdlPacket packet) {
- boolean sendResult = false;
- try {
- byte[] msgBytes = packet.constructPacket();
- _output.write(msgBytes, 0, msgBytes.length);
- sendResult = true;
- } catch (Exception ex) {
- DebugTool.logError("Error writing to Bluetooth socket: " + ex.toString(), ex);
- handleTransportError("Error writing to Bluetooth socket:", ex);
- sendResult = false;
- } // end-catch
- return sendResult;
- } // end-method
-
-
-
- private class TransportReaderThread extends Thread {
- private Boolean isHalted = false;
- SdlPsm psm;
- int bytesRead = 0;
- byte[] buffer = new byte[READ_BUFFER_SIZE];
- byte currentByte = -1;
- boolean stateProgress = false;
-
- private InputStream _input = null;
-
-
- public TransportReaderThread(){
- psm = new SdlPsm();
- }
- public void halt() {
- isHalted = true;
- }
-
- private void acceptConnection() {
- SdlTrace.logTransportEvent("BTTransport: Waiting for incoming RFCOMM connect", "", InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
-
- try {
- // Blocks thread until connection established.
- _activeSocket = _serverSocket.accept();
-
- // If halted after serverSocket.accept(), then return immediately
- if (isHalted) {
- return;
- }
-
- // Log info of the connected device
- BluetoothDevice btDevice = _activeSocket.getRemoteDevice();
- String btDeviceInfoXml = SdlTrace.getBTDeviceInfo(btDevice);
- SdlTrace.logTransportEvent("BTTransport: RFCOMM Connection Accepted", btDeviceInfoXml, InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
-
- _output = _activeSocket.getOutputStream();
- _input = _activeSocket.getInputStream();
-
- handleTransportConnected();
-
- } catch (Exception e) {
- if (!isHalted) {
- // Only call disconnect if the thread has not been halted
- clearInputStream();
- // Check to see if Bluetooth was disabled
- if (_adapter != null && !_adapter.isEnabled()) {
- disconnect("Bluetooth Adapater has been disabled.", new SdlException("Bluetooth adapter must be enabled to instantiate a SdlProxy object.", e, SdlExceptionCause.BLUETOOTH_DISABLED));
- } else {
- disconnect("Failed to accept connection", e);
- }
- }
- } finally {
-
- if (!bKeepSocketActive && _serverSocket != null && !isHalted && (VERSION.SDK_INT > 0x00000010 /*VERSION_CODES.JELLY_BEAN*/) ) {
- try {
- _serverSocket.close();
- } catch (IOException e) {
- //do nothing
- }
- _serverSocket = null;
- }
- }
- }
-
- private void readFromTransport() {
- try {
- try {
- bytesRead = _input.read(buffer);
- } catch (Exception e) {
- if (!isHalted) {
- // Only call disconnect if the thread has not been halted
- clearInputStream();
- // Check to see if Bluetooth was disabled
- if (_adapter != null && !_adapter.isEnabled()) {
- disconnect("Bluetooth Adapater has been disabled.", new SdlException("Bluetooth adapter must be enabled to instantiate a SdlProxy object.", e, SdlExceptionCause.BLUETOOTH_DISABLED));
- } else {
- disconnect("Failed to read from Bluetooth transport.", e);
- }
- }
- return;
- } // end-catch
-
- for (int i = 0; i < bytesRead; i++) {
- currentByte = buffer[i];
- stateProgress = psm.handleByte(currentByte);
- if(!stateProgress){//We are trying to weed through the bad packet info until we get something
- //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
- psm.reset();
- if(currentByte == -1){ //If we read a -1 and the psm didn't move forward, then there is a problem
- if (!isHalted) {
- // Only call disconnect if the thread has not been halted
- DebugTool.logError("End of stream reached!");
- disconnect("End of stream reached.", null);
- }
- }
- }
- if(psm.getState() == SdlPsm.FINISHED_STATE){
- //Log.d(TAG, "Packet formed, sending off");
- handleReceivedPacket((SdlPacket)psm.getFormedPacket());
- //We put a trace statement in the message read so we can avoid all the extra bytes
- psm.reset();
- }
- }
-
- } catch (Exception excp) {
- if (!isHalted) {
- // Only call disconnect if the thread has not been halted
- clearInputStream();
- String errString = "Failure in BTTransport reader thread: " + excp.toString();
- DebugTool.logError(errString, excp);
- disconnect(errString, excp);
- }
- return;
- } // end-catch
- } // end-method
-
- private void clearInputStream(){
- try {
- if (_input != null) {
- _input.close();
- _input = null;
- }
- } catch (Exception e) {
- DebugTool.logError("Failed to close input stream", e);
- } // end-catch
- }
-
- public void run() {
- // acceptConnection blocks until the connection has been accepted
- acceptConnection();
- psm.reset();
- while (!isHalted) {
- readFromTransport();
- }
- }
- }
-
- private class BluetoothAdapterMonitor {
- private boolean _isHalted = false;
- private BluetoothAdapter _bluetoothAdapter = null;
- private final String THREAD_NAME = "BluetoothAdapterMonitor";
- private Thread _bluetoothAdapterMonitorThread = null;
-
- public BluetoothAdapterMonitor(BluetoothAdapter bluetoothAdapter) {
- if (bluetoothAdapter == null) {
- throw new IllegalArgumentException("BluetoothAdapter cannot be null.");
- }
-
- // Set the bluetooth adapter
- _bluetoothAdapter = bluetoothAdapter;
-
- _bluetoothAdapterMonitorThread = new Thread(new Runnable() {
- @Override
- public void run() {
- while (!_isHalted) {
- checkIfBluetoothAdapterDisabled();
- try {
- Thread.sleep(15000);
- } catch (InterruptedException e) {
- // Break if interrupted
- break;
- }
- }
- }
- });
- _bluetoothAdapterMonitorThread.setName(THREAD_NAME);
- _bluetoothAdapterMonitorThread.setDaemon(true);
- _bluetoothAdapterMonitorThread.start();
- }
-
- private void checkIfBluetoothAdapterDisabled() {
- if (_bluetoothAdapter != null && !_bluetoothAdapter.isEnabled()) {
- // Bluetooth adapter has been disabled, disconnect the transport
- disconnect("Bluetooth adapter has been disabled.",
- new SdlException("Bluetooth adapter must be enabled to instantiate a SdlProxy object.", SdlExceptionCause.BLUETOOTH_DISABLED));
- }
- }
-
- public void halt() {
- _isHalted = true;
- _bluetoothAdapterMonitorThread.interrupt();
- }
- }
-
- /**
- * Overridden abstract method which returns specific type of this transport.
- *
- * @return Constant value - TransportType.BLUETOOTH.
- *
- * @see TransportType
- */
- public TransportType getTransportType() {
- return TransportType.BLUETOOTH;
- }
-
- @Override
- public String getBroadcastComment() {
- return sComment;
- }
-
- @Override
- protected void handleTransportDisconnected(String info) {
- SdlConnection.enableLegacyMode(false, null);
- super.handleTransportDisconnected(info);
- }
-
- @Override
- protected void handleTransportError(String message, Exception ex) {
- SdlConnection.enableLegacyMode(false, null);
- super.handleTransportError(message, ex);
- }
-
-} // end-class
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java b/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java
deleted file mode 100644
index 0f2c4a7e5..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.smartdevicelink.transport;
-
-import com.smartdevicelink.transport.enums.TransportType;
-
-/**
- * Container of Bluetooth transport specific configuration.
- */
-@Deprecated
-public final class BTTransportConfig extends BaseTransportConfig {
-
- private boolean bKeepSocketActive = true;
-
- /**
- * Overridden abstract method which returns specific type of this transport configuration.
- *
- * @return Constant value TransportType.BLUETOOTH.
- *
- * @see TransportType
- */
- public TransportType getTransportType() {
- return TransportType.BLUETOOTH;
- }
-
- public BTTransportConfig() {
- this(true);
- }
-
- public BTTransportConfig(boolean shareConnection) {
- super.shareConnection = shareConnection;
- }
-
- public void setKeepSocketActive(boolean bValue) {
- bKeepSocketActive = bValue;
- }
-
- public boolean getKeepSocketActive() {
- return bKeepSocketActive;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java b/sdl_android/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
deleted file mode 100644
index 4b7fe79be..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.transport;
-
-import com.smartdevicelink.transport.enums.TransportType;
-
-/**
- * Defines base abstract class for transport configurations.
- */
-public abstract class BaseTransportConfig {
-
- protected boolean shareConnection = true;
- protected int iHeartBeatTimeout = Integer.MAX_VALUE;
- /**
- * Gets transport type for this transport configuration.
- *
- * @return One of {@link TransportType} enumeration values that represents type of this transport configuration.
- */
- public abstract TransportType getTransportType();
-
- /**
- * Indicate whether the application want to share connection with others.
- *
- * @return
- */
- public boolean shareConnection() {
- return shareConnection;
- }
-
- public int getHeartBeatTimeout() {
- return iHeartBeatTimeout;
- }
-
- public void setHeartBeatTimeout(int iTimeout) {
- iHeartBeatTimeout = iTimeout;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/ITransportListener.java b/sdl_android/src/main/java/com/smartdevicelink/transport/ITransportListener.java
deleted file mode 100644
index b4c4a9b33..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/ITransportListener.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.smartdevicelink.transport;
-
-import com.smartdevicelink.protocol.SdlPacket;
-
-public interface ITransportListener {
- // Called to indicate and deliver a packet received from transport
- void onTransportPacketReceived(SdlPacket packet);
-
- // Called to indicate that transport connection was established
- void onTransportConnected();
-
- // Called to indicate that transport was disconnected (by either side)
- void onTransportDisconnected(String info);
-
- // Called to indicate that some error occurred on the transport
- void onTransportError(String info, Exception e);
-} // end-interface \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java b/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
deleted file mode 100644
index dd66784f7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
+++ /dev/null
@@ -1,870 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Note: This file has been modified from its original form.
- */
-
-package com.smartdevicelink.transport;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.UUID;
-
-import android.annotation.SuppressLint;
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothServerSocket;
-import android.bluetooth.BluetoothSocket;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.util.Log;
-
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-/**
- * This class does all the work for setting up and managing Bluetooth
- * connections with other devices. It has a thread that listens for
- * incoming connections, a thread for connecting with a device, and a
- * thread for performing data transmissions when connected.
- *
- * @author Joey Grover
- *
- */
-public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
- //finals
- private static final String TAG = "Bluetooth Transport";
- private static final UUID SERVER_UUID= new UUID(0x936DA01F9ABD4D9DL, 0x80C702AF85C822A8L);
- // Name for the SDP record when creating server socket
- private static final String NAME_SECURE =" SdlRouterService";
- // Key names received from the BluetoothSerialServer Handler
- private static final long MS_TILL_TIMEOUT = 2500;
- private static final int READ_BUFFER_SIZE = 4096;
- private final Object THREAD_LOCK = new Object();;
-
- protected static final String SHARED_PREFS = "sdl.bluetoothprefs";
-
-
- // Member fields
- private final BluetoothAdapter mAdapter = BluetoothAdapter.getDefaultAdapter();
- private AcceptThread mSecureAcceptThread;
- private ConnectThread mConnectThread;
- private ConnectedThread mConnectedThread;
- private ConnectedWriteThread mConnectedWriteThread;
- private int mBluetoothLevel = 0;
- Handler timeOutHandler;
- Runnable socketRunable;
- boolean keepSocketAlive = true;
-
- /**
- * Constructor. Prepares a new BluetoothChat session.
- * @param handler A Handler to send messages back to the UI Activity
- */
- public MultiplexBluetoothTransport(Handler handler) {
- super(handler, TransportType.BLUETOOTH);
- //This will keep track of which method worked last night
- mBluetoothLevel = SdlRouterService.getBluetoothPrefs(SHARED_PREFS);
- }
-
-
- /**
- * This method has been deprecated. It will return an instance of MultiplexBluetoothTransport but <b>should not</b> be used.
- * @param handler for receiving status messages from the transport
- * @return an instance of MultiplexBluetoothTransport
- * @deprecated
- */
- @Deprecated
- public synchronized static MultiplexBluetoothTransport getBluetoothSerialServerInstance(Handler handler){
- return new MultiplexBluetoothTransport(handler);
- }
- /**
- * This method has been deprecated. It will return an instance of MultiplexBluetoothTransport but <b>should not</b> be used.
- * @param handler for receiving status messages from the transport
- * @param keepSocketAlive Flag for keeping the socket alive
- * @return an instance of MultiplexBluetoothTransport
- * @deprecated
- */
- @Deprecated
- public synchronized static MultiplexBluetoothTransport getBluetoothSerialServerInstance(Handler handler, boolean keepSocketAlive){
- MultiplexBluetoothTransport transport = new MultiplexBluetoothTransport(handler);
- transport.setKeepSocketAlive(keepSocketAlive);
- return transport;
- }
-
- /**
- * This method has been deprecated. <b>It will always return null.</b>
- * @return always null
- * @deprecated
- */
- @Deprecated
- public synchronized static MultiplexBluetoothTransport getBluetoothSerialServerInstance(){
- return null;
- }
-
- //These methods are used so we can have a semi-static reference to the Accept Thread (Static reference inherited by housing class)
- private synchronized AcceptThread getAcceptThread(){
- return mSecureAcceptThread;
- }
- private synchronized void setAcceptThread(AcceptThread aThread){
- mSecureAcceptThread = aThread;
- }
- protected synchronized void setStateManually(int state){
- //Log.d(TAG, "Setting state from: " +mState + " to: " +state);
- mState = state;
- }
-
- /**
- * Return the current connection state. */
- public synchronized int getState() {
- return mState;
- }
-
- public void setKeepSocketAlive(boolean keepSocketAlive){
- this.keepSocketAlive = keepSocketAlive;
- }
-
- /**
- * Start the chat service. Specifically start AcceptThread to begin a
- * session in listening (server) mode. Called by the Activity onResume() */
- public synchronized void start() {
- //Log.d(TAG, "Starting up Bluetooth Server to Listen");
- // Cancel any thread attempting to make a connection
- if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
-
- // Cancel any thread currently running a connection
- if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
- if (mConnectedWriteThread != null) {mConnectedWriteThread.cancel(); mConnectedWriteThread = null;}
-
-
-
- // Start the thread to listen on a BluetoothServerSocket
- if (getAcceptThread() == null
- && mAdapter != null
- && mAdapter.isEnabled()) {
- //Log.d(TAG, "Secure thread was null, attempting to create new");
- setAcceptThread(new AcceptThread(true));
- if(getAcceptThread()!=null){
- setState(STATE_LISTEN);
- getAcceptThread().start();
- }
- }
- }
-
- /**
- * Start the ConnectThread to initiate a connection to a remote device.
- * @param device The BluetoothDevice to connect
- */
- public synchronized void connect(BluetoothDevice device) {
- // Cancel any thread attempting to make a connection
- if (mState == STATE_CONNECTING) {
- if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}
- }
-
- // Cancel any thread currently running a connection
- if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}
- if (mConnectedWriteThread != null) {mConnectedWriteThread.cancel(); mConnectedWriteThread = null;}
-
-
- // Cancel the accept thread because we only want to connect to one device
- if (mSecureAcceptThread != null) {
- mSecureAcceptThread.cancel();
- mSecureAcceptThread = null;
- }
-
- // Start the thread to connect with the given device
- mConnectThread = new ConnectThread(device);
- mConnectThread.start();
- setState(STATE_CONNECTING);
- }
-
- /**
- * Start the ConnectedThread to begin managing a Bluetooth connection
- * @param socket The BluetoothSocket on which the connection was made
- * @param device The BluetoothDevice that has been connected
- */
- public synchronized void connected(BluetoothSocket socket, BluetoothDevice device) {
- // Cancel the thread that completed the connection
- if (mConnectThread != null) {
- mConnectThread.cancel();
- mConnectThread = null;
- }
-
- // Cancel any thread currently running a connection
- if (mConnectedThread != null) {
- mConnectedThread.cancel();
- mConnectedThread = null;
- }
- if (mConnectedWriteThread != null) {
- mConnectedWriteThread.cancel();
- mConnectedWriteThread = null;
- }
- // Cancel the accept thread because we only want to connect to one device
- if (!keepSocketAlive && mSecureAcceptThread != null) {
- mSecureAcceptThread.cancel();
- mSecureAcceptThread = null;
- }
-
- // Start the thread to manage the connection and perform transmissions
- mConnectedThread = new ConnectedThread(socket);
- mConnectedThread.start();
- // Start the thread to manage the connection and perform transmissions
- mConnectedWriteThread = new ConnectedWriteThread(socket);
- mConnectedWriteThread.start();
-
- //Store a static name of the device that is connected.
- if(device != null){
- connectedDeviceName = device.getName();
- connectedDeviceAddress = device.getAddress();
- if(connectedDeviceAddress!=null){
- //Update the transport record with the address
- transportRecord = new TransportRecord(transportType, connectedDeviceAddress);
- }
- }
-
- // Send the name of the connected device back to the UI Activity
- Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_DEVICE_NAME);
- Bundle bundle = new Bundle();
- if(connectedDeviceName != null) {
- bundle.putString(DEVICE_NAME, connectedDeviceName);
- bundle.putString(DEVICE_ADDRESS, connectedDeviceAddress);
- }
- msg.setData(bundle);
- handler.sendMessage(msg);
- setState(STATE_CONNECTED);
- }
-
- /**
- * Stop all threads
- */
- public synchronized void stop() {
- stop(STATE_NONE);
- }
- protected synchronized void stop(int stateToTransitionTo) {
- //Log.d(TAG, "Attempting to close the bluetooth serial server");
- if (mConnectThread != null) {
- mConnectThread.cancel();
- mConnectThread = null;
- }
-
- if (mConnectedThread != null) {
- mConnectedThread.cancel();
- mConnectedThread = null;
- }
- if (mConnectedWriteThread != null) {mConnectedWriteThread.cancel(); mConnectedWriteThread = null;}
-
- if (mSecureAcceptThread != null) {
- mSecureAcceptThread.cancel();
- mSecureAcceptThread = null;
- }
-
- setState(stateToTransitionTo);
- }
-
-
- /**
- * Write to the ConnectedThread in an unsynchronized manner
- * @param out The bytes to write
- * @see ConnectedThread#write(byte[])
- */
- public void write(byte[] out, int offset, int count) {
- // Create temporary object
- ConnectedWriteThread r;
- // Synchronize a copy of the ConnectedThread
- synchronized (this) {
- if (mState != STATE_CONNECTED) return;
- r = mConnectedWriteThread;
- //r.write(out,offset,count);
- }
- // Perform the write unsynchronized
- r.write(out,offset,count);
- }
-
- /**
- * Indicate that the connection attempt failed and notify the UI Activity.
- */
- private void connectionFailed() {
- // Send a failure message back to the Activity
- Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);
- Bundle bundle = new Bundle();
- bundle.putString(LOG, "Unable to connect device");
- msg.setData(bundle);
- handler.sendMessage(msg);
-
- // Start the service over to restart listening mode
- // BluetoothSerialServer.this.start();
- }
-
- /**
- * Indicate that the connection was lost and notify the UI Activity.
- */
- private void connectionLost() {
- // Send a failure message back to the Activity
- Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);
- Bundle bundle = new Bundle();
- bundle.putString(LOG, "Device connection was lost");
- msg.setData(bundle);
- handler.sendMessage(msg);
- stop();
-
- }
-
- private void timerDelayRemoveDialog(final BluetoothSocket sock){
- timeOutHandler = new Handler();
- socketRunable = new Runnable() {
- public void run() {
- //Log.e(TAG, "BLUETOOTH SOCKET CONNECT TIMEOUT - ATTEMPT TO CLOSE SOCKET");
- try {
- sock.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- };
- timeOutHandler.postDelayed(socketRunable, MS_TILL_TIMEOUT);
- }
-
-
-
- /**
- * This thread runs while listening for incoming connections. It behaves
- * like a server-side client. It runs until a connection is accepted
- * (or until cancelled).
- */
- private class AcceptThread extends Thread {
- // The local server socket
- private String mSocketType;
- final BluetoothServerSocket mmServerSocket;
-
- @SuppressLint("NewApi")
- public AcceptThread(boolean secure) {
- synchronized(THREAD_LOCK){
- //Log.d(TAG, "Creating an Accept Thread");
- BluetoothServerSocket tmp = null;
- mSocketType = secure ? "Secure":"Insecure";
- // Create a new listening server socket
- try {
- if (secure) {
- tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME_SECURE, SERVER_UUID);
- }
- } catch (IOException e) {
- //Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e);
- //Let's try to shut down this thead
- }catch(SecurityException e2){
- //Log.e(TAG, "<LIVIO> Security Exception in Accept Thread - "+e2.toString());
- interrupt();
- }
- mmServerSocket = tmp;
- //Should only log on debug
- //BluetoothSocket mySock = getBTSocket(mmServerSocket);
- //Log.d(TAG, "Accepting Connections on SDP Server Port Number: " + getChannel(mySock) + "\r\n");
- }
- }
-
- public void run() {
- synchronized(THREAD_LOCK){
- Log.d(TAG, "Socket Type: " + mSocketType +
- " BEGIN mAcceptThread" + this);
- setName("AcceptThread" + mSocketType);
-
- BluetoothSocket socket = null;
- int listenAttempts = 0;
-
- // Listen to the server socket if we're not connected
- while (mState != STATE_CONNECTED) {
- try {
- if(listenAttempts>=5){
- Log.e(TAG, "Complete failure in attempting to listen for Bluetooth connection, erroring out.");
- MultiplexBluetoothTransport.this.stop(STATE_ERROR);
- return;
- }
- listenAttempts++;
- Log.d(TAG, "SDL Bluetooth Accept thread is running.");
-
- // This is a blocking call and will only return on a
- // successful connection or an exception
- if(mmServerSocket!=null){
-
- socket = mmServerSocket.accept();
-
- }
- else{
- Log.e(TAG, "Listening Socket was null, stopping the bluetooth serial server.");
- MultiplexBluetoothTransport.this.stop(STATE_ERROR);
- return;
- }
- } catch (IOException e) {
- Log.e(TAG, "Socket Type: " + mSocketType + "accept() failed");
- MultiplexBluetoothTransport.this.stop(STATE_ERROR);
- return;
- }
-
- // If a connection was accepted
- if (socket != null) {
- synchronized (MultiplexBluetoothTransport.this) {
- switch (mState) {
- case STATE_LISTEN:
- case STATE_CONNECTING:
- // Situation normal. Start the connected thread.
- connected(socket, socket.getRemoteDevice());
-
- break;
- case STATE_NONE:
- case STATE_CONNECTED:
- // Either not ready or already connected. Terminate new socket.
- try {
- Log.d(TAG, "Close unwanted socket");
- socket.close();
- } catch (IOException e) {
- Log.e(TAG, "Could not close unwanted socket", e);
- }
- break;
- }
- }
- }
- }
- Log.d(TAG, mState + " END mAcceptThread, socket Type: " + mSocketType);
- }
- }
-
- public synchronized void cancel() {
- Log.d(TAG, mState + " Socket Type " + mSocketType + " cancel ");
- try {
- if(mmServerSocket != null){
- mmServerSocket.close();
- }
-
- } catch (IOException e) {
- Log.e(TAG, mState + " Socket Type " + mSocketType + " close() of server failed "+ e.getStackTrace());
- }
- }
- }
-
-
- /**
- * This thread runs while attempting to make an outgoing connection
- * with a device. It runs straight through; the connection either
- * succeeds or fails.
- */
- private class ConnectThread extends Thread {
- private BluetoothSocket mmSocket;
- private final BluetoothDevice mmDevice;
- public ConnectThread(BluetoothDevice device) {
- mmDevice = device;
- //Log.d(TAG, "Attempting to conenct to " + device.getName());
- //Log.d(TAG, "UUID to conenct to " + SERVER_UUID.toString());
-
- }
-
- public void attemptCancelDiscovery(){
- try{
- mAdapter.cancelDiscovery();
- }catch(SecurityException e2){
- Log.e(TAG, "Don't have required permision to cancel discovery. Moving on");
- }
- }
-
- public void run() {
- setName("ConnectThread");
- // Always cancel discovery because it will slow down a connection
- attemptCancelDiscovery();
- // Make a connection to the BluetoothSocket
- int attemptCount = 0;
- boolean success = false;
- Looper.prepare();
-
- while(attemptCount < 5)
- {
- //Looper.loop()
- attemptCount++;
- try {
- // This is a blocking call and will only return on a
- // successful connection or an exception
- mBluetoothLevel = SdlRouterService.getBluetoothPrefs(SHARED_PREFS);
- long waitTime = 3000;
- try {
- Thread.sleep(waitTime);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- //This sequence tries to use reflection first to connect with a certain number of phones that require this
- //Next is the most common methods for phones
- //Finally if both have failed an insecure connection is attempted, though this is not available on lower SDK's
- boolean tryInsecure = false;
- boolean trySecure = false;
- //Log.i(TAG,mmDevice.getName() + " socket connecting...");
-
- if(mBluetoothLevel<=1){
- try {
- SdlRouterService.setBluetoothPrefs(2,SHARED_PREFS);
- Method m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
- //Log.i(TAG,"connecting using createRfcommSocket");
- mmSocket = (BluetoothSocket) m.invoke(mmDevice, Integer.valueOf(1));
- if(mmSocket!=null){
- //Looper.prepare();
- timerDelayRemoveDialog(mmSocket);
- //Looper.loop();
- mmSocket.connect();
- timeOutHandler.removeCallbacks(socketRunable);
- Looper.myLooper().quit();
- success=true;
- SdlRouterService.setBluetoothPrefs(1,SHARED_PREFS);
- break;
- } else{trySecure = true;}
-
- } catch (Exception e) {
- //Log.e(TAG,"createRfcommSocket exception - " + e.toString());
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
-
- trySecure = true;
- try {
- Thread.sleep(500);
- } catch (InterruptedException e2) {
- e2.printStackTrace();
- }
- }
- }else{trySecure = true;}
- if(trySecure && mBluetoothLevel<=2){
- try {
- SdlRouterService.setBluetoothPrefs(3,SHARED_PREFS);
- //Log.i(TAG, "connecting using createRfcommSocketToServiceRecord ");
- mmSocket = mmDevice.createRfcommSocketToServiceRecord(SERVER_UUID);
- if(mmSocket!=null){
- //Looper.prepare();
- timerDelayRemoveDialog(mmSocket);
- //Looper.loop();
- mmSocket.connect();
- timeOutHandler.removeCallbacks(socketRunable);
- Looper.myLooper().quit();
- success=true;
- SdlRouterService.setBluetoothPrefs(2,SHARED_PREFS);
- break;
- }else{tryInsecure = true;}
- } catch (IOException io) {
- tryInsecure = true;
- Log.e(TAG,"createRfcommSocketToServiceRecord exception - " + io.toString());
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
-
- } catch (Exception e){
- Log.e(TAG,"createRfcommSocketToServiceRecord exception - " + e.toString());
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
-
- }
- }else{tryInsecure = true;}
-
- if (tryInsecure && mBluetoothLevel<=3) {
- // try again using insecure comm if available
- try {
- SdlRouterService.setBluetoothPrefs(4,SHARED_PREFS);
- //Log.i(TAG,"connecting using createInsecureRfcommSocketToServiceRecord");
- Method m = mmDevice.getClass().getMethod("createInsecureRfcommSocketToServiceRecord", new Class[] {UUID.class});
- mmSocket = (BluetoothSocket) m.invoke(mmDevice, new Object[] {SERVER_UUID});
- //Looper.prepare();
- timerDelayRemoveDialog(mmSocket);
- //Looper.loop();
- mmSocket.connect();
- timeOutHandler.removeCallbacks(socketRunable);
- Looper.myLooper().quit();
- success=true;
- tryInsecure = false;
- SdlRouterService.setBluetoothPrefs(3,SHARED_PREFS);
- break;
- } catch (NoSuchMethodException ie) {
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
- } catch (IllegalAccessException ie) {
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
- } catch (InvocationTargetException ie) {
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
- }
- }
- if (tryInsecure && mBluetoothLevel<=4) {
- // try again using insecure comm if available
- try {
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
- //Log.i(TAG,"connecting using createInsecureRfcommSocket()");
- Method m = mmDevice.getClass().getMethod("createInsecureRfcommSocket()", new Class[] {UUID.class});
- mmSocket = (BluetoothSocket) m.invoke(mmDevice, new Object[] {SERVER_UUID});
- //Looper.prepare();
- timerDelayRemoveDialog(mmSocket);
- //Looper.loop();
- mmSocket.connect();
- timeOutHandler.removeCallbacks(socketRunable);
- Looper.myLooper().quit();
- success=true;
- SdlRouterService.setBluetoothPrefs(4,SHARED_PREFS);
- break;
- } catch (NoSuchMethodException ie) {
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
- } catch (IllegalAccessException ie) {
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
- } catch (InvocationTargetException ie) {
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
- }
- }
- } catch (IOException e) {
- connectionFailed();
- Log.e(TAG,e.getClass().getSimpleName()
- + " caught connecting to the bluetooth socket: "
- + e.toString());
- try {
- mmSocket.close();
- } catch (IOException e2) {
- Log.e(TAG,"unable to close() socket during connection failure" + e2);
- }
- return;
- }
- }
- // Reset the ConnectThread because we're done
- if(success)
- {
- synchronized (MultiplexBluetoothTransport.this) {
- mConnectThread = null;
- }
-
-
- // Start the connected thread
-
- connected(mmSocket, mmDevice);
- }
- else
- {
- Log.e(TAG, "There was a problem opening up RFCOMM");
- }
- }
-
- public void cancel() {
- try {
- Log.d(TAG, "Calling Cancel in the connect thread");
- mmSocket.close();
- } catch (IOException e) {
- // close() of connect socket failed
- }
- catch(NullPointerException e){
- //mSocket was pry never initialized
- }
- }
- }
-
- /**
- * This thread runs during a connection with a remote device.
- * It handles all incoming and outgoing transmissions.
- */
- private class ConnectedWriteThread extends Thread {
- private final BluetoothSocket mmSocket;
- private final OutputStream mmOutStream;
-
-
- public ConnectedWriteThread(BluetoothSocket socket) {
- //Log.d(TAG, "Creating a Connected - Write Thread");
- mmSocket = socket;
- OutputStream tmpOut = null;
- setName("SDL Router BT Write Thread");
- // Get the BluetoothSocket input and output streams
- try {
- tmpOut = socket.getOutputStream();
- } catch (IOException e) {
- // temp sockets not created
- Log.e(TAG, "Connected Write Thread: " + e.getMessage());
- }
- mmOutStream = tmpOut;
-
-
- }
- /**
- * Write to the connected OutStream.
- * @param buffer The bytes to write
- */
- public void write(byte[] buffer, int offset, int count) {
- try {
- if(buffer==null){
- Log.w(TAG, "Can't write to device, nothing to send");
- return;
- }
- //This would be a good spot to log out all bytes received
- mmOutStream.write(buffer, offset, count);
- //Log.w(TAG, "Wrote out to device: bytes = "+ count);
- } catch (IOException|NullPointerException e) { // STRICTLY to catch mmOutStream NPE
- // Exception during write
- //OMG! WE MUST NOT BE CONNECTED ANYMORE! LET THE USER KNOW
- Log.e(TAG, "Error sending bytes to connected device!");
- connectionLost();
- }
- }
-
- public synchronized void cancel() {
- try {
- if(mmOutStream!=null){
- mmOutStream.flush();
- mmOutStream.close();
-
- }
- if(mmSocket!=null){
- mmSocket.close();
- }
- } catch (IOException e) {
- // close() of connect socket failed
- Log.d(TAG, "Write Thread: " + e.getMessage());
- }
- }
- }
-
- private class ConnectedThread extends Thread {
- private final BluetoothSocket mmSocket;
- private final InputStream mmInStream;
- SdlPsm psm;
- public ConnectedThread(BluetoothSocket socket) {
- this.psm = new SdlPsm();
- //Log.d(TAG, "Creating a Connected - Read Thread");
- mmSocket = socket;
- InputStream tmpIn = null;
- setName("SDL Router BT Read Thread");
- // Get the BluetoothSocket input and output streams
- try {
- tmpIn = socket.getInputStream();
- } catch (IOException e) {
- // temp sockets not created
- Log.e(TAG, "Connected Read Thread: "+e.getMessage());
- }
- mmInStream = tmpIn;
-
- }
-
- @SuppressLint("NewApi")
- public void run() {
- Log.d(TAG, "Running the Connected Thread");
- byte input = 0;
- int bytesRead = 0;
- byte[] buffer = new byte[READ_BUFFER_SIZE];
- // Keep listening to the InputStream while connected
- boolean stateProgress;
-
- psm.reset();
-
- while (true) {
- try {
- bytesRead = mmInStream.read(buffer);
- // Log.i(getClass().getName(), "Received " + bytesRead + " bytes from Bluetooth");
- for (int i = 0; i < bytesRead; i++) {
- input = buffer[i];
-
- // Send the response of what we received
- stateProgress = psm.handleByte(input);
- if (!stateProgress) { //We are trying to weed through the bad packet info until we get something
- //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
- psm.reset();
- continue;
- }
-
- if (psm.getState() == SdlPsm.FINISHED_STATE) {
- //Log.d(TAG, "Packet formed, sending off");
- SdlPacket packet = psm.getFormedPacket();
- packet.setTransportRecord(getTransportRecord());
- handler.obtainMessage(SdlRouterService.MESSAGE_READ, packet).sendToTarget();
- psm.reset();
- }
- }
- } catch (IOException|NullPointerException e) { // NPE is ONLY to catch error on mmInStream
- Log.e(TAG, "Lost connection in the Connected Thread");
- e.printStackTrace();
- connectionLost();
- break;
- }
- }
- }
-
-
- public synchronized void cancel() {
- try {
- //Log.d(TAG, "Calling Cancel in the Read thread");
- if(mmInStream!=null){
- mmInStream.close();
- }
- if(mmSocket!=null){
- mmSocket.close();
- }
-
- } catch (IOException|NullPointerException e) { // NPE is ONLY to catch error on mmInStream
- // Log.trace(TAG, "Read Thread: " + e.getMessage());
- // Socket or stream is already closed
- }
- }
- }
-
-
-
- public BluetoothSocket getBTSocket(BluetoothServerSocket bsSocket){
- if(bsSocket == null){
- return null;
- }
- Field[] f = bsSocket.getClass().getDeclaredFields();
-
- //int channel = -1;
- BluetoothSocket mySocket = null;
- for (Field field : f) {
- if(field.getName().equals("mSocket")){
- field.setAccessible(true);
- try {
-
- mySocket = (BluetoothSocket) field.get(bsSocket);
- return mySocket;
- //channel = field.getInt(bsSocket);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- field.setAccessible(false);
- }
- }
-
- return null;
- }
-
- public int getChannel(BluetoothSocket bsSocket){
-
- int channel = -1;
- if (bsSocket == null){
- return channel;
- }
-
- Field[] f = bsSocket.getClass().getDeclaredFields();
-
- for (Field field : f) {
- if(field.getName().equals("mPort")){
- field.setAccessible(true);
- try {
-
-
- channel = field.getInt(bsSocket);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- field.setAccessible(false);
- }
- }
-
- return channel;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java b/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java
deleted file mode 100644
index 8a3e39d20..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.transport;
-
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-import android.content.ComponentName;
-import android.content.Context;
-
-import java.util.Arrays;
-import java.util.List;
-
-@SuppressWarnings("WeakerAccess")
-public class MultiplexTransportConfig extends BaseTransportConfig{
-
- /**
- * Multiplexing security will be turned off. All router services will be trusted.
- */
- public static final int FLAG_MULTI_SECURITY_OFF = 0x00;
- /**
- * Multiplexing security will be minimal. Only trusted router services will be used. Trusted router list will be obtain from
- * server. List will be refreshed every <b>30 days</b> or during next connection session if an SDL enabled app has been
- * installed or uninstalled.
- */
- public static final int FLAG_MULTI_SECURITY_LOW = 0x10;
- /**
- * Multiplexing security will be on at a normal level. Only trusted router services will be used. Trusted router list will be obtain from
- * server. List will be refreshed every <b>7 days</b> or during next connection session if an SDL enabled app has been
- * installed or uninstalled.
- */
- public static final int FLAG_MULTI_SECURITY_MED = 0x20;
- /**
- * Multiplexing security will be very strict. Only trusted router services installed from trusted app stores will
- * be used. Trusted router list will be obtain from server. List will be refreshed every <b>7 days</b>
- * or during next connection session if an SDL enabled app has been installed or uninstalled.
- */
- public static final int FLAG_MULTI_SECURITY_HIGH = 0x30;
-
- Context context;
- String appId;
- ComponentName service;
- int securityLevel;
-
- List<TransportType> primaryTransports, secondaryTransports;
- boolean requiresHighBandwidth = false;
- TransportListener transportListener;
-
-
- public MultiplexTransportConfig(Context context, String appId) {
- this.context = context;
- this.appId = appId;
- this.securityLevel = FLAG_MULTI_SECURITY_MED;
- this.primaryTransports = Arrays.asList(TransportType.USB, TransportType.BLUETOOTH);
- this.secondaryTransports = Arrays.asList(TransportType.TCP, TransportType.USB, TransportType.BLUETOOTH);
-
- }
-
- public MultiplexTransportConfig(Context context, String appId, int securityLevel) {
- this.context = context;
- this.appId = appId;
- this.securityLevel = securityLevel;
- this.primaryTransports = Arrays.asList(TransportType.USB, TransportType.BLUETOOTH);
- this.secondaryTransports = Arrays.asList(TransportType.TCP, TransportType.USB, TransportType.BLUETOOTH);
- }
-
- /**
- * Overridden abstract method which returns specific type of this transport configuration.
- *
- * @return Constant value TransportType.MULTIPLEX.
- *
- * @see TransportType
- */
- public TransportType getTransportType() {
- return TransportType.MULTIPLEX;
- }
-
- /**
- * Gets the context attached to this config
- * @return context supplied during creation
- */
- public Context getContext(){
- return this.context;
- }
-
- /**
- * Gets the ComponentName of the router service attached to this config
- * @return ComponentName of the router service that will be bound to
- */
- public ComponentName getService() {
- return service;
- }
-
- /**
- * Supplies the config with the router service that should be bound to
- * @param service the router service that should be bound to
- */
- public void setService(ComponentName service) {
- this.service = service;
- }
-
- /**
- * Sets the security level that should be used to verify a router service that is to be bound
- * @param securityLevel the security level that will be used to perform certain tests
- * @see #FLAG_MULTI_SECURITY_OFF
- * @see #FLAG_MULTI_SECURITY_LOW
- * @see #FLAG_MULTI_SECURITY_MED
- * @see #FLAG_MULTI_SECURITY_HIGH
- */
- public void setSecurityLevel(int securityLevel){
- this.securityLevel = securityLevel;
- }
-
- /**
- * Get the securitly level that will be used to verify a router service before binding
- * @return the set security level
- * @see #FLAG_MULTI_SECURITY_OFF
- * @see #FLAG_MULTI_SECURITY_LOW
- * @see #FLAG_MULTI_SECURITY_MED
- * @see #FLAG_MULTI_SECURITY_HIGH
- */
- public int getSecurityLevel(){
- return securityLevel;
- }
-
- /**
- * Set whether or not this app requires the use of a transport that supports high bandwidth
- * services. Common use is when an app uses the video/audio streaming services and there is no
- * other integration that could be useful to the user.
- * <br><br> <b>For example:</b>
- * <br><b>1. </b>If an app intends to perform audio or video streaming and does not wish
- * to appear on the module when that isn't possible, a value of true should be sent.
- * <br><b>2. </b>If the same app wishes to appear on the module even when those services aren't available
- * a value of true should be sent. In this case, the app could display a message prompting the
- * user to "Please connect USB or Wifi" or it could have a separate integration like giving turn
- * by turn directions in place of streaming the full navigation map.
- * @param requiresHighBandwidth whether the app should be treated as requiring a high
- * bandwidth transport.
- */
- public void setRequiresHighBandwidth(boolean requiresHighBandwidth){
- this.requiresHighBandwidth = requiresHighBandwidth;
- }
-
- /**
- * Get the setting from this config to see whether the app should be treated as requiring a high
- * bandwidth transport.
- * @return whether the app should be treated as requiring a high
- * bandwidth transport.
- */
- public boolean requiresHighBandwidth(){
- return this.requiresHighBandwidth;
- }
-
- /**
- * This will set the order in which a primary transport is determined to be accepted or not.
- * In the case of previous protocol versions ( < 5.1)
- * @param transports list of transports that can be used as primary
- */
- public void setPrimaryTransports(List<TransportType> transports){
- if(transports != null){
- //Sanitize
- transports.remove(TransportType.MULTIPLEX);
- this.primaryTransports = transports;
- }
- }
-
- /**
- * Get the list of primary transports that are set to be accepted by this config
- * @return acceptable primary transports
- */
- public List<TransportType> getPrimaryTransports(){
- return this.primaryTransports;
- }
-
- /**
- * This will set the order in which a primary transport is determined to be accepted or not.
- * In the case of previous protocol versions ( < 5.1)
- * @param transports list of transports that can be used as secondary
- **/
- public void setSecondaryTransports(List<TransportType> transports){
- if(transports != null){
- //Sanitize
- transports.remove(TransportType.MULTIPLEX);
- this.secondaryTransports = transports;
- }
- }
-
- /**
- * Get the list of secondary transports that are set to be accepted by this config
- * @return acceptable secondary transports
- */
- public List<TransportType> getSecondaryTransports(){
- return this.secondaryTransports;
- }
-
- /**
- * Set a lister for transport events. Useful when connected high bandwidth services like audio
- * or video streaming
- * @param listener the TransportListener that will be called back when transport events happen
- */
- public void setTransportListener(TransportListener listener){
- this.transportListener = listener;
- }
-
- /**
- * Getter for the supplied transport listener
- * @return the transport listener if any
- */
- public TransportListener getTransportListener(){
- return this.transportListener;
- }
-
- /**
- * Callback to be used if the state of the transports needs to be monitored for any reason.
- */
- public interface TransportListener{
- /**
- * Gets called whenever there is a change in the available transports for use
- * @param connectedTransports the currently connected transports
- * @param audioStreamTransportAvail true if there is either an audio streaming supported
- * transport currently connected or a transport is
- * available to connect with. False if there is no
- * transport connected to support audio streaming and
- * no possibility in the foreseeable future.
- * @param videoStreamTransportAvail true if there is either a video streaming supported
- * transport currently connected or a transport is
- * available to connect with. False if there is no
- * transport connected to support video streaming and
- * no possibility in the foreseeable future.
- */
- void onTransportEvent(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail,boolean videoStreamTransportAvail);
- }
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java b/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
deleted file mode 100644
index e807f7ac7..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.transport;
-
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.os.ParcelFileDescriptor;
-import android.util.Log;
-
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.transport.enums.TransportType;
-
-import java.io.FileDescriptor;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-public class MultiplexUsbTransport extends MultiplexBaseTransport{
-
- private static final String TAG = "MultiplexUsbTransport";
-
- public static final String MANUFACTURER = "manufacturer";
- public static final String MODEL = "model";
- public static final String VERSION = "version";
- public static final String URI = "uri";
- public static final String SERIAL = "serial";
- public static final String DESCRIPTION = "description";
-
- private final Bundle deviceInfo;
- private ReaderThread readerThread;
- private WriterThread writerThread;
- private final ParcelFileDescriptor parcelFileDescriptor;
-
- MultiplexUsbTransport(ParcelFileDescriptor parcelFileDescriptor, Handler handler, Bundle bundle){
- super(handler, TransportType.USB);
- if(parcelFileDescriptor == null){
- Log.e(TAG, "Error with object");
- this.parcelFileDescriptor = null;
- throw new ExceptionInInitializerError("ParcelFileDescriptor can't be null");
- }else{
- this.parcelFileDescriptor = parcelFileDescriptor;
- connectedDeviceName = "USB";
- deviceInfo = bundle;
- if(deviceInfo != null){
- //Fill in info
- connectedDeviceAddress = bundle.getString(SERIAL);
- if(connectedDeviceAddress == null){
- connectedDeviceAddress = bundle.getString(URI);
- if(connectedDeviceAddress == null) {
- connectedDeviceAddress = bundle.getString(DESCRIPTION);
- if (connectedDeviceAddress == null) {
- connectedDeviceAddress = bundle.getString(MODEL);
- if (connectedDeviceAddress == null) {
- connectedDeviceAddress = bundle.getString(MANUFACTURER);
- }
- }
- }
- }
-
- }else{
- connectedDeviceAddress = "USB";
- }
- }
- }
-
- public synchronized void start(){
- setState(STATE_CONNECTING);
- FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
- readerThread = new ReaderThread(fileDescriptor);
- writerThread = new WriterThread(fileDescriptor);
-
-
- // Send the name of the connected device back to the UI Activity
- Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_DEVICE_NAME);
- Bundle bundle = new Bundle();
- bundle.putString(DEVICE_NAME, connectedDeviceName);
- bundle.putString(DEVICE_ADDRESS, connectedDeviceAddress);
- msg.setData(bundle);
- handler.sendMessage(msg);
-
- setState(STATE_CONNECTED);
- readerThread.start();
- writerThread.start();
- }
-
- protected synchronized void stop(int stateToTransitionTo) {
- //Log.d(TAG, "Attempting to close the Usb transports");
- if (writerThread != null) {
- writerThread.cancel();
- writerThread = null;
- }
-
- if (readerThread != null) {
- readerThread.cancel();
- readerThread = null;
- }
-
- if(parcelFileDescriptor != null){
- try {
- parcelFileDescriptor.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- setState(stateToTransitionTo);
- }
-
-
- /**
- * Write to the ConnectedThread in an unsynchronized manner
- * @param out The bytes to write
- */
- public void write(byte[] out, int offset, int count) {
- // Create temporary object
- MultiplexUsbTransport.WriterThread r;
- // Synchronize a copy of the ConnectedThread
- synchronized (this) {
- if (mState != STATE_CONNECTED) return;
- r = writerThread;
- //r.write(out,offset,count);
- }
- // Perform the write unsynchronized
- r.write(out,offset,count);
- }
-
- /**
- * Indicate that the connection attempt failed and notify the UI Activity.
- */
- private void connectionFailed() {
- // Send a failure message back to the Activity
- Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);
- Bundle bundle = new Bundle();
- bundle.putString(LOG, "Unable to connect device");
- msg.setData(bundle);
- handler.sendMessage(msg);
-
- // Start the service over to restart listening mode
- // BluetoothSerialServer.this.start();
- }
-
- /**
- * Indicate that the connection was lost and notify the UI Activity.
- */
- private void connectionLost() {
- // Send a failure message back to the Activity
- Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);
- Bundle bundle = new Bundle();
- bundle.putString(LOG, "Device connection was lost");
- msg.setData(bundle);
- handler.sendMessage(msg);
- stop();
-
- }
-
- private class ReaderThread extends Thread{
- SdlPsm psm;
-
- final InputStream inputStream;
-
- public ReaderThread(final FileDescriptor fileDescriptor){
- psm = new SdlPsm();
- inputStream = new FileInputStream(fileDescriptor);
- }
-
- @Override
- public void run() { //FIXME probably check to see what the BT does
- super.run();
- final int READ_BUFFER_SIZE = 4096;
- byte[] buffer = new byte[READ_BUFFER_SIZE];
- int bytesRead;
- boolean stateProgress;
-
- // read loop
- while (!isInterrupted()) {
- try {
- bytesRead = inputStream.read(buffer);
- if (bytesRead == -1) {
- if (isInterrupted()) {
- Log.e(TAG,"EOF reached, and thread is interrupted");
- } else {
- Log.i(TAG,"EOF reached, disconnecting!");
- connectionLost();
- }
- return;
- }
- if (isInterrupted()) {
- Log.w(TAG,"Read some data, but thread is interrupted");
- return;
- }
- byte input;
- for(int i=0;i<bytesRead; i++){
- input=buffer[i];
- stateProgress = psm.handleByte(input);
- if(!stateProgress){//We are trying to weed through the bad packet info until we get something
- //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
- psm.reset();
- buffer = new byte[READ_BUFFER_SIZE];
- }
-
- if(psm.getState() == SdlPsm.FINISHED_STATE){
- synchronized (MultiplexUsbTransport.this) {
- //Log.d(TAG, "Packet formed, sending off");
- SdlPacket packet = psm.getFormedPacket();
- packet.setTransportRecord(getTransportRecord());
- handler.obtainMessage(SdlRouterService.MESSAGE_READ, packet).sendToTarget();
- }
- //We put a trace statement in the message read so we can avoid all the extra bytes
- psm.reset();
- buffer = new byte[READ_BUFFER_SIZE]; //FIXME just do an array copy and send off
- }
- }
- } catch (IOException e) {
- if (isInterrupted()) {
- Log.w(TAG,"Can't read data, and thread is interrupted");
- } else {
- Log.w(TAG,"Can't read data, disconnecting!");
- connectionLost();
- }
- return;
- } catch (Exception e){
- connectionLost();
- }
- }
- }
-
-
- public synchronized void cancel() {
- try {
- //Log.d(TAG, "Calling Cancel in the Read thread");
- if(inputStream!=null){
- inputStream.close();
- }
-
- } catch (IOException|NullPointerException e) { // NPE is ONLY to catch error on mmInStream
- // Log.trace(TAG, "Read Thread: " + e.getMessage());
- // Socket or stream is already closed
- }
- }
-
- }
-
-
- /**
- * This thread runs during a connection with a remote device.
- * It handles all incoming and outgoing transmissions.
- */
- private class WriterThread extends Thread {
- private final OutputStream mmOutStream;
-
- public WriterThread(FileDescriptor fileDescriptor) {
- //Log.d(TAG, "Creating a Connected - Write Thread");
- OutputStream tmpOut = null;
- setName("SDL Router BT Write Thread");
- // Get the Usb output streams
- mmOutStream = new FileOutputStream(fileDescriptor);
-
-
- }
- /**
- * Write to the connected OutStream.
- * @param buffer The bytes to write
- */
- public void write(byte[] buffer, int offset, int count) {
- try {
- if(buffer==null){
- Log.w(TAG, "Can't write to device, nothing to send");
- return;
- }
- //This would be a good spot to log out all bytes received
- mmOutStream.write(buffer, offset, count);
- //Log.w(TAG, "Wrote out to device: bytes = "+ count);
- } catch (IOException|NullPointerException e) { // STRICTLY to catch mmOutStream NPE
- // Exception during write
- //OMG! WE MUST NOT BE CONNECTED ANYMORE! LET THE USER KNOW
- Log.e(TAG, "Error sending bytes to connected device!");
- connectionLost();
- }
- }
-
- public synchronized void cancel() {
- try {
- if(mmOutStream!=null){
- mmOutStream.flush();
- mmOutStream.close();
-
- }
- } catch (IOException e) {
- // close() of connect socket failed
- Log.d(TAG, "Write Thread: " + e.getMessage());
- }
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java b/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java
deleted file mode 100644
index 868c71054..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java
+++ /dev/null
@@ -1,694 +0,0 @@
-package com.smartdevicelink.transport;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Locale;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.app.ActivityManager;
-import android.app.ActivityManager.RunningServiceInfo;
-import android.bluetooth.BluetoothAdapter;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ServiceInfo;
-import android.os.Build;
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.smartdevicelink.util.AndroidTools;
-import com.smartdevicelink.util.HttpRequestTask;
-import com.smartdevicelink.util.HttpRequestTask.HttpRequestTaskCallback;
-
-/**
- * This class will tell us if the currently running router service is valid or not.
- * To use this class simply create a new instance of RouterServiceValidator with a supplied context.
- * After that, you have the option to set if you want to test in a production setting. If not, it will default to a debug setting.
- * Once you are ready to check if the router service is trusted you simply call routerServiceValidator.validate();
- * <br><br> This validator should be passed into the multiplexing transport construction as well.
- * @author Joey Grover
- *
- */
-public class RouterServiceValidator {
- private static final String TAG = "RSVP";
- public static final String ROUTER_SERVICE_PACKAGE = "com.sdl.router";
-
- private static final String REQUEST_PREFIX = "https://woprjr.smartdevicelink.com/api/1/applications/queryTrustedRouters";
-
- private static final String DEFAULT_APP_LIST = "{\"response\": {\"com.livio.sdl\" : { \"versionBlacklist\":[] }, \"com.lexus.tcapp\" : { \"versionBlacklist\":[] }, \"com.toyota.tcapp\" : { \"versionBlacklist\": [] } , \"com.sdl.router\":{\"versionBlacklist\": [] },\"com.ford.fordpass\" : { \"versionBlacklist\":[] } }}";
-
-
- private static final String JSON_RESPONSE_OBJECT_TAG = "response";
- private static final String JSON_RESONSE_APP_VERSIONS_TAG = "versionBlacklist";
-
- private static final String JSON_PUT_ARRAY_TAG = "installedApps";
- private static final String JSON_APP_PACKAGE_TAG = "packageName";
- private static final String JSON_APP_VERSION_TAG = "version";
-
-
- private static final long REFRESH_TRUSTED_APP_LIST_TIME_DAY = 3600000 * 24; // A day in ms
-
- private static final String SDL = "sdl";
- private static final String SDL_PACKAGE_LIST = "sdl_package_list";
- private static final String SDL_PACKAGE_LIST_TIMESTAMP = "sdl_package_list_timestamp";
- private static final String SDL_LAST_REQUEST = "sdl_last_request";
- private static final String SDL_RSVP_SECURITY_LEVEL = "sdl_rsvp_security_level";
-
-
- //Flags to aid in debugging and production checks
- public static final int FLAG_DEBUG_NONE = 0x00;
- public static final int FLAG_DEBUG_PACKAGE_CHECK = 0x01;
- /**
- * This will flag the validator to check for app version during debugging.
- * <br><br><b>NOTE: This flag will include a package check as well.
- */
- public static final int FLAG_DEBUG_VERSION_CHECK = 0x03; //We use 3 becuase version check will be 2, but since a version check implies a package check we do 2+1=3;
- public static final int FLAG_DEBUG_INSTALLED_FROM_CHECK = 0x04;
- public static final int FLAG_DEBUG_USE_TIMESTAMP_CHECK = 0x05;
-
- public static final int FLAG_DEBUG_PERFORM_ALL_CHECKS = 0xFF;
-
-
- private int flags = FLAG_DEBUG_NONE;
-
- private Context context= null;
- private boolean inDebugMode = false;
- @SuppressWarnings("unused")
- private static boolean pendingListRefresh = false;
-
- private ComponentName service;//This is how we can save different routers over another in a waterfall method if we choose to.
-
- private static int securityLevel = -1;
-
- public RouterServiceValidator(Context context){
- this.context = context;
- inDebugMode = inDebugMode();
- }
-
- public RouterServiceValidator(Context context, ComponentName service){
- this.context = context;
- inDebugMode = inDebugMode();
- this.service = service;
- }
-
- public RouterServiceValidator(@NonNull MultiplexTransportConfig config){
- this.context = config.context;
- this.service = config.service;
- setSecurityLevel(config.securityLevel);
- inDebugMode = inDebugMode();
- }
-
- /**
- * Main function to call to ensure we are connecting to a validated router service
- * @return whether or not the currently running router service can be trusted.
- */
- public boolean validate(){
-
- if(securityLevel == -1){
- securityLevel = getSecurityLevel(context);
- }
-
- if(securityLevel == MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF){ //If security isn't an issue, just return true;
- return true;
- }
-
- PackageManager pm = context.getPackageManager();
- //Grab the package for the currently running router service. We need this call regardless of if we are in debug mode or not.
- String packageName = null;
-
- if(this.service != null){
- Log.d(TAG, "Supplied service name of " + this.service.getClassName());
- if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O && !isServiceRunning(context,this.service)){
- //This means our service isn't actually running, so set to null. Hopefully we can find a real router service after this.
- service = null;
- Log.w(TAG, "Supplied service is not actually running.");
- } else {
- // If the running router service is created by this app, the validation is good by default
- if (this.service.getPackageName().equals(context.getPackageName())) {
- return true;
- }
- }
- }
- if(this.service == null){
- if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O ) {
- this.service = componentNameForServiceRunning(pm); //Change this to an array if multiple services are started?
- if (this.service == null) { //if this is still null we know there is no service running so we can return false
- wakeUpRouterServices();
- return false;
- }
- }else{
- wakeUpRouterServices();
- return false;
- }
-
- }
-
- //Log.d(TAG, "Checking app package: " + service.getClassName());
- packageName = this.appPackageForComponentName(service, pm);
-
-
- if(packageName!=null){//Make sure there is a service running
- if(wasInstalledByAppStore(packageName)){ //Was this package installed from a trusted app store
- if( isTrustedPackage(packageName, pm)){//Is this package on the list of trusted apps.
- return true;
- }
- }
- }//No running service found. Might need to attempt to start one
- //TODO spin up a known good router service
- wakeUpRouterServices();
- return false;
- }
-
- /**
- * This will ensure that all router services are aware that there are no valid router services running and should start up
- */
- private void wakeUpRouterServices(){
- if(BluetoothAdapter.getDefaultAdapter()!=null && BluetoothAdapter.getDefaultAdapter().isEnabled()){
- Intent intent = new Intent(TransportConstants.START_ROUTER_SERVICE_ACTION);
- intent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true);
- AndroidTools.sendExplicitBroadcast(context,intent,null);
- }
- }
- public ComponentName getService(){
- return this.service;
- }
-
- private boolean shouldOverrideVersionCheck(){
- return (this.inDebugMode && ((this.flags & FLAG_DEBUG_VERSION_CHECK) != FLAG_DEBUG_VERSION_CHECK));
- }
-
- private boolean shouldOverridePackageName(){
- return (this.inDebugMode && ((this.flags & FLAG_DEBUG_PACKAGE_CHECK) != FLAG_DEBUG_PACKAGE_CHECK));
- }
-
- private boolean shouldOverrideInstalledFrom(){
- return securityLevel< MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH
- || (this.inDebugMode && ((this.flags & FLAG_DEBUG_INSTALLED_FROM_CHECK) != FLAG_DEBUG_INSTALLED_FROM_CHECK));
- }
-
- @SuppressWarnings("unused")
- private boolean shouldOverrideTimeCheck(){
- return (this.inDebugMode && ((this.flags & FLAG_DEBUG_USE_TIMESTAMP_CHECK) != FLAG_DEBUG_USE_TIMESTAMP_CHECK));
- }
-
-
- /**
- * Use this method if you would like to test your app in a production setting rather than defaulting to a
- * debug mode where you connect to whatever router service is running.
- * <br><br><b>These flags are only used in debugging mode. During production they will be ignored.</b>
- * @param flags
- */
- public void setFlags(int flags){
- this.flags = flags;
- }
-
- public void setSecurityLevel(int securityLevel){
- RouterServiceValidator.securityLevel = securityLevel;
- cacheSecurityLevel(this.context,securityLevel);
- }
-
- protected static long getRefreshRate(){
- switch(securityLevel){
- case MultiplexTransportConfig.FLAG_MULTI_SECURITY_LOW:
- return 30 * REFRESH_TRUSTED_APP_LIST_TIME_DAY;
- case MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH:
- case MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED:
- default:
- return 7 * REFRESH_TRUSTED_APP_LIST_TIME_DAY;
-
- }
- }
-
- /**
- * This method will find which router service is running. Use that info to find out more about that app and service.
- * It will store the found service for later use and return the package name if found.
- * @param context
- * @return
- */
- public ComponentName componentNameForServiceRunning(PackageManager pm){
- if(context==null){
- return null;
- }
- ActivityManager manager = (ActivityManager) context.getSystemService("activity");
- //PackageManager pm = context.getPackageManager();
-
-
- for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
- //Log.d(TAG, service.service.getClassName());
- //We will check to see if it contains this name, should be pretty specific
- if ((service.service.getClassName()).toLowerCase(Locale.US).contains(SdlBroadcastReceiver.SDL_ROUTER_SERVICE_CLASS_NAME)){
- //this.service = service.service; //This is great
- if(service.started && service.restarting==0){ //If this service has been started and is not crashed
- return service.service; //appPackageForComponenetName(service.service,pm);
- }
- }
- }
-
- return null;
- }
-
- /**
- * Returns the package name for the component name
- * @param cn
- * @param pm
- * @return
- */
- private String appPackageForComponentName(ComponentName cn,PackageManager pm ){
- if(cn!=null && pm!=null){
- ServiceInfo info;
- try {
- info = pm.getServiceInfo(cn, 0);
- return info.applicationInfo.packageName;
- } catch (NameNotFoundException e) {
- e.printStackTrace();
- }
- }
- return null;
-
- }
-
- /**
- * Check to see if the app was installed from a trusted app store.
- * @param packageName the package name of the app to be tested
- * @return whether or not the app was installed from a trusted app store
- */
- public boolean wasInstalledByAppStore(String packageName){
- if(shouldOverrideInstalledFrom()){
- return true;
- }
- PackageManager packageManager = context.getPackageManager();
- try {
- final ApplicationInfo applicationInfo = packageManager.getApplicationInfo(packageName, 0);
- if(TrustedAppStore.isTrustedStore(packageManager.getInstallerPackageName(applicationInfo.packageName))){
- // App was installed by trusted app store
- return true;
- }
- } catch (final NameNotFoundException e) {
- e.printStackTrace();
- return false;
- }
- return false;
- }
-
- /**
- * This method will check to see if this app is a debug build. If it is, we will attempt to connect to any router service.
- * If false, it will only connect to approved apps with router services.
- * @return
- */
- public boolean inDebugMode(){
- return (0 != (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
- }
-
-
- private boolean isTrustedPackage(String packageName, PackageManager pm){
- if(packageName == null){
- return false;
- }
-
- if(shouldOverridePackageName()){ //If we don't care about package names, just return true;
- return true;
- }
-
- int version = -1;
- try {version = pm.getPackageInfo(packageName,0).versionCode;} catch (NameNotFoundException e1) {e1.printStackTrace(); return false;}
-
- JSONObject trustedApps = stringToJson(getTrustedList(context));
- JSONArray versions;
- JSONObject app = null;
-
- try {
- app = trustedApps.getJSONObject(packageName);
- } catch (JSONException e) {
- e.printStackTrace();
- return false;
- }
-
- if(app!=null){
- //At this point, an app object was found in the JSON list that matches the package name
- if(shouldOverrideVersionCheck()){ //If we don't care about versions, just return true
- return true;
- }
- try { versions = app.getJSONArray(JSON_RESONSE_APP_VERSIONS_TAG); } catch (JSONException e) { e.printStackTrace();return false;}
- return verifyVersion(version, versions);
- }
-
- return false;
- }
-
- protected boolean verifyVersion(int version, JSONArray versions){
- if(version<0){
- return false;
- }
- if(versions == null || versions.length()==0){
- return true;
- }
- for(int i=0;i<versions.length();i++){
- try {
- if(version == versions.getInt(i)){
- return false;
- }
- } catch (JSONException e) {
- continue;
- }
- }//We didn't find our version in the black list.
- return true;
- }
-
- /**
- * Using the knowledge that all SDL enabled apps have an SDL Broadcast Receiver that has an intent filter that includes a specific
- * intent.
- * @return
- */
- private static List<SdlApp> findAllSdlApps(Context context){
- List<SdlApp> apps = new ArrayList<SdlApp>();
- PackageManager packageManager = context.getPackageManager();
- Intent intent = new Intent();
- intent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION);
- List<ResolveInfo> infoList = packageManager.queryBroadcastReceivers(intent, 0);
- //We want to sort our list so that we know it's the same everytime
- Collections.sort(infoList,new Comparator<ResolveInfo>() {
- @Override
- public int compare(ResolveInfo lhs, ResolveInfo rhs) {
- return lhs.activityInfo.packageName.compareTo(rhs.activityInfo.packageName);
- }
- });
- if(infoList!=null){
- String packageName;
- for(ResolveInfo info : infoList){
- //Log.i(TAG, "SDL apps: " + info.activityInfo.packageName);
- packageName = info.activityInfo.packageName;
- try {
- apps.add(new SdlApp(packageName,packageManager.getPackageInfo(packageName,0).versionCode));
- } catch (NameNotFoundException e) {
- e.printStackTrace();
- }
- }
-
- return apps;
- }else{
- Log.i(TAG, "No SDL apps, list was null");
- return null;
- }
- }
-
- /**
- * Performs a look up against installed SDL apps that support the router service.
- * When it receives a list back from the server it will store it for later use.
- * @param context
- */
- public static boolean createTrustedListRequest(final Context context, boolean forceRefresh){
- return createTrustedListRequest(context,forceRefresh,null,null);
- }
- public static boolean createTrustedListRequest(final Context context, boolean forceRefresh, TrustedListCallback listCallback){Log.d(TAG,"Checking to make sure we have a list");
- return createTrustedListRequest(context,forceRefresh,null,listCallback);
- }
-
- @Deprecated
- protected static boolean createTrustedListRequest(final Context context, boolean forceRefresh,HttpRequestTask.HttpRequestTaskCallback cb ){
- return createTrustedListRequest(context,forceRefresh,cb,null);
- }
-
- protected static boolean createTrustedListRequest(final Context context, boolean forceRefresh,HttpRequestTask.HttpRequestTaskCallback cb, final TrustedListCallback listCallback ){
- if(context == null){
- return false;
- }
- else if(getSecurityLevel(context) == MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF){ //If security is off, we can just return now
- if(listCallback!=null){
- listCallback.onListObtained(true);
- }
- return false;
- }
-
- pendingListRefresh = true;
- //Might want to store a flag letting this class know a request is currently pending
- StringBuilder builder = new StringBuilder();
- builder.append(REQUEST_PREFIX);
-
- List<SdlApp> apps = findAllSdlApps(context);
-
- final JSONObject object = new JSONObject();
- JSONArray array = new JSONArray();
- JSONObject jsonApp;
-
- for(SdlApp app: apps){ //Format all the apps into a JSON object and add it to the JSON array
- try{
- jsonApp = new JSONObject();
- jsonApp.put(JSON_APP_PACKAGE_TAG, app.packageName);
- jsonApp.put(JSON_APP_VERSION_TAG, app.versionCode);
- array.put(jsonApp);
- }catch(JSONException e){
- e.printStackTrace();
- continue;
- }
- }
-
- try {object.put(JSON_PUT_ARRAY_TAG, array);} catch (JSONException e) {e.printStackTrace();}
-
- if(!forceRefresh && (System.currentTimeMillis()-getTrustedAppListTimeStamp(context))<getRefreshRate()){
- if(object.toString().equals(getLastRequest(context))){
- //Our list should still be ok for now so we will skip the request
- pendingListRefresh = false;
- if(listCallback!=null){
- listCallback.onListObtained(true);
- }
- return false;
- }else{
- Log.d(TAG, "Sdl apps have changed. Need to request new trusted router service list.");
- }
- }
-
- if (cb == null) {
- cb = new HttpRequestTaskCallback() {
-
- @Override
- public void httpCallComplete(String response) {
- // Might want to check if this list is ok
- //Log.d(TAG, "APPS! " + response);
- setTrustedList(context, response);
- setLastRequest(context, object.toString()); //Save our last request
- pendingListRefresh = false;
- if(listCallback!=null){listCallback.onListObtained(true);}
- }
-
- @Override
- public void httpFailure(int statusCode) {
- Log.e(TAG, "Error while requesting trusted app list: "
- + statusCode);
- pendingListRefresh = false;
- if(listCallback!=null){listCallback.onListObtained(false);}
- }
- };
- }
-
- new HttpRequestTask(cb).execute(REQUEST_PREFIX,HttpRequestTask.REQUEST_TYPE_POST,object.toString(),"application/json","application/json");
-
- return true;
- }
-
- /**
- * This method will determine if our supplied component name is really running.
- * @param context
- * @param service
- * @return
- */
- protected boolean isServiceRunning(Context context, ComponentName service){
- ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
- for (RunningServiceInfo serviceInfo : manager.getRunningServices(Integer.MAX_VALUE)) {
- if (serviceInfo.service.equals(service)) {
- return true;
- }
- }
- return false;
- }
-
-
- /**
- * Parses a string into a JSON array
- * @param json
- * @return
- */
- protected JSONObject stringToJson(String json){
- if(json==null){
- return stringToJson(DEFAULT_APP_LIST);
- }
- try {
- JSONObject object = new JSONObject(json);
- JSONObject trustedApps = object.getJSONObject(JSON_RESPONSE_OBJECT_TAG);
- return trustedApps;
-
- } catch (JSONException e) {
- e.printStackTrace();
- if(!json.equalsIgnoreCase(DEFAULT_APP_LIST)){ //Since we were unable to parse, let's fall back to at least our last known good list. If this list is somehow messed up, just quit.
- return stringToJson(DEFAULT_APP_LIST);
- }else{
- return null;
- }
- }
- }
-
- public static boolean invalidateList(Context context){
- if(context == null){
- return false;
- }
- SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
- // Write the new prefs
- SharedPreferences.Editor prefAdd = pref.edit();
- prefAdd.putLong(SDL_PACKAGE_LIST_TIMESTAMP, 0); //This will be the last time we updated
- return prefAdd.commit();
- }
- /******************************************************************
- *
- * Saving the list for later!!!
- *
- ******************************************************************/
-
- /**
- * Saves the list of available applications into user's shared prefs.
- * @param context The application's environment
- * @param jsonString The JSON string to save.
- */
- protected static boolean setTrustedList(Context context, String jsonString){
- if(jsonString!=null && context!=null){
- SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
- // Write the new prefs
- SharedPreferences.Editor prefAdd = pref.edit();
- prefAdd.putString(SDL_PACKAGE_LIST, jsonString);
- prefAdd.putLong(SDL_PACKAGE_LIST_TIMESTAMP, System.currentTimeMillis()); //This will be the last time we updated
- return prefAdd.commit();
- }
- return false;
- }
-
- /**
- * Retrieves the list of available applications from user's shared prefs.
- * @param context The application's environment.
- * @return The JSON string that was retrieved.
- */
- protected static String getTrustedList(Context context){
- if(context!=null){
- SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
- return pref.getString(SDL_PACKAGE_LIST, DEFAULT_APP_LIST);
- }
- return null;
- }
-
- /**
- * Retrieves the time stamp from the user's shared prefs.
- * @param context The application's environment.
- * @return The time stamp that was retrieved.
- */
- protected static Long getTrustedAppListTimeStamp(Context context){
- if(context!=null){
- SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
- return pref.getLong(SDL_PACKAGE_LIST_TIMESTAMP, 0);
- }
- return -1L;
- }
-
- protected static boolean setLastRequest(Context context, String request){
- if(context!=null){
- SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
- SharedPreferences.Editor prefAdd = pref.edit();
- prefAdd.putString(SDL_LAST_REQUEST, request);
- return prefAdd.commit();
- }
- return false;
- }
-
- /**
- * Gets the last request JSON object we sent to the RSVP server. It basically contains a list of sdl enabled apps
- * @param context
- * @return
- */
- protected static String getLastRequest(Context context){
- if(context!=null){
- SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
- return pref.getString(SDL_LAST_REQUEST, null);
- }
- return null;
- }
-
- protected static boolean cacheSecurityLevel(Context context, int securityLevel){
- if(context!=null){
- SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
- SharedPreferences.Editor prefAdd = pref.edit();
- prefAdd.putInt(SDL_RSVP_SECURITY_LEVEL, securityLevel);
- return prefAdd.commit();
- }
- return false;
- }
-
- protected static int getSecurityLevel(Context context){
- if(context!=null){
- SharedPreferences pref = context.getSharedPreferences(SDL, Context.MODE_PRIVATE);
- return pref.getInt(SDL_RSVP_SECURITY_LEVEL, MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED);
- }
- return MultiplexTransportConfig.FLAG_MULTI_SECURITY_MED;
- }
-
- /**
- * Class that holds all the info we want to send/receive from the validation server
- */
- public static class SdlApp{
- String packageName;
- int versionCode;
-
- SdlApp(String packageName, int versionCode){
- this.packageName = packageName;
- this.versionCode = versionCode;
- }
- }
-
- public static enum TrustedAppStore{
- PLAY_STORE("com.android.vending"),
- AMAZON("com.amazon.venezia"),
- XIAOMI("com.xiaomi.market"),
- SAMSUNG("com.sec.android.app.samsungapps"),
- WANDOUJIA("com.wandoujia.phoenix2"),
- BAIDU_APP_SEARCH("com.baidu.appsearch"),
- HIAPK("com.hiapk.marketpho"),
- ;
-
- String packageString;
- private TrustedAppStore(String packageString){
- this.packageString = packageString;
- }
-
- /**
- * Test if the supplied store package is one of the trusted app stores
- * @param packageString
- * @return
- */
- public static boolean isTrustedStore(String packageString){
- if(packageString == null){
- return false;
- }
- TrustedAppStore[] stores = TrustedAppStore.values();
- for(int i =0; i<stores.length; i++){
- if(packageString.equalsIgnoreCase(stores[i].packageString)){
- return true;
- }
- }
- return false;
- }
-
- }
- /**
- * This interface is used as a callback to know when we have either obtained a list or at least returned from our attempt.
- *
- */
- public static interface TrustedListCallback{
- public void onListObtained(boolean successful);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
deleted file mode 100644
index b96ac4f65..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.transport;
-
-import android.annotation.TargetApi;
-import android.app.ActivityManager;
-import android.app.ActivityManager.RunningServiceInfo;
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothProfile;
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.hardware.usb.UsbManager;
-import android.os.Build;
-import android.os.Parcelable;
-import android.util.Log;
-
-import com.smartdevicelink.R;
-import com.smartdevicelink.transport.RouterServiceValidator.TrustedListCallback;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.util.AndroidTools;
-import com.smartdevicelink.util.SdlAppInfo;
-import com.smartdevicelink.util.ServiceFinder;
-
-import java.util.List;
-import java.util.Locale;
-import java.util.Vector;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
-
-public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
-
- private static final String TAG = "Sdl Broadcast Receiver";
-
- protected static final String SDL_ROUTER_SERVICE_CLASS_NAME = "sdlrouterservice";
-
- public static final String LOCAL_ROUTER_SERVICE_EXTRA = "router_service";
- public static final String LOCAL_ROUTER_SERVICE_DID_START_OWN = "did_start";
-
- public static final String TRANSPORT_GLOBAL_PREFS = "SdlTransportPrefs";
- public static final String IS_TRANSPORT_CONNECTED = "isTransportConnected";
-
- public static Vector<ComponentName> runningBluetoothServicePackage = null;
-
- @SuppressWarnings("rawtypes")
- private static Class localRouterClass;
-
- private static final Object QUEUED_SERVICE_LOCK = new Object();
- private static ComponentName queuedService = null;
-
- public int getRouterServiceVersion(){
- return SdlRouterService.ROUTER_SERVICE_VERSION_NUMBER;
- }
-
- @Override
- public void onReceive(Context context, Intent intent) {
- //Log.i(TAG, "Sdl Receiver Activated");
- final String action = intent.getAction();
- BluetoothDevice device = null;
-
- if(action.equalsIgnoreCase(Intent.ACTION_PACKAGE_ADDED)
- || action.equalsIgnoreCase(Intent.ACTION_PACKAGE_REPLACED)){
- //The package manager has sent out a new broadcast.
- RouterServiceValidator.invalidateList(context);
- return;
- }
-
- if(!(action.equalsIgnoreCase(BluetoothDevice.ACTION_ACL_CONNECTED)
- || action.equalsIgnoreCase(USBTransport.ACTION_USB_ACCESSORY_ATTACHED)
- || action.equalsIgnoreCase(TransportConstants.START_ROUTER_SERVICE_ACTION))){
- //We don't want anything else here if the child class called super and has different intent filters
- //Log.i(TAG, "Unwanted intent from child class");
- return;
- }
-
- if(action.equalsIgnoreCase(USBTransport.ACTION_USB_ACCESSORY_ATTACHED)){
- Log.d(TAG, "Usb connected");
- intent.setAction(null);
- onSdlEnabled(context, intent);
- return;
- }
-
- if(intent.hasExtra(BluetoothDevice.EXTRA_DEVICE)){ //Grab the bluetooth device if available
- device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
- }
-
- boolean didStart = false;
- if (localRouterClass == null){
- localRouterClass = defineLocalSdlRouterClass();
- // we need to check this again because for USB apps, the returned class can still be null
- if (localRouterClass != null) {
-
- // Check if the service declaration in AndroidManifest has the intent-filter action specified correctly
- boolean serviceFilterHasAction = false;
- String className = localRouterClass.getName();
- List<SdlAppInfo> services = AndroidTools.querySdlAppInfo(context, null);
- for (SdlAppInfo sdlAppInfo : services) {
- if(sdlAppInfo != null && sdlAppInfo.getRouterServiceComponentName() != null && className.equals((sdlAppInfo.getRouterServiceComponentName().getClassName()))){
- serviceFilterHasAction = true;
- break;
- }
- }
- if (!serviceFilterHasAction){
- Log.e(TAG, "WARNING: This application has not specified its intent-filter for the SdlRouterService. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
- }
-
- // Check if the service declaration in AndroidManifest has the router service version metadata specified correctly
- ResolveInfo info = context.getPackageManager().resolveService(new Intent(context, localRouterClass), PackageManager.GET_META_DATA);
- if (info != null) {
- if (info.serviceInfo.metaData == null || !info.serviceInfo.metaData.containsKey(context.getString(R.string.sdl_router_service_version_name))) {
- Log.e(TAG, "WARNING: This application has not specified its metadata tags for the SdlRouterService. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
- }
- } else {
- Log.e(TAG, "WARNING: This application has not specified its SdlRouterService correctly in the manifest. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
- }
- }
- }
-
- //This will only be true if we are being told to reopen our SDL service because SDL is enabled
- if(action.equalsIgnoreCase(TransportConstants.START_ROUTER_SERVICE_ACTION)){
- if(intent.hasExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_EXTRA)){
- if(intent.getBooleanExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_EXTRA, false)){
- String packageName = intent.getStringExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_APP_PACKAGE);
- final ComponentName componentName = intent.getParcelableExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_CMP_NAME);
- if(componentName!=null){
- final Intent finalIntent = intent;
- final Context finalContext = context;
- RouterServiceValidator.createTrustedListRequest(context, false, new TrustedListCallback(){
- @Override
- public void onListObtained(boolean successful) {
- //Log.v(TAG, "SDL enabled by router service from " + packageName + " compnent package " + componentName.getPackageName() + " - " + componentName.getClassName());
- //List obtained. Let's start our service
- queuedService = componentName;
- finalIntent.setAction("com.sdl.noaction"); //Replace what's there so we do go into some unintended loop
- String transportType = finalIntent.getStringExtra(TransportConstants.START_ROUTER_SERVICE_TRANSPORT_CONNECTED);
- if(transportType!= null ){
- if(TransportType.USB.toString().equals(transportType)){
- finalIntent.putExtra(UsbManager.EXTRA_ACCESSORY, (Parcelable)null);
- }
- }
- onSdlEnabled(finalContext, finalIntent);
- }
-
- });
- }
-
- }else{
- //This was previously not hooked up, so let's leave it commented out
- //onSdlDisabled(context);
- }
- return;
- }else if(intent.getBooleanExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, false)){
- //We were told to wake up our router services
- boolean altServiceWake = intent.getBooleanExtra(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT, false);
- didStart = wakeUpRouterService(context, false,altServiceWake,device );
-
- }
- }
-
-
- Log.d(TAG, "Check for local router");
- if(localRouterClass!=null){ //If there is a supplied router service lets run some logic regarding starting one
-
- if(!didStart){Log.d(TAG, "attempting to wake up router service");
- didStart = wakeUpRouterService(context, true,false, device);
- }
-
- //So even though we started our own version, on some older phones we find that two services are started up so we want to make sure we send our version that we are working with
- //We will send it an intent with the version number of the local instance and an intent to start this instance
-
- Intent serviceIntent = new Intent(context, localRouterClass);
- SdlRouterService.LocalRouterService self = SdlRouterService.getLocalRouterService(serviceIntent, serviceIntent.getComponent());
- Intent restart = new Intent(SdlRouterService.REGISTER_NEWER_SERVER_INSTANCE_ACTION);
- restart.putExtra(LOCAL_ROUTER_SERVICE_EXTRA, self);
- restart.putExtra(LOCAL_ROUTER_SERVICE_DID_START_OWN, didStart);
- context.sendBroadcast(restart);
- }
- }
-
- private boolean wakeUpRouterService(final Context context, final boolean ping, final boolean altTransportWake, final BluetoothDevice device){
- new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() {
- @Override
- public void onComplete(Vector<ComponentName> routerServices) {
- runningBluetoothServicePackage = new Vector<ComponentName>();
- runningBluetoothServicePackage.addAll(routerServices);
- if (runningBluetoothServicePackage.isEmpty()) {
- //If there isn't a service running we should try to start one
- //We will try to sort the SDL enabled apps and find the one that's been installed the longest
- Intent serviceIntent;
- List<SdlAppInfo> sdlAppInfoList = AndroidTools.querySdlAppInfo(context, new SdlAppInfo.BestRouterComparator());
- if (sdlAppInfoList != null && !sdlAppInfoList.isEmpty()) {
- serviceIntent = new Intent();
- serviceIntent.setComponent(sdlAppInfoList.get(0).getRouterServiceComponentName());
- } else{
- Log.d(TAG, "No SDL Router Services found");
- Log.d(TAG, "WARNING: This application has not specified its SdlRouterService correctly in the manifest. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
- return;
- }
- if (altTransportWake) {
- serviceIntent.setAction(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT);
- }
- if(device != null){
- serviceIntent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
- }
- try {
- if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
- context.startService(serviceIntent);
- }else {
- serviceIntent.putExtra(FOREGROUND_EXTRA, true);
- context.startForegroundService(serviceIntent);
-
- }
- //Make sure to send this out for old apps to close down
- SdlRouterService.LocalRouterService self = SdlRouterService.getLocalRouterService(serviceIntent, serviceIntent.getComponent());
- Intent restart = new Intent(SdlRouterService.REGISTER_NEWER_SERVER_INSTANCE_ACTION);
- restart.putExtra(LOCAL_ROUTER_SERVICE_EXTRA, self);
- restart.putExtra(LOCAL_ROUTER_SERVICE_DID_START_OWN, true);
- context.sendBroadcast(restart);
-
- } catch (SecurityException e) {
- Log.e(TAG, "Security exception, process is bad");
- }
- } else {
- if (altTransportWake) {
- wakeRouterServiceAltTransport(context);
- return;
- }else{
- for(ComponentName service : runningBluetoothServicePackage){
- pingRouterService(context,service.getPackageName(),service.getClassName());
- }
- }
- return;
- }
- }
- });
- return true;
- }
-
- private void wakeRouterServiceAltTransport(Context context){
- Intent serviceIntent = new Intent();
- serviceIntent.setAction(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT);
- for (ComponentName compName : runningBluetoothServicePackage) {
- serviceIntent.setComponent(compName);
- context.startService(serviceIntent);
-
- }
- }
-
- /**
- * Determines if an instance of the Router Service is currently running on the device.<p>
- * <b>Note:</b> This method no longer works on Android Oreo or newer
- * @param context A context to access Android system services through.
- * @param pingService Set this to true if you want to make sure the service is up and listening to bluetooth
- * @return True if a SDL Router Service is currently running, false otherwise.
- */
- private static boolean isRouterServiceRunning(Context context, boolean pingService){
- if(context == null){
- Log.e(TAG, "Can't look for router service, context supplied was null");
- return false;
- }
- if (runningBluetoothServicePackage == null) {
- runningBluetoothServicePackage = new Vector<ComponentName>();
- } else {
- runningBluetoothServicePackage.clear();
- }
- ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
- manager.getRunningAppProcesses();
- List<RunningServiceInfo> runningServices = null;
- try {
- runningServices = manager.getRunningServices(Integer.MAX_VALUE);
- } catch (NullPointerException e) {
- Log.e(TAG, "Can't get list of running services");
- return false;
- }
- for (RunningServiceInfo service : runningServices) {
- //We will check to see if it contains this name, should be pretty specific
- //Log.d(TAG, "Found Service: "+ service.service.getClassName());
- if ((service.service.getClassName()).toLowerCase(Locale.US).contains(SDL_ROUTER_SERVICE_CLASS_NAME) && AndroidTools.isServiceExported(context, service.service)) {
- runningBluetoothServicePackage.add(service.service); //Store which instance is running
- if (pingService) {
- pingRouterService(context, service.service.getPackageName(), service.service.getClassName());
- }
- }
- }
- return runningBluetoothServicePackage.size() > 0;
-
- }
-
- /**
- * Attempts to ping a running router service
- * @param context A context to access Android system services through.
- * @param packageName Package name for service to ping
- * @param className Class name for service to ping
- */
- protected static void pingRouterService(Context context, String packageName, String className){
- if(context == null || packageName == null || className == null){
- return;
- }
- try{
- Intent intent = new Intent();
- intent.setClassName(packageName, className);
- intent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true);
- 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
- }
- }
-
- /**
- * This call will reach out to all SDL related router services to check if they're connected. If a the router service is connected, it will react by pinging all clients. This receiver will then
- * receive that ping and if the router service is trusted, the onSdlEnabled method will be called.
- * @param context
- */
- public static void queryForConnectedService(final Context context){
- //Leverage existing call. Include ping bit
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
- ServiceFinder finder = new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() {
- @Override
- public void onComplete(Vector<ComponentName> routerServices) {
- runningBluetoothServicePackage = new Vector<ComponentName>();
- runningBluetoothServicePackage.addAll(routerServices);
- requestTransportStatus(context,null,true,false);
- }
- });
-
- }else{
- requestTransportStatus(context,null,true,true);
- }
- }
- /**
- * If a Router Service is running, this method determines if that service is connected to a device over some form of transport.
- * @param context A context to access Android system services through. If null is passed, this will always return false
- * @param callback Use this callback to find out if the router service is connected or not.
- */
- @Deprecated
- public static void requestTransportStatus(Context context, final SdlRouterStatusProvider.ConnectedStatusCallback callback){
- requestTransportStatus(context,callback,false, true);
- }
-
- private static void requestTransportStatus(Context context, final SdlRouterStatusProvider.ConnectedStatusCallback callback, final boolean triggerRouterServicePing, final boolean lookForServices){
- if(context == null){
- if(callback!=null){
- callback.onConnectionStatusUpdate(false, null,context);
- }
- return;
- }
- if((!lookForServices || isRouterServiceRunning(context,false)) && !runningBluetoothServicePackage.isEmpty()){ //So there is a service up, let's see if it's connected
- final ConcurrentLinkedQueue<ComponentName> list = new ConcurrentLinkedQueue<ComponentName>(runningBluetoothServicePackage);
- final SdlRouterStatusProvider.ConnectedStatusCallback sdlBrCallback = new SdlRouterStatusProvider.ConnectedStatusCallback() {
-
- @Override
- public void onConnectionStatusUpdate(boolean connected, ComponentName service,Context context) {
- if(!connected && !list.isEmpty()){
- SdlRouterStatusProvider provider = new SdlRouterStatusProvider(context,list.poll(), this);
- if(triggerRouterServicePing){provider.setFlags(TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING); }
- provider.checkIsConnected();
- }else{
- if(service!=null){
- Log.d(TAG, service.getPackageName() + " is connected = " + connected);
- }else{
- Log.d(TAG,"No service is connected/running");
- }
- if(callback!=null){
- callback.onConnectionStatusUpdate(connected, service,context);
- }
- list.clear();
- }
-
- }
- };
- final SdlRouterStatusProvider provider = new SdlRouterStatusProvider(context,list.poll(),sdlBrCallback);
- if(triggerRouterServicePing){
- provider.setFlags(TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING);
- }
- //Lets ensure we have a current list of trusted router services
- RouterServiceValidator.createTrustedListRequest(context, false, new TrustedListCallback(){
- @Override
- public void onListObtained(boolean successful) {
- //This will kick off our check of router services
- provider.checkIsConnected();
- }
- });
-
- }else{
- Log.w(TAG, "Router service isn't running, returning false.");
- if(isBluetoothConnected()){
- Log.d(TAG, "Bluetooth is connected. Attempting to start Router Service");
- Intent serviceIntent = new Intent();
- serviceIntent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION);
- serviceIntent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true);
- AndroidTools.sendExplicitBroadcast(context,serviceIntent,null);
- }
- if(callback!=null){
- callback.onConnectionStatusUpdate(false, null,context);
- }
- }
- }
-
- @SuppressWarnings({"MissingPermission"})
- private static boolean isBluetoothConnected() {
- BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
- if(bluetoothAdapter != null && bluetoothAdapter.isEnabled()) {
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- int a2dpState = bluetoothAdapter.getProfileConnectionState(BluetoothProfile.A2DP);
- int headSetState = bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET);
-
- return ((a2dpState == BluetoothAdapter.STATE_CONNECTED || a2dpState == BluetoothAdapter.STATE_CONNECTING)
- && (headSetState == BluetoothAdapter.STATE_CONNECTED || headSetState == BluetoothAdapter.STATE_CONNECTING));
- }else{
- return true;
- }
- }
- return false;
- }
-
- public static ComponentName consumeQueuedRouterService(){
- synchronized(QUEUED_SERVICE_LOCK){
- ComponentName retVal = queuedService;
- queuedService = null;
- return retVal;
- }
- }
-
- /**
- * We need to define this for local copy of the Sdl Router Service class.
- * It will be the main point of connection for Sdl enabled apps
- * @return Return the local copy of SdlRouterService.class
- * {@inheritDoc}
- */
- public abstract Class<? extends SdlRouterService> defineLocalSdlRouterClass();
-
-
-
- /**
- *
- * The developer will need to define exactly what should happen when Sdl is enabled.
- * This method will only get called when a Sdl session is initiated.
- * <p> The most useful code here would be to start the activity or service that handles most of the Livio
- * Connect code.
- * @param context this is the context that was passed to this receiver when it was called.
- * @param intent this is the intent that alerted this broadcast. Make sure to pass all extra it came with to your service/activity
- * {@inheritDoc}
- */
- public abstract void onSdlEnabled(Context context, Intent intent);
-
- //public abstract void onSdlDisabled(Context context); //Removing for now until we're able to abstract from developer
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlPsm.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlPsm.java
deleted file mode 100644
index f5b650722..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlPsm.java
+++ /dev/null
@@ -1,261 +0,0 @@
-package com.smartdevicelink.transport;
-
-import com.smartdevicelink.protocol.SdlPacket;
-
-import static com.smartdevicelink.protocol.SdlProtocol.V1_HEADER_SIZE;
-import static com.smartdevicelink.protocol.SdlProtocol.V1_V2_MTU_SIZE;
-
-
-public class SdlPsm{
- //private static final String TAG = "Sdl PSM";
- //Each state represents the byte that should be incomming
-
- public static final int START_STATE = 0x0;
- public static final int SERVICE_TYPE_STATE = 0x02;
- public static final int CONTROL_FRAME_INFO_STATE = 0x03;
- public static final int SESSION_ID_STATE = 0x04;
- public static final int DATA_SIZE_1_STATE = 0x05;
- public static final int DATA_SIZE_2_STATE = 0x06;
- public static final int DATA_SIZE_3_STATE = 0x07;
- public static final int DATA_SIZE_4_STATE = 0x08;
- public static final int MESSAGE_1_STATE = 0x09;
- public static final int MESSAGE_2_STATE = 0x0A;
- public static final int MESSAGE_3_STATE = 0x0B;
- public static final int MESSAGE_4_STATE = 0x0C;
- public static final int DATA_PUMP_STATE = 0x0D;
- public static final int FINISHED_STATE = 0xFF;
- public static final int ERROR_STATE = -1;
-
-
- private static final byte FIRST_FRAME_DATA_SIZE = 0x08;
-
- private static final int VERSION_MASK = 0xF0; //4 highest bits
- private static final int COMPRESSION_MASK = 0x08; //4th lowest bit
- private static final int FRAME_TYPE_MASK = 0x07; //3 lowest bits
-
-
-
- int state ;
-
- int version;
- boolean compression;
- int frameType;
- int serviceType;
- int controlFrameInfo;
- int sessionId;
- int dumpSize, dataLength;
- int messageId = 0;
-
- byte[] payload;
-
- public SdlPsm(){
- reset();
- }
-
- public boolean handleByte(byte data) {
- //Log.trace(TAG, data + " = incomming");
- state = transitionOnInput(data,state);
-
- if(state==ERROR_STATE){
- return false;
- }
- return true;
- }
-
- private int transitionOnInput(byte rawByte, int state){
- switch(state){
- case START_STATE:
- version = (rawByte&(byte)VERSION_MASK)>>4;
- //Log.trace(TAG, "Version: " + version);
- if(version==0){ //It should never be 0
- return ERROR_STATE;
- }
- compression = (1 == ((rawByte&(byte)COMPRESSION_MASK)>>3));
-
-
- frameType = rawByte&(byte)FRAME_TYPE_MASK;
- //Log.trace(TAG, rawByte + " = Frame Type: " + frameType);
-
- if((version < 1 || version > 5) //These are known versions supported by this library.
- && frameType!=SdlPacket.FRAME_TYPE_CONTROL){
- return ERROR_STATE;
- }
-
- if(frameType<SdlPacket.FRAME_TYPE_CONTROL || frameType > SdlPacket.FRAME_TYPE_CONSECUTIVE){
- return ERROR_STATE;
- }
-
- return SERVICE_TYPE_STATE;
-
- case SERVICE_TYPE_STATE:
- serviceType = (int)(rawByte&0xFF);
- return CONTROL_FRAME_INFO_STATE;
-
- case CONTROL_FRAME_INFO_STATE:
- controlFrameInfo = (int)(rawByte&0xFF);
- //Log.trace(TAG,"Frame Info: " + controlFrameInfo);
- switch(frameType){
- case SdlPacket.FRAME_TYPE_CONTROL:
- /*if(frameInfo<FRAME_INFO_HEART_BEAT
- || (frameInfo>FRAME_INFO_END_SERVICE_ACK
- && (frameInfo!=FRAME_INFO_SERVICE_DATA_ACK || frameInfo!=FRAME_INFO_HEART_BEAT_ACK))){
- return ERROR_STATE;
- }*/ //Although some bits are reserved...whatever
- break;
- case SdlPacket.FRAME_TYPE_SINGLE: //Fall through since they are both the same
- case SdlPacket.FRAME_TYPE_FIRST:
- if(controlFrameInfo!=0x00){
- return ERROR_STATE;
- }
- break;
- case SdlPacket.FRAME_TYPE_CONSECUTIVE:
- //It might be a good idea to check packet sequence numbers here
- break;
-
- default:
- return ERROR_STATE;
- }
- return SESSION_ID_STATE;
-
- case SESSION_ID_STATE:
- sessionId = (int)(rawByte&0xFF);
- return DATA_SIZE_1_STATE;
-
- case DATA_SIZE_1_STATE:
- //First data size byte
- //Log.d(TAG, "Data byte 1: " + rawByte);
- dataLength += ((int)(rawByte& 0xFF))<<24; //3 bytes x 8 bits
- //Log.d(TAG, "Data Size 1 : " + dataLength);
- return DATA_SIZE_2_STATE;
-
- case DATA_SIZE_2_STATE:
- //Log.d(TAG, "Data byte 2: " + rawByte);
- dataLength += ((int)(rawByte& 0xFF))<<16; //2 bytes x 8 bits
- //Log.d(TAG, "Data Size 2 : " + dataLength);
- return DATA_SIZE_3_STATE;
-
- case DATA_SIZE_3_STATE:
- //Log.d(TAG, "Data byte 3: " + rawByte);
- dataLength += ((int)(rawByte& 0xFF))<<8; //1 byte x 8 bits
- //Log.d(TAG, "Data Size 3 : " + dataLength);
- return DATA_SIZE_4_STATE;
-
- case DATA_SIZE_4_STATE:
- //Log.d(TAG, "Data byte 4: " + rawByte);
- dataLength+=((int)rawByte) & 0xFF;
- //Log.trace(TAG, "Data Size: " + dataLength);
- //We should have data length now for the pump state
- switch(frameType){ //If all is correct we should break out of this switch statement
- case SdlPacket.FRAME_TYPE_SINGLE:
- case SdlPacket.FRAME_TYPE_CONSECUTIVE:
- break;
- case SdlPacket.FRAME_TYPE_CONTROL:
- //Ok, well here's some interesting bit of knowledge. Because the start session request is from the phone with no knowledge of version it sends out
- //a v1 packet. THEREFORE there is no message id field. **** Now you know and knowing is half the battle ****
- if(version==1 && controlFrameInfo == SdlPacket.FRAME_INFO_START_SERVICE){
- if(dataLength==0){
- return FINISHED_STATE; //We are done if we don't have any payload
- }
- if(dataLength <= V1_V2_MTU_SIZE - V1_HEADER_SIZE){ // sizes from protocol/WiProProtocol.java
- payload = new byte[dataLength];
- }else{
- return ERROR_STATE;
- }
- dumpSize = dataLength;
- return DATA_PUMP_STATE;
- }
- break;
-
- case SdlPacket.FRAME_TYPE_FIRST:
- if(dataLength==FIRST_FRAME_DATA_SIZE){
- break;
- }
- default:
- return ERROR_STATE;
- }
- if(version==1){ //Version 1 packets will not have message id's
- if(dataLength == 0){
- return FINISHED_STATE; //We are done if we don't have any payload
- }
- if(dataLength <= V1_V2_MTU_SIZE - V1_HEADER_SIZE){ // sizes from protocol/WiProProtocol.java
- payload = new byte[dataLength];
- }else{
- return ERROR_STATE;
- }
- dumpSize = dataLength;
- return DATA_PUMP_STATE;
- }else{
- return MESSAGE_1_STATE;
- }
-
- case MESSAGE_1_STATE:
- messageId += ((int)(rawByte& 0xFF))<<24; //3 bytes x 8 bits
- return MESSAGE_2_STATE;
-
- case MESSAGE_2_STATE:
- messageId += ((int)(rawByte& 0xFF))<<16; //2 bytes x 8 bits
- return MESSAGE_3_STATE;
-
- case MESSAGE_3_STATE:
- messageId += ((int)(rawByte& 0xFF))<<8; //1 byte x 8 bits
- return MESSAGE_4_STATE;
-
- case MESSAGE_4_STATE:
- messageId+=((int)rawByte) & 0xFF;
-
- if(dataLength==0){
- return FINISHED_STATE; //We are done if we don't have any payload
- }
- try{
- payload = new byte[dataLength];
- }catch(OutOfMemoryError oom){
- return ERROR_STATE;
- }
- dumpSize = dataLength;
- return DATA_PUMP_STATE;
-
- case DATA_PUMP_STATE:
- payload[dataLength-dumpSize] = rawByte;
- dumpSize--;
- //Do we have any more bytes to read in?
- if(dumpSize>0){
- return DATA_PUMP_STATE;
- }
- else if(dumpSize==0){
- return FINISHED_STATE;
- }else{
- return ERROR_STATE;
- }
- case FINISHED_STATE: //We shouldn't be here...Should have been reset
- default:
- return ERROR_STATE;
-
- }
-
- }
-
- public SdlPacket getFormedPacket(){
- if(state==FINISHED_STATE){
- //Log.trace(TAG, "Finished packet.");
- return new SdlPacket(version, compression, frameType,
- serviceType, controlFrameInfo, sessionId,
- dataLength, messageId, payload);
- }else{
- return null;
- }
- }
-
- public int getState() {
- return state;
- }
-
- public void reset() {
- version = 0;
- state = START_STATE;
- messageId = 0;
- dataLength = 0;
- frameType = 0x00; //Set it to null
- payload = null;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
deleted file mode 100644
index a6069c8e1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
+++ /dev/null
@@ -1,3529 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.transport;
-
-import static com.smartdevicelink.transport.TransportConstants.CONNECTED_DEVICE_STRING_EXTRA_NAME;
-import static com.smartdevicelink.transport.TransportConstants.FORMED_PACKET_EXTRA_NAME;
-import static com.smartdevicelink.transport.TransportConstants.HARDWARE_DISCONNECTED;
-import static com.smartdevicelink.transport.TransportConstants.SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-import java.util.Vector;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.Manifest;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.app.ActivityManager;
-import android.app.ActivityManager.RunningAppProcessInfo;
-import android.app.Notification;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.app.Service;
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.SharedPreferences;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.DeadObjectException;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.IBinder.DeathRecipient;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.Parcel;
-import android.os.ParcelFileDescriptor;
-import android.os.Parcelable;
-import android.os.RemoteException;
-import android.util.Log;
-import android.util.SparseArray;
-import android.util.SparseIntArray;
-
-import com.smartdevicelink.R;
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.BinaryFrameHeader;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.protocol.SdlPacketFactory;
-import com.smartdevicelink.protocol.enums.ControlFrameTags;
-import com.smartdevicelink.protocol.enums.FrameType;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.ByteAraryMessageAssembler;
-import com.smartdevicelink.transport.utl.ByteArrayMessageSpliter;
-import com.smartdevicelink.transport.utl.TransportRecord;
-import com.smartdevicelink.util.AndroidTools;
-import com.smartdevicelink.util.BitConverter;
-import com.smartdevicelink.util.SdlAppInfo;
-
-import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
-import static com.smartdevicelink.transport.TransportConstants.SDL_NOTIFICATION_CHANNEL_ID;
-import static com.smartdevicelink.transport.TransportConstants.SDL_NOTIFICATION_CHANNEL_NAME;
-import static com.smartdevicelink.transport.TransportConstants.TRANSPORT_DISCONNECTED;
-
-/**
- * <b>This class should not be modified by anyone outside of the approved contributors of the SmartDeviceLink project.</b>
- * This service is a central point of communication between hardware and the registered clients. It will multiplex a single transport
- * to provide a connection for a theoretical infinite amount of SDL sessions.
- * @author Joey Grover
- *
- */
-@SuppressWarnings({"UnusedReturnValue", "WeakerAccess", "Convert2Diamond", "deprecation"})
-public class SdlRouterService extends Service{
-
- private static final String TAG = "Sdl Router Service";
- /**
- * <b> NOTE: DO NOT MODIFY THIS UNLESS YOU KNOW WHAT YOU'RE DOING.</b>
- */
- protected static final int ROUTER_SERVICE_VERSION_NUMBER = 8;
-
- private static final String ROUTER_SERVICE_PROCESS = "com.smartdevicelink.router";
-
- private static final int FOREGROUND_SERVICE_ID = 849;
-
- private static final long CLIENT_PING_DELAY = 1000;
-
- public static final String REGISTER_NEWER_SERVER_INSTANCE_ACTION = "com.sdl.android.newservice";
-
- public static final String SDL_NOTIFICATION_FAQS_PAGE = "https://smartdevicelink.com/en/guides/android/frequently-asked-questions/sdl-notifications/";
-
- /**
- * @deprecated use {@link TransportConstants#START_ROUTER_SERVICE_ACTION} instead
- */
- @Deprecated
- public static final String START_SERVICE_ACTION = "sdl.router.startservice";
- public static final String REGISTER_WITH_ROUTER_ACTION = "com.sdl.android.register";
-
- /** Message types sent from the BluetoothReadService Handler */
- public static final int MESSAGE_STATE_CHANGE = 1;
- public static final int MESSAGE_READ = 2;
- @SuppressWarnings("unused")
- public static final int MESSAGE_WRITE = 3;
- public static final int MESSAGE_DEVICE_NAME = 4;
- public static final int MESSAGE_LOG = 5;
-
- @SuppressWarnings("FieldCanBeLocal")
- private final int UNREGISTER_APP_INTERFACE_CORRELATION_ID = 65530;
-
- /* Bluetooth Transport */
- private MultiplexBluetoothTransport bluetoothTransport = null;
- private final Handler bluetoothHandler = new TransportHandler(this);
-
- /* USB Transport */
- private MultiplexUsbTransport usbTransport;
- private final Handler usbHandler = new TransportHandler(this);
-
- /* TCP Transport */
- private MultiplexTcpTransport tcpTransport;
- private final Handler tcpHandler = new TransportHandler(this);
-
- /**
- * Preference location where the service stores known SDL status based on device address
- */
- protected static final String SDL_DEVICE_STATUS_SHARED_PREFS = "sdl.device.status";
-
-
-
- private static boolean connectAsClient = false;
- private static boolean closing = false;
-
- private Handler altTransportTimerHandler, foregroundTimeoutHandler;
- private Runnable altTransportTimerRunnable, foregroundTimeoutRunnable;
- private final static int ALT_TRANSPORT_TIMEOUT_RUNNABLE = 30000, FOREGROUND_TIMEOUT = 10000;
-
- private boolean wrongProcess = false;
- private boolean initPassed = false;
-
- public static HashMap<String,RegisteredApp> registeredApps;
- private SparseArray<String> bluetoothSessionMap, usbSessionMap, tcpSessionMap;
- private SparseIntArray sessionHashIdMap;
- private SparseIntArray cleanedSessionMap;
- 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;
-
- private boolean startSequenceComplete = false;
-
- private ExecutorService packetExecutor = null;
- HashMap<TransportType, PacketWriteTaskMaster> packetWriteTaskMasterMap = null;
-
-
- /**
- * This flag is to keep track of if we are currently acting as a foreground service
- */
- private boolean isForeground = false;
-
- private int cachedModuleVersion = -1;
-
- /**
- * Executor for making sure clients are still running during trying times
- */
- private ScheduledExecutorService clientPingExecutor = null;
- Intent pingIntent = null;
- private boolean isPingingClients = false;
- int pingCount = 0;
-
-
- /* **************************************************************************************************************************************
- ****************************************************************************************************************************************
- *********************************************** Broadcast Receivers START **************************************************************
- ****************************************************************************************************************************************
- ****************************************************************************************************************************************/
-
- /** create our receiver from the router service */
- final BroadcastReceiver mainServiceReceiver = new BroadcastReceiver()
- {
- @Override
- public void onReceive(Context context, Intent intent)
- {
- //Let's grab where to reply to this intent at. We will keep it temp right now because we may have to deny registration
- String action =intent.getStringExtra(SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME);
- sendBroadcast(prepareRegistrationIntent(action));
- }
- };
-
- private Intent prepareRegistrationIntent(String action){
- Intent registrationIntent = new Intent();
- registrationIntent.setAction(action);
- registrationIntent.putExtra(TransportConstants.BIND_LOCATION_PACKAGE_NAME_EXTRA, this.getPackageName());
- registrationIntent.putExtra(TransportConstants.BIND_LOCATION_CLASS_NAME_EXTRA, this.getClass().getName());
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
- registrationIntent.setFlags((Intent.FLAG_RECEIVER_FOREGROUND));
- }
- return registrationIntent;
- }
-
- private void onAppRegistered(RegisteredApp app){
- //Log.enableDebug(receivedIntent.getBooleanExtra(LOG_BASIC_DEBUG_BOOLEAN_EXTRA, false));
- //Log.enableBluetoothTraceLogging(receivedIntent.getBooleanExtra(LOG_TRACE_BT_DEBUG_BOOLEAN_EXTRA, false));
- //Ok this is where we should do some authenticating...maybe.
- //Should we ask for all relevant data in this packet?
- if(bluetoothAvailable()){
- if(startSequenceComplete &&
- !connectAsClient && (bluetoothTransport ==null
- || bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_NONE)){
- Log.e(TAG, "Serial service not initialized while registering app");
- //Maybe we should try to do a connect here instead
- Log.d(TAG, "Serial service being restarted");
- initBluetoothSerialService();
-
-
- }
- }
-
- Log.i(TAG, app.appId + " has just been registered with SDL Router Service");
- }
-
- /**
- * If the user disconnects the bluetooth device we will want to stop SDL and our current
- * connection through RFCOMM
- */
- final BroadcastReceiver mListenForDisconnect = new BroadcastReceiver()
- {
- @Override
- @SuppressWarnings("MissingPermission")
- public void onReceive(Context context, Intent intent)
- {
- String action = intent.getAction();
- if(action == null){
- Log.d(TAG, "Disconnect received with no action.");
- }else {
- Log.d(TAG, "Disconnect received. Action: " + intent.getAction());
-
- if(action.equalsIgnoreCase(BluetoothAdapter.ACTION_STATE_CHANGED)){
- int bluetoothState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1);
- switch (bluetoothState) {
- case BluetoothAdapter.STATE_TURNING_ON:
- case BluetoothAdapter.STATE_ON:
- //There is nothing to do in the case the adapter is turning on or just switched to on
- return;
- case BluetoothAdapter.STATE_TURNING_OFF:
- case BluetoothAdapter.STATE_OFF:
- Log.d(TAG, "Bluetooth is shutting off, SDL Router Service is closing.");
- connectAsClient = false;
- if(!shouldServiceRemainOpen(intent)){
- closeSelf();
- }
- return;
- default:
- break;
- }
- }
- //Otherwise
- connectAsClient = false;
- if (legacyModeEnabled) {
- Log.d(TAG, "Legacy mode enabled and bluetooth d/c'ed, restarting router service bluetooth.");
- enableLegacyMode(false);
- onTransportDisconnected(new TransportRecord(TransportType.BLUETOOTH,null));
- initBluetoothSerialService();
- }
- }
- }
- };
-
-/* **************************************************************************************************************************************
-*********************************************** Broadcast Receivers End **************************************************************
-****************************************************************************************************************************************/
-
- /* **************************************************************************************************************************************
- *********************************************** Handlers for bound clients **************************************************************
- ****************************************************************************************************************************************/
-
-
- /**
- * Target we publish for clients to send messages to RouterHandler.
- */
- final Messenger routerMessenger = new Messenger(new RouterHandler(this));
-
- /**
- * Handler of incoming messages from clients.
- */
- @SuppressWarnings("Convert2Diamond")
- static class RouterHandler extends Handler {
- final WeakReference<SdlRouterService> provider;
-
- public RouterHandler(SdlRouterService provider){
- this.provider = new WeakReference<SdlRouterService>(provider);
- }
-
- @Override
- public void handleMessage(Message msg) {
- if(this.provider.get() == null){
- return;
- }
- final Bundle receivedBundle = msg.getData();
- Bundle returnBundle;
- final SdlRouterService service = this.provider.get();
-
- switch (msg.what) {
- case TransportConstants.ROUTER_REQUEST_BT_CLIENT_CONNECT:
- if(receivedBundle.getBoolean(TransportConstants.CONNECT_AS_CLIENT_BOOLEAN_EXTRA, false)
- && !connectAsClient){ //We check this flag to make sure we don't try to connect over and over again. On D/C we should set to false
- //Log.d(TAG,"Attempting to connect as bt client");
- BluetoothDevice device = receivedBundle.getParcelable(BluetoothDevice.EXTRA_DEVICE);
- connectAsClient = true;
- if(device==null || !service.bluetoothConnect(device)){
- Log.e(TAG, "Unable to connect to bluetooth device");
- connectAsClient = false;
- }
- }
- //**************** We don't break here so we can let the app register as well
- case TransportConstants.ROUTER_REGISTER_CLIENT: //msg.arg1 is appId
- //pingClients();
- Message message = Message.obtain();
- message.what = TransportConstants.ROUTER_REGISTER_CLIENT_RESPONSE;
- message.arg1 = TransportConstants.REGISTRATION_RESPONSE_SUCESS;
- String appId = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
- if(appId == null){
- appId = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
- }
- if(appId.length()<=0 || msg.replyTo == null){
- Log.w(TAG, "Unable to register app as no id or messenger was included");
- if(msg.replyTo!=null){
- message.arg1 = TransportConstants.REGISTRATION_RESPONSE_DENIED_APP_ID_NOT_INCLUDED;
- try {
- msg.replyTo.send(message);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- break;
- }
- if(service.legacyModeEnabled){
- Log.w(TAG, "Unable to register app as legacy mode is enabled");
- if(msg.replyTo!=null){
- message.arg1 = TransportConstants.REGISTRATION_RESPONSE_DENIED_LEGACY_MODE_ENABLED;
- try {
- msg.replyTo.send(message);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- break;
- }
-
- int routerMessagingVersion = receivedBundle.getInt(TransportConstants.ROUTER_MESSAGING_VERSION,1);
-
- RegisteredApp app = service.new RegisteredApp(appId, routerMessagingVersion, msg.replyTo);
-
- synchronized(service.REGISTERED_APPS_LOCK){
- RegisteredApp old = registeredApps.put(app.getAppId(), app);
- if(old!=null){
- Log.w(TAG, "Replacing already existing app with this app id");
- service.removeAllSessionsForApp(old, true);
- old.close();
- }
- }
- service.onAppRegistered(app);
-
- returnBundle = new Bundle();
- //Add params if connected
- if(service.isPrimaryTransportConnected()){
- ArrayList<TransportRecord> records = service.getConnectedTransports();
- returnBundle.putString(TransportConstants.HARDWARE_CONNECTED, records.get(records.size()-1).getType().name());
- if(app.routerMessagingVersion > 1) {
- returnBundle.putParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED, records);
- }
-
- if(service.bluetoothTransport != null){
- returnBundle.putString(CONNECTED_DEVICE_STRING_EXTRA_NAME, service.bluetoothTransport.getDeviceName());
- }
- }
- //Add the version of this router service
- returnBundle.putInt(TransportConstants.ROUTER_SERVICE_VERSION, SdlRouterService.ROUTER_SERVICE_VERSION_NUMBER);
-
- message.setData(returnBundle);
-
- int result = app.sendMessage(message);
- if(result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT){
- synchronized(service.REGISTERED_APPS_LOCK){
- registeredApps.remove(appId);
- }
- }
- break;
- case TransportConstants.ROUTER_UNREGISTER_CLIENT:
- String appIdToUnregister = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
- if(appIdToUnregister == null){
- appIdToUnregister = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
- }
- Log.i(TAG, "Unregistering client: " + appIdToUnregister);
- RegisteredApp unregisteredApp;
- synchronized(service.REGISTERED_APPS_LOCK){
- unregisteredApp = registeredApps.remove(appIdToUnregister);
- }
- Message response = Message.obtain();
- response.what = TransportConstants.ROUTER_UNREGISTER_CLIENT_RESPONSE;
- if(unregisteredApp == null){
- response.arg1 = TransportConstants.UNREGISTRATION_RESPONSE_FAILED_APP_ID_NOT_FOUND;
- service.removeAllSessionsWithAppId(appIdToUnregister);
- }else{
- response.arg1 = TransportConstants.UNREGISTRATION_RESPONSE_SUCESS;
- service.removeAllSessionsForApp(unregisteredApp,false);
- }
- Log.i(TAG, "Unregistering client response: " + response.arg1 );
- try {
- msg.replyTo.send(response); //We do this because we aren't guaranteed to find the correct registeredApp to send the message through
- } catch (RemoteException e) {
- e.printStackTrace();
-
- }catch(NullPointerException e2){
- Log.e(TAG, "No reply address included, can't send a reply");
- }
-
- break;
- case TransportConstants.ROUTER_SEND_PACKET:
- //Log.d(TAG, "Received packet to send");
- if(receivedBundle!=null){
- Runnable packetRun = new Runnable(){
- @Override
- public void run() {
- String buffAppId = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
- if(buffAppId == null){
- buffAppId = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
- }
-
- RegisteredApp buffApp;
- synchronized(service.REGISTERED_APPS_LOCK){
- buffApp = registeredApps.get(buffAppId);
- }
-
- if(buffApp !=null){
- buffApp.handleIncommingClientMessage(receivedBundle);
- }else{
- TransportType transportType = TransportType.valueForString(receivedBundle.getString(TransportConstants.TRANSPORT_TYPE));
- if(transportType == null){
-
- /* We check bluetooth first because we assume if this value
- * isn't included it is an older version of the proxy and
- * therefore will be expecting this to be bluetooth.
- */
- if(service.bluetoothTransport != null && service.bluetoothTransport.isConnected()){
- transportType = TransportType.BLUETOOTH;
- } else if(service.usbTransport!= null && service.usbTransport.isConnected()){
- transportType = TransportType.USB;
- } else if(service.tcpTransport != null && service.tcpTransport.isConnected()){
- transportType = TransportType.TCP;
- }
- //Log.d(TAG, "Transport type was null, so router set it to " + transportType.name());
- if(transportType != null){
- receivedBundle.putString(TransportConstants.TRANSPORT_TYPE, transportType.name());
- }
- }
- service.writeBytesToTransport(receivedBundle);
- }
- }
- };
- if(service.packetExecutor !=null){
- service.packetExecutor.execute(packetRun);
- }
- }
- break;
- case TransportConstants.ROUTER_REQUEST_NEW_SESSION:
- String appIdRequesting = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
- if(appIdRequesting == null){
- appIdRequesting = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
- }
- Message extraSessionResponse = Message.obtain();
- extraSessionResponse.what = TransportConstants.ROUTER_REQUEST_NEW_SESSION_RESPONSE;
- if(appIdRequesting.length()>0){
- synchronized(service.REGISTERED_APPS_LOCK){
- if(registeredApps!=null){
- RegisteredApp appRequesting = registeredApps.get(appIdRequesting);
- if(appRequesting!=null){
- //Retrieve the transport the app is requesting a new session
- String transport = receivedBundle.getString(TransportConstants.TRANSPORT_TYPE);
- TransportType requestingTransport = null;
- if(transport != null){
- try{
- requestingTransport = TransportType.valueOf(transport);
- }catch (IllegalArgumentException e){}
- }
- if(requestingTransport == null){
- /* We check bluetooth first because we assume if this value
- * isn't included it is an older version of the proxy and
- * therefore will be expecting this to be bluetooth.
- */
- if(service.bluetoothTransport != null && service.bluetoothTransport.isConnected()){
- requestingTransport = TransportType.BLUETOOTH;
- }else if(service.usbTransport!= null && service.usbTransport.isConnected()){
- requestingTransport = TransportType.USB;
- }else if(service.tcpTransport != null && service.tcpTransport.isConnected()){
- requestingTransport = TransportType.TCP;
- }
- }
- appRequesting.getSessionIds().add((long)-1); //Adding an extra session
- appRequesting.getAwaitingSession().add(requestingTransport);
- extraSessionResponse.arg1 = TransportConstants.ROUTER_REQUEST_NEW_SESSION_RESPONSE_SUCESS;
- }else{
- extraSessionResponse.arg1 = TransportConstants.ROUTER_REQUEST_NEW_SESSION_RESPONSE_FAILED_APP_NOT_FOUND;
- }
- }
- }
- }else{
- extraSessionResponse.arg1 = TransportConstants.ROUTER_REQUEST_NEW_SESSION_RESPONSE_FAILED_APP_ID_NOT_INCL;
- }
- try {
- msg.replyTo.send(extraSessionResponse); //We do this because we aren't guaranteed to find the correct registeredApp to send the message through
- } catch (RemoteException e) {
- e.printStackTrace();
- }catch(NullPointerException e2){
- Log.e(TAG, "No reply address included, can't send a reply");
- }
- break;
- case TransportConstants.ROUTER_REMOVE_SESSION:
- String appIdWithSession = receivedBundle.getString(TransportConstants.APP_ID_EXTRA_STRING);
- if(appIdWithSession == null){
- appIdWithSession = "" + receivedBundle.getLong(TransportConstants.APP_ID_EXTRA, -1);
- }
- long sessionId = receivedBundle.getLong(TransportConstants.SESSION_ID_EXTRA, -1);
-
- Message removeSessionResponse = Message.obtain();
- removeSessionResponse.what = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE;
- if(appIdWithSession.length()>0){
- if(sessionId>=0){
- synchronized(service.REGISTERED_APPS_LOCK){
- if(registeredApps!=null){
- RegisteredApp appRequesting = registeredApps.get(appIdWithSession);
- if(appRequesting!=null){
- //Might need to check which session is on which transport
- service.removeSessionFromMap((int)sessionId, appRequesting.getTransportsForSession((int)sessionId));
- if(appRequesting.removeSession(sessionId)){
- removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_SUCESS;
- }else{
- removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_FAILED_SESSION_NOT_FOUND;
- }
- }else{
- removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_FAILED_APP_NOT_FOUND;
- }
- }
- }
- }else{
- removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_FAILED_SESSION_ID_NOT_INCL;
- }
- }else{
- removeSessionResponse.arg1 = TransportConstants.ROUTER_REMOVE_SESSION_RESPONSE_FAILED_APP_ID_NOT_INCL;
- }
- try {
- msg.replyTo.send(removeSessionResponse); //We do this because we aren't guaranteed to find the correct registeredApp to send the message through
- } catch (RemoteException e) {
- e.printStackTrace();
- }catch(NullPointerException e2){
- Log.e(TAG, "No reply address included, can't send a reply");
- }
- break;
- case TransportConstants.ROUTER_REQUEST_SECONDARY_TRANSPORT_CONNECTION:
- // Currently this only handles one TCP connection
-
- String ipAddress = receivedBundle.getString(ControlFrameTags.RPC.TransportEventUpdate.TCP_IP_ADDRESS);
- int port = receivedBundle.getInt(ControlFrameTags.RPC.TransportEventUpdate.TCP_PORT);
-
- if(ipAddress != null){
- if(service.tcpTransport != null){
- switch (service.tcpTransport.getState()){
- case MultiplexBaseTransport.STATE_CONNECTED:
- case MultiplexBaseTransport.STATE_CONNECTING:
- // A TCP connection is currently active. This version of the
- // router service can't handle multiple TCP transports so just
- // return a connected message to requester.
- if(msg.replyTo != null){
- // Send a transport connect message to the app that requested
- // the tcp transport
- try {
- msg.replyTo.send(service.createHardwareConnectedMessage(service.tcpTransport.transportRecord));
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- //Nothing else to do, so return out of this method
- return;
-
- case MultiplexBaseTransport.STATE_NONE:
- case MultiplexBaseTransport.STATE_LISTEN:
- case MultiplexBaseTransport.STATE_ERROR:
- //Clear out tcp transport
- service.tcpTransport.stop(MultiplexBaseTransport.STATE_NONE);
- service.tcpTransport = null;
- //Do not return, need to create a new TCP connection
- }
-
- }//else { TCP transport does not exists.}
-
- //TCP transport either doesn't exist or is not connected. Start one up.
- service.tcpTransport = new MultiplexTcpTransport(port, ipAddress, true, service.tcpHandler, service);
- service.tcpTransport.start();
-
- }
- break;
- default:
- super.handleMessage(msg);
- }
- }
- }
-
-
- /**
- * Target we publish for alternative transport (USB) clients to send messages to RouterHandler.
- */
- final Messenger altTransportMessenger = new Messenger(new AltTransportHandler(this));
-
- /**
- * Handler of incoming messages from an alternative transport (USB).
- */
- @SuppressWarnings("Convert2Diamond")
- static class AltTransportHandler extends Handler {
- final ClassLoader loader;
- final WeakReference<SdlRouterService> provider;
-
- public AltTransportHandler(SdlRouterService provider){
- this.provider = new WeakReference<SdlRouterService>(provider);
- loader = getClass().getClassLoader();
- }
-
- @Override
- public void handleMessage(Message msg) {
- if(this.provider.get() == null){
- return;
- }
- SdlRouterService service = this.provider.get();
- Bundle receivedBundle = msg.getData();
- switch(msg.what){
- case TransportConstants.HARDWARE_CONNECTION_EVENT:
- if(receivedBundle.containsKey(TransportConstants.HARDWARE_DISCONNECTED)){
- //We should shut down, so call
- if(altTransportService != null
- && altTransportService.equals(msg.replyTo)){
- //The same transport that was connected to the router service is now telling us it's disconnected. Let's inform clients and clear our saved messenger
- altTransportService = null;
- service.onTransportDisconnected(new TransportRecord(TransportType.valueOf(receivedBundle.getString(TransportConstants.HARDWARE_DISCONNECTED)),null));
- service.shouldServiceRemainOpen(null); //this will close the service if bluetooth is not available
- }
- }else if(receivedBundle.containsKey(TransportConstants.HARDWARE_CONNECTED)){
- Message retMsg = Message.obtain();
- retMsg.what = TransportConstants.ROUTER_REGISTER_ALT_TRANSPORT_RESPONSE;
- if(altTransportService == null){ //Ok no other transport is connected, this is good
- Log.d(TAG, "Alt transport connected.");
- if(msg.replyTo == null){
- break;
- }
- altTransportService = msg.replyTo;
- //Clear out the timer to make sure the service knows we're good to go
- if(service.altTransportTimerHandler!=null && service.altTransportTimerRunnable!=null){
- service.altTransportTimerHandler.removeCallbacks(service.altTransportTimerRunnable);
- }
- service.altTransportTimerHandler = null;
- service.altTransportTimerRunnable = null;
-
- //Let the alt transport know they are good to go
- retMsg.arg1 = TransportConstants.ROUTER_REGISTER_ALT_TRANSPORT_RESPONSE_SUCESS;
- service.onTransportConnected(new TransportRecord(TransportType.valueOf(receivedBundle.getString(TransportConstants.HARDWARE_CONNECTED)),null));
-
- }else{ //There seems to be some other transport connected
- //Error
- retMsg.arg1 = TransportConstants.ROUTER_REGISTER_ALT_TRANSPORT_ALREADY_CONNECTED;
- }
- if(msg.replyTo!=null){
- try {msg.replyTo.send(retMsg);} catch (RemoteException e) {e.printStackTrace();}
- }
- }
- break;
- case TransportConstants.ROUTER_RECEIVED_PACKET:
- if(receivedBundle!=null){
- receivedBundle.setClassLoader(loader);//We do this because loading a custom parcelable object isn't possible without it
- if(receivedBundle.containsKey(TransportConstants.FORMED_PACKET_EXTRA_NAME)){
- SdlPacket packet = receivedBundle.getParcelable(TransportConstants.FORMED_PACKET_EXTRA_NAME);
- if(packet!=null){
- service.onPacketRead(packet);
- }else{
- Log.w(TAG, "Received null packet from alt transport service");
- }
- }else{
- Log.w(TAG, "False positive packet reception");
- }
- }else{
- Log.e(TAG, "Bundle was null while sending packet to router service from alt transport");
- }
- break;
- default:
- super.handleMessage(msg);
- }
-
- }
- }
-
- /**
- * Target we publish for alternative transport (USB) clients to send messages to RouterHandler.
- */
- final Messenger routerStatusMessenger = new Messenger(new RouterStatusHandler(this));
-
- /**
- * Handler of incoming messages from an alternative transport (USB).
- */
- @SuppressWarnings("Convert2Diamond")
- static class RouterStatusHandler extends Handler {
- final WeakReference<SdlRouterService> provider;
-
- public RouterStatusHandler(SdlRouterService provider){
- this.provider = new WeakReference<SdlRouterService>(provider);
- }
-
- @Override
- public void handleMessage(Message msg) {
- if(this.provider.get() == null){
- return;
- }
- SdlRouterService service = this.provider.get();
- switch(msg.what){
- case TransportConstants.ROUTER_STATUS_CONNECTED_STATE_REQUEST:
- int flags = msg.arg1;
- if(msg.replyTo!=null){
- Message message = Message.obtain();
- message.what = TransportConstants.ROUTER_STATUS_CONNECTED_STATE_RESPONSE;
- message.arg1 = (service.isPrimaryTransportConnected()) ? 1 : 0;
- try {
- msg.replyTo.send(message);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- if(service.isPrimaryTransportConnected() && ((TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING & flags) == TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING)){
- if(service.pingIntent == null){
- service.initPingIntent();
- }
- AndroidTools.sendExplicitBroadcast(service.getApplicationContext(),service.pingIntent, null);
- }
- break;
- default:
- Log.w(TAG, "Unsupported request: " + msg.what);
- break;
- }
- }
- }
-
-
- /**
- * Target we publish for alternative transport (USB) clients to send messages to RouterHandler.
- */
- final Messenger usbTransferMessenger = new Messenger(new UsbTransferHandler(this));
-
- /**
- * Handler of incoming messages from an alternative transport (USB).
- */
- @SuppressWarnings("Convert2Diamond")
- static class UsbTransferHandler extends Handler {
- final WeakReference<SdlRouterService> provider;
-
- public UsbTransferHandler(SdlRouterService provider){
- this.provider = new WeakReference<SdlRouterService>(provider);
- }
-
- @Override
- public void handleMessage(Message msg) {
- if(this.provider.get() == null){
- return;
- }
- SdlRouterService service = this.provider.get();
- switch(msg.what){
- case TransportConstants.USB_CONNECTED_WITH_DEVICE:
- int flags = msg.arg1;
- ParcelFileDescriptor parcelFileDescriptor = (ParcelFileDescriptor)msg.obj;
- if(parcelFileDescriptor != null){
- //New USB constructor with PFD
- service.usbTransport = new MultiplexUsbTransport(parcelFileDescriptor,service.usbHandler,msg.getData());
- service.usbTransport.start();
-
- }
- if(msg.replyTo!=null){
- Message message = Message.obtain();
- message.what = TransportConstants.ROUTER_USB_ACC_RECEIVED;
- try {
- msg.replyTo.send(message);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- if(service.isPrimaryTransportConnected() && ((TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING & flags) == TransportConstants.ROUTER_STATUS_FLAG_TRIGGER_PING)){
- if(service.pingIntent == null){
- service.initPingIntent();
- }
- AndroidTools.sendExplicitBroadcast(service.getApplicationContext(),service.pingIntent, null);
- }
- break;
- case TransportConstants.ALT_TRANSPORT_CONNECTED:
- break;
- default:
- Log.w(TAG, "Unsupported request: " + msg.what);
- break;
- }
- }
- }
-
-/* **************************************************************************************************************************************
-*********************************************** Life Cycle **************************************************************
-****************************************************************************************************************************************/
-
- @Override
- public IBinder onBind(Intent intent) {
- //Check intent to send back the correct binder (client binding vs alt transport)
- if(intent!=null){
- if(closing){
- Log.w(TAG, "Denying bind request due to service shutting down.");
- return null;
- }
- String requestType = intent.getAction();//intent.getIntExtra(TransportConstants.ROUTER_BIND_REQUEST_TYPE_EXTRA, TransportConstants.BIND_REQUEST_TYPE_CLIENT);
- if(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT.equals(requestType)){
- if(0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)){ //Only allow alt transport in debug mode
- return this.altTransportMessenger.getBinder();
- }
- }else if(TransportConstants.BIND_REQUEST_TYPE_CLIENT.equals(requestType)){
- return this.routerMessenger.getBinder();
- }else if(TransportConstants.BIND_REQUEST_TYPE_STATUS.equals(requestType)){
- return this.routerStatusMessenger.getBinder();
- }else if(TransportConstants.BIND_REQUEST_TYPE_USB_PROVIDER.equals(requestType)){
- return this.usbTransferMessenger.getBinder();
- }else{
- Log.w(TAG, "Unknown bind request type");
- }
-
- }
- return null;
- }
-
-
-
- @Override
- public boolean onUnbind(Intent intent) {
- Log.d(TAG, "Unbind being called.");
- return super.onUnbind(intent);
- }
-
-
- private void notifyClients(Message message){
- if(message==null){
- Log.w(TAG, "Can't notify clients, message was null");
- return;
- }
- Log.d(TAG, "Notifying "+ registeredApps.size()+ " clients");
- int result;
- synchronized(REGISTERED_APPS_LOCK){
- Collection<RegisteredApp> apps = registeredApps.values();
- Iterator<RegisteredApp> it = apps.iterator();
- while(it.hasNext()){
- RegisteredApp app = it.next();
- //Format the message for the receiving app and appropriate messaging version
- if(formatMessage(app, message)) {
- result = app.sendMessage(message);
- if (result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT) {
- app.close();
- it.remove();
- }
- }
- }
-
- }
- }
-
- /**
- * Formats the message for the app that is to receive it
- * @param app
- * @param message
- * @return if the message should be sent or not
- */
- protected boolean formatMessage(RegisteredApp app, Message message){
- if( app.routerMessagingVersion <= 1){
- Bundle bundle = message.getData();
- if (bundle != null){
- if(message.what == TransportConstants.HARDWARE_CONNECTION_EVENT) {
-
- switch (message.arg1){
- case TransportConstants.HARDWARE_CONNECTION_EVENT_CONNECTED:
- if(app.isRegisteredOnTransport(-1, null)){
- //App is already registered on a transport and does not need this update
- return false;
- }
- break;
- case TransportConstants.HARDWARE_CONNECTION_EVENT_DISCONNECTED:
- if(bundle.containsKey(TransportConstants.HARDWARE_DISCONNECTED)){
- TransportType transportType = TransportType.valueOf(bundle.getString(TransportConstants.HARDWARE_DISCONNECTED));
- if(!app.isRegisteredOnTransport(-1, transportType)){
- //App is not registered on this transport, not sending
- return false;
- }
- }
- if (bundle.containsKey(TransportConstants.TRANSPORT_DISCONNECTED)) {
- //Unable to handle new parcel TransportRecord
- bundle.remove(TransportConstants.TRANSPORT_DISCONNECTED);
- }
- break;
- }
-
- //All connection event messages should have this as part of the bundle
- if (bundle.containsKey(TransportConstants.CURRENT_HARDWARE_CONNECTED)) {
- //Unable to handle new parcel TransportRecord
- bundle.remove(TransportConstants.CURRENT_HARDWARE_CONNECTED);
- }
-
-
- }
- }
- }
- return true;
- }
-
- @SuppressWarnings("unused")
- private void pingClients(){
- Message message = Message.obtain();
- Log.d(TAG, "Pinging "+ registeredApps.size()+ " clients");
- int result;
- synchronized(REGISTERED_APPS_LOCK){
- Collection<RegisteredApp> apps = registeredApps.values();
- Iterator<RegisteredApp> it = apps.iterator();
- while(it.hasNext()){
- RegisteredApp app = it.next();
- result = app.sendMessage(message);
- if(result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT){
- app.close();
- Vector<Long> sessions = app.getSessionIds();
- for(Long session:sessions){
- if(session !=null && session != -1){
- List<TransportType> transportTypes = app.getTransportsForSession(session.intValue());
- if(transportTypes != null && transportTypes.size() > 0){
- attemptToCleanUpModule(session.intValue(), cachedModuleVersion, transportTypes.get(0) );
- }
- }
- }
- it.remove();
- }
- }
- }
- }
-
- /**
- * We want to make sure we are in the right process here. If there is some sort of developer error
- * we want to just close out right away.
- * @return if this service is executing in the correct process
- */
- private boolean processCheck(){
- int myPid = android.os.Process.myPid();
- ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
- if(am == null || am.getRunningAppProcesses() == null)
- return false; // No RunningAppProcesses, let's close out
- for (RunningAppProcessInfo processInfo : am.getRunningAppProcesses())
- {
- if (processInfo != null && processInfo.pid == myPid)
- {
- return ROUTER_SERVICE_PROCESS.equals(processInfo.processName);
- }
- }
- return false;
-
- }
-
- @SuppressWarnings("SameParameterValue")
- private boolean permissionCheck(String permissionToCheck){
- if(permissionToCheck == null){
- throw new IllegalArgumentException("permission is null");
- }
- return PackageManager.PERMISSION_GRANTED == getBaseContext().checkPermission(permissionToCheck, android.os.Process.myPid(), android.os.Process.myUid());
- }
-
- /**
- * Runs several checks to ensure this router service has the correct conditions to run properly
- * @return true if this service is set up correctly
- */
- private boolean initCheck(){
- if(!processCheck()){
- Log.e(TAG, "Not using correct process. Shutting down");
- wrongProcess = true;
- return false;
- }
- if(!permissionCheck(Manifest.permission.BLUETOOTH)){
- Log.e(TAG, "Bluetooth Permission is not granted. Shutting down");
- return false;
- }
- if(!AndroidTools.isServiceExported(this, new ComponentName(this, this.getClass()))){ //We want to check to see if our service is actually exported
- Log.e(TAG, "Service isn't exported. Shutting down");
- return false;
- }
- return true;
- }
-
-
- @Override
- public void onCreate() {
- super.onCreate();
- //This must be done regardless of if this service shuts down or not
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- enterForeground("Waiting for connection...", FOREGROUND_TIMEOUT/1000, false);
- resetForegroundTimeOut(FOREGROUND_TIMEOUT/1000);
- }
-
-
- if(!initCheck()){ // Run checks on process and permissions
- deployNextRouterService();
- stopSelf();
- return;
- }
- initPassed = true;
-
-
- synchronized(REGISTERED_APPS_LOCK){
- registeredApps = new HashMap<String,RegisteredApp>();
- }
- closing = false;
-
- synchronized(SESSION_LOCK){
- this.bluetoothSessionMap = new SparseArray<String>();
- this.sessionHashIdMap = new SparseIntArray();
- this.cleanedSessionMap = new SparseIntArray();
- }
-
- packetExecutor = Executors.newSingleThreadExecutor();
-
- startUpSequence();
- }
-
- /**
- * The method will attempt to start up the next router service in line based on the sorting criteria of best router service.
- */
- protected void deployNextRouterService(){
- List<SdlAppInfo> sdlAppInfoList = AndroidTools.querySdlAppInfo(getApplicationContext(), new SdlAppInfo.BestRouterComparator());
- if (sdlAppInfoList != null && !sdlAppInfoList.isEmpty()) {
- ComponentName name = new ComponentName(this, this.getClass());
- SdlAppInfo info;
- int listSize = sdlAppInfoList.size();
- for(int i = 0; i < listSize; i++) {
- info = sdlAppInfoList.get(i);
- if(info.getRouterServiceComponentName().equals(name) && listSize > i + 1){
- SdlAppInfo nextUp = sdlAppInfoList.get(i+1);
- Intent serviceIntent = new Intent();
- serviceIntent.setComponent(nextUp.getRouterServiceComponentName());
- if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
- startService(serviceIntent);
- }else{
- try{
- startForegroundService(serviceIntent);
- }catch (Exception e){
- Log.e(TAG, "Unable to start next SDL router service. " + e.getMessage());
- }
- }
- break;
-
- }
- }
- } else{
- Log.d(TAG, "No sdl apps found");
- return;
- }
- closing = true;
- closeBluetoothSerialServer();
- notifyAltTransportOfClose(TransportConstants.ROUTER_SHUTTING_DOWN_REASON_NEWER_SERVICE);
- }
-
- public void startUpSequence(){
- IntentFilter disconnectFilter = new IntentFilter();
- disconnectFilter.addAction(BluetoothDevice.ACTION_CLASS_CHANGED);
- disconnectFilter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
- disconnectFilter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED);
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
- disconnectFilter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
- }
- registerReceiver(mListenForDisconnect,disconnectFilter );
-
- IntentFilter filter = new IntentFilter();
- filter.addAction(REGISTER_WITH_ROUTER_ACTION);
- registerReceiver(mainServiceReceiver,filter);
-
- if(!connectAsClient){
- if(bluetoothAvailable()){
- initBluetoothSerialService();
- }
- }
-
- if(altTransportTimerHandler!=null){
- //There's an alt transport waiting for this service to be started
- Intent intent = new Intent(TransportConstants.ALT_TRANSPORT_RECEIVER);
- sendBroadcast(intent);
- }
-
- startSequenceComplete= true;
- }
-
-
- @SuppressLint({"NewApi", "MissingPermission"})
- @Override
- public int onStartCommand(Intent intent, int flags, int startId) {
- if(!initPassed) {
- return super.onStartCommand(intent, flags, startId);
- }
- if(registeredApps == null){
- synchronized(REGISTERED_APPS_LOCK){
- registeredApps = new HashMap<String,RegisteredApp>();
- }
- }
- if(intent != null ){
- if(intent.getBooleanExtra(FOREGROUND_EXTRA, false)){
- if(!this.isPrimaryTransportConnected()) { //If there is no transport connected we need to ensure the service is moved to the foreground
- String address = null;
- if(intent.hasExtra(BluetoothDevice.EXTRA_DEVICE)){
- BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
- if(device != null){
- address = device.getAddress();
- }
- }
- int timeout = getNotificationTimeout(address);
- enterForeground("Waiting for connection...", timeout, false);
- resetForegroundTimeOut(timeout);
- }else{
- enterForeground(createConnectedNotificationText(),0,true);
- }
- }
- if(intent.hasExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA)){
- //Make sure we are listening on RFCOMM
- if(startSequenceComplete){ //We only check if we are sure we are already through the start up process
- Log.i(TAG, "Received ping, making sure we are listening to bluetooth rfcomm");
- initBluetoothSerialService();
- }
- }
- }
- if(!shouldServiceRemainOpen(intent)){
- closeSelf();
- }
- return super.onStartCommand(intent, flags, startId);
- }
-
- @SuppressWarnings("ConstantConditions")
- @Override
- public void onDestroy(){
- stopClientPings();
-
- if(altTransportTimerHandler!=null){
- altTransportTimerHandler.removeCallbacks(altTransportTimerRunnable);
- altTransportTimerHandler = null;
- }
-
- Log.w(TAG, "Sdl Router Service Destroyed");
- closing = true;
- //No need for this Broadcast Receiver anymore
- unregisterAllReceivers();
- closeBluetoothSerialServer();
- if(registeredApps!=null){
- synchronized(REGISTERED_APPS_LOCK){
- registeredApps.clear();
- registeredApps = null;
- }
- }
- synchronized(SESSION_LOCK){
- if(this.bluetoothSessionMap !=null){
- this.bluetoothSessionMap.clear();
- this.bluetoothSessionMap = null;
- }
- if(this.sessionHashIdMap!=null){
- this.sessionHashIdMap.clear();
- this.sessionHashIdMap = null;
- }
- }
-
- //SESSION_LOCK = null;
-
- startSequenceComplete=false;
- if(packetExecutor !=null){
- packetExecutor.shutdownNow();
- packetExecutor = null;
- }
-
- exitForeground();
- if(packetWriteTaskMasterMap != null && packetWriteTaskMasterMap.values() != null) {
- Collection<PacketWriteTaskMaster> tasks = packetWriteTaskMasterMap.values();
- for (PacketWriteTaskMaster packetWriteTaskMaster : tasks) {
- if (packetWriteTaskMaster != null) {
- packetWriteTaskMaster.close();
- }
- }
- }
- if(packetWriteTaskMasterMap != null){
- packetWriteTaskMasterMap.clear();
- }
- packetWriteTaskMasterMap = null;
-
-
- super.onDestroy();
- System.gc(); //Lower end phones need this hint
- if(!wrongProcess){
- //noinspection EmptyCatchBlock
- try{
- android.os.Process.killProcess(android.os.Process.myPid());
- }catch(Exception e){}
- }
- }
-
- private void unregisterAllReceivers(){
- //noinspection EmptyCatchBlock
- try{
- unregisterReceiver(mListenForDisconnect);
- unregisterReceiver(mainServiceReceiver);
- }catch(Exception e){}
- }
-
- @SuppressWarnings("SameParameterValue")
- private void notifyAltTransportOfClose(int reason){
- if(altTransportService!=null){
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_SHUTTING_DOWN_NOTIFICATION;
- msg.arg1 = reason;
- try {
- altTransportService.send(msg);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Gets the correct timeout for the foreground notification.
- * @param address the address of the device that is currently connected
- * @return the amount of time for a timeout handler to remove the notification.
- */
- @SuppressLint("MissingPermission")
- private int getNotificationTimeout(String address){
- if(address != null){
- if(hasSDLConnected(address)){
- return FOREGROUND_TIMEOUT * 2;
- }else if(this.isFirstStatusCheck(address)) {
- // If this is the first time the service has ever connected to this device we want
- // to ensure we have a record of it
- setSDLConnectedStatus(address, false);
- }
- }
- // If this is a new device or hasn't connected through SDL we want to limit the exposure
- // of the SDL service in the foreground
- return FOREGROUND_TIMEOUT/1000;
- }
-
- public void resetForegroundTimeOut(long delay){
- if(android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR2){
- return;
- }
- 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);
- }
- }
-
- public void cancelForegroundTimeOut(){
- synchronized (NOTIFICATION_LOCK) {
- if (foregroundTimeoutHandler != null && foregroundTimeoutRunnable != null) {
- foregroundTimeoutHandler.removeCallbacks(foregroundTimeoutRunnable);
- }
- }
-
- }
-
- @SuppressLint("NewApi")
- @SuppressWarnings("deprecation")
- private void enterForeground(String content, long chronometerLength, boolean ongoing) {
- if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB){
- Log.w(TAG, "Unable to start service as foreground due to OS SDK version being lower than 11");
- isForeground = false;
- return;
- }
-
- Bitmap icon;
- int resourcesIncluded = getResources().getIdentifier("ic_sdl", "drawable", getPackageName());
-
- if ( resourcesIncluded != 0 ) { //No additional pylons required
- icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_sdl);
- }
- else {
- icon = BitmapFactory.decodeResource(getResources(), android.R.drawable.stat_sys_data_bluetooth);
- }
- // Bitmap icon = BitmapFactory.decodeByteArray(SdlLogo.SDL_LOGO_STRING, 0, SdlLogo.SDL_LOGO_STRING.length);
-
- 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{
- builder.setContentTitle("SmartDeviceLink");
- }
- builder.setTicker("SmartDeviceLink");
- builder.setContentText(content);
-
- //We should use icon from library resources if available
- int trayId = getResources().getIdentifier("sdl_tray_icon", "drawable", getPackageName());
-
- if ( resourcesIncluded != 0 ) { //No additional pylons required
- builder.setSmallIcon(trayId);
- }
- else {
- builder.setSmallIcon(android.R.drawable.stat_sys_data_bluetooth);
- }
- builder.setLargeIcon(icon);
- builder.setOngoing(ongoing);
-
- // Create an intent that will be fired when the user clicks the notification.
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(SDL_NOTIFICATION_FAQS_PAGE));
- PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
- builder.setContentIntent(pendingIntent);
-
- if(chronometerLength > 0) {
- builder.setWhen(chronometerLength + System.currentTimeMillis());
- builder.setUsesChronometer(true);
- builder.setChronometerCountDown(true);
- }
- 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();
- }
- if (notification == 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(){
- synchronized (NOTIFICATION_LOCK) {
- if (isForeground && !isPrimaryTransportConnected()) { //Ensure that the service is in the foreground and no longer connected to a transport
- this.stopForeground(true);
- isForeground = false;
- }
- }
- }
-
-
- /**
- * Creates a notification message to attach to the foreground service notification.
- *
- * @return string to be used as the message
- */
- private String createConnectedNotificationText(){
- StringBuilder builder = new StringBuilder();
- builder.append("Connected to ");
-
- if(bluetoothTransport!= null && bluetoothTransport.isConnected()){
- if(bluetoothTransport.getDeviceName() != null){
- builder.append(bluetoothTransport.getDeviceName());
- if(0 == (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)) {
- //If this is production, just the device name is fine
- return builder.toString();
- }
- }else{
- builder.append(TransportType.BLUETOOTH.name().toLowerCase());
- }
- }
-
- if(usbTransport != null && usbTransport.isConnected()){
- if(builder.length() > 13){ //13 characters for initial Connected to string
- builder.append(" & ");
- }
- builder.append(TransportType.USB.name());
- }
-
- return builder.toString();
- }
-
-
- /* **************************************************************************************************************************************
- *********************************************** Helper Methods **************************************************************
- ****************************************************************************************************************************************/
-
- @SuppressWarnings("SameReturnValue")
- @Deprecated
- public String getConnectedDeviceName(){
- return null;
- }
-
- private ArrayList<TransportRecord> getConnectedTransports(){
- ArrayList<TransportRecord> connected = new ArrayList<>();
- if(bluetoothTransport != null && bluetoothTransport.isConnected()){
- connected.add(bluetoothTransport.getTransportRecord());
- }
-
- if(tcpTransport != null && tcpTransport.isConnected()){
- connected.add(tcpTransport.getTransportRecord());
- }
-
- if(usbTransport != null && usbTransport.isConnected()){
- connected.add(usbTransport.getTransportRecord());
- }
-
- return connected;
- }
-
- private boolean isPrimaryTransportConnected(){
- return isTransportConnected(TransportType.BLUETOOTH) || isTransportConnected(TransportType.USB);
- }
-
- private boolean isTransportConnected(TransportType transportType){
- if(bluetoothTransport != null && transportType.equals(TransportType.BLUETOOTH)){
- return bluetoothTransport.isConnected();
- }else if(tcpTransport != null && transportType.equals(TransportType.TCP)){
- return tcpTransport.isConnected();
- }else if(usbTransport != null && transportType.equals(TransportType.USB)){
- return usbTransport.isConnected();
- }
- return false;
- }
-
- /**
- * Checks to make sure bluetooth adapter is available and on
- * @return if the bluetooth adapter is available and is enabled
- */
- @SuppressWarnings("MissingPermission")
- private boolean bluetoothAvailable(){
- try {
- return (!(BluetoothAdapter.getDefaultAdapter() == null) && BluetoothAdapter.getDefaultAdapter().isEnabled());
- }catch(NullPointerException e){ // only for BluetoothAdapter.getDefaultAdapter().isEnabled() call
- return false;
- }
- }
-
- /**
- *
- * 1. If the app has SDL shut off, shut down
- * 2. if The app has an Alt Transport address or was started by one, stay open
- * 3. If Bluetooth is off/NA shut down
- * 4. Anything else
- */
- public boolean shouldServiceRemainOpen(Intent intent){
- ArrayList<TransportRecord> connectedTransports = getConnectedTransports();
-
- if(connectedTransports != null && !connectedTransports.isEmpty()){ // stay open if we have any transports connected
- Log.d(TAG, "1 or more transports connected, remaining open");
- return true;
- }else if(altTransportService!=null || altTransportTimerHandler !=null){
- //We have been started by an alt transport, we must remain open. "My life for Auir...."
- Log.d(TAG, "Alt Transport connected, remaining open");
- return true;
-
- }else if(intent!=null && TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT.equals(intent.getAction())){
- Log.i(TAG, "Received start intent with alt transport request.");
- startAltTransportTimer();
- return true;
- }else if(!bluetoothAvailable()){//If bluetooth isn't on...there's nothing to see here
- //Bluetooth is off, we should shut down
- Log.d(TAG, "Bluetooth not available, shutting down service");
-
- return connectedTransports != null && connectedTransports.size() > 0; //If a transport is connected the list will be >0
- }else{
- Log.d(TAG, "Service to remain open");
- return true;
- }
- }
- /**
- * This method is needed so that apps that choose not to implement this as a service as defined by Android, but rather
- * just a simple class we have to know how to shut down.
- */
- public void closeSelf(){
- closing = true;
-
- if(getBaseContext()!=null){
- stopSelf();
- }
-
- //For good measure.
- onDestroy();
-
- }
- private synchronized void initBluetoothSerialService(){
- if(legacyModeEnabled){
- Log.d(TAG, "Not starting own bluetooth during legacy mode");
- return;
- }
- //init serial service
- if(bluetoothTransport == null || bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_ERROR){
- bluetoothTransport = new MultiplexBluetoothTransport(bluetoothHandler);
- }
- if (bluetoothTransport != null) {
- // Only if the state is STATE_NONE, do we know that we haven't started already
- if (bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_NONE) {
- // Start the Bluetooth services
- Log.i(TAG, "Starting bluetooth transport");
- bluetoothTransport.start();
- }
-
- }
- }
-
- @Deprecated
- public void onTransportConnected(final TransportType type){
- onTransportConnected(new TransportRecord(type,null));
- }
-
- public void onTransportConnected(final TransportRecord record){
- cancelForegroundTimeOut();
- enterForeground(createConnectedNotificationText(),0,true);
-
- if(packetWriteTaskMasterMap == null){
- packetWriteTaskMasterMap = new HashMap<>();
- }
-
- TransportType type = record.getType();
- PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(type);
-
- if(packetWriteTaskMaster!=null){
- packetWriteTaskMaster.close();
- }
- packetWriteTaskMaster = new PacketWriteTaskMaster();
- packetWriteTaskMaster.setTransportType(type);
- packetWriteTaskMaster.start();
- packetWriteTaskMasterMap.put(type,packetWriteTaskMaster);
-
- Intent startService = new Intent();
- startService.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION);
-
- startService.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_EXTRA, true);
- startService.putExtra(TransportConstants.FORCE_TRANSPORT_CONNECTED, true);
- startService.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_APP_PACKAGE, getBaseContext().getPackageName());
- startService.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_CMP_NAME, new ComponentName(this, this.getClass()));
-
- if(record!= null && record.getType() != null){
- startService.putExtra(TransportConstants.START_ROUTER_SERVICE_TRANSPORT_CONNECTED, record.getType().toString());
- }
-
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- startService.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
- }
-
- AndroidTools.sendExplicitBroadcast(getApplicationContext(),startService, null);
-
- //HARDWARE_CONNECTED
- if(!(registeredApps== null || registeredApps.isEmpty())){
- //If we have clients
- notifyClients(createHardwareConnectedMessage(record));
- }
- }
-
- private Message createHardwareConnectedMessage(final TransportRecord record){
- Message message = Message.obtain();
- message.what = TransportConstants.HARDWARE_CONNECTION_EVENT;
- message.arg1 = TransportConstants.HARDWARE_CONNECTION_EVENT_CONNECTED;
- Bundle bundle = new Bundle();
- bundle.putString(TransportConstants.HARDWARE_CONNECTED, record.getType().name());
- bundle.putParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED, getConnectedTransports());
-
- if(bluetoothTransport != null){
- bundle.putString(CONNECTED_DEVICE_STRING_EXTRA_NAME, bluetoothTransport.getDeviceName());
- }
-
- message.setData(bundle);
- return message;
-
- }
-
- @Deprecated
- public void onTransportDisconnected(TransportType type) {
- onTransportDisconnected(new TransportRecord(type,null));
- }
-
- public void onTransportDisconnected(TransportRecord record){
- cachedModuleVersion = -1; //Reset our cached version
- if(registeredApps != null && !registeredApps.isEmpty()){
- Message message = Message.obtain();
- message.what = TransportConstants.HARDWARE_CONNECTION_EVENT;
- message.arg1 = TransportConstants.HARDWARE_CONNECTION_EVENT_DISCONNECTED;
-
- Bundle bundle = new Bundle();
- bundle.putParcelable(TRANSPORT_DISCONNECTED, record);
- //For legacy
- bundle.putString(HARDWARE_DISCONNECTED, record.getType().name());
- bundle.putBoolean(TransportConstants.ENABLE_LEGACY_MODE_EXTRA, legacyModeEnabled);
-
- //Still connected transports
- bundle.putParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED,getConnectedTransports());
-
- message.setData(bundle);
- notifyClients(message);
- }
- if(!getConnectedTransports().isEmpty()){
- // Updates notification to one of still connected transport
- enterForeground(createConnectedNotificationText(),0,true);
- return;
- }else{
- exitForeground();//Leave our foreground state as we don't have a connection anymore
- if(!shouldServiceRemainOpen(null)){
- closeSelf();
- }
- }
-
- if(altTransportService!=null){ //If we still have an alt transport open, then we don't need to tell the clients to close
- return;
- }
- switch (record.getType()){
- case BLUETOOTH:
- if(!connectAsClient ){
- if(!legacyModeEnabled && !closing){
- initBluetoothSerialService();
- }
- }
- break;
- case USB:
- break;
- case TCP:
- break;
- }
- Log.e(TAG, "Notifying client service of hardware disconnect.");
-
- stopClientPings();
-
-
- PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.remove(record.getType());
- if(packetWriteTaskMaster!=null){
- packetWriteTaskMaster.close();
- }
-
- //We've notified our clients, less clean up the mess now.
- synchronized(SESSION_LOCK){
- this.bluetoothSessionMap.clear();
- this.sessionHashIdMap.clear();
- }
- synchronized(REGISTERED_APPS_LOCK){
- if(registeredApps==null){
- return;
- }
- registeredApps.clear();
- }
- }
-
- @Deprecated
- public void onTransportError(TransportType transportType){
- onTransportError(new TransportRecord(transportType,null));
- }
-
- public void onTransportError(TransportRecord transport){
- switch (transport.getType()){
- case BLUETOOTH:
- if(bluetoothTransport !=null){
- bluetoothTransport.setStateManually(MultiplexBluetoothTransport.STATE_NONE);
- bluetoothTransport = null;
- }
- break;
- case USB:
- break;
- case TCP:
- break;
- }
-
- }
-
- public void onPacketRead(SdlPacket packet){
- try {
- //Log.i(TAG, "******** Read packet with header: " +(packet).toString());
- if(packet.getVersion() == 1){
- if( packet.getFrameType() == FrameType.Control && packet.getFrameInfo() == SdlPacket.FRAME_INFO_START_SERVICE_ACK){
- //We received a v1 packet from the head unit, this means we can't use the router service.
- //Enable legacy mode
- enableLegacyMode(true);
- return;
- }
- }else if(cachedModuleVersion == -1){
- cachedModuleVersion = packet.getVersion();
- }
- //Send the received packet to the registered app
- sendPacketToRegisteredApp(packet);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Handler for all Multiplex Based transports.
- * It will ensure messages are properly queued back to the router service.
- */
- private static class TransportHandler extends Handler{
-
- final WeakReference<SdlRouterService> provider;
-
- public TransportHandler(SdlRouterService provider){
- this.provider = new WeakReference<SdlRouterService>(provider);
- }
- @Override
- public void handleMessage(Message msg) {
- if(this.provider.get() == null){
- return;
- }
- SdlRouterService service = this.provider.get();
- switch (msg.what) {
- case MESSAGE_DEVICE_NAME:
- Bundle bundle = msg.getData();
- if(bundle !=null) {
- service.setSDLConnectedStatus(bundle.getString(MultiplexBaseTransport.DEVICE_ADDRESS),true);
- }
- break;
- case MESSAGE_STATE_CHANGE:
- TransportRecord transportRecord = (TransportRecord) msg.obj;
- switch (msg.arg1) {
- case MultiplexBaseTransport.STATE_CONNECTED:
- service.onTransportConnected(transportRecord);
- break;
- case MultiplexBaseTransport.STATE_CONNECTING:
- // Currently attempting to connect - update UI?
- break;
- case MultiplexBaseTransport.STATE_LISTEN:
- break;
- case MultiplexBaseTransport.STATE_NONE:
- // We've just lost the connection
- service.onTransportDisconnected(transportRecord);
- break;
- case MultiplexBaseTransport.STATE_ERROR:
- service.onTransportError(transportRecord);
- break;
- }
- break;
-
- case MESSAGE_READ:
- service.onPacketRead((SdlPacket) msg.obj);
- break;
- }
- }
- }
-
- @SuppressWarnings("unused") //The return false after the packet null check is not dead code. Read the getByteArray method from bundle
- public boolean writeBytesToTransport(Bundle bundle){
- if(bundle == null){
- return false;
- }
- byte[] packet = bundle.getByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME);
- if(packet==null) {
- Log.w(TAG, "Ignoring null packet");
- return false;
- }
- int offset = bundle.getInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, 0); //If nothing, start at the beginning of the array
- int count = bundle.getInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, packet.length); //In case there isn't anything just send the whole packet.
- TransportType transportType = TransportType.valueForString(bundle.getString(TransportConstants.TRANSPORT_TYPE));
- switch ((transportType)){
- case BLUETOOTH:
- if(bluetoothTransport !=null && bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_CONNECTED) {
- bluetoothTransport.write(packet, offset, count);
- return true;
- }
- case USB:
- if(usbTransport != null && usbTransport.getState() == MultiplexBaseTransport.STATE_CONNECTED) {
- usbTransport.write(packet, offset, count);
- return true;
- }
- case TCP:
- if(tcpTransport != null && tcpTransport.getState() == MultiplexBaseTransport.STATE_CONNECTED) {
- tcpTransport.write(packet, offset, count);
- return true;
- }
- default:
- if(sendThroughAltTransport(bundle)){
- return true;
- }
- }
- Log.e(TAG, "Can't send data, no transport of specified type connected");
- return false;
- }
-
- private boolean manuallyWriteBytes(TransportType transportType, byte[] packet, int offset, int count){
- switch ((transportType)){
- case BLUETOOTH:
- if(bluetoothTransport !=null && bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_CONNECTED) {
- bluetoothTransport.write(packet, offset, count);
- return true;
- }
- case USB:
- if(usbTransport != null && usbTransport.getState() == MultiplexBaseTransport.STATE_CONNECTED) {
- usbTransport.write(packet, offset, count);
- return true;
- }
- case TCP:
- if(tcpTransport != null && tcpTransport.getState() == MultiplexBaseTransport.STATE_CONNECTED) {
- tcpTransport.write(packet, offset, count);
- return true;
- }
- default:
- return sendThroughAltTransport(packet, offset, count);
- }
- }
-
-
- /**
- * This Method will send the packets through the alt transport that is connected
- * @param bundle This bundle will have its what changed and sent off to the alt transport
- * @return If it was possible to send the packet off.
- * <p><b>NOTE: This is not guaranteed. It is a best attempt at sending the packet, it may fail.</b>
- */
- private boolean sendThroughAltTransport(Bundle bundle){
- if(altTransportService!=null){
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_SEND_PACKET;
- msg.setData(bundle);
- try {
- altTransportService.send(msg);
- } catch (RemoteException e) {
- Log.e(TAG, "Unable to send through alt transport!");
- e.printStackTrace();
- }
- return true;
- }else{
- Log.w(TAG, "Unable to send packet through alt transport, it was null");
- }
- return false;
- }
-
- /** This Method will send the packets through the alt transport that is connected
- * @param bytes The byte array of data to be wrote out
- * @return If it was possible to send the packet off.
- * <p><b>NOTE: This is not guaranteed. It is a best attempt at sending the packet, it may fail.</b>
- */
- private boolean sendThroughAltTransport(byte[] bytes, int offset, int count){
- if(altTransportService!=null){
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_SEND_PACKET;
- Bundle bundle = new Bundle();
- bundle.putByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME,bytes);
- bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, offset);
- bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, count);
- msg.setData(bundle);
- try {
- altTransportService.send(msg);
- } catch (RemoteException e) {
- Log.e(TAG, "Unable to send through alt transport!");
- e.printStackTrace();
- }
- return true;
- }else{
- Log.w(TAG, "Unable to send packet through alt transport, it was null");
- }
- return false;
- }
- /**
- * This will send the received packet to the registered service. It will default to the single registered "foreground" app.
- * This can be overridden to provide more specific functionality.
- * @param packet the packet that is received
- * @return whether or not the sending was successful
- */
- public boolean sendPacketToRegisteredApp(SdlPacket packet) {
- if(registeredApps != null && registeredApps.size() > 0 ){
- final int session = packet.getSessionId();
- boolean isNewSessionRequest = false, isNewTransportRequest = false;
-
- final int frameInfo = packet.getFrameInfo();
- if(packet.getFrameType() == FrameType.Control){
- isNewSessionRequest = (frameInfo == SdlPacket.FRAME_INFO_START_SERVICE_ACK ||frameInfo == SdlPacket.FRAME_INFO_START_SERVICE_NAK)
- && packet.getServiceType() == SdlPacket.SERVICE_TYPE_RPC;
- isNewTransportRequest = (frameInfo == SdlPacket.FRAME_INFO_REGISTER_SECONDARY_TRANSPORT_ACK
- || frameInfo == SdlPacket.FRAME_INFO_REGISTER_SECONDARY_TRANSPORT_NAK); // && packet.getServiceType() != SdlPacket.SERVICE_TYPE_RPC;
- }
-
- //Find where this packet should go
- String appid = getAppIDForSession(session, isNewSessionRequest, isNewTransportRequest, packet.getTransportRecord().getType());
-
- if(appid != null && appid.length() > 0){
-
- RegisteredApp app;
- synchronized(REGISTERED_APPS_LOCK){
- app = registeredApps.get(appid);
- }
-
- if(app == null){
- Log.e(TAG, "No app found for app id " + appid + " Removing session mapping and sending unregisterAI to head unit.");
-
- //We have no app to match the app id tied to this session
- removeSessionFromMap(session, Collections.singletonList(packet.getTransportRecord().getType()));
-
- final int serviceType = packet.getServiceType();
- if(serviceType == SdlPacket.SERVICE_TYPE_RPC || serviceType == SdlPacket.SERVICE_TYPE_BULK_DATA) {
- //This is a primary transport packet as it is an RPC packet
- //Create an unregister app interface to remove the app as it doesn't appear to exist anymore
- byte[] uai = createForceUnregisterApp((byte) session, (byte) packet.getVersion());
- manuallyWriteBytes(packet.getTransportRecord().getType(),uai, 0, uai.length);
-
- int hashId = 0;
- synchronized(this.SESSION_LOCK){
- if(this.sessionHashIdMap.indexOfKey(session)>=0){
- hashId = this.sessionHashIdMap.get(session);
- this.sessionHashIdMap.delete(session);
- }
- }
-
- //TODO stop other services on that transport for the session with no app
- SdlPacket endService = SdlPacketFactory.createEndSession(SessionType.RPC, (byte)session, 0, (byte)packet.getVersion(),BitConverter.intToByteArray(hashId));
- byte[] stopService = endService.constructPacket();
- manuallyWriteBytes(packet.getTransportRecord().getType(), stopService,0,stopService.length);
- }else{
- Log.w(TAG, "No where to send a packet from what appears to be a non primary transport");
- }
-
- return false;
- }
-
- //There is an app id and can continue to normal flow
- byte version = (byte)packet.getVersion();
-
- if(isNewSessionRequest && version > 1 && packet.getFrameInfo() == SdlPacket.FRAME_INFO_START_SERVICE_ACK){ //we know this was a start session response
- if (packet.getPayload() != null && packet.getDataSize() == 4){ //hashid will be 4 bytes in length
- synchronized(SESSION_LOCK){
- this.sessionHashIdMap.put(session, (BitConverter.intFromByteArray(packet.getPayload(), 0)));
- }
- }
- }
-
- // check and prevent a UAI from being passed to an app that is using a recycled session id
- if (cleanedSessionMap != null && cleanedSessionMap.size() > 0 ) {
- if(packet.getFrameType() == FrameType.Single && packet.getServiceType() == SdlPacket.SERVICE_TYPE_RPC) {
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.parseBinaryHeader(packet.getPayload());
- if (binFrameHeader != null && FunctionID.UNREGISTER_APP_INTERFACE.getId() == binFrameHeader.getFunctionID()) {
- Log.d(TAG, "Received an unregister app interface. Checking session hash before sending");
- // make sure that we don't try to unregister a recently added app that might have a
- // session ID of a removed app whose UAI was delayed
- int hashOfRemoved = this.cleanedSessionMap.get(session, -1);
- int currentHash = this.sessionHashIdMap.get(session, -1);
- if (hashOfRemoved != -1) {
- // Current session contains key that was held before
- if (hashOfRemoved != currentHash) {
- // App assigned same session id but is a different app. Keep this from being killed
- Log.d(TAG, "same session id for different apps found, dropping packet");
- this.cleanedSessionMap.delete(session);
- return false;
- }
- }
- }
- }
- }
-
- int packetSize = (int) (packet.getDataSize() + SdlPacket.HEADER_SIZE);
- //Log.i(TAG, "Checking packet size: " + packetSize);
- Message message = Message.obtain();
- Bundle bundle = new Bundle();
-
- if(packetSize < ByteArrayMessageSpliter.MAX_BINDER_SIZE){ //This is a small enough packet just send on through
- //Log.w(TAG, " Packet size is just right " + packetSize + " is smaller than " + ByteArrayMessageSpliter.MAX_BINDER_SIZE + " = " + (packetSize<ByteArrayMessageSpliter.MAX_BINDER_SIZE));
- message.what = TransportConstants.ROUTER_RECEIVED_PACKET;
-
- // !!!! ADD ADDITIONAL ITEMS TO BUNDLE HERE !!!
-
- packet.setMessagingVersion(app.routerMessagingVersion);
- bundle.putParcelable(FORMED_PACKET_EXTRA_NAME, packet);
- /* !!!!!! DO NOT ADD ANY ADDITIONAL ITEMS TO THE BUNDLE AFTER PACKET. ONLY BYTES_TO_SEND_FLAG !!!!!!!*/
- bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_NONE);
- /* !!!!!! DO NOT ADD ANY ADDITIONAL ITEMS TO THE BUNDLE AFTER PACKET. ONLY BYTES_TO_SEND_FLAG !!!!!!!*/
-
- message.setData(bundle);
- return sendPacketMessageToClient(app,message, version);
- }else{
- //Log.w(TAG, "Packet too big for IPC buffer. Breaking apart and then sending to client.");
- //We need to churn through the packet payload and send it in chunks
- byte[] bytes = packet.getPayload();
- SdlPacket copyPacket = new SdlPacket(packet.getVersion(),packet.isEncrypted(),
- (int)packet.getFrameType().getValue(),
- packet.getServiceType(),packet.getFrameInfo(), session,
- (int)packet.getDataSize(),packet.getMessageId(),null);
- message.what = TransportConstants.ROUTER_RECEIVED_PACKET;
- // !!!! ADD ADDITIONAL ITEMS TO BUNDLE HERE !!!
-
- bundle.putParcelable(FORMED_PACKET_EXTRA_NAME, copyPacket);
- /* !!!!!! DO NOT ADD ANY ADDITIONAL ITEMS TO THE BUNDLE AFTER PACKET. ONLY BYTES_TO_SEND_FLAG !!!!!!!*/
- bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_SDL_PACKET_INCLUDED);
- /* !!!!!! DO NOT ADD ANY ADDITIONAL ITEMS TO THE BUNDLE AFTER PACKET. ONLY BYTES_TO_SEND_FLAG !!!!!!!*/
-
- message.setData(bundle);
- //Log.d(TAG, "First packet before sending: " + message.getData().toString());
- if(!sendPacketMessageToClient(app, message, version)){
- Log.w(TAG, "Error sending first message of split packet to client " + app.appId);
- return false;
- }
- //Log.w(TAG, "Message too big for single IPC transaction. Breaking apart. Size - " + packet.getDataSize());
- ByteArrayMessageSpliter splitter = new ByteArrayMessageSpliter(appid,TransportConstants.ROUTER_RECEIVED_PACKET,bytes,0);
- while(splitter.isActive()){
- if(!sendPacketMessageToClient(app,splitter.nextMessage(),version)){
- Log.w(TAG, "Error sending first message of split packet to client " + app.appId);
- splitter.close();
- return false;
- }
- }
- //Log.i(TAG, "Large packet finished being sent");
- }
-
- }else{ //If we can't find a session for this packet we just drop the packet
- Log.e(TAG, "App Id was NULL for session! " + session);
- TransportType transportType = packet.getTransportRecord().getType();
- if(removeSessionFromMap(session, Collections.singletonList(transportType))){ //If we found the session id still tied to an app in our map we need to remove it and send the proper shutdown sequence.
- Log.i(TAG, "Removed session from map. Sending unregister request to module.");
- attemptToCleanUpModule(session, packet.getVersion(), transportType);
- }else{ //There was no mapping so let's try to resolve this
-
- if(packet.getFrameType() == FrameType.Single && packet.getServiceType() == SdlPacket.SERVICE_TYPE_RPC){
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.parseBinaryHeader(packet.getPayload());
- if(binFrameHeader!=null && FunctionID.UNREGISTER_APP_INTERFACE.getId() == binFrameHeader.getFunctionID()){
- Log.d(TAG, "Received an unregister app interface with no where to send it, dropping the packet.");
- }else{
- attemptToCleanUpModule(session, packet.getVersion(),transportType);
- }
- }else if((packet.getFrameType() == FrameType.Control
- && (packet.getFrameInfo() == SdlPacket.FRAME_INFO_END_SERVICE_ACK || packet.getFrameInfo() == SdlPacket.FRAME_INFO_END_SERVICE_NAK))){
- //We want to ignore this
- Log.d(TAG, "Received a stop service ack/nak with no where to send it, dropping the packet.");
- }else{
- attemptToCleanUpModule(session, packet.getVersion(),transportType);
- }
- }
- }
- }
- return false;
- }
-
- /**
- * This method is an all else fails situation. If the head unit is out of sync with the apps on the phone
- * this method will clear out an unwanted or out of date session.
- * @param session the session id that is to be cleaned up
- * @param version the last known version that this session was operating with
- */
- private void attemptToCleanUpModule(int session, int version, TransportType primaryTransport){
- Log.i(TAG, "Attempting to stop session " + session);
- byte[] uai = createForceUnregisterApp((byte)session, (byte)version);
- manuallyWriteBytes(primaryTransport,uai,0,uai.length);
- int hashId = 0;
- synchronized(this.SESSION_LOCK){
- if(this.sessionHashIdMap.indexOfKey(session)>=0){
- hashId = this.sessionHashIdMap.get(session);
- this.sessionHashIdMap.delete(session);
- this.cleanedSessionMap.put(session,hashId);
- }
- }
- byte[] stopService = (SdlPacketFactory.createEndSession(SessionType.RPC, (byte)session, 0, (byte)version,BitConverter.intToByteArray(hashId))).constructPacket();
- manuallyWriteBytes(primaryTransport,stopService,0,stopService.length);
- }
-
- private boolean sendPacketMessageToClient(RegisteredApp app, Message message, byte version){
- int result = app.sendMessage(message);
- if(result == RegisteredApp.SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT){
- Log.d(TAG, "Dead object, removing app and sessions");
- //Get all their sessions and send out unregister info
- //Use the version in this packet as a best guess
- app.close();
- Vector<Long> sessions = app.getSessionIds();
- byte[] unregister,stopService;
- int size = sessions.size(), sessionId;
- for(int i=0; i<size;i++){
- sessionId = sessions.get(i).intValue();
- unregister = createForceUnregisterApp((byte)sessionId,version);
- List<TransportType> transportTypes = app.getTransportsForSession(sessionId);
- if(transportTypes != null && !transportTypes.isEmpty()) {
- manuallyWriteBytes(transportTypes.get(0),unregister, 0, unregister.length);
- int hashId = 0;
- synchronized (this.SESSION_LOCK) {
- if (this.sessionHashIdMap.indexOfKey(sessionId) >= 0) {
- hashId = this.sessionHashIdMap.get(sessionId);
- }
- }
- stopService = (SdlPacketFactory.createEndSession(SessionType.RPC, (byte) sessionId, 0, version, BitConverter.intToByteArray(hashId))).constructPacket();
-
- manuallyWriteBytes(transportTypes.get(0),stopService, 0, stopService.length);
- synchronized (SESSION_LOCK) {
- this.bluetoothSessionMap.remove(sessionId);
- this.sessionHashIdMap.delete(sessionId);
- }
- }
- }
- synchronized(REGISTERED_APPS_LOCK){
- registeredApps.remove(app.appId);
- }
- return false;//We did our best to correct errors
- }
- return true;//We should have sent our packet, so we can return true now
- }
-
- private synchronized void closeBluetoothSerialServer(){
- if(bluetoothTransport != null){
- bluetoothTransport.stop();
- bluetoothTransport = null;
- }
- }
-
- /**
- * This function looks through the phones currently paired bluetooth devices
- * If one of the devices' names contain "sync", or livio it will attempt to connect the RFCOMM
- * And start SDL
- * @return a boolean if a connection was attempted
- */
- @SuppressWarnings({"MissingPermission", "unused"})
- public synchronized boolean bluetoothQuerryAndConnect(){
- BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
- if(adapter != null && adapter.isEnabled()){
- Set<BluetoothDevice> pairedBT= adapter.getBondedDevices();
- Log.d(TAG, "Query Bluetooth paired devices");
- if (pairedBT.size() > 0) {
- for (BluetoothDevice device : pairedBT) {
- String name = device.getName().toLowerCase(Locale.US);
- if(name.contains("sync") || name.contains("livio")){
- bluetoothConnect(device);
- return true;
- }
- }
- }
- }else{
- Log.e(TAG, "There was an issue with connecting as client");
- }
- return false;
- }
-
- @SuppressWarnings("MissingPermission")
- private synchronized boolean bluetoothConnect(BluetoothDevice device){
- Log.d(TAG,"Connecting to device: " + device.getName());
- if(bluetoothTransport == null || !bluetoothTransport.isConnected())
- { // Set up the Bluetooth serial object
- bluetoothTransport = new MultiplexBluetoothTransport(bluetoothHandler);
- }
- // We've been given a device - let's connect to it
- if(bluetoothTransport.getState()!=MultiplexBluetoothTransport.STATE_CONNECTING){
- bluetoothTransport.connect(device);
- if(bluetoothTransport.getState() == MultiplexBluetoothTransport.STATE_CONNECTING){
- return true;
- }
- }
-
- Log.d(TAG, "Bluetooth SPP Connect Attempt Completed");
- return false;
- }
-
-
- //**************************************************************************************************************************************
- //********************************************************* PREFERENCES ****************************************************************
- //**************************************************************************************************************************************
- /**
- * @deprecated
- * This method will set the last known bluetooth connection method that worked with this phone.
- * This helps speed up the process of connecting
- * @param level The level of bluetooth connecting method that last worked
- * @param prefLocation Where the preference should be stored
- */
- @SuppressWarnings("DeprecatedIsStillUsed")
- @Deprecated
- public static void setBluetoothPrefs (int level, String prefLocation) {
- Log.w(TAG, "This method is deprecated and will not take any action");
- }
-
- /**
- * @deprecated
- * This method has been deprecated as it was bad practice.
- */
- @SuppressWarnings({"DeprecatedIsStillUsed", "SameReturnValue"})
- @Deprecated
- public static int getBluetoothPrefs(String prefLocation)
- {
- return 0;
- }
-
- /**
- * Set the connection establishment status of the particular device
- * @param address address of the device in quesiton
- * @param hasSDLConnected true if a connection has been established, false if not
- */
- protected void setSDLConnectedStatus(String address, boolean hasSDLConnected){
- SharedPreferences preferences = this.getSharedPreferences(SDL_DEVICE_STATUS_SHARED_PREFS, Context.MODE_PRIVATE);
- SharedPreferences.Editor editor = preferences.edit();
- editor.putBoolean(address,hasSDLConnected);
- editor.commit();
- }
-
- /**
- * Checks to see if a device address has connected to SDL before.
- * @param address the mac address of the device in quesiton
- * @return if this is the first status check of this device
- */
- protected boolean isFirstStatusCheck(String address){
- SharedPreferences preferences = this.getSharedPreferences(SDL_DEVICE_STATUS_SHARED_PREFS, Context.MODE_PRIVATE);
- return !preferences.contains(address) ;
- }
- /**
- * Checks to see if a device address has connected to SDL before.
- * @param address the mac address of the device in quesiton
- * @return if an SDL connection has ever been established with this device
- */
- protected boolean hasSDLConnected(String address){
- SharedPreferences preferences = this.getSharedPreferences(SDL_DEVICE_STATUS_SHARED_PREFS, Context.MODE_PRIVATE);
- return preferences.contains(address) && preferences.getBoolean(address,false);
- }
-
-
-
- /* ***********************************************************************************************************************************************************************
- * ***************************************************************** CUSTOM ADDITIONS ************************************************************************************
- *************************************************************************************************************************************************************************/
-
- @SuppressWarnings("DeprecatedIsStillUsed")
- @Deprecated
- protected static LocalRouterService getLocalRouterService(Intent launchIntent, ComponentName name){
- if(launchIntent == null){
- Log.w(TAG, "Supplied intent was null, local router service will not contain intent");
- }
- if(name == null){
- Log.e(TAG, "Unable to create local router service object because component name was null");
- return null;
- }
- //noinspection deprecation
- return new LocalRouterService(launchIntent,ROUTER_SERVICE_VERSION_NUMBER, System.currentTimeMillis(), name);
- }
-
- /**
- * This method is used to check for the newest version of this class to make sure the latest and greatest is up and running.
- */
- private void startAltTransportTimer(){
- altTransportTimerHandler = new Handler();
- altTransportTimerRunnable = new Runnable() {
- public void run() {
- altTransportTimerHandler = null;
- altTransportTimerRunnable = null;
- if(!shouldServiceRemainOpen(null)){
- closeSelf();
- }
- }
- };
- altTransportTimerHandler.postDelayed(altTransportTimerRunnable, ALT_TRANSPORT_TIMEOUT_RUNNABLE);
- }
-
- /**
- * Removes session from map if the key is found.
- * @param sessionId the session id that is to be removed from our current mapping
- * @return if the key was found
- */
- private boolean removeSessionFromMap(int sessionId, List<TransportType> transportTypes){
- synchronized(SESSION_LOCK){
- boolean retVal = false;
- if(transportTypes != null) { //FIXME I don't believe this should be null
- if (transportTypes.contains(TransportType.BLUETOOTH) && bluetoothSessionMap != null) {
- if (bluetoothSessionMap.indexOfKey(sessionId) >= 0) {
- bluetoothSessionMap.remove(sessionId);
- retVal = true;
- }
- } else if (transportTypes.contains(TransportType.USB) && usbSessionMap != null) {
- if (usbSessionMap.indexOfKey(sessionId) >= 0) {
- usbSessionMap.remove(sessionId);
- retVal = true;
- }
- } else if (transportTypes.contains(TransportType.TCP) && tcpSessionMap != null) {
- if (tcpSessionMap.indexOfKey(sessionId) >= 0) {
- tcpSessionMap.remove(sessionId);
- retVal = true;
- }
- }
- }
- return retVal;
- }
- }
-
-
-
- @TargetApi(Build.VERSION_CODES.HONEYCOMB)
- private boolean removeAllSessionsWithAppId(String appId){
- synchronized(SESSION_LOCK){
- if(bluetoothSessionMap !=null){
- SparseArray<String> iter = bluetoothSessionMap.clone();
- int size = iter.size();
- for(int i = 0; i<size; i++){
- if(iter.valueAt(i).compareTo(appId) == 0){
- sessionHashIdMap.delete(iter.keyAt(i));
- bluetoothSessionMap.removeAt(i);
- }
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * Removes all sessions from the sessions map for this given app id
- * @param app the RegisteredApp object that should have all its sessions removed
- * @param cleanModule a flag if this service should attempt to clear off the sessions tied to the app off the module
- */
- private void removeAllSessionsForApp(RegisteredApp app, boolean cleanModule){
- Vector<Long> sessions = app.getSessionIds();
- int size = sessions.size(), sessionId;
- for(int i=0; i<size;i++){
- //Log.d(TAG, "Investigating session " +sessions.get(i).intValue());
- //Log.d(TAG, "App id is: " + bluetoothSessionMap.get(sessions.get(i).intValue()));
- sessionId = sessions.get(i).intValue();
- List<TransportType> transportTypes = app.getTransportsForSession(sessionId);
- removeSessionFromMap(sessionId, transportTypes);
- if(cleanModule){
- if(transportTypes != null && transportTypes.size() > 0){
- attemptToCleanUpModule(sessionId, cachedModuleVersion, transportTypes.get(0));
- }
- }
- }
- }
-
- private boolean removeAppFromMap(RegisteredApp app){
- synchronized(REGISTERED_APPS_LOCK){
- //noinspection SuspiciousMethodCalls
- RegisteredApp old = registeredApps.remove(app);
- if(old!=null){
- old.close();
- return true;
- }
- }
- return false;
- }
-
- private String getAppIDForSession(int sessionId, boolean newSession, boolean newTransport, TransportType transportType){
- synchronized(SESSION_LOCK){
- //Log.d(TAG, "Looking for session: " + sessionId);
- //First get the session map for the correct transport
- SparseArray<String> sessionMap;
- switch(transportType){
- case BLUETOOTH:
- if(bluetoothSessionMap == null){
- bluetoothSessionMap = new SparseArray<String>();
- }
- sessionMap = bluetoothSessionMap;
- break;
- case USB:
- if(usbSessionMap == null){
- usbSessionMap = new SparseArray<String>();
- }
- sessionMap = usbSessionMap;
- break;
- case TCP:
- if(tcpSessionMap == null){
- tcpSessionMap = new SparseArray<String>();
- }
- sessionMap = tcpSessionMap;
- break;
- default:
- return null;
- }
-
- String appId = sessionMap.get(sessionId);
- if(appId==null){
- // If service type is RPC then we know we need to just skip ahead and see if there
- // is a registered app awaiting a session.
- if(newSession) {
- int pos;
- synchronized (REGISTERED_APPS_LOCK) {
- for (RegisteredApp app : registeredApps.values()) {
- if(app.getAwaitingSession().contains(transportType)) {
- pos = app.containsSessionId(-1);
- if (pos != -1) {
- app.setSessionId(pos, sessionId);
- app.registerTransport(sessionId, transportType);
- app.getAwaitingSession().remove(transportType);
- appId = app.getAppId();
- sessionMap.put(sessionId, appId);
- break;
- }
- }
- }
- }
- }else if(newTransport){
-
- // If this is anything other than RPC with a start service response we can assume
- // the app wants to use a new transport as secondary.
-
- // We would only receive a start service response for RPC service when an app is
- // attempting to register for the first time. Other services can be ran on
- //secondary transports.
- switch (transportType){
- case BLUETOOTH: //Check for BT as a secondary transport
- //USB is potential primary
- appId = usbSessionMap.get(sessionId);
- // No other suitable transport for primary transport
- break;
- case USB: //Check for USB as a secondary transport
- //BT potential primary transport
- appId = bluetoothSessionMap.get(sessionId);
- // No other suitable transport for primary transport
- break;
- case TCP: //Check for TCP as a secondary transport
- //BT potential primary transport
- appId = bluetoothSessionMap.get(sessionId);
- if(appId == null){
- //USB is potential primary transport
- appId = usbSessionMap.get(sessionId);
- }
- break;
- default:
- return null;
- }
-
- if(appId != null){
- //This means that there is a session id of the same id on another transport
- synchronized(REGISTERED_APPS_LOCK){
- RegisteredApp app = registeredApps.get(appId);
- //Ensure a registered app actually exists and is not null
- if(app != null){
- //Register this new transport for the app and add the entry to the
- //session map associated with this transport
- app.registerTransport(sessionId, transportType);
- sessionMap.put(sessionId,appId);
- }else{
- Log.w(TAG, "No registered app found when register secondary transport");
- }
- }
- }
- }
-
- }
- //Log.d(TAG, sessionId + " session returning App Id: " + appId);
- return appId;
- }
- }
-
- /* ****************************************************************************************************************************************
- // *********************************************************** LEGACY ****************************************************************
- //*****************************************************************************************************************************************/
- private boolean legacyModeEnabled = false;
-
- private void enableLegacyMode(boolean enable){
- Log.d(TAG, "Enable legacy mode: " + enable);
- legacyModeEnabled = enable; //We put this at the end to avoid a race condition between the bluetooth d/c and notify of legacy mode enabled
-
- if(legacyModeEnabled){
- //So we need to let the clients know they need to host their own bluetooth sessions because the currently connected head unit only supports a very old version of SDL/Applink
- //Start by closing our own bluetooth connection. The following calls will handle actually notifying the clients of legacy mode
- closeBluetoothSerialServer();
- //Now wait until we get a d/c, then the apps should shut their bluetooth down and go back to normal
-
- }//else{}
-
- }
-
- /* ****************************************************************************************************************************************
- // *********************************************************** UTILITY ****************************************************************
- //*****************************************************************************************************************************************/
-
- @SuppressWarnings("unused")
- private void debugPacket(byte[] bytes){
- //DEBUG
-
- if(bytes[0] != 0x00){
- Log.d(TAG, "Writing packet with header: " + BitConverter.bytesToHex(bytes, 12)); //just want the header
- }else{
-
- //Log.d(TAG, "Writing packet with binary header: " + BitConverter.bytesToHex(bytes, 12)); //just want the header
- //int length = bytes.length-12;
- if(bytes.length<=8){
- Log.w(TAG, "No payload to debug or too small");
- return;
- }
- //Check first byte if 0, make to json
- char[] buffer = new char[bytes.length];
- for(int i = 12;i<bytes.length;i++){
- buffer[i-12] = (char)(bytes[i] & 0xFF);
- }
- try {
-
- JSONObject object = new JSONObject(new String(buffer));
- Log.d(TAG, "JSON: " + object.toString());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-
- }
-
- /**
- * If an app crashes the only way we can handle it being on the head unit is to send an unregister app interface rpc.
- * This method should only be called when the router service recognizes the client is no longer valid
- * @param sessionId session id that is currently being cleared from the module. It will be used to form the packet.
- * @param version the last known version this session was operating with
- * @return a byte array that contains the full packet for an UnregisterAppInterface that can be written out to the transport
- */
- 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);
- pm.setSessionID(sessionId);
- pm.setMessageType(MessageType.RPC);
- pm.setSessionType(SessionType.RPC);
- pm.setFunctionID(FunctionID.getFunctionId(request.getFunctionName()));
- pm.setCorrID(request.getCorrelationID());
- if (request.getBulkData() != null)
- pm.setBulkData(request.getBulkData());
- byte[] data;
- if(version > 1) { //If greater than v1 we need to include a binary frame header in the data before all the JSON starts
- data = new byte[12 + pm.getJsonSize()];
- BinaryFrameHeader binFrameHeader = SdlPacketFactory.createBinaryFrameHeader(pm.getRPCType(), pm.getFunctionID(), pm.getCorrID(), pm.getJsonSize());
- System.arraycopy(binFrameHeader.assembleHeaderBytes(), 0, data, 0, 12);
- System.arraycopy(pm.getData(), 0, data, 12, pm.getJsonSize());
- }else {
- data = pm.getData();
- }
-
- SdlPacket packet = new SdlPacket(version,false,SdlPacket.FRAME_TYPE_SINGLE,SdlPacket.SERVICE_TYPE_RPC,0,sessionId,data.length,data.length+100,data);
- return packet.constructPacket();
- }
-
-
- /**
- * Method for finding the next, highest priority write task from all connected apps.
- * @return the next task for writing out packets if one exists
- */
- protected PacketWriteTask getNextTask(TransportType transportType){
- final long currentTime = System.currentTimeMillis();
- RegisteredApp priorityApp = null;
- long currentPriority = -Long.MAX_VALUE, peekWeight;
- synchronized(REGISTERED_APPS_LOCK){
- PacketWriteTask peekTask;
- for (RegisteredApp app : registeredApps.values()) {
- peekTask = app.peekNextTask(transportType);
- if(peekTask!=null){
- peekWeight = peekTask.getWeight(currentTime);
- //Log.v(TAG, "App " + app.appId +" has a task with weight "+ peekWeight);
- if(peekWeight>currentPriority){
- if(app.queuePaused){
- app.notIt(transportType);//Reset the timer
- continue;
- }
- if(priorityApp!=null){
- priorityApp.notIt(transportType);
- }
- currentPriority = peekWeight;
- priorityApp = app;
- }
- }
- }
- if(priorityApp!=null){
- return priorityApp.getNextTask(transportType);
- }
- }
- return null;
- }
-
- private void initPingIntent(){
- pingIntent = new Intent();
- pingIntent.setAction(TransportConstants.START_ROUTER_SERVICE_ACTION);
- pingIntent.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_EXTRA, true);
- pingIntent.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_APP_PACKAGE, getBaseContext().getPackageName());
- pingIntent.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_CMP_NAME, new ComponentName(SdlRouterService.this, SdlRouterService.this.getClass()));
- pingIntent.putExtra(TransportConstants.START_ROUTER_SERVICE_SDL_ENABLED_PING, true);
- }
-
- private void startClientPings(){
- synchronized(this){
- if(!isPrimaryTransportConnected()){ //If we aren't connected, bail
- return;
- }
- if(isPingingClients){
- Log.w(TAG, "Already pinging clients. Resting count");
- synchronized(PING_COUNT_LOCK){
- pingCount = 0;
- }
- return;
- }
- if(clientPingExecutor == null){
- clientPingExecutor = Executors.newSingleThreadScheduledExecutor();
- }
- isPingingClients = true;
- synchronized(PING_COUNT_LOCK){
- pingCount = 0;
- }
-
- clientPingExecutor.scheduleAtFixedRate(new Runnable(){
- List<ResolveInfo> sdlApps;
- @Override
- public void run() {
- if(getPingCount()>=10){
- Log.d(TAG, "Hit ping limit");
- stopClientPings();
- return;
- }
- if(pingIntent == null){
- initPingIntent();
- }
-
- if(sdlApps == null){
- sdlApps = getPackageManager().queryBroadcastReceivers(pingIntent, 0);
- }
-
- AndroidTools.sendExplicitBroadcast(getApplicationContext(), pingIntent, sdlApps);
- synchronized(PING_COUNT_LOCK){
- pingCount++;
- }
-
- }
- }, CLIENT_PING_DELAY, CLIENT_PING_DELAY, TimeUnit.MILLISECONDS); //Give a little delay for first call
- }
- }
-
- private int getPingCount(){
- synchronized(PING_COUNT_LOCK){
- return pingCount;
- }
- }
-
- private void stopClientPings(){
- if(clientPingExecutor!=null && !clientPingExecutor.isShutdown()){
- clientPingExecutor.shutdownNow();
- clientPingExecutor = null;
- isPingingClients = false;
- }
- pingIntent = null;
- }
-
- /* ****************************************************************************************************************************************
- // ********************************************************** TINY CLASSES ************************************************************
- //*****************************************************************************************************************************************/
-
- /**
- *This class enables us to compare two router services
- * from different apps and determine which is the newest
- * and therefore which one should be the one spun up.
- * @author Joey Grover
- * @deprecated Move to the new version checking system with meta-data
- *
- */
- @SuppressWarnings({"unused", "DeprecatedIsStillUsed"})
- @Deprecated
- static class LocalRouterService implements Parcelable{
- Intent launchIntent = null;
- int version ;
- final long timestamp;
- ComponentName name;
-
- @SuppressWarnings("SameParameterValue")
- private LocalRouterService(Intent intent, int version, long timeStamp, ComponentName name ){
- this.launchIntent = intent;
- this.version = version;
- this.timestamp = timeStamp;
- this.name = name;
- }
- /**
- * Check if input is newer than this version
- * @param service a reference to another possible router service that is in quesiton
- * @return if the supplied service is newer than this one
- */
- public boolean isNewer(@SuppressWarnings("deprecation") LocalRouterService service){
- if(service.version>this.version){
- return true;
- }else if(service.version == this.version){ //If we have the same version, we will use a timestamp
- return service.timestamp<this.timestamp;
- }
- return false;
- }
-
- @SuppressWarnings("BooleanMethodIsAlwaysInverted")
- public boolean isEqual(@SuppressWarnings("deprecation") LocalRouterService service) {
- return service != null && service.name != null && this.name != null && this.name.equals(service.name);
- }
-
- @Override
- public String toString() {
- StringBuilder build = new StringBuilder();
- build.append("Intent action: ");
- if(launchIntent!=null && launchIntent.getComponent() != null){
- build.append(launchIntent.getComponent().getClassName());
- }else if(name!=null){
- build.append(name.getClassName());
- }
-
- build.append(" Version: ");
- build.append(version);
- build.append(" Timestamp: ");
- build.append(timestamp);
-
- return build.toString();
- }
- public LocalRouterService(Parcel p) {
- this.version = p.readInt();
- this.timestamp = p.readLong();
- try {
- this.launchIntent = p.readParcelable(Intent.class.getClassLoader());
- this.name = p.readParcelable(ComponentName.class.getClassLoader());
- }catch (Exception e){
- // catch DexException
- }
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(version);
- dest.writeLong(timestamp);
- dest.writeParcelable(launchIntent, 0);
- dest.writeParcelable(name, 0);
-
- }
-
- @SuppressWarnings("deprecation")
- public static final Parcelable.Creator<LocalRouterService> CREATOR = new Parcelable.Creator<LocalRouterService>() {
- @SuppressWarnings("deprecation")
- public LocalRouterService createFromParcel(Parcel in) {
- //noinspection deprecation
- return new LocalRouterService(in);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public LocalRouterService[] newArray(int size) {
- //noinspection deprecation
- return new LocalRouterService[size];
- }
-
- };
-
- }
-
-
- /**
- * This class helps keep track of all the different sessions established with the head unit
- * and to which app they belong to.
- * @author Joey Grover
- *
- */
- @SuppressWarnings("Convert2Diamond")
- class RegisteredApp {
- protected static final int SEND_MESSAGE_SUCCESS = 0x00;
- protected static final int SEND_MESSAGE_ERROR_MESSAGE_NULL = 0x01;
- protected static final int SEND_MESSAGE_ERROR_MESSENGER_NULL = 0x02;
- protected static final int SEND_MESSAGE_ERROR_MESSENGER_GENERIC_EXCEPTION = 0x03;
- protected static final int SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT = 0x04;
-
- protected static final int PAUSE_TIME_FOR_QUEUE = 1500;
-
- private final Object TRANSPORT_LOCK = new Object();
-
- final String appId;
- final Messenger messenger;
- final Vector<Long> sessionIds;
- final Vector<TransportType> awaitingSession;
- final int routerMessagingVersion;
-
- ByteAraryMessageAssembler buffer;
- int priorityForBuffingMessage;
- DeathRecipient deathNote = null;
- //Packet queue vars
- final HashMap<TransportType, PacketWriteTaskBlockingQueue> queues;
- Handler queueWaitHandler;
- Runnable queueWaitRunnable = null;
- boolean queuePaused = false;
-
- //Primary will always be first
- final SparseArray<ArrayList<TransportType>> registeredTransports;
-
- /**
- * This is a simple class to hold onto a reference of a registered app.
- * @param appId the supplied id for this app that is attempting to register
- * @param messenger the specific messenger that is tied to this app
- */
- @Deprecated
- public RegisteredApp(String appId, Messenger messenger){
- this.appId = appId;
- this.messenger = messenger;
- this.sessionIds = new Vector<Long>();
- this.queues = new HashMap<>();
- queueWaitHandler = new Handler();
- registeredTransports = new SparseArray<ArrayList<TransportType>>();
- awaitingSession = new Vector<>();
- setDeathNote();
- routerMessagingVersion = 1;
- }
-
- /**
- * This is a simple class to hold onto a reference of a registered app.
- * @param appId the supplied id for this app that is attempting to register
- * @param routerMessagingVersion
- * @param messenger the specific messenger that is tied to this app
- */
- public RegisteredApp(String appId, int routerMessagingVersion, Messenger messenger){
- this.appId = appId;
- this.messenger = messenger;
- this.sessionIds = new Vector<Long>();
- this.queues = new HashMap<>();
- queueWaitHandler = new Handler();
- registeredTransports = new SparseArray<ArrayList<TransportType>>();
- awaitingSession = new Vector<>();
- setDeathNote(); //messaging Version
- this.routerMessagingVersion = routerMessagingVersion;
- }
-
-
- /**
- * Closes this app properly.
- */
- public void close(){
- clearDeathNote();
- clearBuffer();
- Collection<PacketWriteTaskBlockingQueue> queueCollection = queues.values();
- for(PacketWriteTaskBlockingQueue queue : queueCollection) {
- if (queue != null) {
- queue.clear();
- }
- }
- queueCollection.clear();
-
- if(queueWaitHandler!=null){
- if(queueWaitRunnable!=null){
- queueWaitHandler.removeCallbacks(queueWaitRunnable);
- }
- queueWaitHandler = null;
- }
- }
-
- public String getAppId() {
- return appId;
- }
-
- /*public long getAppId() {
- return appId;
- }*/
- /**
- * This is a convenience variable and may not be used or useful in different protocols
- * @return a vector of all the session ids associated with this app
- */
- public Vector<Long> getSessionIds() {
- return sessionIds;
- }
-
- /**
- * Returns the position of the desired object if it is contained in the vector. If not it will return -1.
- * @param id a session id value that is in question to be associated with this app
- * @return the index of the supplied session id or -1 if it is not associated with this app
- */
- public int containsSessionId(long id){
- return sessionIds.indexOf(id);
- }
- /**
- * This will remove a session from the session id list
- * @param sessionId the id of the session that should be removed
- * @return if the session was successfully removed, or false if the session id wasn't associated with this app.
- */
- public boolean removeSession(Long sessionId){
- int location = sessionIds.indexOf(sessionId);
- if(location>=0){
- Long removedSessionId = sessionIds.remove(location);
- registeredTransports.remove(sessionId.intValue());
- return removedSessionId != null;
- }else{
- return false;
- }
- }
-
- /**
- * This method is to manually put a session id into the mapping. This method should be used with extreme caution and
- * only in certain cases when the sesion id needs to exist at a specific position in the mapping (overwriting a value)
- * @param position the position at which the session id should be placed
- * @param sessionId the session id that will be put into the specific position in the mapping
- * @throws ArrayIndexOutOfBoundsException if the position is outside of the current size of the sessionIds vector
- */
- public void setSessionId(int position,long sessionId) throws ArrayIndexOutOfBoundsException {
- this.sessionIds.set(position, sessionId);
- synchronized (TRANSPORT_LOCK){
- this.registeredTransports.put((int)sessionId, new ArrayList<TransportType>());
- }
- }
-
- @SuppressWarnings("unused")
- public void clearSessionIds(){
- this.sessionIds.clear();
- }
-
- public Vector<TransportType> getAwaitingSession() {
- return awaitingSession;
- }
-
- protected void registerTransport(int sessionId, TransportType transportType){
- synchronized (TRANSPORT_LOCK){
- ArrayList<TransportType> transportTypes = this.registeredTransports.get(sessionId);
- if(transportTypes!= null){
- if(queues.get(transportType) == null){
- queues.put(transportType, new PacketWriteTaskBlockingQueue());
- }
- transportTypes.add(transportType);
- this.registeredTransports.put(sessionId,transportTypes);
- }
-
- }
- }
-
- /**
- *
- * @param sessionId the session id to find if a transport is registered. -1 for sessionId will
- * trigger a search through all sessions.
- * @param transportType the transport type to find if a transport is registered. If null is
- * passed, will return true for any transport being registered on
- * @return
- */
- protected boolean isRegisteredOnTransport(int sessionId, TransportType transportType){
- synchronized (TRANSPORT_LOCK){
- if(this.registeredTransports.indexOfKey(sessionId) >= 0){
- if(transportType == null){
- return this.registeredTransports.get(sessionId).size() > 0;
- }
- return this.registeredTransports.get(sessionId).indexOf(transportType) >= 0;
- }else if(sessionId < 0 ){
-
- //Check if any session is registered on this transport
- int numberOfSessions = registeredTransports.size();
- ArrayList<TransportType> transportTypes;
- for(int i = 0; i < numberOfSessions; i++){
- transportTypes = registeredTransports.valueAt(i);
- if(transportTypes != null) {
- if(transportType == null && transportTypes.size() > 0){
- return true;
- }
- for (TransportType type : transportTypes) {
- if (type.equals(transportType)) {
- return true;
- }
- }
- }
- }
- return false;
-
- }else{
- return false;
- }
- }
- }
-
- protected List<TransportType> getTransportsForSession(int sessionId){
- synchronized (TRANSPORT_LOCK){
- if(this.registeredTransports.indexOfKey(sessionId) >= 0){
- return this.registeredTransports.get(sessionId);
- }else{
- return null;
- }
- }
- }
-
- protected boolean unregisterTransport(int sessionId, TransportType transportType){
- synchronized (TRANSPORT_LOCK){
- if(this.registeredTransports.indexOfKey(sessionId) >= 0){
- return this.registeredTransports.get(sessionId).remove(transportType);
- }else{
- return false;
- }
- }
- }
-
- protected void unregisterAllTransports(int sessionId){
- synchronized (TRANSPORT_LOCK){
- if(this.registeredTransports.indexOfKey(sessionId) >= 0){
- this.registeredTransports.get(sessionId).clear();
- }else if(sessionId == -1){
- int size = this.registeredTransports.size();
- for(int i = 0; i <size; i++){
- this.registeredTransports.get(i).clear();
- }
- }
- }
- }
-
-
- /**
- * This method will attempt to return a transport type that can be associated to this
- * registered app
- * @return
- */
- private TransportType getCompatPrimaryTransport(){
- if(this.registeredTransports != null){
- List<TransportType> transportTypes = this.registeredTransports.valueAt(0);
- if(transportTypes != null){
- if(transportTypes.get(0) != null){
- return transportTypes.get(0);
- }
- }
- }
-
- //No transport stored
- if(bluetoothTransport != null && bluetoothTransport.isConnected()){
- return TransportType.BLUETOOTH;
- } else if(usbTransport!= null && usbTransport.isConnected()){
- return TransportType.USB;
- } else if(tcpTransport != null && tcpTransport.isConnected()){
- return TransportType.TCP;
- }
-
- return TransportType.BLUETOOTH;
- }
-
- @SuppressWarnings("SameReturnValue")
- public boolean handleIncommingClientMessage(final Bundle receivedBundle){
- int flags = receivedBundle.getInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_NONE);
- TransportType transportType = TransportType.valueForString(receivedBundle.getString(TransportConstants.TRANSPORT_TYPE));
- if(transportType == null){
- transportType = getCompatPrimaryTransport();
- receivedBundle.putString(TransportConstants.TRANSPORT_TYPE, transportType.name());
- }
-
- if(flags!=TransportConstants.BYTES_TO_SEND_FLAG_NONE){
- byte[] packet = receivedBundle.getByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME);
- if(flags == TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START){
- this.priorityForBuffingMessage = receivedBundle.getInt(TransportConstants.PACKET_PRIORITY_COEFFICIENT,0);
- }
- handleMessage(flags, packet, transportType);
- }else{
- //Add the write task on the stack
- PacketWriteTaskBlockingQueue queue = queues.get(transportType);
- if(queue == null){ //TODO check to see if there is any better place to put this
- queue = new PacketWriteTaskBlockingQueue();
- queues.put(transportType,queue);
- }
- queue.add(new PacketWriteTask(receivedBundle));
- PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(transportType);
- if(packetWriteTaskMaster!=null){
- packetWriteTaskMaster.alert();
- }
- }
- return true;
- }
-
- public int sendMessage(Message message){
- if(this.messenger == null){return SEND_MESSAGE_ERROR_MESSENGER_NULL;}
- if(message == null){return SEND_MESSAGE_ERROR_MESSAGE_NULL;}
- try {
- this.messenger.send(message);
- return SEND_MESSAGE_SUCCESS;
- } catch (RemoteException e) {
- e.printStackTrace();
- if(e instanceof DeadObjectException){
- return SEND_MESSAGE_ERROR_MESSENGER_DEAD_OBJECT;
- }else{
- return SEND_MESSAGE_ERROR_MESSENGER_GENERIC_EXCEPTION;
- }
- }
- }
-
- @Deprecated
- public void handleMessage(int flags, byte[] packet) {
- handleMessage(flags,packet,null);
- }
-
- public void handleMessage(int flags, byte[] packet, TransportType transportType){
- if(flags == TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START){
- clearBuffer();
- buffer = new ByteAraryMessageAssembler();
- buffer.init();
- buffer.setTransportType(transportType);
- }
- if(buffer != null){
- if (!buffer.handleMessage(flags, packet)) { //If this returns false
- Log.e(TAG, "Error handling bytes");
- }
- if (buffer.isFinished()) { //We are finished building the buffer so we should write the bytes out
- byte[] bytes = buffer.getBytes();
- PacketWriteTaskBlockingQueue queue = queues.get(transportType);
- if (queue != null) {
- queue.add(new PacketWriteTask(bytes, 0, bytes.length, this.priorityForBuffingMessage,transportType));
- PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(transportType);
- if (packetWriteTaskMaster != null) {
- packetWriteTaskMaster.alert();
- }
- }
- buffer.close();
- }
- }
- }
-
- protected PacketWriteTask peekNextTask(TransportType transportType){
- PacketWriteTaskBlockingQueue queue = queues.get(transportType);
- if(queue !=null){
- return queue.peek();
- }
- return null;
- }
-
- protected PacketWriteTask getNextTask(TransportType transportType){
- PacketWriteTaskBlockingQueue queue = queues.get(transportType);
- if(queue !=null){
- return queue.poll();
- }
- return null;
- }
-
- /**
- * This will inform the local app object that it was not picked to have the highest priority. This will allow the user to continue to perform interactions
- * with the module and not be bogged down by large packet requests.
- */
- protected void notIt(final TransportType transportType){
- PacketWriteTaskBlockingQueue queue = queues.get(transportType);
- if(queue!=null && queue.peek().priorityCoefficient>0){ //If this has any sort of priority coefficient we want to make it wait.
- //Flag to wait
- if(queueWaitHandler == null){
- Log.e(TAG, "Unable to pause queue, handler was null");
- }
- if(queueWaitRunnable == null){
- queueWaitRunnable = new Runnable(){
-
- @Override
- public void run() {
- pauseQueue(false);
- PacketWriteTaskMaster packetWriteTaskMaster = packetWriteTaskMasterMap.get(transportType);
- if(packetWriteTaskMaster!=null){
- packetWriteTaskMaster.alert();
- }
- }
- };
- }
- if(queuePaused){
- queueWaitHandler.removeCallbacks(queueWaitRunnable);
- }
- pauseQueue(queueWaitHandler.postDelayed(queueWaitRunnable, PAUSE_TIME_FOR_QUEUE));
- }
- }
- private void pauseQueue(boolean paused){
- this.queuePaused = paused;
- }
- protected void clearBuffer(){
- if(buffer!=null){
- buffer.close();
- buffer = null;
- }
- }
-
- protected boolean setDeathNote(){
- if(messenger!=null){
- if(deathNote == null){
- deathNote = new DeathRecipient(){
- final Object deathLock = new Object();
- @Override
- public void binderDied() {
- synchronized(deathLock){
- Log.w(TAG, "Binder died for app " + RegisteredApp.this.appId);
- if(messenger.getBinder()!=null){
- messenger.getBinder().unlinkToDeath(this, 0);
- }
- removeAllSessionsForApp(RegisteredApp.this,true);
- removeAppFromMap(RegisteredApp.this);
- startClientPings();
- }
- }
- };
- }
- try {
- messenger.getBinder().linkToDeath(deathNote, 0);
- return true;
- } catch (RemoteException e) {
- e.printStackTrace();
- return false;
- }
- }
- return false;
- }
-
- protected boolean clearDeathNote() {
- return messenger != null && messenger.getBinder() != null && deathNote != null && messenger.getBinder().unlinkToDeath(deathNote, 0);
- }
- }
-
- /**
- * A runnable task for writing out packets.
- * @author Joey Grover
- *
- */
- public class PacketWriteTask implements Runnable{
- private static final long DELAY_CONSTANT = 500; //250ms
- private static final long SIZE_CONSTANT = 1000; //1kb
- private static final long PRIORITY_COEF_CONSTANT = 500;
- private static final int DELAY_COEF = 1;
- private static final int SIZE_COEF = 1;
-
- private byte[] bytesToWrite = null;
- private final int offset, size, priorityCoefficient;
- private final long timestamp;
- final Bundle receivedBundle;
- TransportType transportType;
-
- @SuppressWarnings("SameParameterValue")
- @Deprecated
- public PacketWriteTask(byte[] bytes, int offset, int size, int priorityCoefficient) {
- this(bytes, offset, size, priorityCoefficient,null);
- }
-
- public PacketWriteTask(byte[] bytes, int offset, int size, int priorityCoefficient, TransportType transportType){
- timestamp = System.currentTimeMillis();
- bytesToWrite = bytes;
- this.offset = offset;
- this.size = size;
- this.priorityCoefficient = priorityCoefficient;
- receivedBundle = null;
- this.transportType = transportType;
- }
-
- public PacketWriteTask(Bundle bundle){
- this.receivedBundle = bundle;
- timestamp = System.currentTimeMillis();
- bytesToWrite = bundle.getByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME);
- offset = bundle.getInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, 0); //If nothing, start at the beginning of the array
- size = bundle.getInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, bytesToWrite.length); //In case there isn't anything just send the whole packet.
- this.priorityCoefficient = bundle.getInt(TransportConstants.PACKET_PRIORITY_COEFFICIENT,0);
- this.transportType = TransportType.valueForString(receivedBundle.getString(TransportConstants.TRANSPORT_TYPE));
-
- }
-
- protected void setTransportType(TransportType transportType){
- this.transportType = transportType;
- }
-
- @Override
- public void run() {
- if(receivedBundle != null){
- writeBytesToTransport(receivedBundle);
- }else if(bytesToWrite !=null){
- manuallyWriteBytes(this.transportType, bytesToWrite, offset, size);
- }
- }
-
- private long getWeight(long currentTime){ //Time waiting - size - priority_coef
- return ((((currentTime-timestamp) + DELAY_CONSTANT) * DELAY_COEF ) - ((size -SIZE_CONSTANT) * SIZE_COEF) - (priorityCoefficient * PRIORITY_COEF_CONSTANT));
- }
- }
-
- /**
- * Extends thread to consume PacketWriteTasks in a priority queue fashion. It will attempt to look
- * at all apps serial queue of tasks and compare them
- * @author Joey Grover
- *
- */
- private class PacketWriteTaskMaster extends Thread{
- protected final Object QUEUE_LOCK = new Object();
- private boolean isHalted = false, isWaiting = false;
- private TransportType transportType;
-
- public PacketWriteTaskMaster(){
- this.setName("PacketWriteTaskMaster");
- }
- protected void setTransportType(TransportType transportType){
- this.transportType = transportType;
- }
-
- @Override
- public void run() {
- while(!isHalted){
- try{
- PacketWriteTask task;
- synchronized(QUEUE_LOCK){
- task = getNextTask(transportType);
- if(task != null){
- task.run();
- }else{
- isWaiting = true;
- QUEUE_LOCK.wait();
- isWaiting = false;
- }
- }
- }catch(InterruptedException e){
- break;
- }
- }
- }
-
- private void alert(){
- if(isWaiting){
- synchronized(QUEUE_LOCK){
- QUEUE_LOCK.notify();
- }
- }
- }
-
- private void close(){
- this.isHalted = true;
- }
- }
-
- /**
- * Custom queue to prioritize packet write tasks based on their priority coefficient.<br> The queue is a doubly linked list.<br><br>
- * When a tasks is added to the queue, it will be evaluated using it's priority coefficient. If the coefficient is greater than 0, it will simply
- * be placed at the end of the queue. If the coefficient is equal to 0, the queue will begin to iterate at the head and work it's way back. Once it is found that the current
- * tasks has a priority coefficient greater than 0, it will be placed right before that task. The idea is to keep a semi-serial queue but creates a priority that allows urgent
- * tasks such as UI related to skip near the front. However, it is assumed those tasks of higher priority should also be handled in a serial fashion.
- *
- * @author Joey Grover
- *
- */
- @SuppressWarnings("Convert2Diamond")
- private class PacketWriteTaskBlockingQueue{
- final class Node<E> {
- final E item;
- Node<E> prev;
- Node<E> next;
- Node(E item, Node<E> previous, Node<E> next) {
- this.item = item;
- this.prev = previous;
- this.next = next;
- }
- }
-
- private Node<PacketWriteTask> head;
- private Node<PacketWriteTask> tail;
-
- /**
- * This will take the given task and insert it at the tail of the queue
- * @param task the task to be inserted at the tail of the queue
- */
- private void insertAtTail(PacketWriteTask task){
- if (task == null){
- throw new NullPointerException();
- }
- Node<PacketWriteTask> oldTail = tail;
- Node<PacketWriteTask> newTail = new Node<PacketWriteTask>(task, oldTail, null);
- tail = newTail;
- if (head == null){
- head = newTail;
- }else{
- oldTail.next = newTail;
- }
-
- }
-
- /**
- * This will take the given task and insert it at the head of the queue
- * @param task the task to be inserted at the head of the queue
- */
- private void insertAtHead(PacketWriteTask task){
- if (task == null){
- throw new NullPointerException();
- }
- Node<PacketWriteTask> oldHead = head;
- Node<PacketWriteTask> newHead = new Node<PacketWriteTask>(task, null, oldHead);
- head = newHead;
- if (tail == null){
- tail = newHead;
- }else{
- if(oldHead!=null){
- oldHead.prev = newHead;
- }
- }
- }
-
- /**
- * Insert the task in the queue where it belongs
- * @param task the new PacketWriteTask that needs to be added to the queue to be handled
- */
- public void add(PacketWriteTask task){
- synchronized(this){
- if (task == null){
- throw new NullPointerException();
- }
-
- //If we currently don't have anything in our queue
- if(head == null || tail == null){
- Node<PacketWriteTask> taskNode = new Node<PacketWriteTask>(task, head, tail);
- head = taskNode;
- tail = taskNode;
- }else if(task.priorityCoefficient>0){ //If the task is already a not high priority task, we just need to insert it at the tail
- insertAtTail(task);
- }else if(head.item.priorityCoefficient>0){ //If the head task is already a not high priority task, we just need to insert at head
- insertAtHead(task);
- }else{
- if(tail.item.priorityCoefficient==0){ //Saves us from going through the entire list if all of these tasks are priority coef == 0
- insertAtTail(task);
- return;
- }
- Node<PacketWriteTask> currentPlace = head;
- while(true){
- if(currentPlace.item.priorityCoefficient==0){
- if(currentPlace.next==null){
- //We've reached the end of the list
- insertAtTail(task);
- return;
- }else{
- currentPlace = currentPlace.next;
- }
- }else{
- //We've found where this task should be inserted
- Node<PacketWriteTask> previous = currentPlace.prev;
- Node<PacketWriteTask> taskNode = new Node<PacketWriteTask>(task, previous, currentPlace);
- previous.next = taskNode;
- currentPlace.prev = taskNode;
- return;
-
- }
- }
- }
- }
- }
-
- /**
- * Peek at the current head of the queue
- * @return the task at the head of the queue but does not remove it from the queue
- */
- public PacketWriteTask peek(){
- synchronized(this){
- if(head == null){
- return null;
- }else{
- return head.item;
- }
- }
- }
-
- /**
- * Remove the head of the queue
- * @return the old head of the queue
- */
- public PacketWriteTask poll(){
- synchronized(this){
- if(head == null){
- return null;
- }else{
- Node<PacketWriteTask> retValNode = head;
- Node<PacketWriteTask> newHead = head.next;
- if(newHead == null){
- tail = null;
- }
- head = newHead;
-
- return retValNode.item;
- }
- }
- }
-
- /**
- * Currently only clears the head and the tail of the queue.
- */
- public void clear(){
- //Should probably go through the linked list and clear elements, but gc should clear them out automatically.
- head = null;
- tail = null;
- }
- }
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java
deleted file mode 100644
index 2b3a17a8e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package com.smartdevicelink.transport;
-
-import java.lang.ref.WeakReference;
-
-import com.smartdevicelink.util.AndroidTools;
-
-import android.annotation.SuppressLint;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.content.pm.PackageManager;
-import android.content.pm.ServiceInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.os.Build;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.RemoteException;
-import android.util.Log;
-import android.os.Looper;
-
-import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
-
-public class SdlRouterStatusProvider {
-
- private static final String TAG = "SdlRouterStateProvider";
-
- private Context context = null;
- private boolean isBound = false;
- ConnectedStatusCallback cb = null;
- Messenger routerServiceMessenger = null;
- private ComponentName routerService = null;
- private int flags = 0;
-
- final Messenger clientMessenger;
-
- private ServiceConnection routerConnection= new ServiceConnection() {
-
- public void onServiceConnected(ComponentName className, IBinder service) {
- Log.d(TAG, "Bound to service " + className.toString());
- routerServiceMessenger = new Messenger(service);
- isBound = true;
- //So we just established our connection
- //Register with router service
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_STATUS_CONNECTED_STATE_REQUEST;
- msg.arg1 = flags;
- msg.replyTo = clientMessenger;
- try {
- routerServiceMessenger.send(msg);
- } catch (RemoteException e) {
- e.printStackTrace();
- if(cb!=null){
- cb.onConnectionStatusUpdate(false, routerService, context);
- }
- }
- }
-
- public void onServiceDisconnected(ComponentName className) {
- Log.d(TAG, "UN-Bound from service " + className.getClassName());
- routerServiceMessenger = null;
- isBound = false;
- }
- };
-
- public SdlRouterStatusProvider(Context context, ComponentName service, ConnectedStatusCallback callback){
- if(context == null || service == null || callback == null){
- throw new IllegalStateException("Supplied params are not correct. Context == null? "+ (context==null) + " ComponentName == null? " + (service == null) + " ConnectedStatusListener == null? " + callback);
- }
- this.context = context;
- this.routerService = service;
- this.cb = callback;
- this.clientMessenger = new Messenger(new ClientHandler(this));
-
- }
- public void setFlags(int flags){
- this.flags = flags;
- }
- public void checkIsConnected(){
- if(!AndroidTools.isServiceExported(context,routerService) || !bindToService()){
- //We are unable to bind to service
- cb.onConnectionStatusUpdate(false, routerService, context);
- unBindFromService();
- }
- }
-
- public void cancel(){
- if(isBound){
- unBindFromService();
- }
- }
-
- private boolean bindToService(){
- if(isBound){
- return true;
- }
- if(clientMessenger == null){
- return false;
- }
- Intent bindingIntent = new Intent();
- bindingIntent.setClassName(this.routerService.getPackageName(), this.routerService.getClassName());//This sets an explicit intent
- //Quickly make sure it's just up and running
- if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
- context.startService(bindingIntent);
- }else {
- bindingIntent.putExtra(FOREGROUND_EXTRA, true);
- context.startForegroundService(bindingIntent);
-
- }
- bindingIntent.setAction( TransportConstants.BIND_REQUEST_TYPE_STATUS);
- return context.bindService(bindingIntent, routerConnection, Context.BIND_AUTO_CREATE);
- }
-
- private void unBindFromService(){
- try{
- if(context!=null && routerConnection!=null){
- context.unbindService(routerConnection);
- }else{
- Log.w(TAG, "Unable to unbind from router service, context was null");
- }
-
- }catch(IllegalArgumentException e){
- //This is ok
- }
- }
-
- private void handleRouterStatusConnectedResponse(int connectedStatus){
- if(cb!=null){
- cb.onConnectionStatusUpdate(connectedStatus == 1, routerService,context);
- }
- unBindFromService();
- routerServiceMessenger =null;
- }
-
- static class ClientHandler extends Handler {
- final WeakReference<SdlRouterStatusProvider> provider;
-
- public ClientHandler(SdlRouterStatusProvider provider){
- super(Looper.getMainLooper());
- this.provider = new WeakReference<SdlRouterStatusProvider>(provider);
- }
-
- @Override
- public void handleMessage(Message msg) {
- if(provider.get()==null){
- return;
- }
- switch (msg.what) {
- case TransportConstants.ROUTER_STATUS_CONNECTED_STATE_RESPONSE:
- provider.get().handleRouterStatusConnectedResponse(msg.arg1);
- break;
- default:
- break;
- }
- }
- };
-
- public interface ConnectedStatusCallback{
- public void onConnectionStatusUpdate(boolean connected, ComponentName service, Context context);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java
deleted file mode 100644
index 27c87bcef..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package com.smartdevicelink.transport;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.trace.SdlTrace;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.util.DebugTool;
-
-public abstract class SdlTransport {
- private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
-
- private final static String FailurePropagating_Msg = "Failure propagating ";
- private Boolean isConnected = false;
-
- private String _sendLockObj = "lock";
-
-
- // Get status of transport connection
- public Boolean getIsConnected() {
- return isConnected;
- }
-
- //protected SdlTransport(String endpointName, String param2, ITransportListener transportListener)
- protected SdlTransport(ITransportListener transportListener) {
- if (transportListener == null) {
- throw new IllegalArgumentException("Provided transport listener interface reference is null");
- } // end-if
- _transportListener = transportListener;
- } // end-method
-
- // This method is called by the subclass to indicate that data has arrived from
- // the transport.
- protected void handleReceivedPacket(SdlPacket packet) {
- try {
- // Trace received data
- if (packet!=null) {
- // Send transport data to the siphon server
- //FIXME SiphonServer.sendBytesFromSDL(receivedBytes, 0, receivedBytesLength);
- //SdlTrace.logTransportEvent("", null, InterfaceActivityDirection.Receive, receivedBytes, receivedBytesLength, SDL_LIB_TRACE_KEY);
-
- _transportListener.onTransportPacketReceived(packet);
- } // end-if
- } catch (Exception excp) {
- DebugTool.logError(FailurePropagating_Msg + "handleBytesFromTransport: " + excp.toString(), excp);
- handleTransportError(FailurePropagating_Msg, excp);
- } // end-catch
- } // end-method
-
- // This method must be implemented by transport subclass, and is called by this
- // base class to actually send an array of bytes out over the transport. This
- // method is meant to only be callable within the class hierarchy.
- protected abstract boolean sendBytesOverTransport(SdlPacket packet);
-
- // This method is called by whomever has reference to transport to have bytes
- // sent out over transport.
- /* public boolean sendBytes(byte[] message) {
- return sendBytes(message, 0, message.length);
- }*/ // end-method
-
- // This method is called by whomever has reference to transport to have bytes
- // sent out over transport.
- public boolean sendBytes(SdlPacket packet) {
- boolean bytesWereSent = false;
- synchronized (_sendLockObj) {
- bytesWereSent = sendBytesOverTransport(packet);//message, offset, length);
- } // end-lock
- // Send transport data to the siphon server
- //FIXME SiphonServer.sendBytesFromAPP(message, offset, length);
-
- //FIXME SdlTrace.logTransportEvent("", null, InterfaceActivityDirection.Transmit, message, offset, length, SDL_LIB_TRACE_KEY);
- return bytesWereSent;
- } // end-method
-
- private ITransportListener _transportListener = null;
-
- // This method is called by the subclass to indicate that transport connection
- // has been established.
- protected void handleTransportConnected() {
- isConnected = true;
- try {
- SdlTrace.logTransportEvent("Transport.connected", null, InterfaceActivityDirection.Receive, null, 0, SDL_LIB_TRACE_KEY);
- _transportListener.onTransportConnected();
- } catch (Exception excp) {
- DebugTool.logError(FailurePropagating_Msg + "onTransportConnected: " + excp.toString(), excp);
- handleTransportError(FailurePropagating_Msg + "onTransportConnected", excp);
- } // end-catch
- } // end-method
-
- // This method is called by the subclass to indicate that transport disconnection
- // has occurred.
- protected void handleTransportDisconnected(final String info) {
- isConnected = false;
-
- try {
- SdlTrace.logTransportEvent("Transport.disconnect: " + info, null, InterfaceActivityDirection.Transmit, null, 0, SDL_LIB_TRACE_KEY);
- _transportListener.onTransportDisconnected(info);
- } catch (Exception excp) {
- DebugTool.logError(FailurePropagating_Msg + "onTransportDisconnected: " + excp.toString(), excp);
- } // end-catch
- } // end-method
-
- // This method is called by the subclass to indicate a transport error has occurred.
- protected void handleTransportError(final String message, final Exception ex) {
- isConnected = false;
- _transportListener.onTransportError(message, ex);
- }
-
- public abstract void openConnection() throws SdlException;
- public abstract void disconnect();
-
- /**
- * Abstract method which should be implemented by subclasses in order to return actual type of the transport.
- *
- * @return One of {@link TransportType} enumeration values.
- *
- * @see TransportType
- */
- public abstract TransportType getTransportType();
-
- public abstract String getBroadcastComment();
-} // end-class
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SiphonServer.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SiphonServer.java
deleted file mode 100644
index ab8a8a7bd..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/SiphonServer.java
+++ /dev/null
@@ -1,384 +0,0 @@
-package com.smartdevicelink.transport;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.BindException;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-import com.smartdevicelink.util.*;
-
-public class SiphonServer {
- // Prohibit use of no-arg ctor
- private SiphonServer() {}
-
- enum SiphonDataType {
- fromSdl,
- fromApp,
- appLog,
- formattedTrace,
- baselineTimeStamp,
- traceSettings
- }
-
- // Boolean to enable/disable the siphon
- private static Boolean m_siphonEnabled = false;
-
- // Boolean to determine if the siphon has been initialized
- private static Boolean m_siphonInitialized = false;
- private static Boolean m_foundOpenSocket = false;
- private static Socket m_siphonSocket = null;
- private static Object m_siphonLock = new Object();
- private static ServerSocket m_listeningSocket = null;
- private static short m_listenPort = -1;
- private static OutputStream m_siphonSocketOutputStream = null;
- private static SiphonServerThread m_siphonClientThread = null;
-
- // Initial timestamp in MS
- private static long m_startTimeStamp = 0;
-
- // SDL Trace Message Version
- private static byte m_sdlTraceMsgVersionNumber = 1;
-
- // Max number of ports to attempt a connection on
- private final static Integer MAX_NUMBER_OF_PORT_ATTEMPTS = 20;
-
- // Starting port for future port attempts
- private final static short FIRST_PORT_TO_ATTEMPT_CONNECTION = 7474;
-
- // Boolean to determine if formatted trace is being sent
- private static Boolean m_sendingFormattedTrace = false;
-
- public static short enableSiphonServer() {
- m_siphonEnabled = true;
- SiphonServer.init();
- return m_listenPort;
- }
-
- public static Boolean getSiphonEnabledStatus() {
- return m_siphonEnabled;
- }
-
- public static short disableSiphonServer() {
- if (!m_siphonEnabled) {
- m_listenPort = -1;
- } else {
- m_siphonEnabled = false;
- }
-
- m_siphonInitialized = false;
-
- try {
- SiphonServer.closeServer();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return m_listenPort;
- }
-
- public static boolean init() {
- // Only initialize if the siphon has not been initialized previously
-
- // Check here to be lean. If true, no need to sdlhronize
- if (m_siphonInitialized) {
- return true;
- }
-
- synchronized (m_siphonLock) {
- // To prevent a race condition, re-check m_siphonInitialized inside of sdlhronize block
- if (!m_siphonInitialized) {
- if (m_siphonClientThread == null) {
- // Set current time stamp
- m_startTimeStamp = System.currentTimeMillis();
-
- // Start Siphon Thread
- m_siphonClientThread = new SiphonServerThread();
- m_siphonClientThread.setName("Siphon");
- m_siphonClientThread.setDaemon(true);
- m_foundOpenSocket = m_siphonClientThread.findOpenSocket(FIRST_PORT_TO_ATTEMPT_CONNECTION);
- m_siphonClientThread.start();
-
- m_siphonInitialized = true;
- } // end-if
- } // end-lock
- }
-
- return m_siphonInitialized;
- } // end-method
-
- public static void closeServer() throws IOException {
-
- if (m_siphonClientThread != null) {
- m_siphonClientThread.halt();
- m_siphonClientThread = null;
- }
-
- if (m_listeningSocket != null) {
- m_listeningSocket.close();
- m_listeningSocket = null;
- }
-
- if (m_siphonSocket != null) {
- m_siphonSocket.close();
- m_siphonSocket = null;
- }
-
- if (m_siphonSocketOutputStream != null) {
- m_siphonSocketOutputStream.close();
- m_siphonSocketOutputStream = null;
- }
- }
-
- public static Boolean sendBytesFromAPP(byte[] msgBytes, int offset, int length) {
-
- if (m_sendingFormattedTrace) {
- return false;
- }
-
- return sendSiphonData(SiphonDataType.fromApp, msgBytes, offset, length);
- } // end-method
-
- public static Boolean sendBytesFromSDL(byte[] msgBytes, int offset, int length) {
-
- if (m_sendingFormattedTrace) {
- return false;
- }
-
- return sendSiphonData(SiphonDataType.fromSdl, msgBytes, offset, length);
- } // end-method
-
- public static Boolean sendSiphonLogData(String message) {
-
- if (m_sendingFormattedTrace) {
- return false;
- }
-
- if (message == null || message.length() == 0) {
- return false;
- }
-
- byte messageBytes[] = null;
- int messageLength = 0;
-
- try {
- messageBytes = message.getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- return false;
- }
-
- messageLength = messageBytes.length;
- return sendSiphonData(SiphonDataType.appLog, messageBytes, 0, messageLength);
-
- }
-
- public static Boolean sendFormattedTraceMessage(String message) {
-
- if (message == null || message.length() == 0) {
- return false;
- }
-
- byte messageBytes[] = null;
- int messageLength = 0;
-
- try {
- messageBytes = message.getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- return false;
- }
-
- messageLength = messageBytes.length;
- if (sendSiphonData(SiphonDataType.formattedTrace, messageBytes, 0, messageLength)) {
- m_sendingFormattedTrace = true;
- return true;
- } else {
- return false;
- }
- }
-
- private static Boolean sendSiphonData(SiphonDataType direction, byte[] msgBytes, int offset, int length) {
- byte siphonDataTypeIndicator = 0x00;
-
- long currentDateTime = System.currentTimeMillis();
- Integer deltaTimeMills = null;
-
- deltaTimeMills = (int)(currentDateTime - m_startTimeStamp);
-
- switch(direction) {
- case fromSdl:
- siphonDataTypeIndicator = 0x00;
- break;
- case fromApp:
- siphonDataTypeIndicator = 0x01;
- break;
- case appLog:
- siphonDataTypeIndicator = 0x02;
- break;
- case formattedTrace:
- siphonDataTypeIndicator = 0x03;
- break;
- case baselineTimeStamp:
- siphonDataTypeIndicator = 0x04;
- break;
- case traceSettings:
- siphonDataTypeIndicator = 0x05;
- break;
- default:
- siphonDataTypeIndicator = 0x00;
- break;
- }
-
- // Set high bit to indicate new format
- siphonDataTypeIndicator = (byte)((byte)0x80 | siphonDataTypeIndicator);
-
- return sendDataToSiphonSocket(siphonDataTypeIndicator, deltaTimeMills, msgBytes, offset, length);
- }
-
- private synchronized static Boolean sendDataToSiphonSocket(byte directionIndicator, Integer timeStamp,
- byte[] msgBytes, int offset, int length) {
- if (!m_siphonEnabled) {
- return false;
- }
-
- if (msgBytes == null || length == 0) {
- return false;
- }
-
- OutputStream siphonOutputStream = null;
-
- synchronized (m_siphonLock) {
- siphonOutputStream = m_siphonSocketOutputStream;
- } // end-lock
-
- if (siphonOutputStream == null) {
- return false;
- }
-
- try {
- // blobSize = length(of message) + 1(size of direction indicator)
- // + 1 (size of msgVersionNumber) + 4 (size of timeStamp)
- int blobSize = length + 1 + 1 + 4;
-
- siphonOutputStream.write(BitConverter.intToByteArray(blobSize));
- siphonOutputStream.write(new byte[] {directionIndicator});
- siphonOutputStream.write(new byte[] {m_sdlTraceMsgVersionNumber});
- siphonOutputStream.write(intToByteArray(timeStamp));
- siphonOutputStream.write(msgBytes, offset, length);
- } catch (Exception ex) {
- return false;
- } // end-catch
-
- return true;
- } // end-method
-
- private static class SiphonServerThread extends Thread {
-
- private Boolean isHalted = false;
- short listenPort;
-
- public void halt() {
- isHalted = true;
- }
-
- private boolean findOpenSocket(short port) {
- // Accept incoming sihpon connection from trace utility.
- Boolean foundOpenPort = false;
- listenPort = port;
-
- // Listen to accept incoming connection from SDL
- while (!foundOpenPort) {
- try {
- m_listeningSocket = new ServerSocket(listenPort);
- foundOpenPort = true;
- m_listenPort = listenPort;
- } catch (BindException ex) {
- listenPort++;
- if(listenPort > port + MAX_NUMBER_OF_PORT_ATTEMPTS) {
- return false;
- }
- } catch (IOException e) {
- return false;
- }
- }
-
- return foundOpenPort;
- }
-
- private void startServerOnPort() throws IOException {
- Socket newSocket = null;
-
- // Wait for a connection
- newSocket = m_listeningSocket.accept();
-
- // If isHalted after accept() delay, return
- if (isHalted) {
- return;
- }
-
- synchronized (m_siphonLock) {
- // Reset siphonSocketOutputStream
- if (m_siphonSocketOutputStream != null) {
- try {
- m_siphonSocketOutputStream.close();
- } catch (IOException e) {
- // Do nothing
- }
- m_siphonSocketOutputStream = null;
- }
-
- // Reset siphonSocket
- if (m_siphonSocket != null) {
- try {
- m_siphonSocket.close();
- } catch (IOException e) {
- // Do nothing
- }
- m_siphonSocket = null;
- }
-
- // Store the new socket
- m_siphonSocket = newSocket;
-
- // Set Socket Options
- m_siphonSocket.setKeepAlive(true);
-
- // Get the output stream of the connection
- m_siphonSocketOutputStream = m_siphonSocket.getOutputStream();
-
- // Output version number to the Siphon upon connection (version number prepending to logInfo)
- DebugTool.logInfo("Siphon connected.");
- } // end-lock
- } // end-method
-
- @Override
- public void run() {
- try {
- if (m_foundOpenSocket){
- while (!isHalted) {
- startServerOnPort();
- }
- }
- } catch (Exception ex) {
- // Do nothing
- } finally {
- if (m_listeningSocket != null) {
- try {
- m_listeningSocket.close();
- } catch (IOException e) {
- // Do nothing
- }
- m_listeningSocket = null;
- }
- }
- }
- }
-
- private static final byte[] intToByteArray(int value) {
- return new byte[] {
- (byte)(value >>> 24),
- (byte)(value >>> 16),
- (byte)(value >>> 8),
- (byte)value};
- }
-} // end-class \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java b/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java
deleted file mode 100644
index c858c7790..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java
+++ /dev/null
@@ -1,528 +0,0 @@
-package com.smartdevicelink.transport;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-
-import android.annotation.TargetApi;
-import android.os.Build;
-import android.os.NetworkOnMainThreadException;
-import android.util.Log;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.transport.enums.TransportType;
-
-/**
- * General comments:
- *
- * 1) Transport layer can be reorganized to properly incapsulate thread-related code according to Android OS guidelines
- * 2) Currently there are different cases when transport error information sent to listener components
- * a) when there are some errors during writing data to transport
- * b) when there are errors during connection establishing/reading data
- * But information about transport disconnection is sent only if disconnection was successful. So we have following
- * sequences:
- * a) handleTransportConnected -> read without errors -> handleTransportDisconnected
- * b) handleTransportConnected -> handleTransportError(write with errors) -> handleTransportDisconnected
- * c) handleTransportConnected -> handleTransportError(read with errors) -> handleTransportError(socket closed)
- *
- * They can be changed to be more natural and easy to use.
- *
- * 3) Public api is inconsistent. During single call of some api method (for example "openConnection") some of the
- * following result can appears:
- * a) SdlException thrown
- * b) onTransportError callback called on listeners
- *
- * 4) Handling of connection must be more stable
- * 5) General solution in case of reconnecting must be implemented
- * 6) It must be common and same solution for handling information about physical device adapters (BT, WiFi etc.)
- */
-
-/**
- * Class that implements TCP transport
- */
-public class TCPTransport extends SdlTransport {
-
- /**
- * Size of the read buffer.
- */
- private static final int READ_BUFFER_SIZE = 4096;
-
- /**
- * Delay between reconnect attempts
- */
- private static final int RECONNECT_DELAY = 5000;
-
- /**
- * Count of the reconnect retries
- */
- private static final int RECONNECT_RETRY_COUNT = 30;
-
- /**
- * Instance of TCP transport configuration
- */
- private TCPTransportConfig mConfig = null;
-
- /**
- * Instance of the client socket
- */
- private Socket mSocket = null;
-
- /**
- * Instance of the input stream. Used to read data from SmartDeviceLinkCore
- */
- private InputStream mInputStream = null;
-
- /**
- * Instance of the output stream. Used to send data to SmartDeviceLinkCore
- */
- private OutputStream mOutputStream = null;
-
- /**
- * Instance of the separate thread, that does actual work, related to connecting/reading/writing data
- */
- private TCPTransportThread mThread = null;
-
- /**
- * Initial internal state of the component. Used like a simple lightweight FSM replacement while component
- * must behave differently in response to it's public function calls depending of it's current state
- */
- private TCPTransportState mCurrentState = TCPTransportState.IDLE;
-
- /**
- * Constructs TCP transport component instance
- *
- * @param tcpTransportConfig Instance of the TCP transport configuration
- * @param transportListener Listener that will be notified on different TCP transport activities
- */
- public TCPTransport(TCPTransportConfig tcpTransportConfig, ITransportListener transportListener) {
- super(transportListener);
- this.mConfig = tcpTransportConfig;
- }
-
- /**
- * Performs actual work of sending array of bytes over the transport
- * @param msgBytes Bytes to send
- * @param offset Offset in the bytes array to send data from
- * @param length Number of bytes to send
- * @return True if data was sent successfully, False otherwise
- */
- @TargetApi(Build.VERSION_CODES.HONEYCOMB)
- @Override
- protected boolean sendBytesOverTransport(SdlPacket packet) {
- TCPTransportState currentState = getCurrentState();
- byte[] msgBytes = packet.constructPacket();
- logInfo(String.format("TCPTransport: sendBytesOverTransport requested. Size: %d, Offset: %d, Length: %d, Current state is: %s"
- , msgBytes.length, 0, msgBytes.length, currentState.name()));
-
- boolean bResult = false;
-
- if(currentState == TCPTransportState.CONNECTED) {
- if (mOutputStream != null) {
- logInfo("TCPTransport: sendBytesOverTransport request accepted. Trying to send data");
- try {
- mOutputStream.write(msgBytes, 0, msgBytes.length);
- bResult = true;
- logInfo("TCPTransport.sendBytesOverTransport: successfully send data");
- } catch (IOException | NetworkOnMainThreadException e) {
- logError("TCPTransport.sendBytesOverTransport: error during sending data: " + e.getMessage());
- bResult = false;
- }
- } else {
- logError("TCPTransport: sendBytesOverTransport request accepted, but output stream is null");
- }
- }
- else {
- logInfo("TCPTransport: sendBytesOverTransport request rejected. Transport is not connected");
- bResult = false;
- }
-
- return bResult;
- }
-
- /**
- * Tries to open connection to SmartDeviceLinkCore.
- * Actual try will be performed only if no actual connection is available
- * @throws SdlException
- */
- @Override
- public void openConnection() throws SdlException {
- TCPTransportState currentState = getCurrentState();
- logInfo(String.format("TCPTransport: openConnection requested. Current state is: %s", currentState.name()));
-
- if(currentState == TCPTransportState.IDLE) {
- synchronized (this) {
- setCurrentState(TCPTransportState.CONNECTING);
- logInfo("TCPTransport: openConnection request accepted. Starting transport thread");
- try {
- mThread = new TCPTransportThread();
- mThread.setDaemon(true);
- mThread.start();
-
- // Initialize the SiphonServer
- if (SiphonServer.getSiphonEnabledStatus()) {
- SiphonServer.init();
- }
-
- } catch (Exception e) {
- logError("TCPTransport: Exception during transport thread starting", e);
- throw new SdlException(e);
- }
- }
- } else {
- logInfo("TCPTransport: openConnection request rejected. Another connection is not finished");
- }
- }
-
-
- /**
- * Tries to disconnect from SmartDeviceLinkCore.
- * Actual try will be performed only if connection is available
- */
- @Override
- public void disconnect() {
- TCPTransportState currentState = getCurrentState();
- logInfo(String.format("TCPTransport: disconnect requested from client. Current state is: %s", currentState.name()));
-
- if(currentState == TCPTransportState.CONNECTED) {
- logInfo("TCPTransport: disconnect request accepted.");
- synchronized (this) {
- disconnect(null, null, true);
- }
- } else {
- logInfo("TCPTransport: disconnect request rejected. Transport is not connected");
- }
- }
-
- /**
- * Performs actual work related to disconnecting from SmartDeviceLinkCore.
- *
- * @param message Message that describes disconnect reason
- * @param exception Some of the possible exceptions that was the reason of disconnecting
- * @param stopThread True if not only disconnection must be done but also thread that handles connection must be
- * also stopped so no reconnect attempts will be made
- */
- private synchronized void disconnect(String message, Exception exception, boolean stopThread) {
-
- if(getCurrentState() == TCPTransportState.DISCONNECTING) {
- logInfo("TCPTransport: disconnecting already in progress");
- return;
- }
-
- setCurrentState(TCPTransportState.DISCONNECTING);
-
- String disconnectMsg = (message == null ? "" : message);
- if (exception != null) {
- disconnectMsg += ", " + exception.toString();
- }
-
- try {
- if(mThread != null && stopThread) {
- mThread.halt();
- mThread.interrupt();
- }
-
- if(mSocket != null){
- mSocket.close();
- }
- mSocket = null;
- } catch (IOException e) {
- logError("TCPTransport.disconnect: Exception during disconnect: " + e.getMessage());
- }
-
- if (exception == null) {
- // This disconnect was not caused by an error, notify the proxy that
- // the transport has been disconnected.
- logInfo("Disconnect is correct. Handling it");
- handleTransportDisconnected(disconnectMsg);
- } else {
- // This disconnect was caused by an error, notify the proxy
- // that there was a transport error.
- logError("Disconnect is incorrect. Handling it as error");
- handleTransportError(disconnectMsg, exception);
- }
- }
-
- /**
- * Overridden abstract method which returns specific type of this transport.
- *
- * @return Constant value - TransportType.TCP.
- *
- * @see TransportType
- */
- public TransportType getTransportType() {
- return TransportType.TCP;
- }
-
- /**
- * Internal method for logging information messages
- * @param message Message to log
- */
- protected void logInfo(String message) {
- Log.i(getClass().getName(), message);
- }
-
- /**
- * Internal method for logging error messages
- * @param message Message to log
- */
- protected void logError(String message) {
- Log.e(getClass().getName(), message);
- }
-
- /**
- * Internal method for logging warning messages
- * @param message Message to log
- */
- protected void logWarning(String message) {
- Log.w(getClass().getName(), message);
- }
-
- /**
- * Internal method for logging error message together with information about exception that was the reason of it
- * @param message Message to log
- * @param throwable Exception, that was the main reason for logged error message
- */
- protected void logError(String message, Throwable throwable) {
- Log.e(getClass().getName(), message, throwable);
- }
-
- /**
- * Internal class that represents separate thread, that does actual work, related to connecting/reading/writing data
- */
- private class TCPTransportThread extends Thread {
- SdlPsm psm;
- public TCPTransportThread(){
- psm = new SdlPsm();
- }
- /**
- * Represents current thread state - halted or not. This flag is used to change internal behavior depending
- * on current state.
- */
- private Boolean isHalted = false;
-
- /**
- * Method that marks thread as halted.
- */
- public void halt() {
- isHalted = true;
- }
-
- /**
- * Tries to connect to the SmartDeviceLink core. Behavior depends autoReconnect configuration param:
- * a) If autoReconnect is false, then only one connect try will be performed.
- * b) If autoReconnect is true, then in case of connection error continuous reconnect will be performed
- * after short delay until connection will be established or retry count will be reached
- *
- * @return true if connection established and false otherwise
- */
- private boolean connect() {
- boolean bConnected;
- int remainingRetry = RECONNECT_RETRY_COUNT;
-
- synchronized (TCPTransport.this) {
- do {
- try {
-
- if ((null != mSocket) && (!mSocket.isClosed())) {
- logInfo("TCPTransport.connect: Socket is not closed. Trying to close it");
- mSocket.close();
- }
-
- logInfo(String.format("TCPTransport.connect: Socket is closed. Trying to connect to %s", mConfig));
- mSocket = new Socket();
- mSocket.connect(new InetSocketAddress(mConfig.getIPAddress(), mConfig.getPort()));
- mOutputStream = mSocket.getOutputStream();
- mInputStream = mSocket.getInputStream();
-
- } catch (IOException e) {
- logError("TCPTransport.connect: Exception during connect stage: " + e.getMessage());
- }
-
- bConnected = (null != mSocket) && mSocket.isConnected();
-
- if(bConnected){
- logInfo("TCPTransport.connect: Socket connected");
- }else{
- if(mConfig.getAutoReconnect()){
- remainingRetry--;
- logInfo(String.format("TCPTransport.connect: Socket not connected. AutoReconnect is ON. retryCount is: %d. Waiting for reconnect delay: %d"
- , remainingRetry, RECONNECT_DELAY));
- waitFor(RECONNECT_DELAY);
- } else {
- logInfo("TCPTransport.connect: Socket not connected. AutoReconnect is OFF");
- }
- }
- } while ((!bConnected) && (mConfig.getAutoReconnect()) && (remainingRetry > 0) && (!isHalted));
-
- return bConnected;
- }
- }
-
- /**
- * Performs actual thread work
- */
- @Override
- public void run() {
- logInfo("TCPTransport.run: transport thread created. Starting connect stage");
- psm.reset();
- while(!isHalted) {
- setCurrentState(TCPTransportState.CONNECTING);
- if(!connect()){
- if (isHalted) {
- logInfo("TCPTransport.run: Connection failed, but thread already halted");
- } else {
- disconnect("Failed to connect to Sdl", new SdlException("Failed to connect to Sdl"
- , SdlExceptionCause.SDL_CONNECTION_FAILED), true);
- }
- break;
- }
-
- synchronized (TCPTransport.this) {
- setCurrentState(TCPTransportState.CONNECTED);
- handleTransportConnected();
- }
-
- byte input;
- byte[] buffer = new byte[READ_BUFFER_SIZE];
- int bytesRead;
- boolean stateProgress = false;
- while (!isHalted) {
- //logInfo("TCPTransport.run: Waiting for data...");
- try {
- //input = (byte) mInputStream.read();
- bytesRead = mInputStream.read(buffer);
- } catch (IOException e) {
- internalHandleStreamReadError();
- break;
- }
-
- synchronized (TCPTransport.this) {
- if (mThread.isInterrupted()) {
- logInfo("TCPTransport.run: Got new data but thread is interrupted");
- break;
- }
- }
- for (int i = 0; i < bytesRead; i++) {
- //logInfo("TCPTransport.run: Got new data");
- // Send the response of what we received
- input = buffer[i];
- stateProgress = psm.handleByte(input);
- if (!stateProgress) {//We are trying to weed through the bad packet info until we get something
-
- //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
- psm.reset();
- }
-
- if (psm.getState() == SdlPsm.FINISHED_STATE)
- {
- synchronized (TCPTransport.this) {
- //Log.d(TAG, "Packet formed, sending off");
- handleReceivedPacket((SdlPacket) psm.getFormedPacket());
- }
- //We put a trace statement in the message read so we can avoid all the extra bytes
- psm.reset();
- }
- //FIXME logInfo(String.format("TCPTransport.run: Received %d bytes", bytesRead));
- }
- }
- }
-
- logInfo("TCPTransport.run: Thread terminated");
- setCurrentState(TCPTransportState.IDLE);
- }
-
- /**
- * Internal handling of Tcp disconnection
- */
- private void internalHandleTCPDisconnect() {
- if(isHalted){
- logInfo("TCPTransport.run: TCP disconnect received, but thread already halted");
- } else {
- logInfo("TCPTransport.run: TCP disconnect received");
- disconnect("TCPTransport.run: End of stream reached", null, false);
- }
- }
-
- /**
- * Internal handling of reading data from input stream
- */
- private void internalHandleStreamReadError() {
- if(isHalted){
- logError("TCPTransport.run: Exception during reading data, but thread already halted");
- } else {
- logError("TCPTransport.run: Exception during reading data");
- disconnect("Failed to read data from Sdl", new SdlException("Failed to read data from Sdl"
- , SdlExceptionCause.SDL_CONNECTION_FAILED), false);
- }
- }
- }
-
- /**
- * Returns current TCP transport state
- *
- * @return current state
- */
- private synchronized TCPTransportState getCurrentState() {
- return mCurrentState;
- }
-
- /**
- * Sets current TCP transport state
- * @param currentState New state
- */
- private synchronized void setCurrentState(TCPTransportState currentState) {
- logInfo(String.format("Current state changed to: %s", currentState));
- this.mCurrentState = currentState;
- }
-
- /**
- * Implementation of waiting required delay that cannot be interrupted
- * @param timeMs Time in milliseconds of required delay
- */
- private void waitFor(long timeMs) {
- long endTime = System.currentTimeMillis() +timeMs;
- while (System.currentTimeMillis() < endTime) {
- synchronized (this) {
- try {
- wait(endTime - System.currentTimeMillis());
- } catch (Exception e) {
- // Nothing To Do, simple wait
- }
- }
- }
- }
-
- /**
- * Defines available states of the TCP transport
- */
- private enum TCPTransportState {
- /**
- * TCP transport is created. No connection opened
- */
- IDLE,
-
- /**
- * TCP transport is in progress of establishing connection.
- */
- CONNECTING,
-
- /**
- * TCP transport is connected to SmartDeviceLink core
- */
- CONNECTED,
-
- /**
- * TCP transport is in progress of disconnecting
- */
- DISCONNECTING
- }
-
- @Override
- public String getBroadcastComment() {
- return "";
- }
-} // end-class
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportConfig.java b/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportConfig.java
deleted file mode 100644
index 8ff3f2172..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportConfig.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.smartdevicelink.transport;
-
-import com.smartdevicelink.transport.enums.TransportType;
-
-/**
- * Container of TCP transport specific configuration.
- */
-public final class TCPTransportConfig extends BaseTransportConfig {
-
- /**
- * Value of port to use in TCP connection.
- */
- private final int mPort;
-
- /**
- * Value of IP address to use in TCP connection.
- */
- private final String mIpAddress;
-
- /**
- * Value of flag which is set to true if tcp connection must be automatically reestablished in case of disconnection
- */
- private final boolean mAutoReconnect;
-
- /**
- * Constructor. Objects of this class must be created for known port and IP address value.
- *
- * @param port Port for TCP connection.
- * @param ipAddress IP address for TCP connection.
- * @param autoReconnect Flag which must be set to true if tcp connection must be automatically reestablished in
- * case of disconnection
- */
- public TCPTransportConfig(int port, String ipAddress, boolean autoReconnect) {
- mPort = port;
- mIpAddress = ipAddress;
- mAutoReconnect = autoReconnect;
- }
-
- /**
- * Gets value of Port.
- *
- * @return Port for TCP connection.
- */
- public int getPort() {
- return mPort;
- }
-
- /**
- * Gets value of IP address.
- *
- * @return IP address for TCP connection.
- */
- public String getIPAddress() {
- return mIpAddress;
- }
-
- /**
- * Gets value of AutoReconnect
- * @return Flag that determines automatic reconnection
- */
- public boolean getAutoReconnect() {
- return mAutoReconnect;
- }
-
- /**
- * Overridden abstract method which returns specific type of this transport configuration.
- *
- * @return Constant value TransportType.TCP.
- *
- * @see TransportType
- */
- public TransportType getTransportType() {
- return TransportType.TCP;
- }
-
- @Override
- public String toString() {
- return "TCPTransportConfig{" +
- "Port=" + mPort +
- ", IpAddress='" + mIpAddress + '\'' +
- ", AutoReconnect=" + mAutoReconnect +
- '}';
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java b/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java
deleted file mode 100644
index 21e9fedef..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java
+++ /dev/null
@@ -1,819 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.transport;
-
-import android.annotation.SuppressLint;
-import android.app.ActivityManager;
-import android.app.ActivityManager.RunningServiceInfo;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.Parcelable;
-import android.os.RemoteException;
-import android.os.TransactionTooLargeException;
-import android.util.Log;
-
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.ByteAraryMessageAssembler;
-import com.smartdevicelink.transport.utl.ByteArrayMessageSpliter;
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-import java.lang.ref.WeakReference;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
-
-public class TransportBroker {
-
- private static final String TAG = "SdlTransportBroker";
-
- /**
- * See version document included with library
- */
- private static final int MAX_MESSAGING_VERSION = 2;
- private static final int MIN_MESSAGING_VERSION = 1;
-
- /** Version of the router service that supports the new additional transports (USB and TCP) */
- private static final int RS_MULTI_TRANSPORT_SUPPORT = 8;
-
- private final String WHERE_TO_REPLY_PREFIX = "com.sdl.android.";
- private String appId = null;
- private String whereToReply = null;
- private Context currentContext = null;
-
- private final Object INIT_LOCK = new Object();
-
- private TransportType queuedOnTransportConnect = null;
-
- Messenger routerServiceMessenger = null;
- final Messenger clientMessenger;
-
- boolean isBound = false, registeredWithRouterService = false;
- private String routerPackage = null, routerClassName = null;
- private ComponentName routerService = null;
-
-
- private SdlPacket bufferedPacket = null;
- private ByteAraryMessageAssembler bufferedPayloadAssembler = null;
-
- private ServiceConnection routerConnection;
- private int routerServiceVersion = 1;
- private int messagingVersion = MAX_MESSAGING_VERSION;
-
- private void initRouterConnection() {
- routerConnection = new ServiceConnection() {
-
- public void onServiceConnected(ComponentName className, IBinder service) {
- Log.d(TAG, "Bound to service " + className.toString());
- routerServiceMessenger = new Messenger(service);
- isBound = true;
- //So we just established our connection
- //Register with router service
- sendRegistrationMessage();
- }
-
- public void onServiceDisconnected(ComponentName className) {
- Log.d(TAG, "Unbound from service " + className.getClassName());
- routerServiceMessenger = null;
- registeredWithRouterService = false;
- isBound = false;
- onHardwareDisconnected(null, null);
- }
- };
- }
-
- protected synchronized boolean sendMessageToRouterService(Message message) {
- return sendMessageToRouterService(message, 0);
- }
-
- protected synchronized boolean sendMessageToRouterService(Message message, int retryCount) {
- if (message == null) {
- Log.w(TAG, "Attempted to send null message");
- return false;
- }
- //Log.i(TAG, "Attempting to send message type - " + message.what);
- if (isBound && routerServiceMessenger != null) {
- if (registeredWithRouterService
- || message.what == TransportConstants.ROUTER_REGISTER_CLIENT) { //We can send a message if we are registered or are attempting to register
- try {
- routerServiceMessenger.send(message);
- return true;
- } catch (RemoteException e) {
- e.printStackTrace();
- //Let's check to see if we should retry
- if (e instanceof TransactionTooLargeException
- || (retryCount < 5 && routerServiceMessenger.getBinder().isBinderAlive() && routerServiceMessenger.getBinder().pingBinder())) { //We probably just failed on a small transaction =\
- try {
- Thread.sleep(100);
- } catch (InterruptedException e1) {
- e1.printStackTrace();
- }
- return sendMessageToRouterService(message, retryCount++);
- } else {
- //DeadObject, time to kill our connection
- Log.d(TAG, "Dead object while attempting to send packet");
- routerServiceMessenger = null;
- registeredWithRouterService = false;
- isBound = false;
- onHardwareDisconnected(null, null);
- return false;
- }
- } catch (NullPointerException e) {
- Log.d(TAG, "Null messenger while attempting to send packet"); // NPE, routerServiceMessenger is null
- routerServiceMessenger = null;
- registeredWithRouterService = false;
- isBound = false;
- onHardwareDisconnected(null, null);
- return false;
- }
- } else {
- Log.e(TAG, "Unable to send message to router service. Not registered.");
- return false;
- }
- } else {
- Log.e(TAG, "Unable to send message to router service. Not bound.");
- return false;
- }
- }
-
-
- /**
- * Handler of incoming messages from service.
- */
- static class ClientHandler extends Handler {
- ClassLoader loader;
- final WeakReference<TransportBroker> provider;
-
- public ClientHandler(TransportBroker provider) {
- this.provider = new WeakReference<TransportBroker>(provider);
- loader = getClass().getClassLoader();
- }
-
- @Override
- public void handleMessage(Message msg) {
- TransportBroker broker = provider.get();
- if (broker == null) {
- Log.e(TAG, "Broker object null, unable to process message");
- return;
- }
- Bundle bundle = msg.getData();
-
- if (bundle != null) {
- bundle.setClassLoader(loader);
- }
- //Log.d(TAG, "Bundle: " + bundle.toString());
- /* DO NOT MOVE
- * This needs to be first to make sure we already know if we are attempting to enter legacy mode or not
- */
- if (bundle != null
- && bundle.containsKey(TransportConstants.ENABLE_LEGACY_MODE_EXTRA)) {
- boolean enableLegacy = bundle.getBoolean(TransportConstants.ENABLE_LEGACY_MODE_EXTRA, false);
- broker.enableLegacyMode(enableLegacy);
- }
-
- //Find out what message we have and what to do with it
- switch (msg.what) {
- case TransportConstants.ROUTER_REGISTER_CLIENT_RESPONSE:
- switch (msg.arg1) {
- case TransportConstants.REGISTRATION_RESPONSE_SUCESS:
- // yay! we have been registered. Now what?
- broker.registeredWithRouterService = true;
- if (bundle != null) {
-
- if (bundle.containsKey(TransportConstants.ROUTER_SERVICE_VERSION)) {
- broker.routerServiceVersion = bundle.getInt(TransportConstants.ROUTER_SERVICE_VERSION);
- }
-
- if (bundle.containsKey(TransportConstants.HARDWARE_CONNECTED) || bundle.containsKey(TransportConstants.CURRENT_HARDWARE_CONNECTED)) {
- //A connection is already available
- handleConnectionEvent(bundle, broker);
- }
-
- }
- break;
- case TransportConstants.REGISTRATION_RESPONSE_DENIED_LEGACY_MODE_ENABLED:
- Log.d(TAG, "Denied registration because router is in legacy mode");
- broker.registeredWithRouterService = false;
- broker.enableLegacyMode(true);
- //We call this so we can start the process of legacy connection
- //onHardwareDisconnected(TransportType.BLUETOOTH);
- broker.onLegacyModeEnabled();
- break;
- default:
- broker.registeredWithRouterService = false;
- Log.w(TAG, "Registration denied from router service. Reason - " + msg.arg1);
- break;
- }
- ;
-
-
- break;
- case TransportConstants.ROUTER_UNREGISTER_CLIENT_RESPONSE:
- if (msg.arg1 == TransportConstants.UNREGISTRATION_RESPONSE_SUCESS) {
- // We've been unregistered. Now what?
-
-
- } else { //We were denied our unregister request to the router service, let's see why
- Log.w(TAG, "Unregister request denied from router service. Reason - " + msg.arg1);
- //Do we care?
- }
-
- break;
- case TransportConstants.ROUTER_RECEIVED_PACKET:
- //So the intent has a packet with it. PEFRECT! Let's send it through the library
- int flags = bundle.getInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_NONE);
-
- if (bundle.containsKey(TransportConstants.FORMED_PACKET_EXTRA_NAME)) {
- SdlPacket packet = bundle.getParcelable(TransportConstants.FORMED_PACKET_EXTRA_NAME);
-
- if (flags == TransportConstants.BYTES_TO_SEND_FLAG_NONE) {
- if (packet != null) { //Log.i(TAG, "received packet to process "+ packet.toString());
-
- if(packet.getTransportRecord() == null){
- // If the transport record is null, one must be added
- // This is likely due to an older router service being used
- // in which only a bluetooth transport is available
- packet.setTransportRecord(new TransportRecord(TransportType.BLUETOOTH,""));
- }
-
- broker.onPacketReceived(packet);
- } else {
- Log.w(TAG, "Received null packet from router service, not passing along");
- }
- } else if (flags == TransportConstants.BYTES_TO_SEND_FLAG_SDL_PACKET_INCLUDED) {
- broker.bufferedPacket = (SdlPacket) packet;
- if (broker.bufferedPayloadAssembler != null) {
- broker.bufferedPayloadAssembler.close();
- broker.bufferedPayloadAssembler = null;
- }
-
- broker.bufferedPayloadAssembler = new ByteAraryMessageAssembler();
- broker.bufferedPayloadAssembler.init();
- }
- } else if (bundle.containsKey(TransportConstants.BYTES_TO_SEND_EXTRA_NAME)) {
- //This should contain the payload
- if (broker.bufferedPayloadAssembler != null) {
- byte[] chunk = bundle.getByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME);
- if (!broker.bufferedPayloadAssembler.handleMessage(flags, chunk)) {
- //If there was a problem
- Log.e(TAG, "Error handling bytes for split packet");
- }
- if (broker.bufferedPayloadAssembler.isFinished()) {
- broker.bufferedPacket.setPayload(broker.bufferedPayloadAssembler.getBytes());
-
- broker.bufferedPayloadAssembler.close();
- broker.bufferedPayloadAssembler = null;
- broker.onPacketReceived(broker.bufferedPacket);
- broker.bufferedPacket = null;
- }
- }
- //}
- //}
- } else {
- Log.w(TAG, "Flase positive packet reception");
- }
- break;
- case TransportConstants.HARDWARE_CONNECTION_EVENT:
- if (bundle.containsKey(TransportConstants.TRANSPORT_DISCONNECTED)
- || bundle.containsKey(TransportConstants.HARDWARE_DISCONNECTED)) {
- //We should shut down, so call
- Log.d(TAG, "Hardware disconnected");
- if (isLegacyModeEnabled()) {
- broker.onLegacyModeEnabled();
- } else {
- if (bundle.containsKey(TransportConstants.TRANSPORT_DISCONNECTED)) {
- TransportRecord disconnectedTransport = bundle.getParcelable(TransportConstants.TRANSPORT_DISCONNECTED);
- List<TransportRecord> connectedTransports = bundle.getParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED);
- broker.onHardwareDisconnected(disconnectedTransport, connectedTransports);
- } else {
- TransportType transportType = TransportType.valueOf(bundle.getString(TransportConstants.HARDWARE_DISCONNECTED));
- broker.onHardwareDisconnected(new TransportRecord(transportType, null), null);
- }
-
-
- }
- break;
- }
-
- if (bundle.containsKey(TransportConstants.HARDWARE_CONNECTED) || bundle.containsKey(TransportConstants.CURRENT_HARDWARE_CONNECTED)) {
- //This is a connection event
- handleConnectionEvent(bundle,broker);
- break;
- }
- break;
- default:
- super.handleMessage(msg);
- }
-
- }
-
- /**
- * Handle a potential connection event. This will adapt legacy router service implementaions
- * into the new multiple transport scheme.
- * @param bundle the received bundle from the router service
- * @param broker reference to the transport broker that this handler exists
- * @return if a connection event was triggered in the supplied broker
- */
- private boolean handleConnectionEvent(Bundle bundle, TransportBroker broker){
- if (broker.routerServiceVersion < RS_MULTI_TRANSPORT_SUPPORT) {
- //Previous versions of the router service only supports a single
- //transport, so this will be the only extra received
- if (bundle.containsKey(TransportConstants.HARDWARE_CONNECTED)) {
- String transportName = "";
- if (bundle.containsKey(TransportConstants.CONNECTED_DEVICE_STRING_EXTRA_NAME)) {
- //Keep track if we actually get this
- transportName = bundle.getString(TransportConstants.CONNECTED_DEVICE_STRING_EXTRA_NAME);
- }
- TransportType transportType = TransportType.valueOf(bundle.getString(TransportConstants.HARDWARE_CONNECTED));
- if(transportType == null){
- transportType = TransportType.BLUETOOTH;
- }
- TransportRecord record = new TransportRecord(transportType,transportName);
-
- broker.onHardwareConnected(Collections.singletonList(record));
- return true;
- }
- } else{
- //Router service supports multiple transport
-
- if (bundle.containsKey(TransportConstants.CURRENT_HARDWARE_CONNECTED)) {
- ArrayList<TransportRecord> transports = bundle.getParcelableArrayList(TransportConstants.CURRENT_HARDWARE_CONNECTED);
- broker.onHardwareConnected(transports);
- return true;
- }
- }
- return false;
- }
-
- }
-
-
- /***************************************************************************************************************************************
- *********************************************** Life Cycle **************************************************************
- ****************************************************************************************************************************************/
-
-
- @SuppressLint("SimpleDateFormat")
- public TransportBroker(Context context, String appId, ComponentName service) {
- synchronized (INIT_LOCK) {
- clientMessenger = new Messenger(new ClientHandler(this));
- initRouterConnection();
- //So the user should have set the AppId, lets define where the intents need to be sent
- SimpleDateFormat s = new SimpleDateFormat("hhmmssss"); //So we have a time stamp of the event
- String timeStamp = s.format(new Date(System.currentTimeMillis()));
- if (whereToReply == null) {
- if (appId == null) { //This should really just throw an error
- whereToReply = WHERE_TO_REPLY_PREFIX + "." + timeStamp;
- } else {
- whereToReply = WHERE_TO_REPLY_PREFIX + appId + "." + timeStamp;
- }
- }
- //this.appId = appId.concat(timeStamp);
- this.appId = appId;
- queuedOnTransportConnect = null;
- currentContext = context;
- //Log.d(TAG, "Registering our reply receiver: " + whereToReply);
- this.routerService = service;
- }
- }
-
- /**
- * This beings the initial connection with the router service.
- */
- public boolean start() {
- //Log.d(TAG, "Starting up transport broker for " + whereToReply);
- synchronized (INIT_LOCK) {
- if (currentContext == null) {
- throw new IllegalStateException("This instance can't be started since it's local reference of context is null. Ensure when suppling a context to the TransportBroker that it is valid");
- }
- if (routerConnection == null) {
- initRouterConnection();
- }
- //Log.d(TAG, "Registering our reply receiver: " + whereToReply);
- if (!isBound) {
- return registerWithRouterService();
- } else {
- return false;
- }
- }
- }
-
- public void resetSession() {
- synchronized (INIT_LOCK) {
- unregisterWithRouterService();
- routerServiceMessenger = null;
- queuedOnTransportConnect = null;
- unBindFromRouterService();
- }
- }
-
- /**
- * This method will end our communication with the router service.
- */
- public void stop() {
- //Log.d(TAG, "STOPPING transport broker for " + whereToReply);
- synchronized (INIT_LOCK) {
- unregisterWithRouterService();
- unBindFromRouterService();
- routerServiceMessenger = null;
- queuedOnTransportConnect = null;
- currentContext = null;
-
- }
- }
-
- private void unBindFromRouterService() {
- try {
- if (getContext() != null && routerConnection != null) {
- getContext().unbindService(routerConnection);
- } else {
- Log.w(TAG, "Unable to unbind from router service, context was null");
- }
-
- } catch (IllegalArgumentException e) {
- //This is ok
- }
- }
-
- /***************************************************************************************************************************************
- *********************************************** Event Callbacks **************************************************************
- ****************************************************************************************************************************************/
-
-
- public void onServiceUnregsiteredFromRouterService(int unregisterCode) {
- queuedOnTransportConnect = null;
- }
-
- @Deprecated
- public void onHardwareDisconnected(TransportType type) {
- routerServiceDisconnect();
- }
-
- public void onHardwareDisconnected(TransportRecord record, List<TransportRecord> connectedTransports) {
-
- }
-
- private void routerServiceDisconnect() {
- synchronized (INIT_LOCK) {
- unBindFromRouterService();
- routerServiceMessenger = null;
- routerConnection = null;
- queuedOnTransportConnect = null;
- }
- }
-
- /**
- * WILL NO LONGER BE CALLED
- *
- * @param type
- * @return
- */
- @Deprecated
- public boolean onHardwareConnected(TransportType type) {
- synchronized (INIT_LOCK) {
- if (routerServiceMessenger == null) {
- queuedOnTransportConnect = type;
- return false;
- }
- return true;
- }
- }
-
- public boolean onHardwareConnected(List<TransportRecord> transports) {
- synchronized (INIT_LOCK) {
- if (routerServiceMessenger == null && transports != null && transports.size() > 0) {
- queuedOnTransportConnect = transports.get(transports.size() - 1).getType();
- return false;
- }
- return true;
- }
- }
-
- public void onPacketReceived(Parcelable packet) {
-
- }
-
- public void onLegacyModeEnabled() {
-
- }
-
- /**
- * We want to check to see if the Router service is already up and running
- *
- * @param context
- * @return
- */
- private boolean isRouterServiceRunning(Context context) {
- if (context == null) {
-
- return false;
- }
- ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
- for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
- //We will check to see if it contains this name, should be pretty specific
- if ((service.service.getClassName()).toLowerCase(Locale.US).contains(SdlBroadcastReceiver.SDL_ROUTER_SERVICE_CLASS_NAME)) {
- this.routerClassName = service.service.getClassName();
- this.routerPackage = service.service.getPackageName();
- return true;
- }
- }
- return false;
- }
-
-
- public boolean sendPacketToRouterService(SdlPacket packet) { //We use ints because that is all that is supported by the outputstream class
- //Log.d(TAG,whereToReply + "Sending packet to router service");
-
- if (routerServiceMessenger == null) {
- Log.d(TAG, whereToReply + " tried to send packet, but no where to send");
- return false;
- }
- if (packet == null
- //|| offset<0
- //|| count<0
- ) {//|| count>(bytes.length-offset)){
- Log.w(TAG, whereToReply + "incorrect params supplied");
- return false;
- }
- byte[] bytes = packet.constructPacket();
- if (bytes.length < ByteArrayMessageSpliter.MAX_BINDER_SIZE) {//Determine if this is under the packet length.
- Message message = Message.obtain(); //Do we need to always obtain new? or can we just swap bundles?
- message.what = TransportConstants.ROUTER_SEND_PACKET;
- Bundle bundle = new Bundle();
- if (routerServiceVersion < TransportConstants.RouterServiceVersions.APPID_STRING) {
- bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId));
- }
- bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
- bundle.putByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME, bytes); //Do we just change this to the args and objs
- bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, 0);
- bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, bytes.length);
- bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_NONE);
- bundle.putInt(TransportConstants.PACKET_PRIORITY_COEFFICIENT, packet.getPrioirtyCoefficient());
- if (packet.getTransportRecord() != null) {
- //Log.d(TAG, "Sending packet on transport " + packet.getTransportType().name());
- TransportRecord record = packet.getTransportRecord();
- bundle.putString(TransportConstants.TRANSPORT_TYPE, record.getType().name());
- bundle.putString(TransportConstants.TRANSPORT_ADDRESS, record.getAddress());
- } else {
- //Log.d(TAG, "No transport to be found");
- }
- message.setData(bundle);
-
- sendMessageToRouterService(message);
- return true;
- } else { //Message is too big for IPC transaction
- //Log.w(TAG, "Message too big for single IPC transaction. Breaking apart. Size - " + bytes.length);
- ByteArrayMessageSpliter splitter = new ByteArrayMessageSpliter(appId, TransportConstants.ROUTER_SEND_PACKET, bytes, packet.getPrioirtyCoefficient());
- splitter.setRouterServiceVersion(routerServiceVersion);
- splitter.setTransportRecord(packet.getTransportRecord());
- while (splitter.isActive()) {
- sendMessageToRouterService(splitter.nextMessage());
- }
- return splitter.close();
- }
-
- }
-
- /**
- * This registers this service with the router service
- */
- private boolean registerWithRouterService() {
- if (getContext() == null) {
- Log.e(TAG, "Context set to null, failing out");
- return false;
- }
-
- if (routerServiceMessenger != null) {
- Log.w(TAG, "Already registered with router service");
- return false;
- }
- //Make sure we know where to bind to
- if (this.routerService == null) {
- if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.O) && !isRouterServiceRunning(getContext())) {//We should be able to ignore this case because of the validation now
- Log.d(TAG, whereToReply + " found no router service. Shutting down.");
- this.onHardwareDisconnected(null);
- return false;
- }
- } else {//We were already told where to bind. This should be the case.
- this.routerClassName = this.routerService.getClassName();
- this.routerPackage = this.routerService.getPackageName();
- }
-
- if (!sendBindingIntent()) {
- Log.e(TAG, "Something went wrong while trying to bind with the router service.");
- SdlBroadcastReceiver.queryForConnectedService(currentContext);
- return false;
- }
- return true;
-
- }
-
- @SuppressLint("InlinedApi")
- private boolean sendBindingIntent() {
- if (this.routerPackage != null && this.routerClassName != null) {
- Log.d(TAG, "Sending bind request to " + this.routerPackage + " - " + this.routerClassName);
- Intent bindingIntent = new Intent();
- bindingIntent.setClassName(this.routerPackage, this.routerClassName);//This sets an explicit intent
- //Quickly make sure it's just up and running
- getContext().startService(bindingIntent);
- bindingIntent.setAction(TransportConstants.BIND_REQUEST_TYPE_CLIENT);
- return getContext().bindService(bindingIntent, routerConnection, Context.BIND_AUTO_CREATE);
- } else {
- return false;
- }
- }
-
- private void sendRegistrationMessage() {
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_REGISTER_CLIENT;
- msg.replyTo = this.clientMessenger;
- Bundle bundle = new Bundle();
- bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId)); //We send this no matter what due to us not knowing what router version we are connecting to
- bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
- bundle.putInt(TransportConstants.ROUTER_MESSAGING_VERSION, messagingVersion);
- msg.setData(bundle);
- sendMessageToRouterService(msg);
- }
-
- private void unregisterWithRouterService() {
- Log.i(TAG, "Attempting to unregister with Sdl Router Service");
- if (isBound && routerServiceMessenger != null) {
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_UNREGISTER_CLIENT;
- msg.replyTo = this.clientMessenger; //Including this in case this app isn't actually registered with the router service
- Bundle bundle = new Bundle();
- if (routerServiceVersion < TransportConstants.RouterServiceVersions.APPID_STRING) {
- bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId));
- }
- bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
- msg.setData(bundle);
- sendMessageToRouterService(msg);
- } else {
- Log.w(TAG, "Unable to unregister, not bound to router service");
- }
-
- routerServiceMessenger = null;
- }
-
- protected ComponentName getRouterService() {
- return this.routerService;
- }
-
- /**
- * Since it doesn't always make sense to add another service, use this method to get
- * the appropriate context that the rest of this class is using.
- *
- * @return The currently used context for this class
- */
- private Context getContext() {
- return currentContext;
- }
-
-
- public static Long convertAppId(String appId) {
- if (appId == null) {
- return -1L;
- }
- try {
- return Long.valueOf(appId);
- } catch (NumberFormatException e) {
- return -1L;
- }
- }
-
- /***************************************************************************************************************************************
- *********************************************** LEGACY *******************************************************************************
- ****************************************************************************************************************************************/
- /*
- * Due to old implementations of SDL/Applink, old versions can't support multiple sessions per RFCOMM channel.
- * This causes a race condition in the router service where only the first app registered will be able to communicate with the
- * head unit. With this additional code, the router service will:
- * 1) Acknowledge it's connected to an old system
- * 2) d/c its bluetooth
- * 3) Send a message to all clients connected that legacy mode is enabled
- * 4) Each client spins up their own bluetooth RFCOMM listening channel
- * 5) Head unit will need to query apps again
- * 6) HU should then connect to each app by their own RFCOMM channel bypassing the router service
- * 7) When the phone is D/C from the head unit the router service will reset and tell clients legacy mode is now off
- */
-
- private static boolean legacyModeEnabled = false;
- private static Object LEGACY_LOCK = new Object();
-
- protected void enableLegacyMode(boolean enable) {
- synchronized (LEGACY_LOCK) {
- legacyModeEnabled = enable;
- }
- }
-
- protected static boolean isLegacyModeEnabled() {
- synchronized (LEGACY_LOCK) {
- return legacyModeEnabled;
- }
-
- }
-
- /***************************************************************************************************************************************
- **************************************************** LEGACY END ***********************************************************************
- ****************************************************************************************************************************************/
-
- /**
- * Use this method to let the router service know that you are requesting a new session from the head unit.
- */
- @Deprecated
- public void requestNewSession() {
- requestNewSession(null);
- }
-
- public void requestNewSession(TransportRecord transportRecord) {
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_REQUEST_NEW_SESSION;
- msg.replyTo = this.clientMessenger; //Including this in case this app isn't actually registered with the router service
- Bundle bundle = new Bundle();
- if (routerServiceVersion < TransportConstants.RouterServiceVersions.APPID_STRING) {
- bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId));
- }
- bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
- if (transportRecord != null) {
- bundle.putString(TransportConstants.TRANSPORT_TYPE, transportRecord.getType().name());
- bundle.putString(TransportConstants.TRANSPORT_ADDRESS, transportRecord.getAddress());
- }
- msg.setData(bundle);
- this.sendMessageToRouterService(msg);
- }
-
- /**
- * Request secondary transport and communicate details to router service
- *
- * @param sessionId
- * @param bundle
- */
- public void requestSecondaryTransportConnection(byte sessionId, Bundle bundle) {
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_REQUEST_SECONDARY_TRANSPORT_CONNECTION;
- msg.replyTo = this.clientMessenger;
- if (bundle == null) {
- bundle = new Bundle();
- }
- bundle.putByte(TransportConstants.SESSION_ID_EXTRA, sessionId);
- msg.setData(bundle);
- this.sendMessageToRouterService(msg);
- }
-
-
- public void removeSession(long sessionId) {
- Message msg = Message.obtain();
- msg.what = TransportConstants.ROUTER_REMOVE_SESSION;
- msg.replyTo = this.clientMessenger; //Including this in case this app isn't actually registered with the router service
- Bundle bundle = new Bundle();
- if (routerServiceVersion < TransportConstants.RouterServiceVersions.APPID_STRING) {
- bundle.putLong(TransportConstants.APP_ID_EXTRA, convertAppId(appId));
- }
- bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
- bundle.putLong(TransportConstants.SESSION_ID_EXTRA, sessionId);
- msg.setData(bundle);
- this.sendMessageToRouterService(msg);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/TransportConstants.java b/sdl_android/src/main/java/com/smartdevicelink/transport/TransportConstants.java
deleted file mode 100644
index a66651502..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/TransportConstants.java
+++ /dev/null
@@ -1,263 +0,0 @@
-package com.smartdevicelink.transport;
-
-
-/**
- * These constants are shared between the router service and the SDL base service.
- * They are defined as strings/actions/values that both of them can understand.
- * Attempting to use standard HTTP error codes as definitions.
- * @author Joey Grover
- *
- */
-public class TransportConstants {
- public static final String START_ROUTER_SERVICE_ACTION ="sdl.router.startservice";
- public static final String ROUTER_SERVICE_ACTION = "com.smartdevicelink.router.service";
- public static final String FOREGROUND_EXTRA = "foreground";
-
- public static final String BIND_LOCATION_PACKAGE_NAME_EXTRA = "BIND_LOCATION_PACKAGE_NAME_EXTRA";
- public static final String BIND_LOCATION_CLASS_NAME_EXTRA = "BIND_LOCATION_CLASS_NAME_EXTRA";
-
- public static final String ALT_TRANSPORT_RECEIVER = "com.sdl.android.alttransport";
- public static final String ALT_TRANSPORT_CONNECTION_STATUS_EXTRA = "connection_status";
- public static final int ALT_TRANSPORT_DISCONNECTED = 0;
- public static final int ALT_TRANSPORT_CONNECTED = 1;
- public static final String ALT_TRANSPORT_READ = "read";//Read from the alt transport, goes to the app
- public static final String ALT_TRANSPORT_WRITE = "write";//Write to the alt transport, comes from the app
- public static final String ALT_TRANSPORT_ADDRESS_EXTRA = "altTransportAddress";
-
- public static final String START_ROUTER_SERVICE_SDL_ENABLED_EXTRA = "sdl_enabled";
- public static final String START_ROUTER_SERVICE_SDL_ENABLED_APP_PACKAGE = "package_name";
- public static final String START_ROUTER_SERVICE_SDL_ENABLED_CMP_NAME = "component_name";
- public static final String START_ROUTER_SERVICE_TRANSPORT_CONNECTED = "transport_connected"; //Extra for the transport that just connected
- public static final String START_ROUTER_SERVICE_SDL_ENABLED_PING = "ping";
- @Deprecated
- public static final String FORCE_TRANSPORT_CONNECTED = "force_connect"; //This is legacy, do not refactor this.
- public static final String ROUTER_SERVICE_VALIDATED = "router_service_validated";
-
- @Deprecated
- public static final String REPLY_TO_INTENT_EXTRA = "ReplyAddress";
- public static final String CONNECT_AS_CLIENT_BOOLEAN_EXTRA = "connectAsClient";
- public static final String PACKAGE_NAME_STRING = "package.name";
- public static final String APP_ID_EXTRA = "app.id";//Sent as a Long. This is no longer used
- public static final String APP_ID_EXTRA_STRING = "app.id.string";
- public static final String ROUTER_MESSAGING_VERSION = "router.messaging.version";
-
- public static final String SESSION_ID_EXTRA = "session.id";
-
- public static final String ENABLE_LEGACY_MODE_EXTRA = "ENABLE_LEGACY_MODE_EXTRA";
-
- @Deprecated
- public static final String HARDWARE_DISCONNECTED = "hardware.disconect";
- public static final String TRANSPORT_DISCONNECTED = "transport.disconect";
- public static final String HARDWARE_CONNECTED = "hardware.connected";
- public static final String CURRENT_HARDWARE_CONNECTED = "current.hardware.connected";
-
- public static final String SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME = "senderintent";
- public static final String SEND_PACKET_TO_ROUTER_LOCATION_EXTRA_NAME = "routerintent";
-
-
- public static final String BIND_REQUEST_TYPE_CLIENT = "BIND_REQUEST_TYPE_CLIENT";
- public static final String BIND_REQUEST_TYPE_ALT_TRANSPORT = "BIND_REQUEST_TYPE_ALT_TRANSPORT";
- public static final String BIND_REQUEST_TYPE_STATUS = "BIND_REQUEST_TYPE_STATUS";
- public static final String BIND_REQUEST_TYPE_USB_PROVIDER = "BIND_REQUEST_TYPE_USB_PROVIDER";
-
-
- public static final String PING_ROUTER_SERVICE_EXTRA = "ping.router.service";
-
- public static final String SDL_NOTIFICATION_CHANNEL_ID = "sdl_notification_channel";
- public static final String SDL_NOTIFICATION_CHANNEL_NAME = "SmartDeviceLink";
-
-
-
-
- /**
- * This class houses all important router service versions
- */
- public class RouterServiceVersions{
- /**
- * This version of the router service is when app IDs went from Longs to Strings
- */
- public static final int APPID_STRING = 4;
- }
-
-
- /*
- * Alt transport
- *
- */
-
- /**
- * This will be the response when a hardware connect event comes through from an alt transport.
- * This is because it only makes sense to register an alt transport when a connection is established with that
- * transport, not waiting for one.
- */
- public static final int ROUTER_REGISTER_ALT_TRANSPORT_RESPONSE = 0x02;
- public static final int ROUTER_REGISTER_ALT_TRANSPORT_RESPONSE_SUCESS = 0x00;
- /**
- * There is already another alt transport connected, so we are unable to register this one
- */
- public static final int ROUTER_REGISTER_ALT_TRANSPORT_ALREADY_CONNECTED = 0x01;
-
- /**
- * This means the router service is shutting down for some reason. Most likely
- */
- public static final int ROUTER_SHUTTING_DOWN_NOTIFICATION = 0x0F;
-
- /**
- * There is a newer service to start up, so this one is shutting down
- */
- public static final int ROUTER_SHUTTING_DOWN_REASON_NEWER_SERVICE = 0x00;
-
- /*
- * Router to Client binding service
- *
- */
-
- //WHATS
- /**
- * Command to the service to register a client, receiving callbacks
- * from the service. The Message's replyTo field must be a Messenger of
- * the client where callbacks should be sent.
- */
- public static final int ROUTER_REGISTER_CLIENT = 0x01;
- /**
- * This response message will contain if the registration request was successful or not. If not, the reason will be
- * great or equal to 1 and be descriptive of why it was denied.
- */
- public static final int ROUTER_REGISTER_CLIENT_RESPONSE = 0x02;
- //Response arguments
- public static final int REGISTRATION_RESPONSE_SUCESS = 0x00;
- public static final int REGISTRATION_RESPONSE_DENIED_AUTHENTICATION_FAILED = 0x01;
- public static final int REGISTRATION_RESPONSE_DENIED_NO_CONNECTION = 0x02;
- public static final int REGISTRATION_RESPONSE_DENIED_APP_ID_NOT_INCLUDED = 0x03;
- public static final int REGISTRATION_RESPONSE_DENIED_LEGACY_MODE_ENABLED = 0x04;
- public static final int REGISTRATION_RESPONSE_DENIED_UNKNOWN = 0xFF;
-
- /**
- * Command to the service to unregister a client, to stop receiving callbacks
- * from the service. The Message's replyTo field must be a Messenger of
- * the client as previously given with MSG_REGISTER_CLIENT. Also include the app id as arg1.
- */
- public static final int ROUTER_UNREGISTER_CLIENT = 0x03;
- public static final int ROUTER_UNREGISTER_CLIENT_RESPONSE = 0x04;
- //Response arguments
- public static final int UNREGISTRATION_RESPONSE_SUCESS = 0x00;
- public static final int UNREGISTRATION_RESPONSE_FAILED_APP_ID_NOT_FOUND = 0x01;
-
-
- /**
- * what message type to notify apps of a hardware connection event. The connection event will be placed in the bundle
- * attached to the message
- */
- public static final int HARDWARE_CONNECTION_EVENT = 0x05;
- public static final int HARDWARE_CONNECTION_EVENT_CONNECTED = 0x10;
- public static final int HARDWARE_CONNECTION_EVENT_DISCONNECTED = 0x30;
-
-
- public static final int ROUTER_REQUEST_BT_CLIENT_CONNECT = 0x10;
- public static final int ROUTER_REQUEST_BT_CLIENT_CONNECT_RESPONSE = 0x11;
-
- /**
- * This provides the app with an ability to request another session within the router service.
- * A replyTo must be provided or else there won't be a response
- */
- public static final int ROUTER_REQUEST_NEW_SESSION = 0x12;
- //Request arguments
- //See TRANSPORT_TYPE & TRANSPORT_ADDRESS
-
-
- public static final int ROUTER_REQUEST_NEW_SESSION_RESPONSE = 0x13;
- //Response arguments
- public static final int ROUTER_REQUEST_NEW_SESSION_RESPONSE_SUCESS = 0x00;
- public static final int ROUTER_REQUEST_NEW_SESSION_RESPONSE_FAILED_APP_NOT_FOUND = 0x01;
- public static final int ROUTER_REQUEST_NEW_SESSION_RESPONSE_FAILED_APP_ID_NOT_INCL = 0x02;
-
- /**
- * This provides the app with an ability to request another session within the router service.
- * A replyTo must be provided or else there won't be a response
- */
- public static final int ROUTER_REMOVE_SESSION = 0x14;
- public static final int ROUTER_REMOVE_SESSION_RESPONSE = 0x15;
- //Response arguments
- public static final int ROUTER_REMOVE_SESSION_RESPONSE_SUCESS = 0x00;
- public static final int ROUTER_REMOVE_SESSION_RESPONSE_FAILED_APP_NOT_FOUND = 0x01;
- public static final int ROUTER_REMOVE_SESSION_RESPONSE_FAILED_APP_ID_NOT_INCL = 0x02;
- public static final int ROUTER_REMOVE_SESSION_RESPONSE_FAILED_SESSION_NOT_FOUND = 0x03;
- public static final int ROUTER_REMOVE_SESSION_RESPONSE_FAILED_SESSION_ID_NOT_INCL = 0x04;
- /**
- * Command to have router service to send a packet
- */
- public static final int ROUTER_SEND_PACKET = 0x20;
-
- //response
- /**
- * Router has received a packet and sent it to the client
- */
- public static final int ROUTER_RECEIVED_PACKET = 0x26;
- //response
-
- /**
- * Command to tell router service details of secondary transport
- */
- public static final int ROUTER_REQUEST_SECONDARY_TRANSPORT_CONNECTION = 0x30;
-
- //BUNDLE EXTRAS
-
- public static final String FORMED_PACKET_EXTRA_NAME = "packet";
-
- public static final String BYTES_TO_SEND_EXTRA_NAME = "bytes";
- public static final String BYTES_TO_SEND_EXTRA_OFFSET = "offset";
- public static final String BYTES_TO_SEND_EXTRA_COUNT = "count";
- public static final String BYTES_TO_SEND_FLAGS = "flags";
-
- public static final String PACKET_PRIORITY_COEFFICIENT = "priority_coefficient";
-
- public static final String TRANSPORT_TYPE = "transport_type";
- public static final String TRANSPORT_ADDRESS = "transport_address";
-
- public static final int BYTES_TO_SEND_FLAG_NONE = 0x00;
- public static final int BYTES_TO_SEND_FLAG_SDL_PACKET_INCLUDED = 0x01;
- public static final int BYTES_TO_SEND_FLAG_LARGE_PACKET_START = 0x02;
- public static final int BYTES_TO_SEND_FLAG_LARGE_PACKET_CONT = 0x04;
- public static final int BYTES_TO_SEND_FLAG_LARGE_PACKET_END = 0x08;
-
- public static final String CONNECTED_DEVICE_STRING_EXTRA_NAME = "devicestring";
-
- public static final int PACKET_SENDING_ERROR_NOT_REGISTERED_APP = 0x00;
- public static final int PACKET_SENDING_ERROR_NOT_CONNECTED = 0x01;
- public static final int PACKET_SENDING_ERROR_UKNOWN = 0xFF;
-
- public static final String ROUTER_SERVICE_VERSION = "router_service_version";
-
- /**
- * Status binder
- */
-
- public static final int ROUTER_STATUS_CONNECTED_STATE_REQUEST = 0x01;
- public static final int ROUTER_STATUS_CONNECTED_STATE_RESPONSE = 0x02;
- /**
- * This flag when used to check router status will trigger the router service in sending out a ping that if it is connected to a device
- */
- public static final int ROUTER_STATUS_FLAG_TRIGGER_PING = 0x02;
-
-
- /**
- * Usb Transfer binder
- */
-
- public static final int USB_CONNECTED_WITH_DEVICE = 0x55;
- public static final int ROUTER_USB_ACC_RECEIVED = 0x56;
-
-
- /**
- * Multiple-transports related constants
- *
- */
- public static final String IAP_BLUETOOTH = "IAP_BLUETOOTH";
- public static final String IAP_USB = "IAP_USB";
- public static final String IAP_USB_HOST_MODE = "TCP_WIFI";
- public static final String IAP_CARPLAY = "IAP_CARPLAY";
- public static final String SPP_BLUETOOTH = "SPP_BLUETOOTH";
- public static final String AOA_USB = "AOA_USB";
- public static final String TCP_WIFI = "TCP_WIFI";
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java b/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java
deleted file mode 100644
index 38df218b2..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.transport;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.os.Parcelable;
-import android.util.Log;
-
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.transport.utl.TransportRecord;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.List;
-
-@SuppressWarnings("unused")
-public class TransportManager {
- private static final String TAG = "TransportManager";
-
- private final Object TRANSPORT_STATUS_LOCK;
-
- TransportBrokerImpl transport;
- final List<TransportRecord> transportStatus;
- final TransportEventListener transportListener;
-
- //Legacy Transport
- MultiplexBluetoothTransport legacyBluetoothTransport;
- LegacyBluetoothHandler legacyBluetoothHandler;
-
-
- /**
- * Managing transports
- * List for status of all transports
- * If transport is not connected. Request Router service connect to it. Get connected message
- */
-
- public TransportManager(MultiplexTransportConfig config, TransportEventListener listener){
-
- this.transportListener = listener;
- this.TRANSPORT_STATUS_LOCK = new Object();
- synchronized (TRANSPORT_STATUS_LOCK){
- this.transportStatus = new ArrayList<>();
- }
-
- if(config.service == null) {
- config.service = SdlBroadcastReceiver.consumeQueuedRouterService();
- }
-
- RouterServiceValidator validator = new RouterServiceValidator(config);
- if(validator.validate()){
- transport = new TransportBrokerImpl(config.context, config.appId,config.service);
- }else{
- enterLegacyMode("Router service is not trusted. Entering legacy mode");
- }
- }
-
- public void start(){
- if(transport != null){
- transport.start();
- }else if(legacyBluetoothTransport != null){
- legacyBluetoothTransport.start();
- }
- }
-
- public void close(long sessionId){
- if(transport != null) {
- transport.removeSession(sessionId);
- transport.stop();
- }else if(legacyBluetoothTransport != null){
- legacyBluetoothTransport.stop();
- legacyBluetoothTransport = null;
- }
- }
-
- /**
- * Check to see if a transport is connected.
- * @param transportType the transport to have its connection status returned. If `null` is
- * passed in, all transports will be checked and if any are connected a
- * true value will be returned.
- * @param address the address associated with the transport type. If null, the first transport
- * of supplied type will be used to return if connected.
- * @return if a transport is connected based on included variables
- */
- public boolean isConnected(TransportType transportType, String address){
- synchronized (TRANSPORT_STATUS_LOCK) {
- if (transportType == null) {
- return !transportStatus.isEmpty();
- }
- for (TransportRecord record : transportStatus) {
- if (record.getType().equals(transportType)) {
- if (address != null) {
- if (address.equals(record.getAddress())) {
- return true;
- } // Address doesn't match, move forward
- } else {
- //If no address is included, assume any transport of correct type is acceptable
- return true;
- }
- }
- }
- return false;
- }
- }
- /**
- * Retrieve a transport record with the supplied params
- * @param transportType the transport to have its connection status returned.
- * @param address the address associated with the transport type. If null, the first transport
- * of supplied type will be returned.
- * @return the transport record for the transport type and address if supplied
- */
- public TransportRecord getTransportRecord(TransportType transportType, String address){
- synchronized (TRANSPORT_STATUS_LOCK) {
- if (transportType == null) {
- return null;
- }
- for (TransportRecord record : transportStatus) {
- if (record.getType().equals(transportType)) {
- if (address != null) {
- if (address.equals(record.getAddress())) {
- return record;
- } // Address doesn't match, move forward
- } else {
- //If no address is included, assume any transport of correct type is acceptable
- return record;
- }
- }
- }
- return null;
- }
- }
-
- /**
- * Retrieves the currently connected transports
- * @return the currently connected transports
- */
- public List<TransportRecord> getConnectedTransports(){
- return this.transportStatus;
- }
-
- public boolean isHighBandwidthAvailable(){
- synchronized (TRANSPORT_STATUS_LOCK) {
- for (TransportRecord record : transportStatus) {
- if (record.getType().equals(TransportType.USB)
- || record.getType().equals(TransportType.TCP)) {
- return true;
- }
- }
- return false;
- }
- }
-
- public ComponentName getRouterService(){
- if(transport != null) {
- return transport.getRouterService();
- }
- return null;
- }
-
- public void sendPacket(SdlPacket packet){
- if(transport !=null){
- transport.sendPacketToRouterService(packet);
- }else if(legacyBluetoothTransport != null){
- byte[] data = packet.constructPacket();
- legacyBluetoothTransport.write(data, 0, data.length);
- }
- }
-
- public void requestNewSession(TransportRecord transportRecord){
- if(transport != null){
- transport.requestNewSession(transportRecord);
- }else if(legacyBluetoothTransport != null){
- Log.w(TAG, "Session requested for non-bluetooth transport while in legacy mode");
- }
- }
-
- public void requestSecondaryTransportConnection(byte sessionId, Bundle params){
- transport.requestSecondaryTransportConnection(sessionId, params);
- }
-
- protected class TransportBrokerImpl extends TransportBroker{
-
- public TransportBrokerImpl(Context context, String appId, ComponentName routerService){
- super(context,appId,routerService);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- @Deprecated
- public boolean onHardwareConnected(TransportType transportType){
- return false;
- }
-
- @Override
- public boolean onHardwareConnected(List<TransportRecord> transports) {
- super.onHardwareConnected(transports);
- synchronized (TRANSPORT_STATUS_LOCK){
- transportStatus.clear();
- transportStatus.addAll(transports);
- }
- transportListener.onTransportConnected(transports);
- return true;
- }
-
-
- @Override
- public void onHardwareDisconnected(TransportRecord record, List<TransportRecord> connectedTransports) {
- if(record != null){
- Log.d(TAG, "Transport disconnected - " + record);
- }else{
- Log.d(TAG, "Transport disconnected");
-
- }
-
- synchronized (TRANSPORT_STATUS_LOCK){
- TransportManager.this.transportStatus.remove(record);
- //Might check connectedTransports vs transportStatus to ensure they are equal
- }
-
- if(isLegacyModeEnabled()
- && record != null
- && TransportType.BLUETOOTH.equals(record.getType()) //Make sure it's bluetooth that has be d/c
- && legacyBluetoothTransport == null){ //Make sure we aren't already in legacy mode
- //Legacy mode has been enabled so we need to cycle
- enterLegacyMode("Router service has enabled legacy mode");
- }else{
- //Inform the transport listener that a transport has disconnected
- transportListener.onTransportDisconnected("", record, connectedTransports);
- }
- }
-
- @Override
- public void onPacketReceived(Parcelable packet) {
- if(packet!=null){
- transportListener.onPacketReceived((SdlPacket)packet);
- }
- }
- }
-
- private synchronized void enterLegacyMode(final String info){
- if(legacyBluetoothTransport != null && legacyBluetoothHandler != null){
- return; //Already in legacy mode
- }
-
- if(transportListener.onLegacyModeEnabled(info)) {
- if(Looper.myLooper() == null){
- Looper.prepare();
- }
- legacyBluetoothHandler = new LegacyBluetoothHandler(this);
- legacyBluetoothTransport = new MultiplexBluetoothTransport(legacyBluetoothHandler);
- }else{
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- transportListener.onError(info + " - Legacy mode unacceptable; shutting down.");
-
- }
- },500);
- }
- }
-
- protected synchronized void exitLegacyMode(String info ){
- if(legacyBluetoothTransport != null){
- legacyBluetoothTransport.stop();
- legacyBluetoothTransport = null;
- }
- legacyBluetoothHandler = null;
- synchronized (TRANSPORT_STATUS_LOCK){
- TransportManager.this.transportStatus.clear();
- }
- transportListener.onTransportDisconnected(info, new TransportRecord(TransportType.BLUETOOTH,null),null);
- }
-
- public interface TransportEventListener{
- /** Called to indicate and deliver a packet received from transport */
- void onPacketReceived(SdlPacket packet);
-
- /** Called to indicate that transport connection was established */
- void onTransportConnected(List<TransportRecord> transports);
-
- /** Called to indicate that transport was disconnected (by either side) */
- void onTransportDisconnected(String info, TransportRecord type, List<TransportRecord> connectedTransports);
-
- // Called when the transport manager experiences an unrecoverable failure
- void onError(String info);
- /**
- * Called when the transport manager has determined it needs to move towards a legacy style
- * transport connection. It will always be bluetooth.
- * @param info simple info string about the situation
- * @return if the listener is ok with entering legacy mode
- */
- boolean onLegacyModeEnabled(String info);
- }
-
-
-
- protected static class LegacyBluetoothHandler extends Handler{
-
- final WeakReference<TransportManager> provider;
-
- public LegacyBluetoothHandler(TransportManager provider){
- this.provider = new WeakReference<>(provider);
- }
- @Override
- public void handleMessage(Message msg) {
- if(this.provider.get() == null){
- return;
- }
- TransportManager service = this.provider.get();
- if(service.transportListener == null){
- return;
- }
- switch (msg.what) {
- case SdlRouterService.MESSAGE_STATE_CHANGE:
- switch (msg.arg1) {
- case MultiplexBaseTransport.STATE_CONNECTED:
- synchronized (service.TRANSPORT_STATUS_LOCK){
- service.transportStatus.clear();
- service.transportStatus.add(service.legacyBluetoothTransport.getTransportRecord());
- }
- service.transportListener.onTransportConnected(service.transportStatus);
- break;
- case MultiplexBaseTransport.STATE_CONNECTING:
- // Currently attempting to connect - update UI?
- break;
- case MultiplexBaseTransport.STATE_LISTEN:
- break;
- case MultiplexBaseTransport.STATE_NONE:
- // We've just lost the connection
- service.exitLegacyMode("Lost connection");
- break;
- case MultiplexBaseTransport.STATE_ERROR:
- Log.d(TAG, "Bluetooth serial server error received, setting state to none, and clearing local copy");
- service.exitLegacyMode("Transport error");
- break;
- }
- break;
-
- case SdlRouterService.MESSAGE_READ:
- service.transportListener.onPacketReceived((SdlPacket) msg.obj);
- break;
- }
- }
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java b/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java
deleted file mode 100644
index 4b878c2aa..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.transport;
-
-import android.app.Activity;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.hardware.usb.UsbAccessory;
-import android.hardware.usb.UsbManager;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Parcelable;
-import android.support.annotation.RequiresApi;
-import android.util.Log;
-
-import com.smartdevicelink.util.AndroidTools;
-import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.SdlAppInfo;
-import com.smartdevicelink.util.ServiceFinder;
-
-import java.util.List;
-import java.util.Vector;
-
-import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
-
-/**
- * The USBAccessoryAttachmentActivity is a proxy to listen for
- * USB_ACCESSORY_ATTACHED intents.
- * <br><br>
- * Unfortunately, the USB_ACCESSORY_ATTACHED intent can only be sent to an
- * activity. So this class is a workaround to get that intent.
- * <br><br>
- * Some reference: http://stackoverflow.com/questions/6981736/android-3-1-usb-host-broadcastreceiver-does-not-receive-usb-device-attached/9814826#9814826
- * <br><br>
- * Inspired by OpenXC-Android: https://github.com/openxc/openxc-android
- * <br><br>
- * <strong>NOTE:</strong> An application that wants to use USB transport
- * must make the following changes to AndroidManifest.xml:
- * <br><br>
- * <b>1.</b> Add these lines to the {@literal <manifest>…</manifest>} scope:<br>
- * <pre>{@code
- * <!-- Required to use the USB Accessory mode -->
- * <uses-feature android:name="android.hardware.usb.accessory"/>
- * }</pre>
- * <b>2.</b> Add these lines to the {@literal <application>…</application>} scope:
- * <pre>{@code <activity android:name="com.smartdevicelink.transport.USBAccessoryAttachmentActivity">
- * <intent-filter>
- * <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"/>
- * </intent-filter>
- * <meta-data
- * android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
- * android:resource="@xml/accessory_filter"/>
- * </activity>
- * }</pre>
- * <b>3.</b> Set minimum SDK version to 12:
- * <pre>{@code <uses-sdk android:minSdkVersion="12"/>}</pre>
- */
-@RequiresApi(12)
-public class USBAccessoryAttachmentActivity extends Activity {
-
- private static final String TAG = USBAccessoryAttachmentActivity.class.getSimpleName();
- private static final int USB_SUPPORTED_ROUTER_SERVICE_VERSION = 8;
-
- UsbAccessory usbAccessory;
- Parcelable permissionGranted;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- checkUsbAccessoryIntent("Create");
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- checkUsbAccessoryIntent("Resume");
- }
-
- private void checkUsbAccessoryIntent(String sourceAction) {
- final Intent intent = getIntent();
- String action = intent.getAction();
- Log.d(TAG, sourceAction + " with action: " + action);
-
- if (UsbManager.ACTION_USB_ACCESSORY_ATTACHED.equals(action)) {
- usbAccessory = intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
- permissionGranted = intent.getParcelableExtra(UsbManager.EXTRA_PERMISSION_GRANTED);
-
- wakeUpRouterService(getApplicationContext());
-
- }
-
- }
-
- @SuppressWarnings("deprecation")
- private void wakeUpRouterService(final Context context){
- new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() {
- @Override
- public void onComplete(Vector<ComponentName> routerServices) {
- Vector<ComponentName> runningBluetoothServicePackage = new Vector<>(routerServices);
- if (runningBluetoothServicePackage.isEmpty()) {
- //If there isn't a service running we should try to start one
- //We will try to sort the SDL enabled apps and find the one that's been installed the longest
- Intent serviceIntent;
- List<SdlAppInfo> sdlAppInfoList = AndroidTools.querySdlAppInfo(context, new SdlAppInfo.BestRouterComparator());
-
- if (sdlAppInfoList != null && !sdlAppInfoList.isEmpty()) {
- SdlAppInfo optimalRouterService = sdlAppInfoList.get(0);
-
- if(optimalRouterService.getRouterServiceVersion() < USB_SUPPORTED_ROUTER_SERVICE_VERSION){
- // The most optimal router service doesn't support the USB connection
- // At this point to ensure that USB connection is still possible it might be
- // worth trying to use the legacy USB transport scheme
- attemptLegacyUsbConnection();
- return;
- }
-
- serviceIntent = new Intent();
- serviceIntent.setComponent(optimalRouterService.getRouterServiceComponentName());
- } else{
- Log.d(TAG, "No SDL Router Services found");
- Log.d(TAG, "WARNING: This application has not specified its SdlRouterService correctly in the manifest. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
- // At this point to ensure that USB connection is still possible it might be
- // worth trying to use the legacy USB transport scheme
- attemptLegacyUsbConnection();
- return;
- }
- serviceIntent.setAction(TransportConstants.BIND_REQUEST_TYPE_ALT_TRANSPORT);
-
- ComponentName startedService;
- try {
- if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
- startedService = context.startService(serviceIntent);
- }else {
- serviceIntent.putExtra(FOREGROUND_EXTRA, true);
- startedService = context.startForegroundService(serviceIntent);
- }
-
- if(startedService == null){
- // A router service was not started or is not running.
- DebugTool.logError(TAG + " - Error starting router service. Attempting legacy connection ");
- attemptLegacyUsbConnection();
- return;
- }
-
- //Make sure to send this out for old apps to close down
- SdlRouterService.LocalRouterService self = SdlRouterService.getLocalRouterService(serviceIntent, serviceIntent.getComponent());
- Intent restart = new Intent(SdlRouterService.REGISTER_NEWER_SERVER_INSTANCE_ACTION);
- restart.putExtra(SdlBroadcastReceiver.LOCAL_ROUTER_SERVICE_EXTRA, self);
- restart.putExtra(SdlBroadcastReceiver.LOCAL_ROUTER_SERVICE_DID_START_OWN, true);
- context.sendBroadcast(restart);
-
- if (usbAccessory!=null) {
- new UsbTransferProvider(context, serviceIntent.getComponent(), usbAccessory, new UsbTransferProvider.UsbTransferCallback() {
- @Override
- public void onUsbTransferUpdate(boolean success) {
- finish();
- }
- });
-
- }
-
- } catch (SecurityException e) {
- Log.e(TAG, "Security exception, process is bad");
- }
- } else {
- if (usbAccessory!=null) {
- new UsbTransferProvider(context,runningBluetoothServicePackage.get(0),usbAccessory, new UsbTransferProvider.UsbTransferCallback(){
- @Override
- public void onUsbTransferUpdate(boolean success) {
- finish();
- }
- });
-
- }
- }
- }
- });
- }
-
- private void attemptLegacyUsbConnection(){
- DebugTool.logInfo("Attempting to send USB connection intent using legacy method");
- Intent usbAccessoryAttachedIntent = new Intent(USBTransport.ACTION_USB_ACCESSORY_ATTACHED);
- usbAccessoryAttachedIntent.putExtra(UsbManager.EXTRA_ACCESSORY, usbAccessory);
- usbAccessoryAttachedIntent.putExtra(UsbManager.EXTRA_PERMISSION_GRANTED, permissionGranted);
- AndroidTools.sendExplicitBroadcast(getApplicationContext(),usbAccessoryAttachedIntent,null);
- finish();
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java b/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java
deleted file mode 100644
index 9b1bf1efd..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java
+++ /dev/null
@@ -1,873 +0,0 @@
-package com.smartdevicelink.transport;
-
-import java.io.FileDescriptor;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import android.annotation.SuppressLint;
-import android.app.PendingIntent;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.hardware.usb.UsbAccessory;
-import android.hardware.usb.UsbManager;
-import android.os.ParcelFileDescriptor;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.trace.SdlTrace;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-import com.smartdevicelink.transport.enums.TransportType;
-import com.smartdevicelink.util.DebugTool;
-
-/**
- * Class that implements USB transport.
- *
- * A note about USB Accessory protocol. If the device is already in the USB
- * accessory mode, any side (computer or Android) can open connection even if
- * the other side is not connected. Conversely, if one side simply disconnects,
- * the other side will NOT be notified and unblocked from reading data until
- * some data is sent again or the USB is physically disconnected.
- */
-@SuppressLint("NewApi")
-@Deprecated
-public class USBTransport extends SdlTransport {
-
- // Boolean to monitor if the transport is in a disconnecting state
- private boolean _disconnecting = false;
- /**
- * Broadcast action: sent when a USB accessory is attached.
- *
- * UsbManager.EXTRA_ACCESSORY extra contains UsbAccessory object that has
- * been attached.
- */
- public static final String ACTION_USB_ACCESSORY_ATTACHED =
- "com.smartdevicelink.USB_ACCESSORY_ATTACHED";
- /**
- * String tag for logging.
- */
- private static final String TAG = USBTransport.class.getSimpleName();
- /**
- * Key for SdlTrace.
- */
- private static final String SDL_LIB_TRACE_KEY =
- "42baba60-eb57-11df-98cf-0800200c9a66";
- /**
- * Broadcast action: sent when the user has granted access to the USB
- * accessory.
- */
- private static final String ACTION_USB_PERMISSION =
- "com.smartdevicelink.USB_PERMISSION";
- /**
- * Manufacturer name of the accessory we want to connect to. Must be the
- * same as in accessory_filter.xml to work properly.
- */
- private final static String ACCESSORY_MANUFACTURER = "SDL";
- /**
- * Model name of the accessory we want to connect to. Must be the same as
- * in accessory_filter.xml to work properly.
- */
- private final static String ACCESSORY_MODEL = "Core";
- /**
- * Version of the accessory we want to connect to. Must be the same as in
- * accessory_filter.xml to work properly.
- */
- private final static String ACCESSORY_VERSION = "1.0";
- /**
- * Prefix string to indicate debug output.
- */
- private static final String DEBUG_PREFIX = "DEBUG: ";
- /**
- * String to prefix exception output.
- */
- private static final String EXCEPTION_STRING = " Exception String: ";
- /**
- * Broadcast receiver that receives different USB-related intents: USB
- * accessory connected, disconnected, and permission granted.
- */
- private final BroadcastReceiver mUSBReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- logD("USBReceiver Action: " + action);
-
- UsbAccessory accessory =
- intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
- if (accessory != null) {
- if (ACTION_USB_ACCESSORY_ATTACHED.equals(action)) {
- logI("Accessory " + accessory + " attached");
- if (isAccessorySupported(accessory)) {
- connectToAccessory(accessory);
- } else {
- logW("Attached accessory is not supported!");
- }
- } else if (UsbManager.ACTION_USB_ACCESSORY_DETACHED
- .equals(action)) {
- logI("Accessory " + accessory + " detached");
- final String msg = "USB accessory has been detached";
- disconnect(msg, new SdlException(msg,
- SdlExceptionCause.SDL_USB_DETACHED));
- } else if (ACTION_USB_PERMISSION.equals(action)) {
- boolean permissionGranted = intent.getBooleanExtra(
- UsbManager.EXTRA_PERMISSION_GRANTED, false);
- if (permissionGranted) {
- logI("Permission granted for accessory " + accessory);
- openAccessory(accessory);
- } else {
- final String msg =
- "Permission denied for accessory " + accessory;
- logW(msg);
- disconnect(msg, new SdlException(msg,
- SdlExceptionCause.SDL_USB_PERMISSION_DENIED));
- }
- }
- } else {
- logW("Accessory is null");
- }
- }
- };
- /**
- * USB config object.
- */
- private USBTransportConfig mConfig = null;
- /**
- * Current state of transport.
- *
- * Use setter and getter to access it.
- */
- private State mState = State.IDLE;
- /**
- * Current accessory the transport is working with if any.
- */
- private UsbAccessory mAccessory = null;
- /**
- * FileDescriptor that owns the input and output streams. We have to keep
- * it, otherwise it will be garbage collected and the streams will become
- * invalid.
- */
- private ParcelFileDescriptor mParcelFD = null;
- /**
- * Data input stream to read data from USB accessory.
- */
- private InputStream mInputStream = null;
- /**
- * Data output stream to write data to USB accessory.
- */
- private OutputStream mOutputStream = null;
- /**
- * Thread that connects and reads data from USB accessory.
- *
- * @see USBTransportReader
- */
- private Thread mReaderThread = null;
-
- /**
- * Constructs the USBTransport instance.
- *
- * @param usbTransportConfig Config object for the USB transport
- * @param transportListener Listener that gets notified on different
- * transport events
- */
- public USBTransport(USBTransportConfig usbTransportConfig,
- ITransportListener transportListener) {
- super(transportListener);
- this.mConfig = usbTransportConfig;
- registerReciever();
- }
-
- /**
- * Returns the current state of transport.
- *
- * @return Current state of transport
- */
- public State getState() {
- return this.mState;
- }
-
- /**
- * Changes current state of transport.
- *
- * @param state New state
- */
- private void setState(State state) {
- logD("Changing state " + this.mState + " to " + state);
- this.mState = state;
- }
-
- /**
- * Sends the array of bytes over USB.
- *
- * @param packet The packet that is to be written out on the USB transport
- * @return true if the bytes are sent successfully
- */
- @Override
- protected boolean sendBytesOverTransport(SdlPacket packet) {
- byte[] msgBytes = packet.constructPacket();
- logD("SendBytes: array size " + msgBytes.length + ", offset " + 0 +
- ", length " + msgBytes.length);
-
- boolean result = false;
- final State state = getState();
- switch (state) {
- case CONNECTED:
- if (mOutputStream != null) {
- try {
- mOutputStream.write(msgBytes, 0, msgBytes.length);
- result = true;
-
- logI("Bytes successfully sent");
- SdlTrace.logTransportEvent(TAG + ": bytes sent",
- null, InterfaceActivityDirection.Transmit,
- msgBytes, 0, msgBytes.length,
- SDL_LIB_TRACE_KEY);
- } catch (IOException e) {
- final String msg = "Failed to send bytes over USB";
- logW(msg, e);
- disconnect(msg, e);
- }
- } else {
- final String msg =
- "Can't send bytes when output stream is null";
- logW(msg);
- disconnect(msg, null);
- }
- break;
-
- default:
- logW("Can't send bytes from " + state + " state");
- break;
- }
-
- return result;
- }
-
-
- public void registerReciever()
- {
- IntentFilter filter = new IntentFilter();
- filter.addAction(ACTION_USB_ACCESSORY_ATTACHED);
- filter.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED);
- filter.addAction(ACTION_USB_PERMISSION);
- filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
- getContext().registerReceiver(mUSBReceiver, filter);
- }
-
- /**
- * Opens a USB connection if not open yet.
- *
- * @throws SdlException
- */
- @Override
- public void openConnection() throws SdlException {
- final State state = getState();
- switch (state) {
- case IDLE:
- synchronized (this) {
- logI("openConnection()");
- setState(State.LISTENING);
- }
-
- logD("Registering receiver");
- try {
- IntentFilter filter = new IntentFilter();
- filter.addAction(ACTION_USB_ACCESSORY_ATTACHED);
- filter.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED);
- filter.addAction(ACTION_USB_PERMISSION);
- getContext().registerReceiver(mUSBReceiver, filter);
- initializeAccessory();
- } catch (Exception e) {
- String msg = "Couldn't start opening connection";
- logE(msg, e);
- throw new SdlException(msg, e,
- SdlExceptionCause.SDL_CONNECTION_FAILED);
- }
-
- break;
-
- default:
- logW("openConnection() called from state " + state +
- "; doing nothing");
- break;
- }
- }
-
- /**
- * Closes the USB connection if open.
- */
- @Override
- public void disconnect() {
- disconnect(null, null);
- }
-
- /**
- * Asks the reader thread to stop while it's possible. If it's blocked on
- * read(), there is no way to stop it except for physical USB disconnect.
- */
- //@Override
- public void stopReading() {
- DebugTool.logInfo("USBTransport: stop reading requested, doing nothing");
- // TODO - put back stopUSBReading(); @see <a href="https://adc.luxoft.com/jira/browse/SmartDeviceLink-3450">SmartDeviceLink-3450</a>
- }
-
- @SuppressWarnings("unused")
- private void stopUSBReading() {
- final State state = getState();
- switch (state) {
- case CONNECTED:
- logI("Stopping reading");
- synchronized (this) {
- stopReaderThread();
- }
- break;
-
- default:
- logW("Stopping reading called from state " + state +
- "; doing nothing");
- break;
- }
- }
-
- /**
- * Actually asks the reader thread to interrupt.
- */
- private void stopReaderThread() {
- if (mReaderThread != null) {
- logI("Interrupting USB reader");
- mReaderThread.interrupt();
- // don't join() now
- mReaderThread = null;
- } else {
- logD("USB reader is null");
- }
- }
-
- /**
- * Closes the USB connection from inside the transport with some extra info.
- *
- * @param msg Disconnect reason message, if any
- * @param ex Disconnect exception, if any
- */
- private void disconnect(String msg, Exception ex) {
-
- // If already disconnecting, return
- if (_disconnecting) {
- // No need to recursively call
- return;
- }
- _disconnecting = true;
-
- mConfig.setUsbAccessory(null);
-
- final State state = getState();
- switch (state) {
- case LISTENING:
- case CONNECTED:
- synchronized (this) {
- logI("Disconnect from state " + getState() + "; message: " +
- msg + "; exception: " + ex);
- setState(State.IDLE);
-
- SdlTrace.logTransportEvent(TAG + ": disconnect", null,
- InterfaceActivityDirection.None, null, 0,
- SDL_LIB_TRACE_KEY);
-
- stopReaderThread();
-
- if (mAccessory != null) {
- if (mOutputStream != null) {
- try {
- mOutputStream.close();
- mOutputStream = null;
- } catch (IOException e) {
- logW("Can't close output stream", e);
- mOutputStream = null;
- }
- }
- if (mInputStream != null) {
- try {
- mInputStream.close();
- mInputStream = null;
- } catch (IOException e) {
- logW("Can't close input stream", e);
- mInputStream = null;
- }
- }
- if (mParcelFD != null) {
- try {
- mParcelFD.close();
- mParcelFD = null;
- } catch (IOException e) {
- logW("Can't close file descriptor", e);
- mParcelFD = null;
- }
- }
-
- mAccessory = null;
- }
- }
-
- logD("Unregistering receiver");
- try {
- getContext().unregisterReceiver(mUSBReceiver);
- } catch (IllegalArgumentException e) {
- logW("Receiver was already unregistered", e);
- }
-
- String disconnectMsg = (msg == null ? "" : msg);
- if (ex != null) {
- disconnectMsg += ", " + ex.toString();
-
- if(ex instanceof SdlException
- && SdlExceptionCause.SDL_USB_PERMISSION_DENIED.equals(((SdlException)ex).getSdlExceptionCause())){
- //If the USB device disconnected we don't want to cycle the proxy ourselves
- ex = null;
- }
- }
-
- if (ex == null) {
- // This disconnect was not caused by an error, notify the
- // proxy that the transport has been disconnected.
- logI("Disconnect is correct. Handling it");
- handleTransportDisconnected(disconnectMsg);
- } else {
- // This disconnect was caused by an error, notify the proxy
- // that there was a transport error.
- logI("Disconnect is incorrect. Handling it as error");
- handleTransportError(disconnectMsg, ex);
- }
- break;
-
- default:
- logW("Disconnect called from state " + state +
- "; doing nothing");
- break;
- }
- _disconnecting = false;
- }
-
- /**
- * Returns the type of the transport.
- *
- * @return TransportType.USB
- * @see com.smartdevicelink.transport.enums.TransportType
- */
- @Override
- public TransportType getTransportType() {
- return TransportType.USB;
- }
-
- /**
- * Looks for an already connected compatible accessory and connect to it.
- */
- private void initializeAccessory() {
- UsbAccessory acc = mConfig.getUsbAccessory();
-
- if (!mConfig.getQueryUsbAcc() && acc == null){
- logI("Query for accessory is disabled and accessory in config was null.");
- return;
- }
- logI("Looking for connected accessories");
-
- if( acc == null || !isAccessorySupported(acc)){ //Check to see if our config included an accessory and that it is supported. If not, see if there are any other accessories connected.
- UsbManager usbManager = getUsbManager();
- UsbAccessory[] accessories = usbManager.getAccessoryList();
- if (accessories != null) {
- logD("Found total " + accessories.length + " accessories");
- for (UsbAccessory accessory : accessories) {
- if (isAccessorySupported(accessory)) {
- acc = accessory;
- break;
- }
- }
- } else {
- logI("No connected accessories found");
- return;
- }
- }
- connectToAccessory(acc);
- }
-
- /**
- * Checks if the specified connected USB accessory is what we expect.
- *
- * @param accessory Accessory to check
- * @return true if the accessory is right
- */
- public static boolean isAccessorySupported(UsbAccessory accessory) {
- boolean manufacturerMatches =
- ACCESSORY_MANUFACTURER.equals(accessory.getManufacturer());
- boolean modelMatches = ACCESSORY_MODEL.equals(accessory.getModel());
- boolean versionMatches =
- ACCESSORY_VERSION.equals(accessory.getVersion());
- return manufacturerMatches && modelMatches && versionMatches;
- }
-
- /**
- * Attempts to connect to the specified accessory.
- *
- * If the permission is already granted, opens the accessory. Otherwise,
- * requests permission to use it.
- *
- * @param accessory Accessory to connect to
- */
- private void connectToAccessory(UsbAccessory accessory) {
- final State state = getState();
- switch (state) {
- case LISTENING:
- UsbManager usbManager = getUsbManager();
- if (usbManager.hasPermission(accessory)) {
- logI("Already have permission to use " + accessory);
- openAccessory(accessory);
- } else {
- logI("Requesting permission to use " + accessory);
-
- PendingIntent permissionIntent = PendingIntent
- .getBroadcast(getContext(), 0,
- new Intent(ACTION_USB_PERMISSION), 0);
- usbManager.requestPermission(accessory, permissionIntent);
- }
-
- break;
-
- default:
- logW("connectToAccessory() called from state " + state +
- "; doing nothing");
- }
- }
-
- /**
- * Returns the UsbManager to use with accessories.
- *
- * @return System UsbManager
- */
- private UsbManager getUsbManager() {
- return (UsbManager) getContext().getSystemService(Context.USB_SERVICE);
- }
-
- /**
- * Opens a connection to the accessory.
- *
- * When this function is called, the permission to use it must have already
- * been granted.
- *
- * @param accessory Accessory to open connection to
- */
- private void openAccessory(UsbAccessory accessory) {
- final State state = getState();
- switch (state) {
- case LISTENING:
- synchronized (this) {
- logI("Opening accessory " + accessory);
- mAccessory = accessory;
-
- mReaderThread = new Thread(new USBTransportReader());
- mReaderThread.setDaemon(true);
- mReaderThread
- .setName(USBTransportReader.class.getSimpleName());
- mReaderThread.start();
-
- // Initialize the SiphonServer
- if (SiphonServer.getSiphonEnabledStatus()) {
- SiphonServer.init();
- }
- }
-
- break;
-
- default:
- logW("openAccessory() called from state " + state +
- "; doing nothing");
- }
- }
-
- /**
- * Logs the string and the throwable with ERROR level.
- *
- * @param s string to log
- * @param tr throwable to log
- */
- private void logE(String s, Throwable tr) {
- DebugTool.logError(s, tr);
- }
-
- /**
- * Logs the string with WARN level.
- *
- * @param s string to log
- */
- private void logW(String s) {
- DebugTool.logWarning(s);
- }
-
- /**
- * Logs the string and the throwable with WARN level.
- *
- * @param s string to log
- * @param tr throwable to log
- */
- private void logW(String s, Throwable tr) {
- StringBuilder res = new StringBuilder(s);
- if (tr != null) {
- res.append(EXCEPTION_STRING);
- res.append(tr.toString());
- }
- logW(res.toString());
- }
-
- /**
- * Logs the string with INFO level.
- *
- * @param s string to log
- */
- private void logI(String s) {
- DebugTool.logInfo(s);
- }
-
- /**
- * Logs the string with DEBUG level.
- *
- * @param s string to log
- */
- private void logD(String s) {
- // DebugTool doesn't support DEBUG level, so we use INFO instead
- DebugTool.logInfo(DEBUG_PREFIX + s);
- }
-
- /**
- * Returns Context to communicate with the OS.
- *
- * @return current context to be used by the USB transport
- */
- private Context getContext() {
- return mConfig.getUSBContext();
- }
-
- /**
- * Possible states of the USB transport.
- */
- private enum State {
- /**
- * Transport initialized; no connections.
- */
- IDLE,
-
- /**
- * USB accessory not attached; SdlProxy wants connection as soon as
- * accessory is attached.
- */
- LISTENING,
-
- /**
- * USB accessory attached; permission granted; data IO in progress.
- */
- CONNECTED
- }
-
- /**
- * Internal task that connects to and reads data from a USB accessory.
- *
- * Since the class has to have access to the parent class' variables,
- * synchronization must be taken in consideration! For now, all access
- * to variables of USBTransport must be surrounded with
- * synchronized (USBTransport.this) { … }
- */
- private class USBTransportReader implements Runnable {
- /**
- * String tag for logging inside the task.
- */
- private final String TAG = USBTransportReader.class.getSimpleName();
-
- SdlPsm psm;
-
- /**
- * Checks if the thread has been interrupted.
- *
- * @return true if the thread has been interrupted
- */
- private boolean isInterrupted() {
- return Thread.interrupted();
- }
-
- /**
- * Entry function that is called when the task is started. It attempts
- * to connect to the accessory, then starts a read loop until
- * interrupted.
- */
- @Override
- public void run() {
- logD("USB reader started!");
- psm = new SdlPsm();
- psm.reset();
- if (connect()) {
- readFromTransport();
- }
-
- logD("USB reader finished!");
- }
-
- /**
- * Attemps to open connection to USB accessory.
- *
- * @return true if connected successfully
- */
- private boolean connect() {
- if (isInterrupted()) {
- logI("Thread is interrupted, not connecting");
- return false;
- }
-
- final State state = getState();
- switch (state) {
- case LISTENING:
-
- synchronized (USBTransport.this) {
- try {
- mParcelFD =
- getUsbManager().openAccessory(mAccessory);
- } catch (Exception e) {
- final String msg =
- "Have no permission to open the accessory";
- logE(msg, e);
- disconnect(msg, e);
- return false;
- }
- if (mParcelFD == null) {
- if (isInterrupted()) {
- logW("Can't open accessory, and thread is interrupted");
- } else {
- logW("Can't open accessory, disconnecting!");
- String msg = "Failed to open USB accessory";
- disconnect(msg, new SdlException(msg,
- SdlExceptionCause.SDL_CONNECTION_FAILED));
- }
- return false;
- }
- FileDescriptor fd = mParcelFD.getFileDescriptor();
- mInputStream = new FileInputStream(fd);
- mOutputStream = new FileOutputStream(fd);
- }
-
- logI("Accessory opened!");
-
- synchronized (USBTransport.this) {
- setState(State.CONNECTED);
- handleTransportConnected();
- }
- break;
-
- default:
- logW("connect() called from state " + state +
- ", will not try to connect");
- return false;
- }
-
- return true;
- }
-
- /**
- * Continuously reads data from the transport's input stream, blocking
- * when no data is available.
- */
- private void readFromTransport() {
- final int READ_BUFFER_SIZE = 4096;
- byte[] buffer = new byte[READ_BUFFER_SIZE];
- int bytesRead;
- // byte input;
- boolean stateProgress = false;
-
- // read loop
- while (!isInterrupted()) {
- try {
- if (mInputStream == null)
- continue;
-
- bytesRead = mInputStream.read(buffer);
- if (bytesRead == -1) {
- if (isInterrupted()) {
- logI("EOF reached, and thread is interrupted");
- } else {
- logI("EOF reached, disconnecting!");
- disconnect("EOF reached", null);
- }
- return;
- }
- } catch (IOException e) {
- if (isInterrupted()) {
- logW("Can't read data, and thread is interrupted", e);
- } else {
- logW("Can't read data, disconnecting!", e);
- disconnect("Can't read data from USB", e);
- }
- return;
- }
-
- logD("Read " + bytesRead + " bytes");
- //FIXME SdlTrace.logTransportEvent(TAG + ": read bytes", null,
- // InterfaceActivityDirection.Receive, buffer, bytesRead,
- // SDL_LIB_TRACE_KEY);
-
- if (isInterrupted()) {
- logI("Read some data, but thread is interrupted");
- return;
- }
- byte input;
- for(int i=0;i<bytesRead; i++){
- input=buffer[i];
- stateProgress = psm.handleByte(input);
- if(!stateProgress){//We are trying to weed through the bad packet info until we get something
- //Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
- psm.reset();
- buffer = new byte[READ_BUFFER_SIZE];
- }
-
- if(psm.getState() == SdlPsm.FINISHED_STATE){
- synchronized (USBTransport.this) {
- //Log.d(TAG, "Packet formed, sending off");
- handleReceivedPacket((SdlPacket)psm.getFormedPacket());
- }
- //We put a trace statement in the message read so we can avoid all the extra bytes
- psm.reset();
- buffer = new byte[READ_BUFFER_SIZE]; //FIXME just do an array copy and send off
-
- }
- }
- }
- }
-
- // Log functions
-
- private void logD(String s) {
- DebugTool.logInfo(DEBUG_PREFIX + s);
- }
-
- private void logI(String s) {
- DebugTool.logInfo(s);
- }
-
- private void logW(String s) {
- DebugTool.logWarning(s);
- }
-
- private void logW(String s, Throwable tr) {
- StringBuilder res = new StringBuilder(s);
- if (tr != null) {
- res.append(EXCEPTION_STRING);
- res.append(tr.toString());
- }
- logW(res.toString());
- }
-
- private void logE(String s, Throwable tr) {
- DebugTool.logError(s, tr);
- }
- }
-
- @Override
- public String getBroadcastComment() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java b/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java
deleted file mode 100644
index b819a6844..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package com.smartdevicelink.transport;
-
-import com.smartdevicelink.transport.enums.TransportType;
-
-import android.content.Context;
-import android.hardware.usb.UsbAccessory;
-
-/**
- * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
- * understand how to implement USB multiplexing. This class and method of USB connection will be
- * removed in the next major release. If a router service is available to handle multiplexing of the
- * usb transport it will be used, and this app will connect to whatever router service hosts the USB
- * connection.
- * @see MultiplexTransportConfig
- */
-@Deprecated
-public class USBTransportConfig extends BaseTransportConfig {
-
- private Context mainActivity = null;
- private UsbAccessory usbAccessory = null;
- private Boolean queryUsbAcc = true;
-
- /**
- * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
- * understand how to implement USB multiplexing. This class and method of USB connection will be
- * removed in the next major release. If a router service is available to handle multiplexing of the
- * usb transport it will be used, and this app will connect to whatever router service hosts the USB
- * connection.
- * @param mainActivity context used to start USB transport
- * @see MultiplexTransportConfig
- */
- public USBTransportConfig (Context mainActivity) {
- this.mainActivity = mainActivity;
- }
-
- /**
- * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
- * understand how to implement USB multiplexing. This class and method of USB connection will be
- * removed in the next major release. If a router service is available to handle multiplexing of the
- * usb transport it will be used, and this app will connect to whatever router service hosts the USB
- * connection.
- * @param mainActivity context used to start USB transport
- * @param usbAccessory the accessory that was given to this app
- * @see MultiplexTransportConfig
- */
- public USBTransportConfig (Context mainActivity, UsbAccessory usbAccessory) {
- this.mainActivity = mainActivity;
- this.usbAccessory = usbAccessory;
- }
-
- /**
- * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
- * understand how to implement USB multiplexing. This class and method of USB connection will be
- * removed in the next major release. If a router service is available to handle multiplexing of the
- * usb transport it will be used, and this app will connect to whatever router service hosts the USB
- * connection.
- * @param mainActivity context used to start USB transport
- * @param shareConnection enable other sessions on this app to use this USB connection
- * @param queryUsbAcc attempt to query the USB accessory if none is provided
- * @see MultiplexTransportConfig
- */
- public USBTransportConfig (Context mainActivity, boolean shareConnection, boolean queryUsbAcc) {
- this.mainActivity = mainActivity;
- this.queryUsbAcc = queryUsbAcc;
- super.shareConnection = shareConnection;
- }
-
- /**
- * <b>NOTE: </b> This should no longer be used. See the MultplexTransportConfig and guides to
- * understand how to implement USB multiplexing. This class and method of USB connection will be
- * removed in the next major release. If a router service is available to handle multiplexing of the
- * usb transport it will be used, and this app will connect to whatever router service hosts the USB
- * connection.
- * @param mainActivity context used to start USB transport
- * @param usbAccessory the accessory that was given to this app
- * @param shareConnection enable other sessions on this app to use this USB connection
- * @param queryUsbAcc attempt to query the USB accessory if none is provided
- * @see MultiplexTransportConfig
- */
- public USBTransportConfig (Context mainActivity, UsbAccessory usbAccessory, boolean shareConnection, boolean queryUsbAcc) {
- this.mainActivity = mainActivity;
- this.queryUsbAcc = queryUsbAcc;
- this.usbAccessory = usbAccessory;
- super.shareConnection = shareConnection;
- }
-
- public Boolean getQueryUsbAcc () {
- return queryUsbAcc;
- }
-
- public Context getUSBContext () {
- return mainActivity;
- }
-
- public UsbAccessory getUsbAccessory () {
- return usbAccessory;
- }
-
- public void setUsbAccessory (UsbAccessory value) { usbAccessory = value; }
-
- public TransportType getTransportType() {
- return TransportType.USB;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java b/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java
deleted file mode 100644
index 9657a2c27..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.transport;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.hardware.usb.UsbAccessory;
-import android.hardware.usb.UsbManager;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Looper;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.ParcelFileDescriptor;
-import android.os.RemoteException;
-import android.util.Log;
-
-import com.smartdevicelink.util.AndroidTools;
-import java.lang.ref.WeakReference;
-
-@TargetApi(12)
-public class UsbTransferProvider {
- private static final String TAG = "UsbTransferProvider";
-
- private Context context ;
- private boolean isBound = false;
- private ComponentName routerService;
- private int flags = 0;
-
- final Messenger clientMessenger;
-
- UsbTransferCallback callback;
- Messenger routerServiceMessenger = null;
- ParcelFileDescriptor usbPfd;
- Bundle usbInfoBundle;
-
- private ServiceConnection routerConnection= new ServiceConnection() {
-
- public void onServiceConnected(ComponentName className, IBinder service) {
- Log.d(TAG, "Bound to service " + className.toString());
- routerServiceMessenger = new Messenger(service);
- isBound = true;
- //So we just established our connection
- //Register with router service
- Message msg = Message.obtain();
- msg.what = TransportConstants.USB_CONNECTED_WITH_DEVICE;
- msg.arg1 = flags;
- msg.replyTo = clientMessenger;
- msg.obj = usbPfd;
- if(usbInfoBundle != null){
- msg.setData(usbInfoBundle);
- }
- try {
- routerServiceMessenger.send(msg);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
-
- public void onServiceDisconnected(ComponentName className) {
- Log.d(TAG, "UN-Bound from service " + className.getClassName());
- routerServiceMessenger = null;
- isBound = false;
- }
- };
-
- public UsbTransferProvider(Context context, ComponentName service, UsbAccessory usbAccessory, UsbTransferCallback callback){
- if(context == null || service == null || usbAccessory == null){
- throw new IllegalStateException("Supplied params are not correct. Context == null? "+ (context==null) + " ComponentName == null? " + (service == null) + " Usb Accessory == null? " + usbAccessory);
- }
- this.context = context;
- this.routerService = service;
- this.callback = callback;
- this.clientMessenger = new Messenger(new ClientHandler(this));
- usbPfd = getFileDescriptor(usbAccessory);
- if(usbPfd != null){
- usbInfoBundle = new Bundle();
- usbInfoBundle.putString(MultiplexUsbTransport.MANUFACTURER, usbAccessory.getManufacturer());
- usbInfoBundle.putString(MultiplexUsbTransport.MODEL, usbAccessory.getModel());
- usbInfoBundle.putString(MultiplexUsbTransport.VERSION, usbAccessory.getVersion());
- usbInfoBundle.putString(MultiplexUsbTransport.URI, usbAccessory.getUri());
- usbInfoBundle.putString(MultiplexUsbTransport.SERIAL, usbAccessory.getSerial());
- usbInfoBundle.putString(MultiplexUsbTransport.DESCRIPTION, usbAccessory.getDescription());
- checkIsConnected();
- }
-
- }
-
- @SuppressLint("NewApi")
- private ParcelFileDescriptor getFileDescriptor(UsbAccessory accessory) {
- try {
- UsbManager manager = (UsbManager) context.getSystemService(Context.USB_SERVICE);
-
- if (manager != null) {
- return manager.openAccessory(accessory);
- }
- }catch (Exception e){}
-
- return null;
- }
-
- public void setFlags(int flags){
- this.flags = flags;
- }
-
- public void checkIsConnected(){
- if(!AndroidTools.isServiceExported(context,routerService) || !bindToService()){
- //We are unable to bind to service
- Log.e(TAG, "Unable to bind to service");
- unBindFromService();
- }
- }
-
- public void cancel(){
- if(isBound){
- unBindFromService();
- }
- }
-
- private boolean bindToService(){
- if(isBound){
- return true;
- }
- if(clientMessenger == null){
- return false;
- }
- Intent bindingIntent = new Intent();
- bindingIntent.setClassName(this.routerService.getPackageName(), this.routerService.getClassName());//This sets an explicit intent
- //Quickly make sure it's just up and running
- context.startService(bindingIntent);
- bindingIntent.setAction( TransportConstants.BIND_REQUEST_TYPE_USB_PROVIDER);
- return context.bindService(bindingIntent, routerConnection, Context.BIND_AUTO_CREATE);
- }
-
- private void unBindFromService(){
- try{
- if(context!=null && routerConnection!=null){
- context.unbindService(routerConnection);
- }else{
- Log.w(TAG, "Unable to unbind from router service, context was null");
- }
-
- }catch(IllegalArgumentException e){
- //This is ok
- }
- }
-
- private void finish(){
- if(callback != null){
- callback.onUsbTransferUpdate(true);
- }
- unBindFromService();
- routerServiceMessenger =null;
- }
-
- static class ClientHandler extends Handler {
- final WeakReference<UsbTransferProvider> provider;
-
- public ClientHandler(UsbTransferProvider provider){
- super(Looper.getMainLooper());
- this.provider = new WeakReference<UsbTransferProvider>(provider);
- }
-
- @Override
- public void handleMessage(Message msg) {
- if(provider.get()==null){
- return;
- }
- switch (msg.what) {
- case TransportConstants.ROUTER_USB_ACC_RECEIVED:
- Log.d(TAG, "Successful USB transfer");
- provider.get().finish();
- break;
- default:
- break;
- }
- }
- }
-
- public interface UsbTransferCallback{
- void onUsbTransferUpdate(boolean success);
- }
-
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/enums/TransportType.java b/sdl_android/src/main/java/com/smartdevicelink/transport/enums/TransportType.java
deleted file mode 100644
index 2c09c72fc..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/enums/TransportType.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.smartdevicelink.transport.enums;
-
-/**
- * Defines available types of the transports.
- */
-public enum TransportType {
- /**
- * Transport type will be anything the multiplexing service connects to.
- */
- MULTIPLEX,
- /**
- * Transport type is Bluetooth.
- */
- BLUETOOTH,
-
- /**
- * Transport type is TCP.
- */
- TCP,
- USB;
-
- public static TransportType valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteAraryMessageAssembler.java b/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteAraryMessageAssembler.java
deleted file mode 100644
index 61fd2e13e..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteAraryMessageAssembler.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.smartdevicelink.transport.utl;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import android.util.Log;
-
-import com.smartdevicelink.transport.TransportConstants;
-import com.smartdevicelink.transport.enums.TransportType;
-
-public class ByteAraryMessageAssembler {
- private static final String TAG = "ByteAraryMessageAssembler";
- ByteArrayOutputStream buffer;
- boolean isFinished;
- TransportType transportType;
-
-
- public void init(){
- close();
- this.isFinished = false;
- buffer = new ByteArrayOutputStream();
- }
-
- public void setTransportType(TransportType transportType){
- this.transportType = transportType;
- }
-
- public TransportType getTransportType() {
- return transportType;
- }
-
- public boolean close(){
- if(buffer!=null){
- try {
- buffer.close();
- buffer = null;
- return true;
- } catch (IOException e) {
- e.printStackTrace();
- return false;
- }
- }
- return false;
- }
-
- public void append(byte[] bytes){
- try {
- buffer.write(bytes);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- public synchronized boolean handleMessage(int flags, byte[] packet){
- switch(flags){
- case TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START: //Fall through to write the bytes after they buffer was init'ed
- case TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_CONT:
- append(packet);
- break;
- case TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_END:
- append(packet);
- this.isFinished = true;
- break;
- default:
- Log.e(TAG, "Error handling message");
- return false;
- }
-
- return true;
- }
-
- public byte[] getBytes(){
- if(buffer == null){
- return null;
- }
- return this.buffer.toByteArray();
- }
-
- public boolean isFinished(){
- return this.isFinished;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java b/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java
deleted file mode 100644
index 999fdacb3..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package com.smartdevicelink.transport.utl;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-
-import com.smartdevicelink.transport.TransportBroker;
-import com.smartdevicelink.transport.TransportConstants;
-import com.smartdevicelink.transport.enums.TransportType;
-
-import android.os.Bundle;
-import android.os.Message;
-import android.util.Log;
-
-public class ByteArrayMessageSpliter {
- private static final String TAG = "ByteArrayMessageSpliter";
-
- //To test set this value to something very small (eg, 50)
- public static final int MAX_BINDER_SIZE = 1000000/4; //~1MB/4 We do this as a safety measure. IPC only allows 1MB for everything. We should never fill more than 25% of the buffer so here we make sure we stay under that
-
- boolean firstPacket;
- ByteArrayInputStream stream;
- int bytesRead;
- int what;
- String appId;
- byte[] buffer;
- int orginalSize;
- int priorityCoef;
- int routerServiceVersion = 1;
- TransportRecord transportRecord;
-
- public ByteArrayMessageSpliter(String appId,int what, byte[] bytes, int priorityCoef){
- this.appId = appId;
- this.what = what;
- stream = new ByteArrayInputStream(bytes);
- orginalSize = stream.available();
- bytesRead = 0;
- firstPacket = true;
- this.priorityCoef = priorityCoef;
- }
-
- @Deprecated
- public ByteArrayMessageSpliter(Long appId,int what, byte[] bytes, int priorityCoef){
- this.appId = appId+"";
- this.what = what;
- stream = new ByteArrayInputStream(bytes);
- orginalSize = stream.available();
- bytesRead = 0;
- firstPacket = true;
- this.priorityCoef = priorityCoef;
- }
-
- public void setRouterServiceVersion(int version){
- this.routerServiceVersion = version;
- }
-
- public void setTransportRecord(TransportRecord transportRecord){
- this.transportRecord = transportRecord;
- }
-
- public boolean isActive(){
- if(stream!=null){
- return stream.available()>0;
- }
- return false;
- }
-
- public boolean close(){
- if(stream == null){
- return false;
- }
- try {
- stream.close();
- stream = null;
- return true;
- } catch (IOException e) {
- e.printStackTrace();
- return false;
- }
-
- }
-
- public Message nextMessage(){
- if(stream == null || stream.available()<=0){
- return null;
- }
-
- Message message = Message.obtain(); //Do we need to always obtain new? or can we just swap bundles?
- message.what = this.what;// TransportConstants.ROUTER_SEND_PACKET;
- Bundle bundle = new Bundle();
-
-
- if(stream.available()>=MAX_BINDER_SIZE){
- buffer = new byte[MAX_BINDER_SIZE];
- bytesRead = stream.read(buffer, 0, MAX_BINDER_SIZE);
- }else{
- buffer = new byte[stream.available()];
- bytesRead = stream.read(buffer, 0, stream.available());
- }
-
- bundle.putByteArray(TransportConstants.BYTES_TO_SEND_EXTRA_NAME, buffer); //Do we just change this to the args and objs
- bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_OFFSET, 0);
- bundle.putInt(TransportConstants.BYTES_TO_SEND_EXTRA_COUNT, bytesRead);
- if(transportRecord != null){
- bundle.putString(TransportConstants.TRANSPORT_TYPE, transportRecord.getType().name());
- bundle.putString(TransportConstants.TRANSPORT_ADDRESS, transportRecord.getAddress());
- }
-
- //Determine which flag should be sent for this division of the packet
- if(firstPacket){
- bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START);
- bundle.putInt(TransportConstants.PACKET_PRIORITY_COEFFICIENT, this.priorityCoef);
- firstPacket = false;
- }else if(stream.available()<=0){ //We are at the end of the stream so let the flag reflect that
- bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_END);
- }else{
- bundle.putInt(TransportConstants.BYTES_TO_SEND_FLAGS, TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_CONT);
- }
-
- if(routerServiceVersion< TransportConstants.RouterServiceVersions.APPID_STRING){
- bundle.putLong(TransportConstants.APP_ID_EXTRA,TransportBroker.convertAppId(appId));
- }
- bundle.putString(TransportConstants.APP_ID_EXTRA_STRING, appId);
- message.setData(bundle);
- Log.i(TAG, ((100 - ((stream.available()*100)/orginalSize) ))+ " percent complete.");
- return message;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/utl/WiFiSocketFactory.java b/sdl_android/src/main/java/com/smartdevicelink/transport/utl/WiFiSocketFactory.java
deleted file mode 100644
index b35070d89..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/utl/WiFiSocketFactory.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package com.smartdevicelink.transport.utl;
-
-import android.Manifest;
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.net.ConnectivityManager;
-import android.net.Network;
-import android.net.NetworkCapabilities;
-import android.os.Build;
-
-import java.io.IOException;
-import java.net.Socket;
-
-import javax.net.SocketFactory;
-
-import static com.smartdevicelink.util.NativeLogTool.logInfo;
-
-public class WiFiSocketFactory {
- /**
- * Try to create a TCP socket which is bound to Wi-Fi network (for Android 5+)
- *
- * On Android 5 and later, this method tries to create a Socket instance which is bound to a
- * Wi-Fi network. If the phone is not connected to a Wi-Fi network, or the app lacks
- * required permission (ACCESS_NETWORK_STATE), then this method simply creates a Socket instance
- * with "new Socket();".
- *
- * @return a Socket instance, preferably bound to a Wi-Fi network
- */
- public static Socket createSocket(Context context) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- Socket socket = createWiFiSocket(context);
- if (socket != null) {
- logInfo("Created a Socket bound to Wi-Fi network");
- return socket;
- }
- }
-
- return new Socket();
- }
-
- @TargetApi(Build.VERSION_CODES.LOLLIPOP)
- private static Socket createWiFiSocket(Context context) {
- PackageManager pm = context.getPackageManager();
- if (pm == null) {
- logInfo("PackageManager isn't available.");
- return null;
- }
- // getAllNetworks() and getNetworkCapabilities() require ACCESS_NETWORK_STATE
- if (pm.checkPermission(Manifest.permission.ACCESS_NETWORK_STATE, context.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
- logInfo("Router service doesn't have ACCESS_NETWORK_STATE permission. It cannot bind a TCP transport to Wi-Fi network.");
- return null;
- }
-
- ConnectivityManager connMan = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
- if (connMan == null) {
- logInfo("ConnectivityManager isn't available.");
- return null;
- }
-
- Network[] allNetworks = connMan.getAllNetworks();
- if (allNetworks == null) {
- logInfo("Failed to acquire a list of networks.");
- return null;
- }
-
- // Samsung Galaxy S9 (with Android 8.0.0) provides two `Network` instances which have
- // TRANSPORT_WIFI capability. The first one throws an IOException upon creating a Socket,
- // and the second one actually works. To support such case, here we iterate over all
- // `Network` instances until we can create a Socket.
- for (Network network : allNetworks) {
- if (network == null) {
- continue;
- }
-
- NetworkCapabilities capabilities = connMan.getNetworkCapabilities(network);
- if (capabilities == null) {
- continue;
- }
-
- if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
- try {
- SocketFactory factory = network.getSocketFactory();
- if (factory != null) {
- return factory.createSocket();
- }
- } catch (IOException e) {
- logInfo("IOException during socket creation (ignored): " + e.getMessage());
- }
- }
- }
-
- logInfo("Cannot find Wi-Fi network to bind a TCP transport.");
- return null;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java b/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java
deleted file mode 100644
index 62f379031..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.util;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ServiceInfo;
-
-import com.smartdevicelink.transport.TransportConstants;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-
-public class AndroidTools {
- /**
- * Check to see if a component is exported
- * @param context object used to retrieve the package manager
- * @param name of the component in question
- * @return true if this component is tagged as exported
- */
- public static boolean isServiceExported(Context context, ComponentName name) {
- try {
- ServiceInfo serviceInfo = context.getPackageManager().getServiceInfo(name, PackageManager.GET_META_DATA);
- return serviceInfo.exported;
- } catch (NameNotFoundException e) {
- e.printStackTrace();
- }
- return false;
- }
- /**
- * Get all SDL enabled apps. If the package name is null, it will return all apps. However, if the package name is included, the
- * resulting hash map will not include the app with that package name.
- * @param context a context object used to get an instance of the package manager
- * @param myPackageName the package of the requesting app. This should only be included if the app wants to exclude itself from the map
- * @return a hash map of SDL apps with the package name as the key, and the ResolveInfo as the value
- */
- public static HashMap<String,ResolveInfo> getSdlEnabledApps(Context context, String myPackageName){
- Intent intent = new Intent(TransportConstants.START_ROUTER_SERVICE_ACTION);
- List<ResolveInfo> infos = context.getPackageManager().queryBroadcastReceivers(intent, 0);
- HashMap<String,ResolveInfo> sdlMultiList = new HashMap<String,ResolveInfo>();
- for(ResolveInfo info: infos){
- if(info.activityInfo.applicationInfo.packageName.equals(myPackageName)){
- continue; //Ignoring my own package
- }
- sdlMultiList.put(info.activityInfo.packageName, info);
- }
- return sdlMultiList;
- }
-
-
- /**
- * Finds all SDL apps via their SdlRouterService manifest entry. It will return the metadata associated with that router service.
- * @param context a context instance to obtain the package manager
- * @param comparator the Comparator to sort the resulting list. If null is supplied, they will be returned as they are from the system
- * @return the sorted list of SdlAppInfo objects that represent SDL apps
- */
- public static List<SdlAppInfo> querySdlAppInfo(Context context, Comparator<SdlAppInfo> comparator){
- List<SdlAppInfo> sdlAppInfoList = new ArrayList<>();
- Intent intent = new Intent(TransportConstants.ROUTER_SERVICE_ACTION);
- List<ResolveInfo> resolveInfoList = context.getPackageManager().queryIntentServices(intent, PackageManager.GET_META_DATA);
-
- if(resolveInfoList != null && resolveInfoList.size() > 0) {
- PackageManager packageManager = context.getPackageManager();
- if(packageManager != null) {
-
- for (ResolveInfo info : resolveInfoList) {
- PackageInfo packageInfo = null;
- try {
- packageInfo = packageManager.getPackageInfo(info.serviceInfo.packageName, 0);
- sdlAppInfoList.add(new SdlAppInfo(info, packageInfo));
- } catch (NameNotFoundException e) {
- //Package was not found, likely a sign the resolve info can't be trusted.
- }
-
- }
- }
-
- if (comparator != null) {
- Collections.sort(sdlAppInfoList, comparator);
- }
- }
-
- return sdlAppInfoList;
- }
-
-
- /**
- * Sends the provided intent to the specified destinations making it an explicit intent, rather
- * than an implicit intent. A direct replacement of sendBroadcast(Intent). As of Android 8.0
- * (API 26+) implicit broadcasts are no longer sent to broadcast receivers that are declared via
- * the AndroidManifest. If no apps are found to receive the intent, this method will send the
- * broadcast implicitly if no list of apps is provided.
- *
- * @param intent - the intent to send explicitly
- * @param apps - the list of apps that this broadcast will be sent to. If null is passed in
- * the intent will be sent to all apps that match the provided intent via a query
- * to the package manager; it will also be sent implicitly to mimic
- * sendBroadcast()'s original functionality.
- */
- public static void sendExplicitBroadcast(Context context, Intent intent, List<ResolveInfo> apps) {
-
- if(context == null || intent == null){
- return;
- }
-
- if (apps == null) {
- apps = context.getPackageManager().queryBroadcastReceivers(intent, 0);
- }
-
- if (apps != null && apps.size()>0) {
- for(ResolveInfo app: apps){
- try {
- intent.setClassName(app.activityInfo.applicationInfo.packageName, app.activityInfo.name);
- context.sendBroadcast(intent);
- }catch(Exception e){
- //In case there is missing info in the app reference we want to keep moving
- }
- }
- } else {
- // fallback to implicit broadcast if we cannot resolve apps info.
- context.sendBroadcast(intent);
- }
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/BitConverter.java b/sdl_android/src/main/java/com/smartdevicelink/util/BitConverter.java
deleted file mode 100644
index a681a75a8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/BitConverter.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package com.smartdevicelink.util;
-
-public class BitConverter {
- /**
- * @param bytes byte array that will be converted to hex
- * @return the String containing converted hex values or null if byte array is null
- */
- public static String bytesToHex(byte [] bytes) {
- if (bytes == null) { return null; }
- return bytesToHex(bytes, 0, bytes.length);
- } // end-method
-
- /**
- * @param bytes byte array that will be converted to hex
- * @param offset int representing the offset to begin conversion at
- * @param length int representing number of bytes in array to convert
- * @return the String containing converted hex values or null if byte array is null
- */
- public static String bytesToHex(byte[] bytes, int offset, int length) {
- if (bytes == null) { return null; }
- final char[] HexDigits = new char[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
- byte b;
- char[] hexChars = new char[2 * length];
- //StringBuffer sb = new StringBuffer();
- int upperBound = Math.min(bytes.length, (offset + length));
- int baidx = 0;
- int sidx = 0;
- for (baidx = offset; baidx < upperBound; baidx++) {
- // Get the byte from the array
- b = bytes[baidx];
- // Use nibbles as index into hex digit array (left nibble, then right)
- hexChars[sidx++] = HexDigits[(b & 0xf0) >> 4];
- hexChars[sidx++] = HexDigits[(b & 0x0f)];
- } // end-for
- return new String(hexChars);
- } // end-method
-
- /**
- * @param hexString the String containing converted hex values
- * @return byte array converted from input String or null if String is null
- */
- public static byte [] hexToBytes(String hexString) {
- if (hexString == null) { return null; }
- if (hexString.length() % 2 != 0) {
- hexString = "0" + hexString;
- }
- byte [] theBytes = new byte[hexString.length() / 2];
- for (int i = 0; i < hexString.length(); i += 2) {
- String byteString = hexString.substring(i, i + 2);
- byte theByte = (byte)Integer.parseInt(byteString, 16);
- theBytes[i/2] = theByte;
- }
- return theBytes;
- } // end-method
-
- public static final byte[] intToByteArray(int value) {
- return new byte[] {
- (byte)(value >>> 24),
- (byte)(value >>> 16),
- (byte)(value >>> 8),
- (byte)value};
- }
-
- /**
- * @param sizeBuf byte array that will be converted to int
- * @return int converted from byte array or -1 if byte array is null
- */
- public static int intFromByteArray(byte[] sizeBuf, int offset) {
- if (sizeBuf == null) { return -1; }
- int ret = 0;
- for (int i = offset; i < offset + 4; i++) {
- ret <<= 8;
- ret |= 0xFF & sizeBuf[i];
- }
- return ret;
- }
-
- public static final byte[] shortToByteArray(short value) {
- return new byte[] {
- (byte)(value >>> 8),
- (byte)value};
- }
-
- /**
- * @param sizeBuf byte array that will be converted to short
- * @return short converted from byte array or -1 if byte array is null
- */
- public static short shortFromByteArray(byte[] sizeBuf, int offset) {
- if (sizeBuf == null) { return -1; }
- short ret = 0;
- for (int i = offset; i < offset + 2; i++) {
- ret <<= 8;
- ret |= 0xFF & sizeBuf[i];
- }
- return ret;
- }
-
- /**
- * Converts the byte array into a string of hex values.
- * @param bytes byte array that will be converted to hex
- * @param end EXCLUSIVE so if it it receives 10 it will print 0-9
- * @return the String containing converted hex values or null if byte array is null
- */
- public static String bytesToHex(byte[] bytes,int end){
- if (bytes == null) { return null; }
- if(bytes.length<end){
- end = bytes.length;
- }
- StringBuilder sb = new StringBuilder();
- for(int i=0;i<end;i++){
- sb.append(" ");
- sb.append(String.format("%02X ", bytes[i]));
- }
- return sb.toString();
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/ByteEnumer.java b/sdl_android/src/main/java/com/smartdevicelink/util/ByteEnumer.java
deleted file mode 100644
index 0b67d9992..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/ByteEnumer.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.smartdevicelink.util;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-public abstract class ByteEnumer {
-
- protected ByteEnumer(byte value, String name) {
- this.value = value;
- this.name = name;
- }
-
- private byte value;
- private String name;
-
- public byte getValue() { return value; }
- public String getName() { return name; }
-
- public boolean equals(ByteEnumer other) {
- return name == other.getName();
- }
-
- public boolean eq(ByteEnumer other) {
- return equals(other);
- }
-
- public byte value() {
- return value;
- }
-
- public static ByteEnumer get(Vector<?> theList, byte value) {
- Enumeration<?> enumer = theList.elements();
- while (enumer.hasMoreElements()) {
- try {
- ByteEnumer current = (ByteEnumer)enumer.nextElement();
- if (current.getValue() == value) {
- return current;
- }
- } catch (ClassCastException e) {
- return null;
- }
- }
- return null;
- }
-
- public static ByteEnumer get(Vector<?> theList, String name) {
- Enumeration<?> enumer = theList.elements();
- while (enumer.hasMoreElements()) {
- try {
- ByteEnumer current = (ByteEnumer)enumer.nextElement();
- if (current.getName().equals(name)) {
- return current;
- }
- } catch (ClassCastException e) {
- return null;
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java b/sdl_android/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java
deleted file mode 100644
index 18ff93622..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/CorrelationIdGenerator.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.smartdevicelink.util;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class CorrelationIdGenerator {
-
- private static final int CORRELATION_ID_START = 0;
-
- private static final AtomicInteger sNextCorrelationId = new AtomicInteger(CORRELATION_ID_START);
-
- public static int generateId() {
- for (;;) {
- final int result = sNextCorrelationId.get();
- // aapt-generated IDs have the high byte nonzero; clamp to the range under that.
- int newValue = result + 1;
-
- if (newValue > 0x00FFFFFF){
- newValue = CORRELATION_ID_START; // Roll over to 0.
- }
- if (sNextCorrelationId.compareAndSet(result, newValue)) {
- return result;
- }
- }
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/DebugTool.java b/sdl_android/src/main/java/com/smartdevicelink/util/DebugTool.java
deleted file mode 100644
index 2ea9cc938..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/DebugTool.java
+++ /dev/null
@@ -1,355 +0,0 @@
-package com.smartdevicelink.util;
-
-import android.util.Log;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.protocol.BinaryFrameHeader;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.SdlPacket;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.RPCStruct;
-import com.smartdevicelink.proxy.Version;
-import com.smartdevicelink.transport.SiphonServer;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-public class DebugTool {
-
-
- public static final String TAG = "SdlProxy";
-
- private static boolean isErrorEnabled = false;
- private static boolean isWarningEnabled = false;
- private static boolean isInfoEnabled = false;
-
- public static void enableDebugTool() {
- isErrorEnabled = true;
- isWarningEnabled = true;
- isInfoEnabled = true;
- }
-
- public static void disableDebugTool() {
- isErrorEnabled = true;
- isWarningEnabled = false;
- isInfoEnabled = false;
- }
-
- public static boolean isDebugEnabled()
- {
- if (isWarningEnabled && isInfoEnabled) return true;
-
- return false;
- }
-
- private static String prependProxyVersionNumberToString(String string) {
- if (Version.VERSION != null && string != null) {
- string = Version.VERSION + ": " + string;
- }
-
- return string;
- }
-
- public static void logError(String msg) {
-
- Boolean wasWritten = false;
-
- msg = prependProxyVersionNumberToString(msg);
-
- wasWritten = logToSiphon(msg);
-
- if (isErrorEnabled && !wasWritten) {
- NativeLogTool.logError(TAG, msg);
- }
- }
-
- public static void logError(String msg, Throwable ex) {
- Boolean wasWritten = false;
-
- msg = prependProxyVersionNumberToString(msg);
-
- if (ex != null) {
- wasWritten = logToSiphon(msg + " Exception String: " + ex.toString());
- } else {
- wasWritten = logToSiphon(msg);
- }
-
- if (isErrorEnabled && !wasWritten) {
- NativeLogTool.logError(TAG, msg, ex);
- }
- }
-
- public static void logWarning(String msg) {
- Boolean wasWritten = false;
-
- msg = prependProxyVersionNumberToString(msg);
-
- wasWritten = logToSiphon(msg);
-
- if (isWarningEnabled && !wasWritten) {
- NativeLogTool.logWarning(TAG, msg);
- }
- }
-
- public static void logInfo(String msg) {
- Boolean wasWritten = false;
-
- msg = prependProxyVersionNumberToString(msg);
-
- wasWritten = logToSiphon(msg);
-
- if (isInfoEnabled && !wasWritten) {
- NativeLogTool.logInfo(TAG, msg);
- }
- }
-
- public static void logInfo(String msg, boolean bPrependVersion) {
- Boolean wasWritten = false;
-
- if (bPrependVersion) msg = prependProxyVersionNumberToString(msg);
-
- wasWritten = logToSiphon(msg);
-
- if (isInfoEnabled && !wasWritten) {
- NativeLogTool.logInfo(TAG, msg);
- }
- }
-
- protected static Boolean logToSiphon(String msg) {
- if (SiphonServer.getSiphonEnabledStatus()) {
- // Initialize the SiphonServer, will be ignored if already initialized
- SiphonServer.init();
-
- // Write to the SiphonServer
- return SiphonServer.sendSiphonLogData(msg);
- }
- return false;
- }
-
- protected static String getLine(Throwable ex) {
- if (ex == null) { return null; }
- String toPrint = ex.toString() + " :" + ex.getMessage();
- for (int i=0; i<ex.getStackTrace().length; i++) {
- StackTraceElement elem = ex.getStackTrace()[i];
- toPrint += "\n " + elem.toString();
- }
-
- if (ex instanceof SdlException) {
- SdlException sdlEx = (SdlException) ex;
- if (sdlEx.getInnerException() != null && sdlEx != sdlEx.getInnerException()) {
- toPrint += "\n nested:\n";
- toPrint += getLine(sdlEx.getInnerException());
- }
- }
-
- return toPrint;
- }
-
-
- protected static Vector<IConsole> consoleListenerList = new Vector<IConsole>();
-
- protected final static boolean isTransportEnabled = false;
- protected final static boolean isRPCEnabled = false;
-
- public static void addConsole(IConsole console) {
- synchronized(consoleListenerList) {
- consoleListenerList.addElement(console);
- }
- }
-
- public static void removeConsole(IConsole console) {
- synchronized(consoleListenerList) {
- consoleListenerList.removeElement(console);
- }
- }
-
- public static void clearConsoles() {
- synchronized(consoleListenerList) {
- consoleListenerList.removeAllElements();
- }
- }
-
- public static void logTransport(String msg) {
- if (isTransportEnabled) {
- Log.d(TAG, msg);
- logInfoToConsole(msg);
- }
- }
-
- public static void logRPCSend(String rpcMsg) {
- if (isRPCEnabled) {
- Log.d(TAG, "Sending RPC message: " + rpcMsg);
- logRPCSendToConsole(rpcMsg);
- }
- }
-
- public static void logRPCReceive(String rpcMsg) {
- if (isRPCEnabled) {
- Log.d(TAG, "Received RPC message: " + rpcMsg);
- logRPCSendToConsole(rpcMsg);
- }
- }
-
- @SuppressWarnings("unchecked")
- protected static void logInfoToConsole(String msg) {
- Vector<IConsole> localList;
- synchronized(consoleListenerList) {
- localList = (Vector<IConsole>) consoleListenerList.clone();
- }
-
- for (int i = 0; i < localList.size(); i++) {
- IConsole consoleListener = (IConsole) localList.elementAt(i);
- try {
- consoleListener.logInfo(msg);
- } catch (Exception ex) {
- Log.e(TAG, "Failure propagating logInfo: " + ex.toString(), ex);
- } // end-catch
- }
- }
-
- @SuppressWarnings("unchecked")
- protected static void logErrorToConsole(String msg) {
- Vector<IConsole> localList;
- synchronized(consoleListenerList) {
- localList = (Vector<IConsole>) consoleListenerList.clone();
- }
- for (int i = 0; i < localList.size(); i++) {
- IConsole consoleListener = (IConsole) localList.elementAt(i);
- try {
- consoleListener.logError(msg);
- } catch (Exception ex) {
- Log.e(TAG, "Failure propagating logError: " + ex.toString(), ex);
- } // end-catch
- }
- }
-
- @SuppressWarnings("unchecked")
- protected static void logErrorToConsole(String msg, Throwable e) {
- Vector<IConsole> localList;
- synchronized(consoleListenerList) {
- localList = (Vector<IConsole>) consoleListenerList.clone();
- }
-
- for (int i = 0; i < localList.size(); i++) {
- IConsole consoleListener = (IConsole) localList.elementAt(i);
- try {
- consoleListener.logError(msg, e);
- } catch (Exception ex) {
- Log.e(TAG, "Failure propagating logError: " + ex.toString(), ex);
- } // end-catch
- }
- }
-
- @SuppressWarnings("unchecked")
- protected static void logRPCSendToConsole(String msg) {
- Vector<IConsole> localList;
- synchronized(consoleListenerList) {
- localList = (Vector<IConsole>) consoleListenerList.clone();
- }
-
- for (int i = 0; i < localList.size(); i++) {
- IConsole consoleListener = (IConsole) localList.elementAt(i);
- try {
- consoleListener.logRPCSend(msg);
- } catch (Exception ex) {
- Log.e(TAG, "Failure propagating logRPCSend: " + ex.toString(), ex);
- } // end-catch
- }
- }
-
- @SuppressWarnings("unchecked")
- protected static void logRPCReceiveToConsole(String msg) {
- Vector<IConsole> localList;
- synchronized(consoleListenerList) {
- localList = (Vector<IConsole>) consoleListenerList.clone();
- }
-
- for (int i = 0; i < localList.size(); i++) {
- IConsole consoleListener = (IConsole) localList.elementAt(i);
- try {
- consoleListener.logRPCReceive(msg);
- } catch (Exception ex) {
- Log.e(TAG, "Failure propagating logRPCReceive: " + ex.toString(), ex);
- } // end-catch
- }
- }
-
- /**
- * Debug method to try to extract the RPC hash from the packet payload. Should only be used while debugging, not in production.
- * Currently it will only handle single frame RPCs
- * @param packet to inspect
- * @return The Hashtable to be used to construct an RPC
- */
- public static Hashtable<String, Object> getRPCHash(SdlPacket packet){
- if(packet == null ||
- packet.getFrameType().getValue() != SdlPacket.FRAME_TYPE_SINGLE ||
- packet.getServiceType()!=SdlPacket.SERVICE_TYPE_RPC){
- Log.w("Debug", "Unable to get hash");
- return null;
- }
- int version = packet.getVersion();
-
- ProtocolMessage message = new ProtocolMessage();
- SessionType serviceType = SessionType.valueOf((byte)packet.getServiceType());
- if (serviceType == SessionType.RPC) {
- message.setMessageType(MessageType.RPC);
- } else if (serviceType == SessionType.BULK_DATA) {
- message.setMessageType(MessageType.BULK);
- } // end-if
- message.setSessionType(serviceType);
- message.setSessionID((byte)packet.getSessionId());
- //If it is WiPro 2.0 it must have binary header
- if (version > 1) {
- BinaryFrameHeader binFrameHeader = BinaryFrameHeader.
- parseBinaryHeader(packet.getPayload());
- if(binFrameHeader == null) {
- return null;
- }
- message.setVersion((byte) version);
- message.setRPCType(binFrameHeader.getRPCType());
- message.setFunctionID(binFrameHeader.getFunctionID());
- message.setCorrID(binFrameHeader.getCorrID());
- if (binFrameHeader.getJsonSize() > 0){
- message.setData(binFrameHeader.getJsonData());
- }
- if (binFrameHeader.getBulkData() != null){
- message.setBulkData(binFrameHeader.getBulkData());
- }
- } else {
- message.setData(packet.getPayload());
- }
- Hashtable<String, Object> hash = new Hashtable<String, Object>();
- if (packet.getVersion() > 1) {
- Hashtable<String, Object> hashTemp = new Hashtable<String, Object>();
-
- hashTemp.put(RPCMessage.KEY_CORRELATION_ID, message.getCorrID());
- if (message.getJsonSize() > 0) {
- final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());
- hashTemp.put(RPCMessage.KEY_PARAMETERS, mhash);
- }
-
- String functionName = FunctionID.getFunctionName(message.getFunctionID());
- if (functionName != null) {
- hashTemp.put(RPCMessage.KEY_FUNCTION_NAME, functionName);
- } else {
- return null;
- }
- if (message.getRPCType() == 0x00) {
- hash.put(RPCMessage.KEY_REQUEST, hashTemp);
- } else if (message.getRPCType() == 0x01) {
- hash.put(RPCMessage.KEY_RESPONSE, hashTemp);
- } else if (message.getRPCType() == 0x02) {
- hash.put(RPCMessage.KEY_NOTIFICATION, hashTemp);
- }
- if (message.getBulkData() != null) hash.put(RPCStruct.KEY_BULK_DATA, message.getBulkData());
- } else {
- final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());
- hash = mhash;
- }
- return hash;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java b/sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
deleted file mode 100644
index 5e8bba95c..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package com.smartdevicelink.util;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.net.HttpURLConnection;
-import java.net.URL;
-
-import android.os.AsyncTask;
-import android.util.Log;
-
-public class HttpRequestTask extends AsyncTask<String, String, String> {
- private static final String TAG = "Http Request Task";
-
- public static final String REQUEST_TYPE_POST = "POST";
- public static final String REQUEST_TYPE_GET = "GET";
- public static final String REQUEST_TYPE_DELETE = "DELETE";
-
- HttpRequestTaskCallback cb;
-
- /**
- * @param HttpRequestTaskCallback callback for when this task finishes
- * <br><br><b> - When calling execute, params as followed: </b><br>
- * 1. Url String<br>
- * 2. Request type (Defined in this class) REQUEST_TYPE_POST, REQUEST_TYPE_GET, REQUEST_TYPE_DELETE<br>
- * 3. (Optional) Data to be sent. <br>
- * 4. (Optional) Content Type Default will be application/json<br>
- * 5. (Optional) Accept Type default will be application/json
- *
- */
- public HttpRequestTask( HttpRequestTaskCallback hcb){
- this.cb = hcb;
- }
-
- @Override
- protected String doInBackground(String... params) {
- int length = params.length;
- String urlString = params[0];
- String request_type = params[1];
-
- //Grab and set data to be written if included
- String data;
- if(length>2){
- data = params[2];
- }else{
- data = null;
- }
-
- //Grab and set content type for the header if included
- String contentType;
- if(length>3){
- contentType = params[3];
- }else{
- contentType = "application/json";
- }
- //Grab and set accept type for the header if included
- String acceptType;
- if(length>4){
- acceptType = params[4];
- }else{
- acceptType = "application/json";
- }
-
- if(urlString == null || request_type == null){
- Log.e(TAG, "Can't process request, param error");
- if(cb!=null){
- cb.httpFailure(-1);
- cb = null;
- }
- return "Error";
- }
-
- HttpURLConnection urlConnection = null;
- BufferedReader reader = null;
- try {
- URL url = new URL(urlString);
- urlConnection = (HttpURLConnection) url.openConnection();
- urlConnection.setDoOutput(true);
- urlConnection.setRequestMethod(request_type);
- urlConnection.setRequestProperty("Content-Type", contentType);
- urlConnection.setRequestProperty("Accept", acceptType);
- //If we have data, we should write it out
- if(data !=null){
- Writer writer = new BufferedWriter(new OutputStreamWriter(urlConnection.getOutputStream(), "UTF-8"));
- writer.write(data);
- writer.close();
- }
- InputStream inputStream = urlConnection.getInputStream();
-
- int responseCode = urlConnection.getResponseCode();
- if (responseCode == 200) { //Success
- //input stream
- StringBuffer buffer = new StringBuffer();
- if (inputStream == null) {
- // Nothing to do.
- if(cb!=null){
- cb.httpCallComplete(null);
- cb = null;
- }
- return null;
- }
- reader = new BufferedReader(new InputStreamReader(inputStream));
-
- String inputLine;
- while ((inputLine = reader.readLine()) != null)
- buffer.append(inputLine + "\n");
- if (buffer.length() == 0) {
- // Stream was empty. No point in parsing.
- if(cb!=null){
- cb.httpCallComplete(null);
- cb = null;
- }
- return null;
- }
- String response = null;
-
- response = buffer.toString();
- //send to post execute
- if(cb!=null){
- cb.httpCallComplete(response);
- cb = null;
- }
- return response;
- }else{
- if(cb!=null){
- cb.httpFailure(responseCode);
- cb = null;
- }
- Log.e(TAG, "Failed to download file - " + responseCode);
- return null;
- }
-
-
- } catch (IOException e) {
- e.printStackTrace();
- } catch (NullPointerException e){ // Only to catch error in urlConnection.getOutputStream() - when servers are down
- e.printStackTrace();
- urlConnection = null;
- }
- finally {
- if (urlConnection != null) {
- urlConnection.disconnect();
- }
- if (reader != null) {
- try {
- reader.close();
- } catch (final IOException e) {
- Log.e(TAG, "Error closing stream", e);
- }
- }
- if(cb!=null){
- cb.httpFailure(-1);
- }
- }
- return null;
- }
-
- /**
- * Callback interface for HTTP requests.
- * @author Joey Grover
- *
- */
- public interface HttpRequestTaskCallback{
- /**
- * Called when HTTP request is successfully completed.
- * @param response The response to the HTTP request.
- */
- public abstract void httpCallComplete(String response);
- /**
- * Called when HTTP request failed.
- * @param statusCode The HTTP failure code.
- */
- public abstract void httpFailure(int statusCode);
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java b/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java
deleted file mode 100644
index d0752e008..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.smartdevicelink.util;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-
-public class HttpUtils{
-
- public static Bitmap downloadImage(String urlStr) throws IOException{
- URL url = new URL(urlStr);
- URLConnection connection = url.openConnection();
- BufferedInputStream bis = new BufferedInputStream(connection.getInputStream());
- Bitmap result = BitmapFactory.decodeStream(bis);
- bis.close();
- return result;
- }
-
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/IConsole.java b/sdl_android/src/main/java/com/smartdevicelink/util/IConsole.java
deleted file mode 100644
index 8d6d4a0f1..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/IConsole.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.smartdevicelink.util;
-
-
-public interface IConsole {
- void logInfo(String msg);
- void logError(String msg);
- void logError(String msg, Throwable ex);
- void logRPCSend(String rpcMsg);
- void logRPCReceive(String rpcMsg);
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/NativeLogTool.java b/sdl_android/src/main/java/com/smartdevicelink/util/NativeLogTool.java
deleted file mode 100644
index c89b970dc..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/NativeLogTool.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package com.smartdevicelink.util;
-
-import android.util.Log;
-
-import com.smartdevicelink.proxy.SdlProxyBase;
-
-public class NativeLogTool {
-
- static private boolean logToSystemEnabled = true;
- private static final int ChunkSize = 4000;
-
- public enum LogTarget {
- Info
- ,Warning
- ,Error;
-
- public static LogTarget valueForString (String value) {
- try{
- return valueOf(value);
- } catch(Exception e) {
- return null;
- }
- }
- }
-
- public static void setEnableState(boolean en) {
- logToSystemEnabled = en;
- } // end-method
-
- public static boolean isEnabled() {
- return logToSystemEnabled;
- } // end-method
-
- public static boolean logInfo(String message) {
- return logInfo(SdlProxyBase.TAG, message);
- }
-
- public static boolean logInfo(String tag, String message) {
- if (logToSystemEnabled) {
- return log(LogTarget.Info, tag, message);
- }
- return false;
- }
-
- public static boolean logWarning(String message) {
- return logWarning(SdlProxyBase.TAG, message);
- }
-
- public static boolean logWarning(String tag, String message) {
- if (logToSystemEnabled) {
- return log(LogTarget.Warning, tag, message);
- }
- return false;
- }
-
- public static boolean logError(String message) {
- return logError(SdlProxyBase.TAG, message);
- }
-
- public static boolean logError(String tag, String message) {
- if (logToSystemEnabled) {
- return log(LogTarget.Error, tag, message);
- }
- return false;
- }
-
- public static boolean logError(String message, Throwable t) {
- return logError(SdlProxyBase.TAG, message, t);
- }
-
- public static boolean logError(String tag, String message, Throwable t) {
- // If the call to logError is passed a throwable, write directly to the system log
- if (logToSystemEnabled) {
- Log.e(tag, message, t);
- }
- return logToSystemEnabled;
- }
-
- private static boolean log(LogTarget ltarg, String source, String logMsg) {
- // Don't log empty messages
- if (logMsg == null || logMsg.length() == 0) {
- return false;
- }
-
- int bytesWritten = 0;
- int substrSize = 0;
- String tag = source;
- String chunk = null;
- try {
- for (int idx=0;idx < logMsg.length();idx += substrSize) {
- substrSize = Math.min(ChunkSize, logMsg.length() - idx);
- chunk = logMsg.substring(idx, idx + substrSize);
- switch (ltarg) {
- case Info:
- bytesWritten = Log.i(tag, chunk);
- break;
- case Warning:
- bytesWritten = Log.w(tag, chunk);
- break;
- case Error:
- bytesWritten = Log.e(tag, chunk);
- break;
- }
- if (bytesWritten < chunk.length()) {
- Log.e(SdlProxyBase.TAG, "Calling Log.e: msg length=" + chunk.length() + ", bytesWritten=" + bytesWritten);
- }
- }
- } catch (Exception ex) {
- Log.e(SdlProxyBase.TAG, "Failure writing " + ltarg.name() + " fragments to android log:" + ex.toString());
- return false;
- }
- return true;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java b/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java
deleted file mode 100644
index 38e881b60..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2018 Livio, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Livio Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.smartdevicelink.util;
-
-import android.content.ComponentName;
-import android.content.Intent;
-import android.content.pm.PackageInfo;
-import android.content.pm.ResolveInfo;
-import android.os.Bundle;
-import android.util.Log;
-
-import java.util.Comparator;
-import java.util.Set;
-
-/**
- * Created by Joey Grover on 2/2/18.
- */
-
-public class SdlAppInfo {
- private static final String TAG = "SdlAppInfo";
-
- //FIXME we shouldn't be duplicating constants, but this currently keeps us from needing a context instance.
- private static final String SDL_ROUTER_VERSION_METADATA = "sdl_router_version";
- private static final String SDL_CUSTOM_ROUTER_METADATA = "sdl_custom_router";
-
-
- String packageName;
- ComponentName routerServiceComponentName;
- int routerServiceVersion = 4; //We use this as a default and assume if the number doens't exist in meta data it is because the app hasn't updated.
- boolean isCustomRouterService = false;
- long lastUpdateTime;
-
-
- public SdlAppInfo(ResolveInfo resolveInfo, PackageInfo packageInfo){
- if(resolveInfo.serviceInfo != null){
-
- this.packageName = resolveInfo.serviceInfo.packageName;
- this.routerServiceComponentName = new ComponentName(resolveInfo.serviceInfo.packageName, resolveInfo.serviceInfo.name);
-
- Bundle metadata = resolveInfo.serviceInfo.metaData;
- if(metadata != null) {
-
- if (metadata.containsKey(SDL_ROUTER_VERSION_METADATA)){
- this.routerServiceVersion = metadata.getInt(SDL_ROUTER_VERSION_METADATA);
- }
-
- if (metadata.containsKey(SDL_CUSTOM_ROUTER_METADATA)) {
- this.isCustomRouterService = metadata.getBoolean(SDL_CUSTOM_ROUTER_METADATA);
- }
- } else {
- Log.w(TAG, packageName + " has not supplied metadata with their router service!");
- }
- }
-
- if(packageInfo != null){
- this.lastUpdateTime = packageInfo.lastUpdateTime;
- if(this.lastUpdateTime <= 0){
- this.lastUpdateTime = packageInfo.firstInstallTime;
- }
- }
- }
-
- public int getRouterServiceVersion() {
- return routerServiceVersion;
- }
-
- public boolean isCustomRouterService() {
- return isCustomRouterService;
- }
-
-
- public ComponentName getRouterServiceComponentName() {
- return routerServiceComponentName;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("-------- Sdl App Info ------\n");
-
- builder.append("Package Name: ");
- builder.append(packageName);
-
- builder.append("\nRouter Service: ");
- builder.append(this.routerServiceComponentName.getClassName());
-
- builder.append("\nRouter Service Version: ");
- builder.append(this.routerServiceVersion);
-
- builder.append("\nCustom Router Service?: ");
- builder.append(this.isCustomRouterService);
-
- builder.append("\nLast updated: ");
- builder.append(this.lastUpdateTime);
-
- builder.append("\n-------- Sdl App Info End------");
-
- return builder.toString();
- }
-
- /**
- * This comparator will sort a list to find the best router service to start out of the known SDL enabled apps
- *
- */
- public static class BestRouterComparator implements Comparator<SdlAppInfo>{
-
- @Override
- public int compare(SdlAppInfo one, SdlAppInfo two) {
- if(one != null){
- if(two != null){
- if(one.isCustomRouterService){
- if(two.isCustomRouterService){
- return 0;
- }else{
- return 1;
- }
- }else if(two.isCustomRouterService){
- return -1;
-
- }//else, do nothing. Move to version check
-
- int versionCompare = two.routerServiceVersion - one.routerServiceVersion;
-
- if(versionCompare == 0){ //Versions are equal so lets use the one that has been updated most recently
- int updateTime = (int)(two.lastUpdateTime - one.lastUpdateTime);
- if(updateTime == 0){
- //This is arbitrary, but we want to ensure all lists are sorted in the same order
- return one.routerServiceComponentName.getPackageName().compareTo(two.routerServiceComponentName.getPackageName());
- }else{
- return updateTime;
- }
- }else{
- return versionCompare;
- }
-
- }else{
- return -1;
- }
- }else{
- if(two != null){
- return 1;
- }
- }
- return 0;
- }
-
-
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java b/sdl_android/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java
deleted file mode 100644
index 0b47a59cd..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/SdlDataTypeConverter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.smartdevicelink.util;
-
-/**
- * This is a utility class to aid in handling values stored in the RPC classes.
- */
-public class SdlDataTypeConverter {
-
- /**
- * Converts values that are retrieved from an RPC parameters Hashtable as an
- * Object into the standard number value of the mobile API, Double.
- *
- * @param originalValue The value retrieved from an RPC parameters Hashtable.
- * @return The Double representation of an integer or double value stored in
- * the Object, or null if the value could not be converted.
- */
- public static Double objectToDouble(Object originalValue) {
-
- if (originalValue == null) {
- return null;
- }
-
- Double result = null;
-
- // Uses reflection to determine if the object is a valid type.
- if (originalValue instanceof Integer) {
- result = ((Integer) originalValue).doubleValue();
- } else if (originalValue instanceof Float){
- result = ((Float) originalValue).doubleValue();
- } else if (originalValue instanceof Double){
- result = (Double) originalValue;
- }
-
- return result;
- }
-
- /**
- * Converts values that are retrieved from an RPC parameters Hashtable as an
- * Object into the standard number value of the mobile API, Float.
- *
- * @param originalValue The value retrieved from an RPC parameters Hashtable.
- * @return The Float representation of an integer or float value stored in
- * the Object, or null if the value could not be converted.
- */
- public static Float objectToFloat(Object originalValue) {
-
- if (originalValue == null) {
- return null;
- }
-
- Float result = null;
-
- // Uses reflection to determine if the object is a valid type.
- if (originalValue instanceof Integer) {
- result = ((Integer) originalValue).floatValue();
- } else if (originalValue instanceof Double){
- result = ((Double) originalValue).floatValue();
- } else if (originalValue instanceof Float){
- result = (Float) originalValue;
- }
-
- return result;
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java b/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java
deleted file mode 100644
index ba19310e8..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package com.smartdevicelink.util;
-
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ResolveInfo;
-import android.os.Handler;
-import android.os.Looper;
-import android.util.Log;
-
-import com.smartdevicelink.transport.SdlRouterService;
-
-import java.util.HashMap;
-import java.util.Vector;
-
-import static com.smartdevicelink.transport.TransportConstants.BIND_LOCATION_CLASS_NAME_EXTRA;
-import static com.smartdevicelink.transport.TransportConstants.BIND_LOCATION_PACKAGE_NAME_EXTRA;
-import static com.smartdevicelink.transport.TransportConstants.SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME;
-
-/**
- * Created by Joey Grover on 8/18/17.
- */
-
-public class ServiceFinder {
- public static final String TAG = ServiceFinder.class.getSimpleName();
-
- private static final int TIMEOUT = 1000;
- final String receiverLocation;
- final Context context;
- final ServiceFinderCallback callback;
- final Vector<ComponentName> services;
- final HashMap<String, ResolveInfo> sdlMultiMap;
- final Handler timeoutHandler;
- final Runnable timeoutRunnable;
-
-
- public ServiceFinder(Context context, String packageName, final ServiceFinderCallback callback) {
- this.receiverLocation = packageName + ".ServiceFinder";
- this.context = context.getApplicationContext();
- this.callback = callback;
- this.services = new Vector<>();
-
- this.sdlMultiMap = AndroidTools.getSdlEnabledApps(context, packageName);
-
- this.context.registerReceiver(mainServiceReceiver, new IntentFilter(this.receiverLocation));
-
- timeoutRunnable = new Runnable() {
- @Override
- public void run() {
- onFinished();
- }
- };
- timeoutHandler = new Handler(Looper.getMainLooper());
- timeoutHandler.postDelayed(timeoutRunnable, TIMEOUT + (50 * packageName.length()));
-
- //Send out our broadcast
- context.sendBroadcast(createQueryIntent(this.receiverLocation));
-
-
- }
-
- BroadcastReceiver mainServiceReceiver = new BroadcastReceiver() {
- private final Object LIST_LOCK = new Object();
-
- @Override
- public void onReceive(Context context, Intent intent) {
- Log.d(TAG, "Received intent " + intent);
- if (intent != null) {
- String packageName = intent.getStringExtra(BIND_LOCATION_PACKAGE_NAME_EXTRA);
- String className = intent.getStringExtra(BIND_LOCATION_CLASS_NAME_EXTRA);
- Log.d(TAG, "Received intent from package: " + packageName + ". Classname: " + className);
- synchronized (LIST_LOCK) {
- //Add to running services
- services.add(new ComponentName(packageName, className));
- //Remove from our waiting for response list
- sdlMultiMap.remove(packageName);
-
- //If list is empty, return to callback and unregister
- if (sdlMultiMap.isEmpty() && callback != null) {
- timeoutHandler.removeCallbacks(timeoutRunnable);
- onFinished();
- }
- }
- }
- }
- };
-
- private void onFinished() {
- if (callback != null) {
- callback.onComplete(services);
- }
- context.unregisterReceiver(mainServiceReceiver);
-
- }
-
-// /**
-// * Get all SDL enabled apps. If the package name is null, it will return all apps. However, if the package name is included, the
-// * resulting hash map will not include the app with that package name.
-// *
-// * @param context
-// * @param packageName
-// * @return
-// */
-// public static HashMap<String, ResolveInfo> getSdlEnabledApps(Context context, String packageName) {
-// Intent intent = new Intent(TransportConstants.START_ROUTER_SERVICE_ACTION);
-// PackageManager manager = context.getPackageManager();
-// List<ResolveInfo> infos = manager.queryBroadcastReceivers(intent, 0);
-// HashMap<String, ResolveInfo> sdlMultiMap = new HashMap<String, ResolveInfo>();
-// for (ResolveInfo info : infos) {
-// //Log.d(TAG, "Sdl enabled app: " + info.activityInfo.packageName);
-// if (info.activityInfo.applicationInfo.packageName.equals(packageName)) {
-// //Log.d(TAG, "Ignoring my own package");
-// continue;
-// }
-//
-// sdlMultiMap.put(info.activityInfo.packageName, info);
-// try {
-// ServiceInfo[] services = manager.getPackageInfo(info.activityInfo.applicationInfo.packageName, PackageManager.GET_SERVICES).services;
-// for (int i = 0; i < services.length; i++) {
-// Log.d(TAG, "Found : " + services[i].name);
-// }
-// } catch (PackageManager.NameNotFoundException e) {
-// e.printStackTrace();
-// }
-// }
-// return sdlMultiMap;
-// }
-
- private static Intent createQueryIntent(String receiverLocation) {
- Intent intent = new Intent();
- intent.setAction(SdlRouterService.REGISTER_WITH_ROUTER_ACTION);
- intent.putExtra(SEND_PACKET_TO_APP_LOCATION_EXTRA_NAME, receiverLocation);
- intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);
- return intent;
- }
-
- public interface ServiceFinderCallback {
- void onComplete(Vector<ComponentName> routerServices);
- }
-}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/Version.java b/sdl_android/src/main/java/com/smartdevicelink/util/Version.java
deleted file mode 100644
index 78eac8db4..000000000
--- a/sdl_android/src/main/java/com/smartdevicelink/util/Version.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.smartdevicelink.util;
-
-
-public class Version {
-
- final int major,minor,patch;
-
- public Version(){
- major = 0;
- minor = 0;
- 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){
- throw new IllegalArgumentException("Incorrect version string format");
- }
- major = Integer.valueOf(versions[0]);
- minor = Integer.valueOf(versions[1]);
- patch = Integer.valueOf(versions[2]);
-
- }
-
- public int getMajor() {
- return major;
- }
-
- public int getMinor() {
- return minor;
- }
-
- public int getPatch() {
- return patch;
- }
-
- /**
- * Method to test if this instance of Version is newer than the supplied one.
- * @param version the version to check against
- * @return 1 if this instance is newer, -1 if supplied version is newer, and 0 if they are equal
- */
- public int isNewerThan(Version version){
- if(this.major > version.major){
- return 1;
- }else if(this.major == version.major){
- if(this.minor > version.minor){
- return 1;
- } else if(this.minor == version.minor){
- if(this.patch > version.patch){
- return 1;
- }else if(this.patch == version.patch){
- return 0;
- }
- }
- }
- return -1;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append(major);
- builder.append(".");
- builder.append(minor);
- builder.append(".");
- builder.append(patch);
- return builder.toString();
- }
-}
diff --git a/sdl_android/src/main/res/values/sdl.xml b/sdl_android/src/main/res/values/sdl.xml
deleted file mode 100644
index ca8b15851..000000000
--- a/sdl_android/src/main/res/values/sdl.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?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">8</integer>
-
- <string name="sdl_router_service_is_custom_name" translatable="false">sdl_custom_router</string>
-</resources>
diff --git a/sdl_android/src/test/java/com/smartdevicelink/ExampleUnitTest.java b/sdl_android/src/test/java/com/smartdevicelink/ExampleUnitTest.java
deleted file mode 100644
index 1a82a259f..000000000
--- a/sdl_android/src/test/java/com/smartdevicelink/ExampleUnitTest.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.smartdevicelink;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
- @Test
- public void addition_isCorrect() throws Exception {
- assertEquals(4, 2 + 2);
- }
-} \ No newline at end of file
diff --git a/sdl_android/src/test/java/com/smartdevicelink/haptic/HapticInterfaceManagerTest.java b/sdl_android/src/test/java/com/smartdevicelink/haptic/HapticInterfaceManagerTest.java
deleted file mode 100644
index 87c547bb1..000000000
--- a/sdl_android/src/test/java/com/smartdevicelink/haptic/HapticInterfaceManagerTest.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/***************************************************************************************************
- * Copyright © 2017 Xevo Inc.
- * Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of conditions
- * and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
- * endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
- * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- **************************************************************************************************/
-package com.smartdevicelink.haptic;
-
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.HapticRect;
-import com.smartdevicelink.proxy.rpc.Rectangle;
-import com.smartdevicelink.proxy.rpc.SendHapticData;
-
-import junit.framework.TestCase;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.mockito.stubbing.Answer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.mockito.Mockito.*;
-
-/**
- * Created on 9/26/2017.
- */
-@RunWith(MockitoJUnitRunner.Strict.class)
-public class HapticInterfaceManagerTest extends TestCase {
- @Mock
- private ISdl mockProxy;
-
- @Captor
- private ArgumentCaptor<SendHapticData> captor;
-
- private HapticInterfaceManager hapticMgr;
-
- @Before
- public void setUp() throws Exception {
- hapticMgr = new HapticInterfaceManager(mockProxy);
- }
-
- @After
- public void tearDown() throws Exception {
- hapticMgr = null;
- }
-
- @Test
- public void testSetHapticData() throws Exception {
- List<HapticRect> rects = new ArrayList<>();
- Rectangle rect = new Rectangle();
- rect.setX(10f);
- rect.setY(10f);
- rect.setWidth(50f);
- rect.setHeight(20f);
- HapticRect hRect = new HapticRect();
- hRect.setRect(rect);
- rects.add(hRect);
- hapticMgr.setHapticData(rects);
- verify(mockProxy).sendRPCRequest(any(SendHapticData.class));
- }
-
- @Test
- public void testRefreshHapticData() throws Exception {
- View root = createViews();
- hapticMgr.refreshHapticData(root);
- verify(mockProxy).sendRPCRequest(captor.capture());
- SendHapticData data = captor.getValue();
- assertNotNull("SendHapticData RPC", data);
- List<HapticRect> list = data.getHapticRectData();
- assertNotNull("List", list);
- assertEquals("Haptic Rects", 4, list.size());
- }
-
- @Test
- public void testRefreshHapticDataNull() throws Exception {
- hapticMgr.refreshHapticData(null);
- verify(mockProxy).sendRPCRequest(captor.capture());
- SendHapticData data = captor.getValue();
- assertNotNull("SendHapticData RPC", data);
- List<HapticRect> list = data.getHapticRectData();
- assertNull("List", list);
- }
-
- @Test
- public void testRefreshWithUserData() throws Exception {
- List<HapticRect> rects = new ArrayList<>();
- Rectangle rect = new Rectangle();
- rect.setX(10f);
- rect.setY(10f);
- rect.setWidth(50f);
- rect.setHeight(20f);
- HapticRect hRect = new HapticRect();
- hRect.setRect(rect);
- rects.add(hRect);
- hapticMgr.setHapticData(rects);
- verify(mockProxy).sendRPCRequest(any(SendHapticData.class));
-
- View root = createViews();
- hapticMgr.refreshHapticData(root);
- verify(mockProxy, times(1)).sendRPCRequest(any(SendHapticData.class));
- }
-
- private View createViews() {
-
- View view = mock(View.class);
-
- ViewGroup parent1 = mock(ViewGroup.class);
- ViewGroup parent2 = mock(ViewGroup.class);
-
- when(parent1.getChildCount()).thenReturn(5);
-
- when(parent1.getChildAt(0)).thenReturn(view);
- when(parent1.getChildAt(1)).thenReturn(view);
- when(parent1.getChildAt(2)).thenReturn(view);
- when(parent1.getChildAt(3)).thenReturn(parent2);
- when(parent1.getChildAt(4)).thenReturn(view);
-
- when(parent2.getChildCount()).thenReturn(2);
- when(parent2.getChildAt(0)).thenReturn(view);
- when(parent2.getChildAt(1)).thenReturn(view);
-
- when(view.isFocusable()).then(new Answer<Boolean>() {
- private int count = 0;
-
- @Override
- public Boolean answer(InvocationOnMock invocation) throws Throwable {
- int curCount = count++;
- return (curCount == 1) || (curCount == 2) || (curCount == 3);
- }
- });
- when(view.isClickable()).then(new Answer<Boolean>() {
- private int count = 0;
-
- @Override
- public Boolean answer(InvocationOnMock invocation) throws Throwable {
- int curCount = count++;
- return (curCount == 0) || (curCount == 3);
- }
- });
-
- return parent1;
- }
-}
diff --git a/third_party.md b/third_party.md
index 667e841a9..aed363637 100644
--- a/third_party.md
+++ b/third_party.md
@@ -1,9 +1,11 @@
-### SDL ANDROID
+### Introduction
-Copyright (C) 2018 SmartDeviceLink Consortium, Inc.
+This file is broken into three Parts: SDL Base, SDL Android, and SDL Java. SDL Android and SDL Java are sub projects of SDL Base. Additionally, SDL Java contains two sub-projects: SDL JavaSE and SDL JavaEE.
+
+## SDL BASE
#### License
-Copyright (c) 2017 - 2018, SmartDeviceLink Consortium, Inc.
+Copyright (c) 2017-2019, SmartDeviceLink Consortium, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -26,14 +28,62 @@ original licenses.
The third party software included and used by this project is:
+**Android Open Source Project**
+
+* Copyright (C) 2006, 2008 & 2009 The Android Open Source Project
+* Licensed under Apache License, Version 2.0
+* The library is included in the MultiplexBluetoothTransport file
+* The classes AsyncTask, Parcel, Parcelable, and Log are also utilized in this project. These files HAVE BEEN MODIFIED from their original forms for use in this project. This message is in accordance with the Apache License, Version 2.0 section 4.b Redistribution.
+* See [https://services.gradle.org/distributions/gradle-4.4-all.zip](https://services.gradle.org/distributions/gradle-4.4-all.zip)
+
+## SDL ANDROID
+
+SDL Android inherits any license defined in SDL BASE.
+
+#### Third Party Licenses
+
+Both the source and binary distributions of this software contain
+some third party software. All the third party software included
+or linked is redistributed under the terms and conditions of their
+original licenses.
+
+The third party software included and used by this project is:
+
**Gradle 4.4**
* Licensed under Apache License, Version 2.0
* See [https://services.gradle.org/distributions/gradle-4.4-all.zip](https://services.gradle.org/distributions/gradle-4.4-all.zip)
-**Android 2009**
+## SDL Java
+
+### SDL JavaSE
+
+SDL JavaSE inherits any license defined in SDL BASE.
+
+#### Third Party Licenses
+
+Both the source and binary distributions of this software contain
+some third party software. All the third party software included
+or linked is redistributed under the terms and conditions of their
+original licenses.
+
+The third party software included and used by this project is:
+
+**Gradle 4.4**
-* Copyright (C) 2009 The Android Open Source Project
* Licensed under Apache License, Version 2.0
-* The library is included in the MultiplexBluetoothTransport file
-* See [https://services.gradle.org/distributions/gradle-4.4-all.zip](https://services.gradle.org/distributions/gradle-4.4-all.zip) \ No newline at end of file
+* See [https://services.gradle.org/distributions/gradle-4.4-all.zip](https://services.gradle.org/distributions/gradle-4.4-all.zip)
+
+**BSON - MongoDB**
+
+* `org.mongodb:bson`
+* Licensed under Apache License, Version 2.0
+* See [https://mvnrepository.com/artifact/org.mongodb/bson/3.10.1](https://mvnrepository.com/artifact/org.mongodb/bson/3.10.1)
+
+
+### SDL JavaEE
+
+SDL JavaEE inherits any license defined in SDL JavaSE.
+
+
+